Home | History | Annotate | Line # | Download | only in netinet
sctp_uio.h revision 1.1
      1  1.1  rjs /*	$KAME: sctp_uio.h,v 1.11 2005/03/06 16:04:18 itojun Exp $	*/
      2  1.1  rjs /*	$NetBSD: sctp_uio.h,v 1.1 2015/10/13 21:28:35 rjs 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.1  rjs /* On/Off setup for subscription to events */
     45  1.1  rjs struct sctp_event_subscribe {
     46  1.1  rjs 	u_int8_t sctp_data_io_event;
     47  1.1  rjs 	u_int8_t sctp_association_event;
     48  1.1  rjs 	u_int8_t sctp_address_event;
     49  1.1  rjs 	u_int8_t sctp_send_failure_event;
     50  1.1  rjs 	u_int8_t sctp_peer_error_event;
     51  1.1  rjs 	u_int8_t sctp_shutdown_event;
     52  1.1  rjs 	u_int8_t sctp_partial_delivery_event;
     53  1.1  rjs 	u_int8_t sctp_adaption_layer_event;
     54  1.1  rjs 	u_int8_t sctp_stream_reset_events;
     55  1.1  rjs };
     56  1.1  rjs 
     57  1.1  rjs /* ancillary data types */
     58  1.1  rjs #define SCTP_INIT	0x0001
     59  1.1  rjs #define SCTP_SNDRCV	0x0002
     60  1.1  rjs 
     61  1.1  rjs /*
     62  1.1  rjs  * ancillary data structures
     63  1.1  rjs  */
     64  1.1  rjs struct sctp_initmsg {
     65  1.1  rjs 	u_int32_t sinit_num_ostreams;
     66  1.1  rjs 	u_int32_t sinit_max_instreams;
     67  1.1  rjs 	u_int16_t sinit_max_attempts;
     68  1.1  rjs 	u_int16_t sinit_max_init_timeo;
     69  1.1  rjs };
     70  1.1  rjs 
     71  1.1  rjs struct sctp_sndrcvinfo {
     72  1.1  rjs 	u_int16_t sinfo_stream;
     73  1.1  rjs 	u_int16_t sinfo_ssn;
     74  1.1  rjs 	u_int16_t sinfo_flags;
     75  1.1  rjs 	u_int32_t sinfo_ppid;
     76  1.1  rjs 	u_int32_t sinfo_context;
     77  1.1  rjs 	u_int32_t sinfo_timetolive;
     78  1.1  rjs 	u_int32_t sinfo_tsn;
     79  1.1  rjs 	u_int32_t sinfo_cumtsn;
     80  1.1  rjs 	sctp_assoc_t sinfo_assoc_id;
     81  1.1  rjs };
     82  1.1  rjs 
     83  1.1  rjs struct sctp_snd_all_completes {
     84  1.1  rjs 	u_int16_t sall_stream;
     85  1.1  rjs 	u_int16_t sall_flags;
     86  1.1  rjs 	u_int32_t sall_ppid;
     87  1.1  rjs 	u_int32_t sall_context;
     88  1.1  rjs 	u_int32_t sall_num_sent;
     89  1.1  rjs 	u_int32_t sall_num_failed;
     90  1.1  rjs };
     91  1.1  rjs 
     92  1.1  rjs /* send/recv flags */
     93  1.1  rjs /* MSG_EOF (0x0100) is reused from sys/socket.h */
     94  1.1  rjs #define MSG_SENDALL     0x0200
     95  1.1  rjs #define MSG_PR_SCTP_TTL	0x0400	/* Partial Reliable on this msg */
     96  1.1  rjs #define MSG_PR_SCTP_BUF	0x0800	/* Buffer based PR-SCTP */
     97  1.1  rjs #ifndef MSG_EOF
     98  1.1  rjs #define MSG_EOF 	0x1000	/* Start shutdown procedures */
     99  1.1  rjs #endif
    100  1.1  rjs #define MSG_UNORDERED 	0x2000	/* Message is un-ordered */
    101  1.1  rjs #define MSG_ADDR_OVER	0x4000	/* Override the primary-address */
    102  1.1  rjs #define MSG_ABORT	0x8000	/* Send an ABORT to peer */
    103  1.1  rjs 
    104  1.1  rjs /* Stat's */
    105  1.1  rjs struct sctp_pcbinfo {
    106  1.1  rjs 	u_int32_t ep_count;
    107  1.1  rjs 	u_int32_t asoc_count;
    108  1.1  rjs 	u_int32_t laddr_count;
    109  1.1  rjs 	u_int32_t raddr_count;
    110  1.1  rjs 	u_int32_t chk_count;
    111  1.1  rjs 	u_int32_t sockq_count;
    112  1.1  rjs 	u_int32_t mbuf_track;
    113  1.1  rjs };
    114  1.1  rjs 
    115  1.1  rjs struct sctp_sockstat {
    116  1.1  rjs 	sctp_assoc_t ss_assoc_id;
    117  1.1  rjs 	u_int32_t ss_total_sndbuf;
    118  1.1  rjs 	u_int32_t ss_total_mbuf_sndbuf;
    119  1.1  rjs 	u_int32_t ss_total_recv_buf;
    120  1.1  rjs };
    121  1.1  rjs 
    122  1.1  rjs /*
    123  1.1  rjs  * notification event structures
    124  1.1  rjs  */
    125  1.1  rjs 
    126  1.1  rjs 
    127  1.1  rjs /* association change events */
    128  1.1  rjs 
    129  1.1  rjs struct sctp_assoc_change {
    130  1.1  rjs 	u_int16_t sac_type;
    131  1.1  rjs 	u_int16_t sac_flags;
    132  1.1  rjs 	u_int32_t sac_length;
    133  1.1  rjs 	u_int16_t sac_state;
    134  1.1  rjs 	u_int16_t sac_error;
    135  1.1  rjs 	u_int16_t sac_outbound_streams;
    136  1.1  rjs 	u_int16_t sac_inbound_streams;
    137  1.1  rjs 	sctp_assoc_t sac_assoc_id;
    138  1.1  rjs };
    139  1.1  rjs /* sac_state values */
    140  1.1  rjs 
    141  1.1  rjs #define SCTP_COMM_UP		0x0001
    142  1.1  rjs #define SCTP_COMM_LOST		0x0002
    143  1.1  rjs #define SCTP_RESTART		0x0003
    144  1.1  rjs #define SCTP_SHUTDOWN_COMP	0x0004
    145  1.1  rjs #define SCTP_CANT_STR_ASSOC	0x0005
    146  1.1  rjs 
    147  1.1  rjs 
    148  1.1  rjs /* Address events */
    149  1.1  rjs struct sctp_paddr_change {
    150  1.1  rjs 	u_int16_t spc_type;
    151  1.1  rjs 	u_int16_t spc_flags;
    152  1.1  rjs 	u_int32_t spc_length;
    153  1.1  rjs 	struct sockaddr_storage spc_aaddr;
    154  1.1  rjs 	u_int32_t spc_state;
    155  1.1  rjs 	u_int32_t spc_error;
    156  1.1  rjs 	sctp_assoc_t spc_assoc_id;
    157  1.1  rjs };
    158  1.1  rjs /* paddr state values */
    159  1.1  rjs #define SCTP_ADDR_AVAILABLE	0x0001
    160  1.1  rjs #define SCTP_ADDR_UNREACHABLE	0x0002
    161  1.1  rjs #define SCTP_ADDR_REMOVED	0x0003
    162  1.1  rjs #define SCTP_ADDR_ADDED		0x0004
    163  1.1  rjs #define SCTP_ADDR_MADE_PRIM	0x0005
    164  1.1  rjs #define SCTP_ADDR_CONFIRMED	0x0006
    165  1.1  rjs 
    166  1.1  rjs /*
    167  1.1  rjs  * CAUTION: these are user exposed SCTP addr reachability states
    168  1.1  rjs  *          must be compatible with SCTP_ADDR states in sctp_constants.h
    169  1.1  rjs  */
    170  1.1  rjs #ifdef SCTP_ACTIVE
    171  1.1  rjs #undef SCTP_ACTIVE
    172  1.1  rjs #endif
    173  1.1  rjs #define SCTP_ACTIVE		0x0001	/* SCTP_ADDR_REACHABLE */
    174  1.1  rjs 
    175  1.1  rjs #ifdef SCTP_INACTIVE
    176  1.1  rjs #undef SCTP_INACTIVE
    177  1.1  rjs #endif
    178  1.1  rjs #define SCTP_INACTIVE		0x0002	/* SCTP_ADDR_NOT_REACHABLE */
    179  1.1  rjs 
    180  1.1  rjs 
    181  1.1  rjs #ifdef SCTP_UNCONFIRMED
    182  1.1  rjs #undef SCTP_UNCONFIRMED
    183  1.1  rjs #endif
    184  1.1  rjs #define SCTP_UNCONFIRMED	0x0200  /* SCTP_ADDR_UNCONFIRMED */
    185  1.1  rjs 
    186  1.1  rjs #ifdef SCTP_NOHEARTBEAT
    187  1.1  rjs #undef SCTP_NOHEARTBEAT
    188  1.1  rjs #endif
    189  1.1  rjs #define SCTP_NOHEARTBEAT        0x0040 /* SCTP_ADDR_NOHB */
    190  1.1  rjs 
    191  1.1  rjs 
    192  1.1  rjs 
    193  1.1  rjs 
    194  1.1  rjs /* remote error events */
    195  1.1  rjs struct sctp_remote_error {
    196  1.1  rjs 	u_int16_t sre_type;
    197  1.1  rjs 	u_int16_t sre_flags;
    198  1.1  rjs 	u_int32_t sre_length;
    199  1.1  rjs 	u_int16_t sre_error;
    200  1.1  rjs 	sctp_assoc_t sre_assoc_id;
    201  1.1  rjs 	u_int8_t  sre_data[4];
    202  1.1  rjs };
    203  1.1  rjs 
    204  1.1  rjs /* data send failure event */
    205  1.1  rjs struct sctp_send_failed {
    206  1.1  rjs 	u_int16_t ssf_type;
    207  1.1  rjs 	u_int16_t ssf_flags;
    208  1.1  rjs 	u_int32_t ssf_length;
    209  1.1  rjs 	u_int32_t ssf_error;
    210  1.1  rjs 	struct sctp_sndrcvinfo ssf_info;
    211  1.1  rjs 	sctp_assoc_t ssf_assoc_id;
    212  1.1  rjs 	u_int8_t ssf_data[4];
    213  1.1  rjs };
    214  1.1  rjs 
    215  1.1  rjs /* flag that indicates state of data */
    216  1.1  rjs #define SCTP_DATA_UNSENT	0x0001	/* inqueue never on wire */
    217  1.1  rjs #define SCTP_DATA_SENT		0x0002	/* on wire at failure */
    218  1.1  rjs 
    219  1.1  rjs /* shutdown event */
    220  1.1  rjs struct sctp_shutdown_event {
    221  1.1  rjs 	u_int16_t	sse_type;
    222  1.1  rjs 	u_int16_t	sse_flags;
    223  1.1  rjs 	u_int32_t	sse_length;
    224  1.1  rjs 	sctp_assoc_t	sse_assoc_id;
    225  1.1  rjs };
    226  1.1  rjs 
    227  1.1  rjs /* Adaption layer indication stuff */
    228  1.1  rjs struct sctp_adaption_event {
    229  1.1  rjs 	u_int16_t	sai_type;
    230  1.1  rjs 	u_int16_t	sai_flags;
    231  1.1  rjs 	u_int32_t	sai_length;
    232  1.1  rjs 	u_int32_t	sai_adaption_ind;
    233  1.1  rjs 	sctp_assoc_t	sai_assoc_id;
    234  1.1  rjs };
    235  1.1  rjs 
    236  1.1  rjs struct sctp_setadaption {
    237  1.1  rjs 	u_int32_t	ssb_adaption_ind;
    238  1.1  rjs };
    239  1.1  rjs 
    240  1.1  rjs /* pdapi indications */
    241  1.1  rjs struct sctp_pdapi_event {
    242  1.1  rjs 	u_int16_t	pdapi_type;
    243  1.1  rjs 	u_int16_t	pdapi_flags;
    244  1.1  rjs 	u_int32_t	pdapi_length;
    245  1.1  rjs 	u_int32_t	pdapi_indication;
    246  1.1  rjs 	sctp_assoc_t	pdapi_assoc_id;
    247  1.1  rjs };
    248  1.1  rjs 
    249  1.1  rjs 
    250  1.1  rjs #define SCTP_PARTIAL_DELIVERY_ABORTED	0x0001
    251  1.1  rjs 
    252  1.1  rjs /* stream reset stuff */
    253  1.1  rjs 
    254  1.1  rjs struct sctp_stream_reset_event {
    255  1.1  rjs 	u_int16_t	strreset_type;
    256  1.1  rjs 	u_int16_t	strreset_flags;
    257  1.1  rjs 	u_int32_t	strreset_length;
    258  1.1  rjs 	sctp_assoc_t    strreset_assoc_id;
    259  1.1  rjs 	u_int16_t       strreset_list[0];
    260  1.1  rjs };
    261  1.1  rjs 
    262  1.1  rjs /* flags in strreset_flags filed */
    263  1.1  rjs #define SCTP_STRRESET_INBOUND_STR  0x0001
    264  1.1  rjs #define SCTP_STRRESET_OUTBOUND_STR 0x0002
    265  1.1  rjs #define SCTP_STRRESET_ALL_STREAMS  0x0004
    266  1.1  rjs #define SCTP_STRRESET_STREAM_LIST  0x0008
    267  1.1  rjs 
    268  1.1  rjs #define MAX_ASOC_IDS_RET 255
    269  1.1  rjs 
    270  1.1  rjs struct sctp_assoc_ids {
    271  1.1  rjs 	u_int16_t asls_assoc_start;	/* array of index's start at 0 */
    272  1.1  rjs 	u_int8_t asls_numb_present;
    273  1.1  rjs 	u_int8_t asls_more_to_get;
    274  1.1  rjs 	sctp_assoc_t asls_assoc_id[MAX_ASOC_IDS_RET];
    275  1.1  rjs };
    276  1.1  rjs 
    277  1.1  rjs /* notification types */
    278  1.1  rjs #define SCTP_ASSOC_CHANGE		0x0001
    279  1.1  rjs #define SCTP_PEER_ADDR_CHANGE		0x0002
    280  1.1  rjs #define SCTP_REMOTE_ERROR		0x0003
    281  1.1  rjs #define SCTP_SEND_FAILED		0x0004
    282  1.1  rjs #define SCTP_SHUTDOWN_EVENT		0x0005
    283  1.1  rjs #define SCTP_ADAPTION_INDICATION	0x0006
    284  1.1  rjs #define SCTP_PARTIAL_DELIVERY_EVENT	0x0007
    285  1.1  rjs #define SCTP_STREAM_RESET_EVENT         0x0008
    286  1.1  rjs 
    287  1.1  rjs 
    288  1.1  rjs 
    289  1.1  rjs struct sctp_tlv {
    290  1.1  rjs 	u_int16_t sn_type;
    291  1.1  rjs 	u_int16_t sn_flags;
    292  1.1  rjs 	u_int32_t sn_length;
    293  1.1  rjs };
    294  1.1  rjs 
    295  1.1  rjs 
    296  1.1  rjs /* notification event */
    297  1.1  rjs union sctp_notification {
    298  1.1  rjs 	struct sctp_tlv sn_header;
    299  1.1  rjs 	struct sctp_assoc_change sn_assoc_change;
    300  1.1  rjs 	struct sctp_paddr_change sn_paddr_change;
    301  1.1  rjs 	struct sctp_remote_error sn_remote_error;
    302  1.1  rjs 	struct sctp_send_failed	sn_send_failed;
    303  1.1  rjs 	struct sctp_shutdown_event sn_shutdown_event;
    304  1.1  rjs 	struct sctp_adaption_event sn_adaption_event;
    305  1.1  rjs 	struct sctp_pdapi_event sn_pdapi_event;
    306  1.1  rjs 	struct sctp_stream_reset_event sn_strreset_event;
    307  1.1  rjs };
    308  1.1  rjs 
    309  1.1  rjs /*
    310  1.1  rjs  * socket option structs
    311  1.1  rjs  */
    312  1.1  rjs #define SCTP_ISSUE_HB 0xffffffff	/* get a on-demand hb */
    313  1.1  rjs #define SCTP_NO_HB    0x0		/* turn off hb's */
    314  1.1  rjs 
    315  1.1  rjs struct sctp_paddrparams {
    316  1.1  rjs 	sctp_assoc_t spp_assoc_id;
    317  1.1  rjs 	struct sockaddr_storage spp_address;
    318  1.1  rjs 	u_int32_t spp_hbinterval;
    319  1.1  rjs 	u_int16_t spp_pathmaxrxt;
    320  1.1  rjs };
    321  1.1  rjs 
    322  1.1  rjs struct sctp_paddrinfo {
    323  1.1  rjs 	sctp_assoc_t spinfo_assoc_id;
    324  1.1  rjs 	struct sockaddr_storage spinfo_address;
    325  1.1  rjs 	int32_t spinfo_state;
    326  1.1  rjs 	u_int32_t spinfo_cwnd;
    327  1.1  rjs 	u_int32_t spinfo_srtt;
    328  1.1  rjs 	u_int32_t spinfo_rto;
    329  1.1  rjs 	u_int32_t spinfo_mtu;
    330  1.1  rjs };
    331  1.1  rjs 
    332  1.1  rjs struct sctp_rtoinfo {
    333  1.1  rjs 	sctp_assoc_t srto_assoc_id;
    334  1.1  rjs 	u_int32_t srto_initial;
    335  1.1  rjs 	u_int32_t srto_max;
    336  1.1  rjs 	u_int32_t srto_min;
    337  1.1  rjs };
    338  1.1  rjs 
    339  1.1  rjs struct sctp_assocparams {
    340  1.1  rjs 	sctp_assoc_t sasoc_assoc_id;
    341  1.1  rjs 	u_int16_t sasoc_asocmaxrxt;
    342  1.1  rjs         u_int16_t sasoc_number_peer_destinations;
    343  1.1  rjs         u_int32_t sasoc_peer_rwnd;
    344  1.1  rjs         u_int32_t sasoc_local_rwnd;
    345  1.1  rjs         u_int32_t sasoc_cookie_life;
    346  1.1  rjs };
    347  1.1  rjs 
    348  1.1  rjs struct sctp_setprim {
    349  1.1  rjs 	sctp_assoc_t ssp_assoc_id;
    350  1.1  rjs 	struct sockaddr_storage ssp_addr;
    351  1.1  rjs };
    352  1.1  rjs 
    353  1.1  rjs struct sctp_setpeerprim {
    354  1.1  rjs 	sctp_assoc_t sspp_assoc_id;
    355  1.1  rjs 	struct sockaddr_storage sspp_addr;
    356  1.1  rjs };
    357  1.1  rjs 
    358  1.1  rjs struct sctp_getaddresses {
    359  1.1  rjs 	sctp_assoc_t sget_assoc_id;
    360  1.1  rjs 	/* addr is filled in for N * sockaddr_storage */
    361  1.1  rjs 	struct sockaddr addr[1];
    362  1.1  rjs };
    363  1.1  rjs 
    364  1.1  rjs struct sctp_setstrm_timeout {
    365  1.1  rjs 	sctp_assoc_t ssto_assoc_id;
    366  1.1  rjs 	u_int32_t ssto_timeout;
    367  1.1  rjs 	u_int32_t ssto_streamid_start;
    368  1.1  rjs 	u_int32_t ssto_streamid_end;
    369  1.1  rjs };
    370  1.1  rjs 
    371  1.1  rjs struct sctp_status {
    372  1.1  rjs 	sctp_assoc_t sstat_assoc_id;
    373  1.1  rjs 	int32_t sstat_state;
    374  1.1  rjs 	u_int32_t sstat_rwnd;
    375  1.1  rjs 	u_int16_t sstat_unackdata;
    376  1.1  rjs 	u_int16_t sstat_penddata;
    377  1.1  rjs         u_int16_t sstat_instrms;
    378  1.1  rjs         u_int16_t sstat_outstrms;
    379  1.1  rjs         u_int32_t sstat_fragmentation_point;
    380  1.1  rjs 	struct sctp_paddrinfo sstat_primary;
    381  1.1  rjs };
    382  1.1  rjs 
    383  1.1  rjs struct sctp_cwnd_args {
    384  1.1  rjs 	struct sctp_nets *net;		/* network to */
    385  1.1  rjs 	u_int32_t cwnd_new_value;	/* cwnd in k */
    386  1.1  rjs 	u_int32_t inflight;		/* flightsize in k */
    387  1.1  rjs 	int cwnd_augment;		/* increment to it */
    388  1.1  rjs };
    389  1.1  rjs 
    390  1.1  rjs struct sctp_blk_args {
    391  1.1  rjs 	u_int32_t onmb;			/* in 1k bytes */
    392  1.1  rjs 	u_int32_t onsb;			/* in 1k bytes */
    393  1.1  rjs 	u_int16_t maxmb;		/* in 1k bytes */
    394  1.1  rjs 	u_int16_t maxsb;		/* in 1k bytes */
    395  1.1  rjs 	u_int16_t send_sent_qcnt;	/* chnk cnt */
    396  1.1  rjs 	u_int16_t stream_qcnt;		/* chnk cnt */
    397  1.1  rjs };
    398  1.1  rjs 
    399  1.1  rjs /*
    400  1.1  rjs  * Max we can reset in one setting, note this is dictated not by the
    401  1.1  rjs  * define but the size of a mbuf cluster so don't change this define
    402  1.1  rjs  * and think you can specify more. You must do multiple resets if you
    403  1.1  rjs  * want to reset more than SCTP_MAX_EXPLICIT_STR_RESET.
    404  1.1  rjs  */
    405  1.1  rjs #define SCTP_MAX_EXPLICT_STR_RESET   1000
    406  1.1  rjs 
    407  1.1  rjs #define SCTP_RESET_LOCAL_RECV  0x0001
    408  1.1  rjs #define SCTP_RESET_LOCAL_SEND  0x0002
    409  1.1  rjs #define SCTP_RESET_BOTH        0x0003
    410  1.1  rjs 
    411  1.1  rjs struct sctp_stream_reset {
    412  1.1  rjs 	sctp_assoc_t strrst_assoc_id;
    413  1.1  rjs 	u_int16_t    strrst_flags;
    414  1.1  rjs 	u_int16_t    strrst_num_streams;	/* 0 == ALL */
    415  1.1  rjs 	u_int16_t    strrst_list[0];		/* list if strrst_num_streams is not 0*/
    416  1.1  rjs };
    417  1.1  rjs 
    418  1.1  rjs 
    419  1.1  rjs struct sctp_get_nonce_values {
    420  1.1  rjs 	sctp_assoc_t gn_assoc_id;
    421  1.1  rjs 	u_int32_t    gn_peers_tag;
    422  1.1  rjs 	u_int32_t    gn_local_tag;
    423  1.1  rjs };
    424  1.1  rjs 
    425  1.1  rjs /* Debugging logs */
    426  1.1  rjs struct sctp_str_log{
    427  1.1  rjs 	u_int32_t n_tsn;
    428  1.1  rjs 	u_int32_t e_tsn;
    429  1.1  rjs 	u_int16_t n_sseq;
    430  1.1  rjs 	u_int16_t e_sseq;
    431  1.1  rjs };
    432  1.1  rjs 
    433  1.1  rjs struct sctp_fr_log {
    434  1.1  rjs 	u_int32_t largest_tsn;
    435  1.1  rjs 	u_int32_t largest_new_tsn;
    436  1.1  rjs 	u_int32_t tsn;
    437  1.1  rjs };
    438  1.1  rjs 
    439  1.1  rjs struct sctp_fr_map {
    440  1.1  rjs 	u_int32_t base;
    441  1.1  rjs 	u_int32_t cum;
    442  1.1  rjs 	u_int32_t high;
    443  1.1  rjs };
    444  1.1  rjs 
    445  1.1  rjs struct sctp_rwnd_log {
    446  1.1  rjs 	u_int32_t rwnd;
    447  1.1  rjs 	u_int32_t send_size;
    448  1.1  rjs 	u_int32_t overhead;
    449  1.1  rjs 	u_int32_t new_rwnd;
    450  1.1  rjs };
    451  1.1  rjs 
    452  1.1  rjs struct sctp_mbcnt_log {
    453  1.1  rjs 	u_int32_t total_queue_size;
    454  1.1  rjs 	u_int32_t size_change;
    455  1.1  rjs 	u_int32_t total_queue_mb_size;
    456  1.1  rjs 	u_int32_t mbcnt_change;
    457  1.1  rjs };
    458  1.1  rjs 
    459  1.1  rjs struct sctp_cwnd_log{
    460  1.1  rjs 	union {
    461  1.1  rjs 		struct sctp_blk_args blk;
    462  1.1  rjs 		struct sctp_cwnd_args cwnd;
    463  1.1  rjs 		struct sctp_str_log strlog;
    464  1.1  rjs 		struct sctp_fr_log fr;
    465  1.1  rjs 		struct sctp_fr_map map;
    466  1.1  rjs 		struct sctp_rwnd_log rwnd;
    467  1.1  rjs 		struct sctp_mbcnt_log mbcnt;
    468  1.1  rjs 	}x;
    469  1.1  rjs 	u_int8_t from;
    470  1.1  rjs 	u_int8_t event_type;
    471  1.1  rjs 
    472  1.1  rjs };
    473  1.1  rjs 
    474  1.1  rjs struct sctp_cwnd_log_req{
    475  1.1  rjs 	int num_in_log;     /* Number in log */
    476  1.1  rjs 	int num_ret;        /* Number returned */
    477  1.1  rjs 	int start_at;       /* start at this one */
    478  1.1  rjs 	int end_at;         /* end at this one */
    479  1.1  rjs 	struct sctp_cwnd_log log[0];
    480  1.1  rjs };
    481  1.1  rjs 
    482  1.1  rjs 
    483  1.1  rjs 
    484  1.1  rjs /*
    485  1.1  rjs  * API system calls
    486  1.1  rjs  */
    487  1.1  rjs #if !defined(_KERNEL)
    488  1.1  rjs 
    489  1.1  rjs __BEGIN_DECLS
    490  1.1  rjs int sctp_peeloff(int, sctp_assoc_t);
    491  1.1  rjs int	sctp_bindx(int, struct sockaddr *, int, int);
    492  1.1  rjs int     sctp_connectx(int, struct sockaddr *, int);
    493  1.1  rjs int	sctp_getpaddrs(int, sctp_assoc_t, struct sockaddr **);
    494  1.1  rjs void	sctp_freepaddrs(struct sockaddr *);
    495  1.1  rjs int	sctp_getladdrs(int, sctp_assoc_t, struct sockaddr **);
    496  1.1  rjs void	sctp_freeladdrs(struct sockaddr *);
    497  1.1  rjs int     sctp_opt_info(int, sctp_assoc_t, int, void *, socklen_t *);
    498  1.1  rjs 
    499  1.1  rjs ssize_t sctp_sendmsg(int, const void *, size_t,
    500  1.1  rjs 	const struct sockaddr *,
    501  1.1  rjs 	socklen_t, u_int32_t, u_int32_t, u_int16_t, u_int32_t, u_int32_t);
    502  1.1  rjs 
    503  1.1  rjs ssize_t sctp_send(int sd, const void *msg, size_t len,
    504  1.1  rjs 	const struct sctp_sndrcvinfo *sinfo,int flags);
    505  1.1  rjs 
    506  1.1  rjs ssize_t
    507  1.1  rjs sctp_sendx(int sd, const void *msg, size_t len,
    508  1.1  rjs 		struct sockaddr *addrs, int addrcnt,
    509  1.1  rjs 		struct sctp_sndrcvinfo *sinfo, int flags);
    510  1.1  rjs ssize_t
    511  1.1  rjs sctp_sendmsgx(int sd, const void *, size_t,
    512  1.1  rjs 	           struct sockaddr *, int,
    513  1.1  rjs 	           u_int32_t, u_int32_t, u_int16_t, u_int32_t, u_int32_t);
    514  1.1  rjs 
    515  1.1  rjs sctp_assoc_t
    516  1.1  rjs sctp_getassocid(int sd, struct sockaddr *sa);
    517  1.1  rjs 
    518  1.1  rjs ssize_t sctp_recvmsg(int, void *, size_t, struct sockaddr *,
    519  1.1  rjs         socklen_t *, struct sctp_sndrcvinfo *, int *);
    520  1.1  rjs 
    521  1.1  rjs __END_DECLS
    522  1.1  rjs 
    523  1.1  rjs #endif /* !_KERNEL */
    524  1.1  rjs #endif /* !__SCTP_UIO_H__ */
    525