Skip to content

Commit

Permalink
Add IN6ADDR_ANY_INIT, IN6ADDR_LOOPBACK_INIT, in6addr_any, in6addr_loo…
Browse files Browse the repository at this point in the history
…pback

(backport <rust-lang#3693>)
(cherry picked from commit 8db9bc7)
  • Loading branch information
Askar Safin authored and tgross35 committed Aug 28, 2024
1 parent f9aa12d commit d939efa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libc-test/semver/unix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ IF_NAMESIZE
IGNBRK
IGNCR
IGNPAR
IN6ADDR_ANY_INIT
IN6ADDR_LOOPBACK_INIT
INADDR_ANY
INADDR_BROADCAST
INADDR_LOOPBACK
Expand Down Expand Up @@ -586,6 +588,8 @@ hstrerror
if_indextoname
if_nametoindex
in6_addr
in6addr_any
in6addr_loopback
in_addr
in_addr_t
in_port_t
Expand Down
12 changes: 12 additions & 0 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,13 @@ 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],
};
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],
};

pub const ARPOP_REQUEST: u16 = 1;
pub const ARPOP_REPLY: u16 = 2;

Expand All @@ -313,6 +320,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
Expand Down

0 comments on commit d939efa

Please sign in to comment.