suricata
source-ipfw.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2011 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 Nick Rogness <nick@rogness.net>
22  * \author Eric Leblond <eric@regit.org>
23  */
24 
25 #ifndef SURICATA_SOURCE_IPFW_H
26 #define SURICATA_SOURCE_IPFW_H
27 
28 #define IPFW_MAX_QUEUE 16
29 
30 /* per packet IPFW vars (Not used) */
31 typedef struct IPFWPacketVars_
32 {
35 
36 typedef struct IPFWQueueVars_
37 {
38  int fd;
40  uint8_t use_mutex;
41  /* this one should be not changing after init */
42  uint16_t port_num;
43  /* position into the ipfw queue var array */
44  uint16_t ipfw_index;
45  struct sockaddr_in ipfw_sin;
46  socklen_t ipfw_sinlen;
47 
48 #ifdef DBG_PERF
49  int dbg_maxreadsize;
50 #endif /* DBG_PERF */
51 
52  /* counters */
53  uint32_t pkts;
54  uint64_t bytes;
55  uint32_t errs;
56  uint32_t accepted;
57  uint32_t dropped;
58  uint32_t replaced;
59 
61 
62 void *IPFWGetThread(int number);
63 int IPFWRegisterQueue(char *queue);
64 
65 void TmModuleReceiveIPFWRegister (void);
66 void TmModuleVerdictIPFWRegister (void);
67 void TmModuleDecodeIPFWRegister (void);
68 
69 #endif /* SURICATA_SOURCE_IPFW_H */
IPFWPacketVars
struct IPFWPacketVars_ IPFWPacketVars
TmModuleVerdictIPFWRegister
void TmModuleVerdictIPFWRegister(void)
Registration Function for VerdictIPFW.
Definition: source-ipfw.c:171
IPFWQueueVars_::socket_lock
SCMutex socket_lock
Definition: source-ipfw.h:39
IPFWGetThread
void * IPFWGetThread(int number)
Get a pointer to the IPFW thread at index.
Definition: source-ipfw.c:762
IPFWQueueVars_::accepted
uint32_t accepted
Definition: source-ipfw.h:56
IPFWRegisterQueue
int IPFWRegisterQueue(char *queue)
Add an IPFW divert.
Definition: source-ipfw.c:698
IPFWQueueVars_::ipfw_index
uint16_t ipfw_index
Definition: source-ipfw.h:44
IPFWQueueVars_::fd
int fd
Definition: source-ipfw.h:38
IPFWQueueVars_::dropped
uint32_t dropped
Definition: source-ipfw.h:57
IPFWQueueVars_::pkts
uint32_t pkts
Definition: source-ipfw.h:53
IPFWQueueVars_::ipfw_sin
struct sockaddr_in ipfw_sin
Definition: source-ipfw.h:45
TmModuleDecodeIPFWRegister
void TmModuleDecodeIPFWRegister(void)
Registration Function for DecodeIPFW.
Definition: source-ipfw.c:186
IPFWQueueVars_::replaced
uint32_t replaced
Definition: source-ipfw.h:58
TmModuleReceiveIPFWRegister
void TmModuleReceiveIPFWRegister(void)
Registration Function for RecieveIPFW.
Definition: source-ipfw.c:150
IPFWQueueVars_::use_mutex
uint8_t use_mutex
Definition: source-ipfw.h:40
IPFWPacketVars_
Definition: source-ipfw.h:32
IPFWQueueVars_::errs
uint32_t errs
Definition: source-ipfw.h:55
IPFWQueueVars_::port_num
uint16_t port_num
Definition: source-ipfw.h:42
IPFWQueueVars_::ipfw_sinlen
socklen_t ipfw_sinlen
Definition: source-ipfw.h:46
IPFWPacketVars_::ipfw_index
int ipfw_index
Definition: source-ipfw.h:33
IPFWQueueVars_
Definition: source-ipfw.h:37
IPFWQueueVars
struct IPFWQueueVars_ IPFWQueueVars
IPFWQueueVars_::bytes
uint64_t bytes
Definition: source-ipfw.h:54
SCMutex
#define SCMutex
Definition: threads-debug.h:114