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

📄 snmp.refentries.toc73.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<dd><pre class="Code2"><b><a name="89758">INT_32_T masterIpcRcv  &nbsp;&nbsp; ( &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EBUFFER_T *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pBuf,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* buffer to receive message &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PTR_T&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ipchandle&nbsp;&nbsp;&nbsp;&nbsp;/* address of subagent &nbsp;&nbsp; )</a></b></pre></dl><dl class="margin"><dd><div class="Indent"><a name="89759"> </a>If <b class="routine"><i class="routine">snmpMasterHandlerWR</i></b><b>(&nbsp;)</b> is processing a registration request from the subagent, it associates this function pointer with the group of objects it adds to the master agent's MIB tree. The methods for those objects call this routine to wait on a local queue for a response from the subagent. For an example of an <b class="routine"><i class="routine">masterIpcRcv</i></b><b>(&nbsp;)</b>, see the <b class="routine"><i class="routine">masterIpcRcv</i></b><b>(&nbsp;)</b> defined in <b>masterIoLib.c</b>. </div><br><dd><div class="Indent"><a name="89760"> </a><i class="i">ipcFree <br></i>Expects a pointer to a function of the form: </div><br></dl><dl class="margin"><dd><pre class="Code2"><b><a name="89761">void masterIpcFree ( PTR_T ipchandle )</a></b></pre></dl><dl class="margin"><dd><div class="Indent"><a name="89762"> </a>The master agent uses this function to free any resources it allocated to maintain the IPC link with the subagent. The master agent calls this function when a subagent deregisters. </div><br><dd><div class="Indent"><a name="89763"> </a><i class="i">pIpcAyt <br></i>Expects a pointer to the function the master agent can use to test the connection with the subagent. This function must be of the form: </div><br></dl><dl class="margin"><dd><pre class="Code2"><b><a name="89764">INT_32_T masterIpcAyt ( PTR_T ipchandle )</a></b></pre></dl><dl class="margin"><dd><div class="Indent"><a name="89765"> </a>For an example of such a function, see the <b class="routine"><i class="routine">masterIpcAyt</i></b><b>(&nbsp;)</b> defined in <b>masterIoLib.c</b>. </div><br><dd><div class="Indent"><a name="89766"> </a><i class="i">ipchandle <br></i>Expects a pointer to the IPC handle used to access the subagent that sent this message. In the shipped implementation, this is a pointer to a message queue. </div><br><dd><div class="Indent"><a name="89767"> </a><i class="i">pBuf <br></i>Expects a pointer to a previously allocated EBUFFER_T. This is an output parameter that <b class="routine"><i class="routine">snmpMasterHandlerWR</i></b><b>(&nbsp;)</b> uses this to return a reply packet, if one is generated. For example, if <b class="routine"><i class="routine">snmpMasterHandlerWR</i></b><b>(&nbsp;)</b> successfully processes a registration request, it writes a message to the EBUFFER_T at <i class="i">pBuf</i>. This message contains the group ID for the objects just added to the master agent's MIB tree. When control returns from <b class="routine"><i class="routine">snmpMasterHandlerWR</i></b><b>(&nbsp;)</b>, you must transmit this message back to the subagent, which will store the group ID for use in a deregistration request. In the current implementation, <b class="routine"><i class="routine">snmpQueMonitor</i></b><b>(&nbsp;)</b> already handles this for you. </div><br><dd><div class="Indent"><a name="89768"> </a><i class="i">pVblist <br></i>Expects a pointer to a previously allocated VBL_T. The intended use of this parameter is to provide an output vehicle for the varbind list received in a trap message from a subagent. Because of the application-dependent nature of traps, the shipped implementation of <b class="routine"><i class="routine">snmpQueMonitor</i></b><b>(&nbsp;)</b> just drops the packet. However, if you want to support traps from your subagents, you can modify <b class="routine"><i class="routine">snmpQueMonitor</i></b><b>(&nbsp;)</b> to check the returned value of <b class="routine"><i class="routine">snmpMasterHandlerWR</i></b><b>(&nbsp;)</b> to watch for a trap message. You can then use <b class="routine"><i class="routine">snmpIoTrapSend</i></b><b>(&nbsp;)</b> to forward the trap message in <i class="i">pVblist</i> to the SNMP manager. </div><br><dd><div class="Indent"><a name="89769"> </a><i class="i">user_priv <br></i>Expects a pointer to the MIB tree from which registration and deregistration requests want to add or delete objects or instances. If this pointer is NULL, the default MIB tree specified by mib_root_node is used. </div><br></dl><dd><p class="Body"><a name="89770"> </a>If the message is trap request, it is the responsibility of the user code to acquire any values not specified in the trap message and to send the trap to the manager. </p></dl></dl><h4 class="SH"><a name="89771"> </a>RETURNS </h4><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="89772"> </a>The opcode from the decoded packet or 0 or -1. An returned value of 0 indicates an error for which you should just drop the packet. A return value of -1 indicates success.</p><dd><p class="Body"><a name="89773"> </a>If this function returns an opcode, a value from 1 to 127, the shipped implementation just drops the packet. However, to support traps from the subagent, you could modify <b class="routine"><i class="routine">snmpQueMonitor</i></b><b>(&nbsp;)</b> to note a returned value of <b>SA_TRAP_REQUEST</b> and then forward the varbind list in <i class="i">pVblist</i> to the SNMP manager. </p></dl></dl><h4 class="SH"><a name="89774"> </a>SEE ALSO </h4><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="89775"> </a><b>subagentLib</b> </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="snmp.refEntries.TOC.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="snmp.refEntries.TOC72.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="snmp.refEntries.TOC74.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 + -