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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
365 // Also returns false if it cannot determine this. | 365 // Also returns false if it cannot determine this. |
366 bool HaveOnlyLoopbackAddresses(); | 366 bool HaveOnlyLoopbackAddresses(); |
367 | 367 |
368 // Returns AddressFamily of the address. | 368 // Returns AddressFamily of the address. |
369 NET_EXPORT_PRIVATE AddressFamily GetAddressFamily( | 369 NET_EXPORT_PRIVATE AddressFamily GetAddressFamily( |
370 const IPAddressNumber& address); | 370 const IPAddressNumber& address); |
371 | 371 |
372 // Maps the given AddressFamily to either AF_INET, AF_INET6 or AF_UNSPEC. | 372 // Maps the given AddressFamily to either AF_INET, AF_INET6 or AF_UNSPEC. |
373 NET_EXPORT_PRIVATE int ConvertAddressFamily(AddressFamily address_family); | 373 NET_EXPORT_PRIVATE int ConvertAddressFamily(AddressFamily address_family); |
374 | 374 |
375 // Parses a URL-safe IP literal to its numeric value. Returns true on success, | |
Ryan Sleevi
2014/08/06 19:42:12
// Parses a URL-safe IP literal (see RFC 3986, Sec
Mike West
2014/08/08 08:15:03
Done.
| |
376 // and fills |ip_number| with the numeric value. | |
377 NET_EXPORT bool ParseURLHostnameToNumber(const std::string& hostname, | |
378 IPAddressNumber* ip_number); | |
379 | |
375 // Parses an IP address literal (either IPv4 or IPv6) to its numeric value. | 380 // Parses an IP address literal (either IPv4 or IPv6) to its numeric value. |
376 // Returns true on success and fills |ip_number| with the numeric value. | 381 // Returns true on success and fills |ip_number| with the numeric value. |
377 NET_EXPORT bool ParseIPLiteralToNumber(const std::string& ip_literal, | 382 NET_EXPORT bool ParseIPLiteralToNumber(const std::string& ip_literal, |
378 IPAddressNumber* ip_number); | 383 IPAddressNumber* ip_number); |
379 | 384 |
380 // Converts an IPv4 address to an IPv4-mapped IPv6 address. | 385 // Converts an IPv4 address to an IPv4-mapped IPv6 address. |
381 // For example 192.168.0.1 would be converted to ::ffff:192.168.0.1. | 386 // For example 192.168.0.1 would be converted to ::ffff:192.168.0.1. |
382 NET_EXPORT_PRIVATE IPAddressNumber ConvertIPv4NumberToIPv6Number( | 387 NET_EXPORT_PRIVATE IPAddressNumber ConvertIPv4NumberToIPv6Number( |
383 const IPAddressNumber& ipv4_number); | 388 const IPAddressNumber& ipv4_number); |
384 | 389 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
526 DSCP_CS5 = 40, // Video | 531 DSCP_CS5 = 40, // Video |
527 DSCP_EF = 46, // Voice | 532 DSCP_EF = 46, // Voice |
528 DSCP_CS6 = 48, // Voice | 533 DSCP_CS6 = 48, // Voice |
529 DSCP_CS7 = 56, // Control messages | 534 DSCP_CS7 = 56, // Control messages |
530 DSCP_LAST = DSCP_CS7 | 535 DSCP_LAST = DSCP_CS7 |
531 }; | 536 }; |
532 | 537 |
533 } // namespace net | 538 } // namespace net |
534 | 539 |
535 #endif // NET_BASE_NET_UTIL_H_ | 540 #endif // NET_BASE_NET_UTIL_H_ |
OLD | NEW |