Function netsim_embed_machine::machine[][src]

pub fn machine<F>(
    addr: Ipv4Addr,
    mask: u8,
    plug: Plug,
    task: F
) -> JoinHandle<F::Output> where
    F: Future + Send + 'static,
    F::Output: Send + 'static, 

Spawns a thread in a new network namespace and configures a TUN interface that sends and receives IP packets from the tx/rx channels and runs some UDP/TCP networking code in task.