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

Unix: add IN6ADDR_ANY_INIT, IN6ADDR_LOOPBACK_INIT, in6addr_any, in6addr_loopback #3693

Merged
merged 1 commit into from
Aug 16, 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
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