Trait UdpInspector

pub trait UdpInspector:
    Send
    + Sync
    + 'static {
    type Error: Into<Box<dyn Error + Sync + Send>> + Send + 'static;

    // Required method
    fn inspect_packet(
        &self,
        ctx: &Context,
        direction: RelayDirection,
        server_address: SocketAddress,
        payload: &[u8],
    ) -> Result<UdpInspectAction, Self::Error>;
}
Expand description

Inspector of relayed udp packets, handling both north and south traffic.

Required Associated Types§

type Error: Into<Box<dyn Error + Sync + Send>> + Send + 'static

Required Methods§

fn inspect_packet( &self, ctx: &Context, direction: RelayDirection, server_address: SocketAddress, payload: &[u8], ) -> Result<UdpInspectAction, Self::Error>

Inspect a relayed udp packet respond with a UdpInspectAction.

Implementors§

§

impl<F, E> UdpInspector for F
where F: Fn(&Context, RelayDirection, SocketAddress, &[u8]) -> Result<UdpInspectAction, E> + Send + Sync + 'static, E: Into<Box<dyn Error + Sync + Send>> + Send + 'static,

§

type Error = E