pub struct IcmpRelay { /* private fields */ }Expand description
Relays ICMP echo requests from the guest to the real network via unprivileged ICMP sockets.
Each echo request spawns a fire-and-forget tokio task. No session table is needed — ping traffic is low-volume and each probe is independent.
Implementations§
Source§impl IcmpRelay
impl IcmpRelay
Sourcepub fn new(
shared: Arc<SharedState>,
gateway_mac: [u8; 6],
guest_mac: [u8; 6],
tokio_handle: Handle,
) -> Self
pub fn new( shared: Arc<SharedState>, gateway_mac: [u8; 6], guest_mac: [u8; 6], tokio_handle: Handle, ) -> Self
Create a new ICMP relay, probing for unprivileged socket support.
Sourcepub fn relay_outbound_if_echo(
&self,
frame: &[u8],
config: &PollLoopConfig,
policy: &NetworkPolicy,
) -> bool
pub fn relay_outbound_if_echo( &self, frame: &[u8], config: &PollLoopConfig, policy: &NetworkPolicy, ) -> bool
Try to intercept an outbound frame as an ICMP echo request.
Returns true if the frame was consumed (caller should
drop_staged_frame()). Returns false if the frame is not an
ICMP echo request or the backend is unavailable — caller should
fall through to classify_frame.
Auto Trait Implementations§
impl Freeze for IcmpRelay
impl RefUnwindSafe for IcmpRelay
impl Send for IcmpRelay
impl Sync for IcmpRelay
impl Unpin for IcmpRelay
impl UnsafeUnpin for IcmpRelay
impl UnwindSafe for IcmpRelay
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more