Skip to content
Draft
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
11 changes: 11 additions & 0 deletions ext/snmp/snmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1637,6 +1637,17 @@ PHP_FUNCTION(snmp_read_mib)
}
/* }}} */

/* {{{ Resets the MIB tree using the MIBDIRS, MIBS and MIBFILES environment variables. */
PHP_FUNCTION(snmp_init_mib)
{
// Destroy the old MIB tree and set the internal MIB directory list to NULL
shutdown_mib();
netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIBDIRS, NULL);
// Initialise the new MIB tree
init_mib();
}
/* }}} */

/* {{{ Creates a new SNMP session to specified host. */
PHP_METHOD(SNMP, __construct)
{
Expand Down
2 changes: 2 additions & 0 deletions ext/snmp/snmp.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ function snmp_get_valueretrieval(): int {}

function snmp_read_mib(string $filename): bool {}

function snmp_init_mib(): void {}

class SNMP
{
/** @cvalue SNMP_VERSION_1 */
Expand Down
7 changes: 6 additions & 1 deletion ext/snmp/snmp_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading