1 #ifndef _NFNETLINK_QUEUE_H
2 #define _NFNETLINK_QUEUE_H
4 #include <linux/types.h>
5 #include <linux/netfilter/nfnetlink.h>
8 NFQNL_MSG_PACKET
, /* packet from kernel to userspace */
9 NFQNL_MSG_VERDICT
, /* verdict from userspace to kernel */
10 NFQNL_MSG_CONFIG
, /* connect to a particular queue */
11 NFQNL_MSG_VERDICT_BATCH
, /* batchv from userspace to kernel */
16 struct nfqnl_msg_packet_hdr
{
17 __be32 packet_id
; /* unique ID of packet in queue */
18 __be16 hw_protocol
; /* hw protocol (network order) */
19 __u8 hook
; /* netfilter hook */
20 } __attribute__ ((packed
));
22 struct nfqnl_msg_packet_hw
{
28 struct nfqnl_msg_packet_timestamp
{
33 enum nfqnl_attr_type
{
36 NFQA_VERDICT_HDR
, /* nfqnl_msg_verdict_hrd */
37 NFQA_MARK
, /* __u32 nfmark */
38 NFQA_TIMESTAMP
, /* nfqnl_msg_packet_timestamp */
39 NFQA_IFINDEX_INDEV
, /* __u32 ifindex */
40 NFQA_IFINDEX_OUTDEV
, /* __u32 ifindex */
41 NFQA_IFINDEX_PHYSINDEV
, /* __u32 ifindex */
42 NFQA_IFINDEX_PHYSOUTDEV
, /* __u32 ifindex */
43 NFQA_HWADDR
, /* nfqnl_msg_packet_hw */
44 NFQA_PAYLOAD
, /* opaque data payload */
45 NFQA_CT
, /* nf_conntrack_netlink.h */
46 NFQA_CT_INFO
, /* enum ip_conntrack_info */
50 #define NFQA_MAX (__NFQA_MAX - 1)
52 struct nfqnl_msg_verdict_hdr
{
58 enum nfqnl_msg_config_cmds
{
62 NFQNL_CFG_CMD_PF_BIND
,
63 NFQNL_CFG_CMD_PF_UNBIND
,
66 struct nfqnl_msg_config_cmd
{
67 __u8 command
; /* nfqnl_msg_config_cmds */
69 __be16 pf
; /* AF_xxx for PF_[UN]BIND */
72 enum nfqnl_config_mode
{
78 struct nfqnl_msg_config_params
{
80 __u8 copy_mode
; /* enum nfqnl_config_mode */
81 } __attribute__ ((packed
));
84 enum nfqnl_attr_config
{
86 NFQA_CFG_CMD
, /* nfqnl_msg_config_cmd */
87 NFQA_CFG_PARAMS
, /* nfqnl_msg_config_params */
88 NFQA_CFG_QUEUE_MAXLEN
, /* __u32 */
89 NFQA_CFG_MASK
, /* identify which flags to change */
90 NFQA_CFG_FLAGS
, /* value of these flags (__u32) */
93 #define NFQA_CFG_MAX (__NFQA_CFG_MAX-1)
95 /* Flags for NFQA_CFG_FLAGS */
96 #define NFQA_CFG_F_FAIL_OPEN (1 << 0)
97 #define NFQA_CFG_F_CONNTRACK (1 << 1)
98 #define NFQA_CFG_F_MAX (1 << 2)
100 #endif /* _NFNETLINK_QUEUE_H */