• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 <netinet/in.h>
22 #include <sys/socket.h>
23 #include <linux/const.h>
24 #include <linux/types.h>
25 #include <linux/in.h>
26 #include <linux/in6.h>
27 #include <linux/socket.h>
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"
55 #define MPTCP_PM_EV_GRP_NAME "mptcp_pm_events"
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,
62   MPTCP_PM_ATTR_TOKEN,
63   MPTCP_PM_ATTR_LOC_ID,
64   MPTCP_PM_ATTR_ADDR_REMOTE,
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)
83 #define MPTCP_PM_ADDR_FLAG_FULLMESH (1 << 3)
84 #define MPTCP_PM_ADDR_FLAG_IMPLICIT (1 << 4)
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,
93   MPTCP_PM_CMD_SET_FLAGS,
94   MPTCP_PM_CMD_ANNOUNCE,
95   MPTCP_PM_CMD_REMOVE,
96   MPTCP_PM_CMD_SUBFLOW_CREATE,
97   MPTCP_PM_CMD_SUBFLOW_DESTROY,
98   __MPTCP_PM_CMD_AFTER_LAST
99 };
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;
114   __u8 mptcpi_local_addr_used;
115   __u8 mptcpi_local_addr_max;
116   __u8 mptcpi_csum_enabled;
117 };
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   MPTCP_EVENT_LISTENER_CREATED = 15,
129   MPTCP_EVENT_LISTENER_CLOSED = 16,
130 };
131 enum mptcp_event_attr {
132   MPTCP_ATTR_UNSPEC = 0,
133   MPTCP_ATTR_TOKEN,
134   MPTCP_ATTR_FAMILY,
135   MPTCP_ATTR_LOC_ID,
136   MPTCP_ATTR_REM_ID,
137   MPTCP_ATTR_SADDR4,
138   MPTCP_ATTR_SADDR6,
139   MPTCP_ATTR_DADDR4,
140   MPTCP_ATTR_DADDR6,
141   MPTCP_ATTR_SPORT,
142   MPTCP_ATTR_DPORT,
143   MPTCP_ATTR_BACKUP,
144   MPTCP_ATTR_ERROR,
145   MPTCP_ATTR_FLAGS,
146   MPTCP_ATTR_TIMEOUT,
147   MPTCP_ATTR_IF_IDX,
148   MPTCP_ATTR_RESET_REASON,
149   MPTCP_ATTR_RESET_FLAGS,
150   MPTCP_ATTR_SERVER_SIDE,
151   __MPTCP_ATTR_AFTER_LAST
152 };
153 #define MPTCP_ATTR_MAX (__MPTCP_ATTR_AFTER_LAST - 1)
154 #define MPTCP_RST_EUNSPEC 0
155 #define MPTCP_RST_EMPTCP 1
156 #define MPTCP_RST_ERESOURCE 2
157 #define MPTCP_RST_EPROHIBIT 3
158 #define MPTCP_RST_EWQ2BIG 4
159 #define MPTCP_RST_EBADPERF 5
160 #define MPTCP_RST_EMIDDLEBOX 6
161 struct mptcp_subflow_data {
162   __u32 size_subflow_data;
163   __u32 num_subflows;
164   __u32 size_kernel;
165   __u32 size_user;
166 } __attribute__((aligned(8)));
167 struct mptcp_subflow_addrs {
168   union {
169     __kernel_sa_family_t sa_family;
170     struct sockaddr sa_local;
171     struct sockaddr_in sin_local;
172     struct sockaddr_in6 sin6_local;
173     struct __kernel_sockaddr_storage ss_local;
174   };
175   union {
176     struct sockaddr sa_remote;
177     struct sockaddr_in sin_remote;
178     struct sockaddr_in6 sin6_remote;
179     struct __kernel_sockaddr_storage ss_remote;
180   };
181 };
182 #define MPTCP_INFO 1
183 #define MPTCP_TCPINFO 2
184 #define MPTCP_SUBFLOW_ADDRS 3
185 #endif
186