source: EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/icmp6.h@ 270

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

mruby版ECNLプロトタイピング・ツールを追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-chdr
File size: 19.2 KB
Line 
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: icmp6.h 270 2017-02-09 04:03:47Z coas-nagasima $
44 */
45
46/* $FreeBSD: src/sys/netinet/icmp6.h,v 1.2.2.3 2001/07/06 05:36:35 sumikawa Exp $ */
47/* $KAME: icmp6.h,v 1.46 2001/04/27 15:09:48 itojun Exp $ */
48
49/*
50 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
51 * All rights reserved.
52 *
53 * Redistribution and use in source and binary forms, with or without
54 * modification, are permitted provided that the following conditions
55 * are met:
56 * 1. Redistributions of source code must retain the above copyright
57 * notice, this list of conditions and the following disclaimer.
58 * 2. Redistributions in binary form must reproduce the above copyright
59 * notice, this list of conditions and the following disclaimer in the
60 * documentation and/or other materials provided with the distribution.
61 * 3. Neither the name of the project nor the names of its contributors
62 * may be used to endorse or promote products derived from this software
63 * without specific prior written permission.
64 *
65 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
66 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
67 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
68 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
69 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
70 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
71 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
72 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
73 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
74 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
75 * SUCH DAMAGE.
76 */
77
78/*
79 * Copyright (c) 1982, 1986, 1993
80 * The Regents of the University of California. All rights reserved.
81 *
82 * Redistribution and use in source and binary forms, with or without
83 * modification, are permitted provided that the following conditions
84 * are met:
85 * 1. Redistributions of source code must retain the above copyright
86 * notice, this list of conditions and the following disclaimer.
87 * 2. Redistributions in binary form must reproduce the above copyright
88 * notice, this list of conditions and the following disclaimer in the
89 * documentation and/or other materials provided with the distribution.
90 * 3. All advertising materials mentioning features or use of this software
91 * must display the following acknowledgement:
92 * This product includes software developed by the University of
93 * California, Berkeley and its contributors.
94 * 4. Neither the name of the University nor the names of its contributors
95 * may be used to endorse or promote products derived from this software
96 * without specific prior written permission.
97 *
98 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
99 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
100 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
101 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
102 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
103 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
104 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
105 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
106 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
107 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
108 * SUCH DAMAGE.
109 *
110 * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93
111 */
112
113#ifndef _IP_ICMP6_H_
114#define _IP_ICMP6_H_
115
116#ifdef SUPPORT_INET6
117
118/*
119 * ICMPv6 ヘッダ
120 */
121
122typedef struct t_icmp6_hdr {
123 uint8_t type; /* メッセージの型 */
124 uint8_t code; /* サブ型 */
125 uint16_t sum; /* チェックサム */
126 union {
127 uint32_t data32;
128 uint16_t data16[2];
129 uint8_t data8[4];
130 } data;
131 } __attribute__((packed, aligned(2)))T_ICMP6_HDR;
132
133#define icmp6_data32 data.data32
134#define icmp6_data16 data.data16
135#define icmp6_data8 data.data8
136#define icmp6_pptr data.data32 /* パラメータ異常 */
137#define icmp6_mtu data.data32 /* パラメータ異常 */
138#define icmp6_id data.data16[0] /* エコー要求と応答 */
139#define icmp6_seq data.data16[1] /* エコー要求と応答 */
140
141#define ICMP6_HDR_SIZE (sizeof(T_ICMP6_HDR))
142#define IF_IP6_ICMP6_HDR_OFFSET (IF_IP6_HDR_SIZE)
143
144#define GET_ICMP6_HDR(nbuf,ihoff) ((T_ICMP6_HDR*)((uint8_t*)((nbuf)->buf) + ihoff))
145#define GET_ICMP6_SDU(nbuf,ihoff) ((uint8_t*)((nbuf)->buf) + ihoff + ICMP6_HDR_SIZE)
146
147#define GET_IP6_ICMP6_HDR_SIZE(nbuf) (GET_IP6_HDR_SIZE(GET_IP6_HDR(nbuf)) + ICMP6_HDR_SIZE)
148#define GET_IF_IP6_ICMP6_HDR_SIZE(nbuf) (IF_HDR_SIZE + GET_IP6_ICMP6_HDR_SIZE(nbuf))
149
150/*
151 * ICMP6 タイプ
152 */
153
154#define ICMP6_DST_UNREACH UINT_C(1) /* 宛å…
155ˆåˆ°é”不可能 */
156#define ICMP6_PACKET_TOO_BIG UINT_C(2) /* パケットが大きすぎる。 */
157#define ICMP6_TIME_EXCEEDED UINT_C(3) /* TTL を超
158過した。 */
159#define ICMP6_PARAM_PROB UINT_C(4) /* IPv6 ヘッダが不正。 */
160
161#define ICMP6_ECHO_REQUEST UINT_C(128) /* エコー要求 */
162#define ICMP6_ECHO_REPLY UINT_C(129) /* エコー応答 */
163
164#define ICMP6_MEMBERSHIP_QUERY UINT_C(130) /* グループメンバç…
165§ä¼š */
166#define ICMP6_MEMBERSHIP_REPORT UINT_C(131) /* グループメンバ報告 */
167#define ICMP6_MEMBERSHIP_REDUCTION UINT_C(132) /* グループメンバ終了 */
168
169#define MLD_LISTENER_QUERY UINT_C(130) /* マルチキャスト受信者
170ç…
171§ä¼š */
172#define MLD_LISTENER_REPORT UINT_C(131) /* マルチキャスト受信者
173報告 */
174#define MLD_LISTENER_DONE UINT_C(132) /* マルチキャスト受信者
175終了 */
176
177#define ND_ROUTER_SOLICIT UINT_C(133) /* ルータ要請 */
178#define ND_ROUTER_ADVERT UINT_C(134) /* ルータ通知 */
179#define ND_NEIGHBOR_SOLICIT UINT_C(135) /* 近隣要請 */
180#define ND_NEIGHBOR_ADVERT UINT_C(136) /* 近隣通知 */
181#define ND_REDIRECT UINT_C(137) /* 向け直し */
182
183#define ICMP6_ROUTER_RENUMBERING UINT_C(138) /* ルータ番号再設定 */
184
185#define ICMP6_WRU_REQUEST UINT_C(139) /* 要求ノード探索 */
186#define ICMP6_WRU_REPLY UINT_C(140) /* 応答ノード探索 */
187
188#define ICMP6_FQDN_QUERY UINT_C(139) /* FQDN ç…
189§ä¼š */
190#define ICMP6_FQDN_REPLY UINT_C(140) /* FQDN 応答 */
191
192#define ICMP6_NI_QUERY UINT_C(139) /* ノード情
193å ±ç…
194§ä¼š */
195#define ICMP6_NI_REPLY UINT_C(140) /* ノード情
196報応答 */
197
198#define ICMP6_MAX_TYPE UINT_C(203) /* ICMP6 タイプの最大値 */
199
200/*
201 * ICMP6 コード
202 */
203
204/* 宛å…
205ˆåˆ°é”不可能 */
206
207#define ICMP6_DST_UNREACH_NOROUTE UINT_C(0) /* 到達ルートなし。 */
208#define ICMP6_DST_UNREACH_ADMIN UINT_C(1) /* 管理者
209により無効化中。 */
210#define ICMP6_DST_UNREACH_NOTEIGHBOR UINT_C(2) /* 近隣者
211ではなくなった。 */
212#define ICMP6_DST_UNREACH_BEYOND_SCOPE UINT_C(2) /* スコープを超
213えている。 */
214#define ICMP6_DST_UNREACH_ADDR UINT_C(3) /* 宛å…
215ˆã‚¢ãƒ‰ãƒ¬ã‚¹ã«åˆ°é”不可能。 */
216#define ICMP6_DST_UNREACH_NOPORT UINT_C(4) /* 宛å…
217ˆãƒãƒ¼ãƒˆã«åˆ°é”不可能。 */
218
219/* TTL 超
220過 */
221
222#define ICMP6_TIME_EXCEED_TRANSIT UINT_C(0) /* 転送時に TTL==0 になった。 */
223#define ICMP6_TIME_EXCEED_REASSEMBLY UINT_C(1) /* IP 再構成でタイムアウトした。*/
224
225/* ヘッダ不正 */
226
227#define ICMP6_PARAMPROB_HEADER UINT_C(0) /* ヘッダに不正があった。 */
228#define ICMP6_PARAMPROB_NEXT_HEADER UINT_C(1) /* 次ヘッダが認識できない。 */
229#define ICMP6_PARAMPROB_OPTION UINT_C(2) /* オプションが認識できない。 */
230
231/* 内
232部使用 */
233#define ND_REDIRECT_ONLINK UINT_C(0) /* オンリンクへの向け直し */
234#define ND_REDIRECT_ROUTER UINT_C(1) /* ルータへの向け直し */
235
236/*
237 * 制限値
238 */
239
240 /* ICMPv6 の最大ペイロード長 */
241#define ICMPV6_PAYLOAD_MAXLEN (IPV6_MMTU - (IP6_HDR_SIZE + ICMP6_HDR_SIZE))
242
243/*
244 * 近隣要請
245 */
246
247typedef struct t_neighbor_solicit_hdr {
248 T_ICMP6_HDR hdr;
249 T_IN6_ADDR target;
250 /* この後にオプションが続く */
251 } __attribute__((packed, aligned(2)))T_NEIGHBOR_SOLICIT_HDR;
252
253#define NEIGHBOR_SOLICIT_HDR_SIZE (sizeof(T_NEIGHBOR_SOLICIT_HDR))
254#define IF_IP6_NEIGHBOR_SOLICIT_HDR_OFFSET \
255 (IF_IP6_HDR_SIZE)
256
257#define GET_NEIGHBOR_SOLICIT_HDR(nbuf,nhoff) \
258 ((T_NEIGHBOR_SOLICIT_HDR*)((uint8_t*)((nbuf)->buf) + nhoff))
259#define GET_NEIGHBOR_SOLICIT_SDU(nbuf,nhoff) \
260 ((uint8_t*)((nbuf)->buf) + nhoff + NEIGHBOR_SOLICIT_HDR_SIZE)
261
262#define GET_IP6_NEIGHBOR_SOLICIT_HDR_SIZE(nbuf) \
263 (GET_IP6_HDR_SIZE(GET_IP6_HDR(nbuf)) + NEIGHBOR_SOLICIT_HDR_SIZE)
264#define GET_IF_IP6_NEIGHBOR_SOLICIT_HDR_SIZE(nbuf) \
265 (GET_IP6_NEIGHBOR_SOLICIT_HDR_SIZE(nbuf) + IF_HDR_SIZE)
266
267/*
268 * 近隣通知
269 */
270
271typedef struct t_neighbor_advert_hdr {
272 T_ICMP6_HDR hdr;
273 T_IN6_ADDR target;
274 /* この後にオプションが続く */
275 } __attribute__((packed, aligned(2)))T_NEIGHBOR_ADVERT_HDR;
276
277/* ICMP6 ヘッダのデータ部の定義 */
278
279#define nd_na_flags_reserved hdr.data.data32
280
281#define NEIGHBOR_ADVERT_HDR_SIZE (sizeof(T_NEIGHBOR_ADVERT_HDR))
282#define IP6_NEIGHBOR_ADVERT_HDR_SIZE (IP6_HDR_SIZE + NEIGHBOR_ADVERT_HDR_SIZE)
283#define IF_IP6_NEIGHBOR_ADVERT_HDR_SIZE \
284 (IF_IP6_HDR_SIZE + NEIGHBOR_ADVERT_HDR_SIZE)
285#define IF_IP6_NEIGHBOR_ADVERT_HDR_OFFSET \
286 (IF_IP6_HDR_SIZE)
287
288#define GET_NEIGHBOR_ADVERT_HDR(nbuf,nhoff) \
289 ((T_NEIGHBOR_ADVERT_HDR*)((uint8_t*)((nbuf)->buf) + nhoff))
290#define GET_NEIGHBOR_ADVERT_SDU(nbuf,nhoff) \
291 ((uint8_t*)((nbuf)->buf) + nhoff + NEIGHBOR_ADVERT_HDR_SIZE)
292
293#define GET_IP6_NEIGHBOR_ADVERT_HDR_SIZE(nbuf) \
294 (GET_IP6_HDR_SIZE(GET_IP6_HDR(nbuf)) + NEIGHBOR_ADVERT_HDR_SIZE)
295#define GET_IF_IP6_NEIGHBOR_ADVERT_HDR_SIZE(nbuf) \
296 (GET_IP6_NEIGHBOR_ADVERT_HDR_SIZE(nbuf) + IF_HDR_SIZE)
297
298/*
299 * 近隣通知フラグ、nd_na_flags_reserved (hdr.data32) に設定する。
300 */
301
302#if _NET_CFG_BYTE_ORDER == _NET_CFG_BIG_ENDIAN
303
304#define ND_NA_FLG_OVERRIDE ULONG_C(0x20000000) /* 近隣キャッシュ上書き */
305#define ND_NA_FLG_SOLICITED ULONG_C(0x40000000) /* 近隣要請への応答 */
306#define ND_NA_FLG_ROUTER ULONG_C(0x80000000) /* ルータ通知 */
307
308#elif _NET_CFG_BYTE_ORDER == _NET_CFG_LITTLE_ENDIAN
309
310#define ND_NA_FLG_OVERRIDE ULONG_C(0x00000020) /* 近隣キャッシュ上書き */
311#define ND_NA_FLG_SOLICITED ULONG_C(0x00000040) /* 近隣要請への応答 */
312#define ND_NA_FLG_ROUTER ULONG_C(0x00000080) /* ルータ通知 */
313
314#endif /* #if _NET_CFG_BYTE_ORDER == _NET_CFG_BIG_ENDIAN */
315
316/*
317 * ルータ通知
318 */
319
320typedef struct t_router_advert_hdr {
321 T_ICMP6_HDR hdr;
322 uint32_t reachable; /* [ms] 到達可能時間 */
323 uint32_t retransmit; /* [ms] 近隣要請送信間隔 */
324 /* この後にオプションが続く */
325 } __attribute__((packed, aligned(2)))T_ROUTER_ADVERT_HDR;
326
327/* ICMP6 ヘッダのデータ部の定義 */
328
329#define nd_ra_current_hoplimit hdr.data.data8[0]
330#define nd_ra_flags hdr.data.data8[1]
331#define nd_ra_router_lifetime hdr.data.data16[1] /* [s] ルータ有効時間 */
332
333#define ROUTER_ADVERT_HDR_SIZE (sizeof(T_ROUTER_ADVERT_HDR))
334#define IP6_ROUTER_ADVERT_HDR_SIZE (IP6_HDR_SIZE + ROUTER_ADVERT_HDR_SIZE)
335#define IF_IP6_ROUTER_ADVERT_HDR_SIZE (IF_IP6_HDR_SIZE + ROUTER_ADVERT_HDR_SIZE)
336#define IF_IP6_ROUTER_ADVERT_HDR_OFFSET (IF_IP6_HDR_SIZE)
337
338#define GET_ROUTER_ADVERT_HDR(nbuf,nhoff) \
339 ((T_ROUTER_ADVERT_HDR*)((uint8_t*)((nbuf)->buf) + nhoff))
340#define GET_ROUTER_ADVERT_SDU(nbuf,nhoff) \
341 ((uint8_t*)((nbuf)->buf) + nhoff + ROUTER_ADVERT_HDR_SIZE)
342
343#define GET_IP6_ROUTER_ADVERT_HDR_SIZE(nbuf) \
344 (GET_IP6_HDR_SIZE(GET_IP6_HDR(nbuf)) + ROUTER_ADVERT_HDR_SIZE)
345#define GET_IF_IP6_ROUTER_ADVERT_HDR_SIZE(nbuf) \
346 (GET_IP6_ROUTER_ADVERT_HDR_SIZE(nbuf) + IF_HDR_SIZE)
347
348/*
349 * ルータ通知ヘッダのフラグ
350 */
351
352#define ND_RA_FLAG_MANAGED UINT_C(0x80)
353#define ND_RA_FLAG_OTHER UINT_C(0x40)
354#define ND_RA_FLAG_HA UINT_C(0x20)
355
356/*
357 * ルータ要請
358 */
359
360typedef struct t_router_solicit_hdr {
361 T_ICMP6_HDR hdr;
362 } __attribute__((packed, aligned(2)))T_ROUTER_SOLICIT_HDR;
363
364/* ICMP6 ヘッダのデータ部の定義 */
365
366#define nd_rs_reserved hdr.data.data32
367
368#define ROUTER_SOLICIT_HDR_SIZE (sizeof(T_ROUTER_SOLICIT_HDR))
369#define IP6_ROUTER_SOLICIT_HDR_SIZE (IP6_HDR_SIZE + ROUTER_SOLICIT_HDR_SIZE)
370#define IF_IP6_ROUTER_SOLICIT_HDR_SIZE (IF_IP6_HDR_SIZE + ROUTER_SOLICIT_HDR_SIZE)
371#define IF_IP6_ROUTER_SOLICIT_HDR_OFFSET \
372 (IF_IP6_HDR_SIZE)
373
374#define GET_ROUTER_SOLICIT_HDR(nbuf,nhoff) \
375 ((T_ROUTER_SOLICIT_HDR*)((uint8_t*)((nbuf)->buf) + nhoff))
376#define GET_ROUTER_SOLICIT_SDU(nbuf,nhoff) \
377 ((uint8_t*)((nbuf)->buf) + nhoff + ROUTER_SOLICIT_HDR_SIZE)
378
379#define GET_IP6_ROUTER_SOLICIT_HDR_SIZE(nbuf) \
380 (GET_IP6_HDR_SIZE(GET_IP6_HDR(nbuf)) + ROUTER_SOLICIT_HDR_SIZE)
381#define GET_IF_IP6_ROUTER_SOLICIT_HDR_SIZE(nbuf) \
382 (GET_IP6_ROUTER_SOLICIT_HDR_SIZE(nbuf) + IF_HDR_SIZE)
383
384/*
385 * 近隣探索オプション
386 */
387
388/* 近隣探索ヘッダ */
389
390typedef struct t_neighbor_hdr {
391 T_ICMP6_HDR hdr;
392 T_IN6_ADDR target;
393 } __attribute__((packed, aligned(2)))T_NEIGHBOR_HDR;
394
395/* 近隣探索オプションヘッダ */
396
397typedef struct t_nd_opt_hdr {
398 uint8_t type; /* オプションタイプ */
399 uint8_t len; /* オプション長、単位は 8 バイト */
400 } __attribute__((packed, aligned(2)))T_ND_OPT_HDR;
401
402#define ND_OPT_HDR_SIZE (sizeof(T_ND_OPT_HDR))
403
404#define ND_OPT_SOURCE_LINKADDR UINT_C(1) /* 送信å…
405ˆãƒãƒƒãƒˆãƒ¯ãƒ¼ã‚¯ã‚¤ãƒ³ã‚¿ãƒ•ã‚§ãƒ¼ã‚¹ã®ã‚¢ãƒ‰ãƒ¬ã‚¹ */
406#define ND_OPT_TARGET_LINKADDR UINT_C(2) /* 対象ネットワークインタフェースのアドレス */
407#define ND_OPT_PREFIX_INFORMATION UINT_C(3) /* プレフィックス情
408å ± */
409#define ND_OPT_REDIRECTED_HEADER UINT_C(4) /* リダイレクト・ヘッダ */
410#define ND_OPT_MTU UINT_C(5) /* MTU */
411
412#define ND_OPT_PREFIX_INFO_COUNT UINT_C(6) /* プレフィックス情
413報の個数 */
414#define ND_OPT_OFF_ARRAY_SIZE UINT_C(7) /* ND オプションのオフセットを記録するé…
415åˆ—サイズ*/
416
417#define ND_OPT_OFF_ARRAY_IX(t) ((t)-1) /* オフセットé…
418åˆ—のインデックス */
419
420/* プレフィックスオプション */
421
422typedef struct t_nd_opt_prefix_info {
423 uint8_t type; /* 近隣探索オプションタイプ = 3 */
424 uint8_t len; /* オプション長 = 8×4=32 */
425 uint8_t prefix_len; /* プレフィックス長 */
426 uint8_t flags; /* フラグ */
427 uint32_t valid; /* [s] 有効時間 */
428 uint32_t preferred; /* [s] 推奨有効時間 */
429 uint32_t reserved;
430 T_IN6_ADDR prefix; /* プレフィックス */
431 } __attribute__((packed, aligned(2)))T_ND_OPT_PREFIX_INFO;
432
433#define ND_OPT_PI_FLAG_ONLINK UINT_C(0x80) /* オンリンクプレフィックス */
434#define ND_OPT_PI_FLAG_AUTO UINT_C(0x40) /* ステートレス・アドレス自動設定*/
435
436/* MTU オプションヘッダ */
437
438typedef struct t_nd_opt_mtu_hdr {
439 uint8_t type; /* オプションタイプ */
440 uint8_t len; /* オプション長、単位は 8 バイト*/
441 uint16_t reserved;
442 uint32_t mtu; /* MTU */
443 } __attribute__((packed, aligned(2)))T_ND_OPT_MTU_HDR;
444
445/*
446 * 向け直し
447 */
448
449typedef struct t_nd_redirect_hdr {
450 T_ICMP6_HDR hdr;
451 T_IN6_ADDR target; /* ルータのアドレス */
452 T_IN6_ADDR dst; /* 向け直しの終点アドレス */
453 /* この後にオプションが続く */
454 } __attribute__((packed, aligned(2)))T_ND_REDIRECT_HDR;
455
456#define ND_REDIRECT_HDR_SIZE (sizeof(T_ND_REDIRECT_HDR))
457
458#ifdef SUPPORT_MIB
459
460/*
461 * SNMP の 管理情
462報ベース (MIB)
463 */
464
465typedef struct t_icmp6_ifstat {
466 uint32_t ipv6IfIcmpInMsgs;
467 uint32_t ipv6IfIcmpInErrors;
468 uint32_t ipv6IfIcmpInDestUnreachs;
469/* uint32_t ipv6IfIcmpInAdminProhibs;*/
470 uint32_t ipv6IfIcmpInTimeExcds;
471 uint32_t ipv6IfIcmpInParmProblems;
472 uint32_t ipv6IfIcmpInPktTooBigs;
473 uint32_t ipv6IfIcmpInEchos;
474 uint32_t ipv6IfIcmpInEchoReplies;
475/* uint32_t ipv6IfIcmpInRouterSolicits;*/
476 uint32_t ipv6IfIcmpInRouterAdvertisements;
477 uint32_t ipv6IfIcmpInNeighborSolicits;
478 uint32_t ipv6IfIcmpInNeighborAdvertisements;
479 uint32_t ipv6IfIcmpInRedirects;
480/* uint32_t ipv6IfIcmpInGroupMembQueries;*/
481/* uint32_t ipv6IfIcmpInGroupMembResponses;*/
482/* uint32_t ipv6IfIcmpInGroupMembReductions;*/
483 uint32_t ipv6IfIcmpOutMsgs;
484 uint32_t ipv6IfIcmpOutErrors;
485 uint32_t ipv6IfIcmpOutDestUnreachs;
486/* uint32_t ipv6IfIcmpOutAdminProhibs;*/
487/* uint32_t ipv6IfIcmpOutTimeExcds;*/
488 uint32_t ipv6IfIcmpOutParmProblems;
489 uint32_t ipv6IfIcmpOutPktTooBigs;
490 uint32_t ipv6IfIcmpOutEchos;
491 uint32_t ipv6IfIcmpOutEchoReplies;
492 uint32_t ipv6IfIcmpOutRouterSolicits;
493/* uint32_t ipv6IfIcmpOutRouterAdvertisements;*/
494 uint32_t ipv6IfIcmpOutNeighborSolicits;
495 uint32_t ipv6IfIcmpOutNeighborAdvertisements;
496/* uint32_t ipv6IfIcmpOutRedirects;*/
497/* uint32_t ipv6IfIcmpOutGroupMembQueries;*/
498/* uint32_t ipv6IfIcmpOutGroupMembResponses;*/
499/* uint32_t ipv6IfIcmpOutGroupMembReductions;*/
500} T_ICMP6_IFSTAT;
501
502extern T_ICMP6_IFSTAT icmp6_ifstat;
503
504#endif /* of #ifdef SUPPORT_MIB */
505
506/*
507 * 関数
508 */
509
510extern uint_t icmp6_input (T_NET_BUF **inputp, uint_t *offp, uint_t *nextp);
511extern void icmp6_error (T_NET_BUF *input, uint8_t type, uint8_t code, uint32_t param);
512
513#ifdef ICMP_CFG_CALLBACK_ECHO_REPLY
514
515extern void icmp6_echo_reply (T_NET_BUF *input, uint_t ihoff);
516
517#endif /* of #ifdef ICMP_CFG_CALLBACK_ECHO_REPLY */
518
519#endif /* of #ifdef SUPPORT_INET6 */
520
521#endif /* of #ifndef _IP_ICMP6_H_ */
Note: See TracBrowser for help on using the repository browser.