xref: /freebsd/sys/netinet/sctp.h (revision 59b6d5be)
1f8829a4aSRandall Stewart /*-
2830d754dSRandall Stewart  * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved.
3807aad63SMichael Tuexen  * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
4807aad63SMichael Tuexen  * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
5f8829a4aSRandall Stewart  *
6f8829a4aSRandall Stewart  * Redistribution and use in source and binary forms, with or without
7f8829a4aSRandall Stewart  * modification, are permitted provided that the following conditions are met:
8f8829a4aSRandall Stewart  *
9f8829a4aSRandall Stewart  * a) Redistributions of source code must retain the above copyright notice,
10f8829a4aSRandall Stewart  *    this list of conditions and the following disclaimer.
11f8829a4aSRandall Stewart  *
12f8829a4aSRandall Stewart  * b) Redistributions in binary form must reproduce the above copyright
13f8829a4aSRandall Stewart  *    notice, this list of conditions and the following disclaimer in
14f8829a4aSRandall Stewart  *    the documentation and/or other materials provided with the distribution.
15f8829a4aSRandall Stewart  *
16f8829a4aSRandall Stewart  * c) Neither the name of Cisco Systems, Inc. nor the names of its
17f8829a4aSRandall Stewart  *    contributors may be used to endorse or promote products derived
18f8829a4aSRandall Stewart  *    from this software without specific prior written permission.
19f8829a4aSRandall Stewart  *
20f8829a4aSRandall Stewart  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21f8829a4aSRandall Stewart  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22f8829a4aSRandall Stewart  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23f8829a4aSRandall Stewart  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24f8829a4aSRandall Stewart  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25f8829a4aSRandall Stewart  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26f8829a4aSRandall Stewart  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27f8829a4aSRandall Stewart  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28f8829a4aSRandall Stewart  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29f8829a4aSRandall Stewart  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30f8829a4aSRandall Stewart  * THE POSSIBILITY OF SUCH DAMAGE.
31f8829a4aSRandall Stewart  */
32f8829a4aSRandall Stewart 
33f8829a4aSRandall Stewart #include <sys/cdefs.h>
34f8829a4aSRandall Stewart __FBSDID("$FreeBSD$");
35f8829a4aSRandall Stewart 
36f8829a4aSRandall Stewart #ifndef _NETINET_SCTP_H_
37f8829a4aSRandall Stewart #define _NETINET_SCTP_H_
38f8829a4aSRandall Stewart 
39807aad63SMichael Tuexen 
40f8829a4aSRandall Stewart #include <sys/types.h>
41f8829a4aSRandall Stewart 
42b3f1ea41SRandall Stewart 
43b3f1ea41SRandall Stewart #define SCTP_PACKED __attribute__((packed))
44b3f1ea41SRandall Stewart 
45f8829a4aSRandall Stewart /*
4603192574SMichael Tuexen  * SCTP protocol - RFC4960.
47f8829a4aSRandall Stewart  */
48f8829a4aSRandall Stewart struct sctphdr {
49f8829a4aSRandall Stewart 	uint16_t src_port;	/* source port */
50f8829a4aSRandall Stewart 	uint16_t dest_port;	/* destination port */
51f8829a4aSRandall Stewart 	uint32_t v_tag;		/* verification tag of packet */
5203192574SMichael Tuexen 	uint32_t checksum;	/* CRC32C checksum */
53f8829a4aSRandall Stewart 	/* chunks follow... */
54b3f1ea41SRandall Stewart }       SCTP_PACKED;
55f8829a4aSRandall Stewart 
56f8829a4aSRandall Stewart /*
57f8829a4aSRandall Stewart  * SCTP Chunks
58f8829a4aSRandall Stewart  */
59f8829a4aSRandall Stewart struct sctp_chunkhdr {
60f8829a4aSRandall Stewart 	uint8_t chunk_type;	/* chunk type */
61f8829a4aSRandall Stewart 	uint8_t chunk_flags;	/* chunk flags */
62f8829a4aSRandall Stewart 	uint16_t chunk_length;	/* chunk length */
63f8829a4aSRandall Stewart 	/* optional params follow */
64b3f1ea41SRandall Stewart }             SCTP_PACKED;
65f8829a4aSRandall Stewart 
66f8829a4aSRandall Stewart /*
67f8829a4aSRandall Stewart  * SCTP chunk parameters
68f8829a4aSRandall Stewart  */
69f8829a4aSRandall Stewart struct sctp_paramhdr {
70f8829a4aSRandall Stewart 	uint16_t param_type;	/* parameter type */
71f8829a4aSRandall Stewart 	uint16_t param_length;	/* parameter length */
72b3f1ea41SRandall Stewart }             SCTP_PACKED;
73f8829a4aSRandall Stewart 
74f8829a4aSRandall Stewart /*
75f8829a4aSRandall Stewart  * user socket options: socket API defined
76f8829a4aSRandall Stewart  */
77f8829a4aSRandall Stewart /*
78f8829a4aSRandall Stewart  * read-write options
79f8829a4aSRandall Stewart  */
80f8829a4aSRandall Stewart #define SCTP_RTOINFO			0x00000001
81f8829a4aSRandall Stewart #define SCTP_ASSOCINFO			0x00000002
82f8829a4aSRandall Stewart #define SCTP_INITMSG			0x00000003
83f8829a4aSRandall Stewart #define SCTP_NODELAY			0x00000004
84f8829a4aSRandall Stewart #define SCTP_AUTOCLOSE			0x00000005
85f8829a4aSRandall Stewart #define SCTP_SET_PEER_PRIMARY_ADDR	0x00000006
86f8829a4aSRandall Stewart #define SCTP_PRIMARY_ADDR		0x00000007
87f8829a4aSRandall Stewart #define SCTP_ADAPTATION_LAYER		0x00000008
88f8829a4aSRandall Stewart /* same as above */
89f8829a4aSRandall Stewart #define SCTP_ADAPTION_LAYER		0x00000008
90f8829a4aSRandall Stewart #define SCTP_DISABLE_FRAGMENTS		0x00000009
91f8829a4aSRandall Stewart #define SCTP_PEER_ADDR_PARAMS 		0x0000000a
92f8829a4aSRandall Stewart #define SCTP_DEFAULT_SEND_PARAM		0x0000000b
93f8829a4aSRandall Stewart /* ancillary data/notification interest options */
94e2e7c62eSMichael Tuexen #define SCTP_EVENTS			0x0000000c	/* deprecated */
95f8829a4aSRandall Stewart /* Without this applied we will give V4 and V6 addresses on a V6 socket */
96f8829a4aSRandall Stewart #define SCTP_I_WANT_MAPPED_V4_ADDR	0x0000000d
97f8829a4aSRandall Stewart #define SCTP_MAXSEG 			0x0000000e
98d61a0ae0SRandall Stewart #define SCTP_DELAYED_SACK               0x0000000f
99f8829a4aSRandall Stewart #define SCTP_FRAGMENT_INTERLEAVE        0x00000010
100f8829a4aSRandall Stewart #define SCTP_PARTIAL_DELIVERY_POINT     0x00000011
101f8829a4aSRandall Stewart /* authentication support */
102f8829a4aSRandall Stewart #define SCTP_AUTH_CHUNK 		0x00000012
103f8829a4aSRandall Stewart #define SCTP_AUTH_KEY 			0x00000013
104f8829a4aSRandall Stewart #define SCTP_HMAC_IDENT 		0x00000014
105f8829a4aSRandall Stewart #define SCTP_AUTH_ACTIVE_KEY 		0x00000015
106f8829a4aSRandall Stewart #define SCTP_AUTH_DELETE_KEY 		0x00000016
107f8829a4aSRandall Stewart #define SCTP_USE_EXT_RCVINFO		0x00000017
108f8829a4aSRandall Stewart #define SCTP_AUTO_ASCONF		0x00000018	/* rw */
109f8829a4aSRandall Stewart #define SCTP_MAXBURST			0x00000019	/* rw */
110d61a0ae0SRandall Stewart #define SCTP_MAX_BURST			0x00000019	/* rw */
111f8829a4aSRandall Stewart /* assoc level context */
112f8829a4aSRandall Stewart #define SCTP_CONTEXT                    0x0000001a	/* rw */
113b1ce21c6SRebecca Cran /* explicit EOR signalling */
114f8829a4aSRandall Stewart #define SCTP_EXPLICIT_EOR               0x0000001b
1156d9e8f2bSRandall Stewart #define SCTP_REUSE_PORT                 0x0000001c	/* rw */
116830d754dSRandall Stewart #define SCTP_AUTH_DEACTIVATE_KEY	0x0000001d
117e2e7c62eSMichael Tuexen #define SCTP_EVENT                      0x0000001e
118e2e7c62eSMichael Tuexen #define SCTP_RECVRCVINFO                0x0000001f
119e2e7c62eSMichael Tuexen #define SCTP_RECVNXTINFO                0x00000020
120e2e7c62eSMichael Tuexen #define SCTP_DEFAULT_SNDINFO            0x00000021
1216037f89cSMichael Tuexen #define SCTP_DEFAULT_PRINFO             0x00000022
122ca85e948SMichael Tuexen #define SCTP_PEER_ADDR_THLDS            0x00000023
123c9c58059SMichael Tuexen #define SCTP_REMOTE_UDP_ENCAPS_PORT     0x00000024
124f342355aSMichael Tuexen #define SCTP_ECN_SUPPORTED              0x00000025
125dd973b0eSMichael Tuexen #define SCTP_PR_SUPPORTED               0x00000026
126c79bec9cSMichael Tuexen #define SCTP_AUTH_SUPPORTED             0x00000027
127c79bec9cSMichael Tuexen #define SCTP_ASCONF_SUPPORTED           0x00000028
128317e00efSMichael Tuexen #define SCTP_RECONFIG_SUPPORTED         0x00000029
129c79bec9cSMichael Tuexen #define SCTP_NRSACK_SUPPORTED           0x00000030
130c79bec9cSMichael Tuexen #define SCTP_PKTDROP_SUPPORTED          0x00000031
13159b6d5beSMichael Tuexen #define SCTP_MAX_CWND                   0x00000032
132f8829a4aSRandall Stewart 
133f8829a4aSRandall Stewart /*
134f8829a4aSRandall Stewart  * read-only options
135f8829a4aSRandall Stewart  */
136f8829a4aSRandall Stewart #define SCTP_STATUS			0x00000100
137f8829a4aSRandall Stewart #define SCTP_GET_PEER_ADDR_INFO		0x00000101
138f8829a4aSRandall Stewart /* authentication support */
139f8829a4aSRandall Stewart #define SCTP_PEER_AUTH_CHUNKS 		0x00000102
140f8829a4aSRandall Stewart #define SCTP_LOCAL_AUTH_CHUNKS 		0x00000103
1413c503c28SRandall Stewart #define SCTP_GET_ASSOC_NUMBER           0x00000104	/* ro */
1423c503c28SRandall Stewart #define SCTP_GET_ASSOC_ID_LIST          0x00000105	/* ro */
1436a67588bSMichael Tuexen #define SCTP_TIMEOUTS                   0x00000106
144f0396ad1SMichael Tuexen #define SCTP_PR_STREAM_STATUS           0x00000107
145f0396ad1SMichael Tuexen #define SCTP_PR_ASSOC_STATUS            0x00000108
146f8829a4aSRandall Stewart 
147f8829a4aSRandall Stewart /*
148f8829a4aSRandall Stewart  * user socket options: BSD implementation specific
149f8829a4aSRandall Stewart  */
150f8829a4aSRandall Stewart /*
151f8829a4aSRandall Stewart  * Blocking I/O is enabled on any TCP type socket by default. For the UDP
152f8829a4aSRandall Stewart  * model if this is turned on then the socket buffer is shared for send
153f8829a4aSRandall Stewart  * resources amongst all associations.  The default for the UDP model is that
154b1ce21c6SRebecca Cran  * is SS_NBIO is set.  Which means all associations have a separate send
155f8829a4aSRandall Stewart  * limit BUT they will NOT ever BLOCK instead you will get an error back
156b1ce21c6SRebecca Cran  * EAGAIN if you try to send too much. If you want the blocking semantics you
157f8829a4aSRandall Stewart  * set this option at the cost of sharing one socket send buffer size amongst
158f8829a4aSRandall Stewart  * all associations. Peeled off sockets turn this option off and block. But
159f8829a4aSRandall Stewart  * since both TCP and peeled off sockets have only one assoc per socket this
160f8829a4aSRandall Stewart  * is fine. It probably does NOT make sense to set this on SS_NBIO on a TCP
161f8829a4aSRandall Stewart  * model OR peeled off UDP model, but we do allow you to do so. You just use
162f8829a4aSRandall Stewart  * the normal syscall to toggle SS_NBIO the way you want.
163f8829a4aSRandall Stewart  *
164b1ce21c6SRebecca Cran  * Blocking I/O is controlled by the SS_NBIO flag on the socket state so_state
165f8829a4aSRandall Stewart  * field.
166f8829a4aSRandall Stewart  */
167f8829a4aSRandall Stewart 
168c4e848b7SRandall Stewart #define SCTP_ENABLE_STREAM_RESET	0x00000900	/* struct
169c4e848b7SRandall Stewart 							 * sctp_assoc_value */
170c4e848b7SRandall Stewart #define SCTP_RESET_STREAMS		0x00000901	/* struct
171c4e848b7SRandall Stewart 							 * sctp_reset_streams */
172c4e848b7SRandall Stewart #define SCTP_RESET_ASSOC		0x00000902	/* sctp_assoc_t */
173c4e848b7SRandall Stewart #define SCTP_ADD_STREAMS		0x00000903	/* struct
174c4e848b7SRandall Stewart 							 * sctp_add_streams */
175c4e848b7SRandall Stewart 
176c4e848b7SRandall Stewart /* For enable stream reset */
177c4e848b7SRandall Stewart #define SCTP_ENABLE_RESET_STREAM_REQ 	0x00000001
178c4e848b7SRandall Stewart #define SCTP_ENABLE_RESET_ASSOC_REQ 	0x00000002
179c4e848b7SRandall Stewart #define SCTP_ENABLE_CHANGE_ASSOC_REQ 	0x00000004
180c4e848b7SRandall Stewart #define SCTP_ENABLE_VALUE_MASK		0x00000007
181c4e848b7SRandall Stewart /* For reset streams */
182c4e848b7SRandall Stewart #define SCTP_STREAM_RESET_INCOMING	0x00000001
183c4e848b7SRandall Stewart #define SCTP_STREAM_RESET_OUTGOING	0x00000002
184f8829a4aSRandall Stewart 
185f8829a4aSRandall Stewart 
186f8829a4aSRandall Stewart /* here on down are more implementation specific */
187f8829a4aSRandall Stewart #define SCTP_SET_DEBUG_LEVEL		0x00001005
188f8829a4aSRandall Stewart #define SCTP_CLR_STAT_LOG               0x00001007
189f8829a4aSRandall Stewart /* CMT ON/OFF socket option */
190f8829a4aSRandall Stewart #define SCTP_CMT_ON_OFF                 0x00001200
191f8829a4aSRandall Stewart #define SCTP_CMT_USE_DAC                0x00001201
192b54d3a6cSRandall Stewart /* JRS - Pluggable Congestion Control Socket option */
193b54d3a6cSRandall Stewart #define SCTP_PLUGGABLE_CC               0x00001202
194f7a77f6fSMichael Tuexen /* RS - Pluggable Stream Scheduling Socket option */
195f7a77f6fSMichael Tuexen #define SCTP_PLUGGABLE_SS		0x00001203
196f7a77f6fSMichael Tuexen #define SCTP_SS_VALUE			0x00001204
197299108c5SRandall Stewart #define SCTP_CC_OPTION			0x00001205	/* Options for CC
198299108c5SRandall Stewart 							 * modules */
199f8829a4aSRandall Stewart /* read only */
200f8829a4aSRandall Stewart #define SCTP_GET_SNDBUF_USE		0x00001101
201f8829a4aSRandall Stewart #define SCTP_GET_STAT_LOG		0x00001103
2023c503c28SRandall Stewart #define SCTP_PCB_STATUS			0x00001104
2033c503c28SRandall Stewart #define SCTP_GET_NONCE_VALUES           0x00001105
204f8829a4aSRandall Stewart 
205207304d4SRandall Stewart 
20642551e99SRandall Stewart /* Special hook for dynamically setting primary for all assoc's,
207b1ce21c6SRebecca Cran  * this is a write only option that requires root privilege.
20842551e99SRandall Stewart  */
20942551e99SRandall Stewart #define SCTP_SET_DYNAMIC_PRIMARY        0x00002001
210f8829a4aSRandall Stewart 
21142551e99SRandall Stewart /* VRF (virtual router feature) and multi-VRF support
21242551e99SRandall Stewart  * options. VRF's provide splits within a router
21342551e99SRandall Stewart  * that give the views of multiple routers. A
21442551e99SRandall Stewart  * standard host, without VRF support, is just
21542551e99SRandall Stewart  * a single VRF. If VRF's are supported then
21642551e99SRandall Stewart  * the transport must be VRF aware. This means
21742551e99SRandall Stewart  * that every socket call coming in must be directed
21842551e99SRandall Stewart  * within the endpoint to one of the VRF's it belongs
21942551e99SRandall Stewart  * to. The endpoint, before binding, may select
22042551e99SRandall Stewart  * the "default" VRF it is in by using a set socket
22142551e99SRandall Stewart  * option with SCTP_VRF_ID. This will also
222b1ce21c6SRebecca Cran  * get propagated to the default VRF. Once the
22342551e99SRandall Stewart  * endpoint binds an address then it CANNOT add
22442551e99SRandall Stewart  * additional VRF's to become a Multi-VRF endpoint.
22542551e99SRandall Stewart  *
22642551e99SRandall Stewart  * Before BINDING additional VRF's can be added with
22742551e99SRandall Stewart  * the SCTP_ADD_VRF_ID call or deleted with
22842551e99SRandall Stewart  * SCTP_DEL_VRF_ID.
22942551e99SRandall Stewart  *
23042551e99SRandall Stewart  * Associations are ALWAYS contained inside a single
23142551e99SRandall Stewart  * VRF. They cannot reside in two (or more) VRF's. Incoming
23242551e99SRandall Stewart  * packets, assuming the router is VRF aware, can always
23342551e99SRandall Stewart  * tell us what VRF they arrived on. A host not supporting
23442551e99SRandall Stewart  * any VRF's will find that the packets always arrived on the
23542551e99SRandall Stewart  * single VRF that the host has.
23642551e99SRandall Stewart  *
23742551e99SRandall Stewart  */
23842551e99SRandall Stewart 
23942551e99SRandall Stewart #define SCTP_VRF_ID			0x00003001
24042551e99SRandall Stewart #define SCTP_ADD_VRF_ID			0x00003002
24142551e99SRandall Stewart #define SCTP_GET_VRF_IDS		0x00003003
24242551e99SRandall Stewart #define SCTP_GET_ASOC_VRF               0x00003004
24342551e99SRandall Stewart #define SCTP_DEL_VRF_ID                 0x00003005
244207304d4SRandall Stewart 
245207304d4SRandall Stewart /*
246207304d4SRandall Stewart  * If you enable packet logging you can get
247207304d4SRandall Stewart  * a poor mans ethereal output in binary
248207304d4SRandall Stewart  * form. Note this is a compile option to
249207304d4SRandall Stewart  * the kernel,  SCTP_PACKET_LOGGING, and
250207304d4SRandall Stewart  * without it in your kernel you
2516b4ae356SRandall Stewart  * will get a EOPNOTSUPP
252207304d4SRandall Stewart  */
253207304d4SRandall Stewart #define SCTP_GET_PACKET_LOG             0x00004001
254207304d4SRandall Stewart 
255f8829a4aSRandall Stewart /*
256f8829a4aSRandall Stewart  * hidden implementation specific options these are NOT user visible (should
257f8829a4aSRandall Stewart  * move out of sctp.h)
258f8829a4aSRandall Stewart  */
259f8829a4aSRandall Stewart /* sctp_bindx() flags as hidden socket options */
260f8829a4aSRandall Stewart #define SCTP_BINDX_ADD_ADDR		0x00008001
261f8829a4aSRandall Stewart #define SCTP_BINDX_REM_ADDR		0x00008002
262f8829a4aSRandall Stewart /* Hidden socket option that gets the addresses */
263f8829a4aSRandall Stewart #define SCTP_GET_PEER_ADDRESSES		0x00008003
264f8829a4aSRandall Stewart #define SCTP_GET_LOCAL_ADDRESSES	0x00008004
265f8829a4aSRandall Stewart /* return the total count in bytes needed to hold all local addresses bound */
266f8829a4aSRandall Stewart #define SCTP_GET_LOCAL_ADDR_SIZE	0x00008005
267f8829a4aSRandall Stewart /* Return the total count in bytes needed to hold the remote address */
268f8829a4aSRandall Stewart #define SCTP_GET_REMOTE_ADDR_SIZE	0x00008006
269f8829a4aSRandall Stewart /* hidden option for connectx */
270f8829a4aSRandall Stewart #define SCTP_CONNECT_X			0x00008007
271f8829a4aSRandall Stewart /* hidden option for connectx_delayed, part of sendx */
272f8829a4aSRandall Stewart #define SCTP_CONNECT_X_DELAYED		0x00008008
273f8829a4aSRandall Stewart #define SCTP_CONNECT_X_COMPLETE         0x00008009
274f8829a4aSRandall Stewart /* hidden socket option based sctp_peeloff */
275f8829a4aSRandall Stewart #define SCTP_PEELOFF                    0x0000800a
276f8829a4aSRandall Stewart /* the real worker for sctp_getaddrlen() */
277f8829a4aSRandall Stewart #define SCTP_GET_ADDR_LEN               0x0000800b
278f8829a4aSRandall Stewart /* Debug things that need to be purged */
279f8829a4aSRandall Stewart #define SCTP_SET_INITIAL_DBG_SEQ	0x00009f00
280f8829a4aSRandall Stewart 
281b54d3a6cSRandall Stewart /* JRS - Supported congestion control modules for pluggable
282b54d3a6cSRandall Stewart  * congestion control
283b54d3a6cSRandall Stewart  */
284b54d3a6cSRandall Stewart /* Standard TCP Congestion Control */
285b54d3a6cSRandall Stewart #define SCTP_CC_RFC2581		0x00000000
286b54d3a6cSRandall Stewart /* High Speed TCP Congestion Control (Floyd) */
287b54d3a6cSRandall Stewart #define SCTP_CC_HSTCP		0x00000001
288b54d3a6cSRandall Stewart /* HTCP Congestion Control */
289b54d3a6cSRandall Stewart #define SCTP_CC_HTCP		0x00000002
29048b6c649SRandall Stewart /* RTCC Congestion Control - RFC2581 plus */
29148b6c649SRandall Stewart #define SCTP_CC_RTCC            0x00000003
29248b6c649SRandall Stewart 
29348b6c649SRandall Stewart #define SCTP_CC_OPT_RTCC_SETMODE	0x00002000
29448b6c649SRandall Stewart #define SCTP_CC_OPT_USE_DCCC_ECN	0x00002001
295f79aab18SRandall Stewart #define SCTP_CC_OPT_STEADY_STEP         0x00002002
296b54d3a6cSRandall Stewart 
297c3d72c80SMichael Tuexen #define SCTP_CMT_OFF            0
298c3d72c80SMichael Tuexen #define SCTP_CMT_BASE           1
299c3d72c80SMichael Tuexen #define SCTP_CMT_RPV1           2
300c3d72c80SMichael Tuexen #define SCTP_CMT_RPV2           3
301c3d72c80SMichael Tuexen #define SCTP_CMT_MPTCP          4
302c3d72c80SMichael Tuexen #define SCTP_CMT_MAX            SCTP_CMT_MPTCP
303c3d72c80SMichael Tuexen 
304f7a77f6fSMichael Tuexen /* RS - Supported stream scheduling modules for pluggable
305f7a77f6fSMichael Tuexen  * stream scheduling
306f7a77f6fSMichael Tuexen  */
307f7a77f6fSMichael Tuexen /* Default simple round-robin */
308f7a77f6fSMichael Tuexen #define SCTP_SS_DEFAULT			0x00000000
309f7a77f6fSMichael Tuexen /* Real round-robin */
310f7a77f6fSMichael Tuexen #define SCTP_SS_ROUND_ROBIN		0x00000001
311f7a77f6fSMichael Tuexen /* Real round-robin per packet */
312f7a77f6fSMichael Tuexen #define SCTP_SS_ROUND_ROBIN_PACKET	0x00000002
313f7a77f6fSMichael Tuexen /* Priority */
314f7a77f6fSMichael Tuexen #define SCTP_SS_PRIORITY		0x00000003
315f7a77f6fSMichael Tuexen /* Fair Bandwidth */
316f7a77f6fSMichael Tuexen #define SCTP_SS_FAIR_BANDWITH		0x00000004
317f7a77f6fSMichael Tuexen /* First-come, first-serve */
318f7a77f6fSMichael Tuexen #define SCTP_SS_FIRST_COME		0x00000005
319f7a77f6fSMichael Tuexen 
3209a6142d8SRandall Stewart 
3219a6142d8SRandall Stewart /* fragment interleave constants
3229a6142d8SRandall Stewart  * setting must be one of these or
3239a6142d8SRandall Stewart  * EINVAL returned.
3249a6142d8SRandall Stewart  */
3259a6142d8SRandall Stewart #define SCTP_FRAG_LEVEL_0    0x00000000
3269a6142d8SRandall Stewart #define SCTP_FRAG_LEVEL_1    0x00000001
3279a6142d8SRandall Stewart #define SCTP_FRAG_LEVEL_2    0x00000002
3289a6142d8SRandall Stewart 
329f8829a4aSRandall Stewart /*
330f8829a4aSRandall Stewart  * user state values
331f8829a4aSRandall Stewart  */
332f8829a4aSRandall Stewart #define SCTP_CLOSED			0x0000
333f8829a4aSRandall Stewart #define SCTP_BOUND			0x1000
334f8829a4aSRandall Stewart #define SCTP_LISTEN			0x2000
335f8829a4aSRandall Stewart #define SCTP_COOKIE_WAIT		0x0002
336f8829a4aSRandall Stewart #define SCTP_COOKIE_ECHOED		0x0004
337f8829a4aSRandall Stewart #define SCTP_ESTABLISHED		0x0008
338f8829a4aSRandall Stewart #define SCTP_SHUTDOWN_SENT		0x0010
339f8829a4aSRandall Stewart #define SCTP_SHUTDOWN_RECEIVED		0x0020
340f8829a4aSRandall Stewart #define SCTP_SHUTDOWN_ACK_SENT		0x0040
341f8829a4aSRandall Stewart #define SCTP_SHUTDOWN_PENDING		0x0080
342f8829a4aSRandall Stewart 
343f8829a4aSRandall Stewart /*
344f8829a4aSRandall Stewart  * SCTP operational error codes (user visible)
345f8829a4aSRandall Stewart  */
346f8829a4aSRandall Stewart #define SCTP_CAUSE_NO_ERROR		0x0000
347f8829a4aSRandall Stewart #define SCTP_CAUSE_INVALID_STREAM	0x0001
348f8829a4aSRandall Stewart #define SCTP_CAUSE_MISSING_PARAM	0x0002
349f8829a4aSRandall Stewart #define SCTP_CAUSE_STALE_COOKIE		0x0003
350f8829a4aSRandall Stewart #define SCTP_CAUSE_OUT_OF_RESC		0x0004
351f8829a4aSRandall Stewart #define SCTP_CAUSE_UNRESOLVABLE_ADDR	0x0005
352f8829a4aSRandall Stewart #define SCTP_CAUSE_UNRECOG_CHUNK	0x0006
353f8829a4aSRandall Stewart #define SCTP_CAUSE_INVALID_PARAM	0x0007
354f8829a4aSRandall Stewart #define SCTP_CAUSE_UNRECOG_PARAM	0x0008
355f8829a4aSRandall Stewart #define SCTP_CAUSE_NO_USER_DATA		0x0009
356f8829a4aSRandall Stewart #define SCTP_CAUSE_COOKIE_IN_SHUTDOWN	0x000a
357f8829a4aSRandall Stewart #define SCTP_CAUSE_RESTART_W_NEWADDR	0x000b
358f8829a4aSRandall Stewart #define SCTP_CAUSE_USER_INITIATED_ABT	0x000c
359f8829a4aSRandall Stewart #define SCTP_CAUSE_PROTOCOL_VIOLATION	0x000d
360f8829a4aSRandall Stewart 
3613232788eSRandall Stewart /* Error causes from RFC5061 */
362830d754dSRandall Stewart #define SCTP_CAUSE_DELETING_LAST_ADDR	0x00a0
363830d754dSRandall Stewart #define SCTP_CAUSE_RESOURCE_SHORTAGE	0x00a1
364830d754dSRandall Stewart #define SCTP_CAUSE_DELETING_SRC_ADDR	0x00a2
365830d754dSRandall Stewart #define SCTP_CAUSE_ILLEGAL_ASCONF_ACK	0x00a3
366830d754dSRandall Stewart #define SCTP_CAUSE_REQUEST_REFUSED	0x00a4
367830d754dSRandall Stewart 
368830d754dSRandall Stewart /* Error causes from nat-draft */
369830d754dSRandall Stewart #define SCTP_CAUSE_NAT_COLLIDING_STATE  0x00b0
370830d754dSRandall Stewart #define SCTP_CAUSE_NAT_MISSING_STATE    0x00b1
371f8829a4aSRandall Stewart 
3723232788eSRandall Stewart /* Error causes from RFC4895 */
373f8829a4aSRandall Stewart #define SCTP_CAUSE_UNSUPPORTED_HMACID	0x0105
374f8829a4aSRandall Stewart 
375f8829a4aSRandall Stewart /*
376b1ce21c6SRebecca Cran  * error cause parameters (user visible)
377f8829a4aSRandall Stewart  */
378ff1ffd74SMichael Tuexen struct sctp_gen_error_cause {
379ff1ffd74SMichael Tuexen 	uint16_t code;
380ff1ffd74SMichael Tuexen 	uint16_t length;
381ff1ffd74SMichael Tuexen 	uint8_t info[];
382ff1ffd74SMichael Tuexen }                    SCTP_PACKED;
383ff1ffd74SMichael Tuexen 
384f8829a4aSRandall Stewart struct sctp_error_cause {
385f8829a4aSRandall Stewart 	uint16_t code;
386f8829a4aSRandall Stewart 	uint16_t length;
387f8829a4aSRandall Stewart 	/* optional cause-specific info may follow */
388b3f1ea41SRandall Stewart }                SCTP_PACKED;
389f8829a4aSRandall Stewart 
390f8829a4aSRandall Stewart struct sctp_error_invalid_stream {
391b3f1ea41SRandall Stewart 	struct sctp_error_cause cause;	/* code=SCTP_ERROR_INVALID_STREAM */
392f8829a4aSRandall Stewart 	uint16_t stream_id;	/* stream id of the DATA in error */
393f8829a4aSRandall Stewart 	uint16_t reserved;
394b3f1ea41SRandall Stewart }                         SCTP_PACKED;
395f8829a4aSRandall Stewart 
396f8829a4aSRandall Stewart struct sctp_error_missing_param {
397b3f1ea41SRandall Stewart 	struct sctp_error_cause cause;	/* code=SCTP_ERROR_MISSING_PARAM */
398b3f1ea41SRandall Stewart 	uint32_t num_missing_params;	/* number of missing parameters */
399f8829a4aSRandall Stewart 	/* uint16_t param_type's follow */
400b3f1ea41SRandall Stewart }                        SCTP_PACKED;
401f8829a4aSRandall Stewart 
402f8829a4aSRandall Stewart struct sctp_error_stale_cookie {
403b3f1ea41SRandall Stewart 	struct sctp_error_cause cause;	/* code=SCTP_ERROR_STALE_COOKIE */
404f8829a4aSRandall Stewart 	uint32_t stale_time;	/* time in usec of staleness */
405b3f1ea41SRandall Stewart }                       SCTP_PACKED;
406f8829a4aSRandall Stewart 
407f8829a4aSRandall Stewart struct sctp_error_out_of_resource {
408b3f1ea41SRandall Stewart 	struct sctp_error_cause cause;	/* code=SCTP_ERROR_OUT_OF_RESOURCES */
409b3f1ea41SRandall Stewart }                          SCTP_PACKED;
410f8829a4aSRandall Stewart 
411f8829a4aSRandall Stewart struct sctp_error_unresolv_addr {
412b3f1ea41SRandall Stewart 	struct sctp_error_cause cause;	/* code=SCTP_ERROR_UNRESOLVABLE_ADDR */
413f8829a4aSRandall Stewart 
414b3f1ea41SRandall Stewart }                        SCTP_PACKED;
415f8829a4aSRandall Stewart 
416f8829a4aSRandall Stewart struct sctp_error_unrecognized_chunk {
417b3f1ea41SRandall Stewart 	struct sctp_error_cause cause;	/* code=SCTP_ERROR_UNRECOG_CHUNK */
418f8829a4aSRandall Stewart 	struct sctp_chunkhdr ch;/* header from chunk in error */
419b3f1ea41SRandall Stewart }                             SCTP_PACKED;
420f8829a4aSRandall Stewart 
42132451da4SMichael Tuexen struct sctp_error_no_user_data {
42232451da4SMichael Tuexen 	struct sctp_error_cause cause;	/* code=SCTP_CAUSE_NO_USER_DATA */
42332451da4SMichael Tuexen 	uint32_t tsn;		/* TSN of the empty data chunk */
42432451da4SMichael Tuexen }                       SCTP_PACKED;
42532451da4SMichael Tuexen 
426f8829a4aSRandall Stewart /*
427f8829a4aSRandall Stewart  * Main SCTP chunk types we place these here so natd and f/w's in user land
428f8829a4aSRandall Stewart  * can find them.
429f8829a4aSRandall Stewart  */
430f8829a4aSRandall Stewart /************0x00 series ***********/
431f8829a4aSRandall Stewart #define SCTP_DATA		0x00
432f8829a4aSRandall Stewart #define SCTP_INITIATION		0x01
433f8829a4aSRandall Stewart #define SCTP_INITIATION_ACK	0x02
434f8829a4aSRandall Stewart #define SCTP_SELECTIVE_ACK	0x03
435f8829a4aSRandall Stewart #define SCTP_HEARTBEAT_REQUEST	0x04
436f8829a4aSRandall Stewart #define SCTP_HEARTBEAT_ACK	0x05
437f8829a4aSRandall Stewart #define SCTP_ABORT_ASSOCIATION	0x06
438f8829a4aSRandall Stewart #define SCTP_SHUTDOWN		0x07
439f8829a4aSRandall Stewart #define SCTP_SHUTDOWN_ACK	0x08
440f8829a4aSRandall Stewart #define SCTP_OPERATION_ERROR	0x09
441f8829a4aSRandall Stewart #define SCTP_COOKIE_ECHO	0x0a
442f8829a4aSRandall Stewart #define SCTP_COOKIE_ACK		0x0b
443f8829a4aSRandall Stewart #define SCTP_ECN_ECHO		0x0c
444f8829a4aSRandall Stewart #define SCTP_ECN_CWR		0x0d
445f8829a4aSRandall Stewart #define SCTP_SHUTDOWN_COMPLETE	0x0e
4463232788eSRandall Stewart /* RFC4895 */
447f8829a4aSRandall Stewart #define SCTP_AUTHENTICATION     0x0f
448830d754dSRandall Stewart /* EY nr_sack chunk id*/
449830d754dSRandall Stewart #define SCTP_NR_SELECTIVE_ACK	0x10
450f8829a4aSRandall Stewart /************0x40 series ***********/
451f8829a4aSRandall Stewart /************0x80 series ***********/
4523232788eSRandall Stewart /* RFC5061 */
453f8829a4aSRandall Stewart #define	SCTP_ASCONF_ACK		0x80
454f8829a4aSRandall Stewart /* draft-ietf-stewart-pktdrpsctp */
455f8829a4aSRandall Stewart #define SCTP_PACKET_DROPPED	0x81
456f8829a4aSRandall Stewart /* draft-ietf-stewart-strreset-xxx */
457f8829a4aSRandall Stewart #define SCTP_STREAM_RESET       0x82
4589a972525SRandall Stewart 
4599a972525SRandall Stewart /* RFC4820                         */
4609a972525SRandall Stewart #define SCTP_PAD_CHUNK          0x84
461f8829a4aSRandall Stewart /************0xc0 series ***********/
462f8829a4aSRandall Stewart /* RFC3758 */
463f8829a4aSRandall Stewart #define SCTP_FORWARD_CUM_TSN	0xc0
4643232788eSRandall Stewart /* RFC5061 */
465f8829a4aSRandall Stewart #define SCTP_ASCONF		0xc1
466f8829a4aSRandall Stewart 
467f8829a4aSRandall Stewart 
468f8829a4aSRandall Stewart /* ABORT and SHUTDOWN COMPLETE FLAG */
469f8829a4aSRandall Stewart #define SCTP_HAD_NO_TCB		0x01
470f8829a4aSRandall Stewart 
471f8829a4aSRandall Stewart /* Packet dropped flags */
472f8829a4aSRandall Stewart #define SCTP_FROM_MIDDLE_BOX	SCTP_HAD_NO_TCB
473f8829a4aSRandall Stewart #define SCTP_BADCRC		0x02
474f8829a4aSRandall Stewart #define SCTP_PACKET_TRUNCATED	0x04
475f8829a4aSRandall Stewart 
476a21779f0SRandall Stewart /* Flag for ECN -CWR */
477a21779f0SRandall Stewart #define SCTP_CWR_REDUCE_OVERRIDE 0x01
478a21779f0SRandall Stewart #define SCTP_CWR_IN_SAME_WINDOW  0x02
479a21779f0SRandall Stewart 
480f8829a4aSRandall Stewart #define SCTP_SAT_NETWORK_MIN	400	/* min ms for RTT to set satellite
481f8829a4aSRandall Stewart 					 * time */
482f8829a4aSRandall Stewart #define SCTP_SAT_NETWORK_BURST_INCR  2	/* how many times to multiply maxburst
483f8829a4aSRandall Stewart 					 * in sat */
484f8829a4aSRandall Stewart 
485f8829a4aSRandall Stewart /* Data Chuck Specific Flags */
486f8829a4aSRandall Stewart #define SCTP_DATA_FRAG_MASK        0x03
487f8829a4aSRandall Stewart #define SCTP_DATA_MIDDLE_FRAG      0x00
488f8829a4aSRandall Stewart #define SCTP_DATA_LAST_FRAG        0x01
489f8829a4aSRandall Stewart #define SCTP_DATA_FIRST_FRAG       0x02
490f8829a4aSRandall Stewart #define SCTP_DATA_NOT_FRAG         0x03
491f8829a4aSRandall Stewart #define SCTP_DATA_UNORDERED        0x04
492b3f1ea41SRandall Stewart #define SCTP_DATA_SACK_IMMEDIATELY 0x08
493f8829a4aSRandall Stewart /* ECN Nonce: SACK Chunk Specific Flags */
494f8829a4aSRandall Stewart #define SCTP_SACK_NONCE_SUM        0x01
495f8829a4aSRandall Stewart 
496f8829a4aSRandall Stewart /* CMT DAC algorithm SACK flag */
497f8829a4aSRandall Stewart #define SCTP_SACK_CMT_DAC          0x80
498f8829a4aSRandall Stewart 
49958967d8dSRandall Stewart /*
50058967d8dSRandall Stewart  * PCB flags (in sctp_flags bitmask).
50158967d8dSRandall Stewart  * Note the features and flags are meant
50258967d8dSRandall Stewart  * for use by netstat.
50358967d8dSRandall Stewart  */
50458967d8dSRandall Stewart #define SCTP_PCB_FLAGS_UDPTYPE		0x00000001
50558967d8dSRandall Stewart #define SCTP_PCB_FLAGS_TCPTYPE		0x00000002
50658967d8dSRandall Stewart #define SCTP_PCB_FLAGS_BOUNDALL		0x00000004
50758967d8dSRandall Stewart #define SCTP_PCB_FLAGS_ACCEPTING	0x00000008
50858967d8dSRandall Stewart #define SCTP_PCB_FLAGS_UNBOUND		0x00000010
50958967d8dSRandall Stewart #define SCTP_PCB_FLAGS_CLOSE_IP         0x00040000
51058967d8dSRandall Stewart #define SCTP_PCB_FLAGS_WAS_CONNECTED    0x00080000
51158967d8dSRandall Stewart #define SCTP_PCB_FLAGS_WAS_ABORTED      0x00100000
51258967d8dSRandall Stewart /* TCP model support */
51358967d8dSRandall Stewart 
51458967d8dSRandall Stewart #define SCTP_PCB_FLAGS_CONNECTED	0x00200000
51558967d8dSRandall Stewart #define SCTP_PCB_FLAGS_IN_TCPPOOL	0x00400000
51658967d8dSRandall Stewart #define SCTP_PCB_FLAGS_DONT_WAKE	0x00800000
51758967d8dSRandall Stewart #define SCTP_PCB_FLAGS_WAKEOUTPUT	0x01000000
51858967d8dSRandall Stewart #define SCTP_PCB_FLAGS_WAKEINPUT	0x02000000
51958967d8dSRandall Stewart #define SCTP_PCB_FLAGS_BOUND_V6		0x04000000
520bfefd190SRandall Stewart #define SCTP_PCB_FLAGS_BLOCKING_IO	0x08000000
521bfefd190SRandall Stewart #define SCTP_PCB_FLAGS_SOCKET_GONE	0x10000000
522bfefd190SRandall Stewart #define SCTP_PCB_FLAGS_SOCKET_ALLGONE	0x20000000
523cd1386abSMichael Tuexen #define SCTP_PCB_FLAGS_SOCKET_CANT_READ	0x40000000
524a1cb341bSMichael Tuexen 
52558967d8dSRandall Stewart /* flags to copy to new PCB */
526bfefd190SRandall Stewart #define SCTP_PCB_COPY_FLAGS		(SCTP_PCB_FLAGS_BOUNDALL|\
527bfefd190SRandall Stewart 					 SCTP_PCB_FLAGS_WAKEINPUT|\
528bfefd190SRandall Stewart 					 SCTP_PCB_FLAGS_BOUND_V6)
52958967d8dSRandall Stewart 
53058967d8dSRandall Stewart /*
53158967d8dSRandall Stewart  * PCB Features (in sctp_features bitmask)
53258967d8dSRandall Stewart  */
5332c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_DO_NOT_PMTUD      0x0000000000000001
5342c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_EXT_RCVINFO       0x0000000000000002	/* deprecated */
5352c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_DONOT_HEARTBEAT   0x0000000000000004
5362c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_FRAG_INTERLEAVE   0x0000000000000008
5372c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_INTERLEAVE_STRMS  0x0000000000000010
5382c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_DO_ASCONF         0x0000000000000020
5392c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_AUTO_ASCONF       0x0000000000000040
5402c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE  0x0000000000000080
54158967d8dSRandall Stewart /* socket options */
5422c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_NODELAY           0x0000000000000100
5432c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_AUTOCLOSE         0x0000000000000200
5442c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_RECVDATAIOEVNT    0x0000000000000400	/* deprecated */
5452c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_RECVASSOCEVNT     0x0000000000000800
5462c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_RECVPADDREVNT     0x0000000000001000
5472c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_RECVPEERERR       0x0000000000002000
5482c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_RECVSENDFAILEVNT  0x0000000000004000	/* deprecated */
5492c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT  0x0000000000008000
5502c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_ADAPTATIONEVNT    0x0000000000010000
5512c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_PDAPIEVNT         0x0000000000020000
5522c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_AUTHEVNT          0x0000000000040000
5532c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_STREAM_RESETEVNT  0x0000000000080000
5542c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_NO_FRAGMENT       0x0000000000100000
5552c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_EXPLICIT_EOR      0x0000000000400000
5562c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_NEEDS_MAPPED_V4   0x0000000000800000
5572c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_MULTIPLE_ASCONFS  0x0000000001000000
5582c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_PORTREUSE         0x0000000002000000
5592c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_DRYEVNT           0x0000000004000000
5602c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_RECVRCVINFO       0x0000000008000000
5612c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_RECVNXTINFO       0x0000000010000000
5622c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_ASSOC_RESETEVNT   0x0000000020000000
5632c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_STREAM_CHANGEEVNT 0x0000000040000000
5642c9c61deSMichael Tuexen #define SCTP_PCB_FLAGS_RECVNSENDFAILEVNT 0x0000000080000000
565e2e7c62eSMichael Tuexen 
5662afb3e84SRandall Stewart /*-
5672afb3e84SRandall Stewart  * mobility_features parameters (by micchie).Note
5682afb3e84SRandall Stewart  * these features are applied against the
5692afb3e84SRandall Stewart  * sctp_mobility_features flags.. not the sctp_features
5702afb3e84SRandall Stewart  * flags.
5712afb3e84SRandall Stewart  */
5722afb3e84SRandall Stewart #define SCTP_MOBILITY_BASE               0x00000001
5732afb3e84SRandall Stewart #define SCTP_MOBILITY_FASTHANDOFF        0x00000002
574851b7298SRandall Stewart #define SCTP_MOBILITY_PRIM_DELETED       0x00000004
5752afb3e84SRandall Stewart 
5762afb3e84SRandall Stewart 
577d61a0ae0SRandall Stewart #define SCTP_SMALLEST_PMTU 512	/* smallest pmtu allowed when disabling PMTU
578d61a0ae0SRandall Stewart 				 * discovery */
579d61a0ae0SRandall Stewart 
580430061cfSMichael Tuexen #undef SCTP_PACKED
581430061cfSMichael Tuexen 
582f8829a4aSRandall Stewart #include <netinet/sctp_uio.h>
583f8829a4aSRandall Stewart 
58480fefe0aSRandall Stewart /* This dictates the size of the packet
58580fefe0aSRandall Stewart  * collection buffer. This only applies
58680fefe0aSRandall Stewart  * if SCTP_PACKET_LOGGING is enabled in
58780fefe0aSRandall Stewart  * your config.
58880fefe0aSRandall Stewart  */
589207304d4SRandall Stewart #define SCTP_PACKET_LOG_SIZE 65536
590207304d4SRandall Stewart 
59118e198d3SRandall Stewart /* Maximum delays and such a user can set for options that
59218e198d3SRandall Stewart  * take ms.
59318e198d3SRandall Stewart  */
59418e198d3SRandall Stewart #define SCTP_MAX_SACK_DELAY 500	/* per RFC4960 */
59518e198d3SRandall Stewart #define SCTP_MAX_HB_INTERVAL 14400000	/* 4 hours in ms */
59618e198d3SRandall Stewart #define SCTP_MAX_COOKIE_LIFE  3600000	/* 1 hour in ms */
59718e198d3SRandall Stewart 
59818e198d3SRandall Stewart 
59980fefe0aSRandall Stewart /* Types of logging/KTR tracing  that can be enabled via the
60080fefe0aSRandall Stewart  * sysctl net.inet.sctp.sctp_logging. You must also enable
60180fefe0aSRandall Stewart  * SUBSYS tracing.
60280fefe0aSRandall Stewart  * Note that you must have the SCTP option in the kernel
60380fefe0aSRandall Stewart  * to enable these as well.
60480fefe0aSRandall Stewart  */
60580fefe0aSRandall Stewart #define SCTP_BLK_LOGGING_ENABLE				0x00000001
60680fefe0aSRandall Stewart #define SCTP_CWND_MONITOR_ENABLE			0x00000002
60780fefe0aSRandall Stewart #define SCTP_CWND_LOGGING_ENABLE			0x00000004
60880fefe0aSRandall Stewart #define SCTP_FLIGHT_LOGGING_ENABLE			0x00000020
60980fefe0aSRandall Stewart #define SCTP_FR_LOGGING_ENABLE				0x00000040
61080fefe0aSRandall Stewart #define SCTP_LOCK_LOGGING_ENABLE			0x00000080
61180fefe0aSRandall Stewart #define SCTP_MAP_LOGGING_ENABLE				0x00000100
61280fefe0aSRandall Stewart #define SCTP_MBCNT_LOGGING_ENABLE			0x00000200
61380fefe0aSRandall Stewart #define SCTP_MBUF_LOGGING_ENABLE			0x00000400
61480fefe0aSRandall Stewart #define SCTP_NAGLE_LOGGING_ENABLE			0x00000800
61580fefe0aSRandall Stewart #define SCTP_RECV_RWND_LOGGING_ENABLE			0x00001000
61680fefe0aSRandall Stewart #define SCTP_RTTVAR_LOGGING_ENABLE			0x00002000
61780fefe0aSRandall Stewart #define SCTP_SACK_LOGGING_ENABLE			0x00004000
61880fefe0aSRandall Stewart #define SCTP_SACK_RWND_LOGGING_ENABLE			0x00008000
61980fefe0aSRandall Stewart #define SCTP_SB_LOGGING_ENABLE				0x00010000
62080fefe0aSRandall Stewart #define SCTP_STR_LOGGING_ENABLE				0x00020000
62180fefe0aSRandall Stewart #define SCTP_WAKE_LOGGING_ENABLE			0x00040000
62280fefe0aSRandall Stewart #define SCTP_LOG_MAXBURST_ENABLE			0x00080000
62380fefe0aSRandall Stewart #define SCTP_LOG_RWND_ENABLE    			0x00100000
62480fefe0aSRandall Stewart #define SCTP_LOG_SACK_ARRIVALS_ENABLE			0x00200000
62580fefe0aSRandall Stewart #define SCTP_LTRACE_CHUNK_ENABLE			0x00400000
62680fefe0aSRandall Stewart #define SCTP_LTRACE_ERROR_ENABLE			0x00800000
627d95ddf02SRandall Stewart #define SCTP_LAST_PACKET_TRACING			0x01000000
628c4739e2fSRandall Stewart #define SCTP_THRESHOLD_LOGGING				0x02000000
6299f22f500SRandall Stewart #define SCTP_LOG_AT_SEND_2_SCTP				0x04000000
6309f22f500SRandall Stewart #define SCTP_LOG_AT_SEND_2_OUTQ				0x08000000
6310c0982b8SRandall Stewart #define SCTP_LOG_TRY_ADVANCE				0x10000000
632207304d4SRandall Stewart 
633f8829a4aSRandall Stewart #endif				/* !_NETINET_SCTP_H_ */
634