blob: 9a55459b2f3ec32acd1e50c42971540f46517e73 [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
61#define SCTP_SOCKOPT_BINDX_ADD 100
Ben Cheng655a7c02013-10-16 16:09:24 -070062#define SCTP_SOCKOPT_BINDX_REM 101
63#define SCTP_SOCKOPT_PEELOFF 102
64#define SCTP_SOCKOPT_CONNECTX_OLD 107
65#define SCTP_GET_PEER_ADDRS 108
Ben Cheng655a7c02013-10-16 16:09:24 -070066#define SCTP_GET_LOCAL_ADDRS 109
67#define SCTP_SOCKOPT_CONNECTX 110
68#define SCTP_SOCKOPT_CONNECTX3 111
69#define SCTP_GET_ASSOC_STATS 112
Christopher Ferris49f525c2016-12-12 14:55:36 -080070#define SCTP_PR_SUPPORTED 113
Christopher Ferris49f525c2016-12-12 14:55:36 -080071#define SCTP_DEFAULT_PRINFO 114
72#define SCTP_PR_ASSOC_STATUS 115
Christopher Ferris525ce912017-07-26 13:12:53 -070073#define SCTP_PR_STREAM_STATUS 116
74#define SCTP_RECONFIG_SUPPORTED 117
75#define SCTP_ENABLE_STREAM_RESET 118
76#define SCTP_RESET_STREAMS 119
77#define SCTP_RESET_ASSOC 120
78#define SCTP_ADD_STREAMS 121
Christopher Ferris1308ad32017-11-14 17:32:13 -080079#define SCTP_SOCKOPT_PEELOFF_FLAGS 122
Christopher Ferris49f525c2016-12-12 14:55:36 -080080#define SCTP_PR_SCTP_NONE 0x0000
81#define SCTP_PR_SCTP_TTL 0x0010
Christopher Ferris49f525c2016-12-12 14:55:36 -080082#define SCTP_PR_SCTP_RTX 0x0020
83#define SCTP_PR_SCTP_PRIO 0x0030
84#define SCTP_PR_SCTP_MAX SCTP_PR_SCTP_PRIO
85#define SCTP_PR_SCTP_MASK 0x0030
Christopher Ferris49f525c2016-12-12 14:55:36 -080086#define __SCTP_PR_INDEX(x) ((x >> 4) - 1)
87#define SCTP_PR_INDEX(x) __SCTP_PR_INDEX(SCTP_PR_SCTP_ ##x)
88#define SCTP_PR_POLICY(x) ((x) & SCTP_PR_SCTP_MASK)
89#define SCTP_PR_SET_POLICY(flags,x) do { flags &= ~SCTP_PR_SCTP_MASK; flags |= x; } while(0)
Christopher Ferris49f525c2016-12-12 14:55:36 -080090#define SCTP_PR_TTL_ENABLED(x) (SCTP_PR_POLICY(x) == SCTP_PR_SCTP_TTL)
91#define SCTP_PR_RTX_ENABLED(x) (SCTP_PR_POLICY(x) == SCTP_PR_SCTP_RTX)
92#define SCTP_PR_PRIO_ENABLED(x) (SCTP_PR_POLICY(x) == SCTP_PR_SCTP_PRIO)
Christopher Ferris525ce912017-07-26 13:12:53 -070093#define SCTP_ENABLE_RESET_STREAM_REQ 0x01
94#define SCTP_ENABLE_RESET_ASSOC_REQ 0x02
95#define SCTP_ENABLE_CHANGE_ASSOC_REQ 0x04
96#define SCTP_ENABLE_STRRESET_MASK 0x07
97#define SCTP_STREAM_RESET_INCOMING 0x01
98#define SCTP_STREAM_RESET_OUTGOING 0x02
Christopher Ferris82d75042015-01-26 10:57:07 -080099enum sctp_msg_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800100 MSG_NOTIFICATION = 0x8000,
Christopher Ferris82d75042015-01-26 10:57:07 -0800101#define MSG_NOTIFICATION MSG_NOTIFICATION
102};
Ben Cheng655a7c02013-10-16 16:09:24 -0700103struct sctp_initmsg {
Tao Baod7db5942015-01-28 10:07:51 -0800104 __u16 sinit_num_ostreams;
105 __u16 sinit_max_instreams;
106 __u16 sinit_max_attempts;
107 __u16 sinit_max_init_timeo;
Ben Cheng655a7c02013-10-16 16:09:24 -0700108};
109struct sctp_sndrcvinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800110 __u16 sinfo_stream;
111 __u16 sinfo_ssn;
Tao Baod7db5942015-01-28 10:07:51 -0800112 __u16 sinfo_flags;
113 __u32 sinfo_ppid;
114 __u32 sinfo_context;
115 __u32 sinfo_timetolive;
Tao Baod7db5942015-01-28 10:07:51 -0800116 __u32 sinfo_tsn;
117 __u32 sinfo_cumtsn;
118 sctp_assoc_t sinfo_assoc_id;
Christopher Ferris82d75042015-01-26 10:57:07 -0800119};
Christopher Ferris82d75042015-01-26 10:57:07 -0800120struct sctp_sndinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800121 __u16 snd_sid;
122 __u16 snd_flags;
123 __u32 snd_ppid;
Tao Baod7db5942015-01-28 10:07:51 -0800124 __u32 snd_context;
125 sctp_assoc_t snd_assoc_id;
Christopher Ferris82d75042015-01-26 10:57:07 -0800126};
127struct sctp_rcvinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800128 __u16 rcv_sid;
129 __u16 rcv_ssn;
130 __u16 rcv_flags;
131 __u32 rcv_ppid;
Tao Baod7db5942015-01-28 10:07:51 -0800132 __u32 rcv_tsn;
133 __u32 rcv_cumtsn;
134 __u32 rcv_context;
135 sctp_assoc_t rcv_assoc_id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700136};
Christopher Ferris82d75042015-01-26 10:57:07 -0800137struct sctp_nxtinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800138 __u16 nxt_sid;
139 __u16 nxt_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800140 __u32 nxt_ppid;
141 __u32 nxt_length;
142 sctp_assoc_t nxt_assoc_id;
Christopher Ferris82d75042015-01-26 10:57:07 -0800143};
Christopher Ferris82d75042015-01-26 10:57:07 -0800144enum sctp_sinfo_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800145 SCTP_UNORDERED = (1 << 0),
146 SCTP_ADDR_OVER = (1 << 1),
147 SCTP_ABORT = (1 << 2),
Tao Baod7db5942015-01-28 10:07:51 -0800148 SCTP_SACK_IMMEDIATELY = (1 << 3),
149 SCTP_NOTIFICATION = MSG_NOTIFICATION,
150 SCTP_EOF = MSG_FIN,
Ben Cheng655a7c02013-10-16 16:09:24 -0700151};
Ben Cheng655a7c02013-10-16 16:09:24 -0700152typedef union {
Tao Baod7db5942015-01-28 10:07:51 -0800153 __u8 raw;
154 struct sctp_initmsg init;
155 struct sctp_sndrcvinfo sndrcv;
Ben Cheng655a7c02013-10-16 16:09:24 -0700156} sctp_cmsg_data_t;
157typedef enum sctp_cmsg_type {
Tao Baod7db5942015-01-28 10:07:51 -0800158 SCTP_INIT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700159#define SCTP_INIT SCTP_INIT
Tao Baod7db5942015-01-28 10:07:51 -0800160 SCTP_SNDRCV,
Ben Cheng655a7c02013-10-16 16:09:24 -0700161#define SCTP_SNDRCV SCTP_SNDRCV
Tao Baod7db5942015-01-28 10:07:51 -0800162 SCTP_SNDINFO,
Christopher Ferris82d75042015-01-26 10:57:07 -0800163#define SCTP_SNDINFO SCTP_SNDINFO
Tao Baod7db5942015-01-28 10:07:51 -0800164 SCTP_RCVINFO,
Christopher Ferris82d75042015-01-26 10:57:07 -0800165#define SCTP_RCVINFO SCTP_RCVINFO
Tao Baod7db5942015-01-28 10:07:51 -0800166 SCTP_NXTINFO,
Christopher Ferris82d75042015-01-26 10:57:07 -0800167#define SCTP_NXTINFO SCTP_NXTINFO
Ben Cheng655a7c02013-10-16 16:09:24 -0700168} sctp_cmsg_t;
169struct sctp_assoc_change {
Tao Baod7db5942015-01-28 10:07:51 -0800170 __u16 sac_type;
171 __u16 sac_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800172 __u32 sac_length;
173 __u16 sac_state;
174 __u16 sac_error;
175 __u16 sac_outbound_streams;
Tao Baod7db5942015-01-28 10:07:51 -0800176 __u16 sac_inbound_streams;
177 sctp_assoc_t sac_assoc_id;
178 __u8 sac_info[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700179};
180enum sctp_sac_state {
Tao Baod7db5942015-01-28 10:07:51 -0800181 SCTP_COMM_UP,
182 SCTP_COMM_LOST,
183 SCTP_RESTART,
Tao Baod7db5942015-01-28 10:07:51 -0800184 SCTP_SHUTDOWN_COMP,
185 SCTP_CANT_STR_ASSOC,
Ben Cheng655a7c02013-10-16 16:09:24 -0700186};
187struct sctp_paddr_change {
Tao Baod7db5942015-01-28 10:07:51 -0800188 __u16 spc_type;
189 __u16 spc_flags;
190 __u32 spc_length;
191 struct sockaddr_storage spc_aaddr;
Tao Baod7db5942015-01-28 10:07:51 -0800192 int spc_state;
193 int spc_error;
194 sctp_assoc_t spc_assoc_id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700195} __attribute__((packed, aligned(4)));
196enum sctp_spc_state {
Tao Baod7db5942015-01-28 10:07:51 -0800197 SCTP_ADDR_AVAILABLE,
198 SCTP_ADDR_UNREACHABLE,
199 SCTP_ADDR_REMOVED,
Tao Baod7db5942015-01-28 10:07:51 -0800200 SCTP_ADDR_ADDED,
201 SCTP_ADDR_MADE_PRIM,
202 SCTP_ADDR_CONFIRMED,
Ben Cheng655a7c02013-10-16 16:09:24 -0700203};
204struct sctp_remote_error {
Tao Baod7db5942015-01-28 10:07:51 -0800205 __u16 sre_type;
206 __u16 sre_flags;
207 __u32 sre_length;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800208 __be16 sre_error;
Tao Baod7db5942015-01-28 10:07:51 -0800209 sctp_assoc_t sre_assoc_id;
210 __u8 sre_data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700211};
212struct sctp_send_failed {
Tao Baod7db5942015-01-28 10:07:51 -0800213 __u16 ssf_type;
214 __u16 ssf_flags;
215 __u32 ssf_length;
Tao Baod7db5942015-01-28 10:07:51 -0800216 __u32 ssf_error;
217 struct sctp_sndrcvinfo ssf_info;
218 sctp_assoc_t ssf_assoc_id;
219 __u8 ssf_data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700220};
221enum sctp_ssf_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800222 SCTP_DATA_UNSENT,
223 SCTP_DATA_SENT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700224};
225struct sctp_shutdown_event {
Tao Baod7db5942015-01-28 10:07:51 -0800226 __u16 sse_type;
227 __u16 sse_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800228 __u32 sse_length;
229 sctp_assoc_t sse_assoc_id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700230};
231struct sctp_adaptation_event {
Tao Baod7db5942015-01-28 10:07:51 -0800232 __u16 sai_type;
233 __u16 sai_flags;
234 __u32 sai_length;
235 __u32 sai_adaptation_ind;
Tao Baod7db5942015-01-28 10:07:51 -0800236 sctp_assoc_t sai_assoc_id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700237};
Ben Cheng655a7c02013-10-16 16:09:24 -0700238struct sctp_pdapi_event {
Tao Baod7db5942015-01-28 10:07:51 -0800239 __u16 pdapi_type;
Tao Baod7db5942015-01-28 10:07:51 -0800240 __u16 pdapi_flags;
241 __u32 pdapi_length;
242 __u32 pdapi_indication;
243 sctp_assoc_t pdapi_assoc_id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700244};
Tao Baod7db5942015-01-28 10:07:51 -0800245enum {
246 SCTP_PARTIAL_DELIVERY_ABORTED = 0,
247};
Ben Cheng655a7c02013-10-16 16:09:24 -0700248struct sctp_authkey_event {
Tao Baod7db5942015-01-28 10:07:51 -0800249 __u16 auth_type;
250 __u16 auth_flags;
251 __u32 auth_length;
Tao Baod7db5942015-01-28 10:07:51 -0800252 __u16 auth_keynumber;
253 __u16 auth_altkeynumber;
254 __u32 auth_indication;
255 sctp_assoc_t auth_assoc_id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700256};
Tao Baod7db5942015-01-28 10:07:51 -0800257enum {
258 SCTP_AUTH_NEWKEY = 0,
259};
Ben Cheng655a7c02013-10-16 16:09:24 -0700260struct sctp_sender_dry_event {
Tao Baod7db5942015-01-28 10:07:51 -0800261 __u16 sender_dry_type;
262 __u16 sender_dry_flags;
263 __u32 sender_dry_length;
Tao Baod7db5942015-01-28 10:07:51 -0800264 sctp_assoc_t sender_dry_assoc_id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700265};
Christopher Ferris525ce912017-07-26 13:12:53 -0700266#define SCTP_STREAM_RESET_INCOMING_SSN 0x0001
267#define SCTP_STREAM_RESET_OUTGOING_SSN 0x0002
268#define SCTP_STREAM_RESET_DENIED 0x0004
269#define SCTP_STREAM_RESET_FAILED 0x0008
270struct sctp_stream_reset_event {
271 __u16 strreset_type;
272 __u16 strreset_flags;
273 __u32 strreset_length;
274 sctp_assoc_t strreset_assoc_id;
275 __u16 strreset_stream_list[];
276};
277#define SCTP_ASSOC_RESET_DENIED 0x0004
278#define SCTP_ASSOC_RESET_FAILED 0x0008
279struct sctp_assoc_reset_event {
280 __u16 assocreset_type;
281 __u16 assocreset_flags;
282 __u32 assocreset_length;
283 sctp_assoc_t assocreset_assoc_id;
284 __u32 assocreset_local_tsn;
285 __u32 assocreset_remote_tsn;
286};
287#define SCTP_ASSOC_CHANGE_DENIED 0x0004
288#define SCTP_ASSOC_CHANGE_FAILED 0x0008
289struct sctp_stream_change_event {
290 __u16 strchange_type;
291 __u16 strchange_flags;
292 __u32 strchange_length;
293 sctp_assoc_t strchange_assoc_id;
294 __u16 strchange_instrms;
295 __u16 strchange_outstrms;
296};
Ben Cheng655a7c02013-10-16 16:09:24 -0700297struct sctp_event_subscribe {
Tao Baod7db5942015-01-28 10:07:51 -0800298 __u8 sctp_data_io_event;
Tao Baod7db5942015-01-28 10:07:51 -0800299 __u8 sctp_association_event;
300 __u8 sctp_address_event;
301 __u8 sctp_send_failure_event;
302 __u8 sctp_peer_error_event;
Tao Baod7db5942015-01-28 10:07:51 -0800303 __u8 sctp_shutdown_event;
304 __u8 sctp_partial_delivery_event;
305 __u8 sctp_adaptation_layer_event;
306 __u8 sctp_authentication_event;
Tao Baod7db5942015-01-28 10:07:51 -0800307 __u8 sctp_sender_dry_event;
Christopher Ferris525ce912017-07-26 13:12:53 -0700308 __u8 sctp_stream_reset_event;
309 __u8 sctp_assoc_reset_event;
310 __u8 sctp_stream_change_event;
Ben Cheng655a7c02013-10-16 16:09:24 -0700311};
Ben Cheng655a7c02013-10-16 16:09:24 -0700312union sctp_notification {
Tao Baod7db5942015-01-28 10:07:51 -0800313 struct {
Tao Baod7db5942015-01-28 10:07:51 -0800314 __u16 sn_type;
315 __u16 sn_flags;
316 __u32 sn_length;
317 } sn_header;
Tao Baod7db5942015-01-28 10:07:51 -0800318 struct sctp_assoc_change sn_assoc_change;
319 struct sctp_paddr_change sn_paddr_change;
320 struct sctp_remote_error sn_remote_error;
321 struct sctp_send_failed sn_send_failed;
Tao Baod7db5942015-01-28 10:07:51 -0800322 struct sctp_shutdown_event sn_shutdown_event;
323 struct sctp_adaptation_event sn_adaptation_event;
324 struct sctp_pdapi_event sn_pdapi_event;
325 struct sctp_authkey_event sn_authkey_event;
Tao Baod7db5942015-01-28 10:07:51 -0800326 struct sctp_sender_dry_event sn_sender_dry_event;
Christopher Ferris525ce912017-07-26 13:12:53 -0700327 struct sctp_stream_reset_event sn_strreset_event;
328 struct sctp_assoc_reset_event sn_assocreset_event;
329 struct sctp_stream_change_event sn_strchange_event;
Ben Cheng655a7c02013-10-16 16:09:24 -0700330};
Ben Cheng655a7c02013-10-16 16:09:24 -0700331enum sctp_sn_type {
Tao Baod7db5942015-01-28 10:07:51 -0800332 SCTP_SN_TYPE_BASE = (1 << 15),
Tao Baod7db5942015-01-28 10:07:51 -0800333 SCTP_ASSOC_CHANGE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700334#define SCTP_ASSOC_CHANGE SCTP_ASSOC_CHANGE
Tao Baod7db5942015-01-28 10:07:51 -0800335 SCTP_PEER_ADDR_CHANGE,
Ben Cheng655a7c02013-10-16 16:09:24 -0700336#define SCTP_PEER_ADDR_CHANGE SCTP_PEER_ADDR_CHANGE
Tao Baod7db5942015-01-28 10:07:51 -0800337 SCTP_SEND_FAILED,
Ben Cheng655a7c02013-10-16 16:09:24 -0700338#define SCTP_SEND_FAILED SCTP_SEND_FAILED
Tao Baod7db5942015-01-28 10:07:51 -0800339 SCTP_REMOTE_ERROR,
Ben Cheng655a7c02013-10-16 16:09:24 -0700340#define SCTP_REMOTE_ERROR SCTP_REMOTE_ERROR
Tao Baod7db5942015-01-28 10:07:51 -0800341 SCTP_SHUTDOWN_EVENT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700342#define SCTP_SHUTDOWN_EVENT SCTP_SHUTDOWN_EVENT
Tao Baod7db5942015-01-28 10:07:51 -0800343 SCTP_PARTIAL_DELIVERY_EVENT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700344#define SCTP_PARTIAL_DELIVERY_EVENT SCTP_PARTIAL_DELIVERY_EVENT
Tao Baod7db5942015-01-28 10:07:51 -0800345 SCTP_ADAPTATION_INDICATION,
Ben Cheng655a7c02013-10-16 16:09:24 -0700346#define SCTP_ADAPTATION_INDICATION SCTP_ADAPTATION_INDICATION
Tao Baod7db5942015-01-28 10:07:51 -0800347 SCTP_AUTHENTICATION_EVENT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700348#define SCTP_AUTHENTICATION_INDICATION SCTP_AUTHENTICATION_EVENT
Tao Baod7db5942015-01-28 10:07:51 -0800349 SCTP_SENDER_DRY_EVENT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700350#define SCTP_SENDER_DRY_EVENT SCTP_SENDER_DRY_EVENT
Christopher Ferris525ce912017-07-26 13:12:53 -0700351 SCTP_STREAM_RESET_EVENT,
352#define SCTP_STREAM_RESET_EVENT SCTP_STREAM_RESET_EVENT
353 SCTP_ASSOC_RESET_EVENT,
354#define SCTP_ASSOC_RESET_EVENT SCTP_ASSOC_RESET_EVENT
355 SCTP_STREAM_CHANGE_EVENT,
356#define SCTP_STREAM_CHANGE_EVENT SCTP_STREAM_CHANGE_EVENT
Ben Cheng655a7c02013-10-16 16:09:24 -0700357};
358typedef enum sctp_sn_error {
Tao Baod7db5942015-01-28 10:07:51 -0800359 SCTP_FAILED_THRESHOLD,
360 SCTP_RECEIVED_SACK,
361 SCTP_HEARTBEAT_SUCCESS,
362 SCTP_RESPONSE_TO_USER_REQ,
Tao Baod7db5942015-01-28 10:07:51 -0800363 SCTP_INTERNAL_ERROR,
364 SCTP_SHUTDOWN_GUARD_EXPIRES,
365 SCTP_PEER_FAULTY,
Ben Cheng655a7c02013-10-16 16:09:24 -0700366} sctp_sn_error_t;
367struct sctp_rtoinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800368 sctp_assoc_t srto_assoc_id;
369 __u32 srto_initial;
370 __u32 srto_max;
Tao Baod7db5942015-01-28 10:07:51 -0800371 __u32 srto_min;
Ben Cheng655a7c02013-10-16 16:09:24 -0700372};
Ben Cheng655a7c02013-10-16 16:09:24 -0700373struct sctp_assocparams {
Tao Baod7db5942015-01-28 10:07:51 -0800374 sctp_assoc_t sasoc_assoc_id;
Tao Baod7db5942015-01-28 10:07:51 -0800375 __u16 sasoc_asocmaxrxt;
376 __u16 sasoc_number_peer_destinations;
377 __u32 sasoc_peer_rwnd;
378 __u32 sasoc_local_rwnd;
Tao Baod7db5942015-01-28 10:07:51 -0800379 __u32 sasoc_cookie_life;
Ben Cheng655a7c02013-10-16 16:09:24 -0700380};
Ben Cheng655a7c02013-10-16 16:09:24 -0700381struct sctp_setpeerprim {
Tao Baod7db5942015-01-28 10:07:51 -0800382 sctp_assoc_t sspp_assoc_id;
Tao Baod7db5942015-01-28 10:07:51 -0800383 struct sockaddr_storage sspp_addr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700384} __attribute__((packed, aligned(4)));
Ben Cheng655a7c02013-10-16 16:09:24 -0700385struct sctp_prim {
Tao Baod7db5942015-01-28 10:07:51 -0800386 sctp_assoc_t ssp_assoc_id;
Tao Baod7db5942015-01-28 10:07:51 -0800387 struct sockaddr_storage ssp_addr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700388} __attribute__((packed, aligned(4)));
Ben Cheng655a7c02013-10-16 16:09:24 -0700389#define sctp_setprim sctp_prim
390struct sctp_setadaptation {
Tao Baod7db5942015-01-28 10:07:51 -0800391 __u32 ssb_adaptation_ind;
Ben Cheng655a7c02013-10-16 16:09:24 -0700392};
Ben Cheng655a7c02013-10-16 16:09:24 -0700393enum sctp_spp_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800394 SPP_HB_ENABLE = 1 << 0,
Tao Baod7db5942015-01-28 10:07:51 -0800395 SPP_HB_DISABLE = 1 << 1,
396 SPP_HB = SPP_HB_ENABLE | SPP_HB_DISABLE,
397 SPP_HB_DEMAND = 1 << 2,
398 SPP_PMTUD_ENABLE = 1 << 3,
Tao Baod7db5942015-01-28 10:07:51 -0800399 SPP_PMTUD_DISABLE = 1 << 4,
400 SPP_PMTUD = SPP_PMTUD_ENABLE | SPP_PMTUD_DISABLE,
401 SPP_SACKDELAY_ENABLE = 1 << 5,
402 SPP_SACKDELAY_DISABLE = 1 << 6,
Tao Baod7db5942015-01-28 10:07:51 -0800403 SPP_SACKDELAY = SPP_SACKDELAY_ENABLE | SPP_SACKDELAY_DISABLE,
404 SPP_HB_TIME_IS_ZERO = 1 << 7,
Ben Cheng655a7c02013-10-16 16:09:24 -0700405};
406struct sctp_paddrparams {
Tao Baod7db5942015-01-28 10:07:51 -0800407 sctp_assoc_t spp_assoc_id;
408 struct sockaddr_storage spp_address;
409 __u32 spp_hbinterval;
410 __u16 spp_pathmaxrxt;
Tao Baod7db5942015-01-28 10:07:51 -0800411 __u32 spp_pathmtu;
412 __u32 spp_sackdelay;
413 __u32 spp_flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700414} __attribute__((packed, aligned(4)));
415struct sctp_authchunk {
Tao Baod7db5942015-01-28 10:07:51 -0800416 __u8 sauth_chunk;
Ben Cheng655a7c02013-10-16 16:09:24 -0700417};
418enum {
Tao Baod7db5942015-01-28 10:07:51 -0800419 SCTP_AUTH_HMAC_ID_SHA1 = 1,
420 SCTP_AUTH_HMAC_ID_SHA256 = 3,
Ben Cheng655a7c02013-10-16 16:09:24 -0700421};
422struct sctp_hmacalgo {
Tao Baod7db5942015-01-28 10:07:51 -0800423 __u32 shmac_num_idents;
424 __u16 shmac_idents[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700425};
426#define shmac_number_of_idents shmac_num_idents
427struct sctp_authkey {
Tao Baod7db5942015-01-28 10:07:51 -0800428 sctp_assoc_t sca_assoc_id;
429 __u16 sca_keynumber;
430 __u16 sca_keylength;
Tao Baod7db5942015-01-28 10:07:51 -0800431 __u8 sca_key[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700432};
Ben Cheng655a7c02013-10-16 16:09:24 -0700433struct sctp_authkeyid {
Tao Baod7db5942015-01-28 10:07:51 -0800434 sctp_assoc_t scact_assoc_id;
Tao Baod7db5942015-01-28 10:07:51 -0800435 __u16 scact_keynumber;
Ben Cheng655a7c02013-10-16 16:09:24 -0700436};
Ben Cheng655a7c02013-10-16 16:09:24 -0700437struct sctp_sack_info {
Tao Baod7db5942015-01-28 10:07:51 -0800438 sctp_assoc_t sack_assoc_id;
Tao Baod7db5942015-01-28 10:07:51 -0800439 uint32_t sack_delay;
440 uint32_t sack_freq;
Ben Cheng655a7c02013-10-16 16:09:24 -0700441};
442struct sctp_assoc_value {
Tao Baod7db5942015-01-28 10:07:51 -0800443 sctp_assoc_t assoc_id;
444 uint32_t assoc_value;
Ben Cheng655a7c02013-10-16 16:09:24 -0700445};
446struct sctp_paddrinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800447 sctp_assoc_t spinfo_assoc_id;
448 struct sockaddr_storage spinfo_address;
449 __s32 spinfo_state;
450 __u32 spinfo_cwnd;
Tao Baod7db5942015-01-28 10:07:51 -0800451 __u32 spinfo_srtt;
452 __u32 spinfo_rto;
453 __u32 spinfo_mtu;
Ben Cheng655a7c02013-10-16 16:09:24 -0700454} __attribute__((packed, aligned(4)));
455enum sctp_spinfo_state {
Tao Baod7db5942015-01-28 10:07:51 -0800456 SCTP_INACTIVE,
457 SCTP_PF,
458 SCTP_ACTIVE,
Tao Baod7db5942015-01-28 10:07:51 -0800459 SCTP_UNCONFIRMED,
460 SCTP_UNKNOWN = 0xffff
Ben Cheng655a7c02013-10-16 16:09:24 -0700461};
462struct sctp_status {
Tao Baod7db5942015-01-28 10:07:51 -0800463 sctp_assoc_t sstat_assoc_id;
464 __s32 sstat_state;
465 __u32 sstat_rwnd;
466 __u16 sstat_unackdata;
Tao Baod7db5942015-01-28 10:07:51 -0800467 __u16 sstat_penddata;
468 __u16 sstat_instrms;
469 __u16 sstat_outstrms;
470 __u32 sstat_fragmentation_point;
Tao Baod7db5942015-01-28 10:07:51 -0800471 struct sctp_paddrinfo sstat_primary;
Ben Cheng655a7c02013-10-16 16:09:24 -0700472};
Ben Cheng655a7c02013-10-16 16:09:24 -0700473struct sctp_authchunks {
Tao Baod7db5942015-01-28 10:07:51 -0800474 sctp_assoc_t gauth_assoc_id;
Tao Baod7db5942015-01-28 10:07:51 -0800475 __u32 gauth_number_of_chunks;
476 uint8_t gauth_chunks[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700477};
478#define guth_number_of_chunks gauth_number_of_chunks
479enum sctp_sstat_state {
Tao Baod7db5942015-01-28 10:07:51 -0800480 SCTP_EMPTY = 0,
481 SCTP_CLOSED = 1,
482 SCTP_COOKIE_WAIT = 2,
Tao Baod7db5942015-01-28 10:07:51 -0800483 SCTP_COOKIE_ECHOED = 3,
484 SCTP_ESTABLISHED = 4,
485 SCTP_SHUTDOWN_PENDING = 5,
486 SCTP_SHUTDOWN_SENT = 6,
Tao Baod7db5942015-01-28 10:07:51 -0800487 SCTP_SHUTDOWN_RECEIVED = 7,
488 SCTP_SHUTDOWN_ACK_SENT = 8,
Ben Cheng655a7c02013-10-16 16:09:24 -0700489};
490struct sctp_assoc_ids {
Tao Baod7db5942015-01-28 10:07:51 -0800491 __u32 gaids_number_of_ids;
492 sctp_assoc_t gaids_assoc_id[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700493};
494struct sctp_getaddrs_old {
Tao Baod7db5942015-01-28 10:07:51 -0800495 sctp_assoc_t assoc_id;
496 int addr_num;
497 struct sockaddr * addrs;
Ben Cheng655a7c02013-10-16 16:09:24 -0700498};
499struct sctp_getaddrs {
Tao Baod7db5942015-01-28 10:07:51 -0800500 sctp_assoc_t assoc_id;
501 __u32 addr_num;
502 __u8 addrs[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700503};
504struct sctp_assoc_stats {
Tao Baod7db5942015-01-28 10:07:51 -0800505 sctp_assoc_t sas_assoc_id;
506 struct sockaddr_storage sas_obs_rto_ipaddr;
Tao Baod7db5942015-01-28 10:07:51 -0800507 __u64 sas_maxrto;
508 __u64 sas_isacks;
509 __u64 sas_osacks;
510 __u64 sas_opackets;
Tao Baod7db5942015-01-28 10:07:51 -0800511 __u64 sas_ipackets;
512 __u64 sas_rtxchunks;
513 __u64 sas_outofseqtsns;
514 __u64 sas_idupchunks;
Tao Baod7db5942015-01-28 10:07:51 -0800515 __u64 sas_gapcnt;
516 __u64 sas_ouodchunks;
517 __u64 sas_iuodchunks;
518 __u64 sas_oodchunks;
Tao Baod7db5942015-01-28 10:07:51 -0800519 __u64 sas_iodchunks;
520 __u64 sas_octrlchunks;
521 __u64 sas_ictrlchunks;
Ben Cheng655a7c02013-10-16 16:09:24 -0700522};
Ben Cheng655a7c02013-10-16 16:09:24 -0700523#define SCTP_BINDX_ADD_ADDR 0x01
524#define SCTP_BINDX_REM_ADDR 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700525typedef struct {
Tao Baod7db5942015-01-28 10:07:51 -0800526 sctp_assoc_t associd;
Tao Baod7db5942015-01-28 10:07:51 -0800527 int sd;
Ben Cheng655a7c02013-10-16 16:09:24 -0700528} sctp_peeloff_arg_t;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800529typedef struct {
530 sctp_peeloff_arg_t p_arg;
531 unsigned flags;
532} sctp_peeloff_flags_arg_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700533struct sctp_paddrthlds {
Tao Baod7db5942015-01-28 10:07:51 -0800534 sctp_assoc_t spt_assoc_id;
Tao Baod7db5942015-01-28 10:07:51 -0800535 struct sockaddr_storage spt_address;
536 __u16 spt_pathmaxrxt;
537 __u16 spt_pathpfthld;
Ben Cheng655a7c02013-10-16 16:09:24 -0700538};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800539struct sctp_prstatus {
540 sctp_assoc_t sprstat_assoc_id;
541 __u16 sprstat_sid;
542 __u16 sprstat_policy;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800543 __u64 sprstat_abandoned_unsent;
544 __u64 sprstat_abandoned_sent;
545};
546struct sctp_default_prinfo {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800547 sctp_assoc_t pr_assoc_id;
548 __u32 pr_value;
549 __u16 pr_policy;
550};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800551struct sctp_info {
552 __u32 sctpi_tag;
553 __u32 sctpi_state;
554 __u32 sctpi_rwnd;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800555 __u16 sctpi_unackdata;
556 __u16 sctpi_penddata;
557 __u16 sctpi_instrms;
558 __u16 sctpi_outstrms;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800559 __u32 sctpi_fragmentation_point;
560 __u32 sctpi_inqueue;
561 __u32 sctpi_outqueue;
562 __u32 sctpi_overall_error;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800563 __u32 sctpi_max_burst;
564 __u32 sctpi_maxseg;
565 __u32 sctpi_peer_rwnd;
566 __u32 sctpi_peer_tag;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800567 __u8 sctpi_peer_capable;
568 __u8 sctpi_peer_sack;
569 __u16 __reserved1;
570 __u64 sctpi_isacks;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800571 __u64 sctpi_osacks;
572 __u64 sctpi_opackets;
573 __u64 sctpi_ipackets;
574 __u64 sctpi_rtxchunks;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800575 __u64 sctpi_outofseqtsns;
576 __u64 sctpi_idupchunks;
577 __u64 sctpi_gapcnt;
578 __u64 sctpi_ouodchunks;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800579 __u64 sctpi_iuodchunks;
580 __u64 sctpi_oodchunks;
581 __u64 sctpi_iodchunks;
582 __u64 sctpi_octrlchunks;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800583 __u64 sctpi_ictrlchunks;
584 struct sockaddr_storage sctpi_p_address;
585 __s32 sctpi_p_state;
586 __u32 sctpi_p_cwnd;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800587 __u32 sctpi_p_srtt;
588 __u32 sctpi_p_rto;
589 __u32 sctpi_p_hbinterval;
590 __u32 sctpi_p_pathmaxrxt;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800591 __u32 sctpi_p_sackdelay;
592 __u32 sctpi_p_sackfreq;
593 __u32 sctpi_p_ssthresh;
594 __u32 sctpi_p_partial_bytes_acked;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800595 __u32 sctpi_p_flight_size;
596 __u16 sctpi_p_error;
597 __u16 __reserved2;
598 __u32 sctpi_s_autoclose;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800599 __u32 sctpi_s_adaptation_ind;
600 __u32 sctpi_s_pd_point;
601 __u8 sctpi_s_nodelay;
602 __u8 sctpi_s_disable_fragments;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800603 __u8 sctpi_s_v4mapped;
604 __u8 sctpi_s_frag_interleave;
605 __u32 sctpi_s_type;
606 __u32 __reserved3;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800607};
Christopher Ferris525ce912017-07-26 13:12:53 -0700608struct sctp_reset_streams {
609 sctp_assoc_t srs_assoc_id;
610 uint16_t srs_flags;
611 uint16_t srs_number_streams;
612 uint16_t srs_stream_list[];
613};
614struct sctp_add_streams {
615 sctp_assoc_t sas_assoc_id;
616 uint16_t sas_instrms;
617 uint16_t sas_outstrms;
618};
Ben Cheng655a7c02013-10-16 16:09:24 -0700619#endif