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 __SOURCE_IPFW_H__
26 #define __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 
70 #endif /* __SOURCE_IPFW_H__ */
struct IPFWQueueVars_ IPFWQueueVars
uint32_t pkts
Definition: source-ipfw.h:53
uint32_t replaced
Definition: source-ipfw.h:58
uint8_t use_mutex
Definition: source-ipfw.h:40
struct IPFWPacketVars_ IPFWPacketVars
uint32_t errs
Definition: source-ipfw.h:55
uint16_t port_num
Definition: source-ipfw.h:42
void TmModuleReceiveIPFWRegister(void)
Registration Function for RecieveIPFW.
Definition: source-ipfw.c:153
socklen_t ipfw_sinlen
Definition: source-ipfw.h:46
uint64_t bytes
Definition: source-ipfw.h:54
void TmModuleVerdictIPFWRegister(void)
Registration Function for VerdictIPFW.
Definition: source-ipfw.c:175
SCMutex socket_lock
Definition: source-ipfw.h:39
void * IPFWGetThread(int number)
Get a pointer to the IPFW thread at index.
Definition: source-ipfw.c:778
void TmModuleDecodeIPFWRegister(void)
Registration Function for DecodeIPFW.
Definition: source-ipfw.c:191
uint32_t accepted
Definition: source-ipfw.h:56
#define SCMutex
int IPFWRegisterQueue(char *queue)
Add an IPFW divert.
Definition: source-ipfw.c:713
uint16_t ipfw_index
Definition: source-ipfw.h:44
uint32_t dropped
Definition: source-ipfw.h:57