-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
netfilter: synproxy: extract SYNPROXY infrastructure from {ipt, ip6t}…
…_SYNPROXY Add common functions into nf_synproxy_core.c to prepare for nftables support. The prototypes of the functions used by {ipt, ip6t}_SYNPROXY are in the new file nf_synproxy.h Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
- Loading branch information
Fernando Fernandez Mancera
authored and
Pablo Neira Ayuso
committed
Jun 17, 2019
1 parent
3006a52
commit d7f9b2f
Showing
5 changed files
with
920 additions
and
847 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef _NF_SYNPROXY_SHARED_H | ||
#define _NF_SYNPROXY_SHARED_H | ||
|
||
#include <linux/module.h> | ||
#include <linux/skbuff.h> | ||
#include <net/ip6_checksum.h> | ||
#include <net/ip6_route.h> | ||
#include <net/tcp.h> | ||
|
||
#include <net/netfilter/nf_conntrack_seqadj.h> | ||
#include <net/netfilter/nf_conntrack_synproxy.h> | ||
|
||
void synproxy_send_client_synack(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); | ||
|
||
unsigned int ipv4_synproxy_hook(void *priv, struct sk_buff *skb, | ||
const struct nf_hook_state *nhs); | ||
int nf_synproxy_ipv4_init(struct synproxy_net *snet, struct net *net); | ||
void nf_synproxy_ipv4_fini(struct synproxy_net *snet, struct net *net); | ||
|
||
#if IS_ENABLED(CONFIG_IPV6) | ||
void synproxy_send_client_synack_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); | ||
|
||
unsigned int ipv6_synproxy_hook(void *priv, struct sk_buff *skb, | ||
const struct nf_hook_state *nhs); | ||
int nf_synproxy_ipv6_init(struct synproxy_net *snet, struct net *net); | ||
void nf_synproxy_ipv6_fini(struct synproxy_net *snet, struct net *net); | ||
#endif /* CONFIG_IPV6 */ | ||
|
||
#endif /* _NF_SYNPROXY_SHARED_H */ |
Oops, something went wrong.