net/mlx4_core: Manage interface state for Reset flow cases
[linux-2.6-block.git] / include / net / netfilter / nf_nat_helper.h
CommitLineData
5b1158e9
JK
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
7struct sk_buff;
8
9/* These return true or false. */
4e77be46
JP
10int __nf_nat_mangle_tcp_packet(struct sk_buff *skb, struct nf_conn *ct,
11 enum ip_conntrack_info ctinfo,
12 unsigned int protoff, unsigned int match_offset,
13 unsigned int match_len, const char *rep_buffer,
14 unsigned int rep_len, bool adjust);
010c0b9f
PM
15
16static inline int nf_nat_mangle_tcp_packet(struct sk_buff *skb,
17 struct nf_conn *ct,
18 enum ip_conntrack_info ctinfo,
051966c0 19 unsigned int protoff,
010c0b9f
PM
20 unsigned int match_offset,
21 unsigned int match_len,
22 const char *rep_buffer,
23 unsigned int rep_len)
24{
051966c0 25 return __nf_nat_mangle_tcp_packet(skb, ct, ctinfo, protoff,
010c0b9f
PM
26 match_offset, match_len,
27 rep_buffer, rep_len, true);
28}
29
4e77be46
JP
30int nf_nat_mangle_udp_packet(struct sk_buff *skb, struct nf_conn *ct,
31 enum ip_conntrack_info ctinfo,
32 unsigned int protoff, unsigned int match_offset,
33 unsigned int match_len, const char *rep_buffer,
34 unsigned int rep_len);
010c0b9f 35
5b1158e9
JK
36/* Setup NAT on this expected conntrack so it follows master, but goes
37 * to port ct->master->saved_proto. */
4e77be46 38void nf_nat_follow_master(struct nf_conn *ct, struct nf_conntrack_expect *this);
f9dd09c7 39
5b1158e9 40#endif