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 |
| 21 | #include <linux/const.h> |
| 22 | #include <linux/types.h> |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 23 | #include <linux/in.h> |
| 24 | #include <linux/in6.h> |
| 25 | #include <linux/socket.h> |
| 26 | #include <sys/socket.h> |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 27 | #define MPTCP_SUBFLOW_FLAG_MCAP_REM _BITUL(0) |
| 28 | #define MPTCP_SUBFLOW_FLAG_MCAP_LOC _BITUL(1) |
| 29 | #define MPTCP_SUBFLOW_FLAG_JOIN_REM _BITUL(2) |
| 30 | #define MPTCP_SUBFLOW_FLAG_JOIN_LOC _BITUL(3) |
| 31 | #define MPTCP_SUBFLOW_FLAG_BKUP_REM _BITUL(4) |
| 32 | #define MPTCP_SUBFLOW_FLAG_BKUP_LOC _BITUL(5) |
| 33 | #define MPTCP_SUBFLOW_FLAG_FULLY_ESTABLISHED _BITUL(6) |
| 34 | #define MPTCP_SUBFLOW_FLAG_CONNECTED _BITUL(7) |
| 35 | #define MPTCP_SUBFLOW_FLAG_MAPVALID _BITUL(8) |
| 36 | enum { |
| 37 | MPTCP_SUBFLOW_ATTR_UNSPEC, |
| 38 | MPTCP_SUBFLOW_ATTR_TOKEN_REM, |
| 39 | MPTCP_SUBFLOW_ATTR_TOKEN_LOC, |
| 40 | MPTCP_SUBFLOW_ATTR_RELWRITE_SEQ, |
| 41 | MPTCP_SUBFLOW_ATTR_MAP_SEQ, |
| 42 | MPTCP_SUBFLOW_ATTR_MAP_SFSEQ, |
| 43 | MPTCP_SUBFLOW_ATTR_SSN_OFFSET, |
| 44 | MPTCP_SUBFLOW_ATTR_MAP_DATALEN, |
| 45 | MPTCP_SUBFLOW_ATTR_FLAGS, |
| 46 | MPTCP_SUBFLOW_ATTR_ID_REM, |
| 47 | MPTCP_SUBFLOW_ATTR_ID_LOC, |
| 48 | MPTCP_SUBFLOW_ATTR_PAD, |
| 49 | __MPTCP_SUBFLOW_ATTR_MAX |
| 50 | }; |
| 51 | #define MPTCP_SUBFLOW_ATTR_MAX (__MPTCP_SUBFLOW_ATTR_MAX - 1) |
| 52 | #define MPTCP_PM_NAME "mptcp_pm" |
| 53 | #define MPTCP_PM_CMD_GRP_NAME "mptcp_pm_cmds" |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 54 | #define MPTCP_PM_EV_GRP_NAME "mptcp_pm_events" |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 55 | #define MPTCP_PM_VER 0x1 |
| 56 | enum { |
| 57 | MPTCP_PM_ATTR_UNSPEC, |
| 58 | MPTCP_PM_ATTR_ADDR, |
| 59 | MPTCP_PM_ATTR_RCV_ADD_ADDRS, |
| 60 | MPTCP_PM_ATTR_SUBFLOWS, |
| 61 | __MPTCP_PM_ATTR_MAX |
| 62 | }; |
| 63 | #define MPTCP_PM_ATTR_MAX (__MPTCP_PM_ATTR_MAX - 1) |
| 64 | enum { |
| 65 | MPTCP_PM_ADDR_ATTR_UNSPEC, |
| 66 | MPTCP_PM_ADDR_ATTR_FAMILY, |
| 67 | MPTCP_PM_ADDR_ATTR_ID, |
| 68 | MPTCP_PM_ADDR_ATTR_ADDR4, |
| 69 | MPTCP_PM_ADDR_ATTR_ADDR6, |
| 70 | MPTCP_PM_ADDR_ATTR_PORT, |
| 71 | MPTCP_PM_ADDR_ATTR_FLAGS, |
| 72 | MPTCP_PM_ADDR_ATTR_IF_IDX, |
| 73 | __MPTCP_PM_ADDR_ATTR_MAX |
| 74 | }; |
| 75 | #define MPTCP_PM_ADDR_ATTR_MAX (__MPTCP_PM_ADDR_ATTR_MAX - 1) |
| 76 | #define MPTCP_PM_ADDR_FLAG_SIGNAL (1 << 0) |
| 77 | #define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1) |
| 78 | #define MPTCP_PM_ADDR_FLAG_BACKUP (1 << 2) |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame] | 79 | #define MPTCP_PM_ADDR_FLAG_FULLMESH (1 << 3) |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame^] | 80 | #define MPTCP_PM_ADDR_FLAG_IMPLICIT (1 << 4) |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 81 | enum { |
| 82 | MPTCP_PM_CMD_UNSPEC, |
| 83 | MPTCP_PM_CMD_ADD_ADDR, |
| 84 | MPTCP_PM_CMD_DEL_ADDR, |
| 85 | MPTCP_PM_CMD_GET_ADDR, |
| 86 | MPTCP_PM_CMD_FLUSH_ADDRS, |
| 87 | MPTCP_PM_CMD_SET_LIMITS, |
| 88 | MPTCP_PM_CMD_GET_LIMITS, |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 89 | MPTCP_PM_CMD_SET_FLAGS, |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 90 | __MPTCP_PM_CMD_AFTER_LAST |
| 91 | }; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 92 | #define MPTCP_INFO_FLAG_FALLBACK _BITUL(0) |
| 93 | #define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED _BITUL(1) |
| 94 | struct 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; |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 106 | __u8 mptcpi_local_addr_used; |
| 107 | __u8 mptcpi_local_addr_max; |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 108 | __u8 mptcpi_csum_enabled; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 109 | }; |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 110 | enum mptcp_event_type { |
| 111 | MPTCP_EVENT_UNSPEC = 0, |
| 112 | MPTCP_EVENT_CREATED = 1, |
| 113 | MPTCP_EVENT_ESTABLISHED = 2, |
| 114 | MPTCP_EVENT_CLOSED = 3, |
| 115 | MPTCP_EVENT_ANNOUNCED = 6, |
| 116 | MPTCP_EVENT_REMOVED = 7, |
| 117 | MPTCP_EVENT_SUB_ESTABLISHED = 10, |
| 118 | MPTCP_EVENT_SUB_CLOSED = 11, |
| 119 | MPTCP_EVENT_SUB_PRIORITY = 13, |
| 120 | }; |
| 121 | enum mptcp_event_attr { |
| 122 | MPTCP_ATTR_UNSPEC = 0, |
| 123 | MPTCP_ATTR_TOKEN, |
| 124 | MPTCP_ATTR_FAMILY, |
| 125 | MPTCP_ATTR_LOC_ID, |
| 126 | MPTCP_ATTR_REM_ID, |
| 127 | MPTCP_ATTR_SADDR4, |
| 128 | MPTCP_ATTR_SADDR6, |
| 129 | MPTCP_ATTR_DADDR4, |
| 130 | MPTCP_ATTR_DADDR6, |
| 131 | MPTCP_ATTR_SPORT, |
| 132 | MPTCP_ATTR_DPORT, |
| 133 | MPTCP_ATTR_BACKUP, |
| 134 | MPTCP_ATTR_ERROR, |
| 135 | MPTCP_ATTR_FLAGS, |
| 136 | MPTCP_ATTR_TIMEOUT, |
| 137 | MPTCP_ATTR_IF_IDX, |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 138 | MPTCP_ATTR_RESET_REASON, |
| 139 | MPTCP_ATTR_RESET_FLAGS, |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 140 | __MPTCP_ATTR_AFTER_LAST |
| 141 | }; |
| 142 | #define MPTCP_ATTR_MAX (__MPTCP_ATTR_AFTER_LAST - 1) |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 143 | #define MPTCP_RST_EUNSPEC 0 |
| 144 | #define MPTCP_RST_EMPTCP 1 |
| 145 | #define MPTCP_RST_ERESOURCE 2 |
| 146 | #define MPTCP_RST_EPROHIBIT 3 |
| 147 | #define MPTCP_RST_EWQ2BIG 4 |
| 148 | #define MPTCP_RST_EBADPERF 5 |
| 149 | #define MPTCP_RST_EMIDDLEBOX 6 |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 150 | struct mptcp_subflow_data { |
| 151 | __u32 size_subflow_data; |
| 152 | __u32 num_subflows; |
| 153 | __u32 size_kernel; |
| 154 | __u32 size_user; |
| 155 | } __attribute__((aligned(8))); |
| 156 | struct mptcp_subflow_addrs { |
| 157 | union { |
| 158 | __kernel_sa_family_t sa_family; |
| 159 | struct sockaddr sa_local; |
| 160 | struct sockaddr_in sin_local; |
| 161 | struct sockaddr_in6 sin6_local; |
| 162 | struct __kernel_sockaddr_storage ss_local; |
| 163 | }; |
| 164 | union { |
| 165 | struct sockaddr sa_remote; |
| 166 | struct sockaddr_in sin_remote; |
| 167 | struct sockaddr_in6 sin6_remote; |
| 168 | struct __kernel_sockaddr_storage ss_remote; |
| 169 | }; |
| 170 | }; |
| 171 | #define MPTCP_INFO 1 |
| 172 | #define MPTCP_TCPINFO 2 |
| 173 | #define MPTCP_SUBFLOW_ADDRS 3 |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 174 | #endif |