| 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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 an IP address literal (either IPv4 or IPv6) to its numeric value. | 375 // 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. | 376 // Returns true on success and fills |ip_number| with the numeric value. |
| 377 NET_EXPORT_PRIVATE bool ParseIPLiteralToNumber(const std::string& ip_literal, | 377 NET_EXPORT bool ParseIPLiteralToNumber(const std::string& ip_literal, |
| 378 IPAddressNumber* ip_number); | 378 IPAddressNumber* ip_number); |
| 379 | 379 |
| 380 // Converts an IPv4 address to an IPv4-mapped IPv6 address. | 380 // 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. | 381 // For example 192.168.0.1 would be converted to ::ffff:192.168.0.1. |
| 382 NET_EXPORT_PRIVATE IPAddressNumber ConvertIPv4NumberToIPv6Number( | 382 NET_EXPORT_PRIVATE IPAddressNumber ConvertIPv4NumberToIPv6Number( |
| 383 const IPAddressNumber& ipv4_number); | 383 const IPAddressNumber& ipv4_number); |
| 384 | 384 |
| 385 // Returns true iff |address| is an IPv4-mapped IPv6 address. | 385 // Returns true iff |address| is an IPv4-mapped IPv6 address. |
| 386 NET_EXPORT_PRIVATE bool IsIPv4Mapped(const IPAddressNumber& address); | 386 NET_EXPORT_PRIVATE bool IsIPv4Mapped(const IPAddressNumber& address); |
| 387 | 387 |
| 388 // Converts an IPv4-mapped IPv6 address to IPv4 address. Should only be called | 388 // Converts an IPv4-mapped IPv6 address to IPv4 address. Should only be called |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 DSCP_CS5 = 40, // Video | 526 DSCP_CS5 = 40, // Video |
| 527 DSCP_EF = 46, // Voice | 527 DSCP_EF = 46, // Voice |
| 528 DSCP_CS6 = 48, // Voice | 528 DSCP_CS6 = 48, // Voice |
| 529 DSCP_CS7 = 56, // Control messages | 529 DSCP_CS7 = 56, // Control messages |
| 530 DSCP_LAST = DSCP_CS7 | 530 DSCP_LAST = DSCP_CS7 |
| 531 }; | 531 }; |
| 532 | 532 |
| 533 } // namespace net | 533 } // namespace net |
| 534 | 534 |
| 535 #endif // NET_BASE_NET_UTIL_H_ | 535 #endif // NET_BASE_NET_UTIL_H_ |
| OLD | NEW |