Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* IPv6-specific defines for netfilter. |
| 2 | * (C)1998 Rusty Russell -- This code is GPL. |
| 3 | * (C)1999 David Jeffery |
| 4 | * this header was blatantly ripped from netfilter_ipv4.h |
| 5 | * it's amazing what adding a bunch of 6s can do =8^) |
| 6 | */ |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 7 | #ifndef __LINUX_IP6_NETFILTER_H |
| 8 | #define __LINUX_IP6_NETFILTER_H |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 10 | #include <uapi/linux/netfilter_ipv6.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | |
Pablo Neira Ayuso | 7db9a51 | 2017-12-20 16:12:55 +0100 | [diff] [blame] | 12 | /* Extra routing may needed on local out, as the QUEUE target never returns |
| 13 | * control to the table. |
| 14 | */ |
| 15 | struct ip6_rt_info { |
| 16 | struct in6_addr daddr; |
| 17 | struct in6_addr saddr; |
| 18 | u_int32_t mark; |
| 19 | }; |
| 20 | |
Pablo Neira Ayuso | ce388f4 | 2017-11-27 22:50:26 +0100 | [diff] [blame] | 21 | struct nf_queue_entry; |
| 22 | |
Florian Westphal | 2a7851b | 2013-05-17 03:56:10 +0000 | [diff] [blame] | 23 | /* |
| 24 | * Hook functions for ipv6 to allow xt_* modules to be built-in even |
| 25 | * if IPv6 is a module. |
| 26 | */ |
| 27 | struct nf_ipv6_ops { |
| 28 | int (*chk_addr)(struct net *net, const struct in6_addr *addr, |
| 29 | const struct net_device *dev, int strict); |
Bernhard Thaler | 72b31f7 | 2015-05-30 15:27:40 +0200 | [diff] [blame] | 30 | void (*route_input)(struct sk_buff *skb); |
Eric W. Biederman | 7d8c6e3 | 2015-06-12 22:12:04 -0500 | [diff] [blame] | 31 | int (*fragment)(struct net *net, struct sock *sk, struct sk_buff *skb, |
| 32 | int (*output)(struct net *, struct sock *, struct sk_buff *)); |
Pablo Neira Ayuso | 3f87c08 | 2017-11-27 22:29:52 +0100 | [diff] [blame] | 33 | int (*route)(struct net *net, struct dst_entry **dst, struct flowi *fl, |
| 34 | bool strict); |
Pablo Neira Ayuso | ce388f4 | 2017-11-27 22:50:26 +0100 | [diff] [blame] | 35 | int (*reroute)(struct sk_buff *skb, const struct nf_queue_entry *entry); |
Florian Westphal | 2a7851b | 2013-05-17 03:56:10 +0000 | [diff] [blame] | 36 | }; |
| 37 | |
Joe Stringer | 2e4cfae | 2015-08-27 15:25:45 -0700 | [diff] [blame] | 38 | #ifdef CONFIG_NETFILTER |
Eric W. Biederman | 5f5d74d | 2015-09-25 15:07:31 -0500 | [diff] [blame] | 39 | int ip6_route_me_harder(struct net *net, struct sk_buff *skb); |
Joe Stringer | 2e4cfae | 2015-08-27 15:25:45 -0700 | [diff] [blame] | 40 | __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, |
| 41 | unsigned int dataoff, u_int8_t protocol); |
| 42 | |
| 43 | int ipv6_netfilter_init(void); |
| 44 | void ipv6_netfilter_fini(void); |
| 45 | |
Florian Westphal | 2a7851b | 2013-05-17 03:56:10 +0000 | [diff] [blame] | 46 | extern const struct nf_ipv6_ops __rcu *nf_ipv6_ops; |
| 47 | static inline const struct nf_ipv6_ops *nf_get_ipv6_ops(void) |
| 48 | { |
| 49 | return rcu_dereference(nf_ipv6_ops); |
| 50 | } |
| 51 | |
Patrick McHardy | bb94aa1 | 2006-01-09 16:43:13 -0800 | [diff] [blame] | 52 | #else /* CONFIG_NETFILTER */ |
| 53 | static inline int ipv6_netfilter_init(void) { return 0; } |
| 54 | static inline void ipv6_netfilter_fini(void) { return; } |
Joe Stringer | 2e4cfae | 2015-08-27 15:25:45 -0700 | [diff] [blame] | 55 | static inline const struct nf_ipv6_ops *nf_get_ipv6_ops(void) { return NULL; } |
Patrick McHardy | bb94aa1 | 2006-01-09 16:43:13 -0800 | [diff] [blame] | 56 | #endif /* CONFIG_NETFILTER */ |
Harald Welte | 2cc7d57 | 2005-08-09 19:42:34 -0700 | [diff] [blame] | 57 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | #endif /*__LINUX_IP6_NETFILTER_H*/ |