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