suricata
util-debug-filters.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_DEBUG_FILTERS_H
25#define SURICATA_DEBUG_FILTERS_H
26
27// pthread_t
28#include "threads.h"
29
30/**
31 * \brief Enum that holds the different kinds of filters available
32 */
33enum {
37};
38
39/**
40 * \brief Structure used to hold the line_no details of a FG filter
41 */
47
48/**
49 * \brief structure used to hold the function details of a FG filter
50 */
57
58/**
59 * \brief Structure used to hold FG filters. Encapsulates filename details,
60 * func details, which inturn encapsulates the line_no details
61 */
68
69/**
70 * \brief Structure used to hold the thread_list used by FD filters
71 */
74 pthread_t t;
75// pid_t t;
76
79
80/**
81 * \brief Structure that holds the FD filters
82 */
83typedef struct SCLogFDFilter_ {
84 char *func;
85
88
89
91
93
94int SCLogAddFGFilterBL(const char *, const char *, int);
95
96int SCLogMatchFGFilterBL(const char *, const char *, int);
97
98int SCLogMatchFGFilterWL(const char *, const char *, int);
99
100void SCLogReleaseFGFilters(void);
101
102int SCLogAddFDFilter(const char *);
103
104int SCLogPrintFDFilters(void);
105
106void SCLogReleaseFDFilters(void);
107
108int SCLogRemoveFDFilter(const char *);
109
110int SCLogCheckFDFilterEntry(const char *);
111
112void SCLogCheckFDFilterExit(const char *);
113
114int SCLogMatchFDFilter(const char *);
115
116int SCLogPrintFGFilters(void);
117
119 const char *,
120 const char *, int,
121 int);
122
125 const char *, int);
126
129 int);
130
132#endif /* SURICATA_DEBUG_FILTERS_H */
Structure used to hold the thread_list used by FD filters.
struct SCLogFDFilterThreadList_ * next
Structure that holds the FD filters.
struct SCLogFDFilter_ * next
Structure used to hold FG filters. Encapsulates filename details, func details, which inturn encapsul...
SCLogFGFilterFunc * func
struct SCLogFGFilterFile_ * next
structure used to hold the function details of a FG filter
SCLogFGFilterLine * line
struct SCLogFGFilterFunc_ * next
Structure used to hold the line_no details of a FG filter.
struct SCLogFGFilterLine_ * next
void SCLogCheckFDFilterExit(const char *)
Updates a FD filter, based on whether the function that calls this function, is registered as a FD fi...
int SCLogMatchFGFilterWL(const char *, const char *, int)
Checks if there is a match for the incoming log_message with any of the FG filters....
int sc_log_fd_filters_present
struct SCLogFGFilterFile_ SCLogFGFilterFile
Structure used to hold FG filters. Encapsulates filename details, func details, which inturn encapsul...
struct SCLogFGFilterFunc_ SCLogFGFilterFunc
structure used to hold the function details of a FG filter
int SCLogCheckFDFilterEntry(const char *)
Updates a FD filter, based on whether the function that calls this function, is registered as a FD fi...
struct SCLogFDFilter_ SCLogFDFilter
Structure that holds the FD filters.
struct SCLogFGFilterLine_ SCLogFGFilterLine
Structure used to hold the line_no details of a FG filter.
void SCLogReleaseFDFilters(void)
Releases all the FD filters added to the logging module.
void SCLogAddToFGFFileList(SCLogFGFilterFile *, const char *, const char *, int, int)
Helper function used internally to add a FG filter. This function is called when the file component o...
@ SC_LOG_FILTER_MAX
@ SC_LOG_FILTER_BL
@ SC_LOG_FILTER_WL
int SCLogPrintFGFilters(void)
Prints the FG filters(both WL and BL). Used for debugging purposes.
int SCLogAddFGFilterBL(const char *, const char *, int)
Adds a Blacklist(BL) fine-grained(FG) filter. A FG filter BL filter allows messages that don't match ...
int sc_log_fg_filters_present
void SCLogAddToFGFFuncList(SCLogFGFilterFile *, SCLogFGFilterFunc *, const char *, int)
Helper function used internally to add a FG filter. This function is called when the file component o...
int SCLogRemoveFDFilter(const char *)
Removes a Function-Dependent(FD) filter.
struct SCLogFDFilterThreadList_ SCLogFDFilterThreadList
Structure used to hold the thread_list used by FD filters.
void SCLogAddToFGFLineList(SCLogFGFilterFunc *, SCLogFGFilterLine *, int)
Helper function used internally to add a FG filter. This function is called when the file and functio...
int SCLogAddFDFilter(const char *)
Adds a Function-Dependent(FD) filter.
int SCLogMatchFGFilterBL(const char *, const char *, int)
Checks if there is a match for the incoming log_message with any of the FG filters....
void SCLogReleaseFGFilters(void)
int SCLogPrintFDFilters(void)
Prints the FG filters(both WL and BL). Used for debugging purposes.
void SCLogReleaseFDFilter(SCLogFDFilter *)
Releases the memory alloted to a FD filter.
int SCLogMatchFDFilter(const char *)
Checks if there is a match for the incoming log_message with any of the FD filters.