suricata
|
#include "suricata-common.h"
Go to the source code of this file.
Data Structures | |
struct | SCRadix6Node_ |
Structure for the node in the radix tree. More... | |
struct | SCRadix6Tree_ |
Structure for the radix tree. More... | |
struct | SCRadix6Config_ |
Macros | |
#define | SC_RADIX6_TREE_INITIALIZER |
Typedefs | |
typedef struct SCRadix6Node_ | SCRadix6Node |
Structure for the node in the radix tree. More... | |
typedef struct SCRadix6Tree_ | SCRadix6Tree |
Structure for the radix tree. More... | |
typedef struct SCRadix6Config_ | SCRadix6Config |
typedef int(* | SCRadix6ForEachNodeFunc) (const SCRadix6Node *node, void *user_data, const uint8_t netmask, void *data) |
typedef bool(* | SCRadix6TreeCompareFunc) (const void *ud1, const void *ud2) |
compare content of 2 user data entries More... | |
Functions | |
SCRadix6Tree | SCRadix6TreeInitialize (void) |
void | SCRadix6TreeRelease (SCRadix6Tree *, const SCRadix6Config *) |
SCRadix6Node * | SCRadix6AddKeyIPV6 (SCRadix6Tree *, const SCRadix6Config *, const uint8_t *, void *) |
Adds a new IPV6 address to the Radix6 tree. More... | |
SCRadix6Node * | SCRadix6AddKeyIPV6Netblock (SCRadix6Tree *, const SCRadix6Config *, const uint8_t *, uint8_t, void *) |
Adds a new IPV6 netblock to the Radix6 tree. More... | |
bool | SCRadix6AddKeyIPV6String (SCRadix6Tree *, const SCRadix6Config *, const char *, void *) |
Adds a new IPV6/netblock to the Radix6 tree from a string. More... | |
void | SCRadix6RemoveKeyIPV6Netblock (SCRadix6Tree *, const SCRadix6Config *, const uint8_t *, uint8_t) |
Removes an IPV6 address netblock key from the tree. More... | |
void | SCRadix6RemoveKeyIPV6 (SCRadix6Tree *, const SCRadix6Config *, const uint8_t *) |
Removes an IPV6 address key(not a netblock) from the Radix6 tree. Instead of using this function, we can also used SCRadix6RemoveKeyIPV6Netblock(), by supplying a netmask value of 32. More... | |
SCRadix6Node * | SCRadix6TreeFindExactMatch (const SCRadix6Tree *, const uint8_t *, void **) |
SCRadix6Node * | SCRadix6TreeFindNetblock (const SCRadix6Tree *, const uint8_t *, const uint8_t, void **) |
SCRadix6Node * | SCRadix6TreeFindBestMatch (const SCRadix6Tree *, const uint8_t *, void **) |
SCRadix6Node * | SCRadix6TreeFindBestMatch2 (const SCRadix6Tree *, const uint8_t *, void **, uint8_t *) |
void | SCRadix6PrintTree (SCRadix6Tree *, const SCRadix6Config *) |
void | SCRadix6PrintNodeInfo (SCRadix6Node *, int, void(*PrintData)(void *)) |
void | SCRadix6RegisterTests (void) |
int | SCRadix6ForEachNode (const SCRadix6Tree *tree, SCRadix6ForEachNodeFunc Callback, void *data) |
bool | SCRadix6CompareTrees (const SCRadix6Tree *t1, const SCRadix6Tree *t2, SCRadix6TreeCompareFunc Callback) |
Definition in file util-radix6-tree.h.
#define SC_RADIX6_TREE_INITIALIZER |
Definition at line 77 of file util-radix6-tree.h.
typedef struct SCRadix6Config_ SCRadix6Config |
typedef int(* SCRadix6ForEachNodeFunc) (const SCRadix6Node *node, void *user_data, const uint8_t netmask, void *data) |
Definition at line 104 of file util-radix6-tree.h.
typedef struct SCRadix6Node_ SCRadix6Node |
Structure for the node in the radix tree.
typedef struct SCRadix6Tree_ SCRadix6Tree |
Structure for the radix tree.
typedef bool(* SCRadix6TreeCompareFunc) (const void *ud1, const void *ud2) |
compare content of 2 user data entries
true | equal |
false | not equal |
Definition at line 113 of file util-radix6-tree.h.
SCRadix6Node* SCRadix6AddKeyIPV6 | ( | SCRadix6Tree * | tree, |
const SCRadix6Config * | config, | ||
const uint8_t * | key_stream, | ||
void * | user | ||
) |
Adds a new IPV6 address to the Radix6 tree.
key_stream | Data that has to be added to the Radix6 tree. In this case a pointer to an IPV6 address |
tree | Pointer to the Radix6 tree |
user | Pointer to the user data that has to be associated with the key |
node | Pointer to the newly created node |
Definition at line 196 of file util-radix6-tree.c.
SCRadix6Node* SCRadix6AddKeyIPV6Netblock | ( | SCRadix6Tree * | tree, |
const SCRadix6Config * | config, | ||
const uint8_t * | key_stream, | ||
uint8_t | netmask, | ||
void * | user | ||
) |
Adds a new IPV6 netblock to the Radix6 tree.
key_stream | Data that has to be added to the Radix6 tree. In this case a pointer to an IPV6 netblock |
tree | Pointer to the Radix6 tree |
user | Pointer to the user data that has to be associated with the key |
netmask | The netmask (cidr) if we are adding a netblock |
node | Pointer to the newly created node |
Definition at line 214 of file util-radix6-tree.c.
bool SCRadix6AddKeyIPV6String | ( | SCRadix6Tree * | tree, |
const SCRadix6Config * | config, | ||
const char * | str, | ||
void * | user | ||
) |
Adds a new IPV6/netblock to the Radix6 tree from a string.
str | IPV6 string with optional /cidr netmask |
tree | Pointer to the Radix6 tree |
user | Pointer to the user data that has to be associated with the key |
bool | true if node was added, false otherwise |
If the function returns false, sc_errno
is set:
Definition at line 262 of file util-radix6-tree.c.
References CIDRGetIPv6(), PrintInet(), SC_EINVAL, sc_errno, SCLogWarning, str, StringParseU8RangeCheck(), and strlcpy().
bool SCRadix6CompareTrees | ( | const SCRadix6Tree * | t1, |
const SCRadix6Tree * | t2, | ||
SCRadix6TreeCompareFunc | Callback | ||
) |
Definition at line 418 of file util-radix6-tree.c.
int SCRadix6ForEachNode | ( | const SCRadix6Tree * | tree, |
SCRadix6ForEachNodeFunc | Callback, | ||
void * | data | ||
) |
Definition at line 411 of file util-radix6-tree.c.
References SCRadix6Tree_::head.
void SCRadix6PrintNodeInfo | ( | SCRadix6Node * | , |
int | , | ||
void(*)(void *) | PrintData | ||
) |
void SCRadix6PrintTree | ( | SCRadix6Tree * | , |
const SCRadix6Config * | |||
) |
Definition at line 355 of file util-radix6-tree.c.
void SCRadix6RegisterTests | ( | void | ) |
Definition at line 946 of file util-radix6-tree.c.
References UtRegisterTest().
void SCRadix6RemoveKeyIPV6 | ( | SCRadix6Tree * | tree, |
const SCRadix6Config * | config, | ||
const uint8_t * | key_stream | ||
) |
Removes an IPV6 address key(not a netblock) from the Radix6 tree. Instead of using this function, we can also used SCRadix6RemoveKeyIPV6Netblock(), by supplying a netmask value of 32.
key_stream | Data that has to be removed from the Radix6 tree. In this case an IPV6 address |
tree | Pointer to the Radix6 tree from which the key has to be removed |
Definition at line 335 of file util-radix6-tree.c.
void SCRadix6RemoveKeyIPV6Netblock | ( | SCRadix6Tree * | tree, |
const SCRadix6Config * | config, | ||
const uint8_t * | key_stream, | ||
uint8_t | netmask | ||
) |
Removes an IPV6 address netblock key from the tree.
key_stream | Data that has to be removed from the tree. In this case an IPV6 address with netmask. |
tree | Pointer to the tree from which the key has to be removed |
Definition at line 349 of file util-radix6-tree.c.
SCRadix6Node* SCRadix6TreeFindBestMatch | ( | const SCRadix6Tree * | , |
const uint8_t * | , | ||
void ** | |||
) |
Definition at line 173 of file util-radix6-tree.c.
Referenced by IPOnlyMatchPacket(), and SCHInfoGetIPv6HostOSFlavour().
SCRadix6Node* SCRadix6TreeFindBestMatch2 | ( | const SCRadix6Tree * | , |
const uint8_t * | , | ||
void ** | , | ||
uint8_t * | |||
) |
Definition at line 179 of file util-radix6-tree.c.
SCRadix6Node* SCRadix6TreeFindExactMatch | ( | const SCRadix6Tree * | , |
const uint8_t * | , | ||
void ** | |||
) |
Definition at line 161 of file util-radix6-tree.c.
SCRadix6Node* SCRadix6TreeFindNetblock | ( | const SCRadix6Tree * | , |
const uint8_t * | , | ||
const uint8_t | , | ||
void ** | |||
) |
Definition at line 167 of file util-radix6-tree.c.
SCRadix6Tree SCRadix6TreeInitialize | ( | void | ) |
Definition at line 360 of file util-radix6-tree.c.
References SC_RADIX6_TREE_INITIALIZER.
Referenced by IPOnlyInit(), and SRepInit().
void SCRadix6TreeRelease | ( | SCRadix6Tree * | , |
const SCRadix6Config * | |||
) |
Definition at line 366 of file util-radix6-tree.c.