34658981e8ddbdf9016962c3de00021f0e4710e8
[obnox/wireshark/wip.git] / epan / dissectors / packet-ipv6.h
1 /* packet-ipv6.h
2  * Definitions for IPv6 packet disassembly
3  *
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  *
9  * Copyright 1998 Gerald Combs
10  *
11  * MobileIPv6 support added by Tomislav Borosa <tomislav.borosa@siemens.hr>
12  *
13  * HMIPv6 support added by Martti Kuparinen <martti.kuparinen@iki.fi>
14  *
15  * FMIPv6 support added by Martin Andre <andre@clarinet.u-strasbg.fr>
16  *
17  * This program is free software; you can redistribute it and/or
18  * modify it under the terms of the GNU General Public License
19  * as published by the Free Software Foundation; either version 2
20  * of the License, or (at your option) any later version.
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with this program; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
30  */
31
32 #ifndef __PACKET_IPV6_H_DEFINED__
33 #define __PACKET_IPV6_H_DEFINED__
34
35 #include <epan/ipv6-utils.h>
36
37 /* this definition makes trouble with Microsoft Platform SDK: ws2tcpip.h and is used nowhere */
38 /*#define INET6_ADDRSTRLEN      46*/
39
40 /*
41  * Definition for internet protocol version 6.
42  * RFC 2460
43  */
44 struct ip6_hdr {
45         union {
46                 struct ip6_hdrctl {
47                         guint32 ip6_un1_flow;   /* version, class, flow */
48                         guint16 ip6_un1_plen;   /* payload length */
49                         guint8  ip6_un1_nxt;    /* next header */
50                         guint8  ip6_un1_hlim;   /* hop limit */
51                 } ip6_un1;
52                 guint8 ip6_un2_vfc;     /* 4 bits version, 4 bits class */
53         } ip6_ctlun;
54         struct e_in6_addr ip6_src;      /* source address */
55         struct e_in6_addr ip6_dst;      /* destination address */
56 };
57
58 #define ip6_vfc         ip6_ctlun.ip6_un2_vfc
59 #define ip6_flow        ip6_ctlun.ip6_un1.ip6_un1_flow
60 #define ip6_plen        ip6_ctlun.ip6_un1.ip6_un1_plen
61 #define ip6_nxt         ip6_ctlun.ip6_un1.ip6_un1_nxt
62 #define ip6_hlim        ip6_ctlun.ip6_un1.ip6_un1_hlim
63 #define ip6_hops        ip6_ctlun.ip6_un1.ip6_un1_hlim
64
65 /* Offsets of fields within an IPv6 header. */
66 #define IP6H_CTL                0
67 #define IP6H_CTL_FLOW   0
68 #define IP6H_CTL_PLEN   4
69 #define IP6H_CTL_NXT    6
70 #define IP6H_CTL_HLIM   7
71 #define IP6H_CTL_VFC    0
72 #define IP6H_SRC                8
73 #define IP6H_DST                24
74
75 #define IPV6_FLOWINFO_MASK      0x0fffffff      /* flow info (28 bits) */
76 #define IPV6_FLOWLABEL_MASK     0x000fffff      /* flow label (20 bits) */
77
78 /*
79  * Extension Headers
80  */
81
82 struct  ip6_ext {
83         guchar  ip6e_nxt;
84         guchar  ip6e_len;
85 };
86
87 /* Hop-by-Hop options header */
88 /* XXX should we pad it to force alignment on an 8-byte boundary? */
89 struct ip6_hbh {
90         guint8 ip6h_nxt;        /* next header */
91         guint8 ip6h_len;        /* length in units of 8 octets */
92         /* followed by options */
93 };
94
95 /* Destination options header */
96 /* XXX should we pad it to force alignment on an 8-byte boundary? */
97 struct ip6_dest {
98         guint8 ip6d_nxt;        /* next header */
99         guint8 ip6d_len;        /* length in units of 8 octets */
100         /* followed by options */
101 };
102
103 /* Option types and related macros */
104 #define IP6OPT_PAD1                             0x00    /* 00 0 00000 */
105 #define IP6OPT_PADN                             0x01    /* 00 0 00001 */
106 #define IP6OPT_JUMBO                    0xC2    /* 11 0 00010 = 194 */
107 #define IP6OPT_JUMBO_LEN                6
108 #define IP6OPT_RTALERT                  0x05    /* 00 0 00101 */
109
110 #define IP6OPT_RTALERT_LEN              4
111 #define IP6OPT_RTALERT_MLD              0       /* Datagram contains MLD message */
112 #define IP6OPT_RTALERT_RSVP             1       /* Datagram contains RSVP message */
113 #define IP6OPT_RTALERT_ACTNET   2       /* contains an Active Networks msg */
114 #define IP6OPT_MINLEN                   2
115
116 #define IP6OPT_HOME_ADDRESS     0xC9  /* 11 0 01001 */
117
118 #define IP6OPT_TYPE(o)          ((o) & 0xC0)
119 #define IP6OPT_TYPE_SKIP        0x00
120 #define IP6OPT_TYPE_DISCARD     0x40
121 #define IP6OPT_TYPE_FORCEICMP   0x80
122 #define IP6OPT_TYPE_ICMP        0xC0
123
124 #define IP6OPT_MUTABLE          0x20
125
126 /* Routing header */
127 struct ip6_rthdr {
128         guint8  ip6r_nxt;       /* next header */
129         guint8  ip6r_len;       /* length in units of 8 octets */
130         guint8  ip6r_type;      /* routing type */
131         guint8  ip6r_segleft;   /* segments left */
132         /* followed by routing type specific data */
133 };
134
135 /* Type 0 Routing header */
136 struct ip6_rthdr0 {
137         guint8  ip6r0_nxt;              /* next header */
138         guint8  ip6r0_len;              /* length in units of 8 octets */
139         guint8  ip6r0_type;             /* always zero */
140         guint8  ip6r0_segleft;  /* segments left */
141         guint8  ip6r0_reserved; /* reserved field */
142         guint8  ip6r0_slmap[3]; /* strict/loose bit map */
143         struct e_in6_addr  ip6r0_addr[1];       /* up to 23 addresses */
144 };
145
146 /* Fragment header */
147 struct ip6_frag {
148         guint8  ip6f_nxt;               /* next header */
149         guint8  ip6f_reserved;  /* reserved field */
150         guint16 ip6f_offlg;             /* offset, reserved, and flag */
151         guint32 ip6f_ident;             /* identification */
152 };
153
154 /* SHIM6 control message types */
155 #define SHIM6_TYPE_I1                   0x01    /* 0 000 0001 */
156 #define SHIM6_TYPE_R1                   0x02    /* 0 000 0010 */
157 #define SHIM6_TYPE_I2                   0x03    /* 0 000 0011 */
158 #define SHIM6_TYPE_R2                   0x04    /* 0 000 0100 */
159 #define SHIM6_TYPE_R1BIS                0x05    /* 0 000 0101 */
160 #define SHIM6_TYPE_I2BIS                0x06    /* 0 000 0110 */
161 #define SHIM6_TYPE_UPD_REQ              0x40    /* 0 100 0000 = 64 */
162 #define SHIM6_TYPE_UPD_ACK              0x41    /* 0 100 0001 = 65 */
163 #define SHIM6_TYPE_KEEPALIVE    0x42    /* 0 100 0010 = 66 */
164 #define SHIM6_TYPE_PROBE                0x43    /* 0 100 0011 = 67 */
165
166 /* SHIM6 Options */
167 #define SHIM6_OPT_RESPVAL       0x01    /* 0 000 0001 */
168 #define SHIM6_OPT_LOCLIST       0x02    /* 0 000 0010 */
169 #define SHIM6_OPT_LOCPREF       0x03    /* 0 000 0011 */
170 #define SHIM6_OPT_CGAPDM        0x04    /* 0 000 0100 */
171 #define SHIM6_OPT_CGASIG        0x05    /* 0 000 0101 */
172 #define SHIM6_OPT_ULIDPAIR      0x06    /* 0 000 0110 */
173 #define SHIM6_OPT_FII           0x07    /* 0 000 0111 */
174
175 /* SHIM6 Bitmasks */
176 #define SHIM6_BITMASK_P                 0x80    /* 1 000 0000 */
177 #define SHIM6_BITMASK_TYPE              0x7F    /* 0 111 1111 */
178 #define SHIM6_BITMASK_PROTOCOL  0x01    /* 0 000 0001 */
179 #define SHIM6_BITMASK_SPECIFIC  0xFE    /* 1 111 1110 */
180 #define SHIM6_BITMASK_R                 0x80    /* 1 000 0000 */
181 #define SHIM6_BITMASK_CT                0x7F    /* 0 111 1111 */
182 #define SHIM6_BITMASK_OPT_TYPE  0xFFFE  /* 1 111 1111    1 111 1110 */
183 #define SHIM6_BITMASK_CRITICAL  0x01    /* 0 000 0001 */
184 #define SHIM6_BITMASK_PRECVD    0xF0    /* 1 111 0000 */
185 #define SHIM6_BITMASK_PSENT             0x0F    /* 0 000 1111 */
186 #define SHIM6_BITMASK_STA               0xC0    /* 1 100 0000 */
187
188 /* SHIM6 Verification Methods */
189 #define SHIM6_VERIF_HBA                 0x01    /* 0 000 0001 */
190 #define SHIM6_VERIF_CGA                 0x02    /* 0 000 0010 */
191
192 /* SHIM6 Flags */
193 #define SHIM6_FLAG_BROKEN               0x01    /* 0 000 0001 */
194 #define SHIM6_FLAG_TEMPORARY    0x02    /* 0 000 0010 */
195
196 /* SHIM6 REAP States */
197 #define SHIM6_REAP_OPERATIONAL  0x00    /* 0 000 0000 */
198 #define SHIM6_REAP_EXPLORING    0x01    /* 0 000 0001 */
199 #define SHIM6_REAP_INBOUNDOK    0x02    /* 0 000 0010 */
200
201 /* SHIM6 header */
202 struct ip6_shim {
203         guint8  ip6s_nxt;               /* next header */
204         guint8  ip6s_len;               /* header extension length */
205         guint8  ip6s_p;                 /* P field and first 7 bits of remainder */
206         /* followed by shim6 specific data*/
207 };
208
209 #define IP6F_OFF_MASK           0xfff8  /* mask out offset from _offlg */
210 #define IP6F_RESERVED_MASK      0x0006  /* reserved bits in ip6f_offlg */
211 #define IP6F_MORE_FRAG          0x0001  /* more-fragments flag */
212
213 /*
214  * Definition for ICMPv6.
215  * RFC 1885
216  */
217
218 #define ICMPV6_PLD_MAXLEN       1232    /* IPV6_MMTU - sizeof(struct ip6_hdr)
219                                            - sizeof(struct icmp6_hdr) */
220
221 struct icmp6_hdr {
222         guint8  icmp6_type;     /* type field */
223         guint8  icmp6_code;     /* code field */
224         guint16 icmp6_cksum;    /* checksum field */
225         union {
226                 guint32 icmp6_un_data32[1]; /* type-specific field */
227                 guint16 icmp6_un_data16[2]; /* type-specific field */
228                 guint8  icmp6_un_data8[4];  /* type-specific field */
229         } icmp6_dataun;
230 };
231
232 #define icmp6_data32    icmp6_dataun.icmp6_un_data32
233 #define icmp6_data16    icmp6_dataun.icmp6_un_data16
234 #define icmp6_data8     icmp6_dataun.icmp6_un_data8
235 #define icmp6_pptr      icmp6_data32[0]         /* parameter prob */
236 #define icmp6_mtu       icmp6_data32[0]         /* packet too big */
237 #define icmp6_id        icmp6_data16[0]         /* echo request/reply */
238 #define icmp6_seq       icmp6_data16[1]         /* echo request/reply */
239 #define icmp6_maxdelay  icmp6_data16[0]         /* mcast group membership */
240
241 #define ICMP6_DST_UNREACH               1       /* dest unreachable, codes: */
242 #define ICMP6_PACKET_TOO_BIG            2       /* packet too big */
243 #define ICMP6_TIME_EXCEEDED             3       /* time exceeded, code: */
244 #define ICMP6_PARAM_PROB                4       /* ip6 header bad */
245
246 #define ICMP6_ECHO_REQUEST                      128     /* echo service */
247 #define ICMP6_ECHO_REPLY                        129     /* echo reply */
248 #define ICMP6_MEMBERSHIP_QUERY          130     /* group membership query */
249 #define MLD6_LISTENER_QUERY                     130     /* multicast listener query */
250 #define ICMP6_MEMBERSHIP_REPORT         131     /* group membership report */
251 #define MLD6_LISTENER_REPORT            131     /* multicast listener report */
252 #define ICMP6_MEMBERSHIP_REDUCTION      132     /* group membership termination */
253 #define MLD6_LISTENER_DONE                      132     /* multicast listener done */
254
255 #define ND_ROUTER_SOLICIT               133     /* router solicitation */
256 #define ND_ROUTER_ADVERT                134     /* router advertisment */
257 #define ND_NEIGHBOR_SOLICIT             135     /* neighbor solicitation */
258 #define ND_NEIGHBOR_ADVERT              136     /* neighbor advertisment */
259 #define ND_REDIRECT                             137     /* redirect */
260
261 #define ICMP6_ROUTER_RENUMBERING        138     /* router renumbering */
262
263 #define ICMP6_WRUREQUEST                        139     /* who are you request */
264 #define ICMP6_WRUREPLY                          140     /* who are you reply */
265 #define ICMP6_FQDN_QUERY                        139     /* FQDN query */
266 #define ICMP6_FQDN_REPLY                        140     /* FQDN reply */
267 #define ICMP6_NI_QUERY                          139     /* node information request */
268 #define ICMP6_NI_REPLY                          140     /* node information reply */
269 #define ICMP6_IND_SOLICIT                       141     /* Inverse ND Solicitation */
270 #define ICMP6_IND_ADVERT                        142     /* Inverse ND advertisement */
271 #define ICMP6_MLDV2_REPORT                      143     /* MLD v2 report message : [RFC3810] */
272
273 #define ICMP6_MIP6_DHAAD_REQUEST        144     /* Mobile IPv6 DHAAD */
274 #define ICMP6_MIP6_DHAAD_REPLY          145     /* Mobile IPv6 DHAAD */
275 #define ICMP6_MIP6_MPS                          146     /* Mobile IPv6 MPS */
276 #define ICMP6_MIP6_MPA                          147     /* Mobile IPv6 MPA */
277 #define ICMP6_CERT_PATH_SOL                     148 /* Certification Path Solicitation Message          [RFC3971] */
278 #define ICMP6_CERT_PATH_AD                      149 /* Certification Path Advertisement Message         [RFC3971] */
279 #define ICMP6_EXPERIMENTAL_MOBILITY     150     /* ICMP Experimental Mobility Protocol Type */
280
281 #define ICMP6_MCAST_ROUTER_ADVERT               151 /* Multicast Router Advertisement                   [RFC4286] */
282 #define ICMP6_MCAST_ROUTER_SOLICIT              152 /* Multicast Router Solicitation                    [RFC4286] */
283 #define ICMP6_MCAST_ROUTER_TERM                 153 /* Multicast Router Termination                     [RFC4286] */
284 #define ICMP6_FMIPV6_MESSAGES                   154 /* FMIPv6 Messages       [RFC-ietf-mipshop-rfc5268bis-01.txt] */
285 #define ICMP6_RPL_CONTROL               155 /* RPL control messages  [draft-ietf-roll-rpl-12.txt] */
286                                             /* (Pending IANA Assignment) */
287
288 #define ICMP6_DST_UNREACH_NOROUTE               0       /* no route to destination */
289 #define ICMP6_DST_UNREACH_ADMIN                 1       /* administratively prohibited */
290 #define ICMP6_DST_UNREACH_NOTNEIGHBOR   2       /* not a neighbor(obsolete) */
291 #define ICMP6_DST_UNREACH_BEYONDSCOPE   2       /* beyond scope of source address */
292 #define ICMP6_DST_UNREACH_ADDR                  3       /* address unreachable */
293 #define ICMP6_DST_UNREACH_NOPORT                4       /* port unreachable */
294 #define ICMP6_DST_UNREACH_INGR_EGR              5       /* source address failed ingress/egress policy */
295 #define ICMP6_DST_UNREACH_REJECT                6       /* reject route to destination */
296
297 #define ICMP6_TIME_EXCEED_TRANSIT               0       /* ttl==0 in transit */
298 #define ICMP6_TIME_EXCEED_REASSEMBLY    1       /* ttl==0 in reass */
299
300 #define ICMP6_PARAMPROB_HEADER                  0       /* erroneous header field */
301 #define ICMP6_PARAMPROB_NEXTHEADER              1       /* unrecognized next header */
302 #define ICMP6_PARAMPROB_OPTION                  2       /* unrecognized option */
303
304 #define ICMP6_INFOMSG_MASK              0x80    /* all informational messages */
305
306 #define ICMP6_NI_SUBJ_IPV6      0       /* Query Subject is an IPv6 address */
307 #define ICMP6_NI_SUBJ_FQDN      1       /* Query Subject is a Domain name */
308 #define ICMP6_NI_SUBJ_IPV4      2       /* Query Subject is an IPv4 address */
309
310 #define ICMP6_NI_SUCCESS        0       /* node information successful reply */
311 #define ICMP6_NI_REFUSED        1       /* node information request is refused */
312 #define ICMP6_NI_UNKNOWN        2       /* unknown Qtype */
313
314 #define ICMP6_ROUTER_RENUMBERING_COMMAND  0     /* rr command */
315 #define ICMP6_ROUTER_RENUMBERING_RESULT   1     /* rr result */
316 #define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET   255     /* rr seq num reset */
317
318
319 /*
320  * Neighbor Discovery
321  */
322
323 struct nd_router_solicit {      /* router solicitation */
324         struct icmp6_hdr        nd_rs_hdr;
325         /* could be followed by options */
326 };
327
328 #define nd_rs_type      nd_rs_hdr.icmp6_type
329 #define nd_rs_code      nd_rs_hdr.icmp6_code
330 #define nd_rs_cksum     nd_rs_hdr.icmp6_cksum
331 #define nd_rs_reserved  nd_rs_hdr.icmp6_data32[0]
332
333 struct nd_router_advert {       /* router advertisement */
334         struct icmp6_hdr        nd_ra_hdr;
335         guint32         nd_ra_reachable;        /* reachable time */
336         guint32         nd_ra_retransmit;       /* retransmit timer */
337         /* could be followed by options */
338 };
339
340 #define nd_ra_type              nd_ra_hdr.icmp6_type
341 #define nd_ra_code              nd_ra_hdr.icmp6_code
342 #define nd_ra_cksum             nd_ra_hdr.icmp6_cksum
343 #define nd_ra_curhoplimit       nd_ra_hdr.icmp6_data8[0]
344 #define nd_ra_flags_reserved    nd_ra_hdr.icmp6_data8[1]
345 #define ND_RA_FLAG_MANAGED      0x80
346 #define ND_RA_FLAG_OTHER        0x40
347 #define ND_RA_FLAG_HOME_AGENT   0x20
348
349 /*
350  * Router preference values based on RFC4191.
351  */
352 #define ND_RA_FLAG_RTPREF_MASK  0x18 /* 00011000 */
353 #define ND_RA_FLAG_RESERV_MASK  0xE7 /* 11100111 */
354
355 #define ND_RA_FLAG_RTPREF_HIGH          0x01
356 #define ND_RA_FLAG_RTPREF_MEDIUM        0x00
357 #define ND_RA_FLAG_RTPREF_LOW           0x03
358 #define ND_RA_FLAG_RTPREF_RSV           0x02
359
360 #define ND_RA_FLAG_ND_PROXY     0x04 /* RFC 4389 */
361
362 #define nd_ra_router_lifetime   nd_ra_hdr.icmp6_data16[1]
363
364 struct nd_neighbor_solicit {    /* neighbor solicitation */
365         struct icmp6_hdr        nd_ns_hdr;
366         struct e_in6_addr               nd_ns_target;   /*target address */
367         /* could be followed by options */
368 };
369
370 #define nd_ns_type              nd_ns_hdr.icmp6_type
371 #define nd_ns_code              nd_ns_hdr.icmp6_code
372 #define nd_ns_cksum             nd_ns_hdr.icmp6_cksum
373 #define nd_ns_reserved          nd_ns_hdr.icmp6_data32[0]
374
375 struct nd_neighbor_advert {     /* neighbor advertisement */
376         struct icmp6_hdr        nd_na_hdr;
377         struct e_in6_addr               nd_na_target;   /* target address */
378         /* could be followed by options */
379 };
380
381 #define nd_na_type              nd_na_hdr.icmp6_type
382 #define nd_na_code              nd_na_hdr.icmp6_code
383 #define nd_na_cksum             nd_na_hdr.icmp6_cksum
384 #define nd_na_flags_reserved    nd_na_hdr.icmp6_data32[0]
385 #define ND_NA_FLAG_ROUTER               0x80000000
386 #define ND_NA_FLAG_SOLICITED            0x40000000
387 #define ND_NA_FLAG_OVERRIDE             0x20000000
388
389 struct nd_redirect {            /* redirect */
390         struct icmp6_hdr        nd_rd_hdr;
391         struct e_in6_addr               nd_rd_target;   /* target address */
392         struct e_in6_addr               nd_rd_dst;      /* destination address */
393         /* could be followed by options */
394 };
395
396
397 #define ND_OPT_PI_FLAG_ONLINK           0x80
398 #define ND_OPT_PI_FLAG_AUTO             0x40
399 #define ND_OPT_PI_FLAG_ROUTER           0x20
400 #define ND_OPT_PI_FLAG_SITEPREF         0x10
401
402 #define ND_OPT_MAP_FLAG_R       0x80
403 #define ND_OPT_MAP_FLAG_M       0x40
404 #define ND_OPT_MAP_FLAG_I       0x20
405 #define ND_OPT_MAP_FLAG_T       0x10
406 #define ND_OPT_MAP_FLAG_P       0x08
407 #define ND_OPT_MAP_FLAG_V       0x04
408
409 #define ND_OPT_6CO_FLAG_C        0x10
410 #define ND_OPT_6CO_FLAG_CID      0x0F
411 #define ND_OPT_6CO_FLAG_RESERVED 0xE0
412
413 /*
414  * icmp6 node information
415  */
416 struct icmp6_nodeinfo {
417         struct icmp6_hdr icmp6_ni_hdr;
418         guint8 icmp6_ni_nonce[8];
419         /* could be followed by reply data */
420 };
421
422 #define ni_type         icmp6_ni_hdr.icmp6_type
423 #define ni_code         icmp6_ni_hdr.icmp6_code
424 #define ni_cksum        icmp6_ni_hdr.icmp6_cksum
425 #define ni_qtype        icmp6_ni_hdr.icmp6_data16[0]
426 #define ni_flags        icmp6_ni_hdr.icmp6_data16[1]
427
428 /*
429  * FMIPv6
430  */
431
432 #define FMIP6_SUBTYPE_RTSOLPR   2   /* Router Solicitation for Proxy Advertisement                  */
433 #define FMIP6_RTSOLPR_CODE      0   /* Currently the only code for RTSOLPR                          */
434
435 #define FMIP6_SUBTYPE_PRRTADV   3   /* Proxy Router Advertisement                                   */
436 #define FMIP6_PRRTADV_MNTUP     0   /* MN should use AP-ID, AR-info tuple                           */
437 #define FMIP6_PRRTADV_NI_HOVER  1   /* LLA of the AP is present, Network Initiated Handover trigger */
438 #define FMIP6_PRRTADV_NORTINFO  2   /* No new router information is present                         */
439 #define FMIP6_PRRTADV_LIMRTINFO 3   /* Limited new router information is present                    */
440 #define FMIP6_PRRTADV_UNSOL     4   /* Subnet info for neighbor Access Points are sent unsolicited  */
441
442 #define FMIP6_SUBTYPE_HI        4   /* Handover Initiate                                            */
443 #define FMIP6_HI_PCOA           0   /* PAR receives FBU with PCoA as source IP address              */
444 #define FMIP6_HI_NOTPCOA        1   /* PAR receives FBU whose source IP address is not PCoA         */
445
446 #define FMIP6_SUBTYPE_HACK      5   /* Handover Acknowledge                                         */
447 #define FMIP6_HACK_VALID        0   /* Handover Accepted, NCoA valid                                */
448 #define FMIP6_HACK_INVALID      1   /* Handover Accepted, NCoA not valid                            */
449 #define FMIP6_HACK_INUSE        2   /* Handover Accepted, NCoA in use                               */
450 #define FMIP6_HACK_ASSIGNED     3   /* Handover Accepted, NCoA assigned                             */
451 #define FMIP6_HACK_NOTASSIGNED  4   /* Handover Accepted, NCoA not assigned                         */
452 #define FMIP6_HACK_NOTACCEPTED  128 /* Handover Not Accepted, reason unspecified                    */
453 #define FMIP6_HACK_PROHIBITED   129 /* Administratively prohibited                                  */
454 #define FMIP6_HACK_INSUFFICIENT 130 /* Insufficient resources                                       */
455
456 /* Fast Handover Mobile IPv6 extension: Router Solicitation for Proxy Advertisement (RtSolPr).  */
457 struct fmip6_rtsolpr {
458         struct icmp6_hdr fmip6_rtsolpr_hdr;
459 };
460 #define fmip6_rtsolpr_type     fmip6_rtsolpr_hdr.icmp6_type
461 #define fmip6_rtsolpr_code     fmip6_rtsolpr_hdr.icmp6_code
462 #define fmip6_rtsolpr_cksum    fmip6_rtsolpr_hdr.icmp6_cksum
463 #define fmip6_rtsolpr_subtype  fmip6_rtsolpr_hdr.icmp6_data8[0]
464 #define fmip6_rtsolpr_reserved fmip6_rtsolpr_hdr.icmp6_data8[1]
465 #define fmip6_rtsolpr_id       fmip6_rtsolpr_hdr.icmp6_data16[1]
466
467 /* Fast Handover Mobile IPv6 extension: Proxy Router Advertisement (PrRtAdv).  */
468 struct fmip6_prrtadv {
469         struct icmp6_hdr fmip6_prrtadv_hdr;
470 };
471
472 #define fmip6_prrtadv_type     fmip6_prrtadv_hdr.icmp6_type
473 #define fmip6_prrtadv_code     fmip6_prrtadv_hdr.icmp6_code
474 #define fmip6_prrtadv_cksum    fmip6_prrtadv_hdr.icmp6_cksum
475 #define fmip6_prrtadv_subtype  fmip6_prrtadv_hdr.icmp6_data8[0]
476 #define fmip6_prrtadv_reserved fmip6_prrtadv_hdr.icmp6_data8[1]
477 #define fmip6_prrtadv_id       fmip6_prrtadv_hdr.icmp6_data16[1]
478
479 /* Fast Handover Mobile IPv6 extension: Handover Initiate (HI).  */
480 struct fmip6_hi {
481         struct icmp6_hdr fmip6_hi_hdr;
482 };
483
484 #define fmip6_hi_type           fmip6_hi_hdr.icmp6_type
485 #define fmip6_hi_code           fmip6_hi_hdr.icmp6_code
486 #define fmip6_hi_cksum          fmip6_hi_hdr.icmp6_cksum
487 #define fmip6_hi_subtype        fmip6_hi_hdr.icmp6_data8[0]
488 #define fmip6_hi_flags_reserved fmip6_hi_hdr.icmp6_data8[1]
489 #define fmip6_hi_id             fmip6_hi_hdr.icmp6_data16[1]
490
491 #define FMIP_HI_FLAG_ASSIGNED 0x80
492 #define FMIP_HI_FLAG_BUFFER   0x40
493
494 /* Fast Handover Mobile IPv6 extension: Handover Acknowledge (HAck).  */
495 struct fmip6_hack {
496         struct icmp6_hdr fmip6_hack_hdr;
497 };
498
499 #define fmip6_hack_type         fmip6_hack_hdr.icmp6_type
500 #define fmip6_hack_code         fmip6_hack_hdr.icmp6_code
501 #define fmip6_hack_cksum        fmip6_hack_hdr.icmp6_cksum
502 #define fmip6_hack_subtype      fmip6_hack_hdr.icmp6_data8[0]
503 #define fmip6_hack_reserved     fmip6_hack_hdr.icmp6_data8[1]
504 #define fmip6_hack_id           fmip6_hack_hdr.icmp6_data16[1]
505
506
507 struct fmip6_opt_hdr {
508     guint8 fmip6_opt_type;
509     guint8 fmip6_opt_len;     /* size of this option in 8 octets including opt_hdr */
510     guint8 fmip6_opt_optcode; /* Option-Code see the definition below              */
511 };
512
513
514
515 void capture_ipv6(const guchar *, int, int, packet_counts *);
516
517
518 #endif /* __PACKET_IPV6_H_DEFINED__ */