Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-mip.c
blob90faca890befa2bf383751956974d67dbef38f3d
1 /* packet-mip.c
2 * Routines for Mobile IP dissection
3 * Copyright 2000, Stefan Raab <sraab@cisco.com>
4 * Copyright 2007, Ville Nuorvala <Ville.Nuorvala@secgo.com>
5 * Copyright 2009, Ohuchi Munenori <ohuchi_at_iij.ad.jp>
6 * Copyright 2010, Yi Ren <yi_ren1@agilent.com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * SPDX-License-Identifier: GPL-2.0-or-later
15 #include "config.h"
17 #include <epan/packet.h>
18 #include <epan/expert.h>
19 #include <epan/to_str.h>
20 #include <epan/sminmpec.h>
21 #include <epan/addr_resolv.h>
23 void proto_register_mip(void);
24 void proto_reg_handoff_mip(void);
26 static dissector_table_t mip_nvse_ext_dissector_table;
28 /* Initialize the protocol and registered fields */
29 static int proto_mip;
30 static int hf_mip_type;
31 static int hf_mip_flags;
32 static int hf_mip_s;
33 static int hf_mip_b;
34 static int hf_mip_d;
35 static int hf_mip_m;
36 static int hf_mip_g;
37 static int hf_mip_v;
38 static int hf_mip_t;
39 static int hf_mip_x;
40 static int hf_mip_code;
41 static int hf_mip_life;
42 static int hf_mip_homeaddr;
43 static int hf_mip_haaddr;
44 static int hf_mip_coa;
45 static int hf_mip_ident;
46 static int hf_mip_ext_type;
47 static int hf_mip_gaext_stype;
48 static int hf_mip_ext_len;
49 static int hf_mip_ext;
50 static int hf_mip_aext_spi;
51 static int hf_mip_aext_auth;
52 static int hf_mip_next_nai;
53 static int hf_mip_rext_flags;
54 static int hf_mip_rext_i;
55 static int hf_mip_rext_reserved;
56 static int hf_mip_rext_tstamp;
57 static int hf_mip_rev_reserved;
58 static int hf_mip_flags2;
59 static int hf_mip_rev_a;
60 static int hf_mip_rev_i;
61 static int hf_mip_rev_reserved2;
62 static int hf_mip_ack_reserved;
63 static int hf_mip_ack_i;
64 static int hf_mip_ack_reserved2;
65 static int hf_mip_hda;
66 static int hf_mip_fda;
67 static int hf_mip_revid;
68 static int hf_mip_dhaext_stype;
69 static int hf_mip_dhaext_addr;
70 static int hf_mip_mstrext_stype;
71 static int hf_mip_mstrext_text;
72 static int hf_mip_nattt_nexthdr;
73 static int hf_mip_nattt_reserved;
74 static int hf_mip_utrqext_stype;
75 static int hf_mip_utrqext_reserved1;
76 static int hf_mip_utrqext_flags;
77 static int hf_mip_utrqext_f;
78 static int hf_mip_utrqext_r;
79 static int hf_mip_utrqext_reserved2;
80 static int hf_mip_utrqext_encap_type;
81 static int hf_mip_utrqext_reserved3;
82 static int hf_mip_utrpext_stype;
83 static int hf_mip_utrpext_code;
84 static int hf_mip_utrpext_flags;
85 static int hf_mip_utrpext_f;
86 static int hf_mip_utrpext_reserved;
87 static int hf_mip_utrpext_keepalive;
88 static int hf_mip_pmipv4nonskipext_stype;
89 static int hf_mip_pmipv4nonskipext_pernodeauthmethod;
90 static int hf_mip_pmipv4skipext_stype;
91 static int hf_mip_pmipv4skipext_interfaceid;
92 static int hf_mip_pmipv4skipext_deviceid_type;
93 static int hf_mip_pmipv4skipext_deviceid_id;
94 static int hf_mip_pmipv4skipext_subscriberid_type;
95 static int hf_mip_pmipv4skipext_subscriberid_id;
96 static int hf_mip_pmipv4skipext_accesstechnology_type;
97 static int hf_mip_cvse_reserved;
98 static int hf_mip_cvse_vendor_org_id;
99 static int hf_mip_cvse_verizon_cvse_type;
100 static int hf_mip_cvse_3gpp2_cvse_type;
101 static int hf_mip_cvse_3gpp2_grekey;
102 static int hf_mip_cvse_vendor_cvse_type;
103 static int hf_mip_cvse_vendor_cvse_value;
104 static int hf_mip_nvse_reserved;
105 static int hf_mip_nvse_vendor_org_id;
106 static int hf_mip_nvse_vendor_nvse_type;
107 static int hf_mip_nvse_vendor_nvse_value;
108 static int hf_mip_nvse_3gpp2_type;
109 static int hf_mip_nvse_3gpp2_type17_entity;
110 static int hf_mip_nvse_3gpp2_type16_value;
111 static int hf_mip_nvse_3gpp2_type17_subtype1;
112 static int hf_mip_nvse_3gpp2_type17_subtype2;
113 static int hf_mip_nvse_3gpp2_type17_length;
114 static int hf_mip_nvse_3gpp2_type17_prim_dns;
115 static int hf_mip_nvse_3gpp2_type17_sec_dns;
116 static int hf_mip_mne_sub_type;
117 static int hf_mip_mne_code;
118 static int hf_mip_mne_prefix_length;
119 static int hf_mip_mne_prefix;
120 static int hf_mip_mne_reserved;
122 /* Initialize the subtree pointers */
123 static int ett_mip;
124 static int ett_mip_flags;
125 static int ett_mip_ext;
126 static int ett_mip_exts;
127 static int ett_mip_pmipv4_ext;
129 static expert_field ei_mip_data_not_dissected;
131 static dissector_handle_t mip_handle;
133 /* Port used for Mobile IP */
134 #define UDP_PORT_MIP 434
136 /* http://www.iana.org/assignments/mobileip-numbers */
137 typedef enum {
138 MIP_REGISTRATION_REQUEST = 1,
139 MIP_REGISTRATION_REPLY = 3,
140 MIP_NATT_TUNNEL_DATA = 4,
141 MIP_REGISTRATION_REVOCATION = 7,
142 MIP_REGISTRATION_REVOCATION_ACK = 15,
143 MIP_HANDOFF_REQUEST = 16,
144 MIP_HANDOFF_REPLY = 17,
145 MIP_REGIONAL_REG_REQ = 18,
146 MIP_REGIONAL_REG_REP = 19,
147 MIP_FAST_BINDING_UPD = 20,
148 MIP_FAST_BINDING_ACK = 21,
149 MIP_GENERIC_NOTIFICATION = 22,
150 MIP_GENERIC_NOTIICATION_ACK = 23,
151 MIP_HOME_TEST_INIT = 24,
152 MIP_CAREOF_TEST_INIT = 25,
153 MIP_HOME_TEST = 26,
154 MIP_CAREOF_TEST = 27,
155 MIP_EXPERIMENTAL_MESSAGE = 255
156 } mipMessageTypes;
158 static const value_string mip_types[] = {
159 {MIP_REGISTRATION_REQUEST, "Registration Request"},
160 {MIP_REGISTRATION_REPLY, "Registration Reply"},
161 {MIP_NATT_TUNNEL_DATA, "NAT Traversal Tunnel Data"},
162 {MIP_REGISTRATION_REVOCATION, "Registration Revocation"},
163 {MIP_REGISTRATION_REVOCATION_ACK, "Registration Revocation Acknowledgement"},
164 {MIP_HANDOFF_REQUEST, "Handoff Request"},
165 {MIP_HANDOFF_REPLY, "Handoff Reply"},
166 {MIP_REGIONAL_REG_REQ, "Regional Registration Request"},
167 {MIP_REGIONAL_REG_REP, "Regional Registration Reply"},
168 {MIP_FAST_BINDING_UPD, "Fast Binding Update"},
169 {MIP_FAST_BINDING_ACK, "Fast Binding Acknowledgement"},
170 {MIP_GENERIC_NOTIFICATION, "Generic Notification"},
171 {MIP_GENERIC_NOTIICATION_ACK, "Generic Notification Acknowledgement"},
172 {MIP_HOME_TEST_INIT, "Home Test Init message"},
173 {MIP_CAREOF_TEST_INIT, "Care-of Test Init message"},
174 {MIP_HOME_TEST, "Home Test message"},
175 {MIP_CAREOF_TEST, "Care-of Test message"},
176 {MIP_EXPERIMENTAL_MESSAGE, "Message for Experimental Use"},
177 {0, NULL}
180 static const value_string mip_reply_codes[]= {
181 {0, "Reg Accepted"},
182 {1, "Reg Accepted, but Simultaneous Bindings Unsupported"},
183 {64, "Reg Deny (FA)- Unspecified Reason"},
184 {65, "Reg Deny (FA)- Administratively Prohibited"},
185 {66, "Reg Deny (FA)- Insufficient Resources"},
186 {67, "Reg Deny (FA)- MN Failed Authentication"},
187 {68, "Reg Deny (FA)- HA Failed Authentication"},
188 {69, "Reg Deny (FA)- Requested Lifetime too Long"},
189 {70, "Reg Deny (FA)- Poorly Formed Request"},
190 {71, "Reg Deny (FA)- Poorly Formed Reply"},
191 {72, "Reg Deny (FA)- Requested Encapsulation Unavailable"},
192 {73, "Reg Deny (FA)- VJ Compression Unavailable"},
193 {74, "Reg Deny (FA)- Requested Reverse Tunnel Unavailable"},
194 {75, "Reg Deny (FA)- Reverse Tunnel Is Mandatory and 'T' Bit Not Set"},
195 {76, "Reg Deny (FA)- Mobile Node Too Distant"},
196 {77, "Reg Deny (FA)- Invalid Care-of Address"},
197 {78, "Reg Deny (FA)- Registration Timeout"},
198 {79, "Reg Deny (FA)- Delivery Style Not Supported"},
199 {80, "Reg Deny (FA)- Home Network Unreachable"},
200 {81, "Reg Deny (FA)- HA Host Unreachable"},
201 {82, "Reg Deny (FA)- HA Port Unreachable"},
202 {88, "Reg Deny (FA)- HA Unreachable"},
203 {89, "Reg Deny (FA)- Vendor-specific Reason"},
204 {90, "Reg Deny (FA)- Non-zero HA Address Required"},
205 {96, "Reg Deny (FA)(NAI) - Non-zero Home Address Required"},
206 {97, "Reg Deny (FA)(NAI) - Missing NAI"},
207 {98, "Reg Deny (FA)(NAI) - Missing Home Agent"},
208 {99, "Reg Deny (FA)(NAI) - Missing Home Address"},
209 {100, "Reg Deny (FA)- Unable to Interpret CVSE Sent by MN"},
210 {101, "Reg Deny (FA)- Unable to Interpret CVSE Sent by HA"},
211 {104, "Reg Deny (FA)- Unknown Challenge"},
212 {105, "Reg Deny (FA)- Missing Challenge"},
213 {106, "Reg Deny (FA)- Stale Challenge"},
214 {107, "Reg Deny (FA)- Missing MN-FA Key Generation Nonce Reply Extension"},
215 {108, "Reg Deny (FA)- MN Failed AAA Authentication"},
216 {109, "Reg Deny (FA)- HA Sent Wrong Challenge in Reply"},
217 {127, "Reg Deny (FA)- Error Code for Experimental Use"},
218 {128, "Reg Deny (HA)- Unspecified"},
219 {129, "Reg Deny (HA)- Administratively Prohibited"},
220 {130, "Reg Deny (HA)- Insufficient Resources"},
221 {131, "Reg Deny (HA)- MN Failed Authentication"},
222 {132, "Reg Deny (HA)- FA Failed Authentication"},
223 {133, "Reg Deny (HA)- Registration ID Mismatch"},
224 {134, "Reg Deny (HA)- Poorly Formed Request"},
225 {135, "Reg Deny (HA)- Too Many Simultaneous Bindings"},
226 {136, "Reg Deny (HA)- Unknown HA Address"},
227 {137, "Reg Deny (HA)- Requested Reverse Tunnel Unavailable"},
228 {138, "Reg Deny (HA)- Reverse Tunnel Is Mandatory and 'T' Bit Not Set"},
229 {139, "Reg Deny (HA)- Requested Encapsulation Unavailable"},
230 {140, "Reg Deny (HA)- Unable to Interpret CVSE Sent by MN"},
231 {141, "Reg Deny (HA)- Unable to Interpret CVSE Sent by FA"},
232 {142, "Reg Deny (HA)- UDP Encapsulation Unavailable"},
233 {143, "Reg Deny (HA)- Register with Redirected HA"},
234 {144, "Reg Deny (HA)- MN Failed AAA Authentication"},
235 {149, "Reg Deny (HA)- PMIP_UNSUPPORTED"}, /* draft-leung-mip4-proxy-mode */
236 {150, "Reg Deny (HA)- PMIP_DISALLOWED"}, /* draft-leung-mip4-proxy-mode */
237 {192, "Reg Deny (HA)- Error Code for Experimental Use"},
238 {0, NULL}
241 static const value_string mip_nattt_nexthdr[]= {
242 {4, "IP Header"},
243 {47, "GRE Header"},
244 {55, "Minimal IP Encapsulation Header"},
245 {0, NULL}
248 typedef enum {
249 MH_AUTH_EXT = 32,
250 MF_AUTH_EXT = 33,
251 FH_AUTH_EXT = 34,
252 GEN_AUTH_EXT = 36, /* RFC 3012 */
253 OLD_CVSE_EXT = 37, /* RFC 3115 */
254 CVSE_EXT = 38, /* RFC 3115 */
255 UDP_TUN_REP_EXT = 44, /* RFC 3519 */
256 MIP_FA_ERROR_EXT = 45, /* [RFC4636] */
257 MIP_GFA_IP_ADDR_EXT = 46, /* [RFC4857] */
258 PMIPv4_NON_SKIP_EXT = 47, /* [RFC5563] */
259 MN_NAI_EXT = 131, /* RFC 2794 */
260 MF_CHALLENGE_EXT = 132, /* RFC 3012 */
261 OLD_NVSE_EXT = 133, /* RFC 3115 */
262 NVSE_EXT = 134, /* RFC 3115 */
263 REV_SUPP_EXT = 137, /* RFC 3543 */
264 DYN_HA_EXT = 139, /* RFC 4433 */
265 UDP_TUN_REQ_EXT = 144, /* RFC 3519 */
266 MSG_STR_EXT = 145,
267 PMIPv4_SKIP_EXT = 147, /* draft-leung-mip4-proxy-mode */
268 MNE_EXT = 148, /* RFC 5177 */
269 SKIP_EXP_EXT = 255, /* RFC 4064 */
270 GRE_KEY_EXT = 0x0401
271 } MIP_EXTS;
273 static const value_string mip_ext_types[]= {
274 {MH_AUTH_EXT, "Mobile-Home Authentication Extension"},
275 {MF_AUTH_EXT, "Mobile-Foreign Authentication Extension"},
276 {FH_AUTH_EXT, "Foreign-Home Authentication Extension"},
277 {GEN_AUTH_EXT, "Generalized Mobile-IP Authentication Extension"},
278 {OLD_CVSE_EXT, "Critical Vendor/Organization Specific Extension"},
279 {CVSE_EXT, "Critical Vendor/Organization Specific Extension"},
280 {UDP_TUN_REP_EXT, "UDP Tunnel Reply Extension"},
281 {MIP_FA_ERROR_EXT, "FA Error Extension"},
282 {MIP_GFA_IP_ADDR_EXT, "GFA IP Address Extension"},
283 {PMIPv4_NON_SKIP_EXT, "Proxy Mobile IPv4 Non-skippable Extension"},
284 {128, "Deprecated (2001 Aug 31)"},
285 {129, "SKIP Firewall Traversal Extension"}, /*[RFC2356]*/
286 {130, "Encapsulating Delivery Style Extension"}, /*[RFC3024]*/
287 {MN_NAI_EXT, "Mobile Node NAI Extension"},
288 {MF_CHALLENGE_EXT, "MN-FA Challenge Extension"},
289 {OLD_NVSE_EXT, "Normal Vendor/Organization Specific Extension"},
290 {NVSE_EXT, "Normal Vendor/Organization Specific Extension"},
291 {136, "NAI Carrying Extension"}, /*[RFC3846]*/
292 {REV_SUPP_EXT, "Revocation Support Extension"},
293 {138, "Generalized Link Layer Address Registration Extension"}, /*[RFC4881]*/
294 {DYN_HA_EXT, "Dynamic HA Extension"},
295 {140, "Hierarchical Foreign Agent Extension"}, /*[RFC4857]*/
296 {141, "Replay Protection Style"}, /*[RFC4857]*/
297 {142, "Regional Registration Lifetime Extension"}, /*[RFC4857]*/
298 {UDP_TUN_REQ_EXT, "UDP Tunnel Request Extension"},
299 {MSG_STR_EXT, "Message String Extension"},
300 {PMIPv4_SKIP_EXT, "Proxy Mobile IPv4 Skippable Extension"},
301 {MNE_EXT, "Mobile Network Extension"}, /*[RFC5177]*/
302 {149, "Trusted Networks Configured (TNC) Extension"}, /*[RFC5265]*/
303 {150, "Reserved"},
304 {151, "Service Selection Extension"}, /*[RFC5446]*/
305 {152, "Dual Stack (DSMIPv4) Extension"}, /*[RFC5454]*/
306 {SKIP_EXP_EXT, "Skippable Extension for Experimental use"},
307 {0, NULL}
310 static const value_string mip_gaext_stypes[]= {
311 {1, "MN-AAA Authentication"},
312 {2, "FA-FA Authentication"},
313 {3, "MN-GFA Authentication"},
314 {4, "MN-PAR Auth Extension"},
315 {0, NULL}
318 /* UDP Tunnel Reply Extension: */
319 static const value_string mip_utrpext_stypes[]= {
320 {0, "Regular UDP Tunnel Reply Extension"},
321 {0, NULL}
324 /* Dynamic HA Extension subtypes */
325 static const value_string mip_dhaext_stypes[]= {
326 {1, "Requested HA Extension"},
327 {2, "Redirected HA Extension"},
328 {0, NULL}
331 static const value_string mip_mstrext_stypes[]= {
332 {1, "HA Extension"},
333 {2, "FA Extension"},
334 {0, NULL}
337 static const value_string mip_utrqext_stypes[]= {
338 {0, ""},
339 {0, NULL}
342 static const value_string mip_utrqext_encap_types[]= {
343 {4, "IP Header"},
344 {47, "GRE Header"},
345 {55, "Minimal IP Encapsulation Header"},
346 {0, NULL}
350 static const value_string mip_utrpext_codes[]= {
351 {0, "Will do Tunneling"},
352 {64, "Tunneling Declined, Reason Unspecified"},
353 {0, NULL}
356 static const value_string mip_pmipv4nonskipext_stypes[]= {
357 {0, "Unknown"},
358 {1, "Per-Node Authentication Method"},
359 {0, NULL}
362 /* PMIPv4 Per-Node Authentication Method Types */
363 static const value_string mip_pmipv4nonskipext_pernodeauthmethod_types[]= {
364 {0, "Reserved"},
365 {1, "FA-HA Authentication"},
366 {2, "IPSec Authentication"},
367 {0, NULL}
370 #define PMIPv4_SKIPEXT_STYPE_INTERFACE_ID (1)
371 #define PMIPv4_SKIPEXT_STYPE_DEVICE_ID (2)
372 #define PMIPv4_SKIPEXT_STYPE_SUBSCRIBER_ID (3)
373 #define PMIPv4_SKIPEXT_STYPE_ACCESS_TECHNOLOGY (4)
374 static const value_string mip_pmipv4skipext_stypes[]= {
375 {0, "Unknown"},
376 {PMIPv4_SKIPEXT_STYPE_INTERFACE_ID, "Interface ID"},
377 {PMIPv4_SKIPEXT_STYPE_DEVICE_ID, "Device ID"},
378 {PMIPv4_SKIPEXT_STYPE_SUBSCRIBER_ID, "Subscriber ID"},
379 {PMIPv4_SKIPEXT_STYPE_ACCESS_TECHNOLOGY, "Access Technology Type"},
380 {0, NULL}
383 /* PMIPv4 Device ID Types */
384 static const value_string mip_pmipv4skipext_deviceid_types[]= {
385 {0, "Reserved"},
386 {1, "Ethernet MAC address"},
387 {2, "Mobile Equipment Identifier (MEID)"},
388 {3, "International Mobile Equipment Identity (IMEI)"},
389 {4, "Electronic Serial Number (ESN)"},
390 {0, NULL}
393 /* PMIPv4 Subscriber ID Types */
394 static const value_string mip_pmipv4skipext_subscriberid_types[]= {
395 {0, "Reserved"},
396 {1, "International Mobile Subscriber Identity (IMSI)"},
397 {0, NULL}
400 /* Access Technology Types */
401 static const value_string mip_pmipv4skipext_accesstechnology_types[]= {
402 {0, "Reserved"},
403 {1, "802.3"},
404 {2, "802.11a/b/g"},
405 {3, "802.16e"},
406 {4, "802.16m"},
407 {5, "3GPP EUTRAN/LTE"},
408 {6, "3GPP UTRAN/GERAN"},
409 {7, "3GPP2 1xRTT/HRPD"},
410 {8, "3GPP2 UMB"},
411 {0, NULL}
414 static const value_string mip_cvse_verizon_cvse_types[]= {
415 {0, "Reserved"},
416 {1, "MIP Key Request"},
417 {2, "MIP Key Data"},
418 {3, "AAA Authenticator"},
419 {4, "Public Key Invalid"},
420 {0, NULL}
423 /* https://www.3gpp2.org/Public_html/X/VSA-VSE.cfm */
424 #if 0
425 static const value_string mip_cvse_3gpp2_cvse_types[]= {
426 {257, "Accounting/Radius"},
427 {258, "Accounting/Diameter"},
428 {513, "Accounting/Diameter"},
429 {769, "Data Available Indicator/Data Ready to Send"},
430 {1025,"GRE Key"},
431 {1281, "Binding Type Extension"},
432 {1537, "GRE Tunnel Endpoint Extension"},
433 {0, NULL}
435 #endif
438 static const value_string mip_nvse_3gpp2_type_vals[]= {
439 {16, "PPP Link Indicator"}, /* X.S0011-003-C v1.0 */
440 {17, "DNS server IP address"},
441 {0, NULL}
444 static const value_string mip_nvse_3gpp2_type17_entity_vals[]= {
445 {0, "Unknown"},
446 {1, "HAAA"},
447 {2, "VAAA"},
448 {3, "HA"},
449 {0, NULL}
452 static const value_string mip_nvse_3gpp2_type17_vals[]= {
453 {0, "main service instance"},
454 {1, "negotiate PPP"},
455 {2, "do not negotiate PPP"},
456 {0, NULL}
459 static const value_string mip_mne_stypes[]= {
460 {0, "Mobile Network Request"},
461 {1, "Explicit Mode Acknowledgement"},
462 {2, "Implicit Mode Acknowledgement"},
463 {0, NULL}
466 static const value_string mip_mne_codes[]= {
467 {0, "Success"},
468 {1, "Invalid prefix (MOBNET_INVALID_PREFIX_LEN)"},
469 {2, "Mobile Router is not authorized for prefix (MOBNET_UNAUTHORIZED)"},
470 {3, "Forwarding setup failed (MOBNET_FWDING_SETUP_FAILED)"},
471 {0, NULL}
474 static dissector_handle_t ip_handle;
476 /* Code to dissect 3GPP2 extensions */
478 static int
479 dissect_mip_priv_ext_3gpp2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
481 int offset = 0;
482 uint16_t type;
483 int length = tvb_reported_length(tvb);
485 type = tvb_get_ntohs(tvb,offset);
486 proto_tree_add_item(tree, hf_mip_nvse_3gpp2_type, tvb, offset, 2, ENC_BIG_ENDIAN);
487 offset+=2;
489 switch(type){
490 case 16: /* PPP Link Indicator X.S0011-003-C v1.0 */
491 proto_tree_add_item(tree, hf_mip_nvse_3gpp2_type16_value, tvb, offset, 2, ENC_BIG_ENDIAN);
492 break;
493 case 17: /* DNS server IP address X.S0011-002-C v3.0*/
494 /* Entity-Type */
495 proto_tree_add_item(tree, hf_mip_nvse_3gpp2_type17_entity, tvb, offset, 1, ENC_BIG_ENDIAN);
496 offset++;
497 /* Sub-Type1 */
498 proto_tree_add_item(tree, hf_mip_nvse_3gpp2_type17_subtype1, tvb, offset, 1, ENC_BIG_ENDIAN);
499 offset++;
500 /* Length */
501 proto_tree_add_item(tree, hf_mip_nvse_3gpp2_type17_length, tvb, offset, 1, ENC_BIG_ENDIAN);
502 offset++;
503 /* DNS server IP address */
504 proto_tree_add_item(tree, hf_mip_nvse_3gpp2_type17_prim_dns, tvb, offset, 4, ENC_BIG_ENDIAN);
505 offset+=4;
506 /* Sub-Type2 */
507 proto_tree_add_item(tree, hf_mip_nvse_3gpp2_type17_subtype2, tvb, offset, 1, ENC_BIG_ENDIAN);
508 offset++;
509 /* Length */
510 proto_tree_add_item(tree, hf_mip_nvse_3gpp2_type17_length, tvb, offset, 1, ENC_BIG_ENDIAN);
511 offset++;
512 /* DNS server IP address.*/
513 proto_tree_add_item(tree, hf_mip_nvse_3gpp2_type17_sec_dns, tvb, offset, 4, ENC_BIG_ENDIAN);
514 break;
515 default:
516 proto_tree_add_expert(tree, pinfo, &ei_mip_data_not_dissected, tvb, offset, -1);
517 break;
520 return length;
523 /* Code to dissect extensions */
524 static void
525 dissect_mip_extensions( tvbuff_t *tvb, int offset, proto_tree *tree, packet_info *pinfo)
527 proto_tree *exts_tree=NULL;
528 proto_tree *ext_tree;
529 proto_tree *pmipv4_tree;
530 int ext_len;
531 uint8_t ext_type;
532 uint8_t ext_subtype=0;
533 uint8_t pmipv4skipext_subscriberid_type;
534 int hdrLen;
535 uint32_t cvse_vendor_id;
536 uint16_t cvse_3gpp2_type;
537 int cvse_local_offset= 0;
538 int nvse_local_offset= 0;
539 int mne_local_offset= 0;
541 /* Add our tree, if we have extensions */
542 exts_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_mip_exts, NULL, "Extensions");
544 /* And, handle each extension */
545 while (tvb_reported_length_remaining(tvb, offset) > 0) {
547 /* Get our extension info */
548 ext_type = tvb_get_uint8(tvb, offset);
549 if (ext_type == GEN_AUTH_EXT || ext_type == PMIPv4_NON_SKIP_EXT) {
551 * Very nasty . . breaks normal extensions, since the length is
552 * in the wrong place :(
554 ext_subtype = tvb_get_uint8(tvb, offset + 1);
555 ext_len = tvb_get_ntohs(tvb, offset + 2);
556 hdrLen = 4;
558 else if(ext_type==CVSE_EXT){
560 * CVSE also breaks since it added reserved field before
561 * the length field
563 ext_len = tvb_get_ntohs(tvb, offset + 2);
564 hdrLen = 4;
566 else {
567 ext_len = tvb_get_uint8(tvb, offset + 1);
568 hdrLen = 2;
571 ext_tree = proto_tree_add_subtree_format(exts_tree, tvb, offset, ext_len + hdrLen,
572 ett_mip_ext, NULL, "Extension: %s",
573 val_to_str(ext_type, mip_ext_types,
574 "Unknown Extension %u"));
576 proto_tree_add_uint(ext_tree, hf_mip_ext_type, tvb, offset, 1, ext_type);
577 offset++;
578 if (ext_type != GEN_AUTH_EXT &&
579 ext_type != PMIPv4_NON_SKIP_EXT &&
580 ext_type != CVSE_EXT) {
581 /* Another nasty hack since GEN_AUTH_EXT and PMIPv4_NON_SKIP_EXT broke everything */
582 proto_tree_add_uint(ext_tree, hf_mip_ext_len, tvb, offset, 1, ext_len);
583 offset++;
586 switch (ext_type) {
587 case MH_AUTH_EXT:
588 case MF_AUTH_EXT:
589 case FH_AUTH_EXT:
590 /* All these extensions look the same. 4 byte SPI followed by a key */
591 proto_tree_add_item(ext_tree, hf_mip_aext_spi, tvb, offset, 4, ENC_BIG_ENDIAN);
592 proto_tree_add_item(ext_tree, hf_mip_aext_auth, tvb, offset+4, ext_len-4, ENC_NA);
593 break;
594 case MN_NAI_EXT:
595 proto_tree_add_item(ext_tree, hf_mip_next_nai, tvb, offset,
596 ext_len, ENC_ASCII);
597 break;
599 case GEN_AUTH_EXT: /* RFC 3012 */
601 * Very nasty . . breaks normal extensions, since the length is
602 * in the wrong place :(
604 proto_tree_add_uint(ext_tree, hf_mip_gaext_stype, tvb, offset, 1, ext_subtype);
605 offset++;
606 proto_tree_add_uint(ext_tree, hf_mip_ext_len, tvb, offset, 2, ext_len);
607 offset+=2;
608 /* SPI */
609 proto_tree_add_item(ext_tree, hf_mip_aext_spi, tvb, offset, 4, ENC_BIG_ENDIAN);
610 /* Key */
611 proto_tree_add_item(ext_tree, hf_mip_aext_auth, tvb, offset + 4,
612 ext_len - 4, ENC_NA);
614 break;
615 case REV_SUPP_EXT: /* RFC 3543 */
617 /* flags */
618 static int * const flags[] = {
619 &hf_mip_rext_i,
620 &hf_mip_rext_reserved,
621 NULL
624 proto_tree_add_bitmask(ext_tree, tvb, offset, hf_mip_rext_flags, ett_mip_flags, flags, ENC_BIG_ENDIAN);
626 /* registration revocation timestamp */
627 proto_tree_add_item(ext_tree, hf_mip_rext_tstamp, tvb, offset + 2, 4, ENC_BIG_ENDIAN);
629 break;
630 case DYN_HA_EXT: /* RFC 4433 */
631 /* subtype */
632 proto_tree_add_item(ext_tree, hf_mip_dhaext_stype, tvb, offset, 1, ENC_BIG_ENDIAN);
633 /* Home Agent */
634 proto_tree_add_item(ext_tree, hf_mip_dhaext_addr, tvb, offset + 1, 4, ENC_BIG_ENDIAN);
635 break;
636 case MSG_STR_EXT:
637 /* sub-type */
638 proto_tree_add_item(ext_tree, hf_mip_mstrext_stype, tvb, offset, 1, ENC_BIG_ENDIAN);
640 /* text */
641 proto_tree_add_item(ext_tree, hf_mip_mstrext_text, tvb, offset + 1, ext_len-1, ENC_ASCII);
642 break;
643 case UDP_TUN_REQ_EXT: /* RFC 3519 */
645 static int * const flags[] = {
646 &hf_mip_utrqext_f,
647 &hf_mip_utrqext_r,
648 &hf_mip_utrqext_reserved2,
649 NULL
652 /* sub-type */
653 proto_tree_add_item(ext_tree, hf_mip_utrqext_stype, tvb, offset, 1, ENC_BIG_ENDIAN);
655 /* reserved 1 */
656 proto_tree_add_item(ext_tree, hf_mip_utrqext_reserved1, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
658 /* flags */
659 proto_tree_add_bitmask(ext_tree, tvb, offset + 2, hf_mip_utrqext_flags, ett_mip_flags, flags, ENC_BIG_ENDIAN);
661 /* encapsulation */
662 proto_tree_add_item(ext_tree, hf_mip_utrqext_encap_type, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
664 /* reserved 3 */
665 proto_tree_add_item(ext_tree, hf_mip_utrqext_reserved3, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
667 break;
668 case UDP_TUN_REP_EXT: /* RFC 3519 */
670 static int * const flags[] = {
671 &hf_mip_utrpext_f,
672 &hf_mip_utrpext_reserved,
673 NULL
675 /* sub-type */
676 proto_tree_add_item(ext_tree, hf_mip_utrpext_stype, tvb, offset, 1, ENC_BIG_ENDIAN);
678 /* code */
679 proto_tree_add_item(ext_tree, hf_mip_utrpext_code, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
681 /* flags */
682 proto_tree_add_bitmask(ext_tree, tvb, offset + 2, hf_mip_utrpext_flags, ett_mip_flags, flags, ENC_BIG_ENDIAN);
684 /* keepalive interval */
685 proto_tree_add_item(ext_tree, hf_mip_utrpext_keepalive, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
687 break;
688 case PMIPv4_NON_SKIP_EXT: /* draft-leung-mip4-proxy-mode */
689 /* sub-type */
690 proto_tree_add_uint(ext_tree, hf_mip_pmipv4nonskipext_stype, tvb, offset, 1, ext_subtype);
691 offset++;
692 /* len */
693 proto_tree_add_uint(ext_tree, hf_mip_ext_len, tvb, offset, 2, ext_len);
694 offset+=2;
695 if(ext_subtype == 1){
696 /* Sub-type == 1 : PMIPv4 Per-Node Authentication Method */
697 proto_tree_add_item(ext_tree, hf_mip_pmipv4nonskipext_pernodeauthmethod, tvb, offset, 1, ENC_BIG_ENDIAN);
699 break;
700 case PMIPv4_SKIP_EXT: /* draft-leung-mip4-proxy-mode */
701 /* sub-type */
702 ext_subtype = tvb_get_uint8(tvb, offset);
703 pmipv4_tree = proto_tree_add_subtree_format(ext_tree, tvb, offset, ext_len,
704 ett_mip_pmipv4_ext, NULL, "PMIPv4 Sub-Type: %s",
705 val_to_str(ext_subtype, mip_pmipv4skipext_stypes, "Unknown Sub-Type %u"));
706 proto_tree_add_uint(pmipv4_tree, hf_mip_pmipv4skipext_stype, tvb, offset, 1, ext_subtype);
708 if (ext_subtype == PMIPv4_SKIPEXT_STYPE_INTERFACE_ID) {
709 proto_tree_add_item(pmipv4_tree, hf_mip_pmipv4skipext_interfaceid, tvb, offset + 1, ext_len-1, ENC_NA);
710 } else if (ext_subtype == PMIPv4_SKIPEXT_STYPE_DEVICE_ID) {
711 proto_tree_add_item(pmipv4_tree, hf_mip_pmipv4skipext_deviceid_type, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
712 proto_tree_add_item(pmipv4_tree, hf_mip_pmipv4skipext_deviceid_id, tvb, offset + 2, ext_len - 2, ENC_NA);
713 } else if (ext_subtype == PMIPv4_SKIPEXT_STYPE_SUBSCRIBER_ID) {
714 pmipv4skipext_subscriberid_type = tvb_get_uint8(tvb, offset + 1);
715 proto_tree_add_uint(pmipv4_tree, hf_mip_pmipv4skipext_subscriberid_type, tvb, offset + 1, 1, pmipv4skipext_subscriberid_type);
716 if (pmipv4skipext_subscriberid_type == 1) {
717 proto_tree_add_item(pmipv4_tree, hf_mip_pmipv4skipext_subscriberid_id, tvb, offset + 2, ext_len - 2, ENC_NA);
719 } else if (ext_subtype == PMIPv4_SKIPEXT_STYPE_ACCESS_TECHNOLOGY) {
720 proto_tree_add_item(pmipv4_tree, hf_mip_pmipv4skipext_accesstechnology_type, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
722 break;
724 case OLD_CVSE_EXT: /* RFC 3115 */
725 case CVSE_EXT: /* RFC 3115 */
727 * Very nasty . . breaks normal extensions, since the length is
728 * in the wrong place :(
730 proto_tree_add_item(ext_tree, hf_mip_cvse_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
731 offset++;
732 proto_tree_add_uint(ext_tree, hf_mip_ext_len, tvb, offset, 2, ext_len);
733 offset+=2;
734 /* Vendor/Org ID */
735 /*Vendor ID & cvse type & cvse value are included in ext_len, so do not increment offset for them here.*/
736 cvse_local_offset = offset;
737 proto_tree_add_item(ext_tree, hf_mip_cvse_vendor_org_id, tvb, cvse_local_offset, 4, ENC_BIG_ENDIAN);
738 cvse_vendor_id = tvb_get_ntohl(tvb, cvse_local_offset);
739 cvse_local_offset+=4;
740 /*Vendor CVSE Type*/
741 if( cvse_vendor_id == VENDOR_VERIZON ){
742 /*Verizon CVSE type*/
743 proto_tree_add_item(ext_tree, hf_mip_cvse_verizon_cvse_type, tvb, cvse_local_offset, 2, ENC_BIG_ENDIAN);
744 }else if( cvse_vendor_id == VENDOR_THE3GPP2 ){
745 /*THE3GPP2 CVSE type*/
746 proto_tree_add_item(ext_tree, hf_mip_cvse_3gpp2_cvse_type, tvb, cvse_local_offset, 2, ENC_BIG_ENDIAN);
747 cvse_3gpp2_type = tvb_get_ntohs(tvb, cvse_local_offset);
748 /* XXX: THE3GPP2 CVSE type is followed by a 2 byte length field ? - No ?*/
749 /* ... */
750 /* THE3GPP2 CVSE Value https://www.3gpp2.org/Public_html/X/VSA-VSE.cfm X.S0011
751 * https://www.3gpp2.org/Public_html/Specs/X.S0011-002-E_v1.0_091116.pdf Chapter 4.1.4 GRE CVSE
753 if(cvse_3gpp2_type == GRE_KEY_EXT){
754 proto_tree_add_item(ext_tree, hf_mip_cvse_3gpp2_grekey, tvb, cvse_local_offset + 2, ext_len - 6, ENC_BIG_ENDIAN);
756 }else{
757 /*CVSE Type of Other vendor, just show raw numbers currently*/
758 proto_tree_add_item(ext_tree, hf_mip_cvse_vendor_cvse_type, tvb, cvse_local_offset, 2, ENC_BIG_ENDIAN);
759 /* Vendor CVSE Type+Vendor/Org ID = 6 bytes*/
760 proto_tree_add_item(ext_tree, hf_mip_cvse_vendor_cvse_value, tvb, cvse_local_offset + 2, ext_len - 6, ENC_NA);
762 break;
764 case OLD_NVSE_EXT: /* RFC 3115 */
765 case NVSE_EXT: /* RFC 3115 */
767 uint32_t nvse_vendor_org_id;
768 tvbuff_t *next_tvb;
770 proto_tree_add_item(ext_tree, hf_mip_nvse_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
772 /* Vendor/Org ID */
773 /*Vendor ID & nvse type & nvse value are included in ext_len, so do not increment offset for them here.*/
774 nvse_local_offset = offset + hdrLen;
775 nvse_vendor_org_id = tvb_get_ntohl(tvb, nvse_local_offset);
776 proto_tree_add_item(ext_tree, hf_mip_nvse_vendor_org_id, tvb, nvse_local_offset, 4, ENC_BIG_ENDIAN);
777 nvse_local_offset+=4;
779 next_tvb = tvb_new_subset_length(tvb, nvse_local_offset, ext_len-6);
780 if (!dissector_try_uint(mip_nvse_ext_dissector_table, nvse_vendor_org_id, next_tvb, pinfo, ext_tree)){
782 /*Vendor NVSE Type*/
783 proto_tree_add_item(ext_tree, hf_mip_nvse_vendor_nvse_type, tvb, nvse_local_offset, 2, ENC_BIG_ENDIAN);
784 nvse_local_offset+=2;
786 /* Vendor-NVSE-Value */
787 proto_tree_add_item(ext_tree, hf_mip_nvse_vendor_nvse_value, tvb, nvse_local_offset, ext_len - 8, ENC_NA);
790 break;
792 case MNE_EXT: /* RFC 5177 */
794 uint8_t sub_type;
796 sub_type = tvb_get_uint8(tvb, offset);
797 proto_tree_add_item(ext_tree, hf_mip_mne_sub_type, tvb, offset, 1, ENC_BIG_ENDIAN);
798 mne_local_offset = offset+1;
799 switch (sub_type) {
800 case 0:
801 proto_tree_add_item(ext_tree, hf_mip_mne_prefix_length, tvb, mne_local_offset, 1, ENC_BIG_ENDIAN);
802 mne_local_offset++;
803 break;
804 case 1:
805 case 2:
806 proto_tree_add_item(ext_tree, hf_mip_mne_code, tvb, mne_local_offset, 1, ENC_BIG_ENDIAN);
807 mne_local_offset++;
808 proto_tree_add_item(ext_tree, hf_mip_mne_prefix_length, tvb, mne_local_offset, 1, ENC_BIG_ENDIAN);
809 mne_local_offset++;
810 proto_tree_add_item(ext_tree, hf_mip_mne_reserved, tvb, mne_local_offset, 1, ENC_BIG_ENDIAN);
811 mne_local_offset++;
812 break;
813 default:
814 proto_tree_add_expert_format(ext_tree, pinfo, &ei_mip_data_not_dissected, tvb, offset, -1, "Unable to decode (Unknown Sub-Type)");
815 return;
817 proto_tree_add_item(ext_tree, hf_mip_mne_prefix, tvb, mne_local_offset, 4, ENC_BIG_ENDIAN);
819 break;
821 case MF_CHALLENGE_EXT: /* RFC 3012 */
822 /* The default dissector is good here. The challenge is all hex anyway. */
823 default:
824 proto_tree_add_item(ext_tree, hf_mip_ext, tvb, offset, ext_len, ENC_NA);
825 break;
826 } /* ext type */
828 offset += ext_len;
829 } /* while data remaining */
831 } /* dissect_mip_extensions */
833 /* Code to actually dissect the packets */
834 static int
835 dissect_mip( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
837 /* Set up structures we will need to add the protocol subtree and manage it */
838 proto_item *ti;
839 proto_tree *mip_tree=NULL;
840 uint8_t type;
841 int offset=0;
842 tvbuff_t *next_tvb;
844 /* Make entries in Protocol column and Info column on summary display */
846 col_set_str(pinfo->cinfo, COL_PROTOCOL, "MobileIP");
847 col_clear(pinfo->cinfo, COL_INFO);
849 type = tvb_get_uint8(tvb, offset);
850 switch (type) {
851 case MIP_REGISTRATION_REQUEST:
852 col_add_fstr(pinfo->cinfo, COL_INFO,
853 "Reg Request: HoA=%s HA=%s CoA=%s",
854 tvb_ip_to_str(pinfo->pool, tvb, 4),
855 tvb_ip_to_str(pinfo->pool, tvb, 8),
856 tvb_ip_to_str(pinfo->pool, tvb, 12));
858 if (tree) {
859 static int * const flags[] = {
860 &hf_mip_s,
861 &hf_mip_b,
862 &hf_mip_d,
863 &hf_mip_m,
864 &hf_mip_g,
865 &hf_mip_v,
866 &hf_mip_t,
867 &hf_mip_x,
868 NULL
871 ti = proto_tree_add_item(tree, proto_mip, tvb, offset, -1, ENC_NA);
872 mip_tree = proto_item_add_subtree(ti, ett_mip);
874 /* type */
875 proto_tree_add_uint(mip_tree, hf_mip_type, tvb, offset, 1, type);
876 offset++;
878 /* flags */
879 proto_tree_add_bitmask(mip_tree, tvb, offset, hf_mip_flags, ett_mip_flags, flags, ENC_BIG_ENDIAN);
880 offset++;
882 /* lifetime */
883 proto_tree_add_item(mip_tree, hf_mip_life, tvb, offset, 2, ENC_BIG_ENDIAN);
884 offset += 2;
886 /* home address */
887 proto_tree_add_item(mip_tree, hf_mip_homeaddr, tvb, offset, 4, ENC_BIG_ENDIAN);
888 offset += 4;
890 /* home agent address */
891 proto_tree_add_item(mip_tree, hf_mip_haaddr, tvb, offset, 4, ENC_BIG_ENDIAN);
892 offset += 4;
894 /* Care of Address */
895 proto_tree_add_item(mip_tree, hf_mip_coa, tvb, offset, 4, ENC_BIG_ENDIAN);
896 offset += 4;
898 /* Identifier - assumed to be an NTP time here */
899 proto_tree_add_item(mip_tree, hf_mip_ident, tvb, offset, 8, ENC_TIME_NTP|ENC_BIG_ENDIAN);
900 offset += 8;
902 } else {
903 offset += 24;
905 break;
906 case MIP_REGISTRATION_REPLY:
907 col_add_fstr(pinfo->cinfo, COL_INFO,
908 "Reg Reply: HoA=%s HA=%s, Code=%u",
909 tvb_ip_to_str(pinfo->pool, tvb, 4),
910 tvb_ip_to_str(pinfo->pool, tvb, 8),
911 tvb_get_uint8(tvb,1));
913 if (tree) {
914 /* Add Subtree */
915 ti = proto_tree_add_item(tree, proto_mip, tvb, offset, -1, ENC_NA);
916 mip_tree = proto_item_add_subtree(ti, ett_mip);
918 /* Type */
919 proto_tree_add_uint(mip_tree, hf_mip_type, tvb, offset, 1, type);
920 offset++;
922 /* Reply Code */
923 proto_tree_add_item(mip_tree, hf_mip_code, tvb, offset, 1, ENC_BIG_ENDIAN);
924 offset++;
926 /* Registration Lifetime */
927 proto_tree_add_item(mip_tree, hf_mip_life, tvb, offset, 2, ENC_BIG_ENDIAN);
928 offset += 2;
930 /* Home address */
931 proto_tree_add_item(mip_tree, hf_mip_homeaddr, tvb, offset, 4, ENC_BIG_ENDIAN);
932 offset += 4;
934 /* Home Agent Address */
935 proto_tree_add_item(mip_tree, hf_mip_haaddr, tvb, offset, 4, ENC_BIG_ENDIAN);
936 offset += 4;
938 /* Identifier - assumed to be an NTP time here */
939 proto_tree_add_item(mip_tree, hf_mip_ident, tvb, offset, 8, ENC_TIME_NTP|ENC_BIG_ENDIAN);
940 offset += 8;
941 } else {
942 offset += 20;
944 break;
945 case MIP_NATT_TUNNEL_DATA:
946 col_add_fstr(pinfo->cinfo, COL_INFO, "Tunnel Data: Next Header=%u",
947 tvb_get_uint8(tvb,1));
949 if (tree) {
950 /* Add Subtree */
951 ti = proto_tree_add_item(tree, proto_mip, tvb, offset, -1, ENC_NA);
952 mip_tree = proto_item_add_subtree(ti, ett_mip);
954 /* Type */
955 proto_tree_add_uint(mip_tree, hf_mip_type, tvb, offset, 1, type);
956 offset++;
958 /* Next Header */
959 proto_tree_add_item(mip_tree, hf_mip_nattt_nexthdr, tvb, offset, 1, ENC_BIG_ENDIAN);
960 offset++;
962 /* reserved */
963 proto_tree_add_item(mip_tree, hf_mip_nattt_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
964 offset += 2;
965 } else {
966 offset += 4;
968 /* encapsulated payload */
969 next_tvb = tvb_new_subset_remaining(tvb, offset);
970 call_dissector(ip_handle, next_tvb, pinfo, mip_tree);
971 offset = tvb_reported_length(tvb);
972 break;
973 case MIP_REGISTRATION_REVOCATION:
974 col_add_fstr(pinfo->cinfo, COL_INFO,
975 "Reg Revocation: HoA=%s HDA=%s FDA=%s",
976 tvb_ip_to_str(pinfo->pool, tvb, 4),
977 tvb_ip_to_str(pinfo->pool, tvb, 8),
978 tvb_ip_to_str(pinfo->pool, tvb, 12));
980 if (tree) {
981 static int * const mip_flags[] = {
982 &hf_mip_rev_a,
983 &hf_mip_rev_i,
984 &hf_mip_rev_reserved2,
985 NULL
988 ti = proto_tree_add_item(tree, proto_mip, tvb, offset, -1, ENC_NA);
989 mip_tree = proto_item_add_subtree(ti, ett_mip);
991 /* type */
992 proto_tree_add_uint(mip_tree, hf_mip_type, tvb, offset, 1, type);
993 offset++;
995 /* reserved */
996 proto_tree_add_item(mip_tree, hf_mip_rev_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
997 offset++;
999 /* flags */
1000 proto_tree_add_bitmask(mip_tree, tvb, offset, hf_mip_flags2, ett_mip_flags, mip_flags, ENC_BIG_ENDIAN);
1001 offset += 2;
1003 /* home address */
1004 proto_tree_add_item(mip_tree, hf_mip_homeaddr, tvb, offset, 4, ENC_BIG_ENDIAN);
1005 offset += 4;
1007 /* home domain address */
1008 proto_tree_add_item(mip_tree, hf_mip_hda, tvb, offset, 4, ENC_BIG_ENDIAN);
1009 offset += 4;
1011 /* foreign domain address */
1012 proto_tree_add_item(mip_tree, hf_mip_fda, tvb, offset, 4, ENC_BIG_ENDIAN);
1013 offset += 4;
1015 /* revocation identifier */
1016 proto_tree_add_item(mip_tree, hf_mip_revid, tvb, offset, 4, ENC_BIG_ENDIAN);
1017 offset += 4;
1018 } else {
1019 offset += 20;
1021 break;
1022 case MIP_REGISTRATION_REVOCATION_ACK:
1023 col_add_fstr(pinfo->cinfo, COL_INFO, "Reg Revocation Ack: HoA=%s",
1024 tvb_ip_to_str(pinfo->pool, tvb, 4));
1026 if (tree) {
1027 static int * const mip_flags[] = {
1028 &hf_mip_ack_i,
1029 &hf_mip_ack_reserved2,
1030 NULL
1033 ti = proto_tree_add_item(tree, proto_mip, tvb, offset, -1, ENC_NA);
1034 mip_tree = proto_item_add_subtree(ti, ett_mip);
1036 /* type */
1037 proto_tree_add_uint(mip_tree, hf_mip_type, tvb, offset, 1, type);
1038 offset++;
1040 /* reserved */
1041 proto_tree_add_item(mip_tree, hf_mip_ack_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
1042 offset++;
1044 /* flags */
1045 proto_tree_add_bitmask(mip_tree, tvb, offset, hf_mip_flags2, ett_mip_flags, mip_flags, ENC_BIG_ENDIAN);
1046 offset += 2;
1048 /* home address */
1049 proto_tree_add_item(mip_tree, hf_mip_homeaddr, tvb, offset, 4, ENC_BIG_ENDIAN);
1050 offset += 4;
1052 /* revocation identifier */
1053 proto_tree_add_item(mip_tree, hf_mip_revid, tvb, offset, 4, ENC_BIG_ENDIAN);
1054 offset += 4;
1055 } else {
1056 offset += 12;
1058 break;
1059 } /* End switch */
1061 if (tvb_reported_length_remaining(tvb, offset) > 0)
1062 dissect_mip_extensions(tvb, offset, mip_tree, pinfo);
1064 return tvb_captured_length(tvb);
1065 } /* dissect_mip */
1067 /* Register the protocol with Wireshark */
1068 void proto_register_mip(void)
1071 /* Setup list of header fields */
1072 static hf_register_info hf[] = {
1073 { &hf_mip_type,
1074 { "Message Type", "mip.type",
1075 FT_UINT8, BASE_DEC, VALS(mip_types), 0,
1076 "Mobile IP Message type.", HFILL }
1078 { &hf_mip_flags,
1079 {"Flags", "mip.flags",
1080 FT_UINT8, BASE_HEX, NULL, 0x0,
1081 NULL, HFILL}
1083 { &hf_mip_s,
1084 {"Simultaneous Bindings", "mip.s",
1085 FT_BOOLEAN, 8, NULL, 128,
1086 "Simultaneous Bindings Allowed", HFILL }
1088 { &hf_mip_b,
1089 {"Broadcast Datagrams", "mip.b",
1090 FT_BOOLEAN, 8, NULL, 64,
1091 "Broadcast Datagrams requested", HFILL }
1093 { &hf_mip_d,
1094 { "Co-located Care-of Address", "mip.d",
1095 FT_BOOLEAN, 8, NULL, 32,
1096 "MN using Co-located Care-of address", HFILL }
1098 { &hf_mip_m,
1099 {"Minimal Encapsulation", "mip.m",
1100 FT_BOOLEAN, 8, NULL, 16,
1101 "MN wants Minimal encapsulation", HFILL }
1103 { &hf_mip_g,
1104 {"GRE", "mip.g",
1105 FT_BOOLEAN, 8, NULL, 8,
1106 "MN wants GRE encapsulation", HFILL }
1108 { &hf_mip_v,
1109 { "Van Jacobson", "mip.v",
1110 FT_BOOLEAN, 8, NULL, 4,
1111 NULL, HFILL }
1113 { &hf_mip_t,
1114 { "Reverse Tunneling", "mip.t",
1115 FT_BOOLEAN, 8, NULL, 2,
1116 "Reverse tunneling requested", HFILL }
1118 { &hf_mip_x,
1119 { "Reserved", "mip.x",
1120 FT_BOOLEAN, 8, NULL, 1,
1121 NULL, HFILL }
1123 { &hf_mip_code,
1124 { "Reply Code", "mip.code",
1125 FT_UINT8, BASE_DEC, VALS(mip_reply_codes), 0,
1126 "Mobile IP Reply code.", HFILL }
1128 { &hf_mip_life,
1129 { "Lifetime", "mip.life",
1130 FT_UINT16, BASE_DEC, NULL, 0,
1131 "Mobile IP Lifetime.", HFILL }
1133 { &hf_mip_homeaddr,
1134 { "Home Address", "mip.homeaddr",
1135 FT_IPv4, BASE_NONE, NULL, 0,
1136 "Mobile Node's home address.", HFILL }
1139 { &hf_mip_haaddr,
1140 { "Home Agent", "mip.haaddr",
1141 FT_IPv4, BASE_NONE, NULL, 0,
1142 "Home agent IP Address.", HFILL }
1144 { &hf_mip_coa,
1145 { "Care of Address", "mip.coa",
1146 FT_IPv4, BASE_NONE, NULL, 0,
1147 "Care of Address.", HFILL }
1149 { &hf_mip_ident,
1150 { "Identification", "mip.ident",
1151 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
1152 "MN Identification.", HFILL }
1154 { &hf_mip_ext_type,
1155 { "Extension Type", "mip.ext.type",
1156 FT_UINT8, BASE_DEC, VALS(mip_ext_types), 0,
1157 "Mobile IP Extension Type.", HFILL }
1159 { &hf_mip_gaext_stype,
1160 { "Gen Auth Ext SubType", "mip.ext.auth.subtype",
1161 FT_UINT8, BASE_DEC, VALS(mip_gaext_stypes), 0,
1162 "Mobile IP Auth Extension Sub Type.", HFILL }
1164 { &hf_mip_ext_len,
1165 { "Extension Length", "mip.ext.len",
1166 FT_UINT16, BASE_DEC, NULL, 0,
1167 "Mobile IP Extension Length.", HFILL }
1169 { &hf_mip_ext,
1170 { "Extension", "mip.extension",
1171 FT_BYTES, BASE_NONE, NULL, 0,
1172 NULL, HFILL }
1174 { &hf_mip_aext_spi,
1175 { "SPI", "mip.auth.spi",
1176 FT_UINT32, BASE_HEX, NULL, 0,
1177 "Authentication Header Security Parameter Index.", HFILL }
1179 { &hf_mip_aext_auth,
1180 { "Authenticator", "mip.auth.auth",
1181 FT_BYTES, BASE_NONE, NULL, 0,
1182 "Authenticator.", HFILL }
1184 { &hf_mip_next_nai,
1185 { "NAI", "mip.nai",
1186 FT_STRING, BASE_NONE, NULL, 0,
1187 NULL, HFILL }
1189 { &hf_mip_rext_flags,
1190 {"Rev Ext Flags", "mip.ext.rev.flags",
1191 FT_UINT16, BASE_HEX, NULL, 0x0,
1192 "Revocation Support Extension Flags", HFILL}
1194 { &hf_mip_rext_i,
1195 { "'I' bit Support", "mip.ext.rev.i",
1196 FT_BOOLEAN, 16, NULL, 32768,
1197 "Agent supports Inform bit in Revocation", HFILL }
1199 { &hf_mip_rext_reserved,
1200 { "Reserved", "mip.ext.rev.reserved",
1201 FT_UINT16, BASE_HEX, NULL, 0x7fff,
1202 NULL, HFILL }
1204 { &hf_mip_rext_tstamp,
1205 { "Timestamp", "mip.ext.rev.tstamp",
1206 FT_UINT32, BASE_DEC, NULL, 0,
1207 "Revocation Timestamp of Sending Agent", HFILL }
1209 { &hf_mip_rev_reserved,
1210 { "Reserved", "mip.rev.reserved",
1211 FT_UINT8, BASE_HEX, NULL, 0x0,
1212 NULL, HFILL}
1214 { &hf_mip_flags2,
1215 {"Flags", "mip.flags2",
1216 FT_UINT16, BASE_HEX, NULL, 0x0,
1217 NULL, HFILL}
1219 { &hf_mip_rev_a,
1220 { "Home Agent", "mip.rev.a",
1221 FT_BOOLEAN, 16, NULL, 32768,
1222 "Revocation sent by Home Agent", HFILL }
1224 { &hf_mip_rev_i,
1225 { "Inform", "mip.rev.i",
1226 FT_BOOLEAN, 16, NULL, 16384,
1227 "Inform Mobile Node", HFILL }
1230 { &hf_mip_rev_reserved2,
1231 { "Reserved", "mip.rev.reserved2",
1232 FT_UINT16, BASE_HEX, NULL, 0x3fff,
1233 NULL, HFILL}},
1235 { &hf_mip_hda,
1236 { "Home Domain Address", "mip.rev.hda",
1237 FT_IPv4, BASE_NONE, NULL, 0,
1238 "Revocation Home Domain IP Address", HFILL }
1240 { &hf_mip_fda,
1241 { "Foreign Domain Address", "mip.rev.fda",
1242 FT_IPv4, BASE_NONE, NULL, 0,
1243 "Revocation Foreign Domain IP Address", HFILL }
1245 { &hf_mip_revid,
1246 { "Revocation Identifier", "mip.revid",
1247 FT_UINT32, BASE_DEC, NULL, 0,
1248 "Revocation Identifier of Initiating Agent", HFILL }
1250 { &hf_mip_ack_reserved,
1251 { "Reserved", "mip.ack.reserved",
1252 FT_UINT8, BASE_HEX, NULL, 0x0,
1253 NULL, HFILL}
1255 { &hf_mip_ack_i,
1256 { "Inform", "mip.ack.i",
1257 FT_BOOLEAN, 16, NULL, 32768,
1258 "Inform Mobile Node", HFILL }
1260 { &hf_mip_ack_reserved2,
1261 { "Reserved", "mip.ack.reserved2",
1262 FT_UINT16, BASE_HEX, NULL, 0x7fff,
1263 NULL, HFILL}},
1265 { &hf_mip_dhaext_stype,
1266 { "DynHA Ext SubType", "mip.ext.dynha.subtype",
1267 FT_UINT8, BASE_DEC, VALS(mip_dhaext_stypes), 0,
1268 "Dynamic HA Extension Sub-type", HFILL }
1270 { &hf_mip_dhaext_addr,
1271 { "DynHA Home Agent", "mip.ext.dynha.ha",
1272 FT_IPv4, BASE_NONE, NULL, 0,
1273 "Dynamic Home Agent IP Address", HFILL }
1275 { &hf_mip_mstrext_stype,
1276 { "MsgStr Ext SubType", "mip.ext.msgstr.subtype",
1277 FT_UINT8, BASE_DEC, VALS(mip_mstrext_stypes), 0,
1278 "Message String Extension Sub-type", HFILL }
1280 { &hf_mip_mstrext_text,
1281 { "MsgStr Text", "mip.ext.msgstr.text",
1282 FT_STRING, BASE_NONE, NULL, 0,
1283 "Message String Extension Text", HFILL }
1285 { &hf_mip_nattt_nexthdr,
1286 { "NATTT NextHeader", "mip.nattt.nexthdr",
1287 FT_UINT8, BASE_DEC, VALS(mip_nattt_nexthdr), 0,
1288 "NAT Traversal Tunnel Next Header.", HFILL }
1290 { &hf_mip_nattt_reserved,
1291 { "Reserved", "mip.nattt.reserved",
1292 FT_UINT16, BASE_HEX, NULL , 0x0,
1293 NULL, HFILL }
1295 { &hf_mip_utrqext_stype,
1296 { "UDP TunReq Ext SubType", "mip.ext.utrq.subtype",
1297 FT_UINT8, BASE_DEC, VALS(mip_utrqext_stypes), 0,
1298 "UDP Tunnel Request Extension Sub-type", HFILL }
1300 { &hf_mip_utrqext_reserved1,
1301 { "Reserved 1", "mip.ext.utrq.reserved1",
1302 FT_UINT8, BASE_HEX, NULL, 0x0,
1303 NULL, HFILL }
1305 { &hf_mip_utrqext_flags,
1306 { "UDP TunReq Ext Flags", "mip.ext.utrq.flags",
1307 FT_UINT8, BASE_HEX, NULL, 0x0,
1308 "UDP Tunnel Request Extension Flags", HFILL }
1310 { &hf_mip_utrqext_f,
1311 { "Req Forced", "mip.ext.utrq.f",
1312 FT_BOOLEAN, 8, NULL, 128,
1313 "MN wants to Force UDP Tunneling", HFILL }
1315 { &hf_mip_utrqext_r,
1316 { "FA Registration Required", "mip.ext.utrq.r",
1317 FT_BOOLEAN, 8, NULL, 64,
1318 "Registration through FA Required", HFILL }
1320 { &hf_mip_utrqext_reserved2,
1321 { "Reserved 2", "mip.ext.utrq.reserved2",
1322 FT_UINT8, BASE_HEX, NULL, 0x3f,
1323 NULL, HFILL }
1325 { &hf_mip_utrqext_encap_type,
1326 { "UDP Encap Type", "mip.ext.utrq.encaptype",
1327 FT_UINT8, BASE_DEC, VALS(mip_utrqext_encap_types), 0,
1328 "UDP Encapsulation Type", HFILL }
1330 { &hf_mip_utrqext_reserved3,
1331 { "Reserved 3", "mip.ext.utrq.reserved3",
1332 FT_UINT16, BASE_HEX, NULL, 0x0,
1333 NULL, HFILL }
1335 { &hf_mip_utrpext_stype,
1336 { "UDP TunRep Ext SubType", "mip.ext.utrp.subtype",
1337 FT_UINT8, BASE_DEC, VALS(mip_utrpext_stypes), 0,
1338 "UDP Tunnel Reply Extension Sub-type", HFILL }
1340 { &hf_mip_utrpext_code,
1341 { "UDP TunRep Code", "mip.ext.utrp.code",
1342 FT_UINT8, BASE_DEC, VALS(mip_utrpext_codes), 0,
1343 "UDP Tunnel Reply Code", HFILL }
1345 { &hf_mip_utrpext_flags,
1346 { "UDP TunRep Ext Flags", "mip.ext.utrp.flags",
1347 FT_UINT16, BASE_HEX, NULL, 0x0,
1348 "UDP Tunnel Request Extension Flags", HFILL }
1350 { &hf_mip_utrpext_f,
1351 { "Rep Forced", "mip.ext.utrp.f",
1352 FT_BOOLEAN, 16, NULL, 32768,
1353 "HA wants to Force UDP Tunneling", HFILL }
1355 { &hf_mip_utrpext_reserved,
1356 { "Reserved", "mip.ext.utrp.reserved",
1357 FT_UINT16, BASE_HEX, NULL, 0x7fff,
1358 NULL, HFILL }
1360 { &hf_mip_utrpext_keepalive,
1361 { "Keepalive Interval", "mip.ext.utrp.keepalive",
1362 FT_UINT16, BASE_DEC, NULL, 0,
1363 "NAT Keepalive Interval", HFILL }
1365 { &hf_mip_pmipv4nonskipext_stype,
1366 { "Sub-type", "mip.ext.pmipv4nonskipext.subtype",
1367 FT_UINT8, BASE_DEC, VALS(mip_pmipv4nonskipext_stypes), 0,
1368 "PMIPv4 Skippable Extension Sub-type", HFILL }
1370 { &hf_mip_pmipv4nonskipext_pernodeauthmethod,
1371 { "Per-Node Authentication Method", "mip.ext.pmipv4nonskipext.pernodeauthmethod",
1372 FT_UINT8, BASE_DEC, VALS(mip_pmipv4nonskipext_pernodeauthmethod_types), 0,
1373 NULL, HFILL }
1375 { &hf_mip_pmipv4skipext_stype,
1376 { "Sub-type", "mip.ext.pmipv4skipext.subtype",
1377 FT_UINT8, BASE_DEC, VALS(mip_pmipv4skipext_stypes), 0,
1378 "PMIPv4 Non-skippable Extension Sub-type", HFILL }
1380 { &hf_mip_pmipv4skipext_interfaceid,
1381 { "Interface ID", "mip.ext.pmipv4skipext.interfaceid",
1382 FT_BYTES, BASE_NONE, NULL, 0,
1383 NULL, HFILL }
1385 { &hf_mip_pmipv4skipext_deviceid_type,
1386 { "ID-Type", "mip.ext.pmipv4skipext.deviceid_type",
1387 FT_UINT8, BASE_DEC, VALS(mip_pmipv4skipext_deviceid_types), 0,
1388 "Device ID-Type", HFILL }
1390 { &hf_mip_pmipv4skipext_deviceid_id,
1391 { "Identifier", "mip.ext.pmipv4skipext.deviceid_id",
1392 FT_BYTES, BASE_NONE, NULL, 0,
1393 "Device ID Identifier", HFILL }
1395 { &hf_mip_pmipv4skipext_subscriberid_type,
1396 { "ID-Type", "mip.ext.pmipv4skipext.subscriberid_type",
1397 FT_UINT8, BASE_DEC, VALS(mip_pmipv4skipext_subscriberid_types), 0,
1398 "Subscriber ID-Type", HFILL }
1400 { &hf_mip_pmipv4skipext_subscriberid_id,
1401 { "Identifier", "mip.ext.pmipv4skipext.subscriberid_id",
1402 FT_BYTES, BASE_NONE, NULL, 0,
1403 "Subscriber ID Identifier", HFILL }
1405 { &hf_mip_pmipv4skipext_accesstechnology_type,
1406 { "Access Technology Type", "mip.ext.pmipv4skipext.accesstechnology_type",
1407 FT_UINT8, BASE_DEC, VALS(mip_pmipv4skipext_accesstechnology_types), 0,
1408 NULL, HFILL }
1410 { &hf_mip_cvse_reserved,
1411 { "CVSE Reserved", "mip.ext.cvse.reserved",
1412 FT_UINT8, BASE_HEX, NULL, 0x0,
1413 NULL, HFILL }
1415 { &hf_mip_cvse_vendor_org_id,
1416 { "CVSE Vendor/org ID", "mip.ext.cvse.vendor_id",
1417 FT_UINT32, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0,
1418 NULL, HFILL }
1420 { &hf_mip_cvse_verizon_cvse_type ,
1421 { "Verizon CVSE Type", "mip.ext.cvse.verizon_type",
1422 FT_UINT16, BASE_DEC, VALS(mip_cvse_verizon_cvse_types), 0,
1423 NULL, HFILL }
1425 { &hf_mip_cvse_3gpp2_cvse_type ,
1426 { "3GPP2 CVSE Type","mip.ext.cvse.3gpp2_type",
1427 FT_UINT16, BASE_DEC, NULL, 0,
1428 NULL, HFILL }
1430 { &hf_mip_cvse_3gpp2_grekey,
1431 { "GRE Key","mip.ext.cvse.3gpp2_grekey",
1432 FT_UINT32, BASE_DEC, NULL, 0,
1433 NULL, HFILL }
1435 { &hf_mip_cvse_vendor_cvse_type,
1436 { "Vendor CVSE Type", "mip.ext.cvse.vendor_type",
1437 FT_UINT16, BASE_HEX, NULL, 0x0,
1438 NULL, HFILL }
1440 { &hf_mip_cvse_vendor_cvse_value,
1441 { "Vendor CVSE Value", "mip.ext.cvse.vendor_value",
1442 FT_BYTES, BASE_NONE, NULL, 0,
1443 NULL, HFILL }
1445 { &hf_mip_nvse_reserved,
1446 { "Reserved", "mip.ext.nvse.reserved",
1447 FT_UINT16, BASE_HEX, NULL, 0x0,
1448 NULL, HFILL }
1450 { &hf_mip_nvse_vendor_org_id,
1451 { "Vendor ID", "mip.ext.nvse.vendor_id",
1452 FT_UINT32, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0,
1453 NULL, HFILL }
1455 { &hf_mip_nvse_vendor_nvse_type ,
1456 { "Vendor Type", "mip.ext.nvse.vendor_type",
1457 FT_UINT16, BASE_DEC, NULL, 0x0,
1458 NULL, HFILL }
1460 { &hf_mip_nvse_vendor_nvse_value ,
1461 { "Vendor Value", "mip.ext.nvse.vendor_value",
1462 FT_BYTES, BASE_NONE, NULL, 0,
1463 NULL, HFILL }
1465 { &hf_mip_nvse_3gpp2_type ,
1466 { "Type", "mip.ext.nvse.3gpp2.type",
1467 FT_UINT16, BASE_DEC, VALS(mip_nvse_3gpp2_type_vals), 0,
1468 NULL, HFILL }
1470 { &hf_mip_nvse_3gpp2_type16_value ,
1471 { "value", "mip.ext.nvse.3gpp2.type16.value",
1472 FT_UINT16, BASE_DEC, VALS(mip_nvse_3gpp2_type17_vals), 0,
1473 NULL, HFILL }
1475 { &hf_mip_nvse_3gpp2_type17_entity,
1476 { "Entity-Type", "mip.ext.nvse.3gpp2.type17.entity",
1477 FT_UINT8, BASE_DEC, VALS(mip_nvse_3gpp2_type17_entity_vals), 0,
1478 NULL, HFILL }
1480 { &hf_mip_nvse_3gpp2_type17_subtype1,
1481 { "Sub-Type1", "mip.ext.nvse.3gpp2.type17.subtype1",
1482 FT_UINT8, BASE_DEC, NULL, 0,
1483 NULL, HFILL }
1485 { &hf_mip_nvse_3gpp2_type17_length,
1486 { "Length", "mip.ext.nvse.3gpp2.type17.length",
1487 FT_UINT8, BASE_DEC, NULL, 0,
1488 NULL, HFILL }
1490 { &hf_mip_nvse_3gpp2_type17_subtype2,
1491 { "Sub-Type2", "mip.ext.nvse.3gpp2.type17.subtype2",
1492 FT_UINT8, BASE_DEC, NULL, 0,
1493 NULL, HFILL }
1495 { &hf_mip_nvse_3gpp2_type17_prim_dns,
1496 { "Primary DNS", "mip.ext.nvse.3gpp2.type17.prim_dns",
1497 FT_IPv4, BASE_NONE, NULL, 0,
1498 NULL, HFILL }
1500 { &hf_mip_nvse_3gpp2_type17_sec_dns,
1501 { "Secondary DNS", "mip.ext.nvse.3gpp2.type17.sec_dns",
1502 FT_IPv4, BASE_NONE, NULL, 0,
1503 NULL, HFILL }
1505 { &hf_mip_mne_sub_type,
1506 { "Sub-Type", "mip.ext.mne.subtype",
1507 FT_UINT8, BASE_DEC, VALS(mip_mne_stypes), 0,
1508 NULL, HFILL }
1510 { &hf_mip_mne_code,
1511 { "Code", "mip.ext.mne.code",
1512 FT_UINT8, BASE_DEC, VALS(mip_mne_codes), 0,
1513 NULL, HFILL }
1515 { &hf_mip_mne_prefix_length,
1516 { "Prefix Length", "mip.ext.mne.prefix_length",
1517 FT_UINT8, BASE_DEC, NULL, 0,
1518 NULL, HFILL }
1520 { &hf_mip_mne_reserved,
1521 { "Reserved", "mip.ext.mne.reserved",
1522 FT_UINT8, BASE_HEX, NULL, 0,
1523 NULL, HFILL }
1525 { &hf_mip_mne_prefix,
1526 { "Prefix", "mip.ext.mne.prefix",
1527 FT_IPv4, BASE_NETMASK, NULL, 0,
1528 NULL, HFILL }
1532 /* Setup protocol subtree array */
1533 static int *ett[] = {
1534 &ett_mip,
1535 &ett_mip_flags,
1536 &ett_mip_ext,
1537 &ett_mip_exts,
1538 &ett_mip_pmipv4_ext,
1541 static ei_register_info ei[] = {
1542 { &ei_mip_data_not_dissected, { "mip.data_not_dissected", PI_UNDECODED, PI_WARN, "Data not dissected yet", EXPFILL }},
1545 expert_module_t* expert_mip;
1547 /* Register the protocol name and description */
1548 proto_mip = proto_register_protocol("Mobile IP", "Mobile IP", "mip");
1550 /* Register the dissector by name */
1551 mip_handle = register_dissector("mip", dissect_mip, proto_mip);
1553 /* Required function calls to register the header fields and subtrees used */
1554 proto_register_field_array(proto_mip, hf, array_length(hf));
1555 proto_register_subtree_array(ett, array_length(ett));
1556 expert_mip = expert_register_protocol(proto_mip);
1557 expert_register_field_array(expert_mip, ei, array_length(ei));
1559 mip_nvse_ext_dissector_table = register_dissector_table("mip.nvse_ext",
1560 "MIP Normal Vendor/Organization Specific Extension", proto_mip, FT_UINT32, BASE_DEC);
1563 void
1564 proto_reg_handoff_mip(void)
1566 ip_handle = find_dissector_add_dependency("ip", proto_mip);
1567 dissector_add_uint_with_preference("udp.port", UDP_PORT_MIP, mip_handle);
1569 /* Register as dissector for 3GPP2 NVSE */
1570 dissector_add_uint("mip.nvse_ext", VENDOR_THE3GPP2,
1571 create_dissector_handle(dissect_mip_priv_ext_3gpp2, proto_mip));
1575 * Editor modelines
1577 * Local Variables:
1578 * c-basic-offset: 2
1579 * tab-width: 8
1580 * indent-tabs-mode: nil
1581 * End:
1583 * ex: set shiftwidth=2 tabstop=8 expandtab:
1584 * :indentSize=2:tabSize=8:noTabs=true: