Skip to main content

DecoyProvider

Trait DecoyProvider 

Source
pub trait DecoyProvider: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn start<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn feed_input<'life0, 'async_trait>(
        &'life0 self,
        packet: DynamicByteBuffer,
        tailer_buf: DynamicByteBuffer,
    ) -> Pin<Box<dyn Future<Output = Option<DynamicByteBuffer>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn feed_output<'life0, 'async_trait>(
        &'life0 self,
        body: DynamicByteBuffer,
        tailer_buf: DynamicByteBuffer,
    ) -> Pin<Box<dyn Future<Output = Option<DynamicByteBuffer>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Object-safe runtime interface for decoy traffic. Used as Arc<dyn DecoyProvider> in flow managers — no external lock wraps it, so implementations must manage their own mutable state via interior mutability (e.g. Arc<RwLock<_>>, as every built-in provider does). All async methods are boxed automatically by async_trait.

Required Methods§

Source

fn name(&self) -> &'static str

Short display name of this provider (e.g. “SparseDecoyProvider”).

Source

fn start<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Start the background decoy generation timer.

Source

fn feed_input<'life0, 'async_trait>( &'life0 self, packet: DynamicByteBuffer, tailer_buf: DynamicByteBuffer, ) -> Pin<Box<dyn Future<Output = Option<DynamicByteBuffer>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Process an incoming packet, updating internal rate tracking. tailer_buf is the deobfuscated tailer for the packet (flags, packet number, etc.).

Source

fn feed_output<'life0, 'async_trait>( &'life0 self, body: DynamicByteBuffer, tailer_buf: DynamicByteBuffer, ) -> Pin<Box<dyn Future<Output = Option<DynamicByteBuffer>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Process an outgoing packet body and its plaintext tailer, updating internal rate tracking. Returns the (possibly modified) body, or None to suppress the packet entirely.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl DecoyProvider for SimpleDecoyProvider

Source§

impl<T: IdentityType + Clone + 'static, AE: AsyncExecutor + 'static> DecoyProvider for HeavyDecoyProvider<T, AE>

Source§

impl<T: IdentityType + Clone + 'static, AE: AsyncExecutor + 'static> DecoyProvider for NoisyDecoyProvider<T, AE>

Source§

impl<T: IdentityType + Clone + 'static, AE: AsyncExecutor + 'static> DecoyProvider for SmoothDecoyProvider<T, AE>

Source§

impl<T: IdentityType + Clone + 'static, AE: AsyncExecutor + 'static> DecoyProvider for SparseDecoyProvider<T, AE>