aboutsummaryrefslogtreecommitdiffstats
path: root/packet-snmp.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-02-19 09:35:45 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-02-19 09:35:45 +0000
commitfc5f71168da3deef2759f9065160d0c3059edc55 (patch)
tree0c80e08d1166b692e574890d5db465f699ba9ff1 /packet-snmp.c
parent5bfea9c992212cf0bb56fead3a9fc2414309fefb (diff)
From Andrew Hood: translate enterprise OIDs in SNMP traps to strings if
possible. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4758 f5534014-38df-0310-8fa8-9805f1628bb7
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);