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

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

文字コードを設定

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