📄 snmpdlib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/snmpdLib.html - generated by refgen from snmpdLibDoc.c --> <title> snmpdLib </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>snmpdLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>snmpdLib</strong> - entry points to the SNMP v1/v2c agent </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./snmpdLib.html#snmpdPktProcess">snmpdPktProcess</a></i>( )</b> - process a packet returned by the transport<br><b><i><a href="./snmpdLib.html#snmpdLog">snmpdLog</a></i>( )</b> - log messages from the SNMP agent <br><b><i><a href="./snmpdLib.html#snmpdViewEntrySet">snmpdViewEntrySet</a></i>( )</b> - install an entry in the view table<br><b><i><a href="./snmpdLib.html#snmpdViewEntryRemove">snmpdViewEntryRemove</a></i>( )</b> - remove an entry from the view table<br><b><i><a href="./snmpdLib.html#snmpdTreeAdd">snmpdTreeAdd</a></i>( )</b> - dynamically add a subtree to the SNMP agent MIB tree<br><b><i><a href="./snmpdLib.html#snmpdTreeRemove">snmpdTreeRemove</a></i>( )</b> - dynamically remove part of the SNMP agent MIB tree<br><b><i><a href="./snmpdLib.html#snmpdTrapSend">snmpdTrapSend</a></i>( )</b> - general interface to trap facilities<br><b><i><a href="./snmpdLib.html#snmpdInitFinish">snmpdInitFinish</a></i>( )</b> - complete the initialization of the agent<br><b><i><a href="./snmpdLib.html#snmpdExit">snmpdExit</a></i>( )</b> - exit the SNMP agent<br><b><i><a href="./snmpdLib.html#snmpdContinue">snmpdContinue</a></i>( )</b> - continue processing of an SNMP packet<br><b><i><a href="./snmpdLib.html#snmpdGroupByGetprocAndInstance">snmpdGroupByGetprocAndInstance</a></i>( )</b> - gather set of similar variable bindings<br><b><i><a href="./snmpdLib.html#snmpdVbRowExtract">snmpdVbRowExtract</a></i>( )</b> - extract required pieces of a row for a <b>set</b> operation<br><b><i><a href="./snmpdLib.html#snmpdVbExtractRowLoose">snmpdVbExtractRowLoose</a></i>( )</b> - incrementally extract pieces of a row for a set <br><b><i><a href="./snmpdLib.html#snmpdPktLockGet">snmpdPktLockGet</a></i>( )</b> - lock an SNMP packet <br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p><p>This module implements the WindNet SNMPv1/v2c agent for VxWorks. Thisagent provides for the management of objects defined by the MIB-IIstandard. The agent management information base can be extended toinclude additional user-defined MIBs. The agent also provides supportfor asynchronous method routines and dynamic loading of MIBs.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>snmpdLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./snmpdLib.html#top">snmpdLib</a></b>, The SNMP version 1 framework is defined by the following Request ForComments (RFCs): 1155, 1157, 1212. MIB-II is defined by RFC 1213.For more information about SNMP, refer to these documents.For more information about the VxWorks SNMP agent, see the<i>WindNet SNMP VxWorks Component Release Supplement. </i><hr><a name="snmpdPktProcess"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>snmpdPktProcess</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>snmpdPktProcess</i>( )</strong> - process a packet returned by the transport</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void snmpdPktProcess ( int pktSize, /* packe length */ char * pBuf, /* packet buffer */ void * pRemoteAddr, /* remote transport address */ void * pLocalAddr, /* local transport address */ void * pSnmpEndpoint /* snmp transport end point */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine is invoked by the user-IO layer to process a receivedpacket. The buffer <i>pBuf</i> (provided by the agent designer) mustcontain a packet of size <i>pktSize</i>. The source address of thesending machine is indicated by <i>pRemoteAddr</i>, and the address of thereceiver by <i>pLocalAddr</i>. These three parameters, <i>pRemoteAddr</i>,<i>pLocalAddr</i>, and <i>pSnmpEndpoint</i>, are passed down to user-providedtransport routines. The transport endpoint is passed in<i>pSnmpEndpoint</i><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="snmpdLog"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>snmpdLog</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>snmpdLog</i>( )</strong> - log messages from the SNMP agent </p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void snmpdLog ( int level, /* level of this message */ char * string /* message string */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine logs messages generated by the SNMP agent. Messages aresent to the standard console. If <i>level</i> is less than or equal to<b>SNMP_TRACE_LEVEL</b> (in <b>configAll.h</b>), the message is printed, otherwiseit is ignored. The value of <i>level</i> must be one of 1, 2, or 3.<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="snmpdViewEntrySet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>snmpdViewEntrySet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>snmpdViewEntrySet</i>( )</strong> - install an entry in the view table</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS snmpdViewEntrySet ( OIDC_T * pTreeOid, /* sub tree for view */ int treeOidLen, /* length of subtree oid */ UINT_16_T index, /* index of entry */ uchar_t * pMask, /* mask for entry */ int maskLen, /* mask length in bytes */ int viewType /* type of view (INCLUDED/EXCLUDED) */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function creates an entry in the view table. The view subtreeis specified by <i>pTreeOid</i> and <i>treeOidLen</i>.<p>The installed entry has an index of <i>index</i>. The specified view isincluded in or excluded from the view table depending on the valueof <i>viewType</i> (<b>VIEW_INCLUDED</b> or <b>VIEW_EXCLUDED</b>, respectively). Theentry mask is specified by <i>pmask</i>; <i>maskLen</i> must be the masklength in bytes.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK on success, otherwise ERROR</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./snmpdLib.html#top">snmpdLib</a></b><hr><a name="snmpdViewEntryRemove"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>snmpdViewEntryRemove</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>snmpdViewEntryRemove</i>( )</strong> - remove an entry from the view table</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void snmpdViewEntryRemove ( OIDC_T * pTreeOid, /* oid of view subtree to remove */ int treeOidLen, /* length of view subtree oid */ UINT_16_T index /* index of entry */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine removes an entry from the view table and deallocatesthe associated resources. The entry should have been previouslycreated with <b><i><a href="./snmpdLib.html#snmpdViewEntrySet">snmpdViewEntrySet</a></i>( )</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./snmpdLib.html#top">snmpdLib</a></b>, <b><i><a href="./snmpdLib.html#snmpdViewEntrySet">snmpdViewEntrySet</a></i>( )</b><hr><a name="snmpdTreeAdd"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>snmpdTreeAdd</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>snmpdTreeAdd</i>( )</strong> - dynamically add a subtree to the SNMP agent MIB tree</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS snmpdTreeAdd ( char * pTreeOidStr, MIBNODE_T * pTreeAddr )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds the specified MIB subtree, located in memory atthe address <i>pTreeAddr</i>, to the agent's MIB data tree at the nodewith the object identifier specified by <i>pTreeOidStr</i>. This subtreeis normally generated with the <b>-start</b> option to <b>mibcomp</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK on success, otherwise ERROR.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./snmpdLib.html#top">snmpdLib</a></b>, <i>WindNet SNMPv1v2c VxWorks Component Release Supplement </i><hr><a name="snmpdTreeRemove"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>snmpdTreeRemove</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>snmpdTreeRemove</i>( )</strong> - dynamically remove part of the SNMP agent MIB tree</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void snmpdTreeRemove ( char * pTreeOidStr /* char string specifying oid of tree to remove */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes part of the SNMP agent MIB tree atruntime. Once the specified subtree is deleted, any further requeststo access objects of that subtree fail.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./snmpdLib.html#top">snmpdLib</a></b>, <i>WindNet SNMPv1v2c VxWorks Component Release Supplement </i><hr><a name="snmpdTrapSend"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>snmpdTrapSend</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>snmpdTrapSend</i>( )</strong> - general interface to trap facilities</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void snmpdTrapSend ( void * pSnmpEndpoint, /* snmp agent transport endpoint */ int numDestn, /* number of destinations */ void * * ppDestAddrTbl, /* array of ptrs to destinations */ void * pLocalAddr, /* local address */ int version, /* SNMP version */ char * pTrapCmnty, /* trap community string */ OIDC_T * pMyOid, /* agent object identifier */ int myOidLen, /* length of agent object identifier */ u_long * pIpAddr, /* ip address of sender */ int trapType, /* trap type */ int trapSpecific, /* trap specific code */ int numVarBinds, /* number of varbinds in packet */ FUNCPTR trapVarBindsRtn, /* routine to bind varbinds */ void * pCookie /* argument to binding routine */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sends a trap of type <i>trapType</i> and specific<i>trapSpecific</i> to all the specified destinations, given an array ofdestinations in <i>ppDestAddrTbl</i> of len <i>numDestn</i>.<p>The <i>version</i> parameter is either <b>SNMP_VERSION_1</b> or <b>SNMP_VERSION_2</b>,depending on whether a v1-style or v2-style trap is to be generated.The community used is specified by <i>pTrapCmnty</i>. <i>pLocalAddr</i>indicates a local address to use for a sending endpoint. <i>pMyOid</i>and <i>myOidlen</i> specify the system object identifier (<i>sysObjId</i>) touse.<p><i>numVarBinds</i> indicates the number of variable bindings that are tobe encoded in the packet. <i>trapVarBindsRtn</i> is the routine to usefor doing the variable bindings. <i>pCookie</i> is passed to thisroutine as shown below:<p><pre>(*trapVarBindsRtn) (pPkt, pCookie)</pre></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="snmpdInitFinish"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>snmpdInitFinish</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>snmpdInitFinish</i>( )</strong> - complete the initialization of the agent</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void snmpdInitFinish ( VOIDFUNCPTR pPrivRlse, /* user's privare release routine */ FUNCPTR pSetPduVldt, /* user's set pdu validate routine */ FUNCPTR pPreSet, /* user's pre set routine */ FUNCPTR pPostSet, /* user's post set routine */ FUNCPTR pSetFailed /* user's set failed routine */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine is required to be called by the user to complete theinitialization of the SNMP agent after the transport endpoint hasbeen initialized. This routine must be called \f2after\fR the endpoint hasbeen established, since it depends on that endpoint to functioncorrectly.<p>This routine also installs any user-supplied hooks for customizingthe agent. If a hook is not required, a NULL pointer should be passed
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -