suricata
detect-engine-siggroup.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2010 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author Victor Julien <victor@inliniac.net>
22  */
23 
24 #ifndef __DETECT_ENGINE_SIGGROUP_H__
25 #define __DETECT_ENGINE_SIGGROUP_H__
26 
30 
31 void SigGroupHeadFree(const DetectEngineCtx *de_ctx, SigGroupHead *);
32 
34 
38 
42 
46 
50 
52 
54 void SigGroupHeadSetSigCnt(SigGroupHead *sgh, uint32_t max_idx);
56  uint8_t ipproto, int dir);
58  uint32_t max_idx);
60 
62  uint32_t sid);
63 
64 void SigGroupHeadRegisterTests(void);
66 
73  SigGroupHead *sgh, int list);
74 
76 
77 #endif /* __DETECT_ENGINE_SIGGROUP_H__ */
int SigGroupHeadHashInit(DetectEngineCtx *)
Initializes the hash table in the detection engine context to hold the SigGroupHeads.
void SigGroupHeadStore(DetectEngineCtx *, SigGroupHead *)
int SigGroupHeadCopySigs(DetectEngineCtx *, SigGroupHead *, SigGroupHead **)
Copies the bitarray holding the sids from the source SigGroupHead to the destination SigGroupHead...
int SigGroupHeadHashRemove(DetectEngineCtx *, SigGroupHead *)
int SigGroupHeadContainsSigId(DetectEngineCtx *de_ctx, SigGroupHead *sgh, uint32_t sid)
Check if a SigGroupHead contains a Signature, whose sid is sent as an argument.
void SigGroupHeadHashFree(DetectEngineCtx *)
Frees the hash table - DetectEngineCtx->sgh_hash_table, allocated by SigGroupHeadHashInit() function...
void SigGroupHeadSetProtoAndDirection(SigGroupHead *sgh, uint8_t ipproto, int dir)
void SigGroupHeadSetFileHashFlag(DetectEngineCtx *, SigGroupHead *)
Set the need hash flag in the sgh.
void SigGroupHeadFreeSigArrays(DetectEngineCtx *de_ctx)
void SigGroupHeadSetSigCnt(SigGroupHead *sgh, uint32_t max_idx)
Updates the SigGroupHead->sig_cnt with the total count of all the Signatures present in this SigGroup...
void SigGroupHeadSetFilestoreCount(DetectEngineCtx *, SigGroupHead *)
Set the filestore_cnt in the sgh.
Container for matching data for a signature group.
Definition: detect.h:1298
void SigGroupHeadPrintSigs(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
Helper function used to print the list of sids for the Signatures present in this SigGroupHead...
void SigGroupHeadDPortHashFree(DetectEngineCtx *)
int SigGroupHeadBuildNonPrefilterArray(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
build an array of rule id&#39;s for sigs with no prefilter Also updated de_ctx::non_pf_store_cnt_max to t...
Signature container.
Definition: detect.h:495
main detection engine ctx
Definition: detect.h:723
SigGroupHead * SigGroupHeadDPortHashLookup(DetectEngineCtx *, SigGroupHead *)
int SigGroupHeadClearSigs(SigGroupHead *)
Clears the bitarray holding the sids for this SigGroupHead.
void SigGroupHeadSetFilesizeFlag(DetectEngineCtx *, SigGroupHead *)
Set the need size flag in the sgh.
int SigGroupHeadMpmHashInit(DetectEngineCtx *)
SigGroupHead * SigGroupHeadHashLookup(DetectEngineCtx *, SigGroupHead *)
Used to lookup a SigGroupHead hash from the detection engine context SigGroupHead hash table...
int SigGroupHeadMpmHashAdd(DetectEngineCtx *, SigGroupHead *)
void SigGroupHeadInitDataFree(SigGroupHeadInitData *sghid)
uint16_t SigGroupHeadGetMinMpmSize(DetectEngineCtx *de_ctx, SigGroupHead *sgh, int list)
void SigGroupHeadFree(const DetectEngineCtx *de_ctx, SigGroupHead *)
Free a SigGroupHead and its members.
int SigGroupHeadHashAdd(DetectEngineCtx *, SigGroupHead *)
Adds a SigGroupHead to the detection engine context SigGroupHead hash table.
void SigGroupHeadFreeMpmArrays(DetectEngineCtx *)
void SigGroupHeadRegisterTests(void)
int SigGroupHeadAppendSig(const DetectEngineCtx *, SigGroupHead **, const Signature *)
Add a Signature to a SigGroupHead.
void SigGroupHeadSetFilemagicFlag(DetectEngineCtx *, SigGroupHead *)
Set the need magic flag in the sgh.
int SigGroupHeadDPortHashInit(DetectEngineCtx *)
int SigGroupHeadDPortHashAdd(DetectEngineCtx *, SigGroupHead *)
int SigGroupHeadBuildMatchArray(DetectEngineCtx *de_ctx, SigGroupHead *sgh, uint32_t max_idx)
Create an array with all the internal ids of the sigs that this sig group head will check for...
void SigGroupHeadMpmHashFree(DetectEngineCtx *)
SigGroupHead * SigGroupHeadMpmHashLookup(DetectEngineCtx *, SigGroupHead *)