C# Class Open.Nat.NatDevice

Represents a NAT device and provides access to the operation set that allows open (forward) ports, close ports and get the externa (visible) IP address.
Show file Open project: mcatanzariti/Open.NAT Class Usage Examples

Public Methods

Method Description
CreatePortMapAsync ( Open.Nat.Mapping mapping ) : System.Threading.Tasks.Task

Creates the port map asynchronous.

DeletePortMapAsync ( Open.Nat.Mapping mapping ) : System.Threading.Tasks.Task

Deletes a mapped port asynchronous.

GetAllMappingsAsync ( ) : Task>

Gets all mappings asynchronous.

GetExternalIPAsync ( ) : Task

Gets the external (visible) IP address asynchronous. This is the NAT device IP address

GetSpecificMappingAsync ( Protocol protocol, int port ) : Task

Gets the specified mapping asynchronous.

Protected Methods

Method Description
RegisterMapping ( Open.Nat.Mapping mapping ) : void
UnregisterMapping ( Open.Nat.Mapping mapping ) : void

Private Methods

Method Description
ReleaseAll ( ) : void
ReleaseMapping ( IEnumerable mappings ) : void
ReleaseSessionMappings ( ) : void
RenewMapping ( Open.Nat.Mapping mapping ) : System.Threading.Tasks.Task
RenewMappings ( ) : System.Threading.Tasks.Task
Touch ( ) : void

Method Details

CreatePortMapAsync() public abstract method

Creates the port map asynchronous.
MappingException
public abstract CreatePortMapAsync ( Open.Nat.Mapping mapping ) : System.Threading.Tasks.Task
mapping Open.Nat.Mapping The Mapping entry.
return System.Threading.Tasks.Task

DeletePortMapAsync() public abstract method

Deletes a mapped port asynchronous.
MappingException-class
public abstract DeletePortMapAsync ( Open.Nat.Mapping mapping ) : System.Threading.Tasks.Task
mapping Open.Nat.Mapping The Mapping entry.
return System.Threading.Tasks.Task

GetAllMappingsAsync() public abstract method

Gets all mappings asynchronous.
MappingException
public abstract GetAllMappingsAsync ( ) : Task>
return Task>

GetExternalIPAsync() public abstract method

Gets the external (visible) IP address asynchronous. This is the NAT device IP address
MappingException
public abstract GetExternalIPAsync ( ) : Task
return Task

GetSpecificMappingAsync() public abstract method

Gets the specified mapping asynchronous.
public abstract GetSpecificMappingAsync ( Protocol protocol, int port ) : Task
protocol Protocol The protocol.
port int The port.
return Task

RegisterMapping() protected method

protected RegisterMapping ( Open.Nat.Mapping mapping ) : void
mapping Open.Nat.Mapping
return void

UnregisterMapping() protected method

protected UnregisterMapping ( Open.Nat.Mapping mapping ) : void
mapping Open.Nat.Mapping
return void