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) |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 25 | #define MPTCP_PM_CMD_GRP_NAME "mptcp_pm_cmds" |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 26 | #define MPTCP_PM_EV_GRP_NAME "mptcp_pm_events" |
Christopher Ferris | 0f79521 | 2024-01-17 14:17:28 -0800 | [diff] [blame] | 27 | #include <linux/mptcp_pm.h> |
| 28 | #define MPTCP_INFO_FLAG_FALLBACK _BITUL(0) |
| 29 | #define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED _BITUL(1) |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 30 | #define MPTCP_PM_ADDR_FLAG_SIGNAL (1 << 0) |
| 31 | #define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1) |
| 32 | #define MPTCP_PM_ADDR_FLAG_BACKUP (1 << 2) |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame] | 33 | #define MPTCP_PM_ADDR_FLAG_FULLMESH (1 << 3) |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 34 | #define MPTCP_PM_ADDR_FLAG_IMPLICIT (1 << 4) |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 35 | struct mptcp_info { |
| 36 | __u8 mptcpi_subflows; |
| 37 | __u8 mptcpi_add_addr_signal; |
| 38 | __u8 mptcpi_add_addr_accepted; |
| 39 | __u8 mptcpi_subflows_max; |
| 40 | __u8 mptcpi_add_addr_signal_max; |
| 41 | __u8 mptcpi_add_addr_accepted_max; |
| 42 | __u32 mptcpi_flags; |
| 43 | __u32 mptcpi_token; |
| 44 | __u64 mptcpi_write_seq; |
| 45 | __u64 mptcpi_snd_una; |
| 46 | __u64 mptcpi_rcv_nxt; |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 47 | __u8 mptcpi_local_addr_used; |
| 48 | __u8 mptcpi_local_addr_max; |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 49 | __u8 mptcpi_csum_enabled; |
Christopher Ferris | 8666d04 | 2023-09-06 14:55:31 -0700 | [diff] [blame] | 50 | __u32 mptcpi_retransmits; |
| 51 | __u64 mptcpi_bytes_retrans; |
| 52 | __u64 mptcpi_bytes_sent; |
| 53 | __u64 mptcpi_bytes_received; |
| 54 | __u64 mptcpi_bytes_acked; |
Christopher Ferris | b830ddf | 2024-03-28 11:48:08 -0700 | [diff] [blame] | 55 | __u8 mptcpi_subflows_total; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 56 | }; |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 57 | #define MPTCP_RST_EUNSPEC 0 |
| 58 | #define MPTCP_RST_EMPTCP 1 |
| 59 | #define MPTCP_RST_ERESOURCE 2 |
| 60 | #define MPTCP_RST_EPROHIBIT 3 |
| 61 | #define MPTCP_RST_EWQ2BIG 4 |
| 62 | #define MPTCP_RST_EBADPERF 5 |
| 63 | #define MPTCP_RST_EMIDDLEBOX 6 |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 64 | struct mptcp_subflow_data { |
| 65 | __u32 size_subflow_data; |
| 66 | __u32 num_subflows; |
| 67 | __u32 size_kernel; |
| 68 | __u32 size_user; |
| 69 | } __attribute__((aligned(8))); |
| 70 | struct mptcp_subflow_addrs { |
| 71 | union { |
| 72 | __kernel_sa_family_t sa_family; |
| 73 | struct sockaddr sa_local; |
| 74 | struct sockaddr_in sin_local; |
| 75 | struct sockaddr_in6 sin6_local; |
Elliott Hughes | 5850f6f | 2023-11-29 11:18:49 -0800 | [diff] [blame] | 76 | struct sockaddr_storage ss_local; |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 77 | }; |
| 78 | union { |
| 79 | struct sockaddr sa_remote; |
| 80 | struct sockaddr_in sin_remote; |
| 81 | struct sockaddr_in6 sin6_remote; |
Elliott Hughes | 5850f6f | 2023-11-29 11:18:49 -0800 | [diff] [blame] | 82 | struct sockaddr_storage ss_remote; |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 83 | }; |
| 84 | }; |
Christopher Ferris | 8666d04 | 2023-09-06 14:55:31 -0700 | [diff] [blame] | 85 | struct mptcp_subflow_info { |
| 86 | __u32 id; |
| 87 | struct mptcp_subflow_addrs addrs; |
| 88 | }; |
| 89 | struct mptcp_full_info { |
| 90 | __u32 size_tcpinfo_kernel; |
| 91 | __u32 size_tcpinfo_user; |
| 92 | __u32 size_sfinfo_kernel; |
| 93 | __u32 size_sfinfo_user; |
| 94 | __u32 num_subflows; |
| 95 | __u32 size_arrays_user; |
| 96 | __aligned_u64 subflow_info; |
| 97 | __aligned_u64 tcp_info; |
| 98 | struct mptcp_info mptcp_info; |
| 99 | }; |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 100 | #define MPTCP_INFO 1 |
| 101 | #define MPTCP_TCPINFO 2 |
| 102 | #define MPTCP_SUBFLOW_ADDRS 3 |
Christopher Ferris | 8666d04 | 2023-09-06 14:55:31 -0700 | [diff] [blame] | 103 | #define MPTCP_FULL_INFO 4 |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 104 | #endif |