Move qc_build_new_connection_id_frm() from quic_conn.c to quic_cid.c.
Also move quic_connection_id_to_frm_cpy() from quic_conn.h to quic_cid.h.
struct listener *l,
struct sockaddr_storage *saddr,
int *new_tid);
+int qc_build_new_connection_id_frm(struct quic_conn *qc,
+ struct quic_connection_id *conn_id);
/* Copy <src> QUIC CID to <dst>.
* This is the responsibility of the caller to check there is enough room in
HA_RWLOCK_WRUNLOCK(QC_CID_LOCK, &tree->lock);
}
+/* Copy <src> new connection ID information to <dst> NEW_CONNECTION_ID frame.
+ * Always succeeds.
+ */
+static inline void quic_connection_id_to_frm_cpy(struct quic_frame *dst,
+ struct quic_connection_id *src)
+{
+ struct qf_new_connection_id *ncid_frm = &dst->new_connection_id;
+
+ ncid_frm->seq_num = src->seq_num.key;
+ ncid_frm->retire_prior_to = src->retire_prior_to;
+ ncid_frm->cid.len = src->cid.len;
+ ncid_frm->cid.data = src->cid.data;
+ ncid_frm->stateless_reset_token = src->stateless_reset_token;
+}
+
#endif /* USE_QUIC */
#endif /* _HAPROXY_QUIC_CID_H */
const struct sockaddr_storage *addr);
void quic_conn_closed_err_count_inc(struct quic_conn *qc, struct quic_frame *frm);
int qc_h3_request_reject(struct quic_conn *qc, uint64_t id);
-int qc_build_new_connection_id_frm(struct quic_conn *qc,
- struct quic_connection_id *conn_id);
struct quic_conn *qc_new_conn(const struct quic_version *qv, int ipv4,
struct quic_cid *dcid, struct quic_cid *scid,
const struct quic_cid *token_odcid,
}
-/* Copy <src> new connection ID information to <dst> NEW_CONNECTION_ID frame.
- * Always succeeds.
- */
-static inline void quic_connection_id_to_frm_cpy(struct quic_frame *dst,
- struct quic_connection_id *src)
-{
- struct qf_new_connection_id *ncid_frm = &dst->new_connection_id;
-
- ncid_frm->seq_num = src->seq_num.key;
- ncid_frm->retire_prior_to = src->retire_prior_to;
- ncid_frm->cid.len = src->cid.len;
- ncid_frm->cid.data = src->cid.data;
- ncid_frm->stateless_reset_token = src->stateless_reset_token;
-}
-
void chunk_frm_appendf(struct buffer *buf, const struct quic_frame *frm);
-
void quic_set_connection_close(struct quic_conn *qc, const struct quic_err err);
void quic_set_tls_alert(struct quic_conn *qc, int alert);
int quic_set_app_ops(struct quic_conn *qc, const unsigned char *alpn, size_t alpn_len);
return qc;
}
+/* Build a NEW_CONNECTION_ID frame for <conn_id> CID of <qc> connection.
+ *
+ * Returns 1 on success else 0.
+ */
+int qc_build_new_connection_id_frm(struct quic_conn *qc,
+ struct quic_connection_id *conn_id)
+{
+ int ret = 0;
+ struct quic_frame *frm;
+ struct quic_enc_level *qel;
+
+ TRACE_ENTER(QUIC_EV_CONN_PRSHPKT, qc);
+ qel = qc->ael;
+ frm = qc_frm_alloc(QUIC_FT_NEW_CONNECTION_ID);
+ if (!frm) {
+ TRACE_ERROR("frame allocation error", QUIC_EV_CONN_IO_CB, qc);
+ goto leave;
+ }
+
+ quic_connection_id_to_frm_cpy(frm, conn_id);
+ LIST_APPEND(&qel->pktns->tx.frms, &frm->list);
+ ret = 1;
+ leave:
+ TRACE_LEAVE(QUIC_EV_CONN_PRSHPKT, qc);
+ return ret;
+}
return ret;
}
-/* Build a NEW_CONNECTION_ID frame for <conn_id> CID of <qc> connection.
- *
- * Returns 1 on success else 0.
- */
-int qc_build_new_connection_id_frm(struct quic_conn *qc,
- struct quic_connection_id *conn_id)
-{
- int ret = 0;
- struct quic_frame *frm;
- struct quic_enc_level *qel;
-
- TRACE_ENTER(QUIC_EV_CONN_PRSHPKT, qc);
-
- qel = qc->ael;
- frm = qc_frm_alloc(QUIC_FT_NEW_CONNECTION_ID);
- if (!frm) {
- TRACE_ERROR("frame allocation error", QUIC_EV_CONN_IO_CB, qc);
- goto leave;
- }
-
- quic_connection_id_to_frm_cpy(frm, conn_id);
- LIST_APPEND(&qel->pktns->tx.frms, &frm->list);
- ret = 1;
- leave:
- TRACE_LEAVE(QUIC_EV_CONN_PRSHPKT, qc);
- return ret;
-}
-
-
/* Remove a <qc> quic-conn from its ha_thread_ctx list. If <closing> is true,
* it will immediately be reinserted in the ha_thread_ctx quic_conns_clo list.
*/