Home | History | Annotate | Line # | Download | only in netinet
sctp_uio.h revision 1.3.4.1
      1      1.1       rjs /*	$KAME: sctp_uio.h,v 1.11 2005/03/06 16:04:18 itojun Exp $	*/
      2  1.3.4.1  christos /*	$NetBSD: sctp_uio.h,v 1.3.4.1 2019/06/10 22:09:47 christos Exp $ */
      3      1.1       rjs 
      4      1.1       rjs #ifndef __SCTP_UIO_H__
      5      1.1       rjs #define __SCTP_UIO_H__
      6      1.1       rjs 
      7      1.1       rjs /*
      8      1.1       rjs  * Copyright (c) 2001, 2002, 2003, 2004 Cisco Systems, Inc.
      9      1.1       rjs  * All rights reserved.
     10      1.1       rjs  *
     11      1.1       rjs  * Redistribution and use in source and binary forms, with or without
     12      1.1       rjs  * modification, are permitted provided that the following conditions
     13      1.1       rjs  * are met:
     14      1.1       rjs  * 1. Redistributions of source code must retain the above copyright
     15      1.1       rjs  *    notice, this list of conditions and the following disclaimer.
     16      1.1       rjs  * 2. Redistributions in binary form must reproduce the above copyright
     17      1.1       rjs  *    notice, this list of conditions and the following disclaimer in the
     18      1.1       rjs  *    documentation and/or other materials provided with the distribution.
     19      1.1       rjs  * 3. All advertising materials mentioning features or use of this software
     20      1.1       rjs  *    must display the following acknowledgement:
     21      1.1       rjs  *      This product includes software developed by Cisco Systems, Inc.
     22      1.1       rjs  * 4. Neither the name of the project nor the names of its contributors
     23      1.1       rjs  *    may be used to endorse or promote products derived from this software
     24      1.1       rjs  *    without specific prior written permission.
     25      1.1       rjs  *
     26      1.1       rjs  * THIS SOFTWARE IS PROVIDED BY CISCO SYSTEMS AND CONTRIBUTORS ``AS IS'' AND
     27      1.1       rjs  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     28      1.1       rjs  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     29      1.1       rjs  * ARE DISCLAIMED.  IN NO EVENT SHALL CISCO SYSTEMS OR CONTRIBUTORS BE LIABLE
     30      1.1       rjs  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     31      1.1       rjs  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     32      1.1       rjs  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     33      1.1       rjs  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     34      1.1       rjs  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     35      1.1       rjs  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     36      1.1       rjs  * SUCH DAMAGE.
     37      1.1       rjs  */
     38      1.1       rjs 
     39      1.1       rjs #include <sys/types.h>
     40      1.1       rjs #include <sys/socket.h>
     41      1.1       rjs 
     42      1.1       rjs typedef u_int32_t sctp_assoc_t;
     43      1.1       rjs 
     44      1.3       rjs #define SCTP_FUTURE_ASSOC	0
     45      1.3       rjs #define SCTP_CURRENT_ASSOC	1
     46      1.3       rjs #define SCTP_ALL_ASSOC		2
     47      1.3       rjs 
     48      1.1       rjs /* On/Off setup for subscription to events */
     49      1.1       rjs struct sctp_event_subscribe {
     50      1.1       rjs 	u_int8_t sctp_data_io_event;
     51      1.1       rjs 	u_int8_t sctp_association_event;
     52      1.1       rjs 	u_int8_t sctp_address_event;
     53      1.1       rjs 	u_int8_t sctp_send_failure_event;
     54      1.1       rjs 	u_int8_t sctp_peer_error_event;
     55      1.1       rjs 	u_int8_t sctp_shutdown_event;
     56      1.1       rjs 	u_int8_t sctp_partial_delivery_event;
     57      1.1       rjs 	u_int8_t sctp_adaption_layer_event;
     58      1.1       rjs 	u_int8_t sctp_stream_reset_events;
     59      1.2       rjs } __packed;
     60      1.1       rjs 
     61      1.1       rjs /* ancillary data types */
     62      1.1       rjs #define SCTP_INIT	0x0001
     63      1.1       rjs #define SCTP_SNDRCV	0x0002
     64      1.3       rjs #define SCTP_EXTRCV	0x0003
     65      1.3       rjs #define SCTP_SNDINFO	0x0004
     66      1.3       rjs #define SCTP_RCVINFO	0x0005
     67      1.3       rjs #define SCTP_NXTINFO	0x0006
     68      1.3       rjs #define SCTP_PRINFO	0x0007
     69      1.3       rjs #define SCTP_AUTHINFO	0x0008
     70      1.3       rjs #define SCTP_DSTADDRV4	0x0009
     71      1.3       rjs #define SCTP_DSTADDRV6	0x000a
     72      1.3       rjs 
     73      1.3       rjs struct sctp_event {
     74      1.3       rjs 	sctp_assoc_t se_assoc_id;
     75      1.3       rjs 	u_int16_t se_type;
     76      1.3       rjs 	u_int8_t se_on;
     77      1.3       rjs } __packed;
     78      1.1       rjs 
     79      1.1       rjs /*
     80      1.1       rjs  * ancillary data structures
     81      1.1       rjs  */
     82      1.1       rjs struct sctp_initmsg {
     83      1.1       rjs 	u_int32_t sinit_num_ostreams;
     84      1.1       rjs 	u_int32_t sinit_max_instreams;
     85      1.1       rjs 	u_int16_t sinit_max_attempts;
     86      1.1       rjs 	u_int16_t sinit_max_init_timeo;
     87      1.2       rjs } __packed;
     88      1.1       rjs 
     89      1.1       rjs struct sctp_sndrcvinfo {
     90      1.1       rjs 	u_int16_t sinfo_stream;
     91      1.1       rjs 	u_int16_t sinfo_ssn;
     92      1.1       rjs 	u_int16_t sinfo_flags;
     93      1.1       rjs 	u_int32_t sinfo_ppid;
     94      1.1       rjs 	u_int32_t sinfo_context;
     95      1.1       rjs 	u_int32_t sinfo_timetolive;
     96      1.1       rjs 	u_int32_t sinfo_tsn;
     97      1.1       rjs 	u_int32_t sinfo_cumtsn;
     98      1.1       rjs 	sctp_assoc_t sinfo_assoc_id;
     99      1.2       rjs } __packed;
    100      1.1       rjs 
    101      1.3       rjs struct sctp_sndinfo {
    102      1.3       rjs 	u_int16_t snd_sid;
    103      1.3       rjs 	u_int16_t snd_flags;
    104      1.3       rjs 	u_int32_t snd_ppid;
    105      1.3       rjs 	u_int32_t snd_context;
    106      1.3       rjs 	sctp_assoc_t snd_assoc_id;
    107      1.3       rjs } __packed;
    108      1.3       rjs 
    109      1.3       rjs struct sctp_rcvinfo {
    110      1.3       rjs 	u_int16_t rcv_sid;
    111      1.3       rjs 	u_int16_t rcv_ssn;
    112      1.3       rjs 	u_int16_t rcv_flags;
    113      1.3       rjs 	u_int32_t rcv_ppid;
    114      1.3       rjs 	u_int32_t rcv_tsn;
    115      1.3       rjs 	u_int32_t rcv_cumtsn;
    116      1.3       rjs 	u_int32_t rcv_context;
    117      1.3       rjs 	sctp_assoc_t rcv_assoc_id;
    118      1.3       rjs };
    119      1.3       rjs 
    120      1.3       rjs struct sctp_nxtinfo {
    121      1.3       rjs 	u_int16_t nxt_sid;
    122      1.3       rjs 	u_int16_t nxt_flags;
    123      1.3       rjs 	u_int32_t nxt_ppid;
    124      1.3       rjs 	u_int32_t nxt_length;
    125      1.3       rjs 	sctp_assoc_t nxt_assoc_id;
    126      1.3       rjs } __packed;
    127      1.3       rjs 
    128      1.3       rjs struct sctp_prinfo {
    129      1.3       rjs 	u_int16_t pr_policy;
    130      1.3       rjs 	u_int32_t pr_value;
    131      1.3       rjs };
    132      1.3       rjs 
    133      1.3       rjs struct sctp_authinfo {
    134      1.3       rjs 	u_int16_t auth_keynumber;
    135      1.3       rjs } __packed;
    136      1.3       rjs 
    137      1.1       rjs struct sctp_snd_all_completes {
    138      1.1       rjs 	u_int16_t sall_stream;
    139      1.1       rjs 	u_int16_t sall_flags;
    140      1.1       rjs 	u_int32_t sall_ppid;
    141      1.1       rjs 	u_int32_t sall_context;
    142      1.1       rjs 	u_int32_t sall_num_sent;
    143      1.1       rjs 	u_int32_t sall_num_failed;
    144      1.2       rjs } __packed;
    145      1.1       rjs 
    146      1.1       rjs /* send/recv flags */
    147      1.3       rjs #define SCTP_SENDALL     	0x0200
    148      1.3       rjs #define SCTP_PR_SCTP_TTL	0x0400	/* Partial Reliable on this msg */
    149      1.3       rjs #define SCTP_PR_SCTP_BUF	0x0800	/* Buffer based PR-SCTP */
    150      1.3       rjs #define SCTP_EOF 		0x1000	/* Start shutdown procedures */
    151      1.3       rjs #define SCTP_UNORDERED 		0x2000	/* Message is un-ordered */
    152      1.3       rjs #define SCTP_ADDR_OVER		0x4000	/* Override the primary-address */
    153      1.3       rjs #define SCTP_ABORT		0x8000	/* Send an ABORT to peer */
    154      1.1       rjs 
    155      1.1       rjs /* Stat's */
    156      1.1       rjs struct sctp_pcbinfo {
    157      1.1       rjs 	u_int32_t ep_count;
    158      1.1       rjs 	u_int32_t asoc_count;
    159      1.1       rjs 	u_int32_t laddr_count;
    160      1.1       rjs 	u_int32_t raddr_count;
    161      1.1       rjs 	u_int32_t chk_count;
    162      1.1       rjs 	u_int32_t sockq_count;
    163      1.1       rjs 	u_int32_t mbuf_track;
    164      1.2       rjs } __packed;
    165      1.1       rjs 
    166      1.1       rjs struct sctp_sockstat {
    167      1.1       rjs 	sctp_assoc_t ss_assoc_id;
    168      1.1       rjs 	u_int32_t ss_total_sndbuf;
    169      1.1       rjs 	u_int32_t ss_total_mbuf_sndbuf;
    170      1.1       rjs 	u_int32_t ss_total_recv_buf;
    171      1.2       rjs } __packed;
    172      1.1       rjs 
    173      1.1       rjs /*
    174      1.1       rjs  * notification event structures
    175      1.1       rjs  */
    176      1.1       rjs 
    177      1.1       rjs 
    178      1.1       rjs /* association change events */
    179      1.1       rjs 
    180      1.1       rjs struct sctp_assoc_change {
    181      1.1       rjs 	u_int16_t sac_type;
    182      1.1       rjs 	u_int16_t sac_flags;
    183      1.1       rjs 	u_int32_t sac_length;
    184      1.1       rjs 	u_int16_t sac_state;
    185      1.1       rjs 	u_int16_t sac_error;
    186      1.1       rjs 	u_int16_t sac_outbound_streams;
    187      1.1       rjs 	u_int16_t sac_inbound_streams;
    188      1.1       rjs 	sctp_assoc_t sac_assoc_id;
    189      1.3       rjs 	u_int8_t sac_info[0];
    190      1.2       rjs } __packed;
    191      1.1       rjs /* sac_state values */
    192      1.1       rjs 
    193      1.1       rjs #define SCTP_COMM_UP		0x0001
    194      1.1       rjs #define SCTP_COMM_LOST		0x0002
    195      1.1       rjs #define SCTP_RESTART		0x0003
    196      1.1       rjs #define SCTP_SHUTDOWN_COMP	0x0004
    197      1.1       rjs #define SCTP_CANT_STR_ASSOC	0x0005
    198      1.1       rjs 
    199      1.3       rjs /* sac_info values */
    200      1.3       rjs #define SCTP_ASSOC_SUPPORTS_PR		0x0001
    201      1.3       rjs #define SCTP_ASSOC_SUPPORTS_AUTH	0x0002
    202      1.3       rjs #define SCTP_ASSOC_SUPPORTS_ASCONF	0x0003
    203      1.3       rjs #define SCTP_ASSOC_SUPPORTS_MULTIBUF	0x0004
    204      1.1       rjs 
    205      1.1       rjs /* Address events */
    206      1.1       rjs struct sctp_paddr_change {
    207      1.1       rjs 	u_int16_t spc_type;
    208      1.1       rjs 	u_int16_t spc_flags;
    209      1.1       rjs 	u_int32_t spc_length;
    210      1.1       rjs 	struct sockaddr_storage spc_aaddr;
    211      1.1       rjs 	u_int32_t spc_state;
    212      1.1       rjs 	u_int32_t spc_error;
    213      1.1       rjs 	sctp_assoc_t spc_assoc_id;
    214      1.2       rjs } __packed;
    215      1.1       rjs /* paddr state values */
    216      1.1       rjs #define SCTP_ADDR_AVAILABLE	0x0001
    217      1.1       rjs #define SCTP_ADDR_UNREACHABLE	0x0002
    218      1.1       rjs #define SCTP_ADDR_REMOVED	0x0003
    219      1.1       rjs #define SCTP_ADDR_ADDED		0x0004
    220      1.1       rjs #define SCTP_ADDR_MADE_PRIM	0x0005
    221      1.3       rjs #define SCTP_ADDR_CONFIRMED	0x0006 /* XXX */
    222      1.1       rjs 
    223      1.1       rjs /*
    224      1.1       rjs  * CAUTION: these are user exposed SCTP addr reachability states
    225      1.1       rjs  *          must be compatible with SCTP_ADDR states in sctp_constants.h
    226      1.1       rjs  */
    227      1.1       rjs #ifdef SCTP_ACTIVE
    228      1.1       rjs #undef SCTP_ACTIVE
    229      1.1       rjs #endif
    230      1.1       rjs #define SCTP_ACTIVE		0x0001	/* SCTP_ADDR_REACHABLE */
    231      1.1       rjs 
    232      1.1       rjs #ifdef SCTP_INACTIVE
    233      1.1       rjs #undef SCTP_INACTIVE
    234      1.1       rjs #endif
    235      1.1       rjs #define SCTP_INACTIVE		0x0002	/* SCTP_ADDR_NOT_REACHABLE */
    236      1.1       rjs 
    237      1.1       rjs 
    238      1.1       rjs #ifdef SCTP_UNCONFIRMED
    239      1.1       rjs #undef SCTP_UNCONFIRMED
    240      1.1       rjs #endif
    241      1.1       rjs #define SCTP_UNCONFIRMED	0x0200  /* SCTP_ADDR_UNCONFIRMED */
    242      1.1       rjs 
    243      1.1       rjs #ifdef SCTP_NOHEARTBEAT
    244      1.1       rjs #undef SCTP_NOHEARTBEAT
    245      1.1       rjs #endif
    246      1.1       rjs #define SCTP_NOHEARTBEAT        0x0040 /* SCTP_ADDR_NOHB */
    247      1.1       rjs 
    248      1.1       rjs 
    249      1.1       rjs /* remote error events */
    250      1.1       rjs struct sctp_remote_error {
    251      1.1       rjs 	u_int16_t sre_type;
    252      1.1       rjs 	u_int16_t sre_flags;
    253      1.1       rjs 	u_int32_t sre_length;
    254      1.1       rjs 	u_int16_t sre_error;
    255      1.1       rjs 	sctp_assoc_t sre_assoc_id;
    256      1.1       rjs 	u_int8_t  sre_data[4];
    257      1.2       rjs } __packed;
    258      1.1       rjs 
    259      1.1       rjs /* data send failure event */
    260      1.1       rjs struct sctp_send_failed {
    261      1.1       rjs 	u_int16_t ssf_type;
    262      1.1       rjs 	u_int16_t ssf_flags;
    263      1.1       rjs 	u_int32_t ssf_length;
    264      1.1       rjs 	u_int32_t ssf_error;
    265      1.1       rjs 	struct sctp_sndrcvinfo ssf_info;
    266      1.1       rjs 	sctp_assoc_t ssf_assoc_id;
    267      1.1       rjs 	u_int8_t ssf_data[4];
    268      1.2       rjs } __packed;
    269      1.1       rjs 
    270      1.1       rjs /* flag that indicates state of data */
    271      1.1       rjs #define SCTP_DATA_UNSENT	0x0001	/* inqueue never on wire */
    272      1.1       rjs #define SCTP_DATA_SENT		0x0002	/* on wire at failure */
    273      1.1       rjs 
    274      1.1       rjs /* shutdown event */
    275      1.1       rjs struct sctp_shutdown_event {
    276      1.1       rjs 	u_int16_t	sse_type;
    277      1.1       rjs 	u_int16_t	sse_flags;
    278      1.1       rjs 	u_int32_t	sse_length;
    279      1.1       rjs 	sctp_assoc_t	sse_assoc_id;
    280      1.2       rjs } __packed;
    281      1.1       rjs 
    282      1.1       rjs /* Adaption layer indication stuff */
    283      1.1       rjs struct sctp_adaption_event {
    284      1.1       rjs 	u_int16_t	sai_type;
    285      1.1       rjs 	u_int16_t	sai_flags;
    286      1.1       rjs 	u_int32_t	sai_length;
    287      1.1       rjs 	u_int32_t	sai_adaption_ind;
    288      1.1       rjs 	sctp_assoc_t	sai_assoc_id;
    289      1.2       rjs } __packed;
    290      1.1       rjs 
    291      1.1       rjs struct sctp_setadaption {
    292      1.1       rjs 	u_int32_t	ssb_adaption_ind;
    293      1.2       rjs } __packed;
    294      1.1       rjs 
    295      1.1       rjs /* pdapi indications */
    296      1.1       rjs struct sctp_pdapi_event {
    297      1.1       rjs 	u_int16_t	pdapi_type;
    298      1.1       rjs 	u_int16_t	pdapi_flags;
    299      1.1       rjs 	u_int32_t	pdapi_length;
    300      1.1       rjs 	u_int32_t	pdapi_indication;
    301      1.3       rjs 	u_int32_t	pdapi_stream;
    302      1.3       rjs 	u_int32_t	pdapi_seq;
    303      1.1       rjs 	sctp_assoc_t	pdapi_assoc_id;
    304      1.2       rjs } __packed;
    305      1.1       rjs 
    306      1.1       rjs 
    307      1.1       rjs #define SCTP_PARTIAL_DELIVERY_ABORTED	0x0001
    308      1.1       rjs 
    309      1.3       rjs /* sender dry indications */
    310      1.3       rjs struct sctp_sender_dry_event {
    311      1.3       rjs 	u_int16_t sender_dry_type;
    312      1.3       rjs 	u_int16_t sender_dry_flags;
    313      1.3       rjs 	u_int32_t sender_dry_length;
    314      1.3       rjs 	sctp_assoc_t sender_dry_assoc_id;
    315      1.3       rjs } __packed;
    316      1.3       rjs 
    317      1.1       rjs /* stream reset stuff */
    318      1.1       rjs 
    319      1.1       rjs struct sctp_stream_reset_event {
    320      1.1       rjs 	u_int16_t	strreset_type;
    321      1.1       rjs 	u_int16_t	strreset_flags;
    322      1.1       rjs 	u_int32_t	strreset_length;
    323      1.1       rjs 	sctp_assoc_t    strreset_assoc_id;
    324      1.1       rjs 	u_int16_t       strreset_list[0];
    325      1.2       rjs } __packed;
    326      1.1       rjs 
    327      1.1       rjs /* flags in strreset_flags filed */
    328      1.1       rjs #define SCTP_STRRESET_INBOUND_STR  0x0001
    329      1.1       rjs #define SCTP_STRRESET_OUTBOUND_STR 0x0002
    330      1.1       rjs #define SCTP_STRRESET_ALL_STREAMS  0x0004
    331      1.1       rjs #define SCTP_STRRESET_STREAM_LIST  0x0008
    332      1.1       rjs 
    333      1.1       rjs #define MAX_ASOC_IDS_RET 255
    334      1.1       rjs 
    335      1.1       rjs struct sctp_assoc_ids {
    336      1.1       rjs 	u_int16_t asls_assoc_start;	/* array of index's start at 0 */
    337      1.1       rjs 	u_int8_t asls_numb_present;
    338      1.1       rjs 	u_int8_t asls_more_to_get;
    339      1.1       rjs 	sctp_assoc_t asls_assoc_id[MAX_ASOC_IDS_RET];
    340      1.2       rjs } __packed;
    341      1.1       rjs 
    342      1.1       rjs /* notification types */
    343      1.1       rjs #define SCTP_ASSOC_CHANGE		0x0001
    344      1.1       rjs #define SCTP_PEER_ADDR_CHANGE		0x0002
    345      1.1       rjs #define SCTP_REMOTE_ERROR		0x0003
    346      1.1       rjs #define SCTP_SEND_FAILED		0x0004
    347      1.1       rjs #define SCTP_SHUTDOWN_EVENT		0x0005
    348      1.1       rjs #define SCTP_ADAPTION_INDICATION	0x0006
    349      1.1       rjs #define SCTP_PARTIAL_DELIVERY_EVENT	0x0007
    350      1.3       rjs #define SCTP_STREAM_RESET_EVENT         0x0008 /* XXX */
    351      1.3       rjs #define SCTP_AUTHENTICATION_EVENT	0x0009
    352      1.3       rjs #define SCT_SENDER_DRY_EVENT		0x000a
    353      1.1       rjs 
    354      1.1       rjs struct sctp_tlv {
    355      1.1       rjs 	u_int16_t sn_type;
    356      1.1       rjs 	u_int16_t sn_flags;
    357      1.1       rjs 	u_int32_t sn_length;
    358      1.2       rjs } __packed;
    359      1.1       rjs 
    360      1.1       rjs 
    361      1.1       rjs /* notification event */
    362      1.1       rjs union sctp_notification {
    363      1.1       rjs 	struct sctp_tlv sn_header;
    364      1.1       rjs 	struct sctp_assoc_change sn_assoc_change;
    365      1.1       rjs 	struct sctp_paddr_change sn_paddr_change;
    366      1.1       rjs 	struct sctp_remote_error sn_remote_error;
    367      1.1       rjs 	struct sctp_send_failed	sn_send_failed;
    368      1.1       rjs 	struct sctp_shutdown_event sn_shutdown_event;
    369      1.1       rjs 	struct sctp_adaption_event sn_adaption_event;
    370      1.1       rjs 	struct sctp_pdapi_event sn_pdapi_event;
    371      1.1       rjs 	struct sctp_stream_reset_event sn_strreset_event;
    372      1.2       rjs } __packed;
    373      1.1       rjs 
    374      1.1       rjs /*
    375      1.1       rjs  * socket option structs
    376      1.1       rjs  */
    377      1.1       rjs #define SCTP_ISSUE_HB 0xffffffff	/* get a on-demand hb */
    378      1.1       rjs #define SCTP_NO_HB    0x0		/* turn off hb's */
    379      1.1       rjs 
    380      1.1       rjs struct sctp_paddrparams {
    381      1.1       rjs 	sctp_assoc_t spp_assoc_id;
    382      1.1       rjs 	struct sockaddr_storage spp_address;
    383      1.1       rjs 	u_int32_t spp_hbinterval;
    384      1.1       rjs 	u_int16_t spp_pathmaxrxt;
    385      1.3       rjs 	u_int32_t spp_pathmtu;
    386      1.3       rjs 	u_int32_t spp_flags;
    387      1.3       rjs 	u_int32_t spp_ipv6_flowlabel;
    388      1.3       rjs 	u_int8_t spp_dscp;
    389      1.2       rjs } __packed;
    390      1.1       rjs 
    391      1.3       rjs #define SPP_HB_ENABLE		0x0001
    392      1.3       rjs #define SPP_HB_DISABLE		0x0002
    393      1.3       rjs #define SPP_HB_DEMAND		0x0004
    394      1.3       rjs #define SPP_HB_TIME_IS_ZERO	0x0008
    395      1.3       rjs #define SPP_PMTUD_ENABLE	0x0010
    396      1.3       rjs #define SPP_PMTUD_DISABLE	0x0020
    397      1.3       rjs #define SPP_IPV6_FLOWLABEL	0x0040
    398      1.3       rjs #define SPP_DSCP		0x0080
    399      1.3       rjs 
    400      1.1       rjs struct sctp_paddrinfo {
    401      1.1       rjs 	sctp_assoc_t spinfo_assoc_id;
    402      1.1       rjs 	struct sockaddr_storage spinfo_address;
    403      1.1       rjs 	int32_t spinfo_state;
    404      1.1       rjs 	u_int32_t spinfo_cwnd;
    405      1.1       rjs 	u_int32_t spinfo_srtt;
    406      1.1       rjs 	u_int32_t spinfo_rto;
    407      1.1       rjs 	u_int32_t spinfo_mtu;
    408      1.2       rjs } __packed;
    409      1.1       rjs 
    410      1.1       rjs struct sctp_rtoinfo {
    411      1.1       rjs 	sctp_assoc_t srto_assoc_id;
    412      1.1       rjs 	u_int32_t srto_initial;
    413      1.1       rjs 	u_int32_t srto_max;
    414      1.1       rjs 	u_int32_t srto_min;
    415      1.2       rjs } __packed;
    416      1.1       rjs 
    417      1.1       rjs struct sctp_assocparams {
    418      1.1       rjs 	sctp_assoc_t sasoc_assoc_id;
    419      1.1       rjs 	u_int16_t sasoc_asocmaxrxt;
    420      1.1       rjs         u_int16_t sasoc_number_peer_destinations;
    421      1.1       rjs         u_int32_t sasoc_peer_rwnd;
    422      1.1       rjs         u_int32_t sasoc_local_rwnd;
    423      1.1       rjs         u_int32_t sasoc_cookie_life;
    424      1.2       rjs } __packed;
    425      1.1       rjs 
    426      1.1       rjs struct sctp_setprim {
    427      1.1       rjs 	sctp_assoc_t ssp_assoc_id;
    428      1.1       rjs 	struct sockaddr_storage ssp_addr;
    429      1.2       rjs } __packed;
    430      1.1       rjs 
    431      1.1       rjs struct sctp_setpeerprim {
    432      1.1       rjs 	sctp_assoc_t sspp_assoc_id;
    433      1.1       rjs 	struct sockaddr_storage sspp_addr;
    434      1.2       rjs } __packed;
    435      1.1       rjs 
    436      1.1       rjs struct sctp_getaddresses {
    437      1.1       rjs 	sctp_assoc_t sget_assoc_id;
    438      1.1       rjs 	/* addr is filled in for N * sockaddr_storage */
    439      1.1       rjs 	struct sockaddr addr[1];
    440      1.2       rjs } __packed;
    441      1.1       rjs 
    442      1.1       rjs struct sctp_setstrm_timeout {
    443      1.1       rjs 	sctp_assoc_t ssto_assoc_id;
    444      1.1       rjs 	u_int32_t ssto_timeout;
    445      1.1       rjs 	u_int32_t ssto_streamid_start;
    446      1.1       rjs 	u_int32_t ssto_streamid_end;
    447      1.2       rjs } __packed;
    448      1.1       rjs 
    449      1.1       rjs struct sctp_status {
    450      1.1       rjs 	sctp_assoc_t sstat_assoc_id;
    451      1.1       rjs 	int32_t sstat_state;
    452      1.1       rjs 	u_int32_t sstat_rwnd;
    453      1.1       rjs 	u_int16_t sstat_unackdata;
    454      1.1       rjs 	u_int16_t sstat_penddata;
    455      1.1       rjs         u_int16_t sstat_instrms;
    456      1.1       rjs         u_int16_t sstat_outstrms;
    457      1.1       rjs         u_int32_t sstat_fragmentation_point;
    458      1.1       rjs 	struct sctp_paddrinfo sstat_primary;
    459      1.2       rjs } __packed;
    460      1.1       rjs 
    461      1.1       rjs struct sctp_cwnd_args {
    462      1.1       rjs 	struct sctp_nets *net;		/* network to */
    463      1.1       rjs 	u_int32_t cwnd_new_value;	/* cwnd in k */
    464      1.1       rjs 	u_int32_t inflight;		/* flightsize in k */
    465      1.1       rjs 	int cwnd_augment;		/* increment to it */
    466      1.2       rjs } __packed;
    467      1.1       rjs 
    468      1.1       rjs struct sctp_blk_args {
    469      1.1       rjs 	u_int32_t onmb;			/* in 1k bytes */
    470      1.1       rjs 	u_int32_t onsb;			/* in 1k bytes */
    471      1.1       rjs 	u_int16_t maxmb;		/* in 1k bytes */
    472      1.1       rjs 	u_int16_t maxsb;		/* in 1k bytes */
    473      1.1       rjs 	u_int16_t send_sent_qcnt;	/* chnk cnt */
    474      1.1       rjs 	u_int16_t stream_qcnt;		/* chnk cnt */
    475      1.2       rjs } __packed;
    476      1.1       rjs 
    477      1.1       rjs /*
    478      1.1       rjs  * Max we can reset in one setting, note this is dictated not by the
    479      1.1       rjs  * define but the size of a mbuf cluster so don't change this define
    480      1.1       rjs  * and think you can specify more. You must do multiple resets if you
    481      1.1       rjs  * want to reset more than SCTP_MAX_EXPLICIT_STR_RESET.
    482      1.1       rjs  */
    483      1.1       rjs #define SCTP_MAX_EXPLICT_STR_RESET   1000
    484      1.1       rjs 
    485      1.1       rjs #define SCTP_RESET_LOCAL_RECV  0x0001
    486      1.1       rjs #define SCTP_RESET_LOCAL_SEND  0x0002
    487      1.1       rjs #define SCTP_RESET_BOTH        0x0003
    488      1.1       rjs 
    489      1.1       rjs struct sctp_stream_reset {
    490      1.1       rjs 	sctp_assoc_t strrst_assoc_id;
    491      1.1       rjs 	u_int16_t    strrst_flags;
    492      1.1       rjs 	u_int16_t    strrst_num_streams;	/* 0 == ALL */
    493      1.1       rjs 	u_int16_t    strrst_list[0];		/* list if strrst_num_streams is not 0*/
    494      1.2       rjs } __packed;
    495      1.1       rjs 
    496      1.1       rjs 
    497      1.1       rjs struct sctp_get_nonce_values {
    498      1.1       rjs 	sctp_assoc_t gn_assoc_id;
    499      1.1       rjs 	u_int32_t    gn_peers_tag;
    500      1.1       rjs 	u_int32_t    gn_local_tag;
    501      1.2       rjs } __packed;
    502      1.1       rjs 
    503      1.1       rjs /* Debugging logs */
    504      1.1       rjs struct sctp_str_log{
    505      1.1       rjs 	u_int32_t n_tsn;
    506      1.1       rjs 	u_int32_t e_tsn;
    507      1.1       rjs 	u_int16_t n_sseq;
    508      1.1       rjs 	u_int16_t e_sseq;
    509      1.2       rjs } __packed;
    510      1.1       rjs 
    511      1.1       rjs struct sctp_fr_log {
    512      1.1       rjs 	u_int32_t largest_tsn;
    513      1.1       rjs 	u_int32_t largest_new_tsn;
    514      1.1       rjs 	u_int32_t tsn;
    515      1.2       rjs } __packed;
    516      1.1       rjs 
    517      1.1       rjs struct sctp_fr_map {
    518      1.1       rjs 	u_int32_t base;
    519      1.1       rjs 	u_int32_t cum;
    520      1.1       rjs 	u_int32_t high;
    521      1.2       rjs } __packed;
    522      1.1       rjs 
    523      1.1       rjs struct sctp_rwnd_log {
    524      1.1       rjs 	u_int32_t rwnd;
    525      1.1       rjs 	u_int32_t send_size;
    526      1.1       rjs 	u_int32_t overhead;
    527      1.1       rjs 	u_int32_t new_rwnd;
    528      1.2       rjs } __packed;
    529      1.1       rjs 
    530      1.1       rjs struct sctp_mbcnt_log {
    531      1.1       rjs 	u_int32_t total_queue_size;
    532      1.1       rjs 	u_int32_t size_change;
    533      1.1       rjs 	u_int32_t total_queue_mb_size;
    534      1.1       rjs 	u_int32_t mbcnt_change;
    535      1.2       rjs } __packed;
    536      1.1       rjs 
    537      1.3       rjs struct sctp_cwnd_log {
    538      1.1       rjs 	union {
    539      1.1       rjs 		struct sctp_blk_args blk;
    540      1.1       rjs 		struct sctp_cwnd_args cwnd;
    541      1.1       rjs 		struct sctp_str_log strlog;
    542      1.1       rjs 		struct sctp_fr_log fr;
    543      1.1       rjs 		struct sctp_fr_map map;
    544      1.1       rjs 		struct sctp_rwnd_log rwnd;
    545      1.1       rjs 		struct sctp_mbcnt_log mbcnt;
    546      1.1       rjs 	}x;
    547      1.1       rjs 	u_int8_t from;
    548      1.1       rjs 	u_int8_t event_type;
    549      1.1       rjs 
    550      1.2       rjs } __packed;
    551      1.1       rjs 
    552      1.3       rjs struct sctp_cwnd_log_req {
    553      1.1       rjs 	int num_in_log;     /* Number in log */
    554      1.1       rjs 	int num_ret;        /* Number returned */
    555      1.1       rjs 	int start_at;       /* start at this one */
    556      1.1       rjs 	int end_at;         /* end at this one */
    557      1.1       rjs 	struct sctp_cwnd_log log[0];
    558      1.2       rjs } __packed;
    559      1.1       rjs 
    560      1.3       rjs struct sctp_sendv_spa {
    561      1.3       rjs 	u_int32_t sendv_flags;
    562      1.3       rjs 	struct sctp_sndinfo sendv_sndinfo;
    563      1.3       rjs 	struct sctp_prinfo sendv_prinfo;
    564      1.3       rjs 	struct sctp_authinfo sendv_authinfo;
    565      1.3       rjs } __packed;
    566      1.3       rjs 
    567      1.3       rjs #define SCTP_SEND_SNDINFO_VALID		0x00000001
    568      1.3       rjs #define SCTP_SEND_PRINFO_VALID		0x00000002
    569      1.3       rjs #define SCTP_SEND_AUTHINFO_VALID	0x00000004
    570      1.3       rjs 
    571      1.3       rjs #define SCTP_SENDV_NOINFO	0x0000
    572      1.3       rjs #define SCTP_SENDV_SNDINFO	0x0001
    573      1.3       rjs #define SCTP_SENDV_PRINFO	0x0002
    574      1.3       rjs #define SCTP_SENDV_AUTHINFO	0x0003
    575      1.3       rjs #define SCTP_SENDV_SPA		0x0004
    576      1.3       rjs 
    577      1.3       rjs struct sctp_recvv_rn {
    578      1.3       rjs 	struct sctp_rcvinfo recvv_rcvinfo;
    579      1.3       rjs 	struct sctp_nxtinfo recvv_nxtinfo;
    580      1.3       rjs } __packed;
    581      1.3       rjs 
    582      1.3       rjs #define SCTP_RECVV_NOINFO	0x0000
    583      1.3       rjs #define SCTP_RECVV_RCVINFO	0x0001
    584      1.3       rjs #define SCTP_RECVV_NXTINFO	0x0002
    585      1.3       rjs #define SCTP_RECVV_RN		0x0003
    586      1.1       rjs 
    587  1.3.4.1  christos struct sctp_connectx_addrs {
    588  1.3.4.1  christos 	int cx_num;
    589  1.3.4.1  christos 	int cx_len;
    590  1.3.4.1  christos 	void *cx_addrs;
    591  1.3.4.1  christos } __packed;
    592  1.3.4.1  christos 
    593  1.3.4.1  christos #define SIOCCONNECTX	_IOWR('s', 11, struct sctp_connectx_addrs)
    594  1.3.4.1  christos #define SIOCCONNECTXDEL	_IOWR('s', 12, struct sctp_connectx_addrs)
    595      1.1       rjs 
    596      1.1       rjs /*
    597      1.1       rjs  * API system calls
    598      1.1       rjs  */
    599      1.1       rjs #if !defined(_KERNEL)
    600      1.1       rjs 
    601      1.1       rjs __BEGIN_DECLS
    602      1.1       rjs int sctp_peeloff(int, sctp_assoc_t);
    603      1.1       rjs int	sctp_bindx(int, struct sockaddr *, int, int);
    604      1.3       rjs int     sctp_connectx(int, struct sockaddr *, int, sctp_assoc_t *);
    605      1.1       rjs int	sctp_getpaddrs(int, sctp_assoc_t, struct sockaddr **);
    606      1.1       rjs void	sctp_freepaddrs(struct sockaddr *);
    607      1.1       rjs int	sctp_getladdrs(int, sctp_assoc_t, struct sockaddr **);
    608      1.1       rjs void	sctp_freeladdrs(struct sockaddr *);
    609      1.1       rjs int     sctp_opt_info(int, sctp_assoc_t, int, void *, socklen_t *);
    610      1.1       rjs 
    611      1.1       rjs ssize_t sctp_sendmsg(int, const void *, size_t,
    612      1.1       rjs 	const struct sockaddr *,
    613      1.1       rjs 	socklen_t, u_int32_t, u_int32_t, u_int16_t, u_int32_t, u_int32_t);
    614      1.1       rjs 
    615      1.3       rjs ssize_t sctp_send(int, const void *, size_t,
    616      1.3       rjs 	const struct sctp_sndrcvinfo *, int);
    617      1.1       rjs 
    618      1.1       rjs ssize_t
    619      1.3       rjs sctp_sendx(int, const void *, size_t, struct sockaddr *, int,
    620      1.3       rjs 		struct sctp_sndrcvinfo *, int);
    621      1.1       rjs ssize_t
    622      1.1       rjs sctp_sendmsgx(int sd, const void *, size_t,
    623      1.3       rjs 	      struct sockaddr *, int,
    624      1.3       rjs 	      u_int32_t, u_int32_t, u_int16_t, u_int32_t, u_int32_t);
    625      1.3       rjs ssize_t sctp_sendv(int, const struct iovec *, int, struct sockaddr *, int,
    626      1.3       rjs                       void *, socklen_t, unsigned int, int);
    627      1.1       rjs 
    628      1.1       rjs sctp_assoc_t
    629      1.1       rjs sctp_getassocid(int sd, struct sockaddr *sa);
    630      1.1       rjs 
    631      1.1       rjs ssize_t sctp_recvmsg(int, void *, size_t, struct sockaddr *,
    632      1.1       rjs         socklen_t *, struct sctp_sndrcvinfo *, int *);
    633      1.3       rjs ssize_t sctp_recvv(int, const struct iovec *, int, struct sockaddr *,
    634      1.3       rjs                       socklen_t *, void *, socklen_t *, unsigned int *,
    635      1.3       rjs                       int *);
    636      1.1       rjs 
    637      1.1       rjs __END_DECLS
    638      1.1       rjs 
    639      1.1       rjs #endif /* !_KERNEL */
    640      1.1       rjs #endif /* !__SCTP_UIO_H__ */
    641