aboutsummaryrefslogtreecommitdiffstats
path: root/packet-arp.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-arp.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-arp.c')
-rw-r--r--packet-arp.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/packet-arp.c b/packet-arp.c
index b3ddf2149d..4ae66b30ca 100644
--- a/packet-arp.c
+++ b/packet-arp.c
@@ -1,7 +1,7 @@
/* packet-arp.c
* Routines for ARP packet disassembly
*
- * $Id: packet-arp.c,v 1.14 1999/07/07 22:51:40 gram Exp $
+ * $Id: packet-arp.c,v 1.15 1999/07/29 05:46:52 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -35,6 +35,8 @@
#include "packet.h"
#include "etypes.h"
+static int proto_arp = -1;
+
/* Definitions taken from Linux "linux/if_arp.h" header file, and from
http://www.isi.edu/in-notes/iana/assignments/arp-parameters
@@ -216,10 +218,10 @@ dissect_arp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
if (tree) {
if ((op_str = match_strval(ar_op, op_vals)))
- ti = proto_tree_add_text(tree, offset, 8 + 2*ar_hln + 2*ar_pln,
+ ti = proto_tree_add_item_format(tree, proto_arp, offset, 8 + 2*ar_hln + 2*ar_pln,
op_str);
else
- ti = proto_tree_add_text(tree, offset, 8 + 2*ar_hln + 2*ar_pln,
+ ti = proto_tree_add_item_format(tree, proto_arp, offset, 8 + 2*ar_hln + 2*ar_pln,
"Unknown ARP (opcode 0x%04x)", ar_op);
arp_tree = proto_item_add_subtree(ti, ETT_ARP);
proto_tree_add_text(arp_tree, offset + AR_HRD, 2,
@@ -242,3 +244,15 @@ dissect_arp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
"Target protocol address: %s", tpa_str);
}
}
+
+void
+proto_register_arp(void)
+{
+/* static hf_register_info hf[] = {
+ { &variable,
+ { "Name", "arp.abbreviation", TYPE, VALS_POINTER }},
+ };*/
+
+ proto_arp = proto_register_protocol("Address Resolution Protocol", "arp");
+ /* proto_register_field_array(proto_arp, hf, array_length(hf));*/
+}