| Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 1 | /**************************************************************************** | 
|  | 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 Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 21 | #include <netinet/in.h> | 
|  | 22 | #include <sys/socket.h> | 
| Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 23 | #include <linux/const.h> | 
|  | 24 | #include <linux/types.h> | 
| Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 25 | #include <linux/in.h> | 
|  | 26 | #include <linux/in6.h> | 
|  | 27 | #include <linux/socket.h> | 
| Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 28 | #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) | 
|  | 37 | enum { | 
|  | 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 Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 55 | #define MPTCP_PM_EV_GRP_NAME "mptcp_pm_events" | 
| Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 56 | #define MPTCP_PM_VER 0x1 | 
|  | 57 | enum { | 
|  | 58 | MPTCP_PM_ATTR_UNSPEC, | 
|  | 59 | MPTCP_PM_ATTR_ADDR, | 
|  | 60 | MPTCP_PM_ATTR_RCV_ADD_ADDRS, | 
|  | 61 | MPTCP_PM_ATTR_SUBFLOWS, | 
| Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 62 | MPTCP_PM_ATTR_TOKEN, | 
|  | 63 | MPTCP_PM_ATTR_LOC_ID, | 
|  | 64 | MPTCP_PM_ATTR_ADDR_REMOTE, | 
| Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 65 | __MPTCP_PM_ATTR_MAX | 
|  | 66 | }; | 
|  | 67 | #define MPTCP_PM_ATTR_MAX (__MPTCP_PM_ATTR_MAX - 1) | 
|  | 68 | enum { | 
|  | 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 Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame] | 83 | #define MPTCP_PM_ADDR_FLAG_FULLMESH (1 << 3) | 
| Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 84 | #define MPTCP_PM_ADDR_FLAG_IMPLICIT (1 << 4) | 
| Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 85 | enum { | 
|  | 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 Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 93 | MPTCP_PM_CMD_SET_FLAGS, | 
| Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 94 | MPTCP_PM_CMD_ANNOUNCE, | 
|  | 95 | MPTCP_PM_CMD_REMOVE, | 
|  | 96 | MPTCP_PM_CMD_SUBFLOW_CREATE, | 
|  | 97 | MPTCP_PM_CMD_SUBFLOW_DESTROY, | 
| Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 98 | __MPTCP_PM_CMD_AFTER_LAST | 
|  | 99 | }; | 
| Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 100 | #define MPTCP_INFO_FLAG_FALLBACK _BITUL(0) | 
|  | 101 | #define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED _BITUL(1) | 
|  | 102 | struct 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 Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 114 | __u8 mptcpi_local_addr_used; | 
|  | 115 | __u8 mptcpi_local_addr_max; | 
| Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 116 | __u8 mptcpi_csum_enabled; | 
| Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 117 | }; | 
| Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 118 | enum 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, | 
|  | 128 | }; | 
|  | 129 | enum mptcp_event_attr { | 
|  | 130 | MPTCP_ATTR_UNSPEC = 0, | 
|  | 131 | MPTCP_ATTR_TOKEN, | 
|  | 132 | MPTCP_ATTR_FAMILY, | 
|  | 133 | MPTCP_ATTR_LOC_ID, | 
|  | 134 | MPTCP_ATTR_REM_ID, | 
|  | 135 | MPTCP_ATTR_SADDR4, | 
|  | 136 | MPTCP_ATTR_SADDR6, | 
|  | 137 | MPTCP_ATTR_DADDR4, | 
|  | 138 | MPTCP_ATTR_DADDR6, | 
|  | 139 | MPTCP_ATTR_SPORT, | 
|  | 140 | MPTCP_ATTR_DPORT, | 
|  | 141 | MPTCP_ATTR_BACKUP, | 
|  | 142 | MPTCP_ATTR_ERROR, | 
|  | 143 | MPTCP_ATTR_FLAGS, | 
|  | 144 | MPTCP_ATTR_TIMEOUT, | 
|  | 145 | MPTCP_ATTR_IF_IDX, | 
| Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 146 | MPTCP_ATTR_RESET_REASON, | 
|  | 147 | MPTCP_ATTR_RESET_FLAGS, | 
| Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 148 | MPTCP_ATTR_SERVER_SIDE, | 
| Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 149 | __MPTCP_ATTR_AFTER_LAST | 
|  | 150 | }; | 
|  | 151 | #define MPTCP_ATTR_MAX (__MPTCP_ATTR_AFTER_LAST - 1) | 
| Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 152 | #define MPTCP_RST_EUNSPEC 0 | 
|  | 153 | #define MPTCP_RST_EMPTCP 1 | 
|  | 154 | #define MPTCP_RST_ERESOURCE 2 | 
|  | 155 | #define MPTCP_RST_EPROHIBIT 3 | 
|  | 156 | #define MPTCP_RST_EWQ2BIG 4 | 
|  | 157 | #define MPTCP_RST_EBADPERF 5 | 
|  | 158 | #define MPTCP_RST_EMIDDLEBOX 6 | 
| Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 159 | struct mptcp_subflow_data { | 
|  | 160 | __u32 size_subflow_data; | 
|  | 161 | __u32 num_subflows; | 
|  | 162 | __u32 size_kernel; | 
|  | 163 | __u32 size_user; | 
|  | 164 | } __attribute__((aligned(8))); | 
|  | 165 | struct mptcp_subflow_addrs { | 
|  | 166 | union { | 
|  | 167 | __kernel_sa_family_t sa_family; | 
|  | 168 | struct sockaddr sa_local; | 
|  | 169 | struct sockaddr_in sin_local; | 
|  | 170 | struct sockaddr_in6 sin6_local; | 
|  | 171 | struct __kernel_sockaddr_storage ss_local; | 
|  | 172 | }; | 
|  | 173 | union { | 
|  | 174 | struct sockaddr sa_remote; | 
|  | 175 | struct sockaddr_in sin_remote; | 
|  | 176 | struct sockaddr_in6 sin6_remote; | 
|  | 177 | struct __kernel_sockaddr_storage ss_remote; | 
|  | 178 | }; | 
|  | 179 | }; | 
|  | 180 | #define MPTCP_INFO 1 | 
|  | 181 | #define MPTCP_TCPINFO 2 | 
|  | 182 | #define MPTCP_SUBFLOW_ADDRS 3 | 
| Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 183 | #endif |