Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * 25-Jul-1998 Major changes to allow for ip chain table |
| 3 | * |
| 4 | * 3-Jan-2000 Named tables to allow packet selection for different uses. |
| 5 | */ |
| 6 | |
| 7 | /* |
| 8 | * Format of an IP firewall descriptor |
| 9 | * |
| 10 | * src, dst, src_mask, dst_mask are always stored in network byte order. |
| 11 | * flags are stored in host byte order (of course). |
| 12 | * Port numbers are stored in HOST byte order. |
| 13 | */ |
| 14 | |
| 15 | #ifndef _IPTABLES_H |
| 16 | #define _IPTABLES_H |
| 17 | |
| 18 | #ifdef __KERNEL__ |
| 19 | #include <linux/if.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | #include <linux/in.h> |
| 21 | #include <linux/ip.h> |
| 22 | #include <linux/skbuff.h> |
| 23 | #endif |
Patrick McHardy | c8942f1 | 2008-05-21 14:08:38 -0700 | [diff] [blame] | 24 | #include <linux/types.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | #include <linux/compiler.h> |
| 26 | #include <linux/netfilter_ipv4.h> |
| 27 | |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 28 | #include <linux/netfilter/x_tables.h> |
| 29 | |
| 30 | #define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN |
Patrick McHardy | 2748e5d | 2007-01-23 22:00:13 -0800 | [diff] [blame] | 31 | #define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 32 | #define ipt_match xt_match |
| 33 | #define ipt_target xt_target |
| 34 | #define ipt_table xt_table |
| 35 | #define ipt_get_revision xt_get_revision |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | |
| 37 | /* Yes, Virginia, you have to zero the padding. */ |
| 38 | struct ipt_ip { |
| 39 | /* Source and destination IP addr */ |
| 40 | struct in_addr src, dst; |
| 41 | /* Mask for src and dest IP addr */ |
| 42 | struct in_addr smsk, dmsk; |
| 43 | char iniface[IFNAMSIZ], outiface[IFNAMSIZ]; |
| 44 | unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ]; |
| 45 | |
| 46 | /* Protocol, 0 = ANY */ |
| 47 | u_int16_t proto; |
| 48 | |
| 49 | /* Flags word */ |
| 50 | u_int8_t flags; |
| 51 | /* Inverse flags */ |
| 52 | u_int8_t invflags; |
| 53 | }; |
| 54 | |
Dmitry Mishin | 1e30a01 | 2006-03-22 13:56:56 -0800 | [diff] [blame] | 55 | #define ipt_entry_match xt_entry_match |
| 56 | #define ipt_entry_target xt_entry_target |
| 57 | #define ipt_standard_target xt_standard_target |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 59 | #define ipt_counters xt_counters |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | |
| 61 | /* Values for "flag" field in struct ipt_ip (general ip structure). */ |
| 62 | #define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */ |
Patrick McHardy | 0546534 | 2005-08-21 23:31:43 -0700 | [diff] [blame] | 63 | #define IPT_F_GOTO 0x02 /* Set if jump is a goto */ |
| 64 | #define IPT_F_MASK 0x03 /* All possible flag bits mask. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | |
| 66 | /* Values for "inv" field in struct ipt_ip. */ |
| 67 | #define IPT_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */ |
| 68 | #define IPT_INV_VIA_OUT 0x02 /* Invert the sense of OUT IFACE */ |
| 69 | #define IPT_INV_TOS 0x04 /* Invert the sense of TOS. */ |
| 70 | #define IPT_INV_SRCIP 0x08 /* Invert the sense of SRC IP. */ |
| 71 | #define IPT_INV_DSTIP 0x10 /* Invert the sense of DST OP. */ |
| 72 | #define IPT_INV_FRAG 0x20 /* Invert the sense of FRAG. */ |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 73 | #define IPT_INV_PROTO XT_INV_PROTO |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | #define IPT_INV_MASK 0x7F /* All possible flag bits mask. */ |
| 75 | |
| 76 | /* This structure defines each of the firewall rules. Consists of 3 |
| 77 | parts which are 1) general IP header stuff 2) match specific |
| 78 | stuff 3) the target to perform if the rule matches */ |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 79 | struct ipt_entry { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 80 | struct ipt_ip ip; |
| 81 | |
| 82 | /* Mark with fields that we care about. */ |
| 83 | unsigned int nfcache; |
| 84 | |
| 85 | /* Size of ipt_entry + matches */ |
| 86 | u_int16_t target_offset; |
| 87 | /* Size of ipt_entry + matches + target */ |
| 88 | u_int16_t next_offset; |
| 89 | |
| 90 | /* Back pointer */ |
| 91 | unsigned int comefrom; |
| 92 | |
| 93 | /* Packet and byte counters. */ |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 94 | struct xt_counters counters; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 95 | |
| 96 | /* The matches (if any), then the target. */ |
| 97 | unsigned char elems[0]; |
| 98 | }; |
| 99 | |
| 100 | /* |
| 101 | * New IP firewall options for [gs]etsockopt at the RAW IP level. |
| 102 | * Unlike BSD Linux inherits IP options so you don't have to use a raw |
Yasuyuki Kozakai | b96e7ec | 2006-11-14 19:48:48 -0800 | [diff] [blame] | 103 | * socket for this. Instead we check rights in the calls. |
| 104 | * |
| 105 | * ATTENTION: check linux/in.h before adding new number here. |
| 106 | */ |
| 107 | #define IPT_BASE_CTL 64 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 108 | |
Yasuyuki Kozakai | b96e7ec | 2006-11-14 19:48:48 -0800 | [diff] [blame] | 109 | #define IPT_SO_SET_REPLACE (IPT_BASE_CTL) |
| 110 | #define IPT_SO_SET_ADD_COUNTERS (IPT_BASE_CTL + 1) |
| 111 | #define IPT_SO_SET_MAX IPT_SO_SET_ADD_COUNTERS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 112 | |
Yasuyuki Kozakai | b96e7ec | 2006-11-14 19:48:48 -0800 | [diff] [blame] | 113 | #define IPT_SO_GET_INFO (IPT_BASE_CTL) |
| 114 | #define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1) |
| 115 | #define IPT_SO_GET_REVISION_MATCH (IPT_BASE_CTL + 2) |
| 116 | #define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3) |
| 117 | #define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 119 | #define IPT_CONTINUE XT_CONTINUE |
| 120 | #define IPT_RETURN XT_RETURN |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 121 | |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 122 | #include <linux/netfilter/xt_tcpudp.h> |
| 123 | #define ipt_udp xt_udp |
| 124 | #define ipt_tcp xt_tcp |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 125 | |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 126 | #define IPT_TCP_INV_SRCPT XT_TCP_INV_SRCPT |
| 127 | #define IPT_TCP_INV_DSTPT XT_TCP_INV_DSTPT |
| 128 | #define IPT_TCP_INV_FLAGS XT_TCP_INV_FLAGS |
| 129 | #define IPT_TCP_INV_OPTION XT_TCP_INV_OPTION |
| 130 | #define IPT_TCP_INV_MASK XT_TCP_INV_MASK |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 131 | |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 132 | #define IPT_UDP_INV_SRCPT XT_UDP_INV_SRCPT |
| 133 | #define IPT_UDP_INV_DSTPT XT_UDP_INV_DSTPT |
| 134 | #define IPT_UDP_INV_MASK XT_UDP_INV_MASK |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 135 | |
| 136 | /* ICMP matching stuff */ |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 137 | struct ipt_icmp { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 138 | u_int8_t type; /* type to match */ |
| 139 | u_int8_t code[2]; /* range of code */ |
| 140 | u_int8_t invflags; /* Inverse flags */ |
| 141 | }; |
| 142 | |
| 143 | /* Values for "inv" field for struct ipt_icmp. */ |
| 144 | #define IPT_ICMP_INV 0x01 /* Invert the sense of type/code test */ |
| 145 | |
| 146 | /* The argument to IPT_SO_GET_INFO */ |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 147 | struct ipt_getinfo { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 148 | /* Which table: caller fills this in. */ |
| 149 | char name[IPT_TABLE_MAXNAMELEN]; |
| 150 | |
| 151 | /* Kernel fills these in. */ |
| 152 | /* Which hook entry points are valid: bitmask */ |
| 153 | unsigned int valid_hooks; |
| 154 | |
| 155 | /* Hook entry points: one per netfilter hook. */ |
Patrick McHardy | 6e23ae2 | 2007-11-19 18:53:30 -0800 | [diff] [blame] | 156 | unsigned int hook_entry[NF_INET_NUMHOOKS]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | |
| 158 | /* Underflow points. */ |
Patrick McHardy | 6e23ae2 | 2007-11-19 18:53:30 -0800 | [diff] [blame] | 159 | unsigned int underflow[NF_INET_NUMHOOKS]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 160 | |
| 161 | /* Number of entries */ |
| 162 | unsigned int num_entries; |
| 163 | |
| 164 | /* Size of entries. */ |
| 165 | unsigned int size; |
| 166 | }; |
| 167 | |
| 168 | /* The argument to IPT_SO_SET_REPLACE. */ |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 169 | struct ipt_replace { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 170 | /* Which table. */ |
| 171 | char name[IPT_TABLE_MAXNAMELEN]; |
| 172 | |
| 173 | /* Which hook entry points are valid: bitmask. You can't |
| 174 | change this. */ |
| 175 | unsigned int valid_hooks; |
| 176 | |
| 177 | /* Number of entries */ |
| 178 | unsigned int num_entries; |
| 179 | |
| 180 | /* Total size of new entries */ |
| 181 | unsigned int size; |
| 182 | |
| 183 | /* Hook entry points. */ |
Patrick McHardy | 6e23ae2 | 2007-11-19 18:53:30 -0800 | [diff] [blame] | 184 | unsigned int hook_entry[NF_INET_NUMHOOKS]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | |
| 186 | /* Underflow points. */ |
Patrick McHardy | 6e23ae2 | 2007-11-19 18:53:30 -0800 | [diff] [blame] | 187 | unsigned int underflow[NF_INET_NUMHOOKS]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 188 | |
| 189 | /* Information about old entries: */ |
| 190 | /* Number of counters (must be equal to current number of entries). */ |
| 191 | unsigned int num_counters; |
| 192 | /* The old entries' counters. */ |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 193 | struct xt_counters __user *counters; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 194 | |
| 195 | /* The entries (hang off end: not really an array). */ |
| 196 | struct ipt_entry entries[0]; |
| 197 | }; |
| 198 | |
| 199 | /* The argument to IPT_SO_ADD_COUNTERS. */ |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 200 | #define ipt_counters_info xt_counters_info |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 201 | |
| 202 | /* The argument to IPT_SO_GET_ENTRIES. */ |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 203 | struct ipt_get_entries { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 204 | /* Which table: user fills this in. */ |
| 205 | char name[IPT_TABLE_MAXNAMELEN]; |
| 206 | |
| 207 | /* User fills this in: total entry size. */ |
| 208 | unsigned int size; |
| 209 | |
| 210 | /* The entries. */ |
| 211 | struct ipt_entry entrytable[0]; |
| 212 | }; |
| 213 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 214 | /* Standard return verdict, or do jump. */ |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 215 | #define IPT_STANDARD_TARGET XT_STANDARD_TARGET |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 216 | /* Error verdict. */ |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 217 | #define IPT_ERROR_TARGET XT_ERROR_TARGET |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 218 | |
| 219 | /* Helper functions */ |
| 220 | static __inline__ struct ipt_entry_target * |
| 221 | ipt_get_target(struct ipt_entry *e) |
| 222 | { |
| 223 | return (void *)e + e->target_offset; |
| 224 | } |
| 225 | |
| 226 | /* fn returns 0 to continue iteration */ |
Patrick McHardy | 89c002d | 2007-12-17 21:46:59 -0800 | [diff] [blame] | 227 | #define IPT_MATCH_ITERATE(e, fn, args...) \ |
| 228 | XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 229 | |
| 230 | /* fn returns 0 to continue iteration */ |
Patrick McHardy | 89c002d | 2007-12-17 21:46:59 -0800 | [diff] [blame] | 231 | #define IPT_ENTRY_ITERATE(entries, size, fn, args...) \ |
| 232 | XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 233 | |
| 234 | /* |
| 235 | * Main firewall chains definitions and global var's definitions. |
| 236 | */ |
| 237 | #ifdef __KERNEL__ |
| 238 | |
| 239 | #include <linux/init.h> |
| 240 | extern void ipt_init(void) __init; |
| 241 | |
Alexey Dobriyan | 44d34e7 | 2008-01-31 04:02:44 -0800 | [diff] [blame] | 242 | extern struct xt_table *ipt_register_table(struct net *net, |
Jan Engelhardt | 35aad0f | 2009-08-24 14:56:30 +0200 | [diff] [blame] | 243 | const struct xt_table *table, |
Alexey Dobriyan | 44d34e7 | 2008-01-31 04:02:44 -0800 | [diff] [blame] | 244 | const struct ipt_replace *repl); |
Alexey Dobriyan | f54e936 | 2010-01-18 08:25:47 +0100 | [diff] [blame] | 245 | extern void ipt_unregister_table(struct net *net, struct xt_table *table); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 246 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | /* Standard entry. */ |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 248 | struct ipt_standard { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 249 | struct ipt_entry entry; |
| 250 | struct ipt_standard_target target; |
| 251 | }; |
| 252 | |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 253 | struct ipt_error_target { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 254 | struct ipt_entry_target target; |
| 255 | char errorname[IPT_FUNCTION_MAXNAMELEN]; |
| 256 | }; |
| 257 | |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 258 | struct ipt_error { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 259 | struct ipt_entry entry; |
| 260 | struct ipt_error_target target; |
| 261 | }; |
| 262 | |
Patrick McHardy | 3c2ad46 | 2007-05-10 14:14:16 -0700 | [diff] [blame] | 263 | #define IPT_ENTRY_INIT(__size) \ |
| 264 | { \ |
| 265 | .target_offset = sizeof(struct ipt_entry), \ |
| 266 | .next_offset = (__size), \ |
| 267 | } |
| 268 | |
| 269 | #define IPT_STANDARD_INIT(__verdict) \ |
| 270 | { \ |
| 271 | .entry = IPT_ENTRY_INIT(sizeof(struct ipt_standard)), \ |
| 272 | .target = XT_TARGET_INIT(IPT_STANDARD_TARGET, \ |
| 273 | sizeof(struct xt_standard_target)), \ |
| 274 | .target.verdict = -(__verdict) - 1, \ |
| 275 | } |
| 276 | |
| 277 | #define IPT_ERROR_INIT \ |
| 278 | { \ |
| 279 | .entry = IPT_ENTRY_INIT(sizeof(struct ipt_error)), \ |
| 280 | .target = XT_TARGET_INIT(IPT_ERROR_TARGET, \ |
| 281 | sizeof(struct ipt_error_target)), \ |
| 282 | .target.errorname = "ERROR", \ |
| 283 | } |
| 284 | |
Jan Engelhardt | e3eaa99 | 2009-06-17 22:14:54 +0200 | [diff] [blame^] | 285 | extern void *ipt_alloc_initial_table(const struct xt_table *); |
Herbert Xu | 3db05fe | 2007-10-15 00:53:15 -0700 | [diff] [blame] | 286 | extern unsigned int ipt_do_table(struct sk_buff *skb, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 287 | unsigned int hook, |
| 288 | const struct net_device *in, |
| 289 | const struct net_device *out, |
Jan Engelhardt | e60a13e | 2007-02-07 15:12:33 -0800 | [diff] [blame] | 290 | struct xt_table *table); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 291 | |
Harald Welte | 2e4e6a1 | 2006-01-12 13:30:04 -0800 | [diff] [blame] | 292 | #define IPT_ALIGN(s) XT_ALIGN(s) |
Dmitry Mishin | 2722971 | 2006-04-01 02:25:19 -0800 | [diff] [blame] | 293 | |
| 294 | #ifdef CONFIG_COMPAT |
| 295 | #include <net/compat.h> |
| 296 | |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 297 | struct compat_ipt_entry { |
Dmitry Mishin | 2722971 | 2006-04-01 02:25:19 -0800 | [diff] [blame] | 298 | struct ipt_ip ip; |
| 299 | compat_uint_t nfcache; |
| 300 | u_int16_t target_offset; |
| 301 | u_int16_t next_offset; |
| 302 | compat_uint_t comefrom; |
| 303 | struct compat_xt_counters counters; |
| 304 | unsigned char elems[0]; |
| 305 | }; |
| 306 | |
Patrick McHardy | 73cd598 | 2007-12-17 21:47:32 -0800 | [diff] [blame] | 307 | /* Helper functions */ |
| 308 | static inline struct ipt_entry_target * |
| 309 | compat_ipt_get_target(struct compat_ipt_entry *e) |
| 310 | { |
| 311 | return (void *)e + e->target_offset; |
| 312 | } |
| 313 | |
Dmitry Mishin | 2722971 | 2006-04-01 02:25:19 -0800 | [diff] [blame] | 314 | #define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s) |
| 315 | |
Patrick McHardy | 73cd598 | 2007-12-17 21:47:32 -0800 | [diff] [blame] | 316 | /* fn returns 0 to continue iteration */ |
| 317 | #define COMPAT_IPT_MATCH_ITERATE(e, fn, args...) \ |
| 318 | XT_MATCH_ITERATE(struct compat_ipt_entry, e, fn, ## args) |
| 319 | |
| 320 | /* fn returns 0 to continue iteration */ |
| 321 | #define COMPAT_IPT_ENTRY_ITERATE(entries, size, fn, args...) \ |
| 322 | XT_ENTRY_ITERATE(struct compat_ipt_entry, entries, size, fn, ## args) |
| 323 | |
| 324 | /* fn returns 0 to continue iteration */ |
| 325 | #define COMPAT_IPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \ |
| 326 | XT_ENTRY_ITERATE_CONTINUE(struct compat_ipt_entry, entries, size, n, \ |
| 327 | fn, ## args) |
| 328 | |
Dmitry Mishin | 2722971 | 2006-04-01 02:25:19 -0800 | [diff] [blame] | 329 | #endif /* CONFIG_COMPAT */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 330 | #endif /*__KERNEL__*/ |
| 331 | #endif /* _IPTABLES_H */ |