Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

limiterhandler.h

Go to the documentation of this file.
00001 
00002 /*
00003 ** Copyright (C) 2002 Russell Leighton
00004 **
00005 ** This program is free software; you can redistribute it and/or modify
00006 ** it under the terms of the GNU General Public License as published by
00007 ** the Free Software Foundation; either version 2 of the License, or
00008 ** (at your option) any later version.
00009 **
00010 ** This program is distributed in the hope that it will be useful,
00011 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 ** GNU General Public License for more details.
00014 **
00015 ** You should have received a copy of the GNU General Public License
00016 ** along with this program; if not, write to the Free Software
00017 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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 Changes:
00083 
00084 */
00085 
00089 typedef struct {
00090   
00091   u_int32_t
00092    count;
00093 
00094   /* time of first occurance */
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   /* used only in with the noid option */
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 
Aware 0.11.1 Copyright (C) 1998-2005 Russell Leighton (russ@elegant-software.com)