Struct igd::Gateway [] [src]

pub struct Gateway {
    pub addr: SocketAddrV4,
    pub control_url: String,
}

This structure represents a gateway found by the search functions.

Fields

addr: SocketAddrV4

Socket address of the gateway

control_url: String

Control url of the device

Methods

impl Gateway
[src]

fn get_external_ip(&self) -> Result<Ipv4AddrRequestError>

Get the external IP address of the gateway.

fn add_port(&self, protocol: PortMappingProtocol, external_port: u16, local_addr: SocketAddrV4, lease_duration: u32, description: &str) -> Result<()RequestError>

Add a port mapping.

The local_addr is the address where the traffic is sent to. The lease_duration parameter is in seconds. A value of 0 is infinite.

fn remove_port(&self, protocol: PortMappingProtocol, external_port: u16) -> Result<()RequestError>

Remove a port mapping.

Trait Implementations

impl Debug for Gateway
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Display for Gateway
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.