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);
105 token =
peek_token (&val, (
unsigned *)0, cfile);
113 }
else if (token ==
LBRACE) {
115 }
else if (token ==
SEMI && !brace_count) {
118 }
else if (token ==
EOL) {
125 token =
next_token (&val, (
unsigned *)0, cfile);
135 token =
next_token (&val, (
unsigned *)0, cfile);
164 log_fatal (
"no memory for string %s.", val);
165 memcpy (s, val, len + 1);
200 token =
peek_token (&val, (
unsigned *)0, cfile);
206 if (!(s = (
char *)
dmalloc (strlen (val) + 1,
MDL)))
207 log_fatal (
"can't allocate temp space for hostname.");
209 c =
cons ((caddr_t)s, c);
210 len += strlen (s) + 1;
213 token =
peek_token (&val, (
unsigned *)0, cfile);
215 token =
next_token (&val, (
unsigned *)0, cfile);
219 }
while (token ==
DOT);
227 log_fatal (
"can't allocate space for hostname.");
234 unsigned l = strlen ((
char *)(c -> car));
236 memcpy (t, (
char *)(c -> car), l);
265 unsigned char addr [4];
266 unsigned len =
sizeof addr;
271 token =
peek_token (&val, (
unsigned *)0, cfile);
311 token =
next_token (&val, (
unsigned *)0, cfile);
312 parse_warn (cfile,
"%s (%d): expecting IP address or hostname",
332 &addr -> len,
DOT, 10, 8))
348 unsigned int mask_width, dest_dest_len;
351 &addr -> len,
DOT, 10, 8)) {
352 mask_width = (
unsigned int)addr->
iabuf[0];
353 dest_dest_len = (((mask_width+7)/8)+1);
354 if (mask_width > 32) {
356 "subnet mask width (%u) greater than 32.", mask_width);
358 else if (dest_dest_len != addr->
len) {
360 "destination descriptor with subnet mask width %u "
361 "should have %u octets, but has %u octets.",
362 mask_width, dest_dest_len, addr->
len);
374 is_hex_string(
const char *s) {
376 if (!isxdigit((
int)*s)) {
400 char v6[
sizeof(
"ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
415 is_hex_string(val)) ||
421 val_len = strlen(val);
422 if ((v6_len + val_len) >=
sizeof(v6)) {
427 memcpy(v6+v6_len, val, val_len);
440 if (inet_pton(AF_INET6, v6, addr->
iabuf) <= 0) {
455 struct parse *cfile) {
477 if (token !=
SLASH) {
491 if ((n < 0) || (n > 128)) {
492 parse_warn(cfile,
"Invalid IPv6 prefix length.");
515 const char *val, *orig;
519 unsigned char newval, warnmask=0;
523 prefixlen = match->
addr.
len * 8;
527 if (token ==
SLASH) {
532 parse_warn(cfile,
"Invalid CIDR prefix length:"
533 " expecting a number.");
537 prefixlen = atoi(val);
540 prefixlen > (match->
addr.
len * 8)) {
554 fflen = prefixlen / 8;
560 if (fflen < match->mask.len) {
562 "\x00\x80\xc0\xe0\xf0\xf8\xfc\xfe"[prefixlen % 8];
573 if (newval != match->
addr.
iabuf[fflen]) {
577 }
while (++fflen < match->mask.len);
580 log_error(
"Warning: Extraneous bits removed "
581 "in address component of %s/%d.",
592 "expecting ip-address or ip-address/prefixlen");
628 if (!strncmp(val,
"unknown-", 8)) {
629 hardware->
hbuf[0] = atoi(&val[8]);
632 "expecting a network hardware type");
657 if (hlen + 1 >
sizeof(hardware->
hbuf)) {
659 parse_warn(cfile,
"hardware address too long");
661 hardware->
hlen = hlen + 1;
662 memcpy((
unsigned char *)&hardware->
hbuf[1], t, hlen);
663 if (hlen + 1 <
sizeof(hardware->
hbuf))
664 memset(&hardware->
hbuf[hlen + 1], 0,
665 (
sizeof(hardware->
hbuf)) - hlen - 1);
687 token =
next_token (&val, (
unsigned *)0, cfile);
689 parse_warn (cfile,
"Expecting numeric lease time");
693 convert_num(cfile, (
unsigned char *)&num, val, 10, 32);
724 max, separator, base, size)
734 unsigned char *bufp = buf, *s, *t;
739 bufp = (
unsigned char *)
dmalloc (*max * size / 8,
MDL);
741 log_fatal (
"no space for numeric aggregate");
747 token =
peek_token (&val, (
unsigned *)0, cfile);
748 if (token != separator) {
761 if ((bufp != NULL) && (bufp != buf))
763 return (
unsigned char *)0;
767 token =
next_token (&val, (
unsigned *)0, cfile);
777 parse_warn (cfile,
"expecting numeric value.");
780 if ((bufp != NULL) && (bufp != buf))
797 t = (
unsigned char *)
dmalloc (strlen (val) + 1,
MDL);
800 strcpy ((
char *)t, val);
801 c =
cons ((caddr_t)t, c);
803 }
while (++count != *max);
811 bufp = (
unsigned char *)
dmalloc (count * size / 8,
MDL);
813 log_fatal (
"no space for numeric aggregate.");
814 s = bufp + count - size / 8;
819 convert_num (cfile, s, (
char *)(c -> car), base, size);
836 const unsigned char *ptr = (
const unsigned char *)str;
849 if (ptr [0] ==
'0') {
850 if (ptr [1] ==
'x') {
853 }
else if (isascii (ptr [1]) && isdigit (ptr [1])) {
868 tval = tval -
'a' + 10;
869 else if (tval >=
'A')
870 tval = tval -
'A' + 10;
871 else if (tval >=
'0')
879 "Bogus number %s: digit %d not in base %d",
883 val = val * base + tval;
887 max = (1 << (size - 1));
889 max = (1 << (size - 1)) + ((1 << (size - 1)) - 1);
894 "%s%lo exceeds max (%d) for precision.",
896 (
unsigned long)val, max);
900 "%s%lx exceeds max (%d) for precision.",
902 (
unsigned long)val, max);
906 "%s%lu exceeds max (%d) for precision.",
908 (
unsigned long)val, max);
916 *buf = -(
unsigned long)val;
926 "Unexpected integer size: %d\n", size);
932 *buf = (u_int8_t)val;
942 "Unexpected integer size: %d\n", size);
971 long int tzoff, year, mon, mday, hour, min, sec;
974 static int months[11] = { 31, 59, 90, 120, 151, 181,
975 212, 243, 273, 304, 334 };
979 if (token ==
NEVER) {
985 if (token ==
EPOCH) {
992 parse_warn(cfile,
"Seconds since epoch expected.");
1005 parse_warn(cfile,
"numeric day of week expected.");
1031 if (token !=
SLASH) {
1035 "expected slash separating year from month.");
1045 parse_warn(cfile,
"numeric month expected.");
1049 mon = atoi(val) - 1;
1053 if (token !=
SLASH) {
1057 "expected slash separating month from day.");
1067 parse_warn(cfile,
"numeric day of month expected.");
1086 if (token !=
COLON) {
1090 "expected colon separating hour from minute.");
1100 parse_warn(cfile,
"numeric minute expected.");
1108 if (token !=
COLON) {
1112 "expected colon separating minute from second.");
1122 parse_warn(cfile,
"numeric second expected.");
1133 }
else if (token !=
SEMI) {
1136 "Time zone offset or semicolon expected.");
1141 guess = ((((((365 * (year - 70) +
1147 !((year - 72) & 3)) +
1150 min) * 60) + sec + tzoff;
1161 return((
TIME)guess);
1171 struct
parse *cfile;
1191 struct
parse *cfile;
1206 token =
next_token (&val, (
unsigned *)0, cfile);
1209 "expecting identifier after option keyword.");
1216 log_fatal (
"no memory for uname information.");
1217 strcpy (uname, val);
1218 token =
peek_token (&val, (
unsigned *)0, cfile);
1224 token =
next_token (&val, (
unsigned *)0, cfile);
1226 parse_warn (cfile,
"expecting identifier after '.'");
1234 universe = (
struct universe *)0;
1237 parse_warn (cfile,
"no option space named %s.", uname);
1239 return ISC_R_NOTFOUND;
1249 option_name_hash_lookup(opt, universe->
name_hash, val, 0,
MDL);
1262 }
else if (strncasecmp(val,
"unknown-", 8) == 0) {
1268 if (code == 0 || code == universe->
end) {
1269 parse_warn(cfile,
"Option codes 0 and %u are illegal "
1270 "in the %s space.", universe->
end,
1274 return ISC_R_FAILURE;
1284 option_code_hash_lookup(opt, universe->
code_hash,
1294 if (option == NULL) {
1297 option->
code = code;
1301 log_info(
"option %s has been redefined as option %s. "
1302 "Please update your configs if neccessary.",
1309 }
else if (allocate) {
1311 option -> universe = universe;
1314 parse_warn(cfile,
"no option named %s in space %s",
1315 val, universe->
name);
1318 return ISC_R_NOTFOUND;
1323 return ISC_R_SUCCESS;
1332 struct
parse *cfile;
1338 int tsize=1, lsize=1, hsize = 0;
1343 token =
next_token (&val, (
unsigned *)0, cfile);
1351 log_fatal (
"No memory for new option space.");
1356 log_fatal (
"No memory for new option space name.");
1357 strcpy (nu_name, val);
1358 nu ->
name = nu_name;
1368 if (token !=
WIDTH) {
1375 parse_warn(cfile,
"expecting number 1, 2, 4.");
1396 parse_warn(cfile,
"invalid code width (%d), "
1397 "expecting a 1, 2 or 4.",
1405 if (token !=
WIDTH) {
1412 parse_warn(cfile,
"expecting number 1 or 2.");
1417 if (lsize != 1 && lsize != 2) {
1418 parse_warn(cfile,
"invalid length width (%d) "
1419 "expecting 1 or 2.", lsize);
1427 if (token !=
SIZE) {
1434 parse_warn(cfile,
"expecting a 10base number");
1442 if (hsize < 0 || hsize > 0x7FFFFFFF) {
1453 }
while (token !=
SEMI);
1503 log_fatal (
"No memory to expand option space array.");
1510 if (!option_name_new_hash(&nu->
name_hash, hsize,
MDL) ||
1512 log_fatal(
"Can't allocate %s option hash table.", nu->
name);
1555 struct
parse *cfile;
1560 struct option *oldopt;
1561 unsigned arrayp = 0;
1563 int no_more_in_record = 0;
1569 int has_encapsulation = 0;
1573 token =
next_token (&val, (
unsigned *)0, cfile);
1575 parse_warn (cfile,
"expecting option code number.");
1579 option -> code = atoi (val);
1581 token =
next_token (&val, (
unsigned *)0, cfile);
1582 if (token !=
EQUAL) {
1589 token =
next_token (&val, (
unsigned *)0, cfile);
1590 if (token ==
ARRAY) {
1591 token =
next_token (&val, (
unsigned *)0, cfile);
1598 token =
next_token (&val, (
unsigned *)0, cfile);
1603 token =
next_token (&val, (
unsigned *)0, cfile);
1608 if (has_encapsulation) {
1610 "encapsulate must always be the last item.");
1624 token =
next_token (&val, (
unsigned *)0, cfile);
1630 arrayp = recordp + 1;
1631 token =
next_token (&val, (
unsigned *)0, cfile);
1632 if ((recordp) && (token ==
LBRACE)) {
1634 "only uniform array inside record.");
1646 token =
next_token (&val, (
unsigned *)0, cfile);
1654 switch (atoi (val)) {
1656 type = is_signed ?
'b' :
'B';
1659 type = is_signed ?
's' :
'S';
1662 type = is_signed ?
'l' :
'L';
1666 "%s bit precision is not supported.", val);
1676 token =
next_token (&val, (
unsigned *)0, cfile);
1678 parse_warn (cfile,
"expecting \"integer\" keyword.");
1706 tokbuf[tokix++] =
'D';
1715 parse_warn (cfile,
"arrays of text strings not %s",
1722 no_more_in_record = 1;
1729 token =
next_token (&val, (
unsigned *)0, cfile);
1732 "expecting option space identifier");
1736 encapsulated = NULL;
1738 val, strlen(val),
MDL)) {
1739 parse_warn(cfile,
"unknown option space %s", val);
1743 if (strlen (val) + tokix + 2 >
sizeof (tokbuf))
1745 tokbuf [tokix++] =
'E';
1746 strcpy (&tokbuf [tokix], val);
1747 tokix += strlen (val);
1749 has_encapsulation = 1;
1755 parse_warn (cfile,
"array incompatible with zerolen.");
1761 no_more_in_record = 1;
1765 parse_warn (cfile,
"unknown data type %s", val);
1772 if (tokix ==
sizeof tokbuf) {
1774 parse_warn (cfile,
"too many types in record.");
1780 tokbuf [tokix++] = type;
1783 token =
next_token (&val, (
unsigned *)0, cfile);
1784 if (arrayp > recordp) {
1785 if (tokix ==
sizeof tokbuf) {
1787 "too many types in record.");
1793 tokbuf[tokix++] =
'a';
1795 if (token ==
COMMA) {
1796 if (no_more_in_record) {
1798 "%s must be at end of record.",
1799 type ==
't' ?
"text" :
"string");
1805 token =
next_token (&val, (
unsigned *)0, cfile);
1809 parse_warn (cfile,
"expecting right brace.");
1823 if (has_encapsulation && arrayp) {
1825 "Arrays of encapsulations don't make sense.");
1828 s =
dmalloc(tokix + (arrayp ? 1 : 0) + 1,
MDL);
1830 log_fatal(
"no memory for option format.");
1832 memcpy(s, tokbuf, tokix);
1834 s[tokix++] = (arrayp > recordp) ?
'a' :
'A';
1838 option -> format = s;
1843 if (oldopt != NULL) {
1864 if (has_encapsulation) {
1867 if (!option_code_hash_lookup(&encapsulated->
enc_opt,
1870 log_fatal(
"error finding encapsulated option (%s:%d)",
1883 struct
parse *cfile;
1888 static unsigned char
1889 from64 [] = {64, 64, 64, 64, 64, 64, 64, 64,
1890 64, 64, 64, 62, 64, 64, 64, 63,
1891 52, 53, 54, 55, 56, 57, 58, 59,
1892 60, 61, 64, 64, 64, 64, 64, 64,
1893 64, 0, 1, 2, 3, 4, 5, 6,
1894 7, 8, 9, 10, 11, 12, 13, 14,
1895 15, 16, 17, 18, 19, 20, 21, 22,
1896 23, 24, 25, 64, 64, 64, 64, 64,
1897 64, 26, 27, 28, 29, 30, 31, 32,
1898 33, 34, 35, 36, 37, 38, 39, 40,
1899 41, 42, 43, 44, 45, 46, 47, 48,
1900 49, 50, 51, 64, 64, 64, 64, 64};
1917 log_fatal(
"no memory for base64 buffer.");
1918 memset(t, 0, (
sizeof(*t)) - 1);
1919 memcpy(t->string, val, l + 1);
1928 for (i = 0; val[i]; i++) {
1932 if (((val[i] <
' ') || (val[i] >
'z')) ||
1933 ((from64[val[i] -
' '] > 63) && (val[i] !=
'='))) {
1938 }
while (valid_base64);
1941 data->len = (data->len * 3) / 4;
1943 parse_warn (cfile,
"can't allocate buffer for base64 data.");
1950 for (t = bufs; t; t = t->
next) {
1951 for (i = 0; t->string[i]; i++) {
1952 unsigned foo = t->string[i];
1953 if (terminated && foo !=
'=') {
1955 "stuff after base64 '=' terminator: %s.",
1959 if ((foo <
' ') || (foo >
'z')) {
1962 "invalid base64 character %d.",
1971 foo = from64[foo -
' '];
1974 acc = (acc << 6) + foo;
1979 data->buffer->data[j++] = (acc >> 4);
1984 data->buffer->data[j++] = (acc >> 2);
1988 data->buffer->data[j++] = acc;
1999 "partial base64 value left over: %d.",
2004 data->data = data->buffer->data;
2006 for (t = bufs; t; t = last) {
2024 struct
parse *cfile;
2026 u_int8_t ibuf [128];
2036 token =
next_token (&val, (
unsigned *)0, cfile);
2038 parse_warn (cfile,
"expecting hexadecimal number.");
2040 for (; sl; sl =
next) {
2046 if (ilen ==
sizeof ibuf) {
2051 log_fatal (
"no memory for string list.");
2052 memcpy (next -> data, ibuf, ilen);
2054 last = &next ->
next;
2060 token =
peek_token (&val, (
unsigned *)0, cfile);
2067 log_fatal (
"no memory to store octet data.");
2068 data -> data = &data ->
buffer -> data [0];
2069 data -> len = tlen + ilen;
2070 data -> terminated = 0;
2072 rvp = &data ->
buffer -> data [0];
2075 memcpy (rvp, sl -> data,
sizeof ibuf);
2081 memcpy (rvp, ibuf, ilen);
2101 struct
parse *cfile;
2109 next = &((*next) ->
next);
2117 struct
parse *cfile;
2121 #if defined(ENABLE_EXECUTE)
2134 isc_result_t status;
2137 token =
peek_token (&val, (
unsigned *)0, cfile);
2144 }
else if (token ==
LOCAL) {
2147 parse_warn(cfile,
"Expecting 'local' or 'default'.");
2155 if (token !=
SEMI) {
2170 token =
next_token (&val, (
unsigned *)0, cfile);
2177 cta = (
struct class *)0;
2179 if (status != ISC_R_SUCCESS) {
2181 val, isc_result_totext (status));
2191 log_fatal (
"no memory for new statement.");
2192 (*result) -> op = add_statement;
2193 (*result) -> data.add = cta;
2203 log_fatal (
"no memory for new statement.");
2204 (*result) -> op = break_statement;
2211 if (status != ISC_R_SUCCESS || option == NULL) {
2216 send_option_statement);
2225 if (status != ISC_R_SUCCESS || option == NULL) {
2230 supersede_option_statement);
2248 log_fatal (
"no memory for new statement.");
2249 (*result) -> op = supersede_option_statement;
2250 (*result) ->
data.option = cache;
2255 token =
peek_token (&val, (
unsigned *)0, cfile);
2257 goto switch_default;
2260 if (status != ISC_R_SUCCESS || option == NULL) {
2265 default_option_statement);
2273 if (status != ISC_R_SUCCESS || option == NULL) {
2278 prepend_option_statement);
2286 if (status != ISC_R_SUCCESS || option == NULL) {
2291 append_option_statement);
2307 "case statement in inappropriate scope.");
2313 cfile, lose, case_context);
2318 parse_warn (cfile,
"switch default statement in %s",
2319 "inappropriate scope.");
2325 log_fatal (
"no memory for default statement.");
2326 (*result) -> op = default_statement;
2338 token =
next_token (&val, (
unsigned *)0, cfile);
2341 "%s can't be a variable name", val);
2349 log_fatal (
"no memory for set statement.");
2350 (*result) -> op = flag ? define_statement : set_statement;
2352 if (!(*result)->data.set.name)
2353 log_fatal (
"can't allocate variable name");
2354 strcpy ((*result) ->
data.set.name, val);
2355 token =
next_token (&val, (
unsigned *)0, cfile);
2363 (
unsigned *)0, cfile);
2368 "expecting argument name");
2377 strlen (val),
MDL));
2380 memset (
new, 0,
sizeof *
new);
2381 strcpy (
new ->
string, val);
2389 (
unsigned *)0, cfile);
2390 }
while (token ==
COMMA);
2393 parse_warn (cfile,
"expecting right paren.");
2401 token =
next_token (&val, (
unsigned *)0, cfile);
2409 log_fatal (
"can't allocate expression.");
2417 (&expr ->
data.
func -> statements, cfile, lose,
2423 token =
next_token (&val, (
unsigned *)0, cfile);
2429 if (token !=
EQUAL) {
2431 "expecting '=' in %s statement.",
2432 flag ?
"define" :
"set");
2442 "expecting expression.");
2459 token =
next_token (&val, (
unsigned *)0, cfile);
2462 "%s can't be a variable name", val);
2469 log_fatal (
"no memory for set statement.");
2470 (*result) ->
op = unset_statement;
2472 if (!(*result)->data.unset)
2473 log_fatal (
"can't allocate variable name");
2474 strcpy ((*result) ->
data.unset, val);
2485 log_fatal (
"no memory for eval statement.");
2486 (*result) ->
op = eval_statement;
2493 "expecting data expression.");
2507 #ifdef ENABLE_EXECUTE
2511 log_fatal (
"no memory for execute statement.");
2512 (*result)->op = execute_statement;
2516 parse_warn(cfile,
"left parenthesis expected.");
2524 parse_warn(cfile,
"Expecting a quoted string.");
2530 (*result)->data.execute.command =
dmalloc(len + 1,
MDL);
2531 if ((*result)->data.execute.command == NULL)
2532 log_fatal(
"can't allocate command name");
2533 strcpy((*result)->data.execute.command, val);
2536 (*result)->
data.execute.argc = 0;
2540 log_fatal (
"can't allocate expression");
2546 "expecting expression.");
2554 (*result)->
data.execute.argc++;
2558 parse_warn(cfile,
"right parenthesis expected.");
2569 parse_warn(cfile,
"define ENABLE_EXECUTE in site.h to "
2570 "enable execute(); expressions.");
2581 log_fatal (
"no memory for return statement.");
2582 (*result) ->
op = return_statement;
2589 "expecting data expression.");
2607 log_fatal (
"no memory for log statement.");
2608 (*result) ->
op = log_statement;
2610 token =
next_token (&val, (
unsigned *)0, cfile);
2612 parse_warn (cfile,
"left parenthesis expected.");
2618 token =
peek_token (&val, (
unsigned *)0, cfile);
2620 if (token ==
FATAL) {
2621 (*result) ->
data.log.priority = log_priority_fatal;
2622 }
else if (token ==
ERROR) {
2623 (*result) ->
data.log.priority = log_priority_error;
2625 (*result) ->
data.log.priority = log_priority_debug;
2626 }
else if (token ==
INFO) {
2627 (*result) ->
data.log.priority = log_priority_info;
2629 (*result) ->
data.log.priority = log_priority_debug;
2634 token =
next_token (&val, (
unsigned *)0, cfile);
2635 if (token !=
COMMA) {
2644 (&(*result) ->
data.log.
expr, cfile, lose))) {
2650 token =
next_token (&val, (
unsigned *)0, cfile);
2652 parse_warn (cfile,
"right parenthesis expected.");
2658 token =
next_token (&val, (
unsigned *)0, cfile);
2659 if (token !=
SEMI) {
2676 if (!zone ->
name) {
2684 i = strlen (zone ->
name);
2685 if (zone ->
name [i - 1] !=
'.') {
2688 parse_warn (cfile,
"no trailing '.' on zone");
2691 strcpy (s, zone ->
name);
2700 if (status != ISC_R_SUCCESS) {
2702 zone ->
name, isc_result_totext (status));
2720 option = (
struct option *)0;
2721 option_name_hash_lookup(&option,
2727 (result, cfile, 1, option,
2728 supersede_option_statement);
2738 log_fatal (
"no memory for eval statement.");
2739 (*result) -> op = eval_statement;
2790 token =
next_token (&val, (
unsigned *)0, cfile);
2797 token =
peek_token (&val, (
unsigned *)0, cfile);
2800 if (zone -> primary) {
2802 "more than one primary.");
2807 log_fatal (
"can't allocate primary option cache.");
2808 oc = zone -> primary;
2812 if (zone -> secondary) {
2813 parse_warn (cfile,
"more than one secondary.");
2818 log_fatal (
"can't allocate secondary.");
2819 oc = zone -> secondary;
2826 "expecting IP addr or hostname.");
2848 token =
next_token (&val, (
unsigned *)0, cfile);
2849 }
while (token ==
COMMA);
2850 if (token !=
SEMI) {
2859 parse_warn(cfile,
"more than one primary6.");
2864 log_fatal(
"can't allocate primary6 option cache.");
2870 parse_warn(cfile,
"more than one secondary6.");
2904 }
while (token ==
COMMA);
2905 if (token !=
SEMI) {
2928 log_fatal(
"Multiple key definitions for zone %s.",
2969 isc_result_t status;
2973 if (omapi_auth_key_new (&key,
MDL) != ISC_R_SUCCESS)
2976 token =
peek_token (&val, (
unsigned *)0, cfile);
2982 strcpy (key ->
name, val);
2993 token =
next_token (&val, (
unsigned *)0, cfile);
3000 token =
next_token (&val, (
unsigned *)0, cfile);
3005 "key %s: too many algorithms",
3012 "expecting key algorithm name.");
3021 static char add [] =
".SIG-ALG.REG.INT.";
3050 parse_warn (cfile,
"key %s: too many secrets",
3055 memset (&ds, 0,
sizeof(ds));
3060 if (status != ISC_R_SUCCESS)
3062 memcpy (key -> key -> value,
3076 parse_warn (cfile,
"expecting right brace.");
3081 token =
peek_token (&val, (
unsigned *)0, cfile);
3082 if (token ==
SEMI) {
3088 if (status != ISC_R_SUCCESS) {
3090 key ->
name, isc_result_totext (status));
3093 omapi_auth_key_dereference (&key,
MDL);
3099 omapi_auth_key_dereference (&key,
MDL);
3112 struct
parse *cfile;
3119 log_fatal (
"no memory for new statement.");
3120 (*result) -> op = on_statement;
3123 token =
next_token (&val, (
unsigned *)0, cfile);
3126 (*result) -> data.on.evtypes |=
ON_EXPIRY;
3130 (*result) -> data.on.evtypes |=
ON_COMMIT;
3142 parse_warn (cfile,
"expecting a lease event type");
3148 token =
next_token (&val, (
unsigned *)0, cfile);
3149 }
while (token ==
OR);
3168 (
unsigned *)0, cfile);
3174 token =
next_token (&val, (
unsigned *)0, cfile);
3192 struct
parse *cfile;
3199 log_fatal (
"no memory for new statement.");
3200 (*result) -> op = switch_statement;
3202 token =
next_token (&val, (
unsigned *)0, cfile);
3218 "expecting data or numeric expression.");
3224 token =
next_token (&val, (
unsigned *)0, cfile);
3230 token =
next_token (&val, (
unsigned *)0, cfile);
3236 (&(*result) -> data.s_switch.statements, cfile, lose,
3245 token =
next_token (&val, (
unsigned *)0, cfile);
3260 struct
parse *cfile;
3268 log_fatal (
"no memory for new statement.");
3269 (*result) -> op = case_statement;
3272 cfile, lose, case_context,
3276 parse_warn (cfile,
"expecting %s expression.",
3278 ?
"data" :
"numeric"));
3287 token =
next_token (&val, (
unsigned *)0, cfile);
3288 if (token !=
COLON) {
3307 struct
parse *cfile;
3315 log_fatal (
"no memory for if statement.");
3317 (*result) -> op = if_statement;
3319 token =
peek_token (&val, (
unsigned *)0, cfile);
3330 parse_warn (cfile,
"boolean expression expected.");
3335 #if defined (DEBUG_EXPRESSION_PARSE)
3339 token =
next_token (&val, (
unsigned *)0, cfile);
3341 parse_warn (cfile,
"expecting right paren.");
3347 token =
next_token (&val, (
unsigned *)0, cfile);
3361 (
unsigned *)0, cfile);
3367 token =
next_token (&val, (
unsigned *)0, cfile);
3375 token =
peek_token (&val, (
unsigned *)0, cfile);
3376 if (token ==
ELSE) {
3378 token =
peek_token (&val, (
unsigned *)0, cfile);
3385 "expecting if statement");
3390 }
else if (token !=
LBRACE) {
3391 parse_warn (cfile,
"left brace or if expected.");
3399 (&(*result) -> data.ie.fc,
3404 token =
next_token (&val, (
unsigned *)0, cfile);
3413 }
else if (token ==
ELSIF) {
3419 "expecting conditional.");
3443 struct
parse *cfile;
3454 parse_warn (cfile,
"Expecting a boolean expression.");
3465 struct
parse *cfile;
3471 if (!strcasecmp (val,
"true")
3472 || !strcasecmp (val,
"on"))
3474 else if (!strcasecmp (val,
"false")
3475 || !strcasecmp (val,
"off"))
3479 "boolean value (true/false/on/off) expected");
3510 struct
parse *cfile;
3522 parse_warn (cfile,
"Expecting a data expression.");
3537 struct
parse *cfile;
3549 parse_warn (cfile,
"Expecting a numeric expression.");
3560 struct
parse *cfile;
3570 isc_result_t status;
3573 token =
peek_token (&val, (
unsigned *)0, cfile);
3579 token =
next_token (&val, (
unsigned *)0, cfile);
3587 if (!strcmp (col -> name, val))
3595 log_fatal (
"can't allocate expression");
3603 log_fatal (
"can't allocate expression");
3617 parse_warn (cfile,
"boolean expression expected");
3635 token =
next_token (&val, (
unsigned *)0, cfile);
3647 log_fatal (
"can't allocate expression");
3652 &(*expr)->data.option);
3653 if (status != ISC_R_SUCCESS ||
3654 (*expr)->data.option == NULL) {
3664 log_fatal (
"can't allocate expression");
3671 log_fatal (
"can't allocate expression");
3678 log_fatal (
"can't allocate expression");
3681 token =
next_token (&val, (
unsigned *)0, cfile);
3685 parse_warn (cfile,
"left parenthesis expected.");
3696 "expecting data expression.");
3703 token =
next_token (&val, (
unsigned *)0, cfile);
3704 if (token !=
COMMA) {
3718 "expecting numeric expression.");
3726 token =
next_token (&val, (
unsigned *)0, cfile);
3734 token =
next_token (&val, (
unsigned *)0, cfile);
3737 parse_warn (cfile,
"right parenthesis expected.");
3747 log_fatal (
"can't allocate expression");
3750 token =
next_token (&val, (
unsigned *)0, cfile);
3758 token =
next_token (&val, (
unsigned *)0, cfile);
3766 token =
next_token (&val, (
unsigned *)0, cfile);
3774 log_fatal (
"can't allocate expression");
3777 token =
next_token(&val, (
unsigned *)0, cfile);
3784 token =
next_token(&val, (
unsigned *)0, cfile);
3792 log_fatal (
"can't allocate expression");
3795 token =
next_token (&val, (
unsigned *)0, cfile);
3803 token =
next_token(&val, (
unsigned *)0, cfile);
3811 log_fatal (
"can't allocate expression");
3814 token =
next_token (&val, (
unsigned *)0, cfile);
3822 token =
next_token (&val, (
unsigned *)0, cfile);
3831 token =
next_token (&val, (
unsigned *)0, cfile);
3833 if (token ==
COMMA) {
3836 log_fatal (
"can't allocate at CONCAT2");
3843 goto concat_another;
3853 log_fatal (
"can't allocate expression");
3856 token =
next_token (&val, (
unsigned *)0, cfile);
3864 token =
next_token (&val, (
unsigned *)0, cfile);
3872 token =
next_token (&val, (
unsigned *)0, cfile);
3880 token =
next_token (&val, (
unsigned *)0, cfile);
3888 token =
next_token (&val, (
unsigned *)0, cfile);
3896 log_fatal (
"can't allocate expression");
3899 token =
next_token (&val, (
unsigned *)0, cfile);
3907 token =
next_token (&val, (
unsigned *)0, cfile);
3915 token =
next_token (&val, (
unsigned *)0, cfile);
3925 log_fatal (
"can't allocate expression");
3927 token =
next_token (&val, (
unsigned *)0, cfile);
3940 token =
next_token (&val, (
unsigned *)0, cfile);
3941 if (token ==
COMMA) {
3951 }
while (token ==
COMMA);
3961 log_fatal (
"can't allocate expression");
3969 &(*expr)->data.option);
3970 if (status != ISC_R_SUCCESS ||
3971 (*expr)->data.option == NULL) {
3981 log_fatal (
"can't allocate expression");
3988 log_fatal (
"can't allocate expression");
3995 log_fatal (
"can't allocate expression");
4002 log_fatal (
"can't allocate expression");
4009 log_fatal (
"can't allocate expression");
4016 log_fatal (
"can't allocate expression");
4023 log_fatal (
"can't allocate expression");
4030 log_fatal (
"can't allocate expression");
4037 log_fatal (
"can't allocate expression");
4040 token =
next_token (&val, (
unsigned *)0, cfile);
4048 token =
next_token (&val, (
unsigned *)0, cfile);
4056 token =
next_token (&val, (
unsigned *)0, cfile);
4065 log_fatal (
"can't make constant string expression.");
4070 token =
next_token (&val, (
unsigned *)0, cfile);
4072 parse_warn (cfile,
"left parenthesis expected.");
4078 log_fatal (
"can't allocate expression");
4084 "expecting data expression.");
4092 token =
next_token (&val, (
unsigned *)0, cfile);
4093 if (token !=
COMMA) {
4100 token =
next_token (&val, (
unsigned *)0, cfile);
4107 switch (atoi (val)) {
4122 "unsupported integer size %d", atoi (val));
4129 token =
next_token (&val, (
unsigned *)0, cfile);
4131 parse_warn (cfile,
"right parenthesis expected.");
4140 token =
next_token (&val, (
unsigned *)0, cfile);
4142 parse_warn (cfile,
"left parenthesis expected.");
4148 log_fatal (
"can't allocate expression");
4152 parse_warn (cfile,
"expecting numeric expression.");
4159 token =
next_token (&val, (
unsigned *)0, cfile);
4160 if (token !=
COMMA) {
4167 token =
next_token (&val, (
unsigned *)0, cfile);
4174 switch (atoi (val)) {
4189 "unsupported integer size %d", atoi (val));
4196 token =
next_token (&val, (
unsigned *)0, cfile);
4198 parse_warn (cfile,
"right parenthesis expected.");
4212 log_fatal (
"can't allocate expression");
4220 log_fatal (
"can't allocate expression");
4235 log_fatal (
"can't allocate expression");
4241 known = ISC_R_SUCCESS;
4249 known = ISC_R_NOTIMPLEMENTED;
4310 token =
next_token (&val, (
unsigned *)0, cfile);
4314 token =
next_token (&val, (
unsigned *)0, cfile);
4316 parse_warn (cfile,
"%s can't be a variable name", val);
4323 log_fatal (
"can't allocate expression");
4326 if (!(*expr)->data.variable)
4327 log_fatal (
"can't allocate variable name");
4329 token =
next_token (&val, (
unsigned *)0, cfile);
4359 parse_warn(cfile,
"Expecting quoted literal: "
4360 "\"foo.example.com\"");
4366 log_fatal(
"Error creating gethostbyname() internal "
4367 "record. (%s:%d)",
MDL);
4377 log_fatal (
"can't allocate expression");
4412 log_fatal (
"can't allocate variable name");
4416 token =
peek_token (&val, (
unsigned *)0, cfile);
4419 log_fatal (
"can't allocate expression");
4427 log_fatal (
"can't allocate expression");
4435 log_fatal (
"can't allocate expression");
4443 "expecting expression.");
4451 token =
next_token (&val, (
unsigned *)0, cfile);
4452 }
while (token ==
COMMA);
4454 parse_warn (cfile,
"Right parenthesis expected.");
4469 struct
parse *cfile;
4498 "expecting right-hand side.");
4511 token =
peek_token (&val, (
unsigned *)0, cfile);
4515 token =
peek_token (&val, (
unsigned *)0, cfile);
4516 if (token !=
EQUAL) {
4517 parse_warn (cfile,
"! in boolean context without =");
4540 else if (token ==
EQUAL)
4543 parse_warn(cfile,
"expecting ~= or ~~ operator");
4553 parse_warn(cfile,
"No support for regex operator.");
4651 "expecting a subexpression");
4664 (rhs_context != lhs_context)) {
4665 parse_warn (cfile,
"illegal expression relating different types");
4680 parse_warn (cfile,
"expecting data/numeric expression");
4691 parse_warn(cfile,
"expecting data expression");
4709 parse_warn (cfile,
"expecting boolean expressions");
4727 parse_warn (cfile,
"expecting numeric expressions");
4745 log_fatal (
"Can't allocate expression!");
4747 (*expr) ->
op = binop;
4762 log_fatal (
"No memory for equal precedence combination.");
4788 struct
parse *cfile;
4793 const char *fmt = NULL;
4809 if ((fmt != NULL) && (fmt != option->
format) && (*fmt ==
'a'))
4811 else if ((fmt == NULL) || (*fmt ==
'A'))
4815 if ((fmt[0] !=
'Z') && (tolower((
unsigned char)fmt[1]) ==
'a'))
4819 if ((*fmt ==
'A') || (*fmt ==
'a'))
4827 if (fmt[1] ==
'o') {
4838 if (token ==
SEMI) {
4848 uniform, lookups)) {
4849 if (fmt [1] !=
'o') {
4862 }
while (*fmt !=
'\0');
4864 if ((*fmt ==
'A') || (*fmt ==
'a')) {
4865 token =
peek_token (&val, (
unsigned *)0, cfile);
4867 if (token ==
COMMA) {
4873 if ((*fmt ==
'A') || (fmt[1] ==
'\0'))
4881 }
while ((*fmt ==
'A') || (*fmt ==
'a'));
4895 struct
parse *cfile;
4898 enum statement_op
op;
4905 token =
peek_token (&val, (
unsigned *)0, cfile);
4906 if ((token ==
SEMI) && (option->
format[0] !=
'Z')) {
4915 }
else if (token ==
EQUAL) {
4926 "expecting a data expression.");
4939 log_fatal (
"no memory for option statement.");
4943 NULL, expr, option,
MDL))
4944 log_fatal (
"no memory for option cache");
4954 struct
parse *cfile;
4963 unsigned char buf [4];
4967 isc_boolean_t freeval = ISC_FALSE;
4975 if ((*fmt) [1] !=
'o') {
4988 g = strchr (*fmt,
'.');
4991 "malformed encapsulation format (bug!)");
4999 token =
peek_token (&val, (
unsigned *)0, cfile);
5003 if (!
parse_cshl (&t -> data.const_data, cfile)) {
5013 (
const unsigned char *)val,
5015 log_fatal (
"No memory for \"%s\"", val);
5017 if ((*fmt) [1] !=
'o') {
5019 "or hexadecimal data.");
5028 if ((*fmt)[1] ==
'c') {
5038 if ((*fmt)[1] !=
'o')
5048 parse_warn (cfile,
"not a valid domain name.");
5059 if ((*fmt) [1] !=
'o') {
5069 log_fatal (
"No memory for concatenation");
5070 if (freeval == ISC_TRUE) {
5072 freeval = ISC_FALSE;
5079 g = strchr (*fmt,
'.');
5082 "enumeration format");
5088 token =
next_token (&val, (
unsigned *)0, cfile);
5091 "identifier expected");
5135 token =
next_token (&val, (
unsigned *)0, cfile);
5145 token =
next_token (&val, (
unsigned *)0, cfile);
5149 if ((*fmt) [1] !=
'o') {
5163 token =
next_token (&val, (
unsigned *)0, cfile);
5173 token =
next_token (&val, (
unsigned *)0, cfile);
5182 token =
next_token (&val, (
unsigned *)0, cfile);
5184 if ((*fmt) [1] !=
'o')
5187 if ((*fmt) [1] !=
'o') {
5193 if (!strcasecmp (val,
"true")
5194 || !strcasecmp (val,
"on"))
5196 else if (!strcasecmp (val,
"false")
5197 || !strcasecmp (val,
"off"))
5199 else if (!strcasecmp (val,
"ignore"))
5202 if ((*fmt) [1] !=
'o')
5211 token =
peek_token (&val, (
unsigned *)0, cfile);
5212 if (token !=
SEMI) {
5227 parse_warn (cfile,
"Bad format '%c' in parse_option_token.",
5243 struct
parse *cfile;
5248 u_int8_t hunkbuf [1024];
5249 unsigned hunkix = 0;
5250 const char *fmt, *f;
5252 struct iaddr ip_addr;
5254 const u_int8_t *cdp;
5262 isc_result_t status;
5265 if (status != ISC_R_SUCCESS || option == NULL)
5272 for (; *fmt; fmt++) {
5288 if (*fmt ==
'o' && fmt != option -> format)
5292 fmt = strchr (fmt,
'.');
5295 "malformed %s (bug!)",
5296 "encapsulation format");
5302 len =
parse_X (cfile, &hunkbuf [hunkix],
5303 sizeof hunkbuf - hunkix);
5310 if (token ==
SEMI && fmt[1] ==
'o') {
5318 "expecting string.");
5321 if (hunkix + len + 1 >
sizeof hunkbuf) {
5323 "option data buffer %s",
5327 memcpy (&hunkbuf [hunkix], val, len + 1);
5333 if (fmt[1] ==
'c') {
5341 if (express == NULL)
5353 if ((hunkix + len) >
sizeof(hunkbuf)) {
5358 memcpy(&hunkbuf[hunkix], cdp, len);
5366 fmt = strchr (fmt,
'.');
5369 "malformed %s (bug!)",
5370 "enumeration format");
5374 (
unsigned *)0, cfile);
5377 "identifier expected");
5411 if (hunkix + len >
sizeof hunkbuf) {
5413 "option data buffer %s",
5417 memcpy (&hunkbuf [hunkix], dp, len);
5424 (
unsigned *)0, cfile);
5429 "expecting number.");
5443 (
unsigned *)0, cfile);
5455 (
unsigned *)0, cfile);
5466 (
unsigned *)0, cfile);
5469 "expecting identifier.");
5476 if (!strcasecmp (val,
"true")
5477 || !strcasecmp (val,
"on"))
5479 else if (!strcasecmp (val,
"false")
5480 || !strcasecmp (val,
"off"))
5484 "expecting boolean.");
5492 token =
peek_token(&val, (
unsigned *)0, cfile);
5493 if (token !=
SEMI) {
5495 "semicolon expected.");
5503 log_error (
"parse_option_param: Bad format %c",
5508 token =
next_token (&val, (
unsigned *)0, cfile);
5509 }
while (*fmt && token ==
COMMA);
5511 if (token !=
SEMI) {
5518 log_fatal (
"no memory to store option declaration.");
5519 memcpy (bp ->
data, hunkbuf, hunkix + nul_term);
5522 log_fatal (
"out of memory allocating option cache.");
5524 (*oc) ->
data.buffer = bp;
5525 (*oc) ->
data.data = &bp ->
data [0];
5526 (*oc) ->
data.terminated = nul_term;
5527 (*oc) ->
data.len = hunkix;
5533 if (express != NULL)
5545 struct
parse *cfile;
5553 token =
peek_token (&val, (
unsigned *)0, cfile);
5557 token =
next_token (&val, (
unsigned *)0, cfile);
5560 "expecting hexadecimal constant.");
5567 "hexadecimal constant too long.");
5571 token =
peek_token (&val, (
unsigned *)0, cfile);
5574 (
unsigned *)0, cfile);
5575 }
while (token ==
COLON);
5577 }
else if (token ==
STRING) {
5579 if (len + 1 > max) {
5580 parse_warn (cfile,
"string constant too long.");
5584 memcpy (buf, val, len + 1);
5586 parse_warn (cfile,
"expecting string or hexadecimal data");
5605 snprintf (fbuf,
sizeof fbuf,
"%s line %d: %s",
5608 va_start (list, fmt);
5609 vsnprintf (mbuf,
sizeof mbuf, fbuf, list);
5615 if (lix < (
sizeof lexbuf) - 1)
5616 lexbuf [lix++] =
' ';
5618 for (; lix < (
sizeof lexbuf) - 1 && (lix & 7); lix++)
5625 syslog (LOG_ERR,
"%s", mbuf);
5628 syslog (LOG_ERR,
"%s^", lexbuf);
5642 cfile -> warnings_occurred = 1;
5653 unsigned len, clen = 0;
5656 const unsigned char *dnptrs[256], **lastdnptr;
5658 memset(compbuf, 0,
sizeof(compbuf));
5659 memset(dnptrs, 0,
sizeof(dnptrs));
5660 dnptrs[0] = compbuf;
5661 lastdnptr = &dnptrs[255];
5672 parse_warn(cfile,
"Expecting a domain string.");
5681 sizeof(compbuf) - clen,
5685 parse_warn(cfile,
"Error compressing domain "
5693 sizeof(compbuf) - clen);
5709 while (compbuf[clen] != 0)
5710 clen += compbuf[clen] + 1;
5716 if (clen >
sizeof(compbuf))
5720 }
while (token ==
COMMA);
5723 log_fatal(
"No memory for domain list object.");
struct option_cache * lookup_hashed_option(struct universe *universe, struct option_state *options, unsigned code)
int(* decode)(struct option_state *, const unsigned char *, unsigned, struct universe *)
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)
int(* encapsulate)(struct data_string *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *)
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)
struct universe * universe
int executable_statement_dereference(struct executable_statement **ptr, const char *file, int line)
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)
struct option_cache *(* lookup_func)(struct universe *, struct option_state *, unsigned)
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)
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
u_int32_t(* get_length)(const unsigned char *)
enum expression_context op_context(enum expr_op op)
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
#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)
void(* store_length)(unsigned char *, u_int32_t)
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
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)
void(* delete_func)(struct universe *universe, struct option_state *, int)
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)
u_int32_t(* get_tag)(const unsigned char *)
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)
void(* store_tag)(unsigned char *, u_int32_t)
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)
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 parse_hardware_param(struct parse *cfile, struct hardware *hardware)
#define QUAD_NAME_HASH_SIZE
void(* save_func)(struct universe *, struct option_state *, struct option_cache *, isc_boolean_t)
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)