aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/packet.c8
-rw-r--r--epan/packet.h5
-rw-r--r--epan/plugins.c4
-rw-r--r--epan/proto.h10
-rw-r--r--packet-data.c16
-rw-r--r--plugins/plugin_api.c3
-rw-r--r--plugins/plugin_api.h4
-rw-r--r--plugins/plugin_api_defs.h4
8 files changed, 17 insertions, 37 deletions
diff --git a/epan/packet.c b/epan/packet.c
index 3c5fcd7ff9..a1701bb38e 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.41 2001/11/21 23:16:23 gram Exp $
+ * $Id: packet.c,v 1.42 2001/11/26 05:41:12 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -82,11 +82,13 @@
static gint proto_malformed = -1;
static dissector_handle_t frame_handle = NULL;
+static dissector_handle_t data_handle = NULL;
void
packet_init(void)
{
frame_handle = find_dissector("frame");
+ data_handle = find_dissector("data");
proto_malformed = proto_get_id_by_filter_name("malformed");
}
@@ -824,7 +826,9 @@ call_dissector(dissector_handle_t handle, tvbuff_t *tvb,
/*
* No - just dissect this packet as data.
*/
- dissect_data(tvb, 0, pinfo, tree);
+ g_assert(data_handle != NULL);
+ g_assert(data_handle->proto_index != -1);
+ call_dissector(data_handle,tvb, pinfo, tree);
return;
}
diff --git a/epan/packet.h b/epan/packet.h
index ce27cbc4a8..c9cfc5bca6 100644
--- a/epan/packet.h
+++ b/epan/packet.h
@@ -1,7 +1,7 @@
/* packet.h
* Definitions for packet disassembly structures and routines
*
- * $Id: packet.h,v 1.40 2001/11/21 23:16:23 gram Exp $
+ * $Id: packet.h,v 1.41 2001/11/26 05:41:13 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -227,9 +227,6 @@ extern void init_all_protocols(void);
extern void dissect_packet(struct _epan_dissect_t *edt,
union wtap_pseudo_header *pseudo_header, const u_char *pd,
frame_data *fd);
-extern void dissect_data(tvbuff_t *tvb, int, packet_info *pinfo,
- proto_tree *tree);
-
/* These functions are in packet-ethertype.c */
extern void capture_ethertype(guint16 etype, const u_char *pd, int offset,
diff --git a/epan/plugins.c b/epan/plugins.c
index c4e58374ca..da0509d939 100644
--- a/epan/plugins.c
+++ b/epan/plugins.c
@@ -1,7 +1,7 @@
/* plugins.c
* plugin routines
*
- * $Id: plugins.c,v 1.41 2001/11/21 23:34:08 gram Exp $
+ * $Id: plugins.c,v 1.42 2001/11/26 05:41:13 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -312,8 +312,6 @@ init_plugins(const char *plugin_dir)
patable.p_find_dissector = find_dissector;
patable.p_call_dissector = call_dissector;
- patable.p_dissect_data = dissect_data;
-
patable.p_proto_is_protocol_enabled = proto_is_protocol_enabled;
patable.p_proto_item_get_len = proto_item_get_len;
diff --git a/epan/proto.h b/epan/proto.h
index 60699f413a..9e23889b29 100644
--- a/epan/proto.h
+++ b/epan/proto.h
@@ -1,7 +1,7 @@
/* proto.h
* Definitions for protocol display
*
- * $Id: proto.h,v 1.21 2001/11/26 05:13:14 hagbard Exp $
+ * $Id: proto.h,v 1.22 2001/11/26 05:41:13 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -55,14 +55,6 @@ struct value_string;
#define TFS(x) (struct true_false_string*)(x)
/* check protocol activation */
-#define CHECK_DISPLAY_AS_DATA(index, tvb, pinfo, tree) { \
- if (!proto_is_protocol_enabled(index)) { \
- dissect_data(tvb, 0, pinfo, tree); \
- return; \
- } \
- }
-
-/* check protocol activation */
#define CHECK_DISPLAY_AS_X(x_handle,index, tvb, pinfo, tree) { \
if (!proto_is_protocol_enabled(index)) { \
call_dissector(x_handle,tvb, pinfo, tree); \
diff --git a/packet-data.c b/packet-data.c
index 376aa9c975..967e96993c 100644
--- a/packet-data.c
+++ b/packet-data.c
@@ -2,7 +2,7 @@
* Routines for raw data (default case)
* Gilbert Ramirez <gram@alumni.rice.edu>
*
- * $Id: packet-data.c,v 1.24 2001/11/25 21:44:57 hagbard Exp $
+ * $Id: packet-data.c,v 1.25 2001/11/26 05:41:11 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -40,27 +40,21 @@
int proto_data = -1;
void
-dissect_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
+dissect_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
int bytes;
if (tree) {
- bytes = tvb_length_remaining(tvb, offset);
+ bytes = tvb_length_remaining(tvb, 0);
if (bytes > 0) {
proto_tree_add_protocol_format(tree, proto_data, tvb,
- offset,
+ 0,
bytes, "Data (%d byte%s)", bytes,
plurality(bytes, "", "s"));
}
}
}
-void
-dissect_data_wrapper(tvbuff_t *tvb,packet_info *pinfo, proto_tree *tree)
-{
- dissect_data(tvb,0,pinfo,tree);
-}
-
void
proto_register_data(void)
{
@@ -70,7 +64,7 @@ proto_register_data(void)
"data" /* abbrev */
);
- register_dissector("data",dissect_data_wrapper,proto_data);
+ register_dissector("data",dissect_data,proto_data);
/*
* "Data" is used to dissect something whose normal dissector
diff --git a/plugins/plugin_api.c b/plugins/plugin_api.c
index 8d76a500f3..2d6dc46134 100644
--- a/plugins/plugin_api.c
+++ b/plugins/plugin_api.c
@@ -1,7 +1,7 @@
/* plugin_api.c
* Routines for Ethereal plugins.
*
- * $Id: plugin_api.c,v 1.29 2001/11/24 21:55:53 guy Exp $
+ * $Id: plugin_api.c,v 1.30 2001/11/26 05:41:15 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* Copyright 2000 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -56,7 +56,6 @@ plugin_address_table_init(plugin_address_table_t *pat)
p_register_dissector = pat->p_register_dissector;
p_find_dissector = pat->p_find_dissector;
p_call_dissector = pat->p_call_dissector;
- p_dissect_data = pat->p_dissect_data;
p_proto_is_protocol_enabled = pat->p_proto_is_protocol_enabled;
p_proto_item_get_len = pat->p_proto_item_get_len;
p_proto_item_set_len = pat->p_proto_item_set_len;
diff --git a/plugins/plugin_api.h b/plugins/plugin_api.h
index d5c19114a0..1782c06180 100644
--- a/plugins/plugin_api.h
+++ b/plugins/plugin_api.h
@@ -1,7 +1,7 @@
/* plugin_api.h
* Routines for Ethereal plugins.
*
- * $Id: plugin_api.h,v 1.29 2001/11/24 21:55:54 guy Exp $
+ * $Id: plugin_api.h,v 1.30 2001/11/26 05:41:15 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* Copyright 2000 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -62,8 +62,6 @@
#define find_dissector (*p_find_dissector)
#define call_dissector (*p_call_dissector)
-#define dissect_data (*p_dissect_data)
-
#define proto_is_protocol_enabled (*p_proto_is_protocol_enabled)
#define proto_item_get_len (*p_proto_item_get_len)
diff --git a/plugins/plugin_api_defs.h b/plugins/plugin_api_defs.h
index 1869bdcfef..357dafdfe9 100644
--- a/plugins/plugin_api_defs.h
+++ b/plugins/plugin_api_defs.h
@@ -1,7 +1,7 @@
/* plugin_api_defs.h
* Define the variables that hold pointers to plugin API functions
*
- * $Id: plugin_api_defs.h,v 1.5 2001/11/13 23:55:40 gram Exp $
+ * $Id: plugin_api_defs.h,v 1.6 2001/11/26 05:41:15 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* Copyright 2000 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -51,8 +51,6 @@ addr_register_dissector p_register_dissector;
addr_find_dissector p_find_dissector;
addr_call_dissector p_call_dissector;
-addr_dissect_data p_dissect_data;
-
addr_proto_is_protocol_enabled p_proto_is_protocol_enabled;
addr_proto_item_get_len p_proto_item_get_len;