AntOS Library — net (reference)

The net library's design and native core — the Ant64's single networking library, over DeMon's CM5 stack. The script-facing API is luau_net.

What it is

net is one library for all IP networking: HTTP (with forms, auth, cookies, redirects, streaming), WebSockets, TCP/UDP sockets (with multicast/broadcast), DNS, ICMP diagnostics, NTP, and SMTP send. Socket handles echo the io file-handle shape so streaming code reads the same.

Consolidation

On the ESP32-P4 this was four libraries — curl (HTTP / WebSocket / mail), internet (connectivity, DNS, TCP), udp (datagrams, multicast, NTP), and icmp (ping). The rewrite merges them into one net, because from a script's point of view they are one concern. The old split (and the old API names — tcp_connect, icmp_ping, ntp_query, ws_connect, …) is gone; net is a fresh, coherent surface, not a compatibility shim.

Design notes

  • Networking runs on the CM's Linux stack — wired Gigabit Ethernet or Wi-Fi via the ESP32-C5 (Phreak); the C5 path is transparent to callers.
  • TLS depends on the system clock (certificate validity), so HTTPS works after NTP sync (net.ntp_sync) or a valid RTC (os.rtc) — a cold-boot ordering constraint, not a net bug.
  • NTP lives here, the RTC lives in os — the network clock source is a net job; the battery-backed hardware clock is the OS's. They meet at "set the system time."
  • The same core backs the built-in network commands (ping, dns, get, download) and the debug server.

Native core — libantos_net

libantos_net is the merge of the P4 sys_curl (libcurl-based HTTP/WS/SMTP), sys_net/connectivity, sys_icmp, and the UDP/NTP paths, wrapping the Linux sockets/resolver/TLS. Socket, server, ws, and UDP handles are the core's descriptor types. No Luau dependency — the same core serves scripts, commands, and the debug server.

Related

Important: The Ant64 family of home computers are at early design/prototype stage, everything you see here is subject to change.