OLD | NEW |
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_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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "net/base/net_api.h" | 10 #include "net/base/net_export.h" |
11 #include "net/base/net_util.h" | 11 #include "net/base/net_util.h" |
12 | 12 |
13 struct sockaddr; | 13 struct sockaddr; |
14 | 14 |
15 namespace net { | 15 namespace net { |
16 | 16 |
17 // An IPEndPoint represents the address of a transport endpoint: | 17 // An IPEndPoint represents the address of a transport endpoint: |
18 // * IP address (either v4 or v6) | 18 // * IP address (either v4 or v6) |
19 // * Port | 19 // * Port |
20 class NET_API IPEndPoint { | 20 class NET_EXPORT IPEndPoint { |
21 public: | 21 public: |
22 IPEndPoint(); | 22 IPEndPoint(); |
23 virtual ~IPEndPoint(); | 23 virtual ~IPEndPoint(); |
24 IPEndPoint(const IPAddressNumber& address, int port); | 24 IPEndPoint(const IPAddressNumber& address, int port); |
25 IPEndPoint(const IPEndPoint& endpoint); | 25 IPEndPoint(const IPEndPoint& endpoint); |
26 | 26 |
27 const IPAddressNumber& address() const { return address_; } | 27 const IPAddressNumber& address() const { return address_; } |
28 int port() const { return port_; } | 28 int port() const { return port_; } |
29 | 29 |
30 // Returns AF_INET or AF_INET6 depending on the type of the address. | 30 // Returns AF_INET or AF_INET6 depending on the type of the address. |
(...skipping 23 matching lines...) Expand all Loading... |
54 bool operator==(const IPEndPoint& that) const; | 54 bool operator==(const IPEndPoint& that) const; |
55 | 55 |
56 private: | 56 private: |
57 IPAddressNumber address_; | 57 IPAddressNumber address_; |
58 int port_; | 58 int port_; |
59 }; | 59 }; |
60 | 60 |
61 } // namespace net | 61 } // namespace net |
62 | 62 |
63 #endif // NET_BASE_IP_ENDPOINT_H_ | 63 #endif // NET_BASE_IP_ENDPOINT_H_ |
OLD | NEW |