suricata
source-pfring.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 William Metcalf <william.metcalf@gmail.com>
22  */
23 
24 #ifndef __SOURCE_PFRING_H__
25 #define __SOURCE_PFRING_H__
26 
27 #define PFRING_IFACE_NAME_LENGTH 48
28 
29 #include <config.h>
30 
32 
33 /* PfringIfaceConfig flags */
34 #define PFRING_CONF_FLAGS_CLUSTER (1 << 0)
35 #define PFRING_CONF_FLAGS_BYPASS (1 << 1)
36 
37 typedef struct PfringIfaceConfig_
38 {
39  uint32_t flags;
40 
41  /* cluster param */
43  unsigned int ctype;
44 
46  /* number of threads */
47  int threads;
48 
49  char *bpf_filter;
50 
52  SC_ATOMIC_DECLARE(unsigned int, ref);
53  void (*DerefFunc)(void *);
55 
56 /**
57  * \brief per packet Pfring vars
58  *
59  * This structure is used to pass packet metadata in callbacks.
60  */
61 typedef struct PfringPacketVars_
62 {
64  uint32_t flow_id;
66 
67 
70 
71 int PfringConfGetThreads(void);
72 void PfringLoadConfig(void);
73 
74 /* We don't have to use an enum that sucks in our code */
75 #define CLUSTER_FLOW 0
76 #define CLUSTER_ROUND_ROBIN 1
77 #define CLUSTER_FLOW_5_TUPLE 4
78 #endif /* __SOURCE_PFRING_H__ */
PfringIfaceConfig_
Definition: source-pfring.h:37
PfringIfaceConfig_::cluster_id
int cluster_id
Definition: source-pfring.h:42
PfringIfaceConfig_::bpf_filter
char * bpf_filter
Definition: source-pfring.h:49
PfringPacketVars
struct PfringPacketVars_ PfringPacketVars
per packet Pfring vars
PfringLoadConfig
void PfringLoadConfig(void)
PfringIfaceConfig_::iface
char iface[PFRING_IFACE_NAME_LENGTH]
Definition: source-pfring.h:45
PFRING_IFACE_NAME_LENGTH
#define PFRING_IFACE_NAME_LENGTH
Definition: source-pfring.h:27
PfringPacketVars_::ptv
PfringThreadVars * ptv
Definition: source-pfring.h:63
PfringIfaceConfig
struct PfringIfaceConfig_ PfringIfaceConfig
PfringConfGetThreads
int PfringConfGetThreads(void)
PfringThreadVars_
Structure to hold thread specific variables.
Definition: source-pfring.c:123
PfringIfaceConfig_::flags
uint32_t flags
Definition: source-pfring.h:39
TmModuleDecodePfringRegister
void TmModuleDecodePfringRegister(void)
Registration Function for DecodePfring.
Definition: source-pfring.c:180
PfringIfaceConfig_::SC_ATOMIC_DECLARE
SC_ATOMIC_DECLARE(unsigned int, ref)
TmModuleReceivePfringRegister
void TmModuleReceivePfringRegister(void)
Registration Function for RecievePfring.
Definition: source-pfring.c:163
ChecksumValidationMode
ChecksumValidationMode
Definition: decode.h:40
PfringIfaceConfig_::DerefFunc
void(* DerefFunc)(void *)
Definition: source-pfring.h:53
PfringPacketVars_::flow_id
uint32_t flow_id
Definition: source-pfring.h:64
PfringPacketVars_
per packet Pfring vars
Definition: source-pfring.h:61
PfringIfaceConfig_::threads
int threads
Definition: source-pfring.h:47
PfringIfaceConfig_::checksum_mode
ChecksumValidationMode checksum_mode
Definition: source-pfring.h:51
PfringIfaceConfig_::ctype
unsigned int ctype
Definition: source-pfring.h:43