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__ */
unsigned int ctype
Definition: source-pfring.h:43
int PfringConfGetThreads(void)
struct PfringIfaceConfig_ PfringIfaceConfig
void(* DerefFunc)(void *)
Definition: source-pfring.h:53
void TmModuleDecodePfringRegister(void)
Registration Function for DecodePfring.
struct PfringPacketVars_ PfringPacketVars
per packet Pfring vars
SC_ATOMIC_DECLARE(unsigned int, ref)
Structure to hold thread specific variables.
PfringThreadVars * ptv
Definition: source-pfring.h:63
ChecksumValidationMode checksum_mode
Definition: source-pfring.h:51
per packet Pfring vars
Definition: source-pfring.h:61
char iface[PFRING_IFACE_NAME_LENGTH]
Definition: source-pfring.h:45
ChecksumValidationMode
Definition: decode.h:40
void PfringLoadConfig(void)
void TmModuleReceivePfringRegister(void)
Registration Function for RecievePfring.
#define PFRING_IFACE_NAME_LENGTH
Definition: source-pfring.h:27