user@devops:~$ cat README.md
route-watch
# Description
route-watch (cpp-route-watch) is a Linux kernel routing-table monitor written in dependency-free C++23. It reads /proc/net/route (IPv4) and /proc/net/ipv6_route (IPv6) to decode destinations, gateways, masks/prefixes, flags and per-interface metrics. IPv4: kernel little-endian hex to dotted-quad (e.g. 010110AC → 172.16.1.1) plus CIDR prefix from genmask. IPv6: network-order %pi6 hex with :: compression (e.g. ...0001 → ::1) — different from the LE word layout of /proc/net/tcp6. Classifies defaults, gateway routes (flag G) and host routes (flag H). Aggregates IPv4/IPv6 counts, default v4/v6, via-gateway and host routes. Sort order: defaults first, then most-specific prefix and metric. Watch mode (--watch N) with count deltas between snapshots. JSON output (--json) with summary + ipv4/ipv6 arrays. --demo multi-iface table (eth0, docker0, wg0, tun0, br-lan). --ipv4/--ipv6 filters. --no-color with mutable ANSI palette (0 escapes in pipes). Selftest: 44 checks covering hex decode, table parsers, demo, JSON and live /proc. Zero deps: g++ -std=c++23 -O2 -Wall -Wextra.
# Key features
$ Reads /proc/net/route + ipv6_route: destinations, gateways, flags, metrics and ifaces
$ IPv4 LE hex decode to dotted-quad and CIDR prefix from genmask
$ IPv6 %pi6 network-order decode with :: compression (unlike tcp6 LE words)
$ Classifies defaults, gateway routes (UG) and host routes (UH)
$ Watch mode (--watch N) with IPv4/IPv6/default count deltas between snapshots
$ JSON output (--json) with summary + ipv4/ipv6 arrays (python -m json.tool)
$ --demo multi-iface (eth0/docker0/wg0/tun0) and --no-color with 0 ANSI codes in pipes
$ Selftest 44 checks + zero dependencies: plain g++ -std=c++23 build
# Gallery
# Technologies used