Commit Graph

15 Commits (6bccd5aa30c03debc92c1e910d5f0dd1c6a9cc58)

Author SHA1 Message Date
Philippe Antoine b3ab126394 util: fix int warnings
Ticket: 4516
4 years ago
Victor Julien 7b4be598c4 radix: don't modify node prefix on lookup
The radix tree stores user data. However, it had no function to return
this data to the consumers of the API. Instead, on lookup, it would
set a field "user_data_result" in the nodes prefix structure which
could then be read by the caller.

Apart for this not being a very nice design as it exposes API internals
to the caller, it is not thread safe. By updating the global data
structure without any form (or suggestion) of locking, threads could
overwrite the same field unexpectedly.

This patch modifies the lookup logic to get rid of this stored
user_data_result. Instead, all the lookup functions how take an
addition argument: void **user_data_result.

Through this pointer the user data is returned. It's allowed to be
NULL, in this case the user data is ignored.

This is a significant API change, that affects a lot of tests and
callers. These will be updated in follow up patches.

Bug #1073.
12 years ago
Anoop Saldanha 420befb180 Changed my email address to anoopsaldanha at gmail dot com from my current one 14 years ago
Victor Julien fc248ca7a1 Many small performance updates. 15 years ago
Victor Julien bc7c9d928f Fix radix and stateful detect engine memory leaks. 16 years ago
William Metcalf ce01927515 Import of GPLv2 Header 050410 16 years ago
Victor Julien f81fccd66b Reintroduce usage of the SC_RADIX_NODE_USERDATA marco into the htp code. Rewrite the macro slightly, add unittests for the macro. 16 years ago
Brian Rectanus 4b94babf5d Add functions to radix to add ip/netblocks as string. Add macro to get node user data. Cleanup radix code, docs and printing info. Export all printing functions. 16 years ago
Pablo Rincon e7a989e305 IP Only Engine using radix trees 16 years ago
Pablo Rincon 260e581929 First version of the reputation API 16 years ago
Anoop Saldanha eea0e2a807 Radix Tree fixes/updates 16 years ago
Anoop Saldanha 96614c60f2 change the netmask to uint8_t for the ip handling part of the radix tree and also use 255 instead of -1 to indicate the absence of a netblock 16 years ago
Anoop Saldanha 7dbc117b37 Host OS Table API. Modifications also make to the radix tree to handle netblocks 16 years ago
Anoop Saldanha 590adbb3e8 Radix Tree modifications 16 years ago
Anoop Saldanha 3c21df69d2 Radix Tree structure for the engine 16 years ago