blob: 9f7215cd2ebdf2308c4154d01fe0eedbe8cf832c [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 Ferris25c18d42020-10-14 17:42:58 -0700117};
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700118enum mptcp_event_type {
119 MPTCP_EVENT_UNSPEC = 0,
120 MPTCP_EVENT_CREATED = 1,
121 MPTCP_EVENT_ESTABLISHED = 2,
122 MPTCP_EVENT_CLOSED = 3,
123 MPTCP_EVENT_ANNOUNCED = 6,
124 MPTCP_EVENT_REMOVED = 7,
125 MPTCP_EVENT_SUB_ESTABLISHED = 10,
126 MPTCP_EVENT_SUB_CLOSED = 11,
127 MPTCP_EVENT_SUB_PRIORITY = 13,
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800128 MPTCP_EVENT_LISTENER_CREATED = 15,
129 MPTCP_EVENT_LISTENER_CLOSED = 16,
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700130};
131enum mptcp_event_attr {
132 MPTCP_ATTR_UNSPEC = 0,
133 MPTCP_ATTR_TOKEN,
134 MPTCP_ATTR_FAMILY,
135 MPTCP_ATTR_LOC_ID,
136 MPTCP_ATTR_REM_ID,
137 MPTCP_ATTR_SADDR4,
138 MPTCP_ATTR_SADDR6,
139 MPTCP_ATTR_DADDR4,
140 MPTCP_ATTR_DADDR6,
141 MPTCP_ATTR_SPORT,
142 MPTCP_ATTR_DPORT,
143 MPTCP_ATTR_BACKUP,
144 MPTCP_ATTR_ERROR,
145 MPTCP_ATTR_FLAGS,
146 MPTCP_ATTR_TIMEOUT,
147 MPTCP_ATTR_IF_IDX,
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000148 MPTCP_ATTR_RESET_REASON,
149 MPTCP_ATTR_RESET_FLAGS,
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700150 MPTCP_ATTR_SERVER_SIDE,
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700151 __MPTCP_ATTR_AFTER_LAST
152};
153#define MPTCP_ATTR_MAX (__MPTCP_ATTR_AFTER_LAST - 1)
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000154#define MPTCP_RST_EUNSPEC 0
155#define MPTCP_RST_EMPTCP 1
156#define MPTCP_RST_ERESOURCE 2
157#define MPTCP_RST_EPROHIBIT 3
158#define MPTCP_RST_EWQ2BIG 4
159#define MPTCP_RST_EBADPERF 5
160#define MPTCP_RST_EMIDDLEBOX 6
Christopher Ferrisa4792612022-01-10 13:51:15 -0800161struct mptcp_subflow_data {
162 __u32 size_subflow_data;
163 __u32 num_subflows;
164 __u32 size_kernel;
165 __u32 size_user;
166} __attribute__((aligned(8)));
167struct mptcp_subflow_addrs {
168 union {
169 __kernel_sa_family_t sa_family;
170 struct sockaddr sa_local;
171 struct sockaddr_in sin_local;
172 struct sockaddr_in6 sin6_local;
173 struct __kernel_sockaddr_storage ss_local;
174 };
175 union {
176 struct sockaddr sa_remote;
177 struct sockaddr_in sin_remote;
178 struct sockaddr_in6 sin6_remote;
179 struct __kernel_sockaddr_storage ss_remote;
180 };
181};
182#define MPTCP_INFO 1
183#define MPTCP_TCPINFO 2
184#define MPTCP_SUBFLOW_ADDRS 3
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700185#endif