Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: net/base/net_util.h

Issue 23726043: Added NetworkInterface::network_prefix (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/base/net_util.h
diff --git a/net/base/net_util.h b/net/base/net_util.h
index 6b8884dd11479c5cdfe057d4fc2121b6e3b2a01b..e28ffe3616e7787cd60020b0739a7d63d5b6aff4 100644
--- a/net/base/net_util.h
+++ b/net/base/net_util.h
@@ -516,11 +516,14 @@ NET_EXPORT_PRIVATE bool IsLocalhost(const std::string& host);
// interface.
struct NET_EXPORT NetworkInterface {
NetworkInterface();
- NetworkInterface(const std::string& name, const IPAddressNumber& address);
+ NetworkInterface(const std::string& name,
+ const IPAddressNumber& address,
+ uint8 network_prefix);
~NetworkInterface();
std::string name;
IPAddressNumber address;
+ uint8 network_prefix;
};
typedef std::vector<NetworkInterface> NetworkInterfaceList;
@@ -553,6 +556,13 @@ enum WifiPHYLayerProtocol {
// Currently only available on OS_WIN.
NET_EXPORT WifiPHYLayerProtocol GetWifiPHYLayerProtocol();
+// Returns number of matching initial bits between the addresses |a1| and |a2|.
+unsigned CommonPrefixLength(const IPAddressNumber& a1,
+ const IPAddressNumber& a2);
+
+// Computes the number of leading 1-bits in |mask|.
+unsigned MaskPrefixLength(const IPAddressNumber& mask);
+
} // namespace net
#endif // NET_BASE_NET_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698