eda7acddf8
Add hooks to parse and format the MP_CAPABLE option. This option is handled according to MPTCP version 0 (RFC6824). MPTCP version 1 MP_CAPABLE (RFC6824bis/RFC8684) will be added later in coordination with related code changes. Co-developed-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> Co-developed-by: Florian Westphal <fw@strlen.de> Signed-off-by: Florian Westphal <fw@strlen.de> Co-developed-by: Davide Caratti <dcaratti@redhat.com> Signed-off-by: Davide Caratti <dcaratti@redhat.com> Signed-off-by: Peter Krystad <peter.krystad@linux.intel.com> Signed-off-by: Christoph Paasch <cpaasch@apple.com> Signed-off-by: David S. Miller <davem@davemloft.net>
52 lines
1.2 KiB
C
52 lines
1.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/* Multipath TCP
|
|
*
|
|
* Copyright (c) 2017 - 2019, Intel Corporation.
|
|
*/
|
|
|
|
#ifndef __MPTCP_PROTOCOL_H
|
|
#define __MPTCP_PROTOCOL_H
|
|
|
|
#define MPTCP_SUPPORTED_VERSION 0
|
|
|
|
/* MPTCP option bits */
|
|
#define OPTION_MPTCP_MPC_SYN BIT(0)
|
|
#define OPTION_MPTCP_MPC_SYNACK BIT(1)
|
|
#define OPTION_MPTCP_MPC_ACK BIT(2)
|
|
|
|
/* MPTCP option subtypes */
|
|
#define MPTCPOPT_MP_CAPABLE 0
|
|
#define MPTCPOPT_MP_JOIN 1
|
|
#define MPTCPOPT_DSS 2
|
|
#define MPTCPOPT_ADD_ADDR 3
|
|
#define MPTCPOPT_RM_ADDR 4
|
|
#define MPTCPOPT_MP_PRIO 5
|
|
#define MPTCPOPT_MP_FAIL 6
|
|
#define MPTCPOPT_MP_FASTCLOSE 7
|
|
|
|
/* MPTCP suboption lengths */
|
|
#define TCPOLEN_MPTCP_MPC_SYN 12
|
|
#define TCPOLEN_MPTCP_MPC_SYNACK 12
|
|
#define TCPOLEN_MPTCP_MPC_ACK 20
|
|
|
|
/* MPTCP MP_CAPABLE flags */
|
|
#define MPTCP_VERSION_MASK (0x0F)
|
|
#define MPTCP_CAP_CHECKSUM_REQD BIT(7)
|
|
#define MPTCP_CAP_EXTENSIBILITY BIT(6)
|
|
#define MPTCP_CAP_HMAC_SHA1 BIT(0)
|
|
#define MPTCP_CAP_FLAG_MASK (0x3F)
|
|
|
|
/* MPTCP connection sock */
|
|
struct mptcp_sock {
|
|
/* inet_connection_sock must be the first member */
|
|
struct inet_connection_sock sk;
|
|
struct socket *subflow; /* outgoing connect/listener/!mp_capable */
|
|
};
|
|
|
|
static inline struct mptcp_sock *mptcp_sk(const struct sock *sk)
|
|
{
|
|
return (struct mptcp_sock *)sk;
|
|
}
|
|
|
|
#endif /* __MPTCP_PROTOCOL_H */
|