Skip to content

Commit 4564793

Browse files
committed
Add Sctp protocol and MSG_NOTIFICATION
1 parent 5c80884 commit 4564793

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

changelog/2562.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add socket protocol `Sctp`, as well as `MSG_NOTIFICATION` for non-Android Linux targets.

src/sys/socket/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,15 @@ pub enum SockProtocol {
213213
Icmp = libc::IPPROTO_ICMP,
214214
/// ICMPv6 protocol (ICMP over IPv6)
215215
IcmpV6 = libc::IPPROTO_ICMPV6,
216+
/// SCTP ([sctp(7)](https://man7.org/linux/man-pages/man7/sctp.7.html))
217+
#[cfg(not(any(
218+
target_os = "solaris",
219+
target_os = "openbsd",
220+
target_os = "haiku",
221+
target_os = "dragonfly",
222+
target_os = "illumos"
223+
)))]
224+
Sctp = libc::IPPROTO_SCTP,
216225
}
217226

218227
impl SockProtocol {
@@ -356,6 +365,9 @@ libc_bitflags! {
356365
target_os = "fuchsia",
357366
target_os = "freebsd"))]
358367
MSG_WAITFORONE;
368+
/// Indicates that this message is not a user message but an SCTP notification.
369+
#[cfg(linux)]
370+
MSG_NOTIFICATION;
359371
}
360372
}
361373

0 commit comments

Comments
 (0)