Tor
0.4.6.0-alpha-dev
core
or
address_set.h
Go to the documentation of this file.
1
/* Copyright (c) 2018-2020, The Tor Project, Inc. */
2
/* See LICENSE for licensing information */
3
4
/**
5
* \file address_set.h
6
* \brief Types to handle sets of addresses.
7
**/
8
9
#ifndef TOR_ADDRESS_SET_H
10
#define TOR_ADDRESS_SET_H
11
12
#include "orconfig.h"
13
#include "
lib/cc/torint.h
"
14
#include "
lib/container/bloomfilt.h
"
15
16
/**
17
* An address_set_t represents a set of tor_addr_t values. The implementation
18
* is probabilistic: false negatives cannot occur but false positives are
19
* possible.
20
*/
21
typedef
struct
bloomfilt_t
address_set_t;
22
struct
tor_addr_t
;
23
24
address_set_t *
address_set_new
(
int
max_addresses_guess);
25
#define address_set_free(set) bloomfilt_free(set)
26
void
address_set_add
(address_set_t *set,
const
struct
tor_addr_t
*addr);
27
void
address_set_add_ipv4h
(address_set_t *set, uint32_t addr);
28
int
address_set_probably_contains
(
const
address_set_t *set,
29
const
struct
tor_addr_t
*addr);
30
31
#endif
/* !defined(TOR_ADDRESS_SET_H) */
tor_addr_t
Definition:
address.h:69
address_set_probably_contains
int address_set_probably_contains(const address_set_t *set, const struct tor_addr_t *addr)
Definition:
address_set.c:67
torint.h
Integer definitions used throughout Tor.
address_set_add_ipv4h
void address_set_add_ipv4h(address_set_t *set, uint32_t addr)
Definition:
address_set.c:55
bloomfilt_t
Definition:
bloomfilt.c:24
bloomfilt.h
Header for bloomfilt.c.
address_set_new
address_set_t * address_set_new(int max_addresses_guess)
Definition:
address_set.c:34
address_set_add
void address_set_add(address_set_t *set, const struct tor_addr_t *addr)
Definition:
address_set.c:48
Generated by
1.8.20