aboutsummaryrefslogtreecommitdiffstats
path: root/epan/packet.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-11-25 10:11:53 -0500
committerAnders Broman <a.broman58@gmail.com>2015-11-26 12:34:50 +0000
commit3cb5d94018225a466154a5d22e31f67ce24312a0 (patch)
tree8f322769b0f01ffd1dc1644060012149b83e7abb /epan/packet.c
parent921a844200e32bdc4c59485c5589873540eb238c (diff)
Completely remove "old style" dissector support.
The typedef for the "old style" has been removed as well as any old vs new style checks. The release notes have been updated to reflect the API change, even though the search/replace of the "new style" function names hasn't happen yet. But it will be coming shortly... Change-Id: I6d1eeb51d30e3b2b27f0eafd85fe0ddc0ca25b14 Reviewed-on: https://code.wireshark.org/review/12153 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/packet.c')
-rw-r--r--epan/packet.c31
1 files changed, 5 insertions, 26 deletions
diff --git a/epan/packet.c b/epan/packet.c
index 3c30c68b2e..15edc4df8f 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -585,11 +585,7 @@ dissect_file(epan_dissect_t *edt, struct wtap_pkthdr *phdr,
*/
struct dissector_handle {
const char *name; /* dissector name */
- gboolean is_new; /* TRUE if new-style dissector */
- union {
- dissector_t old;
- new_dissector_t new_d;
- } dissector;
+ new_dissector_t dissector;
protocol_t *protocol;
};
@@ -617,21 +613,7 @@ call_dissector_through_handle(dissector_handle_t handle, tvbuff_t *tvb,
proto_get_protocol_short_name(handle->protocol);
}
- if (handle->is_new) {
- len = (*handle->dissector.new_d)(tvb, pinfo, tree, data);
- } else {
- (*handle->dissector.old)(tvb, pinfo, tree);
- len = tvb_captured_length(tvb);
- if (len == 0) {
- /*
- * XXX - a tvbuff can have 0 bytes of data in
- * it, so we have to make sure we don't return
- * 0.
- */
- len = 1;
- }
- }
-
+ len = (*handle->dissector)(tvb, pinfo, tree, data);
pinfo->current_proto = saved_proto;
return len;
@@ -2604,8 +2586,7 @@ new_create_dissector_handle(new_dissector_t dissector, const int proto)
handle = wmem_new(wmem_epan_scope(), struct dissector_handle);
handle->name = NULL;
- handle->is_new = TRUE;
- handle->dissector.new_d = dissector;
+ handle->dissector = dissector;
handle->protocol = find_protocol_by_id(proto);
return handle;
@@ -2618,8 +2599,7 @@ dissector_handle_t new_create_dissector_handle_with_name(new_dissector_t dissect
handle = wmem_new(wmem_epan_scope(), struct dissector_handle);
handle->name = name;
- handle->is_new = TRUE;
- handle->dissector.new_d = dissector;
+ handle->dissector = dissector;
handle->protocol = find_protocol_by_id(proto);
return handle;
@@ -2647,8 +2627,7 @@ new_register_dissector(const char *name, new_dissector_t dissector, const int pr
handle = wmem_new(wmem_epan_scope(), struct dissector_handle);
handle->name = name;
- handle->is_new = TRUE;
- handle->dissector.new_d = dissector;
+ handle->dissector = dissector;
handle->protocol = find_protocol_by_id(proto);
g_hash_table_insert(registered_dissectors, (gpointer)name,