blob: 03d36915243d014b16ff1e77c5103012b198c81e [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
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 Ferrisaf09c702020-06-01 20:29:29 -07007#ifndef _UAPI_MPTCP_H
8#define _UAPI_MPTCP_H
Christopher Ferris80ae69d2022-08-02 16:32:21 -07009#include <netinet/in.h>
10#include <sys/socket.h>
Christopher Ferrisaf09c702020-06-01 20:29:29 -070011#include <linux/const.h>
12#include <linux/types.h>
Christopher Ferrisa4792612022-01-10 13:51:15 -080013#include <linux/in.h>
14#include <linux/in6.h>
15#include <linux/socket.h>
Christopher Ferrisaf09c702020-06-01 20:29:29 -070016#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 Ferrisaf09c702020-06-01 20:29:29 -070025#define MPTCP_PM_CMD_GRP_NAME "mptcp_pm_cmds"
Christopher Ferrisa9750ed2021-05-03 14:02:49 -070026#define MPTCP_PM_EV_GRP_NAME "mptcp_pm_events"
Christopher Ferris0f795212024-01-17 14:17:28 -080027#include <linux/mptcp_pm.h>
28#define MPTCP_INFO_FLAG_FALLBACK _BITUL(0)
29#define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED _BITUL(1)
Christopher Ferrisaf09c702020-06-01 20:29:29 -070030#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 Ferris2abfa9e2021-11-01 16:26:06 -070033#define MPTCP_PM_ADDR_FLAG_FULLMESH (1 << 3)
Christopher Ferris10a76e62022-06-08 13:31:52 -070034#define MPTCP_PM_ADDR_FLAG_IMPLICIT (1 << 4)
Christopher Ferris25c18d42020-10-14 17:42:58 -070035struct 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 Ferrisa9750ed2021-05-03 14:02:49 -070047 __u8 mptcpi_local_addr_used;
48 __u8 mptcpi_local_addr_max;
Christopher Ferris3a39c0b2021-09-02 00:03:38 +000049 __u8 mptcpi_csum_enabled;
Christopher Ferris8666d042023-09-06 14:55:31 -070050 __u32 mptcpi_retransmits;
51 __u64 mptcpi_bytes_retrans;
52 __u64 mptcpi_bytes_sent;
53 __u64 mptcpi_bytes_received;
54 __u64 mptcpi_bytes_acked;
Christopher Ferrisb830ddf2024-03-28 11:48:08 -070055 __u8 mptcpi_subflows_total;
Christopher Ferris7ac54f52024-08-07 21:07:12 +000056 __u8 reserved[3];
57 __u32 mptcpi_last_data_sent;
58 __u32 mptcpi_last_data_recv;
59 __u32 mptcpi_last_ack_recv;
Christopher Ferris25c18d42020-10-14 17:42:58 -070060};
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +000061#define MPTCP_RST_EUNSPEC 0
62#define MPTCP_RST_EMPTCP 1
63#define MPTCP_RST_ERESOURCE 2
64#define MPTCP_RST_EPROHIBIT 3
65#define MPTCP_RST_EWQ2BIG 4
66#define MPTCP_RST_EBADPERF 5
67#define MPTCP_RST_EMIDDLEBOX 6
Christopher Ferrisa4792612022-01-10 13:51:15 -080068struct mptcp_subflow_data {
69 __u32 size_subflow_data;
70 __u32 num_subflows;
71 __u32 size_kernel;
72 __u32 size_user;
73} __attribute__((aligned(8)));
74struct mptcp_subflow_addrs {
75 union {
76 __kernel_sa_family_t sa_family;
77 struct sockaddr sa_local;
78 struct sockaddr_in sin_local;
79 struct sockaddr_in6 sin6_local;
Elliott Hughes5850f6f2023-11-29 11:18:49 -080080 struct sockaddr_storage ss_local;
Christopher Ferrisa4792612022-01-10 13:51:15 -080081 };
82 union {
83 struct sockaddr sa_remote;
84 struct sockaddr_in sin_remote;
85 struct sockaddr_in6 sin6_remote;
Elliott Hughes5850f6f2023-11-29 11:18:49 -080086 struct sockaddr_storage ss_remote;
Christopher Ferrisa4792612022-01-10 13:51:15 -080087 };
88};
Christopher Ferris8666d042023-09-06 14:55:31 -070089struct mptcp_subflow_info {
90 __u32 id;
91 struct mptcp_subflow_addrs addrs;
92};
93struct mptcp_full_info {
94 __u32 size_tcpinfo_kernel;
95 __u32 size_tcpinfo_user;
96 __u32 size_sfinfo_kernel;
97 __u32 size_sfinfo_user;
98 __u32 num_subflows;
99 __u32 size_arrays_user;
100 __aligned_u64 subflow_info;
101 __aligned_u64 tcp_info;
102 struct mptcp_info mptcp_info;
103};
Christopher Ferrisa4792612022-01-10 13:51:15 -0800104#define MPTCP_INFO 1
105#define MPTCP_TCPINFO 2
106#define MPTCP_SUBFLOW_ADDRS 3
Christopher Ferris8666d042023-09-06 14:55:31 -0700107#define MPTCP_FULL_INFO 4
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700108#endif