suricata
util-classification-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_CLASSIFICATION_CONFIG_H
25#define SURICATA_UTIL_CLASSIFICATION_CONFIG_H
26
27#define CLASSTYPE_NAME_MAX_LEN 64
28#define CLASSTYPE_DESC_MAX_LEN 512
29
30/**
31 * \brief Container for a Classtype from the Classification.config file.
32 */
33typedef struct SCClassConfClasstype_ {
34 /* The index of the classification within classification.config */
35 uint16_t classtype_id;
36
37 /* The priority this classification type carries */
39
40 /* The classtype name. This is the primary key for a Classification. */
41 char *classtype;
42
43 /* Description for a classification. Would be used while printing out
44 * the classification info for a Signature, by the fast-log module. */
47
49int SCClassConfAddClasstype(DetectEngineCtx *de_ctx, char *rawstr, uint16_t index);
53
56
57/* for unittests */
58#ifdef UNITTESTS
63#endif
64
65#endif /* SURICATA_UTIL_CLASSIFICATION_CONFIG_H */
DetectEngineCtx * de_ctx
main detection engine ctx
Definition detect.h:932
Container for a Classtype from the Classification.config file.
FILE * SCClassConfGenerateValidDummyClassConfigFD01(void)
Creates a dummy classification file, with all valid Classtypes, for testing purposes.
void SCClassConfRegisterTests(void)
This function registers unit tests for Classification Config API.
void SCClassSCConfInit(DetectEngineCtx *de_ctx)
FILE * SCClassConfGenerateInvalidDummyClassConfigFD02(void)
Creates a dummy classification file, with some valid Classtypes and a couple of invalid Classtypes,...
int SCClassConfAddClasstype(DetectEngineCtx *de_ctx, char *rawstr, uint16_t index)
Parses a line from the classification file and adds it to Classtype hash table in DetectEngineCtx,...
void SCClassConfDeInitContext(DetectEngineCtx *)
Releases resources used by the Classification Config API.
SCClassConfClasstype * SCClassConfGetClasstype(const char *, DetectEngineCtx *)
Gets the classtype from the corresponding hash table stored in the Detection Engine Context's class c...
bool SCClassConfLoadClassificationConfigFile(DetectEngineCtx *, FILE *fd)
Loads the Classtype info from the classification.config file.
void SCClassConfDeinit(DetectEngineCtx *de_ctx)
struct SCClassConfClasstype_ SCClassConfClasstype
Container for a Classtype from the Classification.config file.
FILE * SCClassConfGenerateInvalidDummyClassConfigFD03(void)
Creates a dummy classification file, with all invalid Classtypes, for testing purposes.