40 enumerations = enumeration;
47 for (e = enumerations; e; e = e ->
next)
48 if (strlen (e -> name) == length &&
49 !memcmp (e -> name, name, (
unsigned)length))
67 if (!strcmp (value, e ->
values [i].name))
101 #if defined (DEBUG_TOKEN)
102 log_error(
"skip_to_rbrace: %d\n", brace_count);
107 if (brace_count > 0) {
111 if (brace_count == 0) {
116 }
else if (token ==
LBRACE) {
118 }
else if (token ==
SEMI && (brace_count == 0)) {
122 }
else if (token ==
EOL) {
141 token =
next_token (&val, (
unsigned *)0, cfile);
170 log_fatal (
"no memory for string %s.", val);
171 memcpy (s, val, len + 1);
206 token =
peek_token (&val, (
unsigned *)0, cfile);
212 if (!(s = (
char *)
dmalloc (strlen (val) + 1,
MDL)))
213 log_fatal (
"can't allocate temp space for hostname.");
215 c =
cons ((caddr_t)s, c);
216 len += strlen (s) + 1;
219 token =
peek_token (&val, (
unsigned *)0, cfile);
221 token =
next_token (&val, (
unsigned *)0, cfile);
225 }
while (token ==
DOT);
233 log_fatal (
"can't allocate space for hostname.");
240 unsigned l = strlen ((
char *)(c -> car));
242 memcpy (t, (
char *)(c -> car), l);
271 unsigned char addr [4];
272 unsigned len =
sizeof addr;
277 token =
peek_token (&val, (
unsigned *)0, cfile);
317 token =
next_token (&val, (
unsigned *)0, cfile);
318 parse_warn (cfile,
"%s (%d): expecting IP address or hostname",
338 &addr -> len,
DOT, 10, 8))
354 unsigned int mask_width, dest_dest_len;
357 &addr -> len,
DOT, 10, 8)) {
358 mask_width = (
unsigned int)addr->
iabuf[0];
359 dest_dest_len = (((mask_width+7)/8)+1);
360 if (mask_width > 32) {
362 "subnet mask width (%u) greater than 32.", mask_width);
364 else if (dest_dest_len != addr->
len) {
366 "destination descriptor with subnet mask width %u "
367 "should have %u octets, but has %u octets.",
368 mask_width, dest_dest_len, addr->
len);
380 is_hex_string(
const char *s) {
382 if (!isxdigit((
int)*s)) {
406 char v6[
sizeof(
"ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
421 is_hex_string(val)) ||
427 val_len = strlen(val);
428 if ((v6_len + val_len) >=
sizeof(v6)) {
433 memcpy(v6+v6_len, val, val_len);
446 if (inet_pton(AF_INET6, v6, addr->
iabuf) <= 0) {
461 struct parse *cfile) {
483 if (token !=
SLASH) {
497 if ((n < 0) || (n > 128)) {
498 parse_warn(cfile,
"Invalid IPv6 prefix length.");
521 const char *val, *orig;
525 unsigned char newval, warnmask=0;
529 prefixlen = match->
addr.
len * 8;
533 if (token ==
SLASH) {
538 parse_warn(cfile,
"Invalid CIDR prefix length:"
539 " expecting a number.");
543 prefixlen = atoi(val);
546 prefixlen > (match->
addr.
len * 8)) {
560 fflen = prefixlen / 8;
566 if (fflen < match->mask.len) {
568 "\x00\x80\xc0\xe0\xf0\xf8\xfc\xfe"[prefixlen % 8];
579 if (newval != match->
addr.
iabuf[fflen]) {
583 }
while (++fflen < match->mask.len);
586 log_error(
"Warning: Extraneous bits removed "
587 "in address component of %s/%d.",
598 "expecting ip-address or ip-address/prefixlen");
634 if (!strncmp(val,
"unknown-", 8)) {
635 hardware->
hbuf[0] = atoi(&val[8]);
638 "expecting a network hardware type");
663 if (hlen + 1 >
sizeof(hardware->
hbuf)) {
665 parse_warn(cfile,
"hardware address too long");
667 hardware->
hlen = hlen + 1;
668 memcpy((
unsigned char *)&hardware->
hbuf[1], t, hlen);
669 if (hlen + 1 <
sizeof(hardware->
hbuf))
670 memset(&hardware->
hbuf[hlen + 1], 0,
671 (
sizeof(hardware->
hbuf)) - hlen - 1);
693 token =
next_token (&val, (
unsigned *)0, cfile);
695 parse_warn (cfile,
"Expecting numeric lease time");
699 convert_num(cfile, (
unsigned char *)&num, val, 10, 32);
730 max, separator, base, size)
740 unsigned char *bufp = buf, *s, *t;
745 bufp = (
unsigned char *)
dmalloc (*max * size / 8,
MDL);
747 log_fatal (
"no space for numeric aggregate");
753 token =
peek_token (&val, (
unsigned *)0, cfile);
754 if (token != separator) {
767 if ((bufp != NULL) && (bufp != buf))
769 return (
unsigned char *)0;
773 token =
next_token (&val, (
unsigned *)0, cfile);
783 parse_warn (cfile,
"expecting numeric value.");
786 if ((bufp != NULL) && (bufp != buf))
803 t = (
unsigned char *)
dmalloc (strlen (val) + 1,
MDL);
806 strcpy ((
char *)t, val);
807 c =
cons ((caddr_t)t, c);
809 }
while (++count != *max);
817 bufp = (
unsigned char *)
dmalloc (count * size / 8,
MDL);
819 log_fatal (
"no space for numeric aggregate.");
820 s = bufp + count - size / 8;
825 convert_num (cfile, s, (
char *)(c -> car), base, size);
842 const unsigned char *ptr = (
const unsigned char *)str;
855 if (ptr [0] ==
'0') {
856 if (ptr [1] ==
'x') {
859 }
else if (isascii (ptr [1]) && isdigit (ptr [1])) {
874 tval = tval -
'a' + 10;
875 else if (tval >=
'A')
876 tval = tval -
'A' + 10;
877 else if (tval >=
'0')
885 "Bogus number %s: digit %d not in base %d",
889 val = val * base + tval;
893 max = (1 << (size - 1));
895 max = (1 << (size - 1)) + ((1 << (size - 1)) - 1);
900 "%s%lo exceeds max (%d) for precision.",
902 (
unsigned long)val, max);
906 "%s%lx exceeds max (%d) for precision.",
908 (
unsigned long)val, max);
912 "%s%lu exceeds max (%d) for precision.",
914 (
unsigned long)val, max);
922 *buf = -(
unsigned long)val;
932 "Unexpected integer size: %d\n", size);
938 *buf = (u_int8_t)val;
948 "Unexpected integer size: %d\n", size);
977 long int tzoff, year, mon, mday, hour, min, sec;
980 static int months[11] = { 31, 59, 90, 120, 151, 181,
981 212, 243, 273, 304, 334 };
985 if (token ==
NEVER) {
991 if (token ==
EPOCH) {
998 parse_warn(cfile,
"Seconds since epoch expected.");
1005 return((
TIME)guess);
1011 parse_warn(cfile,
"numeric day of week expected.");
1037 if (token !=
SLASH) {
1041 "expected slash separating year from month.");
1051 parse_warn(cfile,
"numeric month expected.");
1055 mon = atoi(val) - 1;
1059 if (token !=
SLASH) {
1063 "expected slash separating month from day.");
1073 parse_warn(cfile,
"numeric day of month expected.");
1092 if (token !=
COLON) {
1096 "expected colon separating hour from minute.");
1106 parse_warn(cfile,
"numeric minute expected.");
1114 if (token !=
COLON) {
1118 "expected colon separating minute from second.");
1128 parse_warn(cfile,
"numeric second expected.");
1139 }
else if (token !=
SEMI) {
1142 "Time zone offset or semicolon expected.");
1147 guess = ((((((365 * (year - 70) +
1153 !((year - 72) & 3)) +
1156 min) * 60) + sec + tzoff;
1167 return((
TIME)guess);
1177 struct
parse *cfile;
1197 struct
parse *cfile;
1212 token =
next_token (&val, (
unsigned *)0, cfile);
1215 "expecting identifier after option keyword.");
1222 log_fatal (
"no memory for uname information.");
1223 strcpy (uname, val);
1224 token =
peek_token (&val, (
unsigned *)0, cfile);
1230 token =
next_token (&val, (
unsigned *)0, cfile);
1232 parse_warn (cfile,
"expecting identifier after '.'");
1240 universe = (
struct universe *)0;
1243 parse_warn (cfile,
"no option space named %s.", uname);
1245 return ISC_R_NOTFOUND;
1255 option_name_hash_lookup(opt, universe->
name_hash, val, 0,
MDL);
1268 }
else if (strncasecmp(val,
"unknown-", 8) == 0) {
1274 if (code == 0 || code == universe->
end) {
1275 parse_warn(cfile,
"Option codes 0 and %u are illegal "
1276 "in the %s space.", universe->
end,
1280 return ISC_R_FAILURE;
1290 option_code_hash_lookup(opt, universe->
code_hash,
1300 if (option == NULL) {
1303 option->
code = code;
1307 log_info(
"option %s has been redefined as option %s. "
1308 "Please update your configs if neccessary.",
1315 }
else if (allocate) {
1317 option -> universe = universe;
1320 parse_warn(cfile,
"no option named %s in space %s",
1321 val, universe->
name);
1324 return ISC_R_NOTFOUND;
1329 return ISC_R_SUCCESS;
1338 struct
parse *cfile;
1344 int tsize=1, lsize=1, hsize = 0;
1349 token =
next_token (&val, (
unsigned *)0, cfile);
1357 log_fatal (
"No memory for new option space.");
1362 log_fatal (
"No memory for new option space name.");
1363 strcpy (nu_name, val);
1364 nu ->
name = nu_name;
1374 if (token !=
WIDTH) {
1381 parse_warn(cfile,
"expecting number 1, 2, 4.");
1402 parse_warn(cfile,
"invalid code width (%d), "
1403 "expecting a 1, 2 or 4.",
1411 if (token !=
WIDTH) {
1418 parse_warn(cfile,
"expecting number 1 or 2.");
1423 if (lsize != 1 && lsize != 2) {
1424 parse_warn(cfile,
"invalid length width (%d) "
1425 "expecting 1 or 2.", lsize);
1433 if (token !=
SIZE) {
1440 parse_warn(cfile,
"expecting a 10base number");
1448 if (hsize < 0 || hsize > 0x7FFFFFFF) {
1459 }
while (token !=
SEMI);
1509 log_fatal (
"No memory to expand option space array.");
1516 if (!option_name_new_hash(&nu->
name_hash, hsize,
MDL) ||
1518 log_fatal(
"Can't allocate %s option hash table.", nu->
name);
1561 struct
parse *cfile;
1566 struct option *oldopt;
1567 unsigned arrayp = 0;
1569 int no_more_in_record = 0;
1575 int has_encapsulation = 0;
1579 token =
next_token (&val, (
unsigned *)0, cfile);
1581 parse_warn (cfile,
"expecting option code number.");
1585 option -> code = atoi (val);
1587 token =
next_token (&val, (
unsigned *)0, cfile);
1588 if (token !=
EQUAL) {
1595 token =
next_token (&val, (
unsigned *)0, cfile);
1596 if (token ==
ARRAY) {
1597 token =
next_token (&val, (
unsigned *)0, cfile);
1604 token =
next_token (&val, (
unsigned *)0, cfile);
1609 token =
next_token (&val, (
unsigned *)0, cfile);
1614 if (has_encapsulation) {
1616 "encapsulate must always be the last item.");
1630 token =
next_token (&val, (
unsigned *)0, cfile);
1636 arrayp = recordp + 1;
1637 token =
next_token (&val, (
unsigned *)0, cfile);
1638 if ((recordp) && (token ==
LBRACE)) {
1640 "only uniform array inside record.");
1652 token =
next_token (&val, (
unsigned *)0, cfile);
1660 switch (atoi (val)) {
1662 type = is_signed ?
'b' :
'B';
1665 type = is_signed ?
's' :
'S';
1668 type = is_signed ?
'l' :
'L';
1672 "%s bit precision is not supported.", val);
1682 token =
next_token (&val, (
unsigned *)0, cfile);
1684 parse_warn (cfile,
"expecting \"integer\" keyword.");
1712 tokbuf[tokix++] =
'D';
1721 parse_warn (cfile,
"arrays of text strings not %s",
1728 no_more_in_record = 1;
1735 token =
next_token (&val, (
unsigned *)0, cfile);
1738 "expecting option space identifier");
1742 encapsulated = NULL;
1744 val, strlen(val),
MDL)) {
1745 parse_warn(cfile,
"unknown option space %s", val);
1749 if (strlen (val) + tokix + 2 >
sizeof (tokbuf))
1751 tokbuf [tokix++] =
'E';
1752 strcpy (&tokbuf [tokix], val);
1753 tokix += strlen (val);
1755 has_encapsulation = 1;
1761 parse_warn (cfile,
"array incompatible with zerolen.");
1767 no_more_in_record = 1;
1771 parse_warn (cfile,
"unknown data type %s", val);
1778 if (tokix ==
sizeof tokbuf) {
1780 parse_warn (cfile,
"too many types in record.");
1786 tokbuf [tokix++] = type;
1789 token =
next_token (&val, (
unsigned *)0, cfile);
1790 if (arrayp > recordp) {
1791 if (tokix ==
sizeof tokbuf) {
1793 "too many types in record.");
1799 tokbuf[tokix++] =
'a';
1801 if (token ==
COMMA) {
1802 if (no_more_in_record) {
1804 "%s must be at end of record.",
1805 type ==
't' ?
"text" :
"string");
1811 token =
next_token (&val, (
unsigned *)0, cfile);
1815 parse_warn (cfile,
"expecting right brace.");
1829 if (has_encapsulation && arrayp) {
1831 "Arrays of encapsulations don't make sense.");
1834 s =
dmalloc(tokix + (arrayp ? 1 : 0) + 1,
MDL);
1836 log_fatal(
"no memory for option format.");
1838 memcpy(s, tokbuf, tokix);
1840 s[tokix++] = (arrayp > recordp) ?
'a' :
'A';
1844 option -> format = s;
1849 if (oldopt != NULL) {
1870 if (has_encapsulation) {
1873 if (!option_code_hash_lookup(&encapsulated->
enc_opt,
1876 log_fatal(
"error finding encapsulated option (%s:%d)",
1889 struct
parse *cfile;
1894 static unsigned char
1895 from64 [] = {64, 64, 64, 64, 64, 64, 64, 64,
1896 64, 64, 64, 62, 64, 64, 64, 63,
1897 52, 53, 54, 55, 56, 57, 58, 59,
1898 60, 61, 64, 64, 64, 64, 64, 64,
1899 64, 0, 1, 2, 3, 4, 5, 6,
1900 7, 8, 9, 10, 11, 12, 13, 14,
1901 15, 16, 17, 18, 19, 20, 21, 22,
1902 23, 24, 25, 64, 64, 64, 64, 64,
1903 64, 26, 27, 28, 29, 30, 31, 32,
1904 33, 34, 35, 36, 37, 38, 39, 40,
1905 41, 42, 43, 44, 45, 46, 47, 48,
1906 49, 50, 51, 64, 64, 64, 64, 64};
1923 log_fatal(
"no memory for base64 buffer.");
1924 memset(t, 0, (
sizeof(*t)) - 1);
1925 memcpy(t->string, val, l + 1);
1934 for (i = 0; val[i]; i++) {
1938 if (((val[i] <
' ') || (val[i] >
'z')) ||
1939 ((from64[val[i] -
' '] > 63) && (val[i] !=
'='))) {
1944 }
while (valid_base64);
1947 data->len = (data->len * 3) / 4;
1949 parse_warn (cfile,
"can't allocate buffer for base64 data.");
1956 for (t = bufs; t; t = t->
next) {
1957 for (i = 0; t->string[i]; i++) {
1958 unsigned foo = t->string[i];
1959 if (terminated && foo !=
'=') {
1961 "stuff after base64 '=' terminator: %s.",
1965 if ((foo <
' ') || (foo >
'z')) {
1968 "invalid base64 character %d.",
1977 foo = from64[foo -
' '];
1980 acc = (acc << 6) + foo;
1985 data->buffer->data[j++] = (acc >> 4);
1990 data->buffer->data[j++] = (acc >> 2);
1994 data->buffer->data[j++] = acc;
2005 "partial base64 value left over: %d.",
2010 data->data = data->buffer->data;
2012 for (t = bufs; t; t = last) {
2030 struct
parse *cfile;
2032 u_int8_t ibuf [128];
2042 token =
next_token (&val, (
unsigned *)0, cfile);
2044 parse_warn (cfile,
"expecting hexadecimal number.");
2046 for (; sl; sl =
next) {
2052 if (ilen ==
sizeof ibuf) {
2057 log_fatal (
"no memory for string list.");
2058 memcpy (next -> data, ibuf, ilen);
2060 last = &next ->
next;
2066 token =
peek_token (&val, (
unsigned *)0, cfile);
2073 log_fatal (
"no memory to store octet data.");
2074 data -> data = &data ->
buffer -> data [0];
2075 data -> len = tlen + ilen;
2076 data -> terminated = 0;
2078 rvp = &data ->
buffer -> data [0];
2081 memcpy (rvp, sl -> data,
sizeof ibuf);
2087 memcpy (rvp, ibuf, ilen);
2107 struct
parse *cfile;
2115 next = &((*next) ->
next);
2123 struct
parse *cfile;
2127 #if defined(ENABLE_EXECUTE)
2140 isc_result_t status;
2143 token =
peek_token (&val, (
unsigned *)0, cfile);
2150 }
else if (token ==
LOCAL) {
2153 parse_warn(cfile,
"Expecting 'local' or 'default'.");
2161 if (token !=
SEMI) {
2176 token =
next_token (&val, (
unsigned *)0, cfile);
2183 cta = (
struct class *)0;
2185 if (status != ISC_R_SUCCESS) {
2187 val, isc_result_totext (status));
2197 log_fatal (
"no memory for new statement.");
2198 (*result) -> op = add_statement;
2199 (*result) -> data.add = cta;
2209 log_fatal (
"no memory for new statement.");
2210 (*result) -> op = break_statement;
2217 if (status != ISC_R_SUCCESS || option == NULL) {
2222 send_option_statement);
2231 if (status != ISC_R_SUCCESS || option == NULL) {
2236 supersede_option_statement);
2254 log_fatal (
"no memory for new statement.");
2255 (*result) -> op = supersede_option_statement;
2256 (*result) ->
data.option = cache;
2261 token =
peek_token (&val, (
unsigned *)0, cfile);
2263 goto switch_default;
2266 if (status != ISC_R_SUCCESS || option == NULL) {
2271 default_option_statement);
2279 if (status != ISC_R_SUCCESS || option == NULL) {
2284 prepend_option_statement);
2292 if (status != ISC_R_SUCCESS || option == NULL) {
2297 append_option_statement);
2313 "case statement in inappropriate scope.");
2319 cfile, lose, case_context);
2324 parse_warn (cfile,
"switch default statement in %s",
2325 "inappropriate scope.");
2331 log_fatal (
"no memory for default statement.");
2332 (*result) -> op = default_statement;
2344 token =
next_token (&val, (
unsigned *)0, cfile);
2347 "%s can't be a variable name", val);
2355 log_fatal (
"no memory for set statement.");
2356 (*result) -> op = flag ? define_statement : set_statement;
2358 if (!(*result)->data.set.name)
2359 log_fatal (
"can't allocate variable name");
2360 strcpy ((*result) ->
data.set.name, val);
2361 token =
next_token (&val, (
unsigned *)0, cfile);
2369 (
unsigned *)0, cfile);
2374 "expecting argument name");
2383 strlen (val),
MDL));
2386 memset (
new, 0,
sizeof *
new);
2387 strcpy (
new ->
string, val);
2395 (
unsigned *)0, cfile);
2396 }
while (token ==
COMMA);
2399 parse_warn (cfile,
"expecting right paren.");
2407 token =
next_token (&val, (
unsigned *)0, cfile);
2415 log_fatal (
"can't allocate expression.");
2423 (&expr ->
data.
func -> statements, cfile, lose,
2429 token =
next_token (&val, (
unsigned *)0, cfile);
2435 if (token !=
EQUAL) {
2437 "expecting '=' in %s statement.",
2438 flag ?
"define" :
"set");
2448 "expecting expression.");
2465 token =
next_token (&val, (
unsigned *)0, cfile);
2468 "%s can't be a variable name", val);
2475 log_fatal (
"no memory for set statement.");
2476 (*result) ->
op = unset_statement;
2478 if (!(*result)->data.unset)
2479 log_fatal (
"can't allocate variable name");
2480 strcpy ((*result) ->
data.unset, val);
2491 log_fatal (
"no memory for eval statement.");
2492 (*result) ->
op = eval_statement;
2499 "expecting data expression.");
2513 #ifdef ENABLE_EXECUTE
2517 log_fatal (
"no memory for execute statement.");
2518 (*result)->op = execute_statement;
2522 parse_warn(cfile,
"left parenthesis expected.");
2530 parse_warn(cfile,
"Expecting a quoted string.");
2536 (*result)->data.execute.command =
dmalloc(len + 1,
MDL);
2537 if ((*result)->data.execute.command == NULL)
2538 log_fatal(
"can't allocate command name");
2539 strcpy((*result)->data.execute.command, val);
2542 (*result)->
data.execute.argc = 0;
2546 log_fatal (
"can't allocate expression");
2552 "expecting expression.");
2560 (*result)->
data.execute.argc++;
2564 parse_warn(cfile,
"right parenthesis expected.");
2575 parse_warn(cfile,
"define ENABLE_EXECUTE in site.h to "
2576 "enable execute(); expressions.");
2587 log_fatal (
"no memory for return statement.");
2588 (*result) ->
op = return_statement;
2595 "expecting data expression.");
2613 log_fatal (
"no memory for log statement.");
2614 (*result) ->
op = log_statement;
2616 token =
next_token (&val, (
unsigned *)0, cfile);
2618 parse_warn (cfile,
"left parenthesis expected.");
2624 token =
peek_token (&val, (
unsigned *)0, cfile);
2626 if (token ==
FATAL) {
2627 (*result) ->
data.log.priority = log_priority_fatal;
2628 }
else if (token ==
ERROR) {
2629 (*result) ->
data.log.priority = log_priority_error;
2631 (*result) ->
data.log.priority = log_priority_debug;
2632 }
else if (token ==
INFO) {
2633 (*result) ->
data.log.priority = log_priority_info;
2635 (*result) ->
data.log.priority = log_priority_debug;
2640 token =
next_token (&val, (
unsigned *)0, cfile);
2641 if (token !=
COMMA) {
2650 (&(*result) ->
data.log.
expr, cfile, lose))) {
2656 token =
next_token (&val, (
unsigned *)0, cfile);
2658 parse_warn (cfile,
"right parenthesis expected.");
2664 token =
next_token (&val, (
unsigned *)0, cfile);
2665 if (token !=
SEMI) {
2682 if (!zone ->
name) {
2690 i = strlen (zone ->
name);
2691 if (zone ->
name [i - 1] !=
'.') {
2694 parse_warn (cfile,
"no trailing '.' on zone");
2697 strcpy (s, zone ->
name);
2706 if (status != ISC_R_SUCCESS) {
2708 zone ->
name, isc_result_totext (status));
2726 option = (
struct option *)0;
2727 option_name_hash_lookup(&option,
2733 (result, cfile, 1, option,
2734 supersede_option_statement);
2744 log_fatal (
"no memory for eval statement.");
2745 (*result) -> op = eval_statement;
2796 token =
next_token (&val, (
unsigned *)0, cfile);
2803 token =
peek_token (&val, (
unsigned *)0, cfile);
2806 if (zone -> primary) {
2808 "more than one primary.");
2813 log_fatal (
"can't allocate primary option cache.");
2814 oc = zone -> primary;
2818 if (zone -> secondary) {
2819 parse_warn (cfile,
"more than one secondary.");
2824 log_fatal (
"can't allocate secondary.");
2825 oc = zone -> secondary;
2832 "expecting IP addr or hostname.");
2854 token =
next_token (&val, (
unsigned *)0, cfile);
2855 }
while (token ==
COMMA);
2856 if (token !=
SEMI) {
2865 parse_warn(cfile,
"more than one primary6.");
2870 log_fatal(
"can't allocate primary6 option cache.");
2876 parse_warn(cfile,
"more than one secondary6.");
2910 }
while (token ==
COMMA);
2911 if (token !=
SEMI) {
2934 log_fatal(
"Multiple key definitions for zone %s.",
2975 isc_result_t status;
2979 if (omapi_auth_key_new (&key,
MDL) != ISC_R_SUCCESS)
2982 token =
peek_token (&val, (
unsigned *)0, cfile);
2988 strcpy (key ->
name, val);
2999 token =
next_token (&val, (
unsigned *)0, cfile);
3006 token =
next_token (&val, (
unsigned *)0, cfile);
3011 "key %s: too many algorithms",
3018 "expecting key algorithm name.");
3027 static char add [] =
".SIG-ALG.REG.INT.";
3056 parse_warn (cfile,
"key %s: too many secrets",
3061 memset (&ds, 0,
sizeof(ds));
3066 if (status != ISC_R_SUCCESS)
3068 memcpy (key -> key -> value,
3082 parse_warn (cfile,
"expecting right brace.");
3087 token =
peek_token (&val, (
unsigned *)0, cfile);
3088 if (token ==
SEMI) {
3094 if (status != ISC_R_SUCCESS) {
3096 key ->
name, isc_result_totext (status));
3099 omapi_auth_key_dereference (&key,
MDL);
3105 omapi_auth_key_dereference (&key,
MDL);
3118 struct
parse *cfile;
3125 log_fatal (
"no memory for new statement.");
3126 (*result) -> op = on_statement;
3129 token =
next_token (&val, (
unsigned *)0, cfile);
3132 (*result) -> data.on.evtypes |=
ON_EXPIRY;
3136 (*result) -> data.on.evtypes |=
ON_COMMIT;
3148 parse_warn (cfile,
"expecting a lease event type");
3154 token =
next_token (&val, (
unsigned *)0, cfile);
3155 }
while (token ==
OR);
3174 (
unsigned *)0, cfile);
3180 token =
next_token (&val, (
unsigned *)0, cfile);
3198 struct
parse *cfile;
3205 log_fatal (
"no memory for new statement.");
3206 (*result) -> op = switch_statement;
3208 token =
next_token (&val, (
unsigned *)0, cfile);
3224 "expecting data or numeric expression.");
3230 token =
next_token (&val, (
unsigned *)0, cfile);
3236 token =
next_token (&val, (
unsigned *)0, cfile);
3242 (&(*result) -> data.s_switch.statements, cfile, lose,
3251 token =
next_token (&val, (
unsigned *)0, cfile);
3266 struct
parse *cfile;
3274 log_fatal (
"no memory for new statement.");
3275 (*result) -> op = case_statement;
3278 cfile, lose, case_context,
3282 parse_warn (cfile,
"expecting %s expression.",
3284 ?
"data" :
"numeric"));
3293 token =
next_token (&val, (
unsigned *)0, cfile);
3294 if (token !=
COLON) {
3313 struct
parse *cfile;
3321 log_fatal (
"no memory for if statement.");
3323 (*result) -> op = if_statement;
3325 token =
peek_token (&val, (
unsigned *)0, cfile);
3336 parse_warn (cfile,
"boolean expression expected.");
3341 #if defined (DEBUG_EXPRESSION_PARSE)
3345 token =
next_token (&val, (
unsigned *)0, cfile);
3347 parse_warn (cfile,
"expecting right paren.");
3353 token =
next_token (&val, (
unsigned *)0, cfile);
3367 (
unsigned *)0, cfile);
3373 token =
next_token (&val, (
unsigned *)0, cfile);
3381 token =
peek_token (&val, (
unsigned *)0, cfile);
3382 if (token ==
ELSE) {
3384 token =
peek_token (&val, (
unsigned *)0, cfile);
3391 "expecting if statement");
3396 }
else if (token !=
LBRACE) {
3397 parse_warn (cfile,
"left brace or if expected.");
3405 (&(*result) -> data.ie.fc,
3410 token =
next_token (&val, (
unsigned *)0, cfile);
3419 }
else if (token ==
ELSIF) {
3425 "expecting conditional.");
3449 struct
parse *cfile;
3460 parse_warn (cfile,
"Expecting a boolean expression.");
3471 struct
parse *cfile;
3477 if (!strcasecmp (val,
"true")
3478 || !strcasecmp (val,
"on"))
3480 else if (!strcasecmp (val,
"false")
3481 || !strcasecmp (val,
"off"))
3485 "boolean value (true/false/on/off) expected");
3516 struct
parse *cfile;
3528 parse_warn (cfile,
"Expecting a data expression.");
3543 struct
parse *cfile;
3555 parse_warn (cfile,
"Expecting a numeric expression.");
3566 struct
parse *cfile;
3576 isc_result_t status;
3579 token =
peek_token (&val, (
unsigned *)0, cfile);
3585 token =
next_token (&val, (
unsigned *)0, cfile);
3593 if (!strcmp (col -> name, val))
3601 log_fatal (
"can't allocate expression");
3609 log_fatal (
"can't allocate expression");
3623 parse_warn (cfile,
"boolean expression expected");
3641 token =
next_token (&val, (
unsigned *)0, cfile);
3653 log_fatal (
"can't allocate expression");
3658 &(*expr)->data.option);
3659 if (status != ISC_R_SUCCESS ||
3660 (*expr)->data.option == NULL) {
3670 log_fatal (
"can't allocate expression");
3677 log_fatal (
"can't allocate expression");
3684 log_fatal (
"can't allocate expression");
3687 token =
next_token (&val, (
unsigned *)0, cfile);
3691 parse_warn (cfile,
"left parenthesis expected.");
3702 "expecting data expression.");
3709 token =
next_token (&val, (
unsigned *)0, cfile);
3710 if (token !=
COMMA) {
3724 "expecting numeric expression.");
3732 token =
next_token (&val, (
unsigned *)0, cfile);
3740 token =
next_token (&val, (
unsigned *)0, cfile);
3743 parse_warn (cfile,
"right parenthesis expected.");
3753 log_fatal (
"can't allocate expression");
3756 token =
next_token (&val, (
unsigned *)0, cfile);
3764 token =
next_token (&val, (
unsigned *)0, cfile);
3772 token =
next_token (&val, (
unsigned *)0, cfile);
3780 log_fatal (
"can't allocate expression");
3783 token =
next_token(&val, (
unsigned *)0, cfile);
3790 token =
next_token(&val, (
unsigned *)0, cfile);
3798 log_fatal (
"can't allocate expression");
3801 token =
next_token (&val, (
unsigned *)0, cfile);
3809 token =
next_token(&val, (
unsigned *)0, cfile);
3817 log_fatal (
"can't allocate expression");
3820 token =
next_token (&val, (
unsigned *)0, cfile);
3828 token =
next_token (&val, (
unsigned *)0, cfile);
3837 token =
next_token (&val, (
unsigned *)0, cfile);
3839 if (token ==
COMMA) {
3842 log_fatal (
"can't allocate at CONCAT2");
3849 goto concat_another;
3859 log_fatal (
"can't allocate expression");
3862 token =
next_token (&val, (
unsigned *)0, cfile);
3870 token =
next_token (&val, (
unsigned *)0, cfile);
3878 token =
next_token (&val, (
unsigned *)0, cfile);
3886 token =
next_token (&val, (
unsigned *)0, cfile);
3894 token =
next_token (&val, (
unsigned *)0, cfile);
3902 log_fatal (
"can't allocate expression");
3905 token =
next_token (&val, (
unsigned *)0, cfile);
3913 token =
next_token (&val, (
unsigned *)0, cfile);
3921 token =
next_token (&val, (
unsigned *)0, cfile);
3931 log_fatal (
"can't allocate expression");
3933 token =
next_token (&val, (
unsigned *)0, cfile);
3946 token =
next_token (&val, (
unsigned *)0, cfile);
3947 if (token ==
COMMA) {
3957 }
while (token ==
COMMA);
3967 log_fatal (
"can't allocate expression");
3975 &(*expr)->data.option);
3976 if (status != ISC_R_SUCCESS ||
3977 (*expr)->data.option == NULL) {
3987 log_fatal (
"can't allocate expression");
3994 log_fatal (
"can't allocate expression");
4001 log_fatal (
"can't allocate expression");
4008 log_fatal (
"can't allocate expression");
4015 log_fatal (
"can't allocate expression");
4022 log_fatal (
"can't allocate expression");
4029 log_fatal (
"can't allocate expression");
4036 log_fatal (
"can't allocate expression");
4043 log_fatal (
"can't allocate expression");
4046 token =
next_token (&val, (
unsigned *)0, cfile);
4054 token =
next_token (&val, (
unsigned *)0, cfile);
4062 token =
next_token (&val, (
unsigned *)0, cfile);
4071 log_fatal (
"can't make constant string expression.");
4076 token =
next_token (&val, (
unsigned *)0, cfile);
4078 parse_warn (cfile,
"left parenthesis expected.");
4084 log_fatal (
"can't allocate expression");
4090 "expecting data expression.");
4098 token =
next_token (&val, (
unsigned *)0, cfile);
4099 if (token !=
COMMA) {
4106 token =
next_token (&val, (
unsigned *)0, cfile);
4113 switch (atoi (val)) {
4128 "unsupported integer size %d", atoi (val));
4135 token =
next_token (&val, (
unsigned *)0, cfile);
4137 parse_warn (cfile,
"right parenthesis expected.");
4146 token =
next_token (&val, (
unsigned *)0, cfile);
4148 parse_warn (cfile,
"left parenthesis expected.");
4154 log_fatal (
"can't allocate expression");
4158 parse_warn (cfile,
"expecting numeric expression.");
4165 token =
next_token (&val, (
unsigned *)0, cfile);
4166 if (token !=
COMMA) {
4173 token =
next_token (&val, (
unsigned *)0, cfile);
4180 switch (atoi (val)) {
4195 "unsupported integer size %d", atoi (val));
4202 token =
next_token (&val, (
unsigned *)0, cfile);
4204 parse_warn (cfile,
"right parenthesis expected.");
4218 log_fatal (
"can't allocate expression");
4226 log_fatal (
"can't allocate expression");
4241 log_fatal (
"can't allocate expression");
4247 known = ISC_R_SUCCESS;
4255 known = ISC_R_NOTIMPLEMENTED;
4316 token =
next_token (&val, (
unsigned *)0, cfile);
4320 token =
next_token (&val, (
unsigned *)0, cfile);
4322 parse_warn (cfile,
"%s can't be a variable name", val);
4329 log_fatal (
"can't allocate expression");
4332 if (!(*expr)->data.variable)
4333 log_fatal (
"can't allocate variable name");
4335 token =
next_token (&val, (
unsigned *)0, cfile);
4365 parse_warn(cfile,
"Expecting quoted literal: "
4366 "\"foo.example.com\"");
4372 log_fatal(
"Error creating gethostbyname() internal "
4373 "record. (%s:%d)",
MDL);
4383 log_fatal (
"can't allocate expression");
4418 log_fatal (
"can't allocate variable name");
4422 token =
peek_token (&val, (
unsigned *)0, cfile);
4425 log_fatal (
"can't allocate expression");
4433 log_fatal (
"can't allocate expression");
4441 log_fatal (
"can't allocate expression");
4449 "expecting expression.");
4457 token =
next_token (&val, (
unsigned *)0, cfile);
4458 }
while (token ==
COMMA);
4460 parse_warn (cfile,
"Right parenthesis expected.");
4475 struct
parse *cfile;
4504 "expecting right-hand side.");
4517 token =
peek_token (&val, (
unsigned *)0, cfile);
4521 token =
peek_token (&val, (
unsigned *)0, cfile);
4522 if (token !=
EQUAL) {
4523 parse_warn (cfile,
"! in boolean context without =");
4546 else if (token ==
EQUAL)
4549 parse_warn(cfile,
"expecting ~= or ~~ operator");
4559 parse_warn(cfile,
"No support for regex operator.");
4657 "expecting a subexpression");
4670 (rhs_context != lhs_context)) {
4671 parse_warn (cfile,
"illegal expression relating different types");
4686 parse_warn (cfile,
"expecting data/numeric expression");
4697 parse_warn(cfile,
"expecting data expression");
4715 parse_warn (cfile,
"expecting boolean expressions");
4733 parse_warn (cfile,
"expecting numeric expressions");
4751 log_fatal (
"Can't allocate expression!");
4753 (*expr) ->
op = binop;
4768 log_fatal (
"No memory for equal precedence combination.");
4786 struct
parse *cfile;
4791 const char *fmt = NULL;
4807 if ((fmt != NULL) && (fmt != option->
format) && (*fmt ==
'a'))
4809 else if ((fmt == NULL) || (*fmt ==
'A'))
4813 if ((fmt[0] !=
'Z') && (tolower((
unsigned char)fmt[1]) ==
'a'))
4817 if ((*fmt ==
'A') || (*fmt ==
'a'))
4825 if (fmt[1] ==
'o') {
4836 if (token ==
SEMI) {
4846 uniform, lookups)) {
4847 if (fmt [1] !=
'o') {
4860 }
while (*fmt !=
'\0');
4862 if ((*fmt ==
'A') || (*fmt ==
'a')) {
4863 token =
peek_token (&val, (
unsigned *)0, cfile);
4865 if (token ==
COMMA) {
4871 if ((*fmt ==
'A') || (fmt[1] ==
'\0'))
4879 }
while ((*fmt ==
'A') || (*fmt ==
'a'));
4893 struct
parse *cfile;
4896 enum statement_op
op;
4903 token =
peek_token (&val, (
unsigned *)0, cfile);
4904 if ((token ==
SEMI) && (option->
format[0] !=
'Z')) {
4913 }
else if (token ==
EQUAL) {
4924 "expecting a data expression.");
4937 log_fatal (
"no memory for option statement.");
4941 NULL, expr, option,
MDL))
4942 log_fatal (
"no memory for option cache");
4952 struct
parse *cfile;
4961 unsigned char buf [4];
4965 isc_boolean_t freeval = ISC_FALSE;
4973 if ((*fmt) [1] !=
'o') {
4986 g = strchr (*fmt,
'.');
4989 "malformed encapsulation format (bug!)");
4997 token =
peek_token (&val, (
unsigned *)0, cfile);
5001 if (!
parse_cshl (&t -> data.const_data, cfile)) {
5011 (
const unsigned char *)val,
5013 log_fatal (
"No memory for \"%s\"", val);
5015 if ((*fmt) [1] !=
'o') {
5017 "or hexadecimal data.");
5026 if ((*fmt)[1] ==
'c') {
5036 if ((*fmt)[1] !=
'o')
5046 parse_warn (cfile,
"not a valid domain name.");
5057 if ((*fmt) [1] !=
'o') {
5067 log_fatal (
"No memory for concatenation");
5068 if (freeval == ISC_TRUE) {
5070 freeval = ISC_FALSE;
5077 g = strchr (*fmt,
'.');
5080 "enumeration format");
5086 token =
next_token (&val, (
unsigned *)0, cfile);
5089 "identifier expected");
5133 token =
next_token (&val, (
unsigned *)0, cfile);
5143 token =
next_token (&val, (
unsigned *)0, cfile);
5147 if ((*fmt) [1] !=
'o') {
5161 token =
next_token (&val, (
unsigned *)0, cfile);
5171 token =
next_token (&val, (
unsigned *)0, cfile);
5180 token =
next_token (&val, (
unsigned *)0, cfile);
5182 if ((*fmt) [1] !=
'o')
5185 if ((*fmt) [1] !=
'o') {
5191 if (!strcasecmp (val,
"true")
5192 || !strcasecmp (val,
"on"))
5194 else if (!strcasecmp (val,
"false")
5195 || !strcasecmp (val,
"off"))
5197 else if (!strcasecmp (val,
"ignore"))
5200 if ((*fmt) [1] !=
'o')
5209 token =
peek_token (&val, (
unsigned *)0, cfile);
5210 if (token !=
SEMI) {
5225 parse_warn (cfile,
"Bad format '%c' in parse_option_token.",
5241 struct
parse *cfile;
5246 u_int8_t hunkbuf [1024];
5247 unsigned hunkix = 0;
5248 const char *fmt, *f;
5250 struct iaddr ip_addr;
5252 const u_int8_t *cdp;
5260 isc_result_t status;
5263 if (status != ISC_R_SUCCESS || option == NULL)
5270 for (; *fmt; fmt++) {
5286 if (*fmt ==
'o' && fmt != option -> format)
5290 fmt = strchr (fmt,
'.');
5293 "malformed %s (bug!)",
5294 "encapsulation format");
5300 len =
parse_X (cfile, &hunkbuf [hunkix],
5301 sizeof hunkbuf - hunkix);
5308 if (token ==
SEMI && fmt[1] ==
'o') {
5316 "expecting string.");
5319 if (hunkix + len + 1 >
sizeof hunkbuf) {
5321 "option data buffer %s",
5325 memcpy (&hunkbuf [hunkix], val, len + 1);
5331 if (fmt[1] ==
'c') {
5339 if (express == NULL)
5351 if ((hunkix + len) >
sizeof(hunkbuf)) {
5356 memcpy(&hunkbuf[hunkix], cdp, len);
5364 fmt = strchr (fmt,
'.');
5367 "malformed %s (bug!)",
5368 "enumeration format");
5372 (
unsigned *)0, cfile);
5375 "identifier expected");
5409 if (hunkix + len >
sizeof hunkbuf) {
5411 "option data buffer %s",
5415 memcpy (&hunkbuf [hunkix], dp, len);
5422 (
unsigned *)0, cfile);
5427 "expecting number.");
5441 (
unsigned *)0, cfile);
5453 (
unsigned *)0, cfile);
5464 (
unsigned *)0, cfile);
5467 "expecting identifier.");
5474 if (!strcasecmp (val,
"true")
5475 || !strcasecmp (val,
"on"))
5477 else if (!strcasecmp (val,
"false")
5478 || !strcasecmp (val,
"off"))
5482 "expecting boolean.");
5490 token =
peek_token(&val, (
unsigned *)0, cfile);
5491 if (token !=
SEMI) {
5493 "semicolon expected.");
5501 log_error (
"parse_option_param: Bad format %c",
5506 token =
next_token (&val, (
unsigned *)0, cfile);
5507 }
while (*fmt && token ==
COMMA);
5509 if (token !=
SEMI) {
5516 log_fatal (
"no memory to store option declaration.");
5517 memcpy (bp ->
data, hunkbuf, hunkix + nul_term);
5520 log_fatal (
"out of memory allocating option cache.");
5522 (*oc) ->
data.buffer = bp;
5523 (*oc) ->
data.data = &bp ->
data [0];
5524 (*oc) ->
data.terminated = nul_term;
5525 (*oc) ->
data.len = hunkix;
5531 if (express != NULL)
5543 struct
parse *cfile;
5551 token =
peek_token (&val, (
unsigned *)0, cfile);
5555 token =
next_token (&val, (
unsigned *)0, cfile);
5558 "expecting hexadecimal constant.");
5565 "hexadecimal constant too long.");
5569 token =
peek_token (&val, (
unsigned *)0, cfile);
5572 (
unsigned *)0, cfile);
5573 }
while (token ==
COLON);
5575 }
else if (token ==
STRING) {
5577 if (len + 1 > max) {
5578 parse_warn (cfile,
"string constant too long.");
5582 memcpy (buf, val, len + 1);
5584 parse_warn (cfile,
"expecting string or hexadecimal data");
5603 snprintf (fbuf,
sizeof fbuf,
"%s line %d: %s",
5606 va_start (list, fmt);
5607 vsnprintf (mbuf,
sizeof mbuf, fbuf, list);
5613 if (lix < (
sizeof lexbuf) - 1)
5614 lexbuf [lix++] =
' ';
5616 for (; lix < (
sizeof lexbuf) - 1 && (lix & 7); lix++)
5623 syslog (LOG_ERR,
"%s", mbuf);
5626 syslog (LOG_ERR,
"%s^", lexbuf);
5640 cfile -> warnings_occurred = 1;
5651 unsigned len, clen = 0;
5654 const unsigned char *dnptrs[256], **lastdnptr;
5656 memset(compbuf, 0,
sizeof(compbuf));
5657 memset(dnptrs, 0,
sizeof(dnptrs));
5658 dnptrs[0] = compbuf;
5659 lastdnptr = &dnptrs[255];
5670 parse_warn(cfile,
"Expecting a domain string.");
5679 sizeof(compbuf) - clen,
5683 parse_warn(cfile,
"Error compressing domain "
5691 sizeof(compbuf) - clen);
5707 while (compbuf[clen] != 0)
5708 clen += compbuf[clen] + 1;
5714 if (clen >
sizeof(compbuf))
5718 }
while (token ==
COMMA);
5721 log_fatal(
"No memory for domain list object.");
struct option_cache * lookup_hashed_option(struct universe *universe, struct option_state *options, unsigned code)
void parse_option_space_decl(struct parse *cfile)
int parse_X(struct parse *cfile, u_int8_t *buf, unsigned max)
int executable_statement_allocate(struct executable_statement **ptr, const char *file, int line)
isc_result_t parse_option_name(struct parse *cfile, int allocate, int *known, struct option **opt)
void add_enumeration(struct enumeration *enumeration)
int parse_option_code_definition(struct parse *cfile, struct option *option)
void(* save_func)(struct universe *, struct option_state *, struct option_cache *, isc_boolean_t)
struct universe * universe
int executable_statement_dereference(struct executable_statement **ptr, const char *file, int line)
u_int32_t(* get_length)(const unsigned char *)
int parse_ip_addr_with_subnet(struct parse *cfile, struct iaddrmatch *match)
const char * piaddr(const struct iaddr addr)
struct universe * new_universe(char *file, int line) const
struct expression::expr_union::@25 arg
struct expression * equal[2]
int hashed_option_space_encapsulate(struct data_string *result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *universe)
int parse_key(struct parse *cfile)
void * dmalloc(unsigned, const char *, int)
struct expression::expr_union::@21 pick_first_value
int expression_allocate(struct expression **cptr, const char *file, int line)
int parse_data_expression(struct expression **expr, struct parse *cfile, int *lose)
struct enumeration * find_enumeration(const char *name, int length)
#define DHCP_R_INVALIDARG
struct expression * arglist
struct expression::expr_union::@16 substring
isc_result_t omapi_auth_key_lookup_name(omapi_auth_key_t **, const char *)
int is_numeric_expression(struct expression *expr)
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
struct enumeration_value * find_enumeration_value(const char *name, int length, unsigned *widthp, const char *value)
void data_string_forget(struct data_string *data, const char *file, int line)
void(* delete_func)(struct universe *universe, struct option_state *, int)
int parse_numeric_expression(struct expression **expr, struct parse *cfile, int *lose)
struct expression * concat[2]
#define WORD_NAME_HASH_SIZE
int fundef_allocate(struct fundef **cptr, const char *file, int line)
int parse_allow_deny(struct option_cache **oc, struct parse *cfile, int flag)
int log_error(const char *,...) __attribute__((__format__(__printf__
void putLong(unsigned char *, int32_t)
struct collection * collections
struct expression * offset
enum expression_context op_context(enum expr_op op)
struct option_cache *(* lookup_func)(struct universe *, struct option_state *, unsigned)
int parse_semi(struct parse *cfile)
struct option_cache * secondary6
struct executable_statement * next
isc_result_t enter_dns_zone(struct dns_zone *zone)
enum dhcp_token peek_token(const char **rval, unsigned *rlen, struct parse *cfile)
struct expression * expression
int(* decode)(struct option_state *, const unsigned char *, unsigned, struct universe *)
#define LOCAL_TIME_FORMAT
enum dhcp_token peek_raw_token(const char **rval, unsigned *rlen, struct parse *cfile)
int parse_zone(struct dns_zone *zone, struct parse *cfile)
int parse_option_token(struct expression **rv, struct parse *cfile, const char **fmt, struct expression *expr, int uniform, int lookups)
int parse_string(struct parse *cfile, char **sptr, unsigned *lptr)
struct expression::expr_union::@17 suffix
int is_boolean_expression(struct expression *expr)
void expression_dereference(struct expression **eptr, const char *file, int line)
void log_fatal(const char *,...) __attribute__((__format__(__printf__
int parse_option_buffer(struct option_state *options, const unsigned char *buffer, unsigned length, struct universe *universe)
#define DEFAULT_SPACE_HASH_SIZE
int parse_cshl(struct data_string *data, struct parse *cfile)
int option_cache_allocate(struct option_cache **cptr, const char *file, int line)
int MRns_name_compress(const char *src, u_char *dst, size_t dstsiz, const u_char **dnptrs, const u_char **lastdnptr)
union expression::expr_union data
universe_hash_t * universe_hash
struct expression * encode_int
enum dhcp_token next_token(const char **rval, unsigned *rlen, struct parse *cfile)
int make_host_lookup(struct expression **expr, const char *name)
struct universe * config_universe
void delete_hashed_option(struct universe *universe, struct option_state *options, int code)
struct expression::expr_union::@20 reverse
struct expression * width
void(* store_length)(unsigned char *, u_int32_t)
int buffer_allocate(struct buffer **ptr, unsigned len, const char *file, int line)
int parse_if_statement(struct executable_statement **result, struct parse *cfile, int *lose)
char * default_option_format
struct enumeration_value * values
void putULong(unsigned char *, u_int32_t)
omapi_data_string_t * key
void convert_num(struct parse *cfile, unsigned char *buf, const char *str, int base, unsigned size)
#define skip_token(a, b, c)
void save_hashed_option(struct universe *universe, struct option_state *options, struct option_cache *oc, isc_boolean_t appendp)
int parse_boolean_expression(struct expression **expr, struct parse *cfile, int *lose)
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)
int make_concat(struct expression **expr, struct expression *left, struct expression *right)
TIME parse_date(struct parse *cfile)
u_int32_t getUShort(const unsigned char *)
int hashed_option_state_dereference(struct universe *universe, struct option_state *state, const char *file, int line)
struct enumeration * enumerations
struct option * new_option(char *name, const char *file, int line) const
void dfree(void *, const char *, int)
struct expression * buffer
void putShort(unsigned char *, int32_t)
#define DEFAULT_TIME_FORMAT
int parse_non_binary(struct expression **expr, struct parse *cfile, int *lose, enum expression_context context)
int parse_ip6_addr(struct parse *cfile, struct iaddr *addr)
#define BYTE_NAME_HASH_SIZE
struct enumeration * next
int parse_ip_addr_or_hostname(struct expression **expr, struct parse *cfile, int uniform)
int parse_option_decl(struct option_cache **oc, struct parse *cfile)
int int log_info(const char *,...) __attribute__((__format__(__printf__
void skip_to_semi(struct parse *cfile)
struct expression::expr_union::@19 b2a
struct expression * extract_int
void skip_to_rbrace(struct parse *cfile, int brace_count)
int parse_on_statement(struct executable_statement **result, struct parse *cfile, int *lose)
u_int32_t getULong(const unsigned char *)
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)
void putUChar(unsigned char *, u_int32_t)
int parse_option_data(struct expression **expr, struct parse *cfile, int lookups, struct option *option)
int parse_switch_statement(struct executable_statement **result, struct parse *cfile, int *lose)
isc_result_t omapi_auth_key_enter(omapi_auth_key_t *)
struct universe ** universes
isc_result_t save_parse_state(struct parse *cfile)
struct data_string const_data
u_int32_t getUChar(const unsigned char *)
int parse_ip6_addr_expr(struct expression **expr, struct parse *cfile)
int option_state_dereference(struct option_state **ptr, const char *file, int line)
isc_result_t restore_parse_state(struct parse *cfile)
int parse_expression(struct expression **expr, struct parse *cfile, int *lose, enum expression_context context, struct expression **plhs, enum expr_op binop)
int parse_destination_descriptor(struct parse *cfile, struct iaddr *addr)
isc_boolean_t is_cidr_mask_valid(const struct iaddr *addr, int bits)
int make_const_data(struct expression **expr, const unsigned char *data, unsigned len, int terminated, int allocate, const char *file, int line)
struct string_list * next
struct expression * parse_domain_list(struct parse *cfile, int compress)
int is_data_expression(struct expression *expr)
int MRns_name_pton(const char *src, u_char *dst, size_t dstsiz)
TIME parse_date_core(struct parse *cfile)
int parse_base64(struct data_string *data, struct parse *cfile)
isc_result_t find_class(struct class **c, const char *s, const char *file, int line)
int make_limit(struct expression **new, struct expression *expr, int limit)
int parse_ip6_prefix(struct parse *cfile, struct iaddr *addr, u_int8_t *plen)
struct option_cache * primary6
int int int void do_percentm(char *obuf, const char *ibuf)
isc_result_t omapi_data_string_new(omapi_data_string_t **, unsigned, const char *, int)
void parse_lease_time(struct parse *cfile, TIME *timep)
int parse_boolean(struct parse *cfile)
struct collection * check
int expression_reference(struct expression **ptr, struct expression *src, const char *file, int line)
int(* encapsulate)(struct data_string *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *)
u_int32_t(* get_tag)(const unsigned char *)
struct executable_statement * statements
u_int8_t hbuf[HARDWARE_ADDR_LEN+1]
int op_precedence(enum expr_op op1, enum expr_op op2)
void hashed_option_space_foreach(struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *u, void *stuff, void(*func)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *))
option_code_hash_t * code_hash
int dns_zone_allocate(struct dns_zone **ptr, const char *file, int line)
pair cons(caddr_t car, pair cdr)
void putUShort(unsigned char *, u_int32_t)
int parse_executable_statements(struct executable_statement **statements, struct parse *cfile, int *lose, enum expression_context case_context)
int parse_ip_addr(struct parse *cfile, struct iaddr *addr)
const unsigned char * data
int parse_case_statement(struct executable_statement **result, struct parse *cfile, int *lose, enum expression_context case_context)
int parse_executable_statement(struct executable_statement **result, struct parse *cfile, int *lose, enum expression_context case_context)
struct expression::expr_union::@26 funcall
void(* store_tag)(unsigned char *, u_int32_t)
void parse_hardware_param(struct parse *cfile, struct hardware *hardware)
#define QUAD_NAME_HASH_SIZE
int parse_warn(struct parse *cfile, const char *fmt,...)
struct expression::expr_union::@18 packet
int option_dereference(struct option **dest, const char *file, int line)
enum dhcp_token next_raw_token(const char **rval, unsigned *rlen, struct parse *cfile)
struct expression * separator
int dns_zone_dereference(struct dns_zone **ptr, const char *file, int line)