diff options
author | gram <gram@f5534014-38df-0310-8fa8-9805f1628bb7> | 1999-07-15 15:33:52 +0000 |
---|---|---|
committer | gram <gram@f5534014-38df-0310-8fa8-9805f1628bb7> | 1999-07-15 15:33:52 +0000 |
commit | 9037c6c625b2f3850c86dc2413aa13a84d953792 (patch) | |
tree | f039dce320dbc82cf7724400ce75c8afc499f1c7 /packet-eth.c | |
parent | ac323b858bae0ae19c3e7998ee66f630964b2e12 (diff) |
Modified the proto_register_field_array usage again. Thanks to Guy's
suggestion, this new method using a static array should use less memory
and be faster. It also has a nice side-effect of making the source-code
more readble, IMHO.
Changed the print routines to look for protocol proto_data instead of
looking at the text label as they did before, hoping that the data hex
dump field item starts with "Data (".
Added the -G keyword to ethereal to make it dump a glossary of display
filter keywords to stdout and exit. This data is then formatted with
the doc/dfilter2pod perl program to pod format, which is combined
with doc/ethereal.pod.template to create doc/ethereal.pod, from which
the ethereal manpage is created. This way we can keep the manpage up-to-date
with a list of fields that can be filtered on.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@364 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-eth.c')
-rw-r--r-- | packet-eth.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/packet-eth.c b/packet-eth.c index 3d3ce12550..af24e3bb88 100644 --- a/packet-eth.c +++ b/packet-eth.c @@ -1,7 +1,7 @@ /* packet-eth.c * Routines for ethernet packet disassembly * - * $Id: packet-eth.c,v 1.11 1999/07/08 03:18:20 gram Exp $ + * $Id: packet-eth.c,v 1.12 1999/07/15 15:32:40 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -195,15 +195,26 @@ dissect_eth(const u_char *pd, frame_data *fd, proto_tree *tree) { void proto_register_eth(void) { - const hf_register_info hf[] = { - { "Destination", "eth.dst", &hf_eth_dst, FT_ETHER, NULL }, - { "Source", "eth.src", &hf_eth_src, FT_ETHER, NULL }, - { "Destination Hardware Vendor", "eth.dst_vendor", &hf_eth_dst_vendor, FT_ETHER, NULL }, - { "Source Hardware Vendor", "eth.src_vendor", &hf_eth_src_vendor, FT_ETHER, NULL }, - { "Length", "eth.len", &hf_eth_len, FT_UINT16, NULL }, - - /* registered here but handled in ethertype.c */ - { "Type", "eth.type", &hf_eth_type, FT_VALS_UINT16, VALS(etype_vals) } + static hf_register_info hf[] = { + + { &hf_eth_dst, + { "Destination", "eth.dst", FT_ETHER, NULL }}, + + { &hf_eth_src, + { "Source", "eth.src", FT_ETHER, NULL }}, + + { &hf_eth_dst_vendor, + { "Destination Hardware Vendor", "eth.dst_vendor", FT_ETHER, NULL }}, + + { &hf_eth_src_vendor, + { "Source Hardware Vendor", "eth.src_vendor", FT_ETHER, NULL }}, + + { &hf_eth_len, + { "Length", "eth.len", FT_UINT16, NULL }}, + + /* registered here but handled in ethertype.c */ + { &hf_eth_type, + { "Type", "eth.type", FT_VALS_UINT16, VALS(etype_vals) }} }; proto_eth = proto_register_protocol ("Ethernet", "eth" ); |