Crate upnp

A Rust crate providing basic Universal Plug and Play (UPnP) protocol implementations.

MIT License Minimum Rust Version crates.io docs.rs GitHub stars

Implements the core protocols of the UPnP Device Architecture (UDA), specifically the discovery protocol for control points to search for, and devices to notify of, device and service availability.

UPnP technology allows devices to connect seamlessly and to simplify network implementation in the home and corporate environmentsOpen Connectivity Foundation.

API

The main client interface is the ssdp module that provides search and notify capabilities. Over time the scpd module will be completed for the parsing and generation of device description messages. The following diagram shows the basic structure of the library with the two API modules relying on implementations of HTTPMU/HTTPU and SOAP respectively.

,--------, discover ,--------, advertise ,--------, | |--------->| SSDP |<------------------| | | Client | '--------' | Server | | API | understand : ,--------, describe | API | | |------------------>| SCPD |<---------| | '--------' : '--------' '--------' : : : V : ,--------, : | SOAP | : '--------' : : V : ,--------, : | HTTPMU | : '--------' : : : V V TCP/UDP ,---------------------------------------------------,

Command-Line

The command-line tool upnp can be used to perform basic operations using the SSDP API. Primarily these are used for testing, but the search command can be used for general purpose discovery.

The general form of the command is network-options command command-options, as shown below.

```bash USAGE upnp [-v|--verbose]+ [--interface=] [--ip-version=] COMMAND

COMMANDS search [-s|--search-target=] [-d|--domain=] [-w|--max-wait=] ```

Changes

Version 0.1.0

TODO

  1. Finish parsing search results.
  2. Support listening for notifications.
  3. Support fetching device details.
  4. Support for sending notifications.