Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 5780

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Return all values that are enums with their enum value instead of the raw integer</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.snmp-read-mib.html">snmp_read_mib</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.snmp-set-oid-numeric-print.html">snmp_set_oid_numeric_print</a></div>
 <div class="up"><a href="ref.snmp.html">SNMP Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.snmp-set-enum-print" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">snmp_set_enum_print</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5)</p><p class="refpurpose"><span class="refname">snmp_set_enum_print</span> &mdash; <span class="dc-title">
   Return all values that are enums with their enum value instead of the raw integer
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.snmp-set-enum-print-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>snmp_set_enum_print</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$enum_print</code></span>
   )</div>

  <p class="para rdfs-comment">
   This function toggles if snmpwalk/snmpget etc. should automatically lookup enum values
   in the MIB and return them together with their human readable string. 
  </p>
 </div>

 
 <div class="refsect1 parameters" id="refsect1-function.snmp-set-enum-print-parameters">
  <h3 class="title">Parameters</h3>
  <dl>

   <dt>

    <span class="term"><em><code class="parameter">enum_print</code></em></span>
    <dd>

     <p class="para">
      As the value is interpreted as boolean by the Net-SNMP library, it can only be &quot;0&quot; or &quot;1&quot;.
     </p>
    </dd>

   </dt>

  </dl>

 </div>

   
 <div class="refsect1 examples" id="refsect1-function.snmp-set-enum-print-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-4550">
    <p><strong>Example #1 Using  <span class="function"><strong>snmp_set_enum_print()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />&nbsp;snmp_set_enum_print</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">);<br />&nbsp;echo&nbsp;</span><span style="color: #0000BB">snmpget</span><span style="color: #007700">(</span><span style="color: #DD0000">'localhost'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'public'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'IF-MIB::ifOperStatus.3'</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />&nbsp;</span><span style="color: #0000BB">snmp_set_enum_print</span><span style="color: #007700">(</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br />&nbsp;echo&nbsp;</span><span style="color: #0000BB">snmpget</span><span style="color: #007700">(</span><span style="color: #DD0000">'localhost'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'public'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'IF-MIB::ifOperStatus.3'</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
  <p class="para">
   The above  would return
<div class="cdata"><pre>      
 INTEGER: up(1)
 INTEGER: 1
</pre></div>
  </p>
 </div>

 
 <div class="refsect1 notes" id="refsect1-function.snmp-set-enum-print-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
     <span class="function"><strong>snmp_set_enum_print()</strong></span> is only available when using
    the UCD SNMP library.  This function is not available when using the
    Windows SNMP library.
   </p>
  </p></blockquote>
 </div>

 
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.snmp-read-mib.html">snmp_read_mib</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.snmp-set-oid-numeric-print.html">snmp_set_oid_numeric_print</a></div>
 <div class="up"><a href="ref.snmp.html">SNMP Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>