fallbackdir: Update list generated on August 30, 2023
[tor.git] / src / core / or / address_set.h
blob3c5b55cf5f0962bc3affd5b16aa5d7d582c15875
1 /* Copyright (c) 2018-2021, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
4 /**
5 * \file address_set.h
6 * \brief Types to handle sets of addresses.
7 **/
9 #ifndef TOR_ADDRESS_SET_H
10 #define TOR_ADDRESS_SET_H
12 #include "orconfig.h"
13 #include "lib/cc/torint.h"
14 #include "lib/container/bloomfilt.h"
16 struct tor_addr_t;
18 /**
19 * An address_set_t represents a set of tor_addr_t values. The implementation
20 * is probabilistic: false negatives cannot occur but false positives are
21 * possible.
23 typedef struct bloomfilt_t address_set_t;
25 address_set_t *address_set_new(int max_addresses_guess);
26 #define address_set_free(set) bloomfilt_free(set)
27 void address_set_add(address_set_t *set, const struct tor_addr_t *addr);
28 void address_set_add_ipv4h(address_set_t *set, uint32_t addr);
29 int address_set_probably_contains(const address_set_t *set,
30 const struct tor_addr_t *addr);
32 #endif /* !defined(TOR_ADDRESS_SET_H) */