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