2000-05-27 13:53:26 +00:00
|
|
|
/* packet-mip.c
|
|
|
|
* Routines for Mobile IP dissection
|
2001-02-14 17:01:44 +00:00
|
|
|
* Copyright 2000, Stefan Raab <sraab@cisco.com>
|
2007-05-26 01:01:27 +00:00
|
|
|
* Copyright 2007, Ville Nuorvala <Ville.Nuorvala@secgo.com>
|
2000-05-27 13:53:26 +00:00
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2000-05-27 13:53:26 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2000-05-27 13:53:26 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2000-05-27 13:53:26 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2000-05-27 13:53:26 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2000-08-11 13:37:21 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <glib.h>
|
2001-02-14 17:01:44 +00:00
|
|
|
#include <time.h>
|
2000-08-11 13:37:21 +00:00
|
|
|
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
2005-03-01 06:03:08 +00:00
|
|
|
#include "packet-ntp.h"
|
2000-05-27 13:53:26 +00:00
|
|
|
|
|
|
|
/* Initialize the protocol and registered fields */
|
|
|
|
static int proto_mip = -1;
|
|
|
|
static int hf_mip_type = -1;
|
2001-10-31 07:58:43 +00:00
|
|
|
static int hf_mip_flags = -1;
|
2000-05-27 13:53:26 +00:00
|
|
|
static int hf_mip_s = -1;
|
|
|
|
static int hf_mip_b = -1;
|
|
|
|
static int hf_mip_d = -1;
|
|
|
|
static int hf_mip_m = -1;
|
|
|
|
static int hf_mip_g = -1;
|
|
|
|
static int hf_mip_v = -1;
|
2001-02-27 00:27:27 +00:00
|
|
|
static int hf_mip_t = -1;
|
2007-05-26 01:01:27 +00:00
|
|
|
static int hf_mip_x = -1;
|
2000-05-27 13:53:26 +00:00
|
|
|
static int hf_mip_code = -1;
|
|
|
|
static int hf_mip_life = -1;
|
|
|
|
static int hf_mip_homeaddr = -1;
|
|
|
|
static int hf_mip_haaddr = -1;
|
|
|
|
static int hf_mip_coa = -1;
|
|
|
|
static int hf_mip_ident = -1;
|
2001-02-14 17:01:44 +00:00
|
|
|
static int hf_mip_ext_type = -1;
|
2007-05-26 01:01:27 +00:00
|
|
|
static int hf_mip_gaext_stype = -1;
|
2001-02-14 17:01:44 +00:00
|
|
|
static int hf_mip_ext_len = -1;
|
2001-10-31 07:58:43 +00:00
|
|
|
static int hf_mip_ext = -1;
|
2001-02-14 17:01:44 +00:00
|
|
|
static int hf_mip_aext_spi = -1;
|
|
|
|
static int hf_mip_aext_auth = -1;
|
|
|
|
static int hf_mip_next_nai = -1;
|
2007-05-26 01:01:27 +00:00
|
|
|
static int hf_mip_rext_flags = -1;
|
|
|
|
static int hf_mip_rext_i = -1;
|
|
|
|
static int hf_mip_rext_reserved = -1;
|
|
|
|
static int hf_mip_rext_tstamp = -1;
|
|
|
|
static int hf_mip_rev_reserved = -1;
|
|
|
|
static int hf_mip_rev_a = -1;
|
|
|
|
static int hf_mip_rev_i = -1;
|
|
|
|
static int hf_mip_rev_reserved2 = -1;
|
|
|
|
static int hf_mip_ack_reserved = -1;
|
|
|
|
static int hf_mip_ack_i = -1;
|
|
|
|
static int hf_mip_ack_reserved2 = -1;
|
|
|
|
static int hf_mip_hda = -1;
|
|
|
|
static int hf_mip_fda = -1;
|
|
|
|
static int hf_mip_revid = -1;
|
|
|
|
static int hf_mip_dhaext_stype = -1;
|
|
|
|
static int hf_mip_dhaext_addr = -1;
|
|
|
|
static int hf_mip_mstrext_stype = -1;
|
|
|
|
static int hf_mip_mstrext_text = -1;
|
|
|
|
static int hf_mip_nattt_nexthdr = -1;
|
|
|
|
static int hf_mip_nattt_reserved = -1;
|
|
|
|
static int hf_mip_utrqext_stype = -1;
|
|
|
|
static int hf_mip_utrqext_reserved1 = -1;
|
|
|
|
static int hf_mip_utrqext_flags = -1;
|
|
|
|
static int hf_mip_utrqext_f = -1;
|
|
|
|
static int hf_mip_utrqext_r = -1;
|
|
|
|
static int hf_mip_utrqext_reserved2 = -1;
|
|
|
|
static int hf_mip_utrqext_encap_type = -1;
|
|
|
|
static int hf_mip_utrqext_reserved3 = -1;
|
|
|
|
static int hf_mip_utrpext_stype = -1;
|
|
|
|
static int hf_mip_utrpext_code = -1;
|
|
|
|
static int hf_mip_utrpext_flags = -1;
|
|
|
|
static int hf_mip_utrpext_f = -1;
|
|
|
|
static int hf_mip_utrpext_reserved = -1;
|
|
|
|
static int hf_mip_utrpext_keepalive = -1;
|
2000-05-27 13:53:26 +00:00
|
|
|
|
|
|
|
/* Initialize the subtree pointers */
|
|
|
|
static gint ett_mip = -1;
|
2001-10-31 07:58:43 +00:00
|
|
|
static gint ett_mip_flags = -1;
|
2001-02-14 17:01:44 +00:00
|
|
|
static gint ett_mip_ext = -1;
|
2001-10-31 07:58:43 +00:00
|
|
|
static gint ett_mip_exts = -1;
|
2000-05-27 13:53:26 +00:00
|
|
|
|
|
|
|
/* Port used for Mobile IP */
|
|
|
|
#define UDP_PORT_MIP 434
|
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
typedef enum {
|
|
|
|
REGISTRATION_REQUEST = 1,
|
2007-05-26 01:01:27 +00:00
|
|
|
REGISTRATION_REPLY = 3,
|
|
|
|
NATT_TUNNEL_DATA = 4,
|
|
|
|
REGISTRATION_REVOCATION = 7,
|
|
|
|
REGISTRATION_REVOCATION_ACKNOWLEDGEMENT = 15,
|
|
|
|
EXPERIMENTAL_MESSAGE = 255
|
2001-10-31 07:58:43 +00:00
|
|
|
} mipMessageTypes;
|
|
|
|
|
2000-05-27 13:53:26 +00:00
|
|
|
static const value_string mip_types[] = {
|
2001-10-31 07:58:43 +00:00
|
|
|
{REGISTRATION_REQUEST, "Registration Request"},
|
|
|
|
{REGISTRATION_REPLY, "Registration Reply"},
|
2007-05-26 01:01:27 +00:00
|
|
|
{NATT_TUNNEL_DATA, "NAT Traversal Tunnel Data"},
|
|
|
|
{REGISTRATION_REVOCATION, "Registration Revocation"},
|
|
|
|
{REGISTRATION_REVOCATION_ACKNOWLEDGEMENT, "Registration Revocation Acknowledgement"},
|
|
|
|
{EXPERIMENTAL_MESSAGE, "Message for Experimental Use"},
|
|
|
|
{0, NULL}
|
2000-05-27 13:53:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string mip_reply_codes[]= {
|
2001-02-14 17:01:44 +00:00
|
|
|
{0, "Reg Accepted"},
|
2007-05-26 01:01:27 +00:00
|
|
|
{1, "Reg Accepted, but Simultaneous Bindings Unsupported"},
|
2001-02-14 17:01:44 +00:00
|
|
|
{64, "Reg Deny (FA)- Unspecified Reason"},
|
|
|
|
{65, "Reg Deny (FA)- Administratively Prohibited"},
|
|
|
|
{66, "Reg Deny (FA)- Insufficient Resources"},
|
2007-05-26 01:01:27 +00:00
|
|
|
{67, "Reg Deny (FA)- MN Failed Authentication"},
|
|
|
|
{68, "Reg Deny (FA)- HA Failed Authentication"},
|
2001-02-14 17:01:44 +00:00
|
|
|
{69, "Reg Deny (FA)- Requested Lifetime too Long"},
|
|
|
|
{70, "Reg Deny (FA)- Poorly Formed Request"},
|
|
|
|
{71, "Reg Deny (FA)- Poorly Formed Reply"},
|
|
|
|
{72, "Reg Deny (FA)- Requested Encapsulation Unavailable"},
|
|
|
|
{73, "Reg Deny (FA)- VJ Compression Unavailable"},
|
2001-02-27 00:27:27 +00:00
|
|
|
{74, "Reg Deny (FA)- Requested Reverse Tunnel Unavailable"},
|
2007-05-26 01:01:27 +00:00
|
|
|
{75, "Reg Deny (FA)- Reverse Tunnel Is Mandatory and 'T' Bit Not Set"},
|
2001-02-27 00:27:27 +00:00
|
|
|
{76, "Reg Deny (FA)- Mobile Node Too Distant"},
|
2005-12-20 18:38:13 +00:00
|
|
|
{77, "Reg Deny (FA)- Invalid Care-of Address"},
|
2007-05-26 01:01:27 +00:00
|
|
|
{78, "Reg Deny (FA)- Registration Timeout"},
|
2001-02-27 00:27:27 +00:00
|
|
|
{79, "Reg Deny (FA)- Delivery Style Not Supported"},
|
2001-02-14 17:01:44 +00:00
|
|
|
{80, "Reg Deny (FA)- Home Network Unreachable"},
|
|
|
|
{81, "Reg Deny (FA)- HA Host Unreachable"},
|
|
|
|
{82, "Reg Deny (FA)- HA Port Unreachable"},
|
|
|
|
{88, "Reg Deny (FA)- HA Unreachable"},
|
2007-05-26 01:01:27 +00:00
|
|
|
{89, "Reg Deny (FA)- Vendor-specific Reason"},
|
|
|
|
{90, "Reg Deny (FA)- Non-zero HA Address Required"},
|
|
|
|
{96, "Reg Deny (FA)(NAI) - Non-zero Home Address Required"},
|
2001-02-14 17:01:44 +00:00
|
|
|
{97, "Reg Deny (FA)(NAI) - Missing NAI"},
|
|
|
|
{98, "Reg Deny (FA)(NAI) - Missing Home Agent"},
|
|
|
|
{99, "Reg Deny (FA)(NAI) - Missing Home Address"},
|
2007-05-26 01:01:27 +00:00
|
|
|
{100, "Reg Deny (FA)- Unable to Interpret CVSE Sent by MN"},
|
|
|
|
{101, "Reg Deny (FA)- Unable to Interpret CVSE Sent by HA"},
|
|
|
|
{104, "Reg Deny (FA)- Unknown Challenge"},
|
|
|
|
{105, "Reg Deny (FA)- Missing Challenge"},
|
|
|
|
{106, "Reg Deny (FA)- Stale Challenge"},
|
|
|
|
{107, "Reg Deny (FA)- Missing MN-FA Key Generation Nonce Reply Extension"},
|
|
|
|
{108, "Reg Deny (FA)- MN Failed AAA Authentication"},
|
|
|
|
{109, "Reg Deny (FA)- HA Sent Wrong Challenge in Reply"},
|
|
|
|
{127, "Reg Deny (FA)- Error Code for Experimental Use"},
|
2001-02-14 17:01:44 +00:00
|
|
|
{128, "Reg Deny (HA)- Unspecified"},
|
|
|
|
{129, "Reg Deny (HA)- Administratively Prohibited"},
|
|
|
|
{130, "Reg Deny (HA)- Insufficient Resources"},
|
|
|
|
{131, "Reg Deny (HA)- MN Failed Authentication"},
|
|
|
|
{132, "Reg Deny (HA)- FA Failed Authentication"},
|
|
|
|
{133, "Reg Deny (HA)- Registration ID Mismatch"},
|
|
|
|
{134, "Reg Deny (HA)- Poorly Formed Request"},
|
|
|
|
{135, "Reg Deny (HA)- Too Many Simultaneous Bindings"},
|
|
|
|
{136, "Reg Deny (HA)- Unknown HA Address"},
|
2001-02-27 00:27:27 +00:00
|
|
|
{137, "Reg Deny (HA)- Requested Reverse Tunnel Unavailable"},
|
2007-05-26 01:01:27 +00:00
|
|
|
{138, "Reg Deny (HA)- Reverse Tunnel Is Mandatory and 'T' Bit Not Set"},
|
2001-02-27 00:27:27 +00:00
|
|
|
{139, "Reg Deny (HA)- Requested Encapsulation Unavailable"},
|
2007-05-26 01:01:27 +00:00
|
|
|
{140, "Reg Deny (HA)- Unable to Interpret CVSE Sent by MN"},
|
|
|
|
{141, "Reg Deny (HA)- Unable to Interpret CVSE Sent by FA"},
|
|
|
|
{142, "Reg Deny (HA)- UDP Encapsulation Unavailable"},
|
|
|
|
{143, "Reg Deny (HA)- Register with Redirected HA"},
|
|
|
|
{144, "Reg Deny (HA)- MN Failed AAA Authentication"},
|
|
|
|
{192, "Reg Deny (HA)- Error Code for Experimental Use"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string mip_nattt_nexthdr[]= {
|
|
|
|
{4, "IP Header"},
|
|
|
|
{47, "GRE Header"},
|
|
|
|
{55, "Minimal IP Encapsulation Header"},
|
|
|
|
{0, NULL}
|
2001-02-14 17:01:44 +00:00
|
|
|
};
|
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
typedef enum {
|
|
|
|
MH_AUTH_EXT = 32,
|
|
|
|
MF_AUTH_EXT = 33,
|
|
|
|
FH_AUTH_EXT = 34,
|
|
|
|
GEN_AUTH_EXT = 36, /* RFC 3012 */
|
|
|
|
OLD_CVSE_EXT = 37, /* RFC 3115 */
|
|
|
|
CVSE_EXT = 38, /* RFC 3115 */
|
2007-05-26 01:01:27 +00:00
|
|
|
UDP_TUN_REP_EXT = 44, /* RFC 3519 */
|
|
|
|
MN_NAI_EXT = 131, /* RFC 2794 */
|
2001-10-31 07:58:43 +00:00
|
|
|
MF_CHALLENGE_EXT = 132, /* RFC 3012 */
|
2003-12-21 04:31:58 +00:00
|
|
|
OLD_NVSE_EXT = 133, /* RFC 3115 */
|
2007-05-26 01:01:27 +00:00
|
|
|
NVSE_EXT = 134, /* RFC 3115 */
|
|
|
|
REV_SUPP_EXT = 137, /* RFC 3543 */
|
|
|
|
DYN_HA_EXT = 139, /* RFC 4433 */
|
|
|
|
UDP_TUN_REQ_EXT = 144, /* RFC 3519 */
|
|
|
|
MSG_STR_EXT = 145,
|
|
|
|
SKIP_EXP_EXT = 255 /* RFC 4064 */
|
2001-10-31 07:58:43 +00:00
|
|
|
} MIP_EXTS;
|
2007-05-26 01:01:27 +00:00
|
|
|
|
2001-02-14 17:01:44 +00:00
|
|
|
static const value_string mip_ext_types[]= {
|
2001-10-31 07:58:43 +00:00
|
|
|
{MH_AUTH_EXT, "Mobile-Home Authentication Extension"},
|
|
|
|
{MF_AUTH_EXT, "Mobile-Foreign Authentication Extension"},
|
|
|
|
{FH_AUTH_EXT, "Foreign-Home Authentication Extension"},
|
|
|
|
{GEN_AUTH_EXT, "Generalized Mobile-IP Authentication Extension"},
|
|
|
|
{OLD_CVSE_EXT, "Critical Vendor/Organization Specific Extension"},
|
2007-05-26 01:01:27 +00:00
|
|
|
{CVSE_EXT, "Critical Vendor/Organization Specific Extension"},
|
|
|
|
{UDP_TUN_REP_EXT, "UDP Tunnel Reply Extension"},
|
|
|
|
{MN_NAI_EXT, "Mobile Node NAI Extension"},
|
|
|
|
{MF_CHALLENGE_EXT, "MN-FA Challenge Extension"},
|
2001-10-31 07:58:43 +00:00
|
|
|
{OLD_NVSE_EXT, "Normal Vendor/Organization Specific Extension"},
|
2007-05-26 01:01:27 +00:00
|
|
|
{NVSE_EXT, "Normal Vendor/Organization Specific Extension"},
|
|
|
|
{REV_SUPP_EXT, "Revocation Support Extension"},
|
|
|
|
{DYN_HA_EXT, "Dynamic HA Extension"},
|
|
|
|
{UDP_TUN_REQ_EXT, "UDP Tunnel Request Extension"},
|
|
|
|
{MSG_STR_EXT, "Message String Extension"},
|
|
|
|
{SKIP_EXP_EXT, "Skippable Extension for Experimental use"},
|
|
|
|
{0, NULL}
|
2001-10-31 07:58:43 +00:00
|
|
|
};
|
|
|
|
|
2007-05-26 01:01:27 +00:00
|
|
|
static const value_string mip_gaext_stypes[]= {
|
2001-10-31 07:58:43 +00:00
|
|
|
{1, "MN AAA Extension"},
|
2007-05-26 01:01:27 +00:00
|
|
|
{0, NULL}
|
2000-05-27 13:53:26 +00:00
|
|
|
};
|
2007-05-26 01:01:27 +00:00
|
|
|
|
|
|
|
static const value_string mip_dhaext_stypes[]= {
|
|
|
|
{1, "Requested HA Extension"},
|
|
|
|
{2, "Redirected HA Extension"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string mip_mstrext_stypes[]= {
|
|
|
|
{1, "HA Extension"},
|
|
|
|
{2, "FA Extension"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string mip_utrqext_stypes[]= {
|
|
|
|
{0, ""},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string mip_utrqext_encap_types[]= {
|
|
|
|
{4, "IP Header"},
|
|
|
|
{47, "GRE Header"},
|
|
|
|
{55, "Minimal IP Encapsulation Header"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string mip_utrpext_stypes[]= {
|
|
|
|
{0, ""},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string mip_utrpext_codes[]= {
|
|
|
|
{0, "Will do Tunneling"},
|
|
|
|
{64, "Tunneling Declined, Reason Unspecified"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static dissector_handle_t ip_handle;
|
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
/* Code to dissect extensions */
|
|
|
|
static void
|
2002-05-01 08:17:09 +00:00
|
|
|
dissect_mip_extensions( tvbuff_t *tvb, int offset, proto_tree *tree)
|
2001-10-31 07:58:43 +00:00
|
|
|
{
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *exts_tree=NULL;
|
|
|
|
proto_tree *ext_tree;
|
2007-05-26 01:01:27 +00:00
|
|
|
proto_tree *tf;
|
|
|
|
proto_tree *ext_flags_tree;
|
2001-10-31 07:58:43 +00:00
|
|
|
size_t ext_len;
|
|
|
|
guint8 ext_type;
|
|
|
|
guint8 ext_subtype=0;
|
2007-05-26 01:01:27 +00:00
|
|
|
guint16 flags;
|
2001-10-31 07:58:43 +00:00
|
|
|
size_t hdrLen;
|
|
|
|
|
|
|
|
/* None of this really matters if we don't have a tree */
|
|
|
|
if (!tree) return;
|
|
|
|
|
|
|
|
/* Add our tree, if we have extensions */
|
2002-01-24 09:20:54 +00:00
|
|
|
ti = proto_tree_add_text(tree, tvb, offset, -1, "Extensions");
|
2001-10-31 07:58:43 +00:00
|
|
|
exts_tree = proto_item_add_subtree(ti, ett_mip_exts);
|
|
|
|
|
2002-01-05 22:09:17 +00:00
|
|
|
/* And, handle each extension */
|
|
|
|
while (tvb_reported_length_remaining(tvb, offset) > 0) {
|
2001-10-31 07:58:43 +00:00
|
|
|
|
|
|
|
/* Get our extension info */
|
|
|
|
ext_type = tvb_get_guint8(tvb, offset);
|
|
|
|
if (ext_type == GEN_AUTH_EXT) {
|
|
|
|
/*
|
|
|
|
* Very nasty . . breaks normal extensions, since the length is
|
|
|
|
* in the wrong place :(
|
|
|
|
*/
|
|
|
|
ext_subtype = tvb_get_guint8(tvb, offset + 1);
|
|
|
|
ext_len = tvb_get_ntohs(tvb, offset + 2);
|
|
|
|
hdrLen = 4;
|
|
|
|
} else {
|
|
|
|
ext_len = tvb_get_guint8(tvb, offset + 1);
|
|
|
|
hdrLen = 2;
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
ti = proto_tree_add_text(exts_tree, tvb, offset, ext_len + hdrLen,
|
|
|
|
"Extension: %s",
|
|
|
|
val_to_str(ext_type, mip_ext_types,
|
2001-10-31 22:16:25 +00:00
|
|
|
"Unknown Extension %u"));
|
2001-10-31 07:58:43 +00:00
|
|
|
ext_tree = proto_item_add_subtree(ti, ett_mip_ext);
|
|
|
|
|
|
|
|
proto_tree_add_item(ext_tree, hf_mip_ext_type, tvb, offset, 1, ext_type);
|
|
|
|
offset++;
|
|
|
|
if (ext_type != GEN_AUTH_EXT) {
|
|
|
|
/* Another nasty hack since GEN_AUTH_EXT broke everything */
|
|
|
|
proto_tree_add_uint(ext_tree, hf_mip_ext_len, tvb, offset, 1, ext_len);
|
|
|
|
offset++;
|
|
|
|
}
|
|
|
|
|
2007-05-26 01:01:27 +00:00
|
|
|
switch (ext_type) {
|
2001-10-31 07:58:43 +00:00
|
|
|
case MH_AUTH_EXT:
|
|
|
|
case MF_AUTH_EXT:
|
|
|
|
case FH_AUTH_EXT:
|
|
|
|
/* All these extensions look the same. 4 byte SPI followed by a key */
|
|
|
|
proto_tree_add_item(ext_tree, hf_mip_aext_spi, tvb, offset, 4, FALSE);
|
|
|
|
proto_tree_add_item(ext_tree, hf_mip_aext_auth, tvb, offset+4, ext_len-4,
|
|
|
|
FALSE);
|
|
|
|
break;
|
|
|
|
case MN_NAI_EXT:
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_item(ext_tree, hf_mip_next_nai, tvb, offset,
|
2001-10-31 07:58:43 +00:00
|
|
|
ext_len, FALSE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GEN_AUTH_EXT: /* RFC 3012 */
|
|
|
|
/*
|
|
|
|
* Very nasty . . breaks normal extensions, since the length is
|
|
|
|
* in the wrong place :(
|
|
|
|
*/
|
2007-05-26 01:01:27 +00:00
|
|
|
proto_tree_add_uint(ext_tree, hf_mip_gaext_stype, tvb, offset, 1, ext_subtype);
|
2001-10-31 07:58:43 +00:00
|
|
|
offset++;
|
2002-01-05 22:09:17 +00:00
|
|
|
proto_tree_add_uint(ext_tree, hf_mip_ext_len, tvb, offset, 2, ext_len);
|
2001-10-31 07:58:43 +00:00
|
|
|
offset+=2;
|
|
|
|
/* SPI */
|
|
|
|
proto_tree_add_item(ext_tree, hf_mip_aext_spi, tvb, offset, 4, FALSE);
|
|
|
|
/* Key */
|
|
|
|
proto_tree_add_item(ext_tree, hf_mip_aext_auth, tvb, offset + 4,
|
|
|
|
ext_len - 4, FALSE);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
break;
|
2007-05-26 01:01:27 +00:00
|
|
|
case REV_SUPP_EXT: /* RFC 3543 */
|
|
|
|
/* flags */
|
|
|
|
flags = tvb_get_ntohs(tvb, offset);
|
|
|
|
tf = proto_tree_add_uint(ext_tree, hf_mip_rext_flags, tvb, offset, 2, flags);
|
|
|
|
ext_flags_tree = proto_item_add_subtree(tf, ett_mip_flags);
|
|
|
|
proto_tree_add_boolean(ext_flags_tree, hf_mip_rext_i, tvb, offset, 2, flags);
|
|
|
|
|
|
|
|
/* reserved */
|
|
|
|
proto_tree_add_uint(ext_flags_tree, hf_mip_rext_reserved, tvb, offset, 2, flags);
|
|
|
|
/* registration revocation timestamp */
|
|
|
|
proto_tree_add_item(ext_tree, hf_mip_rext_tstamp, tvb, offset + 2, 4, FALSE);
|
|
|
|
break;
|
|
|
|
case DYN_HA_EXT: /* RFC 4433 */
|
|
|
|
/* subtype */
|
|
|
|
proto_tree_add_item(ext_tree, hf_mip_dhaext_stype, tvb, offset, 1, FALSE);
|
|
|
|
/* Home Agent */
|
|
|
|
proto_tree_add_item(ext_tree, hf_mip_dhaext_addr, tvb, offset + 1, 4, FALSE);
|
|
|
|
break;
|
|
|
|
case MSG_STR_EXT:
|
|
|
|
/* sub-type */
|
|
|
|
proto_tree_add_item(ext_tree, hf_mip_mstrext_stype, tvb, offset, 1, FALSE);
|
|
|
|
|
|
|
|
/* text */
|
|
|
|
proto_tree_add_item(ext_tree, hf_mip_mstrext_text, tvb, offset + 1, ext_len-1, FALSE);
|
|
|
|
break;
|
|
|
|
case UDP_TUN_REQ_EXT: /* RFC 3519 */
|
|
|
|
/* sub-type */
|
|
|
|
proto_tree_add_item(ext_tree, hf_mip_utrqext_stype, tvb, offset, 1, FALSE);
|
|
|
|
|
|
|
|
/* reserved 1 */
|
|
|
|
proto_tree_add_item(ext_tree, hf_mip_utrqext_reserved1, tvb, offset + 1, 1, FALSE);
|
|
|
|
|
|
|
|
/* flags */
|
|
|
|
flags = tvb_get_guint8(tvb, offset + 2);
|
|
|
|
tf = proto_tree_add_uint(ext_tree, hf_mip_utrqext_flags, tvb, offset + 2, 1, flags);
|
|
|
|
ext_flags_tree = proto_item_add_subtree(tf, ett_mip_flags);
|
|
|
|
proto_tree_add_boolean(ext_flags_tree, hf_mip_utrqext_f, tvb, offset + 2, 1, flags);
|
|
|
|
proto_tree_add_boolean(ext_flags_tree, hf_mip_utrqext_r, tvb, offset + 2, 1, flags);
|
|
|
|
|
|
|
|
/* reserved 2 */
|
|
|
|
proto_tree_add_uint(ext_flags_tree, hf_mip_utrqext_reserved2, tvb, offset + 2, 1, flags);
|
|
|
|
/* encapsulation */
|
|
|
|
proto_tree_add_item(ext_tree, hf_mip_utrqext_encap_type, tvb, offset + 3, 1, FALSE);
|
|
|
|
|
|
|
|
/* reserved 3 */
|
|
|
|
proto_tree_add_item(ext_tree, hf_mip_utrqext_reserved3, tvb, offset + 4, 2, FALSE);
|
|
|
|
break;
|
|
|
|
case UDP_TUN_REP_EXT: /* RFC 3519 */
|
|
|
|
/* sub-type */
|
|
|
|
proto_tree_add_item(ext_tree, hf_mip_utrpext_stype, tvb, offset, 1, FALSE);
|
|
|
|
|
|
|
|
/* code */
|
|
|
|
proto_tree_add_item(ext_tree, hf_mip_utrpext_code, tvb, offset + 1, 1, FALSE);
|
|
|
|
|
|
|
|
/* flags */
|
|
|
|
flags = tvb_get_ntohs(tvb, offset+2);
|
|
|
|
tf = proto_tree_add_uint(ext_tree, hf_mip_utrpext_flags, tvb, offset + 2, 2, flags);
|
|
|
|
ext_flags_tree = proto_item_add_subtree(tf, ett_mip_flags);
|
|
|
|
proto_tree_add_boolean(ext_flags_tree, hf_mip_utrpext_f, tvb, offset + 2, 2, flags);
|
|
|
|
|
|
|
|
/* reserved */
|
|
|
|
proto_tree_add_uint(ext_flags_tree, hf_mip_utrpext_reserved, tvb, offset + 2, 2, flags);
|
|
|
|
|
|
|
|
/* keepalive interval */
|
|
|
|
proto_tree_add_item(ext_tree, hf_mip_utrpext_keepalive, tvb, offset + 4, 2, FALSE);
|
|
|
|
break;
|
2001-10-31 07:58:43 +00:00
|
|
|
case OLD_CVSE_EXT: /* RFC 3115 */
|
|
|
|
case CVSE_EXT: /* RFC 3115 */
|
|
|
|
case OLD_NVSE_EXT: /* RFC 3115 */
|
|
|
|
case NVSE_EXT: /* RFC 3115 */
|
|
|
|
case MF_CHALLENGE_EXT: /* RFC 3012 */
|
|
|
|
/* The default dissector is good here. The challenge is all hex anyway. */
|
|
|
|
default:
|
2002-01-05 22:09:17 +00:00
|
|
|
proto_tree_add_item(ext_tree, hf_mip_ext, tvb, offset, ext_len, FALSE);
|
|
|
|
break;
|
2001-10-31 07:58:43 +00:00
|
|
|
} /* ext type */
|
|
|
|
|
|
|
|
offset += ext_len;
|
|
|
|
} /* while data remaining */
|
|
|
|
|
|
|
|
} /* dissect_mip_extensions */
|
2000-05-27 13:53:26 +00:00
|
|
|
|
|
|
|
/* Code to actually dissect the packets */
|
|
|
|
static void
|
2001-02-14 17:01:44 +00:00
|
|
|
dissect_mip( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
2000-05-27 13:53:26 +00:00
|
|
|
{
|
2001-10-31 07:58:43 +00:00
|
|
|
/* Set up structures we will need to add the protocol subtree and manage it */
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *mip_tree=NULL;
|
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *flags_tree;
|
2001-11-21 02:01:06 +00:00
|
|
|
guint8 type;
|
2007-05-26 01:01:27 +00:00
|
|
|
guint16 flags;
|
2001-11-21 02:01:06 +00:00
|
|
|
size_t offset=0;
|
2005-03-01 06:03:08 +00:00
|
|
|
const guint8 *reftime;
|
2007-05-26 01:01:27 +00:00
|
|
|
tvbuff_t *next_tvb;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
/* Make entries in Protocol column and Info column on summary display */
|
2002-08-28 21:04:11 +00:00
|
|
|
|
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
2001-12-10 00:26:21 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MobileIP");
|
2002-08-28 21:04:11 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
2001-12-10 00:26:21 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2000-05-27 13:53:26 +00:00
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
type = tvb_get_guint8(tvb, offset);
|
|
|
|
switch (type) {
|
|
|
|
case REGISTRATION_REQUEST:
|
2002-08-28 21:04:11 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
2007-05-26 01:01:27 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO,
|
|
|
|
"Reg Request: HoA=%s HA=%s CoA=%s",
|
|
|
|
ip_to_str(tvb_get_ptr(tvb,4,4)),
|
|
|
|
ip_to_str(tvb_get_ptr(tvb,8,4)),
|
|
|
|
ip_to_str(tvb_get_ptr(tvb,12,4)));
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
if (tree) {
|
2002-01-24 09:20:54 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_mip, tvb, offset, -1, FALSE);
|
2001-10-31 07:58:43 +00:00
|
|
|
mip_tree = proto_item_add_subtree(ti, ett_mip);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
/* type */
|
|
|
|
proto_tree_add_uint(mip_tree, hf_mip_type, tvb, offset, 1, type);
|
|
|
|
offset++;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
/* flags */
|
|
|
|
flags = tvb_get_guint8(tvb, offset);
|
2007-05-26 01:01:27 +00:00
|
|
|
tf = proto_tree_add_uint(mip_tree, hf_mip_flags, tvb, offset, 1, flags);
|
2001-10-31 07:58:43 +00:00
|
|
|
flags_tree = proto_item_add_subtree(tf, ett_mip_flags);
|
|
|
|
proto_tree_add_boolean(flags_tree, hf_mip_s, tvb, offset, 1, flags);
|
|
|
|
proto_tree_add_boolean(flags_tree, hf_mip_b, tvb, offset, 1, flags);
|
|
|
|
proto_tree_add_boolean(flags_tree, hf_mip_d, tvb, offset, 1, flags);
|
|
|
|
proto_tree_add_boolean(flags_tree, hf_mip_m, tvb, offset, 1, flags);
|
|
|
|
proto_tree_add_boolean(flags_tree, hf_mip_g, tvb, offset, 1, flags);
|
|
|
|
proto_tree_add_boolean(flags_tree, hf_mip_v, tvb, offset, 1, flags);
|
|
|
|
proto_tree_add_boolean(flags_tree, hf_mip_t, tvb, offset, 1, flags);
|
2007-05-26 01:01:27 +00:00
|
|
|
proto_tree_add_boolean(flags_tree, hf_mip_x, tvb, offset, 1, flags);
|
2001-10-31 07:58:43 +00:00
|
|
|
offset++;
|
2000-05-27 13:53:26 +00:00
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
/* lifetime */
|
|
|
|
proto_tree_add_item(mip_tree, hf_mip_life, tvb, offset, 2, FALSE);
|
2007-05-26 01:01:27 +00:00
|
|
|
offset += 2;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
/* home address */
|
|
|
|
proto_tree_add_item(mip_tree, hf_mip_homeaddr, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
/* home agent address */
|
|
|
|
proto_tree_add_item(mip_tree, hf_mip_haaddr, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
/* Care of Address */
|
|
|
|
proto_tree_add_item(mip_tree, hf_mip_coa, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
2005-03-01 06:03:08 +00:00
|
|
|
/* Identifier - assumed to be an NTP time here */
|
|
|
|
reftime = tvb_get_ptr(tvb, offset, 8);
|
|
|
|
proto_tree_add_bytes_format(mip_tree, hf_mip_ident, tvb, offset, 8,
|
2008-12-19 17:39:52 +00:00
|
|
|
reftime,
|
2005-03-01 06:03:08 +00:00
|
|
|
"Identification: %s",
|
2005-09-21 20:05:13 +00:00
|
|
|
ntp_fmt_ts(reftime));
|
2001-10-31 07:58:43 +00:00
|
|
|
offset += 8;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
} /* if tree */
|
|
|
|
break;
|
|
|
|
case REGISTRATION_REPLY:
|
2002-08-28 21:04:11 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
2007-05-26 01:01:27 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO,
|
|
|
|
"Reg Reply: HoA=%s HA=%s, Code=%u",
|
|
|
|
ip_to_str(tvb_get_ptr(tvb,4,4)),
|
|
|
|
ip_to_str(tvb_get_ptr(tvb,8,4)),
|
|
|
|
tvb_get_guint8(tvb,1));
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
if (tree) {
|
|
|
|
/* Add Subtree */
|
2002-01-24 09:20:54 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_mip, tvb, offset, -1, FALSE);
|
2001-10-31 07:58:43 +00:00
|
|
|
mip_tree = proto_item_add_subtree(ti, ett_mip);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
/* Type */
|
|
|
|
proto_tree_add_uint(mip_tree, hf_mip_type, tvb, offset, 1, type);
|
|
|
|
offset++;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
/* Reply Code */
|
|
|
|
proto_tree_add_item(mip_tree, hf_mip_code, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
2000-05-27 13:53:26 +00:00
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
/* Registration Lifetime */
|
|
|
|
proto_tree_add_item(mip_tree, hf_mip_life, tvb, offset, 2, FALSE);
|
|
|
|
offset += 2;
|
2000-05-27 13:53:26 +00:00
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
/* Home address */
|
|
|
|
proto_tree_add_item(mip_tree, hf_mip_homeaddr, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
/* Home Agent Address */
|
|
|
|
proto_tree_add_item(mip_tree, hf_mip_haaddr, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
2000-05-27 13:53:26 +00:00
|
|
|
|
2005-03-01 06:03:08 +00:00
|
|
|
/* Identifier - assumed to be an NTP time here */
|
|
|
|
reftime = tvb_get_ptr(tvb, offset, 8);
|
|
|
|
proto_tree_add_bytes_format(mip_tree, hf_mip_ident, tvb, offset, 8,
|
2008-12-19 17:39:52 +00:00
|
|
|
reftime,
|
2005-03-01 06:03:08 +00:00
|
|
|
"Identification: %s",
|
2005-09-21 20:05:13 +00:00
|
|
|
ntp_fmt_ts(reftime));
|
2001-10-31 07:58:43 +00:00
|
|
|
offset += 8;
|
|
|
|
} /* if tree */
|
2007-05-26 01:01:27 +00:00
|
|
|
break;
|
|
|
|
case NATT_TUNNEL_DATA:
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Tunnel Data: Next Header=%u",
|
|
|
|
tvb_get_guint8(tvb,1));
|
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
/* Add Subtree */
|
|
|
|
ti = proto_tree_add_item(tree, proto_mip, tvb, offset, -1, FALSE);
|
|
|
|
mip_tree = proto_item_add_subtree(ti, ett_mip);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2007-05-26 01:01:27 +00:00
|
|
|
/* Type */
|
|
|
|
proto_tree_add_uint(mip_tree, hf_mip_type, tvb, offset, 1, type);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
/* Next Header */
|
|
|
|
proto_tree_add_item(mip_tree, hf_mip_nattt_nexthdr, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
/* reserved */
|
|
|
|
proto_tree_add_item(mip_tree, hf_mip_nattt_reserved, tvb, offset, 2, FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/* encapsulated payload */
|
|
|
|
next_tvb = tvb_new_subset(tvb, 4, -1, -1);
|
|
|
|
call_dissector(ip_handle, next_tvb, pinfo, mip_tree);
|
|
|
|
offset += tvb_reported_length_remaining(tvb, offset);
|
|
|
|
} /* if tree */
|
|
|
|
break;
|
|
|
|
case REGISTRATION_REVOCATION:
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO,
|
|
|
|
"Reg Revocation: HoA=%s HDA=%s FDA=%s",
|
|
|
|
ip_to_str(tvb_get_ptr(tvb,4,4)),
|
|
|
|
ip_to_str(tvb_get_ptr(tvb,8,4)),
|
|
|
|
ip_to_str(tvb_get_ptr(tvb,12,4)));
|
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
ti = proto_tree_add_item(tree, proto_mip, tvb, offset, -1, FALSE);
|
|
|
|
mip_tree = proto_item_add_subtree(ti, ett_mip);
|
|
|
|
|
|
|
|
/* type */
|
|
|
|
proto_tree_add_uint(mip_tree, hf_mip_type, tvb, offset, 1, type);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
/* reserved */
|
|
|
|
proto_tree_add_item(mip_tree, hf_mip_rev_reserved, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
/* flags */
|
|
|
|
flags = tvb_get_ntohs(tvb, offset);
|
|
|
|
tf = proto_tree_add_uint(mip_tree, hf_mip_flags, tvb, offset, 2, flags);
|
|
|
|
flags_tree = proto_item_add_subtree(tf, ett_mip_flags);
|
|
|
|
proto_tree_add_boolean(flags_tree, hf_mip_rev_a, tvb, offset, 2, flags);
|
|
|
|
proto_tree_add_boolean(flags_tree, hf_mip_rev_i, tvb, offset, 2, flags);
|
|
|
|
|
|
|
|
/* reserved */
|
|
|
|
proto_tree_add_uint(flags_tree, hf_mip_rev_reserved, tvb, offset, 2, flags);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/* home address */
|
|
|
|
proto_tree_add_item(mip_tree, hf_mip_homeaddr, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
/* home domain address */
|
|
|
|
proto_tree_add_item(mip_tree, hf_mip_hda, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
/* foreign domain address */
|
|
|
|
proto_tree_add_item(mip_tree, hf_mip_fda, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
/* revocation identifier */
|
|
|
|
proto_tree_add_item(mip_tree, hf_mip_revid, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
} /* if tree */
|
|
|
|
break;
|
|
|
|
case REGISTRATION_REVOCATION_ACKNOWLEDGEMENT:
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Reg Revocation Ack: HoA=%s",
|
|
|
|
ip_to_str(tvb_get_ptr(tvb,4,4)));
|
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
ti = proto_tree_add_item(tree, proto_mip, tvb, offset, -1, FALSE);
|
|
|
|
mip_tree = proto_item_add_subtree(ti, ett_mip);
|
|
|
|
|
|
|
|
/* type */
|
|
|
|
proto_tree_add_uint(mip_tree, hf_mip_type, tvb, offset, 1, type);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
/* reserved */
|
|
|
|
proto_tree_add_item(mip_tree, hf_mip_ack_reserved, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
/* flags */
|
|
|
|
flags = tvb_get_ntohs(tvb, offset);
|
|
|
|
tf = proto_tree_add_uint(mip_tree, hf_mip_flags, tvb, offset, 2, flags);
|
|
|
|
flags_tree = proto_item_add_subtree(tf, ett_mip_flags);
|
|
|
|
proto_tree_add_boolean(flags_tree, hf_mip_ack_i, tvb, offset, 2, flags);
|
|
|
|
|
|
|
|
/* reserved */
|
|
|
|
proto_tree_add_uint(flags_tree, hf_mip_ack_reserved, tvb, offset, 2, flags);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/* home address */
|
|
|
|
proto_tree_add_item(mip_tree, hf_mip_homeaddr, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
/* revocation identifier */
|
|
|
|
proto_tree_add_item(mip_tree, hf_mip_revid, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
} /* if tree */
|
2001-10-31 07:58:43 +00:00
|
|
|
break;
|
|
|
|
} /* End switch */
|
|
|
|
|
|
|
|
if (tree) {
|
2002-04-29 09:57:29 +00:00
|
|
|
if (tvb_reported_length_remaining(tvb, offset) > 0)
|
2002-05-01 08:17:09 +00:00
|
|
|
dissect_mip_extensions(tvb, offset, mip_tree);
|
2001-10-31 07:58:43 +00:00
|
|
|
}
|
|
|
|
} /* dissect_mip */
|
2000-05-27 13:53:26 +00:00
|
|
|
|
2006-05-21 04:49:01 +00:00
|
|
|
/* Register the protocol with Wireshark */
|
2000-05-27 13:53:26 +00:00
|
|
|
void proto_register_mip(void)
|
2002-08-28 21:04:11 +00:00
|
|
|
{
|
2000-05-27 13:53:26 +00:00
|
|
|
|
|
|
|
/* Setup list of header fields */
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_mip_type,
|
|
|
|
{ "Message Type", "mip.type",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(mip_types), 0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Mobile IP Message type.", HFILL }
|
2000-05-27 13:53:26 +00:00
|
|
|
},
|
2001-10-31 07:58:43 +00:00
|
|
|
{ &hf_mip_flags,
|
|
|
|
{"Flags", "mip.flags",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0,
|
|
|
|
"", HFILL}
|
|
|
|
},
|
2000-05-27 13:53:26 +00:00
|
|
|
{ &hf_mip_s,
|
|
|
|
{"Simultaneous Bindings", "mip.s",
|
2001-02-14 17:01:44 +00:00
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, 128,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Simultaneous Bindings Allowed", HFILL }
|
2000-05-27 13:53:26 +00:00
|
|
|
},
|
2000-05-27 17:51:15 +00:00
|
|
|
{ &hf_mip_b,
|
2000-05-27 13:53:26 +00:00
|
|
|
{"Broadcast Datagrams", "mip.b",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, 64,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Broadcast Datagrams requested", HFILL }
|
2000-05-27 13:53:26 +00:00
|
|
|
},
|
|
|
|
{ &hf_mip_d,
|
2006-01-05 13:01:08 +00:00
|
|
|
{ "Co-located Care-of Address", "mip.d",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, 32,
|
2001-06-18 02:18:27 +00:00
|
|
|
"MN using Co-located Care-of address", HFILL }
|
2000-05-27 13:53:26 +00:00
|
|
|
},
|
|
|
|
{ &hf_mip_m,
|
|
|
|
{"Minimal Encapsulation", "mip.m",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, 16,
|
2001-06-18 02:18:27 +00:00
|
|
|
"MN wants Minimal encapsulation", HFILL }
|
2000-05-27 13:53:26 +00:00
|
|
|
},
|
|
|
|
{ &hf_mip_g,
|
|
|
|
{"GRE", "mip.g",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, 8,
|
2001-06-18 02:18:27 +00:00
|
|
|
"MN wants GRE encapsulation", HFILL }
|
2000-05-27 13:53:26 +00:00
|
|
|
},
|
|
|
|
{ &hf_mip_v,
|
|
|
|
{ "Van Jacobson", "mip.v",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, 4,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Van Jacobson", HFILL }
|
2000-05-27 13:53:26 +00:00
|
|
|
},
|
2001-02-27 00:27:27 +00:00
|
|
|
{ &hf_mip_t,
|
|
|
|
{ "Reverse Tunneling", "mip.t",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, 2,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Reverse tunneling requested", HFILL }
|
2001-02-27 00:27:27 +00:00
|
|
|
},
|
2007-05-26 01:01:27 +00:00
|
|
|
{ &hf_mip_x,
|
|
|
|
{ "Reserved", "mip.x",
|
|
|
|
FT_BOOLEAN, 8, NULL, 1,
|
|
|
|
"Reserved", HFILL }
|
|
|
|
},
|
2000-05-27 13:53:26 +00:00
|
|
|
{ &hf_mip_code,
|
|
|
|
{ "Reply Code", "mip.code",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(mip_reply_codes), 0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Mobile IP Reply code.", HFILL }
|
2000-05-27 13:53:26 +00:00
|
|
|
},
|
|
|
|
{ &hf_mip_life,
|
|
|
|
{ "Lifetime", "mip.life",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Mobile IP Lifetime.", HFILL }
|
2000-05-27 13:53:26 +00:00
|
|
|
},
|
|
|
|
{ &hf_mip_homeaddr,
|
|
|
|
{ "Home Address", "mip.homeaddr",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_IPv4, BASE_NONE, NULL, 0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Mobile Node's home address.", HFILL }
|
2000-05-27 13:53:26 +00:00
|
|
|
},
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-05-27 13:53:26 +00:00
|
|
|
{ &hf_mip_haaddr,
|
|
|
|
{ "Home Agent", "mip.haaddr",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_IPv4, BASE_NONE, NULL, 0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Home agent IP Address.", HFILL }
|
2000-05-27 13:53:26 +00:00
|
|
|
},
|
|
|
|
{ &hf_mip_coa,
|
|
|
|
{ "Care of Address", "mip.coa",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_IPv4, BASE_NONE, NULL, 0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Care of Address.", HFILL }
|
2000-05-27 13:53:26 +00:00
|
|
|
},
|
|
|
|
{ &hf_mip_ident,
|
|
|
|
{ "Identification", "mip.ident",
|
2005-03-01 06:03:08 +00:00
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"MN Identification.", HFILL }
|
2000-05-27 13:53:26 +00:00
|
|
|
},
|
2001-02-14 17:01:44 +00:00
|
|
|
{ &hf_mip_ext_type,
|
|
|
|
{ "Extension Type", "mip.ext.type",
|
2002-08-28 21:04:11 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(mip_ext_types), 0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Mobile IP Extension Type.", HFILL }
|
2001-02-14 17:01:44 +00:00
|
|
|
},
|
2007-05-26 01:01:27 +00:00
|
|
|
{ &hf_mip_gaext_stype,
|
2001-10-31 07:58:43 +00:00
|
|
|
{ "Gen Auth Ext SubType", "mip.ext.auth.subtype",
|
2007-05-26 01:01:27 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(mip_gaext_stypes), 0,
|
2001-10-31 07:58:43 +00:00
|
|
|
"Mobile IP Auth Extension Sub Type.", HFILL }
|
|
|
|
},
|
2001-02-14 17:01:44 +00:00
|
|
|
{ &hf_mip_ext_len,
|
|
|
|
{ "Extension Length", "mip.ext.len",
|
2001-10-31 07:58:43 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Mobile IP Extension Length.", HFILL }
|
2001-02-14 17:01:44 +00:00
|
|
|
},
|
2001-10-31 07:58:43 +00:00
|
|
|
{ &hf_mip_ext,
|
|
|
|
{ "Extension", "mip.extension",
|
|
|
|
FT_BYTES, BASE_HEX, NULL, 0,
|
|
|
|
"Extension", HFILL }
|
|
|
|
},
|
2001-02-14 17:01:44 +00:00
|
|
|
{ &hf_mip_aext_spi,
|
|
|
|
{ "SPI", "mip.auth.spi",
|
2001-10-31 07:58:43 +00:00
|
|
|
FT_UINT32, BASE_HEX, NULL, 0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Authentication Header Security Parameter Index.", HFILL }
|
2001-02-14 17:01:44 +00:00
|
|
|
},
|
|
|
|
{ &hf_mip_aext_auth,
|
|
|
|
{ "Authenticator", "mip.auth.auth",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Authenticator.", HFILL }
|
2001-02-14 17:01:44 +00:00
|
|
|
},
|
|
|
|
{ &hf_mip_next_nai,
|
|
|
|
{ "NAI", "mip.nai",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"NAI", HFILL }
|
2001-02-14 17:01:44 +00:00
|
|
|
},
|
2007-05-26 01:01:27 +00:00
|
|
|
{ &hf_mip_rext_flags,
|
|
|
|
{"Rev Ext Flags", "mip.ext.rev.flags",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
|
|
|
"Revocation Support Extension Flags", HFILL}
|
|
|
|
},
|
|
|
|
{ &hf_mip_rext_i,
|
|
|
|
{ "'I' bit Support", "mip.ext.rev.i",
|
|
|
|
FT_BOOLEAN, 16, NULL, 32768,
|
|
|
|
"Agent surevidpports Inform bit in Revocation", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_rext_reserved,
|
|
|
|
{ "Reserved", "mip.ext.rev.reserved",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x7fff,
|
|
|
|
"", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_rext_tstamp,
|
|
|
|
{ "Timestamp", "mip.ext.rev.tstamp",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0,
|
|
|
|
"Revocation Timestamp of Sending Agent", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_rev_reserved,
|
|
|
|
{ "Reserved", "mip.rev.reserved",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0,
|
|
|
|
"", HFILL}
|
|
|
|
},
|
|
|
|
{ &hf_mip_rev_a,
|
|
|
|
{ "Home Agent", "mip.rev.a",
|
|
|
|
FT_BOOLEAN, 16, NULL, 32768,
|
|
|
|
"Revocation sent by Home Agent", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_rev_i,
|
|
|
|
{ "Inform", "mip.rev.i",
|
|
|
|
FT_BOOLEAN, 16, NULL, 16384,
|
|
|
|
"Inform Mobile Node", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_rev_reserved2,
|
|
|
|
{ "Reserved", "mip.rev.reserved2",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x3fff,
|
|
|
|
"", HFILL}},
|
|
|
|
{ &hf_mip_hda,
|
|
|
|
{ "Home Domain Address", "mip.rev.hda",
|
|
|
|
FT_IPv4, BASE_NONE, NULL, 0,
|
|
|
|
"Revocation Home Domain IP Address", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_fda,
|
|
|
|
{ "Foreign Domain Address", "mip.rev.fda",
|
|
|
|
FT_IPv4, BASE_NONE, NULL, 0,
|
|
|
|
"Revocation Foreign Domain IP Address", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_revid,
|
|
|
|
{ "Revocation Identifier", "mip.revid",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0,
|
|
|
|
"Revocation Identifier of Initiating Agent", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_ack_reserved,
|
|
|
|
{ "Reserved", "mip.ack.reserved",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0,
|
|
|
|
"", HFILL}
|
|
|
|
},
|
|
|
|
{ &hf_mip_ack_i,
|
|
|
|
{ "Inform", "mip.ack.i",
|
|
|
|
FT_BOOLEAN, 16, NULL, 32768,
|
|
|
|
"Inform Mobile Node", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_ack_reserved2,
|
|
|
|
{ "Reserved", "mip.ack.reserved2",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x7fff,
|
|
|
|
"", HFILL}},
|
|
|
|
{ &hf_mip_dhaext_stype,
|
|
|
|
{ "DynHA Ext SubType", "mip.ext.dynha.subtype",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(mip_dhaext_stypes), 0,
|
|
|
|
"Dynamic HA Extension Sub-type", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_dhaext_addr,
|
|
|
|
{ "DynHA Home Agent", "mip.ext.dynha.ha",
|
|
|
|
FT_IPv4, BASE_NONE, NULL, 0,
|
|
|
|
"Dynamic Home Agent IP Address", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_mstrext_stype,
|
|
|
|
{ "MsgStr Ext SubType", "mip.ext.msgstr.subtype",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(mip_mstrext_stypes), 0,
|
|
|
|
"Message String Extension Sub-type", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_mstrext_text,
|
|
|
|
{ "MsgStr Text", "mip.ext.msgstr.text",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0,
|
|
|
|
"Message String Extension Text", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_nattt_nexthdr,
|
|
|
|
{ "NATTT NextHeader", "mip.nattt.nexthdr",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(mip_nattt_nexthdr), 0,
|
|
|
|
"NAT Traversal Tunnel Next Header.", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_nattt_reserved,
|
|
|
|
{ "Reserved", "mip.nattt.reserved",
|
|
|
|
FT_UINT16, BASE_HEX, NULL , 0x0,
|
|
|
|
"", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_utrqext_stype,
|
|
|
|
{ "UDP TunReq Ext SubType", "mip.ext.utrq.subtype",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(mip_utrqext_stypes), 0,
|
|
|
|
"UDP Tunnel Request Extension Sub-type", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_utrqext_reserved1,
|
|
|
|
{ "Reserved 1", "mip.ext.utrq.reserved1",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0,
|
|
|
|
"", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_utrqext_flags,
|
|
|
|
{ "UDP TunReq Ext Flags", "mip.ext.utrq.flags",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0,
|
|
|
|
"UDP Tunnel Request Extension Flags", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_utrqext_f,
|
|
|
|
{ "Req Forced", "mip.ext.utrq.f",
|
|
|
|
FT_BOOLEAN, 8, NULL, 128,
|
|
|
|
"MN wants to Force UDP Tunneling", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_utrqext_r,
|
|
|
|
{ "FA Registration Required", "mip.ext.utrq.r",
|
|
|
|
FT_BOOLEAN, 8, NULL, 64,
|
|
|
|
"Registration through FA Required", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_utrqext_reserved2,
|
|
|
|
{ "Reserved 2", "mip.ext.utrq.reserved2",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x3f,
|
|
|
|
"", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_utrqext_encap_type,
|
|
|
|
{ "UDP Encap Type", "mip.ext.utrq.encaptype",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(mip_utrqext_encap_types), 0,
|
|
|
|
"UDP Encapsulation Type", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_utrqext_reserved3,
|
|
|
|
{ "Reserved 3", "mip.ext.utrq.reserved3",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
|
|
|
"", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_utrpext_stype,
|
|
|
|
{ "UDP TunRep Ext SubType", "mip.ext.utrp.subtype",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(mip_utrpext_stypes), 0,
|
|
|
|
"UDP Tunnel Reply Extension Sub-type", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_utrpext_code,
|
|
|
|
{ "UDP TunRep Code", "mip.ext.utrp.code",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(mip_utrpext_codes), 0,
|
|
|
|
"UDP Tunnel Reply Code", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_utrpext_flags,
|
|
|
|
{ "UDP TunRep Ext Flags", "mip.ext.utrp.flags",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
|
|
|
"UDP Tunnel Request Extension Flags", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_utrpext_f,
|
|
|
|
{ "Rep Forced", "mip.ext.utrp.f",
|
|
|
|
FT_BOOLEAN, 16, NULL, 32768,
|
|
|
|
"HA wants to Force UDP Tunneling", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_utrpext_reserved,
|
|
|
|
{ "Reserved", "mip.ext.utrp.reserved",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x7fff,
|
|
|
|
"", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_mip_utrpext_keepalive,
|
|
|
|
{ "Keepalive Interval", "mip.ext.utrp.keepalive",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0,
|
|
|
|
"NAT Keepalive Interval", HFILL }
|
|
|
|
}
|
2000-05-27 13:53:26 +00:00
|
|
|
};
|
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
/* Setup protocol subtree array */
|
2000-05-27 13:53:26 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_mip,
|
2001-10-31 07:58:43 +00:00
|
|
|
&ett_mip_flags,
|
2001-02-14 17:01:44 +00:00
|
|
|
&ett_mip_ext,
|
2001-10-31 07:58:43 +00:00
|
|
|
&ett_mip_exts,
|
2000-05-27 13:53:26 +00:00
|
|
|
};
|
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
/* Register the protocol name and description */
|
2001-01-03 06:56:03 +00:00
|
|
|
proto_mip = proto_register_protocol("Mobile IP", "Mobile IP", "mip");
|
2000-05-27 13:53:26 +00:00
|
|
|
|
2001-10-31 07:58:43 +00:00
|
|
|
/* Register the dissector by name */
|
|
|
|
register_dissector("mip", dissect_mip, proto_mip);
|
|
|
|
|
|
|
|
/* Required function calls to register the header fields and subtrees used */
|
2000-05-27 13:53:26 +00:00
|
|
|
proto_register_field_array(proto_mip, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2003-12-21 05:51:34 +00:00
|
|
|
}
|
2000-05-27 13:53:26 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_mip(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t mip_handle;
|
|
|
|
|
|
|
|
mip_handle = find_dissector("mip");
|
2007-05-26 01:01:27 +00:00
|
|
|
ip_handle = find_dissector("ip");
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_add("udp.port", UDP_PORT_MIP, mip_handle);
|
2000-05-27 13:53:26 +00:00
|
|
|
}
|