Conversation
|
Thank you for your contribution to NETCAP! Before we can accept your pull request, you need to sign our Contributor License Agreement (CLA). To sign the CLA, please read the Individual CLA and comment below with: If you are contributing on behalf of a company or organization, please contact the maintainers to complete the Entity CLA instead. You can re-trigger this check by commenting I have read and agree to the NETCAP CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
|
Implementation and local evaluation are complete at 975b3b5. Full default unit target (race + coverage), changed-package nodpi race tests, repository-wide nodpi vet, Hyperscan integration tests, and default/nodpi CLI builds passed. The default CLI help smoke test also passed. Remote status after waiting: all CodeQL analyses passed; Go build/test remains queued with no steps started. CLA Assistant fails because its existing configuration uses the nonexistent The PR remains draft. Detailed implementation scope, benchmark limitations, tooling constraints, and the pre-existing persistent-read-error issue are recorded in the PR description. |
Real-PCAP verification (The Ultimate PCAP v20250325, 15.2 MB, 82 audit record types)Compared the built binary against an 1. Full decode, all decoders
The generics differing set is a strict subset of the baseline noise floor. Zero types differ where the baseline is stable, so no regression is attributable to this branch. Generics was actually stable on three types where two baseline runs disagreed (IMAP, TLSCertificate, TLSRecord). Byte-identical, including the two decoders migrated to Nondeterministic in both (stream reassembly, random session IDs, header map ordering): DeviceProfile, File, Host, IRC, Kerberos, MQTTSN, Mail, Protobuf, SIP, SMB, SMTP, Secret, Service, Software. 2. Decoder selection — 10/10 scenarios matchIdentical audit-record file sets and exit codes for: The reported sentinel text alternates between 3. Typed WebUI readers — byte-identicalBoth binaries served the same output directory, isolating reader code from capture nondeterminism:
Edge cases on real audit record files — missing files and wrong-type files ( 4. Pre-existing bug confirmed triggerable on real dataA truncated |
Summary
Complete the scoped generics adoption plan without redesigning runtime decoder/writer interfaces or generated protobuf types.
AuditRecordReader.NextAs[T]and shared typed traversal for Connection, Service, and DeviceProfile summaries. Preserve header-selected allocation, mismatches, empty arrays, projections, sorting, and existing error policy.NetcapClient.GetAs[T]and migrate stable response decoding; retain raw responses and session fallback behavior.Validation
make -f Makefile.test test-unitpassed: full default-build unit suite with race detection and coverage, including PCAP capture.go vet -tags=nodpi ./...passed.make -f Makefile.test test-hyperscanpassed.docker buildx build --check; Ubuntu archive SHA-256 verified against official metadata. CI YAML/shell checks passed.git diff --checkpassed. Independent code review found no introduced regressions.Performance Evaluation
Repeated adapter-plus-real-conversion microbenchmarks on Go 1.27.0, darwin/arm64 (Apple M5 Max), at default CPU settings and CPU=1, including a final 10-sample run:
Timing direction varied between runs, with slower generic samples as well as faster ones. These results do not establish a speedup or performance equivalence. Keep the pilot limited to two decoders; no broad packet-path migration. The adapter still performs a runtime type assertion.
Scope Decisions
Limitations And Existing Issues
reader.go:139-149). Preserved rather than changing unrelated error policy; recoverable malformed protobuf records are regression-tested.