Put the IGMP type field value into the PIM tree, as is done for other
[obnox/wireshark/wip.git] / packet-ipv6.h
1 /* packet-ipv6.h
2  * Definitions for IPv6 packet disassembly 
3  *
4  * $Id: packet-ipv6.h,v 1.23 2001/06/26 17:31:36 itojun Exp $
5  *
6  * Ethereal - Network traffic analyzer
7  * By Gerald Combs <gerald@ethereal.com>
8  *
9  * Copyright 1998 Gerald Combs
10  *
11  * MobileIPv6 support added by Tomislav Borosa <tomislav.borosa@siemens.hr>
12  * 
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  * 
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  * 
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
26  */
27
28 #ifndef __PACKET_IPV6_H_DEFINED__
29 #define __PACKET_IPV6_H_DEFINED__
30
31 #include "ipv6-utils.h"
32
33 #define INET6_ADDRSTRLEN        46
34
35 /*
36  * Definition for internet protocol version 6.
37  * RFC 1883
38  */
39 struct ip6_hdr {
40         union {
41                 struct ip6_hdrctl {
42                         guint32 ip6_un1_flow;   /* 20 bits of flow-ID */
43                         guint16 ip6_un1_plen;   /* payload length */
44                         guint8  ip6_un1_nxt;    /* next header */
45                         guint8  ip6_un1_hlim;   /* hop limit */
46                 } ip6_un1;
47                 guint8 ip6_un2_vfc;     /* 4 bits version, 4 bits class */
48         } ip6_ctlun;
49         struct e_in6_addr ip6_src;      /* source address */
50         struct e_in6_addr ip6_dst;      /* destination address */
51 };
52
53 #define ip6_vfc         ip6_ctlun.ip6_un2_vfc
54 #define ip6_flow        ip6_ctlun.ip6_un1.ip6_un1_flow
55 #define ip6_plen        ip6_ctlun.ip6_un1.ip6_un1_plen
56 #define ip6_nxt         ip6_ctlun.ip6_un1.ip6_un1_nxt
57 #define ip6_hlim        ip6_ctlun.ip6_un1.ip6_un1_hlim
58 #define ip6_hops        ip6_ctlun.ip6_un1.ip6_un1_hlim
59
60 /* Offsets of fields within an IPv6 header. */
61 #define IP6H_CTL        0
62 #define IP6H_CTL_FLOW   0
63 #define IP6H_CTL_PLEN   4
64 #define IP6H_CTL_NXT    6
65 #define IP6H_CTL_HLIM   7
66 #define IP6H_CTL_VFC    0
67 #define IP6H_SRC        8
68 #define IP6H_DST        24
69
70 #define IPV6_FLOWINFO_MASK      0x0fffffff      /* flow info (28 bits) */
71 #define IPV6_FLOWLABEL_MASK     0x000fffff      /* flow label (20 bits) */
72
73 /*
74  * Extension Headers
75  */
76
77 struct  ip6_ext {
78         u_char  ip6e_nxt;
79         u_char  ip6e_len;
80 };
81
82 /* Hop-by-Hop options header */
83 /* XXX should we pad it to force alignment on an 8-byte boundary? */
84 struct ip6_hbh {
85         guint8 ip6h_nxt;        /* next header */
86         guint8 ip6h_len;        /* length in units of 8 octets */
87         /* followed by options */
88 };
89
90 /* Destination options header */
91 /* XXX should we pad it to force alignment on an 8-byte boundary? */
92 struct ip6_dest {
93         guint8 ip6d_nxt;        /* next header */
94         guint8 ip6d_len;        /* length in units of 8 octets */
95         /* followed by options */
96 };
97
98 /* Option types and related macros */
99 #define IP6OPT_PAD1             0x00    /* 00 0 00000 */
100 #define IP6OPT_PADN             0x01    /* 00 0 00001 */
101 #define IP6OPT_JUMBO            0xC2    /* 11 0 00010 = 194 */
102 #define IP6OPT_JUMBO_LEN        6
103 #define IP6OPT_RTALERT          0x05    /* 00 0 00101 */
104
105 #define IP6OPT_RTALERT_LEN      4
106 #define IP6OPT_RTALERT_MLD      0       /* Datagram contains MLD message */
107 #define IP6OPT_RTALERT_RSVP     1       /* Datagram contains RSVP message */
108 #define IP6OPT_RTALERT_ACTNET   2       /* contains an Active Networks msg */
109 #define IP6OPT_MINLEN           2
110
111 #define IP6OPT_BINDING_UPDATE   0xC6  /* 11 0 00110 */
112 #define IP6OPT_BINDING_ACK      0x07  /* 00 0 00111 */
113 #define IP6OPT_BINDING_REQUEST  0x08  /* 00 0 01000 */
114 #define IP6OPT_HOME_ADDRESS     0xC9  /* 11 0 01001 */
115 #define IP6OPT_EID              0x8a  /* 10 0 01010 */
116 #define IP6OPT_MIPv6_UNIQUE_ID_SUB 0x02  /* 00 0 00010 */
117 #define IP6OPT_MIPv6_ALTERNATIVE_COA_SUB 0x04  /* 00 0 00100 */
118
119 #define IP6OPT_TYPE(o)          ((o) & 0xC0)
120 #define IP6OPT_TYPE_SKIP        0x00
121 #define IP6OPT_TYPE_DISCARD     0x40
122 #define IP6OPT_TYPE_FORCEICMP   0x80
123 #define IP6OPT_TYPE_ICMP        0xC0
124
125 #define IP6OPT_MUTABLE          0x20
126
127 /* MIPv6 Lifetime */
128 #define MIP_INFINITY 0xffffffff /* Infinity lifetime */
129
130 /*      Binding Update Flags */
131 #define IP6_MIPv6_BU_A_FLAG 0x80 /* 1000 0000 - Acknowledge */
132 #define IP6_MIPv6_BU_H_FLAG 0x40 /* 0100 0000 - Home Registration */
133 #define IP6_MIPv6_BU_R_FLAG 0x20 /* 0010 0000 - Router */
134 #define IP6_MIPv6_BU_D_FLAG 0x10 /* 0001 0000 - Duplicate Address Detection */
135 #define IP6_MIPv6_BU_M_FLAG 0x8  /* 0000 1000 - MAP Registration */
136 #define IP6_MIPv6_BU_B_FLAG 0x4  /* 0000 0100 - Request for bicasting */
137
138 #define IP6_MIPv6_OPTION_TYPE_LENGTH    1
139 #define IP6_MIPv6_OPTION_LENGTH_LENGTH  1
140 #define IP6_MIPv6_FLAGS_LENGTH  1
141 #define IP6_MIPv6_PREFIX_LENGTH_LENGTH  1
142 #define IP6_MIPv6_SEQUENCE_NUMBER_LENGTH        2
143 #define IP6_MIPv6_LIFE_TIME_LENGTH      4
144 #define IP6_MIPv6_REFRESH_LENGTH        4
145 #define IP6_MIPv6_STATUS_LENGTH 1
146 #define IP6_MIPv6_HOME_ADDRESS_LENGTH   16
147 #define IP6_MIPv6_SUB_TYPE_LENGTH       1
148 #define IP6_MIPv6_SUB_LENGTH_LENGTH     1
149 #define IP6_MIPv6_SUB_UNIQUE_ID_LENGTH  2
150 #define IP6_MIPv6_SUB_ALTERNATIVE_COA_LENGTH    16
151
152 /* Binding Ackonwledgement Status */
153 #define BA_OK 0 /* Binding update accepted */
154 #define BA_REAS_UNSPEC 128 /*Reason unspecified */
155 #define BA_ADMIN_PROH 130 /* Administratively prohibited */
156 #define BA_INSUF_RES 131 /* Insufficient resources */
157 #define BA_NO_HR 132 /* Home registration not supported */
158 #define BA_NO_SUBNET 133 /* Not home subnet */
159 #define BA_ERR_ID_LEN 136 /* Incorrect interface identifier length */
160 #define BA_NO_HA 137 /* Not home agent for this mobile node */
161 #define BA_DUPL_ADDR 138 /* Duplicate Address Detection failed */
162
163 /* Routing header */
164 struct ip6_rthdr {
165         guint8  ip6r_nxt;       /* next header */
166         guint8  ip6r_len;       /* length in units of 8 octets */
167         guint8  ip6r_type;      /* routing type */
168         guint8  ip6r_segleft;   /* segments left */
169         /* followed by routing type specific data */
170 };
171
172 /* Type 0 Routing header */
173 struct ip6_rthdr0 {
174         guint8  ip6r0_nxt;              /* next header */
175         guint8  ip6r0_len;              /* length in units of 8 octets */
176         guint8  ip6r0_type;             /* always zero */
177         guint8  ip6r0_segleft;  /* segments left */
178         guint8  ip6r0_reserved; /* reserved field */
179         guint8  ip6r0_slmap[3]; /* strict/loose bit map */
180         struct e_in6_addr  ip6r0_addr[1];       /* up to 23 addresses */
181 };
182
183 /* Fragment header */
184 struct ip6_frag {
185         guint8  ip6f_nxt;               /* next header */
186         guint8  ip6f_reserved;  /* reserved field */
187         guint16 ip6f_offlg;             /* offset, reserved, and flag */
188         guint32 ip6f_ident;             /* identification */
189 };
190
191 #define IP6F_OFF_MASK           0xfff8  /* mask out offset from _offlg */
192 #define IP6F_RESERVED_MASK      0x0006  /* reserved bits in ip6f_offlg */
193 #define IP6F_MORE_FRAG          0x0001  /* more-fragments flag */
194
195 /*
196  * Definition for ICMPv6.
197  * RFC 1885
198  */
199
200 #define ICMPV6_PLD_MAXLEN       1232    /* IPV6_MMTU - sizeof(struct ip6_hdr)
201                                            - sizeof(struct icmp6_hdr) */
202
203 struct icmp6_hdr {
204         guint8  icmp6_type;     /* type field */
205         guint8  icmp6_code;     /* code field */
206         guint16 icmp6_cksum;    /* checksum field */
207         union {
208                 guint32 icmp6_un_data32[1]; /* type-specific field */
209                 guint16 icmp6_un_data16[2]; /* type-specific field */
210                 guint8  icmp6_un_data8[4];  /* type-specific field */
211         } icmp6_dataun;
212 };
213
214 #define icmp6_data32    icmp6_dataun.icmp6_un_data32
215 #define icmp6_data16    icmp6_dataun.icmp6_un_data16
216 #define icmp6_data8     icmp6_dataun.icmp6_un_data8
217 #define icmp6_pptr      icmp6_data32[0]         /* parameter prob */
218 #define icmp6_mtu       icmp6_data32[0]         /* packet too big */
219 #define icmp6_id        icmp6_data16[0]         /* echo request/reply */
220 #define icmp6_seq       icmp6_data16[1]         /* echo request/reply */
221 #define icmp6_maxdelay  icmp6_data16[0]         /* mcast group membership */
222
223 #define ICMP6_DST_UNREACH               1       /* dest unreachable, codes: */
224 #define ICMP6_PACKET_TOO_BIG            2       /* packet too big */
225 #define ICMP6_TIME_EXCEEDED             3       /* time exceeded, code: */
226 #define ICMP6_PARAM_PROB                4       /* ip6 header bad */
227
228 #define ICMP6_ECHO_REQUEST              128     /* echo service */
229 #define ICMP6_ECHO_REPLY                129     /* echo reply */
230 #define ICMP6_MEMBERSHIP_QUERY          130     /* group membership query */
231 #define MLD6_LISTENER_QUERY             130     /* multicast listener query */
232 #define ICMP6_MEMBERSHIP_REPORT         131     /* group membership report */
233 #define MLD6_LISTENER_REPORT            131     /* multicast listener report */
234 #define ICMP6_MEMBERSHIP_REDUCTION      132     /* group membership termination */
235 #define MLD6_LISTENER_DONE              132     /* multicast listener done */
236
237 #define ND_ROUTER_SOLICIT               133     /* router solicitation */
238 #define ND_ROUTER_ADVERT                134     /* router advertisment */
239 #define ND_NEIGHBOR_SOLICIT             135     /* neighbor solicitation */
240 #define ND_NEIGHBOR_ADVERT              136     /* neighbor advertisment */
241 #define ND_REDIRECT                     137     /* redirect */
242
243 #define ICMP6_ROUTER_RENUMBERING        138     /* router renumbering */
244
245 #define ICMP6_WRUREQUEST                139     /* who are you request */
246 #define ICMP6_WRUREPLY                  140     /* who are you reply */
247 #define ICMP6_FQDN_QUERY                139     /* FQDN query */
248 #define ICMP6_FQDN_REPLY                140     /* FQDN reply */
249 #define ICMP6_NI_QUERY                  139     /* node information request */
250 #define ICMP6_NI_REPLY                  140     /* node information reply */
251
252 /* The definitions below are experimental. TBA */
253 #define MLD6_MTRACE_RESP                141     /* mtrace response(to sender) */
254 #define MLD6_MTRACE                     142     /* mtrace messages */
255
256 #define ICMP6_MAXTYPE                   142
257
258 #define ICMP6_DST_UNREACH_NOROUTE       0       /* no route to destination */
259 #define ICMP6_DST_UNREACH_ADMIN         1       /* administratively prohibited */
260 #define ICMP6_DST_UNREACH_NOTNEIGHBOR   2       /* not a neighbor(obsolete) */
261 #define ICMP6_DST_UNREACH_BEYONDSCOPE   2       /* beyond scope of source address */
262 #define ICMP6_DST_UNREACH_ADDR          3       /* address unreachable */
263 #define ICMP6_DST_UNREACH_NOPORT        4       /* port unreachable */
264
265 #define ICMP6_TIME_EXCEED_TRANSIT       0       /* ttl==0 in transit */
266 #define ICMP6_TIME_EXCEED_REASSEMBLY    1       /* ttl==0 in reass */
267
268 #define ICMP6_PARAMPROB_HEADER          0       /* erroneous header field */
269 #define ICMP6_PARAMPROB_NEXTHEADER      1       /* unrecognized next header */
270 #define ICMP6_PARAMPROB_OPTION          2       /* unrecognized option */
271
272 #define ICMP6_INFOMSG_MASK              0x80    /* all informational messages */
273
274 #define ICMP6_NI_SUBJ_IPV6      0       /* Query Subject is an IPv6 address */
275 #define ICMP6_NI_SUBJ_FQDN      1       /* Query Subject is a Domain name */
276 #define ICMP6_NI_SUBJ_IPV4      2       /* Query Subject is an IPv4 address */
277
278 #define ICMP6_NI_SUCCESS        0       /* node information successful reply */
279 #define ICMP6_NI_REFUSED        1       /* node information request is refused */
280 #define ICMP6_NI_UNKNOWN        2       /* unknown Qtype */
281
282 #define ICMP6_ROUTER_RENUMBERING_COMMAND  0     /* rr command */
283 #define ICMP6_ROUTER_RENUMBERING_RESULT   1     /* rr result */
284 #define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET   255     /* rr seq num reset */
285
286 /*
287  * Multicast Listener Discovery
288  */
289 struct mld6_hdr {
290         struct icmp6_hdr        mld6_hdr;
291         struct e_in6_addr               mld6_addr; /* multicast address */
292 };
293
294 #define mld6_type       mld6_hdr.icmp6_type
295 #define mld6_code       mld6_hdr.icmp6_code
296 #define mld6_cksum      mld6_hdr.icmp6_cksum
297 #define mld6_maxdelay   mld6_hdr.icmp6_data16[0]
298 #define mld6_reserved   mld6_hdr.icmp6_data16[1]
299
300 /*
301  * Neighbor Discovery
302  */
303
304 struct nd_router_solicit {      /* router solicitation */
305         struct icmp6_hdr        nd_rs_hdr;
306         /* could be followed by options */
307 };
308
309 #define nd_rs_type      nd_rs_hdr.icmp6_type
310 #define nd_rs_code      nd_rs_hdr.icmp6_code
311 #define nd_rs_cksum     nd_rs_hdr.icmp6_cksum
312 #define nd_rs_reserved  nd_rs_hdr.icmp6_data32[0]
313
314 struct nd_router_advert {       /* router advertisement */
315         struct icmp6_hdr        nd_ra_hdr;
316         guint32         nd_ra_reachable;        /* reachable time */
317         guint32         nd_ra_retransmit;       /* retransmit timer */
318         /* could be followed by options */
319 };
320
321 #define nd_ra_type              nd_ra_hdr.icmp6_type
322 #define nd_ra_code              nd_ra_hdr.icmp6_code
323 #define nd_ra_cksum             nd_ra_hdr.icmp6_cksum
324 #define nd_ra_curhoplimit       nd_ra_hdr.icmp6_data8[0]
325 #define nd_ra_flags_reserved    nd_ra_hdr.icmp6_data8[1]
326 #define ND_RA_FLAG_MANAGED      0x80
327 #define ND_RA_FLAG_OTHER        0x40
328 #define ND_RA_FLAG_HOME_AGENT   0x20
329
330 /*
331  * Router preference values based on draft-draves-ipngwg-router-selection-01.
332  * These are non-standard definitions.
333  */
334 #define ND_RA_FLAG_RTPREF_MASK  0x18 /* 00011000 */
335
336 #define ND_RA_FLAG_RTPREF_HIGH  0x08 /* 00001000 */
337 #define ND_RA_FLAG_RTPREF_MEDIUM        0x00 /* 00000000 */
338 #define ND_RA_FLAG_RTPREF_LOW   0x18 /* 00011000 */
339 #define ND_RA_FLAG_RTPREF_RSV   0x10 /* 00010000 */
340
341 #define nd_ra_router_lifetime   nd_ra_hdr.icmp6_data16[1]
342
343 struct nd_neighbor_solicit {    /* neighbor solicitation */
344         struct icmp6_hdr        nd_ns_hdr;
345         struct e_in6_addr               nd_ns_target;   /*target address */
346         /* could be followed by options */
347 };
348
349 #define nd_ns_type              nd_ns_hdr.icmp6_type
350 #define nd_ns_code              nd_ns_hdr.icmp6_code
351 #define nd_ns_cksum             nd_ns_hdr.icmp6_cksum
352 #define nd_ns_reserved          nd_ns_hdr.icmp6_data32[0]
353
354 struct nd_neighbor_advert {     /* neighbor advertisement */
355         struct icmp6_hdr        nd_na_hdr;
356         struct e_in6_addr               nd_na_target;   /* target address */
357         /* could be followed by options */
358 };
359
360 #define nd_na_type              nd_na_hdr.icmp6_type
361 #define nd_na_code              nd_na_hdr.icmp6_code
362 #define nd_na_cksum             nd_na_hdr.icmp6_cksum
363 #define nd_na_flags_reserved    nd_na_hdr.icmp6_data32[0]
364 #define ND_NA_FLAG_ROUTER               0x80000000
365 #define ND_NA_FLAG_SOLICITED            0x40000000
366 #define ND_NA_FLAG_OVERRIDE             0x20000000
367
368 struct nd_redirect {            /* redirect */
369         struct icmp6_hdr        nd_rd_hdr;
370         struct e_in6_addr               nd_rd_target;   /* target address */
371         struct e_in6_addr               nd_rd_dst;      /* destination address */
372         /* could be followed by options */
373 };
374
375 #define nd_rd_type              nd_rd_hdr.icmp6_type
376 #define nd_rd_code              nd_rd_hdr.icmp6_code
377 #define nd_rd_cksum             nd_rd_hdr.icmp6_cksum
378 #define nd_rd_reserved          nd_rd_hdr.icmp6_data32[0]
379
380 struct nd_opt_hdr {             /* Neighbor discovery option header */
381         guint8  nd_opt_type;
382         guint8  nd_opt_len;
383         /* followed by option specific data*/
384 };
385
386 #define ND_OPT_SOURCE_LINKADDR          1
387 #define ND_OPT_TARGET_LINKADDR          2
388 #define ND_OPT_PREFIX_INFORMATION       3
389 #define ND_OPT_REDIRECTED_HEADER        4
390 #define ND_OPT_MTU                      5
391 #define ND_OPT_ADVINTERVAL              7
392 #define ND_OPT_HOMEAGENT_INFO           8
393 /* draft-ietf-ipngwg-router-preference, not officially assigned yet */
394 #define ND_OPT_ROUTE_INFO               9
395
396 struct nd_opt_prefix_info {     /* prefix information */
397         guint8  nd_opt_pi_type;
398         guint8  nd_opt_pi_len;
399         guint8  nd_opt_pi_prefix_len;
400         guint8  nd_opt_pi_flags_reserved;
401         guint32 nd_opt_pi_valid_time;
402         guint32 nd_opt_pi_preferred_time;
403         guint32 nd_opt_pi_reserved2;
404         struct e_in6_addr       nd_opt_pi_prefix;
405 };
406
407 #define ND_OPT_PI_FLAG_ONLINK           0x80
408 #define ND_OPT_PI_FLAG_AUTO             0x40
409 #define ND_OPT_PI_FLAG_ROUTER           0x20
410 #define ND_OPT_PI_FLAG_SITEPREF         0x10
411
412 struct nd_opt_rd_hdr {         /* redirected header */
413         guint8  nd_opt_rh_type;
414         guint8  nd_opt_rh_len;
415         guint16 nd_opt_rh_reserved1;
416         guint32 nd_opt_rh_reserved2;
417         /* followed by IP header and data */
418 };
419
420 struct nd_opt_mtu {             /* MTU option */
421         guint8  nd_opt_mtu_type;
422         guint8  nd_opt_mtu_len;
423         guint16 nd_opt_mtu_reserved;
424         guint32 nd_opt_mtu_mtu;
425 };
426
427 struct nd_opt_adv_int {         /* Advertisement Interval option */
428         guint8  nd_opt_adv_int_type;
429         guint8  nd_opt_adv_int_len;
430         guint16 nd_opt_adv_int_reserved;
431         guint32 nd_opt_adv_int_advint;
432 };
433
434 struct nd_opt_ha_info {         /* Home Agent Information option */
435         guint8  nd_opt_ha_info_type;
436         guint8  nd_opt_ha_info_len;
437         guint16 nd_opt_ha_info_reserved;
438         guint16 nd_opt_ha_info_ha_pref;
439         guint16 nd_opt_ha_info_ha_life;
440 };
441
442 struct nd_opt_route_info {      /* route info */
443         guint8  nd_opt_rti_type;
444         guint8  nd_opt_rti_len;
445         guint8  nd_opt_rti_prefixlen;
446         guint8  nd_opt_rti_flags;
447         guint32 nd_opt_rti_lifetime;
448         /* prefix follows */
449 };
450
451 /*
452  * icmp6 node information
453  */
454 struct icmp6_nodeinfo {
455         struct icmp6_hdr icmp6_ni_hdr;
456         guint8 icmp6_ni_nonce[8];
457         /* could be followed by reply data */
458 };
459
460 #define ni_type         icmp6_ni_hdr.icmp6_type
461 #define ni_code         icmp6_ni_hdr.icmp6_code
462 #define ni_cksum        icmp6_ni_hdr.icmp6_cksum
463 #define ni_qtype        icmp6_ni_hdr.icmp6_data16[0]
464 #define ni_flags        icmp6_ni_hdr.icmp6_data16[1]
465
466 #define NI_QTYPE_NOOP           0 /* NOOP  */
467 #define NI_QTYPE_SUPTYPES       1 /* Supported Qtypes */
468 #define NI_QTYPE_FQDN           2 /* FQDN (draft 04) */
469 #define NI_QTYPE_DNSNAME        2 /* DNS Name */
470 #define NI_QTYPE_NODEADDR       3 /* Node Addresses */
471 #define NI_QTYPE_IPV4ADDR       4 /* IPv4 Addresses */
472
473 #define NI_SUPTYPE_FLAG_COMPRESS        0x1
474 #define NI_FQDN_FLAG_VALIDTTL           0x1
475
476 #define NI_NODEADDR_FLAG_TRUNCATE       0x1
477 #define NI_NODEADDR_FLAG_ALL            0x2
478 #define NI_NODEADDR_FLAG_COMPAT         0x4
479 #define NI_NODEADDR_FLAG_LINKLOCAL      0x8
480 #define NI_NODEADDR_FLAG_SITELOCAL      0x10
481 #define NI_NODEADDR_FLAG_GLOBAL         0x20
482 #define NI_NODEADDR_FLAG_ANYCAST        0x40 /* just experimental. not in spec */
483
484 struct ni_reply_fqdn {
485         guint32 ni_fqdn_ttl;    /* TTL */
486         guint8  ni_fqdn_namelen; /* length in octets of the FQDN */
487         guint8  ni_fqdn_name[3]; /* XXX: alignment */
488 };
489
490 /*
491  * Router Renumbering. as router-renum-05.txt
492  */
493 struct icmp6_router_renum {     /* router renumbering header */
494         struct icmp6_hdr        rr_hdr;
495         guint8          rr_segnum;
496         guint8          rr_flags;
497         guint16         rr_maxdelay;
498         guint32         rr_reserved;
499 };
500
501 #define rr_type                 rr_hdr.icmp6_type
502 #define rr_code                 rr_hdr.icmp6_code
503 #define rr_cksum                rr_hdr.icmp6_cksum
504 #define rr_seqnum               rr_hdr.icmp6_data32[0]
505
506 struct rr_pco_match {           /* match prefix part */
507         guint8  rpm_code;
508         guint8  rpm_len;
509         guint8  rpm_ordinal;
510         guint8  rpm_matchlen;
511         guint8  rpm_minlen;
512         guint8  rpm_maxlen;
513         guint16 rpm_reserved;
514         struct e_in6_addr       rpm_prefix;
515 };
516
517 #define RPM_PCO_ADD             1
518 #define RPM_PCO_CHANGE          2
519 #define RPM_PCO_SETGLOBAL       3
520 #define RPM_PCO_MAX             4
521
522 struct rr_pco_use {             /* use prefix part */
523         guint8  rpu_uselen;
524         guint8  rpu_keeplen;
525         guint8  rpu_ramask;
526         guint8  rpu_raflags;
527         guint32 rpu_vltime;
528         guint32 rpu_pltime;
529         guint32 rpu_flags;
530         struct e_in6_addr rpu_prefix;
531 };
532
533 #define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK  0x80
534 #define ICMP6_RR_PCOUSE_RAFLAGS_AUTO    0x40
535
536 /* network endian */
537 #define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME        0x80000000
538 #define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME        0x40000000
539
540 struct rr_result {              /* router renumbering result message */
541         guint16 rrr_flags;
542         guint8  rrr_ordinal;
543         guint8  rrr_matchedlen;
544         guint32 rrr_ifid;
545         struct e_in6_addr rrr_prefix;
546 };
547
548 /* network endian */
549 #define ICMP6_RR_RESULT_FLAGS_OOB               0x0002
550 #define ICMP6_RR_RESULT_FLAGS_FORBIDDEN         0x0001
551
552 #endif /* __PACKET_IPV6_H_DEFINED__ */