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

Get the external IP address of the gateway.

fn add_any_port(&self, protocol: PortMappingProtocol, local_addr: SocketAddrV4, lease_duration: u32, description: &str) -> Result<u16AddAnyPortError>

Add a port mapping.with any external port.

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.

Returns

The external port that was mapped on success. Otherwise an error.

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

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<()RemovePortError>

Remove a port mapping.

Trait Implementations

impl Hash for Gateway
[src]

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.

impl Eq for Gateway
[src]

impl PartialEq for Gateway
[src]

fn eq(&self, __arg_0: &Gateway) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Gateway) -> bool

This method tests for !=.

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.