Lines Matching refs:lease

3 /* Parser for dhclient config and lease files... */
143 * lease-file :== client-lease-statements EOF
144 * client-lease-statements :== <nil>
145 * | client-lease-statements LEASE client-lease-statement
156 /* Open the lease file. If we can't open it, just return -
165 warning("Corrupt lease file - possible data loss!");
191 * LEASE client-lease-statement |
192 * ALIAS client-lease-statement
478 * client-lease-statement :==
479 * RBRACE client-lease-declarations LBRACE
481 * client-lease-declarations :==
483 * client-lease-declaration |
484 * client-lease-declarations client-lease-declaration
489 struct client_lease *lease, *lp, *pl;
501 lease = malloc(sizeof(struct client_lease));
502 if (!lease)
503 error("no memory for lease.");
504 memset(lease, 0, sizeof(*lease));
505 lease->is_static = is_static;
512 parse_warn("unterminated lease declaration.");
517 parse_client_lease_declaration(cfile, lease, &ip);
521 /* If the lease declaration didn't include an interface
525 free_client_lease(lease);
533 /* If this is an alias lease, it doesn't need to be sorted in. */
535 ip->client->alias = lease;
540 * The new lease may supersede a lease that's not the active
541 * lease but is still on the lease list, so scan the lease list
542 * looking for a lease with the same address, and if we find it,
547 if (lp->address.len == lease->address.len &&
548 !memcmp(lp->address.iabuf, lease->address.iabuf,
549 lease->address.len)) {
560 * If this is a preloaded lease, just put it on the list of
561 * recorded leases - don't make it the active lease.
564 lease->next = ip->client->leases;
565 ip->client->leases = lease;
570 * The last lease in the lease file on a particular interface is
571 * the active lease for that interface. Of course, we don't
572 * know what the last lease in the file is until we've parsed
573 * the whole file, so at this point, we assume that the lease we
574 * just parsed is the active lease for its interface. If
575 * there's already an active lease for the interface, and this
576 * lease is for the same ip address, then we just toss the old
577 * active lease and replace it with this one. If this lease is
578 * for a different address, then if the old active lease has
587 lease->address.len &&
589 lease->address.iabuf, lease->address.len))
596 ip->client->active = lease;
602 * client-lease-declaration :==
614 parse_client_lease_declaration(FILE *cfile, struct client_lease *lease,
623 lease->is_bootp = 1;
636 if (!parse_ip_addr(cfile, &lease->address))
640 parse_string_list(cfile, &lease->medium, 0);
643 lease->filename = parse_string(cfile);
646 if (!parse_ip_addr(cfile, &lease->nextserver))
650 lease->server_name = parse_string(cfile);
653 lease->renewal = parse_date(cfile);
656 lease->rebind = parse_date(cfile);
659 lease->expiry = parse_date(cfile);
662 parse_option_decl(cfile, lease->options);
665 parse_warn("expecting lease declaration.");