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 __UTIL_CLASSIFICATION_CONFIG_H__
25 #define __UTIL_CLASSIFICATION_CONFIG_H__
26 
27 /**
28  * \brief Container for a Classtype from the Classification.config file.
29  */
30 typedef struct SCClassConfClasstype_ {
31  /* The index of the classification within classification.confg */
32  uint8_t classtype_id;
33 
34  /* The classtype name. This is the primary key for a Classification. */
35  char *classtype;
36 
37  /* Description for a classification. Would be used while printing out
38  * the classification info for a Signature, by the fast-log module. */
40 
41  /* The priority this classification type carries */
42  int priority;
44 
45 SCClassConfClasstype *SCClassConfAllocClasstype(uint8_t, const char *,
46  const char *, int);
50  DetectEngineCtx *);
52 void SCClassConfRegisterTests(void);
53 
54 /* for unittests */
58 
59 void SCClassConfInit(void);
60 void SCClassConfDeinit(void);
61 
62 #endif /* __UTIL_CLASSIFICATION_CONFIG_H__ */
SCClassConfClasstype * SCClassConfAllocClasstype(uint8_t, const char *, const char *, int)
Returns a new SCClassConfClasstype instance. The classtype string is converted into lowercase...
void SCClassConfDeinit(void)
void SCClassConfRegisterTests(void)
This function registers unit tests for Classification Config API.
FILE * SCClassConfGenerateInValidDummyClassConfigFD03(void)
Creates a dummy classification file, with all invalid Classtypes, for testing purposes.
FILE * SCClassConfGenerateValidDummyClassConfigFD01(void)
Creates a dummy classification file, with all valid Classtypes, for testing purposes.
struct SCClassConfClasstype_ SCClassConfClasstype
Container for a Classtype from the Classification.config file.
main detection engine ctx
Definition: detect.h:756
FILE * SCClassConfGenerateInValidDummyClassConfigFD02(void)
Creates a dummy classification file, with some valid Classtypes and a couple of invalid Classtypes...
SCClassConfClasstype * SCClassConfGetClasstype(const char *, DetectEngineCtx *)
Gets the classtype from the corresponding hash table stored in the Detection Engine Context&#39;s class c...
void SCClassConfInit(void)
void SCClassConfDeInitContext(DetectEngineCtx *)
Releases resources used by the Classification Config API.
void SCClassConfLoadClassficationConfigFile(DetectEngineCtx *, FILE *fd)
Loads the Classtype info from the classification.config file.
Container for a Classtype from the Classification.config file.
void SCClassConfDeAllocClasstype(SCClassConfClasstype *)
Frees a SCClassConfClasstype instance.