Rename "proto_alloc_dfilter_string()" to
[obnox/wireshark/wip.git] / packet-mip6.h
1 /* packet-mip6.h
2  *
3  * $Id: packet-mip6.h,v 1.1 2003/02/04 20:16:57 guy Exp $
4  *
5  * Definitions for Mobile IPv6 dissection (draft-ietf-mobileip-ipv6-20.txt)
6  * Copyright 2003 Oy L M Ericsson Ab <teemu.rinta-aho@ericsson.fi>
7  *
8  * Ethereal - Network traffic analyzer
9  * By Gerald Combs <gerald@ethereal.com>
10  * Copyright 1998 Gerald Combs
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25  */
26
27 #ifndef __PACKET_MIP6_H_DEFINED__
28 #define __PACKET_MIP6_H_DEFINED__
29
30 /* Mobility Header types */
31 typedef enum {
32     BRR  = 0,
33     HOTI = 1,
34     COTI = 2,
35     HOT  = 3,
36     COT  = 4,
37     BU   = 5,
38     BA   = 6,
39     BE   = 7
40 } mhTypes;
41
42 static const value_string mip6_mh_types[] = {
43     {BRR,  "Binding Refresh Request"},
44     {HOTI, "Home Test Init"},
45     {COTI, "Care-of Test Init"},
46     {HOT,  "Home Test"},
47     {COT,  "Care-of Test"},
48     {BU,   "Binding Update"},
49     {BA,   "Binding Acknowledgement"},
50     {BE,   "Binding Error"},
51     {0,    NULL}
52 };
53
54 /* Mobility Option types */
55 typedef enum {
56     PAD1 = 0,
57     PADN = 1,
58     BRA  = 2,
59     ACOA = 3,
60     NI   = 4,
61     BAD  = 5
62 } optTypes;
63
64 static const value_string mip6_opt_types[]= {
65     {PAD1, "Pad1"},
66     {PADN, "PadN"},
67     {BRA,  "Binding Refresh Advice"},
68     {ACOA, "Alternate Care-of Address"},
69     {NI,   "Nonce Indices"},
70     {BAD,  "Binding Authorization Data"},
71     {0,    NULL}
72 };
73
74 /* Binding Update flag description */
75 static const true_false_string mip6_bu_a_flag_value = {
76     "Binding Acknowledgement requested",
77     "Binding Acknowledgement not requested"
78 };
79
80 static const true_false_string mip6_bu_h_flag_value = {
81     "Home Registration",
82     "No Home Registration"
83 };
84
85 static const true_false_string mip6_bu_l_flag_value = {
86     "Link-Local Address Compatibility",
87     "No Link-Local Address Compatibility"
88 };
89
90 static const true_false_string mip6_bu_k_flag_value = {
91     "Key Management Mobility Compatibility",
92     "No Key Management Mobility Compatibility"
93 };
94
95 /* Binding Acknowledgement status values */
96 static const value_string mip6_ba_status_value[] = {
97     {   0, "Binding Update accepted" },
98     { 128, "Reason unspecified" },
99     { 129, "Adminstratively prohibited" },
100     { 130, "Insufficient resources" },
101     { 131, "Home registration not supported" },
102     { 132, "Not home subnet" },
103     { 133, "Not home agent for this mobile node" },
104     { 134, "Duplicate address detection failed" },
105     { 135, "Sequence number out of window" },
106     { 136, "Expired home nonce index" },
107     { 137, "Expired care-of nonce index" },
108     { 138, "Expired nonces" },
109     {   0, NULL }
110 };
111
112 /* Binding Error status values */
113 static const value_string mip6_be_status_value[] = {
114     { 1, "Unknown binding for Home Address destination option" },
115     { 2, "Unrecognized MH type value" },
116     { 0, NULL }
117 };
118
119 /* Message lengths */
120 #define MIP6_BRR_LEN          2
121 #define MIP6_HOTI_LEN        10
122 #define MIP6_COTI_LEN        10
123 #define MIP6_HOT_LEN         18
124 #define MIP6_COT_LEN         18
125 #define MIP6_BU_LEN           6
126 #define MIP6_BA_LEN           6
127 #define MIP6_BE_LEN          18
128
129 /* Field offsets & lengths for mobility headers */
130 #define MIP6_PROTO_OFF        0
131 #define MIP6_HLEN_OFF         1
132 #define MIP6_TYPE_OFF         2
133 #define MIP6_RES_OFF          3
134 #define MIP6_CSUM_OFF         4
135 #define MIP6_DATA_OFF         6
136 #define MIP6_PROTO_LEN        1
137 #define MIP6_HLEN_LEN         1
138 #define MIP6_TYPE_LEN         1
139 #define MIP6_RES_LEN          1
140 #define MIP6_CSUM_LEN         2
141
142 #define MIP6_BRR_RES_OFF      6
143 #define MIP6_BRR_OPTS_OFF     8
144 #define MIP6_BRR_RES_LEN      2
145
146 #define MIP6_HOTI_RES_OFF     6
147 #define MIP6_HOTI_COOKIE_OFF  8
148 #define MIP6_HOTI_OPTS_OFF   16
149 #define MIP6_HOTI_RES_LEN     2
150 #define MIP6_HOTI_COOKIE_LEN  8
151
152 #define MIP6_COTI_RES_OFF     6
153 #define MIP6_COTI_COOKIE_OFF  8
154 #define MIP6_COTI_OPTS_OFF   16
155 #define MIP6_COTI_RES_LEN     2
156 #define MIP6_COTI_COOKIE_LEN  8
157
158 #define MIP6_HOT_INDEX_OFF    6
159 #define MIP6_HOT_COOKIE_OFF   8
160 #define MIP6_HOT_TOKEN_OFF   16
161 #define MIP6_HOT_OPTS_OFF    24
162 #define MIP6_HOT_INDEX_LEN    2
163 #define MIP6_HOT_COOKIE_LEN   8
164 #define MIP6_HOT_TOKEN_LEN    8
165
166 #define MIP6_COT_INDEX_OFF    6
167 #define MIP6_COT_COOKIE_OFF   8
168 #define MIP6_COT_TOKEN_OFF   16
169 #define MIP6_COT_OPTS_OFF    24
170 #define MIP6_COT_INDEX_LEN    2
171 #define MIP6_COT_COOKIE_LEN   8
172 #define MIP6_COT_TOKEN_LEN    8
173
174 #define MIP6_BU_SEQNR_OFF     6
175 #define MIP6_BU_FLAGS_OFF     8
176 #define MIP6_BU_RES_OFF       9
177 #define MIP6_BU_LIFETIME_OFF 10
178 #define MIP6_BU_OPTS_OFF     12
179 #define MIP6_BU_SEQNR_LEN     2
180 #define MIP6_BU_FLAGS_LEN     1
181 #define MIP6_BU_RES_LEN       1
182 #define MIP6_BU_LIFETIME_LEN  2
183
184 #define MIP6_BA_STATUS_OFF    6
185 #define MIP6_BA_FLAGS_OFF     7
186 #define MIP6_BA_SEQNR_OFF     8
187 #define MIP6_BA_LIFETIME_OFF 10
188 #define MIP6_BA_OPTS_OFF     12
189 #define MIP6_BA_STATUS_LEN    1
190 #define MIP6_BA_FLAGS_LEN     1
191 #define MIP6_BA_SEQNR_LEN     2
192 #define MIP6_BA_LIFETIME_LEN  2
193
194 #define MIP6_BE_STATUS_OFF    6
195 #define MIP6_BE_RES_OFF       7
196 #define MIP6_BE_HOA_OFF       8
197 #define MIP6_BE_OPTS_OFF     24
198 #define MIP6_BE_STATUS_LEN    1
199 #define MIP6_BE_RES_LEN       1
200 #define MIP6_BE_HOA_LEN      16
201
202 /* Field offsets & lengths for mobility options */
203 #define MIP6_BRA_RI_OFF       2
204 #define MIP6_BRA_RI_LEN       2
205
206 #define MIP6_ACOA_ACOA_OFF    2
207 #define MIP6_ACOA_ACOA_LEN   16
208
209 #define MIP6_NI_HNI_OFF       2
210 #define MIP6_NI_CNI_OFF       4
211 #define MIP6_NI_HNI_LEN       2
212 #define MIP6_NI_CNI_LEN       2
213
214 #define MIP6_BAD_AUTH_OFF     2
215 #define MIP6_BAD_AUTH_LEN    12
216
217 #endif /* __PACKET_MIP6_H_DEFINED__ */