[avahi] How to get the service name from a callback

Alex Chen alex_chen at filemaker.com
Wed Mar 30 15:31:07 PDT 2011

I am trying to use Avahi to publish a service.  The callback API of 
avahi_entry_group_new() does not seem to contain a parameter that the 
caller to retrieve the original service name used in the 
avahi_entry_group_add_service() call.  I need to get the name and try a 
different name in case there is a name conflict.  The sample code uses a 
'global' variable for this purpose but it is not a good practice.

I found the definition of AvahiEntryGroup structure in 
avahi-client/internal.h, which is not available in Ubuntu's package, 
from the source but could not find anything useful.
Apple's Bonjour API for such callback has the service name, service type 
and domain name passed back as parameters.  How do I get such information?


More information about the avahi mailing list