33static unsigned char global_host_once = 1;
35static int parse_binding_value(
struct parse *cfile,
38static void parse_authoring_byte_order (
struct parse *cfile);
39static void parse_lease_id_format (
struct parse *cfile);
41static int parse_iaid_duid(
struct parse *cfile,
struct ia_xx** ia,
42 u_int32_t *iaid,
const char*
file,
int line);
69#if defined(LDAP_CONFIGURATION)
73 return ldap_read_config ();
80 int group_type,
int leasep)
93 ttype = trace_readleases_type;
95 ttype = trace_readconf_type;
114 tflen = strlen (dbuf);
115 ulen = ulen - tflen - 1;
116 fbuf = dbuf + tflen + 1;
121 if ((
file = open (filename, O_RDONLY | O_CLOEXEC)) < 0) {
123 log_error (
"Can't open lease database %s: %m --",
125 log_error (
" check for failed database %s!",
127 log_error (
"Please read the dhcpd.leases manual%s",
129 log_fatal (
"don't know what to do about this.");
131 log_fatal (
"Can't open %s: %m", filename);
135 cfile = (
struct parse *)0;
142 flen = lseek (
file, (off_t)0, SEEK_END);
145 log_fatal (
"Can't lseek on %s: %m", filename);
147 if (lseek (
file, (off_t)0, SEEK_SET) < 0)
150 if ((
sizeof(
void*) < 8) && flen > 0x7FFFFFFFUL)
151 log_fatal (
"%s: file is too long to buffer.", filename);
156 tflen = strlen (filename);
159 log_fatal (
"No memory for %s (%d bytes)",
163 strcpy (dbuf, filename);
166 fbuf = dbuf + tflen + 1;
167 result = read (
file, fbuf, ulen);
169 log_fatal (
"Can't read in %s: %m", filename);
171 log_fatal (
"%s: short read of %d bytes instead of %d.",
172 filename, ulen, result);
177 status =
new_parse(&cfile, -1, fbuf, ulen, filename, 0);
206 static int postconf_initialized;
207 static int leaseconf_initialized;
212 tflen = strlen (data);
213 flen = len - tflen - 1;
214 fbuf = data + tflen + 1;
220 status =
new_parse(&cfile, -1, fbuf, flen, data, 0);
222 if (ttype == trace_readleases_type)
231 if (!postconf_initialized && ttype == trace_readconf_type) {
233 postconf_initialized = 1;
236 if (!leaseconf_initialized && ttype == trace_readleases_type) {
238 leaseconf_initialized = 1;
294 "possibly corrupt lease file");
295 }
else if (token ==
IA_NA) {
297 }
else if (token ==
IA_TA) {
299 }
else if (token ==
IA_PD) {
301 }
else if (token ==
CLASS) {
307 }
else if (token ==
HOST) {
309 }
else if (token ==
GROUP) {
311#if defined (FAILOVER_PROTOCOL)
314 (cfile, (dhcp_failover_state_t *)0);
321 parse_authoring_byte_order(cfile);
323 log_error (
"Corrupt lease file - possible data loss!");
384 token =
peek_token (&val, (
unsigned *)0, cfile);
389 token =
next_token (&val, (
unsigned *)0, cfile);
391 parse_warn (cfile,
"filename string expected.");
404 if (global_host_once &&
406 global_host_once = 0;
407 log_error(
"WARNING: Host declarations are "
408 "global. They are not limited to "
409 "the scope you declared them in.");
415 "host declarations not allowed here.");
426 "group declarations not allowed here.");
437 parse_warn (cfile,
"shared-network parameters not %s.",
452 "subnet declarations not allowed here.");
478 status = shared_network_allocate (&share,
MDL);
480 log_fatal (
"Can't allocate shared subnet: %s",
481 isc_result_totext (status));
483 log_fatal (
"Can't allocate group for shared net");
514 share->
name = strdup(n);
516 if (share->
name == NULL)
517 log_fatal(
"Out of memory allocating default "
518 "shared network name (\"%s\").", n);
526 shared_network_dereference(&share,
MDL);
533 "class declarations not allowed here.");
544 "class declarations not allowed here.");
555 "class declarations not allowed here.");
566 "class declarations not allowed here.");
579 parse_warn(cfile,
"Host %s hardware address already "
588 parse_warn (cfile,
"hardware address parameter %s",
589 "not allowed here.");
601 "Only one fixed address "
602 "declaration per host.");
608 "fixed-address parameter not "
618 parse_warn (cfile,
"pool declared within pool.");
621 parse_warn (cfile,
"pool declared outside of network");
632 "range declaration not allowed here.");
645 "range6 declaration not allowed here.");
656 "prefix6 declaration not allowed here.");
667 "fixed-prefix6 declaration not "
678 parse_warn (cfile,
"pool6 declared within pool.");
681 parse_warn (cfile,
"pool6 declared outside of network");
692 token =
next_token (&val, (
unsigned *)0, cfile);
695 group -> authoritative = 0;
705 group -> authoritative = 1;
708 parse_warn (cfile,
"authority makes no sense here.");
718 log_fatal(
"Server identifier not in hash (%s:%d).",
725 token =
peek_token (&val, (
unsigned *)0, cfile);
726 if (token ==
SPACE) {
729 "option space definitions %s",
730 "may not be scoped.");
741 token =
peek_token (&val, (
unsigned *)0, cfile);
745 "option definitions%s",
746 " may not be scoped.");
758 option_name_hash_delete(
761 option_code_hash_delete(
792 goto insert_statement;
800 parse_warn (cfile,
"failover peers may only be %s",
801 "defined in shared-network");
802 log_error (
"declarations and the outer scope.");
806 token =
next_token (&val, (
unsigned *)0, cfile);
807#if defined (FAILOVER_PROTOCOL)
822 token =
next_token (&val, (
unsigned *)0, cfile);
823 parse_lease_id_format(cfile);
839 "expecting a declaration");
842 "expecting a parameter %s",
895#if defined (FAILOVER_PROTOCOL)
903 dhcp_failover_state_t *peer;
908 unsigned hba_len =
sizeof hba;
912 dhcp_failover_config_t *cp;
914 token =
next_token (&val, (
unsigned *)0, cfile);
921 token =
next_token (&val, (
unsigned *)0, cfile);
925 log_fatal (
"no memory for peer name %s", val);
928 parse_warn (cfile,
"expecting failover peer name.");
934 peer = (dhcp_failover_state_t *)0;
937 token =
next_token (&val, (
unsigned *)0, cfile);
940 parse_warn (cfile,
"failover peer reference not %s",
941 "in shared-network declaration");
944 parse_warn (cfile,
"reference to unknown%s%s",
945 " failover peer ", name);
949 dhcp_failover_state_reference
953 dhcp_failover_state_dereference (&peer,
MDL);
956 }
else if (token ==
STATE) {
958 parse_warn (cfile,
"state declaration for unknown%s%s",
959 " failover peer ", name);
964 dhcp_failover_state_dereference (&peer,
MDL);
967 }
else if (token !=
LBRACE) {
974 parse_warn (cfile,
"redeclaration of failover peer %s", name);
976 dhcp_failover_state_dereference (&peer,
MDL);
981 status = dhcp_failover_state_allocate (&peer,
MDL);
983 log_fatal (
"Can't allocate failover peer %s: %s",
984 name, isc_result_totext (status));
992 token =
next_token (&val, (
unsigned *)0, cfile);
998 peer -> i_am = primary;
1002 peer -> i_am = secondary;
1005 "secondary may not define %s",
1006 "load balance settings.");
1010 cp = &peer -> partner;
1017 dhcp_failover_state_dereference (&peer,
MDL);
1027 token =
next_token (&val, (
unsigned *)0, cfile);
1032 cp -> port = atoi (val);
1036 tp = &peer->max_lease_misbalance;
1040 tp = &peer->max_lease_ownership;
1044 tp = &peer->max_balance;
1048 tp = &peer->min_balance;
1052 tp = &peer->auto_partner_down;
1056 tp = &cp -> max_response_delay;
1058 token =
next_token (&val, (
unsigned *)0, cfile);
1062 dhcp_failover_state_dereference (&peer,
MDL);
1069 tp = &cp -> max_flying_updates;
1078 if (peer -> i_am == secondary)
1080 "secondary may not define %s",
1081 "load balance settings.");
1085 dhcp_failover_state_dereference (&peer,
MDL);
1088 if (hba_len != 32) {
1090 "HBA must be exactly 32 bytes.");
1099 memcpy (peer -> hba, hba, 32);
1103 token =
next_token (&val, (
unsigned *)0, cfile);
1104 if (peer -> i_am == secondary)
1106 "secondary may not define %s",
1107 "load balance settings.");
1111 dhcp_failover_state_dereference (&peer,
MDL);
1117 "0 and 256, inclusive");
1119 memset (hba, 0,
sizeof hba);
1120 for (i = 0; i < split; i++) {
1122 hba [i / 8] |= (1 << (i & 7));
1129 token =
next_token (&val, (
unsigned *)0, cfile);
1136 token =
next_token (&val, (
unsigned *)0, cfile);
1141 token =
next_token (&val, (
unsigned *)0, cfile);
1146 token =
next_token (&val, (
unsigned *)0, cfile);
1151 peer -> load_balance_max_secs = atoi (val);
1156 "invalid statement in peer declaration");
1158 dhcp_failover_state_dereference (&peer,
MDL);
1163 dhcp_failover_state_dereference (&peer,
MDL);
1166 }
while (token !=
RBRACE);
1171 if (!peer -> partner.address)
1172 parse_warn (cfile,
"peer address may not be omitted");
1175 peer->me.port = DEFAULT_FAILOVER_PORT;
1176 if (!peer->partner.port)
1177 peer->partner.port = DEFAULT_FAILOVER_PORT;
1179 if (peer -> i_am == primary) {
1182 "primary failover server must have hba or split.");
1183 }
else if (!peer -> mclt) {
1185 "primary failover server must have mclt.");
1189 if (!peer->max_lease_misbalance)
1190 peer->max_lease_misbalance = DEFAULT_MAX_LEASE_MISBALANCE;
1191 if (!peer->max_lease_ownership)
1192 peer->max_lease_ownership = DEFAULT_MAX_LEASE_OWNERSHIP;
1193 if (!peer->max_balance)
1194 peer->max_balance = DEFAULT_MAX_BALANCE_TIME;
1195 if (!peer->min_balance)
1196 peer->min_balance = DEFAULT_MIN_BALANCE_TIME;
1197 if (!peer->me.max_flying_updates)
1198 peer->me.max_flying_updates = DEFAULT_MAX_FLYING_UPDATES;
1199 if (!peer->me.max_response_delay)
1200 peer->me.max_response_delay = DEFAULT_MAX_RESPONSE_DELAY;
1214 peer -> name, isc_result_totext (status));
1215 dhcp_failover_state_dereference (&peer,
MDL);
1219 dhcp_failover_state_t *peer)
1224 dhcp_failover_state_t *state;
1225 dhcp_failover_config_t *cp;
1228 token =
next_token (&val, (
unsigned *)0, cfile);
1229 if (token !=
PEER) {
1235 token =
next_token (&val, (
unsigned *)0, cfile);
1239 log_fatal (
"failover peer name %s: no memory",
1243 parse_warn (cfile,
"expecting failover peer name.");
1249 state = (dhcp_failover_state_t *)0;
1252 parse_warn (cfile,
"unknown failover peer: %s", name);
1257 token =
next_token (&val, (
unsigned *)0, cfile);
1258 if (token !=
STATE) {
1265 state = (dhcp_failover_state_t *)0;
1266 dhcp_failover_state_reference (&state, peer,
MDL);
1268 token =
next_token (&val, (
unsigned *)0, cfile);
1273 dhcp_failover_state_dereference (&state,
MDL);
1277 token =
next_token (&val, (
unsigned *)0, cfile);
1284 token =
next_token (&val, (
unsigned *)0, cfile);
1285 if (token !=
STATE) {
1290 &cp -> state, &cp -> stos);
1294 cp = &state -> partner;
1298 if (state -> i_am == primary) {
1300 "mclt not valid for primary");
1303 token =
next_token (&val, (
unsigned *)0, cfile);
1308 state -> mclt = atoi (val);
1313 parse_warn (cfile,
"expecting state setting.");
1316 dhcp_failover_state_dereference (&state,
MDL);
1319 }
while (token !=
RBRACE);
1320 dhcp_failover_state_dereference (&state,
MDL);
1324 struct parse *cfile;
1388 parse_warn (cfile,
"unknown failover state");
1437void parse_authoring_byte_order (
struct parse *cfile)
1446 "authoring-byte-order specified too late.\n"
1447 "It must occur before the first lease in file\n");
1461 parse_warn(cfile,
"authoring-byte-order is invalid: "
1462 " it must be big-endian or little-endian.");
1468 log_error (
"WARNING: Lease file authored using different"
1469 " byte order, will attempt to convert");
1474 parse_warn(cfile,
"corrupt lease file; expecting a semicolon");
1494void parse_lease_id_format (
struct parse *cfile)
1509 parse_warn(cfile,
"lease-id-format is invalid: "
1510 " it must be octal or hex.");
1520 parse_warn(cfile,
"corrupt lease file; expecting a semicolon");
1558void get_permit(cfile, permit_head, is_allow, valid_from, valid_until)
1559 struct parse *cfile;
1560 struct permit **permit_head;
1562 TIME *valid_from, *valid_until;
1567 int need_clients = 1;
1640 if (*valid_from || *valid_until) {
1641 parse_warn(cfile,
"duplicate \"after\" clause.");
1657 parse_warn (cfile,
"expecting permit type.");
1667 if ((need_clients != 0) &&
1675 while (*permit_head)
1676 permit_head = &((*permit_head)->next);
1690 struct permit *plp, *prp;
1697 for (plp = lhs; plp; plp = plp ->
next) {
1699 for (prp = rhs; prp; prp = prp ->
next) {
1702 prp ->
class == plp ->
class)) {
1733 struct parse *cfile;
1741 int declaration = 0;
1742 isc_result_t status;
1743 struct lease *lpchain = NULL, *lp;
1746 status = pool_allocate(&
pool,
MDL);
1749 isc_result_totext (status));
1759 parse_warn(cfile,
"Dynamic pools are only valid inside "
1760 "subnet or shared-network statements.");
1769#if defined (FAILOVER_PROTOCOL)
1772 dhcp_failover_state_reference
1791 "expecting \"failover peer\".");
1795#if defined (FAILOVER_PROTOCOL)
1797 dhcp_failover_state_dereference
1802#if defined (FAILOVER_PROTOCOL)
1806 if (token !=
PEER) {
1818 dhcp_failover_state_dereference
1824 "failover peer %s: %s", val,
1825 isc_result_totext (status));
1875#if defined (FAILOVER_PROTOCOL)
1891 for (lp = lpchain; lp; lp = lp->
next) {
1892 pool_dereference(&lp->pool,
MDL);
1893 pool_reference(&lp->pool, pp,
MDL);
1896#if defined (BINARY_LEASES)
1910 for (; *p; p = &((*p)->next))
1918 parse_warn(cfile,
"Pool declaration with no address range.");
1919 log_error(
"Pool declarations must always contain at least");
1927 lease_reference(&lp, lpchain,
MDL);
1928 lease_dereference(&lpchain,
MDL);
1930 lease_reference(&lpchain, lp->
next,
MDL);
1931 lease_dereference(&lp->next,
MDL);
1932 lease_dereference(&lp,
MDL);
1942 struct parse *cfile;
1960 struct parse *cfile;
1967 int declaration = 0;
1970 isc_result_t status;
1977 parse_warn (cfile,
"expecting a name for host declaration.");
1983 status = host_allocate (&host,
MDL);
1985 log_fatal (
"can't allocate host decl struct %s: %s",
1986 name, isc_result_totext (status));
1991 host_dereference (&host,
MDL);
1999 token =
peek_token (&val, (
unsigned *)0, cfile);
2006 parse_warn (cfile,
"unexpected end of file");
2028 if (token ==
GROUP) {
2031 token =
next_token (&val, (
unsigned *)0, cfile);
2034 "expecting string or identifier.");
2040 val, strlen (val),
MDL)) {
2041 parse_warn (cfile,
"unknown group %s in host %s",
2044 if (host -> named_group)
2045 group_object_dereference
2046 (&host -> named_group,
MDL);
2047 group_object_reference (&host -> named_group,
2049 group_object_dereference (&go,
MDL);
2058 unsigned char *t = 0;
2066 sizeof(buf) - 1, buf);
2068 "Host '%s' already has a uid '%s'",
2075 token =
peek_token (&val, (
unsigned *)0, cfile);
2079 host -> client_identifier.terminated = 1;
2084 (
unsigned char *)0, &len,
':', 16, 8);
2087 "expecting hex list.");
2090 s = (
const char *)t;
2093 (&host -> client_identifier.buffer,
2094 len + host -> client_identifier.terminated,
MDL))
2095 log_fatal (
"no memory for uid for host %s.",
2097 host -> client_identifier.data =
2098 host -> client_identifier.buffer -> data;
2099 host -> client_identifier.len = len;
2100 memcpy (host -> client_identifier.buffer -> data, s,
2101 len + host -> client_identifier.terminated);
2113 "only one host-identifier allowed "
2124 "host-identifier v6relopt "
2125 "must have a number");
2129 host->
relays = atoi(val);
2132 "host-identifier v6relopt "
2133 "must have a number >= 0");
2137 }
else if (token !=
OPTION) {
2139 "host-identifier must be an option"
2186 (
unsigned char *)host ->
name,
2187 strlen (host ->
name),
MDL)) {
2189 host_dereference (&hp,
MDL);
2193 if (host ->
group -> statements ||
2194 (host ->
group -> authoritative !=
2196 if (host ->
group -> next)
2218 isc_result_totext (status));
2220 host_dereference (&host,
MDL);
2228 struct parse *cfile;
2234 struct class *
class = NULL, *pc = NULL;
2235 int declaration = 0;
2242 isc_result_t status = ISC_R_FAILURE;
2243 int matchedonce = 0;
2244 int submatchedonce = 0;
2262 class_reference(&
class, pc,
MDL);
2264 class_dereference(&pc,
MDL);
2279 data.len = strlen (val);
2282 log_fatal (
"no memory for class name.");
2284 data.terminated = 1;
2287 "implicit-vendor-class" :
"implicit-user-class";
2298 log_fatal (
"No memory for class name %s.", tname);
2299 strcpy (
name, tname);
2313 class_dereference (&pc,
MDL);
2317 data.terminated = 1;
2319 memcpy ((
char *)
data.buffer ->
data, val,
2325 class_dereference (&pc,
MDL);
2329 parse_warn (cfile,
"Expecting string or hex list.");
2331 class_dereference (&pc,
MDL);
2339 class_hash_lookup (&
class, pc -> hash,
2346 status = subclass_allocate (&
class,
MDL);
2348 status = class_allocate (&
class,
MDL);
2352 class_reference (&
class -> superclass, pc,
MDL);
2353 class -> lease_limit = pc -> lease_limit;
2354 if (
class -> lease_limit) {
2355 class -> billed_leases =
2356 dmalloc (
class -> lease_limit *
2358 if (!
class -> billed_leases)
2360 memset (
class -> billed_leases, 0,
2361 (
class -> lease_limit *
2362 sizeof (
struct lease *)));
2367 log_fatal (
"No memory for subclass hash.");
2368 class_hash_add (pc -> hash,
2369 (
const char *)
class -> hash_string.data,
2370 class -> hash_string.len,
2371 (
void *)
class,
MDL);
2376 log_fatal (
"no memory to clone class group.");
2385 log_fatal (
"no memory for class statement.");
2389 stmt -> data.option -> data = data;
2393 option_code_hash_lookup(
2398 class -> statements = stmt;
2411 if (
class -> superclass) {
2413 if (token ==
SEMI) {
2417 status = class_reference (cp,
class,
MDL);
2418 class_dereference (&
class,
MDL);
2420 class_dereference (&pc,
MDL);
2430 class_dereference (&
class,
MDL);
2432 class_dereference (&pc,
MDL);
2443 parse_warn (cfile,
"unexpected end of file");
2445 }
else if (token ==
DYNAMIC) {
2457 }
else if (token ==
MATCH) {
2460 "invalid match in subclass.");
2471 "one 'match if' clause.");
2482 "expecting boolean expr.");
2486#if defined (DEBUG_EXPRESSION_PARSE)
2492 }
else if (token ==
SPAWN) {
2496 "invalid spawn in subclass.");
2500 class -> spawning = 1;
2502 if (token !=
WITH) {
2504 "expecting with after spawn");
2509 if (submatchedonce) {
2511 "can't override existing %s.",
2523 "expecting data expr.");
2527#if defined (DEBUG_EXPRESSION_PARSE)
2533 }
else if (token ==
LEASE) {
2536 if (token !=
LIMIT) {
2549 class -> lease_limit = atoi (val);
2552 class -> billed_leases =
2553 dmalloc (
class -> lease_limit *
2555 if (!
class -> billed_leases)
2556 log_fatal (
"no memory for billed leases.");
2557 memset (
class -> billed_leases, 0,
2558 (
class -> lease_limit *
2559 sizeof (
struct lease *)));
2571 struct class *theclass = NULL;
2576 class_dereference(&theclass,
MDL);
2579 class_hash_delete(pc->hash,
2591 class_reference (&c ->
nic,
class,
MDL);
2596 status = class_reference (cp,
class,
MDL);
2597 class_dereference (&
class,
MDL);
2599 class_dereference (&pc,
MDL);
2607 struct parse *cfile;
2614 int declaration = 0;
2615 isc_result_t status;
2618 status = shared_network_allocate (&share,
MDL);
2620 log_fatal (
"Can't allocate shared subnet: %s",
2621 isc_result_totext (status));
2623 log_fatal (
"Can't clone group for shared net");
2629 token =
peek_token (&val, (
unsigned *)0, cfile);
2634 parse_warn (cfile,
"zero-length shared network name");
2635 val =
"<no-name-given>";
2639 log_fatal (
"no memory for shared network name");
2645 "expecting a name for shared-network");
2647 shared_network_dereference (&share,
MDL);
2654 shared_network_dereference (&share,
MDL);
2659 token =
peek_token (&val, (
unsigned *)0, cfile);
2664 "empty shared-network decl");
2667 shared_network_dereference (&share,
MDL);
2671 parse_warn (cfile,
"unexpected end of file");
2675 token =
next_token (&val, (
unsigned *)0, cfile);
2687 shared_network_dereference (&share,
MDL);
2692common_subnet_parsing(
struct parse *cfile,
2698 int declaration = 0;
2714 parse_warn (cfile,
"unexpected end of file");
2731 if (
share->subnets == NULL) {
2744 subnet_dereference(&
share->subnets,
2746 subnet_reference(&
share->subnets,
2764 struct parse *cfile;
2771 unsigned char addr [4];
2772 unsigned len =
sizeof addr;
2773 isc_result_t status;
2776 status = subnet_allocate (&
subnet,
MDL);
2778 log_fatal (
"Allocation of new subnet failed: %s",
2779 isc_result_totext (status));
2794 log_fatal(
"Allocation of group for new subnet failed.");
2808 token =
next_token (&val, (
unsigned *)0, cfile);
2831 if (maskstr == NULL) {
2832 log_fatal(
"Allocation of subnet maskstr failed: %s",
2837 "subnet %s netmask %s: bad subnet number/mask combination.",
2858 isc_result_t status;
2863 const static int mask[] = { 0x00, 0x80, 0xC0, 0xE0,
2864 0xF0, 0xF8, 0xFC, 0xFE };
2869 parse_warn(cfile,
"subnet6 statement is only supported "
2870 "in DHCPv6 and DHCPv4o6 modes.");
2876 parse_warn(cfile,
"subnet6 statement is only supported "
2886 log_fatal(
"Allocation of new subnet failed: %s",
2887 isc_result_totext(status));
2903 log_fatal(
"Allocation of group for new subnet failed.");
2914 if (token !=
SLASH) {
2933 parse_warn(cfile,
"Expecting a number between 0 and 128.");
2940 parse_warn(cfile,
"New subnet mask too short.");
2951 if (ofs < subnet->netmask.len) {
2954 while (--ofs >= 0) {
2962 "subnet %s/%d: prefix not long enough for address.",
2969 if (!common_subnet_parsing(cfile, share,
subnet)) {
2978 struct parse *cfile;
2984 int declaration = 0;
2986 isc_result_t status;
2994 log_fatal(
"no memory for explicit group.");
3002 log_fatal(
"no memory for group decl name %s", val);
3024 }
else if (token ==
DYNAMIC) {
3028 }
else if (token ==
STATIC) {
3049 status = group_object_allocate(&t,
MDL);
3051 log_fatal(
"no memory for group decl %s: %s",
3052 val, isc_result_totext(status));
3061 group_object_dereference(&t,
MDL);
3071 struct parse *cfile,
3108 if (token ==
COMMA) {
3111 }
while (token ==
COMMA);
3145 unsigned char addr [4];
3146 unsigned len =
sizeof addr;
3154 int noequal, newbinding;
3157 isc_result_t status;
3161 unsigned buflen = 0;
3162 struct class *
class;
3165 status = lease_allocate (&
lease,
MDL);
3183 token =
next_token (&val, (
unsigned *)0, cfile);
3187 parse_warn (cfile,
"unexpected end of file");
3190 strncpy (tbuf, val,
sizeof tbuf);
3191 tbuf [(
sizeof tbuf) - 1] = 0;
3243 token =
peek_token (&val, (
unsigned *)0, cfile);
3245 unsigned char *tuid;
3247 if (buflen < sizeof lease ->
uid_buf) {
3252 tuid = ((
unsigned char *)
3256 lease_dereference (&
lease,
3268 (cfile, (
unsigned char *)0,
3269 &buflen,
':', 16, 8));
3292 token =
next_token (&val, (
unsigned *)0, cfile);
3331 token =
next_token (&val, (
unsigned *)0, cfile);
3337 goto do_binding_state;
3347 goto do_binding_state;
3353 token =
next_token (&val, (
unsigned *)0, cfile);
3354 if (token !=
STATE) {
3359 token =
next_token (&val, (
unsigned *)0, cfile);
3397 "%s: expecting a binding state.",
3403 if (seenbit == 256) {
3412 if (!(seenmask & 128))
3416 if (!(seenmask & 512))
3418 }
else if (seenbit == 128)
3420 else if (seenbit == 512)
3423 log_fatal(
"Impossible condition at %s:%d.",
3431 token =
peek_token (&val, (
unsigned *)0, cfile);
3446 "expecting a hostname.");
3456 class = (struct
class *)0;
3457 token =
next_token (&val, (
unsigned *)0, cfile);
3458 if (token ==
CLASS) {
3460 (
unsigned *)0, cfile);
3468 if (
lease -> billing_class)
3469 class_dereference (&
lease -> billing_class,
3474 "unknown class %s", val);
3477 if (
lease -> billing_class)
3478 class_dereference (&
lease -> billing_class,
3488 class_reference (&
lease -> billing_class,
3490 class_dereference (&
class,
MDL);
3504 on->data.on.statements) {
3511 on->data.on.statements) {
3529 "agent option expected.");
3536 log_error (
"no memory to stash agent option");
3540 *p; p = &((*p) -> cdr))
3544 &((*p) -> car)), oc,
MDL);
3552 token =
next_token (&val, (
unsigned *)0, cfile);
3555 "%s can't be a variable name",
3571 if (!
lease -> scope)
3593 log_fatal(
"no memory for binding value.");
3596 token =
next_token (&val, (
unsigned *)0, cfile);
3597 if (token !=
EQUAL) {
3599 "expecting '=' in set statement.");
3609 if (!parse_binding_value(cfile, nv)) {
3636 if (!strcasecmp (val,
"ddns-fwd-name")) {
3640 }
else if (!strcasecmp (val,
"ddns-rev-name")) {
3645 parse_warn(cfile,
"Unexpected configuration "
3653 if (seenmask & seenbit) {
3655 "Too many %s parameters in lease %s\n",
3658 seenmask |= seenbit;
3663 if (!(seenmask & 256)) {
3667#if defined (FAILOVER_PROTOCOL)
3674#if defined (FAILOVER_PROTOCOL)
3687 if (!(seenmask & 65536))
3710 if ((cfile == NULL) || (
value == NULL))
3717 value->type = binding_data;
3718 value->value.data.len = buflen;
3725 memcpy(
data->buffer->data, val, buflen + 1);
3728 data->terminated = 1;
3730 value->type = binding_data;
3745 memcpy(
data->buffer->data, s,
data->len);
3750 }
else if (token ==
PERCENT) {
3754 parse_warn(cfile,
"expecting decimal number.");
3759 value->type = binding_numeric;
3760 value->value.intval = atol(val);
3761 }
else if (token ==
NAME) {
3763 value->type = binding_boolean;
3764 if (!strcasecmp(val,
"true"))
3765 value->value.boolean = 1;
3766 else if (!strcasecmp(val,
"false"))
3767 value->value.boolean = 0;
3769 parse_warn(cfile,
"expecting true or false");
3775 parse_warn (cfile,
"expecting a constant value.");
3788 struct parse *cfile;
3791 struct pool *inpool;
3792 struct lease **lpchain;
3794 struct iaddr low, high, net;
3795 unsigned char addr [4];
3796 unsigned len =
sizeof addr;
3803 isc_result_t status;
3814 memcpy (low.
iabuf, addr, len);
3818 token =
peek_token (&val, (
unsigned *)0, cfile);
3825 memcpy (high.
iabuf, addr, len);
3829 token =
next_token (&val, (
unsigned *)0, cfile);
3830 if (token !=
SEMI) {
3848 parse_warn (cfile,
"address range not on network %s",
3850 log_error (
"Be sure to place pool statement after %s",
3851 "related subnet declarations.");
3857 struct pool *last = (
struct pool *)0;
3867 permit_dynamic_bootp_clients)) ||
3872 permit_all_clients))) {
3881 status = pool_allocate (&
pool,
MDL);
3883 log_fatal (
"no memory for ad-hoc pool: %s",
3884 isc_result_totext (status));
3887 log_fatal (
"no memory for ad-hoc permit.");
3893 pool -> permit_list = p;
3896 pool -> prohibit_list = p;
3906 log_fatal (
"no memory for anon pool group.");
3910 pool_reference (&
pool, last,
MDL);
3916 pool_reference (&
pool, inpool,
MDL);
3919#if defined (FAILOVER_PROTOCOL)
3923 parse_warn (cfile,
"dynamic-bootp flag is %s",
3924 "not permitted for address");
3925 log_error (
"range declarations where there is a failover");
3926 log_error (
"peer in scope. If you wish to declare an");
3927 log_error (
"address range from which dynamic bootp leases");
3928 log_error (
"can be allocated, please declare it within a");
3929 log_error (
"pool declaration that also contains the \"no");
3930 log_error (
"failover\" statement. The failover protocol");
3931 log_error (
"itself does not permit dynamic bootp - this");
3932 log_error (
"is not a limitation specific to the ISC DHCP");
3933 log_error (
"server. Please don't ask me to defend this");
3934 log_error (
"until you have read and really tried %s",
3936 log_error (
"the failover protocol specification.");
3946 pool_dereference (&
pool,
MDL);
3951add_ipv6_pool_to_subnet(
struct subnet *
subnet, u_int16_t type,
3952 struct iaddr *lo_addr,
int bits,
int units,
3955 struct in6_addr tmp_in6_addr;
3962 if (lo_addr->
len !=
sizeof(tmp_in6_addr)) {
3963 log_fatal(
"Internal error: Attempt to add non-IPv6 address "
3964 "to IPv6 shared network.");
3966 memcpy(&tmp_in6_addr, lo_addr->
iabuf,
sizeof(tmp_in6_addr));
3983 pool->subnet = NULL;
3988 pool->ipv6_pond = NULL;
3998 while (pond->
ipv6_pools[num_pools] != NULL) {
4006 if (num_pools > 0) {
4008 sizeof(
struct ipv6_pool *) * num_pools);
4036 if ((
units -
bits) > (
sizeof(isc_uint64_t) * 8)) {
4041 isc_uint64_t space_left
4046 if (addon > space_left) {
4086 struct ipv6_pond *pond = NULL, *last = NULL;
4088 isc_result_t status;
4106 log_fatal (
"no memory for ad-hoc ipv6 pond: %s",
4107 isc_result_totext (status));
4110 log_fatal (
"no memory for ad-hoc ipv6 permit.");
4113 p->
type = permit_all_clients;
4126 log_fatal (
"no memory for anon pool group.");
4141 struct iaddr lo, hi;
4151 parse_warn(cfile,
"range6 statement is only supported "
4171 parse_warn(cfile,
"range6 start address is outside the subnet");
4179 memset(&net, 0,
sizeof(net));
4186 if (token ==
SLASH) {
4199 if ((bits < 0) || (bits > 128)) {
4200 parse_warn(cfile,
"networks have 0 to 128 bits");
4206 "network mask smaller than subnet mask");
4221 parse_warn(cfile,
"temporary mask too short");
4259 "range6 end address is outside the subnet");
4269 log_fatal(
"Error converting range to CIDR networks");
4280 if (inpond != NULL) {
4283 add_ipv6_pond_to_network(
group, &pond);
4287 for (p=nets; p != NULL; p=p->
next) {
4300 if (token !=
SEMI) {
4313 struct iaddr lo, hi;
4322 parse_warn(cfile,
"prefix6 statement is only supported "
4349 " is outside the subnet");
4369 " is outside the subnet");
4379 if (token !=
SLASH) {
4393 if ((bits <= 0) || (bits >= 128)) {
4394 parse_warn(cfile,
"networks have 0 to 128 bits (exclusive)");
4405 parse_warn(cfile,
"network mask smaller than subnet mask");
4418 if (token !=
SEMI) {
4429 log_fatal(
"Error converting prefix to CIDR");
4438 if (inpond != NULL) {
4441 add_ipv6_pond_to_network(
group, &pond);
4444 for (p = nets; p != NULL; p = p->
next) {
4477 while (*h != NULL) {
4497 if (token !=
SLASH) {
4513 if (token !=
SEMI) {
4526 parse_warn(cfile,
"networks have 0 to 128 bits");
4562 struct parse *cfile;
4570 int declaration = 0;
4571 isc_result_t status;
4577 isc_result_totext (status));
4584 parse_warn(cfile,
"pool6s are only valid inside "
4585 "subnet statements.");
4658 for (; *p; p = &((*p)->next))
4665 parse_warn (cfile,
"Pool6 declaration with no %s.",
4666 "address range6 or prefix6");
4667 log_error (
"Pool6 declarations must always contain at least");
4668 log_error (
"one range6 or prefix6 statement.");
4686 struct parse *cfile;
4691 unsigned char rf = flag;
4700 token =
next_token (&val, (
unsigned *)0, cfile);
4735 parse_warn (cfile,
"expecting allow/deny key");
4743 log_fatal(
"Unable to find server option %u (%s:%d).",
4758 struct ia_xx *ia = NULL;
4760 struct ia_xx *old_ia;
4769 char addr_buf[
sizeof(
"ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
4778 parse_warn(cfile,
"IA_NA is only supported in DHCPv6 mode.");
4783 if (!parse_iaid_duid(cfile, &ia, &iaid,
MDL)) {
4791 parse_warn(cfile,
"corrupt lease file; expecting left brace");
4799 if (token ==
RBRACE)
break;
4801 if (token ==
CLTT) {
4808 "expecting IAADDR or right brace");
4815 "expecting IPv6 address");
4823 "expecting left brace");
4833 if (token ==
RBRACE)
break;
4842 "unexpected end of file");
4848 if (token !=
STATE) {
4882 if (token !=
SEMI) {
4899 prefer = atoi (val);
4908 if (token ==
SEMI) {
4912 "corrupt lease file; "
4913 "expecting semicolon.");
4936 if (token ==
SEMI) {
4940 "corrupt lease file; "
4941 "expecting semicolon.");
4953 if ((token !=
NAME) &&
4985 if (bnd->
name == NULL) {
4989 strcpy(bnd->
name, val);
5002 if (token !=
EQUAL) {
5008 if (!parse_binding_value(cfile, nv)) {
5068 "expecting ia_na contents, "
5077 "missing state in iaaddr");
5080 if (end_time == -1) {
5082 "missing end time in iaaddr");
5092 iaaddr->
state = state;
5094 iaaddr->
valid = valid;
5098 if (scope != NULL) {
5110 (i < 2) &&
on_star[i] != NULL ;
5113 on_star[i]->data.on.statements) {
5119 on_star[i]->data.on.statements) {
5131 inet_ntop(AF_INET6, &iaaddr->
addr,
5132 addr_buf,
sizeof(addr_buf));
5133 log_error(
"No pool found for IA_NA address %s",
5139 if ((
pool->ipv6_pond->use_eui_64) &&
5142 log_error(
"Non EUI-64 lease in EUI-64 pool: %s"
5153 inet_ntop(AF_INET6, &iaaddr->
addr,
5154 addr_buf,
sizeof(addr_buf));
5155 parse_warn(cfile,
"duplicate na lease for address %s",
5206 struct ia_xx *ia = NULL;
5208 struct ia_xx *old_ia;
5217 char addr_buf[
sizeof(
"ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
5226 parse_warn(cfile,
"IA_TA is only supported in DHCPv6 mode.");
5231 if (!parse_iaid_duid(cfile, &ia, &iaid,
MDL)) {
5239 parse_warn(cfile,
"corrupt lease file; expecting left brace");
5247 if (token ==
RBRACE)
break;
5249 if (token ==
CLTT) {
5256 "expecting IAADDR or right brace");
5263 "expecting IPv6 address");
5271 "expecting left brace");
5281 if (token ==
RBRACE)
break;
5290 "unexpected end of file");
5296 if (token !=
STATE) {
5330 if (token !=
SEMI) {
5347 prefer = atoi (val);
5356 if (token ==
SEMI) {
5360 "corrupt lease file; "
5361 "expecting semicolon.");
5384 if (token ==
SEMI) {
5388 "corrupt lease file; "
5389 "expecting semicolon.");
5401 if ((token !=
NAME) &&
5433 if (bnd->
name == NULL) {
5437 strcpy(bnd->
name, val);
5450 if (token !=
EQUAL) {
5456 if (!parse_binding_value(cfile, nv)) {
5516 "expecting ia_ta contents, "
5525 "missing state in iaaddr");
5528 if (end_time == -1) {
5530 "missing end time in iaaddr");
5540 iaaddr->
state = state;
5542 iaaddr->
valid = valid;
5546 if (scope != NULL) {
5558 (i < 2) &&
on_star[i] != NULL ;
5561 on_star[i]->data.on.statements) {
5567 on_star[i]->data.on.statements) {
5579 inet_ntop(AF_INET6, &iaaddr->
addr,
5580 addr_buf,
sizeof(addr_buf));
5581 log_error(
"No pool found for IA_TA address %s",
5590 inet_ntop(AF_INET6, &iaaddr->
addr,
5591 addr_buf,
sizeof(addr_buf));
5592 parse_warn(cfile,
"duplicate ta lease for address %s",
5643 struct ia_xx *ia = NULL;
5645 struct ia_xx *old_ia;
5655 char addr_buf[
sizeof(
"ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
5664 parse_warn(cfile,
"IA_PD is only supported in DHCPv6 mode.");
5669 if (!parse_iaid_duid(cfile, &ia, &iaid,
MDL)) {
5677 parse_warn(cfile,
"corrupt lease file; expecting left brace");
5685 if (token ==
RBRACE)
break;
5687 if (token ==
CLTT) {
5693 parse_warn(cfile,
"corrupt lease file; expecting "
5694 "IAPREFIX or right brace");
5701 "expecting IPv6 prefix");
5709 "expecting left brace");
5719 if (token ==
RBRACE)
break;
5728 "unexpected end of file");
5734 if (token !=
STATE) {
5768 if (token !=
SEMI) {
5785 prefer = atoi (val);
5794 if (token ==
SEMI) {
5798 "corrupt lease file; "
5799 "expecting semicolon.");
5822 if (token ==
SEMI) {
5826 "corrupt lease file; "
5827 "expecting semicolon.");
5839 if ((token !=
NAME) &&
5871 if (bnd->
name == NULL) {
5875 strcpy(bnd->
name, val);
5888 if (token !=
EQUAL) {
5894 if (!parse_binding_value(cfile, nv)) {
5954 "expecting ia_pd contents, "
5963 "missing state in iaprefix");
5966 if (end_time == -1) {
5968 "missing end time in iaprefix");
5977 iapref->
plen = plen;
5978 iapref->
state = state;
5980 iapref->
valid = valid;
5984 if (scope != NULL) {
5996 (i < 2) &&
on_star[i] != NULL ;
5999 on_star[i]->data.on.statements) {
6005 on_star[i]->data.on.statements) {
6019 inet_ntop(AF_INET6, &iapref->
addr,
6020 addr_buf,
sizeof(addr_buf));
6021 log_error(
"No pool found for prefix %s/%d", addr_buf,
6030 inet_ntop(AF_INET6, &iapref->
addr,
6031 addr_buf,
sizeof(addr_buf));
6032 parse_warn(cfile,
"duplicate pd lease for address %s",
6092 unsigned char bytes[128];
6102 memset(&duid, 0x0,
sizeof(duid));
6104 log_fatal(
"parse_server_duid: out of memory");
6107 memcpy(duid.buffer->data, bytes,
len);
6109 duid.data = duid.buffer->data;
6133 u_int32_t enterprise_number;
6160 parse_warn(cfile,
"enterprise number expected");
6164 enterprise_number = atoi(val);
6176 memset(&duid, 0,
sizeof(duid));
6177 duid.len = 2 + 4 +
len;
6179 log_fatal(
"Out of memory storing DUID");
6181 duid.data = (
unsigned char *)duid.buffer->data;
6183 putULong(duid.buffer->data + 2, enterprise_number);
6184 memcpy(duid.buffer->data + 6, val,
len);
6197 else if (token ==
LL) {
6220 memset(&ll_addr, 0,
sizeof(ll_addr));
6228 memset(&duid, 0,
sizeof(duid));
6229 duid.len = 2 + 2 + ll_addr.len;
6231 log_fatal(
"Out of memory storing DUID");
6233 duid.data = (
unsigned char *)duid.buffer->data;
6235 putUShort(duid.buffer->data + 2, ll_type);
6236 memcpy(duid.buffer->data + 4,
6237 ll_addr.data, ll_addr.len);
6252 else if (token ==
LLT) {
6282 llt_time = atoi(val);
6284 memset(&ll_addr, 0,
sizeof(ll_addr));
6292 memset(&duid, 0,
sizeof(duid));
6293 duid.len = 2 + 2 + 4 + ll_addr.len;
6295 log_fatal(
"Out of memory storing DUID");
6297 duid.data = (
unsigned char *)duid.buffer->data;
6299 putUShort(duid.buffer->data + 2, ll_type);
6300 putULong(duid.buffer->data + 4, llt_time);
6301 memcpy(duid.buffer->data + 8,
6302 ll_addr.data, ll_addr.len);
6319 else if (token ==
NUMBER) {
6320 duid_type_num = atoi(val);
6332 memset(&duid, 0,
sizeof(duid));
6335 log_fatal(
"Out of memory storing DUID");
6337 duid.data = (
unsigned char *)duid.buffer->data;
6338 putUShort(duid.buffer->data, duid_type_num);
6339 memcpy(duid.buffer->data + 2, val,
len);
6349 parse_warn(cfile,
"DUID type of LLT, EN, or LL expected");
6358 if (token !=
SEMI) {
6382 memcpy(&
value, source, 4);
6386 "authoring-byte-order not in the lease file.\n"
6387 "Assuming file byte order matches this server.\n");
6393 ((
value << 8) & 0xff0000) |
6394 ((
value >> 8) & 0xff00) |
6395 ((
value << 24) & 0xff000000));
6416parse_iaid_duid(
struct parse* cfile,
struct ia_xx** ia, u_int32_t *iaid,
6418 unsigned char bytes[132];
6422 log_error(
"parse_iaid_duid: ia ptr cannot be null");
6430 "iaid+ia_xx string too short");
6441 log_fatal(
"parse_iaid_duid:Out of memory.");
int group_dereference(struct group **ptr, const char *file, int line)
int option_cache_reference(struct option_cache **ptr, struct option_cache *src, const char *file, int line)
int buffer_allocate(struct buffer **ptr, unsigned len, const char *file, int line)
int option_chain_head_allocate(struct option_chain_head **ptr, const char *file, int line)
void data_string_forget(struct data_string *data, const char *file, int line)
int group_reference(struct group **ptr, struct group *bp, const char *file, int line)
int binding_value_reference(struct binding_value **ptr, struct binding_value *src, const char *file, int line)
int executable_statement_reference(struct executable_statement **ptr, struct executable_statement *bp, const char *file, int line)
int binding_scope_reference(struct binding_scope **ptr, struct binding_scope *bp, const char *file, int line)
int binding_scope_allocate(struct binding_scope **ptr, const char *file, int line)
void data_string_copy(struct data_string *dest, const struct data_string *src, const char *file, int line)
int executable_statement_allocate(struct executable_statement **ptr, const char *file, int line)
int option_cache_allocate(struct option_cache **cptr, const char *file, int line)
int binding_value_allocate(struct binding_value **cptr, const char *file, int line)
enum dhcp_token peek_token(const char **rval, unsigned *rlen, struct parse *cfile)
enum dhcp_token next_token(const char **rval, unsigned *rlen, struct parse *cfile)
isc_result_t end_parse(struct parse **cfile)
isc_result_t new_parse(struct parse **cfile, int file, char *inbuf, unsigned buflen, const char *name, int eolp)
int option_cache_dereference(struct option_cache **ptr, const char *file, int line)
unsigned char * parse_numeric_aggregate(struct parse *cfile, unsigned char *buf, unsigned *max, int separator, int base, unsigned size)
int parse_string(struct parse *cfile, char **sptr, unsigned *lptr)
int parse_boolean_expression(struct expression **expr, struct parse *cfile, int *lose)
struct collection * collections
int parse_ip6_addr_expr(struct expression **expr, struct parse *cfile)
void skip_to_semi(struct parse *cfile)
int parse_option_statement(struct executable_statement **result, struct parse *cfile, int lookups, struct option *option, enum statement_op op)
int parse_X(struct parse *cfile, u_int8_t *buf, unsigned max)
int parse_semi(struct parse *cfile)
int parse_option_code_definition(struct parse *cfile, struct option *option)
int parse_ip6_prefix(struct parse *cfile, struct iaddr *addr, u_int8_t *plen)
int parse_ip6_addr(struct parse *cfile, struct iaddr *addr)
int parse_option_decl(struct option_cache **oc, struct parse *cfile)
TIME parse_date(struct parse *cfile)
void skip_to_rbrace(struct parse *cfile, int brace_count)
int parse_warn(struct parse *cfile, const char *fmt,...)
int parse_data_expression(struct expression **expr, struct parse *cfile, int *lose)
char * parse_host_name(struct parse *cfile)
int parse_ip_addr_or_hostname(struct expression **expr, struct parse *cfile, int uniform)
int parse_cshl(struct data_string *data, struct parse *cfile)
void parse_hardware_param(struct parse *cfile, struct hardware *hardware)
int parse_on_statement(struct executable_statement **result, struct parse *cfile, int *lose)
int parse_option_data(struct expression **expr, struct parse *cfile, int lookups, struct option *option)
void parse_option_space_decl(struct parse *cfile)
int parse_executable_statement(struct executable_statement **result, struct parse *cfile, int *lose, enum expression_context case_context)
isc_result_t parse_option_name(struct parse *cfile, int allocate, int *known, struct option **opt)
TIME parse_date_core(struct parse *cfile)
void print_expression(char *name, struct expression *expr) const
void print_hex_or_string(unsigned len, const u_int8_t *data, unsigned limit, char *buf)
void parse_group_declaration(struct parse *cfile, struct group *group)
isc_result_t conf_file_subparse(struct parse *cfile, struct group *group, int group_type)
void parse_address_range(struct parse *cfile, struct group *group, int type, struct pool *inpool, struct lease **lpchain)
void parse_ia_na_declaration(struct parse *cfile)
int parse_allow_deny(struct option_cache **oc, struct parse *cfile, int flag)
int parse_lease_declaration(struct lease **lp, struct parse *cfile)
int parse_class_declaration(struct class **cp, struct parse *cfile, struct group *group, int type)
int permit_list_match(struct permit *lhs, struct permit *rhs)
isc_result_t read_conf_file(const char *filename, struct group *group, int group_type, int leasep)
void parse_host_declaration(struct parse *cfile, struct group *group)
void get_permit(struct parse *cfile, struct permit **permit_head, int is_allow, TIME *valid_from, TIME *valid_until)
Parse allow and deny statements.
int parse_lbrace(struct parse *cfile)
void parse_subnet_declaration(struct parse *cfile, struct shared_network *share)
void parse_subnet6_declaration(struct parse *cfile, struct shared_network *share)
void parse_shared_net_declaration(struct parse *cfile, struct group *group)
int parse_fixed_addr_param(struct option_cache **oc, struct parse *cfile, enum dhcp_token type)
int parse_statement(struct parse *cfile, struct group *group, int type, struct host_decl *host_decl, int declaration)
void parse_ia_ta_declaration(struct parse *cfile)
void parse_pool_statement(struct parse *cfile, struct group *group, int type)
Parse a pool statement.
void parse_ia_pd_declaration(struct parse *cfile)
isc_result_t lease_file_subparse(struct parse *cfile)
void putUShort(unsigned char *, u_int32_t)
void putULong(unsigned char *, u_int32_t)
isc_result_t find_class(struct class **c, const char *s, const char *file, int line)
void db_startup(int testp)
#define DHO_VENDOR_CLASS_IDENTIFIER
#define DHO_DHCP_SERVER_IDENTIFIER
void parse_failover_peer(struct parse *, struct group *, int)
#define skip_token(a, b, c)
isc_result_t ipv6_pond_reference(struct ipv6_pond **pond, struct ipv6_pond *src, const char *file, int line)
reference an IPv6 pond structure.
isc_result_t delete_class(struct class *, int)
const char * pin6_addr(const struct in6_addr *)
#define CLASS_TYPE_VENDOR
void parse_server_duid(struct parse *cfile)
void trace_conf_stop(trace_type_t *ttype)
isc_result_t ia_add_iasubopt(struct ia_xx *ia, struct iasubopt *iasubopt, const char *file, int line)
isc_result_t ipv6_pool_allocate(struct ipv6_pool **pool, u_int16_t type, const struct in6_addr *start_addr, int bits, int units, const char *file, int line)
Create a new IPv6 lease pool structure.
void parse_server_duid_conf(struct parse *cfile)
#define HOST_DECL_DYNAMIC
isc_result_t find_failover_peer(dhcp_failover_state_t **, const char *, const char *, int)
void free_permit(struct permit *, const char *, int)
uint32_t parse_byte_order_uint32(const void *source)
struct universe agent_universe
isc_result_t delete_host(struct host_decl *, int)
int permit_list_match(struct permit *, struct permit *)
isc_result_t add_ipv6_pool(struct ipv6_pool *pool)
#define SV_CLIENT_UPDATES
void parse_trace_setup(void)
void parse_prefix6(struct parse *cfile, struct group *group, struct ipv6_pond *)
void set_server_duid(struct data_string *new_duid)
const char * path_dhcpd_db
void trace_conf_input(trace_type_t *, unsigned, char *)
isc_result_t ia_allocate(struct ia_xx **ia, u_int32_t iaid, const char *duid, unsigned int duid_len, const char *file, int line)
struct ipv6_pool ** pools
#define CLASS_TYPE_SUBCLASS
isc_result_t ipv6_pond_dereference(struct ipv6_pond **pond, const char *file, int line)
de-reference an IPv6 pond structure.
#define SV_BOOT_UNKNOWN_CLIENTS
isc_result_t enter_failover_peer(dhcp_failover_state_t *)
void set_server_duid_type(int type)
isc_result_t enter_host(struct host_decl *, int, int)
void new_shared_network_interface(struct parse *, struct shared_network *, const char *)
host_hash_t * host_name_hash
const char * path_dhcpd_conf
void parse_failover_state_declaration(struct parse *, dhcp_failover_state_t *)
void enter_lease(struct lease *)
isc_result_t ipv6_pond_allocate(struct ipv6_pond **pond, const char *file, int line)
Create a new IPv6 pond structure.
struct universe server_universe
void enter_shared_network(struct shared_network *)
void parse_fixed_prefix6(struct parse *cfile, struct host_decl *host_decl)
isc_result_t ia_dereference(struct ia_xx **ia, const char *file, int line)
#define GROUP_OBJECT_STATIC
struct universe dhcp_universe
int subnet_inner_than(const struct subnet *, const struct subnet *, int)
#define GROUP_OBJECT_DYNAMIC
isc_result_t find_ipv6_pool(struct ipv6_pool **pool, u_int16_t type, const struct in6_addr *addr)
struct permit * new_permit(const char *, int)
isc_result_t ipv6_pool_dereference(struct ipv6_pool **pool, const char *file, int line)
de-reference an IPv6 pool structure.
void parse_address_range6(struct parse *cfile, struct group *group, struct ipv6_pond *)
void postdb_startup(void)
isc_result_t iasubopt_dereference(struct iasubopt **iasubopt, const char *file, int line)
void enter_subnet(struct subnet *)
#define CLASS_DECL_DELETED
void new_address_range(struct parse *, struct iaddr, struct iaddr, struct subnet *, struct pool *, struct lease **)
isc_result_t cleanup_lease6(ia_hash_t *ia_table, struct ipv6_pool *pool, struct iasubopt *lease, struct ia_xx *ia)
Cleans up leases when reading from a lease file.
void parse_pool6_statement(struct parse *, struct group *, int)
isc_result_t add_lease6(struct ipv6_pool *pool, struct iasubopt *lease, time_t valid_lifetime_end_time)
void parse_failover_state(struct parse *, enum failover_state *, TIME *)
int parse_lbrace(struct parse *)
void postconf_initialization(int)
isc_result_t ipv6_pool_reference(struct ipv6_pool **pool, struct ipv6_pool *src, const char *file, int line)
reference an IPv6 pool structure.
isc_result_t ia_reference(struct ia_xx **ia, struct ia_xx *src, const char *file, int line)
#define CLASS_DECL_DYNAMIC
int parse_lease_declaration(struct lease **, struct parse *)
int executable_statement_dereference(struct executable_statement **ptr, const char *file, int line)
@ communications_interrupted
@ COMMUNICATIONS_INTERRUPTED
isc_result_t range2cidr(struct iaddrcidrnetlist **result, const struct iaddr *lo, const struct iaddr *hi)
isc_result_t free_iaddrcidrnetlist(struct iaddrcidrnetlist **result)
u_int32_t host_addr(struct iaddr addr, struct iaddr mask)
isc_boolean_t is_cidr_mask_valid(const struct iaddr *addr, int bits)
struct iaddr ip_addr(struct iaddr subnet, struct iaddr mask, u_int32_t host_address)
char * piaddrcidr(const struct iaddr *addr, unsigned int bits)
const char * piaddr(const struct iaddr addr)
int addr_eq(struct iaddr addr1, struct iaddr addr2)
struct iaddr subnet_number(struct iaddr addr, struct iaddr mask)
char * piaddrmask(struct iaddr *addr, struct iaddr *mask)
@ supersede_option_statement
int clone_group(struct group **gp, struct group *group, const char *file, int line)
struct group * root_group
isc_result_t delete_group(struct group_object *group, int writep)
isc_result_t supersede_group(struct group_object *group, int writep)
group_hash_t * group_name_hash
void * dmalloc(size_t, const char *, int)
void dfree(void *, const char *, int)
int log_error(const char *,...) __attribute__((__format__(__printf__
int int int log_debug(const char *,...) __attribute__((__format__(__printf__
void log_fatal(const char *,...) __attribute__((__format__(__printf__
struct binding * bindings
struct binding_value * value
struct expression * submatch
struct lease ** billed_leases
struct data_string hash_string
const unsigned char * data
enum executable_statement::statement_op op
union executable_statement::@336221350347175166011011356261373334214214051201 data
struct option_cache * option
struct executable_statement * next
struct executable_statement * statements
struct executable_statement::@336221350347175166011011356261373334214214051201::@240325212232200272321314266066265221125200273242 on
union expression::expr_union data
struct shared_network * shared_network
struct executable_statement * statements
struct iaddrcidrnetlist * fixed_prefix
struct option_cache * fixed_addr
struct data_string client_identifier
struct group_object * named_group
struct data_string host_id
struct option * host_id_option
struct hardware interface
struct data_string iaid_duid
struct iaddrcidrnet cidrnet
struct iaddrcidrnetlist * next
time_t hard_lifetime_end_time
struct binding_scope * scope
struct permit * permit_list
struct shared_network * shared_network
struct ipv6_pool ** ipv6_pools
struct permit * prohibit_list
binding_state_t next_binding_state
struct binding_scope * scope
struct hardware hardware_addr
binding_state_t rewind_binding_state
binding_state_t binding_state
struct executable_statement * on_expiry
struct executable_statement * on_release
struct universe * universe
enum permit::@011051276256032144365216260061073130004016310224 type
@ permit_dynamic_bootp_clients
@ permit_authenticated_clients
@ permit_unauthenticated_clients
struct permit * prohibit_list
struct permit * permit_list
dhcp_failover_state_t * failover_peer
struct shared_network * shared_network
struct ipv6_pond * ipv6_pond
struct interface_info * interface
dhcp_failover_state_t * failover_peer
struct interface_info * interface
struct subnet * next_sibling
struct shared_network * shared_network
option_name_hash_t * name_hash
option_code_hash_t * code_hash
int option_reference(struct option **dest, struct option *src, const char *file, int line)
int option_dereference(struct option **dest, const char *file, int line)
isc_result_t trace_get_file(trace_type_t *, const char *, unsigned *, char **)
trace_type_t * trace_type_register(const char *, void *, void(*)(trace_type_t *, unsigned, char *), void(*)(trace_type_t *), const char *, int)
isc_result_t trace_write_packet(trace_type_t *, unsigned, const char *, const char *, int)
struct trace_type trace_type_t
int binding_scope_dereference(struct binding_scope **ptr, const char *file, int line)
int make_const_data(struct expression **expr, const unsigned char *data, unsigned len, int terminated, int allocate, const char *file, int line)
struct binding * find_binding(struct binding_scope *scope, const char *name)
void expression_dereference(struct expression **eptr, const char *file, int line)
pair cons(caddr_t car, pair cdr)
int option_cache(struct option_cache **oc, struct data_string *dp, struct expression *expr, struct option *option, const char *file, int line)
int binding_value_dereference(struct binding_value **v, const char *file, int line)
int make_concat(struct expression **expr, struct expression *left, struct expression *right)
struct data_string const_data