Jozsef Kadlecsik | 5b1158e | 2006-12-02 22:07:13 -0800 | [diff] [blame] | 1 | #ifndef _NF_NAT_CORE_H |
| 2 | #define _NF_NAT_CORE_H |
| 3 | #include <linux/list.h> |
| 4 | #include <net/netfilter/nf_conntrack.h> |
Yasuyuki Kozakai | 4ba8877 | 2007-07-07 22:22:33 -0700 | [diff] [blame] | 5 | #include <net/netfilter/nf_nat.h> |
Jozsef Kadlecsik | 5b1158e | 2006-12-02 22:07:13 -0800 | [diff] [blame] | 6 | |
| 7 | /* This header used to share core functionality between the standalone |
| 8 | NAT module, and the compatibility layer's use of NAT for masquerading. */ |
| 9 | |
Joe Perches | 4e77be4 | 2013-09-23 11:37:48 -0700 | [diff] [blame] | 10 | unsigned int nf_nat_packet(struct nf_conn *ct, enum ip_conntrack_info ctinfo, |
| 11 | unsigned int hooknum, struct sk_buff *skb); |
Jozsef Kadlecsik | 5b1158e | 2006-12-02 22:07:13 -0800 | [diff] [blame] | 12 | |
Eric W. Biederman | c7af648 | 2015-09-18 14:33:07 -0500 | [diff] [blame] | 13 | int nf_xfrm_me_harder(struct net *net, struct sk_buff *skb, unsigned int family); |
Jozsef Kadlecsik | 5b1158e | 2006-12-02 22:07:13 -0800 | [diff] [blame] | 14 | |
| 15 | static inline int nf_nat_initialized(struct nf_conn *ct, |
| 16 | enum nf_nat_manip_type manip) |
| 17 | { |
Patrick McHardy | cbc9f2f | 2011-12-23 13:59:49 +0100 | [diff] [blame] | 18 | if (manip == NF_NAT_MANIP_SRC) |
Changli Gao | a7c2f4d | 2011-01-18 15:02:48 +0100 | [diff] [blame] | 19 | return ct->status & IPS_SRC_NAT_DONE; |
Jozsef Kadlecsik | 5b1158e | 2006-12-02 22:07:13 -0800 | [diff] [blame] | 20 | else |
Changli Gao | a7c2f4d | 2011-01-18 15:02:48 +0100 | [diff] [blame] | 21 | return ct->status & IPS_DST_NAT_DONE; |
Jozsef Kadlecsik | 5b1158e | 2006-12-02 22:07:13 -0800 | [diff] [blame] | 22 | } |
Pablo Neira Ayuso | e6a7d3c | 2008-10-14 11:58:31 -0700 | [diff] [blame] | 23 | |
| 24 | struct nlattr; |
| 25 | |
| 26 | extern int |
| 27 | (*nfnetlink_parse_nat_setup_hook)(struct nf_conn *ct, |
| 28 | enum nf_nat_manip_type manip, |
Patrick McHardy | 3993832 | 2009-08-25 16:07:58 +0200 | [diff] [blame] | 29 | const struct nlattr *attr); |
Pablo Neira Ayuso | e6a7d3c | 2008-10-14 11:58:31 -0700 | [diff] [blame] | 30 | |
Jozsef Kadlecsik | 5b1158e | 2006-12-02 22:07:13 -0800 | [diff] [blame] | 31 | #endif /* _NF_NAT_CORE_H */ |