Blame include/uapi/linux/sctp.h

Packit Service 3880ab
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
Packit Service 3880ab
/* SCTP kernel implementation
Packit Service 3880ab
 * (C) Copyright IBM Corp. 2001, 2004
Packit Service 3880ab
 * Copyright (c) 1999-2000 Cisco, Inc.
Packit Service 3880ab
 * Copyright (c) 1999-2001 Motorola, Inc.
Packit Service 3880ab
 * Copyright (c) 2002 Intel Corp.
Packit Service 3880ab
 *
Packit Service 3880ab
 * This file is part of the SCTP kernel implementation
Packit Service 3880ab
 *
Packit Service 3880ab
 * This header represents the structures and constants needed to support
Packit Service 3880ab
 * the SCTP Extension to the Sockets API.
Packit Service 3880ab
 *
Packit Service 3880ab
 * This SCTP implementation is free software;
Packit Service 3880ab
 * you can redistribute it and/or modify it under the terms of
Packit Service 3880ab
 * the GNU General Public License as published by
Packit Service 3880ab
 * the Free Software Foundation; either version 2, or (at your option)
Packit Service 3880ab
 * any later version.
Packit Service 3880ab
 *
Packit Service 3880ab
 * This SCTP implementation is distributed in the hope that it
Packit Service 3880ab
 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
Packit Service 3880ab
 *                 ************************
Packit Service 3880ab
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Packit Service 3880ab
 * See the GNU General Public License for more details.
Packit Service 3880ab
 *
Packit Service 3880ab
 * You should have received a copy of the GNU General Public License
Packit Service 3880ab
 * along with GNU CC; see the file COPYING.  If not, see
Packit Service 3880ab
 * <http://www.gnu.org/licenses/>.
Packit Service 3880ab
 *
Packit Service 3880ab
 * Please send any bug reports or fixes you make to the
Packit Service 3880ab
 * email address(es):
Packit Service 3880ab
 *    lksctp developers <linux-sctp@vger.kernel.org>
Packit Service 3880ab
 *
Packit Service 3880ab
 * Or submit a bug report through the following website:
Packit Service 3880ab
 *    http://www.sf.net/projects/lksctp
Packit Service 3880ab
 *
Packit Service 3880ab
 * Written or modified by:
Packit Service 3880ab
 *    La Monte H.P. Yarroll    <piggy@acm.org>
Packit Service 3880ab
 *    R. Stewart               <randall@sctp.chicago.il.us>
Packit Service 3880ab
 *    K. Morneau               <kmorneau@cisco.com>
Packit Service 3880ab
 *    Q. Xie                   <qxie1@email.mot.com>
Packit Service 3880ab
 *    Karl Knutson             <karl@athena.chicago.il.us>
Packit Service 3880ab
 *    Jon Grimm                <jgrimm@us.ibm.com>
Packit Service 3880ab
 *    Daisy Chang              <daisyc@us.ibm.com>
Packit Service 3880ab
 *    Ryan Layer               <rmlayer@us.ibm.com>
Packit Service 3880ab
 *    Ardelle Fan              <ardelle.fan@intel.com>
Packit Service 3880ab
 *    Sridhar Samudrala        <sri@us.ibm.com>
Packit Service 3880ab
 *    Inaky Perez-Gonzalez     <inaky.gonzalez@intel.com>
Packit Service 3880ab
 *    Vlad Yasevich            <vladislav.yasevich@hp.com>
Packit Service 3880ab
 *
Packit Service 3880ab
 * Any bugs reported given to us we will try to fix... any fixes shared will
Packit Service 3880ab
 * be incorporated into the next SCTP release.
Packit Service 3880ab
 */
Packit Service 3880ab
Packit Service 3880ab
#ifndef _SCTP_H
Packit Service 3880ab
#define _SCTP_H
Packit Service 3880ab
Packit Service 3880ab
#include <linux/types.h>
Packit Service 3880ab
#include <linux/socket.h>
Packit Service 3880ab
Packit Service 3880ab
typedef __s32 sctp_assoc_t;
Packit Service 3880ab
Packit Service 3880ab
#define SCTP_FUTURE_ASSOC	0
Packit Service 3880ab
#define SCTP_CURRENT_ASSOC	1
Packit Service 3880ab
#define SCTP_ALL_ASSOC		2
Packit Service 3880ab
Packit Service 3880ab
/* The following symbols come from the Sockets API Extensions for
Packit Service 3880ab
 * SCTP <draft-ietf-tsvwg-sctpsocket-07.txt>.
Packit Service 3880ab
 */
Packit Service 3880ab
#define SCTP_RTOINFO	0
Packit Service 3880ab
#define SCTP_ASSOCINFO  1
Packit Service 3880ab
#define SCTP_INITMSG	2
Packit Service 3880ab
#define SCTP_NODELAY	3		/* Get/set nodelay option. */
Packit Service 3880ab
#define SCTP_AUTOCLOSE	4
Packit Service 3880ab
#define SCTP_SET_PEER_PRIMARY_ADDR 5
Packit Service 3880ab
#define SCTP_PRIMARY_ADDR	6
Packit Service 3880ab
#define SCTP_ADAPTATION_LAYER	7
Packit Service 3880ab
#define SCTP_DISABLE_FRAGMENTS	8
Packit Service 3880ab
#define SCTP_PEER_ADDR_PARAMS	9
Packit Service 3880ab
#define SCTP_DEFAULT_SEND_PARAM	10
Packit Service 3880ab
#define SCTP_EVENTS	11
Packit Service 3880ab
#define SCTP_I_WANT_MAPPED_V4_ADDR 12	/* Turn on/off mapped v4 addresses  */
Packit Service 3880ab
#define SCTP_MAXSEG	13		/* Get/set maximum fragment. */
Packit Service 3880ab
#define SCTP_STATUS	14
Packit Service 3880ab
#define SCTP_GET_PEER_ADDR_INFO	15
Packit Service 3880ab
#define SCTP_DELAYED_ACK_TIME	16
Packit Service 3880ab
#define SCTP_DELAYED_ACK SCTP_DELAYED_ACK_TIME
Packit Service 3880ab
#define SCTP_DELAYED_SACK SCTP_DELAYED_ACK_TIME
Packit Service 3880ab
#define SCTP_CONTEXT	17
Packit Service 3880ab
#define SCTP_FRAGMENT_INTERLEAVE	18
Packit Service 3880ab
#define SCTP_PARTIAL_DELIVERY_POINT	19 /* Set/Get partial delivery point */
Packit Service 3880ab
#define SCTP_MAX_BURST	20		/* Set/Get max burst */
Packit Service 3880ab
#define SCTP_AUTH_CHUNK	21	/* Set only: add a chunk type to authenticate */
Packit Service 3880ab
#define SCTP_HMAC_IDENT	22
Packit Service 3880ab
#define SCTP_AUTH_KEY	23
Packit Service 3880ab
#define SCTP_AUTH_ACTIVE_KEY	24
Packit Service 3880ab
#define SCTP_AUTH_DELETE_KEY	25
Packit Service 3880ab
#define SCTP_PEER_AUTH_CHUNKS	26	/* Read only */
Packit Service 3880ab
#define SCTP_LOCAL_AUTH_CHUNKS	27	/* Read only */
Packit Service 3880ab
#define SCTP_GET_ASSOC_NUMBER	28	/* Read only */
Packit Service 3880ab
#define SCTP_GET_ASSOC_ID_LIST	29	/* Read only */
Packit Service 3880ab
#define SCTP_AUTO_ASCONF       30
Packit Service 3880ab
#define SCTP_PEER_ADDR_THLDS	31
Packit Service 3880ab
#define SCTP_RECVRCVINFO	32
Packit Service 3880ab
#define SCTP_RECVNXTINFO	33
Packit Service 3880ab
#define SCTP_DEFAULT_SNDINFO	34
Packit Service 3880ab
#define SCTP_AUTH_DEACTIVATE_KEY	35
Packit Service 3880ab
#define SCTP_REUSE_PORT		36
Packit Service 3880ab
#define SCTP_PEER_ADDR_THLDS_V2	37
Packit Service 3880ab
Packit Service 3880ab
/* Internal Socket Options. Some of the sctp library functions are
Packit Service 3880ab
 * implemented using these socket options.
Packit Service 3880ab
 */
Packit Service 3880ab
#define SCTP_SOCKOPT_BINDX_ADD	100	/* BINDX requests for adding addrs */
Packit Service 3880ab
#define SCTP_SOCKOPT_BINDX_REM	101	/* BINDX requests for removing addrs. */
Packit Service 3880ab
#define SCTP_SOCKOPT_PEELOFF	102	/* peel off association. */
Packit Service 3880ab
/* Options 104-106 are deprecated and removed. Do not use this space */
Packit Service 3880ab
#define SCTP_SOCKOPT_CONNECTX_OLD	107	/* CONNECTX old requests. */
Packit Service 3880ab
#define SCTP_GET_PEER_ADDRS	108		/* Get all peer address. */
Packit Service 3880ab
#define SCTP_GET_LOCAL_ADDRS	109		/* Get all local address. */
Packit Service 3880ab
#define SCTP_SOCKOPT_CONNECTX	110		/* CONNECTX requests. */
Packit Service 3880ab
#define SCTP_SOCKOPT_CONNECTX3	111	/* CONNECTX requests (updated) */
Packit Service 3880ab
#define SCTP_GET_ASSOC_STATS	112	/* Read only */
Packit Service 3880ab
#define SCTP_PR_SUPPORTED	113
Packit Service 3880ab
#define SCTP_DEFAULT_PRINFO	114
Packit Service 3880ab
#define SCTP_PR_ASSOC_STATUS	115
Packit Service 3880ab
#define SCTP_PR_STREAM_STATUS	116
Packit Service 3880ab
#define SCTP_RECONFIG_SUPPORTED	117
Packit Service 3880ab
#define SCTP_ENABLE_STREAM_RESET	118
Packit Service 3880ab
#define SCTP_RESET_STREAMS	119
Packit Service 3880ab
#define SCTP_RESET_ASSOC	120
Packit Service 3880ab
#define SCTP_ADD_STREAMS	121
Packit Service 3880ab
#define SCTP_SOCKOPT_PEELOFF_FLAGS 122
Packit Service 3880ab
#define SCTP_STREAM_SCHEDULER	123
Packit Service 3880ab
#define SCTP_STREAM_SCHEDULER_VALUE	124
Packit Service 3880ab
#define SCTP_INTERLEAVING_SUPPORTED	125
Packit Service 3880ab
#define SCTP_SENDMSG_CONNECT	126
Packit Service 3880ab
#define SCTP_EVENT	127
Packit Service 3880ab
#define SCTP_ASCONF_SUPPORTED	128
Packit Service 3880ab
#define SCTP_AUTH_SUPPORTED	129
Packit Service 3880ab
#define SCTP_ECN_SUPPORTED	130
Packit Service 3880ab
#define SCTP_EXPOSE_POTENTIALLY_FAILED_STATE	131
Packit Service 3880ab
#define SCTP_EXPOSE_PF_STATE	SCTP_EXPOSE_POTENTIALLY_FAILED_STATE
Packit Bot 867fae
#define SCTP_REMOTE_UDP_ENCAPS_PORT	132
Packit Service 3880ab
Packit Service 3880ab
/* PR-SCTP policies */
Packit Service 3880ab
#define SCTP_PR_SCTP_NONE	0x0000
Packit Service 3880ab
#define SCTP_PR_SCTP_TTL	0x0010
Packit Service 3880ab
#define SCTP_PR_SCTP_RTX	0x0020
Packit Service 3880ab
#define SCTP_PR_SCTP_PRIO	0x0030
Packit Service 3880ab
#define SCTP_PR_SCTP_MAX	SCTP_PR_SCTP_PRIO
Packit Service 3880ab
#define SCTP_PR_SCTP_MASK	0x0030
Packit Service 3880ab
Packit Service 3880ab
#define __SCTP_PR_INDEX(x)	((x >> 4) - 1)
Packit Service 3880ab
#define SCTP_PR_INDEX(x)	__SCTP_PR_INDEX(SCTP_PR_SCTP_ ## x)
Packit Service 3880ab
Packit Service 3880ab
#define SCTP_PR_POLICY(x)	((x) & SCTP_PR_SCTP_MASK)
Packit Service 3880ab
#define SCTP_PR_SET_POLICY(flags, x)	\
Packit Service 3880ab
	do {				\
Packit Service 3880ab
		flags &= ~SCTP_PR_SCTP_MASK;	\
Packit Service 3880ab
		flags |= x;		\
Packit Service 3880ab
	} while (0)
Packit Service 3880ab
Packit Service 3880ab
#define SCTP_PR_TTL_ENABLED(x)	(SCTP_PR_POLICY(x) == SCTP_PR_SCTP_TTL)
Packit Service 3880ab
#define SCTP_PR_RTX_ENABLED(x)	(SCTP_PR_POLICY(x) == SCTP_PR_SCTP_RTX)
Packit Service 3880ab
#define SCTP_PR_PRIO_ENABLED(x)	(SCTP_PR_POLICY(x) == SCTP_PR_SCTP_PRIO)
Packit Service 3880ab
Packit Service 3880ab
/* For enable stream reset */
Packit Service 3880ab
#define SCTP_ENABLE_RESET_STREAM_REQ	0x01
Packit Service 3880ab
#define SCTP_ENABLE_RESET_ASSOC_REQ	0x02
Packit Service 3880ab
#define SCTP_ENABLE_CHANGE_ASSOC_REQ	0x04
Packit Service 3880ab
#define SCTP_ENABLE_STRRESET_MASK	0x07
Packit Service 3880ab
Packit Service 3880ab
#define SCTP_STREAM_RESET_INCOMING	0x01
Packit Service 3880ab
#define SCTP_STREAM_RESET_OUTGOING	0x02
Packit Service 3880ab
Packit Service 3880ab
/* These are bit fields for msghdr->msg_flags.  See section 5.1.  */
Packit Service 3880ab
/* On user space Linux, these live in <bits/socket.h> as an enum.  */
Packit Service 3880ab
enum sctp_msg_flags {
Packit Service 3880ab
	MSG_NOTIFICATION = 0x8000,
Packit Service 3880ab
#define MSG_NOTIFICATION MSG_NOTIFICATION
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/* 5.3.1 SCTP Initiation Structure (SCTP_INIT)
Packit Service 3880ab
 *
Packit Service 3880ab
 *   This cmsghdr structure provides information for initializing new
Packit Service 3880ab
 *   SCTP associations with sendmsg().  The SCTP_INITMSG socket option
Packit Service 3880ab
 *   uses this same data structure.  This structure is not used for
Packit Service 3880ab
 *   recvmsg().
Packit Service 3880ab
 *
Packit Service 3880ab
 *   cmsg_level    cmsg_type      cmsg_data[]
Packit Service 3880ab
 *   ------------  ------------   ----------------------
Packit Service 3880ab
 *   IPPROTO_SCTP  SCTP_INIT      struct sctp_initmsg
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_initmsg {
Packit Service 3880ab
	__u16 sinit_num_ostreams;
Packit Service 3880ab
	__u16 sinit_max_instreams;
Packit Service 3880ab
	__u16 sinit_max_attempts;
Packit Service 3880ab
	__u16 sinit_max_init_timeo;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/* 5.3.2 SCTP Header Information Structure (SCTP_SNDRCV)
Packit Service 3880ab
 *
Packit Service 3880ab
 *   This cmsghdr structure specifies SCTP options for sendmsg() and
Packit Service 3880ab
 *   describes SCTP header information about a received message through
Packit Service 3880ab
 *   recvmsg().
Packit Service 3880ab
 *
Packit Service 3880ab
 *   cmsg_level    cmsg_type      cmsg_data[]
Packit Service 3880ab
 *   ------------  ------------   ----------------------
Packit Service 3880ab
 *   IPPROTO_SCTP  SCTP_SNDRCV    struct sctp_sndrcvinfo
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_sndrcvinfo {
Packit Service 3880ab
	__u16 sinfo_stream;
Packit Service 3880ab
	__u16 sinfo_ssn;
Packit Service 3880ab
	__u16 sinfo_flags;
Packit Service 3880ab
	__u32 sinfo_ppid;
Packit Service 3880ab
	__u32 sinfo_context;
Packit Service 3880ab
	__u32 sinfo_timetolive;
Packit Service 3880ab
	__u32 sinfo_tsn;
Packit Service 3880ab
	__u32 sinfo_cumtsn;
Packit Service 3880ab
	sctp_assoc_t sinfo_assoc_id;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/* 5.3.4 SCTP Send Information Structure (SCTP_SNDINFO)
Packit Service 3880ab
 *
Packit Service 3880ab
 *   This cmsghdr structure specifies SCTP options for sendmsg().
Packit Service 3880ab
 *
Packit Service 3880ab
 *   cmsg_level    cmsg_type      cmsg_data[]
Packit Service 3880ab
 *   ------------  ------------   -------------------
Packit Service 3880ab
 *   IPPROTO_SCTP  SCTP_SNDINFO   struct sctp_sndinfo
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_sndinfo {
Packit Service 3880ab
	__u16 snd_sid;
Packit Service 3880ab
	__u16 snd_flags;
Packit Service 3880ab
	__u32 snd_ppid;
Packit Service 3880ab
	__u32 snd_context;
Packit Service 3880ab
	sctp_assoc_t snd_assoc_id;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/* 5.3.5 SCTP Receive Information Structure (SCTP_RCVINFO)
Packit Service 3880ab
 *
Packit Service 3880ab
 *   This cmsghdr structure describes SCTP receive information
Packit Service 3880ab
 *   about a received message through recvmsg().
Packit Service 3880ab
 *
Packit Service 3880ab
 *   cmsg_level    cmsg_type      cmsg_data[]
Packit Service 3880ab
 *   ------------  ------------   -------------------
Packit Service 3880ab
 *   IPPROTO_SCTP  SCTP_RCVINFO   struct sctp_rcvinfo
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_rcvinfo {
Packit Service 3880ab
	__u16 rcv_sid;
Packit Service 3880ab
	__u16 rcv_ssn;
Packit Service 3880ab
	__u16 rcv_flags;
Packit Service 3880ab
	__u32 rcv_ppid;
Packit Service 3880ab
	__u32 rcv_tsn;
Packit Service 3880ab
	__u32 rcv_cumtsn;
Packit Service 3880ab
	__u32 rcv_context;
Packit Service 3880ab
	sctp_assoc_t rcv_assoc_id;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/* 5.3.6 SCTP Next Receive Information Structure (SCTP_NXTINFO)
Packit Service 3880ab
 *
Packit Service 3880ab
 *   This cmsghdr structure describes SCTP receive information
Packit Service 3880ab
 *   of the next message that will be delivered through recvmsg()
Packit Service 3880ab
 *   if this information is already available when delivering
Packit Service 3880ab
 *   the current message.
Packit Service 3880ab
 *
Packit Service 3880ab
 *   cmsg_level    cmsg_type      cmsg_data[]
Packit Service 3880ab
 *   ------------  ------------   -------------------
Packit Service 3880ab
 *   IPPROTO_SCTP  SCTP_NXTINFO   struct sctp_nxtinfo
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_nxtinfo {
Packit Service 3880ab
	__u16 nxt_sid;
Packit Service 3880ab
	__u16 nxt_flags;
Packit Service 3880ab
	__u32 nxt_ppid;
Packit Service 3880ab
	__u32 nxt_length;
Packit Service 3880ab
	sctp_assoc_t nxt_assoc_id;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/* 5.3.7 SCTP PR-SCTP Information Structure (SCTP_PRINFO)
Packit Service 3880ab
 *
Packit Service 3880ab
 *   This cmsghdr structure specifies SCTP options for sendmsg().
Packit Service 3880ab
 *
Packit Service 3880ab
 *   cmsg_level    cmsg_type      cmsg_data[]
Packit Service 3880ab
 *   ------------  ------------   -------------------
Packit Service 3880ab
 *   IPPROTO_SCTP  SCTP_PRINFO    struct sctp_prinfo
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_prinfo {
Packit Service 3880ab
	__u16 pr_policy;
Packit Service 3880ab
	__u32 pr_value;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/* 5.3.8 SCTP AUTH Information Structure (SCTP_AUTHINFO)
Packit Service 3880ab
 *
Packit Service 3880ab
 *   This cmsghdr structure specifies SCTP options for sendmsg().
Packit Service 3880ab
 *
Packit Service 3880ab
 *   cmsg_level    cmsg_type      cmsg_data[]
Packit Service 3880ab
 *   ------------  ------------   -------------------
Packit Service 3880ab
 *   IPPROTO_SCTP  SCTP_AUTHINFO  struct sctp_authinfo
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_authinfo {
Packit Service 3880ab
	__u16 auth_keynumber;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 *  sinfo_flags: 16 bits (unsigned integer)
Packit Service 3880ab
 *
Packit Service 3880ab
 *   This field may contain any of the following flags and is composed of
Packit Service 3880ab
 *   a bitwise OR of these values.
Packit Service 3880ab
 */
Packit Service 3880ab
enum sctp_sinfo_flags {
Packit Service 3880ab
	SCTP_UNORDERED		= (1 << 0), /* Send/receive message unordered. */
Packit Service 3880ab
	SCTP_ADDR_OVER		= (1 << 1), /* Override the primary destination. */
Packit Service 3880ab
	SCTP_ABORT		= (1 << 2), /* Send an ABORT message to the peer. */
Packit Service 3880ab
	SCTP_SACK_IMMEDIATELY	= (1 << 3), /* SACK should be sent without delay. */
Packit Service 3880ab
	/* 2 bits here have been used by SCTP_PR_SCTP_MASK */
Packit Service 3880ab
	SCTP_SENDALL		= (1 << 6),
Packit Service 3880ab
	SCTP_PR_SCTP_ALL	= (1 << 7),
Packit Service 3880ab
	SCTP_NOTIFICATION	= MSG_NOTIFICATION, /* Next message is not user msg but notification. */
Packit Service 3880ab
	SCTP_EOF		= MSG_FIN,  /* Initiate graceful shutdown process. */
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
typedef union {
Packit Service 3880ab
	__u8   			raw;
Packit Service 3880ab
	struct sctp_initmsg	init;
Packit Service 3880ab
	struct sctp_sndrcvinfo	sndrcv;
Packit Service 3880ab
} sctp_cmsg_data_t;
Packit Service 3880ab
Packit Service 3880ab
/* These are cmsg_types.  */
Packit Service 3880ab
typedef enum sctp_cmsg_type {
Packit Service 3880ab
	SCTP_INIT,		/* 5.2.1 SCTP Initiation Structure */
Packit Service 3880ab
#define SCTP_INIT	SCTP_INIT
Packit Service 3880ab
	SCTP_SNDRCV,		/* 5.2.2 SCTP Header Information Structure */
Packit Service 3880ab
#define SCTP_SNDRCV	SCTP_SNDRCV
Packit Service 3880ab
	SCTP_SNDINFO,		/* 5.3.4 SCTP Send Information Structure */
Packit Service 3880ab
#define SCTP_SNDINFO	SCTP_SNDINFO
Packit Service 3880ab
	SCTP_RCVINFO,		/* 5.3.5 SCTP Receive Information Structure */
Packit Service 3880ab
#define SCTP_RCVINFO	SCTP_RCVINFO
Packit Service 3880ab
	SCTP_NXTINFO,		/* 5.3.6 SCTP Next Receive Information Structure */
Packit Service 3880ab
#define SCTP_NXTINFO	SCTP_NXTINFO
Packit Service 3880ab
	SCTP_PRINFO,		/* 5.3.7 SCTP PR-SCTP Information Structure */
Packit Service 3880ab
#define SCTP_PRINFO	SCTP_PRINFO
Packit Service 3880ab
	SCTP_AUTHINFO,		/* 5.3.8 SCTP AUTH Information Structure */
Packit Service 3880ab
#define SCTP_AUTHINFO	SCTP_AUTHINFO
Packit Service 3880ab
	SCTP_DSTADDRV4,		/* 5.3.9 SCTP Destination IPv4 Address Structure */
Packit Service 3880ab
#define SCTP_DSTADDRV4	SCTP_DSTADDRV4
Packit Service 3880ab
	SCTP_DSTADDRV6,		/* 5.3.10 SCTP Destination IPv6 Address Structure */
Packit Service 3880ab
#define SCTP_DSTADDRV6	SCTP_DSTADDRV6
Packit Service 3880ab
} sctp_cmsg_t;
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 5.3.1.1 SCTP_ASSOC_CHANGE
Packit Service 3880ab
 *
Packit Service 3880ab
 *   Communication notifications inform the ULP that an SCTP association
Packit Service 3880ab
 *   has either begun or ended. The identifier for a new association is
Packit Service 3880ab
 *   provided by this notificaion. The notification information has the
Packit Service 3880ab
 *   following format:
Packit Service 3880ab
 *
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_assoc_change {
Packit Service 3880ab
	__u16 sac_type;
Packit Service 3880ab
	__u16 sac_flags;
Packit Service 3880ab
	__u32 sac_length;
Packit Service 3880ab
	__u16 sac_state;
Packit Service 3880ab
	__u16 sac_error;
Packit Service 3880ab
	__u16 sac_outbound_streams;
Packit Service 3880ab
	__u16 sac_inbound_streams;
Packit Service 3880ab
	sctp_assoc_t sac_assoc_id;
Packit Service 3880ab
	__u8 sac_info[0];
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 *   sac_state: 32 bits (signed integer)
Packit Service 3880ab
 *
Packit Service 3880ab
 *   This field holds one of a number of values that communicate the
Packit Service 3880ab
 *   event that happened to the association.  They include:
Packit Service 3880ab
 *
Packit Service 3880ab
 *   Note:  The following state names deviate from the API draft as
Packit Service 3880ab
 *   the names clash too easily with other kernel symbols.
Packit Service 3880ab
 */
Packit Service 3880ab
enum sctp_sac_state {
Packit Service 3880ab
	SCTP_COMM_UP,
Packit Service 3880ab
	SCTP_COMM_LOST,
Packit Service 3880ab
	SCTP_RESTART,
Packit Service 3880ab
	SCTP_SHUTDOWN_COMP,
Packit Service 3880ab
	SCTP_CANT_STR_ASSOC,
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 5.3.1.2 SCTP_PEER_ADDR_CHANGE
Packit Service 3880ab
 *
Packit Service 3880ab
 *   When a destination address on a multi-homed peer encounters a change
Packit Service 3880ab
 *   an interface details event is sent.  The information has the
Packit Service 3880ab
 *   following structure:
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_paddr_change {
Packit Service 3880ab
	__u16 spc_type;
Packit Service 3880ab
	__u16 spc_flags;
Packit Service 3880ab
	__u32 spc_length;
Packit Service 3880ab
	struct sockaddr_storage spc_aaddr;
Packit Service 3880ab
	int spc_state;
Packit Service 3880ab
	int spc_error;
Packit Service 3880ab
	sctp_assoc_t spc_assoc_id;
Packit Service 3880ab
} __attribute__((packed, aligned(4)));
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 *    spc_state:  32 bits (signed integer)
Packit Service 3880ab
 *
Packit Service 3880ab
 *   This field holds one of a number of values that communicate the
Packit Service 3880ab
 *   event that happened to the address.  They include:
Packit Service 3880ab
 */
Packit Service 3880ab
enum sctp_spc_state {
Packit Service 3880ab
	SCTP_ADDR_AVAILABLE,
Packit Service 3880ab
	SCTP_ADDR_UNREACHABLE,
Packit Service 3880ab
	SCTP_ADDR_REMOVED,
Packit Service 3880ab
	SCTP_ADDR_ADDED,
Packit Service 3880ab
	SCTP_ADDR_MADE_PRIM,
Packit Service 3880ab
	SCTP_ADDR_CONFIRMED,
Packit Service 3880ab
	SCTP_ADDR_POTENTIALLY_FAILED,
Packit Service 3880ab
#define SCTP_ADDR_PF	SCTP_ADDR_POTENTIALLY_FAILED
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 5.3.1.3 SCTP_REMOTE_ERROR
Packit Service 3880ab
 *
Packit Service 3880ab
 *   A remote peer may send an Operational Error message to its peer.
Packit Service 3880ab
 *   This message indicates a variety of error conditions on an
Packit Service 3880ab
 *   association. The entire error TLV as it appears on the wire is
Packit Service 3880ab
 *   included in a SCTP_REMOTE_ERROR event.  Please refer to the SCTP
Packit Service 3880ab
 *   specification [SCTP] and any extensions for a list of possible
Packit Service 3880ab
 *   error formats. SCTP error TLVs have the format:
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_remote_error {
Packit Service 3880ab
	__u16 sre_type;
Packit Service 3880ab
	__u16 sre_flags;
Packit Service 3880ab
	__u32 sre_length;
Packit Service 3880ab
	__be16 sre_error;
Packit Service 3880ab
	sctp_assoc_t sre_assoc_id;
Packit Service 3880ab
	__u8 sre_data[0];
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 5.3.1.4 SCTP_SEND_FAILED
Packit Service 3880ab
 *
Packit Service 3880ab
 *   If SCTP cannot deliver a message it may return the message as a
Packit Service 3880ab
 *   notification.
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_send_failed {
Packit Service 3880ab
	__u16 ssf_type;
Packit Service 3880ab
	__u16 ssf_flags;
Packit Service 3880ab
	__u32 ssf_length;
Packit Service 3880ab
	__u32 ssf_error;
Packit Service 3880ab
	struct sctp_sndrcvinfo ssf_info;
Packit Service 3880ab
	sctp_assoc_t ssf_assoc_id;
Packit Service 3880ab
	__u8 ssf_data[0];
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
struct sctp_send_failed_event {
Packit Service 3880ab
	__u16 ssf_type;
Packit Service 3880ab
	__u16 ssf_flags;
Packit Service 3880ab
	__u32 ssf_length;
Packit Service 3880ab
	__u32 ssf_error;
Packit Service 3880ab
	struct sctp_sndinfo ssfe_info;
Packit Service 3880ab
	sctp_assoc_t ssf_assoc_id;
Packit Service 3880ab
	__u8 ssf_data[0];
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 *   ssf_flags: 16 bits (unsigned integer)
Packit Service 3880ab
 *
Packit Service 3880ab
 *   The flag value will take one of the following values
Packit Service 3880ab
 *
Packit Service 3880ab
 *   SCTP_DATA_UNSENT  - Indicates that the data was never put on
Packit Service 3880ab
 *                       the wire.
Packit Service 3880ab
 *
Packit Service 3880ab
 *   SCTP_DATA_SENT    - Indicates that the data was put on the wire.
Packit Service 3880ab
 *                       Note that this does not necessarily mean that the
Packit Service 3880ab
 *                       data was (or was not) successfully delivered.
Packit Service 3880ab
 */
Packit Service 3880ab
enum sctp_ssf_flags {
Packit Service 3880ab
	SCTP_DATA_UNSENT,
Packit Service 3880ab
	SCTP_DATA_SENT,
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 5.3.1.5 SCTP_SHUTDOWN_EVENT
Packit Service 3880ab
 *
Packit Service 3880ab
 *   When a peer sends a SHUTDOWN, SCTP delivers this notification to
Packit Service 3880ab
 *   inform the application that it should cease sending data.
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_shutdown_event {
Packit Service 3880ab
	__u16 sse_type;
Packit Service 3880ab
	__u16 sse_flags;
Packit Service 3880ab
	__u32 sse_length;
Packit Service 3880ab
	sctp_assoc_t sse_assoc_id;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 5.3.1.6 SCTP_ADAPTATION_INDICATION
Packit Service 3880ab
 *
Packit Service 3880ab
 *   When a peer sends a Adaptation Layer Indication parameter , SCTP
Packit Service 3880ab
 *   delivers this notification to inform the application
Packit Service 3880ab
 *   that of the peers requested adaptation layer.
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_adaptation_event {
Packit Service 3880ab
	__u16 sai_type;
Packit Service 3880ab
	__u16 sai_flags;
Packit Service 3880ab
	__u32 sai_length;
Packit Service 3880ab
	__u32 sai_adaptation_ind;
Packit Service 3880ab
	sctp_assoc_t sai_assoc_id;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 5.3.1.7 SCTP_PARTIAL_DELIVERY_EVENT
Packit Service 3880ab
 *
Packit Service 3880ab
 *   When a receiver is engaged in a partial delivery of a
Packit Service 3880ab
 *   message this notification will be used to indicate
Packit Service 3880ab
 *   various events.
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_pdapi_event {
Packit Service 3880ab
	__u16 pdapi_type;
Packit Service 3880ab
	__u16 pdapi_flags;
Packit Service 3880ab
	__u32 pdapi_length;
Packit Service 3880ab
	__u32 pdapi_indication;
Packit Service 3880ab
	sctp_assoc_t pdapi_assoc_id;
Packit Service 3880ab
	__u32 pdapi_stream;
Packit Service 3880ab
	__u32 pdapi_seq;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
enum { SCTP_PARTIAL_DELIVERY_ABORTED=0, };
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 5.3.1.8.  SCTP_AUTHENTICATION_EVENT
Packit Service 3880ab
 *
Packit Service 3880ab
 *  When a receiver is using authentication this message will provide
Packit Service 3880ab
 *  notifications regarding new keys being made active as well as errors.
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_authkey_event {
Packit Service 3880ab
	__u16 auth_type;
Packit Service 3880ab
	__u16 auth_flags;
Packit Service 3880ab
	__u32 auth_length;
Packit Service 3880ab
	__u16 auth_keynumber;
Packit Service 3880ab
	__u16 auth_altkeynumber;
Packit Service 3880ab
	__u32 auth_indication;
Packit Service 3880ab
	sctp_assoc_t auth_assoc_id;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
enum {
Packit Service 3880ab
	SCTP_AUTH_NEW_KEY,
Packit Service 3880ab
#define	SCTP_AUTH_NEWKEY	SCTP_AUTH_NEW_KEY /* compatible with before */
Packit Service 3880ab
	SCTP_AUTH_FREE_KEY,
Packit Service 3880ab
	SCTP_AUTH_NO_AUTH,
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 6.1.9. SCTP_SENDER_DRY_EVENT
Packit Service 3880ab
 *
Packit Service 3880ab
 * When the SCTP stack has no more user data to send or retransmit, this
Packit Service 3880ab
 * notification is given to the user. Also, at the time when a user app
Packit Service 3880ab
 * subscribes to this event, if there is no data to be sent or
Packit Service 3880ab
 * retransmit, the stack will immediately send up this notification.
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_sender_dry_event {
Packit Service 3880ab
	__u16 sender_dry_type;
Packit Service 3880ab
	__u16 sender_dry_flags;
Packit Service 3880ab
	__u32 sender_dry_length;
Packit Service 3880ab
	sctp_assoc_t sender_dry_assoc_id;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
#define SCTP_STREAM_RESET_INCOMING_SSN	0x0001
Packit Service 3880ab
#define SCTP_STREAM_RESET_OUTGOING_SSN	0x0002
Packit Service 3880ab
#define SCTP_STREAM_RESET_DENIED	0x0004
Packit Service 3880ab
#define SCTP_STREAM_RESET_FAILED	0x0008
Packit Service 3880ab
struct sctp_stream_reset_event {
Packit Service 3880ab
	__u16 strreset_type;
Packit Service 3880ab
	__u16 strreset_flags;
Packit Service 3880ab
	__u32 strreset_length;
Packit Service 3880ab
	sctp_assoc_t strreset_assoc_id;
Packit Service 3880ab
	__u16 strreset_stream_list[];
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
#define SCTP_ASSOC_RESET_DENIED		0x0004
Packit Service 3880ab
#define SCTP_ASSOC_RESET_FAILED		0x0008
Packit Service 3880ab
struct sctp_assoc_reset_event {
Packit Service 3880ab
	__u16 assocreset_type;
Packit Service 3880ab
	__u16 assocreset_flags;
Packit Service 3880ab
	__u32 assocreset_length;
Packit Service 3880ab
	sctp_assoc_t assocreset_assoc_id;
Packit Service 3880ab
	__u32 assocreset_local_tsn;
Packit Service 3880ab
	__u32 assocreset_remote_tsn;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
#define SCTP_ASSOC_CHANGE_DENIED	0x0004
Packit Service 3880ab
#define SCTP_ASSOC_CHANGE_FAILED	0x0008
Packit Service 3880ab
#define SCTP_STREAM_CHANGE_DENIED	SCTP_ASSOC_CHANGE_DENIED
Packit Service 3880ab
#define SCTP_STREAM_CHANGE_FAILED	SCTP_ASSOC_CHANGE_FAILED
Packit Service 3880ab
struct sctp_stream_change_event {
Packit Service 3880ab
	__u16 strchange_type;
Packit Service 3880ab
	__u16 strchange_flags;
Packit Service 3880ab
	__u32 strchange_length;
Packit Service 3880ab
	sctp_assoc_t strchange_assoc_id;
Packit Service 3880ab
	__u16 strchange_instrms;
Packit Service 3880ab
	__u16 strchange_outstrms;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * Described in Section 7.3
Packit Service 3880ab
 *   Ancillary Data and Notification Interest Options
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_event_subscribe {
Packit Service 3880ab
	__u8 sctp_data_io_event;
Packit Service 3880ab
	__u8 sctp_association_event;
Packit Service 3880ab
	__u8 sctp_address_event;
Packit Service 3880ab
	__u8 sctp_send_failure_event;
Packit Service 3880ab
	__u8 sctp_peer_error_event;
Packit Service 3880ab
	__u8 sctp_shutdown_event;
Packit Service 3880ab
	__u8 sctp_partial_delivery_event;
Packit Service 3880ab
	__u8 sctp_adaptation_layer_event;
Packit Service 3880ab
	__u8 sctp_authentication_event;
Packit Service 3880ab
	__u8 sctp_sender_dry_event;
Packit Service 3880ab
	__u8 sctp_stream_reset_event;
Packit Service 3880ab
	__u8 sctp_assoc_reset_event;
Packit Service 3880ab
	__u8 sctp_stream_change_event;
Packit Service 3880ab
	__u8 sctp_send_failure_event_event;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 5.3.1 SCTP Notification Structure
Packit Service 3880ab
 *
Packit Service 3880ab
 *   The notification structure is defined as the union of all
Packit Service 3880ab
 *   notification types.
Packit Service 3880ab
 *
Packit Service 3880ab
 */
Packit Service 3880ab
union sctp_notification {
Packit Service 3880ab
	struct {
Packit Service 3880ab
		__u16 sn_type;             /* Notification type. */
Packit Service 3880ab
		__u16 sn_flags;
Packit Service 3880ab
		__u32 sn_length;
Packit Service 3880ab
	} sn_header;
Packit Service 3880ab
	struct sctp_assoc_change sn_assoc_change;
Packit Service 3880ab
	struct sctp_paddr_change sn_paddr_change;
Packit Service 3880ab
	struct sctp_remote_error sn_remote_error;
Packit Service 3880ab
	struct sctp_send_failed sn_send_failed;
Packit Service 3880ab
	struct sctp_shutdown_event sn_shutdown_event;
Packit Service 3880ab
	struct sctp_adaptation_event sn_adaptation_event;
Packit Service 3880ab
	struct sctp_pdapi_event sn_pdapi_event;
Packit Service 3880ab
	struct sctp_authkey_event sn_authkey_event;
Packit Service 3880ab
	struct sctp_sender_dry_event sn_sender_dry_event;
Packit Service 3880ab
	struct sctp_stream_reset_event sn_strreset_event;
Packit Service 3880ab
	struct sctp_assoc_reset_event sn_assocreset_event;
Packit Service 3880ab
	struct sctp_stream_change_event sn_strchange_event;
Packit Service 3880ab
	struct sctp_send_failed_event sn_send_failed_event;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/* Section 5.3.1
Packit Service 3880ab
 * All standard values for sn_type flags are greater than 2^15.
Packit Service 3880ab
 * Values from 2^15 and down are reserved.
Packit Service 3880ab
 */
Packit Service 3880ab
Packit Service 3880ab
enum sctp_sn_type {
Packit Service 3880ab
	SCTP_SN_TYPE_BASE	= (1<<15),
Packit Service 3880ab
	SCTP_DATA_IO_EVENT	= SCTP_SN_TYPE_BASE,
Packit Service 3880ab
#define SCTP_DATA_IO_EVENT		SCTP_DATA_IO_EVENT
Packit Service 3880ab
	SCTP_ASSOC_CHANGE,
Packit Service 3880ab
#define SCTP_ASSOC_CHANGE		SCTP_ASSOC_CHANGE
Packit Service 3880ab
	SCTP_PEER_ADDR_CHANGE,
Packit Service 3880ab
#define SCTP_PEER_ADDR_CHANGE		SCTP_PEER_ADDR_CHANGE
Packit Service 3880ab
	SCTP_SEND_FAILED,
Packit Service 3880ab
#define SCTP_SEND_FAILED		SCTP_SEND_FAILED
Packit Service 3880ab
	SCTP_REMOTE_ERROR,
Packit Service 3880ab
#define SCTP_REMOTE_ERROR		SCTP_REMOTE_ERROR
Packit Service 3880ab
	SCTP_SHUTDOWN_EVENT,
Packit Service 3880ab
#define SCTP_SHUTDOWN_EVENT		SCTP_SHUTDOWN_EVENT
Packit Service 3880ab
	SCTP_PARTIAL_DELIVERY_EVENT,
Packit Service 3880ab
#define SCTP_PARTIAL_DELIVERY_EVENT	SCTP_PARTIAL_DELIVERY_EVENT
Packit Service 3880ab
	SCTP_ADAPTATION_INDICATION,
Packit Service 3880ab
#define SCTP_ADAPTATION_INDICATION	SCTP_ADAPTATION_INDICATION
Packit Service 3880ab
	SCTP_AUTHENTICATION_EVENT,
Packit Service 3880ab
#define SCTP_AUTHENTICATION_INDICATION	SCTP_AUTHENTICATION_EVENT
Packit Service 3880ab
	SCTP_SENDER_DRY_EVENT,
Packit Service 3880ab
#define SCTP_SENDER_DRY_EVENT		SCTP_SENDER_DRY_EVENT
Packit Service 3880ab
	SCTP_STREAM_RESET_EVENT,
Packit Service 3880ab
#define SCTP_STREAM_RESET_EVENT		SCTP_STREAM_RESET_EVENT
Packit Service 3880ab
	SCTP_ASSOC_RESET_EVENT,
Packit Service 3880ab
#define SCTP_ASSOC_RESET_EVENT		SCTP_ASSOC_RESET_EVENT
Packit Service 3880ab
	SCTP_STREAM_CHANGE_EVENT,
Packit Service 3880ab
#define SCTP_STREAM_CHANGE_EVENT	SCTP_STREAM_CHANGE_EVENT
Packit Service 3880ab
	SCTP_SEND_FAILED_EVENT,
Packit Service 3880ab
#define SCTP_SEND_FAILED_EVENT		SCTP_SEND_FAILED_EVENT
Packit Service 3880ab
	SCTP_SN_TYPE_MAX	= SCTP_SEND_FAILED_EVENT,
Packit Service 3880ab
#define SCTP_SN_TYPE_MAX		SCTP_SN_TYPE_MAX
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/* Notification error codes used to fill up the error fields in some
Packit Service 3880ab
 * notifications.
Packit Service 3880ab
 * SCTP_PEER_ADDRESS_CHAGE 	: spc_error
Packit Service 3880ab
 * SCTP_ASSOC_CHANGE		: sac_error
Packit Service 3880ab
 * These names should be potentially included in the draft 04 of the SCTP
Packit Service 3880ab
 * sockets API specification.
Packit Service 3880ab
 */
Packit Service 3880ab
typedef enum sctp_sn_error {
Packit Service 3880ab
	SCTP_FAILED_THRESHOLD,
Packit Service 3880ab
	SCTP_RECEIVED_SACK,
Packit Service 3880ab
	SCTP_HEARTBEAT_SUCCESS,
Packit Service 3880ab
	SCTP_RESPONSE_TO_USER_REQ,
Packit Service 3880ab
	SCTP_INTERNAL_ERROR,
Packit Service 3880ab
	SCTP_SHUTDOWN_GUARD_EXPIRES,
Packit Service 3880ab
	SCTP_PEER_FAULTY,
Packit Service 3880ab
} sctp_sn_error_t;
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 7.1.1 Retransmission Timeout Parameters (SCTP_RTOINFO)
Packit Service 3880ab
 *
Packit Service 3880ab
 *   The protocol parameters used to initialize and bound retransmission
Packit Service 3880ab
 *   timeout (RTO) are tunable.  See [SCTP] for more information on how
Packit Service 3880ab
 *   these parameters are used in RTO calculation.
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_rtoinfo {
Packit Service 3880ab
	sctp_assoc_t	srto_assoc_id;
Packit Service 3880ab
	__u32		srto_initial;
Packit Service 3880ab
	__u32		srto_max;
Packit Service 3880ab
	__u32		srto_min;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 7.1.2 Association Parameters (SCTP_ASSOCINFO)
Packit Service 3880ab
 *
Packit Service 3880ab
 *   This option is used to both examine and set various association and
Packit Service 3880ab
 *   endpoint parameters.
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_assocparams {
Packit Service 3880ab
	sctp_assoc_t	sasoc_assoc_id;
Packit Service 3880ab
	__u16		sasoc_asocmaxrxt;
Packit Service 3880ab
	__u16		sasoc_number_peer_destinations;
Packit Service 3880ab
	__u32		sasoc_peer_rwnd;
Packit Service 3880ab
	__u32		sasoc_local_rwnd;
Packit Service 3880ab
	__u32		sasoc_cookie_life;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 7.1.9 Set Peer Primary Address (SCTP_SET_PEER_PRIMARY_ADDR)
Packit Service 3880ab
 *
Packit Service 3880ab
 *  Requests that the peer mark the enclosed address as the association
Packit Service 3880ab
 *  primary. The enclosed address must be one of the association's
Packit Service 3880ab
 *  locally bound addresses. The following structure is used to make a
Packit Service 3880ab
 *   set primary request:
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_setpeerprim {
Packit Service 3880ab
	sctp_assoc_t            sspp_assoc_id;
Packit Service 3880ab
	struct sockaddr_storage sspp_addr;
Packit Service 3880ab
} __attribute__((packed, aligned(4)));
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 7.1.10 Set Primary Address (SCTP_PRIMARY_ADDR)
Packit Service 3880ab
 *
Packit Service 3880ab
 *  Requests that the local SCTP stack use the enclosed peer address as
Packit Service 3880ab
 *  the association primary. The enclosed address must be one of the
Packit Service 3880ab
 *  association peer's addresses. The following structure is used to
Packit Service 3880ab
 *  make a set peer primary request:
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_prim {
Packit Service 3880ab
	sctp_assoc_t            ssp_assoc_id;
Packit Service 3880ab
	struct sockaddr_storage ssp_addr;
Packit Service 3880ab
} __attribute__((packed, aligned(4)));
Packit Service 3880ab
Packit Service 3880ab
/* For backward compatibility use, define the old name too */
Packit Service 3880ab
#define sctp_setprim	sctp_prim
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 7.1.11 Set Adaptation Layer Indicator (SCTP_ADAPTATION_LAYER)
Packit Service 3880ab
 *
Packit Service 3880ab
 * Requests that the local endpoint set the specified Adaptation Layer
Packit Service 3880ab
 * Indication parameter for all future INIT and INIT-ACK exchanges.
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_setadaptation {
Packit Service 3880ab
	__u32	ssb_adaptation_ind;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 7.1.13 Peer Address Parameters  (SCTP_PEER_ADDR_PARAMS)
Packit Service 3880ab
 *
Packit Service 3880ab
 *   Applications can enable or disable heartbeats for any peer address
Packit Service 3880ab
 *   of an association, modify an address's heartbeat interval, force a
Packit Service 3880ab
 *   heartbeat to be sent immediately, and adjust the address's maximum
Packit Service 3880ab
 *   number of retransmissions sent before an address is considered
Packit Service 3880ab
 *   unreachable. The following structure is used to access and modify an
Packit Service 3880ab
 *   address's parameters:
Packit Service 3880ab
 */
Packit Service 3880ab
enum  sctp_spp_flags {
Packit Service 3880ab
	SPP_HB_ENABLE = 1<<0,		/*Enable heartbeats*/
Packit Service 3880ab
	SPP_HB_DISABLE = 1<<1,		/*Disable heartbeats*/
Packit Service 3880ab
	SPP_HB = SPP_HB_ENABLE | SPP_HB_DISABLE,
Packit Service 3880ab
	SPP_HB_DEMAND = 1<<2,		/*Send heartbeat immediately*/
Packit Service 3880ab
	SPP_PMTUD_ENABLE = 1<<3,	/*Enable PMTU discovery*/
Packit Service 3880ab
	SPP_PMTUD_DISABLE = 1<<4,	/*Disable PMTU discovery*/
Packit Service 3880ab
	SPP_PMTUD = SPP_PMTUD_ENABLE | SPP_PMTUD_DISABLE,
Packit Service 3880ab
	SPP_SACKDELAY_ENABLE = 1<<5,	/*Enable SACK*/
Packit Service 3880ab
	SPP_SACKDELAY_DISABLE = 1<<6,	/*Disable SACK*/
Packit Service 3880ab
	SPP_SACKDELAY = SPP_SACKDELAY_ENABLE | SPP_SACKDELAY_DISABLE,
Packit Service 3880ab
	SPP_HB_TIME_IS_ZERO = 1<<7,	/* Set HB delay to 0 */
Packit Service 3880ab
	SPP_IPV6_FLOWLABEL = 1<<8,
Packit Service 3880ab
	SPP_DSCP = 1<<9,
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
struct sctp_paddrparams {
Packit Service 3880ab
	sctp_assoc_t		spp_assoc_id;
Packit Service 3880ab
	struct sockaddr_storage	spp_address;
Packit Service 3880ab
	__u32			spp_hbinterval;
Packit Service 3880ab
	__u16			spp_pathmaxrxt;
Packit Service 3880ab
	__u32			spp_pathmtu;
Packit Service 3880ab
	__u32			spp_sackdelay;
Packit Service 3880ab
	__u32			spp_flags;
Packit Service 3880ab
	__u32			spp_ipv6_flowlabel;
Packit Service 3880ab
	__u8			spp_dscp;
Packit Service 3880ab
} __attribute__((packed, aligned(4)));
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 7.1.18.  Add a chunk that must be authenticated (SCTP_AUTH_CHUNK)
Packit Service 3880ab
 *
Packit Service 3880ab
 * This set option adds a chunk type that the user is requesting to be
Packit Service 3880ab
 * received only in an authenticated way.  Changes to the list of chunks
Packit Service 3880ab
 * will only effect future associations on the socket.
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_authchunk {
Packit Service 3880ab
	__u8		sauth_chunk;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 7.1.19.  Get or set the list of supported HMAC Identifiers (SCTP_HMAC_IDENT)
Packit Service 3880ab
 *
Packit Service 3880ab
 * This option gets or sets the list of HMAC algorithms that the local
Packit Service 3880ab
 * endpoint requires the peer to use.
Packit Service 3880ab
 */
Packit Service 3880ab
/* This here is only used by user space as is. It might not be a good idea
Packit Service 3880ab
 * to export/reveal the whole structure with reserved fields etc.
Packit Service 3880ab
 */
Packit Service 3880ab
enum {
Packit Service 3880ab
	SCTP_AUTH_HMAC_ID_SHA1 = 1,
Packit Service 3880ab
	SCTP_AUTH_HMAC_ID_SHA256 = 3,
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
struct sctp_hmacalgo {
Packit Service 3880ab
	__u32		shmac_num_idents;
Packit Service 3880ab
	__u16		shmac_idents[];
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/* Sadly, user and kernel space have different names for
Packit Service 3880ab
 * this structure member, so this is to not break anything.
Packit Service 3880ab
 */
Packit Service 3880ab
#define shmac_number_of_idents	shmac_num_idents
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 7.1.20.  Set a shared key (SCTP_AUTH_KEY)
Packit Service 3880ab
 *
Packit Service 3880ab
 * This option will set a shared secret key which is used to build an
Packit Service 3880ab
 * association shared key.
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_authkey {
Packit Service 3880ab
	sctp_assoc_t	sca_assoc_id;
Packit Service 3880ab
	__u16		sca_keynumber;
Packit Service 3880ab
	__u16		sca_keylength;
Packit Service 3880ab
	__u8		sca_key[];
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 7.1.21.  Get or set the active shared key (SCTP_AUTH_ACTIVE_KEY)
Packit Service 3880ab
 *
Packit Service 3880ab
 * This option will get or set the active shared key to be used to build
Packit Service 3880ab
 * the association shared key.
Packit Service 3880ab
 */
Packit Service 3880ab
Packit Service 3880ab
struct sctp_authkeyid {
Packit Service 3880ab
	sctp_assoc_t	scact_assoc_id;
Packit Service 3880ab
	__u16		scact_keynumber;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 7.1.23.  Get or set delayed ack timer (SCTP_DELAYED_SACK)
Packit Service 3880ab
 *
Packit Service 3880ab
 * This option will effect the way delayed acks are performed.  This
Packit Service 3880ab
 * option allows you to get or set the delayed ack time, in
Packit Service 3880ab
 * milliseconds.  It also allows changing the delayed ack frequency.
Packit Service 3880ab
 * Changing the frequency to 1 disables the delayed sack algorithm.  If
Packit Service 3880ab
 * the assoc_id is 0, then this sets or gets the endpoints default
Packit Service 3880ab
 * values.  If the assoc_id field is non-zero, then the set or get
Packit Service 3880ab
 * effects the specified association for the one to many model (the
Packit Service 3880ab
 * assoc_id field is ignored by the one to one model).  Note that if
Packit Service 3880ab
 * sack_delay or sack_freq are 0 when setting this option, then the
Packit Service 3880ab
 * current values will remain unchanged.
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_sack_info {
Packit Service 3880ab
	sctp_assoc_t	sack_assoc_id;
Packit Service 3880ab
	uint32_t	sack_delay;
Packit Service 3880ab
	uint32_t	sack_freq;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
struct sctp_assoc_value {
Packit Service 3880ab
    sctp_assoc_t            assoc_id;
Packit Service 3880ab
    uint32_t                assoc_value;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
struct sctp_stream_value {
Packit Service 3880ab
	sctp_assoc_t assoc_id;
Packit Service 3880ab
	uint16_t stream_id;
Packit Service 3880ab
	uint16_t stream_value;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 7.2.2 Peer Address Information
Packit Service 3880ab
 *
Packit Service 3880ab
 *   Applications can retrieve information about a specific peer address
Packit Service 3880ab
 *   of an association, including its reachability state, congestion
Packit Service 3880ab
 *   window, and retransmission timer values.  This information is
Packit Service 3880ab
 *   read-only. The following structure is used to access this
Packit Service 3880ab
 *   information:
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_paddrinfo {
Packit Service 3880ab
	sctp_assoc_t		spinfo_assoc_id;
Packit Service 3880ab
	struct sockaddr_storage	spinfo_address;
Packit Service 3880ab
	__s32			spinfo_state;
Packit Service 3880ab
	__u32			spinfo_cwnd;
Packit Service 3880ab
	__u32			spinfo_srtt;
Packit Service 3880ab
	__u32			spinfo_rto;
Packit Service 3880ab
	__u32			spinfo_mtu;
Packit Service 3880ab
} __attribute__((packed, aligned(4)));
Packit Service 3880ab
Packit Service 3880ab
/* Peer addresses's state. */
Packit Service 3880ab
/* UNKNOWN: Peer address passed by the upper layer in sendmsg or connect[x]
Packit Service 3880ab
 * calls.
Packit Service 3880ab
 * UNCONFIRMED: Peer address received in INIT/INIT-ACK address parameters.
Packit Service 3880ab
 *              Not yet confirmed by a heartbeat and not available for data
Packit Service 3880ab
 *		transfers.
Packit Service 3880ab
 * ACTIVE : Peer address confirmed, active and available for data transfers.
Packit Service 3880ab
 * INACTIVE: Peer address inactive and not available for data transfers.
Packit Service 3880ab
 */
Packit Service 3880ab
enum sctp_spinfo_state {
Packit Service 3880ab
	SCTP_INACTIVE,
Packit Service 3880ab
	SCTP_PF,
Packit Service 3880ab
#define	SCTP_POTENTIALLY_FAILED		SCTP_PF
Packit Service 3880ab
	SCTP_ACTIVE,
Packit Service 3880ab
	SCTP_UNCONFIRMED,
Packit Service 3880ab
	SCTP_UNKNOWN = 0xffff  /* Value used for transport state unknown */
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 7.2.1 Association Status (SCTP_STATUS)
Packit Service 3880ab
 *
Packit Service 3880ab
 *   Applications can retrieve current status information about an
Packit Service 3880ab
 *   association, including association state, peer receiver window size,
Packit Service 3880ab
 *   number of unacked data chunks, and number of data chunks pending
Packit Service 3880ab
 *   receipt.  This information is read-only.  The following structure is
Packit Service 3880ab
 *   used to access this information:
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_status {
Packit Service 3880ab
	sctp_assoc_t		sstat_assoc_id;
Packit Service 3880ab
	__s32			sstat_state;
Packit Service 3880ab
	__u32			sstat_rwnd;
Packit Service 3880ab
	__u16			sstat_unackdata;
Packit Service 3880ab
	__u16			sstat_penddata;
Packit Service 3880ab
	__u16			sstat_instrms;
Packit Service 3880ab
	__u16			sstat_outstrms;
Packit Service 3880ab
	__u32			sstat_fragmentation_point;
Packit Service 3880ab
	struct sctp_paddrinfo	sstat_primary;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 7.2.3.  Get the list of chunks the peer requires to be authenticated
Packit Service 3880ab
 *         (SCTP_PEER_AUTH_CHUNKS)
Packit Service 3880ab
 *
Packit Service 3880ab
 * This option gets a list of chunks for a specified association that
Packit Service 3880ab
 * the peer requires to be received authenticated only.
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_authchunks {
Packit Service 3880ab
	sctp_assoc_t	gauth_assoc_id;
Packit Service 3880ab
	__u32		gauth_number_of_chunks;
Packit Service 3880ab
	uint8_t		gauth_chunks[];
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/* The broken spelling has been released already in lksctp-tools header,
Packit Service 3880ab
 * so don't break anyone, now that it's fixed.
Packit Service 3880ab
 */
Packit Service 3880ab
#define guth_number_of_chunks	gauth_number_of_chunks
Packit Service 3880ab
Packit Service 3880ab
/* Association states.  */
Packit Service 3880ab
enum sctp_sstat_state {
Packit Service 3880ab
	SCTP_EMPTY                = 0,
Packit Service 3880ab
	SCTP_CLOSED               = 1,
Packit Service 3880ab
	SCTP_COOKIE_WAIT          = 2,
Packit Service 3880ab
	SCTP_COOKIE_ECHOED        = 3,
Packit Service 3880ab
	SCTP_ESTABLISHED          = 4,
Packit Service 3880ab
	SCTP_SHUTDOWN_PENDING     = 5,
Packit Service 3880ab
	SCTP_SHUTDOWN_SENT        = 6,
Packit Service 3880ab
	SCTP_SHUTDOWN_RECEIVED    = 7,
Packit Service 3880ab
	SCTP_SHUTDOWN_ACK_SENT    = 8,
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 8.2.6. Get the Current Identifiers of Associations
Packit Service 3880ab
 *        (SCTP_GET_ASSOC_ID_LIST)
Packit Service 3880ab
 *
Packit Service 3880ab
 * This option gets the current list of SCTP association identifiers of
Packit Service 3880ab
 * the SCTP associations handled by a one-to-many style socket.
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_assoc_ids {
Packit Service 3880ab
	__u32		gaids_number_of_ids;
Packit Service 3880ab
	sctp_assoc_t	gaids_assoc_id[];
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 8.3, 8.5 get all peer/local addresses in an association.
Packit Service 3880ab
 * This parameter struct is used by SCTP_GET_PEER_ADDRS and
Packit Service 3880ab
 * SCTP_GET_LOCAL_ADDRS socket options used internally to implement
Packit Service 3880ab
 * sctp_getpaddrs() and sctp_getladdrs() API.
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_getaddrs_old {
Packit Service 3880ab
	sctp_assoc_t            assoc_id;
Packit Service 3880ab
	int			addr_num;
Packit Service 3880ab
	struct sockaddr		*addrs;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
struct sctp_getaddrs {
Packit Service 3880ab
	sctp_assoc_t		assoc_id; /*input*/
Packit Service 3880ab
	__u32			addr_num; /*output*/
Packit Service 3880ab
	__u8			addrs[0]; /*output, variable size*/
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/* A socket user request obtained via SCTP_GET_ASSOC_STATS that retrieves
Packit Service 3880ab
 * association stats. All stats are counts except sas_maxrto and
Packit Service 3880ab
 * sas_obs_rto_ipaddr. maxrto is the max observed rto + transport since
Packit Service 3880ab
 * the last call. Will return 0 when RTO was not update since last call
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_assoc_stats {
Packit Service 3880ab
	sctp_assoc_t	sas_assoc_id;    /* Input */
Packit Service 3880ab
					 /* Transport of observed max RTO */
Packit Service 3880ab
	struct sockaddr_storage sas_obs_rto_ipaddr;
Packit Service 3880ab
	__u64		sas_maxrto;      /* Maximum Observed RTO for period */
Packit Service 3880ab
	__u64		sas_isacks;	 /* SACKs received */
Packit Service 3880ab
	__u64		sas_osacks;	 /* SACKs sent */
Packit Service 3880ab
	__u64		sas_opackets;	 /* Packets sent */
Packit Service 3880ab
	__u64		sas_ipackets;	 /* Packets received */
Packit Service 3880ab
	__u64		sas_rtxchunks;   /* Retransmitted Chunks */
Packit Service 3880ab
	__u64		sas_outofseqtsns;/* TSN received > next expected */
Packit Service 3880ab
	__u64		sas_idupchunks;  /* Dups received (ordered+unordered) */
Packit Service 3880ab
	__u64		sas_gapcnt;      /* Gap Acknowledgements Received */
Packit Service 3880ab
	__u64		sas_ouodchunks;  /* Unordered data chunks sent */
Packit Service 3880ab
	__u64		sas_iuodchunks;  /* Unordered data chunks received */
Packit Service 3880ab
	__u64		sas_oodchunks;	 /* Ordered data chunks sent */
Packit Service 3880ab
	__u64		sas_iodchunks;	 /* Ordered data chunks received */
Packit Service 3880ab
	__u64		sas_octrlchunks; /* Control chunks sent */
Packit Service 3880ab
	__u64		sas_ictrlchunks; /* Control chunks received */
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * 8.1 sctp_bindx()
Packit Service 3880ab
 *
Packit Service 3880ab
 * The flags parameter is formed from the bitwise OR of zero or more of the
Packit Service 3880ab
 * following currently defined flags:
Packit Service 3880ab
 */
Packit Service 3880ab
#define SCTP_BINDX_ADD_ADDR 0x01
Packit Service 3880ab
#define SCTP_BINDX_REM_ADDR 0x02
Packit Service 3880ab
Packit Service 3880ab
/* This is the structure that is passed as an argument(optval) to
Packit Service 3880ab
 * getsockopt(SCTP_SOCKOPT_PEELOFF).
Packit Service 3880ab
 */
Packit Service 3880ab
typedef struct {
Packit Service 3880ab
	sctp_assoc_t associd;
Packit Service 3880ab
	int sd;
Packit Service 3880ab
} sctp_peeloff_arg_t;
Packit Service 3880ab
Packit Service 3880ab
typedef struct {
Packit Service 3880ab
	sctp_peeloff_arg_t p_arg;
Packit Service 3880ab
	unsigned flags;
Packit Service 3880ab
} sctp_peeloff_flags_arg_t;
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 *  Peer Address Thresholds socket option
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_paddrthlds {
Packit Service 3880ab
	sctp_assoc_t spt_assoc_id;
Packit Service 3880ab
	struct sockaddr_storage spt_address;
Packit Service 3880ab
	__u16 spt_pathmaxrxt;
Packit Service 3880ab
	__u16 spt_pathpfthld;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/* Use a new structure with spt_pathcpthld for back compatibility */
Packit Service 3880ab
struct sctp_paddrthlds_v2 {
Packit Service 3880ab
	sctp_assoc_t spt_assoc_id;
Packit Service 3880ab
	struct sockaddr_storage spt_address;
Packit Service 3880ab
	__u16 spt_pathmaxrxt;
Packit Service 3880ab
	__u16 spt_pathpfthld;
Packit Service 3880ab
	__u16 spt_pathcpthld;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * Socket Option for Getting the Association/Stream-Specific PR-SCTP Status
Packit Service 3880ab
 */
Packit Service 3880ab
struct sctp_prstatus {
Packit Service 3880ab
	sctp_assoc_t sprstat_assoc_id;
Packit Service 3880ab
	__u16 sprstat_sid;
Packit Service 3880ab
	__u16 sprstat_policy;
Packit Service 3880ab
	__u64 sprstat_abandoned_unsent;
Packit Service 3880ab
	__u64 sprstat_abandoned_sent;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
struct sctp_default_prinfo {
Packit Service 3880ab
	sctp_assoc_t pr_assoc_id;
Packit Service 3880ab
	__u32 pr_value;
Packit Service 3880ab
	__u16 pr_policy;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
struct sctp_info {
Packit Service 3880ab
	__u32	sctpi_tag;
Packit Service 3880ab
	__u32	sctpi_state;
Packit Service 3880ab
	__u32	sctpi_rwnd;
Packit Service 3880ab
	__u16	sctpi_unackdata;
Packit Service 3880ab
	__u16	sctpi_penddata;
Packit Service 3880ab
	__u16	sctpi_instrms;
Packit Service 3880ab
	__u16	sctpi_outstrms;
Packit Service 3880ab
	__u32	sctpi_fragmentation_point;
Packit Service 3880ab
	__u32	sctpi_inqueue;
Packit Service 3880ab
	__u32	sctpi_outqueue;
Packit Service 3880ab
	__u32	sctpi_overall_error;
Packit Service 3880ab
	__u32	sctpi_max_burst;
Packit Service 3880ab
	__u32	sctpi_maxseg;
Packit Service 3880ab
	__u32	sctpi_peer_rwnd;
Packit Service 3880ab
	__u32	sctpi_peer_tag;
Packit Service 3880ab
	__u8	sctpi_peer_capable;
Packit Service 3880ab
	__u8	sctpi_peer_sack;
Packit Service 3880ab
	__u16	__reserved1;
Packit Service 3880ab
Packit Service 3880ab
	/* assoc status info */
Packit Service 3880ab
	__u64	sctpi_isacks;
Packit Service 3880ab
	__u64	sctpi_osacks;
Packit Service 3880ab
	__u64	sctpi_opackets;
Packit Service 3880ab
	__u64	sctpi_ipackets;
Packit Service 3880ab
	__u64	sctpi_rtxchunks;
Packit Service 3880ab
	__u64	sctpi_outofseqtsns;
Packit Service 3880ab
	__u64	sctpi_idupchunks;
Packit Service 3880ab
	__u64	sctpi_gapcnt;
Packit Service 3880ab
	__u64	sctpi_ouodchunks;
Packit Service 3880ab
	__u64	sctpi_iuodchunks;
Packit Service 3880ab
	__u64	sctpi_oodchunks;
Packit Service 3880ab
	__u64	sctpi_iodchunks;
Packit Service 3880ab
	__u64	sctpi_octrlchunks;
Packit Service 3880ab
	__u64	sctpi_ictrlchunks;
Packit Service 3880ab
Packit Service 3880ab
	/* primary transport info */
Packit Service 3880ab
	struct sockaddr_storage	sctpi_p_address;
Packit Service 3880ab
	__s32	sctpi_p_state;
Packit Service 3880ab
	__u32	sctpi_p_cwnd;
Packit Service 3880ab
	__u32	sctpi_p_srtt;
Packit Service 3880ab
	__u32	sctpi_p_rto;
Packit Service 3880ab
	__u32	sctpi_p_hbinterval;
Packit Service 3880ab
	__u32	sctpi_p_pathmaxrxt;
Packit Service 3880ab
	__u32	sctpi_p_sackdelay;
Packit Service 3880ab
	__u32	sctpi_p_sackfreq;
Packit Service 3880ab
	__u32	sctpi_p_ssthresh;
Packit Service 3880ab
	__u32	sctpi_p_partial_bytes_acked;
Packit Service 3880ab
	__u32	sctpi_p_flight_size;
Packit Service 3880ab
	__u16	sctpi_p_error;
Packit Service 3880ab
	__u16	__reserved2;
Packit Service 3880ab
Packit Service 3880ab
	/* sctp sock info */
Packit Service 3880ab
	__u32	sctpi_s_autoclose;
Packit Service 3880ab
	__u32	sctpi_s_adaptation_ind;
Packit Service 3880ab
	__u32	sctpi_s_pd_point;
Packit Service 3880ab
	__u8	sctpi_s_nodelay;
Packit Service 3880ab
	__u8	sctpi_s_disable_fragments;
Packit Service 3880ab
	__u8	sctpi_s_v4mapped;
Packit Service 3880ab
	__u8	sctpi_s_frag_interleave;
Packit Service 3880ab
	__u32	sctpi_s_type;
Packit Service 3880ab
	__u32	__reserved3;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
struct sctp_reset_streams {
Packit Service 3880ab
	sctp_assoc_t srs_assoc_id;
Packit Service 3880ab
	uint16_t srs_flags;
Packit Service 3880ab
	uint16_t srs_number_streams;	/* 0 == ALL */
Packit Service 3880ab
	uint16_t srs_stream_list[];	/* list if srs_num_streams is not 0 */
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
struct sctp_add_streams {
Packit Service 3880ab
	sctp_assoc_t sas_assoc_id;
Packit Service 3880ab
	uint16_t sas_instrms;
Packit Service 3880ab
	uint16_t sas_outstrms;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
struct sctp_event {
Packit Service 3880ab
	sctp_assoc_t se_assoc_id;
Packit Service 3880ab
	uint16_t se_type;
Packit Service 3880ab
	uint8_t se_on;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Bot 867fae
struct sctp_udpencaps {
Packit Bot 867fae
	sctp_assoc_t sue_assoc_id;
Packit Bot 867fae
	struct sockaddr_storage sue_address;
Packit Bot 867fae
	uint16_t sue_port;
Packit Bot 867fae
};
Packit Bot 867fae
Packit Service 3880ab
/* SCTP Stream schedulers */
Packit Service 3880ab
enum sctp_sched_type {
Packit Service 3880ab
	SCTP_SS_FCFS,
Packit Service 3880ab
	SCTP_SS_DEFAULT = SCTP_SS_FCFS,
Packit Service 3880ab
	SCTP_SS_PRIO,
Packit Service 3880ab
	SCTP_SS_RR,
Packit Service 3880ab
	SCTP_SS_MAX = SCTP_SS_RR
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
#endif /* _SCTP_H */