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 #include "net/base/ip_endpoint.h" | 5 #include "net/base/ip_endpoint.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/sys_byteorder.h" | 9 #include "base/sys_byteorder.h" |
10 #if defined(OS_WIN) | 10 #include "net/base/net_util.h" |
11 #include <winsock2.h> | 11 #include "net/base/sys_addrinfo.h" |
12 #elif defined(OS_POSIX) | |
13 #include <netinet/in.h> | |
14 #endif | |
15 | 12 |
16 namespace net { | 13 namespace net { |
17 | 14 |
18 namespace { | 15 namespace { |
19 // By definition, socklen_t is large enough to hold both sizes. | 16 // By definition, socklen_t is large enough to hold both sizes. |
20 const socklen_t kSockaddrInSize = sizeof(struct sockaddr_in); | 17 const socklen_t kSockaddrInSize = sizeof(struct sockaddr_in); |
21 const socklen_t kSockaddrIn6Size = sizeof(struct sockaddr_in6); | 18 const socklen_t kSockaddrIn6Size = sizeof(struct sockaddr_in6); |
22 } | 19 } |
23 | 20 |
24 IPEndPoint::IPEndPoint() : port_(0) {} | 21 IPEndPoint::IPEndPoint() : port_(0) {} |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 return address_ < that.address_; | 115 return address_ < that.address_; |
119 } | 116 } |
120 return port_ < that.port_; | 117 return port_ < that.port_; |
121 } | 118 } |
122 | 119 |
123 bool IPEndPoint::operator==(const IPEndPoint& that) const { | 120 bool IPEndPoint::operator==(const IPEndPoint& that) const { |
124 return address_ == that.address_ && port_ == that.port_; | 121 return address_ == that.address_ && port_ == that.port_; |
125 } | 122 } |
126 | 123 |
127 } // namespace net | 124 } // namespace net |
OLD | NEW |