OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_LIMITED_MTU_TEST_WRITER_H_ |
| 6 #define NET_TOOLS_QUIC_TEST_TOOLS_LIMITED_MTU_TEST_WRITER_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "net/quic/quic_protocol.h" |
| 10 #include "net/tools/quic/quic_packet_writer_wrapper.h" |
| 11 |
| 12 namespace net { |
| 13 namespace tools { |
| 14 namespace test { |
| 15 |
| 16 // Simulates a connection over a link with fixed MTU. Drops packets which |
| 17 // exceed the MTU and passes the rest of them as-is. |
| 18 class LimitedMtuTestWriter : public QuicPacketWriterWrapper { |
| 19 public: |
| 20 explicit LimitedMtuTestWriter(QuicByteCount mtu); |
| 21 ~LimitedMtuTestWriter() override; |
| 22 |
| 23 // Inherited from QuicPacketWriterWrapper. |
| 24 WriteResult WritePacket(const char* buffer, |
| 25 size_t buf_len, |
| 26 const IPAddressNumber& self_address, |
| 27 const IPEndPoint& peer_address) override; |
| 28 |
| 29 private: |
| 30 QuicByteCount mtu_; |
| 31 |
| 32 DISALLOW_COPY_AND_ASSIGN(LimitedMtuTestWriter); |
| 33 }; |
| 34 |
| 35 } // namespace test |
| 36 } // namespace tools |
| 37 } // namespace net |
| 38 |
| 39 #endif // NET_TOOLS_QUIC_TEST_TOOLS_LIMITED_MTU_TEST_WRITER_H_ |
OLD | NEW |