class_upnpdevice.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/modules/upnp/doc_classes/UPNPDevice.xml.
  6. .. _class_UPNPDevice:
  7. UPNPDevice
  8. ==========
  9. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Universal Plug and Play (UPnP) device.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +---------------------------------------------+---------------------------------------------------------------------+--------+
  21. | :ref:`String<class_String>` | :ref:`description_url<class_UPNPDevice_property_description_url>` | ``""`` |
  22. +---------------------------------------------+---------------------------------------------------------------------+--------+
  23. | :ref:`String<class_String>` | :ref:`igd_control_url<class_UPNPDevice_property_igd_control_url>` | ``""`` |
  24. +---------------------------------------------+---------------------------------------------------------------------+--------+
  25. | :ref:`String<class_String>` | :ref:`igd_our_addr<class_UPNPDevice_property_igd_our_addr>` | ``""`` |
  26. +---------------------------------------------+---------------------------------------------------------------------+--------+
  27. | :ref:`String<class_String>` | :ref:`igd_service_type<class_UPNPDevice_property_igd_service_type>` | ``""`` |
  28. +---------------------------------------------+---------------------------------------------------------------------+--------+
  29. | :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` | :ref:`igd_status<class_UPNPDevice_property_igd_status>` | ``9`` |
  30. +---------------------------------------------+---------------------------------------------------------------------+--------+
  31. | :ref:`String<class_String>` | :ref:`service_type<class_UPNPDevice_property_service_type>` | ``""`` |
  32. +---------------------------------------------+---------------------------------------------------------------------+--------+
  33. .. rst-class:: classref-reftable-group
  34. Methods
  35. -------
  36. .. table::
  37. :widths: auto
  38. +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`int<class_int>` | :ref:`add_port_mapping<class_UPNPDevice_method_add_port_mapping>`\ (\ port\: :ref:`int<class_int>`, port_internal\: :ref:`int<class_int>` = 0, desc\: :ref:`String<class_String>` = "", proto\: :ref:`String<class_String>` = "UDP", duration\: :ref:`int<class_int>` = 0\ ) |const| |
  40. +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`int<class_int>` | :ref:`delete_port_mapping<class_UPNPDevice_method_delete_port_mapping>`\ (\ port\: :ref:`int<class_int>`, proto\: :ref:`String<class_String>` = "UDP"\ ) |const| |
  42. +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`bool<class_bool>` | :ref:`is_valid_gateway<class_UPNPDevice_method_is_valid_gateway>`\ (\ ) |const| |
  44. +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`String<class_String>` | :ref:`query_external_address<class_UPNPDevice_method_query_external_address>`\ (\ ) |const| |
  46. +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. .. rst-class:: classref-section-separator
  48. ----
  49. .. rst-class:: classref-descriptions-group
  50. Enumerations
  51. ------------
  52. .. _enum_UPNPDevice_IGDStatus:
  53. .. rst-class:: classref-enumeration
  54. enum **IGDStatus**: :ref:`🔗<enum_UPNPDevice_IGDStatus>`
  55. .. _class_UPNPDevice_constant_IGD_STATUS_OK:
  56. .. rst-class:: classref-enumeration-constant
  57. :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_OK** = ``0``
  58. OK.
  59. .. _class_UPNPDevice_constant_IGD_STATUS_HTTP_ERROR:
  60. .. rst-class:: classref-enumeration-constant
  61. :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_HTTP_ERROR** = ``1``
  62. HTTP error.
  63. .. _class_UPNPDevice_constant_IGD_STATUS_HTTP_EMPTY:
  64. .. rst-class:: classref-enumeration-constant
  65. :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_HTTP_EMPTY** = ``2``
  66. Empty HTTP response.
  67. .. _class_UPNPDevice_constant_IGD_STATUS_NO_URLS:
  68. .. rst-class:: classref-enumeration-constant
  69. :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_NO_URLS** = ``3``
  70. **Deprecated:** This value is no longer used.
  71. Returned response contained no URLs.
  72. .. _class_UPNPDevice_constant_IGD_STATUS_NO_IGD:
  73. .. rst-class:: classref-enumeration-constant
  74. :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_NO_IGD** = ``4``
  75. Not a valid IGD.
  76. .. _class_UPNPDevice_constant_IGD_STATUS_DISCONNECTED:
  77. .. rst-class:: classref-enumeration-constant
  78. :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_DISCONNECTED** = ``5``
  79. Disconnected.
  80. .. _class_UPNPDevice_constant_IGD_STATUS_UNKNOWN_DEVICE:
  81. .. rst-class:: classref-enumeration-constant
  82. :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_UNKNOWN_DEVICE** = ``6``
  83. Unknown device.
  84. .. _class_UPNPDevice_constant_IGD_STATUS_INVALID_CONTROL:
  85. .. rst-class:: classref-enumeration-constant
  86. :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_INVALID_CONTROL** = ``7``
  87. Invalid control.
  88. .. _class_UPNPDevice_constant_IGD_STATUS_MALLOC_ERROR:
  89. .. rst-class:: classref-enumeration-constant
  90. :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_MALLOC_ERROR** = ``8``
  91. **Deprecated:** This value is no longer used.
  92. Memory allocation error.
  93. .. _class_UPNPDevice_constant_IGD_STATUS_UNKNOWN_ERROR:
  94. .. rst-class:: classref-enumeration-constant
  95. :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **IGD_STATUS_UNKNOWN_ERROR** = ``9``
  96. Unknown error.
  97. .. rst-class:: classref-section-separator
  98. ----
  99. .. rst-class:: classref-descriptions-group
  100. Property Descriptions
  101. ---------------------
  102. .. _class_UPNPDevice_property_description_url:
  103. .. rst-class:: classref-property
  104. :ref:`String<class_String>` **description_url** = ``""`` :ref:`🔗<class_UPNPDevice_property_description_url>`
  105. .. rst-class:: classref-property-setget
  106. - |void| **set_description_url**\ (\ value\: :ref:`String<class_String>`\ )
  107. - :ref:`String<class_String>` **get_description_url**\ (\ )
  108. URL to the device description.
  109. .. rst-class:: classref-item-separator
  110. ----
  111. .. _class_UPNPDevice_property_igd_control_url:
  112. .. rst-class:: classref-property
  113. :ref:`String<class_String>` **igd_control_url** = ``""`` :ref:`🔗<class_UPNPDevice_property_igd_control_url>`
  114. .. rst-class:: classref-property-setget
  115. - |void| **set_igd_control_url**\ (\ value\: :ref:`String<class_String>`\ )
  116. - :ref:`String<class_String>` **get_igd_control_url**\ (\ )
  117. IDG control URL.
  118. .. rst-class:: classref-item-separator
  119. ----
  120. .. _class_UPNPDevice_property_igd_our_addr:
  121. .. rst-class:: classref-property
  122. :ref:`String<class_String>` **igd_our_addr** = ``""`` :ref:`🔗<class_UPNPDevice_property_igd_our_addr>`
  123. .. rst-class:: classref-property-setget
  124. - |void| **set_igd_our_addr**\ (\ value\: :ref:`String<class_String>`\ )
  125. - :ref:`String<class_String>` **get_igd_our_addr**\ (\ )
  126. Address of the local machine in the network connecting it to this **UPNPDevice**.
  127. .. rst-class:: classref-item-separator
  128. ----
  129. .. _class_UPNPDevice_property_igd_service_type:
  130. .. rst-class:: classref-property
  131. :ref:`String<class_String>` **igd_service_type** = ``""`` :ref:`🔗<class_UPNPDevice_property_igd_service_type>`
  132. .. rst-class:: classref-property-setget
  133. - |void| **set_igd_service_type**\ (\ value\: :ref:`String<class_String>`\ )
  134. - :ref:`String<class_String>` **get_igd_service_type**\ (\ )
  135. IGD service type.
  136. .. rst-class:: classref-item-separator
  137. ----
  138. .. _class_UPNPDevice_property_igd_status:
  139. .. rst-class:: classref-property
  140. :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **igd_status** = ``9`` :ref:`🔗<class_UPNPDevice_property_igd_status>`
  141. .. rst-class:: classref-property-setget
  142. - |void| **set_igd_status**\ (\ value\: :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>`\ )
  143. - :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **get_igd_status**\ (\ )
  144. IGD status. See :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>`.
  145. .. rst-class:: classref-item-separator
  146. ----
  147. .. _class_UPNPDevice_property_service_type:
  148. .. rst-class:: classref-property
  149. :ref:`String<class_String>` **service_type** = ``""`` :ref:`🔗<class_UPNPDevice_property_service_type>`
  150. .. rst-class:: classref-property-setget
  151. - |void| **set_service_type**\ (\ value\: :ref:`String<class_String>`\ )
  152. - :ref:`String<class_String>` **get_service_type**\ (\ )
  153. Service type.
  154. .. rst-class:: classref-section-separator
  155. ----
  156. .. rst-class:: classref-descriptions-group
  157. Method Descriptions
  158. -------------------
  159. .. _class_UPNPDevice_method_add_port_mapping:
  160. .. rst-class:: classref-method
  161. :ref:`int<class_int>` **add_port_mapping**\ (\ port\: :ref:`int<class_int>`, port_internal\: :ref:`int<class_int>` = 0, desc\: :ref:`String<class_String>` = "", proto\: :ref:`String<class_String>` = "UDP", duration\: :ref:`int<class_int>` = 0\ ) |const| :ref:`🔗<class_UPNPDevice_method_add_port_mapping>`
  162. 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>`.
  163. .. rst-class:: classref-item-separator
  164. ----
  165. .. _class_UPNPDevice_method_delete_port_mapping:
  166. .. rst-class:: classref-method
  167. :ref:`int<class_int>` **delete_port_mapping**\ (\ port\: :ref:`int<class_int>`, proto\: :ref:`String<class_String>` = "UDP"\ ) |const| :ref:`🔗<class_UPNPDevice_method_delete_port_mapping>`
  168. 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>`.
  169. .. rst-class:: classref-item-separator
  170. ----
  171. .. _class_UPNPDevice_method_is_valid_gateway:
  172. .. rst-class:: classref-method
  173. :ref:`bool<class_bool>` **is_valid_gateway**\ (\ ) |const| :ref:`🔗<class_UPNPDevice_method_is_valid_gateway>`
  174. Returns ``true`` if this is a valid IGD (InternetGatewayDevice) which potentially supports port forwarding.
  175. .. rst-class:: classref-item-separator
  176. ----
  177. .. _class_UPNPDevice_method_query_external_address:
  178. .. rst-class:: classref-method
  179. :ref:`String<class_String>` **query_external_address**\ (\ ) |const| :ref:`🔗<class_UPNPDevice_method_query_external_address>`
  180. Returns the external IP address of this **UPNPDevice** or an empty string.
  181. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  182. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  183. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  184. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  185. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  186. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  187. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  188. .. |void| replace:: :abbr:`void (No return value.)`