snmp_alarm.h
上传用户:wxp200602
上传日期:2007-10-30
资源大小:4028k
文件大小:2k
源码类别:

SNMP编程

开发平台:

Unix_Linux

  1. #ifndef SNMP_ALARM_H
  2. #define SNMP_ALARM_H
  3. #ifdef __cplusplus
  4. extern          "C" {
  5. #endif
  6.     typedef void    (SNMPAlarmCallback) (unsigned int clientreg,
  7.                                          void *clientarg);
  8.     /*
  9.      * alarm flags 
  10.      */
  11. #define SA_REPEAT 0x01          /* keep repeating every X seconds */
  12.     struct snmp_alarm {
  13.         struct timeval  t;
  14.         unsigned int    flags;
  15.         unsigned int    clientreg;
  16.         struct timeval  t_last;
  17.         struct timeval  t_next;
  18.         void           *clientarg;
  19.         SNMPAlarmCallback *thecallback;
  20.         struct snmp_alarm *next;
  21.     };
  22.     /*
  23.      * the ones you should need 
  24.      */
  25.     void            snmp_alarm_unregister(unsigned int clientreg);
  26.     void     snmp_alarm_unregister_all(void);
  27.     unsigned int    snmp_alarm_register(unsigned int when,
  28.                                         unsigned int flags,
  29.                                         SNMPAlarmCallback * thecallback,
  30.                                         void *clientarg);
  31.     unsigned int    snmp_alarm_register_hr(struct timeval t,
  32.                                            unsigned int flags,
  33.                                            SNMPAlarmCallback * cb,
  34.                                            void *cd);
  35.     /*
  36.      * the ones you shouldn't 
  37.      */
  38.     void            init_snmp_alarm(void);
  39.     int             init_alarm_post_config(int majorid, int minorid,
  40.                                            void *serverarg,
  41.                                            void *clientarg);
  42.     void            sa_update_entry(struct snmp_alarm *alrm);
  43.     struct snmp_alarm *sa_find_next(void);
  44.     void            run_alarms(void);
  45.     RETSIGTYPE      alarm_handler(int a);
  46.     void            set_an_alarm(void);
  47.     int             get_next_alarm_delay_time(struct timeval *delta);
  48. #ifdef __cplusplus
  49. }
  50. #endif
  51. #endif                          /* SNMP_ALARM_H */