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 _UAPI_IP6_TABLES_H
20 #define _UAPI_IP6_TABLES_H
21 #include <linux/types.h>
22 #include <linux/compiler.h>
23 #include <linux/if.h>
24 #include <linux/netfilter_ipv6.h>
25 #include <linux/netfilter/x_tables.h>
26 #define IP6T_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
27 #define IP6T_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
28 #define ip6t_match xt_match
29 #define ip6t_target xt_target
30 #define ip6t_table xt_table
31 #define ip6t_get_revision xt_get_revision
32 #define ip6t_entry_match xt_entry_match
33 #define ip6t_entry_target xt_entry_target
34 #define ip6t_standard_target xt_standard_target
35 #define ip6t_error_target xt_error_target
36 #define ip6t_counters xt_counters
37 #define IP6T_CONTINUE XT_CONTINUE
38 #define IP6T_RETURN XT_RETURN
39 #include <linux/netfilter/xt_tcpudp.h>
40 #define ip6t_tcp xt_tcp
41 #define ip6t_udp xt_udp
42 #define IP6T_TCP_INV_SRCPT XT_TCP_INV_SRCPT
43 #define IP6T_TCP_INV_DSTPT XT_TCP_INV_DSTPT
44 #define IP6T_TCP_INV_FLAGS XT_TCP_INV_FLAGS
45 #define IP6T_TCP_INV_OPTION XT_TCP_INV_OPTION
46 #define IP6T_TCP_INV_MASK XT_TCP_INV_MASK
47 #define IP6T_UDP_INV_SRCPT XT_UDP_INV_SRCPT
48 #define IP6T_UDP_INV_DSTPT XT_UDP_INV_DSTPT
49 #define IP6T_UDP_INV_MASK XT_UDP_INV_MASK
50 #define ip6t_counters_info xt_counters_info
51 #define IP6T_STANDARD_TARGET XT_STANDARD_TARGET
52 #define IP6T_ERROR_TARGET XT_ERROR_TARGET
53 #define IP6T_MATCH_ITERATE(e,fn,args...) XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ##args)
54 #define IP6T_ENTRY_ITERATE(entries,size,fn,args...) XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ##args)
55 struct ip6t_ip6 {
56   struct in6_addr src, dst;
57   struct in6_addr smsk, dmsk;
58   char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
59   unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
60   __u16 proto;
61   __u8 tos;
62   __u8 flags;
63   __u8 invflags;
64 };
65 #define IP6T_F_PROTO 0x01
66 #define IP6T_F_TOS 0x02
67 #define IP6T_F_GOTO 0x04
68 #define IP6T_F_MASK 0x07
69 #define IP6T_INV_VIA_IN 0x01
70 #define IP6T_INV_VIA_OUT 0x02
71 #define IP6T_INV_TOS 0x04
72 #define IP6T_INV_SRCIP 0x08
73 #define IP6T_INV_DSTIP 0x10
74 #define IP6T_INV_FRAG 0x20
75 #define IP6T_INV_PROTO XT_INV_PROTO
76 #define IP6T_INV_MASK 0x7F
77 struct ip6t_entry {
78   struct ip6t_ip6 ipv6;
79   unsigned int nfcache;
80   __u16 target_offset;
81   __u16 next_offset;
82   unsigned int comefrom;
83   struct xt_counters counters;
84   unsigned char elems[0];
85 };
86 struct ip6t_standard {
87   struct ip6t_entry entry;
88   struct xt_standard_target target;
89 };
90 struct ip6t_error {
91   struct ip6t_entry entry;
92   struct xt_error_target target;
93 };
94 #define IP6T_ENTRY_INIT(__size) \
95 {.target_offset = sizeof(struct ip6t_entry),.next_offset = (__size), \
96 }
97 #define IP6T_STANDARD_INIT(__verdict) \
98 {.entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_standard)),.target = XT_TARGET_INIT(XT_STANDARD_TARGET, sizeof(struct xt_standard_target)),.target.verdict = - (__verdict) - 1, \
99 }
100 #define IP6T_ERROR_INIT \
101 {.entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_error)),.target = XT_TARGET_INIT(XT_ERROR_TARGET, sizeof(struct xt_error_target)),.target.errorname = "ERROR", \
102 }
103 #define IP6T_BASE_CTL 64
104 #define IP6T_SO_SET_REPLACE (IP6T_BASE_CTL)
105 #define IP6T_SO_SET_ADD_COUNTERS (IP6T_BASE_CTL + 1)
106 #define IP6T_SO_SET_MAX IP6T_SO_SET_ADD_COUNTERS
107 #define IP6T_SO_GET_INFO (IP6T_BASE_CTL)
108 #define IP6T_SO_GET_ENTRIES (IP6T_BASE_CTL + 1)
109 #define IP6T_SO_GET_REVISION_MATCH (IP6T_BASE_CTL + 4)
110 #define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5)
111 #define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET
112 #define IP6T_SO_ORIGINAL_DST 80
113 struct ip6t_icmp {
114   __u8 type;
115   __u8 code[2];
116   __u8 invflags;
117 };
118 #define IP6T_ICMP_INV 0x01
119 struct ip6t_getinfo {
120   char name[XT_TABLE_MAXNAMELEN];
121   unsigned int valid_hooks;
122   unsigned int hook_entry[NF_INET_NUMHOOKS];
123   unsigned int underflow[NF_INET_NUMHOOKS];
124   unsigned int num_entries;
125   unsigned int size;
126 };
127 struct ip6t_replace {
128   char name[XT_TABLE_MAXNAMELEN];
129   unsigned int valid_hooks;
130   unsigned int num_entries;
131   unsigned int size;
132   unsigned int hook_entry[NF_INET_NUMHOOKS];
133   unsigned int underflow[NF_INET_NUMHOOKS];
134   unsigned int num_counters;
135   struct xt_counters __user * counters;
136   struct ip6t_entry entries[0];
137 };
138 struct ip6t_get_entries {
139   char name[XT_TABLE_MAXNAMELEN];
140   unsigned int size;
141   struct ip6t_entry entrytable[0];
142 };
ip6t_get_target(struct ip6t_entry * e)143 static __inline__ struct xt_entry_target * ip6t_get_target(struct ip6t_entry * e) {
144   return(struct xt_entry_target *) ((char *) e + e->target_offset);
145 }
146 #endif
147