Blame include/uapi/linux/mptcp.h

Packit Service 3880ab
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
Packit Service 3880ab
#ifndef _MPTCP_H
Packit Service 3880ab
#define _MPTCP_H
Packit Service 3880ab
Packit Service 3880ab
#include <linux/const.h>
Packit Service 3880ab
#include <linux/types.h>
Packit Service 3880ab
Packit Service 3880ab
#define MPTCP_SUBFLOW_FLAG_MCAP_REM		_BITUL(0)
Packit Service 3880ab
#define MPTCP_SUBFLOW_FLAG_MCAP_LOC		_BITUL(1)
Packit Service 3880ab
#define MPTCP_SUBFLOW_FLAG_JOIN_REM		_BITUL(2)
Packit Service 3880ab
#define MPTCP_SUBFLOW_FLAG_JOIN_LOC		_BITUL(3)
Packit Service 3880ab
#define MPTCP_SUBFLOW_FLAG_BKUP_REM		_BITUL(4)
Packit Service 3880ab
#define MPTCP_SUBFLOW_FLAG_BKUP_LOC		_BITUL(5)
Packit Service 3880ab
#define MPTCP_SUBFLOW_FLAG_FULLY_ESTABLISHED	_BITUL(6)
Packit Service 3880ab
#define MPTCP_SUBFLOW_FLAG_CONNECTED		_BITUL(7)
Packit Service 3880ab
#define MPTCP_SUBFLOW_FLAG_MAPVALID		_BITUL(8)
Packit Service 3880ab
Packit Service 3880ab
enum {
Packit Service 3880ab
	MPTCP_SUBFLOW_ATTR_UNSPEC,
Packit Service 3880ab
	MPTCP_SUBFLOW_ATTR_TOKEN_REM,
Packit Service 3880ab
	MPTCP_SUBFLOW_ATTR_TOKEN_LOC,
Packit Service 3880ab
	MPTCP_SUBFLOW_ATTR_RELWRITE_SEQ,
Packit Service 3880ab
	MPTCP_SUBFLOW_ATTR_MAP_SEQ,
Packit Service 3880ab
	MPTCP_SUBFLOW_ATTR_MAP_SFSEQ,
Packit Service 3880ab
	MPTCP_SUBFLOW_ATTR_SSN_OFFSET,
Packit Service 3880ab
	MPTCP_SUBFLOW_ATTR_MAP_DATALEN,
Packit Service 3880ab
	MPTCP_SUBFLOW_ATTR_FLAGS,
Packit Service 3880ab
	MPTCP_SUBFLOW_ATTR_ID_REM,
Packit Service 3880ab
	MPTCP_SUBFLOW_ATTR_ID_LOC,
Packit Service 3880ab
	MPTCP_SUBFLOW_ATTR_PAD,
Packit Service 3880ab
	__MPTCP_SUBFLOW_ATTR_MAX
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
#define MPTCP_SUBFLOW_ATTR_MAX (__MPTCP_SUBFLOW_ATTR_MAX - 1)
Packit Service 3880ab
Packit Service 3880ab
/* netlink interface */
Packit Service 3880ab
#define MPTCP_PM_NAME		"mptcp_pm"
Packit Service 3880ab
#define MPTCP_PM_CMD_GRP_NAME	"mptcp_pm_cmds"
Packit Bot 867fae
#define MPTCP_PM_EV_GRP_NAME	"mptcp_pm_events"
Packit Service 3880ab
#define MPTCP_PM_VER		0x1
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * ATTR types defined for MPTCP
Packit Service 3880ab
 */
Packit Service 3880ab
enum {
Packit Service 3880ab
	MPTCP_PM_ATTR_UNSPEC,
Packit Service 3880ab
Packit Service 3880ab
	MPTCP_PM_ATTR_ADDR,				/* nested address */
Packit Service 3880ab
	MPTCP_PM_ATTR_RCV_ADD_ADDRS,			/* u32 */
Packit Service 3880ab
	MPTCP_PM_ATTR_SUBFLOWS,				/* u32 */
Packit Service 3880ab
Packit Service 3880ab
	__MPTCP_PM_ATTR_MAX
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
#define MPTCP_PM_ATTR_MAX (__MPTCP_PM_ATTR_MAX - 1)
Packit Service 3880ab
Packit Service 3880ab
enum {
Packit Service 3880ab
	MPTCP_PM_ADDR_ATTR_UNSPEC,
Packit Service 3880ab
Packit Service 3880ab
	MPTCP_PM_ADDR_ATTR_FAMILY,			/* u16 */
Packit Service 3880ab
	MPTCP_PM_ADDR_ATTR_ID,				/* u8 */
Packit Service 3880ab
	MPTCP_PM_ADDR_ATTR_ADDR4,			/* struct in_addr */
Packit Service 3880ab
	MPTCP_PM_ADDR_ATTR_ADDR6,			/* struct in6_addr */
Packit Service 3880ab
	MPTCP_PM_ADDR_ATTR_PORT,			/* u16 */
Packit Service 3880ab
	MPTCP_PM_ADDR_ATTR_FLAGS,			/* u32 */
Packit Service 3880ab
	MPTCP_PM_ADDR_ATTR_IF_IDX,			/* s32 */
Packit Service 3880ab
Packit Service 3880ab
	__MPTCP_PM_ADDR_ATTR_MAX
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
#define MPTCP_PM_ADDR_ATTR_MAX (__MPTCP_PM_ADDR_ATTR_MAX - 1)
Packit Service 3880ab
Packit Service 3880ab
#define MPTCP_PM_ADDR_FLAG_SIGNAL			(1 << 0)
Packit Service 3880ab
#define MPTCP_PM_ADDR_FLAG_SUBFLOW			(1 << 1)
Packit Service 3880ab
#define MPTCP_PM_ADDR_FLAG_BACKUP			(1 << 2)
Packit Service 3880ab
Packit Service 3880ab
enum {
Packit Service 3880ab
	MPTCP_PM_CMD_UNSPEC,
Packit Service 3880ab
Packit Service 3880ab
	MPTCP_PM_CMD_ADD_ADDR,
Packit Service 3880ab
	MPTCP_PM_CMD_DEL_ADDR,
Packit Service 3880ab
	MPTCP_PM_CMD_GET_ADDR,
Packit Service 3880ab
	MPTCP_PM_CMD_FLUSH_ADDRS,
Packit Service 3880ab
	MPTCP_PM_CMD_SET_LIMITS,
Packit Service 3880ab
	MPTCP_PM_CMD_GET_LIMITS,
Packit Bot 867fae
	MPTCP_PM_CMD_SET_FLAGS,
Packit Service 3880ab
Packit Service 3880ab
	__MPTCP_PM_CMD_AFTER_LAST
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
#define MPTCP_INFO_FLAG_FALLBACK		_BITUL(0)
Packit Service 3880ab
#define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED	_BITUL(1)
Packit Service 3880ab
Packit Service 3880ab
struct mptcp_info {
Packit Service 3880ab
	__u8	mptcpi_subflows;
Packit Service 3880ab
	__u8	mptcpi_add_addr_signal;
Packit Service 3880ab
	__u8	mptcpi_add_addr_accepted;
Packit Service 3880ab
	__u8	mptcpi_subflows_max;
Packit Service 3880ab
	__u8	mptcpi_add_addr_signal_max;
Packit Service 3880ab
	__u8	mptcpi_add_addr_accepted_max;
Packit Service 3880ab
	__u32	mptcpi_flags;
Packit Service 3880ab
	__u32	mptcpi_token;
Packit Service 3880ab
	__u64	mptcpi_write_seq;
Packit Service 3880ab
	__u64	mptcpi_snd_una;
Packit Service 3880ab
	__u64	mptcpi_rcv_nxt;
Packit Bot 867fae
	__u8	mptcpi_local_addr_used;
Packit Bot 867fae
	__u8	mptcpi_local_addr_max;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Bot 867fae
/*
Packit Bot 867fae
 * MPTCP_EVENT_CREATED: token, family, saddr4 | saddr6, daddr4 | daddr6,
Packit Bot 867fae
 *                      sport, dport
Packit Bot 867fae
 * A new MPTCP connection has been created. It is the good time to allocate
Packit Bot 867fae
 * memory and send ADD_ADDR if needed. Depending on the traffic-patterns
Packit Bot 867fae
 * it can take a long time until the MPTCP_EVENT_ESTABLISHED is sent.
Packit Bot 867fae
 *
Packit Bot 867fae
 * MPTCP_EVENT_ESTABLISHED: token, family, saddr4 | saddr6, daddr4 | daddr6,
Packit Bot 867fae
 *			    sport, dport
Packit Bot 867fae
 * A MPTCP connection is established (can start new subflows).
Packit Bot 867fae
 *
Packit Bot 867fae
 * MPTCP_EVENT_CLOSED: token
Packit Bot 867fae
 * A MPTCP connection has stopped.
Packit Bot 867fae
 *
Packit Bot 867fae
 * MPTCP_EVENT_ANNOUNCED: token, rem_id, family, daddr4 | daddr6 [, dport]
Packit Bot 867fae
 * A new address has been announced by the peer.
Packit Bot 867fae
 *
Packit Bot 867fae
 * MPTCP_EVENT_REMOVED: token, rem_id
Packit Bot 867fae
 * An address has been lost by the peer.
Packit Bot 867fae
 *
Packit Bot 867fae
 * MPTCP_EVENT_SUB_ESTABLISHED: token, family, saddr4 | saddr6,
Packit Bot 867fae
 *                              daddr4 | daddr6, sport, dport, backup,
Packit Bot 867fae
 *                              if_idx [, error]
Packit Bot 867fae
 * A new subflow has been established. 'error' should not be set.
Packit Bot 867fae
 *
Packit Bot 867fae
 * MPTCP_EVENT_SUB_CLOSED: token, family, saddr4 | saddr6, daddr4 | daddr6,
Packit Bot 867fae
 *                         sport, dport, backup, if_idx [, error]
Packit Bot 867fae
 * A subflow has been closed. An error (copy of sk_err) could be set if an
Packit Bot 867fae
 * error has been detected for this subflow.
Packit Bot 867fae
 *
Packit Bot 867fae
 * MPTCP_EVENT_SUB_PRIORITY: token, family, saddr4 | saddr6, daddr4 | daddr6,
Packit Bot 867fae
 *                           sport, dport, backup, if_idx [, error]
Packit Bot 867fae
 *       The priority of a subflow has changed. 'error' should not be set.
Packit Bot 867fae
 */
Packit Bot 867fae
enum mptcp_event_type {
Packit Bot 867fae
	MPTCP_EVENT_UNSPEC = 0,
Packit Bot 867fae
	MPTCP_EVENT_CREATED = 1,
Packit Bot 867fae
	MPTCP_EVENT_ESTABLISHED = 2,
Packit Bot 867fae
	MPTCP_EVENT_CLOSED = 3,
Packit Bot 867fae
Packit Bot 867fae
	MPTCP_EVENT_ANNOUNCED = 6,
Packit Bot 867fae
	MPTCP_EVENT_REMOVED = 7,
Packit Bot 867fae
Packit Bot 867fae
	MPTCP_EVENT_SUB_ESTABLISHED = 10,
Packit Bot 867fae
	MPTCP_EVENT_SUB_CLOSED = 11,
Packit Bot 867fae
Packit Bot 867fae
	MPTCP_EVENT_SUB_PRIORITY = 13,
Packit Bot 867fae
};
Packit Bot 867fae
Packit Bot 867fae
enum mptcp_event_attr {
Packit Bot 867fae
	MPTCP_ATTR_UNSPEC = 0,
Packit Bot 867fae
Packit Bot 867fae
	MPTCP_ATTR_TOKEN,	/* u32 */
Packit Bot 867fae
	MPTCP_ATTR_FAMILY,	/* u16 */
Packit Bot 867fae
	MPTCP_ATTR_LOC_ID,	/* u8 */
Packit Bot 867fae
	MPTCP_ATTR_REM_ID,	/* u8 */
Packit Bot 867fae
	MPTCP_ATTR_SADDR4,	/* be32 */
Packit Bot 867fae
	MPTCP_ATTR_SADDR6,	/* struct in6_addr */
Packit Bot 867fae
	MPTCP_ATTR_DADDR4,	/* be32 */
Packit Bot 867fae
	MPTCP_ATTR_DADDR6,	/* struct in6_addr */
Packit Bot 867fae
	MPTCP_ATTR_SPORT,	/* be16 */
Packit Bot 867fae
	MPTCP_ATTR_DPORT,	/* be16 */
Packit Bot 867fae
	MPTCP_ATTR_BACKUP,	/* u8 */
Packit Bot 867fae
	MPTCP_ATTR_ERROR,	/* u8 */
Packit Bot 867fae
	MPTCP_ATTR_FLAGS,	/* u16 */
Packit Bot 867fae
	MPTCP_ATTR_TIMEOUT,	/* u32 */
Packit Bot 867fae
	MPTCP_ATTR_IF_IDX,	/* s32 */
Packit Bot 867fae
Packit Bot 867fae
	__MPTCP_ATTR_AFTER_LAST
Packit Bot 867fae
};
Packit Bot 867fae
Packit Bot 867fae
#define MPTCP_ATTR_MAX (__MPTCP_ATTR_AFTER_LAST - 1)
Packit Bot 867fae
Packit Service 3880ab
#endif /* _MPTCP_H */