OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/quic/quic_socket_address_coder.h" | 5 #include "net/quic/quic_socket_address_coder.h" |
6 | 6 |
| 7 #include "net/base/sys_addrinfo.h" |
| 8 |
7 using std::string; | 9 using std::string; |
8 | 10 |
9 namespace net { | 11 namespace net { |
10 | 12 |
11 namespace { | 13 namespace { |
12 | 14 |
13 // For convenience, the values of these constants match the values of AF_INET | 15 // For convenience, the values of these constants match the values of AF_INET |
14 // and AF_INET6 on Linux. | 16 // and AF_INET6 on Linux. |
15 const uint16 kIPv4 = 2; | 17 const uint16 kIPv4 = 2; |
16 const uint16 kIPv6 = 10; | 18 const uint16 kIPv6 = 10; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 if (length != sizeof(port)) { | 82 if (length != sizeof(port)) { |
81 return false; | 83 return false; |
82 } | 84 } |
83 memcpy(&port, data, length); | 85 memcpy(&port, data, length); |
84 | 86 |
85 address_ = IPEndPoint(ip, port); | 87 address_ = IPEndPoint(ip, port); |
86 return true; | 88 return true; |
87 } | 89 } |
88 | 90 |
89 } // namespace net | 91 } // namespace net |
OLD | NEW |