Struct netsim_embed_machine::iface::Iface[][src]

pub struct Iface { /* fields omitted */ }

See: https://www.kernel.org/doc/Documentation/networking/tuntap.txt

Implementations

impl Iface[src]

pub fn new() -> Result<Self, Error>[src]

Creates a new virtual network interface.

pub fn name(&self) -> &CStr[src]

Returns the name of the iface.

pub fn recv(&self, buf: &mut [u8]) -> Result<usize, Error>[src]

Receives a packet.

pub fn send(&self, buf: &[u8]) -> Result<usize, Error>[src]

Sends a packet.

pub fn set_ipv4_addr(
    &self,
    ipv4_addr: Ipv4Addr,
    netmask_bits: u8
) -> Result<(), Error>
[src]

Set an interface IPv4 address and netmask

pub fn put_up(&self) -> Result<(), Error>[src]

Put an interface up.

pub fn add_ipv4_route(&self, route: Ipv4Route) -> Result<(), Error>[src]

Adds an ipv4 route.

Trait Implementations

impl AsRawFd for Iface[src]

impl Drop for Iface[src]

impl Read for Iface[src]

impl Write for Iface[src]

Auto Trait Implementations

impl RefUnwindSafe for Iface

impl Send for Iface

impl Sync for Iface

impl Unpin for Iface

impl UnwindSafe for Iface

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,