UPNP.addPortMapping

Adds a mapping to forward the external port (between 1 and 65535) on the default gateway (see getGateway) to the internal_port on the local machine for the given protocol proto (either TCP or UDP, with UDP being the default). If a port mapping for the given port and protocol combination already exists on that gateway device, this method tries to overwrite it. If that is not desired, you can retrieve the gateway manually with getGateway and call addPortMapping on it, if any. If internal_port is 0 (the default), the same port number is used for both the external and the internal port (the port value). The description (desc) is shown in some router UIs and can be used to point out which application added the mapping. The mapping's lease duration can be limited by specifying a duration (in seconds). However, some routers are incompatible with one or both of these, so use with caution and add fallback logic in case of errors to retry without them if in doubt. See upnpresult for possible return values.

struct UPNP
@nogc nothrow const
long
addPortMapping
(
in long port
,
in long port_internal = 0
,
in String desc = gs!""
,
in String proto = gs!"UDP"
,
in long duration = 0
)

Meta