1.0 ergonomics: replace 13 bespoke *_from_pcap helpers with one generic pcap::messages::<P>() #86
Labels
No labels
blocks-others
breaking
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
license: clean
license: foxio
needs-fuzz
priority: P0
priority: P1
priority: P2
question
roadmap
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
marcpardo/flowscope#86
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pre-1.0 ergonomics. Additive-then-deprecate (mild break OK).
Problem — 13 near-identical
*_from_pcaphelpers, inconsistently named, covering only 8 of 28 parsersThe per-parser pcap iterators are mechanically identical (open
PcapFlowSource,.sessions/.datagrams, filterSessionEvent::Application→(key, message)):http::{requests,responses,exchanges}_from_pcap(src/http/pcap_iter.rs)dns::{messages,exchanges}_from_pcap,tls::{client_hellos,handshakes}_from_pcap,quic::initials_from_pcap,smb/kerberos/ldap/ssh::messages_from_pcap,pcap::flow_summaries_from_pcap(the one outlier — drives a raw tracker, eagerVec).Problems:
messages_from_pcapvsclient_hellos_from_pcapvsinitials_from_pcapvsrequests_from_pcap. No rule.Proposed direction — one generic typed entry, drop the bespoke 13
PcapFlowSource::sessions(ext, parser)/.datagrams(ext, parser)are already generic — the 13 helpers add nothing but a name. Replace them with a single ergonomic, discoverable API so every parser is equally first-class:(or a small
PcapMessages::<P>::open(path)builder). One generic function → uniform name, uniform behaviour, zero per-parser code, automatic coverage for all 28 + future parsers. The multi-parser case staysDriver::run_pcap(driver/typed.rs:398).Keep
flow_summaries_from_pcap(it's genuinely different — no parser, raw flow records) but rename for consistency (pcap::flow_summaries).Migration
Deprecate the 13 named helpers (keep one release as
#[deprecated]aliases delegating to the generic), document the one-call replacement in the migration recipe, delete next major.Effort: S–M. High DX payoff; shrinks the public surface.