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
//! Passive asset inventory (issue #28).
//!
//! `AssetWatch` wraps flowscope's MAC-keyed [`Inventory`](flowscope::Inventory)
//! and the registered `on_asset` handlers. The Monitor's L2/L3 discovery hooks
//! ([`on_arp`](crate::monitor::MonitorBuilder::on_arp) /
//! [`on_ndp`](crate::monitor::MonitorBuilder::on_ndp) /
//! [`on_lldp`](crate::monitor::MonitorBuilder::on_lldp) /
//! [`on_cdp`](crate::monitor::MonitorBuilder::on_cdp)) feed it: each parsed
//! frame is folded into an [`Asset`](flowscope::Asset) keyed by MAC.
//!
//! `on_asset` is an **inventory-event** stream, not a per-packet one — a
//! handler fires only when an observation creates a *new* asset or *changes* an
//! existing one (a freshly-learned IP, hostname, platform, …), staying quiet on
//! repeat-identical frames.
//!
//! v1 feeds from the MAC-carrying frame protocols only. DHCP (richest single
//! source) and the UDP datagram sources (SSDP / NetBIOS-NS / mDNS) are drained
//! on the L7 path and need IP→MAC resolution — a follow-up.
use crateCtx;
use crateResult;
use Timestamp;
/// Default LRU capacity when [`asset_inventory`](crate::monitor::MonitorBuilder::asset_inventory)
/// isn't given an explicit one (or `on_asset` enables the inventory implicitly).
pub const DEFAULT_ASSET_CAPACITY: usize = 4096;
/// Boxed `on_asset` handler: the merged [`flowscope::Asset`] + `&mut Ctx`.
pub type AssetHandler = ;
/// The Monitor's live asset inventory + `on_asset` handlers.
pub