📄 snmpdlib.html
字号:
in that position. The function <b><i><a href="./snmpIoLib.html#snmpIoTrapSend">snmpIoTrapSend</a></i>( )</b> is invoked by thisroutine, so any configuration required by that routine should bedone prior to calling <b><i><a href="./snmpdLib.html#snmpdInitFinish">snmpdInitFinish</a></i>( )</b>.<p>The hook routines are as follows:<p><dl><dt><i>pPrivRlse</i><dd>This routine is used by the agent to free any memory attached to theprivate field of the <b>SNMP_PKT_T</b> structure. <p><dt><i>pSetPduVldt</i><dd>This routine is called before any processing of a <b>set</b> request hastaken place. It can be used to perform global validation of therequest, if needed. The return values for this routine must meet thefollowing requirements:<p>0 - indicates that the <b>set</b> PDU is valid, and processing should continue.<p>1 - indicates that the <b>set</b> PDU is valid, and that this routine hasalready completed all the required <b>set</b> operations.<p>-1 - indicates that the <b>set</b> PDU is invalid and should be rejected.<p><dt><i>pPreSet</i><dd>This routine is called after all <b>testproc</b> operations havecompleted successfully, but before any <b>setproc</b> operation is begun.Return value requirements are as follows<p>0 - indicates that the <b>set</b> PDU is valid, and processing should continue.<p>1 - indicates that the <b>set</b> PDU is valid, and that this routine hasalready completed all the required <b>set</b> operations.<p>-1 - indicates that the <b>set</b> PDU is invalid and should be rejected.<p><dt><i>pPostSet</i><dd>This routine is called after all <b>setproc</b> have completedsuccessfully. This routine can be used to free resources allocatedduring <b>set</b> processing. <p><dt><i>pSetFailed</i><dd> This routine is possibly called under two sets of circumstances:after all <b>testproc</b> operations have returned and some of them havefailed, and/or after all <b>undoproc</b> operations have returned andsome <b>setproc</b> operations have failed. It can be used to do anyrequired cleanup. </dl><p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./snmpdLib.html#top">snmpdLib</a></b><hr><a name="snmpdExit"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>snmpdExit</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>snmpdExit</i>( )</strong> - exit the SNMP agent</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void snmpdExit (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine causes the SNMP agent to exit. It is available in casethe user encounters some problem after a successful startup. <p>This routine must be called from the main thread. Any other tasksspawned by the user (for asynchronous method routines) should bedeleted prior to calling this function.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./snmpdLib.html#top">snmpdLib</a></b><hr><a name="snmpdContinue"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>snmpdContinue</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>snmpdContinue</i>( )</strong> - continue processing of an SNMP packet</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void snmpdContinue ( SNMP_PKT_T * pktp /* snmp packet */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine continues processing a packet. <b><i><a href="./snmpdLib.html#snmpdPktProcess">snmpdPktProcess</a></i>( )</b> beginsthe method routines needed to fulfill the request, while thisroutine determines whether the current set of method routines havefinished; it then either starts more method routines or sends aresponse packet.<p>If a method routine returns before completing its task, it mustarrange for <b><i><a href="./snmpdLib.html#snmpdContinue">snmpdContinue</a></i>( )</b> to be called when the task is completed.You must obtain the write-lock on this packet by calling<b><i><a href="./snmpdLib.html#snmpdPktLockGet">snmpdPktLockGet</a></i>( )</b> prior to calling <b><i><a href="./snmpdLib.html#snmpdContinue">snmpdContinue</a></i>( )</b>. <b><i><a href="./snmpdLib.html#snmpdContinue">snmpdContinue</a></i>( )</b> releases the write-lock when it completes.<p><i>pktp</i> is a pointer to the structure that contains the packet.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./snmpdLib.html#top">snmpdLib</a></b><hr><a name="snmpdGroupByGetprocAndInstance"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>snmpdGroupByGetprocAndInstance</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>snmpdGroupByGetprocAndInstance</i>( )</strong> - gather set of similar variable bindings</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void snmpdGroupByGetprocAndInstance ( SNMP_PKT_T * pktp, /* snmp packet */ VB_T * firstVbp, /* first var bind */ int compc, /* component count */ OIDC_T * compl /* component length */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gathers a set of similar variable bindings together bysearching the variable bindings in <i>pktp</i>, starting at <i>firstVbp</i>for a match of the <b>getproc</b> pointer of <i>firstVbp</i> and with aninstance specified by <i>compc</i> and <i>compl</i>. This routine then linksthe variable bindings found which match <i>firsVbp</i>.<p>This routine does not set any flags in the variable bindings. It isleft to the calling routine to decide whether the <i>tested</i> or <i>set</i> flagsshould be set.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./snmpdLib.html#top">snmpdLib</a></b><hr><a name="snmpdVbRowExtract"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>snmpdVbRowExtract</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>snmpdVbRowExtract</i>( )</strong> - extract required pieces of a row for a <b>set</b> operation</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>VB_T * snmpdVbRowExtract ( SNMP_PKT_T * pktp, /* snmp packet */ int start_index, /* starting index */ int compc, /* component count */ OIDC_T * compl, /* component length */ int row_structure_length, /* length of row structure */ struct create_row * row /* row structure */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine assists in implementing row-creation <b>set</b> operations.It is typically used by the <b>testproc</b> routine for a table. It scansthe SNMP packet looking for all the pieces that go together for thepurposes of creating a new row in an SNMP table.<p>The parameter <i>row</i> describes what this routine is looking for.<i>row</i> is a list of MIB leaf pointers referring to variables in thetable in question, and a flag indicating if this variable (<i>column</i>)in the table is required. This routine searches the variablebindings in <i>pktp</i> for a match of the MIB leaf pointer specified inthe row array and the instance specified by <i>compc</i> and <i>compl</i>. Itlinks the variable bindings found from the first MIB leaf node inthe row array. This first variable binding must be in the packet whether it is marked as needed or not, and is the return value of<b><i><a href="./snmpdLib.html#snmpdVbRowExtract">snmpdVbRowExtract</a></i>( )</b>.<p>If <b><i><a href="./snmpdLib.html#snmpdVbRowExtract">snmpdVbRowExtract</a></i>( )</b> does not find a matching variable binding andthat leaf is flagged <b>ROW_FLAG_NEEDED</b> in the row array, the routinereturns NULL to indicate an error.<p>This routine marks the variable bindings in the resulting list asalready tested except for the first entry, which is marked asalready set. As a result, the agent only calls the <b>set</b> routineassociated with the first MIB leaf in the row array. This <b>set</b>routine should handle creation of the necessary data structures andreading the variable binding list to execute the required <b>set</b>operations. You can force other entries set routines to be calledby flagging entries with <b>ROW_FLAG_CALL_SET</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>a pointer to the first variable binding if successful,otherwise NULL.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./snmpdLib.html#top">snmpdLib</a></b><hr><a name="snmpdVbExtractRowLoose"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>snmpdVbExtractRowLoose</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>snmpdVbExtractRowLoose</i>( )</strong> - incrementally extract pieces of a row for a set </p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>VB_T * snmpdVbExtractRowLoose ( SNMP_PKT_T * pktp, /* snmp packet */ int indx, /* index */ MIBLEAF_T * * leaves, /* mib leaves */ int compc, /* component count */ OIDC_T * compl /* component length */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine assists in implementing row-creation <b>set</b> operations,especially in the case of <b>`dribble</b><b> creation. In <b>`dribble</b>creation, the network management station may choose to break thecreation of a new entry in some table into multiple packets. Usingmultiple packets does not work with <b><i><a href="./snmpdLib.html#snmpdVbRowExtract">snmpdVbRowExtract</a></i>( )</b>, whichrequires at least one specified item to be in the packet.<p>In dribble creation, there is no single item that is guaranteed tobe in every packet. As its name implies, this routine is similar to<b><i><a href="./snmpdLib.html#snmpdVbRowExtract">snmpdVbRowExtract</a></i>( )</b>. It searches the variable bindings in <i>pktp</i>starting at <i>indx</i> for a match of the MIB leaf pointer specified inthe <i>leaves</i> array and with an instance specified by <i>compc</i> and<i>compl</i>. The routine then links the variable bindings found fromthe last variable binding found.<p>If no variable bindings are found, this routine returns a NULLpointer. This routine does not set any of the flags in the variablebindings. It is left to the calling routine to decide if the <i>tested</i>or <i>set</i> flags should be set.<p></blockquote><h4>RETURNS</h4><blockquote><p>a pointer to the last variable binding if successful,otherwise NULL.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./snmpdLib.html#top">snmpdLib</a></b><hr><a name="snmpdPktLockGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>snmpdPktLockGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>snmpdPktLockGet</i>( )</strong> - lock an SNMP packet </p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS snmpdPktLockGet ( SNMP_PKT_T * pktp /* snmp packet */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine obtains a lock on the SNMP packet being processed,which must be obtained by any asynchronous method routine prior tocalling any of the routines <b>getproc_*</b>, <b>nextproc_*</b>, <b>testproc_*</b>,or <b>setproc_*</b>, or also <b><i><a href="./snmpdLib.html#snmpdContinue">snmpdContinue</a></i>( )</b>. <b><i><a href="./snmpdLib.html#snmpdContinue">snmpdContinue</a></i>( )</b> releasesthe lock before returning. No other routine can release this lock.<p>This routine blocks until the lock is obtained.<p>Returns: OK, or ERROR on failure.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./snmpdLib.html#top">snmpdLib</a></b>, <b><a href="./snmpProcLib.html#top">snmpProcLib</a></b>, <b><i><a href="./snmpdLib.html#snmpdContinue">snmpdContinue</a></i>( )</b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -