Skip to content

Commit 99abcff

Browse files
committed
Add snmp_init_mib function to allow MIB tree to be reset using environment variables
1 parent a5ffcf3 commit 99abcff

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

ext/snmp/snmp.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,6 +1637,14 @@ PHP_FUNCTION(snmp_read_mib)
16371637
}
16381638
/* }}} */
16391639

1640+
/* {{{ Resets the MIB tree using the MIBDIRS, MIBS and MIBFILES environment variables. */
1641+
PHP_FUNCTION(snmp_init_mib)
1642+
{
1643+
shutdown_mib();
1644+
init_mib();
1645+
}
1646+
/* }}} */
1647+
16401648
/* {{{ Creates a new SNMP session to specified host. */
16411649
PHP_METHOD(SNMP, __construct)
16421650
{

ext/snmp/snmp.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ function snmp_get_valueretrieval(): int {}
181181

182182
function snmp_read_mib(string $filename): bool {}
183183

184+
function snmp_init_mib(): void {}
185+
184186
class SNMP
185187
{
186188
/** @cvalue SNMP_VERSION_1 */

ext/snmp/snmp_arginfo.h

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)