Skip to content

Commit 247591b

Browse files
authored
Merge pull request #3693 from safinaskar/in6addr
Add `IN6ADDR_ANY_INIT`, `IN6ADDR_LOOPBACK_INIT`, `in6addr_any`, `in6addr_loopback`
2 parents 50b4720 + 8db9bc7 commit 247591b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

libc-test/semver/unix.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ IF_NAMESIZE
152152
IGNBRK
153153
IGNCR
154154
IGNPAR
155+
IN6ADDR_ANY_INIT
156+
IN6ADDR_LOOPBACK_INIT
155157
INADDR_ANY
156158
INADDR_BROADCAST
157159
INADDR_LOOPBACK
@@ -586,6 +588,8 @@ hstrerror
586588
if_indextoname
587589
if_nametoindex
588590
in6_addr
591+
in6addr_any
592+
in6addr_loopback
589593
in_addr
590594
in_addr_t
591595
in_port_t

src/unix/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,13 @@ pub const INADDR_ANY: in_addr_t = 0;
305305
pub const INADDR_BROADCAST: in_addr_t = 4294967295;
306306
pub const INADDR_NONE: in_addr_t = 4294967295;
307307

308+
pub const IN6ADDR_LOOPBACK_INIT: in6_addr = in6_addr {
309+
s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
310+
};
311+
pub const IN6ADDR_ANY_INIT: in6_addr = in6_addr {
312+
s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
313+
};
314+
308315
pub const ARPOP_REQUEST: u16 = 1;
309316
pub const ARPOP_REPLY: u16 = 2;
310317

@@ -313,6 +320,11 @@ pub const ATF_PERM: ::c_int = 0x04;
313320
pub const ATF_PUBL: ::c_int = 0x08;
314321
pub const ATF_USETRAILERS: ::c_int = 0x10;
315322

323+
extern "C" {
324+
pub static in6addr_loopback: in6_addr;
325+
pub static in6addr_any: in6_addr;
326+
}
327+
316328
cfg_if! {
317329
if #[cfg(any(target_os = "l4re", target_os = "espidf"))] {
318330
// required libraries for L4Re and the ESP-IDF framework are linked externally, ATM

0 commit comments

Comments
 (0)