diff options
| author | foobar <sniper@php.net> | 2002-10-16 00:58:15 +0000 |
|---|---|---|
| committer | foobar <sniper@php.net> | 2002-10-16 00:58:15 +0000 |
| commit | e99b3cdff29681ec735540d1fd26c5640a95ebf6 (patch) | |
| tree | 550bbaf0ee481548663c57030bd4c9819b689e83 | |
| parent | 3c863a6da1ff22ea87600403e94c1f012b1a55d4 (diff) | |
| download | php-git-e99b3cdff29681ec735540d1fd26c5640a95ebf6.tar.gz | |
Some more compatibility fixes for net-snmp vs ucd-snmp
| -rw-r--r-- | ext/snmp/snmp.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 55e00af3d6..c03ca90373 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -276,9 +276,11 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) session.community_len = Z_STRLEN_PP(a2); session.retries = retries; session.timeout = timeout; - session.authenticator = NULL; + +#ifndef HAVE_NET_SNMP snmp_synch_setup(&session); +#endif if ((ss = snmp_open(&session)) == NULL) { php_error(E_WARNING,"Could not open snmp\n"); @@ -446,7 +448,11 @@ PHP_FUNCTION(snmp_get_quick_print) WRONG_PARAM_COUNT; } - RETURN_LONG(snmp_get_quick_print() ? 1 : 0); +#ifdef HAVE_NET_SNMP + RETURN_BOOL(netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)); +#else + RETURN_BOOL(snmp_get_quick_print()); +#endif } /* }}} */ @@ -461,7 +467,11 @@ PHP_FUNCTION(snmp_set_quick_print) return; } +#ifdef HAVE_NET_SNMP + netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT, (int) a1); +#else snmp_set_quick_print((int)a1); +#endif } /* }}} */ |
