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

Side by Side Diff: net/base/net_util_win.cc

Issue 100703002: Added net::NetworkInterface::interface_index. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « net/base/net_util_unittest.cc ('k') | no next file » | 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 #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
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
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
OLDNEW
« no previous file with comments | « net/base/net_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698