<HTML><HEAD>
<STYLE><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></STYLE>
</HEAD>
<BODY dir=ltr class=hmmessage>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>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:</DIV>
<DIV> </DIV>
<DIV><FONT face="Courier New">The "AvahiIfIndex interface" parameter is what you
are looking</FONT></DIV>
<DIV><FONT face="Courier New">for. You can fill in any interface index that is
returned by functions</FONT></DIV>
<DIV><FONT face="Courier New">like if_nametoindex(), and that are considered
"relevant" by Avahi.</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">> In particular, I can specify a constant so it
will register in a way</FONT><FONT face="Courier New"> </FONT></DIV>
<DIV><FONT face="Courier New">> that only processes on the local machine can
see it</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">As Trent already mentioned this is not possible
with Avahi right now,</FONT></DIV>
<DIV><FONT face="Courier New">because Avahi ignores loopback devices as
"irrelevant".</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV>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.</DIV>
<DIV> </DIV>
<DIV>- Doug</DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV style="FONT: 10pt tahoma">
<DIV><FONT size=3 face=Calibri></FONT> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=dougcobie@hotmail.com
href="mailto:dougcobie@hotmail.com">Douglas Coburn</A> </DIV>
<DIV><B>Sent:</B> Thursday, February 23, 2012 10:19 AM</DIV>
<DIV><B>To:</B> <A title=avahi@lists.freedesktop.org
href="mailto:avahi@lists.freedesktop.org">avahi@lists.freedesktop.org</A> </DIV>
<DIV><B>Subject:</B> Re: [avahi] Publish services in local</DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV dir=ltr>I am not sure I understand what you mean by the difference between
a global and a local service.<BR><BR>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.<BR><BR>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.<BR><BR>Hope this helps give you some
ideas,<BR>- Doug<BR><BR>
<DIV>
<DIV id=SkyDrivePlaceholder></DIV>
<HR id=stopSpelling>
From: meme037@hotmail.com<BR>To: avahi@lists.freedesktop.org<BR>Date: Thu, 23
Feb 2012 17:21:24 +0100<BR>Subject: [avahi] Publish services in local<BR><BR>
<META name=Generator content="Microsoft SafeHTML">
<DIV dir=ltr>
<STYLE>
.externalclass .ecxhmmessage p
{padding:0px;}
.externalclass body.ecxhmmessage
{font-size:10pt;font-family:tahoma;}
</STYLE>
<DIV dir=ltr>Hi,<BR><BR>I actually work for a project where we decide to use
avahi to discover services in all our sytem...<BR>We want to publish global
services and also local services.<BR>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"<BR>Can we do this with avahi?<BR><BR>Thanks for your
answer,<BR>regards<BR></DIV></DIV><BR>_______________________________________________
avahi mailing list avahi@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/avahi</DIV></DIV>
<P>
<HR>
_______________________________________________<BR>avahi mailing
list<BR>avahi@lists.freedesktop.org<BR>http://lists.freedesktop.org/mailman/listinfo/avahi<BR></DIV></DIV></DIV></BODY></HTML>