ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
network/packet/decoder.h
Go to the documentation of this file.
1#pragma once
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
14typedef struct {
18 size_t used, size;
19 size_t max_payload;
20 bool failed;
22typedef asciichat_error_t (*packet_decoder_fn)(const void *, size_t, void *);
26
27#ifdef __cplusplus
28}
29#endif
unsigned char uint8_t
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:48
bool packet_decoder_pending(const packet_decoder_t *)
asciichat_error_t(* packet_decoder_fn)(const void *, size_t, void *)
asciichat_error_t packet_decoder_feed(packet_decoder_t *, const void *, size_t, packet_decoder_fn, void *)
void packet_decoder_reset(packet_decoder_t *)
When code needs to work with packet decoder, it keeps header_used, packet, used, size here instead of...
size_t max_payload
Zero uses MAX_PACKET_SIZE; set before the first feed.
uint8_t header[sizeof(packet_header_t)]
Fixed prefix shared by every ACIP packet on the wire.
Definition packet.h:641