4#ifndef PROTOCORE_H3_FRAME_H
5#define PROTOCORE_H3_FRAME_H
34#define H3_HEADERS 0x01
35#define H3_CANCEL_PUSH 0x03
36#define H3_SETTINGS 0x04
37#define H3_PUSH_PROMISE 0x05
39#define H3_MAX_PUSH_ID 0x0d
48#define H3_NO_ERROR 0x0100
49#define H3_GENERAL_PROTOCOL_ERROR 0x0101
50#define H3_INTERNAL_ERROR 0x0102
51#define H3_STREAM_CREATION_ERROR 0x0103
52#define H3_CLOSED_CRITICAL_STREAM 0x0104
53#define H3_FRAME_UNEXPECTED 0x0105
54#define H3_FRAME_ERROR 0x0106
55#define H3_EXCESSIVE_LOAD 0x0107
56#define H3_ID_ERROR 0x0108
57#define H3_SETTINGS_ERROR 0x0109
58#define H3_MISSING_SETTINGS 0x010a
59#define H3_REQUEST_REJECTED 0x010b
60#define H3_REQUEST_CANCELLED 0x010c
61#define H3_REQUEST_INCOMPLETE 0x010d
62#define H3_MESSAGE_ERROR 0x010e
63#define H3_CONNECT_ERROR 0x010f
64#define H3_VERSION_FALLBACK 0x0110
67#define H3_SETTINGS_QPACK_MAX_TABLE_CAPACITY 0x01
68#define H3_SETTINGS_MAX_FIELD_SECTION_SIZE 0x06
69#define H3_SETTINGS_QPACK_BLOCKED_STREAMS 0x07
91 size_t (*write_header)(uint8_t *, uint8_t *, size_t, uint64_t, uint64_t);
95 size_t (*build_data)(uint8_t *, uint8_t *, size_t,
const uint8_t *, size_t);
96 size_t (*build_headers)(uint8_t *, uint8_t *, size_t,
const uint8_t *, size_t);
97 size_t (*build_settings)(uint8_t *, uint8_t *, size_t,
const uint64_t *,
const uint64_t *, size_t);
98 size_t (*build_goaway)(uint8_t *, uint8_t *, size_t, uint64_t);
101 build_headers, build_settings, build_goaway);
175 const uint64_t *vals,
size_t n);
size_t protocore_h3_frame_write_header(uint8_t *work, uint8_t *out, size_t cap, uint64_t type, uint64_t length)
Write a frame header (type + length varints). bytes written, or 0 .
size_t protocore_h3_frame_build_data(uint8_t *work, uint8_t *out, size_t cap, const uint8_t *data, size_t len)
DATA frame wrapping data.
PROTOCORE_NS H3FrameNs H3Frame PROTOCORE_UNUSED
Module namespace.
proto_bool protocore_h3_frame_type_reserved(uint8_t *work, uint64_t type)
True if type is a reserved HTTP/2 frame type (0x02/0x06/0x08/0x09) .
size_t protocore_h3_frame_build_goaway(uint8_t *work, uint8_t *out, size_t cap, uint64_t stream_id)
GOAWAY frame carrying stream_id (RFC 9114 sec 7.2.6).
void protocore_h3_frame_settings_defaults(uint8_t *work, H3Settings *s)
Fill s with the RFC default settings.
proto_bool protocore_h3_frame_parse_header(uint8_t *work, const uint8_t *buf, size_t len, H3FrameHeader *out)
Parse a frame header (type + length varints) at buf. false if .
proto_bool protocore_h3_frame_parse_settings(uint8_t *work, const uint8_t *payload, size_t len, H3Settings *s)
Apply a SETTINGS payload (id, value varint pairs) to s. false if .
size_t protocore_h3_frame_build_settings(uint8_t *work, uint8_t *out, size_t cap, const uint64_t *ids, const uint64_t *vals, size_t n)
SETTINGS frame from n (id, value) pairs.
size_t protocore_h3_frame_build_headers(uint8_t *work, uint8_t *out, size_t cap, const uint8_t *block, size_t len)
HEADERS frame wrapping a QPACK-encoded field section block.
#define PROTOCORE_NS_LAYOUT(T,...)
Pin every dispatch slot of a table that is nothing but function pointers.
#define PROTOCORE_NS
Storage for a dispatch table. The const is load bearing.
Dispatch table. Addressed by offset, so the layout is asserted below.
proto_bool(* parse_header)(uint8_t *, const uint8_t *, size_t, H3FrameHeader *)
The settings we track, with defaults after H3FrameNs::settings_defaults.
uint64_t max_field_section_size
default "unlimited"
uint64_t qpack_blocked_streams
default 0
uint64_t qpack_max_table_capacity
default 0
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS