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
// 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
//! Extensions for MAC address conversions between pnet and the core domain model.
use crateMacAddr as CoreMacAddr;
use MacAddr as PnetMacAddr;
/// An extension trait to seamlessly convert from `pnet_base::MacAddr` to the
/// native `crate::model::mac::MacAddr`.
/// The reverse: a model address as the packet builders want one.
///
/// Needed because the two vocabularies meet in both directions now. 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 for the same reason [`IntoCoreMac`] is one: neither
/// type is this crate's to add inherent conversions to.