msantos/procket
52.9
Weak · 23 September 2026
3.3k
lines of production code
Erlang
with C
5
measurements over time
What this system is
This system is a low-level Erlang library for advanced network programming, providing direct access to Linux packet sockets, Berkeley Packet Filters (BPF), and raw Ethernet frame manipulation. It exposes modules for managing BPF devices, handling PF\_PACKET sockets, and performing system-level I/O control operations. The codebase also includes example programs demonstrating network namespace usage, ICMP messaging, and control data handling.
Features
Add BPF, packet socket, and ioctl helper modules
The library introduces new modules for advanced packet manipulation and system calls. The \bpf\ module provides functions to open BPF devices, retrieve attributes (such as buffer length, datalink type, and statistics), and apply BPF filters. The \packet\ module adds support for Linux PF\_PACKET sockets, enabling users to send and receive raw Ethernet frames, look up MAC addresses via ARP cache, and resolve interface names and indices. Additionally, \procket\_ioctl\ is added to calculate ioctl request macros at runtime for both Linux and BSD systems, and \procket\_mktmp\ provides utilities for creating temporary directories. These changes expand the library's capabilities for low-level network programming and device interaction.
src · high confidence
Added and reorganized example programs for network namespaces, ICMP, and message passing
Added new example programs: \sniff.erl\ demonstrates using network namespaces to capture packets on specific interfaces; \icmp.erl\ and \icmp6.erl\ provide examples for sending and filtering ICMP and ICMPv6 echo requests; \sendmsg\_recvmsg\_echo.erl\ shows how to use \sendmsg\ and \recvmsg\ with control data. Additionally, the existing \echo.erl\ example was moved from the \src\ directory to \examples\, updated to accept protocol family and type options, and simplified to remove the \inet:setopts\ call.
examples · high confidence
New header files for BPF, packet, and socket constants
Added new header files (bpf.hrl, packet.hrl, procket.hrl) that define BPF ioctl commands, packet socket options, and socket constants, while renaming and refactoring the previous mktmp module into include/ioctl.hrl to provide common ioctl macros.
include · high confidence
Behavioural changes
Migration to Rebar3 build system
The project has migrated from a custom Makefile-based build process to Rebar3. This change updates the build configuration (rebar.config, rebar.lock) and build scripts (rebar.config.script) to use Rebar3 for compilation, dependency management, and tooling (dialyzer, ex\_doc). The legacy Emakefile and manual Makefile targets for C compilation and NIF building have been removed in favor of Rebar3's standard hooks. Users will now use Rebar3 commands (e.g., \rebar3 compile\) instead of the previous Makefile targets.
(repo-wide) · high confidence
Refactor procket C source to use stateless NIFs and modernize build system
The C source code in c\_src has been refactored to use stateless NIFs, replacing the previous stateful approach with a static buffer for socket paths and a new procket\_alloc resource type for memory management. The build system has been updated to a new Makefile that supports cross-compilation, handles architecture-specific flags (x86\_64, arm64, i686, i386), and compiles ancillary and command-line tools. Additionally, procket\_constants.h was added to map IP protocol constants, and fd\_recv/fd\_send were updated to use a union for control message buffers to fix alignment issues.
_c\src · medium confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 45 → 53 (+7.4)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 91 → 95 (+4.7)
- Architecture 100 → 100 (+0.0)
- Maturity 50 → 59 (+9.1)
- Readiness 15 → 25 (+9.2)
- Security 100 → 100 (+0.0)
Resolved (7)
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- No exposed public API
- Off-boarding risk: anonymized user #1
- The README does not mention how to install or compile procket from source. (README.md)
- There is no dedicated USING IT or EXAMPLES section, so readers cannot quickly try the library. (README.md)
- TooManyMethods: procket (src/procket.erl)
- complexity unreadable for .erl, .hrl — churn × complexity hotspots could not be measured
New (11)
- Documentation: no contributor guidance (README.md)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (27–30 lines × 2) (src/packet.erl)
- FixmeComment (src/bpf.erl)
- FixmeComment (src/bpf.erl)
- FixmeComment (src/bpf.erl)
- FixmeComment (src/bpf.erl)
- bpf.ctl (cognitive 21) (src/bpf.erl)
- bpf.ctl (cyclomatic 17) (src/bpf.erl)
- bpf.ctl (cyclomatic 20) (src/bpf.erl)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
msantos/procket was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 23 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 362d20157f29bb19e63e7ab1e6b5ab6a560b94b0 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-955b9cee9818.