Lines Matching defs:tid

206  * t_insert(tid, id, key, mask)
208 * inserts a new value, id, into the trie, tid->trie with the input key
216 t_insert(trie_id_t *tid, key_t id, uint32_t key, uint32_t mask)
221 uint8_t key_len = (uint8_t)tid->key_len;
225 ++tid->stats.num_dontcare;
229 rw_enter(&tid->rw_lock, RW_WRITER);
230 c_node = tid->trie; /* point at trie root */
312 ++tid->stats.num_inserted;
317 if (tid->info.dontcareonly == B_TRUE) {
318 tid->info.dontcareonly = B_FALSE;
320 rw_exit(&tid->rw_lock);
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)
340 ++tid->stats.num_dontcare;
344 rw_enter(&tid->rw_lock, RW_WRITER);
345 c_node = tid->trie; /* point at root of trie */
377 ++tid->stats.num_inserted;
382 if (tid->info.dontcareonly == B_TRUE) {
383 tid->info.dontcareonly = B_FALSE;
385 rw_exit(&tid->rw_lock);
390 * t_traverse_delete(in_node, pos, id, key, mask, tid)
396 * If the id is successfully removed, tid->stats are updated
400 uint32_t mask, trie_id_t **tid)
412 (EXTRACTBIT(mask, (pos - 1), (uint8_t)(*tid)->key_len) != 1)) {
419 --(*tid)->stats.num_inserted;
421 if ((*tid)->stats.num_inserted == 0) {
423 (*tid)->info.dontcareonly = B_TRUE;
454 (EXTRACTBIT(mask, (pos - 1), (uint8_t)(*tid)->key_len)
464 --(*tid)->stats.num_inserted;
466 if ((*tid)->stats.num_inserted == 0) {
468 (*tid)->info.dontcareonly = B_TRUE;
492 bit = EXTRACTBIT(key, (pos - 1), (uint8_t)(*tid)->key_len);
495 tid) == B_TRUE) {
500 tid) == B_TRUE) {
531 (uint8_t)(*tid)->key_len);
535 (uint8_t)(*tid)->key_len);
557 (uint8_t)(*tid)->key_len);
561 (uint8_t)(*tid)->key_len);
595 * t_remove(tid, id, key, mask)
602 t_remove(trie_id_t *tid, key_t id, uint32_t key, uint32_t mask)
608 --tid->stats.num_dontcare;
614 rw_enter(&tid->rw_lock, RW_WRITER);
615 c_node = tid->trie;
616 (void) t_traverse_delete(&c_node, (uint8_t)tid->key_len, id, key, mask,
617 &tid);
618 rw_exit(&tid->rw_lock);
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)
637 --tid->stats.num_dontcare;
641 rw_enter(&tid->rw_lock, RW_WRITER);
642 c_node = tid->trie; /* point at root of trie */
674 --tid->stats.num_inserted;
678 if (tid->stats.num_inserted <= 0) {
679 tid->info.dontcareonly = B_TRUE;
683 rw_exit(&tid->rw_lock);
688 * t_retrieve(tid, key, fid_table)
702 t_retrieve(trie_id_t *tid, uint32_t key, ht_match_t *fid_table)
710 rw_enter(&tid->rw_lock, RW_READER);
711 c_node = tid->trie; /* point at root of trie */
715 rw_exit(&tid->rw_lock);
722 for (pos = (uint8_t)tid->key_len; pos > 0; --pos) {
726 rw_exit(&tid->rw_lock);
737 if ((ret = ipgpc_mark_found(tid->info.mask,
740 rw_exit(&tid->rw_lock);
746 bit = EXTRACTBIT(key, (pos - 1), (uint8_t)tid->key_len);
756 rw_exit(&tid->rw_lock);
762 if ((ret = ipgpc_mark_found(tid->info.mask, c_node->elements,
764 rw_exit(&tid->rw_lock);
769 rw_exit(&tid->rw_lock);
774 * t_retrieve6(tid, key, fid_table)
779 t_retrieve6(trie_id_t *tid, in6_addr_t key, ht_match_t *fid_table)
788 rw_enter(&tid->rw_lock, RW_READER);
789 c_node = tid->trie;
793 rw_exit(&tid->rw_lock);
818 rw_exit(&tid->rw_lock);
823 if ((ret = ipgpc_mark_found(tid->info.mask,
826 rw_exit(&tid->rw_lock);
833 rw_exit(&tid->rw_lock);