suricata
util-bloomfilter.c File Reference
#include "suricata-common.h"
#include "util-bloomfilter.h"
#include "util-unittest.h"
Include dependency graph for util-bloomfilter.c:

Go to the source code of this file.

Functions

BloomFilterBloomFilterInit (uint32_t size, uint8_t iter, uint32_t(*Hash)(const void *, uint16_t, uint8_t, uint32_t))
 
void BloomFilterFree (BloomFilter *bf)
 
void BloomFilterPrint (BloomFilter *bf)
 
int BloomFilterAdd (BloomFilter *bf, const void *data, uint16_t datalen)
 
uint32_t BloomFilterMemoryCnt (BloomFilter *bf)
 
uint32_t BloomFilterMemorySize (BloomFilter *bf)
 
void BloomFilterRegisterTests (void)
 

Detailed Description

Author
Victor Julien victo.nosp@m.r@in.nosp@m.linia.nosp@m.c.ne.nosp@m.t

Bitwise bloom filter implementation

Definition in file util-bloomfilter.c.

Function Documentation

int BloomFilterAdd ( BloomFilter bf,
const void *  data,
uint16_t  datalen 
)

Definition at line 89 of file util-bloomfilter.c.

References BloomFilter_::bitarray, BloomFilter_::bitarray_size, BloomFilter_::Hash, and BloomFilter_::hash_iterations.

Referenced by BloomFilterMemorySize().

Here is the caller graph for this function:

void BloomFilterFree ( BloomFilter bf)

Definition at line 69 of file util-bloomfilter.c.

References BloomFilter_::bitarray, and SCFree.

Referenced by BloomFilterMemorySize().

Here is the caller graph for this function:

BloomFilter* BloomFilterInit ( uint32_t  size,
uint8_t  iter,
uint32_t(*)(const void *, uint16_t, uint8_t, uint32_t)  Hash 
)

Definition at line 30 of file util-bloomfilter.c.

References BloomFilter_::bitarray, BloomFilter_::bitarray_size, BloomFilter_::Hash, BloomFilter_::hash_iterations, SCFree, SCMalloc, and unlikely.

Referenced by BloomFilterMemorySize().

Here is the caller graph for this function:

uint32_t BloomFilterMemoryCnt ( BloomFilter bf)

Definition at line 105 of file util-bloomfilter.c.

uint32_t BloomFilterMemorySize ( BloomFilter bf)

Definition at line 113 of file util-bloomfilter.c.

References BloomFilter_::bitarray_size, BloomFilterAdd(), BloomFilterFree(), BloomFilterInit(), and BloomFilter_::Hash.

Here is the call graph for this function:

void BloomFilterPrint ( BloomFilter bf)
void BloomFilterRegisterTests ( void  )

Definition at line 275 of file util-bloomfilter.c.

References UtRegisterTest().

Here is the call graph for this function: