diff options
author | David Goulet <dgoulet@torproject.org> | 2021-02-03 08:44:19 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2021-02-03 08:44:19 -0500 |
commit | 0968c40e36f7cb73ceb7d5761c329ac37692429e (patch) | |
tree | cc779b61ba12d4d8ae79c60f5d216068194caae5 /src/core/or/address_set.h | |
parent | c51ce99da644d50c8d81e1a56d87fea1b71b924e (diff) | |
parent | 705fd37875c4acd61037da6a2680678ae128e4a4 (diff) | |
download | tor-0968c40e36f7cb73ceb7d5761c329ac37692429e.tar.gz tor-0968c40e36f7cb73ceb7d5761c329ac37692429e.zip |
Merge branch 'maint-0.4.3' into release-0.4.3
Diffstat (limited to 'src/core/or/address_set.h')
-rw-r--r-- | src/core/or/address_set.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/core/or/address_set.h b/src/core/or/address_set.h index 33887a7c9e..2c78ab0576 100644 --- a/src/core/or/address_set.h +++ b/src/core/or/address_set.h @@ -13,13 +13,14 @@ #include "lib/cc/torint.h" #include "lib/container/bloomfilt.h" +struct tor_addr_t; + /** * An address_set_t represents a set of tor_addr_t values. The implementation * is probabilistic: false negatives cannot occur but false positives are * possible. */ typedef struct bloomfilt_t address_set_t; -struct tor_addr_t; address_set_t *address_set_new(int max_addresses_guess); #define address_set_free(set) bloomfilt_free(set) @@ -28,4 +29,19 @@ 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); +/** + * An addr_port_set_t represents a set of tor_addr_t values with a uint16_t + * port value. The implementation is probabilistic: false negatives cannot + * occur but false positives are possible. + */ +typedef struct bloomfilt_t addr_port_set_t; + +addr_port_set_t *addr_port_set_new(int max_addresses_guess); +#define addr_port_set_free(s) bloomfilt_free(s) +void addr_port_set_add(addr_port_set_t *set, + const struct tor_addr_t *addr, uint16_t port); +bool addr_port_set_probably_contains(const addr_port_set_t *set, + const struct tor_addr_t *addr, + uint16_t port); + #endif /* !defined(TOR_ADDRESS_SET_H) */ |