Lines Matching defs:cctx
34 if ((cctx->allowed & DNS_COMPRESS_READY) == 0) { \
35 cctx->allowed |= DNS_COMPRESS_READY; \
37 cctx->table[i] = NULL; \
46 dns_compress_init(dns_compress_t *cctx, int edns, isc_mem_t *mctx) {
47 REQUIRE(cctx != NULL);
50 cctx->edns = edns;
51 cctx->mctx = mctx;
52 cctx->count = 0;
53 cctx->allowed = DNS_COMPRESS_ENABLED;
54 cctx->magic = CCTX_MAGIC;
59 dns_compress_invalidate(dns_compress_t *cctx) {
63 REQUIRE(VALID_CCTX(cctx));
65 if ((cctx->allowed & DNS_COMPRESS_READY) != 0) {
67 while (cctx->table[i] != NULL) {
68 node = cctx->table[i];
69 cctx->table[i] = cctx->table[i]->next;
71 isc_mem_put(cctx->mctx, node->r.base,
75 isc_mem_put(cctx->mctx, node, sizeof(*node));
79 cctx->magic = 0;
80 cctx->allowed = 0;
81 cctx->edns = -1;
85 dns_compress_setmethods(dns_compress_t *cctx, unsigned int allowed) {
86 REQUIRE(VALID_CCTX(cctx));
88 cctx->allowed &= ~DNS_COMPRESS_ALL;
89 cctx->allowed |= (allowed & DNS_COMPRESS_ALL);
93 dns_compress_getmethods(dns_compress_t *cctx) {
94 REQUIRE(VALID_CCTX(cctx));
95 return (cctx->allowed & DNS_COMPRESS_ALL);
99 dns_compress_disable(dns_compress_t *cctx) {
100 REQUIRE(VALID_CCTX(cctx));
101 cctx->allowed &= ~DNS_COMPRESS_ENABLED;
105 dns_compress_setsensitive(dns_compress_t *cctx, isc_boolean_t sensitive) {
106 REQUIRE(VALID_CCTX(cctx));
109 cctx->allowed |= DNS_COMPRESS_CASESENSITIVE;
111 cctx->allowed &= ~DNS_COMPRESS_CASESENSITIVE;
115 dns_compress_getsensitive(dns_compress_t *cctx) {
116 REQUIRE(VALID_CCTX(cctx));
118 return (ISC_TF((cctx->allowed & DNS_COMPRESS_CASESENSITIVE) != 0));
122 dns_compress_getedns(dns_compress_t *cctx) {
123 REQUIRE(VALID_CCTX(cctx));
124 return (cctx->edns);
141 dns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name,
148 REQUIRE(VALID_CCTX(cctx));
152 if ((cctx->allowed & DNS_COMPRESS_ENABLED) == 0)
157 if (cctx->count == 0)
170 for (node = cctx->table[hash]; node != NULL; node = node->next)
173 if ((cctx->allowed & DNS_COMPRESS_CASESENSITIVE) != 0) {
208 dns_compress_add(dns_compress_t *cctx, const dns_name_t *name,
223 REQUIRE(VALID_CCTX(cctx));
226 if ((cctx->allowed & DNS_COMPRESS_ENABLED) == 0)
245 tmp = isc_mem_get(cctx->mctx, length);
266 if (cctx->count < DNS_COMPRESS_INITIALNODES)
267 node = &cctx->initialnodes[cctx->count];
269 node = isc_mem_get(cctx->mctx,
274 node->count = cctx->count++;
284 node->next = cctx->table[hash];
285 cctx->table[hash] = node;
292 isc_mem_put(cctx->mctx, tmp, length);
296 dns_compress_rollback(dns_compress_t *cctx, isc_uint16_t offset) {
300 REQUIRE(VALID_CCTX(cctx));
302 if ((cctx->allowed & DNS_COMPRESS_ENABLED) == 0)
305 if ((cctx->allowed & DNS_COMPRESS_READY) == 0)
309 node = cctx->table[i];
317 cctx->table[i] = node->next;
319 isc_mem_put(cctx->mctx, node->r.base,
322 isc_mem_put(cctx->mctx, node, sizeof(*node));
323 cctx->count--;
324 node = cctx->table[i];