1
2#ifndef _NF_SYNPROXY_SHARED_H
3#define _NF_SYNPROXY_SHARED_H
4
5#include <linux/module.h>
6#include <linux/skbuff.h>
7#include <net/ip6_checksum.h>
8#include <net/ip6_route.h>
9#include <net/tcp.h>
10
11#include <net/netfilter/nf_conntrack_seqadj.h>
12#include <net/netfilter/nf_conntrack_synproxy.h>
13
14void synproxy_send_client_synack(struct net *net, const struct sk_buff *skb,
15 const struct tcphdr *th,
16 const struct synproxy_options *opts);
17
18bool synproxy_recv_client_ack(struct net *net,
19 const struct sk_buff *skb,
20 const struct tcphdr *th,
21 struct synproxy_options *opts, u32 recv_seq);
22
23unsigned int ipv4_synproxy_hook(void *priv, struct sk_buff *skb,
24 const struct nf_hook_state *nhs);
25int nf_synproxy_ipv4_init(struct synproxy_net *snet, struct net *net);
26void nf_synproxy_ipv4_fini(struct synproxy_net *snet, struct net *net);
27
28#if IS_ENABLED(CONFIG_IPV6)
29void synproxy_send_client_synack_ipv6(struct net *net,
30 const struct sk_buff *skb,
31 const struct tcphdr *th,
32 const struct synproxy_options *opts);
33
34bool synproxy_recv_client_ack_ipv6(struct net *net, const struct sk_buff *skb,
35 const struct tcphdr *th,
36 struct synproxy_options *opts, u32 recv_seq);
37
38unsigned int ipv6_synproxy_hook(void *priv, struct sk_buff *skb,
39 const struct nf_hook_state *nhs);
40int nf_synproxy_ipv6_init(struct synproxy_net *snet, struct net *net);
41void nf_synproxy_ipv6_fini(struct synproxy_net *snet, struct net *net);
42#else
43static inline int
44nf_synproxy_ipv6_init(struct synproxy_net *snet, struct net *net) { return 0; }
45static inline void
46nf_synproxy_ipv6_fini(struct synproxy_net *snet, struct net *net) {};
47#endif
48
49#endif
50