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 
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__ */
SigGroupHeadMpmHashLookup
SigGroupHead * SigGroupHeadMpmHashLookup(DetectEngineCtx *, SigGroupHead *)
SigGroupHead_
Container for matching data for a signature group.
Definition: detect.h:1337
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:761
SigGroupHeadSetFilesizeFlag
void SigGroupHeadSetFilesizeFlag(DetectEngineCtx *, SigGroupHead *)
Set the need size flag in the sgh.
Definition: detect-engine-siggroup.c:555
SigGroupHeadGetMinMpmSize
uint16_t SigGroupHeadGetMinMpmSize(DetectEngineCtx *de_ctx, SigGroupHead *sgh, int list)
SigGroupHeadCopySigs
int SigGroupHeadCopySigs(DetectEngineCtx *, SigGroupHead *, SigGroupHead **)
Copies the bitarray holding the sids from the source SigGroupHead to the destination SigGroupHead.
Definition: detect-engine-siggroup.c:391
SigGroupHeadRegisterTests
void SigGroupHeadRegisterTests(void)
Definition: detect-engine-siggroup.c:1205
de_ctx
DetectEngineCtx * de_ctx
Definition: fuzz_siginit.c:16
SigGroupHeadFree
void SigGroupHeadFree(const DetectEngineCtx *de_ctx, SigGroupHead *)
Free a SigGroupHead and its members.
Definition: detect-engine-siggroup.c:154
SigGroupHeadHashRemove
int SigGroupHeadHashRemove(DetectEngineCtx *, SigGroupHead *)
Definition: detect-engine-siggroup.c:285
SigGroupHeadSetProtoAndDirection
void SigGroupHeadSetProtoAndDirection(SigGroupHead *sgh, uint8_t ipproto, int dir)
Definition: detect-engine-siggroup.c:438
SigGroupHeadSetFilemagicFlag
void SigGroupHeadSetFilemagicFlag(DetectEngineCtx *, SigGroupHead *)
Set the need magic flag in the sgh.
Definition: detect-engine-siggroup.c:526
SigGroupHeadHashInit
int SigGroupHeadHashInit(DetectEngineCtx *)
Initializes the hash table in the detection engine context to hold the SigGroupHeads.
Definition: detect-engine-siggroup.c:256
SigGroupHeadAppendSig
int SigGroupHeadAppendSig(const DetectEngineCtx *, SigGroupHead **, const Signature *)
Add a Signature to a SigGroupHead.
Definition: detect-engine-siggroup.c:338
SigGroupHeadContainsSigId
int SigGroupHeadContainsSigId(DetectEngineCtx *de_ctx, SigGroupHead *sgh, uint32_t sid)
Check if a SigGroupHead contains a Signature, whose sid is sent as an argument.
Definition: detect-engine-siggroup.c:735
SigGroupHeadHashLookup
SigGroupHead * SigGroupHeadHashLookup(DetectEngineCtx *, SigGroupHead *)
Used to lookup a SigGroupHead hash from the detection engine context SigGroupHead hash table.
Definition: detect-engine-siggroup.c:300
SigGroupHeadStore
void SigGroupHeadStore(DetectEngineCtx *, SigGroupHead *)
Definition: detect-engine-siggroup.c:99
SigGroupHeadSetFilestoreCount
void SigGroupHeadSetFilestoreCount(DetectEngineCtx *, SigGroupHead *)
Set the filestore_cnt in the sgh.
Definition: detect-engine-siggroup.c:624
SigGroupHeadPrintSigs
void SigGroupHeadPrintSigs(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
Helper function used to print the list of sids for the Signatures present in this SigGroupHead.
Definition: detect-engine-siggroup.c:455
SigGroupHeadSetSigCnt
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...
Definition: detect-engine-siggroup.c:425
SigGroupHeadMpmHashFree
void SigGroupHeadMpmHashFree(DetectEngineCtx *)
SigGroupHeadDPortHashInit
int SigGroupHeadDPortHashInit(DetectEngineCtx *)
SigGroupHeadMpmHashAdd
int SigGroupHeadMpmHashAdd(DetectEngineCtx *, SigGroupHead *)
SigGroupHeadInitData_
Definition: detect.h:1315
SigGroupHeadHashAdd
int SigGroupHeadHashAdd(DetectEngineCtx *, SigGroupHead *)
Adds a SigGroupHead to the detection engine context SigGroupHead hash table.
Definition: detect-engine-siggroup.c:278
Signature_
Signature container.
Definition: detect.h:522
SigGroupHeadMpmHashInit
int SigGroupHeadMpmHashInit(DetectEngineCtx *)
SigGroupHeadDPortHashLookup
SigGroupHead * SigGroupHeadDPortHashLookup(DetectEngineCtx *, SigGroupHead *)
SigGroupHeadHashFree
void SigGroupHeadHashFree(DetectEngineCtx *)
Frees the hash table - DetectEngineCtx->sgh_hash_table, allocated by SigGroupHeadHashInit() function.
Definition: detect-engine-siggroup.c:316
SigGroupHeadSetFileHashFlag
void SigGroupHeadSetFileHashFlag(DetectEngineCtx *, SigGroupHead *)
Set the need hash flag in the sgh.
Definition: detect-engine-siggroup.c:583
SigGroupHeadFreeSigArrays
void SigGroupHeadFreeSigArrays(DetectEngineCtx *de_ctx)
SigGroupHeadInitDataFree
void SigGroupHeadInitDataFree(SigGroupHeadInitData *sghid)
Definition: detect-engine-siggroup.c:58
SigGroupHeadBuildNonPrefilterArray
int SigGroupHeadBuildNonPrefilterArray(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
build an array of rule id's for sigs with no prefilter Also updated de_ctx::non_pf_store_cnt_max to t...
Definition: detect-engine-siggroup.c:648
SigGroupHeadClearSigs
int SigGroupHeadClearSigs(SigGroupHead *)
Clears the bitarray holding the sids for this SigGroupHead.
Definition: detect-engine-siggroup.c:367
SigGroupHeadDPortHashFree
void SigGroupHeadDPortHashFree(DetectEngineCtx *)
SigGroupHeadDPortHashAdd
int SigGroupHeadDPortHashAdd(DetectEngineCtx *, SigGroupHead *)
SigGroupHeadFreeMpmArrays
void SigGroupHeadFreeMpmArrays(DetectEngineCtx *)
SigGroupHeadBuildMatchArray
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.
Definition: detect-engine-siggroup.c:487