CVS update: php4/ext/snmp
| From: | sas | Date: | Sun, 27 Jun 1999 21:45:06 +0000 |
| Subject: | CVS update: php4/ext/snmp | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-1701@lists.php.net to get a copy of this message | ||
Date: Sunday June 27, 1999 @ 17:45
Author: sas
Update of /repository/php4/ext/snmp
In directory php:/tmp/cvs-serv2672/ext/snmp
Modified Files:
config.h.stub config.m4 snmp.c
Log Message:
more porting
Index: php4/ext/snmp/config.h.stub
diff -u php4/ext/snmp/config.h.stub:1.1 php4/ext/snmp/config.h.stub:1.2
--- php4/ext/snmp/config.h.stub:1.1 Wed Apr 21 22:48:24 1999
+++ php4/ext/snmp/config.h.stub Sun Jun 27 17:45:06 1999
@@ -1,2 +1,4 @@
/* Define if you want the SNMP interface */
#define HAVE_SNMP 0
+
+#undef UCD_SNMP_HACK
Index: php4/ext/snmp/config.m4
diff -u php4/ext/snmp/config.m4:1.3 php4/ext/snmp/config.m4:1.4
--- php4/ext/snmp/config.m4:1.3 Sun Jun 20 14:52:46 1999
+++ php4/ext/snmp/config.m4 Sun Jun 27 17:45:06 1999
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.3 1999/06/20 18:52:46 sas Exp $
+dnl $Id: config.m4,v 1.4 1999/06/27 21:45:06 sas Exp $
AC_MSG_CHECKING(for SNMP support)
AC_ARG_WITH(snmp,
@@ -23,6 +23,20 @@
PHP_EXTENSION(snmp)
AC_ADD_LIBRARY_WITH_PATH(snmp, $SNMP_LIBDIR)
AC_ADD_INCLUDE($SNMP_INCDIR)
+ AC_CHECK_LIB(kstat, kstat_read, [AC_ADD_LIBRARY(kstat)])
+ else
+ AC_MSG_RESULT(no)
+ fi
+],[
+ AC_MSG_RESULT(no)
+])
+
+AC_MSG_CHECKING(whether to enable UCD SNMP hack)
+AC_ARG_ENABLE(ucd-snmp-hack,
+[ --enable-ucd-snmp-hack 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
Index: php4/ext/snmp/snmp.c
diff -u php4/ext/snmp/snmp.c:1.3 php4/ext/snmp/snmp.c:1.4
--- php4/ext/snmp/snmp.c:1.3 Fri May 21 06:06:18 1999
+++ php4/ext/snmp/snmp.c Sun Jun 27 17:45:06 1999
@@ -26,7 +26,7 @@
| Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
-/* $Id: snmp.c,v 1.3 1999/05/21 10:06:18 sas Exp $ */
+/* $Id: snmp.c,v 1.4 1999/06/27 21:45:06 sas Exp $ */
#include "php.h"
#if defined(COMPILE_DL)
@@ -175,7 +175,11 @@
* in (at least) ucd-snmp 3.6.1 which frees
* memory it did not allocate
*/
+#ifdef UCD_SNMP_HACK
session.community = (u_char *) strdup(a2->value.str.val);
+#else
+ session.community = (u_char *) a2->value.str.val;
+#endif
session.community_len = a2->value.str.len;
session.retries = retries;
session.timeout = timeout;