summaryrefslogtreecommitdiff
path: root/ext/snmp
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:38:07 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:38:07 -0400
commitbb01389fbd53ec1cbcb80d0681a37cca1267891a (patch)
tree4783178fca65a5d9071c8df34f2ddc3d31728673 /ext/snmp
parenteddbbea4325e602ddc87c545531609132d4f0e3b (diff)
downloadphp-bb01389fbd53ec1cbcb80d0681a37cca1267891a.tar.gz
Imported Upstream version 5.2.4upstream/5.2.4
Diffstat (limited to 'ext/snmp')
-rw-r--r--ext/snmp/config.m426
-rw-r--r--ext/snmp/snmp.c8
2 files changed, 14 insertions, 20 deletions
diff --git a/ext/snmp/config.m4 b/ext/snmp/config.m4
index f42541d63..bc51ce218 100644
--- a/ext/snmp/config.m4
+++ b/ext/snmp/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.32.2.1 2005/11/29 18:26:00 tony2001 Exp $
+dnl $Id: config.m4,v 1.32.2.1.2.3 2007/07/31 13:02:00 jani Exp $
dnl
PHP_ARG_WITH(snmp,for SNMP support,
@@ -8,6 +8,9 @@ PHP_ARG_WITH(snmp,for SNMP support,
PHP_ARG_WITH(openssl-dir,OpenSSL dir for SNMP,
[ --with-openssl-dir[=DIR] SNMP: openssl install prefix], no, no)
+PHP_ARG_ENABLE(ucd-snmp-hack, whether to enable UCD SNMP hack,
+[ --enable-ucd-snmp-hack SNMP: Enable UCD SNMP hack], no, no)
+
if test "$PHP_SNMP" != "no"; then
dnl
@@ -45,8 +48,8 @@ if test "$PHP_SNMP" != "no"; then
test -f $i/snmp/snmp.h && SNMP_INCDIR=$i/snmp
test -f $i/snmp/include/ucd-snmp/snmp.h && SNMP_INCDIR=$i/snmp/include/ucd-snmp
done
- for i in /usr /usr/snmp /usr/local /usr/local/snmp; do
- test -f $i/lib/libsnmp.a || test -f $i/lib/libsnmp.$SHLIB_SUFFIX_NAME && SNMP_LIBDIR=$i/lib
+ for i in /usr/$PHP_LIBDIR /usr/snmp/lib /usr/local/$PHP_LIBDIR /usr/local/lib /usr/local/snmp/lib; do
+ test -f $i/libsnmp.a || test -f $i/libsnmp.$SHLIB_SUFFIX_NAME && SNMP_LIBDIR=$i
done
else
SNMP_INCDIR=$PHP_SNMP/include
@@ -119,19 +122,10 @@ if test "$PHP_SNMP" != "no"; then
$SNMP_SHARED_LIBADD
])
+ if test "$PHP_UCD_SNMP_HACK" = "yes" ; then
+ AC_DEFINE(UCD_SNMP_HACK, 1, [ ])
+ fi
+
PHP_NEW_EXTENSION(snmp, snmp.c, $ext_shared)
PHP_SUBST(SNMP_SHARED_LIBADD)
fi
-
-AC_MSG_CHECKING(whether to enable UCD SNMP hack)
-AC_ARG_ENABLE(ucd-snmp-hack,
-[ --enable-ucd-snmp-hack SNMP: Enable UCD SNMP hack],[
- if test "$enableval" = "yes" ; then
- AC_DEFINE(UCD_SNMP_HACK, 1, [ ])
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- fi
-],[
- AC_MSG_RESULT(no)
-])
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index e7ccfae48..302f009ab 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: snmp.c,v 1.106.2.2.2.4 2007/01/01 09:36:06 sebastian Exp $ */
+/* $Id: snmp.c,v 1.106.2.2.2.5 2007/07/09 13:42:05 jani Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -184,7 +184,7 @@ ZEND_GET_MODULE(snmp)
*/
static PHP_GINIT_FUNCTION(snmp)
{
- snmp_globals->valueretrieval = 0;
+ snmp_globals->valueretrieval = SNMP_VALUE_LIBRARY;
}
/* }}} */
@@ -262,7 +262,7 @@ static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_D
buf[0] = 0;
- if (SNMP_G(valueretrieval) == 0) {
+ if (SNMP_G(valueretrieval) == SNMP_VALUE_LIBRARY) {
#ifdef HAVE_NET_SNMP
snprint_value(buf, sizeof(buf), vars->name, vars->name_length, vars);
#else
@@ -332,7 +332,7 @@ static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_D
break;
}
- if (SNMP_G(valueretrieval) == 1) {
+ if (SNMP_G(valueretrieval) == SNMP_VALUE_PLAIN) {
*snmpval = *val;
zval_copy_ctor(snmpval);
} else {