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

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

Issue 7029049: Merge 84251, 85083, 85188, 85375. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/742/src/
Patch Set: Upload before checkin Created 9 years, 7 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/address_list.cc ('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')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 // IP address whose |prefix_length_in_bits| most significant bits match 434 // IP address whose |prefix_length_in_bits| most significant bits match
435 // |ip_prefix| will be matched. 435 // |ip_prefix| will be matched.
436 // 436 //
437 // In cases when an IPv4 address is being compared to an IPv6 address prefix 437 // In cases when an IPv4 address is being compared to an IPv6 address prefix
438 // and vice versa, the IPv4 addresses will be converted to IPv4-mapped 438 // and vice versa, the IPv4 addresses will be converted to IPv4-mapped
439 // (IPv6) addresses. 439 // (IPv6) addresses.
440 bool IPNumberMatchesPrefix(const IPAddressNumber& ip_number, 440 bool IPNumberMatchesPrefix(const IPAddressNumber& ip_number,
441 const IPAddressNumber& ip_prefix, 441 const IPAddressNumber& ip_prefix,
442 size_t prefix_length_in_bits); 442 size_t prefix_length_in_bits);
443 443
444 // Makes a copy of |info|. The dynamically-allocated parts are copied as well.
445 // If |recursive| is true, chained entries via ai_next are copied too.
446 // The copy returned by this function should be freed using
447 // FreeCopyOfAddrinfo(), and NOT freeaddrinfo().
448 struct addrinfo* CreateCopyOfAddrinfo(const struct addrinfo* info,
449 bool recursive);
450
451 // Frees an addrinfo that was created by CreateCopyOfAddrinfo().
452 void FreeCopyOfAddrinfo(struct addrinfo* info);
453
444 // Returns the port field of the sockaddr in |info|. 454 // Returns the port field of the sockaddr in |info|.
445 const uint16* GetPortFieldFromAddrinfo(const struct addrinfo* info); 455 const uint16* GetPortFieldFromAddrinfo(const struct addrinfo* info);
446 uint16* GetPortFieldFromAddrinfo(struct addrinfo* info); 456 uint16* GetPortFieldFromAddrinfo(struct addrinfo* info);
447 457
448 // Returns the value of |info's| port (in host byte ordering). 458 // Returns the value of |info's| port (in host byte ordering).
449 int GetPortFromAddrinfo(const struct addrinfo* info); 459 int GetPortFromAddrinfo(const struct addrinfo* info);
450 460
451 // Same except for struct sockaddr. 461 // Same except for struct sockaddr.
452 const uint16* GetPortFieldFromSockaddr(const struct sockaddr* address, 462 const uint16* GetPortFieldFromSockaddr(const struct sockaddr* address,
453 socklen_t address_len); 463 socklen_t address_len);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 struct ClampComponentOffset { 497 struct ClampComponentOffset {
488 explicit ClampComponentOffset(size_t component_start); 498 explicit ClampComponentOffset(size_t component_start);
489 size_t operator()(size_t offset); 499 size_t operator()(size_t offset);
490 500
491 const size_t component_start; 501 const size_t component_start;
492 }; 502 };
493 503
494 } // namespace net 504 } // namespace net
495 505
496 #endif // NET_BASE_NET_UTIL_H_ 506 #endif // NET_BASE_NET_UTIL_H_
OLDNEW
« no previous file with comments | « net/base/address_list.cc ('k') | net/base/net_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698