Index: net/base/net_util.h |
diff --git a/net/base/net_util.h b/net/base/net_util.h |
index f2ba404ffddcb18a6bc433fabe7ad1e2991924d5..a830198602184fbad5f4bdc22ea98865a2f7a4b0 100644 |
--- a/net/base/net_util.h |
+++ b/net/base/net_util.h |
@@ -42,6 +42,8 @@ struct Parsed; |
namespace net { |
+class AddressList; |
+ |
// This is a "forward declaration" to avoid including ip_address_number.h |
// Keep this in sync. |
typedef std::vector<unsigned char> IPAddressNumber; |
@@ -354,6 +356,15 @@ const uint16_t* GetPortFieldFromSockaddr(const struct sockaddr* address, |
NET_EXPORT_PRIVATE int GetPortFromSockaddr(const struct sockaddr* address, |
socklen_t address_len); |
+// Resolves a localhost name (such as "localhost" or "localhost6") into |
+// IP endpoints with the given port. Returns true if |host| is one of |
+// the names that indicate a loopback and false otherwise. Special IPv6 |
Ryan Sleevi
2015/06/12 01:00:04
Documentation: You seem to mix localhost with loop
estark
2015/06/12 05:59:46
Done.
|
+// names (e.g. "localhost6") will resolve to an IPv6 address only, |
+// whereas other names will resolve to both IPv4 and IPv6. |
+NET_EXPORT_PRIVATE bool ResolveLocalHostname(const std::string& host, |
+ uint16_t port, |
+ AddressList* address_list); |
+ |
// Returns true if |host| is one of the names (e.g. "localhost") or IP |
// addresses (IPv4 127.0.0.0/8 or IPv6 ::1) that indicate a loopback. |
// |