aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mip.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2012-02-24 05:50:47 +0000
committerAnders Broman <anders.broman@ericsson.com>2012-02-24 05:50:47 +0000
commit1b6a35348b9f26c15b7a6dc09041489776f53b73 (patch)
treeed25c049ee9bec794ebc3b0285c96499d355538f /epan/dissectors/packet-mip.c
parentfc42284f1d4e1046592be751f9836187f88ae50b (diff)
From Robert Shade: Mobile IP NVSE (RFC3115) Decoding https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6868
svn path=/trunk/; revision=41171
Diffstat (limited to 'epan/dissectors/packet-mip.c')
-rw-r--r--epan/dissectors/packet-mip.c47
1 files changed, 46 insertions, 1 deletions
diff --git a/epan/dissectors/packet-mip.c b/epan/dissectors/packet-mip.c
index 081dd85a65..b6f87c5948 100644
--- a/epan/dissectors/packet-mip.c
+++ b/epan/dissectors/packet-mip.c
@@ -111,6 +111,10 @@ static int hf_mip_cvse_vendor_org_id = -1;
static int hf_mip_cvse_verizon_cvse_type = -1;
static int hf_mip_cvse_vendor_cvse_type = -1;
static int hf_mip_cvse_vendor_cvse_value = -1;
+static int hf_mip_nvse_reserved = -1;
+static int hf_mip_nvse_vendor_org_id = -1;
+static int hf_mip_nvse_vendor_nvse_type = -1;
+static int hf_mip_nvse_vendor_nvse_value = -1;
/* Initialize the subtree pointers */
static gint ett_mip = -1;
@@ -417,7 +421,10 @@ dissect_mip_extensions( tvbuff_t *tvb, int offset, proto_tree *tree)
gint hdrLen;
guint32 cvse_vendor_id;
guint16 cvse_vendor_type;
+ guint32 nvse_vendor_id;
+ guint16 nvse_vendor_type;
int cvse_local_offset= 0;
+ int nvse_local_offset= 0;
/* None of this really matters if we don't have a tree */
if (!tree) return;
@@ -601,6 +608,7 @@ dissect_mip_extensions( tvbuff_t *tvb, int offset, proto_tree *tree)
}
break;
+ case OLD_CVSE_EXT: /* RFC 3115 */
case CVSE_EXT: /* RFC 3115 */
/*
* Very nasty . . breaks normal extensions, since the length is
@@ -632,9 +640,26 @@ dissect_mip_extensions( tvbuff_t *tvb, int offset, proto_tree *tree)
proto_tree_add_item(ext_tree, hf_mip_cvse_vendor_cvse_value, tvb, cvse_local_offset, ext_len - 6, ENC_NA);
break;
- case OLD_CVSE_EXT: /* RFC 3115 */
case OLD_NVSE_EXT: /* RFC 3115 */
case NVSE_EXT: /* RFC 3115 */
+ proto_tree_add_item(ext_tree, hf_mip_nvse_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
+
+ /* Vendor/Org ID */
+ /*Vendor ID & nvse type & nvse value are included in ext_len, so do not increment offset for them here.*/
+ nvse_local_offset = offset + hdrLen;
+ proto_tree_add_item(ext_tree, hf_mip_nvse_vendor_org_id, tvb, nvse_local_offset, 4, ENC_BIG_ENDIAN);
+ nvse_vendor_id = tvb_get_ntohl(tvb, nvse_local_offset);
+ nvse_local_offset+=4;
+
+ /*Vendor NVSE Type*/
+ nvse_vendor_type = tvb_get_ntohs(tvb, nvse_local_offset);
+ proto_tree_add_uint(ext_tree, hf_mip_nvse_vendor_nvse_type, tvb, nvse_local_offset, 2, nvse_vendor_type);
+ nvse_local_offset+=2;
+
+ /* Vendor-NVSE-Value */
+ proto_tree_add_item(ext_tree, hf_mip_nvse_vendor_nvse_value, tvb, nvse_local_offset, ext_len - 8, ENC_NA);
+ break;
+
case MF_CHALLENGE_EXT: /* RFC 3012 */
/* The default dissector is good here. The challenge is all hex anyway. */
default:
@@ -1235,6 +1260,26 @@ void proto_register_mip(void)
{ "Vendor CVSE Value", "mip.ext.cvse.vendor_value",
FT_BYTES, BASE_NONE, NULL, 0,
NULL, HFILL }
+ },
+ { &hf_mip_nvse_reserved,
+ { "Reserved", "mip.ext.nvse.reserved",
+ FT_UINT16, BASE_HEX, NULL, 0x0,
+ NULL, HFILL }
+ },
+ { &hf_mip_nvse_vendor_org_id,
+ { "Vendor ID", "mip.ext.nvse.vendor_id",
+ FT_UINT32, BASE_DEC|BASE_EXT_STRING, &sminmpec_values_ext, 0,
+ NULL, HFILL }
+ },
+ { &hf_mip_nvse_vendor_nvse_type ,
+ { "Vendor Type", "mip.ext.nvse.vendor_type",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ NULL, HFILL }
+ },
+ { &hf_mip_nvse_vendor_nvse_value ,
+ { "Vendor Value", "mip.ext.nvse.vendor_value",
+ FT_BYTES, BASE_NONE, NULL, 0,
+ NULL, HFILL }
}
};