aboutsummaryrefslogtreecommitdiffstats
path: root/packet-eth.c
diff options
context:
space:
mode:
Diffstat (limited to 'packet-eth.c')
-rw-r--r--packet-eth.c61
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));
}