35 #define LOG(kind, ...) GNUNET_log_from (kind, "rps-sampler_elem", __VA_ARGS__) 129 "Got PeerID %s; Simply accepting (was empty previously).\n",
131 sampler_elem->
peer_id = *new_ID;
141 sampler_elem->
peer_id = *new_ID;
uint32_t num_peers
How many times a PeerID was put in this sampler.
struct GNUNET_TIME_Absolute birth
'Birth'
#define GNUNET_CRYPTO_HASH_LENGTH
Length of a hash value.
A sampler element sampling one PeerID at a time.
void RPS_sampler_elem_destroy(struct RPS_SamplerElement *sampler_elem)
Destroy a sampler element.
Some utils faciliating the view into the internals for the sampler needed for evaluation.
void RPS_sampler_elem_set(struct RPS_SamplerElement *sampler_elem, struct GNUNET_CRYPTO_AuthKey auth_key)
Set the min-wise independent function of the given sampler element.
sampler element implementation
struct RPS_SamplerElement * RPS_sampler_elem_create(void)
Create a sampler element and initialise it.
struct GNUNET_TIME_Absolute last_client_request
Time of last request.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
void RPS_sampler_elem_reinit(struct RPS_SamplerElement *sampler_elem)
Reinitialise a previously initialised sampler element.
void GNUNET_CRYPTO_hmac(const struct GNUNET_CRYPTO_AuthKey *key, const void *plaintext, size_t plaintext_len, struct GNUNET_HashCode *hmac)
Calculate HMAC of a message (RFC 2104)
#define GNUNET_TIME_UNIT_FOREVER_ABS
Constant used to specify "forever".
enum RPS_SamplerEmpty is_empty
Flag that indicates that we are not holding a valid PeerID right now.
struct GNUNET_PeerIdentity peer_id
The PeerID this sampler currently samples.
unsigned char key[(512/8)]
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
struct GNUNET_HashCode peer_id_hash
The according hash value of this PeerID.
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
The identity of the host (wraps the signing key of the peer).
int GNUNET_CRYPTO_hash_cmp(const struct GNUNET_HashCode *h1, const struct GNUNET_HashCode *h2)
Compare function for HashCodes, producing a total ordering of all hashcodes.
struct GNUNET_CRYPTO_AuthKey auth_key
Min-wise linear permutation used by this sampler.
void GNUNET_CRYPTO_random_block(enum GNUNET_CRYPTO_Quality mode, void *buffer, size_t length)
Fill block with a random values.
void RPS_sampler_elem_next(struct RPS_SamplerElement *sampler_elem, const struct GNUNET_PeerIdentity *new_ID)
Update a sampler element with a PeerID.
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
uint32_t num_change
How many times this sampler changed the peer_id.
type for (message) authentication keys
#define GNUNET_free(ptr)
Wrapper around free.
High-quality operations are desired.