Lines Matching defs:key
50 * ht_insert(taid, id, key)
53 * if key == taid->wildcard, the key is inserted as a wildcard
55 * returns DONTCARE_VALUE if key == wildcard, NORMAL_VALUE otherwise
58 ht_insert(table_id_t *taid, key_t id, int key)
65 if (key == taid->wildcard) {
71 x = ht_hash(key);
73 * insert if key matches and entry is being used or if entry is empty
75 if (((table[x].key == key) && (table[x].info == 1)) ||
77 table[x].key = key;
84 table[x].next->key = key;
90 if (((p->key == key) && (p->info == 1)) ||
92 p->key = key;
105 p->key = key;
120 * ht_search(table, key)
122 * searches for key and returns the linked list value associated with key if
123 * found in table. NULL is returned if key not found
126 ht_search(hash_table table, int key)
131 x = ht_hash(key);
132 if ((table[x].key == key) && (table[x].info == 1)) {
137 if ((p->key == key) && (p->info == 1)) {
147 * ht_retrieve(taid, key, fid_table)
151 * the number of found filters that match the input key are returned
155 ht_retrieve(table_id_t *taid, int key, ht_match_t *fid_table)
162 if (key == taid->wildcard) {
165 alist = ht_search(table, key);
192 * ht_remove(taid, id, key)
198 ht_remove(table_id_t *taid, key_t id, int key)
206 if (key == taid->wildcard) {
211 x = ht_hash(key);
212 /* remove entry if key matches and entry is being used */
213 if ((table[x].key == key) && (table[x].info == 1)) {
225 table[x].key = table[x].next->key;
231 table[x].key = 0;
237 if ((p->next->key == key) && (p->next->info == 1)) {