summaryrefslogtreecommitdiff
path: root/include/net/sctp
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-02 01:08:52 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-02 01:08:52 +0400
commit73287a43cc79ca06629a88d1a199cd283f42456a (patch)
treeacf4456e260115bea77ee31a29f10ce17f0db45c /include/net/sctp
parent251df49db3327c64bf917bfdba94491fde2b4ee0 (diff)
parent20074f357da4a637430aec2879c9d864c5d2c23c (diff)
downloadlinux-73287a43cc79ca06629a88d1a199cd283f42456a.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: "Highlights (1721 non-merge commits, this has to be a record of some sort): 1) Add 'random' mode to team driver, from Jiri Pirko and Eric Dumazet. 2) Make it so that any driver that supports configuration of multiple MAC addresses can provide the forwarding database add and del calls by providing a default implementation and hooking that up if the driver doesn't have an explicit set of handlers. From Vlad Yasevich. 3) Support GSO segmentation over tunnels and other encapsulating devices such as VXLAN, from Pravin B Shelar. 4) Support L2 GRE tunnels in the flow dissector, from Michael Dalton. 5) Implement Tail Loss Probe (TLP) detection in TCP, from Nandita Dukkipati. 6) In the PHY layer, allow supporting wake-on-lan in situations where the PHY registers have to be written for it to be configured. Use it to support wake-on-lan in mv643xx_eth. From Michael Stapelberg. 7) Significantly improve firewire IPV6 support, from YOSHIFUJI Hideaki. 8) Allow multiple packets to be sent in a single transmission using network coding in batman-adv, from Martin Hundebøll. 9) Add support for T5 cxgb4 chips, from Santosh Rastapur. 10) Generalize the VXLAN forwarding tables so that there is more flexibility in configurating various aspects of the endpoints. From David Stevens. 11) Support RSS and TSO in hardware over GRE tunnels in bxn2x driver, from Dmitry Kravkov. 12) Zero copy support in nfnelink_queue, from Eric Dumazet and Pablo Neira Ayuso. 13) Start adding networking selftests. 14) In situations of overload on the same AF_PACKET fanout socket, or per-cpu packet receive queue, minimize drop by distributing the load to other cpus/fanouts. From Willem de Bruijn and Eric Dumazet. 15) Add support for new payload offset BPF instruction, from Daniel Borkmann. 16) Convert several drivers over to mdoule_platform_driver(), from Sachin Kamat. 17) Provide a minimal BPF JIT image disassembler userspace tool, from Daniel Borkmann. 18) Rewrite F-RTO implementation in TCP to match the final specification of it in RFC4138 and RFC5682. From Yuchung Cheng. 19) Provide netlink socket diag of netlink sockets ("Yo dawg, I hear you like netlink, so I implemented netlink dumping of netlink sockets.") From Andrey Vagin. 20) Remove ugly passing of rtnetlink attributes into rtnl_doit functions, from Thomas Graf. 21) Allow userspace to be able to see if a configuration change occurs in the middle of an address or device list dump, from Nicolas Dichtel. 22) Support RFC3168 ECN protection for ipv6 fragments, from Hannes Frederic Sowa. 23) Increase accuracy of packet length used by packet scheduler, from Jason Wang. 24) Beginning set of changes to make ipv4/ipv6 fragment handling more scalable and less susceptible to overload and locking contention, from Jesper Dangaard Brouer. 25) Get rid of using non-type-safe NLMSG_* macros and use nlmsg_*() instead. From Hong Zhiguo. 26) Optimize route usage in IPVS by avoiding reference counting where possible, from Julian Anastasov. 27) Convert IPVS schedulers to RCU, also from Julian Anastasov. 28) Support cpu fanouts in xt_NFQUEUE netfilter target, from Holger Eitzenberger. 29) Network namespace support for nf_log, ebt_log, xt_LOG, ipt_ULOG, nfnetlink_log, and nfnetlink_queue. From Gao feng. 30) Implement RFC3168 ECN protection, from Hannes Frederic Sowa. 31) Support several new r8169 chips, from Hayes Wang. 32) Support tokenized interface identifiers in ipv6, from Daniel Borkmann. 33) Use usbnet_link_change() helper in USB net driver, from Ming Lei. 34) Add 802.1ad vlan offload support, from Patrick McHardy. 35) Support mmap() based netlink communication, also from Patrick McHardy. 36) Support HW timestamping in mlx4 driver, from Amir Vadai. 37) Rationalize AF_PACKET packet timestamping when transmitting, from Willem de Bruijn and Daniel Borkmann. 38) Bring parity to what's provided by /proc/net/packet socket dumping and the info provided by netlink socket dumping of AF_PACKET sockets. From Nicolas Dichtel. 39) Fix peeking beyond zero sized SKBs in AF_UNIX, from Benjamin Poirier" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1722 commits) filter: fix va_list build error af_unix: fix a fatal race with bit fields bnx2x: Prevent memory leak when cnic is absent bnx2x: correct reading of speed capabilities net: sctp: attribute printl with __printf for gcc fmt checks netlink: kconfig: move mmap i/o into netlink kconfig netpoll: convert mutex into a semaphore netlink: Fix skb ref counting. net_sched: act_ipt forward compat with xtables mlx4_en: fix a build error on 32bit arches Revert "bnx2x: allow nvram test to run when device is down" bridge: avoid OOPS if root port not found drivers: net: cpsw: fix kernel warn on cpsw irq enable sh_eth: use random MAC address if no valid one supplied 3c509.c: call SET_NETDEV_DEV for all device types (ISA/ISAPnP/EISA) tg3: fix to append hardware time stamping flags unix/stream: fix peeking with an offset larger than data in queue unix/dgram: fix peeking with an offset larger than data in queue unix/dgram: peek beyond 0-sized skbs openvswitch: Remove unneeded ovs_netdev_get_ifindex() ...
Diffstat (limited to 'include/net/sctp')
-rw-r--r--include/net/sctp/checksum.h2
-rw-r--r--include/net/sctp/constants.h1
-rw-r--r--include/net/sctp/structs.h20
-rw-r--r--include/net/sctp/ulpqueue.h1
-rw-r--r--include/net/sctp/user.h782
5 files changed, 4 insertions, 802 deletions
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h
index befc8d2a1b9f..5a2110d3176d 100644
--- a/include/net/sctp/checksum.h
+++ b/include/net/sctp/checksum.h
@@ -77,7 +77,7 @@ static inline __u32 sctp_update_cksum(__u8 *buffer, __u16 length, __u32 crc32)
return sctp_crc32c(crc32, buffer, length);
}
-static inline __le32 sctp_end_cksum(__be32 crc32)
+static inline __le32 sctp_end_cksum(__u32 crc32)
{
return cpu_to_le32(~crc32);
}
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index a7dd5c50df79..ca50e0751e47 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -49,7 +49,6 @@
#include <linux/sctp.h>
#include <linux/ipv6.h> /* For ipv6hdr. */
-#include <net/sctp/user.h>
#include <net/tcp_states.h> /* For TCP states used in sctp_sock_state_t */
/* Value used for stream negotiation. */
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 0e0f9d2322e3..1bd4c4144fe8 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -399,7 +399,6 @@ struct sctp_stream {
struct sctp_ssnmap {
struct sctp_stream in;
struct sctp_stream out;
- int malloced;
};
struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out,
@@ -715,8 +714,7 @@ struct sctp_packet {
has_sack:1, /* This packet contains a SACK chunk. */
has_auth:1, /* This packet contains an AUTH chunk */
has_data:1, /* This packet contains at least 1 DATA chunk */
- ipfragok:1, /* So let ip fragment this packet */
- malloced:1; /* Is it malloced? */
+ ipfragok:1; /* So let ip fragment this packet */
};
struct sctp_packet *sctp_packet_init(struct sctp_packet *,
@@ -780,10 +778,7 @@ struct sctp_transport {
hb_sent:1,
/* Is the Path MTU update pending on this tranport */
- pmtu_pending:1,
-
- /* Is this structure kfree()able? */
- malloced:1;
+ pmtu_pending:1;
/* Has this transport moved the ctsn since we last sacked */
__u32 sack_generation;
@@ -992,8 +987,6 @@ struct sctp_inq {
* messages.
*/
struct work_struct immediate;
-
- int malloced; /* Is this structure kfree()able? */
};
void sctp_inq_init(struct sctp_inq *);
@@ -1062,9 +1055,6 @@ struct sctp_outq {
/* Is this structure empty? */
char empty;
-
- /* Are we kfree()able? */
- char malloced;
};
void sctp_outq_init(struct sctp_association *, struct sctp_outq *);
@@ -1102,8 +1092,6 @@ struct sctp_bind_addr {
* peer(s) in INIT and INIT ACK chunks.
*/
struct list_head address_list;
-
- int malloced; /* Are we kfree()able? */
};
void sctp_bind_addr_init(struct sctp_bind_addr *, __u16 port);
@@ -1174,11 +1162,9 @@ struct sctp_ep_common {
/* Some fields to help us manage this object.
* refcnt - Reference count access to this object.
* dead - Do not attempt to use this object.
- * malloced - Do we need to kfree this object?
*/
atomic_t refcnt;
- char dead;
- char malloced;
+ bool dead;
/* What socket does this endpoint belong to? */
struct sock *sk;
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h
index ff1b8ba73ab1..00e50ba3f24b 100644
--- a/include/net/sctp/ulpqueue.h
+++ b/include/net/sctp/ulpqueue.h
@@ -49,7 +49,6 @@
/* A structure to carry information to the ULP (e.g. Sockets API) */
struct sctp_ulpq {
- char malloced;
char pd_mode;
struct sctp_association *asoc;
struct sk_buff_head reasm;
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
deleted file mode 100644
index 9a0ae091366d..000000000000
--- a/include/net/sctp/user.h
+++ /dev/null
@@ -1,782 +0,0 @@
-/* SCTP kernel implementation
- * (C) Copyright IBM Corp. 2001, 2004
- * Copyright (c) 1999-2000 Cisco, Inc.
- * Copyright (c) 1999-2001 Motorola, Inc.
- * Copyright (c) 2002 Intel Corp.
- *
- * This file is part of the SCTP kernel implementation
- *
- * This header represents the structures and constants needed to support
- * the SCTP Extension to the Sockets API.
- *
- * This SCTP implementation is free software;
- * you can redistribute it and/or modify it under the terms of
- * the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This SCTP implementation is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * ************************
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU CC; see the file COPYING. If not, write to
- * the Free Software Foundation, 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Please send any bug reports or fixes you make to the
- * email address(es):
- * lksctp developers <lksctp-developers@lists.sourceforge.net>
- *
- * Or submit a bug report through the following website:
- * http://www.sf.net/projects/lksctp
- *
- * Written or modified by:
- * La Monte H.P. Yarroll <piggy@acm.org>
- * R. Stewart <randall@sctp.chicago.il.us>
- * K. Morneau <kmorneau@cisco.com>
- * Q. Xie <qxie1@email.mot.com>
- * Karl Knutson <karl@athena.chicago.il.us>
- * Jon Grimm <jgrimm@us.ibm.com>
- * Daisy Chang <daisyc@us.ibm.com>
- * Ryan Layer <rmlayer@us.ibm.com>
- * Ardelle Fan <ardelle.fan@intel.com>
- * Sridhar Samudrala <sri@us.ibm.com>
- *
- * Any bugs reported given to us we will try to fix... any fixes shared will
- * be incorporated into the next SCTP release.
- */
-
-#ifndef __net_sctp_user_h__
-#define __net_sctp_user_h__
-
-#include <linux/types.h>
-#include <linux/socket.h>
-
-typedef __s32 sctp_assoc_t;
-
-/* The following symbols come from the Sockets API Extensions for
- * SCTP <draft-ietf-tsvwg-sctpsocket-07.txt>.
- */
-#define SCTP_RTOINFO 0
-#define SCTP_ASSOCINFO 1
-#define SCTP_INITMSG 2
-#define SCTP_NODELAY 3 /* Get/set nodelay option. */
-#define SCTP_AUTOCLOSE 4
-#define SCTP_SET_PEER_PRIMARY_ADDR 5
-#define SCTP_PRIMARY_ADDR 6
-#define SCTP_ADAPTATION_LAYER 7
-#define SCTP_DISABLE_FRAGMENTS 8
-#define SCTP_PEER_ADDR_PARAMS 9
-#define SCTP_DEFAULT_SEND_PARAM 10
-#define SCTP_EVENTS 11
-#define SCTP_I_WANT_MAPPED_V4_ADDR 12 /* Turn on/off mapped v4 addresses */
-#define SCTP_MAXSEG 13 /* Get/set maximum fragment. */
-#define SCTP_STATUS 14
-#define SCTP_GET_PEER_ADDR_INFO 15
-#define SCTP_DELAYED_ACK_TIME 16
-#define SCTP_DELAYED_ACK SCTP_DELAYED_ACK_TIME
-#define SCTP_DELAYED_SACK SCTP_DELAYED_ACK_TIME
-#define SCTP_CONTEXT 17
-#define SCTP_FRAGMENT_INTERLEAVE 18
-#define SCTP_PARTIAL_DELIVERY_POINT 19 /* Set/Get partial delivery point */
-#define SCTP_MAX_BURST 20 /* Set/Get max burst */
-#define SCTP_AUTH_CHUNK 21 /* Set only: add a chunk type to authenticate */
-#define SCTP_HMAC_IDENT 22
-#define SCTP_AUTH_KEY 23
-#define SCTP_AUTH_ACTIVE_KEY 24
-#define SCTP_AUTH_DELETE_KEY 25
-#define SCTP_PEER_AUTH_CHUNKS 26 /* Read only */
-#define SCTP_LOCAL_AUTH_CHUNKS 27 /* Read only */
-#define SCTP_GET_ASSOC_NUMBER 28 /* Read only */
-#define SCTP_GET_ASSOC_ID_LIST 29 /* Read only */
-#define SCTP_AUTO_ASCONF 30
-#define SCTP_PEER_ADDR_THLDS 31
-
-/* Internal Socket Options. Some of the sctp library functions are
- * implemented using these socket options.
- */
-#define SCTP_SOCKOPT_BINDX_ADD 100 /* BINDX requests for adding addrs */
-#define SCTP_SOCKOPT_BINDX_REM 101 /* BINDX requests for removing addrs. */
-#define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */
-/* Options 104-106 are deprecated and removed. Do not use this space */
-#define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */
-#define SCTP_GET_PEER_ADDRS 108 /* Get all peer address. */
-#define SCTP_GET_LOCAL_ADDRS 109 /* Get all local address. */
-#define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */
-#define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */
-#define SCTP_GET_ASSOC_STATS 112 /* Read only */
-
-/*
- * 5.2.1 SCTP Initiation Structure (SCTP_INIT)
- *
- * This cmsghdr structure provides information for initializing new
- * SCTP associations with sendmsg(). The SCTP_INITMSG socket option
- * uses this same data structure. This structure is not used for
- * recvmsg().
- *
- * cmsg_level cmsg_type cmsg_data[]
- * ------------ ------------ ----------------------
- * IPPROTO_SCTP SCTP_INIT struct sctp_initmsg
- *
- */
-struct sctp_initmsg {
- __u16 sinit_num_ostreams;
- __u16 sinit_max_instreams;
- __u16 sinit_max_attempts;
- __u16 sinit_max_init_timeo;
-};
-
-/*
- * 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV)
- *
- * This cmsghdr structure specifies SCTP options for sendmsg() and
- * describes SCTP header information about a received message through
- * recvmsg().
- *
- * cmsg_level cmsg_type cmsg_data[]
- * ------------ ------------ ----------------------
- * IPPROTO_SCTP SCTP_SNDRCV struct sctp_sndrcvinfo
- *
- */
-struct sctp_sndrcvinfo {
- __u16 sinfo_stream;
- __u16 sinfo_ssn;
- __u16 sinfo_flags;
- __u32 sinfo_ppid;
- __u32 sinfo_context;
- __u32 sinfo_timetolive;
- __u32 sinfo_tsn;
- __u32 sinfo_cumtsn;
- sctp_assoc_t sinfo_assoc_id;
-};
-
-/*
- * sinfo_flags: 16 bits (unsigned integer)
- *
- * This field may contain any of the following flags and is composed of
- * a bitwise OR of these values.
- */
-
-enum sctp_sinfo_flags {
- SCTP_UNORDERED = 1, /* Send/receive message unordered. */
- SCTP_ADDR_OVER = 2, /* Override the primary destination. */
- SCTP_ABORT=4, /* Send an ABORT message to the peer. */
- SCTP_SACK_IMMEDIATELY = 8, /* SACK should be sent without delay */
- SCTP_EOF=MSG_FIN, /* Initiate graceful shutdown process. */
-};
-
-
-/* These are cmsg_types. */
-typedef enum sctp_cmsg_type {
- SCTP_INIT, /* 5.2.1 SCTP Initiation Structure */
- SCTP_SNDRCV, /* 5.2.2 SCTP Header Information Structure */
-} sctp_cmsg_t;
-
-
-/*
- * 5.3.1.1 SCTP_ASSOC_CHANGE
- *
- * Communication notifications inform the ULP that an SCTP association
- * has either begun or ended. The identifier for a new association is
- * provided by this notificaion. The notification information has the
- * following format:
- *
- */
-struct sctp_assoc_change {
- __u16 sac_type;
- __u16 sac_flags;
- __u32 sac_length;
- __u16 sac_state;
- __u16 sac_error;
- __u16 sac_outbound_streams;
- __u16 sac_inbound_streams;
- sctp_assoc_t sac_assoc_id;
- __u8 sac_info[0];
-};
-
-/*
- * sac_state: 32 bits (signed integer)
- *
- * This field holds one of a number of values that communicate the
- * event that happened to the association. They include:
- *
- * Note: The following state names deviate from the API draft as
- * the names clash too easily with other kernel symbols.
- */
-enum sctp_sac_state {
- SCTP_COMM_UP,
- SCTP_COMM_LOST,
- SCTP_RESTART,
- SCTP_SHUTDOWN_COMP,
- SCTP_CANT_STR_ASSOC,
-};
-
-/*
- * 5.3.1.2 SCTP_PEER_ADDR_CHANGE
- *
- * When a destination address on a multi-homed peer encounters a change
- * an interface details event is sent. The information has the
- * following structure:
- */
-struct sctp_paddr_change {
- __u16 spc_type;
- __u16 spc_flags;
- __u32 spc_length;
- struct sockaddr_storage spc_aaddr;
- int spc_state;
- int spc_error;
- sctp_assoc_t spc_assoc_id;
-} __attribute__((packed, aligned(4)));
-
-/*
- * spc_state: 32 bits (signed integer)
- *
- * This field holds one of a number of values that communicate the
- * event that happened to the address. They include:
- */
-enum sctp_spc_state {
- SCTP_ADDR_AVAILABLE,
- SCTP_ADDR_UNREACHABLE,
- SCTP_ADDR_REMOVED,
- SCTP_ADDR_ADDED,
- SCTP_ADDR_MADE_PRIM,
- SCTP_ADDR_CONFIRMED,
-};
-
-
-/*
- * 5.3.1.3 SCTP_REMOTE_ERROR
- *
- * A remote peer may send an Operational Error message to its peer.
- * This message indicates a variety of error conditions on an
- * association. The entire error TLV as it appears on the wire is
- * included in a SCTP_REMOTE_ERROR event. Please refer to the SCTP
- * specification [SCTP] and any extensions for a list of possible
- * error formats. SCTP error TLVs have the format:
- */
-struct sctp_remote_error {
- __u16 sre_type;
- __u16 sre_flags;
- __u32 sre_length;
- __u16 sre_error;
- sctp_assoc_t sre_assoc_id;
- __u8 sre_data[0];
-};
-
-
-/*
- * 5.3.1.4 SCTP_SEND_FAILED
- *
- * If SCTP cannot deliver a message it may return the message as a
- * notification.
- */
-struct sctp_send_failed {
- __u16 ssf_type;
- __u16 ssf_flags;
- __u32 ssf_length;
- __u32 ssf_error;
- struct sctp_sndrcvinfo ssf_info;
- sctp_assoc_t ssf_assoc_id;
- __u8 ssf_data[0];
-};
-
-/*
- * ssf_flags: 16 bits (unsigned integer)
- *
- * The flag value will take one of the following values
- *
- * SCTP_DATA_UNSENT - Indicates that the data was never put on
- * the wire.
- *
- * SCTP_DATA_SENT - Indicates that the data was put on the wire.
- * Note that this does not necessarily mean that the
- * data was (or was not) successfully delivered.
- */
-enum sctp_ssf_flags {
- SCTP_DATA_UNSENT,
- SCTP_DATA_SENT,
-};
-
-/*
- * 5.3.1.5 SCTP_SHUTDOWN_EVENT
- *
- * When a peer sends a SHUTDOWN, SCTP delivers this notification to
- * inform the application that it should cease sending data.
- */
-struct sctp_shutdown_event {
- __u16 sse_type;
- __u16 sse_flags;
- __u32 sse_length;
- sctp_assoc_t sse_assoc_id;
-};
-
-/*
- * 5.3.1.6 SCTP_ADAPTATION_INDICATION
- *
- * When a peer sends a Adaptation Layer Indication parameter , SCTP
- * delivers this notification to inform the application
- * that of the peers requested adaptation layer.
- */
-struct sctp_adaptation_event {
- __u16 sai_type;
- __u16 sai_flags;
- __u32 sai_length;
- __u32 sai_adaptation_ind;
- sctp_assoc_t sai_assoc_id;
-};
-
-/*
- * 5.3.1.7 SCTP_PARTIAL_DELIVERY_EVENT
- *
- * When a receiver is engaged in a partial delivery of a
- * message this notification will be used to indicate
- * various events.
- */
-struct sctp_pdapi_event {
- __u16 pdapi_type;
- __u16 pdapi_flags;
- __u32 pdapi_length;
- __u32 pdapi_indication;
- sctp_assoc_t pdapi_assoc_id;
-};
-
-enum { SCTP_PARTIAL_DELIVERY_ABORTED=0, };
-
-struct sctp_authkey_event {
- __u16 auth_type;
- __u16 auth_flags;
- __u32 auth_length;
- __u16 auth_keynumber;
- __u16 auth_altkeynumber;
- __u32 auth_indication;
- sctp_assoc_t auth_assoc_id;
-};
-
-enum { SCTP_AUTH_NEWKEY = 0, };
-
-/*
- * 6.1.9. SCTP_SENDER_DRY_EVENT
- *
- * When the SCTP stack has no more user data to send or retransmit, this
- * notification is given to the user. Also, at the time when a user app
- * subscribes to this event, if there is no data to be sent or
- * retransmit, the stack will immediately send up this notification.
- */
-struct sctp_sender_dry_event {
- __u16 sender_dry_type;
- __u16 sender_dry_flags;
- __u32 sender_dry_length;
- sctp_assoc_t sender_dry_assoc_id;
-};
-
-/*
- * Described in Section 7.3
- * Ancillary Data and Notification Interest Options
- */
-struct sctp_event_subscribe {
- __u8 sctp_data_io_event;
- __u8 sctp_association_event;
- __u8 sctp_address_event;
- __u8 sctp_send_failure_event;
- __u8 sctp_peer_error_event;
- __u8 sctp_shutdown_event;
- __u8 sctp_partial_delivery_event;
- __u8 sctp_adaptation_layer_event;
- __u8 sctp_authentication_event;
- __u8 sctp_sender_dry_event;
-};
-
-/*
- * 5.3.1 SCTP Notification Structure
- *
- * The notification structure is defined as the union of all
- * notification types.
- *
- */
-union sctp_notification {
- struct {
- __u16 sn_type; /* Notification type. */
- __u16 sn_flags;
- __u32 sn_length;
- } sn_header;
- struct sctp_assoc_change sn_assoc_change;
- struct sctp_paddr_change sn_paddr_change;
- struct sctp_remote_error sn_remote_error;
- struct sctp_send_failed sn_send_failed;
- struct sctp_shutdown_event sn_shutdown_event;
- struct sctp_adaptation_event sn_adaptation_event;
- struct sctp_pdapi_event sn_pdapi_event;
- struct sctp_authkey_event sn_authkey_event;
- struct sctp_sender_dry_event sn_sender_dry_event;
-};
-
-/* Section 5.3.1
- * All standard values for sn_type flags are greater than 2^15.
- * Values from 2^15 and down are reserved.
- */
-
-enum sctp_sn_type {
- SCTP_SN_TYPE_BASE = (1<<15),
- SCTP_ASSOC_CHANGE,
- SCTP_PEER_ADDR_CHANGE,
- SCTP_SEND_FAILED,
- SCTP_REMOTE_ERROR,
- SCTP_SHUTDOWN_EVENT,
- SCTP_PARTIAL_DELIVERY_EVENT,
- SCTP_ADAPTATION_INDICATION,
- SCTP_AUTHENTICATION_EVENT,
-#define SCTP_AUTHENTICATION_INDICATION SCTP_AUTHENTICATION_EVENT
- SCTP_SENDER_DRY_EVENT,
-};
-
-/* Notification error codes used to fill up the error fields in some
- * notifications.
- * SCTP_PEER_ADDRESS_CHAGE : spc_error
- * SCTP_ASSOC_CHANGE : sac_error
- * These names should be potentially included in the draft 04 of the SCTP
- * sockets API specification.
- */
-typedef enum sctp_sn_error {
- SCTP_FAILED_THRESHOLD,
- SCTP_RECEIVED_SACK,
- SCTP_HEARTBEAT_SUCCESS,
- SCTP_RESPONSE_TO_USER_REQ,
- SCTP_INTERNAL_ERROR,
- SCTP_SHUTDOWN_GUARD_EXPIRES,
- SCTP_PEER_FAULTY,
-} sctp_sn_error_t;
-
-/*
- * 7.1.1 Retransmission Timeout Parameters (SCTP_RTOINFO)
- *
- * The protocol parameters used to initialize and bound retransmission
- * timeout (RTO) are tunable. See [SCTP] for more information on how
- * these parameters are used in RTO calculation.
- */
-struct sctp_rtoinfo {
- sctp_assoc_t srto_assoc_id;
- __u32 srto_initial;
- __u32 srto_max;
- __u32 srto_min;
-};
-
-/*
- * 7.1.2 Association Parameters (SCTP_ASSOCINFO)
- *
- * This option is used to both examine and set various association and
- * endpoint parameters.
- */
-struct sctp_assocparams {
- sctp_assoc_t sasoc_assoc_id;
- __u16 sasoc_asocmaxrxt;
- __u16 sasoc_number_peer_destinations;
- __u32 sasoc_peer_rwnd;
- __u32 sasoc_local_rwnd;
- __u32 sasoc_cookie_life;
-};
-
-/*
- * 7.1.9 Set Peer Primary Address (SCTP_SET_PEER_PRIMARY_ADDR)
- *
- * Requests that the peer mark the enclosed address as the association
- * primary. The enclosed address must be one of the association's
- * locally bound addresses. The following structure is used to make a
- * set primary request:
- */
-struct sctp_setpeerprim {
- sctp_assoc_t sspp_assoc_id;
- struct sockaddr_storage sspp_addr;
-} __attribute__((packed, aligned(4)));
-
-/*
- * 7.1.10 Set Primary Address (SCTP_PRIMARY_ADDR)
- *
- * Requests that the local SCTP stack use the enclosed peer address as
- * the association primary. The enclosed address must be one of the
- * association peer's addresses. The following structure is used to
- * make a set peer primary request:
- */
-struct sctp_prim {
- sctp_assoc_t ssp_assoc_id;
- struct sockaddr_storage ssp_addr;
-} __attribute__((packed, aligned(4)));
-
-/*
- * 7.1.11 Set Adaptation Layer Indicator (SCTP_ADAPTATION_LAYER)
- *
- * Requests that the local endpoint set the specified Adaptation Layer
- * Indication parameter for all future INIT and INIT-ACK exchanges.
- */
-struct sctp_setadaptation {
- __u32 ssb_adaptation_ind;
-};
-
-/*
- * 7.1.13 Peer Address Parameters (SCTP_PEER_ADDR_PARAMS)
- *
- * Applications can enable or disable heartbeats for any peer address
- * of an association, modify an address's heartbeat interval, force a
- * heartbeat to be sent immediately, and adjust the address's maximum
- * number of retransmissions sent before an address is considered
- * unreachable. The following structure is used to access and modify an
- * address's parameters:
- */
-enum sctp_spp_flags {
- SPP_HB_ENABLE = 1<<0, /*Enable heartbeats*/
- SPP_HB_DISABLE = 1<<1, /*Disable heartbeats*/
- SPP_HB = SPP_HB_ENABLE | SPP_HB_DISABLE,
- SPP_HB_DEMAND = 1<<2, /*Send heartbeat immediately*/
- SPP_PMTUD_ENABLE = 1<<3, /*Enable PMTU discovery*/
- SPP_PMTUD_DISABLE = 1<<4, /*Disable PMTU discovery*/
- SPP_PMTUD = SPP_PMTUD_ENABLE | SPP_PMTUD_DISABLE,
- SPP_SACKDELAY_ENABLE = 1<<5, /*Enable SACK*/
- SPP_SACKDELAY_DISABLE = 1<<6, /*Disable SACK*/
- SPP_SACKDELAY = SPP_SACKDELAY_ENABLE | SPP_SACKDELAY_DISABLE,
- SPP_HB_TIME_IS_ZERO = 1<<7, /* Set HB delay to 0 */
-};
-
-struct sctp_paddrparams {
- sctp_assoc_t spp_assoc_id;
- struct sockaddr_storage spp_address;
- __u32 spp_hbinterval;
- __u16 spp_pathmaxrxt;
- __u32 spp_pathmtu;
- __u32 spp_sackdelay;
- __u32 spp_flags;
-} __attribute__((packed, aligned(4)));
-
-/*
- * 7.1.18. Add a chunk that must be authenticated (SCTP_AUTH_CHUNK)
- *
- * This set option adds a chunk type that the user is requesting to be
- * received only in an authenticated way. Changes to the list of chunks
- * will only effect future associations on the socket.
- */
-struct sctp_authchunk {
- __u8 sauth_chunk;
-};
-
-/*
- * 7.1.19. Get or set the list of supported HMAC Identifiers (SCTP_HMAC_IDENT)
- *
- * This option gets or sets the list of HMAC algorithms that the local
- * endpoint requires the peer to use.
-*/
-struct sctp_hmacalgo {
- __u32 shmac_num_idents;
- __u16 shmac_idents[];
-};
-
-/*
- * 7.1.20. Set a shared key (SCTP_AUTH_KEY)
- *
- * This option will set a shared secret key which is used to build an
- * association shared key.
- */
-struct sctp_authkey {
- sctp_assoc_t sca_assoc_id;
- __u16 sca_keynumber;
- __u16 sca_keylength;
- __u8 sca_key[];
-};
-
-/*
- * 7.1.21. Get or set the active shared key (SCTP_AUTH_ACTIVE_KEY)
- *
- * This option will get or set the active shared key to be used to build
- * the association shared key.
- */
-
-struct sctp_authkeyid {
- sctp_assoc_t scact_assoc_id;
- __u16 scact_keynumber;
-};
-
-
-/*
- * 7.1.23. Get or set delayed ack timer (SCTP_DELAYED_SACK)
- *
- * This option will effect the way delayed acks are performed. This
- * option allows you to get or set the delayed ack time, in
- * milliseconds. It also allows changing the delayed ack frequency.
- * Changing the frequency to 1 disables the delayed sack algorithm. If
- * the assoc_id is 0, then this sets or gets the endpoints default
- * values. If the assoc_id field is non-zero, then the set or get
- * effects the specified association for the one to many model (the
- * assoc_id field is ignored by the one to one model). Note that if
- * sack_delay or sack_freq are 0 when setting this option, then the
- * current values will remain unchanged.
- */
-struct sctp_sack_info {
- sctp_assoc_t sack_assoc_id;
- uint32_t sack_delay;
- uint32_t sack_freq;
-};
-
-struct sctp_assoc_value {
- sctp_assoc_t assoc_id;
- uint32_t assoc_value;
-};
-
-/*
- * 7.2.2 Peer Address Information
- *
- * Applications can retrieve information about a specific peer address
- * of an association, including its reachability state, congestion
- * window, and retransmission timer values. This information is
- * read-only. The following structure is used to access this
- * information:
- */
-struct sctp_paddrinfo {
- sctp_assoc_t spinfo_assoc_id;
- struct sockaddr_storage spinfo_address;
- __s32 spinfo_state;
- __u32 spinfo_cwnd;
- __u32 spinfo_srtt;
- __u32 spinfo_rto;
- __u32 spinfo_mtu;
-} __attribute__((packed, aligned(4)));
-
-/* Peer addresses's state. */
-/* UNKNOWN: Peer address passed by the upper layer in sendmsg or connect[x]
- * calls.
- * UNCONFIRMED: Peer address received in INIT/INIT-ACK address parameters.
- * Not yet confirmed by a heartbeat and not available for data
- * transfers.
- * ACTIVE : Peer address confirmed, active and available for data transfers.
- * INACTIVE: Peer address inactive and not available for data transfers.
- */
-enum sctp_spinfo_state {
- SCTP_INACTIVE,
- SCTP_PF,
- SCTP_ACTIVE,
- SCTP_UNCONFIRMED,
- SCTP_UNKNOWN = 0xffff /* Value used for transport state unknown */
-};
-
-/*
- * 7.2.1 Association Status (SCTP_STATUS)
- *
- * Applications can retrieve current status information about an
- * association, including association state, peer receiver window size,
- * number of unacked data chunks, and number of data chunks pending
- * receipt. This information is read-only. The following structure is
- * used to access this information:
- */
-struct sctp_status {
- sctp_assoc_t sstat_assoc_id;
- __s32 sstat_state;
- __u32 sstat_rwnd;
- __u16 sstat_unackdata;
- __u16 sstat_penddata;
- __u16 sstat_instrms;
- __u16 sstat_outstrms;
- __u32 sstat_fragmentation_point;
- struct sctp_paddrinfo sstat_primary;
-};
-
-/*
- * 7.2.3. Get the list of chunks the peer requires to be authenticated
- * (SCTP_PEER_AUTH_CHUNKS)
- *
- * This option gets a list of chunks for a specified association that
- * the peer requires to be received authenticated only.
- */
-struct sctp_authchunks {
- sctp_assoc_t gauth_assoc_id;
- __u32 gauth_number_of_chunks;
- uint8_t gauth_chunks[];
-};
-
-/*
- * 8.2.6. Get the Current Identifiers of Associations
- * (SCTP_GET_ASSOC_ID_LIST)
- *
- * This option gets the current list of SCTP association identifiers of
- * the SCTP associations handled by a one-to-many style socket.
- */
-struct sctp_assoc_ids {
- __u32 gaids_number_of_ids;
- sctp_assoc_t gaids_assoc_id[];
-};
-
-/*
- * 8.3, 8.5 get all peer/local addresses in an association.
- * This parameter struct is used by SCTP_GET_PEER_ADDRS and
- * SCTP_GET_LOCAL_ADDRS socket options used internally to implement
- * sctp_getpaddrs() and sctp_getladdrs() API.
- */
-struct sctp_getaddrs_old {
- sctp_assoc_t assoc_id;
- int addr_num;
- struct sockaddr __user *addrs;
-};
-struct sctp_getaddrs {
- sctp_assoc_t assoc_id; /*input*/
- __u32 addr_num; /*output*/
- __u8 addrs[0]; /*output, variable size*/
-};
-
-/* A socket user request obtained via SCTP_GET_ASSOC_STATS that retrieves
- * association stats. All stats are counts except sas_maxrto and
- * sas_obs_rto_ipaddr. maxrto is the max observed rto + transport since
- * the last call. Will return 0 when RTO was not update since last call
- */
-struct sctp_assoc_stats {
- sctp_assoc_t sas_assoc_id; /* Input */
- /* Transport of observed max RTO */
- struct sockaddr_storage sas_obs_rto_ipaddr;
- __u64 sas_maxrto; /* Maximum Observed RTO for period */
- __u64 sas_isacks; /* SACKs received */
- __u64 sas_osacks; /* SACKs sent */
- __u64 sas_opackets; /* Packets sent */
- __u64 sas_ipackets; /* Packets received */
- __u64 sas_rtxchunks; /* Retransmitted Chunks */
- __u64 sas_outofseqtsns;/* TSN received > next expected */
- __u64 sas_idupchunks; /* Dups received (ordered+unordered) */
- __u64 sas_gapcnt; /* Gap Acknowledgements Received */
- __u64 sas_ouodchunks; /* Unordered data chunks sent */
- __u64 sas_iuodchunks; /* Unordered data chunks received */
- __u64 sas_oodchunks; /* Ordered data chunks sent */
- __u64 sas_iodchunks; /* Ordered data chunks received */
- __u64 sas_octrlchunks; /* Control chunks sent */
- __u64 sas_ictrlchunks; /* Control chunks received */
-};
-
-/* These are bit fields for msghdr->msg_flags. See section 5.1. */
-/* On user space Linux, these live in <bits/socket.h> as an enum. */
-enum sctp_msg_flags {
- MSG_NOTIFICATION = 0x8000,
-#define MSG_NOTIFICATION MSG_NOTIFICATION
-};
-
-/*
- * 8.1 sctp_bindx()
- *
- * The flags parameter is formed from the bitwise OR of zero or more of the
- * following currently defined flags:
- */
-#define SCTP_BINDX_ADD_ADDR 0x01
-#define SCTP_BINDX_REM_ADDR 0x02
-
-/* This is the structure that is passed as an argument(optval) to
- * getsockopt(SCTP_SOCKOPT_PEELOFF).
- */
-typedef struct {
- sctp_assoc_t associd;
- int sd;
-} sctp_peeloff_arg_t;
-
-/*
- * Peer Address Thresholds socket option
- */
-struct sctp_paddrthlds {
- sctp_assoc_t spt_assoc_id;
- struct sockaddr_storage spt_address;
- __u16 spt_pathmaxrxt;
- __u16 spt_pathpfthld;
-};
-#endif /* __net_sctp_user_h__ */