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 */
35typedef 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
42SCRConfReference *SCRConfAllocSCRConfReference(const char *, const char *);
48int SCRConfAddReference(DetectEngineCtx *de_ctx, const char *line);
49void SCRConfRegisterTests(void);
50
51/* these below functions are only used by unittests */
55
58
59#endif /* SURICATA_UTIL_REFERENCE_CONFIG_H */
DetectEngineCtx * de_ctx
main detection engine ctx
Definition detect.h:932
Holds a reference from the file - reference.config.
SCRConfReference * SCRConfAllocSCRConfReference(const char *, const char *)
Returns a new SCRConfReference instance. The reference string is converted into lowercase,...
int SCRConfLoadReferenceConfigFile(DetectEngineCtx *, FILE *)
Loads the Reference info from the reference.config file.
FILE * SCRConfGenerateInvalidDummyReferenceConfigFD03(void)
Creates a dummy reference config, with all invalid references, for testing purposes.
SCRConfReference * SCRConfGetReference(const char *, DetectEngineCtx *)
Gets the reference config from the corresponding hash table stored in the Detection Engine Context's ...
void SCReferenceSCConfInit(DetectEngineCtx *de_ctx)
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 SCRConfDeAllocSCRConfReference(SCRConfReference *)
Frees a SCRConfReference instance.
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...
FILE * SCRConfGenerateInvalidDummyReferenceConfigFD02(void)
Creates a dummy reference config, with some valid references and a couple of invalid references,...
void SCReferenceConfDeinit(DetectEngineCtx *de_ctx)
void SCRConfRegisterTests(void)
This function registers unit tests for Reference Config API.
struct SCRConfReference_ SCRConfReference
Holds a reference from the file - reference.config.