1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _NF_SYNPROXY_SHARED_H
3 #define _NF_SYNPROXY_SHARED_H
5 #include <linux/module.h>
6 #include <linux/skbuff.h>
7 #include <net/ip6_checksum.h>
8 #include <net/ip6_route.h>
11 #include <net/netfilter/nf_conntrack_seqadj.h>
12 #include <net/netfilter/nf_conntrack_synproxy.h>
14 void synproxy_send_client_synack(struct net *net, const struct sk_buff *skb,
15 const struct tcphdr *th,
16 const struct synproxy_options *opts);
18 bool 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);
23 unsigned int ipv4_synproxy_hook(void *priv, struct sk_buff *skb,
24 const struct nf_hook_state *nhs);
25 int nf_synproxy_ipv4_init(struct synproxy_net *snet, struct net *net);
26 void nf_synproxy_ipv4_fini(struct synproxy_net *snet, struct net *net);
28 #if IS_ENABLED(CONFIG_IPV6)
29 void 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);
34 bool 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);
38 unsigned int ipv6_synproxy_hook(void *priv, struct sk_buff *skb,
39 const struct nf_hook_state *nhs);
40 int nf_synproxy_ipv6_init(struct synproxy_net *snet, struct net *net);
41 void nf_synproxy_ipv6_fini(struct synproxy_net *snet, struct net *net);
44 nf_synproxy_ipv6_init(struct synproxy_net *snet, struct net *net) { return 0; }
46 nf_synproxy_ipv6_fini(struct synproxy_net *snet, struct net *net) {};
47 #endif /* CONFIG_IPV6 */
49 #endif /* _NF_SYNPROXY_SHARED_H */