virtualx-engine-docs/_sources/classes/class_upnpdevice.rst.txt
2024-10-23 09:41:33 -07:00

322 lines
12 KiB
ReStructuredText

:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.6/modules/upnp/doc_classes/UPNPDevice.xml.
.. _class_UPNPDevice:
UPNPDevice
==========
**Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
Universal Plug and Play (UPnP) device.
.. rst-class:: classref-introduction-group
Description
-----------
Universal Plug and Play (UPnP) device. See :ref:`UPNP<class_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.
.. rst-class:: classref-reftable-group
Properties
----------
.. table::
:widths: auto
+---------------------------------------------+---------------------------------------------------------------------+--------+
| :ref:`String<class_String>` | :ref:`description_url<class_UPNPDevice_property_description_url>` | ``""`` |
+---------------------------------------------+---------------------------------------------------------------------+--------+
| :ref:`String<class_String>` | :ref:`igd_control_url<class_UPNPDevice_property_igd_control_url>` | ``""`` |
+---------------------------------------------+---------------------------------------------------------------------+--------+
| :ref:`String<class_String>` | :ref:`igd_our_addr<class_UPNPDevice_property_igd_our_addr>` | ``""`` |
+---------------------------------------------+---------------------------------------------------------------------+--------+
| :ref:`String<class_String>` | :ref:`igd_service_type<class_UPNPDevice_property_igd_service_type>` | ``""`` |
+---------------------------------------------+---------------------------------------------------------------------+--------+
| :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` | :ref:`igd_status<class_UPNPDevice_property_igd_status>` | ``9`` |
+---------------------------------------------+---------------------------------------------------------------------+--------+
| :ref:`String<class_String>` | :ref:`service_type<class_UPNPDevice_property_service_type>` | ``""`` |
+---------------------------------------------+---------------------------------------------------------------------+--------+
.. rst-class:: classref-reftable-group
Methods
-------
.. table::
:widths: auto
+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`add_port_mapping<class_UPNPDevice_method_add_port_mapping>` **(** :ref:`int<class_int>` port, :ref:`int<class_int>` port_internal=0, :ref:`String<class_String>` desc="", :ref:`String<class_String>` proto="UDP", :ref:`int<class_int>` duration=0 **)** |const| |
+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`delete_port_mapping<class_UPNPDevice_method_delete_port_mapping>` **(** :ref:`int<class_int>` port, :ref:`String<class_String>` proto="UDP" **)** |const| |
+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_valid_gateway<class_UPNPDevice_method_is_valid_gateway>` **(** **)** |const| |
+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`query_external_address<class_UPNPDevice_method_query_external_address>` **(** **)** |const| |
+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_UPNPDevice_IGDStatus:
.. rst-class:: classref-enumeration
enum **IGDStatus**:
.. _class_UPNPDevice_constant_IGD_STATUS_OK:
.. rst-class:: classref-enumeration-constant
:ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_OK** = ``0``
OK.
.. _class_UPNPDevice_constant_IGD_STATUS_HTTP_ERROR:
.. rst-class:: classref-enumeration-constant
:ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_HTTP_ERROR** = ``1``
HTTP error.
.. _class_UPNPDevice_constant_IGD_STATUS_HTTP_EMPTY:
.. rst-class:: classref-enumeration-constant
:ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_HTTP_EMPTY** = ``2``
Empty HTTP response.
.. _class_UPNPDevice_constant_IGD_STATUS_NO_URLS:
.. rst-class:: classref-enumeration-constant
:ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_NO_URLS** = ``3``
Returned response contained no URLs.
.. _class_UPNPDevice_constant_IGD_STATUS_NO_IGD:
.. rst-class:: classref-enumeration-constant
:ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_NO_IGD** = ``4``
Not a valid IGD.
.. _class_UPNPDevice_constant_IGD_STATUS_DISCONNECTED:
.. rst-class:: classref-enumeration-constant
:ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_DISCONNECTED** = ``5``
Disconnected.
.. _class_UPNPDevice_constant_IGD_STATUS_UNKNOWN_DEVICE:
.. rst-class:: classref-enumeration-constant
:ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_UNKNOWN_DEVICE** = ``6``
Unknown device.
.. _class_UPNPDevice_constant_IGD_STATUS_INVALID_CONTROL:
.. rst-class:: classref-enumeration-constant
:ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_INVALID_CONTROL** = ``7``
Invalid control.
.. _class_UPNPDevice_constant_IGD_STATUS_MALLOC_ERROR:
.. rst-class:: classref-enumeration-constant
:ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_MALLOC_ERROR** = ``8``
Memory allocation error.
.. _class_UPNPDevice_constant_IGD_STATUS_UNKNOWN_ERROR:
.. rst-class:: classref-enumeration-constant
:ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_UNKNOWN_ERROR** = ``9``
Unknown error.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_UPNPDevice_property_description_url:
.. rst-class:: classref-property
:ref:`String<class_String>` **description_url** = ``""``
.. rst-class:: classref-property-setget
- void **set_description_url** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_description_url** **(** **)**
URL to the device description.
.. rst-class:: classref-item-separator
----
.. _class_UPNPDevice_property_igd_control_url:
.. rst-class:: classref-property
:ref:`String<class_String>` **igd_control_url** = ``""``
.. rst-class:: classref-property-setget
- void **set_igd_control_url** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_igd_control_url** **(** **)**
IDG control URL.
.. rst-class:: classref-item-separator
----
.. _class_UPNPDevice_property_igd_our_addr:
.. rst-class:: classref-property
:ref:`String<class_String>` **igd_our_addr** = ``""``
.. rst-class:: classref-property-setget
- void **set_igd_our_addr** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_igd_our_addr** **(** **)**
Address of the local machine in the network connecting it to this **UPNPDevice**.
.. rst-class:: classref-item-separator
----
.. _class_UPNPDevice_property_igd_service_type:
.. rst-class:: classref-property
:ref:`String<class_String>` **igd_service_type** = ``""``
.. rst-class:: classref-property-setget
- void **set_igd_service_type** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_igd_service_type** **(** **)**
IGD service type.
.. rst-class:: classref-item-separator
----
.. _class_UPNPDevice_property_igd_status:
.. rst-class:: classref-property
:ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **igd_status** = ``9``
.. rst-class:: classref-property-setget
- void **set_igd_status** **(** :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` value **)**
- :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **get_igd_status** **(** **)**
IGD status. See :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>`.
.. rst-class:: classref-item-separator
----
.. _class_UPNPDevice_property_service_type:
.. rst-class:: classref-property
:ref:`String<class_String>` **service_type** = ``""``
.. rst-class:: classref-property-setget
- void **set_service_type** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_service_type** **(** **)**
Service type.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_UPNPDevice_method_add_port_mapping:
.. rst-class:: classref-method
:ref:`int<class_int>` **add_port_mapping** **(** :ref:`int<class_int>` port, :ref:`int<class_int>` port_internal=0, :ref:`String<class_String>` desc="", :ref:`String<class_String>` proto="UDP", :ref:`int<class_int>` duration=0 **)** |const|
Adds a port mapping to forward the given external port on this **UPNPDevice** for the given protocol to the local machine. See :ref:`UPNP.add_port_mapping<class_UPNP_method_add_port_mapping>`.
.. rst-class:: classref-item-separator
----
.. _class_UPNPDevice_method_delete_port_mapping:
.. rst-class:: classref-method
:ref:`int<class_int>` **delete_port_mapping** **(** :ref:`int<class_int>` port, :ref:`String<class_String>` proto="UDP" **)** |const|
Deletes the port mapping identified by the given port and protocol combination on this device. See :ref:`UPNP.delete_port_mapping<class_UPNP_method_delete_port_mapping>`.
.. rst-class:: classref-item-separator
----
.. _class_UPNPDevice_method_is_valid_gateway:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_valid_gateway** **(** **)** |const|
Returns ``true`` if this is a valid IGD (InternetGatewayDevice) which potentially supports port forwarding.
.. rst-class:: classref-item-separator
----
.. _class_UPNPDevice_method_query_external_address:
.. rst-class:: classref-method
:ref:`String<class_String>` **query_external_address** **(** **)** |const|
Returns the external IP address of this **UPNPDevice** or an empty string.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`