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 SURICATA_UTIL_REFERENCE_CONFIG_H
25 #define SURICATA_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 
58 
59 #endif /* SURICATA_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:220
SCReferenceConfDeinit
void SCReferenceConfDeinit(DetectEngineCtx *de_ctx)
Definition: util-reference-config.c:72
SCRConfDeInitContext
void SCRConfDeInitContext(DetectEngineCtx *)
Releases de_ctx resources related to Reference Config API.
Definition: util-reference-config.c:179
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:841
SCRConfLoadReferenceConfigFile
int SCRConfLoadReferenceConfigFile(DetectEngineCtx *, FILE *)
Loads the Reference info from the reference.config file.
Definition: util-reference-config.c:485
de_ctx
DetectEngineCtx * de_ctx
Definition: fuzz_siginit.c:17
SCRConfGenerateInvalidDummyReferenceConfigFD02
FILE * SCRConfGenerateInvalidDummyReferenceConfigFD02(void)
Creates a dummy reference config, with some valid references and a couple of invalid references,...
Definition: util-reference-config.c:558
SCRConfAllocSCRConfReference
SCRConfReference * SCRConfAllocSCRConfReference(const char *, const char *)
Returns a new SCRConfReference instance. The reference string is converted into lowercase,...
Definition: util-reference-config.c:351
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:516
SCReferenceConfInit
void SCReferenceConfInit(DetectEngineCtx *de_ctx)
Definition: util-reference-config.c:52
SCRConfRegisterTests
void SCRConfRegisterTests(void)
This function registers unit tests for Reference Config API.
Definition: util-reference-config.c:775
SCRConfReference_
Holds a reference from the file - reference.config.
Definition: util-reference-config.h:35
SCRConfGenerateInvalidDummyReferenceConfigFD03
FILE * SCRConfGenerateInvalidDummyReferenceConfigFD03(void)
Creates a dummy reference config, with all invalid references, for testing purposes.
Definition: util-reference-config.c:578
SCRConfDeAllocSCRConfReference
void SCRConfDeAllocSCRConfReference(SCRConfReference *)
Frees a SCRConfReference instance.
Definition: util-reference-config.c:384
SCRConfGenerateValidDummyReferenceConfigFD01
FILE * SCRConfGenerateValidDummyReferenceConfigFD01(void)
Creates a dummy reference config, with all valid references, for testing purposes.
Definition: util-reference-config.c:538
SCRConfReference_::system
char * system
Definition: util-reference-config.h:37
SCRConfReference_::url
char * url
Definition: util-reference-config.h:39