#include <import/eb64tree.h>
#include <import/ebmbtree.h>
-#include <haproxy/buf.h>
#include <haproxy/chunk.h>
-#include <haproxy/ncbuf-t.h>
+#include <haproxy/dynbuf.h>
+#include <haproxy/ncbuf.h>
#include <haproxy/net_helper.h>
#include <haproxy/openssl-compat.h>
#include <haproxy/ticks.h>
}
+/* Allocate the underlying required memory for <ncbuf> non-contiguous buffer */
+static inline struct ncbuf *quic_get_ncbuf(struct ncbuf *ncbuf)
+{
+ struct buffer buf = BUF_NULL;
+
+ if (!ncb_is_null(ncbuf))
+ return ncbuf;
+
+ b_alloc(&buf);
+ BUG_ON(b_is_null(&buf));
+
+ *ncbuf = ncb_make(buf.area, buf.size, 0);
+ ncb_init(ncbuf, 0);
+
+ return ncbuf;
+}
+
+/* Release the underlying memory use by <ncbuf> non-contiguous buffer */
+static inline void quic_free_ncbuf(struct ncbuf *ncbuf)
+{
+ struct buffer buf;
+
+ if (ncb_is_null(ncbuf))
+ return;
+
+ buf = b_make(ncbuf->area, ncbuf->size, 0, 0);
+ b_free(&buf);
+ offer_buffers(NULL, 1);
+
+ *ncbuf = NCBUF_NULL;
+}
+
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 qc_treat_rx_pkts(struct quic_conn *qc);
int qc_parse_hd_form(struct quic_rx_packet *pkt,
unsigned char **pos, const unsigned char *end);
-void quic_free_ncbuf(struct ncbuf *ncbuf);
int qc_treat_rx_crypto_frms(struct quic_conn *qc, struct quic_enc_level *el,
struct ssl_sock_ctx *ctx);
int qc_handle_frms_of_lost_pkt(struct quic_conn *qc,
return !ret;
}
-/* Release the underlying memory use by <ncbuf> non-contiguous buffer */
-void quic_free_ncbuf(struct ncbuf *ncbuf)
-{
- struct buffer buf;
-
- if (ncb_is_null(ncbuf))
- return;
-
- buf = b_make(ncbuf->area, ncbuf->size, 0, 0);
- b_free(&buf);
- offer_buffers(NULL, 1);
-
- *ncbuf = NCBUF_NULL;
-}
-
-/* Allocate the underlying required memory for <ncbuf> non-contiguous buffer */
-static struct ncbuf *quic_get_ncbuf(struct ncbuf *ncbuf)
-{
- struct buffer buf = BUF_NULL;
-
- if (!ncb_is_null(ncbuf))
- return ncbuf;
-
- b_alloc(&buf);
- BUG_ON(b_is_null(&buf));
-
- *ncbuf = ncb_make(buf.area, buf.size, 0);
- ncb_init(ncbuf, 0);
-
- return ncbuf;
-}
-
/* Parse <frm> CRYPTO frame coming with <pkt> packet at <qel> <qc> connectionn.
* Returns 1 if succeeded, 0 if not. Also set <*fast_retrans> to 1 if the
* speed up handshake completion may be run after having received duplicated