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

📄 x-mibcomp4.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<dd><div class="Indent3"><a name="84082"> </a>This is exactly like <b class="symbol_lc">set-function</b> except that it specifies an asynchronous method routine.</><br></dl></dl></dl><dd><div class="Item"><a name="83593"> </a><b class="symbol_lc">get-function</b>  <br></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84084"> </a>This is the name of a C function for the target agent to call which gets the value of a MIB object. Every <b class="symbol_lc">read-only</b>, <b class="symbol_lc">read-write</b>, or <b class="symbol_lc">read-create</b> object must have either a <b class="symbol_lc">get-function</b> or a <b class="symbol_lc">get-function-async</b> associated with it.</><br></dl></dl></dl><dd><div class="Item"><a name="83594"> </a><b class="symbol_lc">get-function-async</b>  <br></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84086"> </a>This is exactly like <b class="symbol_lc">get-function</b> except that it specifies an asynchronous method routine.</><br></dl></dl></dl><dd><div class="Item"><a name="83595"> </a><b class="symbol_lc">locator</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84088"> </a>This is a C expression whose value is the locator to associate with the object. If <b class="command">mibcomp</b> can't resolve the locator for a node by climbing the object tree, it assumes a locator of 0 and does not generate an error.</><br><dd><div class="Indent3"><a name="83596"> </a>Note: For almost all purposes, the memory address of the <b class="symbol_UC">MIBLEAF_T</b><b class="symbol_lc"> </b>structure makes a better unique identifier than a locator would, so it is almost never worth bothering to set the locator.</><br></dl></dl></dl><dd><div class="Item"><a name="83597"> </a><b class="symbol_lc">cookie</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84093"> </a>This is a C expression whose value is passed as the <b class="symbol_lc">cookie</b> argument to the above functions. Every <b class="symbol_lc">read-only</b>, <b class="symbol_lc">read-write</b>, or <b class="symbol_lc">read-create</b> object must have a <b class="symbol_lc">cookie</b> associated with it.</><br><dd><div class="Indent3"><a name="83598"> </a>The <b class="symbol_lc">cookie</b> expression may be any legal C expression suitable for initializing a <b class="symbol_lc">(char *)</b> variable at compile time (for instance, it cannot include function calls). The <b class="symbol_lc">cookie</b> may simply be 0 (the null pointer), or it may be a string naming a symbol in the system's kernel, or may be the address of the variable, or may have some other purpose defined by you. For example:</><br></dl></dl><dl class="margin"><dd><pre class="Code3"><b><a name="83599">        DEFAULT cookie (char *) 0 <i class="emphasis">            or </i>        DEFAULT cookie "_ipstats"</a></b></pre><dl class="margin"><dd><div class="Indent3"><a name="83600"> </a><b class="command">mibcomp</b> does <i class="emphasis">not</i> generate any declarations for symbols used in the <b class="symbol_lc">cookie</b> expression. If any are necessary, they must be declared in a file which is included through the use of the <b class="symbol_UC">FORCE-INCLUDE</b> statement, as described in section <a href="x-mibcomp4.html#83559"><i class="title">The FORCE-INCLUDE Keyword</i></a>.</><br></dl></dl></dl><dd><div class="Item"><a name="83604"> </a><b class="symbol_lc">leaf-name</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84097"> </a>This is the name that <b class="command">mibcomp</b> should use when generating a global <b class="symbol_UC">MIBLEAF_T</b> variable for this object. If <b class="command">mibcomp</b> cannot resolve the leaf name for a node by climbing the object tree, it declares the <b class="symbol_UC">MIBLEAF_T</b> to be <b class="symbol_UC">STATIC</b> and does not generate an error.</><br></dl></dl></dl></dl><dl class="margin"><dd><p class="Body"><a name="83607"> </a>For details on the <b class="command">-mib.c</b>, <b class="command">-skel</b>, and <b class="command">-skel.h</b> options to <b class="command">mibcomp</b>, see <a href="x-mibcompOut.html#83419"><i class="title">B.&nbsp;mibcomp Output Formats</i></a>.</p><dd><p class="Body"><a name="83609"> </a>It is not necessary to specify nine <b class="symbol_UC">DEFAULT</b> statements in every object definition in the MIB. If <b class="command">mibcomp </b>finds no <b class="symbol_UC">DEFAULT</b> on a particular object, it checks that object's parent, and the parent's parent, and so forth, until it finally finds the <b class="symbol_UC">DEFAULT</b> it needs or hits the root object in the MIB. Thus, you can easily use the same set of <b class="symbol_UC">DEFAULT</b>s for all objects in a group or a particular MIB or table quite easily, just by setting the <b class="symbol_UC">DEFAULT</b> in an object they all share as a parent. You can also override these inherited <b class="symbol_UC">DEFAULT</b>s by setting <b class="symbol_UC">DEFAULT</b>s at a lower layer.</p><dd><p class="Body"><a name="83610"> </a>The <b class="symbol_UC">DEFAULT</b> statements at the top of the MIB are associated with the root object in the MIB and are therefore inherited by all MIB objects, unless overridden. Only one input file should specify <b class="symbol_UC">DEFAULT</b> statements for the root object.</p><dd><p class="Body"><a name="83611"> </a>The value supplied to a <b class="symbol_UC">DEFAULT</b> statement can include several special strings. Each of the special strings begins with a percent sign (<b class="symbol_lc">%</b>). When <b class="command">mibcomp</b> comes across one of these special strings, it replaces it with a more meaningful string.</p><dd><p class="Body"><a name="83612"> </a>The <b class="symbol_lc">%</b> replacements are as follows:</p></dl><dl class="margin"><dd><div class="Item"><a name="83613"> </a><b class="symbol_lc">%%</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84099"> </a>replaced with a single percent sign.</><br></dl></dl></dl><dd><div class="Item"><a name="83614"> </a><b class="symbol_lc">%d</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84101"> </a>replaced with the name of the node where the <b class="symbol_UC">DEFAULT</b> statement was located, with no prepended module name. You can only use this where it resolves to a uniquely named object.</><br></dl></dl></dl><dd><div class="Item"><a name="83615"> </a><b class="symbol_lc">%D</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84103"> </a>replaced with the name of the node where the <b class="symbol_UC">DEFAULT</b> statement was located, prepended with the name of the module that contained the <b class="symbol_UC">DEFAULT</b> statement. The module name is separated from the object name by an underscore character (<b class="symbol_lc">_</b>).</><br></dl></dl></dl><dd><div class="Item"><a name="83616"> </a><b class="symbol_lc">%n</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84121"> </a>replaced with the name of the object, with no prepended module name. You can only use this where it resolves to a uniquely named object.</><br></dl></dl></dl><dd><div class="Item"><a name="84122"> </a><b class="symbol_lc">%N</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84123"> </a>replaced with the name of the object, prepended with the name of the module that contained the object. The module name is separated from the object name by an underscore character (<b class="symbol_lc">_</b>).</><br></dl></dl></dl><dd><div class="Item"><a name="84117"> </a><b class="symbol_lc">%p</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84118"> </a>replaced with the name of the object's parent, with no prepended module name. You can only use this where it resolves to a uniquely named object.</><br></dl></dl></dl><dd><div class="Item"><a name="83619"> </a><b class="symbol_lc">%P</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84111"> </a>replaced with the name of the object's parent, prepended with the name of the module that contained the parent object. The module name is separated from the object name by an underscore character(<b class="symbol_lc">_</b>).</><br></dl></dl></dl><dd><div class="Item"><a name="83620"> </a><b class="symbol_lc">%t</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84113"> </a>replaced with the object's C data type (for example, <b class="symbol_UC">INT32_T</b>).</><br></dl></dl></dl></dl><dl class="margin"><dd><p class="Body"><a name="83621"> </a>The <b class="symbol_lc">%d</b>, <b class="symbol_lc">%n</b>, and <b class="symbol_lc">%p</b> replacements can only be used where they do not cause name conflicts. Because ASN.1 object names are not guaranteed to be unique, it is not possible to construct unique C identifiers from all ASN.1 names. <b class="command">mibcomp</b> keeps track of these replacements and generates an error if you use one of these replacements in a way that appears to be ambiguous.</p><dd><p class="Body"><a name="83622"> </a>The <b class="symbol_lc">%D</b>, <b class="symbol_lc">%N</b>, and <b class="symbol_lc">%P</b> replacements prepend the name of the ASN.1 module that contains the object name, thus creating a unique identifier. The module name is separated from the object name by an underscore character(<b class="symbol_lc">_</b>).</p><dd><p class="Body"><a name="83623"> </a>All of the replacements that deal with object names convert all hyphen characters ( <b class="symbol_lc">-</b> ) in the ASN.1 object or module name to underscore characters (<b class="symbol_lc">_</b>).</p><dd><p class="Body"><a name="83624"> </a>Thus, if a module <b class="symbol_UC">FOO-MIB</b> defines an object <b class="symbol_lc">barObject</b>, the string <b class="symbol_lc">"get_%n"</b> in a <b class="symbol_UC">DEFAULT</b> on that object is replaced with <b class="symbol_lc">"get_barObject"</b> while the string <b class="symbol_lc">"get_%N"</b> is replaced with <b class="symbol_lc">"get_FOO_MIB_barObject"</b>.</p><dd><p class="Body"><a name="83625"> </a>For examples of the usage of these facilities, see the file <b class="file">$WIND_BASE/target/src/snmpv1/agent/snmpMib2.mib</b>.</p></dl><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="83627">The <b class="symbol_UC">EXCLUDE</b> Keyword</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="83628"> </a>The <b class="symbol_UC">EXCLUDE</b> keyword tells <b class="command">mibcomp</b> to remove a node and all of its children from the MIB tree. This removes ordinary MIB objects, object identifiers, and any internal nodes of the MIB tree that fall under the excluded node. <b class="command">mibcomp</b> also removes any traps or notifications which use this object or any of its children as its <b class="symbol_UC">ENTERPRISE</b> or as <b class="symbol_UC">VARIABLES</b>.</p></dl></dl><dl class="margin"><dd><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><a name="84905"><br></a><img border="0" alt="*" src="icons/note.gif">&nbsp;&nbsp;&nbsp;</td><td><div class="Note"><hr><b class="symbol_UC">NOTE: </b> The <b class="symbol_UC">EXCLUDE</b> keyword is particularly useful when scaling the MIB-II groups for your particular SNMP agent implementation; for more details, see <a href="c-config.html#83635"><i class="title">5.&nbsp;Configuring the WindNet SNMPv1/v2c Agent</i></a>.<hr></div></td></tr></table><dl class="margin"><dd><p class="Body"><a name="84909"> </a>The full syntax of the <b class="symbol_UC">EXCLUDE</b> keyword is:</p></dl><dl class="margin"><dd><pre class="Code"><b><a name="83634">EXCLUDE <i class="textVariable">module-name</i>.<i class="textVariable">object-name</i></a></b></pre></dl><dl class="margin"><dd><p class="Body"><a name="83635"> </a>where <i class="textVariable">module-name</i> is the MIB module name of an object to be excluded and <i class="textVariable">object-name</i> is the name of the object within the specified module. Usually you can omit the <i class="textVariable">module-name</i> and the separating dot character ("<b class="symbol_lc">.</b>"), but you may need to use the full syntax if there are multiple objects with the same name and you wish to exclude only one of them.</p><dd><p class="Body"><a name="83636"> </a>The <b class="command">-exclude</b> command line option is equivalent to the <b class="symbol_UC">EXCLUDE</b> keyword, and takes the same arguments.</p><dd><p class="Body"><a name="83637"> </a>Objects are excluded after all input files are processed and before any output is generated.</p><dd><p class="Body"><a name="83638"> </a>The objects listed in <b class="symbol_UC">EXCLUDE</b> statements in multiple input files and the command-line are all remembered and excluded.</p></dl></dl><dl class="margin"><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="83639">Comments</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="83640"> </a>A sequence of two adjacent hyphen characters (<b class="symbol_lc">--</b>) begins a comment in a MIB file or control file. The comment runs either to the next doubled hyphen or to the end of current line, whichever comes first. Comment lines are a convenience for human readers and are ignored by <b class="command">mibcomp</b>, except as specified in this section. Comments may not be used following a <b class="symbol_UC">DEFAULT</b> or <b class="symbol_UC">FORCE-INCLUDE</b> keyword, because these keywords take everything up to the end of the current line as their arguments. A doubled hyphen sequence inside a quoted string (like the text of a <b class="symbol_UC">DESCRIPTION</b> clause) does not start a comment.</p><dd><p class="Body"><a name="83641"> </a>Note that the extended keywords (<b class="symbol_UC">DEFAULT</b>, <b class="symbol_UC">EXCLUDE</b> and <b class="symbol_UC">FORCE-INCLUDE</b>) can all be specified with "<b class="symbol_lc">--</b>" immediately before them (with no intervening whitespace). This allows you to embed these keywords in standard MIB format files and not confuse other tools that do not recognize these keywords.</p></dl></dl><a name="foot"><hr></a><p class="FootnoteNumberMarker">1:&nbsp;<span class="Footnote"><a name="83527"> </a>For example, following the usual naming conventions, if your table is called <b class="symbol_lc">fooTable</b>, the <b class="symbol_lc">fooTable</b> object has one child, called <b class="symbol_lc">fooEntry</b>. The <b class="symbol_UC">INDEX</b> clause goes with the <b class="symbol_lc">fooEntry</b> object.</span><p class="FootnoteNumberMarker">2:&nbsp;<span class="Footnote"><a name="83564"> </a>To be precise, the generated <b class="symbol_lc">#include</b> line contains all text starting from the first non-whitespace character after the <b class="symbol_UC">FORCE-INCLUDE</b> keyword up through the first end-of-line character.</span><p class="FootnoteNumberMarker">3:&nbsp;<span class="Footnote"><a name="83581"> </a>The <i class="textVariable">string</i> starts with the first non-whitespace character after the end of the <i class="textVariable">label</i> argument and ends just before the first end-of-line character.</span><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a></a><a href="x-mibcomp.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="x-mibcomp3.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="x-mibcomp5.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p></body></html><!---by WRS Documentation (), Wind River Systems, Inc.    conversion tool:  Quadralay WebWorks Publisher 4.0.11    template:         CSS Template, Jan 1998 - Jefro --->

⌨️ 快捷键说明

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