• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "quiche/quic/core/frames/quic_inlined_frame.h"
12 #include "quiche/quic/core/quic_types.h"
13 #include "quiche/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> {
QuicPaddingFrameQuicPaddingFrame20   QuicPaddingFrame() : QuicInlinedFrame(PADDING_FRAME) {}
QuicPaddingFrameQuicPaddingFrame21   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, const QuicPaddingFrame& padding_frame);
26 
27   QuicFrameType type;
28 
29   // -1: full padding to the end of a max-sized packet
30   // otherwise: only pad up to num_padding_bytes bytes
31   int num_padding_bytes = -1;
32 };
33 
34 }  // namespace quic
35 
36 #endif  // QUICHE_QUIC_CORE_FRAMES_QUIC_PADDING_FRAME_H_
37