From 7bd6c15378e920f89c76cd3beeb7e8bcf6a164e3 Mon Sep 17 00:00:00 2001 From: Gilbert Ramirez Date: Thu, 29 Jul 1999 05:47:07 +0000 Subject: 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 --- packet-trmac.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'packet-trmac.c') 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 * - * $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 @@ -35,6 +35,8 @@ #include #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));*/ +} -- cgit v1.2.3