Micro UPNP Discovery Daemon
---------------------------

Copyright (c) Lineo, 2001.

Maintainer : Jared Daivson   jared@moreton.com.au

This daemon was based in most part on the Intel UPNP SDK which is freely available. Visit www.upnp.org.

The sdk had a number of subsystems which were not necessary for embedded implementations, especially where the discovery part was the only upnp requirement. upnpd cuts down the resources needed to. It is single threaded, statically linked, has no xml parser, and does not support SOAP or GENA; unlike Intel's SDK implementations from which it is derived. Separate daemons however could be used along with this discovery daemon to satisfy control and eventing requirements if they are ever required.

Some limitations of this implementation :

 1.  Does not support embedded devices or service advertising. Only advertises and responds to SSDP search request for the root device. This is because it does not have an XML parser and DOM subsystems to process the description URL. 

The description URL and Discovery Daemons should keep their device uuid's synchronised by using variables defined in the #include <vendors/autoconf.h>. The discovery daemon builds the uuid/udn (universally unique device name) in the following format.

  uuid = Vendor-SystemName-xxxxxxxxxx 

 where xxxxxxxxxx is the MAC/hardware address of the ethernet adapter that was specified on the command line (see below).

Vendor can be set by setting the preprocessor variable VENDOR_NAME in <vendors/autoconf.h>, and SystemName can be set by setting SYS_NAME likewise.


Kernel Requirements (Warning)
-------------------

Warning: Make sure that CONFIG_IP_MULTICAST is enabled in the kernel networking options of your target system. If this option is not set no errors will necessarily be logged, it just won't work.

Starting the Program
Usage :
        upnpd adapter port urlpath

adapter is the interface name eg. eth0

port is the tcp port address where the xml description url should be found. This will be the target system's web server port. Usually port is 80.

urlpath is the relative path from the root directory of the web-server bound to interface <adapter>. eg. cgi-bin/description
 (note you should not have a preceeding / in the url path)

eg. 
 shellprompt> upnpd eth0 80 cgi-bin/description &
upnpd - Micro Universal Plug and Play Discovery daemon
        Copyright (c) 2001 Lineo
        Portions Copyright (c) 2000 Intel Corporation
[11]

In most shells you can background a process by using '&'. 

To shut down cleanly, sending the upnpd process a SIGTERM signal will unregister the device. upnpd sets a relatively short expiration time on its advertisements so it shouldn't cause much problem in cases where the system cannot be cleanly shutdown.

Operation
---------

upnpd must be run as suid root.

upnpd will add the multicast route 239.0.0.0 netmask 255.0.0.0 to the routing table automatically.

upnpd polls the ip address of the adapter it is bound to every 5 seconds (by default). If the adapter's ip changes for any reason, upnpd will unregister the root device for the adapter's old IP address and reregister with the new IP address.
