match.h
Go to the documentation of this file.00001 /* 00002 ** match.h 00003 ** NAF first-stage flow table (matches and prefilters biflows) 00004 ** 00005 ** ------------------------------------------------------------------------ 00006 ** Copyright (C) 2005-2007 Carnegie Mellon University. All Rights Reserved. 00007 ** ------------------------------------------------------------------------ 00008 ** Authors: Brian Trammell <bht@cert.org> 00009 ** ------------------------------------------------------------------------ 00010 ** GNU General Public License (GPL) Rights pursuant to Version 2, June 1991 00011 ** Government Purpose License Rights (GPLR) pursuant to DFARS 252.225-7013 00012 ** ------------------------------------------------------------------------ 00013 */ 00014 00015 #ifndef _NAF_MATCH_H_ 00016 #define _NAF_MATCH_H_ 00017 00018 #include <naf/autoinc.h> 00019 #include <naf/nafcore.h> 00020 #include <naf/exparse.h> 00021 00035 typedef struct _NAFMultiBin { 00037 GQueue *binqueue; 00039 GHashTable *bintables; 00041 NAFAggConfig *conf; 00043 NAFTimeSec minbin; 00045 NAFTimeSec maxbin; 00047 uint32_t raw_count; 00049 uint32_t hit_count; 00051 uint32_t match_count; 00053 uint32_t miss_count; 00055 uint32_t predrop_count; 00057 uint32_t peridrop_count; 00059 uint32_t perirev_count; 00061 uint32_t horizon_count; 00063 uint32_t active_count; 00065 uint32_t active_max; 00066 } NAFMultiBin; 00067 00071 typedef struct _NAFBinTable { 00073 NAFMultiBin *mtab; 00075 NAFTimeSec bin; 00077 GHashTable *table; 00079 GMemChunk *keychunk; 00081 GMemChunk *valchunk; 00082 } NAFBinTable; 00083 00084 00094 void naf_mtab_init( 00095 NAFMultiBin *mtab, 00096 NAFAggConfig *conf); 00097 00109 gboolean naf_mtab_add( 00110 NAFMultiBin *mtab, 00111 NAFlowKey *key, 00112 NAFlowVal *val, 00113 GError **err); 00114 00125 gboolean naf_mtab_add_raw( 00126 NAFMultiBin *mtab, 00127 NAFlowRaw *raw, 00128 GError **err); 00129 00140 NAFBinTable *naf_mtab_dequeue( 00141 NAFMultiBin *mtab, 00142 NAFTimeSec horizon); 00143 00152 void naf_mtab_bintable_complete( 00153 NAFBinTable *bintab); 00154 00155 #endif