aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sml.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-11-17 20:16:06 -0500
committerAnders Broman <a.broman58@gmail.com>2015-11-18 07:33:08 +0000
commit4adeb424f5cdb74ca1f98cd4b87bd72e4d811f03 (patch)
tree6c73d6e0795cc5181ad53242581e4c7f2282081f /epan/dissectors/packet-sml.c
parent13297438d98e3388d650fc55c2a77d5b52367e1f (diff)
create_dissector_handle -> new_create_dissector_handle
Picking off "easy" dissectors that only have one or two exit points at most. Change-Id: I9c7d1c092bbae896ec0c2832617891346927f2e1 Reviewed-on: https://code.wireshark.org/review/11932 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: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-sml.c')
-rw-r--r--epan/dissectors/packet-sml.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/epan/dissectors/packet-sml.c b/epan/dissectors/packet-sml.c
index 5d072e05a5..5ff618815c 100644
--- a/epan/dissectors/packet-sml.c
+++ b/epan/dissectors/packet-sml.c
@@ -2516,15 +2516,15 @@ static void dissect_sml_file(tvbuff_t *tvb, packet_info *pinfo, gint *offset, pr
}
/* main */
-static void dissect_sml (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
- proto_item *sml_item = NULL;
- proto_tree *sml_tree = NULL;
+static int dissect_sml (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
+ proto_item *sml_item;
+ proto_tree *sml_tree;
guint offset = 0;
/*Check if not SML*/
if (tvb_get_ntohl(tvb, offset) != ESC_SEQ && tvb_get_guint8(tvb, offset) != LIST_6_ELEMENTS){
- return;
+ return 0;
}
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SML");
@@ -2534,6 +2534,7 @@ static void dissect_sml (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
sml_item = proto_tree_add_item(tree, proto_sml, tvb, 0, -1, ENC_NA);
sml_tree = proto_item_add_subtree(sml_item, ett_sml);
dissect_sml_file(tvb, pinfo, &offset, sml_tree);
+ return tvb_captured_length(tvb);
}
static void
@@ -2825,7 +2826,7 @@ void proto_reg_handoff_sml(void) {
static dissector_handle_t sml_handle;
if (!initialized) {
- sml_handle = create_dissector_handle(dissect_sml, proto_sml);
+ sml_handle = new_create_dissector_handle(dissect_sml, proto_sml);
initialized = TRUE;
} else {
dissector_delete_uint("tcp.port", old_tcp_port, sml_handle);