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 #define REFERENCE_SYSTEM_NAME_MAX 64
28 #define REFERENCE_CONTENT_NAME_MAX 1024
29 
30 /**
31  * \brief Holds a reference from the file - reference.config.
32  */
33 typedef struct SCRConfReference_ {
34  /* The system name. This is the primary key for a reference. */
35  char *system;
36  /* The url for the above reference */
37  char *url;
39 
40 SCRConfReference *SCRConfAllocSCRConfReference(const char *, const char *);
45  DetectEngineCtx *);
46 int SCRConfAddReference(DetectEngineCtx *de_ctx, const char *line);
47 void SCRConfRegisterTests(void);
48 
49 /* these below functions are only used by unittests */
53 
54 void SCReferenceConfInit(void);
55 void SCReferenceConfDeinit(void);
56 
57 #endif /* __UTIL_REFERENCE_CONFIG_H__ */
void SCRConfDeInitContext(DetectEngineCtx *)
Releases de_ctx resources related to Reference Config API.
FILE * SCRConfGenerateValidDummyReferenceConfigFD01(void)
Creates a dummy reference config, with all valid references, for testing purposes.
void SCReferenceConfDeinit(void)
void SCReferenceConfInit(void)
int SCRConfLoadReferenceConfigFile(DetectEngineCtx *, FILE *)
Loads the Reference info from the reference.config file.
main detection engine ctx
Definition: detect.h:761
SCRConfReference * SCRConfGetReference(const char *, DetectEngineCtx *)
Gets the refernce config from the corresponding hash table stored in the Detection Engine Context&#39;s r...
FILE * SCRConfGenerateInValidDummyReferenceConfigFD02(void)
Creates a dummy reference config, with some valid references and a couple of invalid references...
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...
SCRConfReference * SCRConfAllocSCRConfReference(const char *, const char *)
Returns a new SCRConfReference instance. The reference string is converted into lowercase, before being assigned to the instance.
void SCRConfDeAllocSCRConfReference(SCRConfReference *)
Frees a SCRConfReference instance.
Holds a reference from the file - reference.config.
FILE * SCRConfGenerateInValidDummyReferenceConfigFD03(void)
Creates a dummy reference config, with all invalid references, for testing purposes.
struct SCRConfReference_ SCRConfReference
Holds a reference from the file - reference.config.
void SCRConfRegisterTests(void)
This function registers unit tests for Reference Config API.