Lines Matching defs:table
40 #define VALID_SSUTABLE(table) ISC_MAGIC_VALID(table, SSUTABLEMAGIC)
43 #define VALID_SSURULE(table) ISC_MAGIC_VALID(table, SSURULEMAGIC)
68 dns_ssutable_t *table;
73 table = isc_mem_get(mctx, sizeof(dns_ssutable_t));
74 if (table == NULL)
76 result = isc_mutex_init(&table->lock);
78 isc_mem_put(mctx, table, sizeof(dns_ssutable_t));
81 table->references = 1;
82 table->mctx = NULL;
83 isc_mem_attach(mctx, &table->mctx);
84 ISC_LIST_INIT(table->rules);
85 table->magic = SSUTABLEMAGIC;
86 *tablep = table;
91 destroy(dns_ssutable_t *table) {
94 REQUIRE(VALID_SSUTABLE(table));
96 mctx = table->mctx;
97 while (!ISC_LIST_EMPTY(table->rules)) {
98 dns_ssurule_t *rule = ISC_LIST_HEAD(table->rules);
110 ISC_LIST_UNLINK(table->rules, rule, link);
114 DESTROYLOCK(&table->lock);
115 table->magic = 0;
116 isc_mem_putanddetach(&table->mctx, table, sizeof(dns_ssutable_t));
137 dns_ssutable_t *table;
141 table = *tablep;
142 REQUIRE(VALID_SSUTABLE(table));
144 LOCK(&table->lock);
146 INSIST(table->references > 0);
147 if (--table->references == 0)
149 UNLOCK(&table->lock);
154 destroy(table);
158 dns_ssutable_addrule(dns_ssutable_t *table, isc_boolean_t grant,
167 REQUIRE(VALID_SSUTABLE(table));
176 mctx = table->mctx;
222 ISC_LIST_INITANDAPPEND(table->rules, rule, link);
347 dns_ssutable_checkrules(dns_ssutable_t *table, dns_name_t *signer,
359 REQUIRE(VALID_SSUTABLE(table));
366 for (rule = ISC_LIST_HEAD(table->rules);
540 dns_ssutable_firstrule(const dns_ssutable_t *table, dns_ssurule_t **rule) {
541 REQUIRE(VALID_SSUTABLE(table));
543 *rule = ISC_LIST_HEAD(table->rules);