3 Lexical scanner for dhcpd config file... */
6 * Copyright (c) 2004-2005 by Internet Systems Consortium, Inc. ("ISC")
7 * Copyright (c) 1995-2003 by Internet Software Consortium
9 * Permission to use, copy, modify, and distribute this software for any
10 * purpose with or without fee is hereby granted, provided that the above
11 * copyright notice and this permission notice appear in all copies.
13 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
14 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
16 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
19 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 * Internet Systems Consortium, Inc.
23 * Redwood City, CA 94063
27 * This software has been written for Internet Systems Consortium
28 * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
29 * To learn more about Internet Systems Consortium, see
30 * ``http://www.isc.org/''. To learn more about Vixie Enterprises,
31 * see ``http://www.vix.com''. To learn more about Nominum, Inc., see
32 * ``http://www.nominum.com''.
36 static char copyright
[] =
37 "$Id$ Copyright (c) 2004-2005 Internet Systems Consortium. All rights reserved.\n";
43 static int get_char
PROTO ((struct parse
*));
44 static enum dhcp_token get_token
PROTO ((struct parse
*));
45 static void skip_to_eol
PROTO ((struct parse
*));
46 static enum dhcp_token read_string
PROTO ((struct parse
*));
47 static enum dhcp_token read_number
PROTO ((int, struct parse
*));
48 static enum dhcp_token read_num_or_name
PROTO ((int, struct parse
*));
49 static enum dhcp_token intern
PROTO ((char *, enum dhcp_token
));
51 isc_result_t
new_parse (cfile
, file
, inbuf
, buflen
, name
, eolp
)
61 tmp
= dmalloc (sizeof (struct parse
), MDL
);
63 return ISC_R_NOMEMORY
;
64 memset (tmp
, 0, sizeof *tmp
);
68 tmp
-> lpos
= tmp
-> line
= 1;
69 tmp
-> cur_line
= tmp
-> line1
;
70 tmp
-> prev_line
= tmp
-> line2
;
71 tmp
-> token_line
= tmp
-> cur_line
;
72 tmp
-> cur_line
[0] = tmp
-> prev_line
[0] = 0;
73 tmp
-> warnings_occurred
= 0;
75 tmp
-> eol_token
= eolp
;
78 tmp
-> buflen
= buflen
;
83 tmp
-> inbuf
= dmalloc (8192, MDL
);
86 return ISC_R_NOMEMORY
;
95 isc_result_t
end_parse (cfile
)
98 if ((*cfile
) -> bufsiz
)
99 dfree ((*cfile
) -> inbuf
, MDL
);
101 *cfile
= (struct parse
*)0;
102 return ISC_R_SUCCESS
;
105 static int get_char (cfile
)
108 /* My kingdom for WITH... */
111 if (cfile
-> bufix
== cfile
-> buflen
) {
112 if (cfile
-> file
!= -1) {
115 cfile
-> inbuf
, cfile
-> bufsiz
);
116 if (cfile
-> buflen
== 0) {
119 } else if (cfile
-> buflen
< 0) {
121 cfile
-> bufix
= cfile
-> buflen
= 0;
123 c
= cfile
-> inbuf
[0];
129 c
= cfile
-> inbuf
[cfile
-> bufix
];
133 if (!cfile
-> ugflag
) {
135 if (cfile
-> cur_line
== cfile
-> line1
) {
136 cfile
-> cur_line
= cfile
-> line2
;
137 cfile
-> prev_line
= cfile
-> line1
;
139 cfile
-> cur_line
= cfile
-> line1
;
140 cfile
-> prev_line
= cfile
-> line2
;
144 cfile
-> cur_line
[0] = 0;
145 } else if (c
!= EOF
) {
146 if (cfile
-> lpos
<= 80) {
147 cfile
-> cur_line
[cfile
-> lpos
- 1] = c
;
148 cfile
-> cur_line
[cfile
-> lpos
] = 0;
157 static enum dhcp_token
get_token (cfile
)
161 enum dhcp_token ttok
;
175 c
= get_char (cfile
);
177 if (c
== '\n' && p
== 1 && !u
178 && cfile
-> comment_index
< sizeof cfile
-> comments
)
179 cfile
-> comments
[cfile
-> comment_index
++] = '\n';
182 if (!(c
== '\n' && cfile
-> eol_token
)
183 && isascii (c
) && isspace (c
))
187 if (cfile
-> comment_index
< sizeof cfile
-> comments
)
188 cfile
-> comments
[cfile
-> comment_index
++] = '#';
194 cfile
-> lexline
= l
;
195 cfile
-> lexchar
= p
;
196 ttok
= read_string (cfile
);
199 if ((isascii (c
) && isdigit (c
)) || c
== '-') {
200 cfile
-> lexline
= l
;
201 cfile
-> lexchar
= p
;
202 ttok
= read_number (c
, cfile
);
204 } else if (isascii (c
) && isalpha (c
)) {
205 cfile
-> lexline
= l
;
206 cfile
-> lexchar
= p
;
207 ttok
= read_num_or_name (c
, cfile
);
209 } else if (c
== EOF
) {
214 cfile
-> lexline
= l
;
215 cfile
-> lexchar
= p
;
227 enum dhcp_token
next_token (rval
, rlen
, cfile
)
234 if (cfile
-> token
) {
235 if (cfile
-> lexline
!= cfile
-> tline
)
236 cfile
-> token_line
= cfile
-> cur_line
;
237 cfile
-> lexchar
= cfile
-> tlpos
;
238 cfile
-> lexline
= cfile
-> tline
;
242 rv
= get_token (cfile
);
243 cfile
-> token_line
= cfile
-> cur_line
;
246 *rval
= cfile
-> tval
;
248 *rlen
= cfile
-> tlen
;
250 fprintf (stderr
, "%s:%d ", cfile
-> tval
, rv
);
255 enum dhcp_token
peek_token (rval
, rlen
, cfile
)
262 if (!cfile
-> token
) {
263 cfile
-> tlpos
= cfile
-> lexchar
;
264 cfile
-> tline
= cfile
-> lexline
;
265 cfile
-> token
= get_token (cfile
);
266 if (cfile
-> lexline
!= cfile
-> tline
)
267 cfile
-> token_line
= cfile
-> prev_line
;
269 x
= cfile
-> lexchar
;
270 cfile
-> lexchar
= cfile
-> tlpos
;
273 x
= cfile
-> lexline
;
274 cfile
-> lexline
= cfile
-> tline
;
278 *rval
= cfile
-> tval
;
280 *rlen
= cfile
-> tlen
;
282 fprintf (stderr
, "(%s:%d) ", cfile
-> tval
, cfile
-> token
);
284 return cfile
-> token
;
287 static void skip_to_eol (cfile
)
292 c
= get_char (cfile
);
296 if (cfile
-> comment_index
< sizeof (cfile
-> comments
))
297 comments
[cfile
-> comment_index
++] = c
;
305 static enum dhcp_token
read_string (cfile
)
314 for (i
= 0; i
< sizeof cfile
-> tokbuf
; i
++) {
316 c
= get_char (cfile
);
318 parse_warn (cfile
, "eof in string constant");
324 cfile
-> tokbuf
[i
] = '\t';
327 cfile
-> tokbuf
[i
] = '\r';
330 cfile
-> tokbuf
[i
] = '\n';
333 cfile
-> tokbuf
[i
] = '\b';
349 cfile
-> tokbuf
[i
] = c
;
356 if (c
>= '0' && c
<= '9') {
357 value
= value
* 16 + (c
- '0');
358 } else if (c
>= 'a' && c
<= 'f') {
359 value
= value
* 16 + (c
- 'a' + 10);
360 } else if (c
>= 'A' && c
<= 'F') {
361 value
= value
* 16 + (c
- 'A' + 10);
364 "invalid hex digit: %x",
370 cfile
-> tokbuf
[i
] = value
;
375 if (c
>= '0' && c
<= '9') {
376 value
= value
* 8 + (c
- '0');
380 "invalid octal digit %x",
384 cfile
-> tokbuf
[i
] = 0;
388 cfile
-> tokbuf
[i
] = value
;
393 } else if (c
== '\\') {
399 cfile
-> tokbuf
[i
] = c
;
401 /* Normally, I'd feel guilty about this, but we're talking about
402 strings that'll fit in a DHCP packet here... */
403 if (i
== sizeof cfile
-> tokbuf
) {
405 "string constant larger than internal buffer");
408 cfile
-> tokbuf
[i
] = 0;
410 cfile
-> tval
= cfile
-> tokbuf
;
414 static enum dhcp_token
read_number (c
, cfile
)
424 cfile
-> tokbuf
[i
++] = c
;
425 for (; i
< sizeof cfile
-> tokbuf
; i
++) {
426 c
= get_char (cfile
);
429 /* Promote NUMBER -> NUMBER_OR_NAME -> NAME, never demote.
430 * Except in the case of '0x' syntax hex, which gets called
431 * a NAME at '0x', and returned to NUMBER_OR_NAME once it's
432 * verified to be at least 0xf or less.
434 switch(isascii(c
) ? token
: BREAK
) {
441 token
= NUMBER_OR_NAME
;
446 if((i
== 2) && isxdigit(c
) &&
447 (cfile
->tokbuf
[0] == '0') &&
448 ((cfile
->tokbuf
[1] == 'x') ||
449 (cfile
->tokbuf
[1] == 'X'))) {
450 token
= NUMBER_OR_NAME
;
452 } else if(((c
== '-') || (c
== '_') || isalnum(c
))) {
458 /* At this point c is either EOF or part of the next
459 * token. If not EOF, rewind the file one byte so
460 * the next token is read from there.
469 log_fatal("read_number():%s:%d: impossible case", MDL
);
471 #else /* OLD_LEXER */
472 if (!seenx
&& (c
== 'x') {
474 } else if (!isascii (c
) || !isxdigit (c
)) {
481 #endif /* OLD_LEXER */
483 cfile
-> tokbuf
[i
] = c
;
486 if (i
== sizeof cfile
-> tokbuf
) {
488 "numeric token larger than internal buffer");
493 cfile
-> tokbuf
[i
] = 0;
495 cfile
-> tval
= cfile
-> tokbuf
;
500 static enum dhcp_token
read_num_or_name (c
, cfile
)
505 enum dhcp_token rv
= NUMBER_OR_NAME
;
506 cfile
-> tokbuf
[i
++] = c
;
507 for (; i
< sizeof cfile
-> tokbuf
; i
++) {
508 c
= get_char (cfile
);
510 (c
!= '-' && c
!= '_' && !isalnum (c
))) {
519 cfile
-> tokbuf
[i
] = c
;
521 if (i
== sizeof cfile
-> tokbuf
) {
522 parse_warn (cfile
, "token larger than internal buffer");
525 cfile
-> tokbuf
[i
] = 0;
527 cfile
-> tval
= cfile
-> tokbuf
;
528 return intern (cfile
-> tval
, rv
);
531 static enum dhcp_token
intern (atom
, dfv
)
535 if (!isascii (atom
[0]))
538 switch (tolower (atom
[0])) {
545 if (!strncasecmp (atom
+ 1, "uth", 3)) {
546 if (!strncasecmp (atom
+ 3, "uthenticat", 10)) {
547 if (!strcasecmp (atom
+ 13, "ed"))
548 return AUTHENTICATED
;
549 if (!strcasecmp (atom
+ 13, "ion"))
550 return AUTHENTICATION
;
553 if (!strcasecmp (atom
+ 1, "uthoritative"))
554 return AUTHORITATIVE
;
557 if (!strcasecmp (atom
+ 1, "nd"))
559 if (!strcasecmp (atom
+ 1, "ppend"))
561 if (!strcasecmp (atom
+ 1, "llow"))
563 if (!strcasecmp (atom
+ 1, "lias"))
565 if (!strcasecmp (atom
+ 1, "lgorithm"))
567 if (!strcasecmp (atom
+ 1, "bandoned"))
568 return TOKEN_ABANDONED
;
569 if (!strcasecmp (atom
+ 1, "dd"))
571 if (!strcasecmp (atom
+ 1, "ll"))
573 if (!strcasecmp (atom
+ 1, "t"))
575 if (!strcasecmp (atom
+ 1, "rray"))
577 if (!strcasecmp (atom
+ 1, "ddress"))
579 if (!strcasecmp (atom
+ 1, "ctive"))
583 if (!strcasecmp (atom
+ 1, "ackup"))
585 if (!strcasecmp (atom
+ 1, "ootp"))
587 if (!strcasecmp (atom
+ 1, "inding"))
589 if (!strcasecmp (atom
+ 1, "inary-to-ascii"))
590 return BINARY_TO_ASCII
;
591 if (!strcasecmp (atom
+ 1, "ackoff-cutoff"))
592 return BACKOFF_CUTOFF
;
593 if (!strcasecmp (atom
+ 1, "ooting"))
595 if (!strcasecmp (atom
+ 1, "oot-unknown-clients"))
596 return BOOT_UNKNOWN_CLIENTS
;
597 if (!strcasecmp (atom
+ 1, "reak"))
599 if (!strcasecmp (atom
+ 1, "illing"))
601 if (!strcasecmp (atom
+ 1, "oolean"))
603 if (!strcasecmp (atom
+ 1, "alance"))
605 if (!strcasecmp (atom
+ 1, "ound"))
609 if (!strcasecmp (atom
+ 1, "ase"))
611 if (!strcasecmp (atom
+ 1, "ommit"))
613 if (!strcasecmp (atom
+ 1, "ode"))
615 if (!strcasecmp (atom
+ 1, "onfig-option"))
616 return CONFIG_OPTION
;
617 if (!strcasecmp (atom
+ 1, "heck"))
619 if (!strcasecmp (atom
+ 1, "lass"))
621 if (!strcasecmp (atom
+ 1, "lose"))
623 if (!strcasecmp (atom
+ 1, "reate"))
625 if (!strcasecmp (atom
+ 1, "iaddr"))
627 if (!strncasecmp (atom
+ 1, "lient", 5)) {
628 if (!strcasecmp (atom
+ 6, "-identifier"))
629 return CLIENT_IDENTIFIER
;
630 if (!strcasecmp (atom
+ 6, "-hostname"))
631 return CLIENT_HOSTNAME
;
632 if (!strcasecmp (atom
+ 6, "-state"))
634 if (!strcasecmp (atom
+ 6, "-updates"))
635 return CLIENT_UPDATES
;
636 if (!strcasecmp (atom
+ 6, "s"))
639 if (!strcasecmp (atom
+ 1, "oncat"))
641 if (!strcasecmp (atom
+ 1, "onnect"))
643 if (!strcasecmp (atom
+ 1, "ommunications-interrupted"))
644 return COMMUNICATIONS_INTERRUPTED
;
645 if (!strcasecmp (atom
+ 1, "ltt"))
649 if (!strcasecmp (atom
+ 1, "ns-update"))
651 if (!strcasecmp (atom
+ 1, "ns-delete"))
653 if (!strcasecmp (atom
+ 1, "omain"))
655 if (!strcasecmp (atom
+ 1, "omain-name"))
657 if (!strcasecmp (atom
+ 1, "o-forward-update"))
658 return DO_FORWARD_UPDATE
;
659 if (!strcasecmp (atom
+ 1, "ebug"))
661 if (!strcasecmp (atom
+ 1, "eny"))
663 if (!strcasecmp (atom
+ 1, "eleted"))
664 return TOKEN_DELETED
;
665 if (!strcasecmp (atom
+ 1, "elete"))
667 if (!strncasecmp (atom
+ 1, "efault", 6)) {
670 if (!strcasecmp (atom
+ 7, "-lease-time"))
671 return DEFAULT_LEASE_TIME
;
674 if (!strncasecmp (atom
+ 1, "ynamic", 6)) {
677 if (!strncasecmp (atom
+ 7, "-bootp", 6)) {
679 return DYNAMIC_BOOTP
;
680 if (!strcasecmp (atom
+ 13, "-lease-cutoff"))
681 return DYNAMIC_BOOTP_LEASE_CUTOFF
;
682 if (!strcasecmp (atom
+ 13, "-lease-length"))
683 return DYNAMIC_BOOTP_LEASE_LENGTH
;
687 if (!strcasecmp (atom
+ 1, "uplicates"))
689 if (!strcasecmp (atom
+ 1, "eclines"))
691 if (!strncasecmp (atom
+ 1, "efine", 5)) {
692 if (!strcasecmp (atom
+ 6, "d"))
699 if (isascii (atom
[1]) && tolower (atom
[1]) == 'x') {
700 if (!strcasecmp (atom
+ 2, "tract-int"))
702 if (!strcasecmp (atom
+ 2, "ists"))
704 if (!strcasecmp (atom
+ 2, "piry"))
706 if (!strcasecmp (atom
+ 2, "pire"))
708 if (!strcasecmp (atom
+ 2, "pired"))
709 return TOKEN_EXPIRED
;
711 if (!strcasecmp (atom
+ 1, "ncode-int"))
713 if (!strcasecmp (atom
+ 1, "thernet"))
715 if (!strcasecmp (atom
+ 1, "nds"))
717 if (!strncasecmp (atom
+ 1, "ls", 2)) {
718 if (!strcasecmp (atom
+ 3, "e"))
720 if (!strcasecmp (atom
+ 3, "if"))
724 if (!strcasecmp (atom
+ 1, "rror"))
726 if (!strcasecmp (atom
+ 1, "val"))
728 if (!strcasecmp (atom
+ 1, "ncapsulate"))
732 if (!strcasecmp (atom
+ 1, "atal"))
734 if (!strcasecmp (atom
+ 1, "ilename"))
736 if (!strcasecmp (atom
+ 1, "ixed-address"))
738 if (!strcasecmp (atom
+ 1, "ddi"))
740 if (!strcasecmp (atom
+ 1, "ormerr"))
742 if (!strcasecmp (atom
+ 1, "unction"))
744 if (!strcasecmp (atom
+ 1, "ailover"))
746 if (!strcasecmp (atom
+ 1, "ree"))
750 if (!strcasecmp (atom
+ 1, "iaddr"))
752 if (!strcasecmp (atom
+ 1, "roup"))
754 if (!strcasecmp (atom
+ 1, "et-lease-hostnames"))
755 return GET_LEASE_HOSTNAMES
;
758 if (!strcasecmp (atom
+ 1, "ba"))
760 if (!strcasecmp (atom
+ 1, "ost"))
762 if (!strcasecmp (atom
+ 1, "ost-decl-name"))
763 return HOST_DECL_NAME
;
764 if (!strcasecmp (atom
+ 1, "ardware"))
766 if (!strcasecmp (atom
+ 1, "ostname"))
768 if (!strcasecmp (atom
+ 1, "elp"))
772 if (!strcasecmp (atom
+ 1, "nclude"))
774 if (!strcasecmp (atom
+ 1, "nteger"))
776 if (!strcasecmp (atom
+ 1, "nfinite"))
778 if (!strcasecmp (atom
+ 1, "nfo"))
780 if (!strcasecmp (atom
+ 1, "p-address"))
782 if (!strcasecmp (atom
+ 1, "nitial-interval"))
783 return INITIAL_INTERVAL
;
784 if (!strcasecmp (atom
+ 1, "nterface"))
786 if (!strcasecmp (atom
+ 1, "dentifier"))
788 if (!strcasecmp (atom
+ 1, "f"))
790 if (!strcasecmp (atom
+ 1, "s"))
792 if (!strcasecmp (atom
+ 1, "gnore"))
796 if (!strncasecmp (atom
+ 1, "nown", 4)) {
797 if (!strcasecmp (atom
+ 5, "-clients"))
798 return KNOWN_CLIENTS
;
803 if (!strcasecmp (atom
+ 1, "ey"))
807 if (!strcasecmp (atom
+ 1, "ease"))
809 if (!strcasecmp (atom
+ 1, "eased-address"))
810 return LEASED_ADDRESS
;
811 if (!strcasecmp (atom
+ 1, "ease-time"))
813 if (!strcasecmp (atom
+ 1, "imit"))
815 if (!strcasecmp (atom
+ 1, "et"))
817 if (!strcasecmp (atom
+ 1, "oad"))
819 if (!strcasecmp (atom
+ 1, "og"))
823 if (!strncasecmp (atom
+ 1, "ax", 2)) {
826 if (!strcasecmp (atom
+ 3, "-lease-time"))
827 return MAX_LEASE_TIME
;
828 if (!strcasecmp (atom
+ 3, "-transmit-idle"))
829 return MAX_TRANSMIT_IDLE
;
830 if (!strcasecmp (atom
+ 3, "-response-delay"))
831 return MAX_RESPONSE_DELAY
;
832 if (!strcasecmp (atom
+ 3, "-unacked-updates"))
833 return MAX_UNACKED_UPDATES
;
835 if (!strncasecmp (atom
+ 1, "in-", 3)) {
836 if (!strcasecmp (atom
+ 4, "lease-time"))
837 return MIN_LEASE_TIME
;
838 if (!strcasecmp (atom
+ 4, "secs"))
842 if (!strncasecmp (atom
+ 1, "edi", 3)) {
843 if (!strcasecmp (atom
+ 4, "a"))
845 if (!strcasecmp (atom
+ 4, "um"))
849 if (!strcasecmp (atom
+ 1, "atch"))
851 if (!strcasecmp (atom
+ 1, "embers"))
853 if (!strcasecmp (atom
+ 1, "y"))
855 if (!strcasecmp (atom
+ 1, "clt"))
859 if (!strcasecmp (atom
+ 1, "ormal"))
861 if (!strcasecmp (atom
+ 1, "ameserver"))
863 if (!strcasecmp (atom
+ 1, "etmask"))
865 if (!strcasecmp (atom
+ 1, "ever"))
867 if (!strcasecmp (atom
+ 1, "ext-server"))
869 if (!strcasecmp (atom
+ 1, "ot"))
871 if (!strcasecmp (atom
+ 1, "o"))
873 if (!strcasecmp (atom
+ 1, "s-update"))
875 if (!strcasecmp (atom
+ 1, "oerror"))
877 if (!strcasecmp (atom
+ 1, "otauth"))
879 if (!strcasecmp (atom
+ 1, "otimp"))
881 if (!strcasecmp (atom
+ 1, "otzone"))
883 if (!strcasecmp (atom
+ 1, "xdomain"))
885 if (!strcasecmp (atom
+ 1, "xrrset"))
887 if (!strcasecmp (atom
+ 1, "ull"))
889 if (!strcasecmp (atom
+ 1, "ext"))
891 if (!strcasecmp (atom
+ 1, "ew"))
895 if (!strcasecmp (atom
+ 1, "mapi"))
897 if (!strcasecmp (atom
+ 1, "r"))
899 if (!strcasecmp (atom
+ 1, "n"))
901 if (!strcasecmp (atom
+ 1, "pen"))
903 if (!strcasecmp (atom
+ 1, "ption"))
905 if (!strcasecmp (atom
+ 1, "ne-lease-per-client"))
906 return ONE_LEASE_PER_CLIENT
;
907 if (!strcasecmp (atom
+ 1, "f"))
909 if (!strcasecmp (atom
+ 1, "wner"))
913 if (!strcasecmp (atom
+ 1, "repend"))
915 if (!strcasecmp (atom
+ 1, "acket"))
917 if (!strcasecmp (atom
+ 1, "ool"))
919 if (!strcasecmp (atom
+ 1, "seudo"))
921 if (!strcasecmp (atom
+ 1, "eer"))
923 if (!strcasecmp (atom
+ 1, "rimary"))
925 if (!strncasecmp (atom
+ 1, "artner", 6)) {
928 if (!strcasecmp (atom
+ 7, "-down"))
931 if (!strcasecmp (atom
+ 1, "ort"))
933 if (!strcasecmp (atom
+ 1, "otential-conflict"))
934 return POTENTIAL_CONFLICT
;
935 if (!strcasecmp (atom
+ 1, "ick-first-value") ||
936 !strcasecmp (atom
+ 1, "ick"))
938 if (!strcasecmp (atom
+ 1, "aused"))
942 if (!strcasecmp (atom
+ 1, "esolution-interrupted"))
943 return RESOLUTION_INTERRUPTED
;
944 if (!strcasecmp (atom
+ 1, "ange"))
946 if (!strcasecmp (atom
+ 1, "ecover"))
948 if (!strcasecmp (atom
+ 1, "ecover-done"))
950 if (!strcasecmp (atom
+ 1, "ecover-wait"))
952 if (!strcasecmp (atom
+ 1, "econtact-interval"))
953 return RECONTACT_INTERVAL
;
954 if (!strcasecmp (atom
+ 1, "equest"))
956 if (!strcasecmp (atom
+ 1, "equire"))
958 if (!strcasecmp (atom
+ 1, "equire"))
960 if (!strcasecmp (atom
+ 1, "etry"))
962 if (!strcasecmp (atom
+ 1, "eturn"))
964 if (!strcasecmp (atom
+ 1, "enew"))
966 if (!strcasecmp (atom
+ 1, "ebind"))
968 if (!strcasecmp (atom
+ 1, "eboot"))
970 if (!strcasecmp (atom
+ 1, "eject"))
972 if (!strcasecmp (atom
+ 1, "everse"))
974 if (!strcasecmp (atom
+ 1, "elease"))
976 if (!strcasecmp (atom
+ 1, "efused"))
978 if (!strcasecmp (atom
+ 1, "eleased"))
979 return TOKEN_RELEASED
;
980 if (!strcasecmp (atom
+ 1, "eset"))
982 if (!strcasecmp (atom
+ 1, "eserved"))
983 return TOKEN_RESERVED
;
984 if (!strcasecmp (atom
+ 1, "emove"))
986 if (!strcasecmp (atom
+ 1, "efresh"))
990 if (!strcasecmp (atom
+ 1, "tate"))
992 if (!strcasecmp (atom
+ 1, "ecret"))
994 if (!strcasecmp (atom
+ 1, "ervfail"))
996 if (!strcasecmp (atom
+ 1, "witch"))
998 if (!strcasecmp (atom
+ 1, "igned"))
1000 if (!strcasecmp (atom
+ 1, "tring"))
1001 return STRING_TOKEN
;
1002 if (!strcasecmp (atom
+ 1, "uffix"))
1004 if (!strcasecmp (atom
+ 1, "earch"))
1006 if (!strcasecmp (atom
+ 1, "tarts"))
1008 if (!strcasecmp (atom
+ 1, "iaddr"))
1010 if (!strcasecmp (atom
+ 1, "hared-network"))
1011 return SHARED_NETWORK
;
1012 if (!strcasecmp (atom
+ 1, "econdary"))
1014 if (!strcasecmp (atom
+ 1, "erver-name"))
1016 if (!strcasecmp (atom
+ 1, "erver-identifier"))
1017 return SERVER_IDENTIFIER
;
1018 if (!strcasecmp (atom
+ 1, "erver"))
1020 if (!strcasecmp (atom
+ 1, "elect-timeout"))
1021 return SELECT_TIMEOUT
;
1022 if (!strcasecmp (atom
+ 1, "elect"))
1024 if (!strcasecmp (atom
+ 1, "end"))
1026 if (!strcasecmp (atom
+ 1, "cript"))
1028 if (!strcasecmp (atom
+ 1, "upersede"))
1030 if (!strncasecmp (atom
+ 1, "ub", 2)) {
1031 if (!strcasecmp (atom
+ 3, "string"))
1033 if (!strcasecmp (atom
+ 3, "net"))
1035 if (!strcasecmp (atom
+ 3, "class"))
1039 if (!strcasecmp (atom
+ 1, "pawn"))
1041 if (!strcasecmp (atom
+ 1, "pace"))
1043 if (!strcasecmp (atom
+ 1, "tatic"))
1045 if (!strcasecmp (atom
+ 1, "plit"))
1047 if (!strcasecmp (atom
+ 1, "et"))
1049 if (!strcasecmp (atom
+ 1, "econds"))
1051 if (!strcasecmp (atom
+ 1, "hutdown"))
1053 if (!strcasecmp (atom
+ 1, "tartup"))
1057 if (!strcasecmp (atom
+ 1, "imestamp"))
1059 if (!strcasecmp (atom
+ 1, "imeout"))
1061 if (!strcasecmp (atom
+ 1, "oken-ring"))
1063 if (!strcasecmp (atom
+ 1, "ext"))
1065 if (!strcasecmp (atom
+ 1, "stp"))
1067 if (!strcasecmp (atom
+ 1, "sfp"))
1069 if (!strcasecmp (atom
+ 1, "ransmission"))
1070 return TRANSMISSION
;
1073 if (!strcasecmp (atom
+ 1, "nset"))
1075 if (!strcasecmp (atom
+ 1, "nsigned"))
1077 if (!strcasecmp (atom
+ 1, "id"))
1079 if (!strncasecmp (atom
+ 1, "se", 2)) {
1080 if (!strcasecmp (atom
+ 3, "r-class"))
1082 if (!strcasecmp (atom
+ 3, "-host-decl-names"))
1083 return USE_HOST_DECL_NAMES
;
1084 if (!strcasecmp (atom
+ 3,
1085 "-lease-addr-for-default-route"))
1086 return USE_LEASE_ADDR_FOR_DEFAULT_ROUTE
;
1089 if (!strncasecmp (atom
+ 1, "nknown", 6)) {
1090 if (!strcasecmp (atom
+ 7, "-clients"))
1091 return UNKNOWN_CLIENTS
;
1092 if (!strcasecmp (atom
+ 7, "-state"))
1093 return UNKNOWN_STATE
;
1098 if (!strcasecmp (atom
+ 1, "nauthenticated"))
1099 return AUTHENTICATED
;
1100 if (!strcasecmp (atom
+ 1, "pdated-dns-rr"))
1101 return UPDATED_DNS_RR
;
1102 if (!strcasecmp (atom
+ 1, "pdate"))
1106 if (!strcasecmp (atom
+ 1, "endor-class"))
1107 return VENDOR_CLASS
;
1108 if (!strcasecmp (atom
+ 1, "endor"))
1112 if (!strcasecmp (atom
+ 1, "ith"))
1116 if (!strcasecmp (atom
+ 1, "iaddr"))
1118 if (!strcasecmp (atom
+ 1, "xdomain"))
1120 if (!strcasecmp (atom
+ 1, "xrrset"))
1124 if (!strcasecmp (atom
+ 1, "one"))