Skip to content

Commit f011ec4

Browse files
committed
Add Protocol::UDPLITE
1 parent 3b44984 commit f011ec4

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

src/lib.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,21 @@ impl Protocol {
318318
#[cfg_attr(docsrs, doc(cfg(all(feature = "all", target_os = "linux"))))]
319319
pub const DCCP: Protocol = Protocol(sys::IPPROTO_DCCP);
320320

321-
#[cfg(all(feature = "all", any(target_os = "freebsd", target_os = "linux")))]
322321
/// Protocol corresponding to `SCTP`.
322+
#[cfg(all(feature = "all", any(target_os = "freebsd", target_os = "linux")))]
323323
pub const SCTP: Protocol = Protocol(sys::IPPROTO_SCTP);
324+
325+
/// Protocol corresponding to `UDPLITE`.
326+
#[cfg(all(
327+
feature = "all",
328+
any(
329+
target_os = "android",
330+
target_os = "freebsd",
331+
target_os = "fuchsia",
332+
target_os = "linux",
333+
)
334+
))]
335+
pub const UDPLITE: Protocol = Protocol(sys::IPPROTO_UDPLITE);
324336
}
325337

326338
impl From<c_int> for Protocol {

src/sys/unix.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ pub(crate) use libc::IPPROTO_DCCP;
9393
pub(crate) use libc::IPPROTO_MPTCP;
9494
#[cfg(all(feature = "all", any(target_os = "freebsd", target_os = "linux")))]
9595
pub(crate) use libc::IPPROTO_SCTP;
96+
#[cfg(all(
97+
feature = "all",
98+
any(
99+
target_os = "android",
100+
target_os = "freebsd",
101+
target_os = "fuchsia",
102+
target_os = "linux",
103+
)
104+
))]
105+
pub(crate) use libc::IPPROTO_UDPLITE;
96106
pub(crate) use libc::{IPPROTO_ICMP, IPPROTO_ICMPV6, IPPROTO_TCP, IPPROTO_UDP};
97107
// Used in `SockAddr`.
98108
pub(crate) use libc::{
@@ -500,6 +510,16 @@ impl_debug!(
500510
libc::IPPROTO_DCCP,
501511
#[cfg(all(feature = "all", any(target_os = "freebsd", target_os = "linux")))]
502512
libc::IPPROTO_SCTP,
513+
#[cfg(all(
514+
feature = "all",
515+
any(
516+
target_os = "android",
517+
target_os = "freebsd",
518+
target_os = "fuchsia",
519+
target_os = "linux",
520+
)
521+
))]
522+
libc::IPPROTO_UDPLITE,
503523
);
504524

505525
/// Unix-only API.

0 commit comments

Comments
 (0)