linux/net/mptcp/ctrl.c

// SPDX-License-Identifier: GPL-2.0
/* Multipath TCP
 *
 * Copyright (c) 2019, Tessares SA.
 */

#ifdef CONFIG_SYSCTL
#include <linux/sysctl.h>
#endif

#include <net/net_namespace.h>
#include <net/netns/generic.h>

#include "protocol.h"
#include "mib.h"

#define MPTCP_SYSCTL_PATH

static int mptcp_pernet_id;

#ifdef CONFIG_SYSCTL
static int mptcp_pm_type_max =;
#endif

struct mptcp_pernet {};

static struct mptcp_pernet *mptcp_get_pernet(const struct net *net)
{}

int mptcp_is_enabled(const struct net *net)
{}

unsigned int mptcp_get_add_addr_timeout(const struct net *net)
{}

int mptcp_is_checksum_enabled(const struct net *net)
{}

int mptcp_allow_join_id0(const struct net *net)
{}

unsigned int mptcp_stale_loss_cnt(const struct net *net)
{}

unsigned int mptcp_close_timeout(const struct sock *sk)
{}

int mptcp_get_pm_type(const struct net *net)
{}

const char *mptcp_get_scheduler(const struct net *net)
{}

static void mptcp_pernet_set_defaults(struct mptcp_pernet *pernet)
{}

#ifdef CONFIG_SYSCTL
static int mptcp_set_scheduler(const struct net *net, const char *name)
{}

static int proc_scheduler(const struct ctl_table *ctl, int write,
			  void *buffer, size_t *lenp, loff_t *ppos)
{}

static int proc_available_schedulers(const struct ctl_table *ctl,
				     int write, void *buffer,
				     size_t *lenp, loff_t *ppos)
{}

static int proc_blackhole_detect_timeout(const struct ctl_table *table,
					 int write, void *buffer, size_t *lenp,
					 loff_t *ppos)
{}

static struct ctl_table mptcp_sysctl_table[] =;

static int mptcp_pernet_new_table(struct net *net, struct mptcp_pernet *pernet)
{}

static void mptcp_pernet_del_table(struct mptcp_pernet *pernet)
{}

#else

static int mptcp_pernet_new_table(struct net *net, struct mptcp_pernet *pernet)
{
	return 0;
}

static void mptcp_pernet_del_table(struct mptcp_pernet *pernet) {}

#endif /* CONFIG_SYSCTL */

/* The following code block is to deal with middle box issues with MPTCP,
 * similar to what is done with TFO.
 * The proposed solution is to disable active MPTCP globally when SYN+MPC are
 * dropped, while SYN without MPC aren't. In this case, active side MPTCP is
 * disabled globally for 1hr at first. Then if it happens again, it is disabled
 * for 2h, then 4h, 8h, ...
 * The timeout is reset back to 1hr when a successful active MPTCP connection is
 * fully established.
 */

/* Disable active MPTCP and record current jiffies and active_disable_times */
void mptcp_active_disable(struct sock *sk)
{}

/* Calculate timeout for MPTCP active disable
 * Return true if we are still in the active MPTCP disable period
 * Return false if timeout already expired and we should use active MPTCP
 */
bool mptcp_active_should_disable(struct sock *ssk)
{}

/* Enable active MPTCP and reset active_disable_times if needed */
void mptcp_active_enable(struct sock *sk)
{}

/* Check the number of retransmissions, and fallback to TCP if needed */
void mptcp_active_detect_blackhole(struct sock *ssk, bool expired)
{}

static int __net_init mptcp_net_init(struct net *net)
{}

/* Note: the callback will only be called per extra netns */
static void __net_exit mptcp_net_exit(struct net *net)
{}

static struct pernet_operations mptcp_pernet_ops =;

void __init mptcp_init(void)
{}

#if IS_ENABLED(CONFIG_MPTCP_IPV6)
int __init mptcpv6_init(void)
{}
#endif