diff options
author | gram <gram@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-04-13 18:18:56 +0000 |
---|---|---|
committer | gram <gram@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-04-13 18:18:56 +0000 |
commit | 0ae7dadfa4f8f257a4b15c9be28cfb8984615b86 (patch) | |
tree | 1d58b40531c9ca503d57229b9cc8c9bf394a2052 /packet-vlan.c | |
parent | e875ac3f604a4c2851f74fc4a3cfd9d26558ccc8 (diff) |
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. :-)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1848 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-vlan.c')
-rw-r--r-- | packet-vlan.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packet-vlan.c b/packet-vlan.c index f6215eb9c2..6096ff40e6 100644 --- a/packet-vlan.c +++ b/packet-vlan.c @@ -1,7 +1,7 @@ /* packet-vlan.c * Routines for VLAN 802.1Q ethernet header disassembly * - * $Id: packet-vlan.c,v 1.8 2000/02/15 21:03:25 gram Exp $ + * $Id: packet-vlan.c,v 1.9 2000/04/13 18:18:52 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -133,3 +133,9 @@ proto_register_vlan(void) proto_register_field_array(proto_vlan, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } + +void +proto_reg_handoff_vlan(void) +{ + dissector_add("ethertype", ETHERTYPE_VLAN, dissect_vlan); +} |