Lines Matching refs:rule

98 		dns_ssurule_t *rule = ISC_LIST_HEAD(table->rules);
99 if (rule->identity != NULL) {
100 dns_name_free(rule->identity, mctx);
101 isc_mem_put(mctx, rule->identity, sizeof(dns_name_t));
103 if (rule->name != NULL) {
104 dns_name_free(rule->name, mctx);
105 isc_mem_put(mctx, rule->name, sizeof(dns_name_t));
107 if (rule->types != NULL)
108 isc_mem_put(mctx, rule->types,
109 rule->ntypes * sizeof(dns_rdatatype_t));
110 ISC_LIST_UNLINK(table->rules, rule, link);
111 rule->magic = 0;
112 isc_mem_put(mctx, rule, sizeof(dns_ssurule_t));
163 dns_ssurule_t *rule;
177 rule = isc_mem_get(mctx, sizeof(dns_ssurule_t));
178 if (rule == NULL)
181 rule->identity = NULL;
182 rule->name = NULL;
183 rule->types = NULL;
185 rule->grant = grant;
187 rule->identity = isc_mem_get(mctx, sizeof(dns_name_t));
188 if (rule->identity == NULL) {
192 dns_name_init(rule->identity, NULL);
193 result = dns_name_dup(identity, mctx, rule->identity);
197 rule->name = isc_mem_get(mctx, sizeof(dns_name_t));
198 if (rule->name == NULL) {
202 dns_name_init(rule->name, NULL);
203 result = dns_name_dup(name, mctx, rule->name);
207 rule->matchtype = matchtype;
209 rule->ntypes = ntypes;
211 rule->types = isc_mem_get(mctx,
213 if (rule->types == NULL) {
217 memmove(rule->types, types, ntypes * sizeof(dns_rdatatype_t));
219 rule->types = NULL;
221 rule->magic = SSURULEMAGIC;
222 ISC_LIST_INITANDAPPEND(table->rules, rule, link);
227 if (rule->identity != NULL) {
228 if (dns_name_dynamic(rule->identity))
229 dns_name_free(rule->identity, mctx);
230 isc_mem_put(mctx, rule->identity, sizeof(dns_name_t));
232 if (rule->name != NULL) {
233 if (dns_name_dynamic(rule->name))
234 dns_name_free(rule->name, mctx);
235 isc_mem_put(mctx, rule->name, sizeof(dns_name_t));
237 if (rule->types != NULL)
238 isc_mem_put(mctx, rule->types,
240 isc_mem_put(mctx, rule, sizeof(dns_ssurule_t));
351 dns_ssurule_t *rule;
366 for (rule = ISC_LIST_HEAD(table->rules);
367 rule != NULL;
368 rule = ISC_LIST_NEXT(rule, link))
370 switch (rule->matchtype) {
379 if (dns_name_iswildcard(rule->identity)) {
381 rule->identity))
384 if (!dns_name_equal(signer, rule->identity))
402 switch (rule->matchtype) {
404 if (!dns_name_equal(name, rule->name))
408 if (!dns_name_issubdomain(name, rule->name))
412 if (!dns_name_matcheswildcard(name, rule->name))
435 rule->identity))
440 rule->identity))
444 if (!dns_name_issubdomain(name, rule->name))
447 rule->identity))
451 if (!dns_name_issubdomain(name, rule->name))
454 rule->identity))
461 if (dns_name_iswildcard(rule->identity)) {
463 rule->identity))
466 if (!dns_name_equal(tcpself, rule->identity))
476 if (dns_name_iswildcard(rule->identity)) {
478 rule->identity))
481 if (!dns_name_equal(stfself, rule->identity))
489 if (rule->ntypes == 0) {
493 for (i = 0; i < rule->ntypes; i++) {
494 if (rule->types[i] == dns_rdatatype_any ||
495 rule->types[i] == type)
498 if (i == rule->ntypes)
501 return (rule->grant);
508 dns_ssurule_isgrant(const dns_ssurule_t *rule) {
509 REQUIRE(VALID_SSURULE(rule));
510 return (rule->grant);
514 dns_ssurule_identity(const dns_ssurule_t *rule) {
515 REQUIRE(VALID_SSURULE(rule));
516 return (rule->identity);
520 dns_ssurule_matchtype(const dns_ssurule_t *rule) {
521 REQUIRE(VALID_SSURULE(rule));
522 return (rule->matchtype);
526 dns_ssurule_name(const dns_ssurule_t *rule) {
527 REQUIRE(VALID_SSURULE(rule));
528 return (rule->name);
532 dns_ssurule_types(const dns_ssurule_t *rule, dns_rdatatype_t **types) {
533 REQUIRE(VALID_SSURULE(rule));
535 *types = rule->types;
536 return (rule->ntypes);
540 dns_ssutable_firstrule(const dns_ssutable_t *table, dns_ssurule_t **rule) {
542 REQUIRE(rule != NULL && *rule == NULL);
543 *rule = ISC_LIST_HEAD(table->rules);
544 return (*rule != NULL ? ISC_R_SUCCESS : ISC_R_NOMORE);
548 dns_ssutable_nextrule(dns_ssurule_t *rule, dns_ssurule_t **nextrule) {
549 REQUIRE(VALID_SSURULE(rule));
551 *nextrule = ISC_LIST_NEXT(rule, link);