suricata
|
#include "suricata-common.h"
#include "util-cidr.h"
#include "util-debug.h"
#include "util-unittest.h"
Go to the source code of this file.
Functions | |
int | CIDRFromMask (uint32_t netmask) |
Turn 32 bit mask into CIDR. More... | |
uint32_t | CIDRGet (int cidr) |
void | CIDRGetIPv6 (int cidr, struct in6_addr *in6) |
Creates a cidr ipv6 netblock, based on the cidr netblock value. More... | |
void | UtilCIDRTests (void) |
CIDR utility functions
Definition in file util-cidr.c.
int CIDRFromMask | ( | uint32_t | netmask | ) |
Turn 32 bit mask into CIDR.
cidr | The cidr value or -1 if the netmask can't be expressed as cidr |
Definition at line 35 of file util-cidr.c.
uint32_t CIDRGet | ( | int | cidr | ) |
Definition at line 57 of file util-cidr.c.
References SCLogDebug.
void CIDRGetIPv6 | ( | int | cidr, |
struct in6_addr * | in6 | ||
) |
Creates a cidr ipv6 netblock, based on the cidr netblock value.
For example if we send a cidr of 7 as argument, an ipv6 address mask of the value FE:00:00:00:00:00:00:00 is created and updated in the argument struct in6_addr *in6.
cidr | The value of the cidr. |
in6 | Pointer to an ipv6 address structure(struct in6_addr) which will hold the cidr netblock result. |
Definition at line 82 of file util-cidr.c.
Referenced by SCRadix6AddKeyIPV6String().
void UtilCIDRTests | ( | void | ) |
Definition at line 149 of file util-cidr.c.
References UtRegisterTest().