aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-10-19 23:06:13 +0000
committerMichael Mann <mmann78@netscape.net>2013-10-19 23:06:13 +0000
commit522b4ce5c0a628a33ff864a42d04127a86fd0a45 (patch)
treea9cb82b7d616b6a762951a3fd91301ab6996aa2d /epan
parente958d8c08134aa048842d4a934baf2946fa6284e (diff)
Pass SPX "private data" into subdissectors instead of using pinfo->private_data.
svn path=/trunk/; revision=52698
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-ipx.c14
-rw-r--r--epan/dissectors/packet-ndps.c23
2 files changed, 14 insertions, 23 deletions
diff --git a/epan/dissectors/packet-ipx.c b/epan/dissectors/packet-ipx.c
index 9e74acaec4..a09f2e0280 100644
--- a/epan/dissectors/packet-ipx.c
+++ b/epan/dissectors/packet-ipx.c
@@ -767,7 +767,6 @@ dissect_spx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tvb_reported_length_remaining(tvb, SPX_HEADER_LEN) > 0) {
- void* pd_save;
/*
* Call subdissectors based on the IPX socket numbers; a
* subdissector might have registered with our IPX socket
@@ -796,24 +795,19 @@ dissect_spx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
spx_infox.eom = conn_ctrl & SPX_EOM;
spx_infox.datastream_type = datastream_type;
- pd_save = pinfo->private_data;
- pinfo->private_data = &spx_infox;
next_tvb = tvb_new_subset_remaining(tvb, SPX_HEADER_LEN);
- if (dissector_try_uint(spx_socket_dissector_table, low_socket,
- next_tvb, pinfo, tree))
+ if (dissector_try_uint_new(spx_socket_dissector_table, low_socket,
+ next_tvb, pinfo, tree, FALSE, &spx_infox))
{
- pinfo->private_data = pd_save;
return;
}
- if (dissector_try_uint(spx_socket_dissector_table, high_socket,
- next_tvb, pinfo, tree))
+ if (dissector_try_uint_new(spx_socket_dissector_table, high_socket,
+ next_tvb, pinfo, tree, FALSE, &spx_infox))
{
- pinfo->private_data = pd_save;
return;
}
call_dissector(data_handle, next_tvb, pinfo, tree);
- pinfo->private_data = pd_save;
}
}
diff --git a/epan/dissectors/packet-ndps.c b/epan/dissectors/packet-ndps.c
index 281f3c515e..5dc5a877f0 100644
--- a/epan/dissectors/packet-ndps.c
+++ b/epan/dissectors/packet-ndps.c
@@ -4328,17 +4328,14 @@ dissect_ndps_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* the last fragment packet number.
*/
static void
-ndps_defrag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+ndps_defrag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, spx_info *spx_info_p)
{
guint len=0;
tvbuff_t *next_tvb = NULL;
fragment_head *fd_head;
- spx_info *spx_info_p;
ndps_req_hash_value *request_value = NULL;
conversation_t *conversation;
- /* Get SPX info from SPX dissector */
- spx_info_p = (spx_info *)pinfo->private_data;
/* Check to see if defragmentation is enabled in the dissector */
if (!ndps_defragment) {
dissect_ndps(tvb, pinfo, tree);
@@ -4476,21 +4473,21 @@ dissect_ndps_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
-static void
-dissect_ndps_ipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ndps_ipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
- proto_tree *ndps_tree = NULL;
+ proto_tree *ndps_tree;
proto_item *ti;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDPS");
col_clear(pinfo->cinfo, COL_INFO);
- if (tree) {
- ti = proto_tree_add_item(tree, proto_ndps, tvb, 0, -1, ENC_NA);
- ndps_tree = proto_item_add_subtree(ti, ett_ndps);
- }
- ndps_defrag(tvb, pinfo, ndps_tree);
+ ti = proto_tree_add_item(tree, proto_ndps, tvb, 0, -1, ENC_NA);
+ ndps_tree = proto_item_add_subtree(ti, ett_ndps);
+
+ ndps_defrag(tvb, pinfo, ndps_tree, (spx_info*)data);
+ return tvb_length(tvb);
}
static int
@@ -9799,7 +9796,7 @@ proto_reg_handoff_ndps(void)
{
dissector_handle_t ndps_handle, ndps_tcp_handle;
- ndps_handle = create_dissector_handle(dissect_ndps_ipx, proto_ndps);
+ ndps_handle = new_create_dissector_handle(dissect_ndps_ipx, proto_ndps);
ndps_tcp_handle = create_dissector_handle(dissect_ndps_tcp, proto_ndps);
dissector_add_uint("spx.socket", SPX_SOCKET_PA, ndps_handle);