UPNPDevice

Hereda: RefCounted < Object

Dispositivo Universal Plug and Play (UPnP).

Descripción

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.

Propiedades

String

description_url

""

String

igd_control_url

""

String

igd_our_addr

""

String

igd_service_type

""

IGDStatus

igd_status

9

String

service_type

""

Métodos

int

add_port_mapping(port: int, port_internal: int = 0, desc: String = "", proto: String = "UDP", duration: int = 0) const

int

delete_port_mapping(port: int, proto: String = "UDP") const

bool

is_valid_gateway() const

String

query_external_address() const


Enumeraciones

enum IGDStatus: 🔗

IGDStatus IGD_STATUS_OK = 0

OK.

IGDStatus IGD_STATUS_HTTP_ERROR = 1

Error HTTP.

IGDStatus IGD_STATUS_HTTP_EMPTY = 2

Respuesta HTTP vacía.

IGDStatus IGD_STATUS_NO_URLS = 3

Obsoleto: This value is no longer used.

La respuesta devuelta no contenía ningún URL.

IGDStatus IGD_STATUS_NO_IGD = 4

No es un IGD válido.

IGDStatus IGD_STATUS_DISCONNECTED = 5

Desconectado.

IGDStatus IGD_STATUS_UNKNOWN_DEVICE = 6

Dispositivo desconocido.

IGDStatus IGD_STATUS_INVALID_CONTROL = 7

Control inválido.

IGDStatus IGD_STATUS_MALLOC_ERROR = 8

Obsoleto: This value is no longer used.

Error de asignación de memoria.

IGDStatus IGD_STATUS_UNKNOWN_ERROR = 9

Error desconocido.


Descripciones de Propiedades

String description_url = "" 🔗

  • void set_description_url(value: String)

  • String get_description_url()

URL de la descripción del dispositivo.


String igd_control_url = "" 🔗

  • void set_igd_control_url(value: String)

  • String get_igd_control_url()

URL de control de IDG.


String igd_our_addr = "" 🔗

  • void set_igd_our_addr(value: String)

  • String get_igd_our_addr()

Dirección de la máquina local en la red que la conecta a este UPNPDevice.


String igd_service_type = "" 🔗

  • void set_igd_service_type(value: String)

  • String get_igd_service_type()

Tipo de servicio IGD.


IGDStatus igd_status = 9 🔗

Estado del IGD.


String service_type = "" 🔗

  • void set_service_type(value: String)

  • String get_service_type()

Tipo de servicio.


Descripciones de Métodos

int add_port_mapping(port: int, port_internal: int = 0, desc: String = "", proto: String = "UDP", duration: int = 0) const 🔗

Añade un mapeo de puertos para reenviar el puerto externo dado en este UPNPDevice para el protocolo dado a la máquina local. Véase UPNP.add_port_mapping().


int delete_port_mapping(port: int, proto: String = "UDP") const 🔗

Borra el mapeo de puertos identificado por la combinación de puerto y protocolo dada en este dispositivo. Véase UPNP.delete_port_mapping().


bool is_valid_gateway() const 🔗

Devuelve true si se trata de un IGD (InternetGatewayDevice) válido que potencialmente soporta el reenvío de puertos.


String query_external_address() const 🔗

Devuelve la dirección IP externa de este UPNPDevice o una string vacía.