1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License Version 2 as
4  * published by the Free Software Foundation.  You may not use, modify or
5  * distribute this program under any other version of the GNU General
6  * Public License.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
16  *
17  * Copyright (C) 2014-2021 Cisco and/or its affiliates. All rights reserved.
18  * Copyright (C) 2005-2013 Sourcefire, Inc.
19  *
20  * Author: Steven Sturges
21  *
22  */
23 
24 /* $Id$ */
25 
26 #ifndef __SP_PREPROCOPT_H_
27 #define __SP_PREPROCOPT_H_
28 
29 #include "sf_dynamic_engine.h"
30 #include "sfghash.h"
31 
32 SFGHASH * PreprocessorRuleOptionsNew(void);
33 void PreprocessorRuleOptionsFree(SFGHASH *);
34 
35 int RegisterPreprocessorRuleOption(
36     struct _SnortConfig *,
37     char *optionName,
38     PreprocOptionInit initFunc,
39     PreprocOptionEval evalFunc,
40     PreprocOptionCleanup cleanupFunc,
41     PreprocOptionHash hashFunc,
42     PreprocOptionKeyCompare keyCompareFunc,
43     PreprocOptionOtnHandler otnHandler,
44     PreprocOptionFastPatternFunc fpFunc
45 );
46 
47 void RegisterPreprocessorRuleOptionOverride(
48     struct _SnortConfig *,
49     char *keyword, char *option,
50     PreprocOptionInit initFunc,
51     PreprocOptionEval evalFunc,
52     PreprocOptionCleanup cleanupFunc,
53     PreprocOptionHash hashFunc,
54     PreprocOptionKeyCompare keyCompareFunc,
55     PreprocOptionOtnHandler otnHandler,
56     PreprocOptionFastPatternFunc fpFunc
57 );
58 
59 int GetPreprocessorRuleOptionFuncs(
60     struct _SnortConfig *,
61     char *optionName,
62     PreprocOptionInit* initFunc,
63     PreprocOptionEval* evalFunc,
64     PreprocOptionOtnHandler* otnHandler,
65     PreprocOptionFastPatternFunc* fpFunc,
66     PreprocOptionCleanup* cleanupFunc
67 );
68 
69 
70 void RegisterPreprocessorRuleOptionByteOrder(char *keyword, PreprocOptionByteOrderFunc bo_func);
71 
72 int AddPreprocessorRuleOption(struct _SnortConfig *sc, char *, OptTreeNode *, void *, PreprocOptionEval);
73 
74 uint32_t PreprocessorRuleOptionHash(void *d);
75 int PreprocessorRuleOptionCompare(void *l, void *r);
76 void PreprocessorRuleOptionsFreeFunc(void *);
77 int GetPreprocFastPatterns(void *, int, int, FPContentInfo **);
78 int PreprocessorOptionFunc(void *option_data, Packet *p);
79 
80 #endif  /* __SP_PREPROCOPT_H_ */
81 
82