[][src]Struct netsim_embed_nat::Ipv4Nat

pub struct Ipv4Nat { /* fields omitted */ }

An Ipv4 NAT.

Implementations

impl Ipv4Nat[src]

pub fn new(
    public_plug: Plug,
    private_plug: Plug,
    public_ip: Ipv4Addr,
    subnet: Ipv4Range
) -> Self
[src]

pub fn set_port_allocator<T: Clone + PortAllocator + 'static>(
    &mut self,
    port_allocator: T
)
[src]

Set the port allocator.

pub fn set_hair_pinning(&mut self, hair_pinning: bool)[src]

Enable/disable hair-pinning.

pub fn forward_port(
    &mut self,
    port: u16,
    local_addr: SocketAddrV4,
    protocol: Protocol
)
[src]

Manually forward a port.

pub fn set_blacklist_unrecognized_addrs(
    &mut self,
    blacklist_unrecognized_addrs: bool
)
[src]

Causes the NAT to permanently block all traffic from an address A if it recieves traffic from A directed at an endpoint for which it doesn't have a mapping.

pub fn set_restrict_endpoints(&mut self, restrict_endpoints: bool)[src]

Only allow incoming traffic on a port from remote addresses that we have already sent data to from that port. Makes this a port-restricted NAT.

pub fn set_symmetric(&mut self, symmetric: bool)[src]

Makes this NAT a symmetric NAT, meaning packets sent to different remote addresses from the same internal address will appear to originate from different external ports.

Trait Implementations

impl Debug for Ipv4Nat[src]

impl Future for Ipv4Nat[src]

type Output = ()

The type of value produced on completion.

Auto Trait Implementations

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> FutureExt for T where
    T: Future + ?Sized

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

impl<F> IntoFuture for F where
    F: Future
[src]

type Output = <F as Future>::Output

🔬 This is a nightly-only experimental API. (into_future)

The output that the future will produce on completion.

type Future = F

🔬 This is a nightly-only experimental API. (into_future)

Which kind of future are we turning this into?

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>,