mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-28 22:31:06 +01:00
CLEANUP: quic: rename frame types with an explicit prefix
Each frame type used in quic_frame union has been renamed with the following prefix "qf_". This helps to differentiate frame instances from other internal objects. This should be backported up to 2.7.
This commit is contained in:
parent
b73762ad78
commit
888c5f283a
@ -199,7 +199,7 @@ static inline void free_quic_conn_cids(struct quic_conn *conn)
|
||||
static inline void quic_connection_id_to_frm_cpy(struct quic_frame *dst,
|
||||
struct quic_connection_id *src)
|
||||
{
|
||||
struct quic_new_connection_id *to = &dst->new_connection_id;
|
||||
struct qf_new_connection_id *to = &dst->new_connection_id;
|
||||
|
||||
to->seq_num = src->seq_num.key;
|
||||
to->retire_prior_to = src->retire_prior_to;
|
||||
@ -388,7 +388,7 @@ static inline int quic_packet_number_encode(unsigned char **buf,
|
||||
* <conn> QUIC connection. Note that the value of <ack_delay> coming from
|
||||
* ACK frame is in microseconds.
|
||||
*/
|
||||
static inline unsigned int quic_ack_delay_ms(struct quic_ack *ack_frm,
|
||||
static inline unsigned int quic_ack_delay_ms(struct qf_ack *ack_frm,
|
||||
struct quic_conn *conn)
|
||||
{
|
||||
return (ack_frm->ack_delay << conn->tx.params.ack_delay_exponent) / 1000;
|
||||
|
||||
@ -113,11 +113,11 @@ enum quic_frame_type {
|
||||
/* Maximum phrase length in CONNECTION_CLOSE frame */
|
||||
#define QUIC_CC_REASON_PHRASE_MAXLEN 64
|
||||
|
||||
struct quic_padding {
|
||||
struct qf_padding {
|
||||
size_t len;
|
||||
};
|
||||
|
||||
struct quic_ack {
|
||||
struct qf_ack {
|
||||
uint64_t largest_ack;
|
||||
uint64_t ack_delay;
|
||||
uint64_t ack_range_num;
|
||||
@ -125,35 +125,35 @@ struct quic_ack {
|
||||
};
|
||||
|
||||
/* Structure used when emitting ACK frames. */
|
||||
struct quic_tx_ack {
|
||||
struct qf_tx_ack {
|
||||
uint64_t ack_delay;
|
||||
struct quic_arngs *arngs;
|
||||
};
|
||||
|
||||
struct quic_reset_stream {
|
||||
struct qf_reset_stream {
|
||||
uint64_t id;
|
||||
uint64_t app_error_code;
|
||||
uint64_t final_size;
|
||||
};
|
||||
|
||||
struct quic_stop_sending {
|
||||
struct qf_stop_sending {
|
||||
uint64_t id;
|
||||
uint64_t app_error_code;
|
||||
};
|
||||
|
||||
struct quic_crypto {
|
||||
struct qf_crypto {
|
||||
uint64_t offset;
|
||||
uint64_t len;
|
||||
const struct quic_enc_level *qel;
|
||||
const unsigned char *data;
|
||||
};
|
||||
|
||||
struct quic_new_token {
|
||||
struct qf_new_token {
|
||||
uint64_t len;
|
||||
const unsigned char *data;
|
||||
};
|
||||
|
||||
struct quic_stream {
|
||||
struct qf_stream {
|
||||
uint64_t id;
|
||||
struct qc_stream_desc *stream;
|
||||
|
||||
@ -177,33 +177,33 @@ struct quic_stream {
|
||||
char dup; /* set for duplicated frame : this forces to check for the underlying qc_stream_buf instance before emitting it. */
|
||||
};
|
||||
|
||||
struct quic_max_data {
|
||||
struct qf_max_data {
|
||||
uint64_t max_data;
|
||||
};
|
||||
|
||||
struct quic_max_stream_data {
|
||||
struct qf_max_stream_data {
|
||||
uint64_t id;
|
||||
uint64_t max_stream_data;
|
||||
};
|
||||
|
||||
struct quic_max_streams {
|
||||
struct qf_max_streams {
|
||||
uint64_t max_streams;
|
||||
};
|
||||
|
||||
struct quic_data_blocked {
|
||||
struct qf_data_blocked {
|
||||
uint64_t limit;
|
||||
};
|
||||
|
||||
struct quic_stream_data_blocked {
|
||||
struct qf_stream_data_blocked {
|
||||
uint64_t id;
|
||||
uint64_t limit;
|
||||
};
|
||||
|
||||
struct quic_streams_blocked {
|
||||
struct qf_streams_blocked {
|
||||
uint64_t limit;
|
||||
};
|
||||
|
||||
struct quic_new_connection_id {
|
||||
struct qf_new_connection_id {
|
||||
uint64_t seq_num;
|
||||
uint64_t retire_prior_to;
|
||||
struct {
|
||||
@ -213,26 +213,26 @@ struct quic_new_connection_id {
|
||||
const unsigned char *stateless_reset_token;
|
||||
};
|
||||
|
||||
struct quic_retire_connection_id {
|
||||
struct qf_retire_connection_id {
|
||||
uint64_t seq_num;
|
||||
};
|
||||
|
||||
struct quic_path_challenge {
|
||||
struct qf_path_challenge {
|
||||
unsigned char data[QUIC_PATH_CHALLENGE_LEN];
|
||||
};
|
||||
|
||||
struct quic_path_challenge_response {
|
||||
struct qf_path_challenge_response {
|
||||
unsigned char data[QUIC_PATH_CHALLENGE_LEN];
|
||||
};
|
||||
|
||||
struct quic_connection_close {
|
||||
struct qf_connection_close {
|
||||
uint64_t error_code;
|
||||
uint64_t frame_type;
|
||||
uint64_t reason_phrase_len;
|
||||
unsigned char reason_phrase[QUIC_CC_REASON_PHRASE_MAXLEN];
|
||||
};
|
||||
|
||||
struct quic_connection_close_app {
|
||||
struct qf_connection_close_app {
|
||||
uint64_t error_code;
|
||||
uint64_t reason_phrase_len;
|
||||
unsigned char reason_phrase[QUIC_CC_REASON_PHRASE_MAXLEN];
|
||||
@ -243,28 +243,28 @@ struct quic_frame {
|
||||
struct quic_tx_packet *pkt; /* Last Tx packet used to send the frame. */
|
||||
unsigned char type; /* QUIC frame type. */
|
||||
union {
|
||||
struct quic_padding padding;
|
||||
struct quic_ack ack;
|
||||
struct quic_tx_ack tx_ack;
|
||||
struct quic_crypto crypto;
|
||||
struct quic_reset_stream reset_stream;
|
||||
struct quic_stop_sending stop_sending;
|
||||
struct quic_new_token new_token;
|
||||
struct quic_stream stream;
|
||||
struct quic_max_data max_data;
|
||||
struct quic_max_stream_data max_stream_data;
|
||||
struct quic_max_streams max_streams_bidi;
|
||||
struct quic_max_streams max_streams_uni;
|
||||
struct quic_data_blocked data_blocked;
|
||||
struct quic_stream_data_blocked stream_data_blocked;
|
||||
struct quic_streams_blocked streams_blocked_bidi;
|
||||
struct quic_streams_blocked streams_blocked_uni;
|
||||
struct quic_new_connection_id new_connection_id;
|
||||
struct quic_retire_connection_id retire_connection_id;
|
||||
struct quic_path_challenge path_challenge;
|
||||
struct quic_path_challenge_response path_challenge_response;
|
||||
struct quic_connection_close connection_close;
|
||||
struct quic_connection_close_app connection_close_app;
|
||||
struct qf_padding padding;
|
||||
struct qf_ack ack;
|
||||
struct qf_tx_ack tx_ack;
|
||||
struct qf_crypto crypto;
|
||||
struct qf_reset_stream reset_stream;
|
||||
struct qf_stop_sending stop_sending;
|
||||
struct qf_new_token new_token;
|
||||
struct qf_stream stream;
|
||||
struct qf_max_data max_data;
|
||||
struct qf_max_stream_data max_stream_data;
|
||||
struct qf_max_streams max_streams_bidi;
|
||||
struct qf_max_streams max_streams_uni;
|
||||
struct qf_data_blocked data_blocked;
|
||||
struct qf_stream_data_blocked stream_data_blocked;
|
||||
struct qf_streams_blocked streams_blocked_bidi;
|
||||
struct qf_streams_blocked streams_blocked_uni;
|
||||
struct qf_new_connection_id new_connection_id;
|
||||
struct qf_retire_connection_id retire_connection_id;
|
||||
struct qf_path_challenge path_challenge;
|
||||
struct qf_path_challenge_response path_challenge_response;
|
||||
struct qf_connection_close connection_close;
|
||||
struct qf_connection_close_app connection_close_app;
|
||||
};
|
||||
struct quic_frame *origin; /* Parent frame. Set if frame is a duplicate (used for retransmission). */
|
||||
struct list reflist; /* List head containing duplicated children frames. */
|
||||
|
||||
@ -49,7 +49,7 @@ static inline size_t qc_frm_len(struct quic_frame *frm)
|
||||
|
||||
switch (frm->type) {
|
||||
case QUIC_FT_ACK: {
|
||||
struct quic_tx_ack *tx_ack = &frm->tx_ack;
|
||||
struct qf_tx_ack *tx_ack = &frm->tx_ack;
|
||||
struct eb64_node *ar, *prev_ar;
|
||||
struct quic_arng_node *ar_node, *prev_ar_node;
|
||||
|
||||
@ -70,102 +70,102 @@ static inline size_t qc_frm_len(struct quic_frame *frm)
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_RESET_STREAM: {
|
||||
struct quic_reset_stream *f = &frm->reset_stream;
|
||||
struct qf_reset_stream *f = &frm->reset_stream;
|
||||
len += 1 + quic_int_getsize(f->id) +
|
||||
quic_int_getsize(f->app_error_code) + quic_int_getsize(f->final_size);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_STOP_SENDING: {
|
||||
struct quic_stop_sending *f = &frm->stop_sending;
|
||||
struct qf_stop_sending *f = &frm->stop_sending;
|
||||
len += 1 + quic_int_getsize(f->id) + quic_int_getsize(f->app_error_code);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_CRYPTO: {
|
||||
struct quic_crypto *f = &frm->crypto;
|
||||
struct qf_crypto *f = &frm->crypto;
|
||||
len += 1 + quic_int_getsize(f->offset) + quic_int_getsize(f->len) + f->len;
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_NEW_TOKEN: {
|
||||
struct quic_new_token *f = &frm->new_token;
|
||||
struct qf_new_token *f = &frm->new_token;
|
||||
len += 1 + quic_int_getsize(f->len) + f->len;
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_STREAM_8 ... QUIC_FT_STREAM_F: {
|
||||
struct quic_stream *f = &frm->stream;
|
||||
struct qf_stream *f = &frm->stream;
|
||||
len += 1 + quic_int_getsize(f->id) +
|
||||
((frm->type & QUIC_STREAM_FRAME_TYPE_OFF_BIT) ? quic_int_getsize(f->offset.key) : 0) +
|
||||
((frm->type & QUIC_STREAM_FRAME_TYPE_LEN_BIT) ? quic_int_getsize(f->len) : 0) + f->len;
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_MAX_DATA: {
|
||||
struct quic_max_data *f = &frm->max_data;
|
||||
struct qf_max_data *f = &frm->max_data;
|
||||
len += 1 + quic_int_getsize(f->max_data);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_MAX_STREAM_DATA: {
|
||||
struct quic_max_stream_data *f = &frm->max_stream_data;
|
||||
struct qf_max_stream_data *f = &frm->max_stream_data;
|
||||
len += 1 + quic_int_getsize(f->id) + quic_int_getsize(f->max_stream_data);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_MAX_STREAMS_BIDI: {
|
||||
struct quic_max_streams *f = &frm->max_streams_bidi;
|
||||
struct qf_max_streams *f = &frm->max_streams_bidi;
|
||||
len += 1 + quic_int_getsize(f->max_streams);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_MAX_STREAMS_UNI: {
|
||||
struct quic_max_streams *f = &frm->max_streams_uni;
|
||||
struct qf_max_streams *f = &frm->max_streams_uni;
|
||||
len += 1 + quic_int_getsize(f->max_streams);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_DATA_BLOCKED: {
|
||||
struct quic_data_blocked *f = &frm->data_blocked;
|
||||
struct qf_data_blocked *f = &frm->data_blocked;
|
||||
len += 1 + quic_int_getsize(f->limit);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_STREAM_DATA_BLOCKED: {
|
||||
struct quic_stream_data_blocked *f = &frm->stream_data_blocked;
|
||||
struct qf_stream_data_blocked *f = &frm->stream_data_blocked;
|
||||
len += 1 + quic_int_getsize(f->id) + quic_int_getsize(f->limit);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_STREAMS_BLOCKED_BIDI: {
|
||||
struct quic_streams_blocked *f = &frm->streams_blocked_bidi;
|
||||
struct qf_streams_blocked *f = &frm->streams_blocked_bidi;
|
||||
len += 1 + quic_int_getsize(f->limit);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_STREAMS_BLOCKED_UNI: {
|
||||
struct quic_streams_blocked *f = &frm->streams_blocked_uni;
|
||||
struct qf_streams_blocked *f = &frm->streams_blocked_uni;
|
||||
len += 1 + quic_int_getsize(f->limit);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_NEW_CONNECTION_ID: {
|
||||
struct quic_new_connection_id *f = &frm->new_connection_id;
|
||||
struct qf_new_connection_id *f = &frm->new_connection_id;
|
||||
len += 1 + quic_int_getsize(f->seq_num) + quic_int_getsize(f->retire_prior_to) +
|
||||
quic_int_getsize(f->cid.len) + f->cid.len + QUIC_STATELESS_RESET_TOKEN_LEN;
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_RETIRE_CONNECTION_ID: {
|
||||
struct quic_retire_connection_id *f = &frm->retire_connection_id;
|
||||
struct qf_retire_connection_id *f = &frm->retire_connection_id;
|
||||
len += 1 + quic_int_getsize(f->seq_num);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_PATH_CHALLENGE: {
|
||||
struct quic_path_challenge *f = &frm->path_challenge;
|
||||
struct qf_path_challenge *f = &frm->path_challenge;
|
||||
len += 1 + sizeof f->data;
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_PATH_RESPONSE: {
|
||||
struct quic_path_challenge_response *f = &frm->path_challenge_response;
|
||||
struct qf_path_challenge_response *f = &frm->path_challenge_response;
|
||||
len += 1 + sizeof f->data;
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_CONNECTION_CLOSE: {
|
||||
struct quic_connection_close *f = &frm->connection_close;
|
||||
struct qf_connection_close *f = &frm->connection_close;
|
||||
len += 1 + quic_int_getsize(f->error_code) + quic_int_getsize(f->frame_type) +
|
||||
quic_int_getsize(f->reason_phrase_len) + f->reason_phrase_len;
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_CONNECTION_CLOSE_APP: {
|
||||
struct quic_connection_close *f = &frm->connection_close;
|
||||
struct qf_connection_close *f = &frm->connection_close;
|
||||
len += 1 + quic_int_getsize(f->error_code) +
|
||||
quic_int_getsize(f->reason_phrase_len) + f->reason_phrase_len;
|
||||
break;
|
||||
@ -278,7 +278,7 @@ static inline void qc_frm_free(struct quic_frame **frm)
|
||||
/* Move forward <strm> STREAM frame by <data> bytes. */
|
||||
static inline void qc_stream_frm_mv_fwd(struct quic_frame *frm, uint64_t data)
|
||||
{
|
||||
struct quic_stream *strm = &frm->stream;
|
||||
struct qf_stream *strm = &frm->stream;
|
||||
struct buffer cf_buf;
|
||||
|
||||
/* Set offset bit if not already there. */
|
||||
|
||||
@ -576,7 +576,7 @@ static void quic_trace(enum trace_level level, uint64_t mask, const struct trace
|
||||
}
|
||||
|
||||
if (mask & QUIC_EV_CONN_ACKSTRM) {
|
||||
const struct quic_stream *s = a2;
|
||||
const struct qf_stream *s = a2;
|
||||
const struct qc_stream_desc *stream = a3;
|
||||
|
||||
if (s)
|
||||
@ -1737,11 +1737,11 @@ static int quic_stream_try_to_consume(struct quic_conn *qc,
|
||||
ret = 0;
|
||||
frm_node = eb64_first(&stream->acked_frms);
|
||||
while (frm_node) {
|
||||
struct quic_stream *strm;
|
||||
struct qf_stream *strm;
|
||||
struct quic_frame *frm;
|
||||
size_t offset, len;
|
||||
|
||||
strm = eb64_entry(frm_node, struct quic_stream, offset);
|
||||
strm = eb64_entry(frm_node, struct qf_stream, offset);
|
||||
offset = strm->offset.key;
|
||||
len = strm->len;
|
||||
|
||||
@ -1787,7 +1787,7 @@ static inline void qc_treat_acked_tx_frm(struct quic_conn *qc,
|
||||
switch (frm->type) {
|
||||
case QUIC_FT_STREAM_8 ... QUIC_FT_STREAM_F:
|
||||
{
|
||||
struct quic_stream *strm_frm = &frm->stream;
|
||||
struct qf_stream *strm_frm = &frm->stream;
|
||||
struct eb64_node *node = NULL;
|
||||
struct qc_stream_desc *stream = NULL;
|
||||
const size_t offset = strm_frm->offset.key;
|
||||
@ -1917,7 +1917,7 @@ static inline int qc_requeue_nacked_pkt_tx_frms(struct quic_conn *qc,
|
||||
switch (frm->type) {
|
||||
case QUIC_FT_STREAM_8 ... QUIC_FT_STREAM_F:
|
||||
{
|
||||
struct quic_stream *strm_frm = &frm->stream;
|
||||
struct qf_stream *strm_frm = &frm->stream;
|
||||
struct eb64_node *node = NULL;
|
||||
struct qc_stream_desc *stream_desc;
|
||||
|
||||
@ -2209,7 +2209,7 @@ static inline int qc_parse_ack_frm(struct quic_conn *qc,
|
||||
unsigned int *rtt_sample,
|
||||
const unsigned char **pos, const unsigned char *end)
|
||||
{
|
||||
struct quic_ack *ack = &frm->ack;
|
||||
struct qf_ack *ack = &frm->ack;
|
||||
uint64_t smallest, largest;
|
||||
struct eb_root *pkts;
|
||||
struct eb64_node *largest_node;
|
||||
@ -2532,7 +2532,7 @@ static inline int qc_provide_cdata(struct quic_enc_level *el,
|
||||
* containing the frame must not be acknowledged.
|
||||
*/
|
||||
static inline int qc_handle_strm_frm(struct quic_rx_packet *pkt,
|
||||
struct quic_stream *strm_frm,
|
||||
struct qf_stream *strm_frm,
|
||||
struct quic_conn *qc, char fin)
|
||||
{
|
||||
int ret;
|
||||
@ -2579,7 +2579,7 @@ static void qc_dup_pkt_frms(struct quic_conn *qc,
|
||||
switch (frm->type) {
|
||||
case QUIC_FT_STREAM_8 ... QUIC_FT_STREAM_F:
|
||||
{
|
||||
struct quic_stream *strm_frm = &frm->stream;
|
||||
struct qf_stream *strm_frm = &frm->stream;
|
||||
struct eb64_node *node = NULL;
|
||||
struct qc_stream_desc *stream_desc;
|
||||
|
||||
@ -2903,7 +2903,7 @@ static struct ncbuf *quic_get_ncbuf(struct ncbuf *ncbuf)
|
||||
* CRYPTO data.
|
||||
*/
|
||||
static int qc_handle_crypto_frm(struct quic_conn *qc,
|
||||
struct quic_crypto *frm, struct quic_rx_packet *pkt,
|
||||
struct qf_crypto *frm, struct quic_rx_packet *pkt,
|
||||
struct quic_enc_level *qel, int *fast_retrans)
|
||||
{
|
||||
int ret = 0;
|
||||
@ -3024,7 +3024,7 @@ static int qc_handle_retire_connection_id_frm(struct quic_conn *qc,
|
||||
struct quic_connection_id **to_retire)
|
||||
{
|
||||
int ret = 0;
|
||||
struct quic_retire_connection_id *rcid = &frm->retire_connection_id;
|
||||
struct qf_retire_connection_id *rcid = &frm->retire_connection_id;
|
||||
struct eb64_node *node;
|
||||
struct quic_connection_id *conn_id;
|
||||
|
||||
@ -3154,13 +3154,13 @@ static int qc_parse_pkt_frms(struct quic_conn *qc, struct quic_rx_packet *pkt,
|
||||
}
|
||||
case QUIC_FT_RESET_STREAM:
|
||||
if (qc->mux_state == QC_MUX_READY) {
|
||||
struct quic_reset_stream *rs = &frm.reset_stream;
|
||||
struct qf_reset_stream *rs = &frm.reset_stream;
|
||||
qcc_recv_reset_stream(qc->qcc, rs->id, rs->app_error_code, rs->final_size);
|
||||
}
|
||||
break;
|
||||
case QUIC_FT_STOP_SENDING:
|
||||
{
|
||||
struct quic_stop_sending *stop_sending = &frm.stop_sending;
|
||||
struct qf_stop_sending *stop_sending = &frm.stop_sending;
|
||||
if (qc->mux_state == QC_MUX_READY) {
|
||||
if (qcc_recv_stop_sending(qc->qcc, stop_sending->id,
|
||||
stop_sending->app_error_code)) {
|
||||
@ -3176,7 +3176,7 @@ static int qc_parse_pkt_frms(struct quic_conn *qc, struct quic_rx_packet *pkt,
|
||||
break;
|
||||
case QUIC_FT_STREAM_8 ... QUIC_FT_STREAM_F:
|
||||
{
|
||||
struct quic_stream *stream = &frm.stream;
|
||||
struct qf_stream *stream = &frm.stream;
|
||||
unsigned nb_streams = qc->rx.strms[qcs_id_type(stream->id)].nb_streams;
|
||||
const char fin = frm.type & QUIC_STREAM_FRAME_TYPE_FIN_BIT;
|
||||
|
||||
@ -3212,13 +3212,13 @@ static int qc_parse_pkt_frms(struct quic_conn *qc, struct quic_rx_packet *pkt,
|
||||
}
|
||||
case QUIC_FT_MAX_DATA:
|
||||
if (qc->mux_state == QC_MUX_READY) {
|
||||
struct quic_max_data *data = &frm.max_data;
|
||||
struct qf_max_data *data = &frm.max_data;
|
||||
qcc_recv_max_data(qc->qcc, data->max_data);
|
||||
}
|
||||
break;
|
||||
case QUIC_FT_MAX_STREAM_DATA:
|
||||
if (qc->mux_state == QC_MUX_READY) {
|
||||
struct quic_max_stream_data *data = &frm.max_stream_data;
|
||||
struct qf_max_stream_data *data = &frm.max_stream_data;
|
||||
if (qcc_recv_max_stream_data(qc->qcc, data->id,
|
||||
data->max_stream_data)) {
|
||||
TRACE_ERROR("qcc_recv_max_stream_data() failed", QUIC_EV_CONN_PRSHPKT, qc);
|
||||
@ -7557,7 +7557,7 @@ static inline int qc_build_frms(struct list *outlist, struct list *inlist,
|
||||
if (cf->stream.dup) {
|
||||
struct eb64_node *node = NULL;
|
||||
struct qc_stream_desc *stream_desc = NULL;
|
||||
struct quic_stream *strm = &cf->stream;
|
||||
struct qf_stream *strm = &cf->stream;
|
||||
|
||||
/* As this frame has been already lost, ensure the stream is always
|
||||
* available or the range of this frame is not consumed before
|
||||
|
||||
118
src/quic_frame.c
118
src/quic_frame.c
@ -109,28 +109,28 @@ void chunk_frm_appendf(struct buffer *buf, const struct quic_frame *frm)
|
||||
switch (frm->type) {
|
||||
case QUIC_FT_CRYPTO:
|
||||
{
|
||||
const struct quic_crypto *cf = &frm->crypto;
|
||||
const struct qf_crypto *cf = &frm->crypto;
|
||||
chunk_appendf(buf, " cfoff=%llu cflen=%llu",
|
||||
(ull)cf->offset, (ull)cf->len);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_RESET_STREAM:
|
||||
{
|
||||
const struct quic_reset_stream *rs = &frm->reset_stream;
|
||||
const struct qf_reset_stream *rs = &frm->reset_stream;
|
||||
chunk_appendf(buf, " id=%llu app_error_code=%llu final_size=%llu",
|
||||
(ull)rs->id, (ull)rs->app_error_code, (ull)rs->final_size);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_STOP_SENDING:
|
||||
{
|
||||
const struct quic_stop_sending *s = &frm->stop_sending;
|
||||
const struct qf_stop_sending *s = &frm->stop_sending;
|
||||
chunk_appendf(&trace_buf, " id=%llu app_error_code=%llu",
|
||||
(ull)s->id, (ull)s->app_error_code);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_STREAM_8 ... QUIC_FT_STREAM_F:
|
||||
{
|
||||
const struct quic_stream *s = &frm->stream;
|
||||
const struct qf_stream *s = &frm->stream;
|
||||
chunk_appendf(&trace_buf, " uni=%d fin=%d id=%llu off=%llu len=%llu",
|
||||
!!(s->id & QUIC_STREAM_FRAME_ID_DIR_BIT),
|
||||
!!(frm->type & QUIC_STREAM_FRAME_TYPE_FIN_BIT),
|
||||
@ -139,63 +139,63 @@ void chunk_frm_appendf(struct buffer *buf, const struct quic_frame *frm)
|
||||
}
|
||||
case QUIC_FT_MAX_DATA:
|
||||
{
|
||||
const struct quic_max_data *s = &frm->max_data;
|
||||
const struct qf_max_data *s = &frm->max_data;
|
||||
chunk_appendf(&trace_buf, " max_data=%llu", (ull)s->max_data);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_MAX_STREAM_DATA:
|
||||
{
|
||||
const struct quic_max_stream_data *s = &frm->max_stream_data;
|
||||
const struct qf_max_stream_data *s = &frm->max_stream_data;
|
||||
chunk_appendf(&trace_buf, " id=%llu max_stream_data=%llu",
|
||||
(ull)s->id, (ull)s->max_stream_data);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_MAX_STREAMS_BIDI:
|
||||
{
|
||||
const struct quic_max_streams *s = &frm->max_streams_bidi;
|
||||
const struct qf_max_streams *s = &frm->max_streams_bidi;
|
||||
chunk_appendf(&trace_buf, " max_streams=%llu", (ull)s->max_streams);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_MAX_STREAMS_UNI:
|
||||
{
|
||||
const struct quic_max_streams *s = &frm->max_streams_uni;
|
||||
const struct qf_max_streams *s = &frm->max_streams_uni;
|
||||
chunk_appendf(&trace_buf, " max_streams=%llu", (ull)s->max_streams);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_DATA_BLOCKED:
|
||||
{
|
||||
const struct quic_data_blocked *s = &frm->data_blocked;
|
||||
const struct qf_data_blocked *s = &frm->data_blocked;
|
||||
chunk_appendf(&trace_buf, " limit=%llu", (ull)s->limit);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_STREAM_DATA_BLOCKED:
|
||||
{
|
||||
const struct quic_stream_data_blocked *s = &frm->stream_data_blocked;
|
||||
const struct qf_stream_data_blocked *s = &frm->stream_data_blocked;
|
||||
chunk_appendf(&trace_buf, " id=%llu limit=%llu",
|
||||
(ull)s->id, (ull)s->limit);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_STREAMS_BLOCKED_BIDI:
|
||||
{
|
||||
const struct quic_streams_blocked *s = &frm->streams_blocked_bidi;
|
||||
const struct qf_streams_blocked *s = &frm->streams_blocked_bidi;
|
||||
chunk_appendf(&trace_buf, " limit=%llu", (ull)s->limit);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_STREAMS_BLOCKED_UNI:
|
||||
{
|
||||
const struct quic_streams_blocked *s = &frm->streams_blocked_uni;
|
||||
const struct qf_streams_blocked *s = &frm->streams_blocked_uni;
|
||||
chunk_appendf(&trace_buf, " limit=%llu", (ull)s->limit);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_RETIRE_CONNECTION_ID:
|
||||
{
|
||||
const struct quic_retire_connection_id *rci = &frm->retire_connection_id;
|
||||
const struct qf_retire_connection_id *rci = &frm->retire_connection_id;
|
||||
chunk_appendf(&trace_buf, " seq_num=%llu", (ull)rci->seq_num);
|
||||
break;
|
||||
}
|
||||
case QUIC_FT_CONNECTION_CLOSE:
|
||||
{
|
||||
const struct quic_connection_close *cc = &frm->connection_close;
|
||||
const struct qf_connection_close *cc = &frm->connection_close;
|
||||
size_t plen = QUIC_MIN((size_t)cc->reason_phrase_len, sizeof cc->reason_phrase);
|
||||
chunk_appendf(&trace_buf,
|
||||
" error_code=%llu frame_type=%llu reason_phrase_len=%llu",
|
||||
@ -207,7 +207,7 @@ void chunk_frm_appendf(struct buffer *buf, const struct quic_frame *frm)
|
||||
}
|
||||
case QUIC_FT_CONNECTION_CLOSE_APP:
|
||||
{
|
||||
const struct quic_connection_close_app *cc = &frm->connection_close_app;
|
||||
const struct qf_connection_close_app *cc = &frm->connection_close_app;
|
||||
size_t plen = QUIC_MIN((size_t)cc->reason_phrase_len, sizeof cc->reason_phrase);
|
||||
chunk_appendf(&trace_buf,
|
||||
" error_code=%llu reason_phrase_len=%llu",
|
||||
@ -225,7 +225,7 @@ void chunk_frm_appendf(struct buffer *buf, const struct quic_frame *frm)
|
||||
static int quic_build_padding_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_padding *padding = &frm->padding;
|
||||
struct qf_padding *padding = &frm->padding;
|
||||
|
||||
if (end - *buf < padding->len - 1)
|
||||
return 0;
|
||||
@ -243,7 +243,7 @@ static int quic_parse_padding_frame(struct quic_frame *frm, struct quic_conn *qc
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
const unsigned char *beg;
|
||||
struct quic_padding *padding = &frm->padding;
|
||||
struct qf_padding *padding = &frm->padding;
|
||||
|
||||
beg = *buf;
|
||||
padding->len = 1;
|
||||
@ -280,7 +280,7 @@ static int quic_parse_ping_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
static int quic_build_ack_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *qc)
|
||||
{
|
||||
struct quic_tx_ack *tx_ack = &frm->tx_ack;
|
||||
struct qf_tx_ack *tx_ack = &frm->tx_ack;
|
||||
struct eb64_node *ar, *prev_ar;
|
||||
struct quic_arng_node *ar_node, *prev_ar_node;
|
||||
|
||||
@ -316,7 +316,7 @@ static int quic_parse_ack_frame_header(struct quic_frame *frm, struct quic_conn
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
int ret;
|
||||
struct quic_ack *ack = &frm->ack;
|
||||
struct qf_ack *ack = &frm->ack;
|
||||
|
||||
ret = quic_dec_int(&ack->largest_ack, buf, end);
|
||||
if (!ret)
|
||||
@ -343,7 +343,7 @@ static int quic_parse_ack_frame_header(struct quic_frame *frm, struct quic_conn
|
||||
static int quic_build_ack_ecn_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_ack *ack = &frm->ack;
|
||||
struct qf_ack *ack = &frm->ack;
|
||||
|
||||
return quic_enc_int(buf, end, ack->largest_ack) &&
|
||||
quic_enc_int(buf, end, ack->ack_delay) &&
|
||||
@ -357,7 +357,7 @@ static int quic_build_ack_ecn_frame(unsigned char **buf, const unsigned char *en
|
||||
static int quic_parse_ack_ecn_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
struct quic_ack *ack = &frm->ack;
|
||||
struct qf_ack *ack = &frm->ack;
|
||||
|
||||
return quic_dec_int(&ack->largest_ack, buf, end) &&
|
||||
quic_dec_int(&ack->ack_delay, buf, end) &&
|
||||
@ -371,7 +371,7 @@ static int quic_parse_ack_ecn_frame(struct quic_frame *frm, struct quic_conn *qc
|
||||
static int quic_build_reset_stream_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_reset_stream *reset_stream = &frm->reset_stream;
|
||||
struct qf_reset_stream *reset_stream = &frm->reset_stream;
|
||||
|
||||
return quic_enc_int(buf, end, reset_stream->id) &&
|
||||
quic_enc_int(buf, end, reset_stream->app_error_code) &&
|
||||
@ -384,7 +384,7 @@ static int quic_build_reset_stream_frame(unsigned char **buf, const unsigned cha
|
||||
static int quic_parse_reset_stream_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
struct quic_reset_stream *reset_stream = &frm->reset_stream;
|
||||
struct qf_reset_stream *reset_stream = &frm->reset_stream;
|
||||
|
||||
return quic_dec_int(&reset_stream->id, buf, end) &&
|
||||
quic_dec_int(&reset_stream->app_error_code, buf, end) &&
|
||||
@ -397,7 +397,7 @@ static int quic_parse_reset_stream_frame(struct quic_frame *frm, struct quic_con
|
||||
static int quic_build_stop_sending_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_stop_sending *stop_sending = &frm->stop_sending;
|
||||
struct qf_stop_sending *stop_sending = &frm->stop_sending;
|
||||
|
||||
return quic_enc_int(buf, end, stop_sending->id) &&
|
||||
quic_enc_int(buf, end, stop_sending->app_error_code);
|
||||
@ -409,7 +409,7 @@ static int quic_build_stop_sending_frame(unsigned char **buf, const unsigned cha
|
||||
static int quic_parse_stop_sending_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
struct quic_stop_sending *stop_sending = &frm->stop_sending;
|
||||
struct qf_stop_sending *stop_sending = &frm->stop_sending;
|
||||
|
||||
return quic_dec_int(&stop_sending->id, buf, end) &&
|
||||
quic_dec_int(&stop_sending->app_error_code, buf, end);
|
||||
@ -421,7 +421,7 @@ static int quic_parse_stop_sending_frame(struct quic_frame *frm, struct quic_con
|
||||
static int quic_build_crypto_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_crypto *crypto = &frm->crypto;
|
||||
struct qf_crypto *crypto = &frm->crypto;
|
||||
const struct quic_enc_level *qel = crypto->qel;
|
||||
size_t offset, len;
|
||||
|
||||
@ -456,7 +456,7 @@ static int quic_build_crypto_frame(unsigned char **buf, const unsigned char *end
|
||||
static int quic_parse_crypto_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
struct quic_crypto *crypto = &frm->crypto;
|
||||
struct qf_crypto *crypto = &frm->crypto;
|
||||
|
||||
if (!quic_dec_int(&crypto->offset, buf, end) ||
|
||||
!quic_dec_int(&crypto->len, buf, end) || end - *buf < crypto->len)
|
||||
@ -474,7 +474,7 @@ static int quic_parse_crypto_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
static int quic_build_new_token_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_new_token *new_token = &frm->new_token;
|
||||
struct qf_new_token *new_token = &frm->new_token;
|
||||
|
||||
if (!quic_enc_int(buf, end, new_token->len) || end - *buf < new_token->len)
|
||||
return 0;
|
||||
@ -490,7 +490,7 @@ static int quic_build_new_token_frame(unsigned char **buf, const unsigned char *
|
||||
static int quic_parse_new_token_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
struct quic_new_token *new_token = &frm->new_token;
|
||||
struct qf_new_token *new_token = &frm->new_token;
|
||||
|
||||
if (!quic_dec_int(&new_token->len, buf, end) || end - *buf < new_token->len)
|
||||
return 0;
|
||||
@ -507,7 +507,7 @@ static int quic_parse_new_token_frame(struct quic_frame *frm, struct quic_conn *
|
||||
static int quic_build_stream_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_stream *stream = &frm->stream;
|
||||
struct qf_stream *stream = &frm->stream;
|
||||
const unsigned char *wrap;
|
||||
|
||||
/* Caller must set OFF bit if and only if a non-null offset is used. */
|
||||
@ -544,7 +544,7 @@ static int quic_build_stream_frame(unsigned char **buf, const unsigned char *end
|
||||
static int quic_parse_stream_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
struct quic_stream *stream = &frm->stream;
|
||||
struct qf_stream *stream = &frm->stream;
|
||||
|
||||
if (!quic_dec_int(&stream->id, buf, end))
|
||||
return 0;
|
||||
@ -575,7 +575,7 @@ static int quic_parse_stream_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
static int quic_build_max_data_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_max_data *max_data = &frm->max_data;
|
||||
struct qf_max_data *max_data = &frm->max_data;
|
||||
|
||||
return quic_enc_int(buf, end, max_data->max_data);
|
||||
}
|
||||
@ -586,7 +586,7 @@ static int quic_build_max_data_frame(unsigned char **buf, const unsigned char *e
|
||||
static int quic_parse_max_data_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
struct quic_max_data *max_data = &frm->max_data;
|
||||
struct qf_max_data *max_data = &frm->max_data;
|
||||
|
||||
return quic_dec_int(&max_data->max_data, buf, end);
|
||||
}
|
||||
@ -597,7 +597,7 @@ static int quic_parse_max_data_frame(struct quic_frame *frm, struct quic_conn *q
|
||||
static int quic_build_max_stream_data_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_max_stream_data *max_stream_data = &frm->max_stream_data;
|
||||
struct qf_max_stream_data *max_stream_data = &frm->max_stream_data;
|
||||
|
||||
return quic_enc_int(buf, end, max_stream_data->id) &&
|
||||
quic_enc_int(buf, end, max_stream_data->max_stream_data);
|
||||
@ -609,7 +609,7 @@ static int quic_build_max_stream_data_frame(unsigned char **buf, const unsigned
|
||||
static int quic_parse_max_stream_data_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
struct quic_max_stream_data *max_stream_data = &frm->max_stream_data;
|
||||
struct qf_max_stream_data *max_stream_data = &frm->max_stream_data;
|
||||
|
||||
return quic_dec_int(&max_stream_data->id, buf, end) &&
|
||||
quic_dec_int(&max_stream_data->max_stream_data, buf, end);
|
||||
@ -621,7 +621,7 @@ static int quic_parse_max_stream_data_frame(struct quic_frame *frm, struct quic_
|
||||
static int quic_build_max_streams_bidi_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_max_streams *max_streams_bidi = &frm->max_streams_bidi;
|
||||
struct qf_max_streams *max_streams_bidi = &frm->max_streams_bidi;
|
||||
|
||||
return quic_enc_int(buf, end, max_streams_bidi->max_streams);
|
||||
}
|
||||
@ -633,7 +633,7 @@ static int quic_build_max_streams_bidi_frame(unsigned char **buf, const unsigned
|
||||
static int quic_parse_max_streams_bidi_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
struct quic_max_streams *max_streams_bidi = &frm->max_streams_bidi;
|
||||
struct qf_max_streams *max_streams_bidi = &frm->max_streams_bidi;
|
||||
|
||||
return quic_dec_int(&max_streams_bidi->max_streams, buf, end);
|
||||
}
|
||||
@ -644,7 +644,7 @@ static int quic_parse_max_streams_bidi_frame(struct quic_frame *frm, struct quic
|
||||
static int quic_build_max_streams_uni_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_max_streams *max_streams_uni = &frm->max_streams_uni;
|
||||
struct qf_max_streams *max_streams_uni = &frm->max_streams_uni;
|
||||
|
||||
return quic_enc_int(buf, end, max_streams_uni->max_streams);
|
||||
}
|
||||
@ -656,7 +656,7 @@ static int quic_build_max_streams_uni_frame(unsigned char **buf, const unsigned
|
||||
static int quic_parse_max_streams_uni_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
struct quic_max_streams *max_streams_uni = &frm->max_streams_uni;
|
||||
struct qf_max_streams *max_streams_uni = &frm->max_streams_uni;
|
||||
|
||||
return quic_dec_int(&max_streams_uni->max_streams, buf, end);
|
||||
}
|
||||
@ -667,7 +667,7 @@ static int quic_parse_max_streams_uni_frame(struct quic_frame *frm, struct quic_
|
||||
static int quic_build_data_blocked_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_data_blocked *data_blocked = &frm->data_blocked;
|
||||
struct qf_data_blocked *data_blocked = &frm->data_blocked;
|
||||
|
||||
return quic_enc_int(buf, end, data_blocked->limit);
|
||||
}
|
||||
@ -678,7 +678,7 @@ static int quic_build_data_blocked_frame(unsigned char **buf, const unsigned cha
|
||||
static int quic_parse_data_blocked_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
struct quic_data_blocked *data_blocked = &frm->data_blocked;
|
||||
struct qf_data_blocked *data_blocked = &frm->data_blocked;
|
||||
|
||||
return quic_dec_int(&data_blocked->limit, buf, end);
|
||||
}
|
||||
@ -689,7 +689,7 @@ static int quic_parse_data_blocked_frame(struct quic_frame *frm, struct quic_con
|
||||
static int quic_build_stream_data_blocked_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_stream_data_blocked *stream_data_blocked = &frm->stream_data_blocked;
|
||||
struct qf_stream_data_blocked *stream_data_blocked = &frm->stream_data_blocked;
|
||||
|
||||
return quic_enc_int(buf, end, stream_data_blocked->id) &&
|
||||
quic_enc_int(buf, end, stream_data_blocked->limit);
|
||||
@ -701,7 +701,7 @@ static int quic_build_stream_data_blocked_frame(unsigned char **buf, const unsig
|
||||
static int quic_parse_stream_data_blocked_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
struct quic_stream_data_blocked *stream_data_blocked = &frm->stream_data_blocked;
|
||||
struct qf_stream_data_blocked *stream_data_blocked = &frm->stream_data_blocked;
|
||||
|
||||
return quic_dec_int(&stream_data_blocked->id, buf, end) &&
|
||||
quic_dec_int(&stream_data_blocked->limit, buf, end);
|
||||
@ -713,7 +713,7 @@ static int quic_parse_stream_data_blocked_frame(struct quic_frame *frm, struct q
|
||||
static int quic_build_streams_blocked_bidi_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_streams_blocked *streams_blocked_bidi = &frm->streams_blocked_bidi;
|
||||
struct qf_streams_blocked *streams_blocked_bidi = &frm->streams_blocked_bidi;
|
||||
|
||||
return quic_enc_int(buf, end, streams_blocked_bidi->limit);
|
||||
}
|
||||
@ -725,7 +725,7 @@ static int quic_build_streams_blocked_bidi_frame(unsigned char **buf, const unsi
|
||||
static int quic_parse_streams_blocked_bidi_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
struct quic_streams_blocked *streams_blocked_bidi = &frm->streams_blocked_bidi;
|
||||
struct qf_streams_blocked *streams_blocked_bidi = &frm->streams_blocked_bidi;
|
||||
|
||||
return quic_dec_int(&streams_blocked_bidi->limit, buf, end);
|
||||
}
|
||||
@ -736,7 +736,7 @@ static int quic_parse_streams_blocked_bidi_frame(struct quic_frame *frm, struct
|
||||
static int quic_build_streams_blocked_uni_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_streams_blocked *streams_blocked_uni = &frm->streams_blocked_uni;
|
||||
struct qf_streams_blocked *streams_blocked_uni = &frm->streams_blocked_uni;
|
||||
|
||||
return quic_enc_int(buf, end, streams_blocked_uni->limit);
|
||||
}
|
||||
@ -748,7 +748,7 @@ static int quic_build_streams_blocked_uni_frame(unsigned char **buf, const unsig
|
||||
static int quic_parse_streams_blocked_uni_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
struct quic_streams_blocked *streams_blocked_uni = &frm->streams_blocked_uni;
|
||||
struct qf_streams_blocked *streams_blocked_uni = &frm->streams_blocked_uni;
|
||||
|
||||
return quic_dec_int(&streams_blocked_uni->limit, buf, end);
|
||||
}
|
||||
@ -759,7 +759,7 @@ static int quic_parse_streams_blocked_uni_frame(struct quic_frame *frm, struct q
|
||||
static int quic_build_new_connection_id_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_new_connection_id *new_cid = &frm->new_connection_id;
|
||||
struct qf_new_connection_id *new_cid = &frm->new_connection_id;
|
||||
|
||||
if (!quic_enc_int(buf, end, new_cid->seq_num) ||
|
||||
!quic_enc_int(buf, end, new_cid->retire_prior_to) ||
|
||||
@ -784,7 +784,7 @@ static int quic_build_new_connection_id_frame(unsigned char **buf, const unsigne
|
||||
static int quic_parse_new_connection_id_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
struct quic_new_connection_id *new_cid = &frm->new_connection_id;
|
||||
struct qf_new_connection_id *new_cid = &frm->new_connection_id;
|
||||
|
||||
if (!quic_dec_int(&new_cid->seq_num, buf, end) ||
|
||||
!quic_dec_int(&new_cid->retire_prior_to, buf, end) || end <= *buf)
|
||||
@ -810,7 +810,7 @@ static int quic_parse_new_connection_id_frame(struct quic_frame *frm, struct qui
|
||||
static int quic_build_retire_connection_id_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_retire_connection_id *retire_connection_id = &frm->retire_connection_id;
|
||||
struct qf_retire_connection_id *retire_connection_id = &frm->retire_connection_id;
|
||||
|
||||
return quic_enc_int(buf, end, retire_connection_id->seq_num);
|
||||
}
|
||||
@ -821,7 +821,7 @@ static int quic_build_retire_connection_id_frame(unsigned char **buf, const unsi
|
||||
static int quic_parse_retire_connection_id_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
struct quic_retire_connection_id *retire_connection_id = &frm->retire_connection_id;
|
||||
struct qf_retire_connection_id *retire_connection_id = &frm->retire_connection_id;
|
||||
|
||||
return quic_dec_int(&retire_connection_id->seq_num, buf, end);
|
||||
}
|
||||
@ -832,7 +832,7 @@ static int quic_parse_retire_connection_id_frame(struct quic_frame *frm, struct
|
||||
static int quic_build_path_challenge_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_path_challenge *path_challenge = &frm->path_challenge;
|
||||
struct qf_path_challenge *path_challenge = &frm->path_challenge;
|
||||
|
||||
if (end - *buf < sizeof path_challenge->data)
|
||||
return 0;
|
||||
@ -849,7 +849,7 @@ static int quic_build_path_challenge_frame(unsigned char **buf, const unsigned c
|
||||
static int quic_parse_path_challenge_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
struct quic_path_challenge *path_challenge = &frm->path_challenge;
|
||||
struct qf_path_challenge *path_challenge = &frm->path_challenge;
|
||||
|
||||
if (end - *buf < sizeof path_challenge->data)
|
||||
return 0;
|
||||
@ -867,7 +867,7 @@ static int quic_parse_path_challenge_frame(struct quic_frame *frm, struct quic_c
|
||||
static int quic_build_path_response_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_path_challenge_response *path_challenge_response = &frm->path_challenge_response;
|
||||
struct qf_path_challenge_response *path_challenge_response = &frm->path_challenge_response;
|
||||
|
||||
if (end - *buf < sizeof path_challenge_response->data)
|
||||
return 0;
|
||||
@ -884,7 +884,7 @@ static int quic_build_path_response_frame(unsigned char **buf, const unsigned ch
|
||||
static int quic_parse_path_response_frame(struct quic_frame *frm, struct quic_conn *qc,
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
struct quic_path_challenge_response *path_challenge_response = &frm->path_challenge_response;
|
||||
struct qf_path_challenge_response *path_challenge_response = &frm->path_challenge_response;
|
||||
|
||||
if (end - *buf < sizeof path_challenge_response->data)
|
||||
return 0;
|
||||
@ -903,7 +903,7 @@ static int quic_parse_path_response_frame(struct quic_frame *frm, struct quic_co
|
||||
static int quic_build_connection_close_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_connection_close *cc = &frm->connection_close;
|
||||
struct qf_connection_close *cc = &frm->connection_close;
|
||||
|
||||
if (!quic_enc_int(buf, end, cc->error_code) ||
|
||||
!quic_enc_int(buf, end, cc->frame_type) ||
|
||||
@ -926,7 +926,7 @@ static int quic_parse_connection_close_frame(struct quic_frame *frm, struct quic
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
size_t plen;
|
||||
struct quic_connection_close *cc = &frm->connection_close;
|
||||
struct qf_connection_close *cc = &frm->connection_close;
|
||||
|
||||
if (!quic_dec_int(&cc->error_code, buf, end) ||
|
||||
!quic_dec_int(&cc->frame_type, buf, end) ||
|
||||
@ -949,7 +949,7 @@ static int quic_parse_connection_close_frame(struct quic_frame *frm, struct quic
|
||||
static int quic_build_connection_close_app_frame(unsigned char **buf, const unsigned char *end,
|
||||
struct quic_frame *frm, struct quic_conn *conn)
|
||||
{
|
||||
struct quic_connection_close_app *cc = &frm->connection_close_app;
|
||||
struct qf_connection_close_app *cc = &frm->connection_close_app;
|
||||
|
||||
if (!quic_enc_int(buf, end, cc->error_code) ||
|
||||
!quic_enc_int(buf, end, cc->reason_phrase_len) ||
|
||||
@ -971,7 +971,7 @@ static int quic_parse_connection_close_app_frame(struct quic_frame *frm, struct
|
||||
const unsigned char **buf, const unsigned char *end)
|
||||
{
|
||||
size_t plen;
|
||||
struct quic_connection_close_app *cc = &frm->connection_close_app;
|
||||
struct qf_connection_close_app *cc = &frm->connection_close_app;
|
||||
|
||||
if (!quic_dec_int(&cc->error_code, buf, end) ||
|
||||
!quic_dec_int(&cc->reason_phrase_len, buf, end) ||
|
||||
|
||||
@ -189,10 +189,10 @@ void qc_stream_desc_free(struct qc_stream_desc *stream, int closing)
|
||||
*/
|
||||
frm_node = eb64_first(&stream->acked_frms);
|
||||
while (frm_node) {
|
||||
struct quic_stream *strm;
|
||||
struct qf_stream *strm;
|
||||
struct quic_frame *frm;
|
||||
|
||||
strm = eb64_entry(frm_node, struct quic_stream, offset);
|
||||
strm = eb64_entry(frm_node, struct qf_stream, offset);
|
||||
|
||||
frm_node = eb64_next(frm_node);
|
||||
eb64_delete(&strm->offset);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user