Lines Matching defs:subnet
61 struct subnet {
62 struct element *subnet;
66 TAILQ_ENTRY(subnet) next;
69 TAILQ_HEAD(subnets, subnet) known_subnets;
261 comment = createComment("/// Kea reservations are per subnet");
583 | subnet-declaration
601 size_t subnet = 0;
645 case SUBNET:
651 "subnet declarations not allowed here.");
653 if (token == SUBNET)
758 if (!subnet) {
761 subnet = i;
766 if (type != SUBNET_DECL || !subnet)
769 parse_address_range(cfile, type, subnet);
776 if (!subnet) {
779 subnet = i;
784 if ((type != SUBNET_DECL) || !subnet)
787 parse_address_range6(cfile, type, subnet);
794 if (!subnet) {
797 subnet = i;
802 if ((type != SUBNET_DECL) || !subnet)
805 parse_prefix6(cfile, type, subnet);
858 if (!subnet) {
866 subnet = i;
871 if (!subnet)
876 mapSet(cfile->stack[subnet], cache, "authoritative");
1134 * or subnet and there may be multiple pools withing a shared network or subnet.
1165 "subnet or shared-network statements.");
1503 "declared subnet");
2074 struct element *subnet;
2086 subnet = find_location(share, range);
2087 if (subnet == NULL)
2096 dsts = mapGet(subnet, "pools");
2099 mapSet(subnet, dsts, "pools");
2117 struct element *subnet;
2211 "in a subnet");
2227 "in a subnet");
2235 /* There is one subnet so the shared network is useless */
2236 subnet = listGet(subnets, 0);
2242 mapContains(subnet, "pools")) {
2248 sub = mapGet(subnet, "pools");
2252 mapContains(subnet, "pd-pools")) {
2258 sub = mapGet(subnet, "pd-pools");
2262 mapContains(subnet, "option-data")) {
2268 sub = mapGet(subnet, "option-data");
2271 merge(subnet, share);
2288 listPush(subnets, subnet);
2294 struct element *subnet)
2303 stackPush(cfile, subnet);
2317 if (mapContains(subnet, "interface"))
2319 "A subnet can't be connected "
2322 mapSet(subnet, interface, "interface");
2332 /* Add the subnet to the list of subnets in this shared net. */
2333 listPush(subnets, subnet);
2338 /* subnet-declaration :==
2346 struct element *subnet;
2347 struct subnet *chain;
2358 subnet = createMap();
2359 subnet->kind = SUBNET_DECL;
2360 TAILQ_CONCAT(&subnet->comments, &cfile->comments);
2363 mapSet(subnet, createInt(subnet_counter), "id");
2365 chain = (struct subnet *)malloc(sizeof(*chain));
2367 parse_error(cfile, "can't allocate subnet");
2369 chain->subnet = subnet;
2383 parse_error(cfile, "can't find a place to put subnet");
2425 mapSet(subnet, createString(prefix), "subnet");
2427 common_subnet_parsing(cfile, subnets, subnet);
2438 struct element *subnet;
2439 struct subnet *chain;
2453 subnet = createMap();
2454 subnet->kind = SUBNET_DECL;
2455 TAILQ_CONCAT(&subnet->comments, &cfile->comments);
2458 mapSet(subnet, createInt(subnet_counter), "id");
2460 chain = (struct subnet *)malloc(sizeof(*chain));
2462 parse_error(cfile, "can't allocate subnet");
2464 chain->subnet = subnet;
2478 parse_error(cfile, "can't find a place to put subnet");
2517 mapSet(subnet, createString(prefix), "subnet");
2519 common_subnet_parsing(cfile, subnets, subnet);
2688 parse_error(cfile, "subnet declarations not "
2755 (strcmp(handle->key, "subnet") == 0) ||
3463 * or subnet and there may be multiple pools withing a shared network or subnet.
3502 "subnet statements.");
4469 * (reservations aka hosts must be in a subnet in Kea < 1.5)
4470 * (defaulting to the last defined subnet (e.g. for reservations
4480 struct subnet *subnet;
4518 return TAILQ_LAST(&known_subnets, subnets)->subnet;
4528 return TAILQ_LAST(&known_subnets, subnets)->subnet;
4532 return TAILQ_LAST(&known_subnets, subnets)->subnet;
4539 TAILQ_FOREACH(subnet, &known_subnets) {
4542 if (subnet->mask->length != len)
4545 if ((addr[i] & subnet->mask->content[i]) !=
4546 subnet->addr->content[i]) {
4551 return subnet->subnet;
4557 * find a subnet where to put a pool
4564 struct subnet *subnet;
4567 TAILQ_FOREACH(subnet, &known_subnets) {
4570 if (subnet->share != share)
4572 if (subnet->mask->length != range->low->length)
4576 subnet->mask->content[i]) !=
4577 subnet->addr->content[i]) {
4582 return subnet->subnet;