diff options
author | gram <gram@f5534014-38df-0310-8fa8-9805f1628bb7> | 1999-07-08 03:18:20 +0000 |
---|---|---|
committer | gram <gram@f5534014-38df-0310-8fa8-9805f1628bb7> | 1999-07-08 03:18:20 +0000 |
commit | 2e399412e935c48b599c0b3ce9c731e5965d2d41 (patch) | |
tree | 2f9fb4d61d19686ac9ed2907a974b84604bc226e /packet-eth.c | |
parent | b732cc733855c48a1ec9293510786a4682c0c4b4 (diff) |
Documented the proto_register_field_array() function, and converted
the registration functions in packet-fddi.c and packet-eth.c to this new
registration method.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@346 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-eth.c')
-rw-r--r-- | packet-eth.c | 61 |
1 files changed, 14 insertions, 47 deletions
diff --git a/packet-eth.c b/packet-eth.c index 9ee7489bcd..3d3ce12550 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.10 1999/07/07 22:51:42 gram Exp $ + * $Id: packet-eth.c,v 1.11 1999/07/08 03:18:20 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -195,50 +195,17 @@ dissect_eth(const u_char *pd, frame_data *fd, proto_tree *tree) { void proto_register_eth(void) { - proto_eth = proto_register_protocol ( - /* name */ "Ethernet", - /* abbrev */ "eth" ); - - hf_eth_dst = proto_register_field ( - /* name */ "Destination", - /* abbrev */ "eth.dst", - /* ftype */ FT_ETHER, - /* parent */ proto_eth, - /* vals[] */ NULL ); - - hf_eth_src = proto_register_field ( - /* name */ "Source", - /* abbrev */ "eth.src", - /* ftype */ FT_ETHER, - /* parent */ proto_eth, - /* vals[] */ NULL ); - - hf_eth_dst_vendor = proto_register_field ( - /* name */ "Destination Hardware Vendor", - /* abbrev */ "eth.dst_vendor", - /* ftype */ FT_ETHER_VENDOR, - /* parent */ proto_eth, - /* vals[] */ NULL ); - - hf_eth_src_vendor = proto_register_field ( - /* name */ "Source Hardware Vendor", - /* abbrev */ "eth.src_vendor", - /* ftype */ FT_ETHER_VENDOR, - /* parent */ proto_eth, - /* vals[] */ NULL ); - - hf_eth_len = proto_register_field ( - /* name */ "Length", - /* abbrev */ "eth.len", - /* ftype */ FT_UINT16, - /* parent */ proto_eth, - /* vals[] */ NULL ); - - /* registered here but handled in ethertype.c */ - hf_eth_type = proto_register_field ( - /* name */ "Type", - /* abbrev */ "eth.type", - /* ftype */ FT_VALS_UINT16, - /* parent */ proto_eth, - /* vals[] */ VALS(etype_vals) ); + 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) } + }; + + proto_eth = proto_register_protocol ("Ethernet", "eth" ); + proto_register_field_array(proto_eth, hf, array_length(hf)); } |