-
Notifications
You must be signed in to change notification settings - Fork 2
/
nfq.h
57 lines (51 loc) · 1.81 KB
/
nfq.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* Soft: check-tun is a userspace daemon that encapsulates packets
* captured through netfilter-nfqueue to the configured
* destinations based on fwmark on the packet.
*
* Author: Alexey Andriyanov, <alan@al-an.info>
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* Copyright (C) 2014 Alexey Andriyanov, <alan@al-an.info>
*/
#include <stdint.h>
#include <stdbool.h>
#include <sys/socket.h>
#include <libnetfilter_queue/libnetfilter_queue.h>
#include "config.h"
#include "keepalived/utils.h"
#include "keepalived/memory.h"
struct gre_base_hdr {
__be16 flags;
__be16 protocol;
} __packed;
typedef struct nfq_thread_var {
unsigned int nfq_q_num;
unsigned int thread_num;
bool err;
bool terminated;
bool cpu_affinity;
struct nfq_handle *h;
struct nfq_q_handle *qh;
struct nfnl_handle *nh;
int fd;
ct_conf_t *current_conf;
ct_conf_t **global_conf;
char buf[8*4096] __attribute__ ((aligned));
} nfq_thread_var_t;
extern int nfq_debug;
extern struct sockaddr_storage bind4, bind6;
extern int nfq_init_int(char *);
extern int nfq_init_th(int, nfq_thread_var_t *);
extern int nfq_done(int, nfq_thread_var_t *);
//extern int nfq_cycle_read(ct_conf_t *);
extern void nfq_thread_hup(int thread_num);