📄 snmp.refentries.toc2.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title>saIoLib 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.TOC1.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="snmp.refEntries.TOC3.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="88652"> saIoLib </a></i></h2></font><h4 class="SH"><a name="88653"> </a>NAME </h4><dl class="margin"><dl class="margin"><dd><a name="88654"><div class="aX"><b class="library">saIoLib</b> - default transport routines for SNMP subagent </div></a></dl></dl><h4 class="SH"><a name="88655"> </a>SYNOPSIS </h4><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="88656"> </a><b class="routine"><i class="routine">snmpSaInit</i></b><b>( )</b> - initialize the subagent </p><dd><p class="Body"><a name="88657"> </a><b class="routine"><i class="routine">saIoWrite</i></b><b>( )</b> - send a packet to the master agent's message queue </p><dd><p class="Body"><a name="88658"> </a><b class="routine"><i class="routine">saIpcFree</i></b><b>( )</b> - free the specified IPC mechanism </p><dd><p class="Body"><a name="88659"> </a><b class="routine"><i class="routine">saMsgBuild</i></b><b>( )</b> - build and encode a message and send it to the master agent </p><dd><p class="Body"><a name="88660"> </a><b class="routine"><i class="routine">hdrBlkBuild</i></b><b>( )</b> - create the header block and the demuxer information </p><dd><p class="Body"><a name="88661"> </a><b class="routine"><i class="routine">envoy_now</i></b><b>( )</b> - return the number of clock ticks elapsed since the timer was set </p><dd><p class="Body"><a name="88662"> </a><b class="routine"><i class="routine">envoy_call_timer</i></b><b>( )</b> - execute the specified function when the timer expires </p></dl><dl class="margin"><dd><pre class="Code"><b><a name="88663">PTR_T snmpSaInit (PTR_T saId, PTR_T sa_root, SA_REG_COMPLETE_T saRegComp) </a></b><dd> <b><a name="88664">STATUS saIoWrite (PTR_T ipchandle, EBUFFER_T * pBuf, INT_32_T code) </a></b><dd> <b><a name="88665">void saIpcFree (PTR_T ipchandle) </a></b><dd> <b><a name="88666">void saMsgBuild (VBL_T * vblist, SA_HEADER_T * hdr_blk, SA_DEMUX_T * demuxer, PTR_T saId) </a></b><dd> <b><a name="88667">void hdrBlkBuild (SA_HEADER_T * hdr, VBL_T * vblist, int opt, int group, PTR_T saId) </a></b><dd> <b><a name="88668">bits32_t envoy_now (void) </a></b><dd> <b><a name="88669">void envoy_call_timer (bits32_t when, void (*what)(void)) </a></b></pre></dl></dl><h4 class="SH"><a name="88670"> </a>DESCRIPTION </h4><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="88671"> </a>This library implements the subagent side of the IPC mechanism used to pass messages between the SNMP master agent and its subagents. In the shipped version of this library, the IPC mechanism is a message queue. However, it is a relatively simple matter to replace the message queue with a socket if you cannot use message queues.</p><dd><p class="Body"><a name="88672"> </a>To set up the IPC mechanism and spawn a task to monitor it, call <b class="routine"><i class="routine">snmpSaInit</i></b><b>( )</b>. To send a message to the master agent, you can call <b class="routine"><i class="routine">saIoWrite</i></b><b>( )</b>. However, you will likely never call this function directly. Instead, you will call <b class="routine"><i class="routine">hdrBlkBuild</i></b><b>( )</b>. Internally, <b class="routine"><i class="routine">hdrBlkBuild</i></b><b>( )</b> calls <b class="routine"><i class="routine">saMsgBuild</i></b><b>( )</b>, which calls <b class="routine"><i class="routine">snmpSubEncode</i></b><b>( )</b> and finally <b class="routine"><i class="routine">saIoWrite</i></b><b>( )</b>.</p><dd><p class="Body"><a name="88673"> </a>The first message you will transmit using <b class="routine"><i class="routine">hdrBlkBuild</i></b><b>( )</b> will be a registration message that registers objects and instances as a group in the master agent's MIB tree. If successful, the response to this message will contain a group ID. Make sure that you store this ID so that you can later remove the group from the MIB tree when you want to deregister the subagent. You also need this ID if you want to register instances of the object just registered.</p><dd><p class="Body"><a name="88674"> </a>Exactly how and when you register a subagent is up to you, but keep in mind that you can do so only after the master agent is up an running. </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.TOC1.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="snmp.refEntries.TOC3.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 + -