Sophie

Sophie

distrib > Mageia > 7 > aarch64 > by-pkgid > ca236e080672a3aa5beda2fe21b8473d > files > 886

erlang-doc-21.2.5-1.mga7.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns:erl="http://erlang.org" xmlns:fn="http://www.w3.org/2005/02/xpath-functions">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../doc/otp_doc.css" type="text/css">
<title>Erlang -- The MIB Compiler</title>
</head>
<body>
<div id="container">
<script id="js" type="text/javascript" language="JavaScript" src="../../../../doc/js/flipmenu/flipmenu.js"></script><script id="js2" type="text/javascript" src="../../../../doc/js/erlresolvelinks.js"></script><script language="JavaScript" type="text/javascript">
            <!--
              function getWinHeight() {
                var myHeight = 0;
                if( typeof( window.innerHeight ) == 'number' ) {
                  //Non-IE
                  myHeight = window.innerHeight;
                } else if( document.documentElement && ( document.documentElement.clientWidth ||
                                                         document.documentElement.clientHeight ) ) {
                  //IE 6+ in 'standards compliant mode'
                  myHeight = document.documentElement.clientHeight;
                } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                  //IE 4 compatible
                  myHeight = document.body.clientHeight;
                }
                return myHeight;
              }

              function setscrollpos() {
                var objf=document.getElementById('loadscrollpos');
                 document.getElementById("leftnav").scrollTop = objf.offsetTop - getWinHeight()/2;
              }

              function addEvent(obj, evType, fn){
                if (obj.addEventListener){
                obj.addEventListener(evType, fn, true);
                return true;
              } else if (obj.attachEvent){
                var r = obj.attachEvent("on"+evType, fn);
                return r;
              } else {
                return false;
              }
             }

             addEvent(window, 'load', setscrollpos);

             //--></script><div id="leftnav"><div class="innertube">
<div class="erlang-logo-wrapper"><a href="../../../../doc/index.html"><img alt="Erlang Logo" src="../../../../doc/erlang-logo.png" class="erlang-logo"></a></div>
<p class="section-title">Simple Network Management Protocol (SNMP)</p>
<p class="section-subtitle">User's Guide</p>
<p class="section-version">Version 5.2.12</p>
<ul class="panel-sections">
<li><a href="users_guide.html">User's Guide</a></li>
<li><a href="index.html">Reference Manual</a></li>
<li><a href="release_notes.html">Release Notes</a></li>
<li><a href="../pdf/snmp-5.2.12.pdf">PDF</a></li>
<li><a href="../../../../doc/index.html">Top</a></li>
</ul>
<ul class="expand-collapse-items">
<li><a href="javascript:openAllFlips()">Expand All</a></li>
<li><a href="javascript:closeAllFlips()">Contract All</a></li>
</ul>
<h3>Chapters</h3>
<ul class="flipMenu" imagepath="../../../../doc/js/flipmenu">
<li id="no" title="SNMP Introduction" expanded="false">SNMP Introduction<ul>
<li><a href="snmp_intro.html">
              Top of chapter
            </a></li>
<li title="Scope and Purpose"><a href="snmp_intro.html#scope-and-purpose">Scope and Purpose</a></li>
<li title="Prerequisites"><a href="snmp_intro.html#prerequisites">Prerequisites</a></li>
<li title="Definitions"><a href="snmp_intro.html#definitions">Definitions</a></li>
<li title="About This Manual"><a href="snmp_intro.html#about-this-manual">About This Manual</a></li>
<li title="Where to Find More Information"><a href="snmp_intro.html#where-to-find-more-information">Where to Find More Information</a></li>
</ul>
</li>
<li id="no" title="Agent Functional Description" expanded="false">Agent Functional Description<ul>
<li><a href="snmp_agent_funct_descr.html">
              Top of chapter
            </a></li>
<li title="Features"><a href="snmp_agent_funct_descr.html#features">Features</a></li>
<li title="SNMPv1, SNMPv2 and SNMPv3"><a href="snmp_agent_funct_descr.html#snmpv1,-snmpv2-and-snmpv3">SNMPv1, SNMPv2 and SNMPv3</a></li>
<li title="Operation"><a href="snmp_agent_funct_descr.html#operation">Operation</a></li>
<li title="Sub-agents and MIB Loading"><a href="snmp_agent_funct_descr.html#sub-agents-and-mib-loading">Sub-agents and MIB Loading</a></li>
<li title="Contexts and Communities"><a href="snmp_agent_funct_descr.html#contexts-and-communities">Contexts and Communities</a></li>
<li title="Management of the Agent"><a href="snmp_agent_funct_descr.html#management-of-the-agent">Management of the Agent</a></li>
<li title="Notifications"><a href="snmp_agent_funct_descr.html#notifications">Notifications</a></li>
<li title="Discovery"><a href="snmp_agent_funct_descr.html#discovery">Discovery</a></li>
</ul>
</li>
<li id="no" title="Manager Functional Description" expanded="false">Manager Functional Description<ul>
<li><a href="snmp_manager_funct_descr.html">
              Top of chapter
            </a></li>
<li title="Features"><a href="snmp_manager_funct_descr.html#features">Features</a></li>
<li title="Operation"><a href="snmp_manager_funct_descr.html#operation">Operation</a></li>
<li title="MIB loading"><a href="snmp_manager_funct_descr.html#mib-loading">MIB loading</a></li>
</ul>
</li>
<li id="loadscrollpos" title="The MIB Compiler" expanded="true">The MIB Compiler<ul>
<li><a href="snmp_mib_compiler.html">
              Top of chapter
            </a></li>
<li title="Operation"><a href="snmp_mib_compiler.html#operation">Operation</a></li>
<li title="Importing MIBs"><a href="snmp_mib_compiler.html#importing-mibs">Importing MIBs</a></li>
<li title="MIB Consistency Checking"><a href="snmp_mib_compiler.html#mib-consistency-checking">MIB Consistency Checking</a></li>
<li title=".hrl File Generation"><a href="snmp_mib_compiler.html#.hrl-file-generation">.hrl File Generation</a></li>
<li title="Emacs Integration"><a href="snmp_mib_compiler.html#emacs-integration">Emacs Integration</a></li>
<li title="Compiling from a Shell or a Makefile"><a href="snmp_mib_compiler.html#compiling-from-a-shell-or-a-makefile">Compiling from a Shell or a Makefile</a></li>
<li title="Deviations from the Standard"><a href="snmp_mib_compiler.html#deviations-from-the-standard">Deviations from the Standard</a></li>
</ul>
</li>
<li id="no" title="Running the application" expanded="false">Running the application<ul>
<li><a href="snmp_config.html">
              Top of chapter
            </a></li>
<li title="Configuring the application"><a href="snmp_config.html#configuring-the-application">Configuring the application</a></li>
<li title="Modifying the Configuration Files"><a href="snmp_config.html#modifying-the-configuration-files">Modifying the Configuration Files</a></li>
<li title="Starting the application"><a href="snmp_config.html#starting-the-application">Starting the application</a></li>
<li title="Debugging the application"><a href="snmp_config.html#debugging-the-application">Debugging the application</a></li>
</ul>
</li>
<li id="no" title="Definition of Agent Configuration Files" expanded="false">Definition of Agent Configuration Files<ul>
<li><a href="snmp_agent_config_files.html">
              Top of chapter
            </a></li>
<li title="Agent Information"><a href="snmp_agent_config_files.html#agent-information">Agent Information</a></li>
<li title="Contexts"><a href="snmp_agent_config_files.html#contexts">Contexts</a></li>
<li title="System Information"><a href="snmp_agent_config_files.html#system-information">System Information</a></li>
<li title="Communities"><a href="snmp_agent_config_files.html#communities">Communities</a></li>
<li title="MIB Views for VACM"><a href="snmp_agent_config_files.html#mib-views-for-vacm">MIB Views for VACM</a></li>
<li title="Security data for USM"><a href="snmp_agent_config_files.html#security-data-for-usm">Security data for USM</a></li>
<li title="Notify Definitions"><a href="snmp_agent_config_files.html#notify-definitions">Notify Definitions</a></li>
<li title="Target Address Definitions"><a href="snmp_agent_config_files.html#target-address-definitions">Target Address Definitions</a></li>
<li title="Target Parameters Definitions"><a href="snmp_agent_config_files.html#target-parameters-definitions">Target Parameters Definitions</a></li>
</ul>
</li>
<li id="no" title="Definition of Manager Configuration Files" expanded="false">Definition of Manager Configuration Files<ul>
<li><a href="snmp_manager_config_files.html">
              Top of chapter
            </a></li>
<li title="Manager Information"><a href="snmp_manager_config_files.html#manager-information">Manager Information</a></li>
<li title="Users"><a href="snmp_manager_config_files.html#users">Users</a></li>
<li title="Agents"><a href="snmp_manager_config_files.html#agents">Agents</a></li>
<li title="Security data for USM"><a href="snmp_manager_config_files.html#security-data-for-usm">Security data for USM</a></li>
</ul>
</li>
<li id="no" title="Agent Implementation Example" expanded="false">Agent Implementation Example<ul>
<li><a href="snmp_impl_example_agent.html">
              Top of chapter
            </a></li>
<li title="MIB"><a href="snmp_impl_example_agent.html#mib">MIB</a></li>
<li title="Default Implementation"><a href="snmp_impl_example_agent.html#default-implementation">Default Implementation</a></li>
<li title="Manual Implementation"><a href="snmp_impl_example_agent.html#manual-implementation">Manual Implementation</a></li>
</ul>
</li>
<li id="no" title="Manager Implementation Example" expanded="false">Manager Implementation Example<ul>
<li><a href="snmp_impl_example_manager.html">
              Top of chapter
            </a></li>
<li title="The example manager"><a href="snmp_impl_example_manager.html#the-example-manager">The example manager</a></li>
<li title="A simple standard test"><a href="snmp_impl_example_manager.html#a-simple-standard-test">A simple standard test</a></li>
</ul>
</li>
<li id="no" title="Instrumentation Functions" expanded="false">Instrumentation Functions<ul>
<li><a href="snmp_instr_functions.html">
              Top of chapter
            </a></li>
<li title="Instrumentation Functions"><a href="snmp_instr_functions.html#instrumentation-functions">Instrumentation Functions</a></li>
<li title="Using the ExtraArgument"><a href="snmp_instr_functions.html#using-the-extraargument">Using the ExtraArgument</a></li>
<li title="Default Instrumentation"><a href="snmp_instr_functions.html#default-instrumentation">Default Instrumentation</a></li>
<li title="Atomic Set"><a href="snmp_instr_functions.html#atomic-set">Atomic Set</a></li>
</ul>
</li>
<li id="no" title="Definition of Instrumentation Functions" expanded="false">Definition of Instrumentation Functions<ul>
<li><a href="snmp_def_instr_functions.html">
              Top of chapter
            </a></li>
<li title="Variable Instrumentation"><a href="snmp_def_instr_functions.html#variable-instrumentation">Variable Instrumentation</a></li>
<li title="Table Instrumentation"><a href="snmp_def_instr_functions.html#table-instrumentation">Table Instrumentation</a></li>
</ul>
</li>
<li id="no" title="Definition of Agent Net if" expanded="false">Definition of Agent Net if<ul>
<li><a href="snmp_agent_netif.html">
              Top of chapter
            </a></li>
<li title="Mandatory Functions"><a href="snmp_agent_netif.html#mandatory-functions">Mandatory Functions</a></li>
<li title="Messages"><a href="snmp_agent_netif.html#messages">Messages</a></li>
</ul>
</li>
<li id="no" title="Definition of Manager Net if" expanded="false">Definition of Manager Net if<ul>
<li><a href="snmp_manager_netif.html">
              Top of chapter
            </a></li>
<li title="Mandatory Functions"><a href="snmp_manager_netif.html#mandatory-functions">Mandatory Functions</a></li>
<li title="Messages"><a href="snmp_manager_netif.html#messages">Messages</a></li>
</ul>
</li>
<li id="no" title="Audit Trail Log" expanded="false">Audit Trail Log<ul>
<li><a href="snmp_audit_trail_log.html">
              Top of chapter
            </a></li>
<li title="Agent Logging"><a href="snmp_audit_trail_log.html#agent-logging">Agent Logging</a></li>
<li title="Manager Logging"><a href="snmp_audit_trail_log.html#manager-logging">Manager Logging</a></li>
</ul>
</li>
<li id="no" title="Advanced Agent Topics" expanded="false">Advanced Agent Topics<ul>
<li><a href="snmp_advanced_agent.html">
              Top of chapter
            </a></li>
<li title="When to use a Sub-agent"><a href="snmp_advanced_agent.html#when-to-use-a-sub-agent">When to use a Sub-agent</a></li>
<li title="Agent Semantics"><a href="snmp_advanced_agent.html#agent-semantics">Agent Semantics</a></li>
<li title="Sub-agents and Dependencies "><a href="snmp_advanced_agent.html#sub-agents-and-dependencies-">Sub-agents and Dependencies </a></li>
<li title="Distributed Tables"><a href="snmp_advanced_agent.html#distributed-tables">Distributed Tables</a></li>
<li title="Fault Tolerance"><a href="snmp_advanced_agent.html#fault-tolerance">Fault Tolerance</a></li>
<li title="Using Mnesia Tables as SNMP Tables"><a href="snmp_advanced_agent.html#using-mnesia-tables-as-snmp-tables">Using Mnesia Tables as SNMP Tables</a></li>
<li title="Deviations from the Standard"><a href="snmp_advanced_agent.html#deviations-from-the-standard">Deviations from the Standard</a></li>
</ul>
</li>
<li id="no" title="SNMP Appendix A" expanded="false">SNMP Appendix A<ul>
<li><a href="snmp_app_a.html">
              Top of chapter
            </a></li>
<li title="Appendix A"><a href="snmp_app_a.html#appendix-a">Appendix A</a></li>
</ul>
</li>
<li id="no" title="SNMP Appendix B" expanded="false">SNMP Appendix B<ul>
<li><a href="snmp_app_b.html">
              Top of chapter
            </a></li>
<li title="Appendix B"><a href="snmp_app_b.html#appendix-b">Appendix B</a></li>
</ul>
</li>
</ul>
</div></div>
<div id="content">
<div class="innertube">
<h1>4 The MIB Compiler</h1>
  
  <p>The chapter <strong>The MIB Compiler</strong> describes the MIB compiler
    and contains the following topics:
    </p>
  <ul>
    <li>Operation</li>
    <li>Import</li>
    <li>Consistency checking between MIBs</li>
    <li>.hrl file generation</li>
    <li>Emacs integration</li>
    <li>Deviations from the standard
    </li>
  </ul>
  <div class="note">
<div class="label">Note</div>
<div class="content"><p>
    <p>When importing MIBs, ensure that the imported MIBs as well as the 
      importing MIB are compiled using the same version of the 
      SNMP-compiler.</p>
  </p></div>
</div>

  <h3><span onMouseOver="document.getElementById('ghlink-operation-idm281472671275352').style.visibility = 'visible';" onMouseOut="document.getElementById('ghlink-operation-idm281472671275352').style.visibility = 'hidden';"><span id="ghlink-operation-idm281472671275352" class="ghlink"><a href="https://github.com/erlang/otp/edit/maint/lib/snmp/doc/src/snmp_mib_compiler.xml#L53" title="Found an issue with the documentation? Fix it by clicking here!"><span class="pencil"></span></a></span><a class="title_link" name="operation" href="#operation">4.1 
          Operation</a></span></h3>
    
    <p>The MIB must be written as a text file in SMIv1 or SMIv2 using 
      an ASN.1 notation before
      it will be compiled. This text file must have the same name as the MIB,
      but with the suffix <span class="code">.mib</span>. This is necessary for handling
      the <span class="code">IMPORT</span> statement.
      </p>
    <p>The association file, which contains the names of
      instrumentation functions for the MIB, should have the suffix
      <span class="code">.funcs</span>. If the compiler does not find the association file,
      it gives a warning message and uses default instrumentation
      functions.  (See <span class="bold_code bc-15"><a href="snmp_instr_functions.html#snmp_3">Default Instrumentation</a></span> for more details).
      </p>
    <p>The MIB compiler is started with a call to
      <span class="code">snmpc:compile(&lt;mibname&gt;).</span> For example:
      </p>
    <div class="example"><pre>snmpc:compile("RFC1213-MIB").</pre></div>
    <p>The output is a new file which is called <span class="code">&lt;mibname&gt;.bin</span>.
      </p>
    <p>The MIB compiler understands both SMIv1 and SMIv2 MIBs.  It
      uses the MODULE-IDENTITY statement to determinate if the MIB is
      written in SMI version 1 or 2.
      </p>
  

  <h3><span onMouseOver="document.getElementById('ghlink-importing-mibs-idm281472671267496').style.visibility = 'visible';" onMouseOut="document.getElementById('ghlink-importing-mibs-idm281472671267496').style.visibility = 'hidden';"><span id="ghlink-importing-mibs-idm281472671267496" class="ghlink"><a href="https://github.com/erlang/otp/edit/maint/lib/snmp/doc/src/snmp_mib_compiler.xml#L81" title="Found an issue with the documentation? Fix it by clicking here!"><span class="pencil"></span></a></span><a class="title_link" name="importing-mibs" href="#importing-mibs">4.2 
          Importing MIBs</a></span></h3>
    
    <p>The compiler handles the <span class="code">IMPORT</span> statement. It is important to
      import the compiled file and not the ASN.1 (source) file. A MIB must
      be recompiled to make changes visible to other MIBs importing it.
      </p>
    <p>The compiled files of the imported MIBs must be present in the
      current directory, or a directory in the current path. The path is
      supplied with the <span class="code">{i, Path}</span> option, for example:
      </p>
    <div class="example"><pre>snmpc:compile("MY-MIB", 
       [{i, ["friend_mibs/", "../standard_mibs/"]}]).</pre></div>
    <p>It is also possible to import MIBs from OTP applications in an
      <span class="code">"include_lib"</span> like fashion with the <span class="code">il</span>
      option. Example:
      </p>
    <div class="example"><pre>snmpc:compile("MY-MIB", 
       [{il, ["snmp/priv/mibs/", "myapp/priv/mibs/"]}]).</pre></div>
    <p>finds the latest version of the <span class="code">snmp</span> and <span class="code">myapp</span>
      applications in the OTP system and uses the expanded paths as
      include paths.
      </p>
    <p>Note that an SMIv2 MIB can import an SMIv1 MIB and vice versa.
      </p>
    <p>The following MIBs are built-ins of the Erlang SNMP compiler:
      SNMPv2-SMI, RFC-1215, RFC-1212, SNMPv2-TC, SNMPv2-CONF, and
      RFC1155-SMI. They cannot therefore be compiled separately.
      </p>
  

  <h3><span onMouseOver="document.getElementById('ghlink-mib-consistency-checking-idm281472671258616').style.visibility = 'visible';" onMouseOut="document.getElementById('ghlink-mib-consistency-checking-idm281472671258616').style.visibility = 'hidden';"><span id="ghlink-mib-consistency-checking-idm281472671258616" class="ghlink"><a href="https://github.com/erlang/otp/edit/maint/lib/snmp/doc/src/snmp_mib_compiler.xml#L115" title="Found an issue with the documentation? Fix it by clicking here!"><span class="pencil"></span></a></span><a class="title_link" name="mib-consistency-checking" href="#mib-consistency-checking">4.3 
          MIB Consistency Checking</a></span></h3>
    
    <p>When an MIB is compiled, the compiler detects if several
      managed objects use the same <span class="code">OBJECT IDENTIFIER</span>. If that is
      the case, it issues an error message. However, the compiler cannot
      detect Oid conflicts between different MIBs. These kinds of
      conflicts generate an error at load time. To avoid this, the
      following function can be used to do consistency checking between
      MIBs:
      </p>
    <div class="example"><pre>

erl&gt;<span class="bold_code bc-12">snmpc:is_consistent(ListOfMibNames).</span>
    </pre></div>
    <p><span class="code">ListOfMibNames</span> is a list of compiled MIBs, for example
      <span class="code">["RFC1213-MIB", "MY-MIB"]</span>. The function also performs
      consistency checking of trap definitions.</p>
  

  <h3><span onMouseOver="document.getElementById('ghlink-.hrl-file-generation-idm281472671253928').style.visibility = 'visible';" onMouseOut="document.getElementById('ghlink-.hrl-file-generation-idm281472671253928').style.visibility = 'hidden';"><span id="ghlink-.hrl-file-generation-idm281472671253928" class="ghlink"><a href="https://github.com/erlang/otp/edit/maint/lib/snmp/doc/src/snmp_mib_compiler.xml#L134" title="Found an issue with the documentation? Fix it by clicking here!"><span class="pencil"></span></a></span><a class="title_link" name=".hrl-file-generation" href="#.hrl-file-generation">4.4 
          .hrl File Generation</a></span></h3>
    
    <p>It is possible to generate an <span class="code">.hrl</span> file which contains
      definitions of Erlang constants from a compiled MIB file. This
      file can then be included in Erlang source code. The file will
      contain constants for:
      </p>
    <ul>
      <li>object Identifiers for tables, table entries and variables</li>
      <li>column numbers</li>
      <li>enumerated values</li>
      <li>default values for variables and table columns.
      </li>
    </ul>
    <p>Use the following command to  generate a .hrl file from an MIB:
      </p>
    <div class="example"><pre>
erl&gt;<span class="bold_code bc-12">snmpc:mib_to_hrl(MibName).</span>
    </pre></div>
  

  <h3><span onMouseOver="document.getElementById('ghlink-emacs-integration-idm281472671247640').style.visibility = 'visible';" onMouseOut="document.getElementById('ghlink-emacs-integration-idm281472671247640').style.visibility = 'hidden';"><span id="ghlink-emacs-integration-idm281472671247640" class="ghlink"><a href="https://github.com/erlang/otp/edit/maint/lib/snmp/doc/src/snmp_mib_compiler.xml#L155" title="Found an issue with the documentation? Fix it by clicking here!"><span class="pencil"></span></a></span><a class="title_link" name="emacs-integration" href="#emacs-integration">4.5 
          Emacs Integration</a></span></h3>
    
    <p>With the Emacs editor, the <span class="code">next-error</span> (<span class="code">C-X `</span>)
      function can be used indicate where a compilation error occurred,
      provided the error message is described by a line number.
      </p>
    <p>Use <span class="code">M-x compile</span> to compile an MIB from inside Emacs, and
      enter:
      </p>
    <div class="example"><pre>
 <span class="bold_code bc-12">erl -s snmpc compile &lt;MibName&gt; -noshell</span>
    </pre></div>
    <p>An example of <span class="code">&lt;MibName&gt;</span> is <span class="code">RFC1213-MIB</span>.
      </p>
  

  <h3><span onMouseOver="document.getElementById('ghlink-compiling-from-a-shell-or-a-makefile-idm281472671241752').style.visibility = 'visible';" onMouseOut="document.getElementById('ghlink-compiling-from-a-shell-or-a-makefile-idm281472671241752').style.visibility = 'hidden';"><span id="ghlink-compiling-from-a-shell-or-a-makefile-idm281472671241752" class="ghlink"><a href="https://github.com/erlang/otp/edit/maint/lib/snmp/doc/src/snmp_mib_compiler.xml#L171" title="Found an issue with the documentation? Fix it by clicking here!"><span class="pencil"></span></a></span><a class="title_link" name="compiling-from-a-shell-or-a-makefile" href="#compiling-from-a-shell-or-a-makefile">4.6 
          Compiling from a Shell or a Makefile</a></span></h3>
    
    <p>The <span class="code">erlc</span> commands can be used to compile SNMP MIBs. Example:
      </p>
    <div class="example"><pre>
 <span class="bold_code bc-12">erlc MY-MIB.mib</span>
    </pre></div>
    <p>All the standard <span class="code">erlc</span> flags are supported, e.g.
      </p>
    <div class="example"><pre>
 <span class="bold_code bc-12">erlc -I mymibs -o mymibs -W MY-MIB.mib</span>
    </pre></div>
    <p>The flags specific to the MIB compiler can be specified by
      using the <span class="code">+</span> syntax:
      </p>
    <div class="example"><pre>
 <span class="bold_code bc-12">erlc +'{group_check,false}' MY-MIB.mib</span>
    </pre></div>
  

  <h3><span onMouseOver="document.getElementById('ghlink-deviations-from-the-standard-idm281472671235000').style.visibility = 'visible';" onMouseOut="document.getElementById('ghlink-deviations-from-the-standard-idm281472671235000').style.visibility = 'hidden';"><span id="ghlink-deviations-from-the-standard-idm281472671235000" class="ghlink"><a href="https://github.com/erlang/otp/edit/maint/lib/snmp/doc/src/snmp_mib_compiler.xml#L191" title="Found an issue with the documentation? Fix it by clicking here!"><span class="pencil"></span></a></span><a class="title_link" name="deviations-from-the-standard" href="#deviations-from-the-standard">4.7 
          Deviations from the Standard</a></span></h3>
    
    <p>In some aspects the Erlang MIB compiler does not follow or
      implement the SMI fully. Here are the differences:
      </p>
    <ul>
      <li>
        <p>Tables must be written in the following order:
          <span class="code">tableObject</span>, <span class="code">entryObject</span>, <span class="code">column1</span>, ...,
          <span class="code">columnN</span> (in order).</p>
      </li>
      <li>
        <p>Integer values, for example in the <span class="code">SIZE</span> expression
          must be entered in decimal syntax, not in hex or bit syntax.</p>
      </li>
      <li>
        <p>Symbolic names must be unique within a MIB and within a
          system.</p>
      </li>
      <li>
        <p>Hyphens are allowed in SMIv2 (a pragmatic approach).  The
          reason for this is that according to SMIv2, hyphens are allowed
          for objects converted from SMIv1, but not for others.  This is
          impossible to check for the compiler.</p>
      </li>
      <li>
        <p>If a word is a keyword in any of SMIv1 or SMIv2, it is a
          keyword in the compiler (deviates from SMIv1 only).</p>
      </li>
      <li>
        <p>Indexes in a table must be objects, not types (deviates
          from SMIv1 only).</p>
      </li>
      <li>
        <p>A subset of all semantic checks on types are
          implemented. For example, strictly the <span class="code">TimeTicks</span> may not
          be sub-classed but the compiler allows this (standard MIBs must
          pass through the compiler) (deviates from SMIv2 only).</p>
      </li>
      <li>
        <p>The <span class="code">MIB.Object</span> syntax is not implemented (since all
          objects must be unique anyway).</p>
      </li>
      <li>
        <p>Two different names cannot define the same OBJECT IDENTIFIER.</p>
      </li>
      <li>
        <p>The type checking in the SEQUENCE construct is non-strict 
          (i.e. subtypes may be specified).  The reason for this is 
          that some standard MIBs use this.</p>
      </li>
      <li>A definition has normally a status field. When the status field
       has the value deprecated, then the MIB-compiler will ignore this 
       definition. With the MIB-compiler option <span class="code">{deprecated,true}</span> 
       the MIB-compiler does not ignore the deprecated definitions.</li>
      <li>An object has a DESCRIPTIONS field. The descriptions-field will 
       not be included in the compiled mib by default. In order to get 
       the description, the mib must be compiled with the option 
      <span class="code">description</span>.</li>
    </ul>
  
</div>
<div class="footer">
<hr>
<p>Copyright © 1997-2019 Ericsson AB. All Rights Reserved.</p>
</div>
</div>
</div>
<script type="text/javascript">window.__otpTopDocDir = '../../../../doc/js/';</script><script type="text/javascript" src="../../../../doc/js/highlight.js"></script>
</body>
</html>