diff --git a/libc-test/semver/unix.txt b/libc-test/semver/unix.txt index 03248dfec58c7..bb8e319def299 100644 --- a/libc-test/semver/unix.txt +++ b/libc-test/semver/unix.txt @@ -152,6 +152,8 @@ IF_NAMESIZE IGNBRK IGNCR IGNPAR +IN6ADDR_ANY_INIT +IN6ADDR_LOOPBACK_INIT INADDR_ANY INADDR_BROADCAST INADDR_LOOPBACK @@ -586,6 +588,8 @@ hstrerror if_indextoname if_nametoindex in6_addr +in6addr_any +in6addr_loopback in_addr in_addr_t in_port_t diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 8b3d988ae38ae..9b2bbe4bae2b9 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -305,6 +305,17 @@ pub const INADDR_ANY: in_addr_t = 0; pub const INADDR_BROADCAST: in_addr_t = 4294967295; pub const INADDR_NONE: in_addr_t = 4294967295; +pub const IN6ADDR_LOOPBACK_INIT: in6_addr = in6_addr { + s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], + #[cfg(not(libc_align))] + __align: [u32; 0], +}; +pub const IN6ADDR_ANY_INIT: in6_addr = in6_addr { + s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + #[cfg(not(libc_align))] + __align: [u32; 0], +}; + pub const ARPOP_REQUEST: u16 = 1; pub const ARPOP_REPLY: u16 = 2; @@ -313,6 +324,11 @@ pub const ATF_PERM: ::c_int = 0x04; pub const ATF_PUBL: ::c_int = 0x08; pub const ATF_USETRAILERS: ::c_int = 0x10; +extern "C" { + pub static in6addr_loopback: in6_addr; + pub static in6addr_any: in6_addr; +} + cfg_if! { if #[cfg(any(target_os = "l4re", target_os = "espidf"))] { // required libraries for L4Re and the ESP-IDF framework are linked externally, ATM