summaryrefslogtreecommitdiff
path: root/epan/packet.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2009-08-03 17:25:17 +0000
committerBill Meier <wmeier@newsguy.com>2009-08-03 17:25:17 +0000
commitd8297e8312060a950fd6009c4baf5ced1965d056 (patch)
tree2c090751d717187062edf4346db278dfbc393926 /epan/packet.c
parentd4e1095f540ab9054b779f0633677f5ee9f0b62c (diff)
downloadwireshark-d8297e8312060a950fd6009c4baf5ced1965d056.tar.gz
Add some debug code (commented out) to check for duplicate dissector port registrations,
svn path=/trunk/; revision=29275
Diffstat (limited to 'epan/packet.c')
-rw-r--r--epan/packet.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/epan/packet.c b/epan/packet.c
index ceb3426c4c..0ad609aa25 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -40,6 +40,7 @@
#include <time.h>
#include "packet.h"
+//#include "proto.h"
#include "timestamp.h"
#include "atalk-utils.h"
@@ -687,6 +688,19 @@ dissector_add(const char *name, guint32 pattern, dissector_handle_t handle)
g_assert_not_reached();
}
+#if 0
+ if (pattern == 0) {
+ g_warning("%s: %s registering using a pattern of 0",
+ name, proto_get_protocol_filter_name(proto_get_id(handle->protocol)));
+ }
+
+ dtbl_entry = g_hash_table_lookup(sub_dissectors->hash_table, GUINT_TO_POINTER(pattern));
+ if (dtbl_entry != NULL) {
+ g_warning("%s: %s registering using pattern %d already registered by %s",
+ name, proto_get_protocol_filter_name(proto_get_id(handle->protocol)),
+ pattern, proto_get_protocol_filter_name(proto_get_id(dtbl_entry->initial->protocol)));
+ }
+#endif
dtbl_entry = g_malloc(sizeof (dtbl_entry_t));
dtbl_entry->current = handle;
dtbl_entry->initial = dtbl_entry->current;