32 static int get_char (
struct parse *);
33 static void unget_char(
struct parse *,
int);
34 static void skip_to_eol (
struct parse *);
49 isc_result_t status = ISC_R_SUCCESS;
54 return (ISC_R_NOMEMORY);
77 if (fstat(file, &sb) < 0) {
78 status = ISC_R_IOERROR;
86 tmp->
inbuf = mmap(NULL, tmp->
bufsiz, PROT_READ, MAP_SHARED,
89 if (tmp->
inbuf == MAP_FAILED) {
90 status = ISC_R_IOERROR;
96 return (ISC_R_SUCCESS);
104 struct
parse **cfile;
107 if ((*cfile)->file != -1) {
108 munmap((*cfile)->inbuf, (*cfile)->bufsiz);
109 close((*cfile)->file);
112 if ((*cfile)->saved_state != NULL) {
118 return ISC_R_SUCCESS;
141 return ISC_R_NOMEMORY;
144 return ISC_R_SUCCESS;
161 #if defined(LDAP_CONFIGURATION) 163 size_t size = cfile->
bufsiz;
171 memcpy(cfile, saved_state,
sizeof(*cfile));
175 #if defined(LDAP_CONFIGURATION) 179 return ISC_R_SUCCESS;
182 static int get_char (cfile)
189 #if !defined(LDAP_CONFIGURATION) 192 if (cfile->read_function != NULL)
193 c = cfile->read_function(cfile);
214 }
else if (c != EOF) {
215 if (cfile->
lpos <= 80) {
230 unget_char(
struct parse *cfile,
int c) {
261 get_raw_token(
struct parse *cfile) {
271 c = get_char (cfile);
272 if (!((c ==
'\n') && cfile->
eol_token) &&
273 isascii(c) && isspace(c)) {
274 ttok = read_whitespace(c, cfile);
284 ttok = read_string (cfile);
287 if ((isascii (c) && isdigit (c)) || c ==
'-') {
290 ttok = read_number (c, cfile);
292 }
else if (isascii (c) && isalpha (c)) {
295 ttok = read_num_or_name (c, cfile);
297 }
else if (c == EOF) {
324 get_next_token(
const char **rval,
unsigned *rlen,
325 struct parse *cfile, isc_boolean_t raw) {
328 if (cfile ->
token) {
336 rv = get_raw_token(cfile);
342 rv = get_raw_token(cfile);
348 *rval = cfile ->
tval;
350 *rlen = cfile ->
tlen;
352 fprintf (stderr,
"%s:%d ", cfile ->
tval, rv);
370 return get_next_token(rval, rlen, cfile, ISC_FALSE);
381 return get_next_token(rval, rlen, cfile, ISC_TRUE);
396 struct parse *cfile, isc_boolean_t raw) {
404 cfile->
token = get_raw_token(cfile);
419 *rval = cfile ->
tval;
421 *rlen = cfile ->
tlen;
423 fprintf (stderr,
"(%s:%d) ", cfile ->
tval, cfile ->
token);
425 return cfile ->
token;
458 static void skip_to_eol (cfile)
463 c = get_char (cfile);
473 read_whitespace(
int c,
struct parse *cfile) {
481 if (ofs >= (
sizeof(cfile->
tokbuf) - 1)) {
488 "whitespace too long, buffer overflow.");
495 }
while (!((c ==
'\n') && cfile->
eol_token) &&
496 isascii(c) && isspace(c));
501 unget_char(cfile, c);
506 cfile->
tokbuf[ofs] =
'\0';
521 for (i = 0; i <
sizeof cfile ->
tokbuf; i++) {
523 c = get_char (cfile);
531 cfile ->
tokbuf [i] =
'\t';
534 cfile ->
tokbuf [i] =
'\r';
537 cfile ->
tokbuf [i] =
'\n';
540 cfile ->
tokbuf [i] =
'\b';
562 if (c >=
'0' && c <=
'9') {
563 value = value * 16 + (c -
'0');
564 }
else if (c >=
'a' && c <=
'f') {
565 value = value * 16 + (c -
'a' + 10);
566 }
else if (c >=
'A' && c <=
'F') {
567 value = value * 16 + (c -
'A' + 10);
570 "invalid hex digit: %x",
576 cfile ->
tokbuf [i] = value;
581 if (c >=
'0' && c <=
'7') {
582 value = value * 8 + (c -
'0');
586 "invalid octal digit %x",
594 cfile ->
tokbuf [i] = value;
599 }
else if (c ==
'\\') {
609 if (i ==
sizeof cfile ->
tokbuf) {
611 "string constant larger than internal buffer");
627 cfile ->
tokbuf [i++] = c;
628 for (; i <
sizeof cfile ->
tokbuf; i++) {
629 c = get_char (cfile);
636 switch(isascii(c) ? token :
BREAK) {
648 if((i == 2) && isxdigit(c) &&
649 (cfile->
tokbuf[0] ==
'0') &&
650 ((cfile->
tokbuf[1] ==
'x') ||
651 (cfile->
tokbuf[1] ==
'X'))) {
654 }
else if(((c ==
'-') || (c ==
'_') || isalnum(c))) {
664 unget_char(cfile, c);
674 if (i ==
sizeof cfile ->
tokbuf) {
676 "numeric token larger than internal buffer");
689 if ((i == 1) && (cfile->
tokbuf[i] ==
'-'))
695 static enum dhcp_token read_num_or_name (c, cfile)
701 cfile ->
tokbuf [i++] = c;
702 for (; i <
sizeof cfile ->
tokbuf; i++) {
703 c = get_char (cfile);
705 (c !=
'-' && c !=
'_' && !isalnum (c))) {
706 unget_char(cfile, c);
713 if (i ==
sizeof cfile ->
tokbuf) {
714 parse_warn (cfile,
"token larger than internal buffer");
720 return intern(cfile->
tval, rv);
725 if (!isascii(atom[0]))
728 switch (tolower((
unsigned char)atom[0])) {
735 if (!strcasecmp(atom + 1,
"bandoned"))
737 if (!strcasecmp(atom + 1,
"ctive"))
739 if (!strncasecmp(atom + 1,
"dd", 2)) {
742 else if (!strcasecmp(atom + 3,
"ress"))
746 if (!strcasecmp(atom + 1,
"fter"))
748 if (isascii(atom[1]) &&
749 (tolower((
unsigned char)atom[1]) ==
'l')) {
750 if (!strcasecmp(atom + 2,
"gorithm"))
752 if (!strcasecmp(atom + 2,
"ias"))
754 if (isascii(atom[2]) &&
755 (tolower((
unsigned char)atom[2]) ==
'l')) {
758 else if (!strcasecmp(atom + 3,
"ow"))
762 if (!strcasecmp(atom + 2,
"so"))
766 if (isascii(atom[1]) &&
767 (tolower((
unsigned char)atom[1]) ==
'n')) {
768 if (!strcasecmp(atom + 2,
"d"))
770 if (!strcasecmp(atom + 2,
"ycast-mac"))
774 if (!strcasecmp(atom + 1,
"ppend"))
776 if (!strcasecmp(atom + 1,
"rray"))
778 if (isascii(atom[1]) &&
779 (tolower((
unsigned char)atom[1]) ==
't')) {
782 if (!strcasecmp(atom + 2,
"sfp"))
786 if (!strncasecmp(atom + 1,
"ut", 2)) {
787 if (isascii(atom[3]) &&
788 (tolower((
unsigned char)atom[3]) ==
'h')) {
789 if (!strncasecmp(atom + 4,
"enticat", 7)) {
790 if (!strcasecmp(atom + 11,
"ed"))
792 if (!strcasecmp(atom + 11,
"ion"))
796 if (!strcasecmp(atom + 4,
"oritative"))
800 if (!strcasecmp(atom + 3,
"o-partner-down"))
806 if (!strcasecmp (atom + 1,
"ackup"))
808 if (!strcasecmp (atom + 1,
"ootp"))
810 if (!strcasecmp (atom + 1,
"inding"))
812 if (!strcasecmp (atom + 1,
"inary-to-ascii"))
814 if (!strcasecmp (atom + 1,
"ackoff-cutoff"))
816 if (!strcasecmp (atom + 1,
"ooting"))
818 if (!strcasecmp (atom + 1,
"oot-unknown-clients"))
820 if (!strcasecmp (atom + 1,
"reak"))
822 if (!strcasecmp (atom + 1,
"illing"))
824 if (!strcasecmp (atom + 1,
"oolean"))
826 if (!strcasecmp (atom + 1,
"alance"))
828 if (!strcasecmp (atom + 1,
"ound"))
830 if (!strcasecmp (atom + 1,
"ootp-broadcast-always"))
834 if (!strcasecmp(atom + 1,
"ase"))
836 if (!strcasecmp(atom + 1,
"heck"))
838 if (!strcasecmp(atom + 1,
"iaddr"))
840 if (isascii(atom[1]) &&
841 tolower((
unsigned char)atom[1]) ==
'l') {
842 if (!strcasecmp(atom + 2,
"ass"))
844 if (!strncasecmp(atom + 2,
"ient", 4)) {
845 if (!strcasecmp(atom + 6,
"s"))
847 if (atom[6] ==
'-') {
848 if (!strcasecmp(atom + 7,
"hostname"))
850 if (!strcasecmp(atom + 7,
"identifier"))
852 if (!strcasecmp(atom + 7,
"state"))
854 if (!strcasecmp(atom + 7,
"updates"))
860 if (!strcasecmp(atom + 2,
"ose"))
862 if (!strcasecmp(atom + 2,
"tt"))
866 if (isascii(atom[1]) &&
867 tolower((
unsigned char)atom[1]) ==
'o') {
868 if (!strcasecmp(atom + 2,
"de"))
870 if (isascii(atom[2]) &&
871 tolower((
unsigned char)atom[2]) ==
'm') {
872 if (!strcasecmp(atom + 3,
"mit"))
874 if (!strcasecmp(atom + 3,
875 "munications-interrupted"))
877 if (!strcasecmp(atom + 3,
"pressed"))
881 if (isascii(atom[2]) &&
882 tolower((
unsigned char)atom[2]) ==
'n') {
883 if (!strcasecmp(atom + 3,
"cat"))
885 if (!strcasecmp(atom + 3,
"fig-option"))
887 if (!strcasecmp(atom + 3,
"flict-done"))
889 if (!strcasecmp(atom + 3,
"nect"))
895 if (!strcasecmp(atom + 1,
"reate"))
899 if (!strcasecmp(atom + 1,
"b-time-format"))
901 if (!strcasecmp (atom + 1,
"omain"))
903 if (!strncasecmp (atom + 1,
"omain-", 6)) {
904 if (!strcasecmp(atom + 7,
"name"))
906 if (!strcasecmp(atom + 7,
"list"))
909 if (!strcasecmp (atom + 1,
"o-forward-updates"))
912 if (!strcasecmp (atom + 1,
"o-forward-update"))
914 if (!strcasecmp (atom + 1,
"ebug"))
916 if (!strcasecmp (atom + 1,
"eny"))
918 if (!strcasecmp (atom + 1,
"eleted"))
920 if (!strcasecmp (atom + 1,
"elete"))
922 if (!strncasecmp (atom + 1,
"efault", 6)) {
925 if (!strcasecmp(atom + 7,
"-duid"))
927 if (!strcasecmp (atom + 7,
"-lease-time"))
931 if (!strncasecmp (atom + 1,
"ynamic", 6)) {
934 if (!strncasecmp (atom + 7,
"-bootp", 6)) {
937 if (!strcasecmp (atom + 13,
"-lease-cutoff"))
939 if (!strcasecmp (atom + 13,
"-lease-length"))
944 if (!strcasecmp (atom + 1,
"uplicates"))
946 if (!strcasecmp (atom + 1,
"eclines"))
948 if (!strncasecmp (atom + 1,
"efine", 5)) {
949 if (!strcasecmp (atom + 6,
"d"))
956 if (isascii (atom [1]) &&
957 tolower((
unsigned char)atom[1]) ==
'x') {
958 if (!strcasecmp (atom + 2,
"tract-int"))
960 if (!strcasecmp (atom + 2,
"ists"))
962 if (!strcasecmp (atom + 2,
"piry"))
964 if (!strcasecmp (atom + 2,
"pire"))
966 if (!strcasecmp (atom + 2,
"pired"))
969 if (!strcasecmp (atom + 1,
"ncode-int"))
971 if (!strcasecmp(atom + 1,
"poch"))
973 if (!strcasecmp (atom + 1,
"thernet"))
975 if (!strcasecmp (atom + 1,
"nds"))
977 if (!strncasecmp (atom + 1,
"ls", 2)) {
978 if (!strcasecmp (atom + 3,
"e"))
980 if (!strcasecmp (atom + 3,
"if"))
984 if (!strcasecmp (atom + 1,
"rror"))
986 if (!strcasecmp (atom + 1,
"val"))
988 if (!strcasecmp (atom + 1,
"ncapsulate"))
990 if (!strcasecmp(atom + 1,
"xecute"))
992 if (!strcasecmp(atom+1,
"n")) {
997 if (!strcasecmp (atom + 1,
"atal"))
999 if (!strcasecmp (atom + 1,
"ilename"))
1001 if (!strcasecmp (atom + 1,
"ixed-address"))
1003 if (!strcasecmp (atom + 1,
"ixed-address6"))
1005 if (!strcasecmp (atom + 1,
"ixed-prefix6"))
1007 if (!strcasecmp (atom + 1,
"ddi"))
1009 if (!strcasecmp (atom + 1,
"ormerr"))
1011 if (!strcasecmp (atom + 1,
"unction"))
1013 if (!strcasecmp (atom + 1,
"ailover"))
1015 if (!strcasecmp (atom + 1,
"ree"))
1019 if (!strncasecmp(atom + 1,
"et", 2)) {
1020 if (!strcasecmp(atom + 3,
"-lease-hostnames"))
1022 if (!strcasecmp(atom + 3,
"hostbyname"))
1024 if (!strcasecmp(atom + 3,
"hostname"))
1028 if (!strcasecmp (atom + 1,
"iaddr"))
1030 if (!strcasecmp (atom + 1,
"roup"))
1034 if (!strcasecmp(atom + 1,
"ash"))
1036 if (!strcasecmp (atom + 1,
"ba"))
1038 if (!strcasecmp (atom + 1,
"ost"))
1040 if (!strcasecmp (atom + 1,
"ost-decl-name"))
1042 if (!strcasecmp(atom + 1,
"ost-identifier"))
1044 if (!strcasecmp (atom + 1,
"ardware"))
1046 if (!strcasecmp (atom + 1,
"ostname"))
1048 if (!strcasecmp (atom + 1,
"elp"))
1052 if (!strcasecmp(atom+1,
"a-na"))
1054 if (!strcasecmp(atom+1,
"a-ta"))
1056 if (!strcasecmp(atom+1,
"a-pd"))
1058 if (!strcasecmp(atom+1,
"aaddr"))
1060 if (!strcasecmp(atom+1,
"aprefix"))
1062 if (!strcasecmp (atom + 1,
"nclude"))
1064 if (!strcasecmp (atom + 1,
"nteger"))
1066 if (!strcasecmp (atom + 1,
"nfiniband"))
1068 if (!strcasecmp (atom + 1,
"nfinite"))
1070 if (!strcasecmp (atom + 1,
"nfo"))
1072 if (!strcasecmp (atom + 1,
"p-address"))
1074 if (!strcasecmp (atom + 1,
"p6-address"))
1076 if (!strcasecmp (atom + 1,
"nitial-interval"))
1078 if (!strcasecmp (atom + 1,
"nitial-delay"))
1080 if (!strcasecmp (atom + 1,
"nterface"))
1082 if (!strcasecmp (atom + 1,
"dentifier"))
1084 if (!strcasecmp (atom + 1,
"f"))
1086 if (!strcasecmp (atom + 1,
"s"))
1088 if (!strcasecmp (atom + 1,
"gnore"))
1092 if (!strncasecmp (atom + 1,
"nown", 4)) {
1093 if (!strcasecmp (atom + 5,
"-clients"))
1099 if (!strcasecmp (atom + 1,
"ey"))
1103 if (!strcasecmp (atom + 1,
"case"))
1105 if (!strcasecmp (atom + 1,
"ease"))
1107 if (!strcasecmp(atom + 1,
"ease6"))
1109 if (!strcasecmp (atom + 1,
"eased-address"))
1111 if (!strcasecmp (atom + 1,
"ease-time"))
1113 if (!strcasecmp(atom + 1,
"easequery"))
1115 if (!strcasecmp(atom + 1,
"ength"))
1117 if (!strcasecmp (atom + 1,
"imit"))
1119 if (!strcasecmp (atom + 1,
"et"))
1121 if (!strcasecmp (atom + 1,
"oad"))
1123 if (!strcasecmp(atom + 1,
"ocal"))
1125 if (!strcasecmp (atom + 1,
"og"))
1127 if (!strcasecmp(atom+1,
"lt")) {
1130 if (!strcasecmp(atom+1,
"l")) {
1135 if (!strncasecmp (atom + 1,
"ax", 2)) {
1138 if (!strcasecmp (atom + 3,
"-balance"))
1140 if (!strncasecmp (atom + 3,
"-lease-", 7)) {
1141 if (!strcasecmp(atom + 10,
"misbalance"))
1143 if (!strcasecmp(atom + 10,
"ownership"))
1145 if (!strcasecmp(atom + 10,
"time"))
1148 if (!strcasecmp(atom + 3,
"-life"))
1150 if (!strcasecmp (atom + 3,
"-transmit-idle"))
1152 if (!strcasecmp (atom + 3,
"-response-delay"))
1154 if (!strcasecmp (atom + 3,
"-unacked-updates"))
1157 if (!strncasecmp (atom + 1,
"in-", 3)) {
1158 if (!strcasecmp (atom + 4,
"balance"))
1160 if (!strcasecmp (atom + 4,
"lease-time"))
1162 if (!strcasecmp (atom + 4,
"secs"))
1166 if (!strncasecmp (atom + 1,
"edi", 3)) {
1167 if (!strcasecmp (atom + 4,
"a"))
1169 if (!strcasecmp (atom + 4,
"um"))
1173 if (!strcasecmp (atom + 1,
"atch"))
1175 if (!strcasecmp (atom + 1,
"embers"))
1177 if (!strcasecmp (atom + 1,
"y"))
1179 if (!strcasecmp (atom + 1,
"clt"))
1183 if (!strcasecmp (atom + 1,
"ormal"))
1185 if (!strcasecmp (atom + 1,
"ameserver"))
1187 if (!strcasecmp (atom + 1,
"etmask"))
1189 if (!strcasecmp (atom + 1,
"ever"))
1191 if (!strcasecmp (atom + 1,
"ext-server"))
1193 if (!strcasecmp (atom + 1,
"ot"))
1195 if (!strcasecmp (atom + 1,
"o"))
1197 if (!strcasecmp (atom + 1,
"oerror"))
1199 if (!strcasecmp (atom + 1,
"otauth"))
1201 if (!strcasecmp (atom + 1,
"otimp"))
1203 if (!strcasecmp (atom + 1,
"otzone"))
1205 if (!strcasecmp (atom + 1,
"xdomain"))
1207 if (!strcasecmp (atom + 1,
"xrrset"))
1209 if (!strcasecmp (atom + 1,
"ull"))
1211 if (!strcasecmp (atom + 1,
"ext"))
1213 if (!strcasecmp (atom + 1,
"ew"))
1217 if (!strcasecmp (atom + 1,
"mapi"))
1219 if (!strcasecmp (atom + 1,
"r"))
1221 if (!strcasecmp (atom + 1,
"n"))
1223 if (!strcasecmp (atom + 1,
"pen"))
1225 if (!strcasecmp (atom + 1,
"ption"))
1227 if (!strcasecmp (atom + 1,
"ne-lease-per-client"))
1229 if (!strcasecmp (atom + 1,
"f"))
1231 if (!strcasecmp (atom + 1,
"wner"))
1235 if (!strcasecmp (atom + 1,
"arse-vendor-option"))
1237 if (!strcasecmp (atom + 1,
"repend"))
1239 if (!strcasecmp(atom + 1,
"referred-life"))
1241 if (!strcasecmp (atom + 1,
"acket"))
1243 if (!strcasecmp (atom + 1,
"ool"))
1245 if (!strcasecmp (atom + 1,
"ool6"))
1247 if (!strcasecmp (atom + 1,
"refix6"))
1249 if (!strcasecmp (atom + 1,
"seudo"))
1251 if (!strcasecmp (atom + 1,
"eer"))
1253 if (!strcasecmp (atom + 1,
"rimary"))
1255 if (!strcasecmp (atom + 1,
"rimary6"))
1257 if (!strncasecmp (atom + 1,
"artner", 6)) {
1260 if (!strcasecmp (atom + 7,
"-down"))
1263 if (!strcasecmp (atom + 1,
"ort"))
1265 if (!strcasecmp (atom + 1,
"otential-conflict"))
1267 if (!strcasecmp (atom + 1,
"ick-first-value") ||
1268 !strcasecmp (atom + 1,
"ick"))
1270 if (!strcasecmp (atom + 1,
"aused"))
1274 if (!strcasecmp(atom + 1,
"ange"))
1276 if (!strcasecmp(atom + 1,
"ange6"))
1278 if (isascii(atom[1]) &&
1279 (tolower((
unsigned char)atom[1]) ==
'e')) {
1280 if (!strcasecmp(atom + 2,
"bind"))
1282 if (!strcasecmp(atom + 2,
"boot"))
1284 if (!strcasecmp(atom + 2,
"contact-interval"))
1286 if (!strncasecmp(atom + 2,
"cover", 5)) {
1287 if (atom[7] ==
'\0')
1289 if (!strcasecmp(atom + 7,
"-done"))
1291 if (!strcasecmp(atom + 7,
"-wait"))
1295 if (!strcasecmp(atom + 2,
"fresh"))
1297 if (!strcasecmp(atom + 2,
"fused"))
1299 if (!strcasecmp(atom + 2,
"ject"))
1301 if (!strcasecmp(atom + 2,
"lease"))
1303 if (!strcasecmp(atom + 2,
"leased"))
1305 if (!strcasecmp(atom + 2,
"move"))
1307 if (!strcasecmp(atom + 2,
"new"))
1309 if (!strcasecmp(atom + 2,
"quest"))
1311 if (!strcasecmp(atom + 2,
"quire"))
1313 if (isascii(atom[2]) &&
1314 (tolower((
unsigned char)atom[2]) ==
's')) {
1315 if (!strcasecmp(atom + 3,
"erved"))
1317 if (!strcasecmp(atom + 3,
"et"))
1319 if (!strcasecmp(atom + 3,
1320 "olution-interrupted"))
1324 if (!strcasecmp(atom + 2,
"try"))
1326 if (!strcasecmp(atom + 2,
"turn"))
1328 if (!strcasecmp(atom + 2,
"verse"))
1330 if (!strcasecmp(atom + 2,
"wind"))
1336 if (!strcasecmp(atom + 1,
"cript"))
1338 if (isascii(atom[1]) &&
1339 tolower((
unsigned char)atom[1]) ==
'e') {
1340 if (!strcasecmp(atom + 2,
"arch"))
1342 if (isascii(atom[2]) &&
1343 tolower((
unsigned char)atom[2]) ==
'c') {
1344 if (!strncasecmp(atom + 3,
"ond", 3)) {
1345 if (!strcasecmp(atom + 6,
"ary"))
1347 if (!strcasecmp(atom + 6,
"ary6"))
1349 if (!strcasecmp(atom + 6,
"s"))
1353 if (!strcasecmp(atom + 3,
"ret"))
1357 if (!strncasecmp(atom + 2,
"lect", 4)) {
1358 if (atom[6] ==
'\0')
1360 if (!strcasecmp(atom + 6,
"-timeout"))
1364 if (!strcasecmp(atom + 2,
"nd"))
1366 if (!strncasecmp(atom + 2,
"rv", 2)) {
1367 if (!strncasecmp(atom + 4,
"er", 2)) {
1368 if (atom[6] ==
'\0')
1370 if (atom[6] ==
'-') {
1371 if (!strcasecmp(atom + 7,
1374 if (!strcasecmp(atom + 7,
1377 if (!strcasecmp(atom + 7,
1384 if (!strcasecmp(atom + 4,
"fail"))
1388 if (!strcasecmp(atom + 2,
"t"))
1392 if (isascii(atom[1]) &&
1393 tolower((
unsigned char)atom[1]) ==
'h') {
1394 if (!strcasecmp(atom + 2,
"ared-network"))
1396 if (!strcasecmp(atom + 2,
"utdown"))
1400 if (isascii(atom[1]) &&
1401 tolower((
unsigned char)atom[1]) ==
'i') {
1402 if (!strcasecmp(atom + 2,
"addr"))
1404 if (!strcasecmp(atom + 2,
"gned"))
1406 if (!strcasecmp(atom + 2,
"ze"))
1410 if (isascii(atom[1]) &&
1411 tolower((
unsigned char)atom[1]) ==
'p') {
1412 if (isascii(atom[2]) &&
1413 tolower((
unsigned char)atom[2]) ==
'a') {
1414 if (!strcasecmp(atom + 3,
"ce"))
1416 if (!strcasecmp(atom + 3,
"wn"))
1420 if (!strcasecmp(atom + 2,
"lit"))
1424 if (isascii(atom[1]) &&
1425 tolower((
unsigned char)atom[1]) ==
't') {
1426 if (isascii(atom[2]) &&
1427 tolower((
unsigned char)atom[2]) ==
'a') {
1428 if(!strncasecmp(atom + 3,
"rt", 2)) {
1429 if (!strcasecmp(atom + 5,
"s"))
1431 if (!strcasecmp(atom + 5,
"up"))
1435 if (isascii(atom[3]) &&
1436 tolower((
unsigned char)atom[3]) ==
't') {
1437 if (!strcasecmp(atom + 4,
"e"))
1439 if (!strcasecmp(atom + 4,
"ic"))
1444 if (!strcasecmp(atom + 2,
"ring"))
1448 if (!strncasecmp(atom + 1,
"ub", 2)) {
1449 if (!strcasecmp(atom + 3,
"class"))
1451 if (!strcasecmp(atom + 3,
"net"))
1453 if (!strcasecmp(atom + 3,
"net6"))
1455 if (!strcasecmp(atom + 3,
"string"))
1459 if (isascii(atom[1]) &&
1460 tolower((
unsigned char)atom[1]) ==
'u') {
1461 if (!strcasecmp(atom + 2,
"ffix"))
1463 if (!strcasecmp(atom + 2,
"persede"))
1466 if (!strcasecmp(atom + 1,
"witch"))
1470 if (!strcasecmp (atom + 1,
"imestamp"))
1472 if (!strcasecmp (atom + 1,
"imeout"))
1474 if (!strcasecmp (atom + 1,
"oken-ring"))
1476 if (!strcasecmp (atom + 1,
"ext"))
1478 if (!strcasecmp (atom + 1,
"stp"))
1480 if (!strcasecmp (atom + 1,
"sfp"))
1482 if (!strcasecmp (atom + 1,
"ransmission"))
1484 if (!strcasecmp(atom + 1,
"emporary"))
1488 if (!strcasecmp (atom + 1,
"case"))
1490 if (!strcasecmp (atom + 1,
"nset"))
1492 if (!strcasecmp (atom + 1,
"nsigned"))
1494 if (!strcasecmp (atom + 1,
"id"))
1496 if (!strncasecmp (atom + 1,
"se", 2)) {
1497 if (!strcasecmp (atom + 3,
"r-class"))
1499 if (!strcasecmp (atom + 3,
"-host-decl-names"))
1501 if (!strcasecmp (atom + 3,
1502 "-lease-addr-for-default-route"))
1506 if (!strncasecmp (atom + 1,
"nknown", 6)) {
1507 if (!strcasecmp (atom + 7,
"-clients"))
1509 if (!strcasecmp (atom + 7,
"-state"))
1515 if (!strcasecmp (atom + 1,
"nauthenticated"))
1517 if (!strcasecmp (atom + 1,
"pdate"))
1521 if (!strcasecmp (atom + 1,
"6relay"))
1523 if (!strcasecmp (atom + 1,
"6relopt"))
1525 if (!strcasecmp (atom + 1,
"endor-class"))
1527 if (!strcasecmp (atom + 1,
"endor"))
1531 if (!strcasecmp (atom + 1,
"ith"))
1533 if (!strcasecmp(atom + 1,
"idth"))
1537 if (!strcasecmp (atom + 1,
"iaddr"))
1539 if (!strcasecmp (atom + 1,
"xdomain"))
1541 if (!strcasecmp (atom + 1,
"xrrset"))
1545 if (!strcasecmp (atom + 1,
"erolen"))
1547 if (!strcasecmp (atom + 1,
"one"))
isc_result_t end_parse(struct parse **cfile)
void * dmalloc(unsigned, const char *, int)
enum dhcp_token do_peek_token(const char **rval, unsigned int *rlen, struct parse *cfile, isc_boolean_t raw)
enum dhcp_token peek_token(const char **rval, unsigned *rlen, struct parse *cfile)
struct parse * saved_state
enum dhcp_token peek_raw_token(const char **rval, unsigned *rlen, struct parse *cfile)
void log_fatal(const char *,...) __attribute__((__format__(__printf__
enum dhcp_token next_token(const char **rval, unsigned *rlen, struct parse *cfile)
void dfree(void *, const char *, int)
isc_result_t save_parse_state(struct parse *cfile)
isc_result_t restore_parse_state(struct parse *cfile)
int parse_warn(struct parse *cfile, const char *fmt,...)
isc_result_t new_parse(struct parse **cfile, int file, char *inbuf, unsigned buflen, const char *name, int eolp)
enum dhcp_token next_raw_token(const char **rval, unsigned *rlen, struct parse *cfile)