2 * 25-Jul-1998 Major changes to allow for ip chain table
4 * 3-Jan-2000 Named tables to allow packet selection for different uses.
8 * Format of an IP firewall descriptor
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.
20 #include <linux/skbuff.h>
22 #include <linux/init.h>
23 #include <uapi/linux/netfilter_ipv4/ip_tables.h>
25 extern void ipt_init(void) __init
;
27 int ipt_register_table(struct net
*net
, const struct xt_table
*table
,
28 const struct ipt_replace
*repl
,
29 const struct nf_hook_ops
*ops
, struct xt_table
**res
);
30 void ipt_unregister_table(struct net
*net
, struct xt_table
*table
,
31 const struct nf_hook_ops
*ops
);
35 struct ipt_entry entry
;
36 struct xt_standard_target target
;
40 struct ipt_entry entry
;
41 struct xt_error_target target
;
44 #define IPT_ENTRY_INIT(__size) \
46 .target_offset = sizeof(struct ipt_entry), \
47 .next_offset = (__size), \
50 #define IPT_STANDARD_INIT(__verdict) \
52 .entry = IPT_ENTRY_INIT(sizeof(struct ipt_standard)), \
53 .target = XT_TARGET_INIT(XT_STANDARD_TARGET, \
54 sizeof(struct xt_standard_target)), \
55 .target.verdict = -(__verdict) - 1, \
58 #define IPT_ERROR_INIT \
60 .entry = IPT_ENTRY_INIT(sizeof(struct ipt_error)), \
61 .target = XT_TARGET_INIT(XT_ERROR_TARGET, \
62 sizeof(struct xt_error_target)), \
63 .target.errorname = "ERROR", \
66 extern void *ipt_alloc_initial_table(const struct xt_table
*);
67 extern unsigned int ipt_do_table(struct sk_buff
*skb
,
68 const struct nf_hook_state
*state
,
69 struct xt_table
*table
);
72 #include <net/compat.h>
74 struct compat_ipt_entry
{
76 compat_uint_t nfcache
;
79 compat_uint_t comefrom
;
80 struct compat_xt_counters counters
;
81 unsigned char elems
[0];
84 /* Helper functions */
85 static inline struct xt_entry_target
*
86 compat_ipt_get_target(struct compat_ipt_entry
*e
)
88 return (void *)e
+ e
->target_offset
;
91 #endif /* CONFIG_COMPAT */
92 #endif /* _IPTABLES_H */