28#ifndef GNUNET_SERVICE_SETU_STRATA_ESTIMATOR_H
29#define GNUNET_SERVICE_SETU_STRATA_ESTIMATOR_H
88 uint64_t element_count);
100 uint16_t se_ibf_total_size,
101 uint8_t number_se_send,
119 uint8_t number_se_received,
120 uint16_t se_ibf_total_size,
135 uint8_t ibf_hashnum);
struct GNUNET_HashCode key
The key used in the DHT.
struct MultiStrataEstimator * strata_estimator_dup(struct MultiStrataEstimator *se)
Make a copy of a strata estimator.
size_t strata_estimator_write(struct MultiStrataEstimator *se, uint16_t se_ibf_total_size, uint8_t number_se_send, void *buf)
Write the given strata estimator to the buffer.
void strata_estimator_destroy(struct MultiStrataEstimator *se)
Destroy a strata estimator, free all of its resources.
uint8_t determine_strata_count(uint64_t avg_element_size, uint64_t element_count)
Deteminate how many strata estimators in the message are necessary.
int strata_estimator_read(const void *buf, size_t buf_len, int is_compressed, uint8_t number_se_received, uint16_t se_ibf_total_size, struct MultiStrataEstimator *se)
Read strata from the buffer into the given strata estimator.
void strata_estimator_insert(struct MultiStrataEstimator *se, struct IBF_Key key)
Add a key to the strata estimator.
void strata_estimator_difference(const struct MultiStrataEstimator *se1, const struct MultiStrataEstimator *se2)
Get an estimation of the symmetric difference of the elements contained in both strata estimators.
struct MultiStrataEstimator * strata_estimator_create(unsigned int strata_count, uint32_t ibf_size, uint8_t ibf_hashnum)
Create a new strata estimator with the given parameters.
void strata_estimator_remove(struct MultiStrataEstimator *se, struct IBF_Key key)
Remove a key from the strata estimator.
static unsigned int ibf_size
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
Keys that can be inserted into and removed from an IBF.
Invertible bloom filter (IBF).
uint8_t size
Number of strata estimators in struct.
struct StrataEstimator ** stratas
Array of strata estimators.
A handle to a strata estimator.
unsigned int ibf_size
Size of each IBF stratum (in bytes)
struct InvertibleBloomFilter ** strata
The IBFs of this strata estimator.
unsigned int strata_count
Size of the IBF array in strata.