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