UPNPDevice.xml 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="UPNPDevice" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
  3. <brief_description>
  4. Universal Plug and Play (UPnP) device.
  5. </brief_description>
  6. <description>
  7. 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.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="add_port_mapping" qualifiers="const">
  13. <return type="int" />
  14. <param index="0" name="port" type="int" />
  15. <param index="1" name="port_internal" type="int" default="0" />
  16. <param index="2" name="desc" type="String" default="&quot;&quot;" />
  17. <param index="3" name="proto" type="String" default="&quot;UDP&quot;" />
  18. <param index="4" name="duration" type="int" default="0" />
  19. <description>
  20. Adds a port mapping to forward the given external port on this [UPNPDevice] for the given protocol to the local machine. See [method UPNP.add_port_mapping].
  21. </description>
  22. </method>
  23. <method name="delete_port_mapping" qualifiers="const">
  24. <return type="int" />
  25. <param index="0" name="port" type="int" />
  26. <param index="1" name="proto" type="String" default="&quot;UDP&quot;" />
  27. <description>
  28. Deletes the port mapping identified by the given port and protocol combination on this device. See [method UPNP.delete_port_mapping].
  29. </description>
  30. </method>
  31. <method name="is_valid_gateway" qualifiers="const">
  32. <return type="bool" />
  33. <description>
  34. Returns [code]true[/code] if this is a valid IGD (InternetGatewayDevice) which potentially supports port forwarding.
  35. </description>
  36. </method>
  37. <method name="query_external_address" qualifiers="const">
  38. <return type="String" />
  39. <description>
  40. Returns the external IP address of this [UPNPDevice] or an empty string.
  41. </description>
  42. </method>
  43. </methods>
  44. <members>
  45. <member name="description_url" type="String" setter="set_description_url" getter="get_description_url" default="&quot;&quot;">
  46. URL to the device description.
  47. </member>
  48. <member name="igd_control_url" type="String" setter="set_igd_control_url" getter="get_igd_control_url" default="&quot;&quot;">
  49. IDG control URL.
  50. </member>
  51. <member name="igd_our_addr" type="String" setter="set_igd_our_addr" getter="get_igd_our_addr" default="&quot;&quot;">
  52. Address of the local machine in the network connecting it to this [UPNPDevice].
  53. </member>
  54. <member name="igd_service_type" type="String" setter="set_igd_service_type" getter="get_igd_service_type" default="&quot;&quot;">
  55. IGD service type.
  56. </member>
  57. <member name="igd_status" type="int" setter="set_igd_status" getter="get_igd_status" enum="UPNPDevice.IGDStatus" default="9">
  58. IGD status. See [enum IGDStatus].
  59. </member>
  60. <member name="service_type" type="String" setter="set_service_type" getter="get_service_type" default="&quot;&quot;">
  61. Service type.
  62. </member>
  63. </members>
  64. <constants>
  65. <constant name="IGD_STATUS_OK" value="0" enum="IGDStatus">
  66. OK.
  67. </constant>
  68. <constant name="IGD_STATUS_HTTP_ERROR" value="1" enum="IGDStatus">
  69. HTTP error.
  70. </constant>
  71. <constant name="IGD_STATUS_HTTP_EMPTY" value="2" enum="IGDStatus">
  72. Empty HTTP response.
  73. </constant>
  74. <constant name="IGD_STATUS_NO_URLS" value="3" enum="IGDStatus" deprecated="This value is no longer used.">
  75. Returned response contained no URLs.
  76. </constant>
  77. <constant name="IGD_STATUS_NO_IGD" value="4" enum="IGDStatus">
  78. Not a valid IGD.
  79. </constant>
  80. <constant name="IGD_STATUS_DISCONNECTED" value="5" enum="IGDStatus">
  81. Disconnected.
  82. </constant>
  83. <constant name="IGD_STATUS_UNKNOWN_DEVICE" value="6" enum="IGDStatus">
  84. Unknown device.
  85. </constant>
  86. <constant name="IGD_STATUS_INVALID_CONTROL" value="7" enum="IGDStatus">
  87. Invalid control.
  88. </constant>
  89. <constant name="IGD_STATUS_MALLOC_ERROR" value="8" enum="IGDStatus" deprecated="This value is no longer used.">
  90. Memory allocation error.
  91. </constant>
  92. <constant name="IGD_STATUS_UNKNOWN_ERROR" value="9" enum="IGDStatus">
  93. Unknown error.
  94. </constant>
  95. </constants>
  96. </class>