Get rid of get_ber_last_reated_item() and fix dissection of wIN-TriggerList.
[obnox/wireshark/wip.git] / epan / dissectors / packet-mip6.h
1 /* packet-mip6.h
2  *
3  * $Id$
4  *
5  * Definitions for Mobile IPv6 dissection (RFC 3775)
6  * and Fast Handover for Mobile IPv6 (FMIPv6, RFC 4068)
7  * Copyright 2003 Oy L M Ericsson Ab <teemu.rinta-aho@ericsson.fi>
8  *
9  * FMIPv6 support added by Martin Andre <andre@clarinet.u-strasbg.fr>
10  * Copyright 2006, Nicolas DICHTEL - 6WIND - <nicolas.dichtel@6wind.com>
11  *
12  * Modifications for NEMO packets (RFC 3963): Bruno Deniaud
13  * (bdeniaud@irisa.fr, nono@chez.com) 12 Oct 2005
14  *
15  * Wireshark - Network traffic analyzer
16  * By Gerald Combs <gerald@wireshark.org>
17  * Copyright 1998 Gerald Combs
18  *
19  * This program is free software; you can redistribute it and/or
20  * modify it under the terms of the GNU General Public License
21  * as published by the Free Software Foundation; either version 2
22  * of the License, or (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program; if not, write to the Free Software
31  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32  */
33
34 #ifndef __PACKET_MIP6_H_DEFINED__
35 #define __PACKET_MIP6_H_DEFINED__
36
37 /* Mobility Header types */
38 typedef enum {
39         BRR  = 0,
40         HOTI = 1,
41         COTI = 2,
42         HOT  = 3,
43         COT  = 4,
44         BU   = 5,
45         BA   = 6,
46         BE    = 7,
47         FBU   = 8,
48         FBACK = 9,
49         FNA   = 10
50 } mhTypes;
51
52 static const value_string mip6_mh_types[] = {
53         {BRR,   "Binding Refresh Request"},
54         {HOTI,  "Home Test Init"},
55         {COTI,  "Care-of Test Init"},
56         {HOT,   "Home Test"},
57         {COT,   "Care-of Test"},
58         {BU,    "Binding Update"},
59         {BA,    "Binding Acknowledgement"},
60         {BE,    "Binding Error"},
61         {FBU,   "Fast Binding Update"},
62         {FBACK, "Fast Binding Acknowledgment"},
63         {FNA,   "Fast Neighbor Advertisement"},
64         {0,     NULL}
65 };
66
67 /* Mobility Option types */
68 typedef enum {
69         PAD1 = 0,
70         PADN = 1,
71         BRA  = 2,
72         ACOA = 3,
73         NI   = 4,
74         BAD  = 5,
75         MNP  = 6,
76         LLA  = 7,
77         MNID = 8,
78         HNP  = 9,   /* temporary value, not yet defined by IANA */
79         TS   = 10   /* temporary value, not yet defined by IANA */
80 } optTypes;
81
82 /* Binding Update flag description */
83 static const true_false_string mip6_bu_a_flag_value = {
84         "Binding Acknowledgement requested",
85         "Binding Acknowledgement not requested"
86 };
87
88 static const true_false_string mip6_bu_h_flag_value = {
89         "Home Registration",
90         "No Home Registration"
91 };
92
93 static const true_false_string mip6_bu_l_flag_value = {
94         "Link-Local Address Compatibility",
95         "No Link-Local Address Compatibility"
96 };
97
98 static const true_false_string mip6_bu_k_flag_value = {
99         "Key Management Mobility Compatibility",
100         "No Key Management Mobility Compatibility"
101 };
102
103 static const true_false_string mip6_bu_m_flag_value = {
104         "MAP Registration Compatibility",
105         "No MAP Registration Compatibility",
106 };
107
108 static const true_false_string nemo_bu_r_flag_value = {
109         "Mobile Router Compatibility",
110         "No Mobile Router Compatibility"
111 };
112
113 static const true_false_string proxy_bu_p_flag_value = {
114         "Proxy Registration",
115         "No Proxy Registration"
116 };
117
118 /* Binding Acknowledgement status values */
119 static const value_string mip6_ba_status_value[] = {
120         {   0, "Binding Update accepted" },
121         {   1, "Accepted but prefix discovery necessary" },
122         { 128, "Reason unspecified" },
123         { 129, "Administratively prohibited" },
124         { 130, "Insufficient resources" },
125         { 131, "Home registration not supported" },
126         { 132, "Not home subnet" },
127         { 133, "Not home agent for this mobile node" },
128         { 134, "Duplicate Address Detection failed" },
129         { 135, "Sequence number out of window" },
130         { 136, "Expired home nonce index" },
131         { 137, "Expired care-of nonce index" },
132         { 138, "Expired nonces" },
133         { 139, "Registration type change disallowed" },
134         { 140, "Mobile Router Operation not permitted" },
135         { 141, "Invalid Prefix" },
136         { 142, "Not Authorized for Prefix" },
137         { 143, "Mobile Network Prefix information unavailable" },
138         { 145, "Proxy Registration not supported by the LMA" },
139         { 146, "Proxy Registrations from this MAG not allowed" },
140         { 147, "No home address for this NAI" },
141         { 148, "Invalid Time Stamp Option" },
142         {   0, NULL }
143 };
144
145 /* Binding Error status values */
146 static const value_string mip6_be_status_value[] = {
147         { 1, "Unknown binding for Home Address destination option" },
148         { 2, "Unrecognized MH type value" },
149         { 0, NULL }
150 };
151
152 /* Fast Binding Update flag description */
153 static const true_false_string fmip6_fbu_a_flag_value = {
154         "Fast Binding Acknowledgement requested",
155         "Fast Binding Acknowledgement not requested"
156 };
157
158 static const true_false_string fmip6_fbu_h_flag_value = {
159         "Home Registration",
160         "No Home Registration"
161 };
162
163 static const true_false_string fmip6_fbu_l_flag_value = {
164         "Link-Local Address Compatibility",
165         "No Link-Local Address Compatibility"
166 };
167
168 static const true_false_string fmip6_fbu_k_flag_value = {
169         "Key Management Mobility Compatibility",
170         "No Key Management Mobility Compatibility"
171 };
172
173 /* Fast Binding Acknowledgement status values */
174 static const value_string fmip6_fback_status_value[] = {
175         {   0, "Fast Binding Update accepted" },
176         {   1, "Accepted but use supplied NCoA" },
177         { 128, "Reason unspecified" },
178         { 129, "Administratively prohibited" },
179         { 130, "Insufficient resources" },
180         { 131, "Incorrect interface identifier length" },
181         {   0, NULL }
182 };
183
184 /* MH LLA Option code */
185 static const value_string fmip6_lla_optcode_value[] = {
186         {   2, "Link Layer Address of the MN" },
187         {   0, NULL }
188 };
189
190 /* Mobile Node Identifier Option code */
191 static const value_string mip6_mnid_subtype_value[] = {
192         {   1, "Network Access Identifier (NAI)" },
193         {   0, NULL }
194 };
195
196 /* Message lengths */
197 #define MIP6_BRR_LEN          2
198 #define MIP6_HOTI_LEN        10
199 #define MIP6_COTI_LEN        10
200 #define MIP6_HOT_LEN         18
201 #define MIP6_COT_LEN         18
202 #define MIP6_BU_LEN           6
203 #define MIP6_BA_LEN           6
204 #define MIP6_BE_LEN          18
205 #define FMIP6_FBU_LEN         6
206 #define FMIP6_FBACK_LEN       6
207 #define FMIP6_FNA_LEN         2
208
209 /* Field offsets & lengths for mobility headers */
210 #define MIP6_PROTO_OFF        0
211 #define MIP6_HLEN_OFF         1
212 #define MIP6_TYPE_OFF         2
213 #define MIP6_RES_OFF          3
214 #define MIP6_CSUM_OFF         4
215 #define MIP6_DATA_OFF         6
216 #define MIP6_PROTO_LEN        1
217 #define MIP6_HLEN_LEN         1
218 #define MIP6_TYPE_LEN         1
219 #define MIP6_RES_LEN          1
220 #define MIP6_CSUM_LEN         2
221
222 #define MIP6_BRR_RES_OFF      6
223 #define MIP6_BRR_OPTS_OFF     8
224 #define MIP6_BRR_RES_LEN      2
225
226 #define MIP6_HOTI_RES_OFF     6
227 #define MIP6_HOTI_COOKIE_OFF  8
228 #define MIP6_HOTI_OPTS_OFF   16
229 #define MIP6_HOTI_RES_LEN     2
230 #define MIP6_HOTI_COOKIE_LEN  8
231
232 #define MIP6_COTI_RES_OFF     6
233 #define MIP6_COTI_COOKIE_OFF  8
234 #define MIP6_COTI_OPTS_OFF   16
235 #define MIP6_COTI_RES_LEN     2
236 #define MIP6_COTI_COOKIE_LEN  8
237
238 #define MIP6_HOT_INDEX_OFF    6
239 #define MIP6_HOT_COOKIE_OFF   8
240 #define MIP6_HOT_TOKEN_OFF   16
241 #define MIP6_HOT_OPTS_OFF    24
242 #define MIP6_HOT_INDEX_LEN    2
243 #define MIP6_HOT_COOKIE_LEN   8
244 #define MIP6_HOT_TOKEN_LEN    8
245
246 #define MIP6_COT_INDEX_OFF    6
247 #define MIP6_COT_COOKIE_OFF   8
248 #define MIP6_COT_TOKEN_OFF   16
249 #define MIP6_COT_OPTS_OFF    24
250 #define MIP6_COT_INDEX_LEN    2
251 #define MIP6_COT_COOKIE_LEN   8
252 #define MIP6_COT_TOKEN_LEN    8
253
254 #define MIP6_BU_SEQNR_OFF     6
255 #define MIP6_BU_FLAGS_OFF     8
256 #define MIP6_BU_RES_OFF       9
257 #define MIP6_BU_LIFETIME_OFF 10
258 #define MIP6_BU_OPTS_OFF     12
259 #define MIP6_BU_SEQNR_LEN     2
260 #define MIP6_BU_FLAGS_LEN     1
261 #define MIP6_BU_RES_LEN       1
262 #define MIP6_BU_LIFETIME_LEN  2
263
264 #define MIP6_BA_STATUS_OFF    6
265 #define MIP6_BA_FLAGS_OFF     7
266 #define MIP6_BA_SEQNR_OFF     8
267 #define MIP6_BA_LIFETIME_OFF 10
268 #define MIP6_BA_OPTS_OFF     12
269 #define MIP6_BA_STATUS_LEN    1
270 #define MIP6_BA_FLAGS_LEN     1
271 #define MIP6_BA_SEQNR_LEN     2
272 #define MIP6_BA_LIFETIME_LEN  2
273
274 #define MIP6_BE_STATUS_OFF    6
275 #define MIP6_BE_RES_OFF       7
276 #define MIP6_BE_HOA_OFF       8
277 #define MIP6_BE_OPTS_OFF     24
278 #define MIP6_BE_STATUS_LEN    1
279 #define MIP6_BE_RES_LEN       1
280 #define MIP6_BE_HOA_LEN      16
281
282 #define FMIP6_FBU_SEQNR_OFF     6
283 #define FMIP6_FBU_FLAGS_OFF     8
284 #define FMIP6_FBU_RES_OFF       9
285 #define FMIP6_FBU_LIFETIME_OFF 10
286 #define FMIP6_FBU_OPTS_OFF     12
287 #define FMIP6_FBU_SEQNR_LEN     2
288 #define FMIP6_FBU_FLAGS_LEN     1
289 #define FMIP6_FBU_RES_LEN       1
290 #define FMIP6_FBU_LIFETIME_LEN  2
291
292 #define FMIP6_FBACK_STATUS_OFF    6
293 #define FMIP6_FBACK_FLAGS_OFF     7
294 #define FMIP6_FBACK_SEQNR_OFF     8
295 #define FMIP6_FBACK_LIFETIME_OFF 10
296 #define FMIP6_FBACK_OPTS_OFF     12
297 #define FMIP6_FBACK_STATUS_LEN    1
298 #define FMIP6_FBACK_FLAGS_LEN     1
299 #define FMIP6_FBACK_SEQNR_LEN     2
300 #define FMIP6_FBACK_LIFETIME_LEN  2
301
302 #define FMIP6_FNA_RES_OFF     6
303 #define FMIP6_FNA_OPTS_OFF    8
304 #define FMIP6_FNA_RES_LEN     2
305
306 /* Field offsets & field and option lengths for mobility options.
307  * The option length does *not* include the option type and length
308  * fields.  The field offsets, however, do include the type and
309  * length fields. */
310 #define MIP6_BRA_LEN          2
311 #define MIP6_BRA_RI_OFF       2
312 #define MIP6_BRA_RI_LEN       2
313
314 #define MIP6_ACOA_LEN        16
315 #define MIP6_ACOA_ACOA_OFF    2
316 #define MIP6_ACOA_ACOA_LEN   16
317
318 #define NEMO_MNP_LEN         18
319 #define NEMO_MNP_PL_OFF       3
320 #define NEMO_MNP_MNP_OFF      4
321 #define NEMO_MNP_MNP_LEN     16
322
323 #define MIP6_NI_LEN           4
324 #define MIP6_NI_HNI_OFF       2
325 #define MIP6_NI_CNI_OFF       4
326 #define MIP6_NI_HNI_LEN       2
327 #define MIP6_NI_CNI_LEN       2
328
329 #define MIP6_BAD_AUTH_OFF     2
330
331 #define FMIP6_LLA_MINLEN      1
332 #define FMIP6_LLA_OPTCODE_OFF 2
333 #define FMIP6_LLA_LLA_OFF     3
334 #define FMIP6_LLA_OPTCODE_LEN 1
335
336 #define MIP6_MNID_MINLEN      2
337 #define MIP6_MNID_SUBTYPE_OFF 2
338 #define MIP6_MNID_SUBTYPE_LEN 1
339 #define MIP6_MNID_MNID_OFF    3
340
341 #define PMIP6_TS_LEN          8
342
343 #endif /* __PACKET_MIP6_H_DEFINED__ */