Table of Contents

Class UPNPDevice

Universal Plug and Play (UPnP) device.

Inheritance
UPNPDevice

Remarks

Universal Plug and Play (UPnP) device. See UPNP for UPnP discovery and utility functions. Provides low-level access to UPNP control commands. Allows to manage port mappings (port forwarding) and to query network information of the device (like local and external IP address and status). Note that methods on this class are synchronous and block the calling thread.

Properties

description_url

URL to the device description.

var description_url : String = ""

Property Value

String

Remarks

  • void set_description_url(String value)
  • String get_description_url

igd_control_url

IDG control URL.

var igd_control_url : String = ""

Property Value

String

Remarks

  • void set_igd_control_url(String value)
  • String get_igd_control_url

igd_our_addr

Address of the local machine in the network connecting it to this UPNPDevice.

var igd_our_addr : String = ""

Property Value

String

Remarks

  • void set_igd_our_addr(String value)
  • String get_igd_our_addr

igd_service_type

IGD service type.

var igd_service_type : String = ""

Property Value

String

Remarks

  • void set_igd_service_type(String value)
  • String get_igd_service_type

igd_status

IGD status. See IGDStatus.

var igd_status : int = 9

Property Value

int

Remarks

  • void set_igd_status(int value)
  • int get_igd_status

service_type

Service type.

var service_type : String = ""

Property Value

String

Remarks

  • void set_service_type(String value)
  • String get_service_type

Methods

add_port_mapping(int, int, String, String, int)

Qualifiers: const

Adds a port mapping to forward the given external port on this UPNPDevice for the given protocol to the local machine. See UPNP.add_port_mapping.

int add_port_mapping(int port, int port_internal, String desc, String proto, int duration)

Parameters

port int
port_internal int
desc String
proto String
duration int

delete_port_mapping(int, String)

Qualifiers: const

Deletes the port mapping identified by the given port and protocol combination on this device. See UPNP.delete_port_mapping.

int delete_port_mapping(int port, String proto)

Parameters

port int
proto String

is_valid_gateway

Qualifiers: const

Returns true if this is a valid IGD (InternetGatewayDevice) which potentially supports port forwarding.

bool is_valid_gateway

query_external_address

Qualifiers: const

Returns the external IP address of this UPNPDevice or an empty string.

String query_external_address