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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 if (prefix_family == family && | 193 if (prefix_family == family && |
194 network_endpoint.FromSockAddr(prefix->Address.lpSockaddr, | 194 network_endpoint.FromSockAddr(prefix->Address.lpSockaddr, |
195 prefix->Address.iSockaddrLength) && | 195 prefix->Address.iSockaddrLength) && |
196 IPNumberMatchesPrefix(endpoint.address(), | 196 IPNumberMatchesPrefix(endpoint.address(), |
197 network_endpoint.address(), | 197 network_endpoint.address(), |
198 prefix->PrefixLength)) { | 198 prefix->PrefixLength)) { |
199 net_prefix = std::max<size_t>(net_prefix, prefix->PrefixLength); | 199 net_prefix = std::max<size_t>(net_prefix, prefix->PrefixLength); |
200 } | 200 } |
201 } | 201 } |
202 } | 202 } |
| 203 uint32 index = |
| 204 (family == AF_INET) ? adapter->IfIndex : adapter->Ipv6IfIndex; |
203 networks->push_back( | 205 networks->push_back( |
204 NetworkInterface(adapter->AdapterName, endpoint.address(), | 206 NetworkInterface(adapter->AdapterName, index, endpoint.address(), |
205 net_prefix)); | 207 net_prefix)); |
206 } | 208 } |
207 } | 209 } |
208 } | 210 } |
209 } | 211 } |
210 | 212 |
211 return true; | 213 return true; |
212 } | 214 } |
213 | 215 |
214 WifiPHYLayerProtocol GetWifiPHYLayerProtocol() { | 216 WifiPHYLayerProtocol GetWifiPHYLayerProtocol() { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 case dot11_phy_type_erp: | 298 case dot11_phy_type_erp: |
297 return WIFI_PHY_LAYER_PROTOCOL_G; | 299 return WIFI_PHY_LAYER_PROTOCOL_G; |
298 case dot11_phy_type_ht: | 300 case dot11_phy_type_ht: |
299 return WIFI_PHY_LAYER_PROTOCOL_N; | 301 return WIFI_PHY_LAYER_PROTOCOL_N; |
300 default: | 302 default: |
301 return WIFI_PHY_LAYER_PROTOCOL_UNKNOWN; | 303 return WIFI_PHY_LAYER_PROTOCOL_UNKNOWN; |
302 } | 304 } |
303 } | 305 } |
304 | 306 |
305 } // namespace net | 307 } // namespace net |
OLD | NEW |