functions for manipulating packets

This commit is contained in:
Vinzenz Schroeter 2025-04-12 12:05:19 +02:00
parent cf9877ce7b
commit 38633f0b6b
9 changed files with 81 additions and 37 deletions

View file

@ -1908,7 +1908,11 @@ Packet *sp_packet_from_parts(Header header,
const uint8_t *payload,
size_t payload_len);
Header sp_packet_get_header(const Packet *packet);
Header *sp_packet_get_header(Packet *packet);
SPByteSlice sp_packet_get_payload(Packet *packet);
void sp_packet_set_payload(Packet *packet, SPByteSlice data);
/**
* Tries to load a [SPPacket] from the passed array with the specified length.
@ -1931,6 +1935,8 @@ Header sp_packet_get_header(const Packet *packet);
Packet *sp_packet_try_load(const uint8_t *data,
size_t length);
void sp_packet_write_to(const Packet *packet, SPByteSlice buffer);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus