aboutsummaryrefslogtreecommitdiffstats
path: root/packet-trmac.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-trmac.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-trmac.c')
-rw-r--r--packet-trmac.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/packet-trmac.c b/packet-trmac.c
index ff58766fc8..67d6f04d5d 100644
--- a/packet-trmac.c
+++ b/packet-trmac.c
@@ -2,7 +2,7 @@
* Routines for Token-Ring Media Access Control
* Gilbert Ramirez <gram@verdict.uthscsa.edu>
*
- * $Id: packet-trmac.c,v 1.12 1999/07/07 22:51:56 gram Exp $
+ * $Id: packet-trmac.c,v 1.13 1999/07/29 05:47:06 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -35,6 +35,8 @@
#include <glib.h>
#include "packet.h"
+static int proto_trmac = -1;
+
/* Major Vector */
static value_string major_vectors[] = {
{ 0x00, "Response" },
@@ -252,12 +254,6 @@ dissect_trmac(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
mv_length = pntohs(&pd[offset]);
- if (tree) {
- ti = proto_tree_add_text(tree, offset, mv_length,
- "Media Access Control");
- mac_tree = proto_item_add_subtree(ti, ETT_TR_MAC);
- }
-
/* Interpret the major vector */
mv_text = val_to_str(pd[offset+3], major_vectors, "Unknown Major Vector: %d\n");
@@ -268,6 +264,10 @@ dissect_trmac(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
col_add_str(fd, COL_INFO, mv_text);
if (tree) {
+
+ ti = proto_tree_add_item(tree, proto_trmac, offset, mv_length, NULL);
+ mac_tree = proto_item_add_subtree(ti, ETT_TR_MAC);
+
if (mv_text)
proto_tree_add_text(mac_tree, offset+3, 1, "Major Vector Command: %s",
mv_text);
@@ -298,3 +298,15 @@ dissect_trmac(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
}
}
}
+
+void
+proto_register_trmac(void)
+{
+/* static hf_register_info hf[] = {
+ { &variable,
+ { "Name", "trmac.abbreviation", TYPE, VALS_POINTER }},
+ };*/
+
+ proto_trmac = proto_register_protocol("Token-Ring Media Access Control", "trmac");
+ /* proto_register_field_array(proto_trmac, hf, array_length(hf));*/
+}