aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ip.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>1999-07-29 05:47:07 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>1999-07-29 05:47:07 +0000
commit7bd6c15378e920f89c76cd3beeb7e8bcf6a164e3 (patch)
tree3e8a46fe6f7bb69698edb1187655e445bbfda37c /packet-ip.c
parent6f1d3a3be830da628246f7cea77fe9c491470d17 (diff)
Made the protocol (but not the fields) use the new proto_tree routine,
allowing users to filter on the existence of these protocols. I also added packet-clip.c to the Nmake makefile. svn path=/trunk/; revision=402
Diffstat (limited to 'packet-ip.c')
-rw-r--r--packet-ip.c48
1 files changed, 28 insertions, 20 deletions
diff --git a/packet-ip.c b/packet-ip.c
index 1ed42f6697..ddf05cbe99 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.30 1999/07/17 04:19:03 gram Exp $
+ * $Id: packet-ip.c,v 1.31 1999/07/29 05:46:55 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -48,23 +48,26 @@
extern packet_info pi;
-int proto_ip = -1;
-int hf_ip_version = -1;
-int hf_ip_hdr_len = -1;
-int hf_ip_tos = -1;
-int hf_ip_tos_precedence = -1;
-int hf_ip_len = -1;
-int hf_ip_id = -1;
-int hf_ip_dst = -1;
-int hf_ip_src = -1;
-int hf_ip_addr = -1;
-
-int proto_igmp = -1;
-int hf_igmp_version = -1;
-int hf_igmp_type = -1;
-int hf_igmp_unused = -1;
-int hf_igmp_checksum = -1;
-int hf_igmp_group = -1;
+static int proto_ip = -1;
+static int hf_ip_version = -1;
+static int hf_ip_hdr_len = -1;
+static int hf_ip_tos = -1;
+static int hf_ip_tos_precedence = -1;
+static int hf_ip_len = -1;
+static int hf_ip_id = -1;
+static int hf_ip_dst = -1;
+static int hf_ip_src = -1;
+static int hf_ip_addr = -1;
+
+static int proto_igmp = -1;
+static int hf_igmp_version = -1;
+static int hf_igmp_type = -1;
+static int hf_igmp_unused = -1;
+static int hf_igmp_checksum = -1;
+static int hf_igmp_group = -1;
+
+static int proto_icmp = -1;
+
/* ICMP structs and definitions */
typedef struct _e_icmp {
@@ -911,8 +914,7 @@ dissect_icmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
col_add_str(fd, COL_INFO, type_str);
if (tree) {
- ti = proto_tree_add_text(tree, offset, 4,
- "Internet Control Message Protocol");
+ ti = proto_tree_add_item(tree, proto_icmp, offset, 4, NULL);
icmp_tree = proto_item_add_subtree(ti, ETT_ICMP);
proto_tree_add_text(icmp_tree, offset, 1, "Type: %d (%s)",
ih.icmp_type, type_str);
@@ -1136,3 +1138,9 @@ proto_register_ip(void)
proto_ip = proto_register_protocol ("Internet Protocol", "ip");
proto_register_field_array(proto_ip, hf, array_length(hf));
}
+
+void
+proto_register_icmp(void)
+{
+ proto_icmp = proto_register_protocol ("Internet Control Message Protocol", "icmp");
+}