⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c-agent10.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title>    The WindNet SNMPv1/v2c Agent   </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a></a><a href="c-agent.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-agent9.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-agent11.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="83927">4.10  &nbsp;&nbsp;Access to MIB Variables</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83928"> </a>The mechanisms to deal with management variables are very flexible.  In general, all access is mediated by procedures provided by the MIB developer. </p><dd><p class="Body"><a name="83929"> </a>Access to any management variable is controlled by the <i class="term">leaf node</i> in the MIB tree corresponding to that variable.  It is important to recognize that the term <i class="term">variable</i> includes scalar data as well as columns (also known as <i class="term">attributes</i>) in tables.  For example, the RFC-1213 scalar variable <i class="textVariable">sysUpTime</i> is represented by a leaf of the MIB tree.  The column of variables known as <i class="textVariable">ipRouteAge</i> in the IP routing table are also represented by a single leaf of the MIB tree.</p><dd><p class="Body"><a name="83930"> </a>The access functions for scalar variables will rarely need to be concerned with selecting which instance of the variable is to be used---when there is only one instance there is not much to decide.</p><dd><p class="Body"><a name="83931"> </a>When an access function operates on a set of variables in a table, the access function will have to select which specific instance to use.  The choice is made using information provided to the access functions as parameters. </p><dd><p class="Body"><a name="83932"> </a>For examples of MIB-variable access, see the MIB-II method routines provided in the source code (see <a href="c-agent2.html#83635"><i class="title">4.2.2&nbsp;$WIND_BASE/target/src/snmpv1/agent/</i></a>).</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="83936">4.10.1  &nbsp;&nbsp;Access Functions</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83937"> </a>Each leaf on the MIB tree is represented by an instance of the <b class="symbol_UC">MIBLEAF_T</b> structure.  This structure contains pointers to four designer-defined procedures.  Note that the specific procedures referenced may be different from one leaf to the next.  In other words, there may be a different set of access procedures for the variable <i class="textVariable">sysUpTime</i> than for the variable <i class="textVariable">ifNumber</i>. These access functions are illustrated in the MIB-II method-routine source code, provided in this release (see <a href="c-agent2.html#83635"><i class="title">4.2.2&nbsp;$WIND_BASE/target/src/snmpv1/agent/</i></a>).</p><dd><p class="Body"><a name="83941"> </a>The four procedures for each leaf are:</p></dl><dl class="margin"><dd><div class="Item"><a name="83942"> </a><b class="keyword">getproc</b></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="83943"> </a>The <b class="keyword">getproc</b> operation is activated to find the specified instance of the object and to install the value of the variable using the <b class="routine"><i class="routine">getproc_got_</i></b><b>(&nbsp;)</b> routines.</><br></dl></dl></dl><dd><div class="Item"><a name="83944"> </a><b class="keyword">nextproc</b></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="83945"> </a>The <b class="keyword">nextproc</b> operation is activated when processing an SNMP <b class="keyword">GET NEXT</b> or <b class="keyword">GET BULK</b> PDU.  This procedure is used to locate a variable whose instance is the SNMP lexicographic successor for the input object identifier, which may or may not actually exist within this object.  This procedure should only examine instances of the given object (the SNMP agent steps to the next object if necessary).  It should install the value and instance of the variable using the <b class="routine"><i class="routine">getproc_got_</i></b><b>(&nbsp;)</b><b class="routine"><i class="routine">*</i></b> and <b class="routine"><i class="routine">nextproc_next_instance</i></b><b>(&nbsp;)</b> routines. </><br></dl></dl></dl><dd><div class="Item"><a name="83946"> </a><b class="keyword">testproc</b></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="83947"> </a>The <b class="keyword">testproc</b> operation is activated before setting a variable to determine whether the proposed <b class="keyword">SET</b> will succeed. The agent does not guarantee that the leaf's <b class="keyword">setproc</b> routine is called after a call to a leaf's <b class="keyword">testproc</b> operation.</><br></dl></dl></dl><dd><div class="Item"><a name="83948"> </a><b class="keyword">setproc</b></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="83949"> </a>The <b class="keyword">setproc</b> operation is called to write a new value of a variable.</><br></dl></dl></dl></dl>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -