OLD | NEW |
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 #include "net/base/net_util.h" | 5 #include "net/base/net_util.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 NetworkInterface::NetworkInterface() | 997 NetworkInterface::NetworkInterface() |
998 : type(NetworkChangeNotifier::CONNECTION_UNKNOWN), | 998 : type(NetworkChangeNotifier::CONNECTION_UNKNOWN), |
999 network_prefix(0) { | 999 network_prefix(0) { |
1000 } | 1000 } |
1001 | 1001 |
1002 NetworkInterface::NetworkInterface(const std::string& name, | 1002 NetworkInterface::NetworkInterface(const std::string& name, |
1003 const std::string& friendly_name, | 1003 const std::string& friendly_name, |
1004 uint32 interface_index, | 1004 uint32 interface_index, |
1005 NetworkChangeNotifier::ConnectionType type, | 1005 NetworkChangeNotifier::ConnectionType type, |
1006 const IPAddressNumber& address, | 1006 const IPAddressNumber& address, |
1007 size_t network_prefix) | 1007 unsigned int network_prefix) |
1008 : name(name), | 1008 : name(name), |
1009 friendly_name(friendly_name), | 1009 friendly_name(friendly_name), |
1010 interface_index(interface_index), | 1010 interface_index(interface_index), |
1011 type(type), | 1011 type(type), |
1012 address(address), | 1012 address(address), |
1013 network_prefix(network_prefix) { | 1013 network_prefix(network_prefix) { |
1014 } | 1014 } |
1015 | 1015 |
1016 NetworkInterface::~NetworkInterface() { | 1016 NetworkInterface::~NetworkInterface() { |
1017 } | 1017 } |
(...skipping 14 matching lines...) Expand all Loading... |
1032 } | 1032 } |
1033 return a1.size() * CHAR_BIT; | 1033 return a1.size() * CHAR_BIT; |
1034 } | 1034 } |
1035 | 1035 |
1036 unsigned MaskPrefixLength(const IPAddressNumber& mask) { | 1036 unsigned MaskPrefixLength(const IPAddressNumber& mask) { |
1037 IPAddressNumber all_ones(mask.size(), 0xFF); | 1037 IPAddressNumber all_ones(mask.size(), 0xFF); |
1038 return CommonPrefixLength(mask, all_ones); | 1038 return CommonPrefixLength(mask, all_ones); |
1039 } | 1039 } |
1040 | 1040 |
1041 } // namespace net | 1041 } // namespace net |
OLD | NEW |