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 #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 Loading... | |
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 // Only expose a subset of IPv6 address flags which is actionable to | |
pauljensen
2014/09/10 17:55:18
Remove "Only expose".
I'm not sure "IPv6 address f
lorenzo
2014/09/11 06:06:10
I don't think "address flags" is a standard term.
guoweis_webrtc
2014/09/12 23:55:21
Done. Changed the name to IPAddressAttributes.
guoweis_webrtc
2014/09/12 23:55:21
Changed the name to IPAddressAttributes.
| |
442 // application layer. Addresses with flags which are not combination | |
pauljensen
2014/09/10 17:55:18
Insert "a" in between "not combination"
guoweis_webrtc
2014/09/12 23:55:21
Done.
| |
443 // of listed below will be filtered out from GetNetworkList. | |
lorenzo
2014/09/11 06:06:10
I think this comment should just describe the flag
guoweis_webrtc
2014/09/12 23:55:21
Done.
| |
444 enum IPv6AddressFlag { | |
lorenzo
2014/09/11 06:06:10
Is there a reason for this enum to be IPv6-specifi
guoweis_webrtc
2014/09/12 23:55:21
Changed the enum name to IPAddressAttributes
| |
445 IPV6_ADDRESS_FLAG_NONE = 0, | |
446 | |
447 // Temporary address is dynamic by nature and will not carry MAC | |
448 // address. | |
449 IPV6_ADDRESS_FLAG_TEMPORARY = 1 << 0, | |
450 | |
451 // Temporary address could become deprecated once the preferred | |
452 // lifetime is reached. It is still valid but shouldn't be used to | |
453 // create new connection. | |
454 IPV6_ADDRESS_FLAG_DEPRECATED = 1 << 1, | |
455 }; | |
456 | |
441 // struct that is used by GetNetworkList() to represent a network | 457 // struct that is used by GetNetworkList() to represent a network |
442 // interface. | 458 // interface. |
443 struct NET_EXPORT NetworkInterface { | 459 struct NET_EXPORT NetworkInterface { |
444 NetworkInterface(); | 460 NetworkInterface(); |
445 NetworkInterface(const std::string& name, | 461 NetworkInterface(const std::string& name, |
446 const std::string& friendly_name, | 462 const std::string& friendly_name, |
447 uint32 interface_index, | 463 uint32 interface_index, |
448 NetworkChangeNotifier::ConnectionType type, | 464 NetworkChangeNotifier::ConnectionType type, |
449 const IPAddressNumber& address, | 465 const IPAddressNumber& address, |
450 size_t network_prefix); | 466 size_t network_prefix, |
467 int ipv6_flags); | |
451 ~NetworkInterface(); | 468 ~NetworkInterface(); |
452 | 469 |
453 std::string name; | 470 std::string name; |
454 std::string friendly_name; // Same as |name| on non-Windows. | 471 std::string friendly_name; // Same as |name| on non-Windows. |
455 uint32 interface_index; // Always 0 on Android. | 472 uint32 interface_index; // Always 0 on Android. |
456 NetworkChangeNotifier::ConnectionType type; | 473 NetworkChangeNotifier::ConnectionType type; |
457 IPAddressNumber address; | 474 IPAddressNumber address; |
458 size_t network_prefix; | 475 size_t network_prefix; |
476 int ipv6_flags; // Combination of |IPv6AddressFlag|. | |
459 }; | 477 }; |
460 | 478 |
461 typedef std::vector<NetworkInterface> NetworkInterfaceList; | 479 typedef std::vector<NetworkInterface> NetworkInterfaceList; |
462 | 480 |
463 // Policy settings to include/exclude network interfaces. | 481 // Policy settings to include/exclude network interfaces. |
464 enum HostAddressSelectionPolicy { | 482 enum HostAddressSelectionPolicy { |
465 INCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES = 0x0, | 483 INCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES = 0x0, |
466 EXCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES = 0x1, | 484 EXCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES = 0x1, |
467 // Include temp address only when interface has both permanent and | 485 // Include temp address only when interface has both permanent and |
468 // temp addresses. | 486 // temp addresses. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
531 DSCP_CS5 = 40, // Video | 549 DSCP_CS5 = 40, // Video |
532 DSCP_EF = 46, // Voice | 550 DSCP_EF = 46, // Voice |
533 DSCP_CS6 = 48, // Voice | 551 DSCP_CS6 = 48, // Voice |
534 DSCP_CS7 = 56, // Control messages | 552 DSCP_CS7 = 56, // Control messages |
535 DSCP_LAST = DSCP_CS7 | 553 DSCP_LAST = DSCP_CS7 |
536 }; | 554 }; |
537 | 555 |
538 } // namespace net | 556 } // namespace net |
539 | 557 |
540 #endif // NET_BASE_NET_UTIL_H_ | 558 #endif // NET_BASE_NET_UTIL_H_ |
OLD | NEW |