blob: d100decedc1f0436c110162aa7921ac6f9c7ab15 [file] [log] [blame]
Colin Cross07a58322022-02-08 19:45:27 -08001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _NFNETLINK_QUEUE_H
20#define _NFNETLINK_QUEUE_H
21#include <linux/types.h>
22#include <linux/netfilter/nfnetlink.h>
23enum nfqnl_msg_types {
24 NFQNL_MSG_PACKET,
25 NFQNL_MSG_VERDICT,
26 NFQNL_MSG_CONFIG,
27 NFQNL_MSG_VERDICT_BATCH,
28 NFQNL_MSG_MAX
29};
30struct nfqnl_msg_packet_hdr {
31 __be32 packet_id;
32 __be16 hw_protocol;
33 __u8 hook;
34} __attribute__((packed));
35struct nfqnl_msg_packet_hw {
36 __be16 hw_addrlen;
37 __u16 _pad;
38 __u8 hw_addr[8];
39};
40struct nfqnl_msg_packet_timestamp {
41 __aligned_be64 sec;
42 __aligned_be64 usec;
43};
44enum nfqnl_vlan_attr {
45 NFQA_VLAN_UNSPEC,
46 NFQA_VLAN_PROTO,
47 NFQA_VLAN_TCI,
48 __NFQA_VLAN_MAX,
49};
50#define NFQA_VLAN_MAX (__NFQA_VLAN_MAX - 1)
51enum nfqnl_attr_type {
52 NFQA_UNSPEC,
53 NFQA_PACKET_HDR,
54 NFQA_VERDICT_HDR,
55 NFQA_MARK,
56 NFQA_TIMESTAMP,
57 NFQA_IFINDEX_INDEV,
58 NFQA_IFINDEX_OUTDEV,
59 NFQA_IFINDEX_PHYSINDEV,
60 NFQA_IFINDEX_PHYSOUTDEV,
61 NFQA_HWADDR,
62 NFQA_PAYLOAD,
63 NFQA_CT,
64 NFQA_CT_INFO,
65 NFQA_CAP_LEN,
66 NFQA_SKB_INFO,
67 NFQA_EXP,
68 NFQA_UID,
69 NFQA_GID,
70 NFQA_SECCTX,
71 NFQA_VLAN,
72 NFQA_L2HDR,
Jordan Demeulenaere2d505822022-08-11 17:20:14 +020073 NFQA_PRIORITY,
Colin Cross07a58322022-02-08 19:45:27 -080074 __NFQA_MAX
75};
76#define NFQA_MAX (__NFQA_MAX - 1)
77struct nfqnl_msg_verdict_hdr {
78 __be32 verdict;
79 __be32 id;
80};
81enum nfqnl_msg_config_cmds {
82 NFQNL_CFG_CMD_NONE,
83 NFQNL_CFG_CMD_BIND,
84 NFQNL_CFG_CMD_UNBIND,
85 NFQNL_CFG_CMD_PF_BIND,
86 NFQNL_CFG_CMD_PF_UNBIND,
87};
88struct nfqnl_msg_config_cmd {
89 __u8 command;
90 __u8 _pad;
91 __be16 pf;
92};
93enum nfqnl_config_mode {
94 NFQNL_COPY_NONE,
95 NFQNL_COPY_META,
96 NFQNL_COPY_PACKET,
97};
98struct nfqnl_msg_config_params {
99 __be32 copy_range;
100 __u8 copy_mode;
101} __attribute__((packed));
102enum nfqnl_attr_config {
103 NFQA_CFG_UNSPEC,
104 NFQA_CFG_CMD,
105 NFQA_CFG_PARAMS,
106 NFQA_CFG_QUEUE_MAXLEN,
107 NFQA_CFG_MASK,
108 NFQA_CFG_FLAGS,
109 __NFQA_CFG_MAX
110};
111#define NFQA_CFG_MAX (__NFQA_CFG_MAX - 1)
112#define NFQA_CFG_F_FAIL_OPEN (1 << 0)
113#define NFQA_CFG_F_CONNTRACK (1 << 1)
114#define NFQA_CFG_F_GSO (1 << 2)
115#define NFQA_CFG_F_UID_GID (1 << 3)
116#define NFQA_CFG_F_SECCTX (1 << 4)
117#define NFQA_CFG_F_MAX (1 << 5)
118#define NFQA_SKB_CSUMNOTREADY (1 << 0)
119#define NFQA_SKB_GSO (1 << 1)
120#define NFQA_SKB_CSUM_NOTVERIFIED (1 << 2)
121#endif