2 * Copyright (c) 2001-2006, Cisco Systems, Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
7 * a) Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.
10 * b) Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the distribution.
14 * c) Neither the name of Cisco Systems, Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived
16 * from this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
31 /* $KAME: sctp_uio.h,v 1.11 2005/03/06 16:04:18 itojun Exp $ */
32 #include <sys/cdefs.h>
33 __FBSDID("$FreeBSD$");
35 #ifndef __sctp_uio_h__
36 #define __sctp_uio_h__
41 #if ! defined(_KERNEL)
44 #include <sys/types.h>
45 #include <sys/socket.h>
46 #include <netinet/in.h>
48 typedef uint32_t sctp_assoc_t;
50 /* On/Off setup for subscription to events */
51 struct sctp_event_subscribe {
52 uint8_t sctp_data_io_event;
53 uint8_t sctp_association_event;
54 uint8_t sctp_address_event;
55 uint8_t sctp_send_failure_event;
56 uint8_t sctp_peer_error_event;
57 uint8_t sctp_shutdown_event;
58 uint8_t sctp_partial_delivery_event;
59 uint8_t sctp_adaptation_layer_event;
60 uint8_t sctp_authentication_event;
61 uint8_t sctp_stream_reset_events;
64 /* ancillary data types */
65 #define SCTP_INIT 0x0001
66 #define SCTP_SNDRCV 0x0002
67 #define SCTP_EXTRCV 0x0003
69 * ancillary data structures
72 uint32_t sinit_num_ostreams;
73 uint32_t sinit_max_instreams;
74 uint16_t sinit_max_attempts;
75 uint16_t sinit_max_init_timeo;
78 /* We add 96 bytes to the size of sctp_sndrcvinfo.
79 * This makes the current structure 128 bytes long
80 * which is nicely 64 bit aligned but also has room
81 * for us to add more and keep ABI compatability.
82 * For example, already we have the sctp_extrcvinfo
83 * when enabled which is 48 bytes.
86 #define SCTP_ALIGN_RESV_PAD 96
88 struct sctp_sndrcvinfo {
89 uint16_t sinfo_stream;
93 uint32_t sinfo_context;
94 uint32_t sinfo_timetolive;
96 uint32_t sinfo_cumtsn;
97 sctp_assoc_t sinfo_assoc_id;
98 uint8_t __reserve_pad[SCTP_ALIGN_RESV_PAD];
101 struct sctp_extrcvinfo {
102 uint16_t sinfo_stream;
104 uint16_t sinfo_flags;
106 uint32_t sinfo_context;
107 uint32_t sinfo_timetolive;
109 uint32_t sinfo_cumtsn;
110 sctp_assoc_t sinfo_assoc_id;
112 uint16_t next_stream;
113 uint32_t next_asocid;
114 uint32_t next_length;
118 #define SCTP_NO_NEXT_MSG 0x0000
119 #define SCTP_NEXT_MSG_AVAIL 0x0001
120 #define SCTP_NEXT_MSG_ISCOMPLETE 0x0002
121 #define SCTP_NEXT_MSG_IS_UNORDERED 0x0004
123 struct sctp_snd_all_completes {
124 uint16_t sall_stream;
127 uint32_t sall_context;
128 uint32_t sall_num_sent;
129 uint32_t sall_num_failed;
132 /* Flags that go into the sinfo->sinfo_flags field */
133 #define SCTP_EOF 0x0100/* Start shutdown procedures */
134 #define SCTP_ABORT 0x0200/* Send an ABORT to peer */
135 #define SCTP_UNORDERED 0x0400/* Message is un-ordered */
136 #define SCTP_ADDR_OVER 0x0800/* Override the primary-address */
137 #define SCTP_SENDALL 0x1000/* Send this on all associations */
138 #define SCTP_EOR 0x2000/* end of message signal */
139 /* for the endpoint */
141 /* The lower byte is an enumeration of PR-SCTP policies */
142 #define SCTP_PR_SCTP_TTL 0x0001/* Time based PR-SCTP */
143 #define SCTP_PR_SCTP_BUF 0x0002/* Buffer based PR-SCTP */
144 #define SCTP_PR_SCTP_RTX 0x0003/* Number of retransmissions based PR-SCTP */
146 #define PR_SCTP_POLICY(x) ((x) & 0xff)
147 #define PR_SCTP_ENABLED(x) (PR_SCTP_POLICY(x) != 0)
148 #define PR_SCTP_TTL_ENABLED(x) (PR_SCTP_POLICY(x) == SCTP_PR_SCTP_TTL)
149 #define PR_SCTP_BUF_ENABLED(x) (PR_SCTP_POLICY(x) == SCTP_PR_SCTP_BUF)
150 #define PR_SCTP_RTX_ENABLED(x) (PR_SCTP_POLICY(x) == SCTP_PR_SCTP_RTX)
153 struct sctp_pcbinfo {
156 uint32_t laddr_count;
157 uint32_t raddr_count;
159 uint32_t readq_count;
160 uint32_t free_chunks;
161 uint32_t stream_oque;
164 struct sctp_sockstat {
165 sctp_assoc_t ss_assoc_id;
166 uint32_t ss_total_sndbuf;
167 uint32_t ss_total_recv_buf;
171 * notification event structures
175 * association change event
177 struct sctp_assoc_change {
183 uint16_t sac_outbound_streams;
184 uint16_t sac_inbound_streams;
185 sctp_assoc_t sac_assoc_id;
188 /* sac_state values */
189 #define SCTP_COMM_UP 0x0001
190 #define SCTP_COMM_LOST 0x0002
191 #define SCTP_RESTART 0x0003
192 #define SCTP_SHUTDOWN_COMP 0x0004
193 #define SCTP_CANT_STR_ASSOC 0x0005
199 struct sctp_paddr_change {
203 struct sockaddr_storage spc_aaddr;
206 sctp_assoc_t spc_assoc_id;
209 /* paddr state values */
210 #define SCTP_ADDR_AVAILABLE 0x0001
211 #define SCTP_ADDR_UNREACHABLE 0x0002
212 #define SCTP_ADDR_REMOVED 0x0003
213 #define SCTP_ADDR_ADDED 0x0004
214 #define SCTP_ADDR_MADE_PRIM 0x0005
215 #define SCTP_ADDR_CONFIRMED 0x0006
218 * CAUTION: these are user exposed SCTP addr reachability states must be
219 * compatible with SCTP_ADDR states in sctp_constants.h
224 #define SCTP_ACTIVE 0x0001 /* SCTP_ADDR_REACHABLE */
229 #define SCTP_INACTIVE 0x0002 /* SCTP_ADDR_NOT_REACHABLE */
231 #ifdef SCTP_UNCONFIRMED
232 #undef SCTP_UNCONFIRMED
234 #define SCTP_UNCONFIRMED 0x0200 /* SCTP_ADDR_UNCONFIRMED */
236 #ifdef SCTP_NOHEARTBEAT
237 #undef SCTP_NOHEARTBEAT
239 #define SCTP_NOHEARTBEAT 0x0040 /* SCTP_ADDR_NOHB */
242 /* remote error events */
243 struct sctp_remote_error {
248 sctp_assoc_t sre_assoc_id;
252 /* data send failure event */
253 struct sctp_send_failed {
258 struct sctp_sndrcvinfo ssf_info;
259 sctp_assoc_t ssf_assoc_id;
263 /* flag that indicates state of data */
264 #define SCTP_DATA_UNSENT 0x0001 /* inqueue never on wire */
265 #define SCTP_DATA_SENT 0x0002 /* on wire at failure */
268 struct sctp_shutdown_event {
272 sctp_assoc_t sse_assoc_id;
275 /* Adaptation layer indication stuff */
276 struct sctp_adaptation_event {
280 uint32_t sai_adaptation_ind;
281 sctp_assoc_t sai_assoc_id;
284 struct sctp_setadaptation {
285 uint32_t ssb_adaptation_ind;
288 /* compatable old spelling */
289 struct sctp_adaption_event {
293 uint32_t sai_adaption_ind;
294 sctp_assoc_t sai_assoc_id;
297 struct sctp_setadaption {
298 uint32_t ssb_adaption_ind;
303 * Partial Delivery API event
305 struct sctp_pdapi_event {
307 uint16_t pdapi_flags;
308 uint32_t pdapi_length;
309 uint32_t pdapi_indication;
310 sctp_assoc_t pdapi_assoc_id;
313 /* indication values */
314 #define SCTP_PARTIAL_DELIVERY_ABORTED 0x0001
318 * authentication key event
320 struct sctp_authkey_event {
323 uint32_t auth_length;
324 uint16_t auth_keynumber;
325 uint16_t auth_altkeynumber;
326 uint32_t auth_indication;
327 sctp_assoc_t auth_assoc_id;
330 /* indication values */
331 #define SCTP_AUTH_NEWKEY 0x0001
337 struct sctp_stream_reset_event {
338 uint16_t strreset_type;
339 uint16_t strreset_flags;
340 uint32_t strreset_length;
341 sctp_assoc_t strreset_assoc_id;
342 uint16_t strreset_list[0];
345 /* flags in strreset_flags field */
346 #define SCTP_STRRESET_INBOUND_STR 0x0001
347 #define SCTP_STRRESET_OUTBOUND_STR 0x0002
348 #define SCTP_STRRESET_ALL_STREAMS 0x0004
349 #define SCTP_STRRESET_STREAM_LIST 0x0008
350 #define SCTP_STRRESET_FAILED 0x0010
353 /* SCTP notification event */
360 union sctp_notification {
361 struct sctp_tlv sn_header;
362 struct sctp_assoc_change sn_assoc_change;
363 struct sctp_paddr_change sn_paddr_change;
364 struct sctp_remote_error sn_remote_error;
365 struct sctp_send_failed sn_send_failed;
366 struct sctp_shutdown_event sn_shutdown_event;
367 struct sctp_adaptation_event sn_adaptation_event;
368 /* compatability same as above */
369 struct sctp_adaption_event sn_adaption_event;
370 struct sctp_pdapi_event sn_pdapi_event;
371 struct sctp_authkey_event sn_auth_event;
372 struct sctp_stream_reset_event sn_strreset_event;
375 /* notification types */
376 #define SCTP_ASSOC_CHANGE 0x0001
377 #define SCTP_PEER_ADDR_CHANGE 0x0002
378 #define SCTP_REMOTE_ERROR 0x0003
379 #define SCTP_SEND_FAILED 0x0004
380 #define SCTP_SHUTDOWN_EVENT 0x0005
381 #define SCTP_ADAPTATION_INDICATION 0x0006
383 #define SCTP_ADAPTION_INDICATION 0x0006
384 #define SCTP_PARTIAL_DELIVERY_EVENT 0x0007
385 #define SCTP_AUTHENTICATION_EVENT 0x0008
386 #define SCTP_STREAM_RESET_EVENT 0x0009
390 * socket option structs
393 struct sctp_paddrparams {
394 sctp_assoc_t spp_assoc_id;
395 struct sockaddr_storage spp_address;
396 uint32_t spp_hbinterval;
397 uint16_t spp_pathmaxrxt;
398 uint32_t spp_pathmtu;
399 uint32_t spp_sackdelay;
401 uint32_t spp_ipv6_flowlabel;
402 uint8_t spp_ipv4_tos;
406 #define SPP_HB_ENABLE 0x00000001
407 #define SPP_HB_DISABLE 0x00000002
408 #define SPP_HB_DEMAND 0x00000004
409 #define SPP_PMTUD_ENABLE 0x00000008
410 #define SPP_PMTUD_DISABLE 0x00000010
411 #define SPP_SACKDELAY_ENABLE 0x00000020
412 #define SPP_SACKDELAY_DISABLE 0x00000040
413 #define SPP_HB_TIME_IS_ZERO 0x00000080
414 #define SPP_IPV6_FLOWLABEL 0x00000100
415 #define SPP_IPV4_TOS 0x00000200
417 struct sctp_paddrinfo {
418 sctp_assoc_t spinfo_assoc_id;
419 struct sockaddr_storage spinfo_address;
420 int32_t spinfo_state;
421 uint32_t spinfo_cwnd;
422 uint32_t spinfo_srtt;
427 struct sctp_rtoinfo {
428 sctp_assoc_t srto_assoc_id;
429 uint32_t srto_initial;
434 struct sctp_assocparams {
435 sctp_assoc_t sasoc_assoc_id;
436 uint16_t sasoc_asocmaxrxt;
437 uint16_t sasoc_number_peer_destinations;
438 uint32_t sasoc_peer_rwnd;
439 uint32_t sasoc_local_rwnd;
440 uint32_t sasoc_cookie_life;
443 struct sctp_setprim {
444 sctp_assoc_t ssp_assoc_id;
445 struct sockaddr_storage ssp_addr;
448 struct sctp_setpeerprim {
449 sctp_assoc_t sspp_assoc_id;
450 struct sockaddr_storage sspp_addr;
453 struct sctp_getaddresses {
454 sctp_assoc_t sget_assoc_id;
455 /* addr is filled in for N * sockaddr_storage */
456 struct sockaddr addr[1];
459 struct sctp_setstrm_timeout {
460 sctp_assoc_t ssto_assoc_id;
461 uint32_t ssto_timeout;
462 uint32_t ssto_streamid_start;
463 uint32_t ssto_streamid_end;
467 sctp_assoc_t sstat_assoc_id;
470 uint16_t sstat_unackdata;
471 uint16_t sstat_penddata;
472 uint16_t sstat_instrms;
473 uint16_t sstat_outstrms;
474 uint32_t sstat_fragmentation_point;
475 struct sctp_paddrinfo sstat_primary;
479 * AUTHENTICATION support
481 /* SCTP_AUTH_CHUNK */
482 struct sctp_authchunk {
487 struct sctp_authkey {
488 sctp_assoc_t sca_assoc_id;
489 uint16_t sca_keynumber;
493 /* SCTP_HMAC_IDENT */
494 struct sctp_hmacalgo {
495 uint16_t shmac_idents[0];
499 #define SCTP_AUTH_HMAC_ID_RSVD 0x0000
500 #define SCTP_AUTH_HMAC_ID_SHA1 0x0001 /* default, mandatory */
501 #define SCTP_AUTH_HMAC_ID_MD5 0x0002 /* deprecated */
502 #define SCTP_AUTH_HMAC_ID_SHA256 0x0003
503 #define SCTP_AUTH_HMAC_ID_SHA224 0x8001
504 #define SCTP_AUTH_HMAC_ID_SHA384 0x8002
505 #define SCTP_AUTH_HMAC_ID_SHA512 0x8003
508 /* SCTP_AUTH_ACTIVE_KEY / SCTP_AUTH_DELETE_KEY */
509 struct sctp_authkeyid {
510 sctp_assoc_t scact_assoc_id;
511 uint16_t scact_keynumber;
514 /* SCTP_PEER_AUTH_CHUNKS / SCTP_LOCAL_AUTH_CHUNKS */
515 struct sctp_authchunks {
516 sctp_assoc_t gauth_assoc_id;
517 uint8_t gauth_chunks[0];
520 struct sctp_assoc_value {
521 sctp_assoc_t assoc_id;
522 uint32_t assoc_value;
525 #define MAX_ASOC_IDS_RET 255
526 struct sctp_assoc_ids {
527 uint16_t asls_assoc_start; /* array of index's start at 0 */
528 uint8_t asls_numb_present;
529 uint8_t asls_more_to_get;
530 sctp_assoc_t asls_assoc_id[MAX_ASOC_IDS_RET];
533 struct sctp_cwnd_args {
534 struct sctp_nets *net; /* network to */
535 uint32_t cwnd_new_value;/* cwnd in k */
536 uint32_t inflight; /* flightsize in k */
537 uint32_t pseudo_cumack;
538 int cwnd_augment; /* increment to it */
539 uint8_t meets_pseudo_cumack;
540 uint8_t need_new_pseudo_cumack;
545 struct sctp_blk_args {
546 uint32_t onsb; /* in 1k bytes */
547 uint32_t sndlen; /* len of send being attempted */
548 uint32_t peer_rwnd; /* rwnd of peer */
549 uint16_t send_sent_qcnt;/* chnk cnt */
550 uint16_t stream_qcnt; /* chnk cnt */
551 uint16_t chunks_on_oque;/* chunks out */
552 uint16_t flight_size; /* flight size in k */
556 * Max we can reset in one setting, note this is dictated not by the define
557 * but the size of a mbuf cluster so don't change this define and think you
558 * can specify more. You must do multiple resets if you want to reset more
559 * than SCTP_MAX_EXPLICIT_STR_RESET.
561 #define SCTP_MAX_EXPLICT_STR_RESET 1000
563 #define SCTP_RESET_LOCAL_RECV 0x0001
564 #define SCTP_RESET_LOCAL_SEND 0x0002
565 #define SCTP_RESET_BOTH 0x0003
566 #define SCTP_RESET_TSN 0x0004
568 struct sctp_stream_reset {
569 sctp_assoc_t strrst_assoc_id;
570 uint16_t strrst_flags;
571 uint16_t strrst_num_streams; /* 0 == ALL */
572 uint16_t strrst_list[0];/* list if strrst_num_streams is not 0 */
576 struct sctp_get_nonce_values {
577 sctp_assoc_t gn_assoc_id;
578 uint32_t gn_peers_tag;
579 uint32_t gn_local_tag;
583 struct sctp_str_log {
600 uint32_t largest_tsn;
601 uint32_t largest_new_tsn;
611 struct sctp_rwnd_log {
618 struct sctp_mbcnt_log {
619 uint32_t total_queue_size;
620 uint32_t size_change;
621 uint32_t total_queue_mb_size;
622 uint32_t mbcnt_change;
625 struct sctp_sack_log {
633 struct sctp_lock_log {
640 uint8_t sockrcvbuf_lock;
641 uint8_t socksndbuf_lock;
646 struct sctp_rto_log {
653 struct sctp_nagle_log {
655 uint32_t total_flight;
656 uint32_t total_in_queue;
657 uint16_t count_in_queue;
658 uint16_t count_in_flight;
661 struct sctp_sbwake_log {
667 uint8_t stream_qcnt; /* chnk cnt */
668 uint8_t chunks_on_oque; /* chunks out */
673 struct sctp_misc_info {
680 struct sctp_log_closing {
688 struct sctp_mbuf_log {
697 struct sctp_cwnd_log {
703 struct sctp_log_closing close;
704 struct sctp_blk_args blk;
705 struct sctp_cwnd_args cwnd;
706 struct sctp_str_log strlog;
707 struct sctp_fr_log fr;
708 struct sctp_fr_map map;
709 struct sctp_rwnd_log rwnd;
710 struct sctp_mbcnt_log mbcnt;
711 struct sctp_sack_log sack;
712 struct sctp_lock_log lock;
713 struct sctp_rto_log rto;
714 struct sctp_sb_log sb;
715 struct sctp_nagle_log nagle;
716 struct sctp_sbwake_log wake;
717 struct sctp_mbuf_log mb;
718 struct sctp_misc_info misc;
722 struct sctp_cwnd_log_req {
723 int num_in_log; /* Number in log */
724 int num_ret; /* Number returned */
725 int start_at; /* start at this one */
726 int end_at; /* end at this one */
727 struct sctp_cwnd_log log[0];
731 /* MIB according to RFC 3873 */
732 u_long sctps_currestab; /* sctpStats 1 (Gauge32) */
733 u_long sctps_activeestab; /* sctpStats 2 (Counter32) */
734 u_long sctps_passiveestab; /* sctpStats 3 (Counter32) */
735 u_long sctps_aborted; /* sctpStats 4 (Counter32) */
736 u_long sctps_shutdown; /* sctpStats 5 (Counter32) */
737 u_long sctps_outoftheblue; /* sctpStats 6 (Counter32) */
738 u_long sctps_checksumerrors; /* sctpStats 7 (Counter32) */
739 u_long sctps_outcontrolchunks; /* sctpStats 8 (Counter64) */
740 u_long sctps_outorderchunks; /* sctpStats 9 (Counter64) */
741 u_long sctps_outunorderchunks; /* sctpStats 10 (Counter64) */
742 u_long sctps_incontrolchunks; /* sctpStats 11 (Counter64) */
743 u_long sctps_inorderchunks; /* sctpStats 12 (Counter64) */
744 u_long sctps_inunorderchunks; /* sctpStats 13 (Counter64) */
745 u_long sctps_fragusrmsgs; /* sctpStats 14 (Counter64) */
746 u_long sctps_reasmusrmsgs; /* sctpStats 15 (Counter64) */
747 u_long sctps_outpackets;/* sctpStats 16 (Counter64) */
748 u_long sctps_inpackets; /* sctpStats 17 (Counter64) */
749 u_long sctps_discontinuitytime; /* sctpStats 18 (TimeStamp) */
750 /* input statistics: */
751 u_long sctps_recvpackets; /* total input packets */
752 u_long sctps_recvdatagrams; /* total input datagrams */
753 u_long sctps_recvpktwithdata;
754 u_long sctps_recvsacks; /* total input SACK chunks */
755 u_long sctps_recvdata; /* total input DATA chunks */
756 u_long sctps_recvdupdata; /* total input duplicate DATA chunks */
757 u_long sctps_recvheartbeat; /* total input HB chunks */
758 u_long sctps_recvheartbeatack; /* total input HB-ACK chunks */
759 u_long sctps_recvecne; /* total input ECNE chunks */
760 u_long sctps_recvauth; /* total input AUTH chunks */
761 u_long sctps_recvauthmissing; /* total input chunks missing AUTH */
762 u_long sctps_recvivalhmacid; /* total number of invalid HMAC ids
764 u_long sctps_recvivalkeyid; /* total number of invalid secret ids
766 u_long sctps_recvauthfailed; /* total number of auth failed */
767 u_long sctps_recvexpress; /* total fast path receives all one
769 u_long sctps_recvexpressm; /* total fast path multi-part data */
770 /* output statistics: */
771 u_long sctps_sendpackets; /* total output packets */
772 u_long sctps_sendsacks; /* total output SACKs */
773 u_long sctps_senddata; /* total output DATA chunks */
774 u_long sctps_sendretransdata; /* total output retransmitted DATA
776 u_long sctps_sendfastretrans; /* total output fast retransmitted
778 u_long sctps_sendmultfastretrans; /* U-del */
779 u_long sctps_sendheartbeat; /* total output HB chunks */
780 u_long sctps_sendecne; /* total output ECNE chunks */
781 u_long sctps_sendauth; /* total output AUTH chunks FIXME */
782 u_long sctps_senderrors;/* ip_output error counter */
783 /* PCKDROPREP statistics: */
784 u_long sctps_pdrpfmbox; /* */
785 u_long sctps_pdrpfehos; /* */
786 u_long sctps_pdrpmbda; /* */
787 u_long sctps_pdrpmbct; /* */
788 u_long sctps_pdrpbwrpt; /* */
789 u_long sctps_pdrpcrupt; /* */
790 u_long sctps_pdrpnedat; /* */
791 u_long sctps_pdrppdbrk; /* */
792 u_long sctps_pdrptsnnf; /* */
793 u_long sctps_pdrpdnfnd; /* */
794 u_long sctps_pdrpdiwnp; /* */
795 u_long sctps_pdrpdizrw; /* */
796 u_long sctps_pdrpbadd; /* */
797 u_long sctps_pdrpmark; /* */
799 u_long sctps_timoiterator; /* */
800 u_long sctps_timodata; /* */
801 u_long sctps_timowindowprobe; /* */
802 u_long sctps_timoinit; /* */
803 u_long sctps_timosack; /* */
804 u_long sctps_timoshutdown; /* */
805 u_long sctps_timoheartbeat; /* */
806 u_long sctps_timocookie;/* */
807 u_long sctps_timosecret;/* */
808 u_long sctps_timopathmtu; /* */
809 u_long sctps_timoshutdownack; /* */
810 u_long sctps_timoshutdownguard; /* */
811 u_long sctps_timostrmrst; /* */
812 u_long sctps_timoearlyfr; /* */
813 u_long sctps_timoasconf;/* */
814 u_long sctps_timoautoclose; /* */
815 u_long sctps_timoassockill; /* */
816 u_long sctps_timoinpkill; /* */
817 /* Early fast retransmission counters */
818 u_long sctps_earlyfrstart;
819 u_long sctps_earlyfrstop;
820 u_long sctps_earlyfrmrkretrans;
821 u_long sctps_earlyfrstpout;
822 u_long sctps_earlyfrstpidsck1;
823 u_long sctps_earlyfrstpidsck2;
824 u_long sctps_earlyfrstpidsck3;
825 u_long sctps_earlyfrstpidsck4;
826 u_long sctps_earlyfrstrid;
827 u_long sctps_earlyfrstrout;
828 u_long sctps_earlyfrstrtmr;
830 u_long sctps_hdrops; /* packet shorter than header */
831 u_long sctps_badsum; /* checksum error */
832 u_long sctps_noport; /* no endpoint for port */
833 u_long sctps_badvtag; /* bad v-tag */
834 u_long sctps_badsid; /* bad SID */
835 u_long sctps_nomem; /* no memory */
836 u_long sctps_fastretransinrtt; /* number of multiple FR in a RTT
838 u_long sctps_markedretrans;
839 u_long sctps_naglesent; /* nagle allowed sending */
840 u_long sctps_naglequeued; /* nagle does't allow sending */
841 u_long sctps_maxburstqueued; /* max burst dosn't allow sending */
842 u_long sctps_ifnomemqueued; /* */
843 u_long sctps_windowprobed; /* total number of window probes sent */
844 u_long sctps_lowlevelerr;
845 u_long sctps_lowlevelerrusr;
846 u_long sctps_datadropchklmt;
847 u_long sctps_datadroprwnd;
848 u_long sctps_ecnereducedcwnd;
849 u_long sctps_vtagexpress; /* Used express lookup via vtag */
850 u_long sctps_vtagbogus; /* Collision in express lookup. */
851 u_long sctps_primary_randry; /* Number of times the sender ran dry
852 * of user data on primary */
853 u_long sctps_cmt_randry;/* Same for above */
854 u_long sctps_slowpath_sack; /* Sacks the slow way */
855 u_long sctps_wu_sacks_sent; /* Window Update only sacks sent */
856 u_long sctps_locks_in_rcv; /* How man so_rcv buf locks we did */
857 u_long sctps_locks_in_rcva; /* How man so_rcv buf locks we did */
858 u_long sctps_locks_in_rcvb; /* How man so_rcv buf locks we did */
859 u_long sctps_locks_in_rcvc; /* How man so_rcv buf locks we did */
860 u_long sctps_locks_in_rcvd; /* How man so_rcv buf locks we did */
861 u_long sctps_locks_in_rcve; /* How man so_rcv buf locks we did */
862 u_long sctps_locks_in_rcvf; /* How man so_rcv buf locks we did */
865 #define SCTP_STAT_INCR(_x) SCTP_STAT_INCR_BY(_x,1)
866 #define SCTP_STAT_DECR(_x) SCTP_STAT_DECR_BY(_x,1)
867 #define SCTP_STAT_INCR_BY(_x,_d) atomic_add_long(&sctpstat._x, _d)
868 #define SCTP_STAT_DECR_BY(_x,_d) atomic_add_long(&sctpstat._x, -(_d))
869 /* The following macros are for handling MIB values, */
870 #define SCTP_STAT_INCR_COUNTER32(_x) SCTP_STAT_INCR(_x)
871 #define SCTP_STAT_INCR_COUNTER64(_x) SCTP_STAT_INCR(_x)
872 #define SCTP_STAT_INCR_GAUGE32(_x) SCTP_STAT_INCR(_x)
873 #define SCTP_STAT_DECR_COUNTER32(_x) SCTP_STAT_DECR(_x)
874 #define SCTP_STAT_DECR_COUNTER64(_x) SCTP_STAT_DECR(_x)
875 #define SCTP_STAT_DECR_GAUGE32(_x) SCTP_STAT_DECR(_x)
877 union sctp_sockstore {
879 struct sockaddr_in sin;
882 struct sockaddr_in6 sin6;
889 * Kernel defined for sctp_send
893 sctp_lower_sosend(struct socket *so,
894 struct sockaddr *addr,
897 struct mbuf *control,
900 struct sctp_sndrcvinfo *srcv,
905 sctp_sorecvmsg(struct socket *so,
908 struct sockaddr *from,
911 struct sctp_sndrcvinfo *sinfo,
921 #if !(defined(_KERNEL))
924 int sctp_peeloff __P((int, sctp_assoc_t));
925 int sctp_bindx __P((int, struct sockaddr *, int, int));
926 int sctp_connectx __P((int, const struct sockaddr *, int));
927 int sctp_getaddrlen __P((sa_family_t));
928 int sctp_getpaddrs __P((int, sctp_assoc_t, struct sockaddr **));
929 void sctp_freepaddrs __P((struct sockaddr *));
930 int sctp_getladdrs __P((int, sctp_assoc_t, struct sockaddr **));
931 void sctp_freeladdrs __P((struct sockaddr *));
932 int sctp_opt_info __P((int, sctp_assoc_t, int, void *, socklen_t *));
935 __P((int, const void *, size_t,
936 const struct sockaddr *,
937 socklen_t, uint32_t, uint32_t, uint16_t, uint32_t, uint32_t));
939 ssize_t sctp_send __P((int sd, const void *msg, size_t len,
940 const struct sctp_sndrcvinfo *sinfo, int flags));
943 sctp_sendx __P((int sd, const void *msg, size_t len,
944 struct sockaddr *addrs, int addrcnt,
945 struct sctp_sndrcvinfo *sinfo, int flags));
947 sctp_sendmsgx __P((int sd, const void *, size_t,
948 struct sockaddr *, int,
949 uint32_t, uint32_t, uint16_t, uint32_t, uint32_t));
952 sctp_getassocid __P((int sd, struct sockaddr *sa));
954 ssize_t sctp_recvmsg __P((int, void *, size_t, struct sockaddr *,
955 socklen_t *, struct sctp_sndrcvinfo *, int *));
959 #endif /* !_KERNEL */
960 #endif /* !__sctp_uio_h__ */