1 | /*
|
---|
2 | * TINET (TCP/IP Protocol Stack)
|
---|
3 | *
|
---|
4 | * Copyright (C) 2001-2009 by Dep. of Computer Science and Engineering
|
---|
5 | * Tomakomai National College of Technology, JAPAN
|
---|
6 | *
|
---|
7 | * ä¸è¨èä½æ¨©è
|
---|
8 | ã¯ï¼ä»¥ä¸ã® (1)ï½(4) ã®æ¡ä»¶ãï¼Free Software Foundation
|
---|
9 | * ã«ãã£ã¦å
|
---|
10 | ¬è¡¨ããã¦ãã GNU General Public License ã® Version 2 ã«è¨
|
---|
11 | * è¿°ããã¦ããæ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§ã¢ï¼æ¬ã½ããã¦ã§ã¢
|
---|
12 | * ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ã使ç¨ã»è¤è£½ã»æ¹å¤ã»åé
|
---|
13 | å¸ï¼ä»¥ä¸ï¼
|
---|
14 | * å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
|
---|
15 | * (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
|
---|
16 | * 権表示ï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
|
---|
17 | * ã¹ã³ã¼ãä¸ã«å«ã¾ãã¦ãããã¨ï¼
|
---|
18 | * (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
19 | * ç¨ã§ããå½¢ã§åé
|
---|
20 | å¸ããå ´åã«ã¯ï¼åé
|
---|
21 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨
|
---|
22 | * è
|
---|
23 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
|
---|
24 | * ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
25 | * (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
26 | * ç¨ã§ããªãå½¢ã§åé
|
---|
27 | å¸ããå ´åã«ã¯ï¼æ¬¡ã®æ¡ä»¶ãæºãããã¨ï¼
|
---|
28 | * (a) åé
|
---|
29 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨è
|
---|
30 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
|
---|
31 | * ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
32 | * (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
|
---|
33 | * 害ãããï¼ä¸è¨èä½æ¨©è
|
---|
34 | ããã³TOPPERSããã¸ã§ã¯ããå
|
---|
35 | 責ãããã¨ï¼
|
---|
36 | *
|
---|
37 | * æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
|
---|
38 | ã
|
---|
39 | * ãã³TOPPERSããã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ãã®é©ç¨å¯è½æ§ã
|
---|
40 | * å«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´
|
---|
41 | * æ¥çã¾ãã¯éæ¥çã«çãããããªãæ害ã«é¢ãã¦ãï¼ãã®è²¬ä»»ãè² ããªãï¼
|
---|
42 | *
|
---|
43 | * @(#) $Id: ppp.h 270 2017-02-09 04:03:47Z coas-nagasima $
|
---|
44 | */
|
---|
45 |
|
---|
46 | /*
|
---|
47 | * Copyright (c) 1989 Carnegie Mellon University.
|
---|
48 | * All rights reserved.
|
---|
49 | *
|
---|
50 | * Redistribution and use in source and binary forms are permitted
|
---|
51 | * provided that the above copyright notice and this paragraph are
|
---|
52 | * duplicated in all such forms and that any documentation,
|
---|
53 | * advertising materials, and other materials related to such
|
---|
54 | * distribution and use acknowledge that the software was developed
|
---|
55 | * by Carnegie Mellon University. The name of the
|
---|
56 | * University may not be used to endorse or promote products derived
|
---|
57 | * from this software without specific prior written permission.
|
---|
58 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
---|
59 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
---|
60 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
---|
61 | */
|
---|
62 |
|
---|
63 | /*
|
---|
64 | * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
|
---|
65 | *
|
---|
66 | * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
|
---|
67 | *
|
---|
68 | * Redistribution and use in source and binary forms are permitted
|
---|
69 | * provided that the above copyright notice and this paragraph are
|
---|
70 | * duplicated in all such forms and that any documentation,
|
---|
71 | * advertising materials, and other materials related to such
|
---|
72 | * distribution and use acknowledge that the software was developed
|
---|
73 | * by the Internet Initiative Japan. The name of the
|
---|
74 | * IIJ may not be used to endorse or promote products derived
|
---|
75 | * from this software without specific prior written permission.
|
---|
76 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
---|
77 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
---|
78 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
---|
79 | */
|
---|
80 |
|
---|
81 | #ifndef _PPP_H_
|
---|
82 | #define _PPP_H_
|
---|
83 |
|
---|
84 | /*
|
---|
85 | * PPP ãããã®ãããã³ã«ãã£ã¼ã«ãã®å¤
|
---|
86 | */
|
---|
87 |
|
---|
88 | #define PPP_IP UINT_C(0x0021) /* IP */
|
---|
89 |
|
---|
90 | #define PPP_IPCP UINT_C(0x8021) /* IPCP */
|
---|
91 | #define PPP_CCP UINT_C(0x80fd) /* CCP */
|
---|
92 |
|
---|
93 | #define PPP_LCP UINT_C(0xc021) /* LCP */
|
---|
94 | #define PPP_PAP UINT_C(0xc023) /* PAP */
|
---|
95 | #define PPP_LQR UINT_C(0xc025) /* LQR */
|
---|
96 | #define PPP_CHAP UINT_C(0xc223) /* CHAP */
|
---|
97 |
|
---|
98 | #define GET_PPP_HDR(nbuf) ((T_PPP_HDR*)((nbuf)->buf))
|
---|
99 |
|
---|
100 | /*
|
---|
101 | * ãªã³ã¯ã®ç¶æ
|
---|
102 |
|
---|
103 | */
|
---|
104 |
|
---|
105 | #define PPP_PHASE_DEAD 0
|
---|
106 | #define PPP_PHASE_INITIALIZE 1
|
---|
107 | #define PPP_PHASE_DORMANT 2
|
---|
108 | #define PPP_PHASE_ESTABLISH 3
|
---|
109 | #define PPP_PHASE_AUTHENTICATE 4
|
---|
110 | #define PPP_PHASE_CALLBACK 5
|
---|
111 | #define PPP_PHASE_NETWORK 6
|
---|
112 | #define PPP_PHASE_TERMINATE 7
|
---|
113 | #define PPP_PHASE_HOLDOFF 8
|
---|
114 |
|
---|
115 | /*
|
---|
116 | * PPP ãªã³ã¯å¶å¾¡ (CP) ãããæ§é ä½
|
---|
117 | */
|
---|
118 |
|
---|
119 | typedef struct t_ppp_cp_hdr {
|
---|
120 | uint8_t code; /* å¶å¾¡ã³ã¼ã */
|
---|
121 | uint8_t id; /* èå¥å */
|
---|
122 | uint16_t len; /* é·ã */
|
---|
123 | } __attribute__((packed, aligned(2)))T_PPP_CP_HDR;
|
---|
124 |
|
---|
125 | #define GET_PPP_CP_HDR(nbuf) ((T_PPP_CP_HDR*)((nbuf)->buf + sizeof(T_PPP_HDR)))
|
---|
126 |
|
---|
127 | /*
|
---|
128 | * PPP ãªã³ã¯å¶å¾¡ (CP) ã®å¶å¾¡ã³ã¼ã
|
---|
129 | */
|
---|
130 |
|
---|
131 | #define PPP_VENDER UINT_C(0) /* Vender Specific */
|
---|
132 | #define PPP_CONFREQ UINT_C(1) /* Configuration Request */
|
---|
133 | #define PPP_CONFACK UINT_C(2) /* Configuration ACK */
|
---|
134 | #define PPP_CONFNAK UINT_C(3) /* Configuration NAK */
|
---|
135 | #define PPP_CONFREJ UINT_C(4) /* Configuration Reject */
|
---|
136 | #define PPP_TERMREQ UINT_C(5) /* Termination Request */
|
---|
137 | #define PPP_TERMACK UINT_C(6) /* Termination ACK */
|
---|
138 | #define PPP_CODEREJ UINT_C(7) /* Code Reject */
|
---|
139 |
|
---|
140 | /*
|
---|
141 | * æ§ææ
|
---|
142 | å ± (CI) ããã
|
---|
143 | */
|
---|
144 |
|
---|
145 | typedef struct t_ppp_ci_hdr {
|
---|
146 | uint8_t type; /* CI ã®å */
|
---|
147 | uint8_t len; /* é·ã */
|
---|
148 | } __attribute__((packed, aligned(2)))T_PPP_CI_HDR;
|
---|
149 |
|
---|
150 | #endif /* of #ifndef _PPP_H_ */
|
---|