Wire codec ready
RFC 2131 / 2132 parse + build — Parse decodes a DISCOVER/REQUEST (BOOTP header + magic cookie + TLV options), BuildReply emits an OFFER / ACK / NAK. Strict on framing, tolerant of unknown option codes, hand-rolled so the core has zero third-party dependencies.
Decision core ready
Decide(pkt, opts) runs the stateless state machine — DISCOVER→OFFER, REQUEST→ACK, mismatched requested-IP→NAK, unknown MAC / other message types→drop. Build-tag-free and portable, so it is unit-tested on every platform without a socket.
Linux UDP/67 server ready
LinuxServer binds UDP/67 to one kernel interface via SO_BINDTODEVICE + SO_BROADCAST + SO_REUSEADDR and replies by broadcast. The socket path is covered without root through injectable syscall seams, so every error branch runs in CI.
Cross-platform surface ready
A build stub on non-Linux plus a socket-free StubServer that drives the Source → Lease pipeline. Callers compile and test the integration surface on darwin / windows / *bsd; the real bind only ships on Linux.
Optional metrics ready
Pass any Metrics implementation in Options; a nil sink discards everything. A ready-made Prometheus adapter (dhcpv4_packets_total{outcome} + dhcpv4_handle_duration_seconds) lives in the prom sub-package so the core library keeps no Prometheus dependency.
Coverage & 6 arches ready
100% test coverage including error branches (socket paths via syscall seams, no root), gofmt + go vet clean, green across all six 64-bit Go arches (amd64, arm64, riscv64, loong64, ppc64le, s390x).
Pure Go, cgo disabled, so it cross-compiles and embeds anywhere. A
hand-rolled RFC 2131 / 2132 wire codec keeps the core dependency-free; the socket path
is covered without root via injectable syscall seams; metrics are optional and the
Prometheus adapter is quarantined in the prom sub-package. Part of the
github.com/go-net-dhcp organization.