3 Lexical scanner for dhcpd config file... */
6 * Copyright (c) 1995-2002 Internet Software Consortium.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of The Internet Software Consortium nor the names
19 * of its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
23 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
24 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
27 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
30 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
33 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * This software has been written for the Internet Software Consortium
37 * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
38 * To learn more about the Internet Software Consortium, see
39 * ``http://www.isc.org/''. To learn more about Vixie Enterprises,
40 * see ``http://www.vix.com''. To learn more about Nominum, Inc., see
41 * ``http://www.nominum.com''.
45 static char copyright[] =
46 "$Id: conflex.c,v 1.92.2.6 2002/11/17 02:26:56 dhankins Exp $ Copyright (c) 1995-2002 The Internet Software Consortium. All rights reserved.\n";
52 static int get_char PROTO ((struct parse *));
53 static enum dhcp_token get_token PROTO ((struct parse *));
54 static void skip_to_eol PROTO ((struct parse *));
55 static enum dhcp_token read_string PROTO ((struct parse *));
56 static enum dhcp_token read_number PROTO ((int, struct parse *));
57 static enum dhcp_token read_num_or_name PROTO ((int, struct parse *));
58 static enum dhcp_token intern PROTO ((char *, enum dhcp_token));
60 isc_result_t new_parse (cfile, file, inbuf, buflen, name, eolp)
70 tmp = dmalloc (sizeof (struct parse), MDL);
72 return ISC_R_NOMEMORY;
73 memset (tmp, 0, sizeof *tmp);
77 tmp -> lpos = tmp -> line = 1;
78 tmp -> cur_line = tmp -> line1;
79 tmp -> prev_line = tmp -> line2;
80 tmp -> token_line = tmp -> cur_line;
81 tmp -> cur_line [0] = tmp -> prev_line [0] = 0;
82 tmp -> warnings_occurred = 0;
84 tmp -> eol_token = eolp;
87 tmp -> buflen = buflen;
92 tmp -> inbuf = dmalloc (8192, MDL);
95 return ISC_R_NOMEMORY;
101 return ISC_R_SUCCESS;
104 isc_result_t end_parse (cfile)
105 struct parse **cfile;
107 if ((*cfile) -> bufsiz)
108 dfree ((*cfile) -> inbuf, MDL);
110 *cfile = (struct parse *)0;
111 return ISC_R_SUCCESS;
114 static int get_char (cfile)
117 /* My kingdom for WITH... */
120 if (cfile -> bufix == cfile -> buflen) {
121 if (cfile -> file != -1) {
124 cfile -> inbuf, cfile -> bufsiz);
125 if (cfile -> buflen == 0) {
128 } else if (cfile -> buflen < 0) {
130 cfile -> bufix = cfile -> buflen = 0;
132 c = cfile -> inbuf [0];
138 c = cfile -> inbuf [cfile -> bufix];
142 if (!cfile -> ugflag) {
144 if (cfile -> cur_line == cfile -> line1) {
145 cfile -> cur_line = cfile -> line2;
146 cfile -> prev_line = cfile -> line1;
148 cfile -> cur_line = cfile -> line1;
149 cfile -> prev_line = cfile -> line2;
153 cfile -> cur_line [0] = 0;
154 } else if (c != EOF) {
155 if (cfile -> lpos <= 80) {
156 cfile -> cur_line [cfile -> lpos - 1] = c;
157 cfile -> cur_line [cfile -> lpos] = 0;
166 static enum dhcp_token get_token (cfile)
170 enum dhcp_token ttok;
179 c = get_char (cfile);
181 if (c == '\n' && p == 1 && !u
182 && cfile -> comment_index < sizeof cfile -> comments)
183 cfile -> comments [cfile -> comment_index++] = '\n';
186 if (!(c == '\n' && cfile -> eol_token)
187 && isascii (c) && isspace (c))
191 if (cfile -> comment_index < sizeof cfile -> comments)
192 cfile -> comments [cfile -> comment_index++] = '#';
198 cfile -> lexline = l;
199 cfile -> lexchar = p;
200 ttok = read_string (cfile);
203 if ((isascii (c) && isdigit (c)) || c == '-') {
204 cfile -> lexline = l;
205 cfile -> lexchar = p;
206 ttok = read_number (c, cfile);
208 } else if (isascii (c) && isalpha (c)) {
209 cfile -> lexline = l;
210 cfile -> lexchar = p;
211 ttok = read_num_or_name (c, cfile);
213 } else if (c == EOF) {
218 cfile -> lexline = l;
219 cfile -> lexchar = p;
231 enum dhcp_token next_token (rval, rlen, cfile)
238 if (cfile -> token) {
239 if (cfile -> lexline != cfile -> tline)
240 cfile -> token_line = cfile -> cur_line;
241 cfile -> lexchar = cfile -> tlpos;
242 cfile -> lexline = cfile -> tline;
246 rv = get_token (cfile);
247 cfile -> token_line = cfile -> cur_line;
250 *rval = cfile -> tval;
252 *rlen = cfile -> tlen;
254 fprintf (stderr, "%s:%d ", cfile -> tval, rv);
259 enum dhcp_token peek_token (rval, rlen, cfile)
266 if (!cfile -> token) {
267 cfile -> tlpos = cfile -> lexchar;
268 cfile -> tline = cfile -> lexline;
269 cfile -> token = get_token (cfile);
270 if (cfile -> lexline != cfile -> tline)
271 cfile -> token_line = cfile -> prev_line;
273 x = cfile -> lexchar;
274 cfile -> lexchar = cfile -> tlpos;
277 x = cfile -> lexline;
278 cfile -> lexline = cfile -> tline;
282 *rval = cfile -> tval;
284 *rlen = cfile -> tlen;
286 fprintf (stderr, "(%s:%d) ", cfile -> tval, cfile -> token);
288 return cfile -> token;
291 static void skip_to_eol (cfile)
296 c = get_char (cfile);
300 if (cfile -> comment_index < sizeof (cfile -> comments))
301 comments [cfile -> comment_index++] = c;
309 static enum dhcp_token read_string (cfile)
318 for (i = 0; i < sizeof cfile -> tokbuf; i++) {
320 c = get_char (cfile);
322 parse_warn (cfile, "eof in string constant");
328 cfile -> tokbuf [i] = '\t';
331 cfile -> tokbuf [i] = '\r';
334 cfile -> tokbuf [i] = '\n';
337 cfile -> tokbuf [i] = '\b';
353 cfile -> tokbuf [i] = c;
360 if (c >= '0' && c <= '9') {
361 value = value * 16 + (c - '0');
362 } else if (c >= 'a' && c <= 'f') {
363 value = value * 16 + (c - 'a' + 10);
364 } else if (c >= 'A' && c <= 'F') {
365 value = value * 16 + (c - 'A' + 10);
368 "invalid hex digit: %x",
374 cfile -> tokbuf [i] = value;
379 if (c >= '0' && c <= '9') {
380 value = value * 8 + (c - '0');
384 "invalid octal digit %x",
388 cfile -> tokbuf [i] = 0;
392 cfile -> tokbuf [i] = value;
397 } else if (c == '\\') {
403 cfile -> tokbuf [i] = c;
405 /* Normally, I'd feel guilty about this, but we're talking about
406 strings that'll fit in a DHCP packet here... */
407 if (i == sizeof cfile -> tokbuf) {
409 "string constant larger than internal buffer");
412 cfile -> tokbuf [i] = 0;
414 cfile -> tval = cfile -> tokbuf;
418 static enum dhcp_token read_number (c, cfile)
426 cfile -> tokbuf [i++] = c;
427 for (; i < sizeof cfile -> tokbuf; i++) {
428 c = get_char (cfile);
429 if (!seenx && c == 'x') {
432 } else if (isascii (c) && !isxdigit (c) &&
433 (c == '-' || c == '_' || isalpha (c))) {
435 } else if (isascii (c) && !isdigit (c) && isxdigit (c)) {
436 token = NUMBER_OR_NAME;
438 } else if (!isascii (c) || !isxdigit (c)) {
445 cfile -> tokbuf [i] = c;
447 if (i == sizeof cfile -> tokbuf) {
449 "numeric token larger than internal buffer");
452 cfile -> tokbuf [i] = 0;
454 cfile -> tval = cfile -> tokbuf;
458 static enum dhcp_token read_num_or_name (c, cfile)
463 enum dhcp_token rv = NUMBER_OR_NAME;
464 cfile -> tokbuf [i++] = c;
465 for (; i < sizeof cfile -> tokbuf; i++) {
466 c = get_char (cfile);
468 (c != '-' && c != '_' && !isalnum (c))) {
477 cfile -> tokbuf [i] = c;
479 if (i == sizeof cfile -> tokbuf) {
480 parse_warn (cfile, "token larger than internal buffer");
483 cfile -> tokbuf [i] = 0;
485 cfile -> tval = cfile -> tokbuf;
486 return intern (cfile -> tval, rv);
489 static enum dhcp_token intern (atom, dfv)
493 if (!isascii (atom [0]))
496 switch (tolower (atom [0])) {
503 if (!strncasecmp (atom + 1, "uth", 3)) {
504 if (!strncasecmp (atom + 3, "uthenticat", 10)) {
505 if (!strcasecmp (atom + 13, "ed"))
506 return AUTHENTICATED;
507 if (!strcasecmp (atom + 13, "ion"))
508 return AUTHENTICATION;
511 if (!strcasecmp (atom + 1, "uthoritative"))
512 return AUTHORITATIVE;
515 if (!strcasecmp (atom + 1, "nd"))
517 if (!strcasecmp (atom + 1, "ppend"))
519 if (!strcasecmp (atom + 1, "llow"))
521 if (!strcasecmp (atom + 1, "lias"))
523 if (!strcasecmp (atom + 1, "lgorithm"))
525 if (!strcasecmp (atom + 1, "bandoned"))
526 return TOKEN_ABANDONED;
527 if (!strcasecmp (atom + 1, "dd"))
529 if (!strcasecmp (atom + 1, "ll"))
531 if (!strcasecmp (atom + 1, "t"))
533 if (!strcasecmp (atom + 1, "rray"))
535 if (!strcasecmp (atom + 1, "ddress"))
537 if (!strcasecmp (atom + 1, "ctive"))
541 if (!strcasecmp (atom + 1, "ackup"))
543 if (!strcasecmp (atom + 1, "ootp"))
545 if (!strcasecmp (atom + 1, "inding"))
547 if (!strcasecmp (atom + 1, "inary-to-ascii"))
548 return BINARY_TO_ASCII;
549 if (!strcasecmp (atom + 1, "ackoff-cutoff"))
550 return BACKOFF_CUTOFF;
551 if (!strcasecmp (atom + 1, "ooting"))
553 if (!strcasecmp (atom + 1, "oot-unknown-clients"))
554 return BOOT_UNKNOWN_CLIENTS;
555 if (!strcasecmp (atom + 1, "reak"))
557 if (!strcasecmp (atom + 1, "illing"))
559 if (!strcasecmp (atom + 1, "oolean"))
561 if (!strcasecmp (atom + 1, "alance"))
563 if (!strcasecmp (atom + 1, "ound"))
567 if (!strcasecmp (atom + 1, "ase"))
569 if (!strcasecmp (atom + 1, "ommit"))
571 if (!strcasecmp (atom + 1, "ode"))
573 if (!strcasecmp (atom + 1, "onfig-option"))
574 return CONFIG_OPTION;
575 if (!strcasecmp (atom + 1, "heck"))
577 if (!strcasecmp (atom + 1, "lass"))
579 if (!strcasecmp (atom + 1, "lose"))
581 if (!strcasecmp (atom + 1, "reate"))
583 if (!strcasecmp (atom + 1, "iaddr"))
585 if (!strncasecmp (atom + 1, "lient", 5)) {
586 if (!strcasecmp (atom + 6, "-identifier"))
587 return CLIENT_IDENTIFIER;
588 if (!strcasecmp (atom + 6, "-hostname"))
589 return CLIENT_HOSTNAME;
590 if (!strcasecmp (atom + 6, "-state"))
592 if (!strcasecmp (atom + 6, "-updates"))
593 return CLIENT_UPDATES;
594 if (!strcasecmp (atom + 6, "s"))
597 if (!strcasecmp (atom + 1, "oncat"))
599 if (!strcasecmp (atom + 1, "onnect"))
601 if (!strcasecmp (atom + 1, "ommunications-interrupted"))
602 return COMMUNICATIONS_INTERRUPTED;
603 if (!strcasecmp (atom + 1, "ltt"))
607 if (!strcasecmp (atom + 1, "ns-update"))
609 if (!strcasecmp (atom + 1, "ns-delete"))
611 if (!strcasecmp (atom + 1, "omain"))
613 if (!strcasecmp (atom + 1, "omain-name"))
615 if (!strcasecmp (atom + 1, "o-forward-update"))
616 return DO_FORWARD_UPDATE;
617 if (!strcasecmp (atom + 1, "ebug"))
619 if (!strcasecmp (atom + 1, "eny"))
621 if (!strcasecmp (atom + 1, "eleted"))
622 return TOKEN_DELETED;
623 if (!strcasecmp (atom + 1, "elete"))
625 if (!strncasecmp (atom + 1, "efault", 6)) {
628 if (!strcasecmp (atom + 7, "-lease-time"))
629 return DEFAULT_LEASE_TIME;
632 if (!strncasecmp (atom + 1, "ynamic", 6)) {
635 if (!strncasecmp (atom + 7, "-bootp", 6)) {
637 return DYNAMIC_BOOTP;
638 if (!strcasecmp (atom + 13, "-lease-cutoff"))
639 return DYNAMIC_BOOTP_LEASE_CUTOFF;
640 if (!strcasecmp (atom + 13, "-lease-length"))
641 return DYNAMIC_BOOTP_LEASE_LENGTH;
645 if (!strcasecmp (atom + 1, "uplicates"))
647 if (!strcasecmp (atom + 1, "eclines"))
649 if (!strncasecmp (atom + 1, "efine", 5)) {
650 if (!strcasecmp (atom + 6, "d"))
657 if (isascii (atom [1]) && tolower (atom [1]) == 'x') {
658 if (!strcasecmp (atom + 2, "tract-int"))
660 if (!strcasecmp (atom + 2, "ists"))
662 if (!strcasecmp (atom + 2, "piry"))
664 if (!strcasecmp (atom + 2, "pire"))
666 if (!strcasecmp (atom + 2, "pired"))
667 return TOKEN_EXPIRED;
669 if (!strcasecmp (atom + 1, "ncode-int"))
671 if (!strcasecmp (atom + 1, "thernet"))
673 if (!strcasecmp (atom + 1, "nds"))
675 if (!strncasecmp (atom + 1, "ls", 2)) {
676 if (!strcasecmp (atom + 3, "e"))
678 if (!strcasecmp (atom + 3, "if"))
682 if (!strcasecmp (atom + 1, "rror"))
684 if (!strcasecmp (atom + 1, "val"))
686 if (!strcasecmp (atom + 1, "ncapsulate"))
690 if (!strcasecmp (atom + 1, "atal"))
692 if (!strcasecmp (atom + 1, "ilename"))
694 if (!strcasecmp (atom + 1, "ixed-address"))
696 if (!strcasecmp (atom + 1, "ddi"))
698 if (!strcasecmp (atom + 1, "ormerr"))
700 if (!strcasecmp (atom + 1, "unction"))
702 if (!strcasecmp (atom + 1, "ailover"))
704 if (!strcasecmp (atom + 1, "ree"))
708 if (!strcasecmp (atom + 1, "iaddr"))
710 if (!strcasecmp (atom + 1, "roup"))
712 if (!strcasecmp (atom + 1, "et-lease-hostnames"))
713 return GET_LEASE_HOSTNAMES;
716 if (!strcasecmp (atom + 1, "ba"))
718 if (!strcasecmp (atom + 1, "ost"))
720 if (!strcasecmp (atom + 1, "ost-decl-name"))
721 return HOST_DECL_NAME;
722 if (!strcasecmp (atom + 1, "ardware"))
724 if (!strcasecmp (atom + 1, "ostname"))
726 if (!strcasecmp (atom + 1, "elp"))
730 if (!strcasecmp (atom + 1, "nclude"))
732 if (!strcasecmp (atom + 1, "nteger"))
734 if (!strcasecmp (atom + 1, "nfinite"))
736 if (!strcasecmp (atom + 1, "nfo"))
738 if (!strcasecmp (atom + 1, "p-address"))
740 if (!strcasecmp (atom + 1, "nitial-interval"))
741 return INITIAL_INTERVAL;
742 if (!strcasecmp (atom + 1, "nterface"))
744 if (!strcasecmp (atom + 1, "dentifier"))
746 if (!strcasecmp (atom + 1, "f"))
748 if (!strcasecmp (atom + 1, "s"))
750 if (!strcasecmp (atom + 1, "gnore"))
754 if (!strcasecmp (atom + 1, "nown"))
756 if (!strcasecmp (atom + 1, "ey"))
760 if (!strcasecmp (atom + 1, "ease"))
762 if (!strcasecmp (atom + 1, "eased-address"))
763 return LEASED_ADDRESS;
764 if (!strcasecmp (atom + 1, "ease-time"))
766 if (!strcasecmp (atom + 1, "imit"))
768 if (!strcasecmp (atom + 1, "et"))
770 if (!strcasecmp (atom + 1, "oad"))
772 if (!strcasecmp (atom + 1, "og"))
776 if (!strncasecmp (atom + 1, "ax", 2)) {
779 if (!strcasecmp (atom + 3, "-lease-time"))
780 return MAX_LEASE_TIME;
781 if (!strcasecmp (atom + 3, "-transmit-idle"))
782 return MAX_TRANSMIT_IDLE;
783 if (!strcasecmp (atom + 3, "-response-delay"))
784 return MAX_RESPONSE_DELAY;
785 if (!strcasecmp (atom + 3, "-unacked-updates"))
786 return MAX_UNACKED_UPDATES;
788 if (!strncasecmp (atom + 1, "in-", 3)) {
789 if (!strcasecmp (atom + 4, "lease-time"))
790 return MIN_LEASE_TIME;
791 if (!strcasecmp (atom + 4, "secs"))
795 if (!strncasecmp (atom + 1, "edi", 3)) {
796 if (!strcasecmp (atom + 4, "a"))
798 if (!strcasecmp (atom + 4, "um"))
802 if (!strcasecmp (atom + 1, "atch"))
804 if (!strcasecmp (atom + 1, "embers"))
806 if (!strcasecmp (atom + 1, "y"))
808 if (!strcasecmp (atom + 1, "clt"))
812 if (!strcasecmp (atom + 1, "ormal"))
814 if (!strcasecmp (atom + 1, "ameserver"))
816 if (!strcasecmp (atom + 1, "etmask"))
818 if (!strcasecmp (atom + 1, "ever"))
820 if (!strcasecmp (atom + 1, "ext-server"))
822 if (!strcasecmp (atom + 1, "ot"))
824 if (!strcasecmp (atom + 1, "o"))
826 if (!strcasecmp (atom + 1, "s-update"))
828 if (!strcasecmp (atom + 1, "oerror"))
830 if (!strcasecmp (atom + 1, "otauth"))
832 if (!strcasecmp (atom + 1, "otimp"))
834 if (!strcasecmp (atom + 1, "otzone"))
836 if (!strcasecmp (atom + 1, "xdomain"))
838 if (!strcasecmp (atom + 1, "xrrset"))
840 if (!strcasecmp (atom + 1, "ull"))
842 if (!strcasecmp (atom + 1, "ext"))
844 if (!strcasecmp (atom + 1, "ew"))
848 if (!strcasecmp (atom + 1, "mapi"))
850 if (!strcasecmp (atom + 1, "r"))
852 if (!strcasecmp (atom + 1, "n"))
854 if (!strcasecmp (atom + 1, "pen"))
856 if (!strcasecmp (atom + 1, "ption"))
858 if (!strcasecmp (atom + 1, "ne-lease-per-client"))
859 return ONE_LEASE_PER_CLIENT;
860 if (!strcasecmp (atom + 1, "f"))
862 if (!strcasecmp (atom + 1, "wner"))
866 if (!strcasecmp (atom + 1, "repend"))
868 if (!strcasecmp (atom + 1, "acket"))
870 if (!strcasecmp (atom + 1, "ool"))
872 if (!strcasecmp (atom + 1, "seudo"))
874 if (!strcasecmp (atom + 1, "eer"))
876 if (!strcasecmp (atom + 1, "rimary"))
878 if (!strncasecmp (atom + 1, "artner", 6)) {
881 if (!strcasecmp (atom + 7, "-down"))
884 if (!strcasecmp (atom + 1, "ort"))
886 if (!strcasecmp (atom + 1, "otential-conflict"))
887 return POTENTIAL_CONFLICT;
888 if (!strcasecmp (atom + 1, "ick-first-value") ||
889 !strcasecmp (atom + 1, "ick"))
891 if (!strcasecmp (atom + 1, "aused"))
895 if (!strcasecmp (atom + 1, "esolution-interrupted"))
896 return RESOLUTION_INTERRUPTED;
897 if (!strcasecmp (atom + 1, "ange"))
899 if (!strcasecmp (atom + 1, "ecover"))
901 if (!strcasecmp (atom + 1, "ecover-done"))
903 if (!strcasecmp (atom + 1, "ecover-wait"))
905 if (!strcasecmp (atom + 1, "econtact-interval"))
906 return RECONTACT_INTERVAL;
907 if (!strcasecmp (atom + 1, "equest"))
909 if (!strcasecmp (atom + 1, "equire"))
911 if (!strcasecmp (atom + 1, "equire"))
913 if (!strcasecmp (atom + 1, "etry"))
915 if (!strcasecmp (atom + 1, "eturn"))
917 if (!strcasecmp (atom + 1, "enew"))
919 if (!strcasecmp (atom + 1, "ebind"))
921 if (!strcasecmp (atom + 1, "eboot"))
923 if (!strcasecmp (atom + 1, "eject"))
925 if (!strcasecmp (atom + 1, "everse"))
927 if (!strcasecmp (atom + 1, "elease"))
929 if (!strcasecmp (atom + 1, "efused"))
931 if (!strcasecmp (atom + 1, "eleased"))
932 return TOKEN_RELEASED;
933 if (!strcasecmp (atom + 1, "eset"))
935 if (!strcasecmp (atom + 1, "eserved"))
936 return TOKEN_RESERVED;
937 if (!strcasecmp (atom + 1, "emove"))
939 if (!strcasecmp (atom + 1, "efresh"))
943 if (!strcasecmp (atom + 1, "tate"))
945 if (!strcasecmp (atom + 1, "ecret"))
947 if (!strcasecmp (atom + 1, "ervfail"))
949 if (!strcasecmp (atom + 1, "witch"))
951 if (!strcasecmp (atom + 1, "igned"))
953 if (!strcasecmp (atom + 1, "tring"))
955 if (!strcasecmp (atom + 1, "uffix"))
957 if (!strcasecmp (atom + 1, "earch"))
959 if (!strcasecmp (atom + 1, "tarts"))
961 if (!strcasecmp (atom + 1, "iaddr"))
963 if (!strcasecmp (atom + 1, "hared-network"))
964 return SHARED_NETWORK;
965 if (!strcasecmp (atom + 1, "econdary"))
967 if (!strcasecmp (atom + 1, "erver-name"))
969 if (!strcasecmp (atom + 1, "erver-identifier"))
970 return SERVER_IDENTIFIER;
971 if (!strcasecmp (atom + 1, "erver"))
973 if (!strcasecmp (atom + 1, "elect-timeout"))
974 return SELECT_TIMEOUT;
975 if (!strcasecmp (atom + 1, "elect"))
977 if (!strcasecmp (atom + 1, "end"))
979 if (!strcasecmp (atom + 1, "cript"))
981 if (!strcasecmp (atom + 1, "upersede"))
983 if (!strncasecmp (atom + 1, "ub", 2)) {
984 if (!strcasecmp (atom + 3, "string"))
986 if (!strcasecmp (atom + 3, "net"))
988 if (!strcasecmp (atom + 3, "class"))
992 if (!strcasecmp (atom + 1, "pawn"))
994 if (!strcasecmp (atom + 1, "pace"))
996 if (!strcasecmp (atom + 1, "tatic"))
998 if (!strcasecmp (atom + 1, "plit"))
1000 if (!strcasecmp (atom + 1, "et"))
1002 if (!strcasecmp (atom + 1, "econds"))
1004 if (!strcasecmp (atom + 1, "hutdown"))
1006 if (!strcasecmp (atom + 1, "tartup"))
1010 if (!strcasecmp (atom + 1, "imestamp"))
1012 if (!strcasecmp (atom + 1, "imeout"))
1014 if (!strcasecmp (atom + 1, "oken-ring"))
1016 if (!strcasecmp (atom + 1, "ext"))
1018 if (!strcasecmp (atom + 1, "stp"))
1020 if (!strcasecmp (atom + 1, "sfp"))
1022 if (!strcasecmp (atom + 1, "ransmission"))
1023 return TRANSMISSION;
1026 if (!strcasecmp (atom + 1, "nset"))
1028 if (!strcasecmp (atom + 1, "nsigned"))
1030 if (!strcasecmp (atom + 1, "id"))
1032 if (!strncasecmp (atom + 1, "se", 2)) {
1033 if (!strcasecmp (atom + 3, "r-class"))
1035 if (!strcasecmp (atom + 3, "-host-decl-names"))
1036 return USE_HOST_DECL_NAMES;
1037 if (!strcasecmp (atom + 3,
1038 "-lease-addr-for-default-route"))
1039 return USE_LEASE_ADDR_FOR_DEFAULT_ROUTE;
1042 if (!strncasecmp (atom + 1, "nknown", 6)) {
1043 if (!strcasecmp (atom + 7, "-clients"))
1044 return UNKNOWN_CLIENTS;
1045 if (!strcasecmp (atom + 7, "-state"))
1046 return UNKNOWN_STATE;
1051 if (!strcasecmp (atom + 1, "nauthenticated"))
1052 return AUTHENTICATED;
1053 if (!strcasecmp (atom + 1, "pdated-dns-rr"))
1054 return UPDATED_DNS_RR;
1055 if (!strcasecmp (atom + 1, "pdate"))
1059 if (!strcasecmp (atom + 1, "endor-class"))
1060 return VENDOR_CLASS;
1061 if (!strcasecmp (atom + 1, "endor"))
1065 if (!strcasecmp (atom + 1, "ith"))
1069 if (!strcasecmp (atom + 1, "iaddr"))
1071 if (!strcasecmp (atom + 1, "xdomain"))
1073 if (!strcasecmp (atom + 1, "xrrset"))
1077 if (!strcasecmp (atom + 1, "one"))