xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/quic/core/frames/quic_path_challenge_frame.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright (c) 2018 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 #include "quiche/quic/core/frames/quic_path_challenge_frame.h"
6 
7 #include "absl/strings/escaping.h"
8 #include "quiche/quic/platform/api/quic_bug_tracker.h"
9 
10 namespace quic {
11 
QuicPathChallengeFrame()12 QuicPathChallengeFrame::QuicPathChallengeFrame()
13     : QuicInlinedFrame(PATH_CHALLENGE_FRAME) {}
14 
QuicPathChallengeFrame(QuicControlFrameId control_frame_id,const QuicPathFrameBuffer & data_buff)15 QuicPathChallengeFrame::QuicPathChallengeFrame(
16     QuicControlFrameId control_frame_id, const QuicPathFrameBuffer& data_buff)
17     : QuicInlinedFrame(PATH_CHALLENGE_FRAME),
18       control_frame_id(control_frame_id) {
19   memcpy(data_buffer.data(), data_buff.data(), data_buffer.size());
20 }
21 
operator <<(std::ostream & os,const QuicPathChallengeFrame & frame)22 std::ostream& operator<<(std::ostream& os,
23                          const QuicPathChallengeFrame& frame) {
24   os << "{ control_frame_id: " << frame.control_frame_id << ", data: "
25      << absl::BytesToHexString(absl::string_view(
26             reinterpret_cast<const char*>(frame.data_buffer.data()),
27             frame.data_buffer.size()))
28      << " }\n";
29   return os;
30 }
31 
32 }  // namespace quic
33