[RFC] SNMP MIB reset function

From: Date: Mon, 16 Mar 2026 05:03:51 +0000
Subject: [RFC] SNMP MIB reset function
Groups: php.internals 
Request: Send a blank email to internals+get-130362@lists.php.net to get a copy of this message
Hi All,   I would like to create an RFC proposal to add a new function snmp_init_mib() that will shut down and then re-initialise the MIB tree within the lib-snmp library.  This allows the PHP code to define the SNMP environment variables, and then initialise the MIB tree without importing any MIBs from the global config into the MIB tree. Another consideration is that the MIB tree persists across FPM requests because the MIB tree is kept as a global structure within SNMP library memory.  This proposal would allow the MIB to be reset within a request if needed. Something like this function is required if you want to run multiple SNMP queries for different MIBs that define the same OIDs differently.  I have come across a few vendor MIB files where this happens, and the php snmp module cannot work without the ability to reset the MIB tree, or without forking an external process for these specific MIBs. I believe that the process is to send a message to the list, and gauge whether there is positive feedback before creating the RFC for voting.  Please let me know if I should create the RFC first? The PR is here: https://github.com/php/php-src/pull/21452/changes regards Steve

« previous php.internals (#130362) next »