Lines Matching refs:cache
34 void pt_tnt_cache_init(struct pt_tnt_cache *cache) in pt_tnt_cache_init() argument
36 if (!cache) in pt_tnt_cache_init()
39 cache->tnt = 0ull; in pt_tnt_cache_init()
40 cache->index = 0ull; in pt_tnt_cache_init()
43 int pt_tnt_cache_is_empty(const struct pt_tnt_cache *cache) in pt_tnt_cache_is_empty() argument
45 if (!cache) in pt_tnt_cache_is_empty()
48 return cache->index == 0; in pt_tnt_cache_is_empty()
51 int pt_tnt_cache_query(struct pt_tnt_cache *cache) in pt_tnt_cache_query() argument
55 if (!cache) in pt_tnt_cache_query()
58 if (!cache->index) in pt_tnt_cache_query()
61 taken = (cache->tnt & cache->index) != 0; in pt_tnt_cache_query()
62 cache->index >>= 1; in pt_tnt_cache_query()
67 int pt_tnt_cache_update_tnt(struct pt_tnt_cache *cache, in pt_tnt_cache_update_tnt() argument
75 if (!cache || !packet) in pt_tnt_cache_update_tnt()
78 if (cache->index) in pt_tnt_cache_update_tnt()
85 cache->tnt = packet->payload; in pt_tnt_cache_update_tnt()
86 cache->index = 1ull << (bit_size - 1); in pt_tnt_cache_update_tnt()