Package nattraverso :: Package pynupnp :: Module upnp :: Class UPnPDevice
[show private | hide private]
[frames | no frames]

Class UPnPDevice


Represents an UPnP device, with the associated infos, and remote methods.
Method Summary
  __init__(self, soap_proxy, info)
Build the device, with the given SOAP proxy, and the meta-infos.
twisted.internet.defer.Deferred add_port_mapping(self, local_ip, intport, extport, desc, proto, lease)
Add a port mapping in the upnp device.
twisted.internet.defer.Deferred get_external_ip(self)
Triggers an external ip discovery on the upnp device.
twisted.internet.defer.Deferred get_port_mappings(self)
Retreive the existing port mappings
twisted.internet.defer.Deferred remove_port_mapping(self, extport, proto)
Remove an existing port mapping on the device.

Method Details

__init__(self, soap_proxy, info)
(Constructor)

Build the device, with the given SOAP proxy, and the meta-infos.
Parameters:
soap_proxy - an initialized SoapProxy to the device
info - a dictionnary of various infos concerning the device extracted with UPnPXml

add_port_mapping(self, local_ip, intport, extport, desc, proto, lease=0)

Add a port mapping in the upnp device. Returns a deferred.
Parameters:
local_ip - the LAN ip of this host as "x.x.x.x"
intport - the internal port number
extport - the external port number
desc - the description of this mapping (string)
proto - "UDP" or "TCP"
lease - The duration of the lease in (mili)seconds(??)
Returns:
A deferred called with None when the mapping is done
           (type=twisted.internet.defer.Deferred)

get_external_ip(self)

Triggers an external ip discovery on the upnp device. Returns a deferred called with the external ip of this host.
Returns:
A deferred called with the ip address, as "x.x.x.x"
           (type=twisted.internet.defer.Deferred)

get_port_mappings(self)

Retreive the existing port mappings
Returns:
A deferred called with the dictionnary as defined in the interface portmapper.NATMapper.get_port_mappings
           (type=twisted.internet.defer.Deferred)

See Also: portmapper.NATMapper.get_port_mappings

remove_port_mapping(self, extport, proto)

Remove an existing port mapping on the device. Returns a deferred
Parameters:
extport - the external port number associated to the mapping to be removed
proto - either "UDP" or "TCP"
Returns:
A deferred called with None when the mapping is done
           (type=twisted.internet.defer.Deferred)

Generated by Epydoc 2.1 on Tue Aug 30 14:56:47 2005 http://epydoc.sf.net