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