33 static unsigned char global_host_once = 1;
35 static int parse_binding_value(
struct parse *cfile,
38 static void parse_authoring_byte_order (
struct parse *cfile);
39 static void parse_lease_id_format (
struct parse *cfile);
41 static 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) 70 if (res != ISC_R_SUCCESS)
73 return ldap_read_config ();
80 int group_type,
int leasep)
93 ttype = trace_readleases_type;
95 ttype = trace_readconf_type;
104 if (status != ISC_R_SUCCESS)
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;
136 #if defined (TRACING) 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 (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);
178 status =
new_parse(&cfile, -1, fbuf, ulen, filename, 0);
184 if (status != ISC_R_SUCCESS || cfile == NULL)
195 #if defined (TRACING) 202 static int postconf_initialized;
203 static int leaseconf_initialized;
208 tflen = strlen (data);
209 flen = len - tflen - 1;
210 fbuf = data + tflen + 1;
216 status =
new_parse(&cfile, -1, fbuf, flen, data, 0);
217 if (status == ISC_R_SUCCESS || cfile != NULL) {
218 if (ttype == trace_readleases_type)
227 if (!postconf_initialized && ttype == trace_readconf_type) {
229 postconf_initialized = 1;
232 if (!leaseconf_initialized && ttype == trace_readleases_type) {
234 leaseconf_initialized = 1;
290 "possibly corrupt lease file");
291 }
else if (token ==
IA_NA) {
293 }
else if (token ==
IA_TA) {
295 }
else if (token ==
IA_PD) {
297 }
else if (token ==
CLASS) {
303 }
else if (token ==
HOST) {
305 }
else if (token ==
GROUP) {
307 #if defined (FAILOVER_PROTOCOL) 310 (cfile, (dhcp_failover_state_t *)0);
317 parse_authoring_byte_order(cfile);
319 log_error (
"Corrupt lease file - possible data loss!");
380 token =
peek_token (&val, (
unsigned *)0, cfile);
385 token =
next_token (&val, (
unsigned *)0, cfile);
387 parse_warn (cfile,
"filename string expected.");
391 if (status != ISC_R_SUCCESS)
400 if (global_host_once &&
402 global_host_once = 0;
403 log_error(
"WARNING: Host declarations are " 404 "global. They are not limited to " 405 "the scope you declared them in.");
411 "host declarations not allowed here.");
422 "group declarations not allowed here.");
433 parse_warn (cfile,
"shared-network parameters not %s.",
448 "subnet declarations not allowed here.");
474 status = shared_network_allocate (&share,
MDL);
475 if (status != ISC_R_SUCCESS)
476 log_fatal (
"Can't allocate shared subnet: %s",
477 isc_result_totext (status));
479 log_fatal (
"Can't allocate group for shared net");
510 share->
name = strdup(n);
512 if (share->
name == NULL)
513 log_fatal(
"Out of memory allocating default " 514 "shared network name (\"%s\").", n);
522 shared_network_dereference(&share,
MDL);
529 "class declarations not allowed here.");
540 "class declarations not allowed here.");
551 "class declarations not allowed here.");
562 "class declarations not allowed here.");
575 parse_warn(cfile,
"Host %s hardware address already " 584 parse_warn (cfile,
"hardware address parameter %s",
585 "not allowed here.");
597 "Only one fixed address " 598 "declaration per host.");
604 "fixed-address parameter not " 614 parse_warn (cfile,
"pool declared within pool.");
617 parse_warn (cfile,
"pool declared outside of network");
628 "range declaration not allowed here.");
641 "range6 declaration not allowed here.");
652 "prefix6 declaration not allowed here.");
663 "fixed-prefix6 declaration not " 674 parse_warn (cfile,
"pool6 declared within pool.");
677 parse_warn (cfile,
"pool6 declared outside of network");
688 token =
next_token (&val, (
unsigned *)0, cfile);
691 group -> authoritative = 0;
701 group -> authoritative = 1;
704 parse_warn (cfile,
"authority makes no sense here.");
714 log_fatal(
"Server identifier not in hash (%s:%d).",
721 token =
peek_token (&val, (
unsigned *)0, cfile);
722 if (token ==
SPACE) {
725 "option space definitions %s",
726 "may not be scoped.");
736 if (status == ISC_R_SUCCESS) {
737 token =
peek_token (&val, (
unsigned *)0, cfile);
741 "option definitions%s",
742 " may not be scoped.");
754 option_name_hash_delete(
757 option_code_hash_delete(
785 goto insert_statement;
793 parse_warn (cfile,
"failover peers may only be %s",
794 "defined in shared-network");
795 log_error (
"declarations and the outer scope.");
799 token =
next_token (&val, (
unsigned *)0, cfile);
800 #if defined (FAILOVER_PROTOCOL) 815 token =
next_token (&val, (
unsigned *)0, cfile);
816 parse_lease_id_format(cfile);
827 "expecting a declaration");
830 "expecting a parameter %s",
883 #if defined (FAILOVER_PROTOCOL) 891 dhcp_failover_state_t *peer;
896 unsigned hba_len =
sizeof hba;
900 dhcp_failover_config_t *cp;
902 token =
next_token (&val, (
unsigned *)0, cfile);
909 token =
next_token (&val, (
unsigned *)0, cfile);
913 log_fatal (
"no memory for peer name %s", name);
916 parse_warn (cfile,
"expecting failover peer name.");
922 peer = (dhcp_failover_state_t *)0;
925 token =
next_token (&val, (
unsigned *)0, cfile);
928 parse_warn (cfile,
"failover peer reference not %s",
929 "in shared-network declaration");
932 parse_warn (cfile,
"reference to unknown%s%s",
933 " failover peer ", name);
937 dhcp_failover_state_reference
941 dhcp_failover_state_dereference (&peer,
MDL);
944 }
else if (token ==
STATE) {
946 parse_warn (cfile,
"state declaration for unknown%s%s",
947 " failover peer ", name);
952 dhcp_failover_state_dereference (&peer,
MDL);
955 }
else if (token !=
LBRACE) {
962 parse_warn (cfile,
"redeclaration of failover peer %s", name);
964 dhcp_failover_state_dereference (&peer,
MDL);
969 status = dhcp_failover_state_allocate (&peer,
MDL);
970 if (status != ISC_R_SUCCESS)
971 log_fatal (
"Can't allocate failover peer %s: %s",
972 name, isc_result_totext (status));
980 token =
next_token (&val, (
unsigned *)0, cfile);
986 peer -> i_am = primary;
990 peer -> i_am = secondary;
993 "secondary may not define %s",
994 "load balance settings.");
998 cp = &peer -> partner;
1005 dhcp_failover_state_dereference (&peer,
MDL);
1015 token =
next_token (&val, (
unsigned *)0, cfile);
1020 cp -> port = atoi (val);
1024 tp = &peer->max_lease_misbalance;
1028 tp = &peer->max_lease_ownership;
1032 tp = &peer->max_balance;
1036 tp = &peer->min_balance;
1040 tp = &peer->auto_partner_down;
1044 tp = &cp -> max_response_delay;
1046 token =
next_token (&val, (
unsigned *)0, cfile);
1050 dhcp_failover_state_dereference (&peer,
MDL);
1057 tp = &cp -> max_flying_updates;
1066 if (peer -> i_am == secondary)
1068 "secondary may not define %s",
1069 "load balance settings.");
1073 dhcp_failover_state_dereference (&peer,
MDL);
1076 if (hba_len != 32) {
1078 "HBA must be exactly 32 bytes.");
1087 memcpy (peer -> hba, hba, 32);
1091 token =
next_token (&val, (
unsigned *)0, cfile);
1092 if (peer -> i_am == secondary)
1094 "secondary may not define %s",
1095 "load balance settings.");
1099 dhcp_failover_state_dereference (&peer,
MDL);
1105 "0 and 256, inclusive");
1107 memset (hba, 0,
sizeof hba);
1108 for (i = 0; i < split; i++) {
1110 hba [i / 8] |= (1 << (i & 7));
1117 token =
next_token (&val, (
unsigned *)0, cfile);
1124 token =
next_token (&val, (
unsigned *)0, cfile);
1129 token =
next_token (&val, (
unsigned *)0, cfile);
1134 token =
next_token (&val, (
unsigned *)0, cfile);
1139 peer -> load_balance_max_secs = atoi (val);
1144 "invalid statement in peer declaration");
1146 dhcp_failover_state_dereference (&peer,
MDL);
1151 dhcp_failover_state_dereference (&peer,
MDL);
1154 }
while (token !=
RBRACE);
1159 if (!peer -> partner.address)
1160 parse_warn (cfile,
"peer address may not be omitted");
1163 peer->me.port = DEFAULT_FAILOVER_PORT;
1164 if (!peer->partner.port)
1165 peer->partner.port = DEFAULT_FAILOVER_PORT;
1167 if (peer -> i_am == primary) {
1170 "primary failover server must have hba or split.");
1171 }
else if (!peer -> mclt) {
1173 "primary failover server must have mclt.");
1177 if (!peer->max_lease_misbalance)
1178 peer->max_lease_misbalance = DEFAULT_MAX_LEASE_MISBALANCE;
1179 if (!peer->max_lease_ownership)
1180 peer->max_lease_ownership = DEFAULT_MAX_LEASE_OWNERSHIP;
1181 if (!peer->max_balance)
1182 peer->max_balance = DEFAULT_MAX_BALANCE_TIME;
1183 if (!peer->min_balance)
1184 peer->min_balance = DEFAULT_MIN_BALANCE_TIME;
1185 if (!peer->me.max_flying_updates)
1186 peer->me.max_flying_updates = DEFAULT_MAX_FLYING_UPDATES;
1187 if (!peer->me.max_response_delay)
1188 peer->me.max_response_delay = DEFAULT_MAX_RESPONSE_DELAY;
1200 if (status != ISC_R_SUCCESS)
1202 peer -> name, isc_result_totext (status));
1203 dhcp_failover_state_dereference (&peer,
MDL);
1207 dhcp_failover_state_t *peer)
1212 dhcp_failover_state_t *state;
1213 dhcp_failover_config_t *cp;
1216 token =
next_token (&val, (
unsigned *)0, cfile);
1217 if (token !=
PEER) {
1223 token =
next_token (&val, (
unsigned *)0, cfile);
1227 log_fatal (
"failover peer name %s: no memory",
1231 parse_warn (cfile,
"expecting failover peer name.");
1237 state = (dhcp_failover_state_t *)0;
1240 parse_warn (cfile,
"unknown failover peer: %s", name);
1245 token =
next_token (&val, (
unsigned *)0, cfile);
1246 if (token !=
STATE) {
1253 state = (dhcp_failover_state_t *)0;
1254 dhcp_failover_state_reference (&state, peer,
MDL);
1256 token =
next_token (&val, (
unsigned *)0, cfile);
1261 dhcp_failover_state_dereference (&state,
MDL);
1265 token =
next_token (&val, (
unsigned *)0, cfile);
1272 token =
next_token (&val, (
unsigned *)0, cfile);
1273 if (token !=
STATE) {
1278 &cp -> state, &cp -> stos);
1282 cp = &state -> partner;
1286 if (state -> i_am == primary) {
1288 "mclt not valid for primary");
1291 token =
next_token (&val, (
unsigned *)0, cfile);
1296 state -> mclt = atoi (val);
1301 parse_warn (cfile,
"expecting state setting.");
1304 dhcp_failover_state_dereference (&state,
MDL);
1307 }
while (token !=
RBRACE);
1308 dhcp_failover_state_dereference (&state,
MDL);
1312 struct parse *cfile;
1376 parse_warn (cfile,
"unknown failover state");
1425 void parse_authoring_byte_order (
struct parse *cfile)
1434 "authoring-byte-order specified too late.\n" 1435 "It must occur before the first lease in file\n");
1449 parse_warn(cfile,
"authoring-byte-order is invalid: " 1450 " it must be big-endian or little-endian.");
1456 log_error (
"WARNING: Lease file authored using different" 1457 " byte order, will attempt to convert");
1462 parse_warn(cfile,
"corrupt lease file; expecting a semicolon");
1482 void parse_lease_id_format (
struct parse *cfile)
1497 parse_warn(cfile,
"lease-id-format is invalid: " 1498 " it must be octal or hex.");
1508 parse_warn(cfile,
"corrupt lease file; expecting a semicolon");
1546 void get_permit(cfile, permit_head, is_allow, valid_from, valid_until)
1547 struct parse *cfile;
1548 struct permit **permit_head;
1550 TIME *valid_from, *valid_until;
1555 int need_clients = 1;
1628 if (*valid_from || *valid_until) {
1629 parse_warn(cfile,
"duplicate \"after\" clause.");
1645 parse_warn (cfile,
"expecting permit type.");
1655 if ((need_clients != 0) &&
1663 while (*permit_head)
1664 permit_head = &((*permit_head)->next);
1678 struct permit *plp, *prp;
1685 for (plp = lhs; plp; plp = plp ->
next) {
1687 for (prp = rhs; prp; prp = prp ->
next) {
1690 prp ->
class == plp ->
class)) {
1721 struct parse *cfile;
1729 int declaration = 0;
1730 isc_result_t status;
1731 struct lease *lpchain = NULL, *lp;
1734 status = pool_allocate(&
pool,
MDL);
1735 if (status != ISC_R_SUCCESS)
1737 isc_result_totext (status));
1747 parse_warn(cfile,
"Dynamic pools are only valid inside " 1748 "subnet or shared-network statements.");
1757 #if defined (FAILOVER_PROTOCOL) 1760 dhcp_failover_state_reference
1779 "expecting \"failover peer\".");
1783 #if defined (FAILOVER_PROTOCOL) 1785 dhcp_failover_state_dereference
1790 #if defined (FAILOVER_PROTOCOL) 1794 if (token !=
PEER) {
1806 dhcp_failover_state_dereference
1810 if (status != ISC_R_SUCCESS)
1812 "failover peer %s: %s", val,
1813 isc_result_totext (status));
1863 #if defined (FAILOVER_PROTOCOL) 1879 for (lp = lpchain; lp; lp = lp->
next) {
1880 pool_dereference(&lp->pool,
MDL);
1881 pool_reference(&lp->pool, pp,
MDL);
1884 #if defined (BINARY_LEASES) 1898 for (; *p; p = &((*p)->next))
1906 parse_warn(cfile,
"Pool declaration with no address range.");
1907 log_error(
"Pool declarations must always contain at least");
1915 lease_reference(&lp, lpchain,
MDL);
1916 lease_dereference(&lpchain,
MDL);
1918 lease_reference(&lpchain, lp->
next,
MDL);
1919 lease_dereference(&lp->next,
MDL);
1920 lease_dereference(&lp,
MDL);
1930 struct parse *cfile;
1948 struct parse *cfile;
1955 int declaration = 0;
1958 isc_result_t status;
1965 parse_warn (cfile,
"expecting a name for host declaration.");
1971 status = host_allocate (&host,
MDL);
1972 if (status != ISC_R_SUCCESS)
1973 log_fatal (
"can't allocate host decl struct %s: %s",
1974 name, isc_result_totext (status));
1979 host_dereference (&host,
MDL);
1987 token =
peek_token (&val, (
unsigned *)0, cfile);
1994 parse_warn (cfile,
"unexpected end of file");
2016 if (token ==
GROUP) {
2019 token =
next_token (&val, (
unsigned *)0, cfile);
2022 "expecting string or identifier.");
2028 val, strlen (val),
MDL)) {
2029 parse_warn (cfile,
"unknown group %s in host %s",
2032 if (host -> named_group)
2033 group_object_dereference
2034 (&host -> named_group,
MDL);
2035 group_object_reference (&host -> named_group,
2037 group_object_dereference (&go,
MDL);
2046 unsigned char *t = 0;
2054 "client identifier.",
2060 token =
peek_token (&val, (
unsigned *)0, cfile);
2064 host -> client_identifier.terminated = 1;
2069 (
unsigned char *)0, &len,
':', 16, 8);
2072 "expecting hex list.");
2075 s = (
const char *)t;
2078 (&host -> client_identifier.buffer,
2079 len + host -> client_identifier.terminated,
MDL))
2080 log_fatal (
"no memory for uid for host %s.",
2082 host -> client_identifier.data =
2083 host -> client_identifier.buffer -> data;
2084 host -> client_identifier.len = len;
2085 memcpy (host -> client_identifier.buffer -> data, s,
2086 len + host -> client_identifier.terminated);
2098 "only one host-identifier allowed " 2109 "host-identifier v6relopt " 2110 "must have a number");
2114 host->
relays = atoi(val);
2117 "host-identifier v6relopt " 2118 "must have a number >= 0");
2122 }
else if (token !=
OPTION) {
2124 "host-identifier must be an option" 2132 if ((status != ISC_R_SUCCESS) || (
option == NULL)) {
2171 (
unsigned char *)host ->
name,
2172 strlen (host ->
name),
MDL)) {
2174 host_dereference (&hp,
MDL);
2178 if (host ->
group -> statements ||
2179 (host ->
group -> authoritative !=
2181 if (host ->
group -> next)
2201 if (status != ISC_R_SUCCESS)
2203 isc_result_totext (status));
2205 host_dereference (&host,
MDL);
2213 struct parse *cfile;
2219 struct class *
class = NULL, *pc = NULL;
2220 int declaration = 0;
2227 isc_result_t status = ISC_R_FAILURE;
2228 int matchedonce = 0;
2229 int submatchedonce = 0;
2247 class_reference(&
class, pc,
MDL);
2249 class_dereference(&pc,
MDL);
2264 data.len = strlen (val);
2267 log_fatal (
"no memory for class name.");
2269 data.terminated = 1;
2272 "implicit-vendor-class" :
"implicit-user-class";
2283 log_fatal (
"No memory for class name %s.", tname);
2284 strcpy (
name, tname);
2298 class_dereference (&pc,
MDL);
2302 data.terminated = 1;
2304 memcpy ((
char *)
data.buffer ->
data, val,
2310 class_dereference (&pc,
MDL);
2314 parse_warn (cfile,
"Expecting string or hex list.");
2316 class_dereference (&pc,
MDL);
2324 class_hash_lookup (&
class, pc -> hash,
2331 status = subclass_allocate (&
class,
MDL);
2333 status = class_allocate (&
class,
MDL);
2337 class_reference (&
class -> superclass, pc,
MDL);
2338 class -> lease_limit = pc -> lease_limit;
2339 if (
class -> lease_limit) {
2340 class -> billed_leases =
2341 dmalloc (
class -> lease_limit *
2343 if (!
class -> billed_leases)
2345 memset (
class -> billed_leases, 0,
2346 (
class -> lease_limit *
2347 sizeof (
struct lease *)));
2352 log_fatal (
"No memory for subclass hash.");
2353 class_hash_add (pc -> hash,
2354 (
const char *)
class -> hash_string.data,
2355 class -> hash_string.len,
2356 (
void *)
class,
MDL);
2361 log_fatal (
"no memory to clone class group.");
2370 log_fatal (
"no memory for class statement.");
2371 stmt -> op = supersede_option_statement;
2374 stmt -> data.option -> data = data;
2378 option_code_hash_lookup(
2383 class -> statements = stmt;
2396 if (
class -> superclass) {
2398 if (token ==
SEMI) {
2402 status = class_reference (cp,
class,
MDL);
2403 class_dereference (&
class,
MDL);
2405 class_dereference (&pc,
MDL);
2406 return cp ? (status == ISC_R_SUCCESS) : 1;
2415 class_dereference (&
class,
MDL);
2417 class_dereference (&pc,
MDL);
2428 parse_warn (cfile,
"unexpected end of file");
2430 }
else if (token ==
DYNAMIC) {
2442 }
else if (token ==
MATCH) {
2445 "invalid match in subclass.");
2456 "one 'match if' clause.");
2467 "expecting boolean expr.");
2471 #if defined (DEBUG_EXPRESSION_PARSE) 2477 }
else if (token ==
SPAWN) {
2481 "invalid spawn in subclass.");
2485 class -> spawning = 1;
2487 if (token !=
WITH) {
2489 "expecting with after spawn");
2494 if (submatchedonce) {
2496 "can't override existing %s.",
2508 "expecting data expr.");
2512 #if defined (DEBUG_EXPRESSION_PARSE) 2518 }
else if (token ==
LEASE) {
2521 if (token !=
LIMIT) {
2534 class -> lease_limit = atoi (val);
2537 class -> billed_leases =
2538 dmalloc (
class -> lease_limit *
2540 if (!
class -> billed_leases)
2541 log_fatal (
"no memory for billed leases.");
2542 memset (
class -> billed_leases, 0,
2543 (
class -> lease_limit *
2544 sizeof (
struct lease *)));
2556 struct class *theclass = NULL;
2559 if (status == ISC_R_SUCCESS) {
2561 class_dereference(&theclass,
MDL);
2564 class_hash_delete(pc->hash,
2576 class_reference (&c ->
nic,
class,
MDL);
2581 status = class_reference (cp,
class,
MDL);
2582 class_dereference (&
class,
MDL);
2584 class_dereference (&pc,
MDL);
2585 return cp ? (status == ISC_R_SUCCESS) : 1;
2592 struct parse *cfile;
2599 int declaration = 0;
2600 isc_result_t status;
2603 status = shared_network_allocate (&share,
MDL);
2604 if (status != ISC_R_SUCCESS)
2605 log_fatal (
"Can't allocate shared subnet: %s",
2606 isc_result_totext (status));
2608 log_fatal (
"Can't clone group for shared net");
2614 token =
peek_token (&val, (
unsigned *)0, cfile);
2619 parse_warn (cfile,
"zero-length shared network name");
2620 val =
"<no-name-given>";
2624 log_fatal (
"no memory for shared network name");
2630 "expecting a name for shared-network");
2632 shared_network_dereference (&share,
MDL);
2639 shared_network_dereference (&share,
MDL);
2644 token =
peek_token (&val, (
unsigned *)0, cfile);
2649 "empty shared-network decl");
2652 shared_network_dereference (&share,
MDL);
2656 parse_warn (cfile,
"unexpected end of file");
2660 token =
next_token (&val, (
unsigned *)0, cfile);
2672 shared_network_dereference (&share,
MDL);
2677 common_subnet_parsing(
struct parse *cfile,
2683 int declaration = 0;
2699 parse_warn (cfile,
"unexpected end of file");
2729 subnet_dereference(&share->
subnets,
2731 subnet_reference(&share->
subnets,
2749 struct parse *cfile;
2756 unsigned char addr [4];
2757 unsigned len =
sizeof addr;
2758 isc_result_t status;
2761 status = subnet_allocate (&
subnet,
MDL);
2762 if (status != ISC_R_SUCCESS)
2763 log_fatal (
"Allocation of new subnet failed: %s",
2764 isc_result_totext (status));
2779 log_fatal(
"Allocation of group for new subnet failed.");
2793 token =
next_token (&val, (
unsigned *)0, cfile);
2815 if (maskstr == NULL) {
2816 log_fatal(
"Allocation of subnet maskstr failed: %s",
2821 "subnet %s netmask %s: bad subnet number/mask combination.",
2829 common_subnet_parsing(cfile, share,
subnet);
2837 #if !defined(DHCPv6) 2842 isc_result_t status;
2847 const static int mask[] = { 0x00, 0x80, 0xC0, 0xE0,
2848 0xF0, 0xF8, 0xFC, 0xFE };
2851 #if defined(DHCP4o6) 2853 parse_warn(cfile,
"subnet6 statement is only supported " 2854 "in DHCPv6 and DHCPv4o6 modes.");
2860 parse_warn(cfile,
"subnet6 statement is only supported " 2869 if (status != ISC_R_SUCCESS) {
2870 log_fatal(
"Allocation of new subnet failed: %s",
2871 isc_result_totext(status));
2887 log_fatal(
"Allocation of group for new subnet failed.");
2898 if (token !=
SLASH) {
2915 parse_warn(cfile,
"Expecting a number between 0 and 128.");
2921 parse_warn(cfile,
"New subnet mask too short.");
2931 if (ofs < subnet->netmask.len) {
2934 while (--ofs >= 0) {
2942 "subnet %s/%d: prefix not long enough for address.",
2949 if (!common_subnet_parsing(cfile, share,
subnet)) {
2958 struct parse *cfile;
2964 int declaration = 0;
2966 isc_result_t status;
2974 log_fatal(
"no memory for explicit group.");
2982 log_fatal(
"no memory for group decl name %s", val);
3004 }
else if (token ==
DYNAMIC) {
3008 }
else if (token ==
STATIC) {
3029 status = group_object_allocate(&t,
MDL);
3030 if (status != ISC_R_SUCCESS)
3031 log_fatal(
"no memory for group decl %s: %s",
3032 val, isc_result_totext(status));
3041 group_object_dereference(&t,
MDL);
3051 struct parse *cfile,
3088 if (token ==
COMMA) {
3091 }
while (token ==
COMMA);
3125 unsigned char addr [4];
3126 unsigned len =
sizeof addr;
3134 int noequal, newbinding;
3137 isc_result_t status;
3141 unsigned buflen = 0;
3142 struct class *
class;
3145 status = lease_allocate (&
lease,
MDL);
3146 if (status != ISC_R_SUCCESS)
3163 token =
next_token (&val, (
unsigned *)0, cfile);
3167 parse_warn (cfile,
"unexpected end of file");
3170 strncpy (tbuf, val,
sizeof tbuf);
3171 tbuf [(
sizeof tbuf) - 1] = 0;
3223 token =
peek_token (&val, (
unsigned *)0, cfile);
3225 unsigned char *tuid;
3227 if (buflen < sizeof lease ->
uid_buf) {
3232 tuid = ((
unsigned char *)
3236 lease_dereference (&
lease,
3248 (cfile, (
unsigned char *)0,
3249 &buflen,
':', 16, 8));
3272 token =
next_token (&val, (
unsigned *)0, cfile);
3311 token =
next_token (&val, (
unsigned *)0, cfile);
3317 goto do_binding_state;
3327 goto do_binding_state;
3333 token =
next_token (&val, (
unsigned *)0, cfile);
3334 if (token !=
STATE) {
3339 token =
next_token (&val, (
unsigned *)0, cfile);
3377 "%s: expecting a binding state.",
3383 if (seenbit == 256) {
3392 if (!(seenmask & 128))
3396 if (!(seenmask & 512))
3398 }
else if (seenbit == 128)
3400 else if (seenbit == 512)
3403 log_fatal(
"Impossible condition at %s:%d.",
3411 token =
peek_token (&val, (
unsigned *)0, cfile);
3426 "expecting a hostname.");
3436 class = (struct
class *)0;
3437 token =
next_token (&val, (
unsigned *)0, cfile);
3438 if (token ==
CLASS) {
3440 (
unsigned *)0, cfile);
3448 if (
lease -> billing_class)
3449 class_dereference (&
lease -> billing_class,
3454 "unknown class %s", val);
3457 if (
lease -> billing_class)
3458 class_dereference (&
lease -> billing_class,
3468 class_reference (&
lease -> billing_class,
3470 class_dereference (&
class,
MDL);
3484 on->data.on.statements) {
3488 on->data.on.statements,
MDL);
3491 on->data.on.statements) {
3495 on->data.on.statements,
MDL);
3509 "agent option expected.");
3516 log_error (
"no memory to stash agent option");
3520 *p; p = &((*p) -> cdr))
3524 &((*p) -> car)), oc,
MDL);
3532 token =
next_token (&val, (
unsigned *)0, cfile);
3535 "%s can't be a variable name",
3551 if (!
lease -> scope)
3573 log_fatal(
"no memory for binding value.");
3576 token =
next_token (&val, (
unsigned *)0, cfile);
3577 if (token !=
EQUAL) {
3579 "expecting '=' in set statement.");
3584 if (!parse_binding_value(cfile, nv)) {
3607 if (!strcasecmp (val,
"ddns-fwd-name")) {
3611 }
else if (!strcasecmp (val,
"ddns-rev-name")) {
3616 parse_warn(cfile,
"Unexpected configuration " 3624 if (seenmask & seenbit) {
3626 "Too many %s parameters in lease %s\n",
3629 seenmask |= seenbit;
3634 if (!(seenmask & 256)) {
3638 #if defined (FAILOVER_PROTOCOL) 3645 #if defined (FAILOVER_PROTOCOL) 3658 if (!(seenmask & 65536))
3681 if ((cfile == NULL) || (value == NULL))
3688 value->
type = binding_data;
3696 memcpy(
data->buffer->data, val, buflen + 1);
3699 data->terminated = 1;
3701 value->
type = binding_data;
3716 memcpy(
data->buffer->data, s,
data->len);
3721 }
else if (token ==
PERCENT) {
3725 parse_warn(cfile,
"expecting decimal number.");
3730 value->
type = binding_numeric;
3732 }
else if (token ==
NAME) {
3734 value->
type = binding_boolean;
3735 if (!strcasecmp(val,
"true"))
3737 else if (!strcasecmp(val,
"false"))
3740 parse_warn(cfile,
"expecting true or false");
3746 parse_warn (cfile,
"expecting a constant value.");
3759 struct parse *cfile;
3762 struct pool *inpool;
3763 struct lease **lpchain;
3765 struct iaddr low, high, net;
3766 unsigned char addr [4];
3767 unsigned len =
sizeof addr;
3774 isc_result_t status;
3785 memcpy (low.
iabuf, addr, len);
3789 token =
peek_token (&val, (
unsigned *)0, cfile);
3796 memcpy (high.
iabuf, addr, len);
3800 token =
next_token (&val, (
unsigned *)0, cfile);
3801 if (token !=
SEMI) {
3819 parse_warn (cfile,
"address range not on network %s",
3821 log_error (
"Be sure to place pool statement after %s",
3822 "related subnet declarations.");
3828 struct pool *last = (
struct pool *)0;
3838 permit_dynamic_bootp_clients)) ||
3843 permit_all_clients))) {
3852 status = pool_allocate (&
pool,
MDL);
3853 if (status != ISC_R_SUCCESS)
3854 log_fatal (
"no memory for ad-hoc pool: %s",
3855 isc_result_totext (status));
3858 log_fatal (
"no memory for ad-hoc permit.");
3864 pool -> permit_list = p;
3867 pool -> prohibit_list = p;
3877 log_fatal (
"no memory for anon pool group.");
3881 pool_reference (&
pool, last,
MDL);
3887 pool_reference (&
pool, inpool,
MDL);
3890 #if defined (FAILOVER_PROTOCOL) 3894 parse_warn (cfile,
"dynamic-bootp flag is %s",
3895 "not permitted for address");
3896 log_error (
"range declarations where there is a failover");
3897 log_error (
"peer in scope. If you wish to declare an");
3898 log_error (
"address range from which dynamic bootp leases");
3899 log_error (
"can be allocated, please declare it within a");
3900 log_error (
"pool declaration that also contains the \"no");
3901 log_error (
"failover\" statement. The failover protocol");
3902 log_error (
"itself does not permit dynamic bootp - this");
3903 log_error (
"is not a limitation specific to the ISC DHCP");
3904 log_error (
"server. Please don't ask me to defend this");
3905 log_error (
"until you have read and really tried %s",
3907 log_error (
"the failover protocol specification.");
3917 pool_dereference (&
pool,
MDL);
3922 add_ipv6_pool_to_subnet(
struct subnet *
subnet, u_int16_t type,
3923 struct iaddr *lo_addr,
int bits,
int units,
3926 struct in6_addr tmp_in6_addr;
3933 if (lo_addr->
len !=
sizeof(tmp_in6_addr)) {
3934 log_fatal(
"Internal error: Attempt to add non-IPv6 address " 3935 "to IPv6 shared network.");
3937 memcpy(&tmp_in6_addr, lo_addr->
iabuf,
sizeof(tmp_in6_addr));
3954 pool->subnet = NULL;
3959 pool->ipv6_pond = NULL;
4007 if ((
units -
bits) > (
sizeof(isc_uint64_t) * 8)) {
4012 isc_uint64_t space_left
4017 if (addon > space_left) {
4054 add_ipv6_pond_to_network(
struct group *
group,
4057 struct ipv6_pond *pond = NULL, *last = NULL;
4059 isc_result_t status;
4076 if (status != ISC_R_SUCCESS)
4077 log_fatal (
"no memory for ad-hoc ipv6 pond: %s",
4078 isc_result_totext (status));
4081 log_fatal (
"no memory for ad-hoc ipv6 permit.");
4084 p->
type = permit_all_clients;
4097 log_fatal (
"no memory for anon pool group.");
4112 struct iaddr lo, hi;
4122 parse_warn(cfile,
"range6 statement is only supported " 4142 parse_warn(cfile,
"range6 start address is outside the subnet");
4150 memset(&net, 0,
sizeof(net));
4157 if (token ==
SLASH) {
4170 if ((bits < 0) || (bits > 128)) {
4171 parse_warn(cfile,
"networks have 0 to 128 bits");
4177 "network mask smaller than subnet mask");
4192 parse_warn(cfile,
"temporary mask too short");
4230 "range6 end address is outside the subnet");
4239 if (
range2cidr(&nets, &lo, &hi) != ISC_R_SUCCESS) {
4240 log_fatal(
"Error converting range to CIDR networks");
4251 if (inpond != NULL) {
4254 add_ipv6_pond_to_network(
group, &pond);
4258 for (p=nets; p != NULL; p=p->
next) {
4271 if (token !=
SEMI) {
4284 struct iaddr lo, hi;
4293 parse_warn(cfile,
"prefix6 statement is only supported " 4320 " is outside the subnet");
4340 " is outside the subnet");
4350 if (token !=
SLASH) {
4364 if ((bits <= 0) || (bits >= 128)) {
4365 parse_warn(cfile,
"networks have 0 to 128 bits (exclusive)");
4376 parse_warn(cfile,
"network mask smaller than subnet mask");
4389 if (token !=
SEMI) {
4399 if (
range2cidr(&nets, &lo, &hi) != ISC_R_SUCCESS) {
4400 log_fatal(
"Error converting prefix to CIDR");
4409 if (inpond != NULL) {
4412 add_ipv6_pond_to_network(
group, &pond);
4415 for (p = nets; p != NULL; p = p->
next) {
4448 while (*h != NULL) {
4468 if (token !=
SLASH) {
4484 if (token !=
SEMI) {
4497 parse_warn(cfile,
"networks have 0 to 128 bits");
4533 struct parse *cfile;
4541 int declaration = 0;
4542 isc_result_t status;
4546 if (status != ISC_R_SUCCESS)
4548 isc_result_totext (status));
4555 parse_warn(cfile,
"pool6s are only valid inside " 4556 "subnet statements.");
4629 for (; *p; p = &((*p)->next))
4636 parse_warn (cfile,
"Pool6 declaration with no %s.",
4637 "address range6 or prefix6");
4638 log_error (
"Pool6 declarations must always contain at least");
4639 log_error (
"one range6 or prefix6 statement.");
4657 struct parse *cfile;
4662 unsigned char rf = flag;
4671 token =
next_token (&val, (
unsigned *)0, cfile);
4706 parse_warn (cfile,
"expecting allow/deny key");
4714 log_fatal(
"Unable to find server option %u (%s:%d).",
4724 #if !defined(DHCPv6) 4729 struct ia_xx *ia = NULL;
4731 struct ia_xx *old_ia;
4740 char addr_buf[
sizeof(
"ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
4741 isc_boolean_t newbinding;
4749 parse_warn(cfile,
"IA_NA is only supported in DHCPv6 mode.");
4754 if (!parse_iaid_duid(cfile, &ia, &iaid,
MDL)) {
4762 parse_warn(cfile,
"corrupt lease file; expecting left brace");
4769 if (token ==
RBRACE)
break;
4771 if (token ==
CLTT) {
4778 "expecting IAADDR or right brace");
4785 "expecting IPv6 address");
4793 "expecting left brace");
4803 if (token ==
RBRACE)
break;
4812 "unexpected end of file");
4818 if (token !=
STATE) {
4852 if (token !=
SEMI) {
4869 prefer = atoi (val);
4878 if (token ==
SEMI) {
4882 "corrupt lease file; " 4883 "expecting semicolon.");
4906 if (token ==
SEMI) {
4910 "corrupt lease file; " 4911 "expecting semicolon.");
4923 if ((token !=
NAME) &&
4955 if (bnd->
name == NULL) {
4959 strcpy(bnd->
name, val);
4961 newbinding = ISC_TRUE;
4963 newbinding = ISC_FALSE;
4972 if (token !=
EQUAL) {
4978 if (!parse_binding_value(cfile, nv)) {
5038 "expecting ia_na contents, " 5047 "missing state in iaaddr");
5050 if (end_time == -1) {
5052 "missing end time in iaaddr");
5057 if (iasubopt_allocate(&iaaddr,
MDL) != ISC_R_SUCCESS) {
5062 iaaddr->
state = state;
5064 iaaddr->
valid = valid;
5068 if (scope != NULL) {
5080 (i < 2) &&
on_star[i] != NULL ;
5083 on_star[i]->data.on.statements) {
5089 on_star[i]->data.on.statements) {
5100 &iaaddr->
addr) != ISC_R_SUCCESS) {
5101 inet_ntop(AF_INET6, &iaaddr->
addr,
5102 addr_buf,
sizeof(addr_buf));
5103 log_error(
"No pool found for IA_NA address %s",
5111 iaaddr, ia) != ISC_R_SUCCESS) {
5112 inet_ntop(AF_INET6, &iaaddr->
addr,
5113 addr_buf,
sizeof(addr_buf));
5114 parse_warn(cfile,
"duplicate na lease for address %s",
5160 #if !defined(DHCPv6) 5165 struct ia_xx *ia = NULL;
5167 struct ia_xx *old_ia;
5176 char addr_buf[
sizeof(
"ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
5177 isc_boolean_t newbinding;
5185 parse_warn(cfile,
"IA_TA is only supported in DHCPv6 mode.");
5190 if (!parse_iaid_duid(cfile, &ia, &iaid,
MDL)) {
5198 parse_warn(cfile,
"corrupt lease file; expecting left brace");
5205 if (token ==
RBRACE)
break;
5207 if (token ==
CLTT) {
5214 "expecting IAADDR or right brace");
5221 "expecting IPv6 address");
5229 "expecting left brace");
5239 if (token ==
RBRACE)
break;
5248 "unexpected end of file");
5254 if (token !=
STATE) {
5288 if (token !=
SEMI) {
5305 prefer = atoi (val);
5314 if (token ==
SEMI) {
5318 "corrupt lease file; " 5319 "expecting semicolon.");
5342 if (token ==
SEMI) {
5346 "corrupt lease file; " 5347 "expecting semicolon.");
5359 if ((token !=
NAME) &&
5391 if (bnd->
name == NULL) {
5395 strcpy(bnd->
name, val);
5397 newbinding = ISC_TRUE;
5399 newbinding = ISC_FALSE;
5408 if (token !=
EQUAL) {
5414 if (!parse_binding_value(cfile, nv)) {
5474 "expecting ia_ta contents, " 5483 "missing state in iaaddr");
5486 if (end_time == -1) {
5488 "missing end time in iaaddr");
5493 if (iasubopt_allocate(&iaaddr,
MDL) != ISC_R_SUCCESS) {
5498 iaaddr->
state = state;
5500 iaaddr->
valid = valid;
5504 if (scope != NULL) {
5516 (i < 2) &&
on_star[i] != NULL ;
5519 on_star[i]->data.on.statements) {
5525 on_star[i]->data.on.statements) {
5536 &iaaddr->
addr) != ISC_R_SUCCESS) {
5537 inet_ntop(AF_INET6, &iaaddr->
addr,
5538 addr_buf,
sizeof(addr_buf));
5539 log_error(
"No pool found for IA_TA address %s",
5547 iaaddr, ia) != ISC_R_SUCCESS) {
5548 inet_ntop(AF_INET6, &iaaddr->
addr,
5549 addr_buf,
sizeof(addr_buf));
5550 parse_warn(cfile,
"duplicate ta lease for address %s",
5596 #if !defined(DHCPv6) 5601 struct ia_xx *ia = NULL;
5603 struct ia_xx *old_ia;
5613 char addr_buf[
sizeof(
"ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
5614 isc_boolean_t newbinding;
5622 parse_warn(cfile,
"IA_PD is only supported in DHCPv6 mode.");
5627 if (!parse_iaid_duid(cfile, &ia, &iaid,
MDL)) {
5635 parse_warn(cfile,
"corrupt lease file; expecting left brace");
5642 if (token ==
RBRACE)
break;
5644 if (token ==
CLTT) {
5650 parse_warn(cfile,
"corrupt lease file; expecting " 5651 "IAPREFIX or right brace");
5658 "expecting IPv6 prefix");
5666 "expecting left brace");
5676 if (token ==
RBRACE)
break;
5685 "unexpected end of file");
5691 if (token !=
STATE) {
5725 if (token !=
SEMI) {
5742 prefer = atoi (val);
5751 if (token ==
SEMI) {
5755 "corrupt lease file; " 5756 "expecting semicolon.");
5779 if (token ==
SEMI) {
5783 "corrupt lease file; " 5784 "expecting semicolon.");
5796 if ((token !=
NAME) &&
5828 if (bnd->
name == NULL) {
5832 strcpy(bnd->
name, val);
5834 newbinding = ISC_TRUE;
5836 newbinding = ISC_FALSE;
5845 if (token !=
EQUAL) {
5851 if (!parse_binding_value(cfile, nv)) {
5911 "expecting ia_pd contents, " 5920 "missing state in iaprefix");
5923 if (end_time == -1) {
5925 "missing end time in iaprefix");
5930 if (iasubopt_allocate(&iapref,
MDL) != ISC_R_SUCCESS) {
5934 iapref->
plen = plen;
5935 iapref->
state = state;
5937 iapref->
valid = valid;
5941 if (scope != NULL) {
5953 (i < 2) &&
on_star[i] != NULL ;
5956 on_star[i]->data.on.statements) {
5962 on_star[i]->data.on.statements) {
5974 &iapref->
addr) != ISC_R_SUCCESS) ||
5976 inet_ntop(AF_INET6, &iapref->
addr,
5977 addr_buf,
sizeof(addr_buf));
5978 log_error(
"No pool found for prefix %s/%d", addr_buf,
5986 iapref, ia) != ISC_R_SUCCESS) {
5987 inet_ntop(AF_INET6, &iapref->
addr,
5988 addr_buf,
sizeof(addr_buf));
5989 parse_warn(cfile,
"duplicate pd lease for address %s",
6049 unsigned char bytes[128];
6059 memset(&duid, 0x0,
sizeof(duid));
6061 log_fatal(
"parse_server_duid: out of memory");
6064 memcpy(duid.buffer->data, bytes,
len);
6066 duid.data = duid.buffer->data;
6090 u_int32_t enterprise_number;
6117 parse_warn(cfile,
"enterprise number expected");
6121 enterprise_number = atoi(val);
6133 memset(&duid, 0,
sizeof(duid));
6134 duid.len = 2 + 4 +
len;
6136 log_fatal(
"Out of memory storing DUID");
6138 duid.data = (
unsigned char *)duid.buffer->data;
6140 putULong(duid.buffer->data + 2, enterprise_number);
6141 memcpy(duid.buffer->data + 6, val,
len);
6154 else if (token ==
LL) {
6177 memset(&ll_addr, 0,
sizeof(ll_addr));
6185 memset(&duid, 0,
sizeof(duid));
6186 duid.len = 2 + 2 + ll_addr.len;
6188 log_fatal(
"Out of memory storing DUID");
6190 duid.data = (
unsigned char *)duid.buffer->data;
6192 putUShort(duid.buffer->data + 2, ll_type);
6193 memcpy(duid.buffer->data + 4,
6194 ll_addr.data, ll_addr.len);
6209 else if (token ==
LLT) {
6239 llt_time = atoi(val);
6241 memset(&ll_addr, 0,
sizeof(ll_addr));
6249 memset(&duid, 0,
sizeof(duid));
6250 duid.len = 2 + 2 + 4 + ll_addr.len;
6252 log_fatal(
"Out of memory storing DUID");
6254 duid.data = (
unsigned char *)duid.buffer->data;
6256 putUShort(duid.buffer->data + 2, ll_type);
6257 putULong(duid.buffer->data + 4, llt_time);
6258 memcpy(duid.buffer->data + 8,
6259 ll_addr.data, ll_addr.len);
6276 else if (token ==
NUMBER) {
6277 duid_type_num = atoi(val);
6289 memset(&duid, 0,
sizeof(duid));
6292 log_fatal(
"Out of memory storing DUID");
6294 duid.data = (
unsigned char *)duid.buffer->data;
6295 putUShort(duid.buffer->data, duid_type_num);
6296 memcpy(duid.buffer->data + 2, val,
len);
6306 parse_warn(cfile,
"DUID type of LLT, EN, or LL expected");
6315 if (token !=
SEMI) {
6339 memcpy(&value, source, 4);
6343 "authoring-byte-order not in the lease file.\n" 6344 "Assuming file byte order matches this server.\n");
6349 value = (((value >> 24) & 0xff) |
6350 ((value << 8) & 0xff0000) |
6351 ((value >> 8) & 0xff00) |
6352 ((value << 24) & 0xff000000));
6373 parse_iaid_duid(
struct parse* cfile,
struct ia_xx** ia, u_int32_t *iaid,
6375 unsigned char bytes[132];
6379 log_error(
"parse_iaid_duid: ia ptr cannot be null");
6387 "iaid+ia_xx string too short");
6398 log_fatal(
"parse_iaid_duid:Out of memory.");
struct iaddrcidrnet cidrnet
#define GROUP_OBJECT_DYNAMIC
void parse_option_space_decl(struct parse *cfile)
int parse_X(struct parse *cfile, u_int8_t *buf, unsigned max)
int executable_statement_reference(struct executable_statement **ptr, struct executable_statement *bp, const char *file, int line)
int executable_statement_allocate(struct executable_statement **ptr, const char *file, int line)
int parse_lease_declaration(struct lease **lp, struct parse *cfile)
void parse_server_duid_conf(struct parse *cfile)
isc_result_t parse_option_name(struct parse *cfile, int allocate, int *known, struct option **opt)
void parse_trace_setup(void)
void trace_conf_input(trace_type_t *, unsigned, char *)
int parse_option_code_definition(struct parse *cfile, struct option *option)
isc_result_t read_conf_file(const char *filename, struct group *group, int group_type, int leasep)
struct universe * universe
int binding_value_dereference(struct binding_value **v, const char *file, int line)
isc_result_t delete_group(struct group_object *group, int writep)
isc_result_t add_lease6(struct ipv6_pool *pool, struct iasubopt *lease, time_t valid_lifetime_end_time)
int executable_statement_dereference(struct executable_statement **ptr, const char *file, int line)
const char * piaddr(const struct iaddr addr)
#define CLASS_TYPE_VENDOR
void parse_fixed_prefix6(struct parse *cfile, struct host_decl *host_decl)
struct permit * new_permit(const char *, int)
isc_result_t end_parse(struct parse **cfile)
int parse_statement(struct parse *cfile, struct group *group, int type, struct host_decl *host_decl, int declaration)
int permit_list_match(struct permit *lhs, struct permit *rhs)
char * piaddrmask(struct iaddr *addr, struct iaddr *mask)
isc_result_t ia_dereference(struct ia_xx **ia, const char *file, int line)
int option_cache_dereference(struct option_cache **ptr, const char *file, int line)
void parse_pool6_statement(struct parse *, struct group *, int)
struct universe server_universe
struct iaddr ip_addr(struct iaddr subnet, struct iaddr mask, u_int32_t host_address)
int parse_data_expression(struct expression **expr, struct parse *cfile, int *lose)
struct ipv6_pond * ipv6_pond
int binding_value_reference(struct binding_value **ptr, struct binding_value *src, const char *file, int line)
#define HOST_DECL_DYNAMIC
#define CLASS_DECL_DELETED
int int int log_debug(const char *,...) __attribute__((__format__(__printf__
enum executable_statement::statement_op op
uint32_t parse_byte_order_uint32(const void *source)
struct executable_statement * on_release
int option_reference(struct option **dest, struct option *src, const char *file, int line)
void print_expression(char *name, struct expression *expr) const
struct universe dhcp_universe
int group_reference(struct group **ptr, struct group *bp, const char *file, int line)
void data_string_forget(struct data_string *data, const char *file, int line)
struct shared_network * shared_network
isc_result_t ipv6_pond_reference(struct ipv6_pond **pond, struct ipv6_pond *src, const char *file, int line)
reference an IPv6 pond structure.
int option_cache_reference(struct option_cache **ptr, struct option_cache *src, const char *file, int line)
struct option_cache * fixed_addr
struct group * root_group
enum binding_value::@15 type
struct data_string hash_string
const char * path_dhcpd_db
int log_error(const char *,...) __attribute__((__format__(__printf__
struct collection * collections
int binding_scope_dereference(struct binding_scope **ptr, const char *file, int line)
void free_permit(struct permit *, const char *, int)
struct binding_scope * scope
dhcp_failover_state_t * failover_peer
int parse_semi(struct parse *cfile)
struct executable_statement * next
dhcp_failover_state_t * failover_peer
int parse_fixed_addr_param(struct option_cache **oc, struct parse *cfile, enum dhcp_token type)
enum dhcp_token peek_token(const char **rval, unsigned *rlen, struct parse *cfile)
isc_result_t lease_file_subparse(struct parse *cfile)
struct data_string client_identifier
struct permit * prohibit_list
int parse_string(struct parse *cfile, char **sptr, unsigned *lptr)
void parse_failover_state_declaration(struct parse *, dhcp_failover_state_t *)
void expression_dereference(struct expression **eptr, const char *file, int line)
#define DHO_DHCP_SERVER_IDENTIFIER
void log_fatal(const char *,...) __attribute__((__format__(__printf__
void get_permit(struct parse *cfile, struct permit **permit_head, int is_allow, TIME *valid_from, TIME *valid_until)
Parse allow and deny statements.
void parse_ia_ta_declaration(struct parse *cfile)
int binding_value_allocate(struct binding_value **cptr, const char *file, int line)
struct executable_statement * statements
int parse_cshl(struct data_string *data, struct parse *cfile)
void parse_group_declaration(struct parse *cfile, struct group *group)
int option_cache_allocate(struct option_cache **cptr, const char *file, int line)
union expression::expr_union data
#define CLASS_DECL_DYNAMIC
struct hardware hardware_addr
struct iaddr subnet_number(struct iaddr addr, struct iaddr mask)
void postdb_startup(void)
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.
enum dhcp_token next_token(const char **rval, unsigned *rlen, struct parse *cfile)
int subnet_inner_than(const struct subnet *, const struct subnet *, int)
time_t hard_lifetime_end_time
struct permit * prohibit_list
host_hash_t * host_name_hash
void parse_ia_na_declaration(struct parse *cfile)
#define CLASS_TYPE_SUBCLASS
isc_result_t delete_host(struct host_decl *, int)
void enter_shared_network(struct shared_network *)
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.
binding_state_t binding_state
int buffer_allocate(struct buffer **ptr, unsigned len, const char *file, int line)
struct option_cache * option
void postconf_initialization(int)
int binding_scope_allocate(struct binding_scope **ptr, const char *file, int line)
trace_type_t * trace_type_register(const char *, void *, void(*)(trace_type_t *, unsigned, char *), void(*)(trace_type_t *), const char *, int)
void putULong(unsigned char *, u_int32_t)
int group_dereference(struct group **ptr, const char *file, int line)
#define skip_token(a, b, c)
void enter_lease(struct lease *)
int parse_boolean_expression(struct expression **expr, struct parse *cfile, int *lose)
struct iaddrcidrnetlist * next
option_name_hash_t * name_hash
unsigned char * parse_numeric_aggregate(struct parse *cfile, unsigned char *buf, unsigned *max, int separator, int base, unsigned size)
struct data_string iaid_duid
isc_result_t free_iaddrcidrnetlist(struct iaddrcidrnetlist **result)
int parse_lbrace(struct parse *cfile)
void parse_subnet6_declaration(struct parse *cfile, struct shared_network *share)
int make_concat(struct expression **expr, struct expression *left, struct expression *right)
TIME parse_date(struct parse *cfile)
struct expression * submatch
void dfree(void *, const char *, int)
void set_server_duid(struct data_string *new_duid)
isc_result_t add_ipv6_pool(struct ipv6_pool *pool)
int parse_ip6_addr(struct parse *cfile, struct iaddr *addr)
struct data_string host_id
int parse_ip_addr_or_hostname(struct expression **expr, struct parse *cfile, int uniform)
void set_server_duid_type(int type)
int parse_option_decl(struct option_cache **oc, struct parse *cfile)
isc_result_t conf_file_subparse(struct parse *cfile, struct group *group, int group_type)
struct ipv6_pool ** ipv6_pools
void skip_to_semi(struct parse *cfile)
int option_cache(struct option_cache **oc, struct data_string *dp, struct expression *expr, struct option *option, const char *file, int line)
void * dmalloc(size_t, const char *, int)
void skip_to_rbrace(struct parse *cfile, int brace_count)
void new_address_range(struct parse *, struct iaddr, struct iaddr, struct subnet *, struct pool *, struct lease **)
isc_result_t find_failover_peer(dhcp_failover_state_t **, const char *, const char *, int)
int parse_on_statement(struct executable_statement **result, struct parse *cfile, int *lose)
struct shared_network * shared_network
isc_result_t ipv6_pool_dereference(struct ipv6_pool **pool, const char *file, int line)
de-reference an IPv6 pool structure.
isc_result_t find_ipv6_pool(struct ipv6_pool **pool, u_int16_t type, const struct in6_addr *addr)
int addr_eq(struct iaddr addr1, struct iaddr addr2)
struct executable_statement::@7::@9 on
char * parse_host_name(struct parse *cfile)
int parse_option_statement(struct executable_statement **result, struct parse *cfile, int lookups, struct option *option, enum statement_op op)
isc_result_t delete_class(struct class *, int)
isc_result_t enter_failover_peer(dhcp_failover_state_t *)
union executable_statement::@7 data
void parse_shared_net_declaration(struct parse *cfile, struct group *group)
void db_startup(int testp)
int parse_option_data(struct expression **expr, struct parse *cfile, int lookups, struct option *option)
union binding_value::value value
struct shared_network * shared_network
struct lease ** billed_leases
const char * path_dhcpd_conf
struct data_string const_data
u_int32_t host_addr(struct iaddr addr, struct iaddr mask)
void parse_address_range(struct parse *cfile, struct group *group, int type, struct pool *inpool, struct lease **lpchain)
int parse_ip6_addr_expr(struct expression **expr, struct parse *cfile)
struct iaddrcidrnetlist * fixed_prefix
struct group_object * named_group
struct binding * bindings
isc_result_t ipv6_pond_allocate(struct ipv6_pond **pond, const char *file, int line)
Create a new IPv6 pond structure.
isc_boolean_t is_cidr_mask_valid(const struct iaddr *addr, int bits)
int binding_scope_reference(struct binding_scope **ptr, struct binding_scope *bp, const char *file, int line)
binding_state_t rewind_binding_state
void parse_failover_state(struct parse *, enum failover_state *, TIME *)
void parse_host_declaration(struct parse *cfile, struct group *group)
int make_const_data(struct expression **expr, const unsigned char *data, unsigned len, int terminated, int allocate, const char *file, int line)
void parse_subnet_declaration(struct parse *cfile, struct shared_network *share)
void parse_failover_peer(struct parse *, struct group *, int)
void parse_address_range6(struct parse *cfile, struct group *group, struct ipv6_pond *)
#define SV_BOOT_UNKNOWN_CLIENTS
TIME parse_date_core(struct parse *cfile)
isc_result_t iasubopt_dereference(struct iasubopt **iasubopt, const char *file, int line)
struct binding_value * value
isc_result_t supersede_group(struct group_object *group, int writep)
isc_result_t find_class(struct class **c, const char *s, const char *file, int line)
void parse_prefix6(struct parse *cfile, struct group *group, struct ipv6_pond *)
struct option * host_id_option
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)
int option_chain_head_allocate(struct option_chain_head **ptr, const char *file, int line)
int parse_ip6_prefix(struct parse *cfile, struct iaddr *addr, u_int8_t *plen)
struct subnet * next_sibling
isc_result_t ia_add_iasubopt(struct ia_xx *ia, struct iasubopt *iasubopt, const char *file, int line)
struct interface_info * interface
isc_result_t ipv6_pond_dereference(struct ipv6_pond **pond, const char *file, int line)
de-reference an IPv6 pond structure.
void enter_subnet(struct subnet *)
isc_result_t enter_host(struct host_decl *, int, int)
void parse_ia_pd_declaration(struct parse *cfile)
group_hash_t * group_name_hash
struct executable_statement * statements
#define DHO_VENDOR_CLASS_IDENTIFIER
struct universe agent_universe
isc_result_t trace_get_file(trace_type_t *, const char *, unsigned *, char **)
struct ipv6_pool ** pools
char * piaddrcidr(const struct iaddr *addr, unsigned int bits)
option_code_hash_t * code_hash
void parse_server_duid(struct parse *cfile)
pair cons(caddr_t car, pair cdr)
struct executable_statement * on_expiry
struct binding * find_binding(struct binding_scope *scope, const char *name)
struct shared_network * shared_network
int parse_class_declaration(struct class **cp, struct parse *cfile, struct group *group, int type)
void new_shared_network_interface(struct parse *, struct shared_network *, const char *)
struct permit * permit_list
void putUShort(unsigned char *, u_int32_t)
isc_result_t trace_write_packet(trace_type_t *, unsigned, const char *, const char *, int)
isc_result_t range2cidr(struct iaddrcidrnetlist **result, const struct iaddr *lo, const struct iaddr *hi)
void trace_conf_stop(trace_type_t *ttype)
int parse_allow_deny(struct option_cache **oc, struct parse *cfile, int flag)
isc_result_t ia_reference(struct ia_xx **ia, struct ia_xx *src, const char *file, int line)
const unsigned char * data
struct binding_scope * scope
void data_string_copy(struct data_string *dest, const struct data_string *src, const char *file, int line)
isc_result_t ipv6_pool_reference(struct ipv6_pool **pool, struct ipv6_pool *src, const char *file, int line)
reference an IPv6 pool structure.
struct hardware interface
struct permit * permit_list
int parse_executable_statement(struct executable_statement **result, struct parse *cfile, int *lose, enum expression_context case_context)
void parse_hardware_param(struct parse *cfile, struct hardware *hardware)
int clone_group(struct group **gp, struct group *group, const char *file, int line)
int parse_warn(struct parse *cfile, const char *fmt,...)
binding_state_t next_binding_state
struct interface_info * interface
isc_result_t new_parse(struct parse **cfile, int file, char *inbuf, unsigned buflen, const char *name, int eolp)
void parse_pool_statement(struct parse *cfile, struct group *group, int type)
Parse a pool statement.
#define GROUP_OBJECT_STATIC
int option_dereference(struct option **dest, const char *file, int line)
#define SV_CLIENT_UPDATES