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: conflex.c,v 1.5 2005/08/11 17:13:21 drochner Exp $ 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
;
170 c
= get_char (cfile
);
172 if (c
== '\n' && p
== 1 && !u
173 && cfile
-> comment_index
< sizeof cfile
-> comments
)
174 cfile
-> comments
[cfile
-> comment_index
++] = '\n';
177 if (!(c
== '\n' && cfile
-> eol_token
)
178 && isascii (c
) && isspace (c
))
182 if (cfile
-> comment_index
< sizeof cfile
-> comments
)
183 cfile
-> comments
[cfile
-> comment_index
++] = '#';
189 cfile
-> lexline
= l
;
190 cfile
-> lexchar
= p
;
191 ttok
= read_string (cfile
);
194 if ((isascii (c
) && isdigit (c
)) || c
== '-') {
195 cfile
-> lexline
= l
;
196 cfile
-> lexchar
= p
;
197 ttok
= read_number (c
, cfile
);
199 } else if (isascii (c
) && isalpha (c
)) {
200 cfile
-> lexline
= l
;
201 cfile
-> lexchar
= p
;
202 ttok
= read_num_or_name (c
, cfile
);
204 } else if (c
== EOF
) {
209 cfile
-> lexline
= l
;
210 cfile
-> lexchar
= p
;
222 enum dhcp_token
next_token (rval
, rlen
, cfile
)
229 if (cfile
-> token
) {
230 if (cfile
-> lexline
!= cfile
-> tline
)
231 cfile
-> token_line
= cfile
-> cur_line
;
232 cfile
-> lexchar
= cfile
-> tlpos
;
233 cfile
-> lexline
= cfile
-> tline
;
237 rv
= get_token (cfile
);
238 cfile
-> token_line
= cfile
-> cur_line
;
241 *rval
= cfile
-> tval
;
243 *rlen
= cfile
-> tlen
;
245 fprintf (stderr
, "%s:%d ", cfile
-> tval
, rv
);
250 enum dhcp_token
peek_token (rval
, rlen
, cfile
)
257 if (!cfile
-> token
) {
258 cfile
-> tlpos
= cfile
-> lexchar
;
259 cfile
-> tline
= cfile
-> lexline
;
260 cfile
-> token
= get_token (cfile
);
261 if (cfile
-> lexline
!= cfile
-> tline
)
262 cfile
-> token_line
= cfile
-> prev_line
;
264 x
= cfile
-> lexchar
;
265 cfile
-> lexchar
= cfile
-> tlpos
;
268 x
= cfile
-> lexline
;
269 cfile
-> lexline
= cfile
-> tline
;
273 *rval
= cfile
-> tval
;
275 *rlen
= cfile
-> tlen
;
277 fprintf (stderr
, "(%s:%d) ", cfile
-> tval
, cfile
-> token
);
279 return cfile
-> token
;
282 static void skip_to_eol (cfile
)
287 c
= get_char (cfile
);
291 if (cfile
-> comment_index
< sizeof (cfile
-> comments
))
292 comments
[cfile
-> comment_index
++] = c
;
300 static enum dhcp_token
read_string (cfile
)
309 value
= 0; /* XXXGCC -Wuninitialized */
310 hex
= 0; /* XXXGCC -Wuninitialized */
312 for (i
= 0; i
< sizeof cfile
-> tokbuf
; i
++) {
314 c
= get_char (cfile
);
316 parse_warn (cfile
, "eof in string constant");
322 cfile
-> tokbuf
[i
] = '\t';
325 cfile
-> tokbuf
[i
] = '\r';
328 cfile
-> tokbuf
[i
] = '\n';
331 cfile
-> tokbuf
[i
] = '\b';
347 cfile
-> tokbuf
[i
] = c
;
354 if (c
>= '0' && c
<= '9') {
355 value
= value
* 16 + (c
- '0');
356 } else if (c
>= 'a' && c
<= 'f') {
357 value
= value
* 16 + (c
- 'a' + 10);
358 } else if (c
>= 'A' && c
<= 'F') {
359 value
= value
* 16 + (c
- 'A' + 10);
362 "invalid hex digit: %x",
368 cfile
-> tokbuf
[i
] = value
;
373 if (c
>= '0' && c
<= '9') {
374 value
= value
* 8 + (c
- '0');
378 "invalid octal digit %x",
382 cfile
-> tokbuf
[i
] = 0;
386 cfile
-> tokbuf
[i
] = value
;
391 } else if (c
== '\\') {
397 cfile
-> tokbuf
[i
] = c
;
399 /* Normally, I'd feel guilty about this, but we're talking about
400 strings that'll fit in a DHCP packet here... */
401 if (i
== sizeof cfile
-> tokbuf
) {
403 "string constant larger than internal buffer");
406 cfile
-> tokbuf
[i
] = 0;
408 cfile
-> tval
= cfile
-> tokbuf
;
412 static enum dhcp_token
read_number (c
, cfile
)
422 cfile
-> tokbuf
[i
++] = c
;
423 for (; i
< sizeof cfile
-> tokbuf
; i
++) {
424 c
= get_char (cfile
);
427 /* Promote NUMBER -> NUMBER_OR_NAME -> NAME, never demote.
428 * Except in the case of '0x' syntax hex, which gets called
429 * a NAME at '0x', and returned to NUMBER_OR_NAME once it's
430 * verified to be at least 0xf or less.
432 switch(isascii(c
) ? token
: BREAK
) {
439 token
= NUMBER_OR_NAME
;
444 if((i
== 2) && isxdigit(c
) &&
445 (cfile
->tokbuf
[0] == '0') &&
446 ((cfile
->tokbuf
[1] == 'x') ||
447 (cfile
->tokbuf
[1] == 'X'))) {
448 token
= NUMBER_OR_NAME
;
450 } else if(((c
== '-') || (c
== '_') || isalnum(c
))) {
456 /* At this point c is either EOF or part of the next
457 * token. If not EOF, rewind the file one byte so
458 * the next token is read from there.
467 log_fatal("read_number():%s:%d: impossible case", MDL
);
469 #else /* OLD_LEXER */
470 if (!seenx
&& (c
== 'x') {
472 } else if (!isascii (c
) || !isxdigit (c
)) {
479 #endif /* OLD_LEXER */
481 cfile
-> tokbuf
[i
] = c
;
484 if (i
== sizeof cfile
-> tokbuf
) {
486 "numeric token larger than internal buffer");
491 cfile
-> tokbuf
[i
] = 0;
493 cfile
-> tval
= cfile
-> tokbuf
;
498 static enum dhcp_token
read_num_or_name (c
, cfile
)
503 enum dhcp_token rv
= NUMBER_OR_NAME
;
504 cfile
-> tokbuf
[i
++] = c
;
505 for (; i
< sizeof cfile
-> tokbuf
; i
++) {
506 c
= get_char (cfile
);
508 (c
!= '-' && c
!= '_' && !isalnum (c
))) {
517 cfile
-> tokbuf
[i
] = c
;
519 if (i
== sizeof cfile
-> tokbuf
) {
520 parse_warn (cfile
, "token larger than internal buffer");
523 cfile
-> tokbuf
[i
] = 0;
525 cfile
-> tval
= cfile
-> tokbuf
;
526 return intern (cfile
-> tval
, rv
);
529 static enum dhcp_token
intern (atom
, dfv
)
533 if (!isascii (atom
[0]))
536 switch (tolower ((unsigned char)atom
[0])) {
543 if (!strncasecmp (atom
+ 1, "uth", 3)) {
544 if (!strncasecmp (atom
+ 3, "uthenticat", 10)) {
545 if (!strcasecmp (atom
+ 13, "ed"))
546 return AUTHENTICATED
;
547 if (!strcasecmp (atom
+ 13, "ion"))
548 return AUTHENTICATION
;
551 if (!strcasecmp (atom
+ 1, "uthoritative"))
552 return AUTHORITATIVE
;
555 if (!strcasecmp (atom
+ 1, "nd"))
557 if (!strcasecmp (atom
+ 1, "ppend"))
559 if (!strcasecmp (atom
+ 1, "llow"))
561 if (!strcasecmp (atom
+ 1, "lias"))
563 if (!strcasecmp (atom
+ 1, "lgorithm"))
565 if (!strcasecmp (atom
+ 1, "bandoned"))
566 return TOKEN_ABANDONED
;
567 if (!strcasecmp (atom
+ 1, "dd"))
569 if (!strcasecmp (atom
+ 1, "ll"))
571 if (!strcasecmp (atom
+ 1, "t"))
573 if (!strcasecmp (atom
+ 1, "rray"))
575 if (!strcasecmp (atom
+ 1, "ddress"))
577 if (!strcasecmp (atom
+ 1, "ctive"))
581 if (!strcasecmp (atom
+ 1, "ackup"))
583 if (!strcasecmp (atom
+ 1, "ootp"))
585 if (!strcasecmp (atom
+ 1, "inding"))
587 if (!strcasecmp (atom
+ 1, "inary-to-ascii"))
588 return BINARY_TO_ASCII
;
589 if (!strcasecmp (atom
+ 1, "ackoff-cutoff"))
590 return BACKOFF_CUTOFF
;
591 if (!strcasecmp (atom
+ 1, "ooting"))
593 if (!strcasecmp (atom
+ 1, "oot-unknown-clients"))
594 return BOOT_UNKNOWN_CLIENTS
;
595 if (!strcasecmp (atom
+ 1, "reak"))
597 if (!strcasecmp (atom
+ 1, "illing"))
599 if (!strcasecmp (atom
+ 1, "oolean"))
601 if (!strcasecmp (atom
+ 1, "alance"))
603 if (!strcasecmp (atom
+ 1, "ound"))
607 if (!strcasecmp (atom
+ 1, "ase"))
609 if (!strcasecmp (atom
+ 1, "ommit"))
611 if (!strcasecmp (atom
+ 1, "ode"))
613 if (!strcasecmp (atom
+ 1, "onfig-option"))
614 return CONFIG_OPTION
;
615 if (!strcasecmp (atom
+ 1, "heck"))
617 if (!strcasecmp (atom
+ 1, "lass"))
619 if (!strcasecmp (atom
+ 1, "lose"))
621 if (!strcasecmp (atom
+ 1, "reate"))
623 if (!strcasecmp (atom
+ 1, "iaddr"))
625 if (!strncasecmp (atom
+ 1, "lient", 5)) {
626 if (!strcasecmp (atom
+ 6, "-identifier"))
627 return CLIENT_IDENTIFIER
;
628 if (!strcasecmp (atom
+ 6, "-hostname"))
629 return CLIENT_HOSTNAME
;
630 if (!strcasecmp (atom
+ 6, "-state"))
632 if (!strcasecmp (atom
+ 6, "-updates"))
633 return CLIENT_UPDATES
;
634 if (!strcasecmp (atom
+ 6, "s"))
637 if (!strcasecmp (atom
+ 1, "oncat"))
639 if (!strcasecmp (atom
+ 1, "onnect"))
641 if (!strcasecmp (atom
+ 1, "ommunications-interrupted"))
642 return COMMUNICATIONS_INTERRUPTED
;
643 if (!strcasecmp (atom
+ 1, "ltt"))
647 if (!strcasecmp (atom
+ 1, "ns-update"))
649 if (!strcasecmp (atom
+ 1, "ns-delete"))
651 if (!strcasecmp (atom
+ 1, "omain"))
653 if (!strcasecmp (atom
+ 1, "omain-name"))
655 if (!strcasecmp (atom
+ 1, "o-forward-update"))
656 return DO_FORWARD_UPDATE
;
657 if (!strcasecmp (atom
+ 1, "ebug"))
659 if (!strcasecmp (atom
+ 1, "eny"))
661 if (!strcasecmp (atom
+ 1, "eleted"))
662 return TOKEN_DELETED
;
663 if (!strcasecmp (atom
+ 1, "elete"))
665 if (!strncasecmp (atom
+ 1, "efault", 6)) {
668 if (!strcasecmp (atom
+ 7, "-lease-time"))
669 return DEFAULT_LEASE_TIME
;
672 if (!strncasecmp (atom
+ 1, "ynamic", 6)) {
675 if (!strncasecmp (atom
+ 7, "-bootp", 6)) {
677 return DYNAMIC_BOOTP
;
678 if (!strcasecmp (atom
+ 13, "-lease-cutoff"))
679 return DYNAMIC_BOOTP_LEASE_CUTOFF
;
680 if (!strcasecmp (atom
+ 13, "-lease-length"))
681 return DYNAMIC_BOOTP_LEASE_LENGTH
;
685 if (!strcasecmp (atom
+ 1, "uplicates"))
687 if (!strcasecmp (atom
+ 1, "eclines"))
689 if (!strncasecmp (atom
+ 1, "efine", 5)) {
690 if (!strcasecmp (atom
+ 6, "d"))
697 if (tolower ((unsigned char)atom
[1]) == 'x') {
698 if (!strcasecmp (atom
+ 2, "tract-int"))
700 if (!strcasecmp (atom
+ 2, "ists"))
702 if (!strcasecmp (atom
+ 2, "piry"))
704 if (!strcasecmp (atom
+ 2, "pire"))
706 if (!strcasecmp (atom
+ 2, "pired"))
707 return TOKEN_EXPIRED
;
709 if (!strcasecmp (atom
+ 1, "ncode-int"))
711 if (!strcasecmp (atom
+ 1, "thernet"))
713 if (!strcasecmp (atom
+ 1, "nds"))
715 if (!strncasecmp (atom
+ 1, "ls", 2)) {
716 if (!strcasecmp (atom
+ 3, "e"))
718 if (!strcasecmp (atom
+ 3, "if"))
722 if (!strcasecmp (atom
+ 1, "rror"))
724 if (!strcasecmp (atom
+ 1, "val"))
726 if (!strcasecmp (atom
+ 1, "ncapsulate"))
730 if (!strcasecmp (atom
+ 1, "atal"))
732 if (!strcasecmp (atom
+ 1, "ilename"))
734 if (!strcasecmp (atom
+ 1, "ixed-address"))
736 if (!strcasecmp (atom
+ 1, "ddi"))
738 if (!strcasecmp (atom
+ 1, "ormerr"))
740 if (!strcasecmp (atom
+ 1, "unction"))
742 if (!strcasecmp (atom
+ 1, "ailover"))
744 if (!strcasecmp (atom
+ 1, "ree"))
748 if (!strcasecmp (atom
+ 1, "iaddr"))
750 if (!strcasecmp (atom
+ 1, "roup"))
752 if (!strcasecmp (atom
+ 1, "et-lease-hostnames"))
753 return GET_LEASE_HOSTNAMES
;
756 if (!strcasecmp (atom
+ 1, "ba"))
758 if (!strcasecmp (atom
+ 1, "ost"))
760 if (!strcasecmp (atom
+ 1, "ost-decl-name"))
761 return HOST_DECL_NAME
;
762 if (!strcasecmp (atom
+ 1, "ardware"))
764 if (!strcasecmp (atom
+ 1, "ostname"))
766 if (!strcasecmp (atom
+ 1, "elp"))
770 if (!strcasecmp (atom
+ 1, "nclude"))
772 if (!strcasecmp (atom
+ 1, "nteger"))
774 if (!strcasecmp (atom
+ 1, "nfinite"))
776 if (!strcasecmp (atom
+ 1, "nfo"))
778 if (!strcasecmp (atom
+ 1, "p-address"))
780 if (!strcasecmp (atom
+ 1, "nitial-interval"))
781 return INITIAL_INTERVAL
;
782 if (!strcasecmp (atom
+ 1, "nterface"))
784 if (!strcasecmp (atom
+ 1, "dentifier"))
786 if (!strcasecmp (atom
+ 1, "f"))
788 if (!strcasecmp (atom
+ 1, "s"))
790 if (!strcasecmp (atom
+ 1, "gnore"))
794 if (!strncasecmp (atom
+ 1, "nown", 4)) {
795 if (!strcasecmp (atom
+ 5, "-clients"))
796 return KNOWN_CLIENTS
;
801 if (!strcasecmp (atom
+ 1, "ey"))
805 if (!strcasecmp (atom
+ 1, "ease"))
807 if (!strcasecmp (atom
+ 1, "eased-address"))
808 return LEASED_ADDRESS
;
809 if (!strcasecmp (atom
+ 1, "ease-time"))
811 if (!strcasecmp (atom
+ 1, "imit"))
813 if (!strcasecmp (atom
+ 1, "et"))
815 if (!strcasecmp (atom
+ 1, "oad"))
817 if (!strcasecmp (atom
+ 1, "og"))
821 if (!strncasecmp (atom
+ 1, "ax", 2)) {
824 if (!strcasecmp (atom
+ 3, "-lease-time"))
825 return MAX_LEASE_TIME
;
826 if (!strcasecmp (atom
+ 3, "-transmit-idle"))
827 return MAX_TRANSMIT_IDLE
;
828 if (!strcasecmp (atom
+ 3, "-response-delay"))
829 return MAX_RESPONSE_DELAY
;
830 if (!strcasecmp (atom
+ 3, "-unacked-updates"))
831 return MAX_UNACKED_UPDATES
;
833 if (!strncasecmp (atom
+ 1, "in-", 3)) {
834 if (!strcasecmp (atom
+ 4, "lease-time"))
835 return MIN_LEASE_TIME
;
836 if (!strcasecmp (atom
+ 4, "secs"))
840 if (!strncasecmp (atom
+ 1, "edi", 3)) {
841 if (!strcasecmp (atom
+ 4, "a"))
843 if (!strcasecmp (atom
+ 4, "um"))
847 if (!strcasecmp (atom
+ 1, "atch"))
849 if (!strcasecmp (atom
+ 1, "embers"))
851 if (!strcasecmp (atom
+ 1, "y"))
853 if (!strcasecmp (atom
+ 1, "clt"))
857 if (!strcasecmp (atom
+ 1, "ormal"))
859 if (!strcasecmp (atom
+ 1, "ameserver"))
861 if (!strcasecmp (atom
+ 1, "etmask"))
863 if (!strcasecmp (atom
+ 1, "ever"))
865 if (!strcasecmp (atom
+ 1, "ext-server"))
867 if (!strcasecmp (atom
+ 1, "ot"))
869 if (!strcasecmp (atom
+ 1, "o"))
871 if (!strcasecmp (atom
+ 1, "s-update"))
873 if (!strcasecmp (atom
+ 1, "oerror"))
875 if (!strcasecmp (atom
+ 1, "otauth"))
877 if (!strcasecmp (atom
+ 1, "otimp"))
879 if (!strcasecmp (atom
+ 1, "otzone"))
881 if (!strcasecmp (atom
+ 1, "xdomain"))
883 if (!strcasecmp (atom
+ 1, "xrrset"))
885 if (!strcasecmp (atom
+ 1, "ull"))
887 if (!strcasecmp (atom
+ 1, "ext"))
889 if (!strcasecmp (atom
+ 1, "ew"))
893 if (!strcasecmp (atom
+ 1, "mapi"))
895 if (!strcasecmp (atom
+ 1, "r"))
897 if (!strcasecmp (atom
+ 1, "n"))
899 if (!strcasecmp (atom
+ 1, "pen"))
901 if (!strcasecmp (atom
+ 1, "ption"))
903 if (!strcasecmp (atom
+ 1, "ne-lease-per-client"))
904 return ONE_LEASE_PER_CLIENT
;
905 if (!strcasecmp (atom
+ 1, "f"))
907 if (!strcasecmp (atom
+ 1, "wner"))
911 if (!strcasecmp (atom
+ 1, "repend"))
913 if (!strcasecmp (atom
+ 1, "acket"))
915 if (!strcasecmp (atom
+ 1, "ool"))
917 if (!strcasecmp (atom
+ 1, "seudo"))
919 if (!strcasecmp (atom
+ 1, "eer"))
921 if (!strcasecmp (atom
+ 1, "rimary"))
923 if (!strncasecmp (atom
+ 1, "artner", 6)) {
926 if (!strcasecmp (atom
+ 7, "-down"))
929 if (!strcasecmp (atom
+ 1, "ort"))
931 if (!strcasecmp (atom
+ 1, "otential-conflict"))
932 return POTENTIAL_CONFLICT
;
933 if (!strcasecmp (atom
+ 1, "ick-first-value") ||
934 !strcasecmp (atom
+ 1, "ick"))
936 if (!strcasecmp (atom
+ 1, "aused"))
940 if (!strcasecmp (atom
+ 1, "esolution-interrupted"))
941 return RESOLUTION_INTERRUPTED
;
942 if (!strcasecmp (atom
+ 1, "ange"))
944 if (!strcasecmp (atom
+ 1, "ecover"))
946 if (!strcasecmp (atom
+ 1, "ecover-done"))
948 if (!strcasecmp (atom
+ 1, "ecover-wait"))
950 if (!strcasecmp (atom
+ 1, "econtact-interval"))
951 return RECONTACT_INTERVAL
;
952 if (!strcasecmp (atom
+ 1, "equest"))
954 if (!strcasecmp (atom
+ 1, "equire"))
956 if (!strcasecmp (atom
+ 1, "equire"))
958 if (!strcasecmp (atom
+ 1, "etry"))
960 if (!strcasecmp (atom
+ 1, "eturn"))
962 if (!strcasecmp (atom
+ 1, "enew"))
964 if (!strcasecmp (atom
+ 1, "ebind"))
966 if (!strcasecmp (atom
+ 1, "eboot"))
968 if (!strcasecmp (atom
+ 1, "eject"))
970 if (!strcasecmp (atom
+ 1, "everse"))
972 if (!strcasecmp (atom
+ 1, "elease"))
974 if (!strcasecmp (atom
+ 1, "efused"))
976 if (!strcasecmp (atom
+ 1, "eleased"))
977 return TOKEN_RELEASED
;
978 if (!strcasecmp (atom
+ 1, "eset"))
980 if (!strcasecmp (atom
+ 1, "eserved"))
981 return TOKEN_RESERVED
;
982 if (!strcasecmp (atom
+ 1, "emove"))
984 if (!strcasecmp (atom
+ 1, "efresh"))
988 if (!strcasecmp (atom
+ 1, "tate"))
990 if (!strcasecmp (atom
+ 1, "ecret"))
992 if (!strcasecmp (atom
+ 1, "ervfail"))
994 if (!strcasecmp (atom
+ 1, "witch"))
996 if (!strcasecmp (atom
+ 1, "igned"))
998 if (!strcasecmp (atom
+ 1, "tring"))
1000 if (!strcasecmp (atom
+ 1, "uffix"))
1002 if (!strcasecmp (atom
+ 1, "earch"))
1004 if (!strcasecmp (atom
+ 1, "tarts"))
1006 if (!strcasecmp (atom
+ 1, "iaddr"))
1008 if (!strcasecmp (atom
+ 1, "hared-network"))
1009 return SHARED_NETWORK
;
1010 if (!strcasecmp (atom
+ 1, "econdary"))
1012 if (!strcasecmp (atom
+ 1, "erver-name"))
1014 if (!strcasecmp (atom
+ 1, "erver-identifier"))
1015 return SERVER_IDENTIFIER
;
1016 if (!strcasecmp (atom
+ 1, "erver"))
1018 if (!strcasecmp (atom
+ 1, "elect-timeout"))
1019 return SELECT_TIMEOUT
;
1020 if (!strcasecmp (atom
+ 1, "elect"))
1022 if (!strcasecmp (atom
+ 1, "end"))
1024 if (!strcasecmp (atom
+ 1, "cript"))
1026 if (!strcasecmp (atom
+ 1, "upersede"))
1028 if (!strncasecmp (atom
+ 1, "ub", 2)) {
1029 if (!strcasecmp (atom
+ 3, "string"))
1031 if (!strcasecmp (atom
+ 3, "net"))
1033 if (!strcasecmp (atom
+ 3, "class"))
1037 if (!strcasecmp (atom
+ 1, "pawn"))
1039 if (!strcasecmp (atom
+ 1, "pace"))
1041 if (!strcasecmp (atom
+ 1, "tatic"))
1043 if (!strcasecmp (atom
+ 1, "plit"))
1045 if (!strcasecmp (atom
+ 1, "et"))
1047 if (!strcasecmp (atom
+ 1, "econds"))
1049 if (!strcasecmp (atom
+ 1, "hutdown"))
1051 if (!strcasecmp (atom
+ 1, "tartup"))
1055 if (!strcasecmp (atom
+ 1, "imestamp"))
1057 if (!strcasecmp (atom
+ 1, "imeout"))
1059 if (!strcasecmp (atom
+ 1, "oken-ring"))
1061 if (!strcasecmp (atom
+ 1, "ext"))
1063 if (!strcasecmp (atom
+ 1, "stp"))
1065 if (!strcasecmp (atom
+ 1, "sfp"))
1067 if (!strcasecmp (atom
+ 1, "ransmission"))
1068 return TRANSMISSION
;
1071 if (!strcasecmp (atom
+ 1, "nset"))
1073 if (!strcasecmp (atom
+ 1, "nsigned"))
1075 if (!strcasecmp (atom
+ 1, "id"))
1077 if (!strncasecmp (atom
+ 1, "se", 2)) {
1078 if (!strcasecmp (atom
+ 3, "r-class"))
1080 if (!strcasecmp (atom
+ 3, "-host-decl-names"))
1081 return USE_HOST_DECL_NAMES
;
1082 if (!strcasecmp (atom
+ 3,
1083 "-lease-addr-for-default-route"))
1084 return USE_LEASE_ADDR_FOR_DEFAULT_ROUTE
;
1087 if (!strncasecmp (atom
+ 1, "nknown", 6)) {
1088 if (!strcasecmp (atom
+ 7, "-clients"))
1089 return UNKNOWN_CLIENTS
;
1090 if (!strcasecmp (atom
+ 7, "-state"))
1091 return UNKNOWN_STATE
;
1096 if (!strcasecmp (atom
+ 1, "nauthenticated"))
1097 return AUTHENTICATED
;
1098 if (!strcasecmp (atom
+ 1, "pdated-dns-rr"))
1099 return UPDATED_DNS_RR
;
1100 if (!strcasecmp (atom
+ 1, "pdate"))
1104 if (!strcasecmp (atom
+ 1, "endor-class"))
1105 return VENDOR_CLASS
;
1106 if (!strcasecmp (atom
+ 1, "endor"))
1110 if (!strcasecmp (atom
+ 1, "ith"))
1114 if (!strcasecmp (atom
+ 1, "iaddr"))
1116 if (!strcasecmp (atom
+ 1, "xdomain"))
1118 if (!strcasecmp (atom
+ 1, "xrrset"))
1122 if (!strcasecmp (atom
+ 1, "one"))