PortMapping class

A single NAT port mapping entry.

Section references are to WANIPConnection:1, whose state variables these fields mirror.

The numeric fields are nullable because a device that reports a non-numeric value must not be read as one: 0 already means "wildcard" for externalPort, so falling back to it would invent a different mapping.

Constructors

PortMapping({required String remoteHost, required int? externalPort, required PortMappingProtocol? protocol, required int? internalPort, required String internalClient, required bool enabled, required String description, required Duration? leaseDuration})
const
PortMapping.fromArgs(Map<String, String> args, {String? remoteHost, int? externalPort, PortMappingProtocol? protocol})
Builds an entry from an action response.
factory

Properties

description String
The gateway's free-text label for the mapping (§2.2.20).
final
enabled bool
Whether the mapping is currently active (§2.2.13).
final
externalPort int?
The WAN-side port. 0 is the wildcard, on gateways that support it (§2.2.16).
final
hashCode int
The hash code for this object.
no setterinherited
internalClient String
The LAN-side host traffic is forwarded to (§2.2.19).
final
internalPort int?
The LAN-side port traffic is forwarded to. Between 1 and 65535 (§2.2.17).
final
leaseDuration Duration?
Time remaining on the mapping. Duration.zero means permanent (§2.2.14).
final
protocol PortMappingProtocol?
Null if the gateway reported a protocol other than TCP or UDP.
final
remoteHost String
The WAN-side host this mapping accepts traffic from. Empty is the wildcard, meaning any host (§2.2.15).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

describeFields() Map<String, dynamic>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited