Commit Graph
2 Commits
Author SHA1 Message Date
gurix 9446dd5c27 feat(01-02): implement capture package with OpenCapture, ListInterfaces, StartCapture
- ListInterfaces uses net.Interfaces() stdlib (no pcap dependency for listing)
- OpenCapture wraps packetcap/go-pcap with platform-specific permission error handling
- StartCapture uses buffered channel (512) with atomic drop counter
- Dynamic link type detection via layers.LinkType(handle.LinkType())
- Linux error shows setcap cap_net_raw+ep hint; macOS shows sudo hint
- Add github.com/packetcap/go-pcap v0.0.0-20251215 to go.mod
2026-03-25 12:17:16 +01:00
gurix 1eb1dd4104 test(01-02): add failing tests for capture package
- TestListInterfaces: verifies net.Interfaces() returns at least 1 interface
- TestListInterfacesFormat: verifies interface Name is non-empty
- TestIsPermissionError: table-driven positive cases for perm error detection
- TestIsPermissionErrorNegative: non-perm errors not flagged
- TestPermissionErrorMsg: verifies sudo + interface name + Linux setcap hint
2026-03-25 12:16:20 +01:00