|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesext-snmp-output-extensions (last revision 2011-01-27 23:19 UTC by mloftis at wgops dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-01-31 12:53 UTC] lytboris@php.net
-Status: Open
+Status: Feedback
[2011-01-31 12:53 UTC] lytboris@php.net
[2011-01-31 12:54 UTC] lytboris@php.net
-Assigned To:
+Assigned To: lytboris
[2012-02-25 09:43 UTC] lytboris@php.net
-Status: Feedback
+Status: No Feedback
[2012-02-25 09:43 UTC] lytboris@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 13 08:00:02 2025 UTC |
Description: ------------ snmp_set_oid_output_format only allows using the FULL (SNMP_OID_OUTPUT_FULL) or NUMERIC (SNMP_OID_OUTPUT_NUMERIC) setting types, neither of which is the default. It also has no corresponding _get_ function call to query/store and return the setting back to "whatever it was before I touched it" I've attached a patch which does both (from the 5.3 branch), extends the existing function to include the available types in UCD Net-SNMP as of 5.4 (not verified/checked against older ones, have not verified that setting to _NONE will not cause crashes). Test script: --------------- $rvDefault = snmp2_get('127.0.0.1','public','.1.3.6.1.2.1.1.2.0'); snmp_set_oid_output_format(SNMP_OID_OUTPUT_FULL); $rvFull = snmp2_get('127.0.0.1','public','.1.3.6.1.2.1.1.2.0'); snmp_set_oid_output_format(SNMP_OID_OUTPUT_NUMERIC); $rvNumeric = snmp2_get('127.0.0.1','public','.1.3.6.1.2.1.1.2.0'); echo $rvDefault."\n"; echo $rvFull."\n"; echo $rvNumeric."\n"; Expected result: ---------------- Setting either SNMP_OID_OUTPUT_FULL or SNMP_OID_OUTPUT_NUMERIC would return the library to it's default. Expect there to be an snmp_get_oid_output_format call as well to query the current setting. Actual result: -------------- Neither of the available snmp_set_oid_output_format constants can return the library to it's default settings. No ability to query the library for the current setting.