📄 x-mibcomp5.html
字号:
</dl></dl></dl><dd><div class="Item"><a name="83702"> </a><b class="command">-mib.c</b></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84626"> </a><a href="x-mibcompOut.html#83488"><i class="title">-mib.c</i></a>. This is <b class="command">mibcomp</b>'s default output mode.</><br></dl></dl></dl><dd><div class="Item"><a name="83706"> </a><b class="command">-nametree</b></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84628"> </a><a href="x-mibcompOut.html#84057"><i class="title">-nametree</i></a></><br></dl></dl></dl><dd><div class="Item"><a name="83707"> </a><b class="command">-nowarn</b></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84630"> </a>The <b class="command">-nowarn</b> option suppresses all <b class="command">mibcomp</b> warning messages. <b class="command">mibcomp</b> still generates messages for fatal errors. You can set this option in your <b class="symbol_UC">MIBCOMP</b> environment variable, but this is not advisable, since most of <b class="command">mibcomp</b>'s warnings indicate potential problems in your MIB. See <b class="command">-quiet</b>.</><br></dl></dl></dl><dd><div class="Item"><a name="83711"> </a><b class="command">-numbers</b></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84632"> </a><a href="x-mibcompOut.html#83515"><i class="title">-numbers</i></a></><br></dl></dl></dl><dd><div class="Item"><a name="83712"> </a><b class="command">-o </b><i class="textVariable">outfile</i></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84634"> </a>The <b class="command">-o</b> option specifies that you want <b class="command">mibcomp</b> to write its output to <i class="textVariable">outfile</i>. If you do not specify this option, <b class="command">mibcomp</b> writes its output to a file named <b class="file">OUTPUT</b>.</><br><dd><div class="Indent3"><a name="84662"> </a>If you want <b class="command">mibcomp</b> to write its output file to the standard output stream, use "<b class="symbol_lc">-</b>" (a single hyphen character) as the output filename. This is most likely to be useful on a system like UNIX that supports I/O redirection.</><br></dl></dl></dl><dd><div class="Item"><a name="83716"> </a><b class="command">-partial</b></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84636"> </a><a href="x-mibcompOut.html#83531"><i class="title">-partial</i></a></><br></dl></dl></dl><dd><div class="Item"><a name="83717"> </a><b class="command">-partialm</b> <i class="textVariable">module-name <br></i><b></b></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84664"> </a><a href="x-mibcompOut.html#83541"><i class="title">-partialm</i></a></><br></dl></dl></dl><dd><div class="Item"><a name="83721"> </a><b class="command">-quiet</b></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84638"> </a>Normally <b class="command">mibcomp</b> generates a series of progress messages while it compiles a MIB, telling the user the name of the current module and current object. The <b class="command">-quiet</b> flag suppresses these progress messages. You may want to set the <b class="command">-quiet</b> option in your <b class="symbol_UC">MIBCOMP</b> environment variable. See <b class="command">-nowarn</b>.</><br></dl></dl></dl><dd><div class="Item"><a name="83725"> </a><b class="command">-readtree</b></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84640"> </a><a href="x-mibcompOut.html#83555"><i class="title">-readtree</i></a></><br></dl></dl></dl><dd><div class="Item"><a name="85065"> </a><b class="command">-rootname</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="85067"> </a>The<b class="command"> -rootname</b> option lets you specify the name of the root of the tree. Use this option if you need multiple MIB trees within one address space. </><br></dl></dl></dl><dd><div class="Item"><a name="85075"> </a><b class="command">-sigid</b> </div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="85076"> </a>The<b class="command"> -sigid</b> option lets you specify the number of significant characters in an identifier. If, during output, the MIB compiler detects identifiers that are not unique within the specified limit, it prints out a warning. The default limit is 31. </><br></dl></dl></dl><dd><div class="Item"><a name="83729"> </a><b class="command">-skel</b></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84642"> </a><a href="x-mibcompOut.html#83578"><i class="title">-skel</i></a></><br></dl></dl></dl><dd><div class="Item"><a name="83733"> </a><b class="command">-skel.h</b></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84644"> </a><a href="x-mibcompOut.html#83589"><i class="title">-skel.h</i></a></><br></dl></dl></dl><dd><div class="Item"><a name="83734"> </a><b class="command">-start </b><i class="textVariable">module-name</i><b class="command">.</b><i class="textVariable">object-name <br></i></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84669"> </a>The <b class="command">-start</b> option instructs certain <b class="command">mibcomp</b> output modes to begin their output starting at the named node in the MIB tree rather than at the root which is the default. This option is effective for all applicable back ends. </><br><dd><div class="Indent3"><a name="84976"> </a>The <b class="command">-start</b> option is particularly useful when constructing MIBs that are linked to the SNMP agent dynamically. For more information, see <a href="c-extend4.html#84262"><i class="title">6.4 Dynamic MIB Additions</i></a>.</><br></dl></dl></dl><dd><div class="Item"><a name="84980"> </a><b class="command">-statistics</b></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84646"> </a>The <b class="command">-statistics</b> option instructs <b class="command">mibcomp</b> to print some simple statistics about the MIB compilation: how many objects were specified, how many traps, and how long the compilation took. You may wish to set the <b class="command">-statistics</b> option in your MIBCOMP environment variable. <b class="command">mibcomp</b> writes the statistics to the standard-error output stream, so using -<b class="command">statistics</b> does not get in the way if you have told <b class="command">mibcomp</b> to write its output file to the standard-output stream.</><br></dl></dl></dl><dd><div class="Item"><a name="83743"> </a><b class="command">-stub</b></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84648"> </a><a href="x-mibcompOut.html#83598"><i class="title">-stub</i></a></><br></dl></dl></dl><dd><div class="Item"><a name="83744"> </a><i class="textVariable">file1</i><b class="command"> [ </b><i class="textVariable">file2</i><b class="command"> . . .]</b> <br></div><dl class="margin"><dl class="margin"><dl class="margin"><dd><div class="Indent3"><a name="84671"> </a>Filenames specify files for <b class="command">mibcomp</b> to use as input. You must specify at least one input file. You can use "<b class="symbol_lc">-</b>" (a single hyphen character) to specify that <b class="command">mibcomp</b> should read from standard input.</><br></dl></dl></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="83745">A.5.2 Compiling a MIB Description File</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83746"> </a>Assume that you want to build an agent that supports MIB-II, that you keep your MIBs in a standard directory, that you have included that directory in a default search path via the MIBCOMP environment variable, and that the control file for your project is in the current directory under the name <b class="file">control.mib</b>. To generate the C code that a WindNet SNMPv1/v2c-based agent uses to represent the MIB tree, leaving the output in a file called <b class="file">mib.c</b>, do:</p><dl class="margin"><dd><pre class="Code2"><b><a name="83750">mibcomp -mib.c -o mib.c rfc1213.mib control.mib</a></b></pre></dl><dd><p class="Body"><a name="83751"> </a>You can modify a makefile to do this automatically by adding the following lines to your makefile:</p><dl class="margin"><dd><pre class="Code2"><b><a name="83752">mib.c: control.mib mibcomp -mib.c -o mib.c rfc1213.mib control.mib</a></b></pre></dl><dd><p class="Body"><a name="83753"> </a>After adding these lines to your makefile, you can use the <b class="command">make</b> utility to generate <b class="file">mib.c</b> automatically:</p><dl class="margin"><dd><pre class="Code2"><b><a name="83754">make mib.c</a></b></pre></dl><dd><p class="Body"><a name="83755"> </a>If your makefile also has rules that use <b class="file">mib.c</b> as a source, you should be able to just build your program normally, letting <b class="command">make</b> build <b class="file">mib.c</b> for you when necessary. For an example of makefile construction, see <b class="symbol_UC">$WIND_BASE</b><b class="file">/target/src/snmpv1/agent/Makefile</b>.</p><dd><p class="Body"><a name="83756"> </a>Whether you create <b class="file">mib.c</b> manually or with the <b class="command">make</b> utility, you should be able to compile it without error using the same compiler switches that you use to compile the target agent. If <b class="file">mib.c</b> does not compile, there is probably something wrong with your control file (<b class="file">control.mib</b> in this example).</p></dl></dl><a name="foot"><hr></a><p class="FootnoteNumberMarker">1: <span class="Footnote"><a name="83676"> </a>K&R" stands for "Kernighan and Ritchie C," named after the authors of the original C language reference.</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-mibcomp4.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="x-mibcomp6.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 + -