1
2#ifndef _NFNETLINK_QUEUE_H
3#define _NFNETLINK_QUEUE_H
4
5#include <linux/types.h>
6#include <linux/netfilter/nfnetlink.h>
7
8enum nfqnl_msg_types {
9 NFQNL_MSG_PACKET,
10 NFQNL_MSG_VERDICT,
11 NFQNL_MSG_CONFIG,
12 NFQNL_MSG_VERDICT_BATCH,
13
14 NFQNL_MSG_MAX
15};
16
17struct nfqnl_msg_packet_hdr {
18 __be32 packet_id;
19 __be16 hw_protocol;
20 __u8 hook;
21} __attribute__ ((packed));
22
23struct nfqnl_msg_packet_hw {
24 __be16 hw_addrlen;
25 __u16 _pad;
26 __u8 hw_addr[8];
27};
28
29struct nfqnl_msg_packet_timestamp {
30 __aligned_be64 sec;
31 __aligned_be64 usec;
32};
33
34enum nfqnl_vlan_attr {
35 NFQA_VLAN_UNSPEC,
36 NFQA_VLAN_PROTO,
37 NFQA_VLAN_TCI,
38 __NFQA_VLAN_MAX,
39};
40#define NFQA_VLAN_MAX (__NFQA_VLAN_MAX - 1)
41
42enum nfqnl_attr_type {
43 NFQA_UNSPEC,
44 NFQA_PACKET_HDR,
45 NFQA_VERDICT_HDR,
46 NFQA_MARK,
47 NFQA_TIMESTAMP,
48 NFQA_IFINDEX_INDEV,
49 NFQA_IFINDEX_OUTDEV,
50 NFQA_IFINDEX_PHYSINDEV,
51 NFQA_IFINDEX_PHYSOUTDEV,
52 NFQA_HWADDR,
53 NFQA_PAYLOAD,
54 NFQA_CT,
55 NFQA_CT_INFO,
56 NFQA_CAP_LEN,
57 NFQA_SKB_INFO,
58 NFQA_EXP,
59 NFQA_UID,
60 NFQA_GID,
61 NFQA_SECCTX,
62 NFQA_VLAN,
63 NFQA_L2HDR,
64
65 __NFQA_MAX
66};
67#define NFQA_MAX (__NFQA_MAX - 1)
68
69struct nfqnl_msg_verdict_hdr {
70 __be32 verdict;
71 __be32 id;
72};
73
74
75enum nfqnl_msg_config_cmds {
76 NFQNL_CFG_CMD_NONE,
77 NFQNL_CFG_CMD_BIND,
78 NFQNL_CFG_CMD_UNBIND,
79 NFQNL_CFG_CMD_PF_BIND,
80 NFQNL_CFG_CMD_PF_UNBIND,
81};
82
83struct nfqnl_msg_config_cmd {
84 __u8 command;
85 __u8 _pad;
86 __be16 pf;
87};
88
89enum nfqnl_config_mode {
90 NFQNL_COPY_NONE,
91 NFQNL_COPY_META,
92 NFQNL_COPY_PACKET,
93};
94
95struct nfqnl_msg_config_params {
96 __be32 copy_range;
97 __u8 copy_mode;
98} __attribute__ ((packed));
99
100
101enum nfqnl_attr_config {
102 NFQA_CFG_UNSPEC,
103 NFQA_CFG_CMD,
104 NFQA_CFG_PARAMS,
105 NFQA_CFG_QUEUE_MAXLEN,
106 NFQA_CFG_MASK,
107 NFQA_CFG_FLAGS,
108 __NFQA_CFG_MAX
109};
110#define NFQA_CFG_MAX (__NFQA_CFG_MAX-1)
111
112
113#define NFQA_CFG_F_FAIL_OPEN (1 << 0)
114#define NFQA_CFG_F_CONNTRACK (1 << 1)
115#define NFQA_CFG_F_GSO (1 << 2)
116#define NFQA_CFG_F_UID_GID (1 << 3)
117#define NFQA_CFG_F_SECCTX (1 << 4)
118#define NFQA_CFG_F_MAX (1 << 5)
119
120
121
122#define NFQA_SKB_CSUMNOTREADY (1 << 0)
123
124#define NFQA_SKB_GSO (1 << 1)
125
126#define NFQA_SKB_CSUM_NOTVERIFIED (1 << 2)
127
128#endif
129