1#ifndef WTCAPSULE_WTCAPSULE_H
2#define WTCAPSULE_WTCAPSULE_H
40#define WTCAPSULE_CLOSE_MESSAGE_MAX 1024
45#define WTCAPSULE_CLOSE_CODE_LEN 4
49#define WTCAPSULE_TYPE_MAX_STREAMS_BIDI 0x190B4D3FULL
53#define WTCAPSULE_TYPE_MAX_STREAMS_UNI 0x190B4D40ULL
57#define WTCAPSULE_TYPE_STREAMS_BLOCKED_BIDI 0x190B4D43ULL
61#define WTCAPSULE_TYPE_STREAMS_BLOCKED_UNI 0x190B4D44ULL
64#define WTCAPSULE_TYPE_MAX_DATA 0x190B4D3DULL
67#define WTCAPSULE_TYPE_CLOSE 0x2843ULL
70#define WTCAPSULE_TYPE_DRAIN 0x78aeULL
Value-type views that fold the SDK's recurring argument shapes into single parameters,...
Growing output buffer view for variable-length results.
Definition span.h:54
Read-only view of a byte range.
Definition span.h:30
unsigned int u32
unsigned 32-bit integer
Definition types.h:15
u64 usz
unsigned size (size_t equivalent)
Definition types.h:20
unsigned long u64
unsigned 64-bit integer
Definition types.h:13
int wtcapsule_decode_data_blocked(wired_span data, usz *at, u64 *max_data)
Attempt to decode the capsule at *at within data as a WT_DATA_BLOCKED capsule.
int wtcapsule_utf8_valid(wired_span msg)
1 iff msg is structurally valid UTF-8 (RFC 3629): every byte either starts a correctly-shaped 1/2/3/4...
int wtcapsule_decode_streams_blocked(wired_span data, usz *at, int bidi, u64 *max_streams)
Attempt to decode the capsule at *at within data as a WT_STREAMS_BLOCKED capsule of the given directi...
int wtcapsule_decode_max_data(wired_span data, usz *at, u64 *max_data)
Attempt to decode the capsule at *at within data as a WT_MAX_DATA capsule.
int wired_wtcapsule_decode_close(wired_span data, usz *at, u32 *app_error_code, wired_span *message)
Attempt to decode the capsule at *at within data as a WT_CLOSE_SESSION.
usz wtcapsule_utf8_truncate_len(wired_span msg, usz cap)
The largest prefix length of msg, <= cap, that ends on a whole UTF-8 character boundary – for truncat...
int wtcapsule_encode_max_streams(wired_obuf *out, int bidi, u64 max_streams)
Encode a WT_MAX_STREAMS capsule (draft-ietf-webtrans-http3-15 SS5.6.2) into out: type 0x190B4D3F for ...
int wtcapsule_encode_streams_blocked(wired_obuf *out, int bidi, u64 max_streams)
Encode a WT_STREAMS_BLOCKED capsule (SS5.6.3) into out: type 0x190B4D43 for bidi, 0x190B4D44 for uni,...
int wtcapsule_decode_drain(wired_span data, usz *at)
Attempt to decode the capsule at *at within data as a WT_DRAIN_SESSION.
int wired_wtcapsule_encode_close(wired_obuf *out, u32 app_error_code, wired_span message)
Encode a WT_CLOSE_SESSION capsule (type 0x2843) into out.
int wtcapsule_decode_max_streams(wired_span data, usz *at, int bidi, u64 *max_streams)
Attempt to decode the capsule at *at within data as a WT_MAX_STREAMS capsule of the given direction.
int wtcapsule_encode_max_data(wired_obuf *out, u64 max_data)
Encode a WT_MAX_DATA capsule (SS5.6.4, type 0x190B4D3D) into out: body a single varint (Maximum Data,...
int wtcapsule_encode_data_blocked(wired_obuf *out, u64 max_data)
Encode a WT_DATA_BLOCKED capsule (SS5.6.5, type 0x190B4D41) into out: body a single varint (Maximum D...
int wtcapsule_encode_drain(wired_obuf *out)
Encode a WT_DRAIN_SESSION capsule (type 0x78ae, empty body) into out.
int wtcapsule_value_varint(wired_span value, u64 *v)
1 iff value is exactly one well-formed varint (fully consumed, no trailing bytes) – the body shape ev...