Home |
Function xn_snmp_send_trap |
Function xn_snmp_send_trapThis function sends an SNMP trap to the SNMP trap manager. int xn_snmp_send_trap(int sp_trap_no, int gn_trap_no, struct oid * enterprise_oid, struct api_req_desc * rqdp, BYTE * buffer, int buf_len, int snmp_version); Parameterssp_trap_noThe specific trap number. gn_trap_noThe generic trap number used with enterprise traps. enterprise_oidEnterprise object ID to be stored in the enterprise field of the trap message. rqdpThe variable binding list (trap data) created with xn_snmp_desc_init and xn_snmp_add_binding. bufferThe buffer used to format data when sending a response to an SNMP request. If it is set to NULL, a DCU will be allocated for buffer space. buf_lenSize of the buffer in bytes. snmp_versionSpecifies which SNMP protocol version the trap should adhere to. Supported values are SNMP_VERSION_V1, SNMP_VERSION_V2C, and SNMP_VERSION_V2U, as defined in Snmpapi.h. return valueReturns 0 if successful, otherwise SOCKET_ERROR. If an error occurred, call xn_getlasterror and xn_geterror_string to return the error value. In addition to the error values listed below, all error values generated by socket, bind, recvfrom and send may also be set. Section Error Codes further describes each error. Possible values for this function are:
|