blob: 771574677e83136c82675559c6f160f6fd827eba [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* 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 Howells607ca462012-10-13 10:46:48 +01007#ifndef __LINUX_IP6_NETFILTER_H
8#define __LINUX_IP6_NETFILTER_H
Linus Torvalds1da177e2005-04-16 15:20:36 -07009
David Howells607ca462012-10-13 10:46:48 +010010#include <uapi/linux/netfilter_ipv6.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
Florian Westphal2a7851b2013-05-17 03:56:10 +000012/*
13 * Hook functions for ipv6 to allow xt_* modules to be built-in even
14 * if IPv6 is a module.
15 */
16struct nf_ipv6_ops {
17 int (*chk_addr)(struct net *net, const struct in6_addr *addr,
18 const struct net_device *dev, int strict);
Bernhard Thaler72b31f72015-05-30 15:27:40 +020019 void (*route_input)(struct sk_buff *skb);
Bernhard Thalerefb6de92015-05-30 15:30:16 +020020 int (*fragment)(struct sock *sk, struct sk_buff *skb,
21 int (*output)(struct sock *, struct sk_buff *));
Florian Westphal2a7851b2013-05-17 03:56:10 +000022};
23
Joe Stringer2e4cfae2015-08-27 15:25:45 -070024#ifdef CONFIG_NETFILTER
25int ip6_route_me_harder(struct sk_buff *skb);
26__sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,
27 unsigned int dataoff, u_int8_t protocol);
28
29int ipv6_netfilter_init(void);
30void ipv6_netfilter_fini(void);
31
Florian Westphal2a7851b2013-05-17 03:56:10 +000032extern const struct nf_ipv6_ops __rcu *nf_ipv6_ops;
33static inline const struct nf_ipv6_ops *nf_get_ipv6_ops(void)
34{
35 return rcu_dereference(nf_ipv6_ops);
36}
37
Patrick McHardybb94aa12006-01-09 16:43:13 -080038#else /* CONFIG_NETFILTER */
39static inline int ipv6_netfilter_init(void) { return 0; }
40static inline void ipv6_netfilter_fini(void) { return; }
Joe Stringer2e4cfae2015-08-27 15:25:45 -070041static inline const struct nf_ipv6_ops *nf_get_ipv6_ops(void) { return NULL; }
Patrick McHardybb94aa12006-01-09 16:43:13 -080042#endif /* CONFIG_NETFILTER */
Harald Welte2cc7d572005-08-09 19:42:34 -070043
Linus Torvalds1da177e2005-04-16 15:20:36 -070044#endif /*__LINUX_IP6_NETFILTER_H*/