diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-16 03:14:42 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-16 03:14:42 +0000 |
commit | d1388f48fc5971d3bddeca6dd6c0c44f63552063 (patch) | |
tree | 8677600788ea2ae558e2cf7c2a18b11b085e9061 /net/base/net_util.h | |
parent | 0738a30690b8992c412ac968816e1ea8479577d8 (diff) | |
download | chromium_src-d1388f48fc5971d3bddeca6dd6c0c44f63552063.zip chromium_src-d1388f48fc5971d3bddeca6dd6c0c44f63552063.tar.gz chromium_src-d1388f48fc5971d3bddeca6dd6c0c44f63552063.tar.bz2 |
In addition to the logging the IP address that a TCP connect is made to, also include the port number.
This helps when debugging situations where the port has been changed.
Review URL: http://codereview.chromium.org/2808008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49893 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_util.h')
-rw-r--r-- | net/base/net_util.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/base/net_util.h b/net/base/net_util.h index 61e1957..5633c11 100644 --- a/net/base/net_util.h +++ b/net/base/net_util.h @@ -95,6 +95,10 @@ std::string GetHostAndOptionalPort(const GURL& url); // Returns empty string on failure. std::string NetAddressToString(const struct addrinfo* net_address); +// Same as NetAddressToString, but additionally includes the port number. For +// example: "192.168.0.1:99" or "[::1]:80". +std::string NetAddressToStringWithPort(const struct addrinfo* net_address); + // Returns the hostname of the current system. Returns empty string on failure. std::string GetHostName(); @@ -368,6 +372,12 @@ bool IPNumberMatchesPrefix(const IPAddressNumber& ip_number, const IPAddressNumber& ip_prefix, size_t prefix_length_in_bits); +// Returns the port field of the sockaddr in |info|. +uint16* GetPortFieldFromAddrinfo(const struct addrinfo* info); + +// Returns the value of |info's| port (in host byte ordering). +int GetPortFromAddrinfo(const struct addrinfo* info); + } // namespace net #endif // NET_BASE_NET_UTIL_H_ |