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

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

Issue 10855163: Revert 151586 - [net/dns] Resolve AF_UNSPEC on dual-stacked systems. Sort addresses according to RF… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « net/base/net_error_list.h ('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')
Property Changes:
Added: svn:mergeinfo
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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 // Parses an IP address literal (either IPv4 or IPv6) to its numeric value. 417 // Parses an IP address literal (either IPv4 or IPv6) to its numeric value.
418 // Returns true on success and fills |ip_number| with the numeric value. 418 // Returns true on success and fills |ip_number| with the numeric value.
419 NET_EXPORT_PRIVATE bool ParseIPLiteralToNumber(const std::string& ip_literal, 419 NET_EXPORT_PRIVATE bool ParseIPLiteralToNumber(const std::string& ip_literal,
420 IPAddressNumber* ip_number); 420 IPAddressNumber* ip_number);
421 421
422 // Converts an IPv4 address to an IPv4-mapped IPv6 address. 422 // Converts an IPv4 address to an IPv4-mapped IPv6 address.
423 // For example 192.168.0.1 would be converted to ::ffff:192.168.0.1. 423 // For example 192.168.0.1 would be converted to ::ffff:192.168.0.1.
424 NET_EXPORT_PRIVATE IPAddressNumber ConvertIPv4NumberToIPv6Number( 424 NET_EXPORT_PRIVATE IPAddressNumber ConvertIPv4NumberToIPv6Number(
425 const IPAddressNumber& ipv4_number); 425 const IPAddressNumber& ipv4_number);
426 426
427 // Returns true iff |address| is an IPv4-mapped IPv6 address.
428 NET_EXPORT_PRIVATE bool IsIPv4Mapped(const IPAddressNumber& address);
429
430 // Converts an IPv4-mapped IPv6 address to IPv4 address. Should only be called
431 // on IPv4-mapped IPv6 addresses.
432 NET_EXPORT_PRIVATE IPAddressNumber ConvertIPv4MappedToIPv4(
433 const IPAddressNumber& address);
434
435 // Parses an IP block specifier from CIDR notation to an 427 // Parses an IP block specifier from CIDR notation to an
436 // (IP address, prefix length) pair. Returns true on success and fills 428 // (IP address, prefix length) pair. Returns true on success and fills
437 // |*ip_number| with the numeric value of the IP address and sets 429 // |*ip_number| with the numeric value of the IP address and sets
438 // |*prefix_length_in_bits| with the length of the prefix. 430 // |*prefix_length_in_bits| with the length of the prefix.
439 // 431 //
440 // CIDR notation literals can use either IPv4 or IPv6 literals. Some examples: 432 // CIDR notation literals can use either IPv4 or IPv6 literals. Some examples:
441 // 433 //
442 // 10.10.3.1/20 434 // 10.10.3.1/20
443 // a:b:c::/46 435 // a:b:c::/46
444 // ::1/128 436 // ::1/128
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 482
491 // Returns list of network interfaces except loopback interface. If an 483 // Returns list of network interfaces except loopback interface. If an
492 // interface has more than one address, a separate entry is added to 484 // interface has more than one address, a separate entry is added to
493 // the list for each address. 485 // the list for each address.
494 // Can be called only on a thread that allows IO. 486 // Can be called only on a thread that allows IO.
495 NET_EXPORT bool GetNetworkList(NetworkInterfaceList* networks); 487 NET_EXPORT bool GetNetworkList(NetworkInterfaceList* networks);
496 488
497 } // namespace net 489 } // namespace net
498 490
499 #endif // NET_BASE_NET_UTIL_H_ 491 #endif // NET_BASE_NET_UTIL_H_
OLDNEW
« no previous file with comments | « net/base/net_error_list.h ('k') | net/base/net_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698