Lines Matching refs:cfile

77 skip_to_semi(struct parse *cfile)  in skip_to_semi()  argument
79 skip_to_rbrace(cfile, 0); in skip_to_semi()
94 skip_to_rbrace(struct parse *cfile, int brace_count) in skip_to_rbrace() argument
100 token = peek_token(&val, NULL, cfile); in skip_to_rbrace()
108 skip_token(&val, NULL, cfile); in skip_to_rbrace()
115 skip_token(&val, NULL, cfile); in skip_to_rbrace()
121 skip_token(&val, NULL, cfile); in skip_to_rbrace()
126 token = next_token(&val, NULL, cfile); in skip_to_rbrace()
131 parse_semi(struct parse *cfile) in parse_semi() argument
136 token = next_token(&val, NULL, cfile); in parse_semi()
138 parse_error(cfile, "semicolon expected."); in parse_semi()
144 parse_string(struct parse *cfile, char **sptr, unsigned *lptr) in parse_string() argument
151 token = next_token(&val, &len, cfile); in parse_string()
153 parse_error(cfile, "expecting a string"); in parse_string()
155 parse_error(cfile, "no memory for string %s.", val); in parse_string()
158 parse_semi(cfile); in parse_string()
174 parse_host_name(struct parse *cfile) in parse_host_name() argument
183 token = peek_token(&val, NULL, cfile); in parse_host_name()
186 skip_token(&val, NULL, cfile); in parse_host_name()
195 token = peek_token(&val, NULL, cfile); in parse_host_name()
197 token = next_token(&val, NULL, cfile); in parse_host_name()
215 parse_ip_addr_or_hostname(struct parse *cfile, isc_boolean_t check_multi) in parse_ip_addr_or_hostname() argument
224 token = peek_token(&val, NULL, cfile); in parse_ip_addr_or_hostname()
233 save_parse_state(cfile); in parse_ip_addr_or_hostname()
234 skip_token(NULL, NULL, cfile); in parse_ip_addr_or_hostname()
235 if (next_token(NULL, NULL, cfile) == DOT && in parse_ip_addr_or_hostname()
236 next_token(NULL, NULL, cfile) == NUMBER) in parse_ip_addr_or_hostname()
238 restore_parse_state(cfile); in parse_ip_addr_or_hostname()
241 bin = parse_numeric_aggregate(cfile, addr, &len, in parse_ip_addr_or_hostname()
249 name = parse_host_name(cfile); in parse_ip_addr_or_hostname()
254 parse_error(cfile, "expected IPv4 address. got " in parse_ip_addr_or_hostname()
262 parse_error(cfile, "%s: host unknown.", name->content); in parse_ip_addr_or_hostname()
271 TAILQ_INSERT_TAIL(&cfile->comments, comment); in parse_ip_addr_or_hostname()
278 token = next_token(&val, NULL, cfile); in parse_ip_addr_or_hostname()
279 parse_error(cfile, "%s (%d): expecting IP address or hostname", in parse_ip_addr_or_hostname()
291 parse_ip_addr(struct parse *cfile) in parse_ip_addr() argument
296 return parse_numeric_aggregate(cfile, addr, &len, DOT, 10, 8); in parse_ip_addr()
325 parse_ip6_addr(struct parse *cfile) in parse_ip6_addr() argument
338 token = peek_token(&val, NULL, cfile); in parse_ip6_addr()
352 next_raw_token(&val, NULL, cfile); in parse_ip6_addr()
355 parse_error(cfile, "Invalid IPv6 address."); in parse_ip6_addr()
362 token = peek_raw_token(&val, NULL, cfile); in parse_ip6_addr()
370 parse_error(cfile, "Invalid IPv6 address."); in parse_ip6_addr()
379 parse_ip6_addr_txt(struct parse *cfile) in parse_ip6_addr_txt() argument
383 bin = parse_ip6_addr(cfile); in parse_ip6_addr_txt()
395 parse_hardware_param(struct parse *cfile) in parse_hardware_param() argument
404 token = next_token(&val, NULL, cfile); in parse_hardware_param()
420 token = peek_token(&val, NULL, cfile); in parse_hardware_param()
422 parse_error(cfile, "empty hardware address"); in parse_hardware_param()
423 t = parse_numeric_aggregate(cfile, NULL, &hlen, COLON, 16, 8); in parse_hardware_param()
425 parse_error(cfile, "can't get hardware address"); in parse_hardware_param()
427 parse_error(cfile, "hardware address too long"); in parse_hardware_param()
428 token = next_token(&val, NULL, cfile); in parse_hardware_param()
430 parse_error(cfile, "expecting semicolon."); in parse_hardware_param()
436 TAILQ_CONCAT(&hw->comments, &cfile->comments); in parse_hardware_param()
439 cfile->issue_counter++; in parse_hardware_param()
465 parse_numeric_aggregate(struct parse *cfile, unsigned char *buf, in parse_numeric_aggregate() argument
478 parse_error(cfile, "no space for numeric aggregate"); in parse_numeric_aggregate()
488 token = peek_token(&val, NULL, cfile); in parse_numeric_aggregate()
493 token = next_token(&val, NULL, cfile); in parse_numeric_aggregate()
494 parse_error(cfile, "too few numbers."); in parse_numeric_aggregate()
496 skip_token(&val, NULL, cfile); in parse_numeric_aggregate()
498 token = next_token(&val, NULL, cfile); in parse_numeric_aggregate()
501 parse_error(cfile, "unexpected end of file"); in parse_numeric_aggregate()
506 parse_error(cfile, "expecting numeric value."); in parse_numeric_aggregate()
510 convert_num(cfile, s, val, base, size); in parse_numeric_aggregate()
513 convert_num(cfile, (unsigned char *)t->content, in parse_numeric_aggregate()
527 convert_num(struct parse *cfile, unsigned char *buf, const char *str, in convert_num() argument
568 parse_error(cfile, "Bogus number: %s.", str); in convert_num()
570 parse_error(cfile, in convert_num()
583 parse_error(cfile, in convert_num()
589 parse_error(cfile, in convert_num()
595 parse_error(cfile, in convert_num()
615 parse_error(cfile, in convert_num()
631 parse_error(cfile, in convert_num()
643 parse_option_name(struct parse *cfile, in parse_option_name() argument
654 token = next_token(&val, NULL, cfile); in parse_option_name()
656 parse_error(cfile, in parse_option_name()
661 parse_error(cfile, "no memory for uname information."); in parse_option_name()
662 token = peek_token(&val, NULL, cfile); in parse_option_name()
665 skip_token(&val, NULL, cfile); in parse_option_name()
668 token = next_token(&val, NULL, cfile); in parse_option_name()
670 parse_error(cfile, "expecting identifier after '.'"); in parse_option_name()
676 parse_error(cfile, "no option space named %s.", uname); in parse_option_name()
690 parse_error(cfile, "unknown server option %s.", val); in parse_option_name()
705 parse_error(cfile, "Option code 0 is illegal " in parse_option_name()
708 parse_error(cfile, "Option code 255 is illegal " in parse_option_name()
740 TAILQ_INSERT_TAIL(&cfile->comments, comment); in parse_option_name()
757 parse_error(cfile, "no option named %s in space %s", in parse_option_name()
769 parse_option_space_decl(struct parse *cfile) in parse_option_space_decl() argument
778 skip_token(&val, NULL, cfile); /* Discard the SPACE token, in parse_option_space_decl()
781 token = next_token(&val, NULL, cfile); in parse_option_space_decl()
783 parse_error(cfile, "expecting identifier."); in parse_option_space_decl()
790 parse_error(cfile, "No memory for new option space."); in parse_option_space_decl()
797 token = next_token(&val, NULL, cfile); in parse_option_space_decl()
804 cfile->issue_counter++; in parse_option_space_decl()
810 token = next_token(&val, NULL, cfile); in parse_option_space_decl()
812 parse_error(cfile, "expecting width token."); in parse_option_space_decl()
814 token = next_token(&val, NULL, cfile); in parse_option_space_decl()
816 parse_error(cfile, in parse_option_space_decl()
843 cfile->issue_counter++; in parse_option_space_decl()
849 token = next_token(&val, NULL, cfile); in parse_option_space_decl()
851 parse_error(cfile, "expecting width token."); in parse_option_space_decl()
853 token = next_token(&val, NULL, cfile); in parse_option_space_decl()
855 parse_error(cfile, "expecting number 1 or 2."); in parse_option_space_decl()
882 token = next_token(&val, NULL, cfile); in parse_option_space_decl()
884 parse_error(cfile, "expecting size token."); in parse_option_space_decl()
886 token = next_token(&val, NULL, cfile); in parse_option_space_decl()
888 parse_error(cfile, in parse_option_space_decl()
893 parse_error(cfile, "Unexpected token."); in parse_option_space_decl()
898 mapSet(cfile->stack[1], nu, "option-space"); in parse_option_space_decl()
935 parse_option_code_definition(struct parse *cfile, struct option *option) in parse_option_code_definition() argument
956 parse_vendor_code_definition(cfile, option); in parse_option_code_definition()
966 TAILQ_CONCAT(&def->comments, &cfile->comments); in parse_option_code_definition()
969 token = next_token(&val, NULL, cfile); in parse_option_code_definition()
971 parse_error(cfile, "expecting option code number."); in parse_option_code_definition()
972 TAILQ_CONCAT(&def->comments, &cfile->comments); in parse_option_code_definition()
997 cfile->issue_counter++; in parse_option_code_definition()
1002 token = next_token(&val, NULL, cfile); in parse_option_code_definition()
1004 parse_error(cfile, "expecting \"=\""); in parse_option_code_definition()
1008 token = next_token(&val, NULL, cfile); in parse_option_code_definition()
1010 token = next_token(&val, NULL, cfile); in parse_option_code_definition()
1012 parse_error(cfile, "expecting \"of\"."); in parse_option_code_definition()
1014 token = next_token(&val, NULL, cfile); in parse_option_code_definition()
1020 token = next_token(&val, NULL, cfile); in parse_option_code_definition()
1035 parse_error(cfile, in parse_option_code_definition()
1041 parse_error(cfile, "no nested arrays."); in parse_option_code_definition()
1049 cfile->issue_counter++; in parse_option_code_definition()
1051 token = next_token(&val, NULL, cfile); in parse_option_code_definition()
1053 parse_error(cfile, "expecting \"of\"."); in parse_option_code_definition()
1055 token = next_token(&val, NULL, cfile); in parse_option_code_definition()
1057 parse_error(cfile, in parse_option_code_definition()
1067 cfile->issue_counter++; in parse_option_code_definition()
1078 token = next_token(&val, NULL, cfile); in parse_option_code_definition()
1080 parse_error(cfile, "expecting number."); in parse_option_code_definition()
1110 parse_error(cfile, in parse_option_code_definition()
1117 token = next_token(&val, NULL, cfile); in parse_option_code_definition()
1119 parse_error(cfile, "expecting \"integer\" keyword."); in parse_option_code_definition()
1139 token = peek_token(&val, NULL, cfile); in parse_option_code_definition()
1145 parse_error(cfile, "domain list in DHCPv6 " in parse_option_code_definition()
1147 skip_token(&val, NULL, cfile); in parse_option_code_definition()
1158 parse_error(cfile, "arrays of text strings not %s", in parse_option_code_definition()
1169 token = next_token(&val, NULL, cfile); in parse_option_code_definition()
1171 parse_error(cfile, in parse_option_code_definition()
1188 parse_error(cfile, "array incompatible with zerolen."); in parse_option_code_definition()
1193 parse_error(cfile, "unknown data type %s", val); in parse_option_code_definition()
1199 token = next_token(&val, NULL, cfile); in parse_option_code_definition()
1210 parse_error(cfile, in parse_option_code_definition()
1214 token = next_token(&val, NULL, cfile); in parse_option_code_definition()
1220 parse_error(cfile, "expecting right brace."); in parse_option_code_definition()
1223 parse_semi(cfile); in parse_option_code_definition()
1225 parse_error(cfile, in parse_option_code_definition()
1267 optdef = mapGet(cfile->stack[1], "option-def"); in parse_option_code_definition()
1270 mapSet(cfile->stack[1], optdef, "option-def"); in parse_option_code_definition()
1283 parse_vendor_code_definition(struct parse *cfile, struct option *option) in parse_vendor_code_definition() argument
1297 token = next_token(&val, NULL, cfile); in parse_vendor_code_definition()
1299 parse_error(cfile, "expecting option code number."); in parse_vendor_code_definition()
1304 token = next_token(&val, NULL, cfile); in parse_vendor_code_definition()
1306 parse_error(cfile, "expecting \"=\""); in parse_vendor_code_definition()
1307 token = next_token(&val, NULL, cfile); in parse_vendor_code_definition()
1309 parse_error(cfile, "expecting encapsulate"); in parse_vendor_code_definition()
1310 token = next_token(&val, NULL, cfile); in parse_vendor_code_definition()
1312 parse_error(cfile, "expecting option space identifier"); in parse_vendor_code_definition()
1315 parse_error(cfile, "unknown option space %s", val); in parse_vendor_code_definition()
1334 parse_semi(cfile); in parse_vendor_code_definition()
1434 parse_base64(struct parse *cfile) in parse_base64() argument
1463 (void)next_token(&val, &l, cfile); in parse_base64()
1466 (void)peek_token(&val, NULL, cfile); in parse_base64()
1489 parse_cshl(struct parse *cfile) in parse_cshl() argument
1501 token = next_token(&val, NULL, cfile); in parse_cshl()
1503 parse_error(cfile, "expecting hexadecimal number."); in parse_cshl()
1504 convert_num(cfile, &ibuf, val, 16, 8); in parse_cshl()
1512 token = peek_token(&val, NULL, cfile); in parse_cshl()
1515 skip_token(&val, NULL, cfile); in parse_cshl()
1524 parse_hexa(struct parse *cfile) in parse_hexa() argument
1535 token = next_token(&val, NULL, cfile); in parse_hexa()
1537 parse_error(cfile, "expecting hexadecimal number."); in parse_hexa()
1538 convert_num(cfile, &ibuf, val, 16, 8); in parse_hexa()
1542 token = peek_token(&val, NULL, cfile); in parse_hexa()
1545 skip_token(&val, NULL, cfile); in parse_hexa()
1567 struct parse *cfile, isc_boolean_t *lose, in parse_executable_statements() argument
1571 parse_error(cfile, "statements is not a list?"); in parse_executable_statements()
1576 TAILQ_CONCAT(&statement->comments, &cfile->comments); in parse_executable_statements()
1577 if (!parse_executable_statement(statement, cfile, lose, in parse_executable_statements()
1580 TAILQ_CONCAT(&statement->comments, &cfile->comments); in parse_executable_statements()
1591 struct parse *cfile, isc_boolean_t *lose, in parse_executable_statement() argument
1610 token = peek_token(&val, NULL, cfile); in parse_executable_statement()
1613 skip_token(&val, NULL, cfile); in parse_executable_statement()
1614 token = next_token(&val, NULL, cfile); in parse_executable_statement()
1620 parse_error(cfile, "Expecting 'local' or 'default'."); in parse_executable_statement()
1622 token = next_token(&val, NULL, cfile); in parse_executable_statement()
1624 parse_error(cfile, "Expecting a semicolon."); in parse_executable_statement()
1627 cfile->issue_counter++; in parse_executable_statement()
1634 skip_token(&val, NULL, cfile); in parse_executable_statement()
1635 return parse_if_statement(result, cfile, lose); in parse_executable_statement()
1638 skip_token(&val, NULL, cfile); in parse_executable_statement()
1639 token = next_token(&val, NULL, cfile); in parse_executable_statement()
1641 parse_error(cfile, "expecting class name."); in parse_executable_statement()
1643 parse_semi(cfile); in parse_executable_statement()
1646 cfile->issue_counter++; in parse_executable_statement()
1651 skip_token(&val, NULL, cfile); in parse_executable_statement()
1653 parse_semi(cfile); in parse_executable_statement()
1656 cfile->issue_counter++; in parse_executable_statement()
1661 skip_token(&val, NULL, cfile); in parse_executable_statement()
1663 option = parse_option_name(cfile, ISC_FALSE, &known); in parse_executable_statement()
1668 return parse_option_statement(result, cfile, option, in parse_executable_statement()
1673 skip_token(&val, NULL, cfile); in parse_executable_statement()
1675 option = parse_option_name(cfile, ISC_FALSE, &known); in parse_executable_statement()
1680 return parse_option_statement(result, cfile, option, in parse_executable_statement()
1692 skip_token(&val, NULL, cfile); in parse_executable_statement()
1693 st = parse_allow_deny(cfile, flag); in parse_executable_statement()
1698 skip_token(&val, NULL, cfile); in parse_executable_statement()
1699 token = peek_token(&val, NULL, cfile); in parse_executable_statement()
1703 option = parse_option_name(cfile, ISC_FALSE, &known); in parse_executable_statement()
1708 return parse_option_statement(result, cfile, option, in parse_executable_statement()
1711 skip_token(&val, NULL, cfile); in parse_executable_statement()
1713 option = parse_option_name(cfile, ISC_FALSE, &known); in parse_executable_statement()
1718 return parse_option_statement(result, cfile, option, in parse_executable_statement()
1721 skip_token(&val, NULL, cfile); in parse_executable_statement()
1723 option = parse_option_name(cfile, ISC_FALSE, &known); in parse_executable_statement()
1728 return parse_option_statement(result, cfile, option, in parse_executable_statement()
1732 skip_token(&val, NULL, cfile); in parse_executable_statement()
1733 return parse_on_statement(result, cfile, lose); in parse_executable_statement()
1736 skip_token(&val, NULL, cfile); in parse_executable_statement()
1737 return parse_switch_statement(result, cfile, lose); in parse_executable_statement()
1740 skip_token(&val, NULL, cfile); in parse_executable_statement()
1742 parse_error(cfile, in parse_executable_statement()
1745 cfile, lose, case_context); in parse_executable_statement()
1748 skip_token(&val, NULL, cfile); in parse_executable_statement()
1750 parse_error(cfile, "switch default statement in %s", in parse_executable_statement()
1755 cfile->issue_counter++; in parse_executable_statement()
1761 skip_token(&val, NULL, cfile); in parse_executable_statement()
1767 token = next_token(&val, NULL, cfile); in parse_executable_statement()
1769 parse_error(cfile, in parse_executable_statement()
1773 cfile->issue_counter++; in parse_executable_statement()
1777 token = next_token(&val, NULL, cfile); in parse_executable_statement()
1786 token = next_token(&val, NULL, cfile); in parse_executable_statement()
1790 parse_error(cfile, in parse_executable_statement()
1795 token = next_token(&val, NULL, cfile); in parse_executable_statement()
1799 parse_error(cfile, "expecting right paren."); in parse_executable_statement()
1801 skip_to_semi(cfile); in parse_executable_statement()
1807 token = next_token(&val, NULL, cfile); in parse_executable_statement()
1809 parse_error(cfile, "expecting left brace."); in parse_executable_statement()
1812 if (!parse_executable_statements(expr, cfile, in parse_executable_statement()
1820 token = next_token(&val, NULL, cfile); in parse_executable_statement()
1822 parse_error(cfile, "expecting rigt brace."); in parse_executable_statement()
1825 parse_error(cfile, in parse_executable_statement()
1830 if (!parse_expression(expr, cfile, lose, context_any, in parse_executable_statement()
1833 parse_error(cfile, in parse_executable_statement()
1837 skip_to_semi(cfile); in parse_executable_statement()
1841 parse_semi(cfile); in parse_executable_statement()
1846 skip_token(&val, NULL, cfile); in parse_executable_statement()
1847 token = next_token(&val, NULL, cfile); in parse_executable_statement()
1849 parse_error(cfile, "%s can't be a variable name", val); in parse_executable_statement()
1853 cfile->issue_counter++; in parse_executable_statement()
1857 parse_semi(cfile); in parse_executable_statement()
1861 skip_token(&val, NULL, cfile); in parse_executable_statement()
1864 if (!parse_expression(expr, cfile, lose, in parse_executable_statement()
1868 parse_error(cfile, in parse_executable_statement()
1872 skip_to_semi(cfile); in parse_executable_statement()
1876 parse_semi(cfile); in parse_executable_statement()
1880 skip_token(&val, NULL, cfile); in parse_executable_statement()
1883 token = next_token(&val, NULL, cfile); in parse_executable_statement()
1885 parse_error(cfile, "left parenthesis expected."); in parse_executable_statement()
1887 token = next_token(&val, &len, cfile); in parse_executable_statement()
1889 parse_error(cfile, "Expecting a quoted string."); in parse_executable_statement()
1894 while ((token = next_token(&val, NULL, cfile)) == COMMA) { in parse_executable_statement()
1896 if (!parse_data_expression(var, cfile, lose)) { in parse_executable_statement()
1898 parse_error(cfile, in parse_executable_statement()
1900 skip_to_semi(cfile); in parse_executable_statement()
1909 parse_error(cfile, "right parenthesis expected."); in parse_executable_statement()
1910 parse_semi(cfile); in parse_executable_statement()
1915 skip_token(&val, NULL, cfile); in parse_executable_statement()
1919 if (!parse_expression(expr, cfile, lose, context_data, in parse_executable_statement()
1922 parse_error(cfile, in parse_executable_statement()
1926 skip_to_semi(cfile); in parse_executable_statement()
1930 parse_semi(cfile); in parse_executable_statement()
1934 skip_token(&val, NULL, cfile); in parse_executable_statement()
1938 cfile->issue_counter++; in parse_executable_statement()
1951 token = next_token(&val, NULL, cfile); in parse_executable_statement()
1953 parse_error(cfile, "left parenthesis expected."); in parse_executable_statement()
1955 token = peek_token(&val, NULL, cfile); in parse_executable_statement()
1970 skip_token(&val, NULL, cfile); in parse_executable_statement()
1971 token = next_token(&val, NULL, cfile); in parse_executable_statement()
1973 parse_error(cfile, "comma expected."); in parse_executable_statement()
1979 if (!parse_data_expression(expr, cfile, lose)) { in parse_executable_statement()
1980 skip_to_semi(cfile); in parse_executable_statement()
1986 token = next_token(&val, NULL, cfile); in parse_executable_statement()
1988 parse_error(cfile, "right parenthesis expected."); in parse_executable_statement()
1990 token = next_token(&val, NULL, cfile); in parse_executable_statement()
1992 parse_error(cfile, "semicolon expected."); in parse_executable_statement()
2000 skip_token(&val, NULL, cfile); in parse_executable_statement()
2001 parse_semi(cfile); in parse_executable_statement()
2011 skip_token(&val, NULL, cfile); in parse_executable_statement()
2014 cfile->issue_counter++; in parse_executable_statement()
2017 s = parse_host_name(cfile); in parse_executable_statement()
2019 parse_error(cfile, "expecting hostname."); in parse_executable_statement()
2022 skip_to_semi(cfile); in parse_executable_statement()
2028 if (!parse_zone(zone, cfile)) in parse_executable_statement()
2034 skip_token(&val, NULL, cfile); in parse_executable_statement()
2035 if (!parse_key(result, cfile)) { in parse_executable_statement()
2047 skip_token(&val, NULL, cfile); in parse_executable_statement()
2049 cfile->issue_counter++; in parse_executable_statement()
2052 cfile, option, in parse_executable_statement()
2062 if (!parse_expression(expr, cfile, lose, context_data, in parse_executable_statement()
2065 parse_error(cfile, "expecting " in parse_executable_statement()
2069 skip_to_semi(cfile); in parse_executable_statement()
2073 parse_semi(cfile); in parse_executable_statement()
2098 parse_zone(struct element *zone, struct parse *cfile) in parse_zone() argument
2106 token = next_token(&val, NULL, cfile); in parse_zone()
2108 parse_error(cfile, "expecting left brace"); in parse_zone()
2111 token = peek_token(&val, NULL, cfile); in parse_zone()
2115 parse_error(cfile, "more than one primary."); in parse_zone()
2122 parse_error(cfile, "more than one secondary."); in parse_zone()
2126 skip_token(&val, NULL, cfile); in parse_zone()
2130 value = parse_ip_addr_or_hostname(cfile, in parse_zone()
2133 parse_error(cfile, in parse_zone()
2137 token = next_token(&val, NULL, cfile); in parse_zone()
2140 parse_error(cfile, "expecting semicolon."); in parse_zone()
2145 parse_error(cfile, "more than one primary6."); in parse_zone()
2152 parse_error(cfile, "more than one secondary6."); in parse_zone()
2156 skip_token(&val, NULL, cfile); in parse_zone()
2160 addr = parse_ip6_addr_txt(cfile); in parse_zone()
2162 parse_error(cfile, "expecting IPv6 addr."); in parse_zone()
2164 token = next_token(&val, NULL, cfile); in parse_zone()
2167 parse_error(cfile, "expecting semicolon."); in parse_zone()
2171 skip_token(&val, NULL, cfile); in parse_zone()
2172 token = peek_token(&val, NULL, cfile); in parse_zone()
2174 skip_token(&val, NULL, cfile); in parse_zone()
2177 key_name = parse_host_name(cfile); in parse_zone()
2179 parse_error(cfile, "expecting key name."); in parse_zone()
2182 parse_error(cfile, "Multiple key definitions"); in parse_zone()
2184 parse_semi(cfile); in parse_zone()
2193 token = next_token(&val, NULL, cfile); in parse_zone()
2195 parse_error(cfile, "expecting right brace."); in parse_zone()
2210 parse_key(struct element* result, struct parse *cfile) in parse_key() argument
2223 cfile->issue_counter++; in parse_key()
2225 token = peek_token(&val, NULL, cfile); in parse_key()
2227 skip_token(&val, NULL, cfile); in parse_key()
2232 name = parse_host_name(cfile); in parse_key()
2234 parse_error(cfile, "expecting key name."); in parse_key()
2238 token = next_token(&val, NULL, cfile); in parse_key()
2240 parse_error(cfile, "expecting left brace"); in parse_key()
2243 token = next_token(&val, NULL, cfile); in parse_key()
2247 parse_error(cfile, "key: too many algorithms"); in parse_key()
2248 alg = parse_host_name(cfile); in parse_key()
2250 parse_error(cfile, in parse_key()
2252 parse_semi(cfile); in parse_key()
2266 parse_error(cfile, "key: too many secrets"); in parse_key()
2268 sec = parse_base64(cfile); in parse_key()
2270 skip_to_rbrace(cfile, 1); in parse_key()
2275 parse_semi(cfile); in parse_key()
2284 parse_error(cfile, "expecting right brace."); in parse_key()
2287 token = peek_token(&val, NULL, cfile); in parse_key()
2289 skip_token(&val, NULL, cfile); in parse_key()
2310 struct parse *cfile, in parse_on_statement() argument
2321 cfile->issue_counter++; in parse_on_statement()
2326 token = next_token(&val, NULL, cfile); in parse_on_statement()
2336 parse_error(cfile, "expecting a lease event type"); in parse_on_statement()
2338 token = next_token(&val, NULL, cfile); in parse_on_statement()
2350 parse_error(cfile, "left brace expected."); in parse_on_statement()
2353 if (!parse_executable_statements(body, cfile, lose, context_any)) { in parse_on_statement()
2357 token = next_token(&val, NULL, cfile); in parse_on_statement()
2363 token = next_token(&val, NULL, cfile); in parse_on_statement()
2365 parse_error(cfile, "right brace expected."); in parse_on_statement()
2376 struct parse *cfile, in parse_switch_statement() argument
2387 cfile->issue_counter++; in parse_switch_statement()
2390 token = next_token(&val, NULL, cfile); in parse_switch_statement()
2392 parse_error(cfile, "expecting left brace."); in parse_switch_statement()
2394 skip_to_semi(cfile); in parse_switch_statement()
2399 if (!parse_expression(cond, cfile, lose, context_data_or_numeric, in parse_switch_statement()
2402 parse_error(cfile, in parse_switch_statement()
2408 token = next_token(&val, NULL, cfile); in parse_switch_statement()
2410 parse_error(cfile, "right paren expected."); in parse_switch_statement()
2412 token = next_token(&val, NULL, cfile); in parse_switch_statement()
2414 parse_error(cfile, "left brace expected."); in parse_switch_statement()
2417 if (!parse_executable_statements(body, cfile, lose, in parse_switch_statement()
2420 skip_to_rbrace(cfile, 1); in parse_switch_statement()
2425 token = next_token(&val, NULL, cfile); in parse_switch_statement()
2427 parse_error(cfile, "right brace expected."); in parse_switch_statement()
2438 struct parse *cfile, in parse_case_statement() argument
2447 if (!parse_expression(expr, cfile, lose, case_context, in parse_case_statement()
2451 parse_error(cfile, "expecting %s expression.", in parse_case_statement()
2455 skip_to_semi(cfile); in parse_case_statement()
2459 token = next_token(&val, NULL, cfile); in parse_case_statement()
2461 parse_error(cfile, "colon expected."); in parse_case_statement()
2478 struct parse *cfile, in parse_if_statement() argument
2490 cfile->issue_counter++; in parse_if_statement()
2494 token = peek_token(&val, NULL, cfile); in parse_if_statement()
2497 skip_token(&val, NULL, cfile); in parse_if_statement()
2502 if (!parse_boolean_expression(cond, cfile, lose)) { in parse_if_statement()
2504 parse_error(cfile, "boolean expression expected."); in parse_if_statement()
2510 token = next_token(&val, NULL, cfile); in parse_if_statement()
2512 parse_error(cfile, "expecting right paren."); in parse_if_statement()
2514 token = next_token(&val, NULL, cfile); in parse_if_statement()
2516 parse_error(cfile, "left brace expected."); in parse_if_statement()
2518 if (!parse_executable_statements(branch, cfile, lose, context_any)) { in parse_if_statement()
2522 token = next_token(&val, NULL, cfile); in parse_if_statement()
2528 token = next_token(&val, NULL, cfile); in parse_if_statement()
2530 parse_error(cfile, "right brace expected."); in parse_if_statement()
2531 token = peek_token(&val, NULL, cfile); in parse_if_statement()
2533 skip_token(&val, NULL, cfile); in parse_if_statement()
2534 token = peek_token(&val, NULL, cfile); in parse_if_statement()
2536 skip_token(&val, NULL, cfile); in parse_if_statement()
2538 if (!parse_if_statement(branch, cfile, lose)) { in parse_if_statement()
2540 parse_error(cfile, in parse_if_statement()
2546 parse_error(cfile, "left brace or if expected."); in parse_if_statement()
2548 skip_token(&val, NULL, cfile); in parse_if_statement()
2550 if (!parse_executable_statements(branch, cfile, in parse_if_statement()
2553 token = next_token(&val, NULL, cfile); in parse_if_statement()
2555 parse_error(cfile, "right brace expected."); in parse_if_statement()
2559 skip_token(&val, NULL, cfile); in parse_if_statement()
2561 if (!parse_if_statement(branch, cfile, lose)) { in parse_if_statement()
2563 parse_error(cfile, in parse_if_statement()
2587 struct parse *cfile, in parse_boolean_expression() argument
2591 if (!parse_expression(expr, cfile, lose, context_boolean, in parse_boolean_expression()
2598 parse_error(cfile, "Expecting a boolean expression."); in parse_boolean_expression()
2605 parse_boolean(struct parse *cfile) in parse_boolean() argument
2610 (void)next_token(&val, NULL, cfile); in parse_boolean()
2618 parse_error(cfile, in parse_boolean()
2620 parse_semi(cfile); in parse_boolean()
2646 struct parse *cfile, in parse_data_expression() argument
2650 if (!parse_expression(expr, cfile, lose, context_data, in parse_data_expression()
2657 parse_error(cfile, "Expecting a data expression."); in parse_data_expression()
2669 struct parse *cfile, in parse_numeric_expression() argument
2673 if (!parse_expression(expr, cfile, lose, context_numeric, in parse_numeric_expression()
2680 parse_error(cfile, "Expecting a numeric expression."); in parse_numeric_expression()
2688 struct parse *cfile, in parse_non_binary() argument
2703 token = peek_token(&val, NULL, cfile); in parse_non_binary()
2708 skip_token(&val, NULL, cfile); in parse_non_binary()
2709 token = next_token(&val, NULL, cfile); in parse_non_binary()
2711 parse_error(cfile, "string expected."); in parse_non_binary()
2714 cfile->issue_counter++; in parse_non_binary()
2719 skip_token(&val, NULL, cfile); in parse_non_binary()
2722 if (!parse_non_binary(nexp, cfile, lose, context_boolean)) { in parse_non_binary()
2724 parse_error(cfile, "expression expected"); in parse_non_binary()
2729 parse_error(cfile, "boolean expression expected"); in parse_non_binary()
2732 cfile->issue_counter++; in parse_non_binary()
2738 skip_token(&val, NULL, cfile); in parse_non_binary()
2739 if (!parse_expression(expr, cfile, lose, context, in parse_non_binary()
2742 parse_error(cfile, "expression expected"); in parse_non_binary()
2746 token = next_token(&val, NULL, cfile); in parse_non_binary()
2748 parse_error(cfile, "right paren expected"); in parse_non_binary()
2752 skip_token(&val, NULL, cfile); in parse_non_binary()
2754 option = parse_option_name(cfile, ISC_FALSE, &known); in parse_non_binary()
2769 cfile->issue_counter++; in parse_non_binary()
2774 skip_token(&val, NULL, cfile); in parse_non_binary()
2777 cfile->issue_counter++; in parse_non_binary()
2782 skip_token(&val, NULL, cfile); in parse_non_binary()
2785 cfile->issue_counter++; in parse_non_binary()
2790 skip_token(&val, NULL, cfile); in parse_non_binary()
2793 cfile->issue_counter++; in parse_non_binary()
2796 token = next_token(&val, NULL, cfile); in parse_non_binary()
2799 parse_error(cfile, "left parenthesis expected."); in parse_non_binary()
2803 if (!parse_data_expression(arg, cfile, lose)) { in parse_non_binary()
2806 parse_error(cfile, in parse_non_binary()
2812 token = next_token(&val, NULL, cfile); in parse_non_binary()
2815 parse_error(cfile, "comma expected."); in parse_non_binary()
2819 if (!parse_numeric_expression(arg, cfile, lose)) { in parse_non_binary()
2822 parse_error(cfile, in parse_non_binary()
2828 token = next_token(&val, NULL, cfile); in parse_non_binary()
2833 if (!parse_numeric_expression(arg, cfile, lose)) in parse_non_binary()
2837 token = next_token(&val, NULL, cfile); in parse_non_binary()
2840 parse_error(cfile, "right parenthesis expected."); in parse_non_binary()
2845 skip_token(&val, NULL, cfile); in parse_non_binary()
2848 cfile->issue_counter++; in parse_non_binary()
2851 token = next_token(&val, NULL, cfile); in parse_non_binary()
2856 if (!parse_data_expression(arg, cfile, lose)) in parse_non_binary()
2860 token = next_token(&val, NULL, cfile); in parse_non_binary()
2865 if (!parse_numeric_expression(arg, cfile, lose)) in parse_non_binary()
2869 token = next_token(&val, NULL, cfile); in parse_non_binary()
2875 skip_token(&val, NULL, cfile); in parse_non_binary()
2878 token = next_token(&val, NULL, cfile); in parse_non_binary()
2882 if (!parse_data_expression(nexp, cfile, lose)) in parse_non_binary()
2885 token = next_token(&val, NULL, cfile); in parse_non_binary()
2890 cfile->issue_counter++; in parse_non_binary()
2896 skip_token(&val, NULL, cfile); in parse_non_binary()
2899 token = next_token(&val, NULL, cfile); in parse_non_binary()
2903 if (!parse_data_expression(nexp, cfile, lose)) in parse_non_binary()
2906 token = next_token(&val, NULL, cfile); in parse_non_binary()
2911 cfile->issue_counter++; in parse_non_binary()
2917 skip_token(&val, NULL, cfile); in parse_non_binary()
2920 cfile->issue_counter++; in parse_non_binary()
2923 token = next_token(&val, NULL, cfile); in parse_non_binary()
2928 if (!parse_data_expression(arg, cfile, lose)) in parse_non_binary()
2932 token = next_token(&val, NULL, cfile); in parse_non_binary()
2938 if (!parse_data_expression(arg, cfile, lose)) in parse_non_binary()
2941 token = next_token(&val, NULL, cfile); in parse_non_binary()
2958 skip_token(&val, NULL, cfile); in parse_non_binary()
2961 cfile->issue_counter++; in parse_non_binary()
2964 token = next_token(&val, NULL, cfile); in parse_non_binary()
2969 if (!parse_numeric_expression(arg, cfile, lose)) in parse_non_binary()
2973 token = next_token(&val, NULL, cfile); in parse_non_binary()
2978 if (!parse_numeric_expression(arg, cfile, lose)) in parse_non_binary()
2982 token = next_token(&val, NULL, cfile); in parse_non_binary()
2987 if (!parse_data_expression(arg, cfile, lose)) in parse_non_binary()
2991 token = next_token(&val, NULL, cfile); in parse_non_binary()
2996 if (!parse_data_expression(arg, cfile, lose)) in parse_non_binary()
3000 token = next_token(&val, NULL, cfile); in parse_non_binary()
3006 skip_token(&val, NULL, cfile); in parse_non_binary()
3009 cfile->issue_counter++; in parse_non_binary()
3012 token = next_token(&val, NULL, cfile); in parse_non_binary()
3017 if (!(parse_numeric_expression(arg, cfile, lose))) in parse_non_binary()
3021 token = next_token(&val, NULL, cfile); in parse_non_binary()
3026 if (!(parse_data_expression(arg, cfile, lose))) in parse_non_binary()
3030 token = next_token(&val, NULL, cfile); in parse_non_binary()
3038 skip_token(&val, NULL, cfile); in parse_non_binary()
3041 cfile->issue_counter++; in parse_non_binary()
3044 token = next_token(&val, NULL, cfile); in parse_non_binary()
3050 if (!(parse_data_expression(arg, cfile, lose))) in parse_non_binary()
3054 token = next_token(&val, NULL, cfile); in parse_non_binary()
3063 skip_token(&val, NULL, cfile); in parse_non_binary()
3065 option = parse_option_name(cfile, ISC_FALSE, &known); in parse_non_binary()
3079 cfile->issue_counter++; in parse_non_binary()
3085 TAILQ_CONCAT(&nexp->comments, &cfile->comments); in parse_non_binary()
3091 skip_token(&val, NULL, cfile); in parse_non_binary()
3094 cfile->issue_counter++; in parse_non_binary()
3099 skip_token(&val, NULL, cfile); in parse_non_binary()
3102 cfile->issue_counter++; in parse_non_binary()
3107 skip_token(&val, NULL, cfile); in parse_non_binary()
3110 cfile->issue_counter++; in parse_non_binary()
3115 skip_token(&val, NULL, cfile); in parse_non_binary()
3118 cfile->issue_counter++; in parse_non_binary()
3123 skip_token(&val, NULL, cfile); in parse_non_binary()
3126 cfile->issue_counter++; in parse_non_binary()
3131 skip_token(&val, NULL, cfile); in parse_non_binary()
3134 cfile->issue_counter++; in parse_non_binary()
3139 skip_token(&val, NULL, cfile); in parse_non_binary()
3143 cfile->issue_counter++; in parse_non_binary()
3148 skip_token(&val, NULL, cfile); in parse_non_binary()
3151 cfile->issue_counter++; in parse_non_binary()
3156 skip_token(&val, NULL, cfile); in parse_non_binary()
3159 cfile->issue_counter++; in parse_non_binary()
3162 token = next_token(&val, NULL, cfile); in parse_non_binary()
3167 if (!parse_numeric_expression(arg, cfile, lose)) in parse_non_binary()
3171 token = next_token(&val, NULL, cfile); in parse_non_binary()
3176 if (!parse_numeric_expression(arg, cfile, lose)) in parse_non_binary()
3180 token = next_token(&val, NULL, cfile); in parse_non_binary()
3186 skip_token(&val, &len, cfile); in parse_non_binary()
3191 skip_token(&val, NULL, cfile); in parse_non_binary()
3194 cfile->issue_counter++; in parse_non_binary()
3196 token = next_token(&val, NULL, cfile); in parse_non_binary()
3198 parse_error(cfile, "left parenthesis expected."); in parse_non_binary()
3200 if (!parse_data_expression(nexp, cfile, lose)) { in parse_non_binary()
3202 parse_error(cfile, in parse_non_binary()
3207 token = next_token(&val, NULL, cfile); in parse_non_binary()
3209 parse_error(cfile, "comma expected."); in parse_non_binary()
3211 token = next_token(&val, NULL, cfile); in parse_non_binary()
3213 parse_error(cfile, "number expected."); in parse_non_binary()
3228 parse_error(cfile, "unsupported integer size %s", val); in parse_non_binary()
3231 token = next_token(&val, NULL, cfile); in parse_non_binary()
3233 parse_error(cfile, "right parenthesis expected."); in parse_non_binary()
3237 skip_token(&val, NULL, cfile); in parse_non_binary()
3240 cfile->issue_counter++; in parse_non_binary()
3242 token = next_token(&val, NULL, cfile); in parse_non_binary()
3244 parse_error(cfile, "left parenthesis expected."); in parse_non_binary()
3246 if (!parse_numeric_expression(nexp, cfile, lose)) in parse_non_binary()
3247 parse_error(cfile, "expecting numeric expression."); in parse_non_binary()
3249 token = next_token(&val, NULL, cfile); in parse_non_binary()
3251 parse_error(cfile, "comma expected."); in parse_non_binary()
3253 token = next_token(&val, NULL, cfile); in parse_non_binary()
3255 parse_error(cfile, "number expected."); in parse_non_binary()
3270 parse_error(cfile, "unsupported integer size %s", val); in parse_non_binary()
3273 token = next_token(&val, NULL, cfile); in parse_non_binary()
3275 parse_error(cfile, "right parenthesis expected."); in parse_non_binary()
3283 skip_token(&val, NULL, cfile); in parse_non_binary()
3292 mapSet(expr, createHexa(parse_hexa(cfile)), "const-data"); in parse_non_binary()
3296 skip_token(&val, NULL, cfile); in parse_non_binary()
3306 skip_token(&val, NULL, cfile); in parse_non_binary()
3316 skip_token(&val, NULL, cfile); in parse_non_binary()
3326 skip_token(&val, NULL, cfile); in parse_non_binary()
3336 skip_token(&val, NULL, cfile); in parse_non_binary()
3346 skip_token(&val, NULL, cfile); in parse_non_binary()
3356 skip_token(&val, NULL, cfile); in parse_non_binary()
3366 skip_token(&val, NULL, cfile); in parse_non_binary()
3376 skip_token(&val, NULL, cfile); in parse_non_binary()
3386 skip_token(&val, NULL, cfile); in parse_non_binary()
3396 skip_token(&val, NULL, cfile); in parse_non_binary()
3406 skip_token(&val, NULL, cfile); in parse_non_binary()
3416 skip_token(&val, NULL, cfile); in parse_non_binary()
3426 skip_token(&val, NULL, cfile); in parse_non_binary()
3436 skip_token(&val, NULL, cfile); in parse_non_binary()
3446 skip_token(&val, NULL, cfile); in parse_non_binary()
3456 skip_token(&val, NULL, cfile); in parse_non_binary()
3466 skip_token(&val, NULL, cfile); in parse_non_binary()
3476 skip_token(&val, NULL, cfile); in parse_non_binary()
3477 token = next_token(&val, NULL, cfile); in parse_non_binary()
3481 token = next_token(&val, NULL, cfile); in parse_non_binary()
3483 parse_error(cfile, "%s can't be a variable name", val); in parse_non_binary()
3487 cfile->issue_counter++; in parse_non_binary()
3489 token = next_token(&val, NULL, cfile); in parse_non_binary()
3496 skip_token(&val, NULL, cfile); in parse_non_binary()
3499 cfile->issue_counter++; in parse_non_binary()
3502 token = next_token(NULL, NULL, cfile); in parse_non_binary()
3506 token = next_token(NULL, NULL, cfile); in parse_non_binary()
3512 skip_token(&val, NULL, cfile); in parse_non_binary()
3513 token = next_token(NULL, NULL, cfile); in parse_non_binary()
3518 token = next_token(&val, NULL, cfile); in parse_non_binary()
3520 parse_error(cfile, "Expecting quoted literal: " in parse_non_binary()
3524 cfile->issue_counter++; in parse_non_binary()
3527 token = next_token(NULL, NULL, cfile); in parse_non_binary()
3533 skip_token(&val, NULL, cfile); in parse_non_binary()
3536 cfile->issue_counter++; in parse_non_binary()
3539 token = next_token(&val, NULL, cfile); in parse_non_binary()
3544 if (!parse_numeric_expression(arg, cfile, lose)) in parse_non_binary()
3548 token = next_token(&val, NULL, cfile); in parse_non_binary()
3553 if (!parse_data_expression(arg, cfile, lose)) in parse_non_binary()
3557 token = next_token(&val, NULL, cfile); in parse_non_binary()
3568 skip_token(&val, NULL, cfile); in parse_non_binary()
3574 token = peek_token(&val, NULL, cfile); in parse_non_binary()
3578 cfile->issue_counter++; in parse_non_binary()
3583 skip_token(&val, NULL, cfile); in parse_non_binary()
3586 cfile->issue_counter++; in parse_non_binary()
3595 if (!parse_expression(arg, cfile, lose, context_any, in parse_non_binary()
3598 parse_error(cfile, in parse_non_binary()
3600 skip_to_semi(cfile); in parse_non_binary()
3604 token = next_token(&val, NULL, cfile); in parse_non_binary()
3607 parse_error(cfile, "Right parenthesis expected."); in parse_non_binary()
3617 parse_expression(struct element *expr, struct parse *cfile, in parse_expression() argument
3632 if (!parse_non_binary(rhs, cfile, lose, context)) { in parse_expression()
3638 parse_error(cfile, in parse_expression()
3647 token = peek_token(&val, NULL, cfile); in parse_expression()
3650 skip_token(&val, NULL, cfile); in parse_expression()
3651 token = peek_token(&val, NULL, cfile); in parse_expression()
3653 parse_error(cfile, "! in boolean context without ="); in parse_expression()
3664 skip_token(&val, NULL, cfile); in parse_expression()
3665 token = peek_token(&val, NULL, cfile); in parse_expression()
3672 parse_error(cfile, "expecting ~= or ~~ operator"); in parse_expression()
3743 skip_token(&val, NULL, cfile); in parse_expression()
3758 skip_token(&val, NULL, cfile); in parse_expression()
3763 if (!parse_expression(rhs, cfile, lose, op_context(next_op), in parse_expression()
3766 parse_error(cfile, in parse_expression()
3781 parse_error(cfile, "illegal expression relating " in parse_expression()
3795 parse_error(cfile, "expecting data/numeric " in parse_expression()
3806 parse_error(cfile, in parse_expression()
3818 parse_error(cfile, in parse_expression()
3849 parse_error(cfile, in parse_expression()
3874 skip_token(&val, NULL, cfile); in parse_expression()
3930 struct parse *cfile, in parse_option_data() argument
3948 save_parse_state(cfile); in parse_option_data()
3950 token = next_raw_token(&val, &len, cfile); in parse_option_data()
3961 restore_parse_state(cfile); in parse_option_data()
3972 parse_error(cfile, "unknown format for option %s.%s\n", in parse_option_data()
3978 return parse_option_binary(expr, cfile, option, ISC_FALSE); in parse_option_data()
3981 parse_error(cfile, "unsupported format %s for option %s.%s\n", in parse_option_data()
3986 save_parse_state(cfile); in parse_option_data()
3998 item = parse_option_token(cfile, fmt, &require_binary, in parse_option_data()
4003 restore_parse_state(cfile); in parse_option_data()
4004 return parse_option_binary(expr, cfile, option, in parse_option_data()
4008 parse_error(cfile, "parse_option_data failed"); in parse_option_data()
4014 token = peek_token(&val, NULL, cfile); in parse_option_data()
4017 skip_token(&val, NULL, cfile); in parse_option_data()
4047 parse_option_binary(struct element *expr, struct parse *cfile, in parse_option_binary() argument
4092 token = peek_token(&val, NULL, cfile); in parse_option_binary()
4099 item = parse_option_token_binary(cfile, fmt); in parse_option_binary()
4104 parse_error(cfile, in parse_option_binary()
4116 parse_error(cfile, in parse_option_binary()
4125 parse_error(cfile, "parse_option_token_binary " in parse_option_binary()
4131 token = peek_token(&val, NULL, cfile); in parse_option_binary()
4134 skip_token(&val, NULL, cfile); in parse_option_binary()
4161 cfile->issue_counter++; in parse_option_binary()
4169 parse_option_textbin(struct parse *cfile, struct option *option) in parse_option_textbin() argument
4179 parse_error(cfile, "unknown format for option %s.%s\n", in parse_option_textbin()
4183 if (!parse_option_binary(expr, cfile, option, ISC_FALSE)) in parse_option_textbin()
4184 parse_error(cfile, "can't parse binary option data"); in parse_option_textbin()
4187 parse_error(cfile, "can't get binary option data"); in parse_option_textbin()
4189 parse_error(cfile, "option data must be binary"); in parse_option_textbin()
4193 if (!parse_option_data(expr, cfile, option)) in parse_option_textbin()
4194 parse_error(cfile, "can't parse text option data"); in parse_option_textbin()
4197 parse_error(cfile, "can't get test option data"); in parse_option_textbin()
4199 parse_error(cfile, "option data must be a string"); in parse_option_textbin()
4212 struct parse *cfile, in parse_option_statement() argument
4225 return parse_config_statement(result, cfile, option, op); in parse_option_statement()
4228 TAILQ_CONCAT(&opt_data->comments, &cfile->comments); in parse_option_statement()
4235 cfile->issue_counter++; in parse_option_statement()
4294 token = peek_token(&val, NULL, cfile); in parse_option_statement()
4304 skip_token(&val, NULL, cfile); in parse_option_statement()
4310 skip_token(&val, NULL, cfile); in parse_option_statement()
4314 if (!parse_data_expression(expr, cfile, &lose)) { in parse_option_statement()
4319 parse_error(cfile, in parse_option_statement()
4346 parse_error(cfile, "can't get const-data"); in parse_option_statement()
4352 cfile->issue_counter++; in parse_option_statement()
4356 if (!parse_option_data(opt_data, cfile, option)) in parse_option_statement()
4360 parse_semi(cfile); in parse_option_statement()
4368 for (where = cfile->stack_top; where > 0; --where) { in parse_option_statement()
4369 if (cfile->stack[where]->kind != PARAMETER) in parse_option_statement()
4373 opt_data_list = mapGet(cfile->stack[where], "option-data"); in parse_option_statement()
4376 mapSet(cfile->stack[where], opt_data_list, "option-data"); in parse_option_statement()
4388 parse_option_token(struct parse *cfile, const char *fmt, in parse_option_token() argument
4400 token = next_token(&val, &len, cfile); in parse_option_token()
4402 parse_error(cfile, "expecting identifier."); in parse_option_token()
4405 token = peek_token(&val, NULL, cfile); in parse_option_token()
4410 token = next_token(&val, &len, cfile); in parse_option_token()
4412 parse_error(cfile, "expecting string " in parse_option_token()
4418 token = peek_token(&val, NULL, cfile); in parse_option_token()
4420 return parse_hexa(cfile); in parse_option_token()
4422 token = next_token(&val, &len, cfile); in parse_option_token()
4424 parse_error(cfile, "expecting string " in parse_option_token()
4430 return parse_domain_list(cfile, ISC_FALSE); in parse_option_token()
4434 item = parse_host_name(cfile); in parse_option_token()
4436 parse_error(cfile, "not a valid domain name."); in parse_option_token()
4440 token = next_token(&val, &len, cfile); in parse_option_token()
4442 parse_error(cfile, "expecting string."); in parse_option_token()
4449 return parse_ip_addr_or_hostname(cfile, ISC_FALSE); in parse_option_token()
4453 return parse_ip6_addr_txt(cfile); in parse_option_token()
4456 token = next_token(&val, NULL, cfile); in parse_option_token()
4467 token = next_token(&val, NULL, cfile); in parse_option_token()
4470 parse_error(cfile, "expecting number."); in parse_option_token()
4477 token = next_token(&val, NULL, cfile); in parse_option_token()
4479 parse_error(cfile, "expecting identifier."); in parse_option_token()
4494 parse_error(cfile, "expecting boolean."); in parse_option_token()
4497 token = peek_token(&val, NULL, cfile); in parse_option_token()
4499 parse_error(cfile, "semicolon expected."); in parse_option_token()
4503 parse_error(cfile, "Bad format '%c' in parse_option_token.", in parse_option_token()
4511 parse_option_token_binary(struct parse *cfile, const char *fmt) in parse_option_token_binary() argument
4521 token = next_token(&val, &len, cfile); in parse_option_token_binary()
4525 parse_error(cfile, "expecting identifier."); in parse_option_token_binary()
4532 token = peek_token(&val, NULL, cfile); in parse_option_token_binary()
4534 return parse_hexa(cfile); in parse_option_token_binary()
4535 token = next_token(&val, &len, cfile); in parse_option_token_binary()
4539 parse_error(cfile, "expecting string " in parse_option_token_binary()
4545 item = parse_domain_list(cfile, ISC_TRUE); in parse_option_token_binary()
4549 parse_error(cfile, "parse_domain_list failed"); in parse_option_token_binary()
4554 item = parse_host_name(cfile); in parse_option_token_binary()
4556 parse_error(cfile, "not a valid domain name."); in parse_option_token_binary()
4559 parse_error(cfile, "too long domain name."); in parse_option_token_binary()
4563 token = next_token(&val, &len, cfile); in parse_option_token_binary()
4567 parse_error(cfile, "expecting string."); in parse_option_token_binary()
4572 item = parse_ip_addr_or_hostname(cfile, ISC_FALSE); in parse_option_token_binary()
4576 item = parse_ip6_addr(cfile); in parse_option_token_binary()
4580 token = next_token(&val, NULL, cfile); in parse_option_token_binary()
4587 token = next_token(&val, NULL, cfile); in parse_option_token_binary()
4593 parse_error(cfile, "expecting number."); in parse_option_token_binary()
4595 convert_num(cfile, buf, val, 0, 32); in parse_option_token_binary()
4600 token = next_token(&val, NULL, cfile); in parse_option_token_binary()
4603 convert_num(cfile, buf, val, 0, 16); in parse_option_token_binary()
4608 token = next_token(&val, NULL, cfile); in parse_option_token_binary()
4611 convert_num(cfile, buf, val, 0, 8); in parse_option_token_binary()
4615 token = next_token(&val, NULL, cfile); in parse_option_token_binary()
4619 parse_error(cfile, "expecting identifier."); in parse_option_token_binary()
4631 parse_error(cfile, "expecting boolean."); in parse_option_token_binary()
4634 token = peek_token(&val, NULL, cfile); in parse_option_token_binary()
4636 parse_error(cfile, "semicolon expected."); in parse_option_token_binary()
4640 parse_error(cfile, "Bad format '%c' in parse_option_token.", in parse_option_token_binary()
4646 parse_domain_list(struct parse *cfile, isc_boolean_t binary) in parse_domain_list() argument
4659 skip_token(&val, NULL, cfile); in parse_domain_list()
4665 token = next_token(&val, &len, cfile); in parse_domain_list()
4668 parse_error(cfile, "Expecting a domain string."); in parse_domain_list()
4676 parse_error(cfile, "not a valid domain name."); in parse_domain_list()
4682 token = peek_token(&val, NULL, cfile); in parse_domain_list()
4693 struct parse *cfile, in parse_config_data() argument
4705 token = peek_token(&val, NULL, cfile); in parse_config_data()
4708 parse_error(cfile, "unexpected end of file"); in parse_config_data()
4710 parse_error(cfile, "empty config option"); in parse_config_data()
4712 parse_error(cfile, "multiple value config option"); in parse_config_data()
4718 token = next_token(&val, &len, cfile); in parse_config_data()
4720 parse_error(cfile, "expecting identifier."); in parse_config_data()
4725 token = next_token(&val, &len, cfile); in parse_config_data()
4727 data = parse_cshl(cfile); in parse_config_data()
4731 parse_error(cfile, "expecting string " in parse_config_data()
4737 data = parse_host_name(cfile); in parse_config_data()
4739 parse_error(cfile, "not a valid domain name."); in parse_config_data()
4744 token = next_token(&val, &len, cfile); in parse_config_data()
4749 token = next_token(&val, &len, cfile); in parse_config_data()
4751 parse_error(cfile, "identifier expected"); in parse_config_data()
4756 data = parse_ip_addr_or_hostname(cfile, ISC_FALSE); in parse_config_data()
4758 parse_error(cfile, "expecting IP address of hostname"); in parse_config_data()
4763 data = parse_ip6_addr_txt(cfile); in parse_config_data()
4765 parse_error(cfile, "expecting IPv6 address"); in parse_config_data()
4770 token = next_token(&val, NULL, cfile); in parse_config_data()
4777 token = next_token(&val, NULL, cfile); in parse_config_data()
4780 parse_error(cfile, "expecting number."); in parse_config_data()
4781 convert_num(cfile, (unsigned char *)&u32, val, 0, 32); in parse_config_data()
4786 token = next_token(&val, NULL, cfile); in parse_config_data()
4788 parse_error(cfile, "expecting number."); in parse_config_data()
4789 convert_num(cfile, (unsigned char *)&u16, val, 0, 16); in parse_config_data()
4794 token = next_token(&val, NULL, cfile); in parse_config_data()
4796 parse_error(cfile, "expecting number."); in parse_config_data()
4797 convert_num(cfile, (unsigned char *)&u8, val, 0, 8); in parse_config_data()
4802 token = next_token(&val, NULL, cfile); in parse_config_data()
4804 parse_error(cfile, "expecting boolean."); in parse_config_data()
4815 parse_error(cfile, "expecting boolean."); in parse_config_data()
4819 parse_error(cfile, "Bad format '%c' in parse_config_data.", in parse_config_data()
4832 struct parse *cfile, in parse_config_statement() argument
4846 TAILQ_CONCAT(&config->comments, &cfile->comments); in parse_config_statement()
4853 cfile->issue_counter++; in parse_config_statement()
4886 token = peek_token(&val, NULL, cfile); in parse_config_statement()
4896 skip_token(&val, NULL, cfile); in parse_config_statement()
4899 skip_token(&val, NULL, cfile); in parse_config_statement()
4903 if (!parse_data_expression(expr, cfile, &lose)) { in parse_config_statement()
4908 parse_error(cfile, in parse_config_statement()
4914 if (!parse_config_data(config, cfile, option)) in parse_config_statement()
4918 parse_semi(cfile); in parse_config_statement()
4926 for (where = cfile->stack_top; where > 0; --where) { in parse_config_statement()
4927 if ((cfile->stack[where]->kind == PARAMETER) || in parse_config_statement()
4928 (cfile->stack[where]->kind == POOL_DECL)) in parse_config_statement()
4934 config_list = mapGet(cfile->stack[where], "config"); in parse_config_statement()
4938 mapSet(cfile->stack[where], config_list, "config"); in parse_config_statement()
4948 config_def_valid_lifetime(config, cfile); in parse_config_statement()
4951 config_max_valid_lifetime(config, cfile); in parse_config_statement()
4954 config_min_valid_lifetime(config, cfile); in parse_config_statement()
4957 config_file(config, cfile); in parse_config_statement()
4960 config_sname(config, cfile); in parse_config_statement()
4963 config_next_server(config, cfile); in parse_config_statement()
4966 parse_error(cfile, "authoritative is a statement, " in parse_config_statement()
4969 config_vendor_option_space(config, cfile); in parse_config_statement()
4972 config_site_option_space(config, cfile); in parse_config_statement()
4975 config_qualifying_suffix(config, cfile); in parse_config_statement()
4978 config_enable_updates(config, cfile); in parse_config_statement()
4981 config_ddns_update_style(config, cfile); in parse_config_statement()
4984 config_preferred_lifetime(config, cfile); in parse_config_statement()
4987 config_match_client_id(config, cfile); in parse_config_statement()
4990 config_echo_client_id(config, cfile); in parse_config_statement()
4993 parse_error(cfile, "unsupported config option %s (%u)", in parse_config_statement()
5001 config_def_valid_lifetime(struct element *config, struct parse *cfile) in config_def_valid_lifetime() argument
5010 for (scope = cfile->stack_top; scope > 0; --scope) { in config_def_valid_lifetime()
5011 int kind = cfile->stack[scope]->kind; in config_def_valid_lifetime()
5028 cfile->issue_counter++; in config_def_valid_lifetime()
5036 mapSet(cfile->stack[scope], value, "valid-lifetime"); in config_def_valid_lifetime()
5040 config_min_valid_lifetime(struct element *config, struct parse *cfile) in config_min_valid_lifetime() argument
5049 for (scope = cfile->stack_top; scope > 0; --scope) { in config_min_valid_lifetime()
5050 int kind = cfile->stack[scope]->kind; in config_min_valid_lifetime()
5067 cfile->issue_counter++; in config_min_valid_lifetime()
5075 mapSet(cfile->stack[scope], value, "min-valid-lifetime"); in config_min_valid_lifetime()
5079 config_max_valid_lifetime(struct element *config, struct parse *cfile) in config_max_valid_lifetime() argument
5088 for (scope = cfile->stack_top; scope > 0; --scope) { in config_max_valid_lifetime()
5089 int kind = cfile->stack[scope]->kind; in config_max_valid_lifetime()
5106 cfile->issue_counter++; in config_max_valid_lifetime()
5114 mapSet(cfile->stack[scope], value, "max-valid-lifetime"); in config_max_valid_lifetime()
5118 config_file(struct element *config, struct parse *cfile) in config_file() argument
5126 parse_error(cfile, "boot-file-name is DHCPv4 only"); in config_file()
5130 for (scope = cfile->stack_top; scope > 0; --scope) { in config_file()
5131 int kind = cfile->stack[scope]->kind; in config_file()
5149 cfile->issue_counter++; in config_file()
5151 mapSet(cfile->stack[scope], value, "boot-file-name"); in config_file()
5155 config_sname(struct element *config, struct parse *cfile) in config_sname() argument
5163 parse_error(cfile, "server-hostname is DHCPv4 only"); in config_sname()
5167 for (scope = cfile->stack_top; scope > 0; --scope) { in config_sname()
5168 int kind = cfile->stack[scope]->kind; in config_sname()
5186 cfile->issue_counter++; in config_sname()
5188 mapSet(cfile->stack[scope], value, "server-hostname"); in config_sname()
5192 config_next_server(struct element *config, struct parse *cfile) in config_next_server() argument
5200 parse_error(cfile, "next-server is DHCPv4 only"); in config_next_server()
5204 for (scope = cfile->stack_top; scope > 0; --scope) { in config_next_server()
5205 int kind = cfile->stack[scope]->kind; in config_next_server()
5222 mapSet(cfile->stack[scope], value, "next-server"); in config_next_server()
5226 config_vendor_option_space(struct element *config, struct parse *cfile) in config_vendor_option_space() argument
5235 parse_error(cfile, "vendor-option-space is DHCPv4 only"); in config_vendor_option_space()
5246 parse_error(cfile, "vendor-option-space has no value"); in config_vendor_option_space()
5248 parse_error(cfile, in config_vendor_option_space()
5253 defs = mapGet(cfile->stack[cfile->stack_top], "option-def"); in config_vendor_option_space()
5256 mapSet(cfile->stack[cfile->stack_top], defs, "option-def"); in config_vendor_option_space()
5289 opts = mapGet(cfile->stack[cfile->stack_top], "option-data"); in config_vendor_option_space()
5292 mapSet(cfile->stack[cfile->stack_top], opts, "option-data"); in config_vendor_option_space()
5298 config_site_option_space(struct element *config, struct parse *cfile) in config_site_option_space() argument
5306 parse_error(cfile, "site-option-space is DHCPv4 only"); in config_site_option_space()
5310 parse_error(cfile, "site-option-space has no value"); in config_site_option_space()
5312 parse_error(cfile, "site-option-space value is not a string"); in config_site_option_space()
5314 defs = mapGet(cfile->stack[cfile->stack_top], "option-def"); in config_site_option_space()
5317 mapSet(cfile->stack[cfile->stack_top], defs, "option-def"); in config_site_option_space()
5351 config_qualifying_suffix(struct element *config, struct parse *cfile) in config_qualifying_suffix() argument
5358 for (scope = cfile->stack_top; scope > 0; --scope) in config_qualifying_suffix()
5359 if ((cfile->stack[scope]->kind != PARAMETER) || in config_qualifying_suffix()
5360 (cfile->stack[scope]->kind != POOL_DECL)) in config_qualifying_suffix()
5362 if (cfile->stack[scope]->kind != ROOT_GROUP) { in config_qualifying_suffix()
5369 cfile->issue_counter++; in config_qualifying_suffix()
5370 mapSet(cfile->stack[scope], value, "qualifying-suffix"); in config_qualifying_suffix()
5374 d2 = mapGet(cfile->stack[1], "dhcp-ddns"); in config_qualifying_suffix()
5378 mapSet(cfile->stack[1], d2, "dhcp-ddns"); in config_qualifying_suffix()
5386 config_enable_updates(struct element *config, struct parse *cfile) in config_enable_updates() argument
5393 for (scope = cfile->stack_top; scope > 0; --scope) in config_enable_updates()
5394 if ((cfile->stack[scope]->kind != PARAMETER) || in config_enable_updates()
5395 (cfile->stack[scope]->kind != POOL_DECL)) in config_enable_updates()
5397 if (cfile->stack[scope]->kind != ROOT_GROUP) { in config_enable_updates()
5404 cfile->issue_counter++; in config_enable_updates()
5405 mapSet(cfile->stack[scope], value, "enable-updates"); in config_enable_updates()
5409 d2 = mapGet(cfile->stack[1], "dhcp-ddns"); in config_enable_updates()
5412 mapSet(cfile->stack[1], d2, "dhcp-ddns"); in config_enable_updates()
5426 config_ddns_update_style(struct element *config, struct parse *cfile) in config_ddns_update_style() argument
5441 for (scope = cfile->stack_top; scope > 0; --scope) in config_ddns_update_style()
5442 if ((cfile->stack[scope]->kind != PARAMETER) || in config_ddns_update_style()
5443 (cfile->stack[scope]->kind != POOL_DECL)) in config_ddns_update_style()
5450 cfile->issue_counter++; in config_ddns_update_style()
5451 mapSet(cfile->stack[scope], value, "ddns-update-style"); in config_ddns_update_style()
5454 for (scope = cfile->stack_top; scope > 0; --scope) in config_ddns_update_style()
5455 if ((cfile->stack[scope]->kind != PARAMETER) || in config_ddns_update_style()
5456 (cfile->stack[scope]->kind != POOL_DECL)) in config_ddns_update_style()
5458 if (cfile->stack[scope]->kind != ROOT_GROUP) { in config_ddns_update_style()
5465 cfile->issue_counter++; in config_ddns_update_style()
5466 mapSet(cfile->stack[scope], value, "ddns-update-style"); in config_ddns_update_style()
5472 d2 = mapGet(cfile->stack[1], "dhcp-ddns"); in config_ddns_update_style()
5475 mapSet(cfile->stack[1], d2, "dhcp-ddns"); in config_ddns_update_style()
5489 config_preferred_lifetime(struct element *config, struct parse *cfile) in config_preferred_lifetime() argument
5498 parse_error(cfile, "preferred-lifetime is DHCPv6 only"); in config_preferred_lifetime()
5502 for (scope = cfile->stack_top; scope > 0; --scope) { in config_preferred_lifetime()
5503 int kind = cfile->stack[scope]->kind; in config_preferred_lifetime()
5520 cfile->issue_counter++; in config_preferred_lifetime()
5529 if (mapContains(cfile->stack[scope], "preferred-lifetime")) { in config_preferred_lifetime()
5536 mapSet(cfile->stack[scope], value, "preferred-lifetime"); in config_preferred_lifetime()
5540 mapSet(cfile->stack[scope], child, "renew-timer"); in config_preferred_lifetime()
5543 mapSet(cfile->stack[scope], child, "rebind-timer"); in config_preferred_lifetime()
5547 config_match_client_id(struct element *config, struct parse *cfile) in config_match_client_id() argument
5555 parse_error(cfile, "ignore-client-uids is DHCPv4 only"); in config_match_client_id()
5561 for (scope = cfile->stack_top; scope > 0; --scope) { in config_match_client_id()
5562 int kind = cfile->stack[scope]->kind; in config_match_client_id()
5579 cfile->issue_counter++; in config_match_client_id()
5587 mapSet(cfile->stack[scope], value, "match-client-id"); in config_match_client_id()
5591 config_echo_client_id(struct element *config, struct parse *cfile) in config_echo_client_id() argument
5598 parse_error(cfile, "echo-client-id is DHCPv4 only"); in config_echo_client_id()
5602 for (scope = cfile->stack_top; scope > 0; --scope) { in config_echo_client_id()
5603 int kind = cfile->stack[scope]->kind; in config_echo_client_id()
5613 cfile->issue_counter++; in config_echo_client_id()
5615 mapSet(cfile->stack[scope], value, "echo-client-id"); in config_echo_client_id()