Skip to content

Commit

Permalink
Add Sctp protocol and MSG_NOTIFICATION (#2562)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnaaman-dn authored Dec 18, 2024
1 parent 5ec9990 commit 5ef78a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog/2562.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add socket protocol `Sctp`, as well as `MSG_NOTIFICATION` for non-Android Linux targets.
11 changes: 11 additions & 0 deletions src/sys/socket/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@ pub enum SockProtocol {
Icmp = libc::IPPROTO_ICMP,
/// ICMPv6 protocol (ICMP over IPv6)
IcmpV6 = libc::IPPROTO_ICMPV6,
/// SCTP ([sctp(7)](https://man7.org/linux/man-pages/man7/sctp.7.html))
#[cfg(any(
apple_targets,
linux_android,
target_os = "freebsd",
target_os = "netbsd"
))]
Sctp = libc::IPPROTO_SCTP,
}

impl SockProtocol {
Expand Down Expand Up @@ -356,6 +364,9 @@ libc_bitflags! {
target_os = "fuchsia",
target_os = "freebsd"))]
MSG_WAITFORONE;
/// Indicates that this message is not a user message but an SCTP notification.
#[cfg(target_os = "linux")]
MSG_NOTIFICATION;
}
}

Expand Down

0 comments on commit 5ef78a8

Please sign in to comment.