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