diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 1999-07-29 05:47:07 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 1999-07-29 05:47:07 +0000 |
commit | 7bd6c15378e920f89c76cd3beeb7e8bcf6a164e3 (patch) | |
tree | 3e8a46fe6f7bb69698edb1187655e445bbfda37c /packet-cdp.c | |
parent | 6f1d3a3be830da628246f7cea77fe9c491470d17 (diff) | |
download | wireshark-7bd6c15378e920f89c76cd3beeb7e8bcf6a164e3.tar.gz |
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-cdp.c')
-rw-r--r-- | packet-cdp.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/packet-cdp.c b/packet-cdp.c index 8874e048e2..7d545cacd1 100644 --- a/packet-cdp.c +++ b/packet-cdp.c @@ -2,7 +2,7 @@ * Routines for the disassembly of the "Cisco Discovery Protocol" * (c) Copyright Hannes R. Boehm <hannes@boehm.org> * - * $Id: packet-cdp.c,v 1.9 1999/07/07 22:51:41 gram Exp $ + * $Id: packet-cdp.c,v 1.10 1999/07/29 05:46:52 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -40,6 +40,8 @@ #define TLV_TYPE 0 #define TLV_LENGTH 2 +static int proto_cdp = -1; + static void add_multi_line_string_to_tree(proto_tree *tree, gint start, gint len, const gchar *prefix, const gchar *string); @@ -66,8 +68,7 @@ dissect_cdp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { col_add_str(fd, COL_INFO, "Cisco Discovery Protocol"); if(tree){ - ti = proto_tree_add_text(tree, offset, (fd->cap_len - offset), - "Cisco Discovery Protocol"); + ti = proto_tree_add_item(tree, proto_cdp, offset, (fd->cap_len - offset), NULL); cdp_tree = proto_item_add_subtree(ti, ETT_CDP); /* CDP header */ @@ -187,3 +188,15 @@ add_multi_line_string_to_tree(proto_tree *tree, gint start, gint len, prefix = blanks; } } + +void +proto_register_cdp(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "cdp.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_cdp = proto_register_protocol("Cisco Discovery Protocol", "cdp"); + /* proto_register_field_array(proto_cdp, hf, array_length(hf));*/ +} |