|
|
You may find it useful (or perhaps necessary) to have your SMUX peer generate traps based on the occurrence of certain types of events, such as specific errors. Implementing these enterpriseSpecific traps will involve the following steps:
#define LINE_DEATH_ERROR_TRAP 1
OID mibvar_oid_ptr[2]; VarBindList *constructed_varbindlist;
mibvar_oid_ptr[0] = text2oid("boardStatus.0"); trap_varbindlist = make_varbind(mibvar_oid_ptr[0], INTEGER_TYPE, 0, (long) boardStatus, NULL, (OID) 0);
mibvar_oid_ptr[1] = text2oid("serialLineNumber.2"); trap_varbindlist->next = make_varbind(mibvar_oid_ptr[1], INTEGER_TYPE, 0, (long) 2, NULL, (OID) 0);
if (smux_trap(trap_enterpriseSpecific, LINE_DEATH_ERROR_TRAP, (struct type_SNMP_VarBindList) trap_varbindlist) == NOTOK) LIB_ERROR2("smux_trap: %s [%s]", smux_error(smux_error), smux_info);