Documentation
¶
Overview ¶
Universal Plug and Play (UPnP) device. See graphics.gd/classdb/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.
Index ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- type ID
- type IGDStatus
- type Instance
- func (self Instance) AddPortMapping(port int) int
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsUPNPDevice() Instance
- func (self Instance) DeletePortMapping(port int) int
- func (self Instance) DescriptionUrl() string
- func (self Instance) ID() ID
- func (self Instance) IgdControlUrl() string
- func (self Instance) IgdOurAddr() string
- func (self Instance) IgdServiceType() string
- func (self Instance) IgdStatus() IGDStatus
- func (self Instance) IsValidGateway() bool
- func (self Instance) QueryExternalAddress() string
- func (self Instance) ServiceType() string
- func (self Instance) SetDescriptionUrl(value string)
- func (self Instance) SetIgdControlUrl(value string)
- func (self Instance) SetIgdOurAddr(value string)
- func (self Instance) SetIgdServiceType(value string)
- func (self Instance) SetIgdStatus(value IGDStatus)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetServiceType(value string)
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Expanded ¶
type Expanded [1]gdclass.UPNPDevice
func (Expanded) AddPortMapping ¶
func (self Expanded) AddPortMapping(port int, port_internal int, desc string, proto string, duration int) int
Adds a port mapping to forward the given external port on this graphics.gd/classdb/UPNPDevice for the given protocol to the local machine. See graphics.gd/classdb/UPNP.Instance.AddPortMapping.
func (Expanded) DeletePortMapping ¶
Deletes the port mapping identified by the given port and protocol combination on this device. See graphics.gd/classdb/UPNP.Instance.DeletePortMapping.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsUPNPDevice ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type IGDStatus ¶
type IGDStatus int //gd:UPNPDevice.IGDStatus
const ( // OK. IgdStatusOk IGDStatus = 0 // HTTP error. IgdStatusHttpError IGDStatus = 1 // Empty HTTP response. IgdStatusHttpEmpty IGDStatus = 2 // Returned response contained no URLs. IgdStatusNoUrls IGDStatus = 3 // Not a valid IGD. IgdStatusNoIgd IGDStatus = 4 // Disconnected. IgdStatusDisconnected IGDStatus = 5 // Unknown device. IgdStatusUnknownDevice IGDStatus = 6 // Invalid control. IgdStatusInvalidControl IGDStatus = 7 // Memory allocation error. IgdStatusMallocError IGDStatus = 8 // Unknown error. IgdStatusUnknownError IGDStatus = 9 )
type Instance ¶
type Instance [1]gdclass.UPNPDevice
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddPortMapping ¶
Adds a port mapping to forward the given external port on this graphics.gd/classdb/UPNPDevice for the given protocol to the local machine. See graphics.gd/classdb/UPNP.Instance.AddPortMapping.
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsUPNPDevice ¶
func (Instance) DeletePortMapping ¶
Deletes the port mapping identified by the given port and protocol combination on this device. See graphics.gd/classdb/UPNP.Instance.DeletePortMapping.
func (Instance) DescriptionUrl ¶
func (Instance) IgdControlUrl ¶
func (Instance) IgdOurAddr ¶
func (Instance) IgdServiceType ¶
func (Instance) IsValidGateway ¶
Returns true if this is a valid IGD (InternetGatewayDevice) which potentially supports port forwarding.
func (Instance) QueryExternalAddress ¶
Returns the external IP address of this graphics.gd/classdb/UPNPDevice or an empty string.