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  */
7 #ifndef _UAPI_SCTP_H
8 #define _UAPI_SCTP_H
9 #include <linux/types.h>
10 #include <linux/socket.h>
11 typedef __s32 sctp_assoc_t;
12 #define SCTP_FUTURE_ASSOC 0
13 #define SCTP_CURRENT_ASSOC 1
14 #define SCTP_ALL_ASSOC 2
15 #define SCTP_RTOINFO 0
16 #define SCTP_ASSOCINFO 1
17 #define SCTP_INITMSG 2
18 #define SCTP_NODELAY 3
19 #define SCTP_AUTOCLOSE 4
20 #define SCTP_SET_PEER_PRIMARY_ADDR 5
21 #define SCTP_PRIMARY_ADDR 6
22 #define SCTP_ADAPTATION_LAYER 7
23 #define SCTP_DISABLE_FRAGMENTS 8
24 #define SCTP_PEER_ADDR_PARAMS 9
25 #define SCTP_DEFAULT_SEND_PARAM 10
26 #define SCTP_EVENTS 11
27 #define SCTP_I_WANT_MAPPED_V4_ADDR 12
28 #define SCTP_MAXSEG 13
29 #define SCTP_STATUS 14
30 #define SCTP_GET_PEER_ADDR_INFO 15
31 #define SCTP_DELAYED_ACK_TIME 16
32 #define SCTP_DELAYED_ACK SCTP_DELAYED_ACK_TIME
33 #define SCTP_DELAYED_SACK SCTP_DELAYED_ACK_TIME
34 #define SCTP_CONTEXT 17
35 #define SCTP_FRAGMENT_INTERLEAVE 18
36 #define SCTP_PARTIAL_DELIVERY_POINT 19
37 #define SCTP_MAX_BURST 20
38 #define SCTP_AUTH_CHUNK 21
39 #define SCTP_HMAC_IDENT 22
40 #define SCTP_AUTH_KEY 23
41 #define SCTP_AUTH_ACTIVE_KEY 24
42 #define SCTP_AUTH_DELETE_KEY 25
43 #define SCTP_PEER_AUTH_CHUNKS 26
44 #define SCTP_LOCAL_AUTH_CHUNKS 27
45 #define SCTP_GET_ASSOC_NUMBER 28
46 #define SCTP_GET_ASSOC_ID_LIST 29
47 #define SCTP_AUTO_ASCONF 30
48 #define SCTP_PEER_ADDR_THLDS 31
49 #define SCTP_RECVRCVINFO 32
50 #define SCTP_RECVNXTINFO 33
51 #define SCTP_DEFAULT_SNDINFO 34
52 #define SCTP_AUTH_DEACTIVATE_KEY 35
53 #define SCTP_REUSE_PORT 36
54 #define SCTP_PEER_ADDR_THLDS_V2 37
55 #define SCTP_SOCKOPT_BINDX_ADD 100
56 #define SCTP_SOCKOPT_BINDX_REM 101
57 #define SCTP_SOCKOPT_PEELOFF 102
58 #define SCTP_SOCKOPT_CONNECTX_OLD 107
59 #define SCTP_GET_PEER_ADDRS 108
60 #define SCTP_GET_LOCAL_ADDRS 109
61 #define SCTP_SOCKOPT_CONNECTX 110
62 #define SCTP_SOCKOPT_CONNECTX3 111
63 #define SCTP_GET_ASSOC_STATS 112
64 #define SCTP_PR_SUPPORTED 113
65 #define SCTP_DEFAULT_PRINFO 114
66 #define SCTP_PR_ASSOC_STATUS 115
67 #define SCTP_PR_STREAM_STATUS 116
68 #define SCTP_RECONFIG_SUPPORTED 117
69 #define SCTP_ENABLE_STREAM_RESET 118
70 #define SCTP_RESET_STREAMS 119
71 #define SCTP_RESET_ASSOC 120
72 #define SCTP_ADD_STREAMS 121
73 #define SCTP_SOCKOPT_PEELOFF_FLAGS 122
74 #define SCTP_STREAM_SCHEDULER 123
75 #define SCTP_STREAM_SCHEDULER_VALUE 124
76 #define SCTP_INTERLEAVING_SUPPORTED 125
77 #define SCTP_SENDMSG_CONNECT 126
78 #define SCTP_EVENT 127
79 #define SCTP_ASCONF_SUPPORTED 128
80 #define SCTP_AUTH_SUPPORTED 129
81 #define SCTP_ECN_SUPPORTED 130
82 #define SCTP_EXPOSE_POTENTIALLY_FAILED_STATE 131
83 #define SCTP_EXPOSE_PF_STATE SCTP_EXPOSE_POTENTIALLY_FAILED_STATE
84 #define SCTP_REMOTE_UDP_ENCAPS_PORT 132
85 #define SCTP_PLPMTUD_PROBE_INTERVAL 133
86 #define SCTP_PR_SCTP_NONE 0x0000
87 #define SCTP_PR_SCTP_TTL 0x0010
88 #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
92 #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)
96 #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)
99 #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
105 enum sctp_msg_flags {
106   MSG_NOTIFICATION = 0x8000,
107 #define MSG_NOTIFICATION MSG_NOTIFICATION
108 };
109 struct sctp_initmsg {
110   __u16 sinit_num_ostreams;
111   __u16 sinit_max_instreams;
112   __u16 sinit_max_attempts;
113   __u16 sinit_max_init_timeo;
114 };
115 struct sctp_sndrcvinfo {
116   __u16 sinfo_stream;
117   __u16 sinfo_ssn;
118   __u16 sinfo_flags;
119   __u32 sinfo_ppid;
120   __u32 sinfo_context;
121   __u32 sinfo_timetolive;
122   __u32 sinfo_tsn;
123   __u32 sinfo_cumtsn;
124   sctp_assoc_t sinfo_assoc_id;
125 };
126 struct sctp_sndinfo {
127   __u16 snd_sid;
128   __u16 snd_flags;
129   __u32 snd_ppid;
130   __u32 snd_context;
131   sctp_assoc_t snd_assoc_id;
132 };
133 struct sctp_rcvinfo {
134   __u16 rcv_sid;
135   __u16 rcv_ssn;
136   __u16 rcv_flags;
137   __u32 rcv_ppid;
138   __u32 rcv_tsn;
139   __u32 rcv_cumtsn;
140   __u32 rcv_context;
141   sctp_assoc_t rcv_assoc_id;
142 };
143 struct sctp_nxtinfo {
144   __u16 nxt_sid;
145   __u16 nxt_flags;
146   __u32 nxt_ppid;
147   __u32 nxt_length;
148   sctp_assoc_t nxt_assoc_id;
149 };
150 struct sctp_prinfo {
151   __u16 pr_policy;
152   __u32 pr_value;
153 };
154 struct sctp_authinfo {
155   __u16 auth_keynumber;
156 };
157 enum sctp_sinfo_flags {
158   SCTP_UNORDERED = (1 << 0),
159   SCTP_ADDR_OVER = (1 << 1),
160   SCTP_ABORT = (1 << 2),
161   SCTP_SACK_IMMEDIATELY = (1 << 3),
162   SCTP_SENDALL = (1 << 6),
163   SCTP_PR_SCTP_ALL = (1 << 7),
164   SCTP_NOTIFICATION = MSG_NOTIFICATION,
165   SCTP_EOF = MSG_FIN,
166 };
167 typedef union {
168   __u8 raw;
169   struct sctp_initmsg init;
170   struct sctp_sndrcvinfo sndrcv;
171 } sctp_cmsg_data_t;
172 typedef enum sctp_cmsg_type {
173   SCTP_INIT,
174 #define SCTP_INIT SCTP_INIT
175   SCTP_SNDRCV,
176 #define SCTP_SNDRCV SCTP_SNDRCV
177   SCTP_SNDINFO,
178 #define SCTP_SNDINFO SCTP_SNDINFO
179   SCTP_RCVINFO,
180 #define SCTP_RCVINFO SCTP_RCVINFO
181   SCTP_NXTINFO,
182 #define SCTP_NXTINFO SCTP_NXTINFO
183   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
191 } sctp_cmsg_t;
192 struct sctp_assoc_change {
193   __u16 sac_type;
194   __u16 sac_flags;
195   __u32 sac_length;
196   __u16 sac_state;
197   __u16 sac_error;
198   __u16 sac_outbound_streams;
199   __u16 sac_inbound_streams;
200   sctp_assoc_t sac_assoc_id;
201   __u8 sac_info[];
202 };
203 enum sctp_sac_state {
204   SCTP_COMM_UP,
205   SCTP_COMM_LOST,
206   SCTP_RESTART,
207   SCTP_SHUTDOWN_COMP,
208   SCTP_CANT_STR_ASSOC,
209 };
210 struct sctp_paddr_change {
211   __u16 spc_type;
212   __u16 spc_flags;
213   __u32 spc_length;
214   struct sockaddr_storage spc_aaddr;
215   int spc_state;
216   int spc_error;
217   sctp_assoc_t spc_assoc_id;
218 } __attribute__((packed, aligned(4)));
219 enum sctp_spc_state {
220   SCTP_ADDR_AVAILABLE,
221   SCTP_ADDR_UNREACHABLE,
222   SCTP_ADDR_REMOVED,
223   SCTP_ADDR_ADDED,
224   SCTP_ADDR_MADE_PRIM,
225   SCTP_ADDR_CONFIRMED,
226   SCTP_ADDR_POTENTIALLY_FAILED,
227 #define SCTP_ADDR_PF SCTP_ADDR_POTENTIALLY_FAILED
228 };
229 struct sctp_remote_error {
230   __u16 sre_type;
231   __u16 sre_flags;
232   __u32 sre_length;
233   __be16 sre_error;
234   sctp_assoc_t sre_assoc_id;
235   __u8 sre_data[];
236 };
237 struct sctp_send_failed {
238   __u16 ssf_type;
239   __u16 ssf_flags;
240   __u32 ssf_length;
241   __u32 ssf_error;
242   struct sctp_sndrcvinfo ssf_info;
243   sctp_assoc_t ssf_assoc_id;
244   __u8 ssf_data[];
245 };
246 struct sctp_send_failed_event {
247   __u16 ssf_type;
248   __u16 ssf_flags;
249   __u32 ssf_length;
250   __u32 ssf_error;
251   struct sctp_sndinfo ssfe_info;
252   sctp_assoc_t ssf_assoc_id;
253   __u8 ssf_data[];
254 };
255 enum sctp_ssf_flags {
256   SCTP_DATA_UNSENT,
257   SCTP_DATA_SENT,
258 };
259 struct sctp_shutdown_event {
260   __u16 sse_type;
261   __u16 sse_flags;
262   __u32 sse_length;
263   sctp_assoc_t sse_assoc_id;
264 };
265 struct sctp_adaptation_event {
266   __u16 sai_type;
267   __u16 sai_flags;
268   __u32 sai_length;
269   __u32 sai_adaptation_ind;
270   sctp_assoc_t sai_assoc_id;
271 };
272 struct sctp_pdapi_event {
273   __u16 pdapi_type;
274   __u16 pdapi_flags;
275   __u32 pdapi_length;
276   __u32 pdapi_indication;
277   sctp_assoc_t pdapi_assoc_id;
278   __u32 pdapi_stream;
279   __u32 pdapi_seq;
280 };
281 enum {
282   SCTP_PARTIAL_DELIVERY_ABORTED = 0,
283 };
284 struct sctp_authkey_event {
285   __u16 auth_type;
286   __u16 auth_flags;
287   __u32 auth_length;
288   __u16 auth_keynumber;
289   __u16 auth_altkeynumber;
290   __u32 auth_indication;
291   sctp_assoc_t auth_assoc_id;
292 };
293 enum {
294   SCTP_AUTH_NEW_KEY,
295 #define SCTP_AUTH_NEWKEY SCTP_AUTH_NEW_KEY
296   SCTP_AUTH_FREE_KEY,
297   SCTP_AUTH_NO_AUTH,
298 };
299 struct sctp_sender_dry_event {
300   __u16 sender_dry_type;
301   __u16 sender_dry_flags;
302   __u32 sender_dry_length;
303   sctp_assoc_t sender_dry_assoc_id;
304 };
305 #define SCTP_STREAM_RESET_INCOMING_SSN 0x0001
306 #define SCTP_STREAM_RESET_OUTGOING_SSN 0x0002
307 #define SCTP_STREAM_RESET_DENIED 0x0004
308 #define SCTP_STREAM_RESET_FAILED 0x0008
309 struct sctp_stream_reset_event {
310   __u16 strreset_type;
311   __u16 strreset_flags;
312   __u32 strreset_length;
313   sctp_assoc_t strreset_assoc_id;
314   __u16 strreset_stream_list[];
315 };
316 #define SCTP_ASSOC_RESET_DENIED 0x0004
317 #define SCTP_ASSOC_RESET_FAILED 0x0008
318 struct sctp_assoc_reset_event {
319   __u16 assocreset_type;
320   __u16 assocreset_flags;
321   __u32 assocreset_length;
322   sctp_assoc_t assocreset_assoc_id;
323   __u32 assocreset_local_tsn;
324   __u32 assocreset_remote_tsn;
325 };
326 #define SCTP_ASSOC_CHANGE_DENIED 0x0004
327 #define SCTP_ASSOC_CHANGE_FAILED 0x0008
328 #define SCTP_STREAM_CHANGE_DENIED SCTP_ASSOC_CHANGE_DENIED
329 #define SCTP_STREAM_CHANGE_FAILED SCTP_ASSOC_CHANGE_FAILED
330 struct sctp_stream_change_event {
331   __u16 strchange_type;
332   __u16 strchange_flags;
333   __u32 strchange_length;
334   sctp_assoc_t strchange_assoc_id;
335   __u16 strchange_instrms;
336   __u16 strchange_outstrms;
337 };
338 struct sctp_event_subscribe {
339   __u8 sctp_data_io_event;
340   __u8 sctp_association_event;
341   __u8 sctp_address_event;
342   __u8 sctp_send_failure_event;
343   __u8 sctp_peer_error_event;
344   __u8 sctp_shutdown_event;
345   __u8 sctp_partial_delivery_event;
346   __u8 sctp_adaptation_layer_event;
347   __u8 sctp_authentication_event;
348   __u8 sctp_sender_dry_event;
349   __u8 sctp_stream_reset_event;
350   __u8 sctp_assoc_reset_event;
351   __u8 sctp_stream_change_event;
352   __u8 sctp_send_failure_event_event;
353 };
354 union sctp_notification {
355   struct {
356     __u16 sn_type;
357     __u16 sn_flags;
358     __u32 sn_length;
359   } sn_header;
360   struct sctp_assoc_change sn_assoc_change;
361   struct sctp_paddr_change sn_paddr_change;
362   struct sctp_remote_error sn_remote_error;
363   struct sctp_send_failed sn_send_failed;
364   struct sctp_shutdown_event sn_shutdown_event;
365   struct sctp_adaptation_event sn_adaptation_event;
366   struct sctp_pdapi_event sn_pdapi_event;
367   struct sctp_authkey_event sn_authkey_event;
368   struct sctp_sender_dry_event sn_sender_dry_event;
369   struct sctp_stream_reset_event sn_strreset_event;
370   struct sctp_assoc_reset_event sn_assocreset_event;
371   struct sctp_stream_change_event sn_strchange_event;
372   struct sctp_send_failed_event sn_send_failed_event;
373 };
374 enum sctp_sn_type {
375   SCTP_SN_TYPE_BASE = (1 << 15),
376   SCTP_DATA_IO_EVENT = SCTP_SN_TYPE_BASE,
377 #define SCTP_DATA_IO_EVENT SCTP_DATA_IO_EVENT
378   SCTP_ASSOC_CHANGE,
379 #define SCTP_ASSOC_CHANGE SCTP_ASSOC_CHANGE
380   SCTP_PEER_ADDR_CHANGE,
381 #define SCTP_PEER_ADDR_CHANGE SCTP_PEER_ADDR_CHANGE
382   SCTP_SEND_FAILED,
383 #define SCTP_SEND_FAILED SCTP_SEND_FAILED
384   SCTP_REMOTE_ERROR,
385 #define SCTP_REMOTE_ERROR SCTP_REMOTE_ERROR
386   SCTP_SHUTDOWN_EVENT,
387 #define SCTP_SHUTDOWN_EVENT SCTP_SHUTDOWN_EVENT
388   SCTP_PARTIAL_DELIVERY_EVENT,
389 #define SCTP_PARTIAL_DELIVERY_EVENT SCTP_PARTIAL_DELIVERY_EVENT
390   SCTP_ADAPTATION_INDICATION,
391 #define SCTP_ADAPTATION_INDICATION SCTP_ADAPTATION_INDICATION
392   SCTP_AUTHENTICATION_EVENT,
393 #define SCTP_AUTHENTICATION_INDICATION SCTP_AUTHENTICATION_EVENT
394   SCTP_SENDER_DRY_EVENT,
395 #define SCTP_SENDER_DRY_EVENT SCTP_SENDER_DRY_EVENT
396   SCTP_STREAM_RESET_EVENT,
397 #define SCTP_STREAM_RESET_EVENT SCTP_STREAM_RESET_EVENT
398   SCTP_ASSOC_RESET_EVENT,
399 #define SCTP_ASSOC_RESET_EVENT SCTP_ASSOC_RESET_EVENT
400   SCTP_STREAM_CHANGE_EVENT,
401 #define SCTP_STREAM_CHANGE_EVENT SCTP_STREAM_CHANGE_EVENT
402   SCTP_SEND_FAILED_EVENT,
403 #define SCTP_SEND_FAILED_EVENT SCTP_SEND_FAILED_EVENT
404   SCTP_SN_TYPE_MAX = SCTP_SEND_FAILED_EVENT,
405 #define SCTP_SN_TYPE_MAX SCTP_SN_TYPE_MAX
406 };
407 typedef enum sctp_sn_error {
408   SCTP_FAILED_THRESHOLD,
409   SCTP_RECEIVED_SACK,
410   SCTP_HEARTBEAT_SUCCESS,
411   SCTP_RESPONSE_TO_USER_REQ,
412   SCTP_INTERNAL_ERROR,
413   SCTP_SHUTDOWN_GUARD_EXPIRES,
414   SCTP_PEER_FAULTY,
415 } sctp_sn_error_t;
416 struct sctp_rtoinfo {
417   sctp_assoc_t srto_assoc_id;
418   __u32 srto_initial;
419   __u32 srto_max;
420   __u32 srto_min;
421 };
422 struct sctp_assocparams {
423   sctp_assoc_t sasoc_assoc_id;
424   __u16 sasoc_asocmaxrxt;
425   __u16 sasoc_number_peer_destinations;
426   __u32 sasoc_peer_rwnd;
427   __u32 sasoc_local_rwnd;
428   __u32 sasoc_cookie_life;
429 };
430 struct sctp_setpeerprim {
431   sctp_assoc_t sspp_assoc_id;
432   struct sockaddr_storage sspp_addr;
433 } __attribute__((packed, aligned(4)));
434 struct sctp_prim {
435   sctp_assoc_t ssp_assoc_id;
436   struct sockaddr_storage ssp_addr;
437 } __attribute__((packed, aligned(4)));
438 #define sctp_setprim sctp_prim
439 struct sctp_setadaptation {
440   __u32 ssb_adaptation_ind;
441 };
442 enum sctp_spp_flags {
443   SPP_HB_ENABLE = 1 << 0,
444   SPP_HB_DISABLE = 1 << 1,
445   SPP_HB = SPP_HB_ENABLE | SPP_HB_DISABLE,
446   SPP_HB_DEMAND = 1 << 2,
447   SPP_PMTUD_ENABLE = 1 << 3,
448   SPP_PMTUD_DISABLE = 1 << 4,
449   SPP_PMTUD = SPP_PMTUD_ENABLE | SPP_PMTUD_DISABLE,
450   SPP_SACKDELAY_ENABLE = 1 << 5,
451   SPP_SACKDELAY_DISABLE = 1 << 6,
452   SPP_SACKDELAY = SPP_SACKDELAY_ENABLE | SPP_SACKDELAY_DISABLE,
453   SPP_HB_TIME_IS_ZERO = 1 << 7,
454   SPP_IPV6_FLOWLABEL = 1 << 8,
455   SPP_DSCP = 1 << 9,
456 };
457 struct sctp_paddrparams {
458   sctp_assoc_t spp_assoc_id;
459   struct sockaddr_storage spp_address;
460   __u32 spp_hbinterval;
461   __u16 spp_pathmaxrxt;
462   __u32 spp_pathmtu;
463   __u32 spp_sackdelay;
464   __u32 spp_flags;
465   __u32 spp_ipv6_flowlabel;
466   __u8 spp_dscp;
467 } __attribute__((packed, aligned(4)));
468 struct sctp_authchunk {
469   __u8 sauth_chunk;
470 };
471 enum {
472   SCTP_AUTH_HMAC_ID_SHA1 = 1,
473   SCTP_AUTH_HMAC_ID_SHA256 = 3,
474 };
475 struct sctp_hmacalgo {
476   __u32 shmac_num_idents;
477   __u16 shmac_idents[];
478 };
479 #define shmac_number_of_idents shmac_num_idents
480 struct sctp_authkey {
481   sctp_assoc_t sca_assoc_id;
482   __u16 sca_keynumber;
483   __u16 sca_keylength;
484   __u8 sca_key[];
485 };
486 struct sctp_authkeyid {
487   sctp_assoc_t scact_assoc_id;
488   __u16 scact_keynumber;
489 };
490 struct sctp_sack_info {
491   sctp_assoc_t sack_assoc_id;
492   uint32_t sack_delay;
493   uint32_t sack_freq;
494 };
495 struct sctp_assoc_value {
496   sctp_assoc_t assoc_id;
497   uint32_t assoc_value;
498 };
499 struct sctp_stream_value {
500   sctp_assoc_t assoc_id;
501   uint16_t stream_id;
502   uint16_t stream_value;
503 };
504 struct sctp_paddrinfo {
505   sctp_assoc_t spinfo_assoc_id;
506   struct sockaddr_storage spinfo_address;
507   __s32 spinfo_state;
508   __u32 spinfo_cwnd;
509   __u32 spinfo_srtt;
510   __u32 spinfo_rto;
511   __u32 spinfo_mtu;
512 } __attribute__((packed, aligned(4)));
513 enum sctp_spinfo_state {
514   SCTP_INACTIVE,
515   SCTP_PF,
516 #define SCTP_POTENTIALLY_FAILED SCTP_PF
517   SCTP_ACTIVE,
518   SCTP_UNCONFIRMED,
519   SCTP_UNKNOWN = 0xffff
520 };
521 struct sctp_status {
522   sctp_assoc_t sstat_assoc_id;
523   __s32 sstat_state;
524   __u32 sstat_rwnd;
525   __u16 sstat_unackdata;
526   __u16 sstat_penddata;
527   __u16 sstat_instrms;
528   __u16 sstat_outstrms;
529   __u32 sstat_fragmentation_point;
530   struct sctp_paddrinfo sstat_primary;
531 };
532 struct sctp_authchunks {
533   sctp_assoc_t gauth_assoc_id;
534   __u32 gauth_number_of_chunks;
535   uint8_t gauth_chunks[];
536 };
537 #define guth_number_of_chunks gauth_number_of_chunks
538 enum sctp_sstat_state {
539   SCTP_EMPTY = 0,
540   SCTP_CLOSED = 1,
541   SCTP_COOKIE_WAIT = 2,
542   SCTP_COOKIE_ECHOED = 3,
543   SCTP_ESTABLISHED = 4,
544   SCTP_SHUTDOWN_PENDING = 5,
545   SCTP_SHUTDOWN_SENT = 6,
546   SCTP_SHUTDOWN_RECEIVED = 7,
547   SCTP_SHUTDOWN_ACK_SENT = 8,
548 };
549 struct sctp_assoc_ids {
550   __u32 gaids_number_of_ids;
551   sctp_assoc_t gaids_assoc_id[];
552 };
553 struct sctp_getaddrs_old {
554   sctp_assoc_t assoc_id;
555   int addr_num;
556   struct sockaddr * addrs;
557 };
558 struct sctp_getaddrs {
559   sctp_assoc_t assoc_id;
560   __u32 addr_num;
561   __u8 addrs[];
562 };
563 struct sctp_assoc_stats {
564   sctp_assoc_t sas_assoc_id;
565   struct sockaddr_storage sas_obs_rto_ipaddr;
566   __u64 sas_maxrto;
567   __u64 sas_isacks;
568   __u64 sas_osacks;
569   __u64 sas_opackets;
570   __u64 sas_ipackets;
571   __u64 sas_rtxchunks;
572   __u64 sas_outofseqtsns;
573   __u64 sas_idupchunks;
574   __u64 sas_gapcnt;
575   __u64 sas_ouodchunks;
576   __u64 sas_iuodchunks;
577   __u64 sas_oodchunks;
578   __u64 sas_iodchunks;
579   __u64 sas_octrlchunks;
580   __u64 sas_ictrlchunks;
581 };
582 #define SCTP_BINDX_ADD_ADDR 0x01
583 #define SCTP_BINDX_REM_ADDR 0x02
584 typedef struct {
585   sctp_assoc_t associd;
586   int sd;
587 } sctp_peeloff_arg_t;
588 typedef struct {
589   sctp_peeloff_arg_t p_arg;
590   unsigned flags;
591 } sctp_peeloff_flags_arg_t;
592 struct sctp_paddrthlds {
593   sctp_assoc_t spt_assoc_id;
594   struct sockaddr_storage spt_address;
595   __u16 spt_pathmaxrxt;
596   __u16 spt_pathpfthld;
597 };
598 struct sctp_paddrthlds_v2 {
599   sctp_assoc_t spt_assoc_id;
600   struct sockaddr_storage spt_address;
601   __u16 spt_pathmaxrxt;
602   __u16 spt_pathpfthld;
603   __u16 spt_pathcpthld;
604 };
605 struct sctp_prstatus {
606   sctp_assoc_t sprstat_assoc_id;
607   __u16 sprstat_sid;
608   __u16 sprstat_policy;
609   __u64 sprstat_abandoned_unsent;
610   __u64 sprstat_abandoned_sent;
611 };
612 struct sctp_default_prinfo {
613   sctp_assoc_t pr_assoc_id;
614   __u32 pr_value;
615   __u16 pr_policy;
616 };
617 struct sctp_info {
618   __u32 sctpi_tag;
619   __u32 sctpi_state;
620   __u32 sctpi_rwnd;
621   __u16 sctpi_unackdata;
622   __u16 sctpi_penddata;
623   __u16 sctpi_instrms;
624   __u16 sctpi_outstrms;
625   __u32 sctpi_fragmentation_point;
626   __u32 sctpi_inqueue;
627   __u32 sctpi_outqueue;
628   __u32 sctpi_overall_error;
629   __u32 sctpi_max_burst;
630   __u32 sctpi_maxseg;
631   __u32 sctpi_peer_rwnd;
632   __u32 sctpi_peer_tag;
633   __u8 sctpi_peer_capable;
634   __u8 sctpi_peer_sack;
635   __u16 __reserved1;
636   __u64 sctpi_isacks;
637   __u64 sctpi_osacks;
638   __u64 sctpi_opackets;
639   __u64 sctpi_ipackets;
640   __u64 sctpi_rtxchunks;
641   __u64 sctpi_outofseqtsns;
642   __u64 sctpi_idupchunks;
643   __u64 sctpi_gapcnt;
644   __u64 sctpi_ouodchunks;
645   __u64 sctpi_iuodchunks;
646   __u64 sctpi_oodchunks;
647   __u64 sctpi_iodchunks;
648   __u64 sctpi_octrlchunks;
649   __u64 sctpi_ictrlchunks;
650   struct sockaddr_storage sctpi_p_address;
651   __s32 sctpi_p_state;
652   __u32 sctpi_p_cwnd;
653   __u32 sctpi_p_srtt;
654   __u32 sctpi_p_rto;
655   __u32 sctpi_p_hbinterval;
656   __u32 sctpi_p_pathmaxrxt;
657   __u32 sctpi_p_sackdelay;
658   __u32 sctpi_p_sackfreq;
659   __u32 sctpi_p_ssthresh;
660   __u32 sctpi_p_partial_bytes_acked;
661   __u32 sctpi_p_flight_size;
662   __u16 sctpi_p_error;
663   __u16 __reserved2;
664   __u32 sctpi_s_autoclose;
665   __u32 sctpi_s_adaptation_ind;
666   __u32 sctpi_s_pd_point;
667   __u8 sctpi_s_nodelay;
668   __u8 sctpi_s_disable_fragments;
669   __u8 sctpi_s_v4mapped;
670   __u8 sctpi_s_frag_interleave;
671   __u32 sctpi_s_type;
672   __u32 __reserved3;
673 };
674 struct sctp_reset_streams {
675   sctp_assoc_t srs_assoc_id;
676   uint16_t srs_flags;
677   uint16_t srs_number_streams;
678   uint16_t srs_stream_list[];
679 };
680 struct sctp_add_streams {
681   sctp_assoc_t sas_assoc_id;
682   uint16_t sas_instrms;
683   uint16_t sas_outstrms;
684 };
685 struct sctp_event {
686   sctp_assoc_t se_assoc_id;
687   uint16_t se_type;
688   uint8_t se_on;
689 };
690 struct sctp_udpencaps {
691   sctp_assoc_t sue_assoc_id;
692   struct sockaddr_storage sue_address;
693   uint16_t sue_port;
694 };
695 enum sctp_sched_type {
696   SCTP_SS_FCFS,
697   SCTP_SS_DEFAULT = SCTP_SS_FCFS,
698   SCTP_SS_PRIO,
699   SCTP_SS_RR,
700   SCTP_SS_FC,
701   SCTP_SS_WFQ,
702   SCTP_SS_MAX = SCTP_SS_WFQ
703 };
704 struct sctp_probeinterval {
705   sctp_assoc_t spi_assoc_id;
706   struct sockaddr_storage spi_address;
707   __u32 spi_interval;
708 };
709 #endif
710