#pragma once

#ifdef __cplusplus
extern "C"
{
#endif

// Duplicated Packet Filter for IPv4 Packet
struct packet_filter;
struct packet_filter *packet_filter_new(uint32_t capacity, uint32_t timeout, double error_rate, uint64_t now);
void packet_filter_free(struct packet_filter *filter);

// return 1: found
// reutrn 0: no found
int packet_filter_lookup(struct packet_filter *filter, const struct packet *pkt, uint64_t now);
void packet_filter_add(struct packet_filter *filter, const struct packet *pkt, uint64_t now);

#ifdef __cplusplus
}
#endif
