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

📄 x-mibcomp6.html

📁 vxworks相关论文
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title>    The MIB Compiler User's Guide   </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="x-mibcomp.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="x-mibcomp5.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="x-mibcompOut.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="83757">A.6  &nbsp;&nbsp;How-To Guide</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83758"> </a>This section is a "how-to" guide to <b class="command">mibcomp</b>. It lists uses for <b class="command">mibcomp</b> and gives a short summary of instructions for each use.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="83760">A.6.1  &nbsp;&nbsp;Check a MIB for Errors</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83761"> </a>To use <b class="command">mibcomp</b> as a MIB checker, specify the <b class="command">-check</b> option instead of an output mode. For instance, to verify that <b class="file">foo.mib</b> is syntactically correct:</p><dl class="margin"><dd><pre class="Code2"><b><a name="83762">mibcomp -check foo.mib</a></b></pre></dl><dd><p class="Body"><a name="83763"> </a>All real MIBs contain <b class="symbol_UC">IMPORT</b> statements. <b class="command">mibcomp</b> has built-in knowledge of the set of standard MIB modules that make up the SNMPv1 SMI: RFC1155-SMI,RFC-1212, and RFC-1215. If <b class="file">foo.mib</b> imports anything from any module not listed here, you must load that module before you can load <b class="file">foo.mib</b>. If, for example, <b class="file">foo.mib</b> imports the <b class="symbol_lc">DisplayString</b> textual convention from MIB-II (RFC1213-MIB, in the file <b class="file">rfc1213.mib</b>), you would need to do:</p><dl class="margin"><dd><pre class="Code2"><b><a name="83764">mibcomp -check rfc1213.mib foo.mib{}</a></b></pre></dl><dd><p class="Body"><a name="83765"> </a>Note that the order of the file names on the command line is important: if you specify the files in the wrong order, <b class="command">mibcomp</b> complains when it tries to process the <b class="symbol_UC">IMPORT</b> statement in <b class="file">foo.mib</b> and fails to find RFC1213-MIB in its internal database.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="83766">A.6.2  &nbsp;&nbsp;Set Personal Options for <b class="command">mibcomp</b> Use</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83767"> </a>To set options for your personal use of <b class="command">mibcomp</b>, use the MIBCOMP environment variable. You can set any command-line arguments you want in this variable; they are processed before the actual command line itself is processed. You can even use automated response files in the variable.</p><dd><p class="Body"><a name="83768"> </a>Most users only specify a search path for their MIB files, the <b class="command">-quiet</b> option and the <b class="command">-statistics</b> option in their MIBCOMP environment variables. Please refer to your operating- system manual to find out how to set environment variables.</p><dd><p class="Body"><a name="83771"> </a>For a complete list of <b class="command">mibcomp</b>'s command line options, please see <a href="x-mibcomp5.html#83643"><i class="title">A.5&nbsp;Running mibcomp</i></a>.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="83773">A.6.3  &nbsp;&nbsp;Create Procedure Skeletons for Method Routines in an Agent</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83774"> </a>You can save yourself time when coding the <b class="symbol_lc">get</b>, <b class="symbol_lc">set</b>, <b class="symbol_lc">test</b>, and <b class="symbol_lc">next</b> method routines for MIB objects by having <b class="command">mibcomp</b> generate skeletal procedures for these method routines. The skeletal procedures already have all the arguments and the return value declared, so you do not have to look these up and remember to specify them all. To generate skeletal procedures for the method routines functions, use the <b class="command">-skel</b> or <b class="command">-stub</b> option. Please see <a href="x-mibcompOut.html#83578"><i class="title">-skel</i></a>and <a href="x-mibcompOut.html#83598"><i class="title">-stub</i></a>, for more details.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="83781">A.6.4  &nbsp;&nbsp;Create Procedure Prototypes for Method Routines in an Agent</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83782"> </a>For consistency checking, you should have external declarations and procedure prototypes for all your MIB method routines. <b class="command">mibcomp</b> can generate these for you, with the <b class="command">-skel.h</b> flag. You can then use this file to cross-check consistency of argument usage between the arguments the target agent expects, the functions used in the <b class="file">mib.c</b> file, and the functions you provide. Please see <a href="x-mibcompOut.html#83589"><i class="title">-skel.h</i></a>, for more details.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="83786">A.6.5  &nbsp;&nbsp;Generate <b class="file">mib.rt</b> for an SNMP Manager Utility</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83787"> </a>A <b class="file">.rt</b> file can be used by an SNMP manager to facilitate parsing a known MIB tree. You can generate a new <b class="file">mib.rt</b> file for an SNMP manager utility with <b class="command">mibcomp</b>'s <b class="command">-readtree</b> output mode option. (<b class="file">.rt </b>stands for <i class="emphasis">readtree</i>.) To generate a new <b class="file">mib.rt</b> containing symbols from MIB-II, do:</p><dl class="margin"><dd><pre class="Code2"><b><a name="83788">mibcomp -readtree -o mib.rt rfc1213.mib</a></b></pre></dl><dd><p class="Body"><a name="83789"> </a>If <b class="command">mibcomp</b> generates an error message instead of a useful <b class="file">mib.rt</b> file, please see section <a href="x-mibcomp6.html#83760"><i class="title">A.6.1&nbsp;Check a MIB for Errors</i></a>.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="83793">A.6.6  &nbsp;&nbsp;Read Standard Input as an Input File</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83794"> </a>If you specify a single hyphen ("<b class="symbol_lc">-</b>") as an argument to <b class="command">mibcomp</b>, <b class="command">mibcomp</b> treats it as a request to use standard input as an input file.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="83795">A.6.7  &nbsp;&nbsp;Write <b class="command">mibcomp</b>'s Output to Standard Output</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83796"> </a>If you specify a single hyphen ("<b class="symbol_lc">-</b>") as the argument to the <b class="command">-o</b> option, <b class="command">mibcomp</b> treats it as a request to use standard output as the output file.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="83798">A.6.8  &nbsp;&nbsp;Get Around the MS-DOS Command Line Length Limit</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83799"> </a>MS-DOS has a command-line length limit of roughly 128 characters. To get around this limit, use an automated response file as an argument. Arguments that start with a "<b class="symbol_lc">@</b>" character are requests to <b class="command">mibcomp</b> that it read from an automated response file. <b class="command">mibcomp</b> reads the contents of the specified file as if they were on the command line. You may use several automated response files on one command line, and may mix them and regular options on the command line.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="83800">A.6.9  &nbsp;&nbsp;Windows NT Filename Case-Insensitive</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83801"> </a>Windows NT has the capability to access filenames longer than the standard MS-DOS 8x3. However, even though these filenames appear to be case-sensitive, they are accessed in a case-insensitive manner, such that the file <b class="file">MyFile.c</b> is equivalent to <b class="file">myfile.c</b>. While this is not a bug, it is something to keep in mind while working with Windows NT.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="83802">A.6.10  &nbsp;&nbsp;Put Comments in an Automated Response File</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83803"> </a>You may want to embed comments in an automated response file to explain what the file is doing. <b class="command">mibcomp</b> ignores any line in an automated response file that starts with the number- (hash-) sign ("<b class="symbol_lc">#</b>"), a semicolon ("<b class="symbol_lc">;</b>"), or two hyphens("<b class="symbol_lc">--</b>").</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="83804">A.6.11  &nbsp;&nbsp;Read <b class="command">mibcomp</b> Commands from Standard Input</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83805"> </a><b class="command">mibcomp</b>'s support for automated response files is intended primarily to work around the short MS-DOS command-line length limit, as described in <a href="x-mibcomp6.html#83798"><i class="title">A.6.8&nbsp;Get Around the MS-DOS Command Line Length Limit</i></a>. However, you can also use this feature to read <b class="command">mibcomp</b> commands from standard input. If you use "<b class="symbol_lc">-</b>" (a single hyphen character) as the name of an automated response file, <b class="command">mibcomp</b> reads command line options from standard input. This could be useful if you are running <b class="command">mibcomp</b> as part of a complicated UNIX pipeline sequence.</p><dd><p class="Body"><a name="83809"> </a></p><dd><p class="Body"><a name="79990"> </a></p></dl></dl><a name="foot"><hr></a><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-mibcomp5.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="x-mibcompOut.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 + -