#ifndef _EVICTED_SESSION_FILTER_H_
#define _EVICTED_SESSION_FILTER_H_

#ifdef __cplusplus
extern "C"
{
#endif

#include "log.h"
#include "stellar/tuple.h"

#define EVICTED_SESSION_FILTER_LOG_ERROR(format, ...) LOG_ERROR("evicted session filter", format, ##__VA_ARGS__)

struct evicted_session_filter *evicted_session_filter_new(uint32_t capacity, uint32_t timeout, double error_rate, uint64_t now);
void evicted_session_filter_free(struct evicted_session_filter *filter);

// return 1: found
// reutrn 0: no found
int evicted_session_filter_lookup(struct evicted_session_filter *filter, const struct tuple6 *key, uint64_t now);
void evicted_session_filter_add(struct evicted_session_filter *filter, const struct tuple6 *key, uint64_t now);

#ifdef __cplusplus
}
#endif

#endif
