2
0

class_upnpdevice.rst 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the UPNPDevice.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_UPNPDevice:
  5. UPNPDevice
  6. ==========
  7. **Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. UPNP device.
  12. Properties
  13. ----------
  14. +---------------------------------------------+------------------------------------------------------------+
  15. | :ref:`String<class_String>` | :ref:`description_url<class_UPNPDevice_description_url>` |
  16. +---------------------------------------------+------------------------------------------------------------+
  17. | :ref:`String<class_String>` | :ref:`igd_control_url<class_UPNPDevice_igd_control_url>` |
  18. +---------------------------------------------+------------------------------------------------------------+
  19. | :ref:`String<class_String>` | :ref:`igd_our_addr<class_UPNPDevice_igd_our_addr>` |
  20. +---------------------------------------------+------------------------------------------------------------+
  21. | :ref:`String<class_String>` | :ref:`igd_service_type<class_UPNPDevice_igd_service_type>` |
  22. +---------------------------------------------+------------------------------------------------------------+
  23. | :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` | :ref:`igd_status<class_UPNPDevice_igd_status>` |
  24. +---------------------------------------------+------------------------------------------------------------+
  25. | :ref:`String<class_String>` | :ref:`service_type<class_UPNPDevice_service_type>` |
  26. +---------------------------------------------+------------------------------------------------------------+
  27. Methods
  28. -------
  29. +------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`int<class_int>` | :ref:`add_port_mapping<class_UPNPDevice_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 |
  31. +------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`int<class_int>` | :ref:`delete_port_mapping<class_UPNPDevice_delete_port_mapping>` **(** :ref:`int<class_int>` port, :ref:`String<class_String>` proto="UDP" **)** const |
  33. +------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`bool<class_bool>` | :ref:`is_valid_gateway<class_UPNPDevice_is_valid_gateway>` **(** **)** const |
  35. +------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`String<class_String>` | :ref:`query_external_address<class_UPNPDevice_query_external_address>` **(** **)** const |
  37. +------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. Enumerations
  39. ------------
  40. .. _enum_UPNPDevice_IGDStatus:
  41. enum **IGDStatus**:
  42. - **IGD_STATUS_OK** = **0** --- OK.
  43. - **IGD_STATUS_HTTP_ERROR** = **1** --- HTTP error.
  44. - **IGD_STATUS_HTTP_EMPTY** = **2** --- Empty HTTP response.
  45. - **IGD_STATUS_NO_URLS** = **3** --- Returned response contained no URLs.
  46. - **IGD_STATUS_NO_IGD** = **4** --- Not a valid IGD.
  47. - **IGD_STATUS_DISCONNECTED** = **5** --- Disconnected.
  48. - **IGD_STATUS_UNKNOWN_DEVICE** = **6** --- Unknown device.
  49. - **IGD_STATUS_INVALID_CONTROL** = **7** --- Invalid control.
  50. - **IGD_STATUS_MALLOC_ERROR** = **8** --- Memory allocation error.
  51. - **IGD_STATUS_UNKNOWN_ERROR** = **9** --- Unknown error.
  52. Description
  53. -----------
  54. 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.
  55. Property Descriptions
  56. ---------------------
  57. .. _class_UPNPDevice_description_url:
  58. - :ref:`String<class_String>` **description_url**
  59. +----------+----------------------------+
  60. | *Setter* | set_description_url(value) |
  61. +----------+----------------------------+
  62. | *Getter* | get_description_url() |
  63. +----------+----------------------------+
  64. URL to the device description.
  65. .. _class_UPNPDevice_igd_control_url:
  66. - :ref:`String<class_String>` **igd_control_url**
  67. +----------+----------------------------+
  68. | *Setter* | set_igd_control_url(value) |
  69. +----------+----------------------------+
  70. | *Getter* | get_igd_control_url() |
  71. +----------+----------------------------+
  72. IDG control URL.
  73. .. _class_UPNPDevice_igd_our_addr:
  74. - :ref:`String<class_String>` **igd_our_addr**
  75. +----------+-------------------------+
  76. | *Setter* | set_igd_our_addr(value) |
  77. +----------+-------------------------+
  78. | *Getter* | get_igd_our_addr() |
  79. +----------+-------------------------+
  80. Address of the local machine in the network connecting it to this :ref:`UPNPDevice<class_UPNPDevice>`.
  81. .. _class_UPNPDevice_igd_service_type:
  82. - :ref:`String<class_String>` **igd_service_type**
  83. +----------+-----------------------------+
  84. | *Setter* | set_igd_service_type(value) |
  85. +----------+-----------------------------+
  86. | *Getter* | get_igd_service_type() |
  87. +----------+-----------------------------+
  88. IGD service type.
  89. .. _class_UPNPDevice_igd_status:
  90. - :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **igd_status**
  91. +----------+-----------------------+
  92. | *Setter* | set_igd_status(value) |
  93. +----------+-----------------------+
  94. | *Getter* | get_igd_status() |
  95. +----------+-----------------------+
  96. IGD status. See :ref:`IGDStatus<enum_@GlobalScope_IGDStatus>`.
  97. .. _class_UPNPDevice_service_type:
  98. - :ref:`String<class_String>` **service_type**
  99. +----------+-------------------------+
  100. | *Setter* | set_service_type(value) |
  101. +----------+-------------------------+
  102. | *Getter* | get_service_type() |
  103. +----------+-------------------------+
  104. Service type.
  105. Method Descriptions
  106. -------------------
  107. .. _class_UPNPDevice_add_port_mapping:
  108. - :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
  109. Adds a port mapping to forward the given external port on this :ref:`UPNPDevice<class_UPNPDevice>` for the given protocol to the local machine. See :ref:`UPNP.add_port_mapping<class_UPNP_add_port_mapping>`.
  110. .. _class_UPNPDevice_delete_port_mapping:
  111. - :ref:`int<class_int>` **delete_port_mapping** **(** :ref:`int<class_int>` port, :ref:`String<class_String>` proto="UDP" **)** const
  112. Deletes the port mapping identified by the given port and protocol combination on this device. See :ref:`UPNP.delete_port_mapping<class_UPNP_delete_port_mapping>`.
  113. .. _class_UPNPDevice_is_valid_gateway:
  114. - :ref:`bool<class_bool>` **is_valid_gateway** **(** **)** const
  115. Returns ``true`` if this is a valid IGD (InternetGatewayDevice) which potentially supports port forwarding.
  116. .. _class_UPNPDevice_query_external_address:
  117. - :ref:`String<class_String>` **query_external_address** **(** **)** const
  118. Returns the external IP address of this :ref:`UPNPDevice<class_UPNPDevice>` or an empty string.