Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sctp protocol and MSG_NOTIFICATION #2562

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading