wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
session.h
Go to the documentation of this file.
1#ifndef QUIC_WT_SESSION_SESSION_H
2#define QUIC_WT_SESSION_SESSION_H
3
6
29
38
44#define WIRED_WT_MAX_BUFFERED_STREAMS 4
45
49#define WIRED_WT_MAX_BUFFERED_DATAGRAMS 4
50
55#define WIRED_WT_BUFFERED_DATAGRAM_CAP 256
56
64
73
106
112void wired_wt_session_init(wired_wt_session* s, u64 connect_stream_id);
113
121
127
135
145
158
172 wired_wt_session* s, int bidi, u64 max_streams);
173
185
193
202
212
219
220#endif
#define WIRED_WT_MAX_BUFFERED_DATAGRAMS
How many pre-establishment datagrams this session buffers.
Definition session.h:49
int wired_wt_session_drain(wired_wt_session *s)
established -> draining: a WT_DRAIN_SESSION capsule was sent/received.
void wired_wt_session_init(wired_wt_session *s, u64 connect_stream_id)
Reset s to WIRED_WT_UNESTABLISHED, empty of any buffered stream/datagram, identified by connect_strea...
#define WIRED_WT_MAX_BUFFERED_STREAMS
How many streams/datagrams that arrive before establishment this session buffers, each independently.
Definition session.h:44
#define WIRED_WT_BUFFERED_DATAGRAM_CAP
Fixed capacity for one buffered pre-establishment datagram's payload.
Definition session.h:55
void wired_wt_session_note_stream_opened(wired_wt_session *s, int bidi)
Record that one more stream of the given direction was opened, advancing the session's cumulative ope...
int wired_wt_session_offer_datagram(wired_wt_session *s, quic_span data)
Offer a datagram to the session: buffers a copy of it if unestablished (subject to WIRED_WT_MAX_BUFFE...
int wired_wt_session_offer_stream(wired_wt_session *s, u64 stream_id)
Offer a stream to the session: buffers it if unestablished (subject to WIRED_WT_MAX_BUFFERED_STREAMS)...
int wired_wt_session_set_max_data(wired_wt_session *s, u64 max_data)
Record a WT_MAX_DATA value just received from the peer (draft-ietf-webtrans-http3-15 SS5....
int wired_wt_session_set_max_streams(wired_wt_session *s, int bidi, u64 max_streams)
Record a WT_MAX_STREAMS value just received from the peer (draft-ietf-webtrans-http3-15 SS5....
int wired_wt_session_stream_open_allowed(const wired_wt_session *s, int bidi)
1 iff opening one more stream of the given direction stays within the peer's most recently advertised...
void wired_wt_session_note_data_sent(wired_wt_session *s, usz len)
Record that len more Stream Body bytes were sent, advancing the session's cumulative sent-data count.
int wired_wt_session_close(wired_wt_session *s)
established/draining -> closed: the CONNECT stream closed (FIN or RESET, either direction) or a WT_CL...
int wired_wt_session_data_send_allowed(const wired_wt_session *s, usz len)
1 iff sending len more Stream Body bytes stays within the peer's most recently advertised WT_MAX_DATA...
wired_wt_state
Session lifecycle state (draft-ietf-webtrans-http3-15 SS4).
Definition session.h:31
@ WIRED_WT_DRAINING
WT_DRAIN_SESSION sent/received (advisory).
Definition session.h:34
@ WIRED_WT_UNESTABLISHED
CONNECT seen, 2xx not yet sent.
Definition session.h:32
@ WIRED_WT_CLOSED
terminal: CONNECT stream closed, or WT_CLOSE_SESSION sent/received
Definition session.h:35
@ WIRED_WT_ESTABLISHED
server has sent its 2xx response
Definition session.h:33
int wired_wt_session_establish(wired_wt_session *s)
unestablished -> established: the server has sent its 2xx response (draft-ietf-webtrans-http3-15 SS4....
Value-type views that fold the SDK's recurring argument shapes into single parameters,...
Read-only view of a byte range.
Definition span.h:30
One buffered pre-establishment datagram, copied (not viewed) since the caller's span may not outlive ...
Definition session.h:67
u8 data[WIRED_WT_BUFFERED_DATAGRAM_CAP]
copied payload bytes
Definition session.h:70
usz len
number of valid bytes in data
Definition session.h:71
int in_use
1 if this slot holds a buffered datagram, 0 if free
Definition session.h:68
One buffered pre-establishment stream: just its id, since the stream's own reassembly state lives in ...
Definition session.h:60
int in_use
1 if this slot holds a buffered stream, 0 if free
Definition session.h:61
u64 stream_id
the buffered stream's id
Definition session.h:62
A WebTransport session.
Definition session.h:77
u64 opened_streams_uni
cumulative count of uni streams opened over the session's lifetime, including closed ones (SS5....
Definition session.h:98
u64 max_streams_uni
most recent WT_MAX_STREAMS (uni) value from the peer; 0 = none received yet (SS5.3)
Definition session.h:93
u64 max_data
most recent WT_MAX_DATA value from the peer; 0 = none received yet (SS5.4)
Definition session.h:101
wired_wt_buffered_stream streams[WIRED_WT_MAX_BUFFERED_STREAMS]
pre-establishment stream buffer; slots persist and are considered associated once established
Definition session.h:82
wired_wt_buffered_datagram datagrams[WIRED_WT_MAX_BUFFERED_DATAGRAMS]
pre-establishment datagram buffer, same persist-and-repurpose design as streams
Definition session.h:87
u64 max_streams_bidi
most recent WT_MAX_STREAMS (bidi) value from the peer; 0 = none received yet (SS5....
Definition session.h:91
wired_wt_state state
current lifecycle state
Definition session.h:78
u64 sent_data
cumulative Stream Body bytes sent on the session so far (SS5.4)
Definition session.h:103
u64 opened_streams_bidi
cumulative count of bidi streams opened over the session's lifetime, including closed ones (SS5....
Definition session.h:95
u64 connect_stream_id
this session's identity (the CONNECT stream's id)
Definition session.h:79
x86_64 Linux direct syscalls.
u64 usz
unsigned size (size_t equivalent)
Definition syscall.h:19
unsigned char u8
unsigned 8-bit integer / byte
Definition syscall.h:17
unsigned long u64
unsigned 64-bit integer
Definition syscall.h:12