aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-btbnep.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-11-20 02:28:14 +0000
committerMichael Mann <mmann78@netscape.net>2013-11-20 02:28:14 +0000
commitf34e11fabead2968fab30e5c3caab8b377aaa287 (patch)
treee2711798ee2270721ea8aca29b2419bbe78bcf5a /epan/dissectors/packet-btbnep.c
parentea278d3bf871239989365121270410930f197377 (diff)
Convert ethertype() function into a pure dissector. Bug 9454 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9454)
The main driving force for this was my new Decode As functionality (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9450) that wants a dissector/subdissector table relationship for all dissectors wanting to use Decode As functionality. The ethertype() function provides the value to the "ethertype" subdissector table, so I think it should be matched to a dissector. Only odd side effect is the display filter of "ethertype" returns no packets because there is no "item" associated with the dissector. svn path=/trunk/; revision=53443
Diffstat (limited to 'epan/dissectors/packet-btbnep.c')
-rw-r--r--epan/dissectors/packet-btbnep.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/epan/dissectors/packet-btbnep.c b/epan/dissectors/packet-btbnep.c
index 93bfa9af13..a214459918 100644
--- a/epan/dissectors/packet-btbnep.c
+++ b/epan/dissectors/packet-btbnep.c
@@ -75,6 +75,7 @@ static gboolean top_dissect = TRUE;
static dissector_handle_t eth_handle;
static dissector_handle_t data_handle;
+static dissector_handle_t ethertype_handle;
static const true_false_string ig_tfs = {
"Group address (multicast/broadcast)",
@@ -366,8 +367,16 @@ dissect_btbnep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
if (bnep_type != BNEP_TYPE_CONTROL) {
/* dissect normal network */
if (top_dissect) {
- ethertype(type, tvb, offset, pinfo, tree, btbnep_tree,
- hf_btbnep_type, 0, 0);
+ ethertype_data_t ethertype_data;
+
+ ethertype_data.etype = type;
+ ethertype_data.offset_after_ethertype = offset;
+ ethertype_data.fh_tree = btbnep_tree;
+ ethertype_data.etype_id = hf_btbnep_type;
+ ethertype_data.trailer_id = 0;
+ ethertype_data.fcs_len = 0;
+
+ call_dissector_with_data(ethertype_handle, tvb, pinfo, tree, &ethertype_data);
} else {
tvbuff_t *next_tvb;
@@ -539,6 +548,7 @@ proto_reg_handoff_btbnep(void)
btbnep_handle = find_dissector("btbnep");
eth_handle = find_dissector("eth");
data_handle = find_dissector("data");
+ ethertype_handle = find_dissector("ethertype");
dissector_add_uint("btl2cap.service", BTSDP_PAN_GN_SERVICE_UUID, btbnep_handle);
dissector_add_uint("btl2cap.service", BTSDP_PAN_NAP_SERVICE_UUID, btbnep_handle);