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-snmp.c | |
parent | 6f1d3a3be830da628246f7cea77fe9c491470d17 (diff) | |
download | wireshark-7bd6c15378e920f89c76cd3beeb7e8bcf6a164e3.tar.gz wireshark-7bd6c15378e920f89c76cd3beeb7e8bcf6a164e3.tar.bz2 wireshark-7bd6c15378e920f89c76cd3beeb7e8bcf6a164e3.zip |
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-snmp.c')
-rw-r--r-- | packet-snmp.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/packet-snmp.c b/packet-snmp.c index d7edc838e8..d1a78aa3bc 100644 --- a/packet-snmp.c +++ b/packet-snmp.c @@ -2,7 +2,7 @@ * Routines for SNMP (simple network management protocol) * D.Jorand (c) 1998 * - * $Id: packet-snmp.c,v 1.4 1999/07/07 22:51:54 gram Exp $ + * $Id: packet-snmp.c,v 1.5 1999/07/29 05:47:05 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -63,6 +63,8 @@ #include <ucd-snmp/snmp_impl.h> #include <ucd-snmp/mib.h> +static int proto_snmp = -1; + typedef long SNMP_INT; typedef unsigned long SNMP_UINT; #define OID_FORMAT_STRING "%ld" @@ -449,10 +451,10 @@ dissect_snmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) "Unknown PDU type %#x"); if (check_col(fd, COL_INFO)) col_add_str(fd, COL_INFO, pdu_type_string); - if(tree) { + if (tree) { /* all_length=header_length+pdu_type_length+request_id_length+error_status_length+error_index_length; */ all_length=fd->pkt_len-offset; - item = proto_tree_add_text(tree, offset, all_length, "Simple Network Management Protocol"); + item = proto_tree_add_item(tree, proto_snmp, offset, all_length, NULL); snmp_tree = proto_item_add_subtree(item, ETT_SNMP); proto_tree_add_text(snmp_tree, offset, header_length, "Community: \"%s\", Version: %s", community, val_to_str(version, versions, "Unknown version %#x")); offset+=header_length; @@ -480,7 +482,7 @@ dissect_snmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) col_add_str(fd, COL_INFO, pdu_type_string); if(tree) { all_length=fd->pkt_len-offset; - item = proto_tree_add_text(tree, offset, all_length, "Simple Network Management Protocol"); + item = proto_tree_add_item(tree, proto_snmp, offset, all_length, NULL); snmp_tree = proto_item_add_subtree(item, ETT_SNMP); proto_tree_add_text(snmp_tree, offset, header_length, "Community: \"%s\", Version: %s", community, val_to_str(version, versions, "Unknown version %#x")); offset+=header_length; @@ -856,4 +858,16 @@ dissect_snmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } } +void +proto_register_snmp(void) +{ +/* static hf_register_info hf[] = { + { &variable, + { "Name", "snmp.abbreviation", TYPE, VALS_POINTER }}, + };*/ + + proto_snmp = proto_register_protocol("Simple Network Management Protocol", "snmp"); + /* proto_register_field_array(proto_snmp, hf, array_length(hf));*/ +} + #endif /* WITH_SNMP: CMU or UCD */ |