1 /**************************************************************************** 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> 23 enum 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 }; 30 struct nfqnl_msg_packet_hdr { 31 __be32 packet_id; 32 __be16 hw_protocol; 33 __u8 hook; 34 } __attribute__((packed)); 35 struct nfqnl_msg_packet_hw { 36 __be16 hw_addrlen; 37 __u16 _pad; 38 __u8 hw_addr[8]; 39 }; 40 struct nfqnl_msg_packet_timestamp { 41 __aligned_be64 sec; 42 __aligned_be64 usec; 43 }; 44 enum 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) 51 enum 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, 73 __NFQA_MAX 74 }; 75 #define NFQA_MAX (__NFQA_MAX - 1) 76 struct nfqnl_msg_verdict_hdr { 77 __be32 verdict; 78 __be32 id; 79 }; 80 enum nfqnl_msg_config_cmds { 81 NFQNL_CFG_CMD_NONE, 82 NFQNL_CFG_CMD_BIND, 83 NFQNL_CFG_CMD_UNBIND, 84 NFQNL_CFG_CMD_PF_BIND, 85 NFQNL_CFG_CMD_PF_UNBIND, 86 }; 87 struct nfqnl_msg_config_cmd { 88 __u8 command; 89 __u8 _pad; 90 __be16 pf; 91 }; 92 enum nfqnl_config_mode { 93 NFQNL_COPY_NONE, 94 NFQNL_COPY_META, 95 NFQNL_COPY_PACKET, 96 }; 97 struct nfqnl_msg_config_params { 98 __be32 copy_range; 99 __u8 copy_mode; 100 } __attribute__((packed)); 101 enum 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 #define NFQA_CFG_F_FAIL_OPEN (1 << 0) 112 #define NFQA_CFG_F_CONNTRACK (1 << 1) 113 #define NFQA_CFG_F_GSO (1 << 2) 114 #define NFQA_CFG_F_UID_GID (1 << 3) 115 #define NFQA_CFG_F_SECCTX (1 << 4) 116 #define NFQA_CFG_F_MAX (1 << 5) 117 #define NFQA_SKB_CSUMNOTREADY (1 << 0) 118 #define NFQA_SKB_GSO (1 << 1) 119 #define NFQA_SKB_CSUM_NOTVERIFIED (1 << 2) 120 #endif 121