1
2#ifndef _UAPI_MPTCP_H
3#define _UAPI_MPTCP_H
4
5#include <linux/const.h>
6#include <linux/types.h>
7
8#define MPTCP_SUBFLOW_FLAG_MCAP_REM _BITUL(0)
9#define MPTCP_SUBFLOW_FLAG_MCAP_LOC _BITUL(1)
10#define MPTCP_SUBFLOW_FLAG_JOIN_REM _BITUL(2)
11#define MPTCP_SUBFLOW_FLAG_JOIN_LOC _BITUL(3)
12#define MPTCP_SUBFLOW_FLAG_BKUP_REM _BITUL(4)
13#define MPTCP_SUBFLOW_FLAG_BKUP_LOC _BITUL(5)
14#define MPTCP_SUBFLOW_FLAG_FULLY_ESTABLISHED _BITUL(6)
15#define MPTCP_SUBFLOW_FLAG_CONNECTED _BITUL(7)
16#define MPTCP_SUBFLOW_FLAG_MAPVALID _BITUL(8)
17
18enum {
19 MPTCP_SUBFLOW_ATTR_UNSPEC,
20 MPTCP_SUBFLOW_ATTR_TOKEN_REM,
21 MPTCP_SUBFLOW_ATTR_TOKEN_LOC,
22 MPTCP_SUBFLOW_ATTR_RELWRITE_SEQ,
23 MPTCP_SUBFLOW_ATTR_MAP_SEQ,
24 MPTCP_SUBFLOW_ATTR_MAP_SFSEQ,
25 MPTCP_SUBFLOW_ATTR_SSN_OFFSET,
26 MPTCP_SUBFLOW_ATTR_MAP_DATALEN,
27 MPTCP_SUBFLOW_ATTR_FLAGS,
28 MPTCP_SUBFLOW_ATTR_ID_REM,
29 MPTCP_SUBFLOW_ATTR_ID_LOC,
30 MPTCP_SUBFLOW_ATTR_PAD,
31 __MPTCP_SUBFLOW_ATTR_MAX
32};
33
34#define MPTCP_SUBFLOW_ATTR_MAX (__MPTCP_SUBFLOW_ATTR_MAX - 1)
35
36
37#define MPTCP_PM_NAME "mptcp_pm"
38#define MPTCP_PM_CMD_GRP_NAME "mptcp_pm_cmds"
39#define MPTCP_PM_EV_GRP_NAME "mptcp_pm_events"
40#define MPTCP_PM_VER 0x1
41
42
43
44
45enum {
46 MPTCP_PM_ATTR_UNSPEC,
47
48 MPTCP_PM_ATTR_ADDR,
49 MPTCP_PM_ATTR_RCV_ADD_ADDRS,
50 MPTCP_PM_ATTR_SUBFLOWS,
51
52 __MPTCP_PM_ATTR_MAX
53};
54
55#define MPTCP_PM_ATTR_MAX (__MPTCP_PM_ATTR_MAX - 1)
56
57enum {
58 MPTCP_PM_ADDR_ATTR_UNSPEC,
59
60 MPTCP_PM_ADDR_ATTR_FAMILY,
61 MPTCP_PM_ADDR_ATTR_ID,
62 MPTCP_PM_ADDR_ATTR_ADDR4,
63 MPTCP_PM_ADDR_ATTR_ADDR6,
64 MPTCP_PM_ADDR_ATTR_PORT,
65 MPTCP_PM_ADDR_ATTR_FLAGS,
66 MPTCP_PM_ADDR_ATTR_IF_IDX,
67
68 __MPTCP_PM_ADDR_ATTR_MAX
69};
70
71#define MPTCP_PM_ADDR_ATTR_MAX (__MPTCP_PM_ADDR_ATTR_MAX - 1)
72
73#define MPTCP_PM_ADDR_FLAG_SIGNAL (1 << 0)
74#define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1)
75#define MPTCP_PM_ADDR_FLAG_BACKUP (1 << 2)
76
77enum {
78 MPTCP_PM_CMD_UNSPEC,
79
80 MPTCP_PM_CMD_ADD_ADDR,
81 MPTCP_PM_CMD_DEL_ADDR,
82 MPTCP_PM_CMD_GET_ADDR,
83 MPTCP_PM_CMD_FLUSH_ADDRS,
84 MPTCP_PM_CMD_SET_LIMITS,
85 MPTCP_PM_CMD_GET_LIMITS,
86 MPTCP_PM_CMD_SET_FLAGS,
87
88 __MPTCP_PM_CMD_AFTER_LAST
89};
90
91#define MPTCP_INFO_FLAG_FALLBACK _BITUL(0)
92#define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED _BITUL(1)
93
94struct mptcp_info {
95 __u8 mptcpi_subflows;
96 __u8 mptcpi_add_addr_signal;
97 __u8 mptcpi_add_addr_accepted;
98 __u8 mptcpi_subflows_max;
99 __u8 mptcpi_add_addr_signal_max;
100 __u8 mptcpi_add_addr_accepted_max;
101 __u32 mptcpi_flags;
102 __u32 mptcpi_token;
103 __u64 mptcpi_write_seq;
104 __u64 mptcpi_snd_una;
105 __u64 mptcpi_rcv_nxt;
106 __u8 mptcpi_local_addr_used;
107 __u8 mptcpi_local_addr_max;
108};
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144enum mptcp_event_type {
145 MPTCP_EVENT_UNSPEC = 0,
146 MPTCP_EVENT_CREATED = 1,
147 MPTCP_EVENT_ESTABLISHED = 2,
148 MPTCP_EVENT_CLOSED = 3,
149
150 MPTCP_EVENT_ANNOUNCED = 6,
151 MPTCP_EVENT_REMOVED = 7,
152
153 MPTCP_EVENT_SUB_ESTABLISHED = 10,
154 MPTCP_EVENT_SUB_CLOSED = 11,
155
156 MPTCP_EVENT_SUB_PRIORITY = 13,
157};
158
159enum mptcp_event_attr {
160 MPTCP_ATTR_UNSPEC = 0,
161
162 MPTCP_ATTR_TOKEN,
163 MPTCP_ATTR_FAMILY,
164 MPTCP_ATTR_LOC_ID,
165 MPTCP_ATTR_REM_ID,
166 MPTCP_ATTR_SADDR4,
167 MPTCP_ATTR_SADDR6,
168 MPTCP_ATTR_DADDR4,
169 MPTCP_ATTR_DADDR6,
170 MPTCP_ATTR_SPORT,
171 MPTCP_ATTR_DPORT,
172 MPTCP_ATTR_BACKUP,
173 MPTCP_ATTR_ERROR,
174 MPTCP_ATTR_FLAGS,
175 MPTCP_ATTR_TIMEOUT,
176 MPTCP_ATTR_IF_IDX,
177 MPTCP_ATTR_RESET_REASON,
178 MPTCP_ATTR_RESET_FLAGS,
179
180 __MPTCP_ATTR_AFTER_LAST
181};
182
183#define MPTCP_ATTR_MAX (__MPTCP_ATTR_AFTER_LAST - 1)
184
185
186#define MPTCP_RST_EUNSPEC 0
187#define MPTCP_RST_EMPTCP 1
188#define MPTCP_RST_ERESOURCE 2
189#define MPTCP_RST_EPROHIBIT 3
190#define MPTCP_RST_EWQ2BIG 4
191#define MPTCP_RST_EBADPERF 5
192#define MPTCP_RST_EMIDDLEBOX 6
193
194#endif
195