net-snmp 5.7
|
00001 #ifndef SNMP_ALARM_H 00002 #define SNMP_ALARM_H 00003 00004 #ifdef __cplusplus 00005 extern "C" { 00006 #endif 00007 00008 typedef void (SNMPAlarmCallback) (unsigned int clientreg, 00009 void *clientarg); 00010 00011 /* 00012 * alarm flags 00013 */ 00014 #define SA_REPEAT 0x01 /* keep repeating every X seconds */ 00015 #define SA_FIRED 0x10 /* Being processed in run_alarms */ 00016 00017 struct snmp_alarm { 00018 struct timeval t; 00019 unsigned int flags; 00020 unsigned int clientreg; 00021 struct timeval t_last; 00022 struct timeval t_next; 00023 void *clientarg; 00024 SNMPAlarmCallback *thecallback; 00025 struct snmp_alarm *next; 00026 }; 00027 00028 /* 00029 * the ones you should need 00030 */ 00031 NETSNMP_IMPORT 00032 void snmp_alarm_unregister(unsigned int clientreg); 00033 void snmp_alarm_unregister_all(void); 00034 NETSNMP_IMPORT 00035 unsigned int snmp_alarm_register(unsigned int when, 00036 unsigned int flags, 00037 SNMPAlarmCallback * thecallback, 00038 void *clientarg); 00039 00040 unsigned int snmp_alarm_register_hr(struct timeval t, 00041 unsigned int flags, 00042 SNMPAlarmCallback * cb, 00043 void *cd); 00044 00045 00046 /* 00047 * the ones you shouldn't 00048 */ 00049 NETSNMP_IMPORT void init_snmp_alarm(void); 00050 int init_alarm_post_config(int majorid, int minorid, 00051 void *serverarg, 00052 void *clientarg); 00053 void sa_update_entry(struct snmp_alarm *alrm); 00054 struct snmp_alarm *sa_find_next(void); 00055 NETSNMP_IMPORT void run_alarms(void); 00056 RETSIGTYPE alarm_handler(int a); 00057 void set_an_alarm(void); 00058 int get_next_alarm_delay_time(struct timeval *delta); 00059 00060 00061 #ifdef __cplusplus 00062 } 00063 #endif 00064 #endif /* SNMP_ALARM_H */