[avahi] avahi-core and what functionality it provides
lathiat at bur.st
Tue Aug 12 03:22:27 PDT 2008
On 12/08/2008, at 4:54 AM, Jim Hodapp wrote:
> I need DNS-SD functionality on an embedded device that I'm making. I
> noticed that avahi-core is recommended for this application type and
> not avahi-client. What is the real difference between the two?
Avahi-core is an "embeddable" version of the mDNS stack. It runs in
process, and should ideally only be used by 1 process. This is what
avahi-daemon/avahi-client use internally.
This suggestion is because it would use less resources, most
specifically it bypasses the need for d-bus which is a bit heavy on
some embedded systems (but then again, the 'spec' of some embedded
systems these days is insane...)
Normally avahi-client interacts over d-bus to avahi-daemon which makes
the avahi-core calls for you and allows you to efficiently and
functionally use Avahi from multiple programs.
> there an example service publish/browse application using avahi-core
> instead of avahi-client?
Yes there are both core- and client- examples.
> What doesn't avahi-core allow me to do?
Use Avahi from more than 1 program.
> Does avahi-core require the avahi-daemon to be running? Or can I just
> make API calls via avahi-core without avahi-daemon running and does
> this allow me to publish a service? How about browsing services
> published on a network, is this possible without avahi-daemon?
avahi-core does not use avahi-daemon. all functions of avahi-client
(well, most of them, browsing/publishing, etc, avahi-client has some
convenience functions though) - are available in avahi-core - just
with the aforementioned limit of only being usable from 1 application
In theory you can use it in multiple programs (multiple mDNS stacks
can run on 1 machine) - in practice this can cause some problems and
is best avoided and use avahi-daemon or something similar you make
yourself to replace it if you need to remove the dbus and other
dependencies (glib, etc)
If you care to write a lighter-weight avahi-daemon for embedded usage,
it would be create if you could contribute a generic one to the
greater avahi project!
More information about the avahi