suricata
util-reference-config.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 Anoop Saldanha <anoopsaldanha@gmail.com>
22  */
23 
24 #ifndef __UTIL_REFERENCE_CONFIG_H__
25 #define __UTIL_REFERENCE_CONFIG_H__
26 
27 #include "detect.h"
28 
29 #define REFERENCE_SYSTEM_NAME_MAX 64
30 #define REFERENCE_CONTENT_NAME_MAX 1024
31 
32 /**
33  * \brief Holds a reference from the file - reference.config.
34  */
35 typedef struct SCRConfReference_ {
36  /* The system name. This is the primary key for a reference. */
37  char *system;
38  /* The url for the above reference */
39  char *url;
41 
42 SCRConfReference *SCRConfAllocSCRConfReference(const char *, const char *);
47  DetectEngineCtx *);
48 int SCRConfAddReference(DetectEngineCtx *de_ctx, const char *line);
49 void SCRConfRegisterTests(void);
50 
51 /* these below functions are only used by unittests */
55 
56 void SCReferenceConfInit(void);
57 void SCReferenceConfDeinit(void);
58 
59 #endif /* __UTIL_REFERENCE_CONFIG_H__ */
SCRConfAddReference
int SCRConfAddReference(DetectEngineCtx *de_ctx, const char *line)
Parses a line from the reference config file and adds it to Reference Config hash table DetectEngineC...
Definition: util-reference-config.c:228
SCRConfDeInitContext
void SCRConfDeInitContext(DetectEngineCtx *)
Releases de_ctx resources related to Reference Config API.
Definition: util-reference-config.c:185
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:785
SCRConfLoadReferenceConfigFile
int SCRConfLoadReferenceConfigFile(DetectEngineCtx *, FILE *)
Loads the Reference info from the reference.config file.
Definition: util-reference-config.c:491
SCRConfGenerateInValidDummyReferenceConfigFD02
FILE * SCRConfGenerateInValidDummyReferenceConfigFD02(void)
Creates a dummy reference config, with some valid references and a couple of invalid references,...
Definition: util-reference-config.c:564
SCRConfGenerateInValidDummyReferenceConfigFD03
FILE * SCRConfGenerateInValidDummyReferenceConfigFD03(void)
Creates a dummy reference config, with all invalid references, for testing purposes.
Definition: util-reference-config.c:584
de_ctx
DetectEngineCtx * de_ctx
Definition: fuzz_siginit.c:17
SCRConfAllocSCRConfReference
SCRConfReference * SCRConfAllocSCRConfReference(const char *, const char *)
Returns a new SCRConfReference instance. The reference string is converted into lowercase,...
Definition: util-reference-config.c:352
detect.h
SCRConfReference
struct SCRConfReference_ SCRConfReference
Holds a reference from the file - reference.config.
SCRConfGetReference
SCRConfReference * SCRConfGetReference(const char *, DetectEngineCtx *)
Gets the reference config from the corresponding hash table stored in the Detection Engine Context's ...
Definition: util-reference-config.c:522
SCRConfRegisterTests
void SCRConfRegisterTests(void)
This function registers unit tests for Reference Config API.
Definition: util-reference-config.c:781
SCRConfReference_
Holds a reference from the file - reference.config.
Definition: util-reference-config.h:35
SCRConfDeAllocSCRConfReference
void SCRConfDeAllocSCRConfReference(SCRConfReference *)
Frees a SCRConfReference instance.
Definition: util-reference-config.c:386
SCRConfGenerateValidDummyReferenceConfigFD01
FILE * SCRConfGenerateValidDummyReferenceConfigFD01(void)
Creates a dummy reference config, with all valid references, for testing purposes.
Definition: util-reference-config.c:544
SCRConfReference_::system
char * system
Definition: util-reference-config.h:37
SCRConfReference_::url
char * url
Definition: util-reference-config.h:39
SCReferenceConfDeinit
void SCReferenceConfDeinit(void)
Definition: util-reference-config.c:76
SCReferenceConfInit
void SCReferenceConfInit(void)
Definition: util-reference-config.c:56