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

📄 snmp.refentries.toc73.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title><i class="i">snmpMasterHandlerWR</i>(&nbsp;)     SNMP Reference   </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="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><font face="Helvetica, sans-serif" class="sans"><h2 class="H1"><i><a name="89727"> <i class="i">snmpMasterHandlerWR</i>(&nbsp;) </a></i></h2></font><h4 class="SH"><a name="89728"> </a>NAME </h4><dl class="margin"><dl class="margin"><dd><a name="89729"><div class="aX"><b class="routine"><i class="routine">snmpMasterHandlerWR</i></b><b>(&nbsp;)</b>     -     synchronous version of <b class="routine"><i class="routine">snmpMasterHandlerAsync</i></b><b>(&nbsp;)</b> </div></a></dl></dl><h4 class="SH"><a name="89730"> </a>SYNOPSIS </h4><dl class="margin"><dl class="margin"><dd><pre class="Code"><b><a name="89731">INT_32_T snmpMasterHandlerWR &nbsp;&nbsp;&nbsp;&nbsp;( &nbsp;&nbsp;&nbsp;&nbsp;OCTET_T *&nbsp;&nbsp;&nbsp;&nbsp;pMsg,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* pointer to the message&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/ &nbsp;&nbsp;&nbsp;&nbsp;ALENGTH_T&nbsp;&nbsp;&nbsp;&nbsp;msgl,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* length of the message&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */ &nbsp;&nbsp;&nbsp;&nbsp;IPCSEND_T *&nbsp;&nbsp;pIpcSend,&nbsp;&nbsp; /* send routine&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/ &nbsp;&nbsp;&nbsp;&nbsp;IPCRCV_T *&nbsp;&nbsp; pIpcRcv,&nbsp;&nbsp;&nbsp;&nbsp;/* receive routine&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */ &nbsp;&nbsp;&nbsp;&nbsp;IPCFREE_T *&nbsp;&nbsp;pIpcFree,&nbsp;&nbsp; /* free routine&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/ &nbsp;&nbsp;&nbsp;&nbsp;IPCAYT_T *&nbsp;&nbsp; pIpcAyt,&nbsp;&nbsp;&nbsp;&nbsp;/* status Check Routine&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/ &nbsp;&nbsp;&nbsp;&nbsp;PTR_T&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ipchandle,&nbsp;&nbsp;/* ipchandle for the IPC scheme used */ &nbsp;&nbsp;&nbsp;&nbsp;EBUFFER_T *&nbsp;&nbsp;pBuf,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* buffer to place reply in&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/ &nbsp;&nbsp;&nbsp;&nbsp;VBL_T *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pVblist,&nbsp;&nbsp;&nbsp;&nbsp;/* place to put varbinds&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */ &nbsp;&nbsp;&nbsp;&nbsp;PTR_T&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user_priv&nbsp;&nbsp; /* MIB tree identifier&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */ &nbsp;&nbsp;&nbsp;&nbsp;)</a></b></pre></dl></dl><h4 class="SH"><a name="89744"> </a>DESCRIPTION </h4><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="89745"> </a>This function is called to process the control messages received from subagents when the communication method between master and subagent is synchronous.</p><dd><p class="Body"><a name="89746"> </a>To process a registration request, this function extracts the objects from the message and adds them as a group to the master agent's MIB tree. The actual get, test, and set methods for these objects reside in the subagent. To set up local methods for these routines, <b class="routine"><i class="routine">snmpMasterHandlerAsync</i></b><b>(&nbsp;)</b> uses the function referenced in <i class="i">pIpcSend</i> and <i class="i">pIpcRcv</i>.</p><dd><p class="Body"><a name="89747"> </a>The methods local to the master agent use <i class="i">pIpcSend</i> to send queries to the subagent which locally executes the actual method routine for the object. The subagent then transmits the results back to the master agent's public queue. When the function monitoring this queue sees the query response, it transfers the message to the master agent's local queue where the <i class="i">pIpcRcv</i> function is waiting for the response.</p><dd><p class="Body"><a name="89748"> </a>To process a deregistration request, this function extracts a group ID from the message and removes that group of objects from the master agent's MIB tree. It also executes the function in <i class="i">pIpcFree</i> to free any resources allocated locally to maintain the IPC link with the deregistered subagent.</p><dd><p class="Body"><a name="89749"> </a>The <b class="routine"><i class="routine">snmpMasterHandlerWR</i></b><b>(&nbsp;)</b> routine returns information using the output parameters <i class="i">pBuf</i> and <i class="i">pVblist</i> and its function return value. If the returned function value indicates success, the master agent sends the message returned in <i class="i">pBuf</i> to the subagent that sent the registration or deregistration request. If the returned value of this function indicates failure, the master agent silently drops the packet.</p><dd><p class="Body"><a name="89750"> </a>This function as has the ability to return an opcode value, although this functionality is unused in the shipped version of WindNet SNMP. In fact, if <b class="routine"><i class="routine">snmpMasterHandlerWR</i></b><b>(&nbsp;)</b> were to return an opcode, the current implementation of the master agent would silently drop the packet. The possibility of returning an opcode is supported to make it possible for you to create subagents that send traps. In this case, <b class="routine"><i class="routine">snmpMasterHandlerWR</i></b><b>(&nbsp;)</b> would return an opcode and a varbind list using the <i class="i">pVblist</i> parameter. You could then rewrite <b class="routine"><i class="routine">snmpQueMonitor</i></b><b>(&nbsp;)</b>, the master agent function that calls <b class="routine"><i class="routine">snmpMasterHandlerWR</i></b><b>(&nbsp;)</b>, so that it responds appropriately to the returned opcode and forwards the contents of <i class="i">pVblist</i> to the SNMP manager.</p><dd><p class="Body"><a name="89751"> </a>Use the <b class="routine"><i class="routine">snmpMasterHandlerWR</i></b><b>(&nbsp;)</b> parameters as follows: </p><dl class="margin"><dd><div class="Indent"><a name="89752"> </a><i class="i">pMsg <br></i>Expects a pointer to an <b>EBUFFER_T</b> structure containing the data part of the message from the subagent. The message shows up on the queue as an <b>SA_MESSAGE_T</b> structure. The message expected by this parameter is contained in the <b>mesg</b> member of the <b>SA_MESSAGE_T</b> structure. To extract this pointer, you can use the <b>EbufferStart</b> macro defined in defined in <b>buffer.h</b>. </div><br><dd><div class="Indent"><a name="89753"> </a><i class="i">msgl <br></i>Expects the length of the message referenced in <i class="i">pMsg</i>. To retrieve this length value, use the <b>EBufferUsed</b> macro defined in <b>buffer.h</b>. </div><br><dd><div class="Indent"><a name="89754"> </a><i class="i">pIpcSend <br></i>Expects a pointer to the function that method routines should use to send messages to the subagent. This function must be of the form: </div><br></dl><dl class="margin"><dd><pre class="Code2"><b><a name="89755">INT_32_T masterIpcSend &nbsp;&nbsp; ( &nbsp;&nbsp; EBUFFER_T *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pBuf,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* message to be sent &nbsp;&nbsp; PTR_T&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ipchandle&nbsp;&nbsp;/* address of subagent &nbsp;&nbsp; )</a></b></pre></dl><dl class="margin"><dd><div class="Indent"><a name="89756"> </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 send a message to the subagent to make a test, get, or set query against those variables. After using this function to send the message, the master agent then calls the function referenced in <i class="i">pIpcRcv</i>. The <i class="i">pIpcRcv</i> function waits on a local queue for a response from the subagent. For an example of an <b class="routine"><i class="routine">masterIpcSend</i></b><b>(&nbsp;)</b> routine, see the <b class="routine"><i class="routine">masterIpcSend</i></b><b>(&nbsp;)</b> defined in <b>masterIoLib.c</b>. </div><br><dd><div class="Indent"><a name="89757"> </a><i class="i">ipcRcv <br></i>Expects a pointer to a function of the form: </div><br></dl><dl class="margin">

⌨️ 快捷键说明

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