From 196d9492dac1ee0621fb7f981b408ebbaf431561 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sat, 11 Jul 2026 20:14:37 +0000 Subject: [PATCH] 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. --- src/transport/ethernet/{socket.rs => io.rs} | 8 ++++---- src/transport/ethernet/{socket_linux.rs => io_linux.rs} | 0 src/transport/ethernet/{socket_macos.rs => io_macos.rs} | 4 ++-- src/transport/ethernet/mod.rs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) rename src/transport/ethernet/{socket.rs => io.rs} (98%) rename src/transport/ethernet/{socket_linux.rs => io_linux.rs} (100%) rename src/transport/ethernet/{socket_macos.rs => io_macos.rs} (99%) diff --git a/src/transport/ethernet/socket.rs b/src/transport/ethernet/io.rs similarity index 98% rename from src/transport/ethernet/socket.rs rename to src/transport/ethernet/io.rs index 622d7f6..392a3b8 100644 --- a/src/transport/ethernet/socket.rs +++ b/src/transport/ethernet/io.rs @@ -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)] diff --git a/src/transport/ethernet/socket_linux.rs b/src/transport/ethernet/io_linux.rs similarity index 100% rename from src/transport/ethernet/socket_linux.rs rename to src/transport/ethernet/io_linux.rs diff --git a/src/transport/ethernet/socket_macos.rs b/src/transport/ethernet/io_macos.rs similarity index 99% rename from src/transport/ethernet/socket_macos.rs rename to src/transport/ethernet/io_macos.rs index 2ddb187..3c8cab1 100644 --- a/src/transport/ethernet/socket_macos.rs +++ b/src/transport/ethernet/io_macos.rs @@ -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- diff --git a/src/transport/ethernet/mod.rs b/src/transport/ethernet/mod.rs index 60b0dbf..1856669 100644 --- a/src/transport/ethernet/mod.rs +++ b/src/transport/ethernet/mod.rs @@ -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;