Simple Library for Service Discovery

libservicediscovery (LSD) is a simple library for advertising and querying for services on a local network (LAN). To make a query, LSD sends a UDP broadcast message to the LAN containing four regular expressions: "title", "description", "types" and "url". Services whose fields match the expressions will respond with the contents of their four fields. In addition, if new services start up and advertise themselves in the future, then you will also recieve a response to your query.

See the "About" section below for more information.

Download

About

LibServiceDiscovery is (C) Copyright 2003 by Peter Amstutz and Reed Hedges, and is distributed under the terms of the GNU Lesser General Public License. See the COPYING file in the source package for the full copyright notice.

Your interface to LSD is through the ServiceDirectory class, which provides "query" and "endQuery" for making queries, "addService" and "removeService" for advertising services, and various configuration methods (including the ability to "relay" messages through a TCP socket, enabling you to bridge networks if necesary). See "servicediscovery/servicedirectory.hh" for the interface.

A program called "service_responder" is also included. This program runs new programs in response to queries. Query patterns and responder programs are specified in a config file.

To build and install LSD, first unpack the archive with "tar xzvf libservicediscovery-0.12.0.tar.gz" and "cd" into the new directory. Then run "./configure", then "make". To install, become root and run "make install". Run "./configure --help" and look at the file "INSTALL" for more detailed information.

LSD has been tested with GNU/Linux (Debian and RedHat), and Mac OSX. It should work on most standard Unix-like systems; please let us know your results on systems other than Linux and Mac.

Note that on Linux, only one process per host can listen for advertisements on one port. On Mac OSX (and FreeBSD I am told) multiple processes can listen on the same port. (Maybe we should use multicast...)

Post a message to the VOS discussion mailing list if you have any problems or questions

LSD requires a regular expression library. If your system lacks libregex, you can use the Boost regular expression library: see http://www.boost.org. The configure script will automatically detect the presence of libboost_regex.

By default, LSD will install header files in /usr/local/include/servicediscovery (so use #include <servicediscovery/servicedirectory.hh>), libraries in /usr/local/lib, and documentation in /usr/local/share/doc/libservicediscovery. Use the "--prefix" option to "configure" to use a different directory.

 


Contact: tetron @ interreality . org
Website problems: reed @ interreality . org