[avahi] Is it possible to customize "#define AVAHI_DEFAULT_TTL_HOST_NAME" and "#define AVAHI_DEFAULT_TTL", rather than embedding them "statically" in the code?

Ajay Garg ajaygargnsit at gmail.com
Mon Jul 9 10:00:40 PDT 2012


Just wanted to update you on some info; also I had some queries ::


The "#defines" are needed in all the avahi-modules (avahi-core,
avahi-daemon, etc.), so it needs to have itself pre-processed from the
common "avahi-common" module. Thankfully, the two "#defines" are present in
"avahi-common/defs.h".

This "avahi-common" is the basic common module, which is linked to other
modules (avahi-core, avahi-daemon, etc)

So far, so good.


===================================================================================


Also, Avahi has "/etc/avahi/avahi-daemon.conf", which is read by
load_config_file() in "avahi-daemon/main.c".
So, that was the first place I tried adding the two new config values.


But.. the problem starts now..


If the two additional values are read from the "static int
load_config_file(DaemonConfig *c)" method in "avahi-daemon/main.c" (via
"/etc/avahi/avahi-daemon.conf"), that does not work out.

Reason is that, because "avahi-daemon" requires "avahi-core" to complete
its linking process, whereas "avahi-core" would need "avahi-daemon" to
complete its linking process (since the two values will be read from the
context of "avahi-daemon").

That puts us in a catch-22 situation.


===================================================================================


So, actually, the right place to load the complete config is in
"avahi-common" module; but as of now, even in F17, the "static int
load_config_file(DaemonConfig *c)" method resides in the "avahi-daemon"
module :\


Anyways, so, I have put in the code to load the two new config files, in
"avahi-common/load_ttl_config.c".


===================================================================================



Thanks and Regards,
Ajay


On Mon, Jul 9, 2012 at 9:45 PM, Ajay Garg <ajaygargnsit at gmail.com> wrote:

> Hi all.
>
> I have written a patch, that solves the issue
> https://bugs.freedesktop.org/show_bug.cgi?id=51501#c5
>
> The patch is available at
>
> http://people.sugarlabs.org/ajay/root/freedesktop_bug_51501/common-patch-for-f14-and-f17/customize-avahi-default-ttl-values.patch
>
>
> Will be glad to have it considered, and have feedback/criticism/whatever.
>
>
> Thanks and Regards,
> Ajay
>
>
> On Thu, Jul 5, 2012 at 7:32 PM, Ajay Garg <ajaygargnsit at gmail.com> wrote:
>
>> Hi all.
>>
>> Just found about /etc/avahi/avahi-daemon.conf.
>> That would do it !!! (of course after patching avahi to read-in the two
>> new values).
>>
>> Will be back soon with a patch :)
>>
>>
>> Regards,
>> Ajay
>>
>>
>> On Thu, Jul 5, 2012 at 3:49 PM, Ajay Garg <ajaygargnsit at gmail.com> wrote:
>>
>>> Hi all.
>>>
>>> I ran into a issue, as described at
>>> https://bugs.freedesktop.org/show_bug.cgi?id=51501
>>>
>>>
>>> I followed these steps ::
>>>
>>> a)
>>> I changed the values to
>>>
>>>                                  #define AVAHI_DEFAULT_TTL_HOST_NAME (20)
>>>                                  #define
>>> AVAHI_DEFAULT_TTL                       (20)
>>>
>>> b)
>>> Re-compiled the RPMS
>>>
>>>
>>> c)
>>> Upgraded to these new RPMS on my F17.
>>>
>>>
>>> And voila, the contacts-disappearance signals did emit (after about 20
>>> seconds)  !!!
>>>
>>>
>>> The same approach solved the issue on F14 as well !!!
>>>
>>>
>>>
>>>
>>> So, now I intend to make the values of these 2 "#defines" customizable.
>>> My queries are ::
>>>
>>> (i)
>>> Is it possible already?
>>>
>>> (ii)
>>> If answer to (i) is "no", perhaps GConf might help? The thing that
>>> worries me is in what context should Gconf-entries be populated, since
>>> avahi runs as a daemon.
>>>
>>>
>>>
>>>
>>> Will be grateful to a reply.
>>>
>>>
>>> Thanks and Regards,
>>> Ajay
>>>
>>>
>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/avahi/attachments/20120709/f1860950/attachment.html>


More information about the avahi mailing list