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 _XT_CONNTRACK_H 20 #define _XT_CONNTRACK_H 21 #include <linux/types.h> 22 #include <linux/netfilter.h> 23 #include <linux/netfilter/nf_conntrack_tuple_common.h> 24 #define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo) % IP_CT_IS_REPLY + 1)) 25 #define XT_CONNTRACK_STATE_INVALID (1 << 0) 26 #define XT_CONNTRACK_STATE_SNAT (1 << (IP_CT_NUMBER + 1)) 27 #define XT_CONNTRACK_STATE_DNAT (1 << (IP_CT_NUMBER + 2)) 28 #define XT_CONNTRACK_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 3)) 29 enum { 30 XT_CONNTRACK_STATE = 1 << 0, 31 XT_CONNTRACK_PROTO = 1 << 1, 32 XT_CONNTRACK_ORIGSRC = 1 << 2, 33 XT_CONNTRACK_ORIGDST = 1 << 3, 34 XT_CONNTRACK_REPLSRC = 1 << 4, 35 XT_CONNTRACK_REPLDST = 1 << 5, 36 XT_CONNTRACK_STATUS = 1 << 6, 37 XT_CONNTRACK_EXPIRES = 1 << 7, 38 XT_CONNTRACK_ORIGSRC_PORT = 1 << 8, 39 XT_CONNTRACK_ORIGDST_PORT = 1 << 9, 40 XT_CONNTRACK_REPLSRC_PORT = 1 << 10, 41 XT_CONNTRACK_REPLDST_PORT = 1 << 11, 42 XT_CONNTRACK_DIRECTION = 1 << 12, 43 XT_CONNTRACK_STATE_ALIAS = 1 << 13, 44 }; 45 struct xt_conntrack_mtinfo1 { 46 union nf_inet_addr origsrc_addr, origsrc_mask; 47 union nf_inet_addr origdst_addr, origdst_mask; 48 union nf_inet_addr replsrc_addr, replsrc_mask; 49 union nf_inet_addr repldst_addr, repldst_mask; 50 __u32 expires_min, expires_max; 51 __u16 l4proto; 52 __be16 origsrc_port, origdst_port; 53 __be16 replsrc_port, repldst_port; 54 __u16 match_flags, invert_flags; 55 __u8 state_mask, status_mask; 56 }; 57 struct xt_conntrack_mtinfo2 { 58 union nf_inet_addr origsrc_addr, origsrc_mask; 59 union nf_inet_addr origdst_addr, origdst_mask; 60 union nf_inet_addr replsrc_addr, replsrc_mask; 61 union nf_inet_addr repldst_addr, repldst_mask; 62 __u32 expires_min, expires_max; 63 __u16 l4proto; 64 __be16 origsrc_port, origdst_port; 65 __be16 replsrc_port, repldst_port; 66 __u16 match_flags, invert_flags; 67 __u16 state_mask, status_mask; 68 }; 69 struct xt_conntrack_mtinfo3 { 70 union nf_inet_addr origsrc_addr, origsrc_mask; 71 union nf_inet_addr origdst_addr, origdst_mask; 72 union nf_inet_addr replsrc_addr, replsrc_mask; 73 union nf_inet_addr repldst_addr, repldst_mask; 74 __u32 expires_min, expires_max; 75 __u16 l4proto; 76 __u16 origsrc_port, origdst_port; 77 __u16 replsrc_port, repldst_port; 78 __u16 match_flags, invert_flags; 79 __u16 state_mask, status_mask; 80 __u16 origsrc_port_high, origdst_port_high; 81 __u16 replsrc_port_high, repldst_port_high; 82 }; 83 #endif 84