transport: rename ethernet byte-layer module from socket to io

Normalizes the ethernet transport onto the canonical byte-layer name
(io.rs), including the per-OS files io_linux.rs/io_macos.rs and their
#[path] wiring. Pure file rename plus module-path and doc-comment
updates; no logic, wire, config, metric, or log change.
This commit is contained in:
Johnathan Corgan
2026-07-11 20:14:37 +00:00
parent 0f2e91b479
commit 196d9492da
4 changed files with 8 additions and 8 deletions
@@ -1,7 +1,7 @@
//! Raw Ethernet socket abstraction.
//!
//! Platform-specific implementations live in `socket_linux.rs` (AF_PACKET)
//! and `socket_macos.rs` (BPF). This module re-exports `PacketSocket` and
//! Platform-specific implementations live in `io_linux.rs` (AF_PACKET)
//! and `io_macos.rs` (BPF). This module re-exports `PacketSocket` and
//! provides `AsyncPacketSocket`.
use crate::transport::TransportError;
@@ -11,11 +11,11 @@ pub const ETHERNET_BROADCAST: [u8; 6] = [0xff; 6];
// Platform-specific PacketSocket implementation.
#[cfg(target_os = "linux")]
#[path = "socket_linux.rs"]
#[path = "io_linux.rs"]
mod platform;
#[cfg(target_os = "macos")]
#[path = "socket_macos.rs"]
#[path = "io_macos.rs"]
mod platform;
#[cfg(unix)]
@@ -555,8 +555,8 @@ fn get_mac_addr(interface: &str) -> Result<[u8; 6], TransportError> {
// ============================================================================
// Unit tests
//
// The whole `socket_macos.rs` file is `#[cfg(target_os = "macos")]`-included
// by `socket.rs`, so this `#[cfg(test)]` mod naturally only compiles on macOS.
// The whole `io_macos.rs` file is `#[cfg(target_os = "macos")]`-included
// by `io.rs`, so this `#[cfg(test)]` mod naturally only compiles on macOS.
// The redundant `#[cfg(target_os = "macos")]` below is belt-and-suspenders:
// it makes the macOS-only intent explicit so that any future refactor that
// includes this file on additional targets won't silently activate macOS-
+2 -2
View File
@@ -6,7 +6,7 @@
//! 802.11 transparently on Linux).
pub mod discovery;
pub mod socket;
pub mod io;
pub mod stats;
use super::{
@@ -15,7 +15,7 @@ use super::{
};
use crate::config::EthernetConfig;
use discovery::{DiscoveryBuffer, FRAME_TYPE_BEACON, FRAME_TYPE_DATA, build_beacon, parse_beacon};
use socket::{AsyncPacketSocket, ETHERNET_BROADCAST, PacketSocket};
use io::{AsyncPacketSocket, ETHERNET_BROADCAST, PacketSocket};
use stats::EthernetStats;
use secp256k1::XOnlyPublicKey;