Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ext/snmp/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ if test "$PHP_SNMP" != "no"; then
[AC_MSG_FAILURE([SNMP sanity check failed.])],
[$SNMP_SHARED_LIBADD])

dnl Check whether netsnmp_init_mib() exists.
PHP_CHECK_LIBRARY([$SNMP_LIBNAME], [netsnmp_init_mib],
[AC_DEFINE([HAVE_NETSNMP_INIT_MIB], [1],
[Define to 1 if the Net-SNMP library has the 'netsnmp_init_mib' function.])],
[],
[$SNMP_SHARED_LIBADD])

dnl Check whether shutdown_snmp_logging() exists.
PHP_CHECK_LIBRARY([$SNMP_LIBNAME], [shutdown_snmp_logging],
[AC_DEFINE([HAVE_SHUTDOWN_SNMP_LOGGING], [1],
Expand Down
8 changes: 8 additions & 0 deletions ext/snmp/snmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,11 @@ PHP_FUNCTION(snmp_init_mib)

shutdown_mib();
netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIBDIRS, ZSTR_VAL(mibdirs));
#ifdef HAVE_NETSNMP_INIT_MIB
netsnmp_init_mib();
#else
init_mib();
#endif
}
/* }}} */

Expand Down Expand Up @@ -2228,7 +2232,11 @@ static PHP_RSHUTDOWN_FUNCTION(snmp)
if (mib_needs_reset) {
shutdown_mib();
netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIBDIRS, NULL);
#ifdef HAVE_NETSNMP_INIT_MIB
netsnmp_init_mib();
#else
init_mib();
#endif
}

return SUCCESS;
Expand Down
Loading