00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __AWHANDLER_LIMTER__
00023 #define __AWHANDLER_LIMTER__
00024
00025 #include <stdio.h>
00026
00027 #include "monitor.h"
00028 #include "wire.h"
00029
00031
00032
00081
00082
00083
00084
00085
00089 typedef struct {
00090
00091 u_int32_t
00092 count;
00093
00094
00095 aw_timestamp_t
00096 timestamp;
00097
00098 } aw_limithandler_event_count_t;
00099
00103 typedef struct {
00104
00105 aw_handler_t
00106 handler_header;
00107
00108 u_int32_t
00109 event_threshold;
00110
00111 aw_address_t
00112 time_period;
00113
00114 aw_event_sig_t
00115 copy_sig;
00116
00117 aw_hash32_t
00118 *id2count;
00119
00120
00121 aw_limithandler_event_count_t
00122 noid;
00123
00124 } aw_limiterhandler_t;
00125
00138 aw_limiterhandler_t *aw_create_limiterhandler(u_int32_t event_threshold,
00139 aw_timestamp_t time_period,
00140 const aw_event_sig_t *copy_sig,
00141 u_int32_t noid,
00142 int32_t (*regevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index),
00143 int32_t (*regmaskevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index),
00144 const aw_alarm_sched_t *sched,
00145 aw_logger_t *aware_logger);
00146
00147
00152 void aw_free_limiterhandler(aw_limiterhandler_t *h);
00153
00154
00158 aw_handler_t *aw_wire_limiterhandler(aw_wire_mkhandler_args_t *args);
00159
00160
00161
00162 #endif
00163