[olsr-dev] How to check if a node is MPR-node from a plugin?

Andreas Tønnesen (spam-protected)
Fri Dec 16 09:24:46 CET 2005

Ok, the function is commited - as usual the pubilc cvs mirror takes some
time to update.

We are interested in feedback on tests of current CVS(to be 0.4.10) on
different platforms. We have people looking at it, but any feedback from
others on platforms like OpenBSD, NetBSD and OSX is very much appreciated.

- Andreas

> Andreas Tønnesen wrote:
>> Hei Roar,
> Hei Andreas,
>> The way I see this there are two solutions. If you plan on using the
>> olsr_lookup_mprs_set function you must provide the main address of the
>> MPR selector, so this is not a good solution as you would have to
>> traverse the link set and check all main addresses.
> Yes, this was the same conclusion I made, that's why I asked on this list
> :)
>> The first one solution would be to create a function BOOL is_mpr() which
>> you can poll. I can add such a function to cvs if needed. What you need
>> is basically(in mpr_selector_set.c):
>> olsr_is_mpr()
>> {
>>     return (mprs_list.next == &mprs_list ? OLSR_FALSE : OLSR_TRUE);
>> }
> Yes, please add such a function.
> I don't known why the above code should  indicate that the current node
> is an MPR, as I'm not that familiar with the core olsrd data structures.
> But I trust you :)
>> The non pollbased way would be to add a callback event for mpr selector
>> change, meaning that plugins can register callbacks to be triggered upon
>> changes. I don't think we want to do this in the main code for now, so
>> you'll have to maintain this yourself IMO.
> I understand this completely. I will fix this myself in the plugin if
> you add the is_mpr() function to CVS.
> Thanks Andreas!
> --
> Roar Bjørgum Rotvik
> _______________________________________________
> olsr-dev mailing list
> (spam-protected)
> https://www.olsr.org/mailman/listinfo/olsr-dev

More information about the Olsr-dev mailing list