std1.0.0-beta-7 SafeC docs

Module net::udp

#include <std/net/udp.h> source

UDP Layer Freestanding-safe.

Structs

UdpHdr

Functions

udp_parseParse UDP header from pkt at byte offset offset. Returns 0 on success, -1 on truncation.
udp_buildWrite UDP header into pkt at offset. payload_len = bytes of data after header. Checksum is left 0 (optional in IPv4). Returns byte offset of first payload byte.
udp_frameFull frame: Ethernet + IPv4 + UDP header, then caller fills payload. Returns offset where payload should be written. pkt is reset first.

Macros

UDP_HDR_LEN