| 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/socket/socket_test_util.h" | 5 #include "net/socket/socket_test_util.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 } | 1195 } |
| 1196 | 1196 |
| 1197 int DeterministicMockUDPClientSocket::SetReceiveBufferSize(int32 size) { | 1197 int DeterministicMockUDPClientSocket::SetReceiveBufferSize(int32 size) { |
| 1198 return OK; | 1198 return OK; |
| 1199 } | 1199 } |
| 1200 | 1200 |
| 1201 int DeterministicMockUDPClientSocket::SetSendBufferSize(int32 size) { | 1201 int DeterministicMockUDPClientSocket::SetSendBufferSize(int32 size) { |
| 1202 return OK; | 1202 return OK; |
| 1203 } | 1203 } |
| 1204 | 1204 |
| 1205 void DeterministicMockUDPClientSocket::Close() { | 1205 int DeterministicMockUDPClientSocket::Close() { |
| 1206 connected_ = false; | 1206 connected_ = false; |
| 1207 return OK; |
| 1207 } | 1208 } |
| 1208 | 1209 |
| 1209 int DeterministicMockUDPClientSocket::GetPeerAddress( | 1210 int DeterministicMockUDPClientSocket::GetPeerAddress( |
| 1210 IPEndPoint* address) const { | 1211 IPEndPoint* address) const { |
| 1211 *address = peer_address_; | 1212 *address = peer_address_; |
| 1212 return OK; | 1213 return OK; |
| 1213 } | 1214 } |
| 1214 | 1215 |
| 1215 int DeterministicMockUDPClientSocket::GetLocalAddress( | 1216 int DeterministicMockUDPClientSocket::GetLocalAddress( |
| 1216 IPEndPoint* address) const { | 1217 IPEndPoint* address) const { |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1608 } | 1609 } |
| 1609 | 1610 |
| 1610 int MockUDPClientSocket::SetReceiveBufferSize(int32 size) { | 1611 int MockUDPClientSocket::SetReceiveBufferSize(int32 size) { |
| 1611 return OK; | 1612 return OK; |
| 1612 } | 1613 } |
| 1613 | 1614 |
| 1614 int MockUDPClientSocket::SetSendBufferSize(int32 size) { | 1615 int MockUDPClientSocket::SetSendBufferSize(int32 size) { |
| 1615 return OK; | 1616 return OK; |
| 1616 } | 1617 } |
| 1617 | 1618 |
| 1618 void MockUDPClientSocket::Close() { | 1619 int MockUDPClientSocket::Close() { |
| 1619 connected_ = false; | 1620 connected_ = false; |
| 1621 return OK; |
| 1620 } | 1622 } |
| 1621 | 1623 |
| 1622 int MockUDPClientSocket::GetPeerAddress(IPEndPoint* address) const { | 1624 int MockUDPClientSocket::GetPeerAddress(IPEndPoint* address) const { |
| 1623 *address = peer_addr_; | 1625 *address = peer_addr_; |
| 1624 return OK; | 1626 return OK; |
| 1625 } | 1627 } |
| 1626 | 1628 |
| 1627 int MockUDPClientSocket::GetLocalAddress(IPEndPoint* address) const { | 1629 int MockUDPClientSocket::GetLocalAddress(IPEndPoint* address) const { |
| 1628 IPAddressNumber ip; | 1630 IPAddressNumber ip; |
| 1629 bool rv = ParseIPLiteralToNumber("192.0.2.33", &ip); | 1631 bool rv = ParseIPLiteralToNumber("192.0.2.33", &ip); |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2013 | 2015 |
| 2014 const char kSOCKS5OkRequest[] = | 2016 const char kSOCKS5OkRequest[] = |
| 2015 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; | 2017 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; |
| 2016 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); | 2018 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); |
| 2017 | 2019 |
| 2018 const char kSOCKS5OkResponse[] = | 2020 const char kSOCKS5OkResponse[] = |
| 2019 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; | 2021 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; |
| 2020 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); | 2022 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); |
| 2021 | 2023 |
| 2022 } // namespace net | 2024 } // namespace net |
| OLD | NEW |