aboutsummaryrefslogtreecommitdiffstats
path: root/proto.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2000-04-13 18:18:56 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>2000-04-13 18:18:56 +0000
commitdb187f965c6ca47932a009f3cb011770a687e289 (patch)
tree1d58b40531c9ca503d57229b9cc8c9bf394a2052 /proto.c
parent2fa56170d39e86f703ee0a6c5d3ddc1d14afa905 (diff)
downloadwireshark-db187f965c6ca47932a009f3cb011770a687e289.tar.gz
wireshark-db187f965c6ca47932a009f3cb011770a687e289.tar.bz2
wireshark-db187f965c6ca47932a009f3cb011770a687e289.zip
Change the sub-dissector handoff registration routines so that the
sub-dissector table is not stored in the header_field_info struct, but in a separate namespace. Dissector tables are now registered by name and not by field ID. For example: udp_dissector_table = register_dissector_table("udp.port"); Because of this different namespace, dissector tables can have names that are not field names. This is useful for ethertype, since multiple fields are "ethertypes". packet-ethertype.c replaces ethertype.c (the name was changed so that it would be named in the same fashion as all the filenames passed to make-reg-dotc) Although it registers no protocol or field, it registers one dissector table: ethertype_dissector_table = register_dissector_table("ethertype"); All protocols that can be called because of an ethertype field now register that fact with dissector_add() calls. In this way, one dissector_table services all ethertype fields (hf_eth_type, hf_llc_type, hf_null_etype, hf_vlan_etype) Furthermore, the code allows for names of protocols to exist in the etype_vals, yet a dissector for that protocol doesn't exist. The name of the dissector is printed in COL_INFO. You're welcome, Richard. :-) svn path=/trunk/; revision=1848
Diffstat (limited to 'proto.c')
-rw-r--r--proto.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/proto.c b/proto.c
index d71193a125..4cd2034de2 100644
--- a/proto.c
+++ b/proto.c
@@ -1,7 +1,7 @@
/* proto.c
* Routines for protocol tree
*
- * $Id: proto.c,v 1.61 2000/04/11 16:07:40 gram Exp $
+ * $Id: proto.c,v 1.62 2000/04/13 18:18:55 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -260,21 +260,6 @@ proto_registrar_get_nth(int hfindex)
return g_ptr_array_index(gpa_hfinfo, hfindex);
}
-/* Finds a dissector table by field name. */
-dissector_table_t
-find_dissector_table(const char *name)
-{
- header_field_info *hfinfo;
- int i, len;
-
- len = gpa_hfinfo->len;
- for (i = 0; i < len ; i++) {
- hfinfo = proto_registrar_get_nth(i);
- if (strcmp(name, hfinfo->abbrev) == 0)
- return hfinfo->sub_dissectors;
- }
- return NULL;
-}
/* Add a node with no text */
proto_item *
@@ -949,8 +934,6 @@ proto_register_protocol(char *name, char *abbrev)
hfinfo->blurb = "";
hfinfo->parent = -1; /* this field differentiates protos and fields */
- hfinfo->sub_dissectors = NULL; /* clear sub-dissector table pointer */
-
return proto_register_field_init(hfinfo, hfinfo->parent);
}