Macros | Functions
address_set.h File Reference

Types to handle sets of addresses. More...

#include "orconfig.h"
#include "lib/cc/torint.h"
#include "lib/container/bloomfilt.h"

Go to the source code of this file.


#define address_set_free(set)   bloomfilt_free(set)


address_set_t * address_set_new (int max_addresses_guess)
void address_set_add (address_set_t *set, const struct tor_addr_t *addr)
void address_set_add_ipv4h (address_set_t *set, uint32_t addr)
int address_set_probably_contains (const address_set_t *set, const struct tor_addr_t *addr)

Detailed Description

Types to handle sets of addresses.

Definition in file address_set.h.

Macro Definition Documentation

◆ address_set_free

#define address_set_free (   set)    bloomfilt_free(set)

Definition at line 26 of file address_set.h.

Function Documentation

◆ address_set_add()

void address_set_add ( address_set_t *  set,
const struct tor_addr_t addr 

Add addr to set.

All future queries for addr in set will return true. Removing items is not possible.

Definition at line 47 of file address_set.c.

Referenced by address_set_add_ipv4h().

◆ address_set_add_ipv4h()

void address_set_add_ipv4h ( address_set_t *  set,
uint32_t  addr 

As address_set_add(), but take an ipv4 address in host order.

Definition at line 54 of file address_set.c.

◆ address_set_new()

address_set_t * address_set_new ( int  max_addresses_guess)

Allocate and return an address_set, suitable for holding up to max_address_guess distinct values.

Definition at line 33 of file address_set.c.

◆ address_set_probably_contains()

int address_set_probably_contains ( const address_set_t *  set,
const struct tor_addr_t addr 

Return true if addr is a member of set. (And probably, return false if addr is not a member of set.)

Definition at line 66 of file address_set.c.