| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- /*
- * Note: this file originally auto-generated by mib2c
- * using mib2c.notify.conf
- */
- #include <net-snmp/net-snmp-config.h>
- #include <net-snmp/net-snmp-includes.h>
- #include <net-snmp/agent/net-snmp-agent-includes.h>
- #include "pduMIB_trap.h"
- extern const oid snmptrap_oid[];
- extern const size_t snmptrap_oid_len;
- int
- send_pduAlarmAdded_trap( void )
- {
- netsnmp_variable_list *var_list = NULL;
- const oid pduAlarmAdded_oid[] = { 1,3,6,1,4,1,2024,2,1 };
- const oid pduAlarmType_oid[] = { 1,3,6,1,4,1,2024,1,6,1,1,2, /* insert index here */ };
- const oid pduAlarmContext_oid[] = { 1,3,6,1,4,1,2024,1,6,1,1,3, /* insert index here */ };
- const oid pduAlarmAction_oid[] = { 1,3,6,1,4,1,2024,1,6,1,1,4, /* insert index here */ };
- const oid pduAlarmActionPara_oid[] = { 1,3,6,1,4,1,2024,1,6,1,1,5, /* insert index here */ };
- const oid pduAlarmDate_oid[] = { 1,3,6,1,4,1,2024,1,6,1,1,6, /* insert index here */ };
- const oid pduAlarmTime_oid[] = { 1,3,6,1,4,1,2024,1,6,1,1,7, /* insert index here */ };
- /*
- * Set the snmpTrapOid.0 value
- */
- snmp_varlist_add_variable(&var_list,
- snmptrap_oid, snmptrap_oid_len,
- ASN_OBJECT_ID,
- pduAlarmAdded_oid, sizeof(pduAlarmAdded_oid));
-
- /*
- * Add any objects from the trap definition
- */
- snmp_varlist_add_variable(&var_list,
- pduAlarmType_oid, OID_LENGTH(pduAlarmType_oid),
- ASN_INTEGER,
- /* Set an appropriate value for pduAlarmType */
- NULL, 0);
- snmp_varlist_add_variable(&var_list,
- pduAlarmContext_oid, OID_LENGTH(pduAlarmContext_oid),
- ASN_OCTET_STR,
- /* Set an appropriate value for pduAlarmContext */
- NULL, 0);
- snmp_varlist_add_variable(&var_list,
- pduAlarmAction_oid, OID_LENGTH(pduAlarmAction_oid),
- ASN_INTEGER,
- /* Set an appropriate value for pduAlarmAction */
- NULL, 0);
- snmp_varlist_add_variable(&var_list,
- pduAlarmActionPara_oid, OID_LENGTH(pduAlarmActionPara_oid),
- ASN_INTEGER,
- /* Set an appropriate value for pduAlarmActionPara */
- NULL, 0);
- snmp_varlist_add_variable(&var_list,
- pduAlarmDate_oid, OID_LENGTH(pduAlarmDate_oid),
- ASN_OCTET_STR,
- /* Set an appropriate value for pduAlarmDate */
- NULL, 0);
- snmp_varlist_add_variable(&var_list,
- pduAlarmTime_oid, OID_LENGTH(pduAlarmTime_oid),
- ASN_OCTET_STR,
- /* Set an appropriate value for pduAlarmTime */
- NULL, 0);
- /*
- * Add any extra (optional) objects here
- */
- /*
- * Send the trap to the list of configured destinations
- * and clean up
- */
- send_v2trap( var_list );
- snmp_free_varbind( var_list );
- return SNMP_ERR_NOERROR;
- }
- int
- send_pduAlarmRemoved_trap( void )
- {
- netsnmp_variable_list *var_list = NULL;
- const oid pduAlarmRemoved_oid[] = { 1,3,6,1,4,1,2024,2,2 };
- const oid pduAlarmContext_oid[] = { 1,3,6,1,4,1,2024,1,6,1,1,3, /* insert index here */ };
- /*
- * Set the snmpTrapOid.0 value
- */
- snmp_varlist_add_variable(&var_list,
- snmptrap_oid, snmptrap_oid_len,
- ASN_OBJECT_ID,
- pduAlarmRemoved_oid, sizeof(pduAlarmRemoved_oid));
-
- /*
- * Add any objects from the trap definition
- */
- snmp_varlist_add_variable(&var_list,
- pduAlarmContext_oid, OID_LENGTH(pduAlarmContext_oid),
- ASN_OCTET_STR,
- /* Set an appropriate value for pduAlarmContext */
- NULL, 0);
- /*
- * Add any extra (optional) objects here
- */
- /*
- * Send the trap to the list of configured destinations
- * and clean up
- */
- send_v2trap( var_list );
- snmp_free_varbind( var_list );
- return SNMP_ERR_NOERROR;
- }
|