HACK: 2nd try to match RowsetProperties
[wireshark-wip.git] / epan / dissectors / packet-ipv6.h
blob8226d1b2bf543382cf4d53498c5d75a366a102b2
1 /* packet-ipv6.h
2 * Definitions for IPv6 packet disassembly
4 * $Id$
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #ifndef __PACKET_IPV6_H_DEFINED__
27 #define __PACKET_IPV6_H_DEFINED__
29 #include <epan/ipv6-utils.h>
31 /* this definition makes trouble with Microsoft Platform SDK: ws2tcpip.h and is used nowhere */
32 /*#define INET6_ADDRSTRLEN 46*/
35 * Definition for internet protocol version 6.
36 * RFC 2460
38 struct ip6_hdr {
39 union {
40 struct ip6_hdrctl {
41 guint32 ip6_un1_flow; /* version, class, flow */
42 guint16 ip6_un1_plen; /* payload length */
43 guint8 ip6_un1_nxt; /* next header */
44 guint8 ip6_un1_hlim; /* hop limit */
45 } ip6_un1;
46 guint8 ip6_un2_vfc; /* 4 bits version, 4 bits class */
47 } ip6_ctlun;
48 struct e_in6_addr ip6_src; /* source address */
49 struct e_in6_addr ip6_dst; /* destination address */
52 #define ip6_vfc ip6_ctlun.ip6_un2_vfc
53 #define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow
54 #define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen
55 #define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt
56 #define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim
57 #define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim
59 /* Offsets of fields within an IPv6 header. */
60 #define IP6H_CTL 0
61 #define IP6H_CTL_FLOW 0
62 #define IP6H_CTL_PLEN 4
63 #define IP6H_CTL_NXT 6
64 #define IP6H_CTL_HLIM 7
65 #define IP6H_CTL_VFC 0
66 #define IP6H_SRC 8
67 #define IP6H_DST 24
69 #define IPV6_FLOWINFO_MASK 0x0fffffff /* flow info (28 bits) */
70 #define IPV6_FLOWLABEL_MASK 0x000fffff /* flow label (20 bits) */
73 * Extension Headers
76 struct ip6_ext {
77 guchar ip6e_nxt;
78 guchar ip6e_len;
81 /* Routing header */
82 struct ip6_rthdr {
83 guint8 ip6r_nxt; /* next header */
84 guint8 ip6r_len; /* length in units of 8 octets */
85 guint8 ip6r_type; /* routing type */
86 guint8 ip6r_segleft; /* segments left */
87 /* followed by routing type specific data */
90 /* Type 0 Routing header */
91 struct ip6_rthdr0 {
92 guint8 ip6r0_nxt; /* next header */
93 guint8 ip6r0_len; /* length in units of 8 octets */
94 guint8 ip6r0_type; /* always zero */
95 guint8 ip6r0_segleft; /* segments left */
96 guint8 ip6r0_reserved; /* reserved field */
97 guint8 ip6r0_slmap[3]; /* strict/loose bit map */
98 struct e_in6_addr ip6r0_addr[1]; /* up to 23 addresses */
101 /* Fragment header */
102 struct ip6_frag {
103 guint8 ip6f_nxt; /* next header */
104 guint8 ip6f_reserved; /* reserved field */
105 guint16 ip6f_offlg; /* offset, reserved, and flag */
106 guint32 ip6f_ident; /* identification */
109 /* SHIM6 control message types */
110 #define SHIM6_TYPE_I1 0x01 /* 0 000 0001 */
111 #define SHIM6_TYPE_R1 0x02 /* 0 000 0010 */
112 #define SHIM6_TYPE_I2 0x03 /* 0 000 0011 */
113 #define SHIM6_TYPE_R2 0x04 /* 0 000 0100 */
114 #define SHIM6_TYPE_R1BIS 0x05 /* 0 000 0101 */
115 #define SHIM6_TYPE_I2BIS 0x06 /* 0 000 0110 */
116 #define SHIM6_TYPE_UPD_REQ 0x40 /* 0 100 0000 = 64 */
117 #define SHIM6_TYPE_UPD_ACK 0x41 /* 0 100 0001 = 65 */
118 #define SHIM6_TYPE_KEEPALIVE 0x42 /* 0 100 0010 = 66 */
119 #define SHIM6_TYPE_PROBE 0x43 /* 0 100 0011 = 67 */
121 /* SHIM6 Options */
122 #define SHIM6_OPT_RESPVAL 0x01 /* 0 000 0001 */
123 #define SHIM6_OPT_LOCLIST 0x02 /* 0 000 0010 */
124 #define SHIM6_OPT_LOCPREF 0x03 /* 0 000 0011 */
125 #define SHIM6_OPT_CGAPDM 0x04 /* 0 000 0100 */
126 #define SHIM6_OPT_CGASIG 0x05 /* 0 000 0101 */
127 #define SHIM6_OPT_ULIDPAIR 0x06 /* 0 000 0110 */
128 #define SHIM6_OPT_FII 0x07 /* 0 000 0111 */
130 /* SHIM6 Bitmasks */
131 #define SHIM6_BITMASK_P 0x80 /* 1 000 0000 */
132 #define SHIM6_BITMASK_TYPE 0x7F /* 0 111 1111 */
133 #define SHIM6_BITMASK_PROTOCOL 0x01 /* 0 000 0001 */
134 #define SHIM6_BITMASK_SPECIFIC 0xFE /* 1 111 1110 */
135 #define SHIM6_BITMASK_R 0x80 /* 1 000 0000 */
136 #define SHIM6_BITMASK_CT 0x7F /* 0 111 1111 */
137 #define SHIM6_BITMASK_OPT_TYPE 0xFFFE /* 1 111 1111 1 111 1110 */
138 #define SHIM6_BITMASK_CRITICAL 0x01 /* 0 000 0001 */
139 #define SHIM6_BITMASK_PRECVD 0xF0 /* 1 111 0000 */
140 #define SHIM6_BITMASK_PSENT 0x0F /* 0 000 1111 */
141 #define SHIM6_BITMASK_STA 0xC0 /* 1 100 0000 */
143 /* SHIM6 Verification Methods */
144 #define SHIM6_VERIF_HBA 0x01 /* 0 000 0001 */
145 #define SHIM6_VERIF_CGA 0x02 /* 0 000 0010 */
147 /* SHIM6 Flags */
148 #define SHIM6_FLAG_BROKEN 0x01 /* 0 000 0001 */
149 #define SHIM6_FLAG_TEMPORARY 0x02 /* 0 000 0010 */
151 /* SHIM6 REAP States */
152 #define SHIM6_REAP_OPERATIONAL 0x00 /* 0 000 0000 */
153 #define SHIM6_REAP_EXPLORING 0x01 /* 0 000 0001 */
154 #define SHIM6_REAP_INBOUNDOK 0x02 /* 0 000 0010 */
156 /* SHIM6 header */
157 struct ip6_shim {
158 guint8 ip6s_nxt; /* next header */
159 guint8 ip6s_len; /* header extension length */
160 guint8 ip6s_p; /* P field and first 7 bits of remainder */
161 /* followed by shim6 specific data*/
164 #define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */
165 #define IP6F_OFF_SHIFT 3 /* right-shift offset by this many bits */
166 #define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */
167 #define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */
169 #ifdef __cplusplus
170 extern "C" {
171 #endif /* __cplusplus */
173 void capture_ipv6(const guchar *, int, int, packet_counts *);
175 #ifdef __cplusplus
177 #endif /* __cplusplus */
179 #endif /* __PACKET_IPV6_H_DEFINED__ */