svn: /phpdoc/en/trunk/reference/snmp/functions/ snmp-set-oid-output-format.xml
| From: | Christian Hammers | Date: | Mon, 21 Feb 2011 23:51:50 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/snmp/functions/ snmp-set-oid-output-format.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-7803@lists.php.net to get a copy of this message | ||
ch Mon, 21 Feb 2011 23:51:50 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=308551
Log:
Added examples and further constants.
Changed paths:
U phpdoc/en/trunk/reference/snmp/functions/snmp-set-oid-output-format.xml
Modified: phpdoc/en/trunk/reference/snmp/functions/snmp-set-oid-output-format.xml
===================================================================
--- phpdoc/en/trunk/reference/snmp/functions/snmp-set-oid-output-format.xml 2011-02-21 23:05:12 UTC
(rev 308550)
+++ phpdoc/en/trunk/reference/snmp/functions/snmp-set-oid-output-format.xml 2011-02-21 23:51:50 UTC
(rev 308551)
@@ -11,14 +11,14 @@
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>snmp_set_oid_output_format</methodname>
-
<methodparam><type>int</type><parameter>oid_format</parameter></methodparam>
+
<methodparam><type>int</type><parameter>oid_format</parameter><initializer>SNMP_OID_OUTPUT_MODULE</initializer></methodparam>
</methodsynopsis>
<para>
<function>snmp_set_oid_output_format</function> sets the output format
to be full or numeric.
</para>
</refsect1>
-
+
<refsect1 role="parameters">
&reftitle.parameters;
<para>
@@ -26,23 +26,35 @@
<varlistentry>
<term><parameter>oid_format</parameter></term>
<listitem>
+ <table>
+ <title>constants</title>
+ <tgroup cols="2">
+ <tbody>
+ <row><entry>SNMP_OID_OUTPUT_FULL</entry><entry>The complete form
like "iso.org.dod...."</entry></row>
+ <row><entry>SNMP_OID_OUTPUT_NUMERIC</entry><entry>The numeric form
like ".1.3.6.1.4.1.8072.3.2.10"</entry> </row>
+ <row><entry>SNMP_OID_OUTPUT_MODULE</entry><entry>The short form
like "NET-SNMP-TC::linux"</entry></row>
+
<row><entry>SNMP_OID_OUTPUT_SUFFIX</entry><entry></entry></row>
+
<row><entry>SNMP_OID_OUTPUT_UCD</entry><entry></entry></row>
+
<row><entry>SNMP_OID_OUTPUT_NONE</entry><entry></entry></row>
+ </tbody>
+ </tgroup>
+ </table>
<para>
- Set it to <constant>SNMP_OID_OUTPUT_FULL</constant> if you want a full
- output, <constant>SNMP_OID_OUTPUT_NUMERIC</constant> otherwise.
+ The last four constants are expected to be added in PHP 5.3.6 as of bug #53862.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
-
+
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
-
+
<refsect1 role="notes">
&reftitle.notes;
<note>
@@ -54,6 +66,51 @@
</note>
</refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title>Using <function>snmprealwalk</function></title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+ snmp_read_mib("/usr/share/mibs/netsnmp/NET-SNMP-TC");
+
+ // default or SNMP_OID_OUTPUT_MODULE in PHP >= 5.3.6
+ print_r( snmprealwalk('localhost', 'public',
'RFC1213-MIB::sysObjectID') );
+
+ snmp_set_oid_output_format(SNMP_OID_OUTPUT_NUMERIC);
+ print_r( snmprealwalk('localhost', 'public',
'RFC1213-MIB::sysObjectID') );
+
+ snmp_set_oid_output_format(SNMP_OID_OUTPUT_FULL);
+ print_r( snmprealwalk('localhost', 'public',
'RFC1213-MIB::sysObjectID') );
+?>
+]]>
+ </programlisting>
+
+ <para>
+ The above would output:
+<![CDATA[
+ Array
+ (
+ [RFC1213-MIB::sysObjectID.0] => OID: NET-SNMP-TC::linux
+ )
+ Array
+ (
+ [.1.3.6.1.2.1.1.2.0] => OID: .1.3.6.1.4.1.8072.3.2.10
+ )
+ Array
+ (
+ [.iso.org.dod.internet.mgmt.mib-2.system.sysObjectID.0] => OID:
.iso.org.dod.internet.private.enterprises.netSnmp.netSnmpEnumerations.netSnmpAgentOIDs.linux
+ )
+]]>
+ </para>
+ </example>
+ </para>
+ </refsect1>
+
+
</refentry>
<!-- Keep this comment at the end of the file
@@ -76,3 +133,4 @@
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
+