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
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 */
30 static int hf_mip_type
;
31 static int hf_mip_flags
;
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 */
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 */
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,
154 MIP_CAREOF_TEST
= 27,
155 MIP_EXPERIMENTAL_MESSAGE
= 255
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"},
180 static const value_string mip_reply_codes
[]= {
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"},
241 static const value_string mip_nattt_nexthdr
[]= {
244 {55, "Minimal IP Encapsulation Header"},
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 */
267 PMIPv4_SKIP_EXT
= 147, /* draft-leung-mip4-proxy-mode */
268 MNE_EXT
= 148, /* RFC 5177 */
269 SKIP_EXP_EXT
= 255, /* RFC 4064 */
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]*/
304 {151, "Service Selection Extension"}, /*[RFC5446]*/
305 {152, "Dual Stack (DSMIPv4) Extension"}, /*[RFC5454]*/
306 {SKIP_EXP_EXT
, "Skippable Extension for Experimental use"},
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"},
318 /* UDP Tunnel Reply Extension: */
319 static const value_string mip_utrpext_stypes
[]= {
320 {0, "Regular UDP Tunnel Reply Extension"},
324 /* Dynamic HA Extension subtypes */
325 static const value_string mip_dhaext_stypes
[]= {
326 {1, "Requested HA Extension"},
327 {2, "Redirected HA Extension"},
331 static const value_string mip_mstrext_stypes
[]= {
337 static const value_string mip_utrqext_stypes
[]= {
342 static const value_string mip_utrqext_encap_types
[]= {
345 {55, "Minimal IP Encapsulation Header"},
350 static const value_string mip_utrpext_codes
[]= {
351 {0, "Will do Tunneling"},
352 {64, "Tunneling Declined, Reason Unspecified"},
356 static const value_string mip_pmipv4nonskipext_stypes
[]= {
358 {1, "Per-Node Authentication Method"},
362 /* PMIPv4 Per-Node Authentication Method Types */
363 static const value_string mip_pmipv4nonskipext_pernodeauthmethod_types
[]= {
365 {1, "FA-HA Authentication"},
366 {2, "IPSec Authentication"},
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
[]= {
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"},
383 /* PMIPv4 Device ID Types */
384 static const value_string mip_pmipv4skipext_deviceid_types
[]= {
386 {1, "Ethernet MAC address"},
387 {2, "Mobile Equipment Identifier (MEID)"},
388 {3, "International Mobile Equipment Identity (IMEI)"},
389 {4, "Electronic Serial Number (ESN)"},
393 /* PMIPv4 Subscriber ID Types */
394 static const value_string mip_pmipv4skipext_subscriberid_types
[]= {
396 {1, "International Mobile Subscriber Identity (IMSI)"},
400 /* Access Technology Types */
401 static const value_string mip_pmipv4skipext_accesstechnology_types
[]= {
407 {5, "3GPP EUTRAN/LTE"},
408 {6, "3GPP UTRAN/GERAN"},
409 {7, "3GPP2 1xRTT/HRPD"},
414 static const value_string mip_cvse_verizon_cvse_types
[]= {
416 {1, "MIP Key Request"},
418 {3, "AAA Authenticator"},
419 {4, "Public Key Invalid"},
423 /* https://www.3gpp2.org/Public_html/X/VSA-VSE.cfm */
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"},
431 {1281, "Binding Type Extension"},
432 {1537, "GRE Tunnel Endpoint Extension"},
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"},
444 static const value_string mip_nvse_3gpp2_type17_entity_vals
[]= {
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"},
459 static const value_string mip_mne_stypes
[]= {
460 {0, "Mobile Network Request"},
461 {1, "Explicit Mode Acknowledgement"},
462 {2, "Implicit Mode Acknowledgement"},
466 static const value_string mip_mne_codes
[]= {
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)"},
474 static dissector_handle_t ip_handle
;
476 /* Code to dissect 3GPP2 extensions */
479 dissect_mip_priv_ext_3gpp2(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, void *data _U_
)
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
);
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
);
493 case 17: /* DNS server IP address X.S0011-002-C v3.0*/
495 proto_tree_add_item(tree
, hf_mip_nvse_3gpp2_type17_entity
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
498 proto_tree_add_item(tree
, hf_mip_nvse_3gpp2_type17_subtype1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
501 proto_tree_add_item(tree
, hf_mip_nvse_3gpp2_type17_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
503 /* DNS server IP address */
504 proto_tree_add_item(tree
, hf_mip_nvse_3gpp2_type17_prim_dns
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
507 proto_tree_add_item(tree
, hf_mip_nvse_3gpp2_type17_subtype2
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
510 proto_tree_add_item(tree
, hf_mip_nvse_3gpp2_type17_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
512 /* DNS server IP address.*/
513 proto_tree_add_item(tree
, hf_mip_nvse_3gpp2_type17_sec_dns
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
516 proto_tree_add_expert(tree
, pinfo
, &ei_mip_data_not_dissected
, tvb
, offset
, -1);
523 /* Code to dissect extensions */
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
;
532 uint8_t ext_subtype
=0;
533 uint8_t pmipv4skipext_subscriberid_type
;
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);
558 else if(ext_type
==CVSE_EXT
){
560 * CVSE also breaks since it added reserved field before
563 ext_len
= tvb_get_ntohs(tvb
, offset
+ 2);
567 ext_len
= tvb_get_uint8(tvb
, offset
+ 1);
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
);
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
);
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
);
595 proto_tree_add_item(ext_tree
, hf_mip_next_nai
, tvb
, offset
,
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
);
606 proto_tree_add_uint(ext_tree
, hf_mip_ext_len
, tvb
, offset
, 2, ext_len
);
609 proto_tree_add_item(ext_tree
, hf_mip_aext_spi
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
611 proto_tree_add_item(ext_tree
, hf_mip_aext_auth
, tvb
, offset
+ 4,
612 ext_len
- 4, ENC_NA
);
615 case REV_SUPP_EXT
: /* RFC 3543 */
618 static int * const flags
[] = {
620 &hf_mip_rext_reserved
,
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
);
630 case DYN_HA_EXT
: /* RFC 4433 */
632 proto_tree_add_item(ext_tree
, hf_mip_dhaext_stype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
634 proto_tree_add_item(ext_tree
, hf_mip_dhaext_addr
, tvb
, offset
+ 1, 4, ENC_BIG_ENDIAN
);
638 proto_tree_add_item(ext_tree
, hf_mip_mstrext_stype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
641 proto_tree_add_item(ext_tree
, hf_mip_mstrext_text
, tvb
, offset
+ 1, ext_len
-1, ENC_ASCII
);
643 case UDP_TUN_REQ_EXT
: /* RFC 3519 */
645 static int * const flags
[] = {
648 &hf_mip_utrqext_reserved2
,
653 proto_tree_add_item(ext_tree
, hf_mip_utrqext_stype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
656 proto_tree_add_item(ext_tree
, hf_mip_utrqext_reserved1
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
659 proto_tree_add_bitmask(ext_tree
, tvb
, offset
+ 2, hf_mip_utrqext_flags
, ett_mip_flags
, flags
, ENC_BIG_ENDIAN
);
662 proto_tree_add_item(ext_tree
, hf_mip_utrqext_encap_type
, tvb
, offset
+ 3, 1, ENC_BIG_ENDIAN
);
665 proto_tree_add_item(ext_tree
, hf_mip_utrqext_reserved3
, tvb
, offset
+ 4, 2, ENC_BIG_ENDIAN
);
668 case UDP_TUN_REP_EXT
: /* RFC 3519 */
670 static int * const flags
[] = {
672 &hf_mip_utrpext_reserved
,
676 proto_tree_add_item(ext_tree
, hf_mip_utrpext_stype
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
679 proto_tree_add_item(ext_tree
, hf_mip_utrpext_code
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
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
);
688 case PMIPv4_NON_SKIP_EXT
: /* draft-leung-mip4-proxy-mode */
690 proto_tree_add_uint(ext_tree
, hf_mip_pmipv4nonskipext_stype
, tvb
, offset
, 1, ext_subtype
);
693 proto_tree_add_uint(ext_tree
, hf_mip_ext_len
, tvb
, offset
, 2, ext_len
);
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
);
700 case PMIPv4_SKIP_EXT
: /* draft-leung-mip4-proxy-mode */
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
);
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
);
732 proto_tree_add_uint(ext_tree
, hf_mip_ext_len
, tvb
, offset
, 2, ext_len
);
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;
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 ?*/
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
);
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
);
764 case OLD_NVSE_EXT
: /* RFC 3115 */
765 case NVSE_EXT
: /* RFC 3115 */
767 uint32_t nvse_vendor_org_id
;
770 proto_tree_add_item(ext_tree
, hf_mip_nvse_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
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
)){
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
);
792 case MNE_EXT
: /* RFC 5177 */
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;
801 proto_tree_add_item(ext_tree
, hf_mip_mne_prefix_length
, tvb
, mne_local_offset
, 1, ENC_BIG_ENDIAN
);
806 proto_tree_add_item(ext_tree
, hf_mip_mne_code
, tvb
, mne_local_offset
, 1, ENC_BIG_ENDIAN
);
808 proto_tree_add_item(ext_tree
, hf_mip_mne_prefix_length
, tvb
, mne_local_offset
, 1, ENC_BIG_ENDIAN
);
810 proto_tree_add_item(ext_tree
, hf_mip_mne_reserved
, tvb
, mne_local_offset
, 1, ENC_BIG_ENDIAN
);
814 proto_tree_add_expert_format(ext_tree
, pinfo
, &ei_mip_data_not_dissected
, tvb
, offset
, -1, "Unable to decode (Unknown Sub-Type)");
817 proto_tree_add_item(ext_tree
, hf_mip_mne_prefix
, tvb
, mne_local_offset
, 4, ENC_BIG_ENDIAN
);
821 case MF_CHALLENGE_EXT
: /* RFC 3012 */
822 /* The default dissector is good here. The challenge is all hex anyway. */
824 proto_tree_add_item(ext_tree
, hf_mip_ext
, tvb
, offset
, ext_len
, ENC_NA
);
829 } /* while data remaining */
831 } /* dissect_mip_extensions */
833 /* Code to actually dissect the packets */
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 */
839 proto_tree
*mip_tree
=NULL
;
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
);
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));
859 static int * const flags
[] = {
871 ti
= proto_tree_add_item(tree
, proto_mip
, tvb
, offset
, -1, ENC_NA
);
872 mip_tree
= proto_item_add_subtree(ti
, ett_mip
);
875 proto_tree_add_uint(mip_tree
, hf_mip_type
, tvb
, offset
, 1, type
);
879 proto_tree_add_bitmask(mip_tree
, tvb
, offset
, hf_mip_flags
, ett_mip_flags
, flags
, ENC_BIG_ENDIAN
);
883 proto_tree_add_item(mip_tree
, hf_mip_life
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
887 proto_tree_add_item(mip_tree
, hf_mip_homeaddr
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
890 /* home agent address */
891 proto_tree_add_item(mip_tree
, hf_mip_haaddr
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
894 /* Care of Address */
895 proto_tree_add_item(mip_tree
, hf_mip_coa
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
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
);
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));
915 ti
= proto_tree_add_item(tree
, proto_mip
, tvb
, offset
, -1, ENC_NA
);
916 mip_tree
= proto_item_add_subtree(ti
, ett_mip
);
919 proto_tree_add_uint(mip_tree
, hf_mip_type
, tvb
, offset
, 1, type
);
923 proto_tree_add_item(mip_tree
, hf_mip_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
926 /* Registration Lifetime */
927 proto_tree_add_item(mip_tree
, hf_mip_life
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
931 proto_tree_add_item(mip_tree
, hf_mip_homeaddr
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
934 /* Home Agent Address */
935 proto_tree_add_item(mip_tree
, hf_mip_haaddr
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
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
);
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));
951 ti
= proto_tree_add_item(tree
, proto_mip
, tvb
, offset
, -1, ENC_NA
);
952 mip_tree
= proto_item_add_subtree(ti
, ett_mip
);
955 proto_tree_add_uint(mip_tree
, hf_mip_type
, tvb
, offset
, 1, type
);
959 proto_tree_add_item(mip_tree
, hf_mip_nattt_nexthdr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
963 proto_tree_add_item(mip_tree
, hf_mip_nattt_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
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
);
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));
981 static int * const mip_flags
[] = {
984 &hf_mip_rev_reserved2
,
988 ti
= proto_tree_add_item(tree
, proto_mip
, tvb
, offset
, -1, ENC_NA
);
989 mip_tree
= proto_item_add_subtree(ti
, ett_mip
);
992 proto_tree_add_uint(mip_tree
, hf_mip_type
, tvb
, offset
, 1, type
);
996 proto_tree_add_item(mip_tree
, hf_mip_rev_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1000 proto_tree_add_bitmask(mip_tree
, tvb
, offset
, hf_mip_flags2
, ett_mip_flags
, mip_flags
, ENC_BIG_ENDIAN
);
1004 proto_tree_add_item(mip_tree
, hf_mip_homeaddr
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1007 /* home domain address */
1008 proto_tree_add_item(mip_tree
, hf_mip_hda
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1011 /* foreign domain address */
1012 proto_tree_add_item(mip_tree
, hf_mip_fda
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1015 /* revocation identifier */
1016 proto_tree_add_item(mip_tree
, hf_mip_revid
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
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));
1027 static int * const mip_flags
[] = {
1029 &hf_mip_ack_reserved2
,
1033 ti
= proto_tree_add_item(tree
, proto_mip
, tvb
, offset
, -1, ENC_NA
);
1034 mip_tree
= proto_item_add_subtree(ti
, ett_mip
);
1037 proto_tree_add_uint(mip_tree
, hf_mip_type
, tvb
, offset
, 1, type
);
1041 proto_tree_add_item(mip_tree
, hf_mip_ack_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1045 proto_tree_add_bitmask(mip_tree
, tvb
, offset
, hf_mip_flags2
, ett_mip_flags
, mip_flags
, ENC_BIG_ENDIAN
);
1049 proto_tree_add_item(mip_tree
, hf_mip_homeaddr
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1052 /* revocation identifier */
1053 proto_tree_add_item(mip_tree
, hf_mip_revid
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1061 if (tvb_reported_length_remaining(tvb
, offset
) > 0)
1062 dissect_mip_extensions(tvb
, offset
, mip_tree
, pinfo
);
1064 return tvb_captured_length(tvb
);
1067 /* Register the protocol with Wireshark */
1068 void proto_register_mip(void)
1071 /* Setup list of header fields */
1072 static hf_register_info hf
[] = {
1074 { "Message Type", "mip.type",
1075 FT_UINT8
, BASE_DEC
, VALS(mip_types
), 0,
1076 "Mobile IP Message type.", HFILL
}
1079 {"Flags", "mip.flags",
1080 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1084 {"Simultaneous Bindings", "mip.s",
1085 FT_BOOLEAN
, 8, NULL
, 128,
1086 "Simultaneous Bindings Allowed", HFILL
}
1089 {"Broadcast Datagrams", "mip.b",
1090 FT_BOOLEAN
, 8, NULL
, 64,
1091 "Broadcast Datagrams requested", HFILL
}
1094 { "Co-located Care-of Address", "mip.d",
1095 FT_BOOLEAN
, 8, NULL
, 32,
1096 "MN using Co-located Care-of address", HFILL
}
1099 {"Minimal Encapsulation", "mip.m",
1100 FT_BOOLEAN
, 8, NULL
, 16,
1101 "MN wants Minimal encapsulation", HFILL
}
1105 FT_BOOLEAN
, 8, NULL
, 8,
1106 "MN wants GRE encapsulation", HFILL
}
1109 { "Van Jacobson", "mip.v",
1110 FT_BOOLEAN
, 8, NULL
, 4,
1114 { "Reverse Tunneling", "mip.t",
1115 FT_BOOLEAN
, 8, NULL
, 2,
1116 "Reverse tunneling requested", HFILL
}
1119 { "Reserved", "mip.x",
1120 FT_BOOLEAN
, 8, NULL
, 1,
1124 { "Reply Code", "mip.code",
1125 FT_UINT8
, BASE_DEC
, VALS(mip_reply_codes
), 0,
1126 "Mobile IP Reply code.", HFILL
}
1129 { "Lifetime", "mip.life",
1130 FT_UINT16
, BASE_DEC
, NULL
, 0,
1131 "Mobile IP Lifetime.", HFILL
}
1134 { "Home Address", "mip.homeaddr",
1135 FT_IPv4
, BASE_NONE
, NULL
, 0,
1136 "Mobile Node's home address.", HFILL
}
1140 { "Home Agent", "mip.haaddr",
1141 FT_IPv4
, BASE_NONE
, NULL
, 0,
1142 "Home agent IP Address.", HFILL
}
1145 { "Care of Address", "mip.coa",
1146 FT_IPv4
, BASE_NONE
, NULL
, 0,
1147 "Care of Address.", HFILL
}
1150 { "Identification", "mip.ident",
1151 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_UTC
, NULL
, 0,
1152 "MN Identification.", HFILL
}
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
}
1165 { "Extension Length", "mip.ext.len",
1166 FT_UINT16
, BASE_DEC
, NULL
, 0,
1167 "Mobile IP Extension Length.", HFILL
}
1170 { "Extension", "mip.extension",
1171 FT_BYTES
, BASE_NONE
, NULL
, 0,
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
}
1186 FT_STRING
, BASE_NONE
, NULL
, 0,
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
}
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,
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,
1215 {"Flags", "mip.flags2",
1216 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1220 { "Home Agent", "mip.rev.a",
1221 FT_BOOLEAN
, 16, NULL
, 32768,
1222 "Revocation sent by Home Agent", HFILL
}
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,
1236 { "Home Domain Address", "mip.rev.hda",
1237 FT_IPv4
, BASE_NONE
, NULL
, 0,
1238 "Revocation Home Domain IP Address", HFILL
}
1241 { "Foreign Domain Address", "mip.rev.fda",
1242 FT_IPv4
, BASE_NONE
, NULL
, 0,
1243 "Revocation Foreign Domain IP Address", HFILL
}
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
1410 { &hf_mip_cvse_reserved
,
1411 { "CVSE Reserved", "mip.ext.cvse.reserved",
1412 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
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,
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,
1425 { &hf_mip_cvse_3gpp2_cvse_type
,
1426 { "3GPP2 CVSE Type","mip.ext.cvse.3gpp2_type",
1427 FT_UINT16
, BASE_DEC
, NULL
, 0,
1430 { &hf_mip_cvse_3gpp2_grekey
,
1431 { "GRE Key","mip.ext.cvse.3gpp2_grekey",
1432 FT_UINT32
, BASE_DEC
, NULL
, 0,
1435 { &hf_mip_cvse_vendor_cvse_type
,
1436 { "Vendor CVSE Type", "mip.ext.cvse.vendor_type",
1437 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1440 { &hf_mip_cvse_vendor_cvse_value
,
1441 { "Vendor CVSE Value", "mip.ext.cvse.vendor_value",
1442 FT_BYTES
, BASE_NONE
, NULL
, 0,
1445 { &hf_mip_nvse_reserved
,
1446 { "Reserved", "mip.ext.nvse.reserved",
1447 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1450 { &hf_mip_nvse_vendor_org_id
,
1451 { "Vendor ID", "mip.ext.nvse.vendor_id",
1452 FT_UINT32
, BASE_ENTERPRISES
, STRINGS_ENTERPRISES
, 0,
1455 { &hf_mip_nvse_vendor_nvse_type
,
1456 { "Vendor Type", "mip.ext.nvse.vendor_type",
1457 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1460 { &hf_mip_nvse_vendor_nvse_value
,
1461 { "Vendor Value", "mip.ext.nvse.vendor_value",
1462 FT_BYTES
, BASE_NONE
, NULL
, 0,
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,
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,
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,
1480 { &hf_mip_nvse_3gpp2_type17_subtype1
,
1481 { "Sub-Type1", "mip.ext.nvse.3gpp2.type17.subtype1",
1482 FT_UINT8
, BASE_DEC
, NULL
, 0,
1485 { &hf_mip_nvse_3gpp2_type17_length
,
1486 { "Length", "mip.ext.nvse.3gpp2.type17.length",
1487 FT_UINT8
, BASE_DEC
, NULL
, 0,
1490 { &hf_mip_nvse_3gpp2_type17_subtype2
,
1491 { "Sub-Type2", "mip.ext.nvse.3gpp2.type17.subtype2",
1492 FT_UINT8
, BASE_DEC
, NULL
, 0,
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,
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,
1505 { &hf_mip_mne_sub_type
,
1506 { "Sub-Type", "mip.ext.mne.subtype",
1507 FT_UINT8
, BASE_DEC
, VALS(mip_mne_stypes
), 0,
1511 { "Code", "mip.ext.mne.code",
1512 FT_UINT8
, BASE_DEC
, VALS(mip_mne_codes
), 0,
1515 { &hf_mip_mne_prefix_length
,
1516 { "Prefix Length", "mip.ext.mne.prefix_length",
1517 FT_UINT8
, BASE_DEC
, NULL
, 0,
1520 { &hf_mip_mne_reserved
,
1521 { "Reserved", "mip.ext.mne.reserved",
1522 FT_UINT8
, BASE_HEX
, NULL
, 0,
1525 { &hf_mip_mne_prefix
,
1526 { "Prefix", "mip.ext.mne.prefix",
1527 FT_IPv4
, BASE_NETMASK
, NULL
, 0,
1532 /* Setup protocol subtree array */
1533 static int *ett
[] = {
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
);
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
));
1580 * indent-tabs-mode: nil
1583 * ex: set shiftwidth=2 tabstop=8 expandtab:
1584 * :indentSize=2:tabSize=8:noTabs=true: