GNUnet  0.10.x
Data Structures | Macros | Typedefs | Functions
container_bloomfilter.c File Reference

data structure used to reduce disk accesses. More...

#include "platform.h"
#include "gnunet_util_lib.h"
Include dependency graph for container_bloomfilter.c:

Go to the source code of this file.

Data Structures

struct  GNUNET_CONTAINER_BloomFilter
 

Macros

#define LOG(kind, ...)   GNUNET_log_from(kind, "util-container-bloomfilter", __VA_ARGS__)
 
#define LOG_STRERROR(kind, syscall)   GNUNET_log_from_strerror(kind, "util-container-bloomfilter", syscall)
 
#define LOG_STRERROR_FILE(kind, syscall, filename)
 
#define BUFFSIZE   65536
 

Typedefs

typedef int(* BitIterator) (void *cls, const struct GNUNET_CONTAINER_BloomFilter *bf, unsigned int bit)
 Iterator (callback) method to be called by the bloomfilter iterator on each bit that is to be set or tested for the key. More...
 

Functions

size_t GNUNET_CONTAINER_bloomfilter_get_element_addresses (const struct GNUNET_CONTAINER_BloomFilter *bf)
 Get the number of the addresses set per element in the bloom filter. More...
 
size_t GNUNET_CONTAINER_bloomfilter_get_size (const struct GNUNET_CONTAINER_BloomFilter *bf)
 Get size of the bloom filter. More...
 
struct GNUNET_CONTAINER_BloomFilterGNUNET_CONTAINER_bloomfilter_copy (const struct GNUNET_CONTAINER_BloomFilter *bf)
 Copy an existing memory. More...
 
static void setBit (char *bitArray, unsigned int bitIdx)
 Sets a bit active in the bitArray. More...
 
static void clearBit (char *bitArray, unsigned int bitIdx)
 Clears a bit from bitArray. More...
 
static int testBit (char *bitArray, unsigned int bitIdx)
 Checks if a bit is active in the bitArray. More...
 
static void incrementBit (char *bitArray, unsigned int bitIdx, const struct GNUNET_DISK_FileHandle *fh)
 Sets a bit active in the bitArray and increments bit-specific usage counter on disk (but only if the counter was below 4 bit max (==15)). More...
 
static void decrementBit (char *bitArray, unsigned int bitIdx, const struct GNUNET_DISK_FileHandle *fh)
 Clears a bit from bitArray if the respective usage counter on the disk hits/is zero. More...
 
static int make_empty_file (const struct GNUNET_DISK_FileHandle *fh, size_t size)
 Creates a file filled with zeroes. More...
 
static void iterateBits (const struct GNUNET_CONTAINER_BloomFilter *bf, BitIterator callback, void *arg, const struct GNUNET_HashCode *key)
 Call an iterator for each bit that the bloomfilter must test or set for this element. More...
 
static int incrementBitCallback (void *cls, const struct GNUNET_CONTAINER_BloomFilter *bf, unsigned int bit)
 Callback: increment bit. More...
 
static int decrementBitCallback (void *cls, const struct GNUNET_CONTAINER_BloomFilter *bf, unsigned int bit)
 Callback: decrement bit. More...
 
static int testBitCallback (void *cls, const struct GNUNET_CONTAINER_BloomFilter *bf, unsigned int bit)
 Callback: test if all bits are set. More...
 
struct GNUNET_CONTAINER_BloomFilterGNUNET_CONTAINER_bloomfilter_load (const char *filename, size_t size, unsigned int k)
 Load a bloom-filter from a file. More...
 
struct GNUNET_CONTAINER_BloomFilterGNUNET_CONTAINER_bloomfilter_init (const char *data, size_t size, unsigned int k)
 Create a bloom filter from raw bits. More...
 
int GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct GNUNET_CONTAINER_BloomFilter *bf, char *data, size_t size)
 Copy the raw data of this bloomfilter into the given data array. More...
 
void GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter *bf)
 Free the space associated with a filter in memory, flush to drive if needed (do not free the space on the drive) More...
 
void GNUNET_CONTAINER_bloomfilter_clear (struct GNUNET_CONTAINER_BloomFilter *bf)
 Reset a bloom filter to empty. More...
 
int GNUNET_CONTAINER_bloomfilter_test (const struct GNUNET_CONTAINER_BloomFilter *bf, const struct GNUNET_HashCode *e)
 Test if an element is in the filter. More...
 
void GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter *bf, const struct GNUNET_HashCode *e)
 Add an element to the filter. More...
 
int GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf, const char *data, size_t size)
 Or the entries of the given raw data array with the data of the given bloom filter. More...
 
int GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf, const struct GNUNET_CONTAINER_BloomFilter *to_or)
 Or the entries of the given raw data array with the data of the given bloom filter. More...
 
void GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter *bf, const struct GNUNET_HashCode *e)
 Remove an element from the filter. More...
 
void GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter *bf, GNUNET_CONTAINER_HashCodeIterator iterator, void *iterator_cls, size_t size, unsigned int k)
 Resize a bloom filter. More...
 

Detailed Description

data structure used to reduce disk accesses.

The idea basically: Create a signature for each element in the database. Add those signatures to a bit array. When doing a lookup, check if the bit array matches the signature of the requested element. If yes, address the disk, otherwise return 'not found'.

A property of the bloom filter is that sometimes we will have a match even if the element is not on the disk (then we do an unnecessary disk access), but what's most important is that we never get a single "false negative".

To be able to delete entries from the bloom filter, we maintain a 4 bit counter in the file on the drive (we still use only one bit in memory).

Author
Igor Wronsky
Christian Grothoff

Definition in file container_bloomfilter.c.

Macro Definition Documentation

◆ LOG

#define LOG (   kind,
  ... 
)    GNUNET_log_from(kind, "util-container-bloomfilter", __VA_ARGS__)

Definition at line 45 of file container_bloomfilter.c.

◆ LOG_STRERROR

#define LOG_STRERROR (   kind,
  syscall 
)    GNUNET_log_from_strerror(kind, "util-container-bloomfilter", syscall)

Definition at line 48 of file container_bloomfilter.c.

◆ LOG_STRERROR_FILE

#define LOG_STRERROR_FILE (   kind,
  syscall,
  filename 
)
Value:
"util-container-bloomfilter", \
syscall, \
#define GNUNET_log_from_strerror_file(level, component, cmd, filename)
Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the mess...
static char * filename

Definition at line 51 of file container_bloomfilter.c.

Referenced by GNUNET_CONTAINER_bloomfilter_load().

◆ BUFFSIZE

#define BUFFSIZE   65536

Definition at line 304 of file container_bloomfilter.c.

Referenced by GNUNET_CONTAINER_bloomfilter_load(), and make_empty_file().

Typedef Documentation

◆ BitIterator

typedef int(* BitIterator) (void *cls, const struct GNUNET_CONTAINER_BloomFilter *bf, unsigned int bit)

Iterator (callback) method to be called by the bloomfilter iterator on each bit that is to be set or tested for the key.

Parameters
clsclosure
bfthe filter to manipulate
bitthe current bit
Returns
GNUNET_YES to continue, GNUNET_NO to stop early

Definition at line 356 of file container_bloomfilter.c.

Function Documentation

◆ GNUNET_CONTAINER_bloomfilter_get_element_addresses()

size_t GNUNET_CONTAINER_bloomfilter_get_element_addresses ( const struct GNUNET_CONTAINER_BloomFilter bf)

Get the number of the addresses set per element in the bloom filter.

Parameters
bfthe filter
Returns
addresses set per element in the bf

Definition at line 92 of file container_bloomfilter.c.

References GNUNET_CONTAINER_BloomFilter::addressesPerElement.

94 {
95  if (bf == NULL)
96  return 0;
97  return bf->addressesPerElement;
98 }
unsigned int addressesPerElement
How many bits we set for each stored element.

◆ setBit()

static void setBit ( char *  bitArray,
unsigned int  bitIdx 
)
static

Sets a bit active in the bitArray.

Increment bit-specific usage counter on disk only if below 4bit max (==15).

Parameters
bitArraymemory area to set the bit in
bitIdxwhich bit to set

Definition at line 141 of file container_bloomfilter.c.

Referenced by GNUNET_CONTAINER_bloomfilter_load(), and incrementBit().

142 {
143  size_t arraySlot;
144  unsigned int targetBit;
145 
146  arraySlot = bitIdx / 8;
147  targetBit = (1L << (bitIdx % 8));
148  bitArray[arraySlot] |= targetBit;
149 }
Here is the caller graph for this function:

◆ clearBit()

static void clearBit ( char *  bitArray,
unsigned int  bitIdx 
)
static

Clears a bit from bitArray.

Bit is cleared from the array only if the respective usage counter on the disk hits/is zero.

Parameters
bitArraymemory area to set the bit in
bitIdxwhich bit to unset

Definition at line 159 of file container_bloomfilter.c.

Referenced by decrementBit().

160 {
161  size_t slot;
162  unsigned int targetBit;
163 
164  slot = bitIdx / 8;
165  targetBit = (1L << (bitIdx % 8));
166  bitArray[slot] = bitArray[slot] & (~targetBit);
167 }
Here is the caller graph for this function:

◆ testBit()

static int testBit ( char *  bitArray,
unsigned int  bitIdx 
)
static

Checks if a bit is active in the bitArray.

Parameters
bitArraymemory area to set the bit in
bitIdxwhich bit to test
Returns
GNUNET_YES if the bit is set, GNUNET_NO if not.

Definition at line 177 of file container_bloomfilter.c.

References GNUNET_NO, and GNUNET_YES.

Referenced by testBitCallback().

178 {
179  size_t slot;
180  unsigned int targetBit;
181 
182  slot = bitIdx / 8;
183  targetBit = (1L << (bitIdx % 8));
184  if (bitArray[slot] & targetBit)
185  return GNUNET_YES;
186  else
187  return GNUNET_NO;
188 }
#define GNUNET_NO
Definition: gnunet_common.h:78
#define GNUNET_YES
Definition: gnunet_common.h:77
Here is the caller graph for this function:

◆ incrementBit()

static void incrementBit ( char *  bitArray,
unsigned int  bitIdx,
const struct GNUNET_DISK_FileHandle fh 
)
static

Sets a bit active in the bitArray and increments bit-specific usage counter on disk (but only if the counter was below 4 bit max (==15)).

Parameters
bitArraymemory area to set the bit in
bitIdxwhich bit to test
fhA file to keep the 4 bit address usage counters in

Definition at line 200 of file container_bloomfilter.c.

References GNUNET_assert, GNUNET_DISK_file_read(), GNUNET_DISK_file_seek(), GNUNET_DISK_file_write(), GNUNET_DISK_handle_invalid(), GNUNET_DISK_SEEK_SET, setBit(), and value.

Referenced by incrementBitCallback().

203 {
204  off_t fileSlot;
205  unsigned char value;
206  unsigned int high;
207  unsigned int low;
208  unsigned int targetLoc;
209 
210  setBit(bitArray, bitIdx);
212  return;
213  /* Update the counter file on disk */
214  fileSlot = bitIdx / 2;
215  targetLoc = bitIdx % 2;
216 
217  GNUNET_assert(fileSlot ==
219  if (1 != GNUNET_DISK_file_read(fh, &value, 1))
220  value = 0;
221  low = value & 0xF;
222  high = (value & (~0xF)) >> 4;
223 
224  if (targetLoc == 0)
225  {
226  if (low < 0xF)
227  low++;
228  }
229  else
230  {
231  if (high < 0xF)
232  high++;
233  }
234  value = ((high << 4) | low);
235  GNUNET_assert(fileSlot ==
237  GNUNET_assert(1 == GNUNET_DISK_file_write(fh, &value, 1));
238 }
ssize_t GNUNET_DISK_file_read(const struct GNUNET_DISK_FileHandle *h, void *result, size_t len)
Read the contents of a binary file into a buffer.
Definition: disk.c:729
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
off_t GNUNET_DISK_file_seek(const struct GNUNET_DISK_FileHandle *h, off_t offset, enum GNUNET_DISK_Seek whence)
Move the read/write pointer in a file.
Definition: disk.c:223
int GNUNET_DISK_handle_invalid(const struct GNUNET_DISK_FileHandle *h)
Checks whether a handle is invalid.
Definition: disk.c:190
static char * value
Value of the record to add/remove.
ssize_t GNUNET_DISK_file_write(const struct GNUNET_DISK_FileHandle *h, const void *buffer, size_t n)
Write a buffer to a file.
Definition: disk.c:817
static void setBit(char *bitArray, unsigned int bitIdx)
Sets a bit active in the bitArray.
Seek an absolute position (from the start of the file).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ decrementBit()

static void decrementBit ( char *  bitArray,
unsigned int  bitIdx,
const struct GNUNET_DISK_FileHandle fh 
)
static

Clears a bit from bitArray if the respective usage counter on the disk hits/is zero.

Parameters
bitArraymemory area to set the bit in
bitIdxwhich bit to test
fhA file to keep the 4bit address usage counters in

Definition at line 249 of file container_bloomfilter.c.

References clearBit(), GNUNET_assert, GNUNET_DISK_file_read(), GNUNET_DISK_file_seek(), GNUNET_DISK_file_write(), GNUNET_DISK_handle_invalid(), GNUNET_DISK_SEEK_SET, GNUNET_ERROR_TYPE_ERROR, GNUNET_log_strerror, GNUNET_SYSERR, and value.

Referenced by decrementBitCallback().

252 {
253  off_t fileslot;
254  unsigned char value;
255  unsigned int high;
256  unsigned int low;
257  unsigned int targetLoc;
258 
260  return; /* cannot decrement! */
261  /* Each char slot in the counter file holds two 4 bit counters */
262  fileslot = bitIdx / 2;
263  targetLoc = bitIdx % 2;
264  if (GNUNET_SYSERR ==
266  {
268  return;
269  }
270  if (1 != GNUNET_DISK_file_read(fh, &value, 1))
271  value = 0;
272  low = value & 0xF;
273  high = (value & 0xF0) >> 4;
274 
275  /* decrement, but once we have reached the max, never go back! */
276  if (targetLoc == 0)
277  {
278  if ((low > 0) && (low < 0xF))
279  low--;
280  if (low == 0)
281  {
282  clearBit(bitArray, bitIdx);
283  }
284  }
285  else
286  {
287  if ((high > 0) && (high < 0xF))
288  high--;
289  if (high == 0)
290  {
291  clearBit(bitArray, bitIdx);
292  }
293  }
294  value = ((high << 4) | low);
295  if (GNUNET_SYSERR ==
297  {
299  return;
300  }
301  GNUNET_assert(1 == GNUNET_DISK_file_write(fh, &value, 1));
302 }
ssize_t GNUNET_DISK_file_read(const struct GNUNET_DISK_FileHandle *h, void *result, size_t len)
Read the contents of a binary file into a buffer.
Definition: disk.c:729
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
off_t GNUNET_DISK_file_seek(const struct GNUNET_DISK_FileHandle *h, off_t offset, enum GNUNET_DISK_Seek whence)
Move the read/write pointer in a file.
Definition: disk.c:223
int GNUNET_DISK_handle_invalid(const struct GNUNET_DISK_FileHandle *h)
Checks whether a handle is invalid.
Definition: disk.c:190
#define GNUNET_log_strerror(level, cmd)
Log an error message at log-level &#39;level&#39; that indicates a failure of the command &#39;cmd&#39; with the mess...
static void clearBit(char *bitArray, unsigned int bitIdx)
Clears a bit from bitArray.
static char * value
Value of the record to add/remove.
ssize_t GNUNET_DISK_file_write(const struct GNUNET_DISK_FileHandle *h, const void *buffer, size_t n)
Write a buffer to a file.
Definition: disk.c:817
#define GNUNET_SYSERR
Definition: gnunet_common.h:76
Seek an absolute position (from the start of the file).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_empty_file()

static int make_empty_file ( const struct GNUNET_DISK_FileHandle fh,
size_t  size 
)
static

Creates a file filled with zeroes.

Parameters
fhthe file handle
sizethe size of the file
Returns
GNUNET_OK if created ok, GNUNET_SYSERR otherwise

Definition at line 314 of file container_bloomfilter.c.

References BUFFSIZE, GNUNET_DISK_file_seek(), GNUNET_DISK_file_write(), GNUNET_DISK_handle_invalid(), GNUNET_DISK_SEEK_SET, GNUNET_OK, GNUNET_SYSERR, res, and size.

Referenced by GNUNET_CONTAINER_bloomfilter_clear(), GNUNET_CONTAINER_bloomfilter_load(), and GNUNET_CONTAINER_bloomfilter_resize().

315 {
316  char buffer[BUFFSIZE];
317  size_t bytesleft = size;
318  int res = 0;
319 
321  return GNUNET_SYSERR;
322  memset(buffer, 0, sizeof(buffer));
324  while (bytesleft > 0)
325  {
326  if (bytesleft > sizeof(buffer))
327  {
328  res = GNUNET_DISK_file_write(fh, buffer, sizeof(buffer));
329  if (res >= 0)
330  bytesleft -= res;
331  }
332  else
333  {
334  res = GNUNET_DISK_file_write(fh, buffer, bytesleft);
335  if (res >= 0)
336  bytesleft -= res;
337  }
338  if (GNUNET_SYSERR == res)
339  return GNUNET_SYSERR;
340  }
341  return GNUNET_OK;
342 }
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
off_t GNUNET_DISK_file_seek(const struct GNUNET_DISK_FileHandle *h, off_t offset, enum GNUNET_DISK_Seek whence)
Move the read/write pointer in a file.
Definition: disk.c:223
int GNUNET_DISK_handle_invalid(const struct GNUNET_DISK_FileHandle *h)
Checks whether a handle is invalid.
Definition: disk.c:190
ssize_t GNUNET_DISK_file_write(const struct GNUNET_DISK_FileHandle *h, const void *buffer, size_t n)
Write a buffer to a file.
Definition: disk.c:817
static int res
#define GNUNET_SYSERR
Definition: gnunet_common.h:76
static unsigned int size
Size of the "table".
Definition: peer.c:66
Seek an absolute position (from the start of the file).
#define BUFFSIZE
Here is the call graph for this function:
Here is the caller graph for this function:

◆ iterateBits()

static void iterateBits ( const struct GNUNET_CONTAINER_BloomFilter bf,
BitIterator  callback,
void *  arg,
const struct GNUNET_HashCode key 
)
static

Call an iterator for each bit that the bloomfilter must test or set for this element.

Parameters
bfthe filter
callbackthe method to call
argextra argument to callback
keythe key for which we iterate over the BF bits

Definition at line 371 of file container_bloomfilter.c.

References GNUNET_CONTAINER_BloomFilter::addressesPerElement, GNUNET_CONTAINER_BloomFilter::bitArraySize, GNUNET_assert, GNUNET_CRYPTO_hash(), GNUNET_YES, and key.

Referenced by GNUNET_CONTAINER_bloomfilter_add(), GNUNET_CONTAINER_bloomfilter_remove(), and GNUNET_CONTAINER_bloomfilter_test().

375 {
376  struct GNUNET_HashCode tmp[2];
377  int bitCount;
378  unsigned int round;
379  unsigned int slot = 0;
380 
381  bitCount = bf->addressesPerElement;
382  tmp[0] = *key;
383  round = 0;
384  GNUNET_assert(bf->bitArraySize > 0);
385  GNUNET_assert(bf->bitArraySize * 8LL > bf->bitArraySize);
386  while (bitCount > 0)
387  {
388  while (slot < (sizeof(struct GNUNET_HashCode) / sizeof(uint32_t)))
389  {
390  if (GNUNET_YES !=
391  callback(arg,
392  bf,
393  ntohl((((uint32_t *)&tmp[round & 1])[slot])) %
394  ((bf->bitArraySize * 8LL))))
395  return;
396  slot++;
397  bitCount--;
398  if (bitCount == 0)
399  break;
400  }
401  if (bitCount > 0)
402  {
403  GNUNET_CRYPTO_hash(&tmp[round & 1],
404  sizeof(struct GNUNET_HashCode),
405  &tmp[(round + 1) & 1]);
406  round++;
407  slot = 0;
408  }
409  }
410 }
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
unsigned int addressesPerElement
How many bits we set for each stored element.
void GNUNET_CRYPTO_hash(const void *block, size_t size, struct GNUNET_HashCode *ret)
Compute hash of a given block.
Definition: crypto_hash.c:44
size_t bitArraySize
Size of bitArray in bytes.
A 512-bit hashcode.
struct GNUNET_HashCode key
The key used in the DHT.
#define GNUNET_YES
Definition: gnunet_common.h:77
Here is the call graph for this function:
Here is the caller graph for this function:

◆ incrementBitCallback()

static int incrementBitCallback ( void *  cls,
const struct GNUNET_CONTAINER_BloomFilter bf,
unsigned int  bit 
)
static

Callback: increment bit.

Parameters
clspointer to writeable form of bf
bfthe filter to manipulate
bitthe bit to increment
Returns
GNUNET_YES

Definition at line 422 of file container_bloomfilter.c.

References GNUNET_CONTAINER_BloomFilter::bitArray, GNUNET_CONTAINER_BloomFilter::fh, GNUNET_YES, and incrementBit().

Referenced by GNUNET_CONTAINER_bloomfilter_add().

425 {
426  struct GNUNET_CONTAINER_BloomFilter *b = cls;
427 
428  incrementBit(b->bitArray, bit, bf->fh);
429  return GNUNET_YES;
430 }
char * bitArray
The actual bloomfilter bit array.
struct GNUNET_DISK_FileHandle * fh
The bit counter file on disk.
static void incrementBit(char *bitArray, unsigned int bitIdx, const struct GNUNET_DISK_FileHandle *fh)
Sets a bit active in the bitArray and increments bit-specific usage counter on disk (but only if the ...
#define GNUNET_YES
Definition: gnunet_common.h:77
Here is the call graph for this function:
Here is the caller graph for this function:

◆ decrementBitCallback()

static int decrementBitCallback ( void *  cls,
const struct GNUNET_CONTAINER_BloomFilter bf,
unsigned int  bit 
)
static

Callback: decrement bit.

Parameters
clspointer to writeable form of bf
bfthe filter to manipulate
bitthe bit to decrement
Returns
GNUNET_YES

Definition at line 442 of file container_bloomfilter.c.

References GNUNET_CONTAINER_BloomFilter::bitArray, decrementBit(), GNUNET_CONTAINER_BloomFilter::fh, and GNUNET_YES.

Referenced by GNUNET_CONTAINER_bloomfilter_remove().

445 {
446  struct GNUNET_CONTAINER_BloomFilter *b = cls;
447 
448  decrementBit(b->bitArray, bit, bf->fh);
449  return GNUNET_YES;
450 }
static void decrementBit(char *bitArray, unsigned int bitIdx, const struct GNUNET_DISK_FileHandle *fh)
Clears a bit from bitArray if the respective usage counter on the disk hits/is zero.
char * bitArray
The actual bloomfilter bit array.
struct GNUNET_DISK_FileHandle * fh
The bit counter file on disk.
#define GNUNET_YES
Definition: gnunet_common.h:77
Here is the call graph for this function:
Here is the caller graph for this function:

◆ testBitCallback()

static int testBitCallback ( void *  cls,
const struct GNUNET_CONTAINER_BloomFilter bf,
unsigned int  bit 
)
static

Callback: test if all bits are set.

Parameters
clspointer set to GNUNET_NO if bit is not set
bfthe filter
bitthe bit to test
Returns
YES if the bit is set, NO if not

Definition at line 462 of file container_bloomfilter.c.

References find_typedefs::arg, GNUNET_CONTAINER_BloomFilter::bitArray, GNUNET_NO, GNUNET_YES, and testBit().

Referenced by GNUNET_CONTAINER_bloomfilter_test().

465 {
466  int *arg = cls;
467 
468  if (GNUNET_NO == testBit(bf->bitArray, bit))
469  {
470  *arg = GNUNET_NO;
471  return GNUNET_NO;
472  }
473  return GNUNET_YES;
474 }
#define GNUNET_NO
Definition: gnunet_common.h:78
char * bitArray
The actual bloomfilter bit array.
static int testBit(char *bitArray, unsigned int bitIdx)
Checks if a bit is active in the bitArray.
#define GNUNET_YES
Definition: gnunet_common.h:77
Here is the call graph for this function:
Here is the caller graph for this function: