1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
//! `flowscope` — passive flow & session tracking for packet capture.
//!
//! Cross-platform, runtime-free library for **observing** what's
//! happening on the wire. Pair with any source of `&[u8]` frames:
//! `netring` (Linux AF_PACKET / AF_XDP), pcap files, tun-tap,
//! eBPF, embedded.
//!
//! ## What's here
//!
//! Core (always on):
//!
//! - [`PacketView`] / [`Timestamp`] — the abstract input.
//! - [`FlowExtractor`] — turn a frame into a flow descriptor.
//! - [`FlowTracker`] — bidirectional flow accounting + TCP state
//! machine + idle/eviction policy. Hot-cache fast path on
//! monoflow workloads.
//! - [`Reassembler`] — sync per-(flow, side) TCP byte stream hook.
//! Optional per-side buffer cap with [`OverflowPolicy`]
//! (sliding-window or drop-flow).
//! - [`SessionParser`] / [`DatagramParser`] — typed L7 message
//! parsing per flow.
//! - [`FlowDriver`] — sync wrapper combining the tracker with a
//! reassembler factory; optional anomaly emission via
//! [`FlowDriver::with_emit_anomalies`].
//! - [`driver::Driver`] — typed flow-lifecycle driver; register one
//! session/datagram slot per protocol for typed L7 messages. This
//! replaced the per-parser `FlowSessionDriver` / `FlowDatagramDriver`
//! in 0.20 (#99).
//!
//! Built-in extractors and decap combinators (`extractors` feature):
//!
//! - [`extract::FiveTuple`], [`extract::IpPair`], [`extract::MacPair`]
//! - [`extract::StripVlan`], [`extract::StripMpls`],
//! [`extract::InnerVxlan`], [`extract::InnerGtpU`],
//! [`extract::InnerGre`], [`extract::AutoDetectEncap`],
//! [`extract::FlowLabel`]
//!
//! ## Cargo features
//!
//! Granular leaf flags compose into coarse umbrellas. Pick the smallest
//! that fits; `--all-features` (docs.rs) turns on everything including the
//! FoxIO-licensed `ja4plus`.
//!
//! **Umbrellas & tiers** — correct, coarse groupings (issue #87):
//!
//! | Feature | Pulls |
//! |-----------------|-------|
//! | `full` | `l7` + every license-clean capability (excludes FoxIO `ja4plus`) |
//! | `l7` | every license-clean wire parser (the three `parsers-*` tiers + `tls-fingerprints`) |
//! | `parsers-core` | `http` `tls` `dns` `icmp` |
//! | `parsers-l2l3` | `arp` `ndp` `lldp` `cdp` `dhcp` (L2/L3 asset discovery) |
//! | `parsers-tier2` | the 19 Tier-2 parsers (`ssh` `ntp` `ssdp` `tftp` `mdns` `netbios-ns` `ftp` `smtp` `wireguard` `modbus` `stun` `rdp` `snmp` `radius` `quic` `smb` `ldap` `kerberos` `dnp3`) |
//! | `nsm` | network-security monitoring: `fingerprint` + `tls-fingerprints` + `analysis` |
//! | `ml` | `ml-features` + `ml-features-nprint` |
//! | `export` | `ipfix` + `ipfix-export` + the `emit*` writers |
//!
//! **Protocol parsers** (each behind its own feature):
//!
//! | Feature | Module | What you get |
//! |---------|--------|--------------|
//! | `http` | [`http`] | HTTP/1.x request/response parser |
//! | `tls` | [`tls`] | TLS handshake observer (ClientHello/ServerHello/Alert) |
//! | `dns` | [`dns`] | DNS-over-UDP/TCP parsers + query/response correlator |
//! | `icmp` | [`icmp`] | ICMPv4/v6 decoder + inner-flow correlation |
//! | `arp` | [`arp`] | ARP + `correlate::NeighborTable` binding tracker |
//! | `ndp` | [`ndp`] | IPv6 Neighbor Discovery (ICMPv6 135/136) |
//! | `dhcp` | [`dhcp`] | DHCP/BOOTP options + Fingerbank-style fingerprint |
//! | `lldp` | [`lldp`] | LLDP (IEEE 802.1AB) L2 asset discovery |
//! | `cdp` | [`cdp`] | Cisco Discovery Protocol |
//! | `ssh` | [`ssh`] | SSH banner + KEXINIT + HASSH fingerprint |
//! | `ntp` | [`ntp`] | NTP (UDP/123); monlist amplification signal |
//! | `ssdp` | [`ssdp`] | SSDP/UPnP IoT discovery |
//! | `tftp` | [`tftp`] | TFTP (UDP/69) device-config-theft visibility |
//! | `mdns` | [`mdns`] | mDNS / DNS-SD service walker (pulls `dns`) |
//! | `netbios-ns` | [`netbios_ns`] | NetBIOS Name Service (UDP/137) |
//! | `ftp` | [`ftp`] | FTP control channel + AUTH-TLS upgrade |
//! | `smtp` | [`smtp`] | SMTP + AUTH base64 decode + STARTTLS |
//! | `wireguard` | [`wireguard`] | WireGuard handshake metadata |
//! | `modbus` | [`modbus`] | Modbus/TCP (502) ICS visibility |
//! | `stun` | [`stun`] | STUN (RFC 5389) WebRTC / NAT discovery |
//! | `rdp` | [`rdp`] | RDP X.224 negotiation metadata |
//! | `snmp` | [`snmp`] | SNMP v1/v2c (rusticata snmp-parser) |
//! | `radius` | [`radius`] | RADIUS auth/accounting (rusticata radius-parser) |
//! | `quic` | [`quic`] | QUIC Initial passive decrypt → SNI/ALPN |
//! | `smb` | [`smb`] | SMB2/3 lateral-movement decode |
//! | `ldap` | [`ldap`] | LDAP bind/search (rusticata ldap-parser) |
//! | `kerberos` | [`kerberos`] | Kerberos AS/TGS/KRB-ERROR |
//! | `dnp3` | [`dnp3`] | DNP3 (TCP/20000) OT/SCADA metadata |
//!
//! **Capabilities & output:**
//!
//! | Feature | Module | What you get |
//! |---------|--------|--------------|
//! | `asset` | [`asset`] | `Asset` + LRU `Inventory`; self-sufficient (pulls its discovery parsers) |
//! | `analysis` | [`analysis`] | `FlowAnalyzer` → risk / IOC enriched flow records |
//! | `tcp_fingerprint` | [`tcp_fingerprint`] | p0f-style passive TCP/IP OS fingerprint |
//! | `fingerprint` | [`detect::fingerprint`] | encrypted-flow **behavioural** fingerprint (not the JA4+ facade — see below) |
//! | `tls-fingerprints` | [`tls`] | JA3 + JA4 TLS *client* fingerprints (royalty-free) |
//! | `ja4plus` | [`tls`] | JA4S/JA4X server fingerprints (**FoxIO License 1.1**, off by default) |
//! | `ml-features` / `ml-features-nprint` | [`ml_features`] / [`nprint`] | CICFlowMeter vector / nPrint bit matrix |
//! | `ipfix` / `ipfix-export` | [`ipfix`] | IANA IE vocabulary / RFC 7011 binary encoder |
//! | `emit` / `emit-ndjson` / `emit-eve` | [`emit`] | CSV+Zeek / NDJSON / Suricata EVE writers |
//! | `aggregate` | [`aggregate`] | `Histogram` + `Percentile` (t-digest) |
//! | `file-hash` | [`detect::file`](detect) | streaming SHA-256/MD5 + MIME-class detection |
//! | `community-id` | [`well_known`] | Corelight Community ID v1 flow hashing |
//! | `chrono` | [`Timestamp`] | `chrono::DateTime<Utc>` interop |
//! | `pcap` | [`pcap`] | pcap file source for offline replay |
//! | `serde` | — | `Serialize`/`Deserialize` on every public type (locks wire vocabulary) |
//!
//! **Always-on modules** (no feature gate):
//!
//! | Module | What you get |
//! |--------|--------------|
//! | [`fingerprint`] | unified JA4+ facade — one import site for the whole family, grouped by license (distinct from the `fingerprint`-feature behavioural detector above) |
//! | [`app_proto`] | identify h2 / h3 + DoT / DoQ / DoH over an encrypted transport from ALPN / SNI / port (no decryption) |
//! | [`ip_fragment`] | IP fragment reassembly (RFC 791 key, RFC 5722 overlap-drop) — defeats fragmentation-based L4/L7 evasion |
//!
//! **Observability** (zero-cost when off):
//!
//! | Feature | What you get |
//! |-----------|--------------|
//! | `metrics` | Prometheus / OpenTelemetry counters, gauges, histograms (see [`obs`]) |
//! | `tracing` | Structured events on flow lifecycle + anomalies |
//!
//! ## Tokio integration
//!
//! For async iteration over flow / session / datagram events, see
//! [`netring`](https://crates.io/crates/netring)'s `AsyncCapture::flow_stream`
//! / `.session_stream` / `.datagram_stream`. Those depend on this
//! crate's traits. The sync analogue is the typed [`driver::Driver`]
//! with one session/datagram slot per protocol.
//!
//! ## Re-exporting flowscope types
//!
//! Crates that re-export flowscope types (`netring`, sister crates,
//! internal forks) should write intra-doc links in the bare
//! `` [`FlowDriver`] `` form, **not** the explicit
//! `` [`FlowDriver`](flowscope::FlowDriver) `` form.
//! The explicit path duplicates what rustdoc already resolves through
//! the re-export and trips the `redundant_explicit_links` lint under
//! `-D warnings`. See recipes.md's "Re-exporting flowscope types"
//! section for the worked example.
// Typed detector identity + ATT&CK technique mapping (issue #133).
// Compile-time guards on the `l7` / `full` feature umbrellas (issue #87).
pub use DetectorKind;
pub use ;
pub use MacAddr;
pub use ParserKind;
pub use ;
// Issue #76: Corelight Community ID v1 flow hashing. Gated by the
// `community-id` feature (pulls SHA-1 + base64). The seed-fixed
// `stable_hash` / `shard_index` helpers on `KeyFields` are always-on
// and need no crypto, so they live in `anomaly_fields`, not here.
// Issue #77: JA4L / JA4LS latency fingerprint (FoxIO-licensed JA4+).
// Issue #136: unified JA4+ fingerprint facade — one import site for
// the whole family, grouped by license. Empty in a build with no
// fingerprint features enabled.
// Issue #138: application-protocol identification over encrypted
// transports (h2/h3, DoT/DoQ/DoH) from ALPN / SNI / port.
// Issue #138: IP fragment reassembly — defeats fragmentation-based
// L4/L7 evasion by reassembling the original datagram.
pub use ;
// Issue #131 (0.21): unified detector trait + registry at the
// crate root, beside the anomaly types they produce.
pub use ;
pub use SegmentBufferReassembler;
// Crate-internal session/datagram engines (the public
// `FlowSessionDriver` / `FlowDatagramDriver` were removed in 0.20,
// #99). Retained privately because the typed `driver` slots and the
// offline `pcap` source both need per-flow parser dispatch.
pub
pub
// Plan 162 (0.14): top-level re-export for the unified
// ICMPv4/v6 Destination Unreachable classification. Parallels
// `pub use anomaly::OwnedAnomaly` (0.13) — frequently-imported
// enum surfaced at the crate root.
pub use ;
// Issue #1 (0.17): ARP visibility — opt-in via the `arp` feature.
pub use ;
// Issue #6 (0.18): NDP (IPv6 Neighbor Discovery) — the ARP
// sibling. Pairs with the always-on `NeighborTable<Ipv6Addr,
// MacAddr>` for binding tracking.
pub use ;
// Issue #11 (0.18): DHCP — UDP/67-68 BOOTP + RFC 2132 options
// + Fingerbank-style option-55 + option-60 fingerprint.
pub use ;
// Issue #23 (0.18): LLDP — IEEE 802.1AB-2016 L2 discovery.
// Asset / rogue-switch visibility for infrastructure devices.
pub use ;
// Issue #25 (0.18): CDP — Cisco Discovery Protocol, the LLDP
// sibling. Asset / topology / rogue-switch visibility on
// Cisco gear.
pub use ;
// Issue #14 sub-piece (0.18): NTP — UDP/123. Stratum / mode /
// ref-id surface + NTP-amplification (monlist) detection.
pub use ;
// Issue #14 sub-piece (0.18): SSDP — UDP/1900. UPnP / DLNA /
// IoT asset discovery.
pub use ;
// Issue #14 sub-piece (0.18): TFTP — UDP/69. Device-config
// transfer visibility.
pub use ;
// Issue #14 sub-piece (0.18): mDNS — UDP/5353. Wire-format
// wrapper around `dns` + RFC 6763 service-discovery helpers.
// Pairs with `asset` for IoT inventory enrichment.
pub use ;
// Issue #14 sub-piece (0.18): NetBIOS Name Service — UDP/137.
// Windows-side counterpart to mDNS/SSDP; completes the
// broadcast-name-service asset-discovery trio.
pub use ;
// Issue #14 sub-piece (0.18): FTP — TCP/21 control channel.
// Cleartext credential capture + AUTH-TLS upgrade detection +
// transfer-command visibility.
pub use ;
// Issue #14 sub-piece (0.18): SMTP — TCP/25 + 587. Cleartext
// AUTH PLAIN/LOGIN credential capture + named-exfil
// (MAIL FROM / RCPT TO) + STARTTLS upgrade detection.
pub use ;
// Issue #14 sub-piece (0.18): WireGuard handshake detection.
// Passive tunnel-fingerprint for shadow-VPN / mesh-VPN
// evasion detection.
pub use ;
// Issue #14 sub-piece (0.18): Modbus/TCP. ICS passive
// observability (the only safe mode for SCADA networks).
pub use ;
// Issue #14 sub-piece (0.18): STUN — RFC 5389. WebRTC peer
// detection, NAT-type discovery, TURN identification.
pub use ;
// Issue #14 sub-piece (0.18): RDP — TCP/3389 X.224 negotiation
// metadata-only (the lateral-movement T1021.001 vector).
// Pairs with `tls` for the wrapper handshake.
pub use ;
// Issue #14 sub-piece (0.18): SNMP v1/v2c — UDP/161 + UDP/162.
// Asset enum + DDoS amplification detection + cleartext
// community-string capture.
pub use ;
// Issue #14 sub-piece (0.18): RADIUS — UDP/1812 + UDP/1813.
// Identity correlation, NAC / wireless-auth visibility.
pub use ;
// Issue #29 (0.18): DNP3 — TCP/20000 OT visibility.
// Metadata-only — link-layer reassembly out of scope to
// avoid the Suricata CVE class.
pub use ;
// Issue #27 (0.18): unified Asset record + Inventory over
// the asset-discovery parsers.
pub use ;
// Issue #83: analysis composition layer — wires detect/risk/IOC
// to the flow lifecycle, producing enriched `AnalyzedFlow` records.
pub use ;
// Issue #9 (0.18): p0f-style passive TCP/IP fingerprint.
// License-clean alternative to FoxIO's JA4T / JA4TS.
pub use ;
// Issue #16 sub-piece (0.18): IPFIX IE vocabulary. The full
// FlowRecord re-key stays open in #16.
pub use FlowRecord;
// Issue #15 scoped sub-piece (0.18): CICFlowMeter-compatible
// feature vector. Subset that's derivable from a finalised
// FlowRecord alone (no per-packet IAT tracking). Gated on
// ipfix (the FlowRecord source-of-truth).
pub use CicFlowFeatures;
// Issue #30 (0.18): nPrint per-packet ternary header-bit matrix
// for model-agnostic ML pipelines. Separate Cargo feature
// because per-packet storage is non-trivial (vs. ml-features
// which is O(1) per flow).
pub use ;
// Issue #13 (0.18): Kerberos passive metadata parser
// (rusticata kerberos-parser).
pub use ;
// Issue #13 (0.18): LDAP passive metadata parser
// (rusticata ldap-parser).
pub use ;
// Issue #12 (0.18): SMB2/3 passive parser (hand-rolled).
pub use ;
// Issue #3 (0.18): QUIC Initial parser — ClientHello
// visibility via RFC 9001 §5.2 Initial-secret derivation
// + AEAD decrypt (passive-decryptable).
pub use ;
// Issue #7 (0.18): SSH handshake parser + HASSH fingerprint.
pub use ;
/// Parser stubs for downstream test crates. Gated by the
/// `test-helpers` feature; not for production use.
pub use Timestamp;
pub use ;
// The deprecated `parser_kinds` string-constant module (soft-
// deprecated in 0.18, slated for removal) was removed in 0.22
// (issue #139) — use the typed [`ParserKind`] enum instead; its
// `.as_str()` yields the same slug vocabulary.
pub use ;
pub use Dedup;
pub use ;
pub use ;
pub use FlowDriver;
pub use HistoryString;
pub use ;
pub use ;
pub use ;