Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_CuckooFilterStructs.h
Go to the documentation of this file.
1/*
2 * Author: Crownstone Team
3 * Copyright: Crownstone (https://crownstone.rocks)
4 * Date: Mar 26, 2021
5 * License: LGPLv3+, Apache License 2.0, and/or MIT (triple-licensed)
6 */
7#pragma once
8
9#include <stddef.h>
10
11#include <cstdint>
12
13typedef const void* cuckoo_key_t;
14typedef uint16_t cuckoo_fingerprint_t;
15typedef uint8_t cuckoo_index_t;
16
24struct __attribute__((__packed__)) cuckoo_extended_fingerprint_t {
26 cuckoo_index_t bucketA; // the bucket this fingerprint should be put in
27 cuckoo_index_t bucketB; // and the alternative bucket.
28};
29
30struct __attribute__((__packed__)) cuckoo_compressed_fingerprint_t {
32 cuckoo_index_t bucket; // the bucket this fingerprint should be put in
33};
34
38struct __attribute__((__packed__)) cuckoo_filter_data_t {
39 cuckoo_index_t bucketCountLog2; // we save the log2 value since bucket_count needs to be a power of 2.
42 cuckoo_fingerprint_t bucketArray[]; // 'flexible array member'
43};
uint16_t cuckoo_fingerprint_t
Definition: cs_CuckooFilterStructs.h:14
const void * cuckoo_key_t
Definition: cs_CuckooFilterStructs.h:13
uint8_t cuckoo_index_t
Definition: cs_CuckooFilterStructs.h:15
Definition: cs_CuckooFilterStructs.h:30
cuckoo_index_t bucket
Definition: cs_CuckooFilterStructs.h:32
cuckoo_fingerprint_t fingerprint
Definition: cs_CuckooFilterStructs.h:31
Representation of an object (O) in this filter comprises of a fingerprint (F) and a the bucket index ...
Definition: cs_CuckooFilterStructs.h:24
cuckoo_index_t bucketB
Definition: cs_CuckooFilterStructs.h:27
cuckoo_index_t bucketA
Definition: cs_CuckooFilterStructs.h:26
cuckoo_fingerprint_t fingerprint
Definition: cs_CuckooFilterStructs.h:25
Data content of the cuckoo filter.
Definition: cs_CuckooFilterStructs.h:38
cuckoo_extended_fingerprint_t victim
Definition: cs_CuckooFilterStructs.h:41
cuckoo_index_t bucketCountLog2
Definition: cs_CuckooFilterStructs.h:39
cuckoo_index_t nestsPerBucket
Definition: cs_CuckooFilterStructs.h:40