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

📄 saiolib.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/saIoLib.html - generated by refgen from saIoLib.c --> <title> saIoLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual :  Libraries</i></a></p></blockquote><h1>saIoLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>saIoLib</strong> - default transport routines for SNMP subagent </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./saIoLib.html#snmpSaInit">snmpSaInit</a></i>(&nbsp;)</b>  -  initialize the subagent<br><b><i><a href="./saIoLib.html#saIoWrite">saIoWrite</a></i>(&nbsp;)</b>  -  send a packet to the master agent's message queue<br><b><i><a href="./saIoLib.html#saIpcFree">saIpcFree</a></i>(&nbsp;)</b>  -  free the specified IPC mechanism<br><b><i><a href="./saIoLib.html#saMsgBuild">saMsgBuild</a></i>(&nbsp;)</b>  -  build and encode a message and send it to the master agent<br><b><i><a href="./saIoLib.html#hdrBlkBuild">hdrBlkBuild</a></i>(&nbsp;)</b>  -  create the header block and the demuxer information<br><b><i><a href="./saIoLib.html#envoy_now">envoy_now</a></i>(&nbsp;)</b>  -  return the number of clock ticks elapsed since the timer was set<br><b><i><a href="./saIoLib.html#envoy_call_timer">envoy_call_timer</a></i>(&nbsp;)</b>  -  execute the specified function when the timer expires<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library implements the subagent side of the IPC mechanism used topass messages between the SNMP master agent and its subagents.  In theshipped version of this library, the IPC mechanism is a message queue.However, it is a relatively simple matter to replace the message queuewith a socket if you cannot use message queues.<p>To set up the IPC mechanism and spawn a task to monitor it, call <b><i><a href="./saIoLib.html#snmpSaInit">snmpSaInit</a></i>(&nbsp;)</b>.To send a message to the master agent, you can call <b><i><a href="./saIoLib.html#saIoWrite">saIoWrite</a></i>(&nbsp;)</b>.  However,you will likely never call this function directly.  Instead, you willcall <b><i><a href="./saIoLib.html#hdrBlkBuild">hdrBlkBuild</a></i>(&nbsp;)</b>.  Internally, <b><i><a href="./saIoLib.html#hdrBlkBuild">hdrBlkBuild</a></i>(&nbsp;)</b> calls <b><i><a href="./saIoLib.html#saMsgBuild">saMsgBuild</a></i>(&nbsp;)</b>, whichcalls <b><i><a href="./subagentLib.html#snmpSubEncode">snmpSubEncode</a></i>(&nbsp;)</b> and finally <b><i><a href="./saIoLib.html#saIoWrite">saIoWrite</a></i>(&nbsp;)</b>.<p>The first message you will transmit using <b><i><a href="./saIoLib.html#hdrBlkBuild">hdrBlkBuild</a></i>(&nbsp;)</b> will be aregistration message that registers objects and instances as a group inthe master agent's MIB tree.  If successful, the response to this messagewill contain a group ID.  Make sure that you store this ID so that youcan later remove the group from the MIB tree when you want to deregisterthe subagent.  You also need this ID if you want to register instancesof the object just registered.<p>Exactly how and when you register a subagent is up to you, but keep inmind that you can do so only after the master agent is up an running.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./saIoLib.html#top">saIoLib</a></b><hr><a name="snmpSaInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>snmpSaInit</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>snmpSaInit</i>(&nbsp;)</strong> - initialize the subagent</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>PTR_T snmpSaInit    (    PTR_T             saId,     /* ipchandle for socket/queue */    PTR_T             sa_root,  /* pointer to mib root node */    SA_REG_COMPLETE_T saRegComp /* registration complete routine */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>Call this routine to initialize an SNMP subagent.  Internally, this routinecreates an IPC mechanism for receiving messages from the master agent andthen spawns a task to run <b><i>snmpSaMonitor</i>(&nbsp;)</b>, a function that monitors the IPCmechanism created by <b><i><a href="./saIoLib.html#snmpSaInit">snmpSaInit</a></i>(&nbsp;)</b>.  As input, <b><i><a href="./saIoLib.html#snmpSaInit">snmpSaInit</a></i>(&nbsp;)</b> takes theparameters: <i>saId</i>, <i>sa_root</i>, and <i>saRegComp</i>.<p><dl><dt><i>saId</i><dd>Expects a null.  In most functions in this library, an <i>saId</i> parameter isa pointer to the IPC mechanism used to pass messages to the subagent.However, the IPC mechanism is first created internally to this function.Thus, this <i>saId</i> parameter is not actually used for input nor is it anoutput parameter.  It is included for parallelism with other functions inthis library.<p><dt><i>sa_root</i><dd>This parameter provides a pointer to the MIB tree for this subagent.<p><dt><i>saRegComp</i><dd> Use this routine to pass in a pointer to the function that <b><i><a href="./subagentLib.html#snmpSaHandlerAsync">snmpSaHandlerAsync</a></i>(&nbsp;)</b> should execute in response to a registration status message from the master agent.  If the registration was successful, the response contains a group ID for the MIB variables registered with the master agent.  You will need this group ID when it comes time to deregister this SNMP subagent, or when you need to register instances of the object just registered.<p></dl><p>Although this function sets up the IPC mechanism and spawns the task thatis effectively the SNMP subagent, this routine does not actually registerthe subagent with the master agent.  The details of how and when one doesthat are entirely dependent upon the nature of the system you are designing.Thus, no generic registration utility is provided.  For more informationon sending a registration request to the master agent, see the descriptionof <b><i><a href="./saIoLib.html#hdrBlkBuild">hdrBlkBuild</a></i>(&nbsp;)</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>A pointer to the IPC mechanism created within this function, orNULL on failure.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./saIoLib.html#top">saIoLib</a></b><hr><a name="saIoWrite"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>saIoWrite</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>saIoWrite</i>(&nbsp;)</strong> - send a packet to the master agent's message queue</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS saIoWrite    (    PTR_T       ipchandle, /* Subagent's identifier */    EBUFFER_T * pBuf,      /* Encoded buffer */    INT_32_T    code       /* Message type */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine is called either from <b><i><a href="./subagentLib.html#snmpSaHandlerAsync">snmpSaHandlerAsync</a></i>(&nbsp;)</b> or from theregistration routines. <i>ipchandle</i> contains an identifier to the sub agents'smessage queue except for the case when the message is a response to <b>IPC_AYT</b>.In this case, it contains the identifier to the local queue at the masteragent. The <i>pBuf</i> parameter points to the message being sent.  The <i>code</i> parameter takes a value that indicates how the master agent should process the message.  Value <i>code</i> values are <b>CALL_QUERY_HANDLER</b>, <b>CALL_REG_HANDLER</b>, and <b>IPC_AYT</b>.  For more on how these values influence message processing in the master agent, see the description of <b><i><a href="./masterIoLib.html#snmpMonitorSpawn">snmpMonitorSpawn</a></i>(&nbsp;)</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./saIoLib.html#top">saIoLib</a></b><hr><a name="saIpcFree"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>saIpcFree</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>saIpcFree</i>(&nbsp;)</strong> - free the specified IPC mechanism</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void saIpcFree    (    PTR_T ipchandle /* pointer to IPC handle */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>Call this routine to free the IPC mechanism specified by <i>ipchandle</i>.You created this IPC mechanism with a call to <b><i><a href="./saIoLib.html#snmpSaInit">snmpSaInit</a></i>(&nbsp;)</b>.  If yourewrote <b><i><a href="./saIoLib.html#snmpSaInit">snmpSaInit</a></i>(&nbsp;)</b> to use an IPC mechanism other than message queues,you must rewrite <b><i><a href="./saIoLib.html#saIpcFree">saIpcFree</a></i>(&nbsp;)</b> to match.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./saIoLib.html#top">saIoLib</a></b><hr><a name="saMsgBuild"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>saMsgBuild</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>saMsgBuild</i>(&nbsp;)</strong> - build and encode a message and send it to the master agent</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void saMsgBuild    (    VBL_T *       vblist,  /* pointer to varbind list */    SA_HEADER_T * hdr_blk, /* pointer to header block */    SA_DEMUX_T *  demuxer, /* pointer to demuxer */    PTR_T         saId     /* IPC handle */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>The <b><i>hdrBlkCreate</i>(&nbsp;)</b> routine calls <b><i><a href="./saIoLib.html#saMsgBuild">saMsgBuild</a></i>(&nbsp;)</b> to build a message, encode

⌨️ 快捷键说明

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