source: EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/dhcp4_cli.h@ 331

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

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr
File size: 10.3 KB
Line 
1/*
2 * Copyright 2004 Henning Brauer <henning@openbsd.org>
3 * Copyright (c) 1995, 1996, 1997, 1998, 1999
4 * The Internet Software Consortium. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of The Internet Software Consortium nor the names
16 * of its contributors may be used to endorse or promote products derived
17 * from this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
20 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 * DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
27 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * This software has been written for the Internet Software Consortium
34 * by Ted Lemon <mellon@fugue.com> in cooperation with Vixie
35 * Enterprises. To learn more about the Internet Software Consortium,
36 * see ``http://www.vix.com/isc''. To learn more about Vixie
37 * Enterprises, see ``http://www.vix.com''.
38 *
39 * This client was substantially modified and enhanced by Elliot Poger
40 * for use on Linux while he was working on the MosquitoNet project at
41 * Stanford.
42 *
43 * The current version owes much to Elliot's Linux enhancements, but
44 * was substantially reorganized and partially rewritten by Ted Lemon
45 * so as to use the same networking framework that the Internet Software
46 * Consortium DHCP server uses. Much system-specific configuration code
47 * was moved into a shell script so that as support for more operating
48 * systems is added, it will not be necessary to port and maintain
49 * system-specific configuration code to these operating systems - instead,
50 * the shell script can invoke the native tools to accomplish the same
51 * purpose.
52 */
53/*
54 * WIDE Project DHCP Implementation
55 * Copyright (c) 1995-1997 Akihiro Tominaga
56 * Copyright (c) 1995-1997 WIDE Project
57 * All rights reserved.
58 *
59 * Permission to use, copy, modify and distribute this software and its
60 * documentation is hereby granted, provided the following conditions
61 * are satisfied,
62 *
63 * 1. Both the copyright notice and this permission notice appear in
64 * all copies of the software, derivative works or modified versions,
65 * and any portions thereof, and that both notices appear in
66 * supporting documentation.
67 * 2. All advertising materials mentioning features or use of this software
68 * must display the following acknowledgement:
69 * This product includes software developed by WIDE Project and
70 * its contributors.
71 * 3. Neither the name of WIDE Project nor the names of its contributors
72 * may be used to endorse or promote products derived from this software
73 * without specific prior written permission.
74 *
75 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND WIDE
76 * PROJECT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
77 * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. ALSO, THERE
78 * IS NO WARRANTY IMPLIED OR OTHERWISE, NOR IS SUPPORT PROVIDED.
79 *
80 * Feedback of the results generated from any improvements or
81 * extensions made to this software would be much appreciated.
82 * Any such feedback should be sent to:
83 *
84 * Akihiro Tominaga
85 * WIDE Project
86 * Keio University, Endo 5322, Kanagawa, Japan
87 * (E-mail: dhcp-dist@wide.ad.jp)
88 *
89 * WIDE project has the rights to redistribute these changes.
90 */
91/*
92 * TINET (TCP/IP Protocol Stack)
93 *
94 * Copyright (C) 2011 by Dep. of Computer Science and Engineering
95 * Tomakomai National College of Technology, JAPAN
96 *
97 * 上記著作権者
98は,以下の (1)~(4) の条件か,Free Software Foundation
99 * によってå…
100¬è¡¨ã•ã‚Œã¦ã„ã‚‹ GNU General Public License の Version 2 に記
101 * 述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
102 * を改変したものを含む.以下同じ)を使用・複製・改変・再é…
103å¸ƒï¼ˆä»¥ä¸‹ï¼Œ
104 * 利用と呼ぶ)することを無償で許諾する.
105 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
106 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
107 * スコード中に含まれていること.
108 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
109 * 用できる形で再é…
110å¸ƒã™ã‚‹å ´åˆã«ã¯ï¼Œå†é…
111å¸ƒã«ä¼´ã†ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆï¼ˆåˆ©ç”¨
112 * 者
113マニュアルなど)に,上記の著作権表示,この利用条件および下記
114 * の無保証規定を掲載すること.
115 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
116 * 用できない形で再é…
117å¸ƒã™ã‚‹å ´åˆã«ã¯ï¼Œæ¬¡ã®ã„ずれかの条件を満たすこ
118 * と.
119 * (a) 再é…
120å¸ƒã«ä¼´ã†ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆï¼ˆåˆ©ç”¨è€…
121マニュアルなど)に,上記の著
122 * 作権表示,この利用条件および下記の無保証規定を掲載すること.
123 * (b) 再é…
124å¸ƒã®å½¢æ…
125‹ã‚’,別に定める方法によって,TOPPERSプロジェクトに
126 * 報告すること.
127 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
128 * 害からも,上記著作権者
129およびTOPPERSプロジェクトをå…
130è²¬ã™ã‚‹ã“と.
131 *
132 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者
133お
134 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
135 * 含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
136 * 接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
137 *
138 * @(#) $Id$
139 */
140
141#ifndef DHCP4_CLI_H
142#define DHCP4_CLI_H
143
144#include <netapp/dhcp4.h>
145
146/*
147 * DHCP クライアントのスタックサイズ
148 */
149
150#define DHCP4_CLI_STACK_SIZE 1024 /* DHCP クライアントタスクのスタックサイズ */
151
152/*
153 * DHCP クライアントの優å…
154ˆåº¦
155 */
156
157#define DHCP4_CLI_MAIN_PRIORITY 5 /* DHCP クライアントタスクの優å…
158ˆåº¦ */
159
160/* 推奨度の定義 */
161#define DHCP4_CLI_CFG_PREFER_ADDR 100 /* アドレスの推奨度 */
162
163/* DHCP クライアントメッセージの受信リストサイズ(2以上指定すること) */
164#define NUM_DHCP4_MSG_LIST 3
165
166/*
167 * DHCP クライアントメッセージ構造体数【変更禁止】
168 * +1 は送信用
169 */
170#define NUM_MPF_DHCP4_CLI_MSG (NUM_DHCP4_MSG_LIST+1)
171
172/*
173 * コンパイル時コンフィギュレーション
174 */
175
176/* DHCP 必
177須オプションリスト */
178
179#ifndef DHCP4_CLI_CFG_REQUIRED_OLIST
180
181#define DHCP4_CLI_CFG_REQUIRED_OLIST { \
182 DHCP4_OPT_SUBNET_MASK, \
183 DHCP4_OPT_ROUTER, \
184}
185
186#endif /* of #ifndef DHCP4_CLI_CFG_REQUIRED_OLIST */
187
188/* DHCP 要求オプションリスト */
189
190#ifndef DHCP4_CLI_CFG_REQUEST_OLIST
191
192#if defined(USE_RESOLVER)
193
194#define DHCP4_CLI_CFG_REQUEST_OLIST { \
195 DHCP4_OPT_DNS_SERVER, \
196 DHCP4_OPT_DOMAIN_NAME, \
197}
198
199#endif /* of #if defined(USE_RESOLVER) */
200
201#endif /* of #ifndef DHCP4_CLI_CFG_REQUEST_OLIST */
202
203/*
204 * タイムアウト値
205 */
206
207/* 受信タイムアウト */
208#define TMO_DHCP4C_OFFER ULONG_C(120*1000) /* OFFER メッセージ */
209#define TMO_DHCP4C_ACK ULONG_C(60*1000) /* ACK/NAK メッセージ */
210
211/* リース時間の既定値 */
212#define TMO_DHCP4C_DEF_LEASE ULONG_C(12*60*60*1000) /* 標準時間 */
213#define TMO_DHCP4C_MIN_LEASE ULONG_C(60*1000) /* 最小時間 */
214
215/* メッセージの送信周期 */
216#define TMO_DHCP4C_INIT_INTVL ULONG_C(3*1000) /* 初期値 */
217#define TMO_DHCP4C_MAX_BACKOFF ULONG_C(15*1000) /* 制限値 */
218
219/* DHCP サーバへの UDP 送信タイムアウト */
220#define TMO_DHCP4C_UDP_SND ULONG_C(1000000) /* [us] */
221
222/* メッセージ構造体獲得タイムアウト */
223#define TMO_DHCP4C_MPF_GET ULONG_C(1000000) /* [us] */
224
225/* ARP 要求を送信してからの待
226ち時間 */
227#define TMO_DHCP4C_ARP_WAIT ULONG_C(1000000) /* [us] */
228
229/* RELEASE メッセージを送信してからの待
230ち時間 */
231#define TMO_DHCP4C_SND_REL_WAIT ULONG_C(1000000) /* [us] */
232
233/* DHCP でアドレスが更新された時に呼び出すコールバック関数 */
234#ifndef DHCP4_CLI_SET_ADDR_CALLBACK
235#define DHCP4_CLI_SET_ADDR_CALLBACK NULL
236#endif
237
238#ifndef _MACRO_ONLY
239
240#ifdef T_IPV4EP_DEFINED
241
242/*
243 * DHCP クライアントメッセージ構造体
244 */
245
246typedef struct dhcp4_cli_msg {
247 /* 4バイト境界にアラインする。*/
248 T_DHCP4_MSG msg; /* DHCP メッセージ構造体 */
249 struct dhcp4_cli_msg *next; /* リストの次のメッセージ構造体 */
250 T_IPV4EP srv; /* サーバのIPv4アドレス/ポート番号 */
251 uint16_t len; /* msg の有効長 */
252 uint16_t prefer; /* msg の推奨度 */
253 uint8_t type; /* メッセージタイプ */
254 } T_DHCP4_CLI_MSG;
255
256#endif /*of #ifdef T_IPV4EP_DEFINED */
257
258/*
259 * コールバック関数
260 */
261
262extern ER callback_nblk_dhcp4_cli (ID cepid, FN fncd, void *p_parblk);
263
264/*
265 * タスク
266 */
267
268extern void dhcp4_cli_task(intptr_t exinf);
269
270/*
271 * 関数
272 */
273
274#ifdef T_IN4_ADDR_DEFINED
275
276extern ER dhcp4c_rel_info (void);
277extern ER dhcp4c_renew_info (void);
278extern ER dhcp4c_get_info (T_IN4_ADDR *addr, uint32_t *expire, uint32_t *renew,
279 uint32_t *rebind, SYSTIM *bind_start);
280
281#endif /* of #ifdef T_IN4_ADDR_DEFINED */
282
283#endif /* of #ifndef _MACRO_ONLY */
284
285#endif /* of #ifndef DHCP4_CLI_H */
Note: See TracBrowser for help on using the repository browser.