| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/browser/renderer_host/p2p/socket_host_test_utils.h" | 5 #include "content/browser/renderer_host/p2p/socket_host_test_utils.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/sys_byteorder.h" | 10 #include "base/sys_byteorder.h" |
| 11 #include "base/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
| 12 #include "net/base/completion_callback.h" | 12 #include "net/base/completion_callback.h" |
| 13 #include "net/base/io_buffer.h" | 13 #include "net/base/io_buffer.h" |
| 14 #include "net/base/ip_address.h" | 14 #include "net/base/ip_address.h" |
| 15 | 15 |
| 16 const int kStunHeaderSize = 20; | 16 const int kStunHeaderSize = 20; |
| 17 const uint16_t kStunBindingRequest = 0x0001; | 17 const uint16_t kStunBindingRequest = 0x0001; |
| 18 const uint16_t kStunBindingResponse = 0x0102; | 18 const uint16_t kStunBindingResponse = 0x0102; |
| 19 const uint16_t kStunBindingError = 0x0111; | 19 const uint16_t kStunBindingError = 0x0111; |
| 20 const uint32_t kStunMagicCookie = 0x2112A442; | 20 const uint32_t kStunMagicCookie = 0x2112A442; |
| 21 | 21 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 211 |
| 212 void CreateStunError(std::vector<char>* packet) { | 212 void CreateStunError(std::vector<char>* packet) { |
| 213 CreateStunPacket(packet, kStunBindingError); | 213 CreateStunPacket(packet, kStunBindingError); |
| 214 } | 214 } |
| 215 | 215 |
| 216 net::IPEndPoint ParseAddress(const std::string& ip_str, uint16_t port) { | 216 net::IPEndPoint ParseAddress(const std::string& ip_str, uint16_t port) { |
| 217 net::IPAddress ip; | 217 net::IPAddress ip; |
| 218 EXPECT_TRUE(ip.AssignFromIPLiteral(ip_str)); | 218 EXPECT_TRUE(ip.AssignFromIPLiteral(ip_str)); |
| 219 return net::IPEndPoint(ip, port); | 219 return net::IPEndPoint(ip, port); |
| 220 } | 220 } |
| OLD | NEW |