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

sfilterhandler.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_SFILTER__
00023 #define __AWHANDLER_SFILTER__
00024 
00025 #include "monitor.h"
00026 #include "wire.h"
00027 
00028 #include "regexmatch.h"
00029 
00030 
00247 /* 
00248 Changes:
00249 
00250 10/17/02 Russell Leighton
00251 Support for 'source:'
00252 
00253 3/20/02 Russell Leighton
00254 Added macro substition to the subst on regex
00255 
00256 */
00257 
00261 typedef struct {
00262 
00263   const byte_t
00264    *regexp;                  /* string pointer to regex */
00265 
00266   const byte_t
00267    *subst;                   /* substitution string (maybe NULL) */
00268 
00269   aw_event_sig_t
00270    copy;                     /* event->id for generated copy events */
00271 
00272 } aw_sfilter_regex_filter_t;
00273 
00277 typedef struct {
00278 
00279   regex_t
00280    pattern;                  /* holds compiled regular expression  */
00281 
00282   byte_t
00283    *subst;                   /* substitution string (maybe NULL) */
00284 
00285   aw_event_sig_t
00286    copy;                     /* event->id for generated copy events */
00287 
00288 } aw_sfilter_pattern_filter_t;
00289 
00293 typedef struct {
00294 
00295   aw_handler_t
00296    handler_header;
00297 
00298   u_int32_t
00299    nfilters;
00300 
00301   aw_sfilter_pattern_filter_t
00302    *filters;
00303 
00304 } aw_sfilterhandler_t;
00305 
00306 
00318 aw_sfilterhandler_t *aw_create_sfilterhandler(u_int32_t nfilters,
00319                                               aw_sfilter_regex_filter_t *filters,
00320                                               u_int32_t alternate,
00321                                               int32_t (*regevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index),
00322                                               int32_t (*regmaskevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index),
00323                                               const aw_alarm_sched_t *sched,
00324                                               aw_logger_t *logger);
00325 
00326 
00331 void aw_free_sfilterhandler(aw_sfilterhandler_t *h);
00332 
00336 aw_handler_t *aw_wire_sfilterhandler(aw_wire_mkhandler_args_t *args);
00337 
00338 
00339 #endif
00340 
Aware 0.11.1 Copyright (C) 1998-2005 Russell Leighton (russ@elegant-software.com)