diff options
author | Michael Mann <mmann78@netscape.net> | 2014-11-22 19:24:06 -0500 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-11-25 15:19:52 +0000 |
commit | 152b0c92d658991b5a8742802a1f8412848de964 (patch) | |
tree | c405423a4037171e97ab0970782ce868e4029c28 /epan | |
parent | e3a04bb392824781b8a3ef6ec98a37ef96c6c827 (diff) |
Remove support for pinfo->private_data in "data-text-lines", "data-l1-events" and "urlencoded-form" dissectors. Data must be passed from parent through dissectors data parameter.
Change-Id: I24ab56ce7d99f8ed670f4a50453223d4e6a46983
Reviewed-on: https://code.wireshark.org/review/5463
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-http-urlencoded.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-json.c | 16 | ||||
-rw-r--r-- | epan/dissectors/packet-l1-events.c | 10 | ||||
-rw-r--r-- | epan/dissectors/packet-text-media.c | 16 |
4 files changed, 11 insertions, 39 deletions
diff --git a/epan/dissectors/packet-http-urlencoded.c b/epan/dissectors/packet-http-urlencoded.c index a3ff4cf8bf..0838f79a6d 100644 --- a/epan/dissectors/packet-http-urlencoded.c +++ b/epan/dissectors/packet-http-urlencoded.c @@ -140,13 +140,7 @@ dissect_form_urlencoded(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi /* * No information from dissector data */ - data_name = (char *)(pinfo->private_data); - if (! (data_name && data_name[0])) { - /* - * No information from "private_data" - */ - data_name = NULL; - } + data_name = NULL; } } diff --git a/epan/dissectors/packet-json.c b/epan/dissectors/packet-json.c index e858bcab54..7572232c7d 100644 --- a/epan/dissectors/packet-json.c +++ b/epan/dissectors/packet-json.c @@ -129,13 +129,7 @@ dissect_json(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) /* * No information from dissector data */ - data_name = (char *)(pinfo->private_data); - if (! (data_name && data_name[0])) { - /* - * No information from "private_data" - */ - data_name = NULL; - } + data_name = NULL; } } @@ -164,15 +158,11 @@ dissect_json(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) /* if we have some unparsed data, pass to data-text-lines dissector (?) */ if (tvb_length_remaining(tvb, offset) > 0) { - int datalen, reported_datalen; tvbuff_t *next_tvb; - datalen = tvb_length_remaining(tvb, offset); - reported_datalen = tvb_reported_length_remaining(tvb, offset); - - next_tvb = tvb_new_subset(tvb, offset, datalen, reported_datalen); + next_tvb = tvb_new_subset_remaining(tvb, offset); - call_dissector(text_lines_handle, next_tvb, pinfo, tree); + call_dissector_with_data(text_lines_handle, next_tvb, pinfo, tree, data); } else if (data_name) { col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "(%s)", data_name); } diff --git a/epan/dissectors/packet-l1-events.c b/epan/dissectors/packet-l1-events.c index 5651063063..49d5709496 100644 --- a/epan/dissectors/packet-l1-events.c +++ b/epan/dissectors/packet-l1-events.c @@ -67,13 +67,7 @@ dissect_l1_events(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat /* * No information from dissector data */ - data_name = (char *)(pinfo->private_data); - if (! (data_name && data_name[0])) { - /* - * No information from "private_data" - */ - data_name = NULL; - } + data_name = NULL; } } @@ -95,7 +89,7 @@ dissect_l1_events(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat while (tvb_reported_length_remaining(tvb, offset) != 0) { /* * XXX - we need to be passed the parameters - * of the content type via "pinfo->private_data", + * of the content type via data parameter, * so that we know the character set. We'd * have to handle that character set, which * might be a multibyte character set such diff --git a/epan/dissectors/packet-text-media.c b/epan/dissectors/packet-text-media.c index a6ad1d56ba..97cdf61e41 100644 --- a/epan/dissectors/packet-text-media.c +++ b/epan/dissectors/packet-text-media.c @@ -2,7 +2,7 @@ * Routines for text-based media dissection. * * NOTE - The media type is either found in pinfo->match_string, - * pinfo->private_data, or passed into the dissector (preferred) + * or passed into the dissector * * (C) Olivier Biot, 2004. * @@ -71,7 +71,7 @@ dissect_text_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da if(length > 38){ if (tvb_strncaseeql(tvb, 0, "<?xml", 5) == 0){ call_dissector(xml_handle, tvb, pinfo, tree); - return tvb_length(tvb); + return length; } } @@ -85,13 +85,7 @@ dissect_text_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da /* * No information from dissector data */ - data_name = (char *)(pinfo->private_data); - if (! (data_name && data_name[0])) { - /* - * No information from "private_data" - */ - data_name = NULL; - } + data_name = NULL; } } @@ -109,7 +103,7 @@ dissect_text_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da while (tvb_reported_length_remaining(tvb, offset) != 0) { /* * XXX - we need to be passed the parameters - * of the content type via "pinfo->private_data", + * of the content type via data parameter, * so that we know the character set. We'd * have to handle that character set, which * might be a multibyte character set such @@ -131,7 +125,7 @@ dissect_text_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da } } - return tvb_length(tvb); + return length; } void |