From db7e3d51af08aef6e98b1bcbb567eca0f8869097 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Fri, 17 Feb 2023 18:38:54 +0000 Subject: [PATCH] freebsd further sctp support. --- libc-test/semver/freebsd.txt | 25 ++++++++++++++ src/unix/bsd/freebsdlike/freebsd/mod.rs | 46 +++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index f1ad283e68199..91b2ce33a5a56 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -1096,6 +1096,7 @@ SCTP_ADDR_MADE_PRIM SCTP_ADDR_REMOVED SCTP_ADDR_UNREACHABLE SCTP_ADDR_OVER +SCTP_ASCONF_SUPPORTED SCTP_ASSOCINFO SCTP_ASSOC_RESET_DENIED SCTP_ASSOC_RESET_FAILED @@ -1116,6 +1117,7 @@ SCTP_AUTH_KEY SCTP_AUTH_NEWKEY SCTP_AUTH_NEW_KEY SCTP_AUTH_NO_AUTH +SCTP_AUTH_SUPPORTED SCTP_AUTOCLOSE SCTP_AUTO_ASCONF SCTP_CANT_STR_ASSOC @@ -1126,25 +1128,34 @@ SCTP_CONTEXT SCTP_CURRENT_ASSOC SCTP_DATA_SENT SCTP_DATA_UNSENT +SCTP_DEFAULT_PRINFO SCTP_DEFAULT_SEND_PARAM +SCTP_DEFAULT_SNDINFO SCTP_DELAYED_SACK SCTP_DISABLE_FRAGMENTS SCTP_DSTADDRV4 SCTP_DSTADDRV6 +SCTP_ECN_SUPPORTED SCTP_EOF SCTP_EOR +SCTP_EVENT SCTP_EVENTS SCTP_EXPLICIT_EOR SCTP_EXTRCV SCTP_FRAGMENT_INTERLEAVE SCTP_FUTURE_ASSOC +SCTP_GET_ASSOC_ID_LIST +SCTP_GET_ASSOC_NUMBER +SCTP_GET_PEER_ADDR_INFO SCTP_HMAC_IDENT SCTP_INACTIVE SCTP_INIT SCTP_INITMSG SCTP_I_WANT_MAPPED_V4_ADDR +SCTP_LOCAL_AUTH_CHUNKS SCTP_MAXBURST SCTP_MAX_BURST +SCTP_MAX_CWND SCTP_MAXSEG SCTP_NEXT_MSG_AVAIL SCTP_NEXT_MSG_ISCOMPLETE @@ -1153,11 +1164,16 @@ SCTP_NEXT_MSG_IS_UNORDERED SCTP_NODELAY SCTP_NOTIFICATION SCTP_NO_NEXT_MSG +SCTP_NRSACK_SUPPORTED SCTP_NXTINFO SCTP_PARTIAL_DELIVERY_ABORTED SCTP_PARTIAL_DELIVERY_POINT SCTP_PEER_ADDR_PARAMS +SCTP_PEER_ADDR_THLDS +SCTP_PEER_AUTH_CHUNKS +SCTP_PKTDROP_SUPPORTED SCTP_PRIMARY_ADDR +SCTP_PR_ASSOC_STATUS SCTP_PR_SCTP_ALL SCTP_PR_SCTP_BUF SCTP_PR_SCTP_MAX @@ -1165,9 +1181,14 @@ SCTP_PR_SCTP_NONE SCTP_PR_SCTP_PRIO SCTP_PR_SCTP_RTX SCTP_PR_SCTP_TTL +SCTP_PR_STREAM_STATUS +SCTP_REMOTE_UDP_ENCAPS_PORT SCTP_RESTART SCTP_REUSE_PORT SCTP_PRINFO +SCTP_RECONFIG_SUPPORTED +SCTP_RECVNXTINFO +SCTP_RECVRCVINFO SCTP_RECVV_NOINFO SCTP_RECVV_NXTINFO SCTP_RECVV_RCVINFO @@ -1187,12 +1208,14 @@ SCTP_SET_PEER_PRIMARY_ADDR SCTP_SHUTDOWN_COMP SCTP_SNDINFO SCTP_SNDRCV +SCTP_STATUS SCTP_STREAM_CHANGE_DENIED SCTP_STREAM_CHANGE_FAILED SCTP_STREAM_RESET_DENIED SCTP_STREAM_RESET_FAILED SCTP_STREAM_RESET_INCOMING_SSN SCTP_STREAM_RESET_OUTGOING_SSN +SCTP_TIMEOUTS SCTP_UNCONFIRMED SCTP_UNORDERED SCTP_USE_EXT_RCVINFO @@ -2038,10 +2061,12 @@ sctp_pdapi_event sctp_peeloff sctp_prinfo sctp_rcvinfo +sctp_recvv sctp_recvv_rn sctp_remote_error sctp_sender_dry_event sctp_send_failed_event +sctp_sendv sctp_sendv_spa sctp_shutdown_event sctp_sndinfo diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index d1dcf46e102bf..2947528f78b5a 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -4586,6 +4586,30 @@ pub const SCTP_CONTEXT: ::c_int = 0x0000001a; pub const SCTP_EXPLICIT_EOR: ::c_int = 0x00000001b; pub const SCTP_REUSE_PORT: ::c_int = 0x00000001c; pub const SCTP_AUTH_DEACTIVATE_KEY: ::c_int = 0x00000001d; +pub const SCTP_EVENT: ::c_int = 0x0000001e; +pub const SCTP_RECVRCVINFO: ::c_int = 0x0000001f; +pub const SCTP_RECVNXTINFO: ::c_int = 0x00000020; +pub const SCTP_DEFAULT_SNDINFO: ::c_int = 0x00000021; +pub const SCTP_DEFAULT_PRINFO: ::c_int = 0x00000022; +pub const SCTP_PEER_ADDR_THLDS: ::c_int = 0x00000023; +pub const SCTP_REMOTE_UDP_ENCAPS_PORT: ::c_int = 0x00000024; +pub const SCTP_ECN_SUPPORTED: ::c_int = 0x00000025; +pub const SCTP_AUTH_SUPPORTED: ::c_int = 0x00000027; +pub const SCTP_ASCONF_SUPPORTED: ::c_int = 0x00000028; +pub const SCTP_RECONFIG_SUPPORTED: ::c_int = 0x00000029; +pub const SCTP_NRSACK_SUPPORTED: ::c_int = 0x00000030; +pub const SCTP_PKTDROP_SUPPORTED: ::c_int = 0x00000031; +pub const SCTP_MAX_CWND: ::c_int = 0x00000032; + +pub const SCTP_STATUS: ::c_int = 0x00000100; +pub const SCTP_GET_PEER_ADDR_INFO: ::c_int = 0x00000101; +pub const SCTP_PEER_AUTH_CHUNKS: ::c_int = 0x00000102; +pub const SCTP_LOCAL_AUTH_CHUNKS: ::c_int = 0x00000103; +pub const SCTP_GET_ASSOC_NUMBER: ::c_int = 0x00000104; +pub const SCTP_GET_ASSOC_ID_LIST: ::c_int = 0x00000105; +pub const SCTP_TIMEOUTS: ::c_int = 0x00000106; +pub const SCTP_PR_STREAM_STATUS: ::c_int = 0x00000107; +pub const SCTP_PR_ASSOC_STATUS: ::c_int = 0x00000108; pub const SCTP_COMM_UP: ::c_int = 0x0001; pub const SCTP_COMM_LOST: ::c_int = 0x0002; @@ -5311,6 +5335,28 @@ extern "C" { arg: *mut ::c_void, size: *mut ::socklen_t, ) -> ::c_int; + pub fn sctp_sendv( + sd: ::c_int, + iov: *const ::iovec, + iovcnt: ::c_int, + addrs: *mut ::sockaddr, + addrcnt: ::c_int, + info: *mut ::c_void, + infolen: ::socklen_t, + infotype: ::c_uint, + flags: ::c_int, + ) -> ::ssize_t; + pub fn sctp_recvv( + sd: ::c_int, + iov: *const ::iovec, + iovcnt: ::c_int, + from: *mut ::sockaddr, + fromlen: *mut ::socklen_t, + info: *mut ::c_void, + infolen: *mut ::socklen_t, + infotype: *mut ::c_uint, + flags: *mut ::c_int, + ) -> ::ssize_t; } #[link(name = "memstat")]