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

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

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « net/base/host_port_pair.cc ('k') | net/base/ip_endpoint.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) 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_IP_ENDPOINT_H_ 5 #ifndef NET_BASE_IP_ENDPOINT_H_
6 #define NET_BASE_IP_ENDPOINT_H_ 6 #define NET_BASE_IP_ENDPOINT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "net/base/address_family.h" 12 #include "net/base/address_family.h"
13 #include "net/base/net_export.h" 13 #include "net/base/net_export.h"
14 #include "net/base/net_util.h" 14 #include "net/base/net_util.h"
15 15
16 struct sockaddr; 16 struct sockaddr;
17 17
18 namespace net { 18 namespace net {
19 19
20 // An IPEndPoint represents the address of a transport endpoint: 20 // An IPEndPoint represents the address of a transport endpoint:
21 // * IP address (either v4 or v6) 21 // * IP address (either v4 or v6)
22 // * Port 22 // * Port
23 class NET_EXPORT IPEndPoint { 23 class NET_EXPORT IPEndPoint {
24 public: 24 public:
25 IPEndPoint(); 25 IPEndPoint();
26 ~IPEndPoint(); 26 ~IPEndPoint();
27 IPEndPoint(const IPAddressNumber& address, int port); 27 IPEndPoint(const IPAddressNumber& address, uint16 port);
28 IPEndPoint(const IPEndPoint& endpoint); 28 IPEndPoint(const IPEndPoint& endpoint);
29 29
30 const IPAddressNumber& address() const { return address_; } 30 const IPAddressNumber& address() const { return address_; }
31 int port() const { return port_; } 31 uint16 port() const { return port_; }
32 32
33 // Returns AddressFamily of the address. 33 // Returns AddressFamily of the address.
34 AddressFamily GetFamily() const; 34 AddressFamily GetFamily() const;
35 35
36 // Returns the sockaddr family of the address, AF_INET or AF_INET6. 36 // Returns the sockaddr family of the address, AF_INET or AF_INET6.
37 int GetSockAddrFamily() const; 37 int GetSockAddrFamily() const;
38 38
39 // Convert to a provided sockaddr struct. 39 // Convert to a provided sockaddr struct.
40 // |address| is the sockaddr to copy into. Should be at least 40 // |address| is the sockaddr to copy into. Should be at least
41 // sizeof(struct sockaddr_storage) bytes. 41 // sizeof(struct sockaddr_storage) bytes.
(...skipping 17 matching lines...) Expand all
59 std::string ToString() const; 59 std::string ToString() const;
60 60
61 // As above, but without port. 61 // As above, but without port.
62 std::string ToStringWithoutPort() const; 62 std::string ToStringWithoutPort() const;
63 63
64 bool operator<(const IPEndPoint& that) const; 64 bool operator<(const IPEndPoint& that) const;
65 bool operator==(const IPEndPoint& that) const; 65 bool operator==(const IPEndPoint& that) const;
66 66
67 private: 67 private:
68 IPAddressNumber address_; 68 IPAddressNumber address_;
69 int port_; 69 uint16 port_;
70 }; 70 };
71 71
72 } // namespace net 72 } // namespace net
73 73
74 #endif // NET_BASE_IP_ENDPOINT_H_ 74 #endif // NET_BASE_IP_ENDPOINT_H_
OLDNEW
« no previous file with comments | « net/base/host_port_pair.cc ('k') | net/base/ip_endpoint.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698