php-doc-en/reference/snmp/functions/snmp-set-enum-print.xml
Christoph Michael Becker 2f493dfdc2 Remove obsolete info from SNMP book
UCD SNMP is long gone, and we're requiring at least NET-SNMP nowadays.  We also
remove obsolete PHP 5 related info.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@352251 c90b9560-bf6c-de11-be94-00142212c4b1
2020-12-28 17:42:40 +00:00

82 lines
2.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.snmp-set-enum-print" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>snmp_set_enum_print</refname>
<refpurpose>
Return all values that are enums with their enum value instead of the raw integer
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>snmp_set_enum_print</methodname>
<methodparam><type>bool</type><parameter>enable</parameter></methodparam>
</methodsynopsis>
<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>enable</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>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->