]> Pileus Git - ~andy/linux/blob - include/net/netfilter/nf_nat_helper.h
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[~andy/linux] / include / net / netfilter / nf_nat_helper.h
1 #ifndef _NF_NAT_HELPER_H
2 #define _NF_NAT_HELPER_H
3 /* NAT protocol helper routines. */
4
5 #include <net/netfilter/nf_conntrack.h>
6
7 struct sk_buff;
8
9 /* These return true or false. */
10 extern int __nf_nat_mangle_tcp_packet(struct sk_buff *skb,
11                                       struct nf_conn *ct,
12                                       enum ip_conntrack_info ctinfo,
13                                       unsigned int protoff,
14                                       unsigned int match_offset,
15                                       unsigned int match_len,
16                                       const char *rep_buffer,
17                                       unsigned int rep_len, bool adjust);
18
19 static inline int nf_nat_mangle_tcp_packet(struct sk_buff *skb,
20                                            struct nf_conn *ct,
21                                            enum ip_conntrack_info ctinfo,
22                                            unsigned int protoff,
23                                            unsigned int match_offset,
24                                            unsigned int match_len,
25                                            const char *rep_buffer,
26                                            unsigned int rep_len)
27 {
28         return __nf_nat_mangle_tcp_packet(skb, ct, ctinfo, protoff,
29                                           match_offset, match_len,
30                                           rep_buffer, rep_len, true);
31 }
32
33 extern int nf_nat_mangle_udp_packet(struct sk_buff *skb,
34                                     struct nf_conn *ct,
35                                     enum ip_conntrack_info ctinfo,
36                                     unsigned int protoff,
37                                     unsigned int match_offset,
38                                     unsigned int match_len,
39                                     const char *rep_buffer,
40                                     unsigned int rep_len);
41
42 /* Setup NAT on this expected conntrack so it follows master, but goes
43  * to port ct->master->saved_proto. */
44 extern void nf_nat_follow_master(struct nf_conn *ct,
45                                  struct nf_conntrack_expect *this);
46
47 #endif