diff options
author | Bill Meier <wmeier@newsguy.com> | 2012-01-12 22:13:09 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2012-01-12 22:13:09 +0000 |
commit | d412a94dd5ac899f13fea4739a5684ffed04c7e7 (patch) | |
tree | d34acecfa01606b60ec2bcacabcf065b8d114064 /epan/dissectors/packet-meta.c | |
parent | 34a0aba9d36b1bd1ce004321c8269dc9dd5a2721 (diff) |
From Tobias Witek: Add dissector table to 'meta' dissector.
The attached patch adds a dissector table to the 'meta' dissector
so that other protocol dissectors can register for specific values
of 'meta.proto'.
Additionally, the patch also adds three more protocol values.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6730
svn path=/trunk/; revision=40445
Diffstat (limited to 'epan/dissectors/packet-meta.c')
-rw-r--r-- | epan/dissectors/packet-meta.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/epan/dissectors/packet-meta.c b/epan/dissectors/packet-meta.c index 496e5e3f9b..d2c0cd8bba 100644 --- a/epan/dissectors/packet-meta.c +++ b/epan/dissectors/packet-meta.c @@ -87,6 +87,8 @@ static dissector_handle_t ethwithoutfcs_handle; static dissector_handle_t fphint_handle; static dissector_handle_t erf_handle; +static dissector_table_t meta_dissector_table; + static const value_string meta_schema_vals[] = { { META_SCHEMA_PCAP, "PCAP" }, { META_SCHEMA_DXT, "DXT" }, @@ -100,6 +102,9 @@ static const value_string meta_proto_vals[] = { { META_PROTO_DXT_ERF_AAL5, "ERF AAL5" }, { META_PROTO_DXT_ATM_AAL2, "ATM AAL2" }, { META_PROTO_DXT_ATM, "ATM" }, + { META_PROTO_DXT_CONTAINER, "DXT CONTAINER" }, + { META_PROTO_DXT_FP_CAPTURE, "FP CAPTURE" }, + { META_PROTO_DXT_UTRAN_CAPSULE, "UTRAN CAPSULE" }, { 0, NULL } }; @@ -446,7 +451,7 @@ dissect_meta(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree *meta_tree = NULL; proto_item *ti = NULL; tvbuff_t *next_tvb; - dissector_handle_t next_dissector = data_handle; + dissector_handle_t next_dissector = NULL; if (check_col(pinfo->cinfo, COL_PROTOCOL)) col_set_str(pinfo->cinfo, COL_PROTOCOL, "META"); @@ -517,10 +522,14 @@ dissect_meta(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) pinfo->pseudo_header->atm.aal = AAL_5; next_dissector = atm_untrunc_handle; break; + default: + next_dissector = + dissector_get_uint_handle(meta_dissector_table, proto); } } next_tvb = tvb_new_subset(tvb, item_len + META_HEADER_SIZE, -1, -1); - call_dissector(next_dissector, next_tvb, pinfo, tree); + call_dissector(next_dissector ? next_dissector : data_handle, + next_tvb, pinfo, tree); } void @@ -574,6 +583,9 @@ proto_register_meta(void) proto_register_field_array(proto_meta, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + meta_dissector_table = register_dissector_table("meta.proto", + "META protocol", FT_UINT16, BASE_DEC); } void |