aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/vnet_mptcp.txt
blob: d824d7ebff07cb819a9918251c99de2f542344dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# Copyright 2018 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

# TCP Extensions for Multipath Operation with Multiple Addresses
# https://tools.ietf.org/html/rfc6824
# This is not upstream yes, constants for this descriptions were generated on the following tree:
# https://github.com/multipath-tcp/mptcp_net-next.git
# Once this is upstream we need to move this to vnet.txt

# Was generated on https://github.com/multipath-tcp/mptcp_net-next
meta noextract

include <net/tcp.h>
include <net/mptcp.h>
include <net/mptcp_v4.h>
include <net/mptcp_v6.h>
include <uapi/linux/tcp.h>

tcp_mptcp_option [
	generic		mptcp_generic_option
	syn		mptcp_syn_option
	synack		mptcp_synack_option
	ack		mptcp_ack_option
	capable		mptcp_capable_option
	add_addr	mptcp_add_addr_option
	mp_join		mptcp_mp_join_option
	mp_fclose	mptcp_mp_fclose_option
	remove_addr	mptcp_remove_addr_option
] [varlen]

mptcp_sub_types = OPTION_TYPE_SYN, OPTION_TYPE_SYNACK, OPTION_TYPE_ACK, OPTION_MP_CAPABLE, OPTION_ADD_ADDR, OPTION_MP_JOIN, OPTION_MP_FCLOSE

# TODO: OPTION_REMOVE_ADDR was listed in mptcp_sub_types, but it does not fit into int8 below...
_ = OPTION_REMOVE_ADDR

mptcp_generic_option {
	type	flags[mptcp_sub_types, int8]
	length	len[parent, int8]
	data	array[int8, 0:16]
} [packed]

mptcp_capable_option {
	type		const[TCPOPT_MPTCP, int8]
	length		len[parent, int8]
	version		int8:4
	subtype		const[OPTION_MP_CAPABLE, int8:4]
	flags		int8
	sender		int64be
	receiver	array[int64be, 0:1]
} [packed]

mptcp_add_addr_option {
	type	const[TCPOPT_MPTCP, int8]
	length	len[parent, int8]
# TODO: this was OPTION_ADD_ADDR, but it does not fit into 4 bits.
	subtype	const[0, int8:4]
	version	len[parent, int8:4]
	addr_id	int8
	address	ipv4_addr
	port	int16be
	mac	array[int8, 0:8]
} [packed]

_ = OPTION_ADD_ADDR

mptcp_mp_join_option {
	type	const[TCPOPT_MPTCP, int8]
	length	len[parent, int8]
	flags	int8:4
# TODO: this was OPTION_MP_JOIN, but it does not fit into 4 bits.
	subtype	const[0, int8:4]
} [packed]

_ = OPTION_MP_JOIN

mptcp_syn_option {
	type	const[TCPOPT_MPTCP, int8]
	length	len[parent, int8]
	flags	int8:4
	subtype	const[OPTION_TYPE_SYN, int8:4]
	addr_id	int8
	token	int32
	nonce	int32
} [packed]

mptcp_synack_option {
	type	const[TCPOPT_MPTCP, int8]
	length	len[parent, int8]
	flags	int8:4
	subtype	const[OPTION_TYPE_SYNACK, int8:4]
	addr_id	int8
	mac	int64
	nonce	int32
} [packed]

mptcp_ack_option {
	type		const[TCPOPT_MPTCP, int8]
	length		len[parent, int8]
	reserved	int16:12
	subtype		const[OPTION_TYPE_ACK, int16:4]
	mac		array[int8, 0:20]
} [packed]

mptcp_mp_fclose_option {
	type		const[TCPOPT_MPTCP, int8]
	length		len[parent, int8]
	reserved	int16:12
# TODO: this was OPTION_MP_FCLOSE, but it does not fit into 4 bits.
	subtype		const[0, int16:4]
	key		int64
} [packed]

_ = OPTION_MP_FCLOSE

mptcp_remove_addr_option {
	type		const[TCPOPT_MPTCP, int8]
	length		len[parent, int8]
	reserved	int8:4
# TODO: this was OPTION_REMOVE_ADDR, but it does not fit into 4 bits.
	subtype		const[0, int8:4]
	addrs_id	array[int8]
} [packed]

_ = OPTION_REMOVE_ADDR