Network System 0.1.1
High-performance modular networking library for scalable client-server applications
Loading...
Searching...
No Matches
kcenon::network::protocols::quic::frame_builder Class Reference

Builder for QUIC frames (RFC 9000 Section 12) More...

#include <frame.h>

Collaboration diagram for kcenon::network::protocols::quic::frame_builder:
Collaboration graph

Static Public Member Functions

static auto build (const frame &f) -> std::vector< uint8_t >
 Build any frame from variant.
 
static auto build_padding (size_t count=1) -> std::vector< uint8_t >
 Build PADDING frame.
 
static auto build_ping () -> std::vector< uint8_t >
 Build PING frame.
 
static auto build_ack (const ack_frame &f) -> std::vector< uint8_t >
 Build ACK frame.
 
static auto build_reset_stream (const reset_stream_frame &f) -> std::vector< uint8_t >
 Build RESET_STREAM frame.
 
static auto build_stop_sending (const stop_sending_frame &f) -> std::vector< uint8_t >
 Build STOP_SENDING frame.
 
static auto build_crypto (const crypto_frame &f) -> std::vector< uint8_t >
 Build CRYPTO frame.
 
static auto build_new_token (const new_token_frame &f) -> std::vector< uint8_t >
 Build NEW_TOKEN frame.
 
static auto build_stream (const stream_frame &f, bool include_length=true) -> std::vector< uint8_t >
 Build STREAM frame.
 
static auto build_max_data (const max_data_frame &f) -> std::vector< uint8_t >
 Build MAX_DATA frame.
 
static auto build_max_stream_data (const max_stream_data_frame &f) -> std::vector< uint8_t >
 Build MAX_STREAM_DATA frame.
 
static auto build_max_streams (const max_streams_frame &f) -> std::vector< uint8_t >
 Build MAX_STREAMS frame.
 
static auto build_data_blocked (const data_blocked_frame &f) -> std::vector< uint8_t >
 Build DATA_BLOCKED frame.
 
static auto build_stream_data_blocked (const stream_data_blocked_frame &f) -> std::vector< uint8_t >
 Build STREAM_DATA_BLOCKED frame.
 
static auto build_streams_blocked (const streams_blocked_frame &f) -> std::vector< uint8_t >
 Build STREAMS_BLOCKED frame.
 
static auto build_new_connection_id (const new_connection_id_frame &f) -> std::vector< uint8_t >
 Build NEW_CONNECTION_ID frame.
 
static auto build_retire_connection_id (const retire_connection_id_frame &f) -> std::vector< uint8_t >
 Build RETIRE_CONNECTION_ID frame.
 
static auto build_path_challenge (const path_challenge_frame &f) -> std::vector< uint8_t >
 Build PATH_CHALLENGE frame.
 
static auto build_path_response (const path_response_frame &f) -> std::vector< uint8_t >
 Build PATH_RESPONSE frame.
 
static auto build_connection_close (const connection_close_frame &f) -> std::vector< uint8_t >
 Build CONNECTION_CLOSE frame.
 
static auto build_handshake_done () -> std::vector< uint8_t >
 Build HANDSHAKE_DONE frame.
 

Static Private Member Functions

static void append_varint (std::vector< uint8_t > &buffer, uint64_t value)
 
static void append_bytes (std::vector< uint8_t > &buffer, std::span< const uint8_t > data)
 

Detailed Description

Builder for QUIC frames (RFC 9000 Section 12)

Serializes QUIC frame structures into raw bytes.

Definition at line 121 of file frame.h.

Member Function Documentation

◆ append_bytes()

void kcenon::network::protocols::quic::frame_builder::append_bytes ( std::vector< uint8_t > & buffer,
std::span< const uint8_t > data )
staticprivate

Definition at line 887 of file frame.cpp.

889{
890 buffer.insert(buffer.end(), data.begin(), data.end());
891}

◆ append_varint()

void kcenon::network::protocols::quic::frame_builder::append_varint ( std::vector< uint8_t > & buffer,
uint64_t value )
staticprivate

Definition at line 881 of file frame.cpp.

882{
883 auto encoded = varint::encode(value);
884 buffer.insert(buffer.end(), encoded.begin(), encoded.end());
885}
static auto encode(uint64_t value) -> std::vector< uint8_t >
Encode a value to variable-length format.
Definition varint.cpp:10

References kcenon::network::protocols::quic::varint::encode().

Here is the call graph for this function:

◆ build()

auto kcenon::network::protocols::quic::frame_builder::build ( const frame & f) -> std::vector<uint8_t>
staticnodiscard

Build any frame from variant.

Parameters
fFrame to serialize
Returns
Serialized frame bytes

Definition at line 893 of file frame.cpp.

894{
895 return std::visit([](const auto& fr) -> std::vector<uint8_t> {
896 using T = std::decay_t<decltype(fr)>;
897 if constexpr (std::is_same_v<T, padding_frame>)
898 return build_padding(fr.count);
899 else if constexpr (std::is_same_v<T, ping_frame>)
900 return build_ping();
901 else if constexpr (std::is_same_v<T, ack_frame>)
902 return build_ack(fr);
903 else if constexpr (std::is_same_v<T, reset_stream_frame>)
904 return build_reset_stream(fr);
905 else if constexpr (std::is_same_v<T, stop_sending_frame>)
906 return build_stop_sending(fr);
907 else if constexpr (std::is_same_v<T, crypto_frame>)
908 return build_crypto(fr);
909 else if constexpr (std::is_same_v<T, new_token_frame>)
910 return build_new_token(fr);
911 else if constexpr (std::is_same_v<T, stream_frame>)
912 return build_stream(fr);
913 else if constexpr (std::is_same_v<T, max_data_frame>)
914 return build_max_data(fr);
915 else if constexpr (std::is_same_v<T, max_stream_data_frame>)
916 return build_max_stream_data(fr);
917 else if constexpr (std::is_same_v<T, max_streams_frame>)
918 return build_max_streams(fr);
919 else if constexpr (std::is_same_v<T, data_blocked_frame>)
920 return build_data_blocked(fr);
921 else if constexpr (std::is_same_v<T, stream_data_blocked_frame>)
922 return build_stream_data_blocked(fr);
923 else if constexpr (std::is_same_v<T, streams_blocked_frame>)
924 return build_streams_blocked(fr);
925 else if constexpr (std::is_same_v<T, new_connection_id_frame>)
926 return build_new_connection_id(fr);
927 else if constexpr (std::is_same_v<T, retire_connection_id_frame>)
929 else if constexpr (std::is_same_v<T, path_challenge_frame>)
930 return build_path_challenge(fr);
931 else if constexpr (std::is_same_v<T, path_response_frame>)
932 return build_path_response(fr);
933 else if constexpr (std::is_same_v<T, connection_close_frame>)
934 return build_connection_close(fr);
935 else if constexpr (std::is_same_v<T, handshake_done_frame>)
936 return build_handshake_done();
937 else
938 return {};
939 }, f);
940}
static auto build_path_response(const path_response_frame &f) -> std::vector< uint8_t >
Build PATH_RESPONSE frame.
Definition frame.cpp:1166
static auto build_streams_blocked(const streams_blocked_frame &f) -> std::vector< uint8_t >
Build STREAMS_BLOCKED frame.
Definition frame.cpp:1116
static auto build_reset_stream(const reset_stream_frame &f) -> std::vector< uint8_t >
Build RESET_STREAM frame.
Definition frame.cpp:996
static auto build_stream(const stream_frame &f, bool include_length=true) -> std::vector< uint8_t >
Build STREAM frame.
Definition frame.cpp:1037
static auto build_stop_sending(const stop_sending_frame &f) -> std::vector< uint8_t >
Build STOP_SENDING frame.
Definition frame.cpp:1007
static auto build_ack(const ack_frame &f) -> std::vector< uint8_t >
Build ACK frame.
Definition frame.cpp:952
static auto build_padding(size_t count=1) -> std::vector< uint8_t >
Build PADDING frame.
Definition frame.cpp:942
static auto build_max_stream_data(const max_stream_data_frame &f) -> std::vector< uint8_t >
Build MAX_STREAM_DATA frame.
Definition frame.cpp:1076
static auto build_data_blocked(const data_blocked_frame &f) -> std::vector< uint8_t >
Build DATA_BLOCKED frame.
Definition frame.cpp:1097
static auto build_new_token(const new_token_frame &f) -> std::vector< uint8_t >
Build NEW_TOKEN frame.
Definition frame.cpp:1027
static auto build_max_data(const max_data_frame &f) -> std::vector< uint8_t >
Build MAX_DATA frame.
Definition frame.cpp:1067
static auto build_ping() -> std::vector< uint8_t >
Build PING frame.
Definition frame.cpp:947
static auto build_new_connection_id(const new_connection_id_frame &f) -> std::vector< uint8_t >
Build NEW_CONNECTION_ID frame.
Definition frame.cpp:1127
static auto build_crypto(const crypto_frame &f) -> std::vector< uint8_t >
Build CRYPTO frame.
Definition frame.cpp:1017
static auto build_path_challenge(const path_challenge_frame &f) -> std::vector< uint8_t >
Build PATH_CHALLENGE frame.
Definition frame.cpp:1157
static auto build_connection_close(const connection_close_frame &f) -> std::vector< uint8_t >
Build CONNECTION_CLOSE frame.
Definition frame.cpp:1175
static auto build_handshake_done() -> std::vector< uint8_t >
Build HANDSHAKE_DONE frame.
Definition frame.cpp:1200
static auto build_stream_data_blocked(const stream_data_blocked_frame &f) -> std::vector< uint8_t >
Build STREAM_DATA_BLOCKED frame.
Definition frame.cpp:1106
static auto build_retire_connection_id(const retire_connection_id_frame &f) -> std::vector< uint8_t >
Build RETIRE_CONNECTION_ID frame.
Definition frame.cpp:1148
static auto build_max_streams(const max_streams_frame &f) -> std::vector< uint8_t >
Build MAX_STREAMS frame.
Definition frame.cpp:1086

Referenced by kcenon::network::protocols::quic::connection::build_packet(), and kcenon::network::internal::quic_socket::send_packet().

Here is the caller graph for this function:

◆ build_ack()

auto kcenon::network::protocols::quic::frame_builder::build_ack ( const ack_frame & f) -> std::vector<uint8_t>
staticnodiscard

Build ACK frame.

Parameters
fACK frame structure
Returns
Serialized frame bytes

Definition at line 952 of file frame.cpp.

953{
954 std::vector<uint8_t> buffer;
955
956 // Frame type
957 append_varint(buffer, f.ecn ? static_cast<uint64_t>(frame_type::ack_ecn)
958 : static_cast<uint64_t>(frame_type::ack));
959
960 // Largest Acknowledged
961 append_varint(buffer, f.largest_acknowledged);
962
963 // ACK Delay
964 append_varint(buffer, f.ack_delay);
965
966 // ACK Range Count
967 append_varint(buffer, f.ranges.empty() ? 0 : f.ranges.size() - 1);
968
969 // First ACK Range (largest_ack - smallest_ack in first range)
970 // For simplicity, we'll use 0 if no ranges are specified
971 uint64_t first_range = 0;
972 if (!f.ranges.empty())
973 {
974 first_range = f.ranges[0].length;
975 }
976 append_varint(buffer, first_range);
977
978 // Additional ranges (skip first)
979 for (size_t i = 1; i < f.ranges.size(); ++i)
980 {
981 append_varint(buffer, f.ranges[i].gap);
982 append_varint(buffer, f.ranges[i].length);
983 }
984
985 // ECN Counts
986 if (f.ecn)
987 {
988 append_varint(buffer, f.ecn->ect0);
989 append_varint(buffer, f.ecn->ect1);
990 append_varint(buffer, f.ecn->ecn_ce);
991 }
992
993 return buffer;
994}
static void append_varint(std::vector< uint8_t > &buffer, uint64_t value)
Definition frame.cpp:881

References kcenon::network::protocols::quic::ack, and kcenon::network::protocols::quic::ack_ecn.

Referenced by kcenon::network::protocols::quic::connection::build_packet().

Here is the caller graph for this function:

◆ build_connection_close()

auto kcenon::network::protocols::quic::frame_builder::build_connection_close ( const connection_close_frame & f) -> std::vector<uint8_t>
staticnodiscard

Build CONNECTION_CLOSE frame.

Parameters
fCONNECTION_CLOSE frame structure
Returns
Serialized frame bytes

Definition at line 1175 of file frame.cpp.

1177{
1178 std::vector<uint8_t> buffer;
1179 append_varint(buffer, f.is_application_error
1180 ? static_cast<uint64_t>(frame_type::connection_close_app)
1181 : static_cast<uint64_t>(frame_type::connection_close));
1182
1183 append_varint(buffer, f.error_code);
1184
1185 // Frame Type (transport close only)
1186 if (!f.is_application_error)
1187 {
1188 append_varint(buffer, f.frame_type);
1189 }
1190
1191 // Reason Phrase Length
1192 append_varint(buffer, f.reason_phrase.size());
1193
1194 // Reason Phrase
1195 buffer.insert(buffer.end(), f.reason_phrase.begin(), f.reason_phrase.end());
1196
1197 return buffer;
1198}

References kcenon::network::protocols::quic::connection_close, and kcenon::network::protocols::quic::connection_close_app.

◆ build_crypto()

auto kcenon::network::protocols::quic::frame_builder::build_crypto ( const crypto_frame & f) -> std::vector<uint8_t>
staticnodiscard

Build CRYPTO frame.

Parameters
fCRYPTO frame structure
Returns
Serialized frame bytes

Definition at line 1017 of file frame.cpp.

1018{
1019 std::vector<uint8_t> buffer;
1020 append_varint(buffer, static_cast<uint64_t>(frame_type::crypto));
1021 append_varint(buffer, f.offset);
1022 append_varint(buffer, f.data.size());
1023 append_bytes(buffer, f.data);
1024 return buffer;
1025}
static void append_bytes(std::vector< uint8_t > &buffer, std::span< const uint8_t > data)
Definition frame.cpp:887

References kcenon::network::protocols::quic::crypto.

Referenced by kcenon::network::protocols::quic::connection::build_packet().

Here is the caller graph for this function:

◆ build_data_blocked()

auto kcenon::network::protocols::quic::frame_builder::build_data_blocked ( const data_blocked_frame & f) -> std::vector<uint8_t>
staticnodiscard

Build DATA_BLOCKED frame.

Parameters
fDATA_BLOCKED frame structure
Returns
Serialized frame bytes

Definition at line 1097 of file frame.cpp.

1099{
1100 std::vector<uint8_t> buffer;
1101 append_varint(buffer, static_cast<uint64_t>(frame_type::data_blocked));
1102 append_varint(buffer, f.maximum_data);
1103 return buffer;
1104}

References kcenon::network::protocols::quic::data_blocked.

◆ build_handshake_done()

auto kcenon::network::protocols::quic::frame_builder::build_handshake_done ( ) -> std::vector<uint8_t>
staticnodiscard

Build HANDSHAKE_DONE frame.

Returns
Serialized frame bytes

Definition at line 1200 of file frame.cpp.

1201{
1202 return {static_cast<uint8_t>(frame_type::handshake_done)};
1203}

References kcenon::network::protocols::quic::handshake_done.

◆ build_max_data()

auto kcenon::network::protocols::quic::frame_builder::build_max_data ( const max_data_frame & f) -> std::vector<uint8_t>
staticnodiscard

Build MAX_DATA frame.

Parameters
fMAX_DATA frame structure
Returns
Serialized frame bytes

Definition at line 1067 of file frame.cpp.

1069{
1070 std::vector<uint8_t> buffer;
1071 append_varint(buffer, static_cast<uint64_t>(frame_type::max_data));
1072 append_varint(buffer, f.maximum_data);
1073 return buffer;
1074}

References kcenon::network::protocols::quic::max_data.

◆ build_max_stream_data()

auto kcenon::network::protocols::quic::frame_builder::build_max_stream_data ( const max_stream_data_frame & f) -> std::vector<uint8_t>
staticnodiscard

Build MAX_STREAM_DATA frame.

Parameters
fMAX_STREAM_DATA frame structure
Returns
Serialized frame bytes

Definition at line 1076 of file frame.cpp.

1078{
1079 std::vector<uint8_t> buffer;
1080 append_varint(buffer, static_cast<uint64_t>(frame_type::max_stream_data));
1081 append_varint(buffer, f.stream_id);
1082 append_varint(buffer, f.maximum_stream_data);
1083 return buffer;
1084}

References kcenon::network::protocols::quic::max_stream_data.

◆ build_max_streams()

auto kcenon::network::protocols::quic::frame_builder::build_max_streams ( const max_streams_frame & f) -> std::vector<uint8_t>
staticnodiscard

Build MAX_STREAMS frame.

Parameters
fMAX_STREAMS frame structure
Returns
Serialized frame bytes

Definition at line 1086 of file frame.cpp.

1088{
1089 std::vector<uint8_t> buffer;
1090 append_varint(buffer, f.bidirectional
1091 ? static_cast<uint64_t>(frame_type::max_streams_bidi)
1092 : static_cast<uint64_t>(frame_type::max_streams_uni));
1093 append_varint(buffer, f.maximum_streams);
1094 return buffer;
1095}

References kcenon::network::protocols::quic::max_streams_bidi, and kcenon::network::protocols::quic::max_streams_uni.

◆ build_new_connection_id()

auto kcenon::network::protocols::quic::frame_builder::build_new_connection_id ( const new_connection_id_frame & f) -> std::vector<uint8_t>
staticnodiscard

Build NEW_CONNECTION_ID frame.

Parameters
fNEW_CONNECTION_ID frame structure
Returns
Serialized frame bytes

Definition at line 1127 of file frame.cpp.

1129{
1130 std::vector<uint8_t> buffer;
1131 append_varint(buffer, static_cast<uint64_t>(frame_type::new_connection_id));
1132 append_varint(buffer, f.sequence_number);
1133 append_varint(buffer, f.retire_prior_to);
1134
1135 // Connection ID length (1 byte, not varint)
1136 buffer.push_back(static_cast<uint8_t>(f.connection_id.size()));
1137
1138 // Connection ID
1139 append_bytes(buffer, f.connection_id);
1140
1141 // Stateless Reset Token
1142 buffer.insert(buffer.end(), f.stateless_reset_token.begin(),
1143 f.stateless_reset_token.end());
1144
1145 return buffer;
1146}

References kcenon::network::protocols::quic::new_connection_id.

◆ build_new_token()

auto kcenon::network::protocols::quic::frame_builder::build_new_token ( const new_token_frame & f) -> std::vector<uint8_t>
staticnodiscard

Build NEW_TOKEN frame.

Parameters
fNEW_TOKEN frame structure
Returns
Serialized frame bytes

Definition at line 1027 of file frame.cpp.

1029{
1030 std::vector<uint8_t> buffer;
1031 append_varint(buffer, static_cast<uint64_t>(frame_type::new_token));
1032 append_varint(buffer, f.token.size());
1033 append_bytes(buffer, f.token);
1034 return buffer;
1035}

References kcenon::network::protocols::quic::new_token.

◆ build_padding()

auto kcenon::network::protocols::quic::frame_builder::build_padding ( size_t count = 1) -> std::vector<uint8_t>
staticnodiscard

Build PADDING frame.

Parameters
countNumber of padding bytes (default 1)
Returns
Serialized frame bytes

Definition at line 942 of file frame.cpp.

943{
944 return std::vector<uint8_t>(count, 0x00);
945}

Referenced by kcenon::network::protocols::quic::connection::build_packet().

Here is the caller graph for this function:

◆ build_path_challenge()

auto kcenon::network::protocols::quic::frame_builder::build_path_challenge ( const path_challenge_frame & f) -> std::vector<uint8_t>
staticnodiscard

Build PATH_CHALLENGE frame.

Parameters
fPATH_CHALLENGE frame structure
Returns
Serialized frame bytes

Definition at line 1157 of file frame.cpp.

1159{
1160 std::vector<uint8_t> buffer;
1161 append_varint(buffer, static_cast<uint64_t>(frame_type::path_challenge));
1162 buffer.insert(buffer.end(), f.data.begin(), f.data.end());
1163 return buffer;
1164}

References kcenon::network::protocols::quic::path_challenge.

◆ build_path_response()

auto kcenon::network::protocols::quic::frame_builder::build_path_response ( const path_response_frame & f) -> std::vector<uint8_t>
staticnodiscard

Build PATH_RESPONSE frame.

Parameters
fPATH_RESPONSE frame structure
Returns
Serialized frame bytes

Definition at line 1166 of file frame.cpp.

1168{
1169 std::vector<uint8_t> buffer;
1170 append_varint(buffer, static_cast<uint64_t>(frame_type::path_response));
1171 buffer.insert(buffer.end(), f.data.begin(), f.data.end());
1172 return buffer;
1173}

References kcenon::network::protocols::quic::path_response.

◆ build_ping()

auto kcenon::network::protocols::quic::frame_builder::build_ping ( ) -> std::vector<uint8_t>
staticnodiscard

Build PING frame.

Returns
Serialized frame bytes

Definition at line 947 of file frame.cpp.

948{
949 return {0x01};
950}

◆ build_reset_stream()

auto kcenon::network::protocols::quic::frame_builder::build_reset_stream ( const reset_stream_frame & f) -> std::vector<uint8_t>
staticnodiscard

Build RESET_STREAM frame.

Parameters
fRESET_STREAM frame structure
Returns
Serialized frame bytes

Definition at line 996 of file frame.cpp.

998{
999 std::vector<uint8_t> buffer;
1000 append_varint(buffer, static_cast<uint64_t>(frame_type::reset_stream));
1001 append_varint(buffer, f.stream_id);
1002 append_varint(buffer, f.application_error_code);
1003 append_varint(buffer, f.final_size);
1004 return buffer;
1005}

References kcenon::network::protocols::quic::reset_stream.

◆ build_retire_connection_id()

auto kcenon::network::protocols::quic::frame_builder::build_retire_connection_id ( const retire_connection_id_frame & f) -> std::vector<uint8_t>
staticnodiscard

Build RETIRE_CONNECTION_ID frame.

Parameters
fRETIRE_CONNECTION_ID frame structure
Returns
Serialized frame bytes

Definition at line 1148 of file frame.cpp.

1150{
1151 std::vector<uint8_t> buffer;
1152 append_varint(buffer, static_cast<uint64_t>(frame_type::retire_connection_id));
1153 append_varint(buffer, f.sequence_number);
1154 return buffer;
1155}

References kcenon::network::protocols::quic::retire_connection_id.

◆ build_stop_sending()

auto kcenon::network::protocols::quic::frame_builder::build_stop_sending ( const stop_sending_frame & f) -> std::vector<uint8_t>
staticnodiscard

Build STOP_SENDING frame.

Parameters
fSTOP_SENDING frame structure
Returns
Serialized frame bytes

Definition at line 1007 of file frame.cpp.

1009{
1010 std::vector<uint8_t> buffer;
1011 append_varint(buffer, static_cast<uint64_t>(frame_type::stop_sending));
1012 append_varint(buffer, f.stream_id);
1013 append_varint(buffer, f.application_error_code);
1014 return buffer;
1015}

References kcenon::network::protocols::quic::stop_sending.

◆ build_stream()

auto kcenon::network::protocols::quic::frame_builder::build_stream ( const stream_frame & f,
bool include_length = true ) -> std::vector<uint8_t>
staticnodiscard

Build STREAM frame.

Parameters
fSTREAM frame structure
include_lengthWhether to include explicit length field
Returns
Serialized frame bytes

Definition at line 1037 of file frame.cpp.

1039{
1040 std::vector<uint8_t> buffer;
1041
1042 // Build frame type with flags
1043 uint8_t type = make_stream_type(f.fin, include_length, f.offset > 0);
1044 buffer.push_back(type);
1045
1046 // Stream ID
1047 append_varint(buffer, f.stream_id);
1048
1049 // Offset (if non-zero)
1050 if (f.offset > 0)
1051 {
1052 append_varint(buffer, f.offset);
1053 }
1054
1055 // Length (if requested)
1056 if (include_length)
1057 {
1058 append_varint(buffer, f.data.size());
1059 }
1060
1061 // Data
1062 append_bytes(buffer, f.data);
1063
1064 return buffer;
1065}
constexpr auto make_stream_type(bool has_fin, bool has_length, bool has_offset) noexcept -> uint8_t
Build STREAM frame type from flags.
Definition frame_types.h:89

References kcenon::network::protocols::quic::make_stream_type().

Referenced by kcenon::network::protocols::quic::connection::build_packet().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ build_stream_data_blocked()

auto kcenon::network::protocols::quic::frame_builder::build_stream_data_blocked ( const stream_data_blocked_frame & f) -> std::vector<uint8_t>
staticnodiscard

Build STREAM_DATA_BLOCKED frame.

Parameters
fSTREAM_DATA_BLOCKED frame structure
Returns
Serialized frame bytes

Definition at line 1106 of file frame.cpp.

1108{
1109 std::vector<uint8_t> buffer;
1110 append_varint(buffer, static_cast<uint64_t>(frame_type::stream_data_blocked));
1111 append_varint(buffer, f.stream_id);
1112 append_varint(buffer, f.maximum_stream_data);
1113 return buffer;
1114}

References kcenon::network::protocols::quic::stream_data_blocked.

◆ build_streams_blocked()

auto kcenon::network::protocols::quic::frame_builder::build_streams_blocked ( const streams_blocked_frame & f) -> std::vector<uint8_t>
staticnodiscard

Build STREAMS_BLOCKED frame.

Parameters
fSTREAMS_BLOCKED frame structure
Returns
Serialized frame bytes

Definition at line 1116 of file frame.cpp.

1118{
1119 std::vector<uint8_t> buffer;
1120 append_varint(buffer, f.bidirectional
1121 ? static_cast<uint64_t>(frame_type::streams_blocked_bidi)
1122 : static_cast<uint64_t>(frame_type::streams_blocked_uni));
1123 append_varint(buffer, f.maximum_streams);
1124 return buffer;
1125}

References kcenon::network::protocols::quic::streams_blocked_bidi, and kcenon::network::protocols::quic::streams_blocked_uni.


The documentation for this class was generated from the following files: