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;
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;
1999 "partial base64 value left over: %d.",
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) 2128 struct option *option=NULL;
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;
2351 (*result) -> data.set.name =
dmalloc (strlen (val) + 1,
MDL);
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.");
2413 expr -> data.func -> args = head;
2414 (*result) -> data.set.expr = expr;
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;
2471 (*result) -> data.unset =
dmalloc (strlen (val) + 1,
MDL);
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) {
2914 token =
peek_token (&val, (
unsigned *)0, cfile);
2917 key_name = (
char *)0;
2928 log_fatal(
"Multiple key definition for zone %s.",
2945 token =
next_token (&val, (
unsigned *)0, cfile);
2947 parse_warn (cfile,
"expecting right brace.");
2968 isc_result_t status;
2972 if (omapi_auth_key_new (&key,
MDL) != ISC_R_SUCCESS)
2975 token =
peek_token (&val, (
unsigned *)0, cfile);
2981 strcpy (key ->
name, val);
2992 token =
next_token (&val, (
unsigned *)0, cfile);
2999 token =
next_token (&val, (
unsigned *)0, cfile);
3004 "key %s: too many algorithms",
3011 "expecting key algorithm name.");
3020 static char add [] =
".SIG-ALG.REG.INT.";
3049 parse_warn (cfile,
"key %s: too many secrets",
3054 memset (&ds, 0,
sizeof(ds));
3059 if (status != ISC_R_SUCCESS)
3061 memcpy (key -> key -> value,
3075 parse_warn (cfile,
"expecting right brace.");
3080 token =
peek_token (&val, (
unsigned *)0, cfile);
3081 if (token ==
SEMI) {
3087 if (status != ISC_R_SUCCESS) {
3089 key ->
name, isc_result_totext (status));
3092 omapi_auth_key_dereference (&key,
MDL);
3098 omapi_auth_key_dereference (&key,
MDL);
3111 struct parse *cfile;
3118 log_fatal (
"no memory for new statement.");
3119 (*result) -> op = on_statement;
3122 token =
next_token (&val, (
unsigned *)0, cfile);
3125 (*result) -> data.on.evtypes |=
ON_EXPIRY;
3129 (*result) -> data.on.evtypes |=
ON_COMMIT;
3141 parse_warn (cfile,
"expecting a lease event type");
3147 token =
next_token (&val, (
unsigned *)0, cfile);
3148 }
while (token ==
OR);
3167 (
unsigned *)0, cfile);
3173 token =
next_token (&val, (
unsigned *)0, cfile);
3191 struct parse *cfile;
3198 log_fatal (
"no memory for new statement.");
3199 (*result) -> op = switch_statement;
3201 token =
next_token (&val, (
unsigned *)0, cfile);
3217 "expecting data or numeric expression.");
3223 token =
next_token (&val, (
unsigned *)0, cfile);
3229 token =
next_token (&val, (
unsigned *)0, cfile);
3235 (&(*result) -> data.s_switch.statements, cfile, lose,
3244 token =
next_token (&val, (
unsigned *)0, cfile);
3259 struct parse *cfile;
3267 log_fatal (
"no memory for new statement.");
3268 (*result) -> op = case_statement;
3271 cfile, lose, case_context,
3275 parse_warn (cfile,
"expecting %s expression.",
3277 ?
"data" :
"numeric"));
3286 token =
next_token (&val, (
unsigned *)0, cfile);
3287 if (token !=
COLON) {
3306 struct parse *cfile;
3314 log_fatal (
"no memory for if statement.");
3316 (*result) -> op = if_statement;
3318 token =
peek_token (&val, (
unsigned *)0, cfile);
3329 parse_warn (cfile,
"boolean expression expected.");
3334 #if defined (DEBUG_EXPRESSION_PARSE) 3338 token =
next_token (&val, (
unsigned *)0, cfile);
3340 parse_warn (cfile,
"expecting right paren.");
3346 token =
next_token (&val, (
unsigned *)0, cfile);
3360 (
unsigned *)0, cfile);
3366 token =
next_token (&val, (
unsigned *)0, cfile);
3374 token =
peek_token (&val, (
unsigned *)0, cfile);
3375 if (token ==
ELSE) {
3377 token =
peek_token (&val, (
unsigned *)0, cfile);
3384 "expecting if statement");
3389 }
else if (token !=
LBRACE) {
3390 parse_warn (cfile,
"left brace or if expected.");
3398 (&(*result) -> data.ie.fc,
3403 token =
next_token (&val, (
unsigned *)0, cfile);
3412 }
else if (token ==
ELSIF) {
3418 "expecting conditional.");
3442 struct parse *cfile;
3453 parse_warn (cfile,
"Expecting a boolean expression.");
3464 struct parse *cfile;
3470 if (!strcasecmp (val,
"true")
3471 || !strcasecmp (val,
"on"))
3473 else if (!strcasecmp (val,
"false")
3474 || !strcasecmp (val,
"off"))
3478 "boolean value (true/false/on/off) expected");
3509 struct parse *cfile;
3521 parse_warn (cfile,
"Expecting a data expression.");
3536 struct parse *cfile;
3548 parse_warn (cfile,
"Expecting a numeric expression.");
3559 struct parse *cfile;
3569 isc_result_t status;
3572 token =
peek_token (&val, (
unsigned *)0, cfile);
3578 token =
next_token (&val, (
unsigned *)0, cfile);
3586 if (!strcmp (col -> name, val))
3594 log_fatal (
"can't allocate expression");
3596 (*expr) -> data.check = col;
3602 log_fatal (
"can't allocate expression");
3616 parse_warn (cfile,
"boolean expression expected");
3634 token =
next_token (&val, (
unsigned *)0, cfile);
3646 log_fatal (
"can't allocate expression");
3651 &(*expr)->data.option);
3652 if (status != ISC_R_SUCCESS ||
3653 (*expr)->data.option == NULL) {
3663 log_fatal (
"can't allocate expression");
3670 log_fatal (
"can't allocate expression");
3677 log_fatal (
"can't allocate expression");
3680 token =
next_token (&val, (
unsigned *)0, cfile);
3684 parse_warn (cfile,
"left parenthesis expected.");
3695 "expecting data expression.");
3702 token =
next_token (&val, (
unsigned *)0, cfile);
3703 if (token !=
COMMA) {
3713 (&(*expr) -> data.substring.offset,cfile, lose)) {
3717 "expecting numeric expression.");
3725 token =
next_token (&val, (
unsigned *)0, cfile);
3730 (&(*expr) -> data.substring.
len, cfile, lose))
3733 token =
next_token (&val, (
unsigned *)0, cfile);
3736 parse_warn (cfile,
"right parenthesis expected.");
3746 log_fatal (
"can't allocate expression");
3749 token =
next_token (&val, (
unsigned *)0, cfile);
3757 token =
next_token (&val, (
unsigned *)0, cfile);
3765 token =
next_token (&val, (
unsigned *)0, cfile);
3773 log_fatal (
"can't allocate expression");
3776 token =
next_token(&val, (
unsigned *)0, cfile);
3783 token =
next_token(&val, (
unsigned *)0, cfile);
3791 log_fatal (
"can't allocate expression");
3794 token =
next_token (&val, (
unsigned *)0, cfile);
3802 token =
next_token(&val, (
unsigned *)0, cfile);
3810 log_fatal (
"can't allocate expression");
3813 token =
next_token (&val, (
unsigned *)0, cfile);
3821 token =
next_token (&val, (
unsigned *)0, cfile);
3830 token =
next_token (&val, (
unsigned *)0, cfile);
3832 if (token ==
COMMA) {
3835 log_fatal (
"can't allocate at CONCAT2");
3842 goto concat_another;
3852 log_fatal (
"can't allocate expression");
3855 token =
next_token (&val, (
unsigned *)0, cfile);
3863 token =
next_token (&val, (
unsigned *)0, cfile);
3871 token =
next_token (&val, (
unsigned *)0, cfile);
3879 token =
next_token (&val, (
unsigned *)0, cfile);
3887 token =
next_token (&val, (
unsigned *)0, cfile);
3895 log_fatal (
"can't allocate expression");
3898 token =
next_token (&val, (
unsigned *)0, cfile);
3903 (&(*expr) -> data.reverse.width, cfile, lose)))
3906 token =
next_token (&val, (
unsigned *)0, cfile);
3911 (&(*expr) -> data.reverse.
buffer, cfile, lose)))
3914 token =
next_token (&val, (
unsigned *)0, cfile);
3924 log_fatal (
"can't allocate expression");
3926 token =
next_token (&val, (
unsigned *)0, cfile);
3935 (&nexp -> data.pick_first_value.car,
3939 token =
next_token (&val, (
unsigned *)0, cfile);
3940 if (token ==
COMMA) {
3945 (&nexp -> data.pick_first_value.cdr, foo,
MDL);
3950 }
while (token ==
COMMA);
3960 log_fatal (
"can't allocate expression");
3968 &(*expr)->data.option);
3969 if (status != ISC_R_SUCCESS ||
3970 (*expr)->data.option == NULL) {
3980 log_fatal (
"can't allocate expression");
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");
4039 token =
next_token (&val, (
unsigned *)0, cfile);
4047 token =
next_token (&val, (
unsigned *)0, cfile);
4055 token =
next_token (&val, (
unsigned *)0, cfile);
4064 log_fatal (
"can't make constant string expression.");
4069 token =
next_token (&val, (
unsigned *)0, cfile);
4071 parse_warn (cfile,
"left parenthesis expected.");
4077 log_fatal (
"can't allocate expression");
4083 "expecting data expression.");
4091 token =
next_token (&val, (
unsigned *)0, cfile);
4092 if (token !=
COMMA) {
4099 token =
next_token (&val, (
unsigned *)0, cfile);
4106 switch (atoi (val)) {
4121 "unsupported integer size %d", atoi (val));
4128 token =
next_token (&val, (
unsigned *)0, cfile);
4130 parse_warn (cfile,
"right parenthesis expected.");
4139 token =
next_token (&val, (
unsigned *)0, cfile);
4141 parse_warn (cfile,
"left parenthesis expected.");
4147 log_fatal (
"can't allocate expression");
4151 parse_warn (cfile,
"expecting numeric expression.");
4158 token =
next_token (&val, (
unsigned *)0, cfile);
4159 if (token !=
COMMA) {
4166 token =
next_token (&val, (
unsigned *)0, cfile);
4173 switch (atoi (val)) {
4188 "unsupported integer size %d", atoi (val));
4195 token =
next_token (&val, (
unsigned *)0, cfile);
4197 parse_warn (cfile,
"right parenthesis expected.");
4211 log_fatal (
"can't allocate expression");
4213 (*expr) -> data.const_int = atoi (val);
4219 log_fatal (
"can't allocate expression");
4222 if (!
parse_cshl (&(*expr) -> data.const_data, cfile)) {
4234 log_fatal (
"can't allocate expression");
4236 (*expr) -> data.const_int = known;
4240 known = ISC_R_SUCCESS;
4248 known = ISC_R_NOTIMPLEMENTED;
4309 token =
next_token (&val, (
unsigned *)0, cfile);
4313 token =
next_token (&val, (
unsigned *)0, cfile);
4315 parse_warn (cfile,
"%s can't be a variable name", val);
4322 log_fatal (
"can't allocate expression");
4324 (*expr) -> data.variable =
dmalloc (strlen (val) + 1,
MDL);
4325 if (!(*expr)->data.variable)
4326 log_fatal (
"can't allocate variable name");
4327 strcpy ((*expr) -> data.variable, val);
4328 token =
next_token (&val, (
unsigned *)0, cfile);
4358 parse_warn(cfile,
"Expecting quoted literal: " 4359 "\"foo.example.com\"");
4365 log_fatal(
"Error creating gethostbyname() internal " 4366 "record. (%s:%d)",
MDL);
4376 log_fatal (
"can't allocate expression");
4411 log_fatal (
"can't allocate variable name");
4415 token =
peek_token (&val, (
unsigned *)0, cfile);
4418 log_fatal (
"can't allocate expression");
4420 (*expr) -> data.variable = cptr;
4426 log_fatal (
"can't allocate expression");
4428 (*expr) -> data.funcall.name = cptr;
4431 ep = &(*expr) -> data.funcall.arglist;
4434 log_fatal (
"can't allocate expression");
4442 "expecting expression.");
4449 ep = &((*ep) -> data.arg.next);
4450 token =
next_token (&val, (
unsigned *)0, cfile);
4451 }
while (token ==
COMMA);
4453 parse_warn (cfile,
"Right parenthesis expected.");
4468 struct parse *cfile;
4497 "expecting right-hand side.");
4510 token =
peek_token (&val, (
unsigned *)0, cfile);
4514 token =
peek_token (&val, (
unsigned *)0, cfile);
4515 if (token !=
EQUAL) {
4516 parse_warn (cfile,
"! in boolean context without =");
4539 else if (token ==
EQUAL)
4542 parse_warn(cfile,
"expecting ~= or ~~ operator");
4552 parse_warn(cfile,
"No support for regex operator.");
4650 "expecting a subexpression");
4663 (rhs_context != lhs_context)) {
4664 parse_warn (cfile,
"illegal expression relating different types");
4679 parse_warn (cfile,
"expecting data/numeric expression");
4690 parse_warn(cfile,
"expecting data expression");
4708 parse_warn (cfile,
"expecting boolean expressions");
4726 parse_warn (cfile,
"expecting numeric expressions");
4744 log_fatal (
"Can't allocate expression!");
4746 (*expr) ->
op = binop;
4750 (*expr) -> data.equal [0] = lhs;
4751 (*expr) -> data.equal [1] = rhs;
4761 log_fatal (
"No memory for equal precedence combination.");
4764 tmp -> data.equal [0] = lhs;
4765 tmp -> data.equal [1] = rhs;
4787 struct parse *cfile;
4789 struct option *option;
4792 const char *fmt = NULL;
4808 if ((fmt != NULL) && (fmt != option->
format) && (*fmt ==
'a'))
4810 else if ((fmt == NULL) || (*fmt ==
'A'))
4814 if ((fmt[0] !=
'Z') && (tolower((
unsigned char)fmt[1]) ==
'a'))
4818 if ((*fmt ==
'A') || (*fmt ==
'a'))
4826 if (fmt[1] ==
'o') {
4837 if (token ==
SEMI) {
4847 uniform, lookups)) {
4848 if (fmt [1] !=
'o') {
4861 }
while (*fmt !=
'\0');
4863 if ((*fmt ==
'A') || (*fmt ==
'a')) {
4864 token =
peek_token (&val, (
unsigned *)0, cfile);
4866 if (token ==
COMMA) {
4872 if ((*fmt ==
'A') || (fmt[1] ==
'\0'))
4880 }
while ((*fmt ==
'A') || (*fmt ==
'a'));
4894 struct parse *cfile;
4896 struct option *option;
4897 enum statement_op op;
4904 token =
peek_token (&val, (
unsigned *)0, cfile);
4905 if ((token ==
SEMI) && (option->
format[0] !=
'Z')) {
4914 }
else if (token ==
EQUAL) {
4925 "expecting a data expression.");
4938 log_fatal (
"no memory for option statement.");
4942 NULL, expr, option,
MDL))
4943 log_fatal (
"no memory for option cache");
4953 struct parse *cfile;
4962 unsigned char buf [4];
4966 isc_boolean_t freeval = ISC_FALSE;
4974 if ((*fmt) [1] !=
'o') {
4987 g = strchr (*fmt,
'.');
4990 "malformed encapsulation format (bug!)");
4998 token =
peek_token (&val, (
unsigned *)0, cfile);
5002 if (!
parse_cshl (&t -> data.const_data, cfile)) {
5012 (
const unsigned char *)val,
5014 log_fatal (
"No memory for \"%s\"", val);
5016 if ((*fmt) [1] !=
'o') {
5018 "or hexadecimal data.");
5027 if ((*fmt)[1] ==
'c') {
5037 if ((*fmt)[1] !=
'o')
5047 parse_warn (cfile,
"not a valid domain name.");
5058 if ((*fmt) [1] !=
'o') {
5068 log_fatal (
"No memory for concatenation");
5069 if (freeval == ISC_TRUE) {
5071 freeval = ISC_FALSE;
5078 g = strchr (*fmt,
'.');
5081 "enumeration format");
5087 token =
next_token (&val, (
unsigned *)0, cfile);
5090 "identifier expected");
5134 token =
next_token (&val, (
unsigned *)0, cfile);
5144 token =
next_token (&val, (
unsigned *)0, cfile);
5148 if ((*fmt) [1] !=
'o') {
5162 token =
next_token (&val, (
unsigned *)0, cfile);
5172 token =
next_token (&val, (
unsigned *)0, cfile);
5181 token =
next_token (&val, (
unsigned *)0, cfile);
5183 if ((*fmt) [1] !=
'o')
5186 if ((*fmt) [1] !=
'o') {
5192 if (!strcasecmp (val,
"true")
5193 || !strcasecmp (val,
"on"))
5195 else if (!strcasecmp (val,
"false")
5196 || !strcasecmp (val,
"off"))
5198 else if (!strcasecmp (val,
"ignore"))
5201 if ((*fmt) [1] !=
'o')
5210 token =
peek_token (&val, (
unsigned *)0, cfile);
5211 if (token !=
SEMI) {
5226 parse_warn (cfile,
"Bad format '%c' in parse_option_token.",
5242 struct parse *cfile;
5247 u_int8_t hunkbuf [1024];
5248 unsigned hunkix = 0;
5249 const char *fmt, *f;
5250 struct option *option=NULL;
5251 struct iaddr ip_addr;
5253 const u_int8_t *cdp;
5261 isc_result_t status;
5264 if (status != ISC_R_SUCCESS || option == NULL)
5271 for (; *fmt; fmt++) {
5287 if (*fmt ==
'o' && fmt != option -> format)
5291 fmt = strchr (fmt,
'.');
5294 "malformed %s (bug!)",
5295 "encapsulation format");
5301 len =
parse_X (cfile, &hunkbuf [hunkix],
5302 sizeof hunkbuf - hunkix);
5309 if (token ==
SEMI && fmt[1] ==
'o') {
5317 "expecting string.");
5320 if (hunkix + len + 1 >
sizeof hunkbuf) {
5322 "option data buffer %s",
5326 memcpy (&hunkbuf [hunkix], val, len + 1);
5332 if (fmt[1] ==
'c') {
5340 if (express == NULL)
5352 if ((hunkix + len) >
sizeof(hunkbuf)) {
5357 memcpy(&hunkbuf[hunkix], cdp, len);
5365 fmt = strchr (fmt,
'.');
5368 "malformed %s (bug!)",
5369 "enumeration format");
5373 (
unsigned *)0, cfile);
5376 "identifier expected");
5410 if (hunkix + len >
sizeof hunkbuf) {
5412 "option data buffer %s",
5416 memcpy (&hunkbuf [hunkix], dp, len);
5423 (
unsigned *)0, cfile);
5428 "expecting number.");
5442 (
unsigned *)0, cfile);
5454 (
unsigned *)0, cfile);
5465 (
unsigned *)0, cfile);
5468 "expecting identifier.");
5475 if (!strcasecmp (val,
"true")
5476 || !strcasecmp (val,
"on"))
5478 else if (!strcasecmp (val,
"false")
5479 || !strcasecmp (val,
"off"))
5483 "expecting boolean.");
5491 token =
peek_token(&val, (
unsigned *)0, cfile);
5492 if (token !=
SEMI) {
5494 "semicolon expected.");
5502 log_error (
"parse_option_param: Bad format %c",
5507 token =
next_token (&val, (
unsigned *)0, cfile);
5508 }
while (*fmt && token ==
COMMA);
5510 if (token !=
SEMI) {
5517 log_fatal (
"no memory to store option declaration.");
5518 memcpy (bp -> data, hunkbuf, hunkix + nul_term);
5521 log_fatal (
"out of memory allocating option cache.");
5523 (*oc) -> data.
buffer = bp;
5524 (*oc) -> data.
data = &bp -> data [0];
5526 (*oc) -> data.
len = hunkix;
5532 if (express != NULL)
5544 struct parse *cfile;
5552 token =
peek_token (&val, (
unsigned *)0, cfile);
5556 token =
next_token (&val, (
unsigned *)0, cfile);
5559 "expecting hexadecimal constant.");
5566 "hexadecimal constant too long.");
5570 token =
peek_token (&val, (
unsigned *)0, cfile);
5573 (
unsigned *)0, cfile);
5574 }
while (token ==
COLON);
5576 }
else if (token ==
STRING) {
5578 if (len + 1 > max) {
5579 parse_warn (cfile,
"string constant too long.");
5583 memcpy (buf, val, len + 1);
5585 parse_warn (cfile,
"expecting string or hexadecimal data");
5604 snprintf (fbuf,
sizeof fbuf,
"%s line %d: %s",
5607 va_start (list, fmt);
5608 vsnprintf (mbuf,
sizeof mbuf, fbuf, list);
5614 if (lix < (
sizeof lexbuf) - 1)
5615 lexbuf [lix++] =
' ';
5617 for (; lix < (
sizeof lexbuf) - 1 && (lix & 7); lix++)
5652 unsigned len, clen = 0;
5655 const unsigned char *dnptrs[256], **lastdnptr;
5657 memset(compbuf, 0,
sizeof(compbuf));
5658 memset(dnptrs, 0,
sizeof(dnptrs));
5659 dnptrs[0] = compbuf;
5660 lastdnptr = &dnptrs[255];
5671 parse_warn(cfile,
"Expecting a domain string.");
5680 sizeof(compbuf) - clen,
5684 parse_warn(cfile,
"Error compressing domain " 5692 sizeof(compbuf) - clen);
5708 while (compbuf[clen] != 0)
5709 clen += compbuf[clen] + 1;
5715 if (clen >
sizeof(compbuf))
5719 }
while (token ==
COMMA);
5722 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
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)
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
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)
#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
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)
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
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)
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)
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)
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)
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)
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,...)
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)
int dns_zone_dereference(struct dns_zone **ptr, const char *file, int line)