Lines Matching refs:mask

66 	buf->mask = 0;
85 * For example: key = 1011 with key_len = 8, would actaully be the key:mask
96 * * * bits = 4 pos = 5 val = 1011 mask = 00111100
102 * * bits = 1 pos = 5 val = 1 mask = 00100000
105 * mask = 00001100 mask = 00001100))
115 * * * bits = 4 pos = 5 val = 1011 mask = 00111100
117 * * * (to be inserted: bits = 1 pos = 0 val = 1 mask = 00000001)
129 /* check if case is that the mask is longer */
164 SETBIT(nodep->zero->mask,
190 SETBIT(nodep->one->mask,
200 UNSETBIT(nodep->mask, i, key_len);
206 * t_insert(tid, id, key, mask)
213 * return DONTCARE_VALUE if mask == 0, otherwise NORMAL_VALUE
216 t_insert(trie_id_t *tid, key_t id, uint32_t key, uint32_t mask)
224 if (mask == 0) {
231 key &= mask; /* apply mask */
235 /* bit in key is significant if it is covered by the mask */
236 if (EXTRACTBIT(mask, (pos - 1), key_len) != 1) {
269 * this case occurs when mask for key
270 * is longer than mask for key at
287 SETBIT(c_node->mask, (pos - 1), 1, key_len);
301 SETBIT(c_node->mask, (pos - 1), 1, key_len);
325 * t_insert6(tid, id, key, mask)
330 t_insert6(trie_id_t *tid, key_t id, in6_addr_t key, in6_addr_t mask)
339 if (IN6_ARE_ADDR_EQUAL(&mask, &zero_addr)) {
346 V6_MASK_COPY(key, mask, key); /* apply mask to key */
355 if (EXTRACTBIT(mask.s6_addr32[i], (pos - 1), type_len)
390 * t_traverse_delete(in_node, pos, id, key, mask, tid)
400 uint32_t mask, trie_id_t **tid)
412 (EXTRACTBIT(mask, (pos - 1), (uint8_t)(*tid)->key_len) != 1)) {
438 c_node->mask = 0;
446 if ((key & c_node->mask) != c_node->val) {
452 /* search should continue if mask and pos are valid */
454 (EXTRACTBIT(mask, (pos - 1), (uint8_t)(*tid)->key_len)
485 c_node->mask = 0;
494 if (t_traverse_delete(&c_node->zero, (pos - 1), id, key, mask,
499 if (t_traverse_delete(&c_node->one, (pos - 1), id, key, mask,
528 c_node->mask |= c_node->zero->mask;
530 SETBIT(c_node->mask, (pos - 1), 1,
554 c_node->mask |= c_node->one->mask;
556 SETBIT(c_node->mask, (pos - 1), 1,
586 c_node->mask = 0;
595 * t_remove(tid, id, key, mask)
602 t_remove(trie_id_t *tid, key_t id, uint32_t key, uint32_t mask)
607 if (mask == 0) {
612 key &= mask; /* apply mask */
616 (void) t_traverse_delete(&c_node, (uint8_t)tid->key_len, id, key, mask,
622 * t_remove6(tid, id, key, mask)
627 t_remove6(trie_id_t *tid, key_t id, in6_addr_t key, in6_addr_t mask)
636 if (IN6_ARE_ADDR_EQUAL(&mask, &zero_addr)) {
643 V6_MASK_COPY(key, mask, key);
652 if (EXTRACTBIT(mask.s6_addr32[i], (pos - 1), type_len)
725 if ((key & c_node->mask) != c_node->val) {
737 if ((ret = ipgpc_mark_found(tid->info.mask,
762 if ((ret = ipgpc_mark_found(tid->info.mask, c_node->elements,
823 if ((ret = ipgpc_mark_found(tid->info.mask,