blob: 6ba738e0fa94b7b09842b204e195ae8f94140599 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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_SCTP_H
20#define _UAPI_SCTP_H
21#include <linux/types.h>
22#include <linux/socket.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023typedef __s32 sctp_assoc_t;
24#define SCTP_RTOINFO 0
25#define SCTP_ASSOCINFO 1
26#define SCTP_INITMSG 2
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define SCTP_NODELAY 3
28#define SCTP_AUTOCLOSE 4
29#define SCTP_SET_PEER_PRIMARY_ADDR 5
30#define SCTP_PRIMARY_ADDR 6
Ben Cheng655a7c02013-10-16 16:09:24 -070031#define SCTP_ADAPTATION_LAYER 7
32#define SCTP_DISABLE_FRAGMENTS 8
33#define SCTP_PEER_ADDR_PARAMS 9
34#define SCTP_DEFAULT_SEND_PARAM 10
Ben Cheng655a7c02013-10-16 16:09:24 -070035#define SCTP_EVENTS 11
36#define SCTP_I_WANT_MAPPED_V4_ADDR 12
37#define SCTP_MAXSEG 13
38#define SCTP_STATUS 14
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define SCTP_GET_PEER_ADDR_INFO 15
40#define SCTP_DELAYED_ACK_TIME 16
41#define SCTP_DELAYED_ACK SCTP_DELAYED_ACK_TIME
42#define SCTP_DELAYED_SACK SCTP_DELAYED_ACK_TIME
Ben Cheng655a7c02013-10-16 16:09:24 -070043#define SCTP_CONTEXT 17
44#define SCTP_FRAGMENT_INTERLEAVE 18
45#define SCTP_PARTIAL_DELIVERY_POINT 19
46#define SCTP_MAX_BURST 20
Ben Cheng655a7c02013-10-16 16:09:24 -070047#define SCTP_AUTH_CHUNK 21
48#define SCTP_HMAC_IDENT 22
49#define SCTP_AUTH_KEY 23
50#define SCTP_AUTH_ACTIVE_KEY 24
Ben Cheng655a7c02013-10-16 16:09:24 -070051#define SCTP_AUTH_DELETE_KEY 25
52#define SCTP_PEER_AUTH_CHUNKS 26
53#define SCTP_LOCAL_AUTH_CHUNKS 27
54#define SCTP_GET_ASSOC_NUMBER 28
Ben Cheng655a7c02013-10-16 16:09:24 -070055#define SCTP_GET_ASSOC_ID_LIST 29
56#define SCTP_AUTO_ASCONF 30
57#define SCTP_PEER_ADDR_THLDS 31
Christopher Ferris82d75042015-01-26 10:57:07 -080058#define SCTP_RECVRCVINFO 32
Christopher Ferris82d75042015-01-26 10:57:07 -080059#define SCTP_RECVNXTINFO 33
60#define SCTP_DEFAULT_SNDINFO 34
Christopher Ferris76a1d452018-06-27 14:12:29 -070061#define SCTP_AUTH_DEACTIVATE_KEY 35
Christopher Ferris9ce28842018-10-25 12:11:39 -070062#define SCTP_REUSE_PORT 36
Christopher Ferris82d75042015-01-26 10:57:07 -080063#define SCTP_SOCKOPT_BINDX_ADD 100
Ben Cheng655a7c02013-10-16 16:09:24 -070064#define SCTP_SOCKOPT_BINDX_REM 101
65#define SCTP_SOCKOPT_PEELOFF 102
66#define SCTP_SOCKOPT_CONNECTX_OLD 107
67#define SCTP_GET_PEER_ADDRS 108
Ben Cheng655a7c02013-10-16 16:09:24 -070068#define SCTP_GET_LOCAL_ADDRS 109
69#define SCTP_SOCKOPT_CONNECTX 110
70#define SCTP_SOCKOPT_CONNECTX3 111
71#define SCTP_GET_ASSOC_STATS 112
Christopher Ferris49f525c2016-12-12 14:55:36 -080072#define SCTP_PR_SUPPORTED 113
Christopher Ferris49f525c2016-12-12 14:55:36 -080073#define SCTP_DEFAULT_PRINFO 114
74#define SCTP_PR_ASSOC_STATUS 115
Christopher Ferris525ce912017-07-26 13:12:53 -070075#define SCTP_PR_STREAM_STATUS 116
76#define SCTP_RECONFIG_SUPPORTED 117
77#define SCTP_ENABLE_STREAM_RESET 118
78#define SCTP_RESET_STREAMS 119
79#define SCTP_RESET_ASSOC 120
80#define SCTP_ADD_STREAMS 121
Christopher Ferris1308ad32017-11-14 17:32:13 -080081#define SCTP_SOCKOPT_PEELOFF_FLAGS 122
Christopher Ferris934ec942018-01-31 15:29:16 -080082#define SCTP_STREAM_SCHEDULER 123
83#define SCTP_STREAM_SCHEDULER_VALUE 124
Christopher Ferris76a1d452018-06-27 14:12:29 -070084#define SCTP_INTERLEAVING_SUPPORTED 125
85#define SCTP_SENDMSG_CONNECT 126
Christopher Ferris49f525c2016-12-12 14:55:36 -080086#define SCTP_PR_SCTP_NONE 0x0000
87#define SCTP_PR_SCTP_TTL 0x0010
Christopher Ferris49f525c2016-12-12 14:55:36 -080088#define SCTP_PR_SCTP_RTX 0x0020
89#define SCTP_PR_SCTP_PRIO 0x0030
90#define SCTP_PR_SCTP_MAX SCTP_PR_SCTP_PRIO
91#define SCTP_PR_SCTP_MASK 0x0030
Christopher Ferris49f525c2016-12-12 14:55:36 -080092#define __SCTP_PR_INDEX(x) ((x >> 4) - 1)
93#define SCTP_PR_INDEX(x) __SCTP_PR_INDEX(SCTP_PR_SCTP_ ##x)
94#define SCTP_PR_POLICY(x) ((x) & SCTP_PR_SCTP_MASK)
95#define SCTP_PR_SET_POLICY(flags,x) do { flags &= ~SCTP_PR_SCTP_MASK; flags |= x; } while(0)
Christopher Ferris49f525c2016-12-12 14:55:36 -080096#define SCTP_PR_TTL_ENABLED(x) (SCTP_PR_POLICY(x) == SCTP_PR_SCTP_TTL)
97#define SCTP_PR_RTX_ENABLED(x) (SCTP_PR_POLICY(x) == SCTP_PR_SCTP_RTX)
98#define SCTP_PR_PRIO_ENABLED(x) (SCTP_PR_POLICY(x) == SCTP_PR_SCTP_PRIO)
Christopher Ferris525ce912017-07-26 13:12:53 -070099#define SCTP_ENABLE_RESET_STREAM_REQ 0x01
100#define SCTP_ENABLE_RESET_ASSOC_REQ 0x02
101#define SCTP_ENABLE_CHANGE_ASSOC_REQ 0x04
102#define SCTP_ENABLE_STRRESET_MASK 0x07
103#define SCTP_STREAM_RESET_INCOMING 0x01
104#define SCTP_STREAM_RESET_OUTGOING 0x02
Christopher Ferris82d75042015-01-26 10:57:07 -0800105enum sctp_msg_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800106 MSG_NOTIFICATION = 0x8000,
Christopher Ferris82d75042015-01-26 10:57:07 -0800107#define MSG_NOTIFICATION MSG_NOTIFICATION
108};
Ben Cheng655a7c02013-10-16 16:09:24 -0700109struct sctp_initmsg {
Tao Baod7db5942015-01-28 10:07:51 -0800110 __u16 sinit_num_ostreams;
111 __u16 sinit_max_instreams;
112 __u16 sinit_max_attempts;
113 __u16 sinit_max_init_timeo;
Ben Cheng655a7c02013-10-16 16:09:24 -0700114};
115struct sctp_sndrcvinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800116 __u16 sinfo_stream;
117 __u16 sinfo_ssn;
Tao Baod7db5942015-01-28 10:07:51 -0800118 __u16 sinfo_flags;
119 __u32 sinfo_ppid;
120 __u32 sinfo_context;
121 __u32 sinfo_timetolive;
Tao Baod7db5942015-01-28 10:07:51 -0800122 __u32 sinfo_tsn;
123 __u32 sinfo_cumtsn;
124 sctp_assoc_t sinfo_assoc_id;
Christopher Ferris82d75042015-01-26 10:57:07 -0800125};
Christopher Ferris82d75042015-01-26 10:57:07 -0800126struct sctp_sndinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800127 __u16 snd_sid;
128 __u16 snd_flags;
129 __u32 snd_ppid;
Tao Baod7db5942015-01-28 10:07:51 -0800130 __u32 snd_context;
131 sctp_assoc_t snd_assoc_id;
Christopher Ferris82d75042015-01-26 10:57:07 -0800132};
133struct sctp_rcvinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800134 __u16 rcv_sid;
135 __u16 rcv_ssn;
136 __u16 rcv_flags;
137 __u32 rcv_ppid;
Tao Baod7db5942015-01-28 10:07:51 -0800138 __u32 rcv_tsn;
139 __u32 rcv_cumtsn;
140 __u32 rcv_context;
141 sctp_assoc_t rcv_assoc_id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700142};
Christopher Ferris82d75042015-01-26 10:57:07 -0800143struct sctp_nxtinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800144 __u16 nxt_sid;
145 __u16 nxt_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800146 __u32 nxt_ppid;
147 __u32 nxt_length;
148 sctp_assoc_t nxt_assoc_id;
Christopher Ferris82d75042015-01-26 10:57:07 -0800149};
Christopher Ferris76a1d452018-06-27 14:12:29 -0700150struct sctp_prinfo {
151 __u16 pr_policy;
152 __u32 pr_value;
153};
154struct sctp_authinfo {
155 __u16 auth_keynumber;
156};
Christopher Ferris82d75042015-01-26 10:57:07 -0800157enum sctp_sinfo_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800158 SCTP_UNORDERED = (1 << 0),
159 SCTP_ADDR_OVER = (1 << 1),
160 SCTP_ABORT = (1 << 2),
Tao Baod7db5942015-01-28 10:07:51 -0800161 SCTP_SACK_IMMEDIATELY = (1 << 3),
Christopher Ferris76a1d452018-06-27 14:12:29 -0700162 SCTP_SENDALL = (1 << 6),
Christopher Ferris9ce28842018-10-25 12:11:39 -0700163 SCTP_PR_SCTP_ALL = (1 << 7),
Tao Baod7db5942015-01-28 10:07:51 -0800164 SCTP_NOTIFICATION = MSG_NOTIFICATION,
165 SCTP_EOF = MSG_FIN,
Ben Cheng655a7c02013-10-16 16:09:24 -0700166};
Ben Cheng655a7c02013-10-16 16:09:24 -0700167typedef union {
Tao Baod7db5942015-01-28 10:07:51 -0800168 __u8 raw;
169 struct sctp_initmsg init;
170 struct sctp_sndrcvinfo sndrcv;
Ben Cheng655a7c02013-10-16 16:09:24 -0700171} sctp_cmsg_data_t;
172typedef enum sctp_cmsg_type {
Tao Baod7db5942015-01-28 10:07:51 -0800173 SCTP_INIT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700174#define SCTP_INIT SCTP_INIT
Tao Baod7db5942015-01-28 10:07:51 -0800175 SCTP_SNDRCV,
Ben Cheng655a7c02013-10-16 16:09:24 -0700176#define SCTP_SNDRCV SCTP_SNDRCV
Tao Baod7db5942015-01-28 10:07:51 -0800177 SCTP_SNDINFO,
Christopher Ferris82d75042015-01-26 10:57:07 -0800178#define SCTP_SNDINFO SCTP_SNDINFO
Tao Baod7db5942015-01-28 10:07:51 -0800179 SCTP_RCVINFO,
Christopher Ferris82d75042015-01-26 10:57:07 -0800180#define SCTP_RCVINFO SCTP_RCVINFO
Tao Baod7db5942015-01-28 10:07:51 -0800181 SCTP_NXTINFO,
Christopher Ferris82d75042015-01-26 10:57:07 -0800182#define SCTP_NXTINFO SCTP_NXTINFO
Christopher Ferris76a1d452018-06-27 14:12:29 -0700183 SCTP_PRINFO,
184#define SCTP_PRINFO SCTP_PRINFO
185 SCTP_AUTHINFO,
186#define SCTP_AUTHINFO SCTP_AUTHINFO
187 SCTP_DSTADDRV4,
188#define SCTP_DSTADDRV4 SCTP_DSTADDRV4
189 SCTP_DSTADDRV6,
190#define SCTP_DSTADDRV6 SCTP_DSTADDRV6
Ben Cheng655a7c02013-10-16 16:09:24 -0700191} sctp_cmsg_t;
192struct sctp_assoc_change {
Tao Baod7db5942015-01-28 10:07:51 -0800193 __u16 sac_type;
194 __u16 sac_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800195 __u32 sac_length;
196 __u16 sac_state;
197 __u16 sac_error;
198 __u16 sac_outbound_streams;
Tao Baod7db5942015-01-28 10:07:51 -0800199 __u16 sac_inbound_streams;
200 sctp_assoc_t sac_assoc_id;
201 __u8 sac_info[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700202};
203enum sctp_sac_state {
Tao Baod7db5942015-01-28 10:07:51 -0800204 SCTP_COMM_UP,
205 SCTP_COMM_LOST,
206 SCTP_RESTART,
Tao Baod7db5942015-01-28 10:07:51 -0800207 SCTP_SHUTDOWN_COMP,
208 SCTP_CANT_STR_ASSOC,
Ben Cheng655a7c02013-10-16 16:09:24 -0700209};
210struct sctp_paddr_change {
Tao Baod7db5942015-01-28 10:07:51 -0800211 __u16 spc_type;
212 __u16 spc_flags;
213 __u32 spc_length;
214 struct sockaddr_storage spc_aaddr;
Tao Baod7db5942015-01-28 10:07:51 -0800215 int spc_state;
216 int spc_error;
217 sctp_assoc_t spc_assoc_id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700218} __attribute__((packed, aligned(4)));
219enum sctp_spc_state {
Tao Baod7db5942015-01-28 10:07:51 -0800220 SCTP_ADDR_AVAILABLE,
221 SCTP_ADDR_UNREACHABLE,
222 SCTP_ADDR_REMOVED,
Tao Baod7db5942015-01-28 10:07:51 -0800223 SCTP_ADDR_ADDED,
224 SCTP_ADDR_MADE_PRIM,
225 SCTP_ADDR_CONFIRMED,
Ben Cheng655a7c02013-10-16 16:09:24 -0700226};
227struct sctp_remote_error {
Tao Baod7db5942015-01-28 10:07:51 -0800228 __u16 sre_type;
229 __u16 sre_flags;
230 __u32 sre_length;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800231 __be16 sre_error;
Tao Baod7db5942015-01-28 10:07:51 -0800232 sctp_assoc_t sre_assoc_id;
233 __u8 sre_data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700234};
235struct sctp_send_failed {
Tao Baod7db5942015-01-28 10:07:51 -0800236 __u16 ssf_type;
237 __u16 ssf_flags;
238 __u32 ssf_length;
Tao Baod7db5942015-01-28 10:07:51 -0800239 __u32 ssf_error;
240 struct sctp_sndrcvinfo ssf_info;
241 sctp_assoc_t ssf_assoc_id;
242 __u8 ssf_data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700243};
244enum sctp_ssf_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800245 SCTP_DATA_UNSENT,
246 SCTP_DATA_SENT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700247};
248struct sctp_shutdown_event {
Tao Baod7db5942015-01-28 10:07:51 -0800249 __u16 sse_type;
250 __u16 sse_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800251 __u32 sse_length;
252 sctp_assoc_t sse_assoc_id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700253};
254struct sctp_adaptation_event {
Tao Baod7db5942015-01-28 10:07:51 -0800255 __u16 sai_type;
256 __u16 sai_flags;
257 __u32 sai_length;
258 __u32 sai_adaptation_ind;
Tao Baod7db5942015-01-28 10:07:51 -0800259 sctp_assoc_t sai_assoc_id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700260};
Ben Cheng655a7c02013-10-16 16:09:24 -0700261struct sctp_pdapi_event {
Tao Baod7db5942015-01-28 10:07:51 -0800262 __u16 pdapi_type;
Tao Baod7db5942015-01-28 10:07:51 -0800263 __u16 pdapi_flags;
264 __u32 pdapi_length;
265 __u32 pdapi_indication;
266 sctp_assoc_t pdapi_assoc_id;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700267 __u32 pdapi_stream;
268 __u32 pdapi_seq;
Ben Cheng655a7c02013-10-16 16:09:24 -0700269};
Tao Baod7db5942015-01-28 10:07:51 -0800270enum {
271 SCTP_PARTIAL_DELIVERY_ABORTED = 0,
272};
Ben Cheng655a7c02013-10-16 16:09:24 -0700273struct sctp_authkey_event {
Tao Baod7db5942015-01-28 10:07:51 -0800274 __u16 auth_type;
275 __u16 auth_flags;
276 __u32 auth_length;
Tao Baod7db5942015-01-28 10:07:51 -0800277 __u16 auth_keynumber;
278 __u16 auth_altkeynumber;
279 __u32 auth_indication;
280 sctp_assoc_t auth_assoc_id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700281};
Tao Baod7db5942015-01-28 10:07:51 -0800282enum {
Christopher Ferris76a1d452018-06-27 14:12:29 -0700283 SCTP_AUTH_NEW_KEY,
284#define SCTP_AUTH_NEWKEY SCTP_AUTH_NEW_KEY
285 SCTP_AUTH_FREE_KEY,
286 SCTP_AUTH_NO_AUTH,
Tao Baod7db5942015-01-28 10:07:51 -0800287};
Ben Cheng655a7c02013-10-16 16:09:24 -0700288struct sctp_sender_dry_event {
Tao Baod7db5942015-01-28 10:07:51 -0800289 __u16 sender_dry_type;
290 __u16 sender_dry_flags;
291 __u32 sender_dry_length;
Tao Baod7db5942015-01-28 10:07:51 -0800292 sctp_assoc_t sender_dry_assoc_id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700293};
Christopher Ferris525ce912017-07-26 13:12:53 -0700294#define SCTP_STREAM_RESET_INCOMING_SSN 0x0001
295#define SCTP_STREAM_RESET_OUTGOING_SSN 0x0002
296#define SCTP_STREAM_RESET_DENIED 0x0004
297#define SCTP_STREAM_RESET_FAILED 0x0008
298struct sctp_stream_reset_event {
299 __u16 strreset_type;
300 __u16 strreset_flags;
301 __u32 strreset_length;
302 sctp_assoc_t strreset_assoc_id;
303 __u16 strreset_stream_list[];
304};
305#define SCTP_ASSOC_RESET_DENIED 0x0004
306#define SCTP_ASSOC_RESET_FAILED 0x0008
307struct sctp_assoc_reset_event {
308 __u16 assocreset_type;
309 __u16 assocreset_flags;
310 __u32 assocreset_length;
311 sctp_assoc_t assocreset_assoc_id;
312 __u32 assocreset_local_tsn;
313 __u32 assocreset_remote_tsn;
314};
315#define SCTP_ASSOC_CHANGE_DENIED 0x0004
316#define SCTP_ASSOC_CHANGE_FAILED 0x0008
317struct sctp_stream_change_event {
318 __u16 strchange_type;
319 __u16 strchange_flags;
320 __u32 strchange_length;
321 sctp_assoc_t strchange_assoc_id;
322 __u16 strchange_instrms;
323 __u16 strchange_outstrms;
324};
Ben Cheng655a7c02013-10-16 16:09:24 -0700325struct sctp_event_subscribe {
Tao Baod7db5942015-01-28 10:07:51 -0800326 __u8 sctp_data_io_event;
Tao Baod7db5942015-01-28 10:07:51 -0800327 __u8 sctp_association_event;
328 __u8 sctp_address_event;
329 __u8 sctp_send_failure_event;
330 __u8 sctp_peer_error_event;
Tao Baod7db5942015-01-28 10:07:51 -0800331 __u8 sctp_shutdown_event;
332 __u8 sctp_partial_delivery_event;
333 __u8 sctp_adaptation_layer_event;
334 __u8 sctp_authentication_event;
Tao Baod7db5942015-01-28 10:07:51 -0800335 __u8 sctp_sender_dry_event;
Christopher Ferris525ce912017-07-26 13:12:53 -0700336 __u8 sctp_stream_reset_event;
337 __u8 sctp_assoc_reset_event;
338 __u8 sctp_stream_change_event;
Ben Cheng655a7c02013-10-16 16:09:24 -0700339};
Ben Cheng655a7c02013-10-16 16:09:24 -0700340union sctp_notification {
Tao Baod7db5942015-01-28 10:07:51 -0800341 struct {
Tao Baod7db5942015-01-28 10:07:51 -0800342 __u16 sn_type;
343 __u16 sn_flags;
344 __u32 sn_length;
345 } sn_header;
Tao Baod7db5942015-01-28 10:07:51 -0800346 struct sctp_assoc_change sn_assoc_change;
347 struct sctp_paddr_change sn_paddr_change;
348 struct sctp_remote_error sn_remote_error;
349 struct sctp_send_failed sn_send_failed;
Tao Baod7db5942015-01-28 10:07:51 -0800350 struct sctp_shutdown_event sn_shutdown_event;
351 struct sctp_adaptation_event sn_adaptation_event;
352 struct sctp_pdapi_event sn_pdapi_event;
353 struct sctp_authkey_event sn_authkey_event;
Tao Baod7db5942015-01-28 10:07:51 -0800354 struct sctp_sender_dry_event sn_sender_dry_event;
Christopher Ferris525ce912017-07-26 13:12:53 -0700355 struct sctp_stream_reset_event sn_strreset_event;
356 struct sctp_assoc_reset_event sn_assocreset_event;
357 struct sctp_stream_change_event sn_strchange_event;
Ben Cheng655a7c02013-10-16 16:09:24 -0700358};
Ben Cheng655a7c02013-10-16 16:09:24 -0700359enum sctp_sn_type {
Tao Baod7db5942015-01-28 10:07:51 -0800360 SCTP_SN_TYPE_BASE = (1 << 15),
Tao Baod7db5942015-01-28 10:07:51 -0800361 SCTP_ASSOC_CHANGE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700362#define SCTP_ASSOC_CHANGE SCTP_ASSOC_CHANGE
Tao Baod7db5942015-01-28 10:07:51 -0800363 SCTP_PEER_ADDR_CHANGE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700364#define SCTP_PEER_ADDR_CHANGE SCTP_PEER_ADDR_CHANGE
Tao Baod7db5942015-01-28 10:07:51 -0800365 SCTP_SEND_FAILED,
Ben Cheng655a7c02013-10-16 16:09:24 -0700366#define SCTP_SEND_FAILED SCTP_SEND_FAILED
Tao Baod7db5942015-01-28 10:07:51 -0800367 SCTP_REMOTE_ERROR,
Ben Cheng655a7c02013-10-16 16:09:24 -0700368#define SCTP_REMOTE_ERROR SCTP_REMOTE_ERROR
Tao Baod7db5942015-01-28 10:07:51 -0800369 SCTP_SHUTDOWN_EVENT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700370#define SCTP_SHUTDOWN_EVENT SCTP_SHUTDOWN_EVENT
Tao Baod7db5942015-01-28 10:07:51 -0800371 SCTP_PARTIAL_DELIVERY_EVENT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700372#define SCTP_PARTIAL_DELIVERY_EVENT SCTP_PARTIAL_DELIVERY_EVENT
Tao Baod7db5942015-01-28 10:07:51 -0800373 SCTP_ADAPTATION_INDICATION,
Ben Cheng655a7c02013-10-16 16:09:24 -0700374#define SCTP_ADAPTATION_INDICATION SCTP_ADAPTATION_INDICATION
Tao Baod7db5942015-01-28 10:07:51 -0800375 SCTP_AUTHENTICATION_EVENT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700376#define SCTP_AUTHENTICATION_INDICATION SCTP_AUTHENTICATION_EVENT
Tao Baod7db5942015-01-28 10:07:51 -0800377 SCTP_SENDER_DRY_EVENT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700378#define SCTP_SENDER_DRY_EVENT SCTP_SENDER_DRY_EVENT
Christopher Ferris525ce912017-07-26 13:12:53 -0700379 SCTP_STREAM_RESET_EVENT,
380#define SCTP_STREAM_RESET_EVENT SCTP_STREAM_RESET_EVENT
381 SCTP_ASSOC_RESET_EVENT,
382#define SCTP_ASSOC_RESET_EVENT SCTP_ASSOC_RESET_EVENT
383 SCTP_STREAM_CHANGE_EVENT,
384#define SCTP_STREAM_CHANGE_EVENT SCTP_STREAM_CHANGE_EVENT
Ben Cheng655a7c02013-10-16 16:09:24 -0700385};
386typedef enum sctp_sn_error {
Tao Baod7db5942015-01-28 10:07:51 -0800387 SCTP_FAILED_THRESHOLD,
388 SCTP_RECEIVED_SACK,
389 SCTP_HEARTBEAT_SUCCESS,
390 SCTP_RESPONSE_TO_USER_REQ,
Tao Baod7db5942015-01-28 10:07:51 -0800391 SCTP_INTERNAL_ERROR,
392 SCTP_SHUTDOWN_GUARD_EXPIRES,
393 SCTP_PEER_FAULTY,
Ben Cheng655a7c02013-10-16 16:09:24 -0700394} sctp_sn_error_t;
395struct sctp_rtoinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800396 sctp_assoc_t srto_assoc_id;
397 __u32 srto_initial;
398 __u32 srto_max;
Tao Baod7db5942015-01-28 10:07:51 -0800399 __u32 srto_min;
Ben Cheng655a7c02013-10-16 16:09:24 -0700400};
Ben Cheng655a7c02013-10-16 16:09:24 -0700401struct sctp_assocparams {
Tao Baod7db5942015-01-28 10:07:51 -0800402 sctp_assoc_t sasoc_assoc_id;
Tao Baod7db5942015-01-28 10:07:51 -0800403 __u16 sasoc_asocmaxrxt;
404 __u16 sasoc_number_peer_destinations;
405 __u32 sasoc_peer_rwnd;
406 __u32 sasoc_local_rwnd;
Tao Baod7db5942015-01-28 10:07:51 -0800407 __u32 sasoc_cookie_life;
Ben Cheng655a7c02013-10-16 16:09:24 -0700408};
Ben Cheng655a7c02013-10-16 16:09:24 -0700409struct sctp_setpeerprim {
Tao Baod7db5942015-01-28 10:07:51 -0800410 sctp_assoc_t sspp_assoc_id;
Tao Baod7db5942015-01-28 10:07:51 -0800411 struct sockaddr_storage sspp_addr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700412} __attribute__((packed, aligned(4)));
Ben Cheng655a7c02013-10-16 16:09:24 -0700413struct sctp_prim {
Tao Baod7db5942015-01-28 10:07:51 -0800414 sctp_assoc_t ssp_assoc_id;
Tao Baod7db5942015-01-28 10:07:51 -0800415 struct sockaddr_storage ssp_addr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700416} __attribute__((packed, aligned(4)));
Ben Cheng655a7c02013-10-16 16:09:24 -0700417#define sctp_setprim sctp_prim
418struct sctp_setadaptation {
Tao Baod7db5942015-01-28 10:07:51 -0800419 __u32 ssb_adaptation_ind;
Ben Cheng655a7c02013-10-16 16:09:24 -0700420};
Ben Cheng655a7c02013-10-16 16:09:24 -0700421enum sctp_spp_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800422 SPP_HB_ENABLE = 1 << 0,
Tao Baod7db5942015-01-28 10:07:51 -0800423 SPP_HB_DISABLE = 1 << 1,
424 SPP_HB = SPP_HB_ENABLE | SPP_HB_DISABLE,
425 SPP_HB_DEMAND = 1 << 2,
426 SPP_PMTUD_ENABLE = 1 << 3,
Tao Baod7db5942015-01-28 10:07:51 -0800427 SPP_PMTUD_DISABLE = 1 << 4,
428 SPP_PMTUD = SPP_PMTUD_ENABLE | SPP_PMTUD_DISABLE,
429 SPP_SACKDELAY_ENABLE = 1 << 5,
430 SPP_SACKDELAY_DISABLE = 1 << 6,
Tao Baod7db5942015-01-28 10:07:51 -0800431 SPP_SACKDELAY = SPP_SACKDELAY_ENABLE | SPP_SACKDELAY_DISABLE,
432 SPP_HB_TIME_IS_ZERO = 1 << 7,
Christopher Ferris9ce28842018-10-25 12:11:39 -0700433 SPP_IPV6_FLOWLABEL = 1 << 8,
434 SPP_DSCP = 1 << 9,
Ben Cheng655a7c02013-10-16 16:09:24 -0700435};
436struct sctp_paddrparams {
Tao Baod7db5942015-01-28 10:07:51 -0800437 sctp_assoc_t spp_assoc_id;
438 struct sockaddr_storage spp_address;
439 __u32 spp_hbinterval;
440 __u16 spp_pathmaxrxt;
Tao Baod7db5942015-01-28 10:07:51 -0800441 __u32 spp_pathmtu;
442 __u32 spp_sackdelay;
443 __u32 spp_flags;
Christopher Ferris9ce28842018-10-25 12:11:39 -0700444 __u32 spp_ipv6_flowlabel;
445 __u8 spp_dscp;
Ben Cheng655a7c02013-10-16 16:09:24 -0700446} __attribute__((packed, aligned(4)));
447struct sctp_authchunk {
Tao Baod7db5942015-01-28 10:07:51 -0800448 __u8 sauth_chunk;
Ben Cheng655a7c02013-10-16 16:09:24 -0700449};
450enum {
Tao Baod7db5942015-01-28 10:07:51 -0800451 SCTP_AUTH_HMAC_ID_SHA1 = 1,
452 SCTP_AUTH_HMAC_ID_SHA256 = 3,
Ben Cheng655a7c02013-10-16 16:09:24 -0700453};
454struct sctp_hmacalgo {
Tao Baod7db5942015-01-28 10:07:51 -0800455 __u32 shmac_num_idents;
456 __u16 shmac_idents[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700457};
458#define shmac_number_of_idents shmac_num_idents
459struct sctp_authkey {
Tao Baod7db5942015-01-28 10:07:51 -0800460 sctp_assoc_t sca_assoc_id;
461 __u16 sca_keynumber;
462 __u16 sca_keylength;
Tao Baod7db5942015-01-28 10:07:51 -0800463 __u8 sca_key[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700464};
Ben Cheng655a7c02013-10-16 16:09:24 -0700465struct sctp_authkeyid {
Tao Baod7db5942015-01-28 10:07:51 -0800466 sctp_assoc_t scact_assoc_id;
Tao Baod7db5942015-01-28 10:07:51 -0800467 __u16 scact_keynumber;
Ben Cheng655a7c02013-10-16 16:09:24 -0700468};
Ben Cheng655a7c02013-10-16 16:09:24 -0700469struct sctp_sack_info {
Tao Baod7db5942015-01-28 10:07:51 -0800470 sctp_assoc_t sack_assoc_id;
Tao Baod7db5942015-01-28 10:07:51 -0800471 uint32_t sack_delay;
472 uint32_t sack_freq;
Ben Cheng655a7c02013-10-16 16:09:24 -0700473};
474struct sctp_assoc_value {
Tao Baod7db5942015-01-28 10:07:51 -0800475 sctp_assoc_t assoc_id;
476 uint32_t assoc_value;
Ben Cheng655a7c02013-10-16 16:09:24 -0700477};
Christopher Ferris934ec942018-01-31 15:29:16 -0800478struct sctp_stream_value {
479 sctp_assoc_t assoc_id;
480 uint16_t stream_id;
481 uint16_t stream_value;
482};
Ben Cheng655a7c02013-10-16 16:09:24 -0700483struct sctp_paddrinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800484 sctp_assoc_t spinfo_assoc_id;
485 struct sockaddr_storage spinfo_address;
486 __s32 spinfo_state;
487 __u32 spinfo_cwnd;
Tao Baod7db5942015-01-28 10:07:51 -0800488 __u32 spinfo_srtt;
489 __u32 spinfo_rto;
490 __u32 spinfo_mtu;
Ben Cheng655a7c02013-10-16 16:09:24 -0700491} __attribute__((packed, aligned(4)));
492enum sctp_spinfo_state {
Tao Baod7db5942015-01-28 10:07:51 -0800493 SCTP_INACTIVE,
494 SCTP_PF,
495 SCTP_ACTIVE,
Tao Baod7db5942015-01-28 10:07:51 -0800496 SCTP_UNCONFIRMED,
497 SCTP_UNKNOWN = 0xffff
Ben Cheng655a7c02013-10-16 16:09:24 -0700498};
499struct sctp_status {
Tao Baod7db5942015-01-28 10:07:51 -0800500 sctp_assoc_t sstat_assoc_id;
501 __s32 sstat_state;
502 __u32 sstat_rwnd;
503 __u16 sstat_unackdata;
Tao Baod7db5942015-01-28 10:07:51 -0800504 __u16 sstat_penddata;
505 __u16 sstat_instrms;
506 __u16 sstat_outstrms;
507 __u32 sstat_fragmentation_point;
Tao Baod7db5942015-01-28 10:07:51 -0800508 struct sctp_paddrinfo sstat_primary;
Ben Cheng655a7c02013-10-16 16:09:24 -0700509};
Ben Cheng655a7c02013-10-16 16:09:24 -0700510struct sctp_authchunks {
Tao Baod7db5942015-01-28 10:07:51 -0800511 sctp_assoc_t gauth_assoc_id;
Tao Baod7db5942015-01-28 10:07:51 -0800512 __u32 gauth_number_of_chunks;
513 uint8_t gauth_chunks[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700514};
515#define guth_number_of_chunks gauth_number_of_chunks
516enum sctp_sstat_state {
Tao Baod7db5942015-01-28 10:07:51 -0800517 SCTP_EMPTY = 0,
518 SCTP_CLOSED = 1,
519 SCTP_COOKIE_WAIT = 2,
Tao Baod7db5942015-01-28 10:07:51 -0800520 SCTP_COOKIE_ECHOED = 3,
521 SCTP_ESTABLISHED = 4,
522 SCTP_SHUTDOWN_PENDING = 5,
523 SCTP_SHUTDOWN_SENT = 6,
Tao Baod7db5942015-01-28 10:07:51 -0800524 SCTP_SHUTDOWN_RECEIVED = 7,
525 SCTP_SHUTDOWN_ACK_SENT = 8,
Ben Cheng655a7c02013-10-16 16:09:24 -0700526};
527struct sctp_assoc_ids {
Tao Baod7db5942015-01-28 10:07:51 -0800528 __u32 gaids_number_of_ids;
529 sctp_assoc_t gaids_assoc_id[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700530};
531struct sctp_getaddrs_old {
Tao Baod7db5942015-01-28 10:07:51 -0800532 sctp_assoc_t assoc_id;
533 int addr_num;
534 struct sockaddr * addrs;
Ben Cheng655a7c02013-10-16 16:09:24 -0700535};
536struct sctp_getaddrs {
Tao Baod7db5942015-01-28 10:07:51 -0800537 sctp_assoc_t assoc_id;
538 __u32 addr_num;
539 __u8 addrs[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700540};
541struct sctp_assoc_stats {
Tao Baod7db5942015-01-28 10:07:51 -0800542 sctp_assoc_t sas_assoc_id;
543 struct sockaddr_storage sas_obs_rto_ipaddr;
Tao Baod7db5942015-01-28 10:07:51 -0800544 __u64 sas_maxrto;
545 __u64 sas_isacks;
546 __u64 sas_osacks;
547 __u64 sas_opackets;
Tao Baod7db5942015-01-28 10:07:51 -0800548 __u64 sas_ipackets;
549 __u64 sas_rtxchunks;
550 __u64 sas_outofseqtsns;
551 __u64 sas_idupchunks;
Tao Baod7db5942015-01-28 10:07:51 -0800552 __u64 sas_gapcnt;
553 __u64 sas_ouodchunks;
554 __u64 sas_iuodchunks;
555 __u64 sas_oodchunks;
Tao Baod7db5942015-01-28 10:07:51 -0800556 __u64 sas_iodchunks;
557 __u64 sas_octrlchunks;
558 __u64 sas_ictrlchunks;
Ben Cheng655a7c02013-10-16 16:09:24 -0700559};
Ben Cheng655a7c02013-10-16 16:09:24 -0700560#define SCTP_BINDX_ADD_ADDR 0x01
561#define SCTP_BINDX_REM_ADDR 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700562typedef struct {
Tao Baod7db5942015-01-28 10:07:51 -0800563 sctp_assoc_t associd;
Tao Baod7db5942015-01-28 10:07:51 -0800564 int sd;
Ben Cheng655a7c02013-10-16 16:09:24 -0700565} sctp_peeloff_arg_t;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800566typedef struct {
567 sctp_peeloff_arg_t p_arg;
568 unsigned flags;
569} sctp_peeloff_flags_arg_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700570struct sctp_paddrthlds {
Tao Baod7db5942015-01-28 10:07:51 -0800571 sctp_assoc_t spt_assoc_id;
Tao Baod7db5942015-01-28 10:07:51 -0800572 struct sockaddr_storage spt_address;
573 __u16 spt_pathmaxrxt;
574 __u16 spt_pathpfthld;
Ben Cheng655a7c02013-10-16 16:09:24 -0700575};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800576struct sctp_prstatus {
577 sctp_assoc_t sprstat_assoc_id;
578 __u16 sprstat_sid;
579 __u16 sprstat_policy;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800580 __u64 sprstat_abandoned_unsent;
581 __u64 sprstat_abandoned_sent;
582};
583struct sctp_default_prinfo {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800584 sctp_assoc_t pr_assoc_id;
585 __u32 pr_value;
586 __u16 pr_policy;
587};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800588struct sctp_info {
589 __u32 sctpi_tag;
590 __u32 sctpi_state;
591 __u32 sctpi_rwnd;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800592 __u16 sctpi_unackdata;
593 __u16 sctpi_penddata;
594 __u16 sctpi_instrms;
595 __u16 sctpi_outstrms;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800596 __u32 sctpi_fragmentation_point;
597 __u32 sctpi_inqueue;
598 __u32 sctpi_outqueue;
599 __u32 sctpi_overall_error;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800600 __u32 sctpi_max_burst;
601 __u32 sctpi_maxseg;
602 __u32 sctpi_peer_rwnd;
603 __u32 sctpi_peer_tag;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800604 __u8 sctpi_peer_capable;
605 __u8 sctpi_peer_sack;
606 __u16 __reserved1;
607 __u64 sctpi_isacks;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800608 __u64 sctpi_osacks;
609 __u64 sctpi_opackets;
610 __u64 sctpi_ipackets;
611 __u64 sctpi_rtxchunks;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800612 __u64 sctpi_outofseqtsns;
613 __u64 sctpi_idupchunks;
614 __u64 sctpi_gapcnt;
615 __u64 sctpi_ouodchunks;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800616 __u64 sctpi_iuodchunks;
617 __u64 sctpi_oodchunks;
618 __u64 sctpi_iodchunks;
619 __u64 sctpi_octrlchunks;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800620 __u64 sctpi_ictrlchunks;
621 struct sockaddr_storage sctpi_p_address;
622 __s32 sctpi_p_state;
623 __u32 sctpi_p_cwnd;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800624 __u32 sctpi_p_srtt;
625 __u32 sctpi_p_rto;
626 __u32 sctpi_p_hbinterval;
627 __u32 sctpi_p_pathmaxrxt;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800628 __u32 sctpi_p_sackdelay;
629 __u32 sctpi_p_sackfreq;
630 __u32 sctpi_p_ssthresh;
631 __u32 sctpi_p_partial_bytes_acked;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800632 __u32 sctpi_p_flight_size;
633 __u16 sctpi_p_error;
634 __u16 __reserved2;
635 __u32 sctpi_s_autoclose;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800636 __u32 sctpi_s_adaptation_ind;
637 __u32 sctpi_s_pd_point;
638 __u8 sctpi_s_nodelay;
639 __u8 sctpi_s_disable_fragments;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800640 __u8 sctpi_s_v4mapped;
641 __u8 sctpi_s_frag_interleave;
642 __u32 sctpi_s_type;
643 __u32 __reserved3;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800644};
Christopher Ferris525ce912017-07-26 13:12:53 -0700645struct sctp_reset_streams {
646 sctp_assoc_t srs_assoc_id;
647 uint16_t srs_flags;
648 uint16_t srs_number_streams;
649 uint16_t srs_stream_list[];
650};
651struct sctp_add_streams {
652 sctp_assoc_t sas_assoc_id;
653 uint16_t sas_instrms;
654 uint16_t sas_outstrms;
655};
Christopher Ferris934ec942018-01-31 15:29:16 -0800656enum sctp_sched_type {
657 SCTP_SS_FCFS,
658 SCTP_SS_PRIO,
659 SCTP_SS_RR,
660 SCTP_SS_MAX = SCTP_SS_RR
661};
Ben Cheng655a7c02013-10-16 16:09:24 -0700662#endif