#ifndef _HASHTABLE_H_ #define _HASHTABLE_H_ #include #include struct hash_entry { struct hash_entry *next; uint32_t src_ip; uint16_t dst_port; uint8_t protonum; uint8_t flags; uint64_t src_bytes; uint64_t dst_bytes; uint32_t count; }; struct hash_table { uint32_t buckets; uint32_t hash_rnd; pthread_mutex_t mutex; struct hash_entry *bucket[0]; }; struct hash_table * create_hash(uint32_t buckets); void purge_hash(struct hash_table *table, void (*callback)(const struct hash_entry *entry, void *privdata), void *privdata); void destroy_hash(struct hash_table *table); void hash_add(struct hash_table *table, struct hash_entry *entry); #endif /* _HASHTABLE_H_ */