[Olsr-dev] rfc5444_reader documentation
Tue Jul 16 04:21:57 CEST 2013
Am Fri, 12 Jul 2013 08:46:39 +0200
schrieb Henning Rogge <(spam-protected)>:
> I took your example code, cleaned it up a little bit and added it to
> the repository in the example section. Hope you will find it easy to
> The main issue with your code was that your reader part declared a
> "message TVL type 2" as mandatory for your callback, but your writer
> added the "message TLV type 0" and "message TLV type 1". Because of
> this the callback was never called.
> The reader guarantees that the 'mandatory" TLVs are present when the
> block_callback() function pointer is called. Otherwise it will call
> the block_callback_failed_constraints() function pointer.
Thank you a lot, the example really helped understanding how the
reader/writer is supposed to be used. I think it'd probably be helpful
to also add addresses with addresstlvs to the example (patch attached)
because I didn't find how they were handled obvious either.
I've then build a small 'virtual network' thing where multiple virtual
nodes can send each other rfc5444 messages. So I had to put all state
of the 'nodes' in a struct for each, but this didn't work with
rfc5444_writer_content_provider - _message_content_provider.creator is
required by the rfc5444_writer_add_address() but the addAddresses()
callback only gets a rfc5444_writer*, the
rfc5444_writer_content_provider is expected to be a local variable. 
As a result, addresses don't get added to the packages when the same
rfc5444_writer_content_provider gets used multiple times.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 6241 bytes
Desc: not available
More information about the Olsr-dev