|
wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
|
WebTransport wire-format helpers (pure functions, no state). More...
Go to the source code of this file.
Functions | |
| usz | wired_wtwire_signal_put (u8 *buf, usz cap, int bidi, u64 session_id) |
| Write the uni (bidi=0) / bidi (bidi=1) stream signal prefix into buf. | |
| usz | wtwire_qsid_put (u8 *buf, usz cap, u64 session_id) |
| Write the datagram quarter-stream-ID prefix varint(session_id / 4). | |
| usz | wired_wtwire_qsid_take (wired_span dg, u64 *session_id) |
| Read the quarter-stream-ID varint at the head of a datagram. | |
| int | wired_wtwire_get_parse (wired_span line, wired_span *file) |
| Parse a "GET <filename>" line. | |
| usz | wired_wtwire_get_put (u8 *buf, usz cap, wired_span filename) |
| Write "GET <filename>" (no trailing newline) into buf. | |
| int | wired_wtwire_push_parse (wired_span msg, wired_span *name, wired_span *content) |
| Parse a "PUSH <name>\n<content>" message. | |
| usz | wired_wtwire_push_head_put (u8 *buf, usz cap, wired_span basename) |
| Write the push header "PUSH <basename>\n" into buf. | |
| wired_span | wired_wtwire_basename (wired_span path) |
| View of the path component after the last '/'; the whole path if it has no '/'. | |
WebTransport wire-format helpers (pure functions, no state).
Covers three small wire shapes used against the webtransport-go reference implementation in the quic-interop-runner:
| wired_span wired_wtwire_basename | ( | wired_span | path | ) |
View of the path component after the last '/'; the whole path if it has no '/'.
A path ending in '/' yields an empty span.
| path | the input path |
| int wired_wtwire_get_parse | ( | wired_span | line, |
| wired_span * | file ) |
Parse a "GET <filename>" line.
The filename is trimmed of surrounding spaces, tabs, and line endings; an empty trimmed name is an error.
| line | the request line (trailing newline optional) |
| file | set to a view of the trimmed filename on success |
| usz wired_wtwire_get_put | ( | u8 * | buf, |
| usz | cap, | ||
| wired_span | filename ) |
Write "GET <filename>" (no trailing newline) into buf.
| buf | destination |
| cap | capacity of buf |
| filename | the requested file name |
| usz wired_wtwire_push_head_put | ( | u8 * | buf, |
| usz | cap, | ||
| wired_span | basename ) |
Write the push header "PUSH <basename>\n" into buf.
| buf | destination |
| cap | capacity of buf |
| basename | the pushed file's base name |
| int wired_wtwire_push_parse | ( | wired_span | msg, |
| wired_span * | name, | ||
| wired_span * | content ) |
Parse a "PUSH <name>\n<content>" message.
The split is at the first newline; the name is trimmed, and an empty trimmed name or a missing newline is an error. content may be empty.
| msg | the full push message |
| name | set to a view of the trimmed name on success |
| content | set to a view of the bytes after the newline on success |
| usz wired_wtwire_qsid_take | ( | wired_span | dg, |
| u64 * | session_id ) |
Read the quarter-stream-ID varint at the head of a datagram.
RFC 9297 SS2.1: a Quarter Stream ID above 2^60-1 does not map to any legal QUIC stream ID (session_id = qsid * 4 would exceed the 2^62-1 stream ID space) and is a decode failure, same as a truncated varint.
| dg | the datagram payload |
| session_id | set to quarter stream ID * 4 on success |
Write the uni (bidi=0) / bidi (bidi=1) stream signal prefix into buf.
| buf | destination |
| cap | capacity of buf |
| bidi | nonzero for a bidirectional stream (0x41), else 0x54 |
| session_id | QUIC stream ID of the Extended CONNECT stream |