Lines Matching defs:crecp

945   struct crec *crecp;
951 if ((crecp = cache_find_by_name(NULL, name, now, F_IPV4 | F_IPV6)) &&
952 (crecp->flags & (F_HOSTS | F_DHCP)))
1117 static unsigned long crec_ttl(struct crec *crecp, time_t now)
1122 if (crecp->flags & (F_IMMORTAL | F_DHCP))
1125 return crecp->ttd - now;
1142 struct crec *crecp;
1275 else if ((crecp = cache_find_by_addr(NULL, &addr, now, is_arpa)))
1279 if (qtype == T_ANY && !(crecp->flags & (F_HOSTS | F_DHCP)))
1282 if (crecp->flags & F_NEG)
1286 if (crecp->flags & F_NXDOMAIN)
1289 log_query(crecp->flags & ~F_FORWARD, name, &addr, NULL);
1291 else if ((crecp->flags & (F_HOSTS | F_DHCP)) || !sec_reqd)
1294 if (!(crecp->flags & (F_HOSTS | F_DHCP)))
1298 log_query(crecp->flags & ~F_FORWARD, cache_get_name(crecp), &addr,
1299 record_source(crecp->uid));
1302 crec_ttl(crecp, now), NULL,
1303 T_PTR, C_IN, "d", cache_get_name(crecp)))
1307 } while ((crecp = cache_find_by_addr(crecp, &addr, now, is_arpa)));
1378 if ((crecp = cache_find_by_name(NULL, name, now, flag | F_CNAME)))
1386 struct crec *save = crecp;
1388 if ((crecp->flags & F_HOSTS) &&
1389 is_same_net(*((struct in_addr *)&crecp->addr), local_addr, local_netmask))
1394 } while ((crecp = cache_find_by_name(crecp, name, now, flag | F_CNAME)));
1395 crecp = save;
1402 if (qtype == T_ANY && !(crecp->flags & (F_HOSTS | F_DHCP)))
1405 if (crecp->flags & F_CNAME)
1409 log_query(crecp->flags, name, NULL, record_source(crecp->uid));
1411 crec_ttl(crecp, now), &nameoffset,
1412 T_CNAME, C_IN, "d", cache_get_name(crecp->addr.cname.cache)))
1416 strcpy(name, cache_get_name(crecp->addr.cname.cache));
1420 if (crecp->flags & F_NEG)
1424 if (crecp->flags & F_NXDOMAIN)
1427 log_query(crecp->flags, name, NULL, NULL);
1429 else if ((crecp->flags & (F_HOSTS | F_DHCP)) || !sec_reqd)
1434 (crecp->flags & F_HOSTS) &&
1435 !is_same_net(*((struct in_addr *)&crecp->addr), local_addr, local_netmask))
1438 if (!(crecp->flags & (F_HOSTS | F_DHCP)))
1444 log_query(crecp->flags & ~F_REVERSE, name, &crecp->addr.addr,
1445 record_source(crecp->uid));
1448 crec_ttl(crecp, now), NULL, type, C_IN,
1449 type == T_A ? "4" : "6", &crecp->addr))
1453 } while ((crecp = cache_find_by_name(crecp, name, now, flag | F_CNAME)));
1573 crecp = NULL;
1574 while ((crecp = cache_find_by_name(crecp, rec->target, now, F_IPV4 | F_IPV6)))
1577 int type = crecp->flags & F_IPV4 ? T_A : T_AAAA;
1581 if (crecp->flags & F_NEG)
1585 crec_ttl(crecp, now), NULL, type, C_IN,
1586 crecp->flags & F_IPV4 ? "4" : "6", &crecp->addr))