[avahi] Publish services in local

Doug Coburn dougcobie at hotmail.com
Thu Feb 23 19:46:23 PST 2012


If you are looking to publish only to other services running on you local host, I don’t think you can do that.  In 2008 Lennart said:

The "AvahiIfIndex interface" parameter is what you are looking
for. You can fill in any interface index that is returned by functions
like if_nametoindex(), and that are considered "relevant" by Avahi.

> In particular, I can specify a constant so it will register in a way 
> that only processes on the local machine can see it

As Trent already mentioned this is not possible with Avahi right now,
because Avahi ignores loopback devices as "irrelevant".

However, if you use the value “<uniqename>.local” for the domain parameter to avahi_entry_group_add_service, only processes using that same domain name to avahi_service_[browser|resolver]_new will see it.

- Doug

From: Douglas Coburn 
Sent: Thursday, February 23, 2012 10:19 AM
To: avahi at lists.freedesktop.org 
Subject: Re: [avahi] Publish services in local

I am not sure I understand what you mean by the difference between a global and a local service.

In our project we often want to sandbox a virtual network inside our larger lab network.  We found the use of the domain field useful in this regard.  I can set up three services that need to see each other and run them all on the foo.local domain (note the .local suffix is needed).  The services publish and discover using this domain value (We use a MY_AVAHI_DOMAIN=foo.local environment variable to enable this sandboxing.

Also, we have some multihome boxes that have two or more physical ethernet ports connecting them to multiple networks.  We use the avahi config file to disable publish/discovery on the interfaces not relevent to to service-to-service communication.

Hope this helps give you some ideas,
- Doug



--------------------------------------------------------------------------------
From: meme037 at hotmail.com
To: avahi at lists.freedesktop.org
Date: Thu, 23 Feb 2012 17:21:24 +0100
Subject: [avahi] Publish services in local


Hi,

I actually work for a project where we decide to use avahi to discover services in all our sytem...
We want to publish global services and also local services.
We use avahi_entry_group_add_service and avahi_entry_group_commit methods. This works well for global services: all machines of our network receive notifications of service publication. But we do not know how to publish only on local... We tried by modifying AvahiIfIndex parameter (value 1 for lo interface): this did not work (no notification received on local machine). We tried by modifying AvahiPublishFlags parameter (value AVAHI_PUBLISH_NO_ANNOUNCE): we had an error with avahi_entry_group_add_service "Failed to add _service1._tcp service: Invalid flags"
Can we do this with avahi?

Thanks for your answer,
regards


_______________________________________________ avahi mailing list avahi at lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/avahi


--------------------------------------------------------------------------------
_______________________________________________
avahi mailing list
avahi at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/avahi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/avahi/attachments/20120223/c656b6c1/attachment.htm>


More information about the avahi mailing list