| 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 <iphlpapi.h> | 7 #include <iphlpapi.h> |
| 8 #include <wlanapi.h> | 8 #include <wlanapi.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 // way identifying the interface type. Usually (and most likely) temp | 166 // way identifying the interface type. Usually (and most likely) temp |
| 167 // IPv6 will have a shorter ValidLifetime value then the permanent | 167 // IPv6 will have a shorter ValidLifetime value then the permanent |
| 168 // interface. | 168 // interface. |
| 169 if (family == AF_INET6 && | 169 if (family == AF_INET6 && |
| 170 (policy & INCLUDE_ONLY_TEMP_IPV6_ADDRESS_IF_POSSIBLE)) { | 170 (policy & INCLUDE_ONLY_TEMP_IPV6_ADDRESS_IF_POSSIBLE)) { |
| 171 if (ipv6_valid_lifetime == 0 || | 171 if (ipv6_valid_lifetime == 0 || |
| 172 ipv6_valid_lifetime > address->ValidLifetime) { | 172 ipv6_valid_lifetime > address->ValidLifetime) { |
| 173 ipv6_valid_lifetime = address->ValidLifetime; | 173 ipv6_valid_lifetime = address->ValidLifetime; |
| 174 ipv6_address.reset(new NetworkInterface(adapter->AdapterName, | 174 ipv6_address.reset(new NetworkInterface(adapter->AdapterName, |
| 175 base::SysWideToNativeMB(adapter->FriendlyName), | 175 base::SysWideToNativeMB(adapter->FriendlyName), |
| 176 index, endpoint.address(), net_prefix)); | 176 index, NETWORK_INTERFACE_UNKNOWN, |
| 177 endpoint.address(), net_prefix)); |
| 177 continue; | 178 continue; |
| 178 } | 179 } |
| 179 } | 180 } |
| 180 networks->push_back( | 181 networks->push_back( |
| 181 NetworkInterface(adapter->AdapterName, | 182 NetworkInterface(adapter->AdapterName, |
| 182 base::SysWideToNativeMB(adapter->FriendlyName), | 183 base::SysWideToNativeMB(adapter->FriendlyName), |
| 183 index, endpoint.address(), net_prefix)); | 184 index, NETWORK_INTERFACE_UNKNOWN, |
| 185 endpoint.address(), net_prefix)); |
| 184 } | 186 } |
| 185 } | 187 } |
| 186 } | 188 } |
| 187 } | 189 } |
| 188 | 190 |
| 189 if (ipv6_address.get()) { | 191 if (ipv6_address.get()) { |
| 190 networks->push_back(*(ipv6_address.get())); | 192 networks->push_back(*(ipv6_address.get())); |
| 191 } | 193 } |
| 192 return true; | 194 return true; |
| 193 } | 195 } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 case dot11_phy_type_erp: | 279 case dot11_phy_type_erp: |
| 278 return WIFI_PHY_LAYER_PROTOCOL_G; | 280 return WIFI_PHY_LAYER_PROTOCOL_G; |
| 279 case dot11_phy_type_ht: | 281 case dot11_phy_type_ht: |
| 280 return WIFI_PHY_LAYER_PROTOCOL_N; | 282 return WIFI_PHY_LAYER_PROTOCOL_N; |
| 281 default: | 283 default: |
| 282 return WIFI_PHY_LAYER_PROTOCOL_UNKNOWN; | 284 return WIFI_PHY_LAYER_PROTOCOL_UNKNOWN; |
| 283 } | 285 } |
| 284 } | 286 } |
| 285 | 287 |
| 286 } // namespace net | 288 } // namespace net |
| OLD | NEW |