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 SURICATA_SOURCE_PFRING_H
25 #define SURICATA_SOURCE_PFRING_H
26 
27 #define PFRING_IFACE_NAME_LENGTH 48
28 
29 typedef struct PfringThreadVars_ PfringThreadVars;
30 
31 /* PfringIfaceConfig flags */
32 #define PFRING_CONF_FLAGS_CLUSTER (1 << 0)
33 #define PFRING_CONF_FLAGS_BYPASS (1 << 1)
34 
35 typedef struct PfringIfaceConfig_
36 {
37  uint32_t flags;
38 
39  /* cluster param */
41  unsigned int ctype;
42 
44  /* number of threads */
45  int threads;
46 
47  const char *bpf_filter;
48 
50  SC_ATOMIC_DECLARE(unsigned int, ref);
51  void (*DerefFunc)(void *);
53 
54 /**
55  * \brief per packet Pfring vars
56  *
57  * This structure is used to pass packet metadata in callbacks.
58  */
59 typedef struct PfringPacketVars_
60 {
62  uint32_t flow_id;
64 
65 
68 
70 void PfringLoadConfig(void);
71 
72 /*
73  * We don't have to use an enum that sucks in our code
74  * these values must match with cluster_type in the kernel
75  * include file pf_ring.h
76  */
77 #define CLUSTER_FLOW 0
78 #define CLUSTER_ROUND_ROBIN 1
79 #define CLUSTER_FLOW_5_TUPLE 4
80 #define CLUSTER_INNER_FLOW 6
81 #define CLUSTER_INNER_FLOW_2_TUPLE 7
82 #define CLUSTER_INNER_FLOW_4_TUPLE 8
83 #define CLUSTER_INNER_FLOW_5_TUPLE 9
84 #endif /* SURICATA_SOURCE_PFRING_H */
PfringIfaceConfig_
Definition: source-pfring.h:36
PfringIfaceConfig_::cluster_id
int cluster_id
Definition: source-pfring.h:40
PfringPacketVars
struct PfringPacketVars_ PfringPacketVars
per packet Pfring vars
PfringLoadConfig
void PfringLoadConfig(void)
PfringIfaceConfig_::iface
char iface[PFRING_IFACE_NAME_LENGTH]
Definition: source-pfring.h:43
PFRING_IFACE_NAME_LENGTH
#define PFRING_IFACE_NAME_LENGTH
Definition: source-pfring.h:27
PfringPacketVars_::ptv
PfringThreadVars * ptv
Definition: source-pfring.h:61
PfringIfaceConfig_::bpf_filter
const char * bpf_filter
Definition: source-pfring.h:47
PfringIfaceConfig
struct PfringIfaceConfig_ PfringIfaceConfig
PfringConfGetThreads
int PfringConfGetThreads(void)
PfringThreadVars_
Structure to hold thread specific variables.
Definition: source-pfring.c:124
PfringIfaceConfig_::flags
uint32_t flags
Definition: source-pfring.h:37
TmModuleDecodePfringRegister
void TmModuleDecodePfringRegister(void)
Registration Function for DecodePfring.
Definition: source-pfring.c:179
PfringIfaceConfig_::SC_ATOMIC_DECLARE
SC_ATOMIC_DECLARE(unsigned int, ref)
TmModuleReceivePfringRegister
void TmModuleReceivePfringRegister(void)
Registration Function for ReceivePfring.
Definition: source-pfring.c:163
ChecksumValidationMode
ChecksumValidationMode
Definition: decode.h:45
PfringIfaceConfig_::DerefFunc
void(* DerefFunc)(void *)
Definition: source-pfring.h:51
PfringPacketVars_::flow_id
uint32_t flow_id
Definition: source-pfring.h:62
PfringPacketVars_
per packet Pfring vars
Definition: source-pfring.h:60
PfringIfaceConfig_::threads
int threads
Definition: source-pfring.h:45
PfringIfaceConfig_::checksum_mode
ChecksumValidationMode checksum_mode
Definition: source-pfring.h:49
PfringIfaceConfig_::ctype
unsigned int ctype
Definition: source-pfring.h:41