No IpAddr in Core


#1

I’m trying to use IP addresses in a no_std crate. I was hoping core will have the IpAddr type, but it doesn’t :frowning:. What options do I have other than writing it myself? Shouldn’t this type be part of core ideally?


#2

IpAddrV4 and IpAddrV6 are direct wrappers over libc’s sockaddr_in and sockaddr_in6 types, respectively, and core doesn’t pull in libc.


#3

Thanks @sfackler


#4

I hope that eventually the changes being done by the portability WG might allow having a pure-Rust IpAddrV4/6 implementation for non-libc targets. (I’m surprised to see that Redox uses the libc based implementation, I didn’t think it used libc).