source: asp3_tinet_ecnl_arm/trunk/asp3_dcre/tinet/net/ppp.h@ 352

Last change on this file since 352 was 352, checked in by coas-nagasima, 6 years ago

arm向けASP3版ECNLを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 5.7 KB
Line 
1/*
2 * TINET (TCP/IP Protocol Stack)
3 *
4 * Copyright (C) 2001-2017 by Dep. of Computer Science and Engineering
5 * Tomakomai National College of Technology, JAPAN
6 *
7 * 上記著作権者は,以下の (1)~(4) の条件か,Free Software Foundation
8 * によって公表されている GNU General Public License の Version 2 に記
9 * 述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
10 * を改変したものを含む.以下同じ)を使用・複製・改変・再配布(以下,
11 * 利用と呼ぶ)することを無償で許諾する.
12 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
13 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
14 * スコード中に含まれていること.
15 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
16 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
17 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
18 * の無保証規定を掲載すること.
19 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
20 * 用できない形で再配布する場合には,次の条件を満たすこと.
21 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
22 * 作権表示,この利用条件および下記の無保証規定を掲載すること.
23 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
24 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
25 *
26 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
27 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
28 * 含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
29 * 接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
30 *
31 * @(#) $Id$
32 */
33
34/*
35 * Copyright (c) 1989 Carnegie Mellon University.
36 * All rights reserved.
37 *
38 * Redistribution and use in source and binary forms are permitted
39 * provided that the above copyright notice and this paragraph are
40 * duplicated in all such forms and that any documentation,
41 * advertising materials, and other materials related to such
42 * distribution and use acknowledge that the software was developed
43 * by Carnegie Mellon University. The name of the
44 * University may not be used to endorse or promote products derived
45 * from this software without specific prior written permission.
46 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
47 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
48 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
49 */
50
51/*
52 * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
53 *
54 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
55 *
56 * Redistribution and use in source and binary forms are permitted
57 * provided that the above copyright notice and this paragraph are
58 * duplicated in all such forms and that any documentation,
59 * advertising materials, and other materials related to such
60 * distribution and use acknowledge that the software was developed
61 * by the Internet Initiative Japan. The name of the
62 * IIJ may not be used to endorse or promote products derived
63 * from this software without specific prior written permission.
64 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
65 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
66 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
67 */
68
69#ifndef _PPP_H_
70#define _PPP_H_
71
72/*
73 * PPP ヘッダのプロトコルフィールドの値
74 */
75
76#define PPP_IP UINT_C(0x0021) /* IPv4 */
77#define PPP_IPV6 UINT_C(0x0057) /* IPv6 */
78
79#define PPP_IPCP UINT_C(0x8021) /* IPCP */
80#define PPP_IPV6CP UINT_C(0x8057) /* IPV6CP */
81#define PPP_CCP UINT_C(0x80fd) /* CCP */
82
83#define PPP_LCP UINT_C(0xc021) /* LCP */
84#define PPP_PAP UINT_C(0xc023) /* PAP */
85#define PPP_LQR UINT_C(0xc025) /* LQR */
86#define PPP_CHAP UINT_C(0xc223) /* CHAP */
87
88#define GET_PPP_HDR(nbuf) ((T_PPP_HDR*)((nbuf)->buf))
89
90/*
91 * リンクの状態
92 */
93
94#define PPP_PHASE_DEAD 0
95#define PPP_PHASE_INITIALIZE 1
96#define PPP_PHASE_DORMANT 2
97#define PPP_PHASE_ESTABLISH 3
98#define PPP_PHASE_AUTHENTICATE 4
99#define PPP_PHASE_CALLBACK 5
100#define PPP_PHASE_NETWORK 6
101#define PPP_PHASE_TERMINATE 7
102#define PPP_PHASE_HOLDOFF 8
103
104/*
105 * PPP リンク制御 (CP) ヘッダ構造体
106 */
107
108typedef struct t_ppp_cp_hdr {
109 uint8_t code; /* 制御コード */
110 uint8_t id; /* 識別子 */
111 uint16_t len; /* 長さ */
112 } __attribute__((packed, aligned(2)))T_PPP_CP_HDR;
113
114#define GET_PPP_CP_HDR(nbuf) ((T_PPP_CP_HDR*)((nbuf)->buf + sizeof(T_PPP_HDR)))
115
116/*
117 * PPP リンク制御 (CP) の制御コード
118 */
119
120#define PPP_VENDER UINT_C(0) /* Vender Specific */
121#define PPP_CONFREQ UINT_C(1) /* Configuration Request */
122#define PPP_CONFACK UINT_C(2) /* Configuration ACK */
123#define PPP_CONFNAK UINT_C(3) /* Configuration NAK */
124#define PPP_CONFREJ UINT_C(4) /* Configuration Reject */
125#define PPP_TERMREQ UINT_C(5) /* Termination Request */
126#define PPP_TERMACK UINT_C(6) /* Termination ACK */
127#define PPP_CODEREJ UINT_C(7) /* Code Reject */
128
129/*
130 * 構成情報 (CI) ヘッダ
131 */
132
133typedef struct t_ppp_ci_hdr {
134 uint8_t type; /* CI の型 */
135 uint8_t len; /* 長さ */
136 } __attribute__((packed, aligned(2)))T_PPP_CI_HDR;
137
138#endif /* of #ifndef _PPP_H_ */
Note: See TracBrowser for help on using the repository browser.