Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * This file is auto-generated. Modifications will be lost. |
| 3 | * |
| 4 | * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ |
| 5 | * for more information. |
| 6 | */ |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 7 | #ifndef _UAPI_MPTCP_H |
| 8 | #define _UAPI_MPTCP_H |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 9 | #include <netinet/in.h> |
| 10 | #include <sys/socket.h> |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 11 | #include <linux/const.h> |
| 12 | #include <linux/types.h> |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 13 | #include <linux/in.h> |
| 14 | #include <linux/in6.h> |
| 15 | #include <linux/socket.h> |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 16 | #define MPTCP_SUBFLOW_FLAG_MCAP_REM _BITUL(0) |
| 17 | #define MPTCP_SUBFLOW_FLAG_MCAP_LOC _BITUL(1) |
| 18 | #define MPTCP_SUBFLOW_FLAG_JOIN_REM _BITUL(2) |
| 19 | #define MPTCP_SUBFLOW_FLAG_JOIN_LOC _BITUL(3) |
| 20 | #define MPTCP_SUBFLOW_FLAG_BKUP_REM _BITUL(4) |
| 21 | #define MPTCP_SUBFLOW_FLAG_BKUP_LOC _BITUL(5) |
| 22 | #define MPTCP_SUBFLOW_FLAG_FULLY_ESTABLISHED _BITUL(6) |
| 23 | #define MPTCP_SUBFLOW_FLAG_CONNECTED _BITUL(7) |
| 24 | #define MPTCP_SUBFLOW_FLAG_MAPVALID _BITUL(8) |
| 25 | enum { |
| 26 | MPTCP_SUBFLOW_ATTR_UNSPEC, |
| 27 | MPTCP_SUBFLOW_ATTR_TOKEN_REM, |
| 28 | MPTCP_SUBFLOW_ATTR_TOKEN_LOC, |
| 29 | MPTCP_SUBFLOW_ATTR_RELWRITE_SEQ, |
| 30 | MPTCP_SUBFLOW_ATTR_MAP_SEQ, |
| 31 | MPTCP_SUBFLOW_ATTR_MAP_SFSEQ, |
| 32 | MPTCP_SUBFLOW_ATTR_SSN_OFFSET, |
| 33 | MPTCP_SUBFLOW_ATTR_MAP_DATALEN, |
| 34 | MPTCP_SUBFLOW_ATTR_FLAGS, |
| 35 | MPTCP_SUBFLOW_ATTR_ID_REM, |
| 36 | MPTCP_SUBFLOW_ATTR_ID_LOC, |
| 37 | MPTCP_SUBFLOW_ATTR_PAD, |
| 38 | __MPTCP_SUBFLOW_ATTR_MAX |
| 39 | }; |
| 40 | #define MPTCP_SUBFLOW_ATTR_MAX (__MPTCP_SUBFLOW_ATTR_MAX - 1) |
| 41 | #define MPTCP_PM_NAME "mptcp_pm" |
| 42 | #define MPTCP_PM_CMD_GRP_NAME "mptcp_pm_cmds" |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 43 | #define MPTCP_PM_EV_GRP_NAME "mptcp_pm_events" |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 44 | #define MPTCP_PM_VER 0x1 |
| 45 | enum { |
| 46 | MPTCP_PM_ATTR_UNSPEC, |
| 47 | MPTCP_PM_ATTR_ADDR, |
| 48 | MPTCP_PM_ATTR_RCV_ADD_ADDRS, |
| 49 | MPTCP_PM_ATTR_SUBFLOWS, |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 50 | MPTCP_PM_ATTR_TOKEN, |
| 51 | MPTCP_PM_ATTR_LOC_ID, |
| 52 | MPTCP_PM_ATTR_ADDR_REMOTE, |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 53 | __MPTCP_PM_ATTR_MAX |
| 54 | }; |
| 55 | #define MPTCP_PM_ATTR_MAX (__MPTCP_PM_ATTR_MAX - 1) |
| 56 | enum { |
| 57 | MPTCP_PM_ADDR_ATTR_UNSPEC, |
| 58 | MPTCP_PM_ADDR_ATTR_FAMILY, |
| 59 | MPTCP_PM_ADDR_ATTR_ID, |
| 60 | MPTCP_PM_ADDR_ATTR_ADDR4, |
| 61 | MPTCP_PM_ADDR_ATTR_ADDR6, |
| 62 | MPTCP_PM_ADDR_ATTR_PORT, |
| 63 | MPTCP_PM_ADDR_ATTR_FLAGS, |
| 64 | MPTCP_PM_ADDR_ATTR_IF_IDX, |
| 65 | __MPTCP_PM_ADDR_ATTR_MAX |
| 66 | }; |
| 67 | #define MPTCP_PM_ADDR_ATTR_MAX (__MPTCP_PM_ADDR_ATTR_MAX - 1) |
| 68 | #define MPTCP_PM_ADDR_FLAG_SIGNAL (1 << 0) |
| 69 | #define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1) |
| 70 | #define MPTCP_PM_ADDR_FLAG_BACKUP (1 << 2) |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame] | 71 | #define MPTCP_PM_ADDR_FLAG_FULLMESH (1 << 3) |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 72 | #define MPTCP_PM_ADDR_FLAG_IMPLICIT (1 << 4) |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 73 | enum { |
| 74 | MPTCP_PM_CMD_UNSPEC, |
| 75 | MPTCP_PM_CMD_ADD_ADDR, |
| 76 | MPTCP_PM_CMD_DEL_ADDR, |
| 77 | MPTCP_PM_CMD_GET_ADDR, |
| 78 | MPTCP_PM_CMD_FLUSH_ADDRS, |
| 79 | MPTCP_PM_CMD_SET_LIMITS, |
| 80 | MPTCP_PM_CMD_GET_LIMITS, |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 81 | MPTCP_PM_CMD_SET_FLAGS, |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 82 | MPTCP_PM_CMD_ANNOUNCE, |
| 83 | MPTCP_PM_CMD_REMOVE, |
| 84 | MPTCP_PM_CMD_SUBFLOW_CREATE, |
| 85 | MPTCP_PM_CMD_SUBFLOW_DESTROY, |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 86 | __MPTCP_PM_CMD_AFTER_LAST |
| 87 | }; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 88 | #define MPTCP_INFO_FLAG_FALLBACK _BITUL(0) |
| 89 | #define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED _BITUL(1) |
| 90 | struct mptcp_info { |
| 91 | __u8 mptcpi_subflows; |
| 92 | __u8 mptcpi_add_addr_signal; |
| 93 | __u8 mptcpi_add_addr_accepted; |
| 94 | __u8 mptcpi_subflows_max; |
| 95 | __u8 mptcpi_add_addr_signal_max; |
| 96 | __u8 mptcpi_add_addr_accepted_max; |
| 97 | __u32 mptcpi_flags; |
| 98 | __u32 mptcpi_token; |
| 99 | __u64 mptcpi_write_seq; |
| 100 | __u64 mptcpi_snd_una; |
| 101 | __u64 mptcpi_rcv_nxt; |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 102 | __u8 mptcpi_local_addr_used; |
| 103 | __u8 mptcpi_local_addr_max; |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 104 | __u8 mptcpi_csum_enabled; |
Christopher Ferris | 8666d04 | 2023-09-06 14:55:31 -0700 | [diff] [blame] | 105 | __u32 mptcpi_retransmits; |
| 106 | __u64 mptcpi_bytes_retrans; |
| 107 | __u64 mptcpi_bytes_sent; |
| 108 | __u64 mptcpi_bytes_received; |
| 109 | __u64 mptcpi_bytes_acked; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 110 | }; |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 111 | enum mptcp_event_type { |
| 112 | MPTCP_EVENT_UNSPEC = 0, |
| 113 | MPTCP_EVENT_CREATED = 1, |
| 114 | MPTCP_EVENT_ESTABLISHED = 2, |
| 115 | MPTCP_EVENT_CLOSED = 3, |
| 116 | MPTCP_EVENT_ANNOUNCED = 6, |
| 117 | MPTCP_EVENT_REMOVED = 7, |
| 118 | MPTCP_EVENT_SUB_ESTABLISHED = 10, |
| 119 | MPTCP_EVENT_SUB_CLOSED = 11, |
| 120 | MPTCP_EVENT_SUB_PRIORITY = 13, |
Christopher Ferris | 8b7fdc9 | 2023-02-21 13:36:32 -0800 | [diff] [blame] | 121 | MPTCP_EVENT_LISTENER_CREATED = 15, |
| 122 | MPTCP_EVENT_LISTENER_CLOSED = 16, |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 123 | }; |
| 124 | enum mptcp_event_attr { |
| 125 | MPTCP_ATTR_UNSPEC = 0, |
| 126 | MPTCP_ATTR_TOKEN, |
| 127 | MPTCP_ATTR_FAMILY, |
| 128 | MPTCP_ATTR_LOC_ID, |
| 129 | MPTCP_ATTR_REM_ID, |
| 130 | MPTCP_ATTR_SADDR4, |
| 131 | MPTCP_ATTR_SADDR6, |
| 132 | MPTCP_ATTR_DADDR4, |
| 133 | MPTCP_ATTR_DADDR6, |
| 134 | MPTCP_ATTR_SPORT, |
| 135 | MPTCP_ATTR_DPORT, |
| 136 | MPTCP_ATTR_BACKUP, |
| 137 | MPTCP_ATTR_ERROR, |
| 138 | MPTCP_ATTR_FLAGS, |
| 139 | MPTCP_ATTR_TIMEOUT, |
| 140 | MPTCP_ATTR_IF_IDX, |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 141 | MPTCP_ATTR_RESET_REASON, |
| 142 | MPTCP_ATTR_RESET_FLAGS, |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 143 | MPTCP_ATTR_SERVER_SIDE, |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 144 | __MPTCP_ATTR_AFTER_LAST |
| 145 | }; |
| 146 | #define MPTCP_ATTR_MAX (__MPTCP_ATTR_AFTER_LAST - 1) |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 147 | #define MPTCP_RST_EUNSPEC 0 |
| 148 | #define MPTCP_RST_EMPTCP 1 |
| 149 | #define MPTCP_RST_ERESOURCE 2 |
| 150 | #define MPTCP_RST_EPROHIBIT 3 |
| 151 | #define MPTCP_RST_EWQ2BIG 4 |
| 152 | #define MPTCP_RST_EBADPERF 5 |
| 153 | #define MPTCP_RST_EMIDDLEBOX 6 |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 154 | struct mptcp_subflow_data { |
| 155 | __u32 size_subflow_data; |
| 156 | __u32 num_subflows; |
| 157 | __u32 size_kernel; |
| 158 | __u32 size_user; |
| 159 | } __attribute__((aligned(8))); |
| 160 | struct mptcp_subflow_addrs { |
| 161 | union { |
| 162 | __kernel_sa_family_t sa_family; |
| 163 | struct sockaddr sa_local; |
| 164 | struct sockaddr_in sin_local; |
| 165 | struct sockaddr_in6 sin6_local; |
| 166 | struct __kernel_sockaddr_storage ss_local; |
| 167 | }; |
| 168 | union { |
| 169 | struct sockaddr sa_remote; |
| 170 | struct sockaddr_in sin_remote; |
| 171 | struct sockaddr_in6 sin6_remote; |
| 172 | struct __kernel_sockaddr_storage ss_remote; |
| 173 | }; |
| 174 | }; |
Christopher Ferris | 8666d04 | 2023-09-06 14:55:31 -0700 | [diff] [blame] | 175 | struct mptcp_subflow_info { |
| 176 | __u32 id; |
| 177 | struct mptcp_subflow_addrs addrs; |
| 178 | }; |
| 179 | struct mptcp_full_info { |
| 180 | __u32 size_tcpinfo_kernel; |
| 181 | __u32 size_tcpinfo_user; |
| 182 | __u32 size_sfinfo_kernel; |
| 183 | __u32 size_sfinfo_user; |
| 184 | __u32 num_subflows; |
| 185 | __u32 size_arrays_user; |
| 186 | __aligned_u64 subflow_info; |
| 187 | __aligned_u64 tcp_info; |
| 188 | struct mptcp_info mptcp_info; |
| 189 | }; |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 190 | #define MPTCP_INFO 1 |
| 191 | #define MPTCP_TCPINFO 2 |
| 192 | #define MPTCP_SUBFLOW_ADDRS 3 |
Christopher Ferris | 8666d04 | 2023-09-06 14:55:31 -0700 | [diff] [blame] | 193 | #define MPTCP_FULL_INFO 4 |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 194 | #endif |