aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-pw-eth.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2014-09-05 08:48:37 -0400
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2014-09-06 07:44:46 +0000
commitceef7eba755cbecf670653360f72d864949dac49 (patch)
tree2cc48ebd17a4e7dc714f1b00af21f4f92546c948 /epan/dissectors/packet-pw-eth.c
parentf1ad9eb212a6f4c5e1b6b1963bccf5f3a4900293 (diff)
Eliminate proto_tree_add_text from some of the dissectors.
Other minor cleanups while in the area. Change-Id: I8ea59205cfe6fab643d8fe01b75ce91532004fd9 Reviewed-on: https://code.wireshark.org/review/4004 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-pw-eth.c')
-rw-r--r--epan/dissectors/packet-pw-eth.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/epan/dissectors/packet-pw-eth.c b/epan/dissectors/packet-pw-eth.c
index 96a81c19ad..4ea7758dce 100644
--- a/epan/dissectors/packet-pw-eth.c
+++ b/epan/dissectors/packet-pw-eth.c
@@ -50,21 +50,18 @@ static dissector_handle_t eth_withoutfcs_handle;
static dissector_handle_t pw_eth_handle_cw;
static dissector_handle_t pw_eth_handle_nocw;
-static void
-dissect_pw_eth_cw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_pw_eth_cw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
tvbuff_t *next_tvb;
guint16 sequence_number;
if (tvb_reported_length_remaining(tvb, 0) < 4) {
- if (tree)
- proto_tree_add_text(tree, tvb, 0, -1,
- "Error processing Message");
- return;
+ return 0;
}
if (dissect_try_cw_first_nibble(tvb, pinfo, tree))
- return;
+ return tvb_captured_length(tvb);
sequence_number = tvb_get_ntohs(tvb, 2);
@@ -90,6 +87,8 @@ dissect_pw_eth_cw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
}
+
+ return tvb_captured_length(tvb);
}
static void
@@ -194,7 +193,7 @@ proto_register_pw_eth(void)
"pwethheuristic");
proto_register_field_array(proto_pw_eth_cw, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- register_dissector("pw_eth_cw", dissect_pw_eth_cw, proto_pw_eth_cw);
+ new_register_dissector("pw_eth_cw", dissect_pw_eth_cw, proto_pw_eth_cw);
register_dissector("pw_eth_nocw", dissect_pw_eth_nocw,
proto_pw_eth_nocw);
register_dissector("pw_eth_heuristic", dissect_pw_eth_heuristic,