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 */ )
This routine sends a trap of type trapType and specific trapSpecific to all the specified destinations, given an array of destinations in ppDestAddrTbl of len numDestn.
The version parameter is either SNMP_VERSION_1 or SNMP_VERSION_2, depending on whether a v1-style or v2-style trap is to be generated. The community used is specified by pTrapCmnty. The pLocalAddr parameter indicates a local address to use for a sending endpoint. The parameters pMyOid and myOidlen specify the system object identifier (sysObjId) to use.
numVarBinds indicates the number of variable bindings that are to be encoded in the packet. The trapVarBindsRtn parameter is the routine to use for doing the variable bindings. And the parameter pCookie is passed to this routine as shown in the following:
(*trapVarBindsRtn) (pPkt, pCookie)