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
// 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
//! # Between the model's hardware address and `pnet`'s
//!
//! Every frame this crate builds or reads goes through `pnet::packet`, which
//! has a `MacAddr` of its own. Nothing public names that type: the builders
//! and readers take and return [`MacAddr`](crate::model::mac::MacAddr), and
//! convert here, at the call into the packet library.
use crateMacAddr as CoreMacAddr;
use MacAddr as PnetMacAddr;
/// From `pnet`'s address to the model's, for one read off a frame.
pub
/// The reverse: a model address as the packet builders want one.
///
/// Needed because the two vocabularies meet in both directions. An address
/// read off an interface arrives as the model's, and every frame this crate
/// emits is built by `pnet::packet`, which wants its own. Written as a trait
/// rather than a `From` impl, as [`IntoCoreMac`] is, because an impl of a
/// public trait is public wherever it sits, and a `From` between the two
/// addresses would put the packet library's back in the public API.
pub