#include <linux/module.h>
#include <linux/skbuff.h>
#include <asm/unaligned.h>
#include <net/tcp.h>
#include <net/netns/generic.h>
#include <linux/proc_fs.h>
#include <linux/netfilter_ipv6.h>
#include <linux/netfilter/nf_synproxy.h>
#include <net/netfilter/nf_conntrack.h>
#include <net/netfilter/nf_conntrack_ecache.h>
#include <net/netfilter/nf_conntrack_extend.h>
#include <net/netfilter/nf_conntrack_seqadj.h>
#include <net/netfilter/nf_conntrack_synproxy.h>
#include <net/netfilter/nf_conntrack_zones.h>
#include <net/netfilter/nf_synproxy.h>
unsigned int synproxy_net_id;
EXPORT_SYMBOL_GPL(…);
bool
synproxy_parse_options(const struct sk_buff *skb, unsigned int doff,
const struct tcphdr *th, struct synproxy_options *opts)
{ … }
EXPORT_SYMBOL_GPL(…);
static unsigned int
synproxy_options_size(const struct synproxy_options *opts)
{ … }
static void
synproxy_build_options(struct tcphdr *th, const struct synproxy_options *opts)
{ … }
void synproxy_init_timestamp_cookie(const struct nf_synproxy_info *info,
struct synproxy_options *opts)
{ … }
EXPORT_SYMBOL_GPL(…);
static void
synproxy_check_timestamp_cookie(struct synproxy_options *opts)
{ … }
static unsigned int
synproxy_tstamp_adjust(struct sk_buff *skb, unsigned int protoff,
struct tcphdr *th, struct nf_conn *ct,
enum ip_conntrack_info ctinfo,
const struct nf_conn_synproxy *synproxy)
{ … }
#ifdef CONFIG_PROC_FS
static void *synproxy_cpu_seq_start(struct seq_file *seq, loff_t *pos)
{ … }
static void *synproxy_cpu_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{ … }
static void synproxy_cpu_seq_stop(struct seq_file *seq, void *v)
{ … }
static int synproxy_cpu_seq_show(struct seq_file *seq, void *v)
{ … }
static const struct seq_operations synproxy_cpu_seq_ops = …;
static int __net_init synproxy_proc_init(struct net *net)
{ … }
static void __net_exit synproxy_proc_exit(struct net *net)
{ … }
#else
static int __net_init synproxy_proc_init(struct net *net)
{
return 0;
}
static void __net_exit synproxy_proc_exit(struct net *net)
{
return;
}
#endif
static int __net_init synproxy_net_init(struct net *net)
{ … }
static void __net_exit synproxy_net_exit(struct net *net)
{ … }
static struct pernet_operations synproxy_net_ops = …;
static int __init synproxy_core_init(void)
{ … }
static void __exit synproxy_core_exit(void)
{ … }
module_init(…) …;
module_exit(synproxy_core_exit);
static struct iphdr *
synproxy_build_ip(struct net *net, struct sk_buff *skb, __be32 saddr,
__be32 daddr)
{ … }
static void
synproxy_send_tcp(struct net *net,
const struct sk_buff *skb, struct sk_buff *nskb,
struct nf_conntrack *nfct, enum ip_conntrack_info ctinfo,
struct iphdr *niph, struct tcphdr *nth,
unsigned int tcp_hdr_size)
{ … }
void
synproxy_send_client_synack(struct net *net,
const struct sk_buff *skb, const struct tcphdr *th,
const struct synproxy_options *opts)
{ … }
EXPORT_SYMBOL_GPL(…);
static void
synproxy_send_server_syn(struct net *net,
const struct sk_buff *skb, const struct tcphdr *th,
const struct synproxy_options *opts, u32 recv_seq)
{ … }
static void
synproxy_send_server_ack(struct net *net,
const struct ip_ct_tcp *state,
const struct sk_buff *skb, const struct tcphdr *th,
const struct synproxy_options *opts)
{ … }
static void
synproxy_send_client_ack(struct net *net,
const struct sk_buff *skb, const struct tcphdr *th,
const struct synproxy_options *opts)
{ … }
bool
synproxy_recv_client_ack(struct net *net,
const struct sk_buff *skb, const struct tcphdr *th,
struct synproxy_options *opts, u32 recv_seq)
{ … }
EXPORT_SYMBOL_GPL(…);
unsigned int
ipv4_synproxy_hook(void *priv, struct sk_buff *skb,
const struct nf_hook_state *nhs)
{ … }
EXPORT_SYMBOL_GPL(…);
static const struct nf_hook_ops ipv4_synproxy_ops[] = …;
int nf_synproxy_ipv4_init(struct synproxy_net *snet, struct net *net)
{ … }
EXPORT_SYMBOL_GPL(…);
void nf_synproxy_ipv4_fini(struct synproxy_net *snet, struct net *net)
{ … }
EXPORT_SYMBOL_GPL(…);
#if IS_ENABLED(CONFIG_IPV6)
static struct ipv6hdr *
synproxy_build_ip_ipv6(struct net *net, struct sk_buff *skb,
const struct in6_addr *saddr,
const struct in6_addr *daddr)
{ … }
static void
synproxy_send_tcp_ipv6(struct net *net,
const struct sk_buff *skb, struct sk_buff *nskb,
struct nf_conntrack *nfct, enum ip_conntrack_info ctinfo,
struct ipv6hdr *niph, struct tcphdr *nth,
unsigned int tcp_hdr_size)
{ … }
void
synproxy_send_client_synack_ipv6(struct net *net,
const struct sk_buff *skb,
const struct tcphdr *th,
const struct synproxy_options *opts)
{ … }
EXPORT_SYMBOL_GPL(…);
static void
synproxy_send_server_syn_ipv6(struct net *net, const struct sk_buff *skb,
const struct tcphdr *th,
const struct synproxy_options *opts, u32 recv_seq)
{ … }
static void
synproxy_send_server_ack_ipv6(struct net *net, const struct ip_ct_tcp *state,
const struct sk_buff *skb,
const struct tcphdr *th,
const struct synproxy_options *opts)
{ … }
static void
synproxy_send_client_ack_ipv6(struct net *net, const struct sk_buff *skb,
const struct tcphdr *th,
const struct synproxy_options *opts)
{ … }
bool
synproxy_recv_client_ack_ipv6(struct net *net,
const struct sk_buff *skb,
const struct tcphdr *th,
struct synproxy_options *opts, u32 recv_seq)
{ … }
EXPORT_SYMBOL_GPL(…);
unsigned int
ipv6_synproxy_hook(void *priv, struct sk_buff *skb,
const struct nf_hook_state *nhs)
{ … }
EXPORT_SYMBOL_GPL(…);
static const struct nf_hook_ops ipv6_synproxy_ops[] = …;
int
nf_synproxy_ipv6_init(struct synproxy_net *snet, struct net *net)
{ … }
EXPORT_SYMBOL_GPL(…);
void
nf_synproxy_ipv6_fini(struct synproxy_net *snet, struct net *net)
{ … }
EXPORT_SYMBOL_GPL(…);
#endif
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;