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
//! [`ProtocolEvent`] + [`ProtocolMessage`] — the unified event surface.
//!
//! As of netring 0.18, [`ProtocolEvent<K>`] is a **type alias** for
//! [`flowscope::driver_unified::Event<K, ProtocolMessage>`]. The
//! prior netring-owned sum-type (`Flow(FlowEvent)` + `Message{…}`)
//! collapsed onto flowscope's unified `Event<K, M>` shape so the
//! whole anomaly toolkit shares the same event vocabulary as
//! flowscope's own pipeline.
//!
//! ## Migration from netring 0.17 and earlier
//!
//! The variant shapes shifted to match flowscope. The mechanical
//! rewrites:
//!
//! | Old (netring 0.17) | New (0.18) |
//! |---|---|
//! | `ProtocolEvent::Flow(FlowEvent::Started { … })` | `ProtocolEvent::FlowStarted { … }` (no `side` field) |
//! | `ProtocolEvent::Flow(FlowEvent::Established { … })` | `ProtocolEvent::FlowEstablished { … }` |
//! | `ProtocolEvent::Flow(FlowEvent::Packet { … })` | `ProtocolEvent::FlowPacket { … }` |
//! | `ProtocolEvent::Flow(FlowEvent::Ended { … })` | `ProtocolEvent::FlowEnded { … }` |
//! | `ProtocolEvent::Flow(FlowEvent::Tick { … })` | `ProtocolEvent::FlowTick { … }` |
//! | `ProtocolEvent::Flow(FlowEvent::FlowAnomaly { … })` | `ProtocolEvent::FlowAnomaly { … }` |
//! | `ProtocolEvent::Flow(FlowEvent::TrackerAnomaly { … })` | `ProtocolEvent::TrackerAnomaly { … }` |
//! | `ProtocolEvent::Message { kind, … }` | `ProtocolEvent::Message { parser_kind, … }` |
//!
//! Accessors `key()`, `timestamp()`, `parser_kind()`,
//! `anomaly_kind()`, `is_flow_event()`, `is_parser_event()` are
//! inherited from flowscope's `Event` impl.
/// Unified protocol event surface — a thin alias over flowscope's
/// driver-unified `Event<K, M>` with `M = ProtocolMessage`. Same
/// shape, same accessors, same `#[non_exhaustive]` discipline.
pub type ProtocolEvent<K> = Event;
/// A parsed L7 message. Variants are feature-gated by the
/// corresponding parser feature (`http` / `dns` / `tls` / `icmp`);
/// enabling `all-parsers` enables all four.