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

Socket address of the gateway

Control url of the device

Methods

impl Gateway
[src]

Get the external IP address of the gateway.

Get an external socket address with our external ip and any port. This is a convenience function that calls get_external_ip followed by add_any_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 address that was mapped on success. Otherwise an error.

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.

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.

Remove a port mapping.

Trait Implementations

impl Clone for Gateway
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Gateway
[src]

Formats the value using the given formatter.

impl PartialEq for Gateway
[src]

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

This method tests for !=.

impl Eq for Gateway
[src]

impl Hash for Gateway
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Display for Gateway
[src]

Formats the value using the given formatter. Read more