std1.0.0-beta-7 SafeC docs

std :: net::udp

Function std::udp_build

#include <std/net/udp.h> source ยท definition

unsigned long udp_build(
    &PacketBuf pkt,
    unsigned long offset,
    unsigned short src_port,
    unsigned short dst_port,
    unsigned short payload_len,
)

Write 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.