sctp.h 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126
  1. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2. /* SCTP kernel implementation
  3. * (C) Copyright IBM Corp. 2001, 2004
  4. * Copyright (c) 1999-2000 Cisco, Inc.
  5. * Copyright (c) 1999-2001 Motorola, Inc.
  6. * Copyright (c) 2002 Intel Corp.
  7. *
  8. * This file is part of the SCTP kernel implementation
  9. *
  10. * This header represents the structures and constants needed to support
  11. * the SCTP Extension to the Sockets API.
  12. *
  13. * This SCTP implementation is free software;
  14. * you can redistribute it and/or modify it under the terms of
  15. * the GNU General Public License as published by
  16. * the Free Software Foundation; either version 2, or (at your option)
  17. * any later version.
  18. *
  19. * This SCTP implementation is distributed in the hope that it
  20. * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  21. * ************************
  22. * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  23. * See the GNU General Public License for more details.
  24. *
  25. * You should have received a copy of the GNU General Public License
  26. * along with GNU CC; see the file COPYING. If not, see
  27. * <http://www.gnu.org/licenses/>.
  28. *
  29. * Please send any bug reports or fixes you make to the
  30. * email address(es):
  31. * lksctp developers <linux-sctp@vger.kernel.org>
  32. *
  33. * Or submit a bug report through the following website:
  34. * http://www.sf.net/projects/lksctp
  35. *
  36. * Written or modified by:
  37. * La Monte H.P. Yarroll <piggy@acm.org>
  38. * R. Stewart <randall@sctp.chicago.il.us>
  39. * K. Morneau <kmorneau@cisco.com>
  40. * Q. Xie <qxie1@email.mot.com>
  41. * Karl Knutson <karl@athena.chicago.il.us>
  42. * Jon Grimm <jgrimm@us.ibm.com>
  43. * Daisy Chang <daisyc@us.ibm.com>
  44. * Ryan Layer <rmlayer@us.ibm.com>
  45. * Ardelle Fan <ardelle.fan@intel.com>
  46. * Sridhar Samudrala <sri@us.ibm.com>
  47. * Inaky Perez-Gonzalez <inaky.gonzalez@intel.com>
  48. * Vlad Yasevich <vladislav.yasevich@hp.com>
  49. *
  50. * Any bugs reported given to us we will try to fix... any fixes shared will
  51. * be incorporated into the next SCTP release.
  52. */
  53. #ifndef _UAPI_SCTP_H
  54. #define _UAPI_SCTP_H
  55. #include <linux/types.h>
  56. #include <linux/socket.h>
  57. typedef __s32 sctp_assoc_t;
  58. /* The following symbols come from the Sockets API Extensions for
  59. * SCTP <draft-ietf-tsvwg-sctpsocket-07.txt>.
  60. */
  61. #define SCTP_RTOINFO 0
  62. #define SCTP_ASSOCINFO 1
  63. #define SCTP_INITMSG 2
  64. #define SCTP_NODELAY 3 /* Get/set nodelay option. */
  65. #define SCTP_AUTOCLOSE 4
  66. #define SCTP_SET_PEER_PRIMARY_ADDR 5
  67. #define SCTP_PRIMARY_ADDR 6
  68. #define SCTP_ADAPTATION_LAYER 7
  69. #define SCTP_DISABLE_FRAGMENTS 8
  70. #define SCTP_PEER_ADDR_PARAMS 9
  71. #define SCTP_DEFAULT_SEND_PARAM 10
  72. #define SCTP_EVENTS 11
  73. #define SCTP_I_WANT_MAPPED_V4_ADDR 12 /* Turn on/off mapped v4 addresses */
  74. #define SCTP_MAXSEG 13 /* Get/set maximum fragment. */
  75. #define SCTP_STATUS 14
  76. #define SCTP_GET_PEER_ADDR_INFO 15
  77. #define SCTP_DELAYED_ACK_TIME 16
  78. #define SCTP_DELAYED_ACK SCTP_DELAYED_ACK_TIME
  79. #define SCTP_DELAYED_SACK SCTP_DELAYED_ACK_TIME
  80. #define SCTP_CONTEXT 17
  81. #define SCTP_FRAGMENT_INTERLEAVE 18
  82. #define SCTP_PARTIAL_DELIVERY_POINT 19 /* Set/Get partial delivery point */
  83. #define SCTP_MAX_BURST 20 /* Set/Get max burst */
  84. #define SCTP_AUTH_CHUNK 21 /* Set only: add a chunk type to authenticate */
  85. #define SCTP_HMAC_IDENT 22
  86. #define SCTP_AUTH_KEY 23
  87. #define SCTP_AUTH_ACTIVE_KEY 24
  88. #define SCTP_AUTH_DELETE_KEY 25
  89. #define SCTP_PEER_AUTH_CHUNKS 26 /* Read only */
  90. #define SCTP_LOCAL_AUTH_CHUNKS 27 /* Read only */
  91. #define SCTP_GET_ASSOC_NUMBER 28 /* Read only */
  92. #define SCTP_GET_ASSOC_ID_LIST 29 /* Read only */
  93. #define SCTP_AUTO_ASCONF 30
  94. #define SCTP_PEER_ADDR_THLDS 31
  95. #define SCTP_RECVRCVINFO 32
  96. #define SCTP_RECVNXTINFO 33
  97. #define SCTP_DEFAULT_SNDINFO 34
  98. /* Internal Socket Options. Some of the sctp library functions are
  99. * implemented using these socket options.
  100. */
  101. #define SCTP_SOCKOPT_BINDX_ADD 100 /* BINDX requests for adding addrs */
  102. #define SCTP_SOCKOPT_BINDX_REM 101 /* BINDX requests for removing addrs. */
  103. #define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */
  104. /* Options 104-106 are deprecated and removed. Do not use this space */
  105. #define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */
  106. #define SCTP_GET_PEER_ADDRS 108 /* Get all peer address. */
  107. #define SCTP_GET_LOCAL_ADDRS 109 /* Get all local address. */
  108. #define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */
  109. #define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */
  110. #define SCTP_GET_ASSOC_STATS 112 /* Read only */
  111. #define SCTP_PR_SUPPORTED 113
  112. #define SCTP_DEFAULT_PRINFO 114
  113. #define SCTP_PR_ASSOC_STATUS 115
  114. #define SCTP_PR_STREAM_STATUS 116
  115. #define SCTP_RECONFIG_SUPPORTED 117
  116. #define SCTP_ENABLE_STREAM_RESET 118
  117. #define SCTP_RESET_STREAMS 119
  118. #define SCTP_RESET_ASSOC 120
  119. #define SCTP_ADD_STREAMS 121
  120. #define SCTP_SOCKOPT_PEELOFF_FLAGS 122
  121. #define SCTP_STREAM_SCHEDULER 123
  122. #define SCTP_STREAM_SCHEDULER_VALUE 124
  123. #define SCTP_INTERLEAVING_SUPPORTED 125
  124. /* PR-SCTP policies */
  125. #define SCTP_PR_SCTP_NONE 0x0000
  126. #define SCTP_PR_SCTP_TTL 0x0010
  127. #define SCTP_PR_SCTP_RTX 0x0020
  128. #define SCTP_PR_SCTP_PRIO 0x0030
  129. #define SCTP_PR_SCTP_MAX SCTP_PR_SCTP_PRIO
  130. #define SCTP_PR_SCTP_MASK 0x0030
  131. #define __SCTP_PR_INDEX(x) ((x >> 4) - 1)
  132. #define SCTP_PR_INDEX(x) __SCTP_PR_INDEX(SCTP_PR_SCTP_ ## x)
  133. #define SCTP_PR_POLICY(x) ((x) & SCTP_PR_SCTP_MASK)
  134. #define SCTP_PR_SET_POLICY(flags, x) \
  135. do { \
  136. flags &= ~SCTP_PR_SCTP_MASK; \
  137. flags |= x; \
  138. } while (0)
  139. #define SCTP_PR_TTL_ENABLED(x) (SCTP_PR_POLICY(x) == SCTP_PR_SCTP_TTL)
  140. #define SCTP_PR_RTX_ENABLED(x) (SCTP_PR_POLICY(x) == SCTP_PR_SCTP_RTX)
  141. #define SCTP_PR_PRIO_ENABLED(x) (SCTP_PR_POLICY(x) == SCTP_PR_SCTP_PRIO)
  142. /* For enable stream reset */
  143. #define SCTP_ENABLE_RESET_STREAM_REQ 0x01
  144. #define SCTP_ENABLE_RESET_ASSOC_REQ 0x02
  145. #define SCTP_ENABLE_CHANGE_ASSOC_REQ 0x04
  146. #define SCTP_ENABLE_STRRESET_MASK 0x07
  147. #define SCTP_STREAM_RESET_INCOMING 0x01
  148. #define SCTP_STREAM_RESET_OUTGOING 0x02
  149. /* These are bit fields for msghdr->msg_flags. See section 5.1. */
  150. /* On user space Linux, these live in <bits/socket.h> as an enum. */
  151. enum sctp_msg_flags {
  152. MSG_NOTIFICATION = 0x8000,
  153. #define MSG_NOTIFICATION MSG_NOTIFICATION
  154. };
  155. /* 5.3.1 SCTP Initiation Structure (SCTP_INIT)
  156. *
  157. * This cmsghdr structure provides information for initializing new
  158. * SCTP associations with sendmsg(). The SCTP_INITMSG socket option
  159. * uses this same data structure. This structure is not used for
  160. * recvmsg().
  161. *
  162. * cmsg_level cmsg_type cmsg_data[]
  163. * ------------ ------------ ----------------------
  164. * IPPROTO_SCTP SCTP_INIT struct sctp_initmsg
  165. */
  166. struct sctp_initmsg {
  167. __u16 sinit_num_ostreams;
  168. __u16 sinit_max_instreams;
  169. __u16 sinit_max_attempts;
  170. __u16 sinit_max_init_timeo;
  171. };
  172. /* 5.3.2 SCTP Header Information Structure (SCTP_SNDRCV)
  173. *
  174. * This cmsghdr structure specifies SCTP options for sendmsg() and
  175. * describes SCTP header information about a received message through
  176. * recvmsg().
  177. *
  178. * cmsg_level cmsg_type cmsg_data[]
  179. * ------------ ------------ ----------------------
  180. * IPPROTO_SCTP SCTP_SNDRCV struct sctp_sndrcvinfo
  181. */
  182. struct sctp_sndrcvinfo {
  183. __u16 sinfo_stream;
  184. __u16 sinfo_ssn;
  185. __u16 sinfo_flags;
  186. __u32 sinfo_ppid;
  187. __u32 sinfo_context;
  188. __u32 sinfo_timetolive;
  189. __u32 sinfo_tsn;
  190. __u32 sinfo_cumtsn;
  191. sctp_assoc_t sinfo_assoc_id;
  192. };
  193. /* 5.3.4 SCTP Send Information Structure (SCTP_SNDINFO)
  194. *
  195. * This cmsghdr structure specifies SCTP options for sendmsg().
  196. *
  197. * cmsg_level cmsg_type cmsg_data[]
  198. * ------------ ------------ -------------------
  199. * IPPROTO_SCTP SCTP_SNDINFO struct sctp_sndinfo
  200. */
  201. struct sctp_sndinfo {
  202. __u16 snd_sid;
  203. __u16 snd_flags;
  204. __u32 snd_ppid;
  205. __u32 snd_context;
  206. sctp_assoc_t snd_assoc_id;
  207. };
  208. /* 5.3.5 SCTP Receive Information Structure (SCTP_RCVINFO)
  209. *
  210. * This cmsghdr structure describes SCTP receive information
  211. * about a received message through recvmsg().
  212. *
  213. * cmsg_level cmsg_type cmsg_data[]
  214. * ------------ ------------ -------------------
  215. * IPPROTO_SCTP SCTP_RCVINFO struct sctp_rcvinfo
  216. */
  217. struct sctp_rcvinfo {
  218. __u16 rcv_sid;
  219. __u16 rcv_ssn;
  220. __u16 rcv_flags;
  221. __u32 rcv_ppid;
  222. __u32 rcv_tsn;
  223. __u32 rcv_cumtsn;
  224. __u32 rcv_context;
  225. sctp_assoc_t rcv_assoc_id;
  226. };
  227. /* 5.3.6 SCTP Next Receive Information Structure (SCTP_NXTINFO)
  228. *
  229. * This cmsghdr structure describes SCTP receive information
  230. * of the next message that will be delivered through recvmsg()
  231. * if this information is already available when delivering
  232. * the current message.
  233. *
  234. * cmsg_level cmsg_type cmsg_data[]
  235. * ------------ ------------ -------------------
  236. * IPPROTO_SCTP SCTP_NXTINFO struct sctp_nxtinfo
  237. */
  238. struct sctp_nxtinfo {
  239. __u16 nxt_sid;
  240. __u16 nxt_flags;
  241. __u32 nxt_ppid;
  242. __u32 nxt_length;
  243. sctp_assoc_t nxt_assoc_id;
  244. };
  245. /* 5.3.7 SCTP PR-SCTP Information Structure (SCTP_PRINFO)
  246. *
  247. * This cmsghdr structure specifies SCTP options for sendmsg().
  248. *
  249. * cmsg_level cmsg_type cmsg_data[]
  250. * ------------ ------------ -------------------
  251. * IPPROTO_SCTP SCTP_PRINFO struct sctp_prinfo
  252. */
  253. struct sctp_prinfo {
  254. __u16 pr_policy;
  255. __u32 pr_value;
  256. };
  257. /*
  258. * sinfo_flags: 16 bits (unsigned integer)
  259. *
  260. * This field may contain any of the following flags and is composed of
  261. * a bitwise OR of these values.
  262. */
  263. enum sctp_sinfo_flags {
  264. SCTP_UNORDERED = (1 << 0), /* Send/receive message unordered. */
  265. SCTP_ADDR_OVER = (1 << 1), /* Override the primary destination. */
  266. SCTP_ABORT = (1 << 2), /* Send an ABORT message to the peer. */
  267. SCTP_SACK_IMMEDIATELY = (1 << 3), /* SACK should be sent without delay. */
  268. SCTP_NOTIFICATION = MSG_NOTIFICATION, /* Next message is not user msg but notification. */
  269. SCTP_EOF = MSG_FIN, /* Initiate graceful shutdown process. */
  270. };
  271. typedef union {
  272. __u8 raw;
  273. struct sctp_initmsg init;
  274. struct sctp_sndrcvinfo sndrcv;
  275. } sctp_cmsg_data_t;
  276. /* These are cmsg_types. */
  277. typedef enum sctp_cmsg_type {
  278. SCTP_INIT, /* 5.2.1 SCTP Initiation Structure */
  279. #define SCTP_INIT SCTP_INIT
  280. SCTP_SNDRCV, /* 5.2.2 SCTP Header Information Structure */
  281. #define SCTP_SNDRCV SCTP_SNDRCV
  282. SCTP_SNDINFO, /* 5.3.4 SCTP Send Information Structure */
  283. #define SCTP_SNDINFO SCTP_SNDINFO
  284. SCTP_RCVINFO, /* 5.3.5 SCTP Receive Information Structure */
  285. #define SCTP_RCVINFO SCTP_RCVINFO
  286. SCTP_NXTINFO, /* 5.3.6 SCTP Next Receive Information Structure */
  287. #define SCTP_NXTINFO SCTP_NXTINFO
  288. SCTP_PRINFO, /* 5.3.7 SCTP PR-SCTP Information Structure */
  289. #define SCTP_PRINFO SCTP_PRINFO
  290. } sctp_cmsg_t;
  291. /*
  292. * 5.3.1.1 SCTP_ASSOC_CHANGE
  293. *
  294. * Communication notifications inform the ULP that an SCTP association
  295. * has either begun or ended. The identifier for a new association is
  296. * provided by this notificaion. The notification information has the
  297. * following format:
  298. *
  299. */
  300. struct sctp_assoc_change {
  301. __u16 sac_type;
  302. __u16 sac_flags;
  303. __u32 sac_length;
  304. __u16 sac_state;
  305. __u16 sac_error;
  306. __u16 sac_outbound_streams;
  307. __u16 sac_inbound_streams;
  308. sctp_assoc_t sac_assoc_id;
  309. __u8 sac_info[0];
  310. };
  311. /*
  312. * sac_state: 32 bits (signed integer)
  313. *
  314. * This field holds one of a number of values that communicate the
  315. * event that happened to the association. They include:
  316. *
  317. * Note: The following state names deviate from the API draft as
  318. * the names clash too easily with other kernel symbols.
  319. */
  320. enum sctp_sac_state {
  321. SCTP_COMM_UP,
  322. SCTP_COMM_LOST,
  323. SCTP_RESTART,
  324. SCTP_SHUTDOWN_COMP,
  325. SCTP_CANT_STR_ASSOC,
  326. };
  327. /*
  328. * 5.3.1.2 SCTP_PEER_ADDR_CHANGE
  329. *
  330. * When a destination address on a multi-homed peer encounters a change
  331. * an interface details event is sent. The information has the
  332. * following structure:
  333. */
  334. struct sctp_paddr_change {
  335. __u16 spc_type;
  336. __u16 spc_flags;
  337. __u32 spc_length;
  338. struct sockaddr_storage spc_aaddr;
  339. int spc_state;
  340. int spc_error;
  341. sctp_assoc_t spc_assoc_id;
  342. } __attribute__((packed, aligned(4)));
  343. /*
  344. * spc_state: 32 bits (signed integer)
  345. *
  346. * This field holds one of a number of values that communicate the
  347. * event that happened to the address. They include:
  348. */
  349. enum sctp_spc_state {
  350. SCTP_ADDR_AVAILABLE,
  351. SCTP_ADDR_UNREACHABLE,
  352. SCTP_ADDR_REMOVED,
  353. SCTP_ADDR_ADDED,
  354. SCTP_ADDR_MADE_PRIM,
  355. SCTP_ADDR_CONFIRMED,
  356. };
  357. /*
  358. * 5.3.1.3 SCTP_REMOTE_ERROR
  359. *
  360. * A remote peer may send an Operational Error message to its peer.
  361. * This message indicates a variety of error conditions on an
  362. * association. The entire error TLV as it appears on the wire is
  363. * included in a SCTP_REMOTE_ERROR event. Please refer to the SCTP
  364. * specification [SCTP] and any extensions for a list of possible
  365. * error formats. SCTP error TLVs have the format:
  366. */
  367. struct sctp_remote_error {
  368. __u16 sre_type;
  369. __u16 sre_flags;
  370. __u32 sre_length;
  371. __be16 sre_error;
  372. sctp_assoc_t sre_assoc_id;
  373. __u8 sre_data[0];
  374. };
  375. /*
  376. * 5.3.1.4 SCTP_SEND_FAILED
  377. *
  378. * If SCTP cannot deliver a message it may return the message as a
  379. * notification.
  380. */
  381. struct sctp_send_failed {
  382. __u16 ssf_type;
  383. __u16 ssf_flags;
  384. __u32 ssf_length;
  385. __u32 ssf_error;
  386. struct sctp_sndrcvinfo ssf_info;
  387. sctp_assoc_t ssf_assoc_id;
  388. __u8 ssf_data[0];
  389. };
  390. /*
  391. * ssf_flags: 16 bits (unsigned integer)
  392. *
  393. * The flag value will take one of the following values
  394. *
  395. * SCTP_DATA_UNSENT - Indicates that the data was never put on
  396. * the wire.
  397. *
  398. * SCTP_DATA_SENT - Indicates that the data was put on the wire.
  399. * Note that this does not necessarily mean that the
  400. * data was (or was not) successfully delivered.
  401. */
  402. enum sctp_ssf_flags {
  403. SCTP_DATA_UNSENT,
  404. SCTP_DATA_SENT,
  405. };
  406. /*
  407. * 5.3.1.5 SCTP_SHUTDOWN_EVENT
  408. *
  409. * When a peer sends a SHUTDOWN, SCTP delivers this notification to
  410. * inform the application that it should cease sending data.
  411. */
  412. struct sctp_shutdown_event {
  413. __u16 sse_type;
  414. __u16 sse_flags;
  415. __u32 sse_length;
  416. sctp_assoc_t sse_assoc_id;
  417. };
  418. /*
  419. * 5.3.1.6 SCTP_ADAPTATION_INDICATION
  420. *
  421. * When a peer sends a Adaptation Layer Indication parameter , SCTP
  422. * delivers this notification to inform the application
  423. * that of the peers requested adaptation layer.
  424. */
  425. struct sctp_adaptation_event {
  426. __u16 sai_type;
  427. __u16 sai_flags;
  428. __u32 sai_length;
  429. __u32 sai_adaptation_ind;
  430. sctp_assoc_t sai_assoc_id;
  431. };
  432. /*
  433. * 5.3.1.7 SCTP_PARTIAL_DELIVERY_EVENT
  434. *
  435. * When a receiver is engaged in a partial delivery of a
  436. * message this notification will be used to indicate
  437. * various events.
  438. */
  439. struct sctp_pdapi_event {
  440. __u16 pdapi_type;
  441. __u16 pdapi_flags;
  442. __u32 pdapi_length;
  443. __u32 pdapi_indication;
  444. sctp_assoc_t pdapi_assoc_id;
  445. __u32 pdapi_stream;
  446. __u32 pdapi_seq;
  447. };
  448. enum { SCTP_PARTIAL_DELIVERY_ABORTED=0, };
  449. /*
  450. * 5.3.1.8. SCTP_AUTHENTICATION_EVENT
  451. *
  452. * When a receiver is using authentication this message will provide
  453. * notifications regarding new keys being made active as well as errors.
  454. */
  455. struct sctp_authkey_event {
  456. __u16 auth_type;
  457. __u16 auth_flags;
  458. __u32 auth_length;
  459. __u16 auth_keynumber;
  460. __u16 auth_altkeynumber;
  461. __u32 auth_indication;
  462. sctp_assoc_t auth_assoc_id;
  463. };
  464. enum { SCTP_AUTH_NEWKEY = 0, };
  465. /*
  466. * 6.1.9. SCTP_SENDER_DRY_EVENT
  467. *
  468. * When the SCTP stack has no more user data to send or retransmit, this
  469. * notification is given to the user. Also, at the time when a user app
  470. * subscribes to this event, if there is no data to be sent or
  471. * retransmit, the stack will immediately send up this notification.
  472. */
  473. struct sctp_sender_dry_event {
  474. __u16 sender_dry_type;
  475. __u16 sender_dry_flags;
  476. __u32 sender_dry_length;
  477. sctp_assoc_t sender_dry_assoc_id;
  478. };
  479. #define SCTP_STREAM_RESET_INCOMING_SSN 0x0001
  480. #define SCTP_STREAM_RESET_OUTGOING_SSN 0x0002
  481. #define SCTP_STREAM_RESET_DENIED 0x0004
  482. #define SCTP_STREAM_RESET_FAILED 0x0008
  483. struct sctp_stream_reset_event {
  484. __u16 strreset_type;
  485. __u16 strreset_flags;
  486. __u32 strreset_length;
  487. sctp_assoc_t strreset_assoc_id;
  488. __u16 strreset_stream_list[];
  489. };
  490. #define SCTP_ASSOC_RESET_DENIED 0x0004
  491. #define SCTP_ASSOC_RESET_FAILED 0x0008
  492. struct sctp_assoc_reset_event {
  493. __u16 assocreset_type;
  494. __u16 assocreset_flags;
  495. __u32 assocreset_length;
  496. sctp_assoc_t assocreset_assoc_id;
  497. __u32 assocreset_local_tsn;
  498. __u32 assocreset_remote_tsn;
  499. };
  500. #define SCTP_ASSOC_CHANGE_DENIED 0x0004
  501. #define SCTP_ASSOC_CHANGE_FAILED 0x0008
  502. struct sctp_stream_change_event {
  503. __u16 strchange_type;
  504. __u16 strchange_flags;
  505. __u32 strchange_length;
  506. sctp_assoc_t strchange_assoc_id;
  507. __u16 strchange_instrms;
  508. __u16 strchange_outstrms;
  509. };
  510. /*
  511. * Described in Section 7.3
  512. * Ancillary Data and Notification Interest Options
  513. */
  514. struct sctp_event_subscribe {
  515. __u8 sctp_data_io_event;
  516. __u8 sctp_association_event;
  517. __u8 sctp_address_event;
  518. __u8 sctp_send_failure_event;
  519. __u8 sctp_peer_error_event;
  520. __u8 sctp_shutdown_event;
  521. __u8 sctp_partial_delivery_event;
  522. __u8 sctp_adaptation_layer_event;
  523. __u8 sctp_authentication_event;
  524. __u8 sctp_sender_dry_event;
  525. __u8 sctp_stream_reset_event;
  526. __u8 sctp_assoc_reset_event;
  527. __u8 sctp_stream_change_event;
  528. };
  529. /*
  530. * 5.3.1 SCTP Notification Structure
  531. *
  532. * The notification structure is defined as the union of all
  533. * notification types.
  534. *
  535. */
  536. union sctp_notification {
  537. struct {
  538. __u16 sn_type; /* Notification type. */
  539. __u16 sn_flags;
  540. __u32 sn_length;
  541. } sn_header;
  542. struct sctp_assoc_change sn_assoc_change;
  543. struct sctp_paddr_change sn_paddr_change;
  544. struct sctp_remote_error sn_remote_error;
  545. struct sctp_send_failed sn_send_failed;
  546. struct sctp_shutdown_event sn_shutdown_event;
  547. struct sctp_adaptation_event sn_adaptation_event;
  548. struct sctp_pdapi_event sn_pdapi_event;
  549. struct sctp_authkey_event sn_authkey_event;
  550. struct sctp_sender_dry_event sn_sender_dry_event;
  551. struct sctp_stream_reset_event sn_strreset_event;
  552. struct sctp_assoc_reset_event sn_assocreset_event;
  553. struct sctp_stream_change_event sn_strchange_event;
  554. };
  555. /* Section 5.3.1
  556. * All standard values for sn_type flags are greater than 2^15.
  557. * Values from 2^15 and down are reserved.
  558. */
  559. enum sctp_sn_type {
  560. SCTP_SN_TYPE_BASE = (1<<15),
  561. SCTP_ASSOC_CHANGE,
  562. #define SCTP_ASSOC_CHANGE SCTP_ASSOC_CHANGE
  563. SCTP_PEER_ADDR_CHANGE,
  564. #define SCTP_PEER_ADDR_CHANGE SCTP_PEER_ADDR_CHANGE
  565. SCTP_SEND_FAILED,
  566. #define SCTP_SEND_FAILED SCTP_SEND_FAILED
  567. SCTP_REMOTE_ERROR,
  568. #define SCTP_REMOTE_ERROR SCTP_REMOTE_ERROR
  569. SCTP_SHUTDOWN_EVENT,
  570. #define SCTP_SHUTDOWN_EVENT SCTP_SHUTDOWN_EVENT
  571. SCTP_PARTIAL_DELIVERY_EVENT,
  572. #define SCTP_PARTIAL_DELIVERY_EVENT SCTP_PARTIAL_DELIVERY_EVENT
  573. SCTP_ADAPTATION_INDICATION,
  574. #define SCTP_ADAPTATION_INDICATION SCTP_ADAPTATION_INDICATION
  575. SCTP_AUTHENTICATION_EVENT,
  576. #define SCTP_AUTHENTICATION_INDICATION SCTP_AUTHENTICATION_EVENT
  577. SCTP_SENDER_DRY_EVENT,
  578. #define SCTP_SENDER_DRY_EVENT SCTP_SENDER_DRY_EVENT
  579. SCTP_STREAM_RESET_EVENT,
  580. #define SCTP_STREAM_RESET_EVENT SCTP_STREAM_RESET_EVENT
  581. SCTP_ASSOC_RESET_EVENT,
  582. #define SCTP_ASSOC_RESET_EVENT SCTP_ASSOC_RESET_EVENT
  583. SCTP_STREAM_CHANGE_EVENT,
  584. #define SCTP_STREAM_CHANGE_EVENT SCTP_STREAM_CHANGE_EVENT
  585. };
  586. /* Notification error codes used to fill up the error fields in some
  587. * notifications.
  588. * SCTP_PEER_ADDRESS_CHAGE : spc_error
  589. * SCTP_ASSOC_CHANGE : sac_error
  590. * These names should be potentially included in the draft 04 of the SCTP
  591. * sockets API specification.
  592. */
  593. typedef enum sctp_sn_error {
  594. SCTP_FAILED_THRESHOLD,
  595. SCTP_RECEIVED_SACK,
  596. SCTP_HEARTBEAT_SUCCESS,
  597. SCTP_RESPONSE_TO_USER_REQ,
  598. SCTP_INTERNAL_ERROR,
  599. SCTP_SHUTDOWN_GUARD_EXPIRES,
  600. SCTP_PEER_FAULTY,
  601. } sctp_sn_error_t;
  602. /*
  603. * 7.1.1 Retransmission Timeout Parameters (SCTP_RTOINFO)
  604. *
  605. * The protocol parameters used to initialize and bound retransmission
  606. * timeout (RTO) are tunable. See [SCTP] for more information on how
  607. * these parameters are used in RTO calculation.
  608. */
  609. struct sctp_rtoinfo {
  610. sctp_assoc_t srto_assoc_id;
  611. __u32 srto_initial;
  612. __u32 srto_max;
  613. __u32 srto_min;
  614. };
  615. /*
  616. * 7.1.2 Association Parameters (SCTP_ASSOCINFO)
  617. *
  618. * This option is used to both examine and set various association and
  619. * endpoint parameters.
  620. */
  621. struct sctp_assocparams {
  622. sctp_assoc_t sasoc_assoc_id;
  623. __u16 sasoc_asocmaxrxt;
  624. __u16 sasoc_number_peer_destinations;
  625. __u32 sasoc_peer_rwnd;
  626. __u32 sasoc_local_rwnd;
  627. __u32 sasoc_cookie_life;
  628. };
  629. /*
  630. * 7.1.9 Set Peer Primary Address (SCTP_SET_PEER_PRIMARY_ADDR)
  631. *
  632. * Requests that the peer mark the enclosed address as the association
  633. * primary. The enclosed address must be one of the association's
  634. * locally bound addresses. The following structure is used to make a
  635. * set primary request:
  636. */
  637. struct sctp_setpeerprim {
  638. sctp_assoc_t sspp_assoc_id;
  639. struct sockaddr_storage sspp_addr;
  640. } __attribute__((packed, aligned(4)));
  641. /*
  642. * 7.1.10 Set Primary Address (SCTP_PRIMARY_ADDR)
  643. *
  644. * Requests that the local SCTP stack use the enclosed peer address as
  645. * the association primary. The enclosed address must be one of the
  646. * association peer's addresses. The following structure is used to
  647. * make a set peer primary request:
  648. */
  649. struct sctp_prim {
  650. sctp_assoc_t ssp_assoc_id;
  651. struct sockaddr_storage ssp_addr;
  652. } __attribute__((packed, aligned(4)));
  653. /* For backward compatibility use, define the old name too */
  654. #define sctp_setprim sctp_prim
  655. /*
  656. * 7.1.11 Set Adaptation Layer Indicator (SCTP_ADAPTATION_LAYER)
  657. *
  658. * Requests that the local endpoint set the specified Adaptation Layer
  659. * Indication parameter for all future INIT and INIT-ACK exchanges.
  660. */
  661. struct sctp_setadaptation {
  662. __u32 ssb_adaptation_ind;
  663. };
  664. /*
  665. * 7.1.13 Peer Address Parameters (SCTP_PEER_ADDR_PARAMS)
  666. *
  667. * Applications can enable or disable heartbeats for any peer address
  668. * of an association, modify an address's heartbeat interval, force a
  669. * heartbeat to be sent immediately, and adjust the address's maximum
  670. * number of retransmissions sent before an address is considered
  671. * unreachable. The following structure is used to access and modify an
  672. * address's parameters:
  673. */
  674. enum sctp_spp_flags {
  675. SPP_HB_ENABLE = 1<<0, /*Enable heartbeats*/
  676. SPP_HB_DISABLE = 1<<1, /*Disable heartbeats*/
  677. SPP_HB = SPP_HB_ENABLE | SPP_HB_DISABLE,
  678. SPP_HB_DEMAND = 1<<2, /*Send heartbeat immediately*/
  679. SPP_PMTUD_ENABLE = 1<<3, /*Enable PMTU discovery*/
  680. SPP_PMTUD_DISABLE = 1<<4, /*Disable PMTU discovery*/
  681. SPP_PMTUD = SPP_PMTUD_ENABLE | SPP_PMTUD_DISABLE,
  682. SPP_SACKDELAY_ENABLE = 1<<5, /*Enable SACK*/
  683. SPP_SACKDELAY_DISABLE = 1<<6, /*Disable SACK*/
  684. SPP_SACKDELAY = SPP_SACKDELAY_ENABLE | SPP_SACKDELAY_DISABLE,
  685. SPP_HB_TIME_IS_ZERO = 1<<7, /* Set HB delay to 0 */
  686. };
  687. struct sctp_paddrparams {
  688. sctp_assoc_t spp_assoc_id;
  689. struct sockaddr_storage spp_address;
  690. __u32 spp_hbinterval;
  691. __u16 spp_pathmaxrxt;
  692. __u32 spp_pathmtu;
  693. __u32 spp_sackdelay;
  694. __u32 spp_flags;
  695. } __attribute__((packed, aligned(4)));
  696. /*
  697. * 7.1.18. Add a chunk that must be authenticated (SCTP_AUTH_CHUNK)
  698. *
  699. * This set option adds a chunk type that the user is requesting to be
  700. * received only in an authenticated way. Changes to the list of chunks
  701. * will only effect future associations on the socket.
  702. */
  703. struct sctp_authchunk {
  704. __u8 sauth_chunk;
  705. };
  706. /*
  707. * 7.1.19. Get or set the list of supported HMAC Identifiers (SCTP_HMAC_IDENT)
  708. *
  709. * This option gets or sets the list of HMAC algorithms that the local
  710. * endpoint requires the peer to use.
  711. */
  712. #ifndef __KERNEL__
  713. /* This here is only used by user space as is. It might not be a good idea
  714. * to export/reveal the whole structure with reserved fields etc.
  715. */
  716. enum {
  717. SCTP_AUTH_HMAC_ID_SHA1 = 1,
  718. SCTP_AUTH_HMAC_ID_SHA256 = 3,
  719. };
  720. #endif
  721. struct sctp_hmacalgo {
  722. __u32 shmac_num_idents;
  723. __u16 shmac_idents[];
  724. };
  725. /* Sadly, user and kernel space have different names for
  726. * this structure member, so this is to not break anything.
  727. */
  728. #define shmac_number_of_idents shmac_num_idents
  729. /*
  730. * 7.1.20. Set a shared key (SCTP_AUTH_KEY)
  731. *
  732. * This option will set a shared secret key which is used to build an
  733. * association shared key.
  734. */
  735. struct sctp_authkey {
  736. sctp_assoc_t sca_assoc_id;
  737. __u16 sca_keynumber;
  738. __u16 sca_keylength;
  739. __u8 sca_key[];
  740. };
  741. /*
  742. * 7.1.21. Get or set the active shared key (SCTP_AUTH_ACTIVE_KEY)
  743. *
  744. * This option will get or set the active shared key to be used to build
  745. * the association shared key.
  746. */
  747. struct sctp_authkeyid {
  748. sctp_assoc_t scact_assoc_id;
  749. __u16 scact_keynumber;
  750. };
  751. /*
  752. * 7.1.23. Get or set delayed ack timer (SCTP_DELAYED_SACK)
  753. *
  754. * This option will effect the way delayed acks are performed. This
  755. * option allows you to get or set the delayed ack time, in
  756. * milliseconds. It also allows changing the delayed ack frequency.
  757. * Changing the frequency to 1 disables the delayed sack algorithm. If
  758. * the assoc_id is 0, then this sets or gets the endpoints default
  759. * values. If the assoc_id field is non-zero, then the set or get
  760. * effects the specified association for the one to many model (the
  761. * assoc_id field is ignored by the one to one model). Note that if
  762. * sack_delay or sack_freq are 0 when setting this option, then the
  763. * current values will remain unchanged.
  764. */
  765. struct sctp_sack_info {
  766. sctp_assoc_t sack_assoc_id;
  767. uint32_t sack_delay;
  768. uint32_t sack_freq;
  769. };
  770. struct sctp_assoc_value {
  771. sctp_assoc_t assoc_id;
  772. uint32_t assoc_value;
  773. };
  774. struct sctp_stream_value {
  775. sctp_assoc_t assoc_id;
  776. uint16_t stream_id;
  777. uint16_t stream_value;
  778. };
  779. /*
  780. * 7.2.2 Peer Address Information
  781. *
  782. * Applications can retrieve information about a specific peer address
  783. * of an association, including its reachability state, congestion
  784. * window, and retransmission timer values. This information is
  785. * read-only. The following structure is used to access this
  786. * information:
  787. */
  788. struct sctp_paddrinfo {
  789. sctp_assoc_t spinfo_assoc_id;
  790. struct sockaddr_storage spinfo_address;
  791. __s32 spinfo_state;
  792. __u32 spinfo_cwnd;
  793. __u32 spinfo_srtt;
  794. __u32 spinfo_rto;
  795. __u32 spinfo_mtu;
  796. } __attribute__((packed, aligned(4)));
  797. /* Peer addresses's state. */
  798. /* UNKNOWN: Peer address passed by the upper layer in sendmsg or connect[x]
  799. * calls.
  800. * UNCONFIRMED: Peer address received in INIT/INIT-ACK address parameters.
  801. * Not yet confirmed by a heartbeat and not available for data
  802. * transfers.
  803. * ACTIVE : Peer address confirmed, active and available for data transfers.
  804. * INACTIVE: Peer address inactive and not available for data transfers.
  805. */
  806. enum sctp_spinfo_state {
  807. SCTP_INACTIVE,
  808. SCTP_PF,
  809. SCTP_ACTIVE,
  810. SCTP_UNCONFIRMED,
  811. SCTP_UNKNOWN = 0xffff /* Value used for transport state unknown */
  812. };
  813. /*
  814. * 7.2.1 Association Status (SCTP_STATUS)
  815. *
  816. * Applications can retrieve current status information about an
  817. * association, including association state, peer receiver window size,
  818. * number of unacked data chunks, and number of data chunks pending
  819. * receipt. This information is read-only. The following structure is
  820. * used to access this information:
  821. */
  822. struct sctp_status {
  823. sctp_assoc_t sstat_assoc_id;
  824. __s32 sstat_state;
  825. __u32 sstat_rwnd;
  826. __u16 sstat_unackdata;
  827. __u16 sstat_penddata;
  828. __u16 sstat_instrms;
  829. __u16 sstat_outstrms;
  830. __u32 sstat_fragmentation_point;
  831. struct sctp_paddrinfo sstat_primary;
  832. };
  833. /*
  834. * 7.2.3. Get the list of chunks the peer requires to be authenticated
  835. * (SCTP_PEER_AUTH_CHUNKS)
  836. *
  837. * This option gets a list of chunks for a specified association that
  838. * the peer requires to be received authenticated only.
  839. */
  840. struct sctp_authchunks {
  841. sctp_assoc_t gauth_assoc_id;
  842. __u32 gauth_number_of_chunks;
  843. uint8_t gauth_chunks[];
  844. };
  845. /* The broken spelling has been released already in lksctp-tools header,
  846. * so don't break anyone, now that it's fixed.
  847. */
  848. #define guth_number_of_chunks gauth_number_of_chunks
  849. /* Association states. */
  850. enum sctp_sstat_state {
  851. SCTP_EMPTY = 0,
  852. SCTP_CLOSED = 1,
  853. SCTP_COOKIE_WAIT = 2,
  854. SCTP_COOKIE_ECHOED = 3,
  855. SCTP_ESTABLISHED = 4,
  856. SCTP_SHUTDOWN_PENDING = 5,
  857. SCTP_SHUTDOWN_SENT = 6,
  858. SCTP_SHUTDOWN_RECEIVED = 7,
  859. SCTP_SHUTDOWN_ACK_SENT = 8,
  860. };
  861. /*
  862. * 8.2.6. Get the Current Identifiers of Associations
  863. * (SCTP_GET_ASSOC_ID_LIST)
  864. *
  865. * This option gets the current list of SCTP association identifiers of
  866. * the SCTP associations handled by a one-to-many style socket.
  867. */
  868. struct sctp_assoc_ids {
  869. __u32 gaids_number_of_ids;
  870. sctp_assoc_t gaids_assoc_id[];
  871. };
  872. /*
  873. * 8.3, 8.5 get all peer/local addresses in an association.
  874. * This parameter struct is used by SCTP_GET_PEER_ADDRS and
  875. * SCTP_GET_LOCAL_ADDRS socket options used internally to implement
  876. * sctp_getpaddrs() and sctp_getladdrs() API.
  877. */
  878. struct sctp_getaddrs_old {
  879. sctp_assoc_t assoc_id;
  880. int addr_num;
  881. #ifdef __KERNEL__
  882. struct sockaddr __user *addrs;
  883. #else
  884. struct sockaddr *addrs;
  885. #endif
  886. };
  887. struct sctp_getaddrs {
  888. sctp_assoc_t assoc_id; /*input*/
  889. __u32 addr_num; /*output*/
  890. __u8 addrs[0]; /*output, variable size*/
  891. };
  892. /* A socket user request obtained via SCTP_GET_ASSOC_STATS that retrieves
  893. * association stats. All stats are counts except sas_maxrto and
  894. * sas_obs_rto_ipaddr. maxrto is the max observed rto + transport since
  895. * the last call. Will return 0 when RTO was not update since last call
  896. */
  897. struct sctp_assoc_stats {
  898. sctp_assoc_t sas_assoc_id; /* Input */
  899. /* Transport of observed max RTO */
  900. struct sockaddr_storage sas_obs_rto_ipaddr;
  901. __u64 sas_maxrto; /* Maximum Observed RTO for period */
  902. __u64 sas_isacks; /* SACKs received */
  903. __u64 sas_osacks; /* SACKs sent */
  904. __u64 sas_opackets; /* Packets sent */
  905. __u64 sas_ipackets; /* Packets received */
  906. __u64 sas_rtxchunks; /* Retransmitted Chunks */
  907. __u64 sas_outofseqtsns;/* TSN received > next expected */
  908. __u64 sas_idupchunks; /* Dups received (ordered+unordered) */
  909. __u64 sas_gapcnt; /* Gap Acknowledgements Received */
  910. __u64 sas_ouodchunks; /* Unordered data chunks sent */
  911. __u64 sas_iuodchunks; /* Unordered data chunks received */
  912. __u64 sas_oodchunks; /* Ordered data chunks sent */
  913. __u64 sas_iodchunks; /* Ordered data chunks received */
  914. __u64 sas_octrlchunks; /* Control chunks sent */
  915. __u64 sas_ictrlchunks; /* Control chunks received */
  916. };
  917. /*
  918. * 8.1 sctp_bindx()
  919. *
  920. * The flags parameter is formed from the bitwise OR of zero or more of the
  921. * following currently defined flags:
  922. */
  923. #define SCTP_BINDX_ADD_ADDR 0x01
  924. #define SCTP_BINDX_REM_ADDR 0x02
  925. /* This is the structure that is passed as an argument(optval) to
  926. * getsockopt(SCTP_SOCKOPT_PEELOFF).
  927. */
  928. typedef struct {
  929. sctp_assoc_t associd;
  930. int sd;
  931. } sctp_peeloff_arg_t;
  932. typedef struct {
  933. sctp_peeloff_arg_t p_arg;
  934. unsigned flags;
  935. } sctp_peeloff_flags_arg_t;
  936. /*
  937. * Peer Address Thresholds socket option
  938. */
  939. struct sctp_paddrthlds {
  940. sctp_assoc_t spt_assoc_id;
  941. struct sockaddr_storage spt_address;
  942. __u16 spt_pathmaxrxt;
  943. __u16 spt_pathpfthld;
  944. };
  945. /*
  946. * Socket Option for Getting the Association/Stream-Specific PR-SCTP Status
  947. */
  948. struct sctp_prstatus {
  949. sctp_assoc_t sprstat_assoc_id;
  950. __u16 sprstat_sid;
  951. __u16 sprstat_policy;
  952. __u64 sprstat_abandoned_unsent;
  953. __u64 sprstat_abandoned_sent;
  954. };
  955. struct sctp_default_prinfo {
  956. sctp_assoc_t pr_assoc_id;
  957. __u32 pr_value;
  958. __u16 pr_policy;
  959. };
  960. struct sctp_info {
  961. __u32 sctpi_tag;
  962. __u32 sctpi_state;
  963. __u32 sctpi_rwnd;
  964. __u16 sctpi_unackdata;
  965. __u16 sctpi_penddata;
  966. __u16 sctpi_instrms;
  967. __u16 sctpi_outstrms;
  968. __u32 sctpi_fragmentation_point;
  969. __u32 sctpi_inqueue;
  970. __u32 sctpi_outqueue;
  971. __u32 sctpi_overall_error;
  972. __u32 sctpi_max_burst;
  973. __u32 sctpi_maxseg;
  974. __u32 sctpi_peer_rwnd;
  975. __u32 sctpi_peer_tag;
  976. __u8 sctpi_peer_capable;
  977. __u8 sctpi_peer_sack;
  978. __u16 __reserved1;
  979. /* assoc status info */
  980. __u64 sctpi_isacks;
  981. __u64 sctpi_osacks;
  982. __u64 sctpi_opackets;
  983. __u64 sctpi_ipackets;
  984. __u64 sctpi_rtxchunks;
  985. __u64 sctpi_outofseqtsns;
  986. __u64 sctpi_idupchunks;
  987. __u64 sctpi_gapcnt;
  988. __u64 sctpi_ouodchunks;
  989. __u64 sctpi_iuodchunks;
  990. __u64 sctpi_oodchunks;
  991. __u64 sctpi_iodchunks;
  992. __u64 sctpi_octrlchunks;
  993. __u64 sctpi_ictrlchunks;
  994. /* primary transport info */
  995. struct sockaddr_storage sctpi_p_address;
  996. __s32 sctpi_p_state;
  997. __u32 sctpi_p_cwnd;
  998. __u32 sctpi_p_srtt;
  999. __u32 sctpi_p_rto;
  1000. __u32 sctpi_p_hbinterval;
  1001. __u32 sctpi_p_pathmaxrxt;
  1002. __u32 sctpi_p_sackdelay;
  1003. __u32 sctpi_p_sackfreq;
  1004. __u32 sctpi_p_ssthresh;
  1005. __u32 sctpi_p_partial_bytes_acked;
  1006. __u32 sctpi_p_flight_size;
  1007. __u16 sctpi_p_error;
  1008. __u16 __reserved2;
  1009. /* sctp sock info */
  1010. __u32 sctpi_s_autoclose;
  1011. __u32 sctpi_s_adaptation_ind;
  1012. __u32 sctpi_s_pd_point;
  1013. __u8 sctpi_s_nodelay;
  1014. __u8 sctpi_s_disable_fragments;
  1015. __u8 sctpi_s_v4mapped;
  1016. __u8 sctpi_s_frag_interleave;
  1017. __u32 sctpi_s_type;
  1018. __u32 __reserved3;
  1019. };
  1020. struct sctp_reset_streams {
  1021. sctp_assoc_t srs_assoc_id;
  1022. uint16_t srs_flags;
  1023. uint16_t srs_number_streams; /* 0 == ALL */
  1024. uint16_t srs_stream_list[]; /* list if srs_num_streams is not 0 */
  1025. };
  1026. struct sctp_add_streams {
  1027. sctp_assoc_t sas_assoc_id;
  1028. uint16_t sas_instrms;
  1029. uint16_t sas_outstrms;
  1030. };
  1031. /* SCTP Stream schedulers */
  1032. enum sctp_sched_type {
  1033. SCTP_SS_FCFS,
  1034. SCTP_SS_PRIO,
  1035. SCTP_SS_RR,
  1036. SCTP_SS_MAX = SCTP_SS_RR
  1037. };
  1038. #endif /* _UAPI_SCTP_H */