[olsr-dev] Plugin messages

Andreas Tønnesen (spam-protected)
Tue Dec 14 18:37:47 CET 2004


Hi Andrea,

You've got a couple of options for your case. You can make
net_outbuffer_bytes_left available to your plugin by adding
it to the plugin interface(and I'll add it for 0.4.9). The
disadvantage here is that you plugin will not work with a clean
0.4.8 build. But the way I see it you don't really need the
bytes-left function. net_outbuffer_push will return 0 if there
is no room left in the outputbuffer. If it returns 0 you
can flush the buffer by calling net_output. An even easier
way is to always call net_output prior to building your message.
This solution is easier, but if the former is better IMO since
it allows for stacking of messages.
All this assumes that your message will never be bigger then
the buffersize(which is set from the MTU of the network interface).

- Andreas



Andrea Sini wrote:
> Hello everybody,
> 
> I'm working with the latest version of OLSR and I'm writing a plugin.
> 
> I need to create messages with a message body's size that isn't fixed 
> and can change over time (depending on various factors).
> 
> I've studied the powerstatus plugin but there the situation is simpler 
> because the message body is fixed in dimension.
> 
> I think that the situation (and the things to do) is similar to the 
> production (for example) of MID messages, where the number of interfaces 
> declaration is previously unknown...
> 
> One of the points is that the function net_outbuffer_bytes_left is not 
> present in olsr_plugin_io etc. and that function is used in MID messages 
> generation.
> 
> So, any suggestion ?
> 
> Thanks in advance for the answer
> 
> Bye
> 
> Andrea Sini
> 
> _______________________________________________
> olsr-dev mailing list
> (spam-protected)
> https://www.olsr.org/mailman/listinfo/olsr-dev

-- 
Andreas Tønnesen
http://www.olsr.org



More information about the Olsr-dev mailing list