QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 1 | // Copyright (c) 2016 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 QUICHE_QUIC_CORE_FRAMES_QUIC_PADDING_FRAME_H_ |
| 6 | #define QUICHE_QUIC_CORE_FRAMES_QUIC_PADDING_FRAME_H_ |
| 7 | |
| 8 | #include <cstdint> |
| 9 | #include <ostream> |
| 10 | |
| 11 | #include "net/third_party/quiche/src/quic/core/frames/quic_inlined_frame.h" |
| 12 | #include "net/third_party/quiche/src/quic/core/quic_types.h" |
| 13 | #include "net/third_party/quiche/src/quic/platform/api/quic_export.h" |
| 14 | |
| 15 | namespace quic { |
| 16 | |
| 17 | // A padding frame contains no payload. |
| 18 | struct QUIC_EXPORT_PRIVATE QuicPaddingFrame |
| 19 | : public QuicInlinedFrame<QuicPaddingFrame> { |
| 20 | QuicPaddingFrame() : QuicInlinedFrame(PADDING_FRAME), num_padding_bytes(-1) {} |
| 21 | explicit QuicPaddingFrame(int num_padding_bytes) |
| 22 | : QuicInlinedFrame(PADDING_FRAME), num_padding_bytes(num_padding_bytes) {} |
| 23 | |
| 24 | friend QUIC_EXPORT_PRIVATE std::ostream& operator<<( |
| 25 | std::ostream& os, |
| 26 | const QuicPaddingFrame& s); |
| 27 | |
| 28 | // -1: full padding to the end of a max-sized packet |
| 29 | // otherwise: only pad up to num_padding_bytes bytes |
| 30 | int num_padding_bytes; |
| 31 | }; |
| 32 | |
| 33 | } // namespace quic |
| 34 | |
| 35 | #endif // QUICHE_QUIC_CORE_FRAMES_QUIC_PADDING_FRAME_H_ |