[avahi] Embedded application

Lennart Poettering lennart at poettering.net
Sun Aug 17 17:00:51 PDT 2008


On Sun, 17.08.08 18:44, David Lambert (dave at lambsys.com) wrote:

> I am new to avahi and am running snapgear with uClibC. After having 
> successfully ported avahi daemon, I am looking at a method to interface 
> custom applications. I do not have glib or dbus due to the small 
> footprint of my embedded application, so the only options I see are:

You only need D-Bus, not GLib to interface with the Avahi daemon.

> 
> 1) Use the "simple interface" using the avahi socket. I can use this to 
> resolve .local addresses, but I do not see how to browse what services 
> are available.

The simple protocol is only for resolving host names, i.e. for what
nss-mdns does. It is explicitly not designed for browsing/resolving services.

> 2) Use the core api. There are warnings that there should not be more 
> than one mDNS application in a system. Is there a way to use the core 
> api to only browse what is available and not interfere with
> avahi-daemon?

The mDNS protocol is unfortunately designed to not completely work if
more than one mDNS stack is running on the same machine. Please note
however, that the aforementioned warning is just a ... warning. You
can ignore it, and usually it should work.

> 3) Any other suggestions?

For embedded applications it is usually the best idea to write your
own tiny mDNS daemon, around avahi-core. Don't use avahi-daemon,
don't use avahi-client. Just create a small daemon that registers the
host names you want, registers the services you want and browses for
the services you want. Such a small daemon would have no dependencies
besides avahi-core.

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4


More information about the avahi mailing list