blob: d84ab50668e155fde53f01d4d9bc4818275a5b5f [file] [log] [blame]
Christopher Ferrisaf09c702020-06-01 20:29:29 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_MPTCP_H
20#define _UAPI_MPTCP_H
Christopher Ferris80ae69d2022-08-02 16:32:21 -070021#include <netinet/in.h>
22#include <sys/socket.h>
Christopher Ferrisaf09c702020-06-01 20:29:29 -070023#include <linux/const.h>
24#include <linux/types.h>
Christopher Ferrisa4792612022-01-10 13:51:15 -080025#include <linux/in.h>
26#include <linux/in6.h>
27#include <linux/socket.h>
Christopher Ferrisaf09c702020-06-01 20:29:29 -070028#define MPTCP_SUBFLOW_FLAG_MCAP_REM _BITUL(0)
29#define MPTCP_SUBFLOW_FLAG_MCAP_LOC _BITUL(1)
30#define MPTCP_SUBFLOW_FLAG_JOIN_REM _BITUL(2)
31#define MPTCP_SUBFLOW_FLAG_JOIN_LOC _BITUL(3)
32#define MPTCP_SUBFLOW_FLAG_BKUP_REM _BITUL(4)
33#define MPTCP_SUBFLOW_FLAG_BKUP_LOC _BITUL(5)
34#define MPTCP_SUBFLOW_FLAG_FULLY_ESTABLISHED _BITUL(6)
35#define MPTCP_SUBFLOW_FLAG_CONNECTED _BITUL(7)
36#define MPTCP_SUBFLOW_FLAG_MAPVALID _BITUL(8)
37enum {
38 MPTCP_SUBFLOW_ATTR_UNSPEC,
39 MPTCP_SUBFLOW_ATTR_TOKEN_REM,
40 MPTCP_SUBFLOW_ATTR_TOKEN_LOC,
41 MPTCP_SUBFLOW_ATTR_RELWRITE_SEQ,
42 MPTCP_SUBFLOW_ATTR_MAP_SEQ,
43 MPTCP_SUBFLOW_ATTR_MAP_SFSEQ,
44 MPTCP_SUBFLOW_ATTR_SSN_OFFSET,
45 MPTCP_SUBFLOW_ATTR_MAP_DATALEN,
46 MPTCP_SUBFLOW_ATTR_FLAGS,
47 MPTCP_SUBFLOW_ATTR_ID_REM,
48 MPTCP_SUBFLOW_ATTR_ID_LOC,
49 MPTCP_SUBFLOW_ATTR_PAD,
50 __MPTCP_SUBFLOW_ATTR_MAX
51};
52#define MPTCP_SUBFLOW_ATTR_MAX (__MPTCP_SUBFLOW_ATTR_MAX - 1)
53#define MPTCP_PM_NAME "mptcp_pm"
54#define MPTCP_PM_CMD_GRP_NAME "mptcp_pm_cmds"
Christopher Ferrisa9750ed2021-05-03 14:02:49 -070055#define MPTCP_PM_EV_GRP_NAME "mptcp_pm_events"
Christopher Ferrisaf09c702020-06-01 20:29:29 -070056#define MPTCP_PM_VER 0x1
57enum {
58 MPTCP_PM_ATTR_UNSPEC,
59 MPTCP_PM_ATTR_ADDR,
60 MPTCP_PM_ATTR_RCV_ADD_ADDRS,
61 MPTCP_PM_ATTR_SUBFLOWS,
Christopher Ferris80ae69d2022-08-02 16:32:21 -070062 MPTCP_PM_ATTR_TOKEN,
63 MPTCP_PM_ATTR_LOC_ID,
64 MPTCP_PM_ATTR_ADDR_REMOTE,
Christopher Ferrisaf09c702020-06-01 20:29:29 -070065 __MPTCP_PM_ATTR_MAX
66};
67#define MPTCP_PM_ATTR_MAX (__MPTCP_PM_ATTR_MAX - 1)
68enum {
69 MPTCP_PM_ADDR_ATTR_UNSPEC,
70 MPTCP_PM_ADDR_ATTR_FAMILY,
71 MPTCP_PM_ADDR_ATTR_ID,
72 MPTCP_PM_ADDR_ATTR_ADDR4,
73 MPTCP_PM_ADDR_ATTR_ADDR6,
74 MPTCP_PM_ADDR_ATTR_PORT,
75 MPTCP_PM_ADDR_ATTR_FLAGS,
76 MPTCP_PM_ADDR_ATTR_IF_IDX,
77 __MPTCP_PM_ADDR_ATTR_MAX
78};
79#define MPTCP_PM_ADDR_ATTR_MAX (__MPTCP_PM_ADDR_ATTR_MAX - 1)
80#define MPTCP_PM_ADDR_FLAG_SIGNAL (1 << 0)
81#define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1)
82#define MPTCP_PM_ADDR_FLAG_BACKUP (1 << 2)
Christopher Ferris2abfa9e2021-11-01 16:26:06 -070083#define MPTCP_PM_ADDR_FLAG_FULLMESH (1 << 3)
Christopher Ferris10a76e62022-06-08 13:31:52 -070084#define MPTCP_PM_ADDR_FLAG_IMPLICIT (1 << 4)
Christopher Ferrisaf09c702020-06-01 20:29:29 -070085enum {
86 MPTCP_PM_CMD_UNSPEC,
87 MPTCP_PM_CMD_ADD_ADDR,
88 MPTCP_PM_CMD_DEL_ADDR,
89 MPTCP_PM_CMD_GET_ADDR,
90 MPTCP_PM_CMD_FLUSH_ADDRS,
91 MPTCP_PM_CMD_SET_LIMITS,
92 MPTCP_PM_CMD_GET_LIMITS,
Christopher Ferrisa9750ed2021-05-03 14:02:49 -070093 MPTCP_PM_CMD_SET_FLAGS,
Christopher Ferris80ae69d2022-08-02 16:32:21 -070094 MPTCP_PM_CMD_ANNOUNCE,
95 MPTCP_PM_CMD_REMOVE,
96 MPTCP_PM_CMD_SUBFLOW_CREATE,
97 MPTCP_PM_CMD_SUBFLOW_DESTROY,
Christopher Ferrisaf09c702020-06-01 20:29:29 -070098 __MPTCP_PM_CMD_AFTER_LAST
99};
Christopher Ferris25c18d42020-10-14 17:42:58 -0700100#define MPTCP_INFO_FLAG_FALLBACK _BITUL(0)
101#define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED _BITUL(1)
102struct mptcp_info {
103 __u8 mptcpi_subflows;
104 __u8 mptcpi_add_addr_signal;
105 __u8 mptcpi_add_addr_accepted;
106 __u8 mptcpi_subflows_max;
107 __u8 mptcpi_add_addr_signal_max;
108 __u8 mptcpi_add_addr_accepted_max;
109 __u32 mptcpi_flags;
110 __u32 mptcpi_token;
111 __u64 mptcpi_write_seq;
112 __u64 mptcpi_snd_una;
113 __u64 mptcpi_rcv_nxt;
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700114 __u8 mptcpi_local_addr_used;
115 __u8 mptcpi_local_addr_max;
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000116 __u8 mptcpi_csum_enabled;
Christopher Ferris8666d042023-09-06 14:55:31 -0700117 __u32 mptcpi_retransmits;
118 __u64 mptcpi_bytes_retrans;
119 __u64 mptcpi_bytes_sent;
120 __u64 mptcpi_bytes_received;
121 __u64 mptcpi_bytes_acked;
Christopher Ferris25c18d42020-10-14 17:42:58 -0700122};
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700123enum mptcp_event_type {
124 MPTCP_EVENT_UNSPEC = 0,
125 MPTCP_EVENT_CREATED = 1,
126 MPTCP_EVENT_ESTABLISHED = 2,
127 MPTCP_EVENT_CLOSED = 3,
128 MPTCP_EVENT_ANNOUNCED = 6,
129 MPTCP_EVENT_REMOVED = 7,
130 MPTCP_EVENT_SUB_ESTABLISHED = 10,
131 MPTCP_EVENT_SUB_CLOSED = 11,
132 MPTCP_EVENT_SUB_PRIORITY = 13,
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800133 MPTCP_EVENT_LISTENER_CREATED = 15,
134 MPTCP_EVENT_LISTENER_CLOSED = 16,
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700135};
136enum mptcp_event_attr {
137 MPTCP_ATTR_UNSPEC = 0,
138 MPTCP_ATTR_TOKEN,
139 MPTCP_ATTR_FAMILY,
140 MPTCP_ATTR_LOC_ID,
141 MPTCP_ATTR_REM_ID,
142 MPTCP_ATTR_SADDR4,
143 MPTCP_ATTR_SADDR6,
144 MPTCP_ATTR_DADDR4,
145 MPTCP_ATTR_DADDR6,
146 MPTCP_ATTR_SPORT,
147 MPTCP_ATTR_DPORT,
148 MPTCP_ATTR_BACKUP,
149 MPTCP_ATTR_ERROR,
150 MPTCP_ATTR_FLAGS,
151 MPTCP_ATTR_TIMEOUT,
152 MPTCP_ATTR_IF_IDX,
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000153 MPTCP_ATTR_RESET_REASON,
154 MPTCP_ATTR_RESET_FLAGS,
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700155 MPTCP_ATTR_SERVER_SIDE,
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700156 __MPTCP_ATTR_AFTER_LAST
157};
158#define MPTCP_ATTR_MAX (__MPTCP_ATTR_AFTER_LAST - 1)
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000159#define MPTCP_RST_EUNSPEC 0
160#define MPTCP_RST_EMPTCP 1
161#define MPTCP_RST_ERESOURCE 2
162#define MPTCP_RST_EPROHIBIT 3
163#define MPTCP_RST_EWQ2BIG 4
164#define MPTCP_RST_EBADPERF 5
165#define MPTCP_RST_EMIDDLEBOX 6
Christopher Ferrisa4792612022-01-10 13:51:15 -0800166struct mptcp_subflow_data {
167 __u32 size_subflow_data;
168 __u32 num_subflows;
169 __u32 size_kernel;
170 __u32 size_user;
171} __attribute__((aligned(8)));
172struct mptcp_subflow_addrs {
173 union {
174 __kernel_sa_family_t sa_family;
175 struct sockaddr sa_local;
176 struct sockaddr_in sin_local;
177 struct sockaddr_in6 sin6_local;
178 struct __kernel_sockaddr_storage ss_local;
179 };
180 union {
181 struct sockaddr sa_remote;
182 struct sockaddr_in sin_remote;
183 struct sockaddr_in6 sin6_remote;
184 struct __kernel_sockaddr_storage ss_remote;
185 };
186};
Christopher Ferris8666d042023-09-06 14:55:31 -0700187struct mptcp_subflow_info {
188 __u32 id;
189 struct mptcp_subflow_addrs addrs;
190};
191struct mptcp_full_info {
192 __u32 size_tcpinfo_kernel;
193 __u32 size_tcpinfo_user;
194 __u32 size_sfinfo_kernel;
195 __u32 size_sfinfo_user;
196 __u32 num_subflows;
197 __u32 size_arrays_user;
198 __aligned_u64 subflow_info;
199 __aligned_u64 tcp_info;
200 struct mptcp_info mptcp_info;
201};
Christopher Ferrisa4792612022-01-10 13:51:15 -0800202#define MPTCP_INFO 1
203#define MPTCP_TCPINFO 2
204#define MPTCP_SUBFLOW_ADDRS 3
Christopher Ferris8666d042023-09-06 14:55:31 -0700205#define MPTCP_FULL_INFO 4
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700206#endif