9 #ifndef TOR_REPLAYCACHE_H
10 #define TOR_REPLAYCACHE_H
12 typedef struct replaycache_t replaycache_t;
14 #ifdef REPLAYCACHE_PRIVATE
16 struct replaycache_t {
18 time_t scrub_interval;
29 digest256map_t *digests_seen;
42 #define replaycache_free(r) \
43 FREE_AND_NULL(replaycache_t, replaycache_free_, (r))
46 #ifdef REPLAYCACHE_PRIVATE
56 time_t present, replaycache_t *r,
const void *data,
size_t len,
59 time_t present, replaycache_t *r);
69 replaycache_t *r,
const void *data,
size_t len, time_t *elapsed);
STATIC int replaycache_add_and_test_internal(time_t present, replaycache_t *r, const void *data, size_t len, time_t *elapsed)
STATIC void replaycache_scrub_if_needed_internal(time_t present, replaycache_t *r)
replaycache_t * replaycache_new(time_t horizon, time_t interval)
void replaycache_free_(replaycache_t *r)
void replaycache_scrub_if_needed(replaycache_t *r)
int replaycache_add_test_and_elapsed(replaycache_t *r, const void *data, size_t len, time_t *elapsed)
int replaycache_add_and_test(replaycache_t *r, const void *data, size_t len)