diff options
author | Michael Mann <mmann78@netscape.net> | 2015-11-14 15:11:44 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-11-14 21:54:39 +0000 |
commit | 159227a14b25b15b535ac95c85d8bc699317d45e (patch) | |
tree | 7d02f802790d5701a0cc5c40537538944b60bb63 /plugins/ethercat | |
parent | 28ea58251c04562cc0670e57bf073dc6966e73e6 (diff) |
register_dissector -> new_register_dissector for plugins.
Picking off "easy" dissectors that only have one or two exit points at most.
Change-Id: Ie98e071a7cb568c13c8958de56b1fc25a4ce2ce9
Reviewed-on: https://code.wireshark.org/review/11831
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'plugins/ethercat')
-rw-r--r-- | plugins/ethercat/packet-ecatmb.c | 5 | ||||
-rw-r--r-- | plugins/ethercat/packet-esl.c | 11 | ||||
-rw-r--r-- | plugins/ethercat/packet-ethercat-frame.c | 5 |
3 files changed, 12 insertions, 9 deletions
diff --git a/plugins/ethercat/packet-ecatmb.c b/plugins/ethercat/packet-ecatmb.c index 6def091ff9..ba8c525c29 100644 --- a/plugins/ethercat/packet-ecatmb.c +++ b/plugins/ethercat/packet-ecatmb.c @@ -1168,7 +1168,7 @@ static void dissect_ecat_foe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro } } -static void dissect_ecat_mailbox(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int dissect_ecat_mailbox(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *ecat_mailbox_tree = NULL; proto_tree *ecat_mailbox_header_tree = NULL; @@ -1249,6 +1249,7 @@ static void dissect_ecat_mailbox(tvbuff_t *tvb, packet_info *pinfo, proto_tree * col_append_str(pinfo->cinfo, COL_INFO, ")"); } } + return tvb_captured_length(tvb); } void proto_register_ecat_mailbox(void) @@ -1941,7 +1942,7 @@ void proto_register_ecat_mailbox(void) proto_register_field_array(proto_ecat_mailbox, hf,array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector("ecat_mailbox", dissect_ecat_mailbox, proto_ecat_mailbox); + new_register_dissector("ecat_mailbox", dissect_ecat_mailbox, proto_ecat_mailbox); } void proto_reg_handoff_ecat_mailbox(void) diff --git a/plugins/ethercat/packet-esl.c b/plugins/ethercat/packet-esl.c index 70f0d416bf..dc67ee747d 100644 --- a/plugins/ethercat/packet-esl.c +++ b/plugins/ethercat/packet-esl.c @@ -171,8 +171,8 @@ static guint16 flags_to_port(guint16 flagsValue) { } /*esl*/ -static void -dissect_esl_header(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { +static int +dissect_esl_header(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { proto_item *ti = NULL; proto_tree *esl_header_tree; @@ -199,6 +199,7 @@ dissect_esl_header(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { proto_tree_add_item(esl_header_tree, hf_esl_timestamp, tvb, offset, 8, ENC_LITTLE_ENDIAN); } } + return tvb_captured_length(tvb); } typedef struct _ref_time_frame_info @@ -277,7 +278,7 @@ dissect_esl_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data First 6 bytes must be: 01 01 05 10 00 00 */ if ( is_esl_header(tvb, 0) ) { - dissect_esl_header(tvb, pinfo, tree); + dissect_esl_header(tvb, pinfo, tree, data); if ( eth_withoutfcs_handle != NULL ) { next_tvb = tvb_new_subset_remaining(tvb, SIZEOF_ESLHEADER); @@ -294,7 +295,7 @@ dissect_esl_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree); } next_tvb = tvb_new_subset_length(tvb, esl_length-SIZEOF_ESLHEADER, SIZEOF_ESLHEADER); - dissect_esl_header(next_tvb, pinfo, tree); + dissect_esl_header(next_tvb, pinfo, tree, data); modify_times(tvb, esl_length-SIZEOF_ESLHEADER, pinfo); result = TRUE; @@ -353,7 +354,7 @@ proto_register_esl(void) { proto_register_field_array(proto_esl,hf,array_length(hf)); proto_register_subtree_array(ett,array_length(ett)); - register_dissector("esl", dissect_esl_header, proto_esl); + new_register_dissector("esl", dissect_esl_header, proto_esl); } void diff --git a/plugins/ethercat/packet-ethercat-frame.c b/plugins/ethercat/packet-ethercat-frame.c index 7ecd0a27bf..8fb5d3c83e 100644 --- a/plugins/ethercat/packet-ethercat-frame.c +++ b/plugins/ethercat/packet-ethercat-frame.c @@ -63,7 +63,7 @@ static const value_string ethercat_frame_reserved_vals[] = }; /* Ethercat Frame */ -static void dissect_ethercat_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int dissect_ethercat_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { tvbuff_t *next_tvb; proto_item *ti; @@ -99,6 +99,7 @@ static void dissect_ethercat_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree data instead. */ call_dissector (ethercat_frame_data_handle, next_tvb, pinfo, tree); } + return tvb_captured_length(tvb); } void proto_register_ethercat_frame(void) @@ -134,7 +135,7 @@ void proto_register_ethercat_frame(void) proto_register_field_array(proto_ethercat_frame,hf,array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector("ecatf", dissect_ethercat_frame, proto_ethercat_frame); + new_register_dissector("ecatf", dissect_ethercat_frame, proto_ethercat_frame); /* Define a handle (ecatf.type) for sub dissectors that want to dissect the Ethercat frame ether type (E88A4) payload. */ |