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 /**
28  * \brief Holds a reference from the file - reference.config.
29  */
30 typedef struct SCRConfReference_ {
31  /* The system name. This is the primary key for a reference. */
32  char *system;
33  /* The url for the above reference */
34  char *url;
36 
37 SCRConfReference *SCRConfAllocSCRConfReference(const char *, const char *);
42  DetectEngineCtx *);
43 void SCRConfRegisterTests(void);
44 
45 /* these below functions are only used by unittests */
49 
50 void SCReferenceConfInit(void);
51 void SCReferenceConfDeinit(void);
52 
53 #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:756
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...
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.