summaryrefslogtreecommitdiff
path: root/chromium/net/tools/quic/test_tools/quic_client_peer.cc
blob: 961cc823e2db4b02bc3e5be6a3f331000088cf3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "net/tools/quic/test_tools/quic_client_peer.h"

#include "net/tools/quic/quic_client.h"

namespace net {
namespace test {

// static
QuicCryptoClientConfig* QuicClientPeer::GetCryptoConfig(QuicClient* client) {
  return client->crypto_config();
}

// static
bool QuicClientPeer::CreateUDPSocketAndBind(QuicClient* client) {
  return client->CreateUDPSocketAndBind();
}

// static
void QuicClientPeer::CleanUpUDPSocket(QuicClient* client, int fd) {
  client->CleanUpUDPSocket(fd);
}

// static
void QuicClientPeer::SetClientPort(QuicClient* client, int port) {
  client->fd_address_map_.back().second =
      IPEndPoint(client->GetLatestClientAddress().address(), port);
}

// static
void QuicClientPeer::SetWriter(QuicClient* client, QuicPacketWriter* writer) {
  client->set_writer(writer);
}

}  // namespace test
}  // namespace net