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
// Copyright (c) 2026 Erik Lening (hollowpointer) and Contributors
//
// This file is part of Zond Engine, licensed under the GNU Affero General
// Public License, version 3 or later. See the LICENSE file for details, or
// <https://www.gnu.org/licenses/agpl-3.0.html>.
//
// SPDX-License-Identifier: AGPL-3.0-or-later
//! # The network hardware this machine has
//!
//! What the host is plugged into, and how a target is reached through it. Four
//! questions, and every one of them has to be answered before a packet can be
//! built:
//!
//! - **What links are there**, and which could carry a probe at all.
//! [`Link`] and [`interfaces`].
//! - **Which link is "the network"** a person means by `lan`. [`lan_link`].
//! - **How is a target reached**: on a segment this machine is attached to,
//! behind a gateway, or by neither. [`map_ips_to_interfaces`].
//! - **What address does a probe leave from**, which for a raw socket the
//! kernel will not compute. [`SourceResolver`].
//!
//! The last two are where the module's judgement lives, and both refuse more
//! carefully than they answer: a bare IPv6 link-local matches every interface
//! and is reported as the unanswerable question it is, and an off-link range too
//! large to walk is refused rather than half-scanned.
//!
//! The facade is the whole of it. Every name below is re-exported here and
//! the modules holding them are private, so each has exactly one public path.
//! Naming both would commit the crate to two spellings of every item and to the
//! file layout underneath, and the layout is where this module still moves: how
//! a source address is chosen is an implementation detail that has changed twice
//! and will again, while `SourceResolver` is the answer either way.
pub use ;
// Not published: the seam `lan_link` reads the machine through, so a caller that
// already holds an interface table can ask `lan` of that table instead. See
// `resolve::for_listening_on`.
pub use lan_link_with;
pub use ;
pub use ;
pub use ;
// Not published: the forced-source override a scan pinned to an interface needs,
// which only the scanner passes. See `DiscoveryPlan::build`.
pub use map_ips_to_interfaces_forced;
pub use SourceResolver;