Home |
Function xn_snmp_add_binding |
Function xn_snmp_add_bindingFunction xn_snmp_add_binding adds a data binding to custom trap. It is used to define what data should be sent with a custom application-specific trap. int xn_snmp_add_binding(struct api_req_desc * desc, const struct oid * var_oid, char * param, int var_type); ParametersdescPointers to the variable binding list to be used. This structure should be initialized using xn_snmp_desc_init before calling this function. var_oidObject ID of the data item to add to the trap. paramPointer to the data to copy into the trap. typeType of the data binding./ The following values are supported:
return valueReturns 0 if successful, otherwise SOCKET_ERROR. If an error occurred, call xn_getlasterror and xn_geterror_string to return the error value. Section Error Codes further describes each error. Possible values for this function are:
This function adds an entry to a variable binding list of a trap. It is used to set up a trap message to be sent with xn_snmp_send_trap to the SNMP manager. xn_snmp_mem_free must be called after the trap binding list is no longer needed (probably after sending the trap) to free up memory used for the variable bindings.
|