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 885 of file frame.cpp.

887{
888 buffer.insert(buffer.end(), data.begin(), data.end());
889}

◆ append_varint()

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

Definition at line 879 of file frame.cpp.

880{
881 auto encoded = varint::encode(value);
882 buffer.insert(buffer.end(), encoded.begin(), encoded.end());
883}
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 891 of file frame.cpp.

892{
893 return std::visit([](const auto& fr) -> std::vector<uint8_t> {
894 using T = std::decay_t<decltype(fr)>;
895 if constexpr (std::is_same_v<T, padding_frame>)
896 return build_padding(fr.count);
897 else if constexpr (std::is_same_v<T, ping_frame>)
898 return build_ping();
899 else if constexpr (std::is_same_v<T, ack_frame>)
900 return build_ack(fr);
901 else if constexpr (std::is_same_v<T, reset_stream_frame>)
902 return build_reset_stream(fr);
903 else if constexpr (std::is_same_v<T, stop_sending_frame>)
904 return build_stop_sending(fr);
905 else if constexpr (std::is_same_v<T, crypto_frame>)
906 return build_crypto(fr);
907 else if constexpr (std::is_same_v<T, new_token_frame>)
908 return build_new_token(fr);
909 else if constexpr (std::is_same_v<T, stream_frame>)
910 return build_stream(fr);
911 else if constexpr (std::is_same_v<T, max_data_frame>)
912 return build_max_data(fr);
913 else if constexpr (std::is_same_v<T, max_stream_data_frame>)
914 return build_max_stream_data(fr);
915 else if constexpr (std::is_same_v<T, max_streams_frame>)
916 return build_max_streams(fr);
917 else if constexpr (std::is_same_v<T, data_blocked_frame>)
918 return build_data_blocked(fr);
919 else if constexpr (std::is_same_v<T, stream_data_blocked_frame>)
920 return build_stream_data_blocked(fr);
921 else if constexpr (std::is_same_v<T, streams_blocked_frame>)
922 return build_streams_blocked(fr);
923 else if constexpr (std::is_same_v<T, new_connection_id_frame>)
924 return build_new_connection_id(fr);
925 else if constexpr (std::is_same_v<T, retire_connection_id_frame>)
927 else if constexpr (std::is_same_v<T, path_challenge_frame>)
928 return build_path_challenge(fr);
929 else if constexpr (std::is_same_v<T, path_response_frame>)
930 return build_path_response(fr);
931 else if constexpr (std::is_same_v<T, connection_close_frame>)
932 return build_connection_close(fr);
933 else if constexpr (std::is_same_v<T, handshake_done_frame>)
934 return build_handshake_done();
935 else
936 return {};
937 }, f);
938}
static auto build_path_response(const path_response_frame &f) -> std::vector< uint8_t >
Build PATH_RESPONSE frame.
Definition frame.cpp:1164
static auto build_streams_blocked(const streams_blocked_frame &f) -> std::vector< uint8_t >
Build STREAMS_BLOCKED frame.
Definition frame.cpp:1114
static auto build_reset_stream(const reset_stream_frame &f) -> std::vector< uint8_t >
Build RESET_STREAM frame.
Definition frame.cpp:994
static auto build_stream(const stream_frame &f, bool include_length=true) -> std::vector< uint8_t >
Build STREAM frame.
Definition frame.cpp:1035
static auto build_stop_sending(const stop_sending_frame &f) -> std::vector< uint8_t >
Build STOP_SENDING frame.
Definition frame.cpp:1005
static auto build_ack(const ack_frame &f) -> std::vector< uint8_t >
Build ACK frame.
Definition frame.cpp:950
static auto build_padding(size_t count=1) -> std::vector< uint8_t >
Build PADDING frame.
Definition frame.cpp:940
static auto build_max_stream_data(const max_stream_data_frame &f) -> std::vector< uint8_t >
Build MAX_STREAM_DATA frame.
Definition frame.cpp:1074
static auto build_data_blocked(const data_blocked_frame &f) -> std::vector< uint8_t >
Build DATA_BLOCKED frame.
Definition frame.cpp:1095
static auto build_new_token(const new_token_frame &f) -> std::vector< uint8_t >
Build NEW_TOKEN frame.
Definition frame.cpp:1025
static auto build_max_data(const max_data_frame &f) -> std::vector< uint8_t >
Build MAX_DATA frame.
Definition frame.cpp:1065
static auto build_ping() -> std::vector< uint8_t >
Build PING frame.
Definition frame.cpp:945
static auto build_new_connection_id(const new_connection_id_frame &f) -> std::vector< uint8_t >
Build NEW_CONNECTION_ID frame.
Definition frame.cpp:1125
static auto build_crypto(const crypto_frame &f) -> std::vector< uint8_t >
Build CRYPTO frame.
Definition frame.cpp:1015
static auto build_path_challenge(const path_challenge_frame &f) -> std::vector< uint8_t >
Build PATH_CHALLENGE frame.
Definition frame.cpp:1155
static auto build_connection_close(const connection_close_frame &f) -> std::vector< uint8_t >
Build CONNECTION_CLOSE frame.
Definition frame.cpp:1173
static auto build_handshake_done() -> std::vector< uint8_t >
Build HANDSHAKE_DONE frame.
Definition frame.cpp:1198
static auto build_stream_data_blocked(const stream_data_blocked_frame &f) -> std::vector< uint8_t >
Build STREAM_DATA_BLOCKED frame.
Definition frame.cpp:1104
static auto build_retire_connection_id(const retire_connection_id_frame &f) -> std::vector< uint8_t >
Build RETIRE_CONNECTION_ID frame.
Definition frame.cpp:1146
static auto build_max_streams(const max_streams_frame &f) -> std::vector< uint8_t >
Build MAX_STREAMS frame.
Definition frame.cpp:1084

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 950 of file frame.cpp.

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

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 1173 of file frame.cpp.

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

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 1015 of file frame.cpp.

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

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 1095 of file frame.cpp.

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

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 1198 of file frame.cpp.

1199{
1200 return {static_cast<uint8_t>(frame_type::handshake_done)};
1201}

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 1065 of file frame.cpp.

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

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 1074 of file frame.cpp.

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

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 1084 of file frame.cpp.

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

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 1125 of file frame.cpp.

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

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 1025 of file frame.cpp.

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

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 940 of file frame.cpp.

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

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 1155 of file frame.cpp.

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

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 1164 of file frame.cpp.

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

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 945 of file frame.cpp.

946{
947 return {0x01};
948}

◆ 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 994 of file frame.cpp.

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

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 1146 of file frame.cpp.

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

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 1005 of file frame.cpp.

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

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 1035 of file frame.cpp.

1037{
1038 std::vector<uint8_t> buffer;
1039
1040 // Build frame type with flags
1041 uint8_t type = make_stream_type(f.fin, include_length, f.offset > 0);
1042 buffer.push_back(type);
1043
1044 // Stream ID
1045 append_varint(buffer, f.stream_id);
1046
1047 // Offset (if non-zero)
1048 if (f.offset > 0)
1049 {
1050 append_varint(buffer, f.offset);
1051 }
1052
1053 // Length (if requested)
1054 if (include_length)
1055 {
1056 append_varint(buffer, f.data.size());
1057 }
1058
1059 // Data
1060 append_bytes(buffer, f.data);
1061
1062 return buffer;
1063}
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 1104 of file frame.cpp.

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

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 1114 of file frame.cpp.

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

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: