2006-12-03 07:07:13 +01:00
|
|
|
#ifndef _NF_NAT_HELPER_H
|
|
|
|
#define _NF_NAT_HELPER_H
|
|
|
|
/* NAT protocol helper routines. */
|
|
|
|
|
|
|
|
#include <net/netfilter/nf_conntrack.h>
|
|
|
|
|
|
|
|
struct sk_buff;
|
|
|
|
|
|
|
|
/* These return true or false. */
|
2013-09-23 20:37:48 +02:00
|
|
|
int __nf_nat_mangle_tcp_packet(struct sk_buff *skb, struct nf_conn *ct,
|
|
|
|
enum ip_conntrack_info ctinfo,
|
|
|
|
unsigned int protoff, unsigned int match_offset,
|
|
|
|
unsigned int match_len, const char *rep_buffer,
|
|
|
|
unsigned int rep_len, bool adjust);
|
2010-02-11 12:27:09 +01:00
|
|
|
|
|
|
|
static inline int nf_nat_mangle_tcp_packet(struct sk_buff *skb,
|
|
|
|
struct nf_conn *ct,
|
|
|
|
enum ip_conntrack_info ctinfo,
|
2012-08-26 19:14:04 +02:00
|
|
|
unsigned int protoff,
|
2010-02-11 12:27:09 +01:00
|
|
|
unsigned int match_offset,
|
|
|
|
unsigned int match_len,
|
|
|
|
const char *rep_buffer,
|
|
|
|
unsigned int rep_len)
|
|
|
|
{
|
2012-08-26 19:14:04 +02:00
|
|
|
return __nf_nat_mangle_tcp_packet(skb, ct, ctinfo, protoff,
|
2010-02-11 12:27:09 +01:00
|
|
|
match_offset, match_len,
|
|
|
|
rep_buffer, rep_len, true);
|
|
|
|
}
|
|
|
|
|
2013-09-23 20:37:48 +02:00
|
|
|
int nf_nat_mangle_udp_packet(struct sk_buff *skb, struct nf_conn *ct,
|
|
|
|
enum ip_conntrack_info ctinfo,
|
|
|
|
unsigned int protoff, unsigned int match_offset,
|
|
|
|
unsigned int match_len, const char *rep_buffer,
|
|
|
|
unsigned int rep_len);
|
2010-02-11 12:27:09 +01:00
|
|
|
|
2006-12-03 07:07:13 +01:00
|
|
|
/* Setup NAT on this expected conntrack so it follows master, but goes
|
|
|
|
* to port ct->master->saved_proto. */
|
2013-09-23 20:37:48 +02:00
|
|
|
void nf_nat_follow_master(struct nf_conn *ct, struct nf_conntrack_expect *this);
|
2009-11-06 09:43:42 +01:00
|
|
|
|
2006-12-03 07:07:13 +01:00
|
|
|
#endif
|