blob: c0dc4dd78887a69757291f25d66d2906f3786555 [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
Pablo Neira Ayuso7db9a512017-12-20 16:12:55 +010012/* Extra routing may needed on local out, as the QUEUE target never returns
13 * control to the table.
14 */
15struct ip6_rt_info {
16 struct in6_addr daddr;
17 struct in6_addr saddr;
18 u_int32_t mark;
19};
20
Pablo Neira Ayusoce388f42017-11-27 22:50:26 +010021struct nf_queue_entry;
22
Florian Westphal2a7851b2013-05-17 03:56:10 +000023/*
24 * Hook functions for ipv6 to allow xt_* modules to be built-in even
25 * if IPv6 is a module.
26 */
27struct nf_ipv6_ops {
28 int (*chk_addr)(struct net *net, const struct in6_addr *addr,
29 const struct net_device *dev, int strict);
Bernhard Thaler72b31f72015-05-30 15:27:40 +020030 void (*route_input)(struct sk_buff *skb);
Eric W. Biederman7d8c6e32015-06-12 22:12:04 -050031 int (*fragment)(struct net *net, struct sock *sk, struct sk_buff *skb,
32 int (*output)(struct net *, struct sock *, struct sk_buff *));
Pablo Neira Ayuso3f87c082017-11-27 22:29:52 +010033 int (*route)(struct net *net, struct dst_entry **dst, struct flowi *fl,
34 bool strict);
Pablo Neira Ayusoce388f42017-11-27 22:50:26 +010035 int (*reroute)(struct sk_buff *skb, const struct nf_queue_entry *entry);
Florian Westphal2a7851b2013-05-17 03:56:10 +000036};
37
Joe Stringer2e4cfae2015-08-27 15:25:45 -070038#ifdef CONFIG_NETFILTER
Eric W. Biederman5f5d74d2015-09-25 15:07:31 -050039int ip6_route_me_harder(struct net *net, struct sk_buff *skb);
Joe Stringer2e4cfae2015-08-27 15:25:45 -070040__sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,
41 unsigned int dataoff, u_int8_t protocol);
42
43int ipv6_netfilter_init(void);
44void ipv6_netfilter_fini(void);
45
Florian Westphal2a7851b2013-05-17 03:56:10 +000046extern const struct nf_ipv6_ops __rcu *nf_ipv6_ops;
47static inline const struct nf_ipv6_ops *nf_get_ipv6_ops(void)
48{
49 return rcu_dereference(nf_ipv6_ops);
50}
51
Patrick McHardybb94aa12006-01-09 16:43:13 -080052#else /* CONFIG_NETFILTER */
53static inline int ipv6_netfilter_init(void) { return 0; }
54static inline void ipv6_netfilter_fini(void) { return; }
Joe Stringer2e4cfae2015-08-27 15:25:45 -070055static inline const struct nf_ipv6_ops *nf_get_ipv6_ops(void) { return NULL; }
Patrick McHardybb94aa12006-01-09 16:43:13 -080056#endif /* CONFIG_NETFILTER */
Harald Welte2cc7d572005-08-09 19:42:34 -070057
Linus Torvalds1da177e2005-04-16 15:20:36 -070058#endif /*__LINUX_IP6_NETFILTER_H*/