pub trait CaptureSource {
type IO: AsyncRead + AsyncWrite + Unpin + Send + 'static;
// Required method
fn accept(
&mut self,
) -> Pin<Box<dyn Future<Output = Result<IncomingConnection<Self::IO>>> + Send + '_>>;
// Provided method
fn listen_addrs(&self) -> Vec<SocketAddr> { ... }
}Expand description
Trait for capturing traffic. This abstracts away the difference between a simple TCP Listener, a Transparent Proxy (TPROXY), or a TUN interface with a user-space stack.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn listen_addrs(&self) -> Vec<SocketAddr>
fn listen_addrs(&self) -> Vec<SocketAddr>
Returns the addresses this source is listening on (for loop detection)