00001 #ifndef _NETINET_IF_PPP_H_ 00002 #define _NETINET_IF_PPP_H_ 00003 00004 /* 00005 * Copyright (C) 2001-2003 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 * Copyright (C) 2002 by Call Direct Cellular Solutions Pty. Ltd. All rights reserved. 00037 * 00038 * Redistribution and use in source and binary forms, with or without 00039 * modification, are permitted provided that the following conditions 00040 * are met: 00041 * 00042 * 1. Redistributions of source code must retain the above copyright 00043 * notice, this list of conditions and the following disclaimer. 00044 * 2. Redistributions in binary form must reproduce the above copyright 00045 * notice, this list of conditions and the following disclaimer in the 00046 * documentation and/or other materials provided with the distribution. 00047 * 3. Neither the name of the copyright holders nor the names of 00048 * contributors may be used to endorse or promote products derived 00049 * from this software without specific prior written permission. 00050 * 00051 * THIS SOFTWARE IS PROVIDED BY CALL DIRECT CELLULAR SOLUTIONS AND CONTRIBUTORS 00052 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00053 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00054 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CALL DIRECT 00055 * CELLULAR SOLUTIONS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00056 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00057 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 00058 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 00059 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00060 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 00061 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00062 * SUCH DAMAGE. 00063 * 00064 * For additional information see http://www.calldirect.com.au/ 00065 * - 00066 * 00067 * Portions are 00068 * Copyright (c) 1989 by Carnegie Mellon University. 00069 * All rights reserved. 00070 * 00071 * Redistribution and use in source and binary forms are permitted 00072 * provided that the above copyright notice and this paragraph are 00073 * duplicated in all such forms and that any documentation, 00074 * advertising materials, and other materials related to such 00075 * distribution and use acknowledge that the software was developed 00076 * by Carnegie Mellon University. The name of the 00077 * University may not be used to endorse or promote products derived 00078 * from this software without specific prior written permission. 00079 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 00080 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 00081 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00082 */ 00083 00084 /* 00085 * $Log: if_ppp.h,v $ 00086 * Revision 1.3 2004/01/30 11:38:25 haraldkipp 00087 * Handle magic number rejects 00088 * 00089 * Revision 1.2 2003/08/14 15:05:18 haraldkipp 00090 * Caller will do ID increment 00091 * 00092 * Revision 1.1.1.1 2003/05/09 14:41:14 haraldkipp 00093 * Initial using 3.2.1 00094 * 00095 * Revision 1.2 2003/05/06 18:46:33 harald 00096 * Cleanup 00097 * 00098 * Revision 1.1 2003/03/31 14:57:20 harald 00099 * *** empty log message *** 00100 * 00101 */ 00102 00103 #include <sys/types.h> 00104 #include <net/if_var.h> 00105 00112 #define MAX_NAK_LOOPS 10 00113 #define MIN_LCPMRU 128 00114 00115 #define PPP_MRU 1500 00116 00117 00118 /* 00119 * Protocol field values. 00120 */ 00121 #define PPP_IP 0x0021 /* Internet Protocol */ 00122 #define PPP_AT 0x0029 /* AppleTalk Protocol */ 00123 #define PPP_IPX 0x002b /* IPX protocol */ 00124 #define PPP_VJC_COMP 0x002d /* VJ compressed TCP */ 00125 #define PPP_VJC_UNCOMP 0x002f /* VJ uncompressed TCP */ 00126 #define PPP_IPV6 0x0057 /* Internet Protocol Version 6 */ 00127 #define PPP_COMP 0x00fd /* compressed packet */ 00128 #define PPP_IPCP 0x8021 /* IP Control Protocol */ 00129 #define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */ 00130 #define PPP_IPXCP 0x802b /* IPX Control Protocol */ 00131 #define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */ 00132 #define PPP_CCP 0x80fd /* Compression Control Protocol */ 00133 #define PPP_LCP 0xc021 /* Link Control Protocol */ 00134 #define PPP_PAP 0xc023 /* Password Authentication Protocol */ 00135 #define PPP_LQR 0xc025 /* Link Quality Report protocol */ 00136 #define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */ 00137 #define PPP_CBCP 0xc029 /* Callback Control Protocol */ 00138 00139 00140 /* 00141 * LCP options. 00142 */ 00143 #define LCP_MRU 1 00144 #define LCP_ASYNCMAP 2 00145 #define LCP_AUTHTYPE 3 00146 #define LCP_QUALITY 4 00147 #define LCP_MAGICNUMBER 5 00148 #define LCP_PCOMPRESSION 7 00149 #define LCP_ACCOMPRESSION 8 00151 /* 00152 * IPCP Options. 00153 */ 00154 #define IPCP_ADDRS 1 /* IP Addresses */ 00155 #define IPCP_COMPRESSTYPE 2 /* Compression Type */ 00156 #define IPCP_ADDR 3 /* IP Address */ 00157 00158 #define IPCP_MS_DNS1 129 /* Primary DNS value */ 00159 #define IPCP_MS_WINS1 130 /* Primary WINS value */ 00160 #define IPCP_MS_DNS2 131 /* Secondary DNS value */ 00161 #define IPCP_MS_WINS2 132 /* Secondary WINS value */ 00162 00167 typedef struct ppp_header { 00168 u_char address; 00169 u_char control; 00170 u_short prot_type; 00171 } PPPHDR; 00172 00173 typedef struct xcphdr { 00176 u_char xch_code; 00177 00180 u_char xch_id; 00181 00184 u_short xch_len; 00185 } XCPHDR; 00186 00187 00188 extern void NutLcpInput(NUTDEVICE * dev, NETBUF * nb); 00189 extern int NutLcpOutput(NUTDEVICE * dev, u_char code, u_char id, NETBUF * nb); 00190 extern void LcpTxConfReq(NUTDEVICE *dev, u_char id, u_char rejected); 00191 extern void LcpTxProtRej(NUTDEVICE *dev, u_short protocol, NETBUF *nb); 00192 00193 extern void NutPapInput(NUTDEVICE * dev, NETBUF * nb); 00194 extern int NutPapOutput(NUTDEVICE * dev, u_char code, u_char id, NETBUF * nb); 00195 extern void PapTxAuthReq(NUTDEVICE *dev, u_char id); 00196 00197 extern void NutIpcpInput(NUTDEVICE * dev, NETBUF * nb); 00198 extern int NutIpcpOutput(NUTDEVICE * dev, u_char code, u_char id, NETBUF * nb); 00199 extern void IpcpTxConfReq(NUTDEVICE *dev, u_char id); 00200 00201 #endif 00202