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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 socklen_t address_len); | 434 socklen_t address_len); |
435 | 435 |
436 // Returns true if |host| is one of the names (e.g. "localhost") or IP | 436 // Returns true if |host| is one of the names (e.g. "localhost") or IP |
437 // addresses (IPv4 127.0.0.0/8 or IPv6 ::1) that indicate a loopback. | 437 // addresses (IPv4 127.0.0.0/8 or IPv6 ::1) that indicate a loopback. |
438 // | 438 // |
439 // Note that this function does not check for IP addresses other than | 439 // Note that this function does not check for IP addresses other than |
440 // the above, although other IP addresses may point to the local | 440 // the above, although other IP addresses may point to the local |
441 // machine. | 441 // machine. |
442 NET_EXPORT_PRIVATE bool IsLocalhost(const std::string& host); | 442 NET_EXPORT_PRIVATE bool IsLocalhost(const std::string& host); |
443 | 443 |
| 444 NET_EXPORT_PRIVATE bool IsLocalhostTLD(const std::string& host); |
| 445 |
444 // A subset of IP address attributes which are actionable by the | 446 // A subset of IP address attributes which are actionable by the |
445 // application layer. Currently unimplemented for all hosts; | 447 // application layer. Currently unimplemented for all hosts; |
446 // IP_ADDRESS_ATTRIBUTE_NONE is always returned. | 448 // IP_ADDRESS_ATTRIBUTE_NONE is always returned. |
447 enum IPAddressAttributes { | 449 enum IPAddressAttributes { |
448 IP_ADDRESS_ATTRIBUTE_NONE = 0, | 450 IP_ADDRESS_ATTRIBUTE_NONE = 0, |
449 | 451 |
450 // A temporary address is dynamic by nature and will not contain MAC | 452 // A temporary address is dynamic by nature and will not contain MAC |
451 // address. Presence of MAC address in IPv6 addresses can be used to | 453 // address. Presence of MAC address in IPv6 addresses can be used to |
452 // track an endpoint and cause privacy concern. Please refer to | 454 // track an endpoint and cause privacy concern. Please refer to |
453 // RFC4941. | 455 // RFC4941. |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 DSCP_CS5 = 40, // Video | 575 DSCP_CS5 = 40, // Video |
574 DSCP_EF = 46, // Voice | 576 DSCP_EF = 46, // Voice |
575 DSCP_CS6 = 48, // Voice | 577 DSCP_CS6 = 48, // Voice |
576 DSCP_CS7 = 56, // Control messages | 578 DSCP_CS7 = 56, // Control messages |
577 DSCP_LAST = DSCP_CS7 | 579 DSCP_LAST = DSCP_CS7 |
578 }; | 580 }; |
579 | 581 |
580 } // namespace net | 582 } // namespace net |
581 | 583 |
582 #endif // NET_BASE_NET_UTIL_H_ | 584 #endif // NET_BASE_NET_UTIL_H_ |
OLD | NEW |