std1.0.0-beta-7 SafeC docs

Module net::net_core

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

Network Core Packet buffer and network interface abstraction. Freestanding-safe.

Structs

PacketBuf
NetIf

Traits

NetDriver

Functions

net_htons
net_ntohs
net_htonl
net_ntohl
net_ip4_strFormat an IPv4 address into buf as "a.b.c.d\0" (at least 16 bytes).
net_mac_strFormat a MAC address into buf as "xx:xx:xx:xx:xx:xx\0" (at least 18 bytes).
net_ip4Build an IPv4 address from four octets: a<<24 | b<<16 | c<<8 | d. Every std::net API takes and returns IPv4 addresses (and ports, seq numbers, …) as plain host integers in this numeric form; the build/parse functions do the big-endian wire (de)serialization themselves, so callers never need net_htons/net_htonl for them.

Macros

NET_MTUEthernet max frame size (excl. preamble/FCS)
NET_MAC_LEN
NET_IP4_LEN