-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbloom_filter.h
More file actions
32 lines (26 loc) · 948 Bytes
/
bloom_filter.h
File metadata and controls
32 lines (26 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef _BLOOM_H_
#define _BLOOM_H_
#include <crypto/algapi.h>
struct bloom_filter {
struct kref kref;
struct mutex lock;
struct list_head alg_list;
unsigned int bitmap_size;
unsigned long bitmap[0];
};
struct bloom_filter *bloom_filter_new(int bit_size);
struct bloom_filter *bloom_filter_ref(struct bloom_filter *filter);
void bloom_filter_unref(struct bloom_filter *filter);
int bloom_filter_add_crypto_hash(struct bloom_filter *filter,
struct crypto_hash *hash_tfm);
int bloom_filter_add_hash_alg(struct bloom_filter *filter,
const char *name);
int bloom_filter_add(struct bloom_filter *filter,
const u8 *data, unsigned int size);
int bloom_filter_check(struct bloom_filter *filter,
const u8 *data, unsigned int size,
bool *result);
void bloom_filter_set(struct bloom_filter *filter,
const u8 *bit_data);
void bloom_filter_reset(struct bloom_filter *filter);
#endif /* _BLOOM_H_ */