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

📄 c-config2.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>    Configuring 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-config.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-config1.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-extend.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="83591">5.2  &nbsp;&nbsp;Configuring <b class="library">snmpIoLib</b> </a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83592"> </a>snmpIoLib contains routines which can be customized by an agent writer for specific needs. The following sections discuss routines which are present in the file <b class="file">$WIND_BASE/target/src/snmpv1/agent/</b>. For more information on an individual routine, see its corresponding manual page entry in <a href="snmp.refEntries.TOC.html#83416"><i class="title">F.&nbsp;SNMP Reference</i></a>. </p></dl></dl><dl class="margin"><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="83593"><b class="routine"><i class="routine">snmpIoInit</i></b><b>(&nbsp;)</b> - initialization routine for SNMP transport endpoint</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="83594"> </a>This routine initializes the SNMP transport endpoint on the target.</p><dd><p class="Body"><a name="83595"> </a>The provided source code illustrates the initialization of a socket interface. Alter this routine to suit the transport needs of your environment. </p></dl><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="83596"><b class="routine"><i class="routine">snmpIoWrite</i></b><b>(&nbsp;)</b> - write a packet to the transport</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="83597"> </a>This routine writes a datagram to the transport mechanism initialized in <b class="routine"><i class="routine">snmpIoInit</i></b><b>(&nbsp;)</b>. </p><dd><p class="Body"><a name="83598"> </a>The provided source code utilizes a call to the VxWorks routine <b class="routine"><i class="routine">sendto</i></b><b>(&nbsp;)</b> (see <i class="title">VxWorks Reference Manual</i>) to send a packet through a socket. Alter this routine to suit the transport needs of your environment.</p></dl><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="83599"><b class="routine"><i class="routine">snmpIoClose</i></b><b>(&nbsp;)</b> - close the transport endpoint</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="83600"> </a>This routine deallocates the resources for the transport endpoint initialized in <b class="routine"><i class="routine">snmpIoInit</i></b><b>(&nbsp;)</b>. This routine is invoked from the task-deletion hook installed by the SNMP agent during initialization; it is invoked if the agent is deleted by accident or from another task.</p><dd><p class="Body"><a name="83601"> </a>The provided source code example deallocates a socket. Alter this routine to suit the transport needs of your environment.</p></dl><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="83602"><b class="routine"><i class="routine">snmpIoMain</i></b><b>(&nbsp;)</b> - main SNMP I/O routine</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="83603"> </a>This routine is invoked as a task by the SNMP agent initialization process after preliminary initializations have successfully completed. In this routine, the user is required to initialize the transport endpoint by calling <b class="routine"><i class="routine">snmpIoInit</i></b><b>(&nbsp;)</b>, to initialize the views by calling the routine <b class="routine"><i class="routine">snmpIoViewInit</i></b><b>(&nbsp;)</b>, to set up the data structures needed to send traps, and then to complete initialization of the agent by calling <b class="routine"><i class="routine">snmpdInitFinish</i></b><b>(&nbsp;)</b>. All user-defined initialization should be performed here.</p><dd><p class="Body"><a name="83604"> </a>Any hooks that are required by the user are to be passed to <b class="routine"><i class="routine">snmpdInitFinish</i></b><b>(&nbsp;)</b>.  The transport endpoint must be initialized before <b class="routine"><i class="routine">snmpdInitFinish</i></b><b>(&nbsp;)</b> is called.</p><dd><p class="Body"><a name="83605"> </a>The main loop, <b class="routine"><i class="routine">snmpIoBody</i></b><b>(&nbsp;)</b>, is then invoked. The agent begins listening on UDP port 161 for incoming SNMP requests.</p></dl><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="83606"><b class="routine"><i class="routine">snmpIoBody</i></b><b>(&nbsp;)</b> - the top level loop of the SNMP agent</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="83607"> </a>This routine listens to the transport endpoint that was initialized in <b class="routine"><i class="routine">snmpIoInit</i></b><b>(&nbsp;)</b>. When a packet is received, it is handed off to the received-packet manager, <b class="routine"><i class="routine">snmpdPktProcess</i></b><b>(&nbsp;)</b>. The provided source code example illustrates this process using a socket. Alter this routine to suit the transport needs of your environment.</p></dl><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="83608"><b class="routine"><i class="routine">snmpIoTrapSend</i></b><b>(&nbsp;)</b> - send a trap</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="83612"> </a>This routine sends a standard SNMP or MIB-II trap message (see <a href="c-agent7.html#83785"><i class="title">4.7&nbsp;Traps</i></a>) to the network.  It is called by the SNMP agent at startup (to indicate a cold start) and when interface states change.</p><dd><p class="Body"><a name="83613"> </a>The provided source-code example illustrates this process using a socket interface. Alter this routine to suit the transport needs of your application.</p></dl><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="83614"><b class="routine"><i class="routine">snmpIoViewInit</i></b><b>(&nbsp;)</b> - sample view-initialization routine</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="83615"> </a>This routine creates the initial view table at agent-startup time. (For more information on view tables, see <a href="c-agent9.html#83916"><i class="title">4.9&nbsp;View Tables</i></a>.)</p><dd><p class="Body"><a name="83619"> </a>By default, the view is unrestricted. Alter this routine to provide restricted views of subsets of the MIB tree.</p></dl><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="83620"><b class="routine"><i class="routine">snmpIoCommunityValidate</i></b><b>(&nbsp;)</b> - sample community validation</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="83621"> </a>This routine is used to set up the view-index field in the SNMP packet. </p><dd><p class="Body"><a name="83622"> </a>By default, the <b class="keyword">priv</b> community is allowed to set MIB variables (initiate <b class="keyword">SET</b> request PDUs), and the <b class="keyword">pub</b> community is allowed to retrieve variables with <b class="keyword">GET</b>, <b class="keyword">GET NEXT</b>, or <b class="keyword">GET BULK</b> request PDUs. Alter this routine to provide a mechanism by which an incoming packet's community name can be validated and assigned a view-index for the corresponding request.</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="c-config.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-config1.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-extend.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 + -