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