if_ppp.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. #ifndef _NETINET_IF_PPP_H_
  2. #define _NETINET_IF_PPP_H_
  3. /*
  4. * <MFS> Modified for Streamit
  5. * use PPP-stack from 3.9.6
  6. *
  7. * Copyright (C) 2001-2003 by egnite Software GmbH. All rights reserved.
  8. *
  9. * Redistribution and use in source and binary forms, with or without
  10. * modification, are permitted provided that the following conditions
  11. * are met:
  12. *
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions and the following disclaimer.
  15. * 2. Redistributions in binary form must reproduce the above copyright
  16. * notice, this list of conditions and the following disclaimer in the
  17. * documentation and/or other materials provided with the distribution.
  18. * 3. Neither the name of the copyright holders nor the names of
  19. * contributors may be used to endorse or promote products derived
  20. * from this software without specific prior written permission.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
  23. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  24. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  25. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
  26. * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  27. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  28. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  29. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  30. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  31. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  32. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  33. * SUCH DAMAGE.
  34. *
  35. * For additional information see http://www.ethernut.de/
  36. *
  37. * -
  38. * Copyright (C) 2002 by Call Direct Cellular Solutions Pty. Ltd. All rights reserved.
  39. *
  40. * Redistribution and use in source and binary forms, with or without
  41. * modification, are permitted provided that the following conditions
  42. * are met:
  43. *
  44. * 1. Redistributions of source code must retain the above copyright
  45. * notice, this list of conditions and the following disclaimer.
  46. * 2. Redistributions in binary form must reproduce the above copyright
  47. * notice, this list of conditions and the following disclaimer in the
  48. * documentation and/or other materials provided with the distribution.
  49. * 3. Neither the name of the copyright holders nor the names of
  50. * contributors may be used to endorse or promote products derived
  51. * from this software without specific prior written permission.
  52. *
  53. * THIS SOFTWARE IS PROVIDED BY CALL DIRECT CELLULAR SOLUTIONS AND CONTRIBUTORS
  54. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  55. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  56. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CALL DIRECT
  57. * CELLULAR SOLUTIONS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  58. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  59. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  60. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  61. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  62. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  63. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  64. * SUCH DAMAGE.
  65. *
  66. * For additional information see http://www.calldirect.com.au/
  67. * -
  68. *
  69. * Portions are
  70. * Copyright (c) 1989 by Carnegie Mellon University.
  71. * All rights reserved.
  72. *
  73. * Redistribution and use in source and binary forms are permitted
  74. * provided that the above copyright notice and this paragraph are
  75. * duplicated in all such forms and that any documentation,
  76. * advertising materials, and other materials related to such
  77. * distribution and use acknowledge that the software was developed
  78. * by Carnegie Mellon University. The name of the
  79. * University may not be used to endorse or promote products derived
  80. * from this software without specific prior written permission.
  81. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  82. * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  83. * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  84. */
  85. /*
  86. * $Log: if_ppp.h,v $
  87. * Revision 1.2 2003/08/14 15:05:18 haraldkipp
  88. * Caller will do ID increment
  89. *
  90. * Revision 1.1.1.1 2003/05/09 14:41:14 haraldkipp
  91. * Initial using 3.2.1
  92. *
  93. * Revision 1.2 2003/05/06 18:46:33 harald
  94. * Cleanup
  95. *
  96. * Revision 1.1 2003/03/31 14:57:20 harald
  97. * *** empty log message ***
  98. *
  99. */
  100. #include <sys/types.h>
  101. #include <net/if_var.h>
  102. /*!
  103. * \file netinet/if_ppp.h
  104. * \brief PPP interface definitions.
  105. *
  106. */
  107. #define MAX_NAK_LOOPS 10
  108. #define MIN_LCPMRU 128
  109. #define PPP_MRU 1500
  110. /*
  111. * Protocol field values.
  112. */
  113. #define PPP_IP 0x0021 /* Internet Protocol */
  114. #define PPP_AT 0x0029 /* AppleTalk Protocol */
  115. #define PPP_IPX 0x002b /* IPX protocol */
  116. #define PPP_VJC_COMP 0x002d /* VJ compressed TCP */
  117. #define PPP_VJC_UNCOMP 0x002f /* VJ uncompressed TCP */
  118. #define PPP_IPV6 0x0057 /* Internet Protocol Version 6 */
  119. #define PPP_COMP 0x00fd /* compressed packet */
  120. #define PPP_IPCP 0x8021 /* IP Control Protocol */
  121. #define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */
  122. #define PPP_IPXCP 0x802b /* IPX Control Protocol */
  123. #define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */
  124. #define PPP_CCP 0x80fd /* Compression Control Protocol */
  125. #define PPP_LCP 0xc021 /* Link Control Protocol */
  126. #define PPP_PAP 0xc023 /* Password Authentication Protocol */
  127. #define PPP_LQR 0xc025 /* Link Quality Report protocol */
  128. #define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */
  129. #define PPP_CBCP 0xc029 /* Callback Control Protocol */
  130. /*
  131. * LCP options.
  132. */
  133. #define LCP_MRU 1 /*!< \brief Maximum Receive Unit */
  134. #define LCP_ASYNCMAP 2 /*!< \brief Async Control Character Map */
  135. #define LCP_AUTHTYPE 3 /*!< \brief Authentication Type */
  136. #define LCP_QUALITY 4 /*!< \brief Quality Protocol */
  137. #define LCP_MAGICNUMBER 5 /*!< \brief Magic Number */
  138. #define LCP_PCOMPRESSION 7 /*!< \brief Protocol Field Compression */
  139. #define LCP_ACCOMPRESSION 8 /*!< \brief Address/Control Field Compression */
  140. /*
  141. * IPCP Options.
  142. */
  143. #define IPCP_ADDRS 1 /* IP Addresses */
  144. #define IPCP_COMPRESSTYPE 2 /* Compression Type */
  145. #define IPCP_ADDR 3 /* IP Address */
  146. #define IPCP_MS_DNS1 129 /* Primary DNS value */
  147. #define IPCP_MS_WINS1 130 /* Primary WINS value */
  148. #define IPCP_MS_DNS2 131 /* Secondary DNS value */
  149. #define IPCP_MS_WINS2 132 /* Secondary WINS value */
  150. /*!
  151. * \typedef PPPHDR
  152. * \brief PPP header type.
  153. */
  154. typedef struct ppp_header {
  155. u_char address; /*!< \brief HDLC Address. */
  156. u_char control; /*!< \brief HDLC Control. */
  157. u_short prot_type; /*!< \brief Protocol type. */
  158. } PPPHDR;
  159. typedef struct xcphdr {
  160. /*!< \brief Code.
  161. */
  162. u_char xch_code;
  163. /*!< \brief Identifier
  164. */
  165. u_char xch_id;
  166. /*!< \brief Length
  167. */
  168. u_short xch_len;
  169. } XCPHDR;
  170. extern void NutLcpInput(NUTDEVICE * dev, NETBUF * nb);
  171. extern int NutLcpOutput(NUTDEVICE * dev, u_char code, u_char id, NETBUF * nb);
  172. extern void LcpTxConfReq(NUTDEVICE *dev, u_char id);
  173. extern void LcpTxProtRej(NUTDEVICE *dev, u_short protocol, NETBUF *nb);
  174. extern void NutPapInput(NUTDEVICE * dev, NETBUF * nb);
  175. extern int NutPapOutput(NUTDEVICE * dev, u_char code, u_char id, NETBUF * nb);
  176. extern void PapTxAuthReq(NUTDEVICE *dev, u_char id);
  177. extern void NutChapInput(NUTDEVICE * dev, NETBUF * nb);
  178. extern int NutChapOutput(NUTDEVICE * dev, u_char code, u_char id, NETBUF * nb);
  179. extern void NutIpcpInput(NUTDEVICE * dev, NETBUF * nb);
  180. extern int NutIpcpOutput(NUTDEVICE * dev, u_char code, u_char id, NETBUF * nb);
  181. extern void IpcpTxConfReq(NUTDEVICE *dev, u_char id);
  182. #endif