diff options
author | bors <bors@rust-lang.org> | 2023-02-14 07:05:14 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2023-02-14 07:05:14 +0000 |
commit | 78d774fbc1c256d6cfae8ea71082b4dc68724634 (patch) | |
tree | dbf5c59ee73120d8ed37af57619fc3b756b56938 | |
parent | 35ad929840e17037660403b3ed170cf5fcafa69e (diff) | |
parent | 4bda84f158f169cb5ff3af20f96c29c2c5ba3148 (diff) | |
download | rust-libc-78d774fbc1c256d6cfae8ea71082b4dc68724634.tar.gz |
Auto merge of #3118 - devnexen:fbsd_sctp3, r=JohnTitor
freebsd sctp support part 3
-rw-r--r-- | libc-test/build.rs | 7 | ||||
-rw-r--r-- | libc-test/semver/freebsd.txt | 47 | ||||
-rw-r--r-- | src/unix/bsd/freebsdlike/freebsd/mod.rs | 140 |
3 files changed, 193 insertions, 1 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs index 7ef89cd52e..ea7db1a503 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2299,7 +2299,12 @@ fn test_freebsd(target: &str) { "memory_type" => true, "memory_type_list" => true, "pidfh" => true, - "sctp_gen_error_cause" | "sctp_error_missing_param" => true, + "sctp_gen_error_cause" + | "sctp_error_missing_param" + | "sctp_remote_error" + | "sctp_assoc_change" + | "sctp_send_failed_event" + | "sctp_stream_reset_event" => true, _ => false, } diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index c432244327..f1ad283e68 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -1085,22 +1085,47 @@ SCHED_RR SCM_CREDS SCM_RIGHTS SCM_TIMESTAMP +SCTP_ACTIVE SCTP_ALL_ASSOC SCTP_ADAPTATION_LAYER SCTP_ADAPTION_LAYER +SCTP_ADDR_ADDED +SCTP_ADDR_AVAILABLE +SCTP_ADDR_CONFIRMED +SCTP_ADDR_MADE_PRIM +SCTP_ADDR_REMOVED +SCTP_ADDR_UNREACHABLE SCTP_ADDR_OVER SCTP_ASSOCINFO +SCTP_ASSOC_RESET_DENIED +SCTP_ASSOC_RESET_FAILED +SCTP_ASSOC_SUPPORTS_ASCONF +SCTP_ASSOC_SUPPORTS_AUTH +SCTP_ASSOC_SUPPORTS_INTERLEAVING +SCTP_ASSOC_SUPPORTS_MAX +SCTP_ASSOC_SUPPORTS_MULTIBUF +SCTP_ASSOC_SUPPORTS_PR +SCTP_ASSOC_SUPPORTS_RE_CONFIG SCTP_AUTHINFO SCTP_AUTH_CHUNK SCTP_AUTH_ACTIVE_KEY SCTP_AUTH_DEACTIVATE_KEY SCTP_AUTH_DELETE_KEY +SCTP_AUTH_FREE_KEY SCTP_AUTH_KEY +SCTP_AUTH_NEWKEY +SCTP_AUTH_NEW_KEY +SCTP_AUTH_NO_AUTH SCTP_AUTOCLOSE SCTP_AUTO_ASCONF +SCTP_CANT_STR_ASSOC +SCTP_COMM_LOST +SCTP_COMM_UP SCTP_COMPLETE SCTP_CONTEXT SCTP_CURRENT_ASSOC +SCTP_DATA_SENT +SCTP_DATA_UNSENT SCTP_DEFAULT_SEND_PARAM SCTP_DELAYED_SACK SCTP_DISABLE_FRAGMENTS @@ -1114,6 +1139,7 @@ SCTP_EXTRCV SCTP_FRAGMENT_INTERLEAVE SCTP_FUTURE_ASSOC SCTP_HMAC_IDENT +SCTP_INACTIVE SCTP_INIT SCTP_INITMSG SCTP_I_WANT_MAPPED_V4_ADDR @@ -1128,6 +1154,7 @@ SCTP_NODELAY SCTP_NOTIFICATION SCTP_NO_NEXT_MSG SCTP_NXTINFO +SCTP_PARTIAL_DELIVERY_ABORTED SCTP_PARTIAL_DELIVERY_POINT SCTP_PEER_ADDR_PARAMS SCTP_PRIMARY_ADDR @@ -1138,6 +1165,7 @@ SCTP_PR_SCTP_NONE SCTP_PR_SCTP_PRIO SCTP_PR_SCTP_RTX SCTP_PR_SCTP_TTL +SCTP_RESTART SCTP_REUSE_PORT SCTP_PRINFO SCTP_RECVV_NOINFO @@ -1156,8 +1184,16 @@ SCTP_SEND_AUTHINFO_VALID SCTP_SEND_PRINFO_VALID SCTP_SEND_SNDINFO_VALID SCTP_SET_PEER_PRIMARY_ADDR +SCTP_SHUTDOWN_COMP SCTP_SNDINFO SCTP_SNDRCV +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_UNCONFIRMED SCTP_UNORDERED SCTP_USE_EXT_RCVINFO SEEK_DATA @@ -1968,6 +2004,8 @@ sched_rr_get_interval sched_setparam sched_setscheduler sctphdr +sctp_adaptation_event +sctp_assoc_change sctp_assoc_t sctp_authinfo sctp_bindx @@ -1995,16 +2033,25 @@ sctp_gen_error_cause sctp_initmsg sctp_nxtinfo sctp_opt_info +sctp_paddr_change +sctp_pdapi_event sctp_peeloff sctp_prinfo sctp_rcvinfo sctp_recvv_rn +sctp_remote_error +sctp_sender_dry_event +sctp_send_failed_event sctp_sendv_spa +sctp_shutdown_event sctp_sndinfo sctp_sndrcvinfo sctp_snd_all_completes +sctp_stream_change_event +sctp_stream_reset_event sctp_paramhdr sctp_pcbinfo +sctp_setadaptation sctp_sockstat sdallocx seed48 diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 7c18f676df..d1dcf46e10 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -1225,6 +1225,100 @@ s! { pub ss_total_sndbuf: u32, pub ss_total_recv_buf: u32, } + + pub struct sctp_assoc_change { + pub sac_type: u16, + pub sac_flags: u16, + pub sac_length: u32, + pub sac_state: u16, + pub sac_error: u16, + pub sac_outbound_streams: u16, + pub sac_inbound_streams: u16, + pub sac_assoc_id: ::sctp_assoc_t, + pub sac_info: [u8; 0], + } + + pub struct sctp_paddr_change { + pub spc_type: u16, + pub spc_flags: u16, + pub spc_length: u32, + pub spc_aaddr: ::sockaddr_storage, + pub spc_state: u32, + pub spc_error: u32, + pub spc_assoc_id: ::sctp_assoc_t, + } + + pub struct sctp_remote_error { + pub sre_type: u16, + pub sre_flags: u16, + pub sre_length: u32, + pub sre_error: u16, + pub sre_assoc_id: ::sctp_assoc_t, + pub sre_data: [u8; 0], + } + + pub struct sctp_send_failed_event { + pub ssfe_type: u16, + pub ssfe_flags: u16, + pub ssfe_length: u32, + pub ssfe_error: u32, + pub ssfe_info: sctp_sndinfo, + pub ssfe_assoc_id: ::sctp_assoc_t, + pub ssfe_data: [u8; 0], + } + + pub struct sctp_shutdown_event { + pub sse_type: u16, + pub sse_flags: u16, + pub sse_length: u32, + pub sse_assoc_id: ::sctp_assoc_t, + } + + pub struct sctp_adaptation_event { + pub sai_type: u16, + pub sai_flags: u16, + pub sai_length: u32, + pub sai_adaptation_ind: u32, + pub sai_assoc_id: ::sctp_assoc_t, + } + + pub struct sctp_setadaptation { + pub ssb_adaptation_ind: u32, + } + + pub struct sctp_pdapi_event { + pub pdapi_type: u16, + pub pdapi_flags: u16, + pub pdapi_length: u32, + pub pdapi_indication: u32, + pub pdapi_stream: u16, + pub pdapi_seq: u16, + pub pdapi_assoc_id: ::sctp_assoc_t, + } + + pub struct sctp_sender_dry_event { + pub sender_dry_type: u16, + pub sender_dry_flags: u16, + pub sender_dry_length: u32, + pub sender_dry_assoc_id: ::sctp_assoc_t, + } + + pub struct sctp_stream_reset_event { + pub strreset_type: u16, + pub strreset_flags: u16, + pub strreset_length: u32, + pub strreset_assoc_id: ::sctp_assoc_t, + pub strreset_stream_list: [u16; 0], + } + + pub struct sctp_stream_change_event { + pub strchange_type: u16, + pub strchange_flags: u16, + pub strchange_length: u32, + pub strchange_assoc_id: ::sctp_assoc_t, + pub strchange_instrms: u16, + pub strchange_outstrms: u16, + } } s_no_extra_traits! { @@ -4493,6 +4587,52 @@ 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_COMM_UP: ::c_int = 0x0001; +pub const SCTP_COMM_LOST: ::c_int = 0x0002; +pub const SCTP_RESTART: ::c_int = 0x0003; +pub const SCTP_SHUTDOWN_COMP: ::c_int = 0x0004; +pub const SCTP_CANT_STR_ASSOC: ::c_int = 0x0005; + +pub const SCTP_ASSOC_SUPPORTS_PR: ::c_int = 0x01; +pub const SCTP_ASSOC_SUPPORTS_AUTH: ::c_int = 0x02; +pub const SCTP_ASSOC_SUPPORTS_ASCONF: ::c_int = 0x03; +pub const SCTP_ASSOC_SUPPORTS_MULTIBUF: ::c_int = 0x04; +pub const SCTP_ASSOC_SUPPORTS_RE_CONFIG: ::c_int = 0x05; +pub const SCTP_ASSOC_SUPPORTS_INTERLEAVING: ::c_int = 0x06; +pub const SCTP_ASSOC_SUPPORTS_MAX: ::c_int = 0x06; + +pub const SCTP_ADDR_AVAILABLE: ::c_int = 0x0001; +pub const SCTP_ADDR_UNREACHABLE: ::c_int = 0x0002; +pub const SCTP_ADDR_REMOVED: ::c_int = 0x0003; +pub const SCTP_ADDR_ADDED: ::c_int = 0x0004; +pub const SCTP_ADDR_MADE_PRIM: ::c_int = 0x0005; +pub const SCTP_ADDR_CONFIRMED: ::c_int = 0x0006; + +pub const SCTP_ACTIVE: ::c_int = 0x0001; +pub const SCTP_INACTIVE: ::c_int = 0x0002; +pub const SCTP_UNCONFIRMED: ::c_int = 0x0200; + +pub const SCTP_DATA_UNSENT: ::c_int = 0x0001; +pub const SCTP_DATA_SENT: ::c_int = 0x0002; + +pub const SCTP_PARTIAL_DELIVERY_ABORTED: ::c_int = 0x0001; + +pub const SCTP_AUTH_NEW_KEY: ::c_int = 0x0001; +pub const SCTP_AUTH_NEWKEY: ::c_int = SCTP_AUTH_NEW_KEY; +pub const SCTP_AUTH_NO_AUTH: ::c_int = 0x0002; +pub const SCTP_AUTH_FREE_KEY: ::c_int = 0x0003; + +pub const SCTP_STREAM_RESET_INCOMING_SSN: ::c_int = 0x0001; +pub const SCTP_STREAM_RESET_OUTGOING_SSN: ::c_int = 0x0002; +pub const SCTP_STREAM_RESET_DENIED: ::c_int = 0x0004; +pub const SCTP_STREAM_RESET_FAILED: ::c_int = 0x0008; + +pub const SCTP_ASSOC_RESET_DENIED: ::c_int = 0x0004; +pub const SCTP_ASSOC_RESET_FAILED: ::c_int = 0x0008; + +pub const SCTP_STREAM_CHANGE_DENIED: ::c_int = 0x0004; +pub const SCTP_STREAM_CHANGE_FAILED: ::c_int = 0x0008; + const_fn! { {const} fn _ALIGN(p: usize) -> usize { (p + _ALIGNBYTES) & !_ALIGNBYTES |