aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2011-12-07 19:04:13 +0000
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2011-12-07 19:04:13 +0000
commitfe21eac4d4d725dc7e5ab11328d5492684af1a1f (patch)
tree71e609f9a5f2b41a04255c6e5a7825d87ce44990
parent810503f867118a859dc1e3c5f0cd0d2e1803e4d0 (diff)
Add a dissector table for private extensions.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40114 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r--epan/dissectors/packet-gtpv2.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c
index 2381654756..831f91cf5c 100644
--- a/epan/dissectors/packet-gtpv2.c
+++ b/epan/dissectors/packet-gtpv2.c
@@ -46,6 +46,8 @@
static dissector_handle_t nas_eps_handle;
+static dissector_table_t gtpv2_priv_ext_dissector_table;
+
/*GTPv2 Message->GTP Header(SB)*/
static int proto_gtpv2 = -1;
@@ -3777,10 +3779,18 @@ static void
dissect_gtpv2_private_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
{
int offset = 0;
+ tvbuff_t *next_tvb;
+ guint16 ext_id;
/* oct 5 -7 Enterprise ID */
+ ext_id = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_gtpv2_enterprise_id, tvb, offset, 2, ENC_BIG_ENDIAN);
offset+=2;
+
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
+ if(dissector_try_uint(gtpv2_priv_ext_dissector_table, ext_id, next_tvb, pinfo, tree))
+ return;
+
proto_tree_add_text(tree, tvb, offset, length-2, "Proprietary value");
}
@@ -5409,6 +5419,8 @@ void proto_register_gtpv2(void)
dissector_add_uint("diameter.3gpp", 22, new_create_dissector_handle(dissect_diameter_3gpp_uli, proto_gtpv2));
register_dissector("gtpv2", dissect_gtpv2, proto_gtpv2);
+ /* Dissector table for private extensions */
+ gtpv2_priv_ext_dissector_table = register_dissector_table("gtpv2.priv_ext", "GTPv2 PRIVATE EXT", FT_UINT16, BASE_DEC);
}
void