linux/net/netfilter/ipvs/ip_vs_proto_tcp.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * ip_vs_proto_tcp.c:	TCP load balancing support for IPVS
 *
 * Authors:     Wensong Zhang <[email protected]>
 *              Julian Anastasov <[email protected]>
 *
 * Changes:     Hans Schillstrom <[email protected]>
 *
 *              Network name space (netns) aware.
 *              Global data moved to netns i.e struct netns_ipvs
 *              tcp_timeouts table has copy per netns in a hash table per
 *              protocol ip_vs_proto_data and is handled by netns
 */

#define KMSG_COMPONENT
#define pr_fmt(fmt)

#include <linux/kernel.h>
#include <linux/ip.h>
#include <linux/tcp.h>                  /* for tcphdr */
#include <net/ip.h>
#include <net/tcp.h>                    /* for csum_tcpudp_magic */
#include <net/ip6_checksum.h>
#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
#include <linux/indirect_call_wrapper.h>

#include <net/ip_vs.h>

static int
tcp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp);

static int
tcp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
		  struct ip_vs_proto_data *pd,
		  int *verdict, struct ip_vs_conn **cpp,
		  struct ip_vs_iphdr *iph)
{}


static inline void
tcp_fast_csum_update(int af, struct tcphdr *tcph,
		     const union nf_inet_addr *oldip,
		     const union nf_inet_addr *newip,
		     __be16 oldport, __be16 newport)
{}


static inline void
tcp_partial_csum_update(int af, struct tcphdr *tcph,
		     const union nf_inet_addr *oldip,
		     const union nf_inet_addr *newip,
		     __be16 oldlen, __be16 newlen)
{}


INDIRECT_CALLABLE_SCOPE int
tcp_snat_handler(struct sk_buff *skb, struct ip_vs_protocol *pp,
		 struct ip_vs_conn *cp, struct ip_vs_iphdr *iph)
{}


static int
tcp_dnat_handler(struct sk_buff *skb, struct ip_vs_protocol *pp,
		 struct ip_vs_conn *cp, struct ip_vs_iphdr *iph)
{}


static int
tcp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp)
{}


#define TCP_DIR_INPUT
#define TCP_DIR_OUTPUT
#define TCP_DIR_INPUT_ONLY

static const int tcp_state_off[IP_VS_DIR_LAST] =;

/*
 *	Timeout table[state]
 */
static const int tcp_timeouts[IP_VS_TCP_S_LAST+1] =;

static const char *const tcp_state_name_table[IP_VS_TCP_S_LAST+1] =;

static const bool tcp_state_active_table[IP_VS_TCP_S_LAST] =;

#define sNO
#define sES
#define sSS
#define sSR
#define sFW
#define sTW
#define sCL
#define sCW
#define sLA
#define sLI
#define sSA

struct tcp_states_t {};

static const char * tcp_state_name(int state)
{}

static bool tcp_state_active(int state)
{}

static struct tcp_states_t tcp_states[] =;

static struct tcp_states_t tcp_states_dos[] =;

static void tcp_timeout_change(struct ip_vs_proto_data *pd, int flags)
{}

static inline int tcp_state_idx(struct tcphdr *th)
{}

static inline void
set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
	      int direction, struct tcphdr *th)
{}

/*
 *	Handle state transitions
 */
static void
tcp_state_transition(struct ip_vs_conn *cp, int direction,
		     const struct sk_buff *skb,
		     struct ip_vs_proto_data *pd)
{}

static inline __u16 tcp_app_hashkey(__be16 port)
{}


static int tcp_register_app(struct netns_ipvs *ipvs, struct ip_vs_app *inc)
{}


static void
tcp_unregister_app(struct netns_ipvs *ipvs, struct ip_vs_app *inc)
{}


static int
tcp_app_conn_bind(struct ip_vs_conn *cp)
{}


/*
 *	Set LISTEN timeout. (ip_vs_conn_put will setup timer)
 */
void ip_vs_tcp_conn_listen(struct ip_vs_conn *cp)
{}

/* ---------------------------------------------
 *   timeouts is netns related now.
 * ---------------------------------------------
 */
static int __ip_vs_tcp_init(struct netns_ipvs *ipvs, struct ip_vs_proto_data *pd)
{}

static void __ip_vs_tcp_exit(struct netns_ipvs *ipvs, struct ip_vs_proto_data *pd)
{}


struct ip_vs_protocol ip_vs_protocol_tcp =;