[Olsr-dev] [RFC]olsrd praeprocessor patch

Henning Rogge (spam-protected)
Fri Jan 4 15:12:17 CET 2008


Hi, 

while looking through the olsr secure plugin in noticed the "hijack hack" the 
plugin uses for capturing the packets before they get processed by olsrd.

I refactored the parser of olsrd so that this is done by two new functions:

void olsr_praeprocessor_add_function(praeprocessor_function);
int olsr_praeprocessor_remove_function(praeprocessor_function);

The "praeprocessor_function" has the type

char *praeprocessor_function(char *packet, struct interface *, union
   olsr_ip_addr *, int *length);

and all registered praeprocessors are called before the package is decoded by 
olsrd. This way the secure plugin (and other possible plugins) can check the 
packages, modify them or discard them (by returning NULL).

The secure plugin is already changed to the new interface with this patch, it 
should be applied to todays mercurial repository.

Henning
-------------- next part --------------
A non-text attachment was scrubbed...
Name: olsrd_praeprocessor.patch
Type: text/x-diff
Size: 17076 bytes
Desc: not available
URL: <http://lists.olsr.org/pipermail/olsr-dev/attachments/20080104/eeb1c0be/attachment.patch>


More information about the Olsr-dev mailing list