expliot.core.protocols.internet.upnp

Wrapper for UPNP Protocol.

Attributes

DEFAULT_UPNP_TIMEOUT

DISCOVER_ALL

Classes

Discovery

Representation of a discovery entity.

UpnpDiscovery

Discovery for UPNP devices on a network.

Functions

device_dict(self)

Get the details of the Device in a dict.

service_dict(self)

GeEt the details of a device's service in a dict.

action_dict(self)

Get the name and argument details of a service.

state_variable_dict(self)

Get the details of the state variable s of a service.

argument_dict(self)

Get the details of an argument to an action.

Package Contents

class expliot.core.protocols.internet.upnp.Discovery

Representation of a discovery entity.

abstract devices()

Return the found devices. This should be called after scan().

Args:

Nothing

Returns:

list: List of all devices discovered in scan()

abstract services()

Return the found services. This should be called after scan().

Args:

Nothing

Returns: list: List of all devices discovered in scan()

abstract scan()

Scan for devices or services depending on the Discovery type.

Args:

Nothing

Returns:

Nothing

expliot.core.protocols.internet.upnp.DEFAULT_UPNP_TIMEOUT = 2
expliot.core.protocols.internet.upnp.DISCOVER_ALL = 'ssdp:all'
expliot.core.protocols.internet.upnp.device_dict(self)

Get the details of the Device in a dict.

Args:

None

Returns:
dict: Dictionary containing the device details. Dict keys are:
  1. host

  2. port

  3. description

  4. friendly_name

  5. type

  6. base_url

  7. services

expliot.core.protocols.internet.upnp.service_dict(self)

GeEt the details of a device’s service in a dict.

Args:

None

Returns:
dict: Dictionary containing the service details. Dict keys are:
  1. name

  2. type

  3. version

  4. id

  5. description

  6. scpd_url

  7. control_url

  8. event_sub_url

  9. base_url

  10. actions

  11. state_variables

expliot.core.protocols.internet.upnp.action_dict(self)

Get the name and argument details of a service.

Args:

None

Returns:

dict: Dictionary containing the action details.

expliot.core.protocols.internet.upnp.state_variable_dict(self)

Get the details of the state variable s of a service.

Args:

None

Returns:

dict: Dictionary containing the state variable details.

expliot.core.protocols.internet.upnp.argument_dict(self)

Get the details of an argument to an action.

Args:

None

Returns:

dict: Dictionary containing the argument details.

class expliot.core.protocols.internet.upnp.UpnpDiscovery(timeout=DEFAULT_UPNP_TIMEOUT, st=DISCOVER_ALL)

Bases: expliot.core.discovery.Discovery

Discovery for UPNP devices on a network.

scan()

Start a scan.

devices()

Get the UPNP devices found in the network.

Args:

None

Returns:

list: List of devices found