Nut/OS  4.10.3
API Reference
ppp_fsm.h
Go to the documentation of this file.
00001 #ifndef _NETINET_PPP_FSM_H_
00002 #define _NETINET_PPP_FSM_H_
00003 
00004 /*
00005  * Copyright (C) 2001-2004 by egnite Software GmbH. All rights reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  *
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in the
00015  *    documentation and/or other materials provided with the distribution.
00016  * 3. Neither the name of the copyright holders nor the names of
00017  *    contributors may be used to endorse or promote products derived
00018  *    from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
00021  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00022  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00023  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
00024  * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00025  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00026  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00027  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00028  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00029  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00030  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00031  * SUCH DAMAGE.
00032  *
00033  * For additional information see http://www.ethernut.de/
00034  *
00035  * -
00036  * Portions are
00037  * Copyright (C) 2002 by Call Direct Cellular Solutions Pty. Ltd. All rights reserved.
00038  *
00039  * Redistribution and use in source and binary forms, with or without
00040  * modification, are permitted provided that the following conditions
00041  * are met:
00042  *
00043  * 1. Redistributions of source code must retain the above copyright
00044  *    notice, this list of conditions and the following disclaimer.
00045  * 2. Redistributions in binary form must reproduce the above copyright
00046  *    notice, this list of conditions and the following disclaimer in the
00047  *    documentation and/or other materials provided with the distribution.
00048  * 3. All advertising materials mentioning features or use of this
00049  *    software must display the following acknowledgement:
00050  *
00051  *    This product includes software developed by Call Direct Cellular Solutions Pty. Ltd
00052  *    and its contributors.
00053  *
00054  * THIS SOFTWARE IS PROVIDED BY CALL DIRECT CELLULAR SOLUTIONS AND CONTRIBUTORS
00055  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00056  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00057  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CALL DIRECT
00058  * CELLULAR SOLUTIONS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00059  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00060  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00061  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00062  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00063  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00064  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00065  * SUCH DAMAGE.
00066  *
00067  * For additional information see http://www.calldirect.com.au/
00068  * -
00069  * Portions are 
00070  * Copyright (c) 1989 by Carnegie Mellon University.
00071  * All rights reserved.
00072  *
00073  * Redistribution and use in source and binary forms are permitted
00074  * provided that the above copyright notice and this paragraph are
00075  * duplicated in all such forms and that any documentation,
00076  * advertising materials, and other materials related to such
00077  * distribution and use acknowledge that the software was developed
00078  * by Carnegie Mellon University.  The name of the
00079  * University may not be used to endorse or promote products derived
00080  * from this software without specific prior written permission.
00081  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
00082  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
00083  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00084  */
00085 
00086 /*
00087  * $Log$
00088  * Revision 1.4  2008/08/11 07:00:23  haraldkipp
00089  * BSD types replaced by stdint types (feature request #1282721).
00090  *
00091  * Revision 1.3  2008/04/01 10:14:04  haraldkipp
00092  * Bug #1902993 fixed. XCPOPT must be declared packed to work on 32-bit
00093  * targets.
00094  *
00095  * Revision 1.2  2004/03/08 11:19:55  haraldkipp
00096  * HDLC functions moved to async HDLC driver.
00097  *
00098  * Revision 1.1.1.1  2003/05/09 14:41:16  haraldkipp
00099  * Initial using 3.2.1
00100  *
00101  * Revision 1.2  2003/05/06 18:46:46  harald
00102  * Cleanup
00103  *
00104  * Revision 1.1  2003/03/31 14:57:20  harald
00105  * *** empty log message ***
00106  *
00107  */
00108 
00109 #include <stdint.h>
00110 
00116 /*
00117  * Link states.
00118  */
00119 #define PPPS_INITIAL         0  
00120 #define PPPS_STARTING        1  
00121 #define PPPS_CLOSED          2  
00122 #define PPPS_STOPPED         3  
00123 #define PPPS_CLOSING         4  
00124 #define PPPS_STOPPING        5  
00125 #define PPPS_REQSENT         6  
00126 #define PPPS_ACKRCVD         7  
00127 #define PPPS_ACKSENT         8  
00128 #define PPPS_OPENED          9  
00130 #define XCP_CONFREQ          1  
00131 #define XCP_CONFACK          2  
00132 #define XCP_CONFNAK          3  
00133 #define XCP_CONFREJ          4  
00134 #define XCP_TERMREQ          5  
00135 #define XCP_TERMACK          6  
00136 #define XCP_CODEREJ          7  
00137 #define LCP_PROTREJ          8  
00138 #define LCP_ERQ              9  
00139 #define LCP_ERP             10  
00140 #define LCP_DRQ             11  
00142 /*
00143  * PAP client states.
00144  */
00145 #define PAPCS_INITIAL        0  
00146 #define PAPCS_CLOSED         1  
00147 #define PAPCS_PENDING        2  
00148 #define PAPCS_AUTHREQ        3  
00149 #define PAPCS_OPEN           4  
00150 #define PAPCS_BADAUTH        5  
00152 typedef struct __attribute__ ((packed)) {
00153     uint8_t xcpo_type;
00154     uint8_t xcpo_len;
00155     union {
00156         uint16_t us;
00157         uint32_t ul;
00158         uint8_t uc[1];
00159     } xcpo_;
00160 } XCPOPT;
00161 
00162 
00163 __BEGIN_DECLS
00164 
00165 extern void LcpOpen(NUTDEVICE * dev);
00166 extern void LcpClose(NUTDEVICE *dev);
00167 extern void LcpLowerUp(NUTDEVICE *dev);
00168 extern void LcpLowerDown(NUTDEVICE *dev);
00169 
00170 extern void PapLowerUp(NUTDEVICE *dev);
00171 extern void PapLowerDown(NUTDEVICE *dev);
00172 
00173 extern void IpcpOpen(NUTDEVICE * dev);
00174 extern void IpcpClose(NUTDEVICE * dev);
00175 extern void IpcpLowerUp(NUTDEVICE *dev);
00176 extern void IpcpLowerDown(NUTDEVICE *dev);
00177 
00178 extern void PppOpen(NUTDEVICE *dev);
00179 extern void PppClose(NUTDEVICE *dev);
00180 
00181 extern int NutPppInitStateMachine(NUTDEVICE * dev);
00182 
00183 __END_DECLS
00184 
00185 #endif
00186