<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 329325 $ -->

<phpdoc:classref xml:id="class.snmp"
 xmlns:phpdoc="http://php.net/ns/phpdoc"
 xmlns:xlink="http://www.w3.org/1999/xlink"
 xmlns:xi="http://www.w3.org/2001/XInclude"
 xmlns="http://docbook.org/ns/docbook">
 <title>The SNMP class</title>
 <titleabbrev>SNMP</titleabbrev>
 
 <partintro>
 
<!-- {{{ SNMP intro -->
  <section xml:id="snmp.intro">
   &reftitle.intro;
   <para>
    Represents <acronym>SNMP</acronym> session.
   </para>
  </section>
<!-- }}} -->
 
  <section xml:id="snmp.synopsis">
   &reftitle.classsynopsis;
 
<!-- {{{ Synopsis -->
   <classsynopsis>
    <ooclass><classname>SNMP</classname></ooclass>
 
<!-- {{{ Class synopsis -->
    <classsynopsisinfo>
     <ooclass>
      <classname>SNMP</classname>
     </ooclass>
    </classsynopsisinfo>
<!-- }}} -->
 
    <classsynopsisinfo role="comment">&Properties;</classsynopsisinfo>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type>int</type>
     <varname linkend="snmp.props.max-oids">max_oids</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type>int</type>
     <varname linkend="snmp.props.valueretrieval">valueretrieval</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type>bool</type>
     <varname linkend="snmp.props.quick-print">quick_print</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type>bool</type>
     <varname linkend="snmp.props.enum-print">enum_print</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type>int</type>
     <varname linkend="snmp.props.oid-output-format">oid_output_format</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type>bool</type>
     <varname linkend="snmp.props.oid-increasing-check">oid_increasing_check</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type>int</type>
     <varname linkend="snmp.props.exceptions-enabled">exceptions_enabled</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type>array</type>
     <varname linkend="snmp.props.info">info</varname>
    </fieldsynopsis>
 
    <classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.snmp')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[not(@role='procedural')])">
     <xi:fallback />
    </xi:include>
    <!--
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.snmp')/db:refentry/db:refsect1[@role='description']/descendant::db:destructorsynopsis[not(@role='procedural')])">
     <xi:fallback />
    </xi:include>
    -->
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.snmp')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[not(@role='procedural')])">
     <xi:fallback />
    </xi:include>

    <classsynopsisinfo role="comment">&Constants;</classsynopsisinfo>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>integer</type>
     <varname linkend="snmp.class.constants.errno-noerror">SNMP::ERRNO_NOERROR</varname>
     <initializer>0</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>integer</type>
     <varname linkend="snmp.class.constants.errno-generic">SNMP::ERRNO_GENERIC</varname>
     <initializer>2</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>integer</type>
     <varname linkend="snmp.class.constants.errno-timeout">SNMP::ERRNO_TIMEOUT</varname>
     <initializer>4</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>integer</type>
     <varname linkend="snmp.class.constants.errno-error-in-reply">SNMP::ERRNO_ERROR_IN_REPLY</varname>
     <initializer>8</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>integer</type>
     <varname linkend="snmp.class.constants.errno-oid-not-increasing">SNMP::ERRNO_OID_NOT_INCREASING</varname>
     <initializer>16</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>integer</type>
     <varname linkend="snmp.class.constants.errno-oid-parsing-error">SNMP::ERRNO_OID_PARSING_ERROR</varname>
     <initializer>32</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>integer</type>
     <varname linkend="snmp.class.constants.errno-multiple-set-queries">SNMP::ERRNO_MULTIPLE_SET_QUERIES</varname>
     <initializer>64</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>integer</type>
     <varname linkend="snmp.class.constants.errno-multiple-set-queries">SNMP::ERRNO_ANY</varname>
     <initializer>126</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>integer</type>
     <varname linkend="snmp.class.constants.version-1">SNMP::VERSION_1</varname>
     <initializer>0</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>integer</type>
     <varname linkend="snmp.class.constants.version-2c">SNMP::VERSION_2C</varname>
     <initializer>1</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>integer</type>
     <varname linkend="snmp.class.constants.version-2c">SNMP::VERSION_2c</varname>
     <initializer>1</initializer>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>const</modifier>
     <type>integer</type>
     <varname linkend="snmp.class.constants.version-3">SNMP::VERSION_3</varname>
     <initializer>3</initializer>
    </fieldsynopsis>

<!-- }}} -->

    </classsynopsis>
 
  </section>
 
<!-- {{{ SNMP properties -->
  <section xml:id="snmp.props">
   &reftitle.properties;
   <variablelist>
    <varlistentry xml:id="snmp.props.max-oids">
     <term><varname>max_oids</varname></term>
     <listitem>
      <para>Maximum OID per GET/SET/GETBULK request</para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="snmp.props.valueretrieval">
     <term><varname>valueretrieval</varname></term>
     <listitem>
      <para>Controls the method how the SNMP values will be returned</para>
      <table>
       <title></title>
       <tgroup cols="2">
        <tbody>
         <row><entry><constant>SNMP_VALUE_LIBRARY</constant></entry><entry>The return values will be as returned by the Net-SNMP library.</entry></row>
         <row><entry><constant>SNMP_VALUE_PLAIN</constant></entry><entry>The return values will be the plain value without the SNMP type hint.</entry></row>
         <row>
          <entry><constant>SNMP_VALUE_OBJECT</constant></entry><entry>
           The return values will be objects with the properties "value" and "type", where the latter
           is one of the SNMP_OCTET_STR, SNMP_COUNTER etc. constants. The
           way "value" is returned is based on which one of <constant>SNMP_VALUE_LIBRARY</constant>,
           <constant>SNMP_VALUE_PLAIN</constant> is set
          </entry>
         </row>
        </tbody>
       </tgroup>
      </table>

     </listitem>
    </varlistentry>
    <varlistentry xml:id="snmp.props.quick-print">
     <term><varname>quick_print</varname></term>
     <listitem>
      <para>Value of <parameter>quick_print</parameter> within the NET-<acronym>SNMP</acronym> library</para>
      <para>
       Sets the value of <parameter>quick_print</parameter> within the NET-<acronym>SNMP</acronym> library.  When this
       is set (1), the <acronym>SNMP</acronym> library will return 'quick printed' values.  This
       means that just the value will be printed.  When <parameter>quick_print</parameter> is not
       enabled (default) the UCD <acronym>SNMP</acronym> library prints extra information
       including the type of the value (i.e. IpAddress or OID).  Additionally,
       if quick_print is not enabled, the library prints additional hex values
       for all strings of three characters or less.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="snmp.props.enum-print">
     <term><varname>enum_print</varname></term>
     <listitem>
      <para>Controls the way enum values are printed</para>
      <para>
       Parameter toggles if walk/get etc. should automatically lookup enum values
       in the MIB and return them together with their human readable string.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="snmp.props.oid-output-format">
     <term><varname>oid_output_format</varname></term>
     <listitem>
      <para>Controls OID output format</para>
      <table>
       <title>OID .1.3.6.1.2.1.1.3.0 representation for various
       <varname>oid_output_format</varname> values</title>
       <tgroup cols="2">
        <tbody>
         <row><entry><constant>SNMP_OID_OUTPUT_FULL</constant></entry><entry>.iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.sysUpTimeInstance</entry></row>
         <row><entry><constant>SNMP_OID_OUTPUT_NUMERIC</constant></entry><entry>.1.3.6.1.2.1.1.3.0</entry> </row>
         <row><entry><constant>SNMP_OID_OUTPUT_MODULE</constant></entry><entry>DISMAN-EVENT-MIB::sysUpTimeInstance</entry></row>
         <row><entry><constant>SNMP_OID_OUTPUT_SUFFIX</constant></entry><entry>sysUpTimeInstance</entry></row>
         <row><entry><constant>SNMP_OID_OUTPUT_UCD</constant></entry><entry>system.sysUpTime.sysUpTimeInstance</entry></row>
         <row><entry><constant>SNMP_OID_OUTPUT_NONE</constant></entry><entry>Undefined</entry></row>
        </tbody>
       </tgroup>
      </table>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="snmp.props.oid-increasing-check">
     <term><varname>oid_increasing_check</varname></term>
     <listitem>
      <para>Controls disabling check for increasing OID while walking OID tree</para>
      <para>
       Some <acronym>SNMP</acronym> agents are known for returning OIDs out
       of order but can complete the walk anyway. Other agents return OIDs
       that are out of order and can cause <methodname>SNMP::walk</methodname>
       to loop indefinitely until memory limit will be reached.
       PHP SNMP library by default performs OID increasing check and stops
       walking on OID tree when it detects possible loop with issuing warning
       about non-increasing OID faced.
       Set <varname>oid_increasing_check</varname> to &false; to disable this
       check.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="snmp.props.exceptions-enabled">
     <term><varname>exceptions_enabled</varname></term>
     <listitem>
      <para>
       Controls which failures will raise SNMPException instead of
       warning. Use bitwise OR'ed <constant>SNMP::ERRNO_*</constant> constants.
       By default all SNMP exceptions are disabled.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="snmp.props.info">
     <term><varname>info</varname></term>
     <listitem>
      <para>Read-only property with remote agent configuration: hostname,
      port, default timeout, default retries count</para>
     </listitem>
    </varlistentry>
   </variablelist>
  </section>
<!-- }}} -->

  <!-- {{{ SNMP constants -->
  <section xml:id="snmp.class.constants">
   &reftitle.constants;
   <section xml:id="snmp.class.constants.error-types">
    <title><acronym>SNMP</acronym> Error Types</title>
    <variablelist>

     <varlistentry xml:id="snmp.class.constants.errno-noerror">
      <term><constant>SNMP::ERRNO_NOERROR</constant></term>
      <listitem>
       <para>No <acronym>SNMP</acronym>-specific error occurred.</para>
      </listitem>
     </varlistentry>

     <varlistentry xml:id="snmp.class.constants.errno-generic">
      <term><constant>SNMP::ERRNO_GENERIC</constant></term>
      <listitem>
       <para>A generic <acronym>SNMP</acronym> error occurred.</para>
      </listitem>
     </varlistentry>

     <varlistentry xml:id="snmp.class.constants.errno-timeout">
      <term><constant>SNMP::ERRNO_TIMEOUT</constant></term>
      <listitem>
       <para>Request to <acronym>SNMP</acronym> agent timed out.</para>
      </listitem>
     </varlistentry>

     <varlistentry xml:id="snmp.class.constants.errno-error-in-reply">
      <term><constant>SNMP::ERRNO_ERROR_IN_REPLY</constant></term>
      <listitem>
       <para><acronym>SNMP</acronym> agent returned an error in reply.</para>
      </listitem>
     </varlistentry>

     <varlistentry xml:id="snmp.class.constants.errno-oid-not-increasing">
      <term><constant>SNMP::ERRNO_OID_NOT_INCREASING</constant></term>
      <listitem>
       <para>
        <acronym>SNMP</acronym> agent faced OID cycling reporning
        non-increasing OID while executing (BULK)WALK command.
        This indicates bogus remote <acronym>SNMP</acronym> agent.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry xml:id="snmp.class.constants.errno-oid-parsing-error">
      <term><constant>SNMP::ERRNO_OID_PARSING_ERROR</constant></term>
      <listitem>
       <para>
        Library failed while parsing OID (and/or type for SET command).
        No queries has been made.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry xml:id="snmp.class.constants.errno-multiple-set-queries">
      <term><constant>SNMP::ERRNO_MULTIPLE_SET_QUERIES</constant></term>
      <listitem>
       <para>
        Library will use multiple queries for SET operation requested.
        That means that operation will be performed in a non-transaction manner 
        and second or subsequent chunks may fail if a type or value failure
        will be faced.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry xml:id="snmp.class.constants.errno-any">
      <term><constant>SNMP::ERRNO_ANY</constant></term>
      <listitem>
       <para>
 All SNMP::ERRNO_* codes bitwise OR'ed.
       </para>
      </listitem>
     </varlistentry>

    </variablelist>
   </section>
   <section xml:id="snmp.class.constants.protocols">
    <title><acronym>SNMP</acronym> Protocol Versions</title>
    <variablelist>

     <varlistentry xml:id="snmp.class.constants.version-1">
      <term><constant>SNMP::VERSION_1</constant></term>
      <listitem>
       <para></para>
      </listitem>
     </varlistentry>

     <varlistentry xml:id="snmp.class.constants.version-2c">
      <term><constant>SNMP::VERSION_2C</constant>, <constant>SNMP::VERSION_2c</constant></term>
      <listitem>
       <para></para>
      </listitem>
     </varlistentry>

     <varlistentry xml:id="snmp.class.constants.version-3">
      <term><constant>SNMP::VERSION_3</constant></term>
      <listitem>
       <para></para>
      </listitem>
     </varlistentry>

    </variablelist>
   </section>
  </section>
  <!-- }}} -->

 
 </partintro>
 
 &reference.snmp.entities.snmp;
 
</phpdoc:classref>
 
<!-- 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
-->

