aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--acconfig.h4
-rw-r--r--configure.in12
-rw-r--r--packet-snmp.c18
3 files changed, 31 insertions, 3 deletions
diff --git a/acconfig.h b/acconfig.h
index b7eed15861..7a42813ac0 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -1,7 +1,7 @@
/* acconfig.h
* #ifdefs to be controlled by "configure"
*
- * $Id: acconfig.h,v 1.20 2001/07/27 07:10:09 guy Exp $
+ * $Id: acconfig.h,v 1.21 2001/12/12 05:26:53 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.org>
@@ -43,3 +43,5 @@
#undef HAVE_PCAP_VERSION
#undef PLUGIN_DIR
+
+#undef RED_HAT_MODIFIED_UCD_SNMP
diff --git a/configure.in b/configure.in
index b292481b2c..8f2b49e76f 100644
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.141 2001/12/07 22:56:56 guy Exp $
+# $Id: configure.in,v 1.142 2001/12/12 05:26:53 gerald Exp $
dnl
dnl Process this file with autoconf 2.13 or later to produce a
dnl configure script; 2.12 doesn't generate a "configure" script that
@@ -494,6 +494,16 @@ else
"$ac_cv_header_snmp_snmp_h" = yes ; then
AC_MSG_ERROR([Both UCD and CMU SNMP libraries found - uninstall one of them.])
fi
+
+ #
+ # Look for the string 'sbuf' in ucd-snmp/mib.h. If found, assume
+ # we've encountered a Red Hat-modified version of UCD SNMP.
+ #
+ # XXX - Check for 'binit()' in parse.h
+ #
+ AC_EGREP_HEADER(sprint_objid.*sbuf, ucd-snmp/mib.h,
+ AC_DEFINE(RED_HAT_MODIFIED_UCD_SNMP))
+
#
# This may require "-lkstat" on Solaris, sigh.
diff --git a/packet-snmp.c b/packet-snmp.c
index f5d9503888..eacf5b67fe 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.76 2001/12/10 00:25:36 guy Exp $
+ * $Id: packet-snmp.c,v 1.77 2001/12/12 05:26:53 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -121,6 +121,12 @@
# define VALTYPE_OBJECTID ASN_OBJECT_ID
# define VALTYPE_BITSTR ASN_BIT_STR
# define VALTYPE_COUNTER64 ASN_COUNTER64
+
+# ifdef RED_HAT_MODIFIED_UCD_SNMP
+# include <ucd-snmp/parse.h>
+# endif
+
+
# elif defined(HAVE_SNMP_SNMP_H)
/*
* CMU SNMP.
@@ -695,7 +701,12 @@ format_var(struct variable_list *variable, subid_t *variable_oid,
}
variable->val_len = vb_length;
+# ifdef RED_HAT_MODIFIED_UCD_SNMP
+ sprint_value(binit(NULL, buf, sizeof(buf)), variable_oid,
+ variable_oid_length, variable);
+# else
sprint_value(buf, variable_oid, variable_oid_length, variable);
+# endif
return buf;
}
#endif
@@ -1240,8 +1251,13 @@ dissect_common_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
variable_oid_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)),
+ variable_oid, variable_oid_length);
+# else
sprint_objid(vb_oid_string, variable_oid,
variable_oid_length);
+# endif
proto_tree_add_text(tree, tvb, offset, sequence_length,
"Object identifier %d: %s (%s)", vb_index,
oid_string, vb_oid_string);