aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ip.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>1999-07-08 04:23:28 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>1999-07-08 04:23:28 +0000
commit53d2a96094c69fbe8cc7bb9e0f9ff3be2a68a522 (patch)
treeb1d812d2db0d3c9d97ce25a48db15b8da2a79a52 /packet-ip.c
parente578a22f4c25d628b4c134ddc4f70349aab3925b (diff)
downloadwireshark-53d2a96094c69fbe8cc7bb9e0f9ff3be2a68a522.tar.gz
wireshark-53d2a96094c69fbe8cc7bb9e0f9ff3be2a68a522.tar.bz2
wireshark-53d2a96094c69fbe8cc7bb9e0f9ff3be2a68a522.zip
Added Johan's RADIUS dissector, finally. I modified it to fit in with the
new proto_tree routines. I also removed the check for lex and yacc from wiretap's configure script. The IP dissector now uses proto_register_field_array(). svn path=/trunk/; revision=348
Diffstat (limited to 'packet-ip.c')
-rw-r--r--packet-ip.c59
1 files changed, 13 insertions, 46 deletions
diff --git a/packet-ip.c b/packet-ip.c
index 3d7585ff84..74a1d80307 100644
--- a/packet-ip.c
+++ b/packet-ip.c
@@ -1,7 +1,7 @@
/* packet-ip.c
* Routines for IP and miscellaneous IP protocol packet disassembly
*
- * $Id: packet-ip.c,v 1.27 1999/07/07 22:51:44 gram Exp $
+ * $Id: packet-ip.c,v 1.28 1999/07/08 04:23:03 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -1066,49 +1066,16 @@ dissect_igmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
void
proto_register_ip(void)
{
- proto_ip = proto_register_protocol (
- /* name */ "Internet Protocol",
- /* abbrev */ "ip" );
-
- hf_ip_version = proto_register_field (
- /* name */ "Version",
- /* abbrev */ "ip.version",
- /* ftype */ FT_UINT8,
- /* parent */ proto_ip,
- /* vals[] */ NULL );
-
- hf_ip_hdr_len = proto_register_field (
- /* name */ "Header Length",
- /* abbrev */ "ip.hdr_len",
- /* ftype */ FT_UINT8,
- /* parent */ proto_ip,
- /* vals[] */ NULL );
-
- hf_ip_tos = proto_register_field (
- /* name */ "Type of Service",
- /* abbrev */ "ip.tos",
- /* ftype */ FT_UINT8,
- /* parent */ proto_ip,
- /* vals[] */ NULL );
-
- hf_ip_tos_precedence = proto_register_field (
- /* name */ "Precedence",
- /* abbrev */ "ip.tos_precedence",
- /* ftype */ FT_VALS_UINT8,
- /* parent */ proto_ip,
- /* vals[] */ VALS(precedence_vals) );
-
- hf_ip_dst = proto_register_field (
- /* name */ "Destination",
- /* abbrev */ "ip.dst",
- /* ftype */ FT_IPv4,
- /* parent */ proto_ip,
- /* vals[] */ NULL );
-
- hf_ip_src = proto_register_field (
- /* name */ "Source",
- /* abbrev */ "ip.src",
- /* ftype */ FT_IPv4,
- /* parent */ proto_ip,
- /* vals[] */ NULL );
+ const hf_register_info hf[] = {
+ { "Version", "ip.version", &hf_ip_version, FT_UINT8, NULL },
+ { "Header Length", "ip.hdr_len", &hf_ip_hdr_len, FT_UINT8, NULL },
+ { "Type of Service", "ip.tos", &hf_ip_tos, FT_UINT8, NULL },
+ { "Precedence", "ip.tos_precedence",
+ &hf_ip_tos_precedence, FT_VALS_UINT8, VALS(precedence_vals) },
+ { "Destination", "ip.dst", &hf_ip_dst, FT_IPv4, NULL },
+ { "Source", "ip.src", &hf_ip_src, FT_IPv4, NULL }
+ };
+
+ proto_ip = proto_register_protocol ("Internet Protocol", "ip");
+ proto_register_field_array(proto_ip, hf, array_length(hf));
}