1 /* SPDX-License-Identifier: GPL-2.0 */
3 * 25-Jul-1998 Major changes to allow for ip chain table
5 * 3-Jan-2000 Named tables to allow packet selection for different uses.
9 * Format of an IP6 firewall descriptor
11 * src, dst, src_mask, dst_mask are always stored in network byte order.
12 * flags are stored in host byte order (of course).
13 * Port numbers are stored in HOST byte order.
19 #include <linux/in6.h>
20 #include <linux/ipv6.h>
21 #include <linux/skbuff.h>
23 #include <linux/init.h>
24 #include <uapi/linux/netfilter_ipv6/ip6_tables.h>
26 extern void ip6t_init(void) __init;
28 extern void *ip6t_alloc_initial_table(const struct xt_table *);
29 #if IS_ENABLED(CONFIG_NETFILTER)
30 int ip6t_register_table(struct net *net, const struct xt_table *table,
31 const struct ip6t_replace *repl,
32 const struct nf_hook_ops *ops, struct xt_table **res);
33 void ip6t_unregister_table(struct net *net, struct xt_table *table,
34 const struct nf_hook_ops *ops);
35 extern unsigned int ip6t_do_table(struct sk_buff *skb,
36 const struct nf_hook_state *state,
37 struct xt_table *table);
40 /* Check for an extension */
42 ip6t_ext_hdr(u8 nexthdr)
43 { return (nexthdr == IPPROTO_HOPOPTS) ||
44 (nexthdr == IPPROTO_ROUTING) ||
45 (nexthdr == IPPROTO_FRAGMENT) ||
46 (nexthdr == IPPROTO_ESP) ||
47 (nexthdr == IPPROTO_AH) ||
48 (nexthdr == IPPROTO_NONE) ||
49 (nexthdr == IPPROTO_DSTOPTS);
53 #include <net/compat.h>
55 struct compat_ip6t_entry {
57 compat_uint_t nfcache;
60 compat_uint_t comefrom;
61 struct compat_xt_counters counters;
62 unsigned char elems[0];
65 static inline struct xt_entry_target *
66 compat_ip6t_get_target(struct compat_ip6t_entry *e)
68 return (void *)e + e->target_offset;
71 #endif /* CONFIG_COMPAT */
72 #endif /* _IP6_TABLES_H */