svn: /phpdoc/en/trunk/reference/snmp/functions/ snmp-read-mib.xml snmp-set-enum-print.xml snmp-set-oid-numeric-print.xml
| From: | Christian Hammers | Date: | Wed, 02 Mar 2011 23:25:52 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/snmp/functions/ snmp-read-mib.xml snmp-set-enum-print.xml snmp-set-oid-numeric-print.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-7826@lists.php.net to get a copy of this message | ||
ch Wed, 02 Mar 2011 23:25:52 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=308876
Log:
Added documentation to undocumented functions.
Changed paths:
U phpdoc/en/trunk/reference/snmp/functions/snmp-read-mib.xml
U phpdoc/en/trunk/reference/snmp/functions/snmp-set-enum-print.xml
U phpdoc/en/trunk/reference/snmp/functions/snmp-set-oid-numeric-print.xml
Modified: phpdoc/en/trunk/reference/snmp/functions/snmp-read-mib.xml
===================================================================
--- phpdoc/en/trunk/reference/snmp/functions/snmp-read-mib.xml 2011-03-02 22:12:02 UTC (rev 308875)
+++ phpdoc/en/trunk/reference/snmp/functions/snmp-read-mib.xml 2011-03-02 23:25:52 UTC (rev 308876)
@@ -13,10 +13,63 @@
<type>bool</type><methodname>snmp_read_mib</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
</methodsynopsis>
-
- &warn.undocumented.func;
-
+
+ <para>
+ This function is used to load additional, e.g. vendor specific, MIBs so that
+ human readable OIDs like VENDOR-MIB::foo.1 instead of error prone numeric OIDs
+ can be used.
+ </para>
+ <para>
+ The order in which the MIBs are loaded does matter as the underlying Net-SNMP
+ libary will print warnings if referenced objects cannot be resolved.
+ </para>
+
</refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>filename</parameter></term>
+ <listitem><para>The filename of the
<acronym>MIB</acronym>.</para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title>Using <function>snmp_read_mib</function></title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+ print_r( snmprealwalk('localhost', 'public', '.1.3.6.1.2.1.2.3.4.5')
);
+
+ snmp_read_mib('./FOO-BAR-MIB.txt');
+ print_r( snmprealwalk('localhost', 'public',
'FOO-BAR-MIB::someTable' );
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ The above example is made up but the results would look like:
+<![CDATA[
+Array
+(
+ [iso.3.6.1.2.1.2.3.4.5.0] => Gauge32: 6
+)
+Array
+(
+ [FOO-BAR-MIB::someTable.0] => Gauge32: 6
+)
+]]>
+ </para>
+ </refsect1>
+
</refentry>
<!-- Keep this comment at the end of the file
Modified: phpdoc/en/trunk/reference/snmp/functions/snmp-set-enum-print.xml
===================================================================
--- phpdoc/en/trunk/reference/snmp/functions/snmp-set-enum-print.xml 2011-03-02 22:12:02 UTC (rev
308875)
+++ phpdoc/en/trunk/reference/snmp/functions/snmp-set-enum-print.xml 2011-03-02 23:25:52 UTC (rev
308876)
@@ -13,11 +13,52 @@
<type>bool</type><methodname>snmp_set_enum_print</methodname>
<methodparam><type>int</type><parameter>enum_print</parameter></methodparam>
</methodsynopsis>
-
- &warn.undocumented.func;
-
+ <para>
+ This function toggles if snmpwalk/snmpget etc. should automatically lookup enum values
+ in the MIB and return them together with their human readable string.
+ </para>
</refsect1>
-
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <variablelist>
+ <varlistentry>
+ <term><parameter>enum_print</parameter></term>
+ <listitem>
+ <para>
+ As the value is interpreted as boolean by the Net-SNMP library, it can only be "0"
or "1".
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title>Using <function>snmp_set_enum_print</function></title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+ snmp_set_enum_print(0);
+ echo snmpget('localhost', 'public', 'IF-MIB::ifOperStatus.3') .
"\n";
+ snmp_set_enum_print(1);
+ echo snmpget('localhost', 'public', 'IF-MIB::ifOperStatus.3') .
"\n";
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ The above would return
+<![CDATA[
+ INTEGER: up(1)
+ INTEGER: 1
+]]>
+ </para>
+ </refsect1>
+
<refsect1 role="notes">
&reftitle.notes;
<note>
@@ -28,7 +69,7 @@
</para>
</note>
</refsect1>
-
+
</refentry>
<!-- Keep this comment at the end of the file
Modified: phpdoc/en/trunk/reference/snmp/functions/snmp-set-oid-numeric-print.xml
===================================================================
--- phpdoc/en/trunk/reference/snmp/functions/snmp-set-oid-numeric-print.xml 2011-03-02 22:12:02 UTC
(rev 308875)
+++ phpdoc/en/trunk/reference/snmp/functions/snmp-set-oid-numeric-print.xml 2011-03-02 23:25:52 UTC
(rev 308876)
@@ -11,11 +11,12 @@
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>snmp_set_oid_numeric_print</methodname>
-
<methodparam><type>int</type><parameter>oid_numeric_print</parameter></methodparam>
+
<methodparam><type>int</type><parameter>oid_format</parameter></methodparam>
</methodsynopsis>
-
- &warn.undocumented.func;
-
+
+ <para>
+ &info.function.alias; <function>snmp_set_oid_output_format</function>.
+ </para>
</refsect1>
<refsect1 role="changelog">
@@ -33,7 +34,7 @@
<row>
<entry>5.2.0</entry>
<entry>
- Since PHP 5.2.0, &info.function.alias;
<function>snmp_set_oid_output_format</function>.
+ Since PHP 5.2.0.
</entry>
</row>
</tbody>
@@ -50,7 +51,7 @@
</simplelist>
</para>
</refsect1>
-
+
</refentry>
<!-- Keep this comment at the end of the file