ipv4: Allow amount of dirty memory from fib resizing to be controllable
[linux-2.6-block.git] / include / net / netfilter / nf_nat_helper.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
5b1158e9
JK
2#ifndef _NF_NAT_HELPER_H
3#define _NF_NAT_HELPER_H
4/* NAT protocol helper routines. */
5
6#include <net/netfilter/nf_conntrack.h>
7
8struct sk_buff;
9
10/* These return true or false. */
cba81cc4
GF
11bool __nf_nat_mangle_tcp_packet(struct sk_buff *skb, struct nf_conn *ct,
12 enum ip_conntrack_info ctinfo,
13 unsigned int protoff, unsigned int match_offset,
14 unsigned int match_len, const char *rep_buffer,
15 unsigned int rep_len, bool adjust);
010c0b9f 16
cba81cc4
GF
17static inline bool nf_nat_mangle_tcp_packet(struct sk_buff *skb,
18 struct nf_conn *ct,
19 enum ip_conntrack_info ctinfo,
20 unsigned int protoff,
21 unsigned int match_offset,
22 unsigned int match_len,
23 const char *rep_buffer,
24 unsigned int rep_len)
010c0b9f 25{
051966c0 26 return __nf_nat_mangle_tcp_packet(skb, ct, ctinfo, protoff,
010c0b9f
PM
27 match_offset, match_len,
28 rep_buffer, rep_len, true);
29}
30
cba81cc4
GF
31bool nf_nat_mangle_udp_packet(struct sk_buff *skb, struct nf_conn *ct,
32 enum ip_conntrack_info ctinfo,
33 unsigned int protoff, unsigned int match_offset,
34 unsigned int match_len, const char *rep_buffer,
35 unsigned int rep_len);
010c0b9f 36
5b1158e9
JK
37/* Setup NAT on this expected conntrack so it follows master, but goes
38 * to port ct->master->saved_proto. */
4e77be46 39void nf_nat_follow_master(struct nf_conn *ct, struct nf_conntrack_expect *this);
f9dd09c7 40
5b1158e9 41#endif