summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-clnp.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-03-19 20:33:14 -0400
committerMichael Mann <mmann78@netscape.net>2016-03-20 17:38:03 +0000
commit1e60d63c8c6882c8c0bdb00cf6df594e1bb6fccf (patch)
tree4147c4f2bee3b93c250a49fa8ec337072c80e713 /epan/dissectors/packet-clnp.c
parent2b2fc64447e5f778d969e6c850e9196d248cbbe1 (diff)
downloadwireshark-1e60d63c8c6882c8c0bdb00cf6df594e1bb6fccf.tar.gz
Create call_data_dissector() to call data dissector.
This saves many dissectors the need to find the data dissector and store a handle to it. There were also some that were finding it, but not using it. For others this was the only reason for their handoff function, so it could be eliminated. Change-Id: I5d3f951ee1daa3d30c060d21bd12bbc881a8027b Reviewed-on: https://code.wireshark.org/review/14530 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-clnp.c')
-rw-r--r--epan/dissectors/packet-clnp.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/epan/dissectors/packet-clnp.c b/epan/dissectors/packet-clnp.c
index c090de07d3..99997180ad 100644
--- a/epan/dissectors/packet-clnp.c
+++ b/epan/dissectors/packet-clnp.c
@@ -101,7 +101,6 @@ static dissector_handle_t clnp_handle;
static dissector_handle_t ositp_handle;
static dissector_handle_t ositp_inactive_handle;
static dissector_handle_t idrp_handle;
-static dissector_handle_t data_handle;
/*
* ISO 8473 OSI CLNP definition (see RFC994)
@@ -245,15 +244,14 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
proto_tree_add_uint_format(clnp_tree, hf_clnp_id, tvb, P_CLNP_PROTO_ID, 1,
cnf_proto_id, "Inactive subset");
next_tvb = tvb_new_subset_remaining(tvb, 1);
- if (call_dissector(ositp_inactive_handle, next_tvb, pinfo, tree) == 0)
- call_dissector(data_handle,tvb, pinfo, tree);
+ call_dissector(ositp_inactive_handle, next_tvb, pinfo, tree);
return tvb_captured_length(tvb);
}
/* return if version not known */
cnf_vers = tvb_get_guint8(tvb, P_CLNP_VERS);
if (cnf_vers != ISO8473_V1) {
- call_dissector(data_handle,tvb, pinfo, tree);
+ call_data_dissector(tvb, pinfo, tree);
return tvb_captured_length(tvb);
}
@@ -524,8 +522,7 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
/* As we haven't reassembled anything, we haven't changed "pi", so
we don't have to restore it. */
- call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo,
- tree);
+ call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree);
pinfo->fragmented = save_fragmented;
return tvb_captured_length(tvb);
}
@@ -593,7 +590,7 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
}
}
col_add_fstr(pinfo->cinfo, COL_INFO, "%s NPDU %s", pdu_type_string, flag_string);
- call_dissector(data_handle,next_tvb, pinfo, tree);
+ call_data_dissector(next_tvb, pinfo, tree);
pinfo->fragmented = save_fragmented;
return tvb_captured_length(tvb);
} /* dissect_clnp */
@@ -768,7 +765,6 @@ proto_reg_handoff_clnp(void)
ositp_handle = find_dissector_add_dependency("ositp", proto_clnp);
ositp_inactive_handle = find_dissector_add_dependency("ositp_inactive", proto_clnp);
idrp_handle = find_dissector_add_dependency("idrp", proto_clnp);
- data_handle = find_dissector("data");
dissector_add_uint("osinl.incl", NLPID_ISO8473_CLNP, clnp_handle);
dissector_add_uint("osinl.incl", NLPID_NULL, clnp_handle); /* Inactive subset */