Skip to content

Commit f2fd3bc

Browse files
olsonjefferybrson
authored andcommitted
std: FIXME stub net::ip::ip_addr::ipv6 variant...needs parse/format impl
still need implementation for parsing/output formatting and (perhaps?) representation (for now, i just followef the ipv4 variant's lead and am representing it as a tuple of 8x u16). parsing an ipv6 addr is way more complex than parsing an ipv4 addr, so i'm putting off an implementation here, for now. candidate solutions: - could use getaddrinfo() (exists on both POSIX and windows), but with incompatible fn signatures. - libuv has a way to parse an ipv6 string into a sockaddr_in6, but it also requires a port, so it's probably not aprop for ip_addr
1 parent 64048d4 commit f2fd3bc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libstd/net_ip.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export v4;
1414
enum ip_addr {
1515
#[doc="An IPv4 address"]
1616
ipv4(u8, u8, u8, u8),
17+
ipv6(u16,u16,u16,u16,u16,u16,u16,u16)
1718
}
1819

1920
#[doc="
@@ -28,6 +29,9 @@ fn format_addr(ip: ip_addr) -> str {
2829
ipv4(a, b, c, d) {
2930
#fmt["%u.%u.%u.%u", a as uint, b as uint, c as uint, d as uint]
3031
}
32+
ipv6(a,b,c,d,e,f,g,h) {
33+
fail "FIXME impl parsing of ipv6 addr";
34+
}
3135
}
3236
}
3337

0 commit comments

Comments
 (0)