net-snmp
5.4.1
|
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 00016 struct snmp_alarm { 00017 struct timeval t; 00018 unsigned int flags; 00019 unsigned int clientreg; 00020 struct timeval t_last; 00021 struct timeval t_next; 00022 void *clientarg; 00023 SNMPAlarmCallback *thecallback; 00024 struct snmp_alarm *next; 00025 }; 00026 00027 /* 00028 * the ones you should need 00029 */ 00030 void snmp_alarm_unregister(unsigned int clientreg); 00031 void snmp_alarm_unregister_all(void); 00032 unsigned int snmp_alarm_register(unsigned int when, 00033 unsigned int flags, 00034 SNMPAlarmCallback * thecallback, 00035 void *clientarg); 00036 00037 unsigned int snmp_alarm_register_hr(struct timeval t, 00038 unsigned int flags, 00039 SNMPAlarmCallback * cb, 00040 void *cd); 00041 00042 00043 /* 00044 * the ones you shouldn't 00045 */ 00046 void init_snmp_alarm(void); 00047 int init_alarm_post_config(int majorid, int minorid, 00048 void *serverarg, 00049 void *clientarg); 00050 void sa_update_entry(struct snmp_alarm *alrm); 00051 struct snmp_alarm *sa_find_next(void); 00052 void run_alarms(void); 00053 RETSIGTYPE alarm_handler(int a); 00054 void set_an_alarm(void); 00055 int get_next_alarm_delay_time(struct timeval *delta); 00056 00057 #ifdef __cplusplus 00058 } 00059 #endif 00060 #endif /* SNMP_ALARM_H */