user@devops:~$ cat README.md
unix-watch
# Description
unix-watch (cpp-unix-watch) is a Linux kernel AF_UNIX socket table monitor written in C++23 with no external dependencies. It reads /proc/net/unix (unix_seq_show: %pK %08X %08X %08X %04X %02X %5lu) to decode type (0001 STREAM, 0002 DGRAM, 0005 SEQPACKET), state (01 UNCONN, 02 CONNING, 03 CONN, 04 DISCONN), flags (0x10000 SO_ACCEPTCON = listen), refcount, decimal inode and path. Classifies abstract namespace (@name, leading NUL), pathname (/run/...) and unnamed (no path). Aggregates: sockets, stream/dgram/seqpacket, listening, connected, abstract, pathname, unnamed. Sort: listeners first, type, paths before unnamed. Watch mode (--watch N) with count deltas between snapshots. JSON (--json) with summary + sockets array. --demo multi-kind (dbus, udev, journal, mysql, X11, containerd). Filters --type, --listen, --abstract, --unnamed, --path PREFIX. --file parses dumps and skips # comments. --no-color with a mutable ANSI palette (0 escapes in pipes). Selftest 57 checks: kinds, states, parser (skips #), demo, JSON, live /proc read. Zero deps: g++ -std=c++23 -O2 -Wall -Wextra.
# Key features
$ Reads /proc/net/unix: type, state, SO_ACCEPTCON flags, inode and path
$ STREAM/DGRAM/SEQPACKET types and UNCONN/CONNING/CONN/DISCONN states
$ Abstract (@name) / pathname / unnamed classification
$ Flag L = SO_ACCEPTCON for listening sockets
$ Watch mode (--watch N) with socket/listen/connected deltas
$ JSON output (--json) with summary + sockets array (python -m json.tool)
$ --demo multi-kind (dbus/udev/journal/X11/containerd) and --no-color with 0 ANSI codes
$ Selftest 57 checks + zero dependencies: g++ -std=c++23
# Gallery
# Technologies used