[Olsr-dev] New plugin: DNSSD

Dan Staples (spam-protected)
Fri Feb 15 17:27:13 CET 2013


I understand the concern about linking a new library for the reason you
give. I was tempted to reimplement the various data structures and
functions I use from that library just so I don't need to link to it. I
may end up doing that, but for now just wanted to get a working example.

The warnings are due to either ldns or uthash, a hash table
implementation I include. I am not concerned at the moment with making
the cleanest building code, but like I said, to get something that works
as a proof-of-concept. Since the consensus seems to be to combine the
multicast plugins anyway, I am not sure it's worth fixing at the moment.
I'm sure there are plenty of things in my code that could be improved,
as it has been many years since I did much C coding. I am more
interested in how well it works and what is a good way to move forward.
Once I get the idea of where to go from here, I will fix those warnings.

On 02/15/2013 11:13 AM, Saverio Proto wrote:
> Hello,
>
> I installed in my system the ldns library and I am now able to compile the code.
>
> Linking a new library is something that should be evaluated by the
> olsrd community however, it is a big change for a program that wants
> to keep a low footprint for embedded devices.
>
> You software compiles now but please fix the following warnings:
>
> (spam-protected):~/SORGENTI/olsrd$ make dnssd
> make[1]: ingresso nella directory "/home/saverio/SORGENTI/olsrd/lib/dnssd"
> make[1]: uscita dalla directory "/home/saverio/SORGENTI/olsrd/lib/dnssd"
> make[1]: ingresso nella directory "/home/saverio/SORGENTI/olsrd/lib/dnssd"
> [CC] src/dllist.c
> [CC] src/dnssd.c
> src/dnssd.c: In function ‘P2pdPacketCaptured’:
> src/dnssd.c:770:5: warning: implicit declaration of function
> ‘ldns_pkt_section_count’ [-Wimplicit-function-declaration]
> src/dnssd.c:770:5: warning: nested extern declaration of
> ‘ldns_pkt_section_count’ [-Wnested-externs]
> src/dnssd.c: In function ‘DnssdSendPacket’:
> src/dnssd.c:834:97: warning: unused parameter ‘nBytes’ [-Wunused-parameter]
> src/dnssd.c: In function ‘AddToRrBuffer’:
> src/dnssd.c:1730:3: warning: switch missing default case [-Wswitch-default]
> src/dnssd.c:1738:5: warning: switch missing default case [-Wswitch-default]
> src/dnssd.c: In function ‘AddToServiceList’:
> src/dnssd.c:1776:3: warning: switch missing default case [-Wswitch-default]
> src/dnssd.c:1780:5: warning: switch missing default case [-Wswitch-default]
> src/dnssd.c: In function ‘GetRrListByTtl’:
> src/dnssd.c:1793:3: warning: switch missing default case [-Wswitch-default]
> src/dnssd.c: In function ‘GetServiceById’:
> src/dnssd.c:1799:3: warning: switch missing default case [-Wswitch-default]
> src/dnssd.c: In function ‘DeleteListByTtl’:
> src/dnssd.c:1805:3: warning: switch missing default case [-Wswitch-default]
> [CC] src/NetworkInterfaces.c
> [CC] src/olsrd_plugin.c
> [CC] src/Packet.c
> [CC] src/PacketHistory.c
> [LD] olsrd_dnssd.so.0.1.2
> gcc -shared -Wl,-soname,libolsrd_dnssd.so
> -Wl,--version-script=version-script.txt  -Wl,--warn-common -fPIC -o
> olsrd_dnssd.so.0.1.2 src/dllist.o src/dnssd.o src/NetworkInterfaces.o
> src/olsrd_plugin.o src/Packet.o src/PacketHistory.o -lpthread
> -lpthread -lldns
> make[1]: uscita dalla directory "/home/saverio/SORGENTI/olsrd/lib/dnssd"
> (spam-protected):~/SORGENTI/olsrd$
>
>
>
> Saverio
>
> 2013/2/15 Dan Staples <(spam-protected)>:
>> Yes, it requires the ldns library to parse mDNS packets.
>> https://www.nlnetlabs.nl/projects/ldns/
>>
>> On Fri 15 Feb 2013 10:55:10 AM EST, Saverio Proto wrote:
>>> You code do not compile for me:
>>> ldns/ldns.h is missing
>>>
>>> Saverio
>>>
>>>
>>> 2013/2/15 Saverio Proto <(spam-protected)>:
>>>>> Here is a fork with the new code included:
>>>>> https://github.com/danstaples/olsrd
>>>> thanks Dan.
>>>>
>>>> I believe you are very new to git :)
>>>>
>>>> I suggest to you to use different branches.
>>>>
>>>> Look at this:
>>>> https://github.com/zioproto/olsrd
>>>>
>>>> I imported your commit in a different branch so I can easily diff stuff.
>>>>
>>>> Unfortunately git is not easy, I read a good book that changed my life.
>>>> "Version control with Git". You can find it very easily online to
>>>> download for free if you google for it :)
>>>>
>>>> ciao,
>>>>
>>>> Saverio
>> --
>> Dan Staples
>>
>> Open Technology Institute
>> https://commotionwireless.net

-- 
Dan Staples

Open Technology Institute
https://commotionwireless.net





More information about the Olsr-dev mailing list