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

Side by Side Diff: net/base/ip_address_number.h

Issue 1162973005: Stop including ip_address_number.h from net_util.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove some header sorting changes, seems to be breaking windows Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « net/base/address_tracker_linux.cc ('k') | net/base/ip_endpoint.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_BASE_IP_ADDRESS_NUMBER_H_ 5 #ifndef NET_BASE_IP_ADDRESS_NUMBER_H_
6 #define NET_BASE_IP_ADDRESS_NUMBER_H_ 6 #define NET_BASE_IP_ADDRESS_NUMBER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "net/base/net_export.h" 12 #include "net/base/net_export.h"
13 13
14 namespace net { 14 namespace net {
15 15
16 // IPAddressNumber is used to represent an IP address's numeric value as an 16 // IPAddressNumber is used to represent an IP address's numeric value as an
17 // array of bytes, from most significant to least significant. This is the 17 // array of bytes, from most significant to least significant. This is the
18 // network byte ordering. 18 // network byte ordering.
19 // 19 //
20 // IPv4 addresses will have length 4, whereas IPv6 address will have length 16. 20 // IPv4 addresses will have length 4, whereas IPv6 address will have length 16.
21 typedef std::vector<unsigned char> IPAddressNumber; 21 typedef std::vector<unsigned char>
22 IPAddressNumber; // This is also duplicated in net_util.h
22 typedef std::vector<IPAddressNumber> IPAddressList; 23 typedef std::vector<IPAddressNumber> IPAddressList;
23 24
24 static const size_t kIPv4AddressSize = 4; 25 static const size_t kIPv4AddressSize = 4;
25 static const size_t kIPv6AddressSize = 16; 26 static const size_t kIPv6AddressSize = 16;
26 27
27 // Returns true if an IP address hostname is in a range reserved by the IANA. 28 // Returns true if an IP address hostname is in a range reserved by the IANA.
28 // Works with both IPv4 and IPv6 addresses, and only compares against a given 29 // Works with both IPv4 and IPv6 addresses, and only compares against a given
29 // protocols's reserved ranges. 30 // protocols's reserved ranges.
30 NET_EXPORT bool IsIPAddressReserved(const IPAddressNumber& address); 31 NET_EXPORT bool IsIPAddressReserved(const IPAddressNumber& address);
31 32
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // Returns number of matching initial bits between the addresses |a1| and |a2|. 105 // Returns number of matching initial bits between the addresses |a1| and |a2|.
105 unsigned CommonPrefixLength(const IPAddressNumber& a1, 106 unsigned CommonPrefixLength(const IPAddressNumber& a1,
106 const IPAddressNumber& a2); 107 const IPAddressNumber& a2);
107 108
108 // Computes the number of leading 1-bits in |mask|. 109 // Computes the number of leading 1-bits in |mask|.
109 unsigned MaskPrefixLength(const IPAddressNumber& mask); 110 unsigned MaskPrefixLength(const IPAddressNumber& mask);
110 111
111 } // namespace net 112 } // namespace net
112 113
113 #endif // NET_BASE_IP_ADDRESS_NUMBER_H_ 114 #endif // NET_BASE_IP_ADDRESS_NUMBER_H_
OLDNEW
« no previous file with comments | « net/base/address_tracker_linux.cc ('k') | net/base/ip_endpoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698