QPACK stack (WebTransport only) (headers)
More...
#include <stdint.h>
#include <glib.h>
Go to the source code of this file.
|
imquic_qpack_entry * | imquic_qpack_entry_create (const char *name, const char *value) |
| Create a new entry out of provided name and value.
|
|
size_t | imquic_qpack_entry_size (imquic_qpack_entry *entry) |
| Helper to calculate the size of this entry.
|
|
void | imquic_qpack_entry_destroy (imquic_qpack_entry *entry) |
| Destroy an existing 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.
|
|
QPACK stack (WebTransport only) (headers)
- Author
- Lorenzo Miniero loren.nosp@m.zo@m.nosp@m.eetec.nosp@m.ho.c.nosp@m.om
- Copyright
- MIT License
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
typedef struct imquic_qpack_context imquic_qpack_context |
◆ imquic_qpack_dynamic_table
typedef struct imquic_qpack_dynamic_table imquic_qpack_dynamic_table |
◆ imquic_qpack_entry
typedef struct imquic_qpack_entry imquic_qpack_entry |
Name-value entry we can have in the static or dynamic tables.
◆ imquic_qpack_context_create()
Create a new QPACK context.
- Parameters
-
capacity | The capacity of the dynamic table, as advertized |
- Returns
- A pointer to a new imquic_qpack_context instance, if successful, or NULL otherwise
◆ imquic_qpack_context_destroy()
Destroy an existing QPACK context.
- Parameters
-
ctx | Context instance to destroy |
◆ imquic_qpack_decode()
Decode incoming QPACK encoder data.
- Note
- This is data coming from the encoder stream of our peer
- Parameters
-
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 |
- Returns
- The amount of processed encoder data
◆ imquic_qpack_dynamic_table_create()
Create a new dynamic table.
- Parameters
-
capacity | The capacity of the dynamic table, as advertized |
- Returns
- A pointer to a new imquic_qpack_dynamic_table instance, if successful, or NULL otherwise
◆ imquic_qpack_dynamic_table_destroy()
Destroy an existing dynamic table.
- Parameters
-
table | Dynamic table instance to destroy |
◆ imquic_qpack_encode()
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.
- Note
- This is data we'll send on our encoder stream
- Parameters
-
[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 |
- Returns
- 0 in case of success, a negative integer otherwise
◆ imquic_qpack_entry_create()
Create a new entry out of provided name and value.
- Parameters
-
name | Name of the new entry |
value | Value of the new entry |
- Returns
- A pointer to a new imquic_qpack_entry instance, if successful, or NULL otherwise
◆ imquic_qpack_entry_destroy()
Destroy an existing entry.
- Parameters
-
entry | Entry instance to destroy |
◆ imquic_qpack_entry_size()
Helper to calculate the size of this entry.
- Parameters
-
entry | Entry instance to calculate the size for |
- Returns
- The size of the entry, as needed for the dynamic table size
◆ imquic_qpack_process()
GList * imquic_qpack_process |
( |
imquic_qpack_context * | ctx, |
|
|
uint8_t * | bytes, |
|
|
size_t | blen, |
|
|
size_t * | bread ) |
Decode an incoming QPACK request.
- Note
- This is data coming from a request. The GList and its contents are owned by the caller, and so should be freed when not needed anymore.
- Parameters
-
[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 |
- Returns
- A list of imquic_qpack_entry entries obtained from the request
◆ imquic_qpack_static_table