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;
163 memcpy(cfile, saved_state,
sizeof(*cfile));
165 return ISC_R_SUCCESS;
168 static int get_char (cfile)
174 if (cfile->bufix == cfile->buflen) {
175 #if !defined(LDAP_CONFIGURATION)
178 if (cfile->read_function != NULL)
179 c = cfile->read_function(cfile);
184 c = cfile->
inbuf [cfile->bufix];
188 if (!cfile->ugflag) {
190 if (cfile->cur_line == cfile->line1) {
191 cfile->cur_line = cfile->line2;
192 cfile->prev_line = cfile->line1;
194 cfile->cur_line = cfile->line1;
195 cfile->prev_line = cfile->line2;
199 cfile->cur_line [0] = 0;
200 }
else if (c != EOF) {
201 if (cfile->lpos <= 80) {
202 cfile->cur_line [cfile->lpos - 1] = c;
203 cfile->cur_line [cfile->lpos] = 0;
216 unget_char(
struct parse *cfile,
int c) {
247 get_raw_token(
struct parse *cfile) {
257 c = get_char (cfile);
258 if (!((c ==
'\n') && cfile->
eol_token) &&
259 isascii(c) && isspace(c)) {
260 ttok = read_whitespace(c, cfile);
270 ttok = read_string (cfile);
273 if ((isascii (c) && isdigit (c)) || c ==
'-') {
276 ttok = read_number (c, cfile);
278 }
else if (isascii (c) && isalpha (c)) {
281 ttok = read_num_or_name (c, cfile);
283 }
else if (c == EOF) {
310 get_next_token(
const char **rval,
unsigned *rlen,
311 struct parse *cfile, isc_boolean_t raw) {
314 if (cfile ->
token) {
322 rv = get_raw_token(cfile);
328 rv = get_raw_token(cfile);
334 *rval = cfile ->
tval;
336 *rlen = cfile ->
tlen;
338 fprintf (stderr,
"%s:%d ", cfile ->
tval, rv);
356 return get_next_token(rval, rlen, cfile, ISC_FALSE);
367 return get_next_token(rval, rlen, cfile, ISC_TRUE);
382 struct parse *cfile, isc_boolean_t raw) {
390 cfile->
token = get_raw_token(cfile);
405 *rval = cfile ->
tval;
407 *rlen = cfile ->
tlen;
409 fprintf (stderr,
"(%s:%d) ", cfile ->
tval, cfile ->
token);
411 return cfile ->
token;
444 static void skip_to_eol (cfile)
449 c = get_char (cfile);
459 read_whitespace(
int c,
struct parse *cfile) {
467 if (ofs >=
sizeof(cfile->
tokbuf)) {
474 "whitespace too long, buffer overflow.");
479 }
while (!((c ==
'\n') && cfile->
eol_token) &&
480 isascii(c) && isspace(c));
485 unget_char(cfile, c);
490 cfile->
tokbuf[ofs] =
'\0';
505 for (i = 0; i <
sizeof cfile ->
tokbuf; i++) {
507 c = get_char (cfile);
515 cfile ->
tokbuf [i] =
'\t';
518 cfile ->
tokbuf [i] =
'\r';
521 cfile ->
tokbuf [i] =
'\n';
524 cfile ->
tokbuf [i] =
'\b';
546 if (c >=
'0' && c <=
'9') {
547 value = value * 16 + (c -
'0');
548 }
else if (c >=
'a' && c <=
'f') {
549 value = value * 16 + (c -
'a' + 10);
550 }
else if (c >=
'A' && c <=
'F') {
551 value = value * 16 + (c -
'A' + 10);
554 "invalid hex digit: %x",
560 cfile ->
tokbuf [i] = value;
565 if (c >=
'0' && c <=
'7') {
566 value = value * 8 + (c -
'0');
570 "invalid octal digit %x",
578 cfile ->
tokbuf [i] = value;
583 }
else if (c ==
'\\') {
593 if (i ==
sizeof cfile ->
tokbuf) {
595 "string constant larger than internal buffer");
611 cfile ->
tokbuf [i++] = c;
612 for (; i <
sizeof cfile ->
tokbuf; i++) {
613 c = get_char (cfile);
620 switch(isascii(c) ? token :
BREAK) {
632 if((i == 2) && isxdigit(c) &&
633 (cfile->
tokbuf[0] ==
'0') &&
634 ((cfile->
tokbuf[1] ==
'x') ||
635 (cfile->
tokbuf[1] ==
'X'))) {
638 }
else if(((c ==
'-') || (c ==
'_') || isalnum(c))) {
648 unget_char(cfile, c);
658 if (i ==
sizeof cfile ->
tokbuf) {
660 "numeric token larger than internal buffer");
673 if ((i == 1) && (cfile->
tokbuf[i] ==
'-'))
679 static enum dhcp_token read_num_or_name (c, cfile)
685 cfile ->
tokbuf [i++] = c;
686 for (; i <
sizeof cfile ->
tokbuf; i++) {
687 c = get_char (cfile);
689 (c !=
'-' && c !=
'_' && !isalnum (c))) {
690 unget_char(cfile, c);
697 if (i ==
sizeof cfile ->
tokbuf) {
698 parse_warn (cfile,
"token larger than internal buffer");
704 return intern(cfile->
tval, rv);
709 if (!isascii(atom[0]))
712 switch (tolower((
unsigned char)atom[0])) {
719 if (!strcasecmp(atom + 1,
"bandoned"))
721 if (!strcasecmp(atom + 1,
"ctive"))
723 if (!strncasecmp(atom + 1,
"dd", 2)) {
726 else if (!strcasecmp(atom + 3,
"ress"))
730 if (!strcasecmp(atom + 1,
"fter"))
732 if (isascii(atom[1]) &&
733 (tolower((
unsigned char)atom[1]) ==
'l')) {
734 if (!strcasecmp(atom + 2,
"gorithm"))
736 if (!strcasecmp(atom + 2,
"ias"))
738 if (isascii(atom[2]) &&
739 (tolower((
unsigned char)atom[2]) ==
'l')) {
742 else if (!strcasecmp(atom + 3,
"ow"))
746 if (!strcasecmp(atom + 2,
"so"))
750 if (isascii(atom[1]) &&
751 (tolower((
unsigned char)atom[1]) ==
'n')) {
752 if (!strcasecmp(atom + 2,
"d"))
754 if (!strcasecmp(atom + 2,
"ycast-mac"))
758 if (!strcasecmp(atom + 1,
"ppend"))
760 if (!strcasecmp(atom + 1,
"rray"))
762 if (isascii(atom[1]) &&
763 (tolower((
unsigned char)atom[1]) ==
't')) {
766 if (!strcasecmp(atom + 2,
"sfp"))
770 if (!strncasecmp(atom + 1,
"ut", 2)) {
771 if (isascii(atom[3]) &&
772 (tolower((
unsigned char)atom[3]) ==
'h')) {
773 if (!strncasecmp(atom + 4,
"enticat", 7)) {
774 if (!strcasecmp(atom + 11,
"ed"))
776 if (!strcasecmp(atom + 11,
"ion"))
780 if (!strcasecmp(atom + 4,
"oritative"))
784 if (!strcasecmp(atom + 3,
"o-partner-down"))
790 if (!strcasecmp (atom + 1,
"ackup"))
792 if (!strcasecmp (atom + 1,
"ootp"))
794 if (!strcasecmp (atom + 1,
"inding"))
796 if (!strcasecmp (atom + 1,
"inary-to-ascii"))
798 if (!strcasecmp (atom + 1,
"ackoff-cutoff"))
800 if (!strcasecmp (atom + 1,
"ooting"))
802 if (!strcasecmp (atom + 1,
"oot-unknown-clients"))
804 if (!strcasecmp (atom + 1,
"reak"))
806 if (!strcasecmp (atom + 1,
"illing"))
808 if (!strcasecmp (atom + 1,
"oolean"))
810 if (!strcasecmp (atom + 1,
"alance"))
812 if (!strcasecmp (atom + 1,
"ound"))
814 if (!strcasecmp (atom + 1,
"ootp-broadcast-always"))
818 if (!strcasecmp(atom + 1,
"ase"))
820 if (!strcasecmp(atom + 1,
"heck"))
822 if (!strcasecmp(atom + 1,
"iaddr"))
824 if (isascii(atom[1]) &&
825 tolower((
unsigned char)atom[1]) ==
'l') {
826 if (!strcasecmp(atom + 2,
"ass"))
828 if (!strncasecmp(atom + 2,
"ient", 4)) {
829 if (!strcasecmp(atom + 6,
"s"))
831 if (atom[6] ==
'-') {
832 if (!strcasecmp(atom + 7,
"hostname"))
834 if (!strcasecmp(atom + 7,
"identifier"))
836 if (!strcasecmp(atom + 7,
"state"))
838 if (!strcasecmp(atom + 7,
"updates"))
844 if (!strcasecmp(atom + 2,
"ose"))
846 if (!strcasecmp(atom + 2,
"tt"))
850 if (isascii(atom[1]) &&
851 tolower((
unsigned char)atom[1]) ==
'o') {
852 if (!strcasecmp(atom + 2,
"de"))
854 if (isascii(atom[2]) &&
855 tolower((
unsigned char)atom[2]) ==
'm') {
856 if (!strcasecmp(atom + 3,
"mit"))
858 if (!strcasecmp(atom + 3,
859 "munications-interrupted"))
861 if (!strcasecmp(atom + 3,
"pressed"))
865 if (isascii(atom[2]) &&
866 tolower((
unsigned char)atom[2]) ==
'n') {
867 if (!strcasecmp(atom + 3,
"cat"))
869 if (!strcasecmp(atom + 3,
"fig-option"))
871 if (!strcasecmp(atom + 3,
"flict-done"))
873 if (!strcasecmp(atom + 3,
"nect"))
879 if (!strcasecmp(atom + 1,
"reate"))
883 if (!strcasecmp(atom + 1,
"b-time-format"))
885 if (!strcasecmp (atom + 1,
"omain"))
887 if (!strncasecmp (atom + 1,
"omain-", 6)) {
888 if (!strcasecmp(atom + 7,
"name"))
890 if (!strcasecmp(atom + 7,
"list"))
893 if (!strcasecmp (atom + 1,
"o-forward-updates"))
896 if (!strcasecmp (atom + 1,
"o-forward-update"))
898 if (!strcasecmp (atom + 1,
"ebug"))
900 if (!strcasecmp (atom + 1,
"eny"))
902 if (!strcasecmp (atom + 1,
"eleted"))
904 if (!strcasecmp (atom + 1,
"elete"))
906 if (!strncasecmp (atom + 1,
"efault", 6)) {
909 if (!strcasecmp(atom + 7,
"-duid"))
911 if (!strcasecmp (atom + 7,
"-lease-time"))
915 if (!strncasecmp (atom + 1,
"ynamic", 6)) {
918 if (!strncasecmp (atom + 7,
"-bootp", 6)) {
921 if (!strcasecmp (atom + 13,
"-lease-cutoff"))
923 if (!strcasecmp (atom + 13,
"-lease-length"))
928 if (!strcasecmp (atom + 1,
"uplicates"))
930 if (!strcasecmp (atom + 1,
"eclines"))
932 if (!strncasecmp (atom + 1,
"efine", 5)) {
933 if (!strcasecmp (atom + 6,
"d"))
940 if (isascii (atom [1]) &&
941 tolower((
unsigned char)atom[1]) ==
'x') {
942 if (!strcasecmp (atom + 2,
"tract-int"))
944 if (!strcasecmp (atom + 2,
"ists"))
946 if (!strcasecmp (atom + 2,
"piry"))
948 if (!strcasecmp (atom + 2,
"pire"))
950 if (!strcasecmp (atom + 2,
"pired"))
953 if (!strcasecmp (atom + 1,
"ncode-int"))
955 if (!strcasecmp(atom + 1,
"poch"))
957 if (!strcasecmp (atom + 1,
"thernet"))
959 if (!strcasecmp (atom + 1,
"nds"))
961 if (!strncasecmp (atom + 1,
"ls", 2)) {
962 if (!strcasecmp (atom + 3,
"e"))
964 if (!strcasecmp (atom + 3,
"if"))
968 if (!strcasecmp (atom + 1,
"rror"))
970 if (!strcasecmp (atom + 1,
"val"))
972 if (!strcasecmp (atom + 1,
"ncapsulate"))
974 if (!strcasecmp(atom + 1,
"xecute"))
976 if (!strcasecmp(atom+1,
"n")) {
981 if (!strcasecmp (atom + 1,
"atal"))
983 if (!strcasecmp (atom + 1,
"ilename"))
985 if (!strcasecmp (atom + 1,
"ixed-address"))
987 if (!strcasecmp (atom + 1,
"ixed-address6"))
989 if (!strcasecmp (atom + 1,
"ixed-prefix6"))
991 if (!strcasecmp (atom + 1,
"ddi"))
993 if (!strcasecmp (atom + 1,
"ormerr"))
995 if (!strcasecmp (atom + 1,
"unction"))
997 if (!strcasecmp (atom + 1,
"ailover"))
999 if (!strcasecmp (atom + 1,
"ree"))
1003 if (!strncasecmp(atom + 1,
"et", 2)) {
1004 if (!strcasecmp(atom + 3,
"-lease-hostnames"))
1006 if (!strcasecmp(atom + 3,
"hostbyname"))
1008 if (!strcasecmp(atom + 3,
"hostname"))
1012 if (!strcasecmp (atom + 1,
"iaddr"))
1014 if (!strcasecmp (atom + 1,
"roup"))
1018 if (!strcasecmp(atom + 1,
"ash"))
1020 if (!strcasecmp (atom + 1,
"ba"))
1022 if (!strcasecmp (atom + 1,
"ost"))
1024 if (!strcasecmp (atom + 1,
"ost-decl-name"))
1026 if (!strcasecmp(atom + 1,
"ost-identifier"))
1028 if (!strcasecmp (atom + 1,
"ardware"))
1030 if (!strcasecmp (atom + 1,
"ostname"))
1032 if (!strcasecmp (atom + 1,
"elp"))
1036 if (!strcasecmp(atom+1,
"a-na"))
1038 if (!strcasecmp(atom+1,
"a-ta"))
1040 if (!strcasecmp(atom+1,
"a-pd"))
1042 if (!strcasecmp(atom+1,
"aaddr"))
1044 if (!strcasecmp(atom+1,
"aprefix"))
1046 if (!strcasecmp (atom + 1,
"nclude"))
1048 if (!strcasecmp (atom + 1,
"nteger"))
1050 if (!strcasecmp (atom + 1,
"nfiniband"))
1052 if (!strcasecmp (atom + 1,
"nfinite"))
1054 if (!strcasecmp (atom + 1,
"nfo"))
1056 if (!strcasecmp (atom + 1,
"p-address"))
1058 if (!strcasecmp (atom + 1,
"p6-address"))
1060 if (!strcasecmp (atom + 1,
"nitial-interval"))
1062 if (!strcasecmp (atom + 1,
"nitial-delay"))
1064 if (!strcasecmp (atom + 1,
"nterface"))
1066 if (!strcasecmp (atom + 1,
"dentifier"))
1068 if (!strcasecmp (atom + 1,
"f"))
1070 if (!strcasecmp (atom + 1,
"s"))
1072 if (!strcasecmp (atom + 1,
"gnore"))
1076 if (!strncasecmp (atom + 1,
"nown", 4)) {
1077 if (!strcasecmp (atom + 5,
"-clients"))
1083 if (!strcasecmp (atom + 1,
"ey"))
1087 if (!strcasecmp (atom + 1,
"case"))
1089 if (!strcasecmp (atom + 1,
"ease"))
1091 if (!strcasecmp(atom + 1,
"ease6"))
1093 if (!strcasecmp (atom + 1,
"eased-address"))
1095 if (!strcasecmp (atom + 1,
"ease-time"))
1097 if (!strcasecmp(atom + 1,
"easequery"))
1099 if (!strcasecmp(atom + 1,
"ength"))
1101 if (!strcasecmp (atom + 1,
"imit"))
1103 if (!strcasecmp (atom + 1,
"et"))
1105 if (!strcasecmp (atom + 1,
"oad"))
1107 if (!strcasecmp(atom + 1,
"ocal"))
1109 if (!strcasecmp (atom + 1,
"og"))
1111 if (!strcasecmp(atom+1,
"lt")) {
1114 if (!strcasecmp(atom+1,
"l")) {
1119 if (!strncasecmp (atom + 1,
"ax", 2)) {
1122 if (!strcasecmp (atom + 3,
"-balance"))
1124 if (!strncasecmp (atom + 3,
"-lease-", 7)) {
1125 if (!strcasecmp(atom + 10,
"misbalance"))
1127 if (!strcasecmp(atom + 10,
"ownership"))
1129 if (!strcasecmp(atom + 10,
"time"))
1132 if (!strcasecmp(atom + 3,
"-life"))
1134 if (!strcasecmp (atom + 3,
"-transmit-idle"))
1136 if (!strcasecmp (atom + 3,
"-response-delay"))
1138 if (!strcasecmp (atom + 3,
"-unacked-updates"))
1141 if (!strncasecmp (atom + 1,
"in-", 3)) {
1142 if (!strcasecmp (atom + 4,
"balance"))
1144 if (!strcasecmp (atom + 4,
"lease-time"))
1146 if (!strcasecmp (atom + 4,
"secs"))
1150 if (!strncasecmp (atom + 1,
"edi", 3)) {
1151 if (!strcasecmp (atom + 4,
"a"))
1153 if (!strcasecmp (atom + 4,
"um"))
1157 if (!strcasecmp (atom + 1,
"atch"))
1159 if (!strcasecmp (atom + 1,
"embers"))
1161 if (!strcasecmp (atom + 1,
"y"))
1163 if (!strcasecmp (atom + 1,
"clt"))
1167 if (!strcasecmp (atom + 1,
"ormal"))
1169 if (!strcasecmp (atom + 1,
"ameserver"))
1171 if (!strcasecmp (atom + 1,
"etmask"))
1173 if (!strcasecmp (atom + 1,
"ever"))
1175 if (!strcasecmp (atom + 1,
"ext-server"))
1177 if (!strcasecmp (atom + 1,
"ot"))
1179 if (!strcasecmp (atom + 1,
"o"))
1181 if (!strcasecmp (atom + 1,
"oerror"))
1183 if (!strcasecmp (atom + 1,
"otauth"))
1185 if (!strcasecmp (atom + 1,
"otimp"))
1187 if (!strcasecmp (atom + 1,
"otzone"))
1189 if (!strcasecmp (atom + 1,
"xdomain"))
1191 if (!strcasecmp (atom + 1,
"xrrset"))
1193 if (!strcasecmp (atom + 1,
"ull"))
1195 if (!strcasecmp (atom + 1,
"ext"))
1197 if (!strcasecmp (atom + 1,
"ew"))
1201 if (!strcasecmp (atom + 1,
"mapi"))
1203 if (!strcasecmp (atom + 1,
"r"))
1205 if (!strcasecmp (atom + 1,
"n"))
1207 if (!strcasecmp (atom + 1,
"pen"))
1209 if (!strcasecmp (atom + 1,
"ption"))
1211 if (!strcasecmp (atom + 1,
"ne-lease-per-client"))
1213 if (!strcasecmp (atom + 1,
"f"))
1215 if (!strcasecmp (atom + 1,
"wner"))
1219 if (!strcasecmp (atom + 1,
"repend"))
1221 if (!strcasecmp(atom + 1,
"referred-life"))
1223 if (!strcasecmp (atom + 1,
"acket"))
1225 if (!strcasecmp (atom + 1,
"ool"))
1227 if (!strcasecmp (atom + 1,
"ool6"))
1229 if (!strcasecmp (atom + 1,
"refix6"))
1231 if (!strcasecmp (atom + 1,
"seudo"))
1233 if (!strcasecmp (atom + 1,
"eer"))
1235 if (!strcasecmp (atom + 1,
"rimary"))
1237 if (!strcasecmp (atom + 1,
"rimary6"))
1239 if (!strncasecmp (atom + 1,
"artner", 6)) {
1242 if (!strcasecmp (atom + 7,
"-down"))
1245 if (!strcasecmp (atom + 1,
"ort"))
1247 if (!strcasecmp (atom + 1,
"otential-conflict"))
1249 if (!strcasecmp (atom + 1,
"ick-first-value") ||
1250 !strcasecmp (atom + 1,
"ick"))
1252 if (!strcasecmp (atom + 1,
"aused"))
1256 if (!strcasecmp(atom + 1,
"ange"))
1258 if (!strcasecmp(atom + 1,
"ange6"))
1260 if (isascii(atom[1]) &&
1261 (tolower((
unsigned char)atom[1]) ==
'e')) {
1262 if (!strcasecmp(atom + 2,
"bind"))
1264 if (!strcasecmp(atom + 2,
"boot"))
1266 if (!strcasecmp(atom + 2,
"contact-interval"))
1268 if (!strncasecmp(atom + 2,
"cover", 5)) {
1269 if (atom[7] ==
'\0')
1271 if (!strcasecmp(atom + 7,
"-done"))
1273 if (!strcasecmp(atom + 7,
"-wait"))
1277 if (!strcasecmp(atom + 2,
"fresh"))
1279 if (!strcasecmp(atom + 2,
"fused"))
1281 if (!strcasecmp(atom + 2,
"ject"))
1283 if (!strcasecmp(atom + 2,
"lease"))
1285 if (!strcasecmp(atom + 2,
"leased"))
1287 if (!strcasecmp(atom + 2,
"move"))
1289 if (!strcasecmp(atom + 2,
"new"))
1291 if (!strcasecmp(atom + 2,
"quest"))
1293 if (!strcasecmp(atom + 2,
"quire"))
1295 if (isascii(atom[2]) &&
1296 (tolower((
unsigned char)atom[2]) ==
's')) {
1297 if (!strcasecmp(atom + 3,
"erved"))
1299 if (!strcasecmp(atom + 3,
"et"))
1301 if (!strcasecmp(atom + 3,
1302 "olution-interrupted"))
1306 if (!strcasecmp(atom + 2,
"try"))
1308 if (!strcasecmp(atom + 2,
"turn"))
1310 if (!strcasecmp(atom + 2,
"verse"))
1312 if (!strcasecmp(atom + 2,
"wind"))
1318 if (!strcasecmp(atom + 1,
"cript"))
1320 if (isascii(atom[1]) &&
1321 tolower((
unsigned char)atom[1]) ==
'e') {
1322 if (!strcasecmp(atom + 2,
"arch"))
1324 if (isascii(atom[2]) &&
1325 tolower((
unsigned char)atom[2]) ==
'c') {
1326 if (!strncasecmp(atom + 3,
"ond", 3)) {
1327 if (!strcasecmp(atom + 6,
"ary"))
1329 if (!strcasecmp(atom + 6,
"ary6"))
1331 if (!strcasecmp(atom + 6,
"s"))
1335 if (!strcasecmp(atom + 3,
"ret"))
1339 if (!strncasecmp(atom + 2,
"lect", 4)) {
1340 if (atom[6] ==
'\0')
1342 if (!strcasecmp(atom + 6,
"-timeout"))
1346 if (!strcasecmp(atom + 2,
"nd"))
1348 if (!strncasecmp(atom + 2,
"rv", 2)) {
1349 if (!strncasecmp(atom + 4,
"er", 2)) {
1350 if (atom[6] ==
'\0')
1352 if (atom[6] ==
'-') {
1353 if (!strcasecmp(atom + 7,
1356 if (!strcasecmp(atom + 7,
1359 if (!strcasecmp(atom + 7,
1366 if (!strcasecmp(atom + 4,
"fail"))
1370 if (!strcasecmp(atom + 2,
"t"))
1374 if (isascii(atom[1]) &&
1375 tolower((
unsigned char)atom[1]) ==
'h') {
1376 if (!strcasecmp(atom + 2,
"ared-network"))
1378 if (!strcasecmp(atom + 2,
"utdown"))
1382 if (isascii(atom[1]) &&
1383 tolower((
unsigned char)atom[1]) ==
'i') {
1384 if (!strcasecmp(atom + 2,
"addr"))
1386 if (!strcasecmp(atom + 2,
"gned"))
1388 if (!strcasecmp(atom + 2,
"ze"))
1392 if (isascii(atom[1]) &&
1393 tolower((
unsigned char)atom[1]) ==
'p') {
1394 if (isascii(atom[2]) &&
1395 tolower((
unsigned char)atom[2]) ==
'a') {
1396 if (!strcasecmp(atom + 3,
"ce"))
1398 if (!strcasecmp(atom + 3,
"wn"))
1402 if (!strcasecmp(atom + 2,
"lit"))
1406 if (isascii(atom[1]) &&
1407 tolower((
unsigned char)atom[1]) ==
't') {
1408 if (isascii(atom[2]) &&
1409 tolower((
unsigned char)atom[2]) ==
'a') {
1410 if(!strncasecmp(atom + 3,
"rt", 2)) {
1411 if (!strcasecmp(atom + 5,
"s"))
1413 if (!strcasecmp(atom + 5,
"up"))
1417 if (isascii(atom[3]) &&
1418 tolower((
unsigned char)atom[3]) ==
't') {
1419 if (!strcasecmp(atom + 4,
"e"))
1421 if (!strcasecmp(atom + 4,
"ic"))
1426 if (!strcasecmp(atom + 2,
"ring"))
1430 if (!strncasecmp(atom + 1,
"ub", 2)) {
1431 if (!strcasecmp(atom + 3,
"class"))
1433 if (!strcasecmp(atom + 3,
"net"))
1435 if (!strcasecmp(atom + 3,
"net6"))
1437 if (!strcasecmp(atom + 3,
"string"))
1441 if (isascii(atom[1]) &&
1442 tolower((
unsigned char)atom[1]) ==
'u') {
1443 if (!strcasecmp(atom + 2,
"ffix"))
1445 if (!strcasecmp(atom + 2,
"persede"))
1448 if (!strcasecmp(atom + 1,
"witch"))
1452 if (!strcasecmp (atom + 1,
"imestamp"))
1454 if (!strcasecmp (atom + 1,
"imeout"))
1456 if (!strcasecmp (atom + 1,
"oken-ring"))
1458 if (!strcasecmp (atom + 1,
"ext"))
1460 if (!strcasecmp (atom + 1,
"stp"))
1462 if (!strcasecmp (atom + 1,
"sfp"))
1464 if (!strcasecmp (atom + 1,
"ransmission"))
1466 if (!strcasecmp(atom + 1,
"emporary"))
1470 if (!strcasecmp (atom + 1,
"case"))
1472 if (!strcasecmp (atom + 1,
"nset"))
1474 if (!strcasecmp (atom + 1,
"nsigned"))
1476 if (!strcasecmp (atom + 1,
"id"))
1478 if (!strncasecmp (atom + 1,
"se", 2)) {
1479 if (!strcasecmp (atom + 3,
"r-class"))
1481 if (!strcasecmp (atom + 3,
"-host-decl-names"))
1483 if (!strcasecmp (atom + 3,
1484 "-lease-addr-for-default-route"))
1488 if (!strncasecmp (atom + 1,
"nknown", 6)) {
1489 if (!strcasecmp (atom + 7,
"-clients"))
1491 if (!strcasecmp (atom + 7,
"-state"))
1497 if (!strcasecmp (atom + 1,
"nauthenticated"))
1499 if (!strcasecmp (atom + 1,
"pdate"))
1503 if (!strcasecmp (atom + 1,
"6relay"))
1505 if (!strcasecmp (atom + 1,
"6relopt"))
1507 if (!strcasecmp (atom + 1,
"endor-class"))
1509 if (!strcasecmp (atom + 1,
"endor"))
1513 if (!strcasecmp (atom + 1,
"ith"))
1515 if (!strcasecmp(atom + 1,
"idth"))
1519 if (!strcasecmp (atom + 1,
"iaddr"))
1521 if (!strcasecmp (atom + 1,
"xdomain"))
1523 if (!strcasecmp (atom + 1,
"xrrset"))
1527 if (!strcasecmp (atom + 1,
"erolen"))
1529 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)