Lines Matching refs:crecp
773 struct crec* crecp; in check_for_local_domain() local
779 if ((crecp = cache_find_by_name(NULL, name, now, F_IPV4 | F_IPV6)) && in check_for_local_domain()
780 (crecp->flags & (F_HOSTS | F_DHCP))) in check_for_local_domain()
927 static unsigned long crec_ttl(struct crec* crecp, time_t now) { in crec_ttl() argument
931 if (crecp->flags & (F_IMMORTAL | F_DHCP)) return daemon->local_ttl; in crec_ttl()
933 return crecp->ttd - now; in crec_ttl()
948 struct crec* crecp; in answer_request() local
1058 } else if ((crecp = cache_find_by_addr(NULL, &addr, now, is_arpa))) in answer_request()
1061 if (qtype == T_ANY && !(crecp->flags & (F_HOSTS | F_DHCP))) continue; in answer_request()
1063 if (crecp->flags & F_NEG) { in answer_request()
1066 if (crecp->flags & F_NXDOMAIN) nxdomain = 1; in answer_request()
1067 if (!dryrun) log_query(crecp->flags & ~F_FORWARD, name, &addr, NULL); in answer_request()
1068 } else if ((crecp->flags & (F_HOSTS | F_DHCP)) || !sec_reqd) { in answer_request()
1070 if (!(crecp->flags & (F_HOSTS | F_DHCP))) auth = 0; in answer_request()
1072 log_query(crecp->flags & ~F_FORWARD, cache_get_name(crecp), &addr, in answer_request()
1073 record_source(crecp->uid)); in answer_request()
1076 crec_ttl(crecp, now), NULL, T_PTR, C_IN, in answer_request()
1077 "d", cache_get_name(crecp))) in answer_request()
1081 } while ((crecp = cache_find_by_addr(crecp, &addr, now, is_arpa))); in answer_request()
1142 if ((crecp = cache_find_by_name(NULL, name, now, flag | F_CNAME))) { in answer_request()
1149 struct crec* save = crecp; in answer_request()
1151 if ((crecp->flags & F_HOSTS) && in answer_request()
1152 is_same_net(*((struct in_addr*) &crecp->addr), local_addr, in answer_request()
1157 } while ((crecp = cache_find_by_name(crecp, name, now, flag | F_CNAME))); in answer_request()
1158 crecp = save; in answer_request()
1164 if (qtype == T_ANY && !(crecp->flags & (F_HOSTS | F_DHCP))) break; in answer_request()
1166 if (crecp->flags & F_CNAME) { in answer_request()
1168 log_query(crecp->flags, name, NULL, record_source(crecp->uid)); in answer_request()
1170 crec_ttl(crecp, now), &nameoffset, T_CNAME, in answer_request()
1172 cache_get_name(crecp->addr.cname.cache))) in answer_request()
1176 strcpy(name, cache_get_name(crecp->addr.cname.cache)); in answer_request()
1180 if (crecp->flags & F_NEG) { in answer_request()
1183 if (crecp->flags & F_NXDOMAIN) nxdomain = 1; in answer_request()
1184 if (!dryrun) log_query(crecp->flags, name, NULL, NULL); in answer_request()
1185 } else if ((crecp->flags & (F_HOSTS | F_DHCP)) || !sec_reqd) { in answer_request()
1188 if (localise && (crecp->flags & F_HOSTS) && in answer_request()
1189 !is_same_net(*((struct in_addr*) &crecp->addr), local_addr, in answer_request()
1193 if (!(crecp->flags & (F_HOSTS | F_DHCP))) auth = 0; in answer_request()
1197 log_query(crecp->flags & ~F_REVERSE, name, &crecp->addr.addr, in answer_request()
1198 record_source(crecp->uid)); in answer_request()
1201 crec_ttl(crecp, now), NULL, type, C_IN, in answer_request()
1202 type == T_A ? "4" : "6", &crecp->addr)) in answer_request()
1206 } while ((crecp = cache_find_by_name(crecp, name, now, flag | F_CNAME))); in answer_request()
1310 crecp = NULL; in answer_request()
1311 while ((crecp = cache_find_by_name(crecp, rec->target, now, F_IPV4 | F_IPV6))) { in answer_request()
1313 int type = crecp->flags & F_IPV4 ? T_A : T_AAAA; in answer_request()
1317 if (crecp->flags & F_NEG) continue; in answer_request()
1320 crec_ttl(crecp, now), NULL, type, C_IN, in answer_request()
1321 crecp->flags & F_IPV4 ? "4" : "6", &crecp->addr)) in answer_request()