QPACK stack (WebTransport only) More...
#include "internal/qpack.h"
#include "internal/huffman.h"
#include "internal/utils.h"
#include "imquic/debug.h"
Functions | |
imquic_qpack_entry * | imquic_qpack_entry_create (const char *name, const char *value) |
Create a new entry out of provided name and value. | |
void | imquic_qpack_entry_destroy (imquic_qpack_entry *entry) |
Destroy an existing entry. | |
size_t | imquic_qpack_entry_size (imquic_qpack_entry *entry) |
Helper to calculate the size of this entry. | |
imquic_qpack_dynamic_table * | imquic_qpack_dynamic_table_create (size_t capacity) |
Create a new dynamic table. | |
void | imquic_qpack_dynamic_table_destroy (imquic_qpack_dynamic_table *table) |
Destroy an existing dynamic table. | |
imquic_qpack_context * | imquic_qpack_context_create (size_t capacity) |
Create a new QPACK context. | |
void | imquic_qpack_context_destroy (imquic_qpack_context *ctx) |
Destroy an existing QPACK context. | |
size_t | imquic_qpack_decode (imquic_qpack_context *ctx, uint8_t *bytes, size_t blen) |
Decode incoming QPACK encoder data. | |
GList * | imquic_qpack_process (imquic_qpack_context *ctx, uint8_t *bytes, size_t blen, size_t *bread) |
Decode an incoming QPACK request. | |
int | imquic_qpack_encode (imquic_qpack_context *ctx, GList *headers, uint8_t *bytes, size_t *blen, uint8_t *qenc, size_t *qenclen) |
Encode outgoing QPACK encoder data. | |
Variables | |
imquic_qpack_entry | imquic_qpack_static_table [] |
Static table. | |
QPACK stack (WebTransport only)
Naive implementation of QPACK, which implements static and dynamic tables, and Huffman encoding/decoding via static tables. This code is only used for the WebTransport establishment via HTTP/3.
imquic_qpack_context * imquic_qpack_context_create | ( | size_t | capacity | ) |
Create a new QPACK context.
capacity | The capacity of the dynamic table, as advertized |
void imquic_qpack_context_destroy | ( | imquic_qpack_context * | ctx | ) |
Destroy an existing QPACK context.
ctx | Context instance to destroy |
size_t imquic_qpack_decode | ( | imquic_qpack_context * | ctx, |
uint8_t * | bytes, | ||
size_t | blen ) |
Decode incoming QPACK encoder data.
ctx | The imquic_qpack_context to update with the new encoder data |
bytes | The buffer containing the encoder data |
blen | Size of the encoder data |
imquic_qpack_dynamic_table * imquic_qpack_dynamic_table_create | ( | size_t | capacity | ) |
Create a new dynamic table.
capacity | The capacity of the dynamic table, as advertized |
void imquic_qpack_dynamic_table_destroy | ( | imquic_qpack_dynamic_table * | table | ) |
Destroy an existing dynamic table.
table | Dynamic table instance to destroy |
int imquic_qpack_encode | ( | imquic_qpack_context * | ctx, |
GList * | headers, | ||
uint8_t * | bytes, | ||
size_t * | blen, | ||
uint8_t * | qenc, | ||
size_t * | qenclen ) |
Encode outgoing QPACK encoder data.
[in] | ctx | The imquic_qpack_context to use to encode the data |
[in] | headers | List of headers to encode |
[in] | bytes | The buffer to put the encoded data in |
[out] | blen | Size of the encoded data buffer |
[in] | qenc | The buffer to put the QPACK encoder info in, if any |
[out] | qenclen | Size of the QPACK encoder info buffer |
imquic_qpack_entry * imquic_qpack_entry_create | ( | const char * | name, |
const char * | value ) |
Create a new entry out of provided name and value.
name | Name of the new entry |
value | Value of the new entry |
void imquic_qpack_entry_destroy | ( | imquic_qpack_entry * | entry | ) |
Destroy an existing entry.
entry | Entry instance to destroy |
size_t imquic_qpack_entry_size | ( | imquic_qpack_entry * | entry | ) |
Helper to calculate the size of this entry.
entry | Entry instance to calculate the size for |
GList * imquic_qpack_process | ( | imquic_qpack_context * | ctx, |
uint8_t * | bytes, | ||
size_t | blen, | ||
size_t * | bread ) |
Decode an incoming QPACK request.
[in] | ctx | The imquic_qpack_context to refer to |
[in] | bytes | The buffer containing the request data |
[in] | blen | Size of the request data |
[out] | bread | The amount of processed request data |
imquic_qpack_entry imquic_qpack_static_table[] |
Static table.