aboutsummaryrefslogtreecommitdiffstats
path: root/packet-snmp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-02-19 09:35:45 +0000
committerGuy Harris <guy@alum.mit.edu>2002-02-19 09:35:45 +0000
commitddf6a753f086df1cba37e5109cf32b8353c1464b (patch)
tree0c80e08d1166b692e574890d5db465f699ba9ff1 /packet-snmp.c
parent642d7239dc8dc8332732dd91224a2d73a31fc143 (diff)
From Andrew Hood: translate enterprise OIDs in SNMP traps to strings if
possible. svn path=/trunk/; revision=4758
Diffstat (limited to 'packet-snmp.c')
-rw-r--r--packet-snmp.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/packet-snmp.c b/packet-snmp.c
index e5d224d3a3..f37db104e0 100644
--- a/packet-snmp.c
+++ b/packet-snmp.c
@@ -8,7 +8,7 @@
*
* See RFCs 1905, 1906, 1909, and 1910 for SNMPv2u.
*
- * $Id: packet-snmp.c,v 1.79 2002/01/24 09:20:51 guy Exp $
+ * $Id: packet-snmp.c,v 1.80 2002/02/19 09:35:45 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1098,8 +1098,20 @@ dissect_common_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
if (tree) {
oid_string = format_oid(enterprise, enterprise_length);
+#if defined(HAVE_UCD_SNMP_SNMP_H) || defined(HAVE_SNMP_SNMP_H)
+# ifdef RED_HAT_MODIFIED_UCD_SNMP
+ sprint_objid(binit(NULL, vb_oid_string, sizeof(vb_oid_string)),
+ enterprise, enterprise_length);
+# else
+ sprint_objid(vb_oid_string, enterprise,
+ enterprise_length);
+# endif
+ proto_tree_add_text(tree, tvb, offset, length,
+ "Enterprise: %s (%s)", oid_string, vb_oid_string);
+#else /* defined(HAVE_UCD_SNMP_SNMP_H) || defined(HAVE_SNMP_SNMP_H) */
proto_tree_add_text(tree, tvb, offset, length,
"Enterprise: %s", oid_string);
+#endif /* defined(HAVE_UCD_SNMP_SNMP_H) || defined(HAVE_SNMP_SNMP_H) */
g_free(oid_string);
}
g_free(enterprise);