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

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

Issue 580283002: Interface change for net_util.h for WebRTC IPv6 support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: modify one extra test case for the new NetworkInterface constructor parameter Created 6 years, 3 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 | « content/renderer/p2p/ipc_network_manager_unittest.cc ('k') | net/base/net_util.cc » ('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_NET_UTIL_H_ 5 #ifndef NET_BASE_NET_UTIL_H_
6 #define NET_BASE_NET_UTIL_H_ 6 #define NET_BASE_NET_UTIL_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #if defined(OS_WIN) 10 #if defined(OS_WIN)
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 socklen_t address_len); 431 socklen_t address_len);
432 432
433 // Returns true if |host| is one of the names (e.g. "localhost") or IP 433 // Returns true if |host| is one of the names (e.g. "localhost") or IP
434 // addresses (IPv4 127.0.0.0/8 or IPv6 ::1) that indicate a loopback. 434 // addresses (IPv4 127.0.0.0/8 or IPv6 ::1) that indicate a loopback.
435 // 435 //
436 // Note that this function does not check for IP addresses other than 436 // Note that this function does not check for IP addresses other than
437 // the above, although other IP addresses may point to the local 437 // the above, although other IP addresses may point to the local
438 // machine. 438 // machine.
439 NET_EXPORT_PRIVATE bool IsLocalhost(const std::string& host); 439 NET_EXPORT_PRIVATE bool IsLocalhost(const std::string& host);
440 440
441 // A subset of IP address attributes which are actionable by the
442 // application layer. Currently unimplemented for all hosts;
443 // IP_ADDRESS_ATTRIBUTE_NONE is always returned.
444 enum IPAddressAttributes {
445 IP_ADDRESS_ATTRIBUTE_NONE = 0,
446
447 // A temporary address is dynamic by nature and will not contain MAC
448 // address. Presence of MAC address in IPv6 addresses can be used to
449 // track an endpoint and cause privacy concern. Please refer to
450 // RFC4941.
451 IP_ADDRESS_ATTRIBUTE_TEMPORARY = 1 << 0,
452
453 // A temporary address could become deprecated once the preferred
454 // lifetime is reached. It is still valid but shouldn't be used to
455 // create new connections.
456 IP_ADDRESS_ATTRIBUTE_DEPRECATED = 1 << 1,
457 };
458
441 // struct that is used by GetNetworkList() to represent a network 459 // struct that is used by GetNetworkList() to represent a network
442 // interface. 460 // interface.
443 struct NET_EXPORT NetworkInterface { 461 struct NET_EXPORT NetworkInterface {
444 NetworkInterface(); 462 NetworkInterface();
445 NetworkInterface(const std::string& name, 463 NetworkInterface(const std::string& name,
446 const std::string& friendly_name, 464 const std::string& friendly_name,
447 uint32 interface_index, 465 uint32 interface_index,
448 NetworkChangeNotifier::ConnectionType type, 466 NetworkChangeNotifier::ConnectionType type,
449 const IPAddressNumber& address, 467 const IPAddressNumber& address,
450 uint32 network_prefix); 468 uint32 network_prefix,
469 int ip_address_attributes);
451 ~NetworkInterface(); 470 ~NetworkInterface();
452 471
453 std::string name; 472 std::string name;
454 std::string friendly_name; // Same as |name| on non-Windows. 473 std::string friendly_name; // Same as |name| on non-Windows.
455 uint32 interface_index; // Always 0 on Android. 474 uint32 interface_index; // Always 0 on Android.
456 NetworkChangeNotifier::ConnectionType type; 475 NetworkChangeNotifier::ConnectionType type;
457 IPAddressNumber address; 476 IPAddressNumber address;
458 uint32 network_prefix; 477 uint32 network_prefix;
478 int ip_address_attributes; // Combination of |IPAddressAttributes|.
459 }; 479 };
460 480
461 typedef std::vector<NetworkInterface> NetworkInterfaceList; 481 typedef std::vector<NetworkInterface> NetworkInterfaceList;
462 482
463 // Policy settings to include/exclude network interfaces. 483 // Policy settings to include/exclude network interfaces.
464 enum HostAddressSelectionPolicy { 484 enum HostAddressSelectionPolicy {
465 INCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES = 0x0, 485 INCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES = 0x0,
466 EXCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES = 0x1, 486 EXCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES = 0x1,
467 // Include temp address only when interface has both permanent and 487 // Include temp address only when interface has both permanent and
468 // temp addresses. 488 // temp addresses.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 DSCP_CS5 = 40, // Video 551 DSCP_CS5 = 40, // Video
532 DSCP_EF = 46, // Voice 552 DSCP_EF = 46, // Voice
533 DSCP_CS6 = 48, // Voice 553 DSCP_CS6 = 48, // Voice
534 DSCP_CS7 = 56, // Control messages 554 DSCP_CS7 = 56, // Control messages
535 DSCP_LAST = DSCP_CS7 555 DSCP_LAST = DSCP_CS7
536 }; 556 };
537 557
538 } // namespace net 558 } // namespace net
539 559
540 #endif // NET_BASE_NET_UTIL_H_ 560 #endif // NET_BASE_NET_UTIL_H_
OLDNEW
« no previous file with comments | « content/renderer/p2p/ipc_network_manager_unittest.cc ('k') | net/base/net_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698