ISC DHCP  4.4.2b1
A reference DHCPv4 and DHCPv6 implementation
conflex.c
Go to the documentation of this file.
1 /* conflex.c
2 
3  Lexical scanner for dhcpd config file... */
4 
5 /*
6  * Copyright (c) 2004-2017 by Internet Systems Consortium, Inc. ("ISC")
7  * Copyright (c) 1995-2003 by Internet Software Consortium
8  *
9  * This Source Code Form is subject to the terms of the Mozilla Public
10  * License, v. 2.0. If a copy of the MPL was not distributed with this
11  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12  *
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.
20  *
21  * Internet Systems Consortium, Inc.
22  * 950 Charter Street
23  * Redwood City, CA 94063
24  * <info@isc.org>
25  * https://www.isc.org/
26  *
27  */
28 
29 #include "dhcpd.h"
30 #include <ctype.h>
31 
32 static int get_char (struct parse *);
33 static void unget_char(struct parse *, int);
34 static void skip_to_eol (struct parse *);
35 static enum dhcp_token read_whitespace(int c, struct parse *cfile);
36 static enum dhcp_token read_string (struct parse *);
37 static enum dhcp_token read_number (int, struct parse *);
38 static enum dhcp_token read_num_or_name (int, struct parse *);
39 static enum dhcp_token intern (char *, enum dhcp_token);
40 
41 isc_result_t new_parse (cfile, file, inbuf, buflen, name, eolp)
42  struct parse **cfile;
43  int file;
44  char *inbuf;
45  unsigned buflen;
46  const char *name;
47  int eolp;
48 {
49  isc_result_t status = ISC_R_SUCCESS;
50  struct parse *tmp;
51 
52  tmp = dmalloc(sizeof(struct parse), MDL);
53  if (tmp == NULL) {
54  return (ISC_R_NOMEMORY);
55  }
56 
57  /*
58  * We don't need to initialize things to zero here, since
59  * dmalloc() returns memory that is set to zero.
60  */
61  tmp->tlname = name;
62  tmp->lpos = tmp -> line = 1;
63  tmp->cur_line = tmp->line1;
64  tmp->prev_line = tmp->line2;
65  tmp->token_line = tmp->cur_line;
66  tmp->cur_line[0] = tmp->prev_line[0] = 0;
67  tmp->file = file;
68  tmp->eol_token = eolp;
69 
70  if (inbuf != NULL) {
71  tmp->inbuf = inbuf;
72  tmp->buflen = buflen;
73  tmp->bufsiz = 0;
74  } else {
75  struct stat sb;
76 
77  if (fstat(file, &sb) < 0) {
78  status = ISC_R_IOERROR;
79  goto cleanup;
80  }
81 
82  if (sb.st_size == 0)
83  goto cleanup;
84 
85  tmp->bufsiz = tmp->buflen = (size_t) sb.st_size;
86  tmp->inbuf = mmap(NULL, tmp->bufsiz, PROT_READ, MAP_SHARED,
87  file, 0);
88 
89  if (tmp->inbuf == MAP_FAILED) {
90  status = ISC_R_IOERROR;
91  goto cleanup;
92  }
93  }
94 
95  *cfile = tmp;
96  return (ISC_R_SUCCESS);
97 
98 cleanup:
99  dfree(tmp, MDL);
100  return (status);
101 }
102 
103 isc_result_t end_parse (cfile)
104  struct parse **cfile;
105 {
106  /* "Memory" config files have no file. */
107  if ((*cfile)->file != -1) {
108  munmap((*cfile)->inbuf, (*cfile)->bufsiz);
109  close((*cfile)->file);
110  }
111 
112  if ((*cfile)->saved_state != NULL) {
113  dfree((*cfile)->saved_state, MDL);
114  }
115 
116  dfree(*cfile, MDL);
117  *cfile = NULL;
118  return ISC_R_SUCCESS;
119 }
120 
121 /*
122  * Save the current state of the parser.
123  *
124  * Only one state may be saved. Any previous saved state is
125  * lost.
126  */
127 isc_result_t
128 save_parse_state(struct parse *cfile) {
129  /*
130  * Free any previous saved state.
131  */
132  if (cfile->saved_state != NULL) {
133  dfree(cfile->saved_state, MDL);
134  }
135 
136  /*
137  * Save our current state.
138  */
139  cfile->saved_state = dmalloc(sizeof(struct parse), MDL);
140  if (cfile->saved_state == NULL) {
141  return ISC_R_NOMEMORY;
142  }
143  memcpy(cfile->saved_state, cfile, sizeof(*cfile));
144  return ISC_R_SUCCESS;
145 }
146 
147 /*
148  * Return the parser to the previous saved state.
149  *
150  * You must call save_parse_state() every time before calling
151  * restore_parse_state().
152  *
153  * Note: When the read function callback is in use in ldap mode,
154  * a call to get_char() may reallocate the buffer and will append
155  * config data to the buffer until a state restore.
156  * Do not restore to the (freed) pointer and size, but use new one.
157  */
158 isc_result_t
159 restore_parse_state(struct parse *cfile) {
160  struct parse *saved_state;
161 #if defined(LDAP_CONFIGURATION)
162  char *inbuf = cfile->inbuf;
163  size_t size = cfile->bufsiz;
164 #endif
165 
166  if (cfile->saved_state == NULL) {
167  return DHCP_R_NOTYET;
168  }
169 
170  saved_state = cfile->saved_state;
171  memcpy(cfile, saved_state, sizeof(*cfile));
173  cfile->saved_state = NULL;
174 
175 #if defined(LDAP_CONFIGURATION)
176  cfile->inbuf = inbuf;
177  cfile->bufsiz = size;
178 #endif
179  return ISC_R_SUCCESS;
180 }
181 
182 static int get_char (cfile)
183  struct parse *cfile;
184 {
185  /* My kingdom for WITH... */
186  int c;
187 
188  if (cfile->bufix == cfile->buflen) {
189 #if !defined(LDAP_CONFIGURATION)
190  c = EOF;
191 #else /* defined(LDAP_CONFIGURATION) */
192  if (cfile->read_function != NULL)
193  c = cfile->read_function(cfile);
194  else
195  c = EOF;
196 #endif
197  } else {
198  c = cfile->inbuf [cfile->bufix];
199  cfile->bufix++;
200  }
201 
202  if (!cfile->ugflag) {
203  if (c == EOL) {
204  if (cfile->cur_line == cfile->line1) {
205  cfile->cur_line = cfile->line2;
206  cfile->prev_line = cfile->line1;
207  } else {
208  cfile->cur_line = cfile->line1;
209  cfile->prev_line = cfile->line2;
210  }
211  cfile->line++;
212  cfile->lpos = 1;
213  cfile->cur_line [0] = 0;
214  } else if (c != EOF) {
215  if (cfile->lpos <= 80) {
216  cfile->cur_line [cfile->lpos - 1] = c;
217  cfile->cur_line [cfile->lpos] = 0;
218  }
219  cfile->lpos++;
220  }
221  } else
222  cfile->ugflag = 0;
223  return c;
224 }
225 
226 /*
227  * Return a character to our input buffer.
228  */
229 static void
230 unget_char(struct parse *cfile, int c) {
231  if (c != EOF) {
232  cfile->bufix--;
233  cfile->ugflag = 1; /* do not put characters into
234  our error buffer on the next
235  call to get_char() */
236  }
237 }
238 
239 /*
240  * GENERAL NOTE ABOUT TOKENS
241  *
242  * We normally only want non-whitespace tokens. There are some
243  * circumstances where we *do* want to see whitespace (for example
244  * when parsing IPv6 addresses).
245  *
246  * Generally we use the next_token() function to read tokens. This
247  * in turn calls get_next_token, which does *not* return tokens for
248  * whitespace. Rather, it skips these.
249  *
250  * When we need to see whitespace, we us next_raw_token(), which also
251  * returns the WHITESPACE token.
252  *
253  * The peek_token() and peek_raw_token() functions work as expected.
254  *
255  * Warning: if you invoke peek_token(), then if there is a whitespace
256  * token, it will be lost, and subsequent use of next_raw_token() or
257  * peek_raw_token() will NOT see it.
258  */
259 
260 static enum dhcp_token
261 get_raw_token(struct parse *cfile) {
262  int c;
263  enum dhcp_token ttok;
264  static char tb [2];
265  int l, p;
266 
267  do {
268  l = cfile -> line;
269  p = cfile -> lpos;
270 
271  c = get_char (cfile);
272  if (!((c == '\n') && cfile->eol_token) &&
273  isascii(c) && isspace(c)) {
274  ttok = read_whitespace(c, cfile);
275  break;
276  }
277  if (c == '#') {
278  skip_to_eol (cfile);
279  continue;
280  }
281  if (c == '"') {
282  cfile -> lexline = l;
283  cfile -> lexchar = p;
284  ttok = read_string (cfile);
285  break;
286  }
287  if ((isascii (c) && isdigit (c)) || c == '-') {
288  cfile -> lexline = l;
289  cfile -> lexchar = p;
290  ttok = read_number (c, cfile);
291  break;
292  } else if (isascii (c) && isalpha (c)) {
293  cfile -> lexline = l;
294  cfile -> lexchar = p;
295  ttok = read_num_or_name (c, cfile);
296  break;
297  } else if (c == EOF) {
298  ttok = END_OF_FILE;
299  cfile -> tlen = 0;
300  break;
301  } else {
302  cfile -> lexline = l;
303  cfile -> lexchar = p;
304  tb [0] = c;
305  tb [1] = 0;
306  cfile -> tval = tb;
307  cfile -> tlen = 1;
308  ttok = c;
309  break;
310  }
311  } while (1);
312  return ttok;
313 }
314 
315 /*
316  * The get_next_token() function consumes the next token and
317  * returns it to the caller.
318  *
319  * Since the code is almost the same for "normal" and "raw"
320  * input, we pass a flag to alter the way it works.
321  */
322 
323 static enum dhcp_token
324 get_next_token(const char **rval, unsigned *rlen,
325  struct parse *cfile, isc_boolean_t raw) {
326  int rv;
327 
328  if (cfile -> token) {
329  if (cfile -> lexline != cfile -> tline)
330  cfile -> token_line = cfile -> cur_line;
331  cfile -> lexchar = cfile -> tlpos;
332  cfile -> lexline = cfile -> tline;
333  rv = cfile -> token;
334  cfile -> token = 0;
335  } else {
336  rv = get_raw_token(cfile);
337  cfile -> token_line = cfile -> cur_line;
338  }
339 
340  if (!raw) {
341  while (rv == WHITESPACE) {
342  rv = get_raw_token(cfile);
343  cfile->token_line = cfile->cur_line;
344  }
345  }
346 
347  if (rval)
348  *rval = cfile -> tval;
349  if (rlen)
350  *rlen = cfile -> tlen;
351 #ifdef DEBUG_TOKENS
352  fprintf (stderr, "%s:%d ", cfile -> tval, rv);
353 #endif
354  return rv;
355 }
356 
357 
358 /*
359  * Get the next token from cfile and return it.
360  *
361  * If rval is non-NULL, set the pointer it contains to
362  * the contents of the token.
363  *
364  * If rlen is non-NULL, set the integer it contains to
365  * the length of the token.
366  */
367 
368 enum dhcp_token
369 next_token(const char **rval, unsigned *rlen, struct parse *cfile) {
370  return get_next_token(rval, rlen, cfile, ISC_FALSE);
371 }
372 
373 
374 /*
375  * The same as the next_token() function above, but will return space
376  * as the WHITESPACE token.
377  */
378 
379 enum dhcp_token
380 next_raw_token(const char **rval, unsigned *rlen, struct parse *cfile) {
381  return get_next_token(rval, rlen, cfile, ISC_TRUE);
382 }
383 
384 
385 /*
386  * The do_peek_token() function checks the next token without
387  * consuming it, and returns it to the caller.
388  *
389  * Since the code is almost the same for "normal" and "raw"
390  * input, we pass a flag to alter the way it works. (See the
391  * warning in the GENERAL NOTES ABOUT TOKENS above though.)
392  */
393 
394 enum dhcp_token
395 do_peek_token(const char **rval, unsigned int *rlen,
396  struct parse *cfile, isc_boolean_t raw) {
397  int x;
398 
399  if (!cfile->token || (!raw && (cfile->token == WHITESPACE))) {
400  cfile -> tlpos = cfile -> lexchar;
401  cfile -> tline = cfile -> lexline;
402 
403  do {
404  cfile->token = get_raw_token(cfile);
405  } while (!raw && (cfile->token == WHITESPACE));
406 
407  if (cfile -> lexline != cfile -> tline)
408  cfile -> token_line = cfile -> prev_line;
409 
410  x = cfile -> lexchar;
411  cfile -> lexchar = cfile -> tlpos;
412  cfile -> tlpos = x;
413 
414  x = cfile -> lexline;
415  cfile -> lexline = cfile -> tline;
416  cfile -> tline = x;
417  }
418  if (rval)
419  *rval = cfile -> tval;
420  if (rlen)
421  *rlen = cfile -> tlen;
422 #ifdef DEBUG_TOKENS
423  fprintf (stderr, "(%s:%d) ", cfile -> tval, cfile -> token);
424 #endif
425  return cfile -> token;
426 }
427 
428 
429 /*
430  * Get the next token from cfile and return it, leaving it for a
431  * subsequent call to next_token().
432  *
433  * Note that it WILL consume whitespace tokens.
434  *
435  * If rval is non-NULL, set the pointer it contains to
436  * the contents of the token.
437  *
438  * If rlen is non-NULL, set the integer it contains to
439  * the length of the token.
440  */
441 
442 enum dhcp_token
443 peek_token(const char **rval, unsigned *rlen, struct parse *cfile) {
444  return do_peek_token(rval, rlen, cfile, ISC_FALSE);
445 }
446 
447 
448 /*
449  * The same as the peek_token() function above, but will return space
450  * as the WHITESPACE token.
451  */
452 
453 enum dhcp_token
454 peek_raw_token(const char **rval, unsigned *rlen, struct parse *cfile) {
455  return do_peek_token(rval, rlen, cfile, ISC_TRUE);
456 }
457 
458 static void skip_to_eol (cfile)
459  struct parse *cfile;
460 {
461  int c;
462  do {
463  c = get_char (cfile);
464  if (c == EOF)
465  return;
466  if (c == EOL) {
467  return;
468  }
469  } while (1);
470 }
471 
472 static enum dhcp_token
473 read_whitespace(int c, struct parse *cfile) {
474  int ofs;
475 
476  /*
477  * Read as much whitespace as we have available.
478  */
479  ofs = 0;
480  do {
481  if (ofs >= (sizeof(cfile->tokbuf) - 1)) {
482  /*
483  * As the file includes a huge amount of whitespace,
484  * it's probably broken.
485  * Print out a warning and bail out.
486  */
487  parse_warn(cfile,
488  "whitespace too long, buffer overflow.");
489  log_fatal("Exiting");
490  }
491  cfile->tokbuf[ofs++] = c;
492  c = get_char(cfile);
493  if (c == EOF)
494  return END_OF_FILE;
495  } while (!((c == '\n') && cfile->eol_token) &&
496  isascii(c) && isspace(c));
497 
498  /*
499  * Put the last (non-whitespace) character back.
500  */
501  unget_char(cfile, c);
502 
503  /*
504  * Return our token.
505  */
506  cfile->tokbuf[ofs] = '\0';
507  cfile->tlen = ofs;
508  cfile->tval = cfile->tokbuf;
509  return WHITESPACE;
510 }
511 
512 static enum dhcp_token read_string (cfile)
513  struct parse *cfile;
514 {
515  int i;
516  int bs = 0;
517  int c;
518  int value = 0;
519  int hex = 0;
520 
521  for (i = 0; i < sizeof cfile -> tokbuf; i++) {
522  again:
523  c = get_char (cfile);
524  if (c == EOF) {
525  parse_warn (cfile, "eof in string constant");
526  break;
527  }
528  if (bs == 1) {
529  switch (c) {
530  case 't':
531  cfile -> tokbuf [i] = '\t';
532  break;
533  case 'r':
534  cfile -> tokbuf [i] = '\r';
535  break;
536  case 'n':
537  cfile -> tokbuf [i] = '\n';
538  break;
539  case 'b':
540  cfile -> tokbuf [i] = '\b';
541  break;
542  case '0':
543  case '1':
544  case '2':
545  case '3':
546  hex = 0;
547  value = c - '0';
548  ++bs;
549  goto again;
550  case 'x':
551  hex = 1;
552  value = 0;
553  ++bs;
554  goto again;
555  default:
556  cfile -> tokbuf [i] = c;
557  break;
558  }
559  bs = 0;
560  } else if (bs > 1) {
561  if (hex) {
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);
568  } else {
569  parse_warn (cfile,
570  "invalid hex digit: %x",
571  c);
572  bs = 0;
573  continue;
574  }
575  if (++bs == 4) {
576  cfile -> tokbuf [i] = value;
577  bs = 0;
578  } else
579  goto again;
580  } else {
581  if (c >= '0' && c <= '7') {
582  value = value * 8 + (c - '0');
583  } else {
584  if (value != 0) {
585  parse_warn (cfile,
586  "invalid octal digit %x",
587  c);
588  continue;
589  } else
590  cfile -> tokbuf [i] = 0;
591  bs = 0;
592  }
593  if (++bs == 4) {
594  cfile -> tokbuf [i] = value;
595  bs = 0;
596  } else
597  goto again;
598  }
599  } else if (c == '\\') {
600  bs = 1;
601  goto again;
602  } else if (c == '"')
603  break;
604  else
605  cfile -> tokbuf [i] = c;
606  }
607  /* Normally, I'd feel guilty about this, but we're talking about
608  strings that'll fit in a DHCP packet here... */
609  if (i == sizeof cfile -> tokbuf) {
610  parse_warn (cfile,
611  "string constant larger than internal buffer");
612  --i;
613  }
614  cfile -> tokbuf [i] = 0;
615  cfile -> tlen = i;
616  cfile -> tval = cfile -> tokbuf;
617  return STRING;
618 }
619 
620 static enum dhcp_token read_number (c, cfile)
621  int c;
622  struct parse *cfile;
623 {
624  int i = 0;
625  int token = NUMBER;
626 
627  cfile -> tokbuf [i++] = c;
628  for (; i < sizeof cfile -> tokbuf; i++) {
629  c = get_char (cfile);
630 
631  /* Promote NUMBER -> NUMBER_OR_NAME -> NAME, never demote.
632  * Except in the case of '0x' syntax hex, which gets called
633  * a NAME at '0x', and returned to NUMBER_OR_NAME once it's
634  * verified to be at least 0xf or less.
635  */
636  switch(isascii(c) ? token : BREAK) {
637  case NUMBER:
638  if(isdigit(c))
639  break;
640  /* FALLTHROUGH */
641  case NUMBER_OR_NAME:
642  if(isxdigit(c)) {
644  break;
645  }
646  /* FALLTHROUGH */
647  case NAME:
648  if((i == 2) && isxdigit(c) &&
649  (cfile->tokbuf[0] == '0') &&
650  ((cfile->tokbuf[1] == 'x') ||
651  (cfile->tokbuf[1] == 'X'))) {
653  break;
654  } else if(((c == '-') || (c == '_') || isalnum(c))) {
655  token = NAME;
656  break;
657  }
658  /* FALLTHROUGH */
659  case BREAK:
660  /* At this point c is either EOF or part of the next
661  * token. If not EOF, rewind the file one byte so
662  * the next token is read from there.
663  */
664  unget_char(cfile, c);
665  goto end_read;
666 
667  default:
668  log_fatal("read_number():%s:%d: impossible case", MDL);
669  }
670 
671  cfile -> tokbuf [i] = c;
672  }
673 
674  if (i == sizeof cfile -> tokbuf) {
675  parse_warn (cfile,
676  "numeric token larger than internal buffer");
677  --i;
678  }
679 
680  end_read:
681  cfile -> tokbuf [i] = 0;
682  cfile -> tlen = i;
683  cfile -> tval = cfile -> tokbuf;
684 
685  /*
686  * If this entire token from start to finish was "-", such as
687  * the middle parameter in "42 - 7", return just the MINUS token.
688  */
689  if ((i == 1) && (cfile->tokbuf[i] == '-'))
690  return MINUS;
691  else
692  return token;
693 }
694 
695 static enum dhcp_token read_num_or_name (c, cfile)
696  int c;
697  struct parse *cfile;
698 {
699  int i = 0;
700  enum dhcp_token rv = NUMBER_OR_NAME;
701  cfile -> tokbuf [i++] = c;
702  for (; i < sizeof cfile -> tokbuf; i++) {
703  c = get_char (cfile);
704  if (!isascii (c) ||
705  (c != '-' && c != '_' && !isalnum (c))) {
706  unget_char(cfile, c);
707  break;
708  }
709  if (!isxdigit (c))
710  rv = NAME;
711  cfile -> tokbuf [i] = c;
712  }
713  if (i == sizeof cfile -> tokbuf) {
714  parse_warn (cfile, "token larger than internal buffer");
715  --i;
716  }
717  cfile -> tokbuf [i] = 0;
718  cfile -> tlen = i;
719  cfile -> tval = cfile -> tokbuf;
720  return intern(cfile->tval, rv);
721 }
722 
723 static enum dhcp_token
724 intern(char *atom, enum dhcp_token dfv) {
725  if (!isascii(atom[0]))
726  return dfv;
727 
728  switch (tolower((unsigned char)atom[0])) {
729  case '-':
730  if (atom [1] == 0)
731  return MINUS;
732  break;
733 
734  case 'a':
735  if (!strcasecmp(atom + 1, "bandoned"))
736  return TOKEN_ABANDONED;
737  if (!strcasecmp(atom + 1, "ctive"))
738  return TOKEN_ACTIVE;
739  if (!strncasecmp(atom + 1, "dd", 2)) {
740  if (atom[3] == '\0')
741  return TOKEN_ADD;
742  else if (!strcasecmp(atom + 3, "ress"))
743  return ADDRESS;
744  break;
745  }
746  if (!strcasecmp(atom + 1, "fter"))
747  return AFTER;
748  if (isascii(atom[1]) &&
749  (tolower((unsigned char)atom[1]) == 'l')) {
750  if (!strcasecmp(atom + 2, "gorithm"))
751  return ALGORITHM;
752  if (!strcasecmp(atom + 2, "ias"))
753  return ALIAS;
754  if (isascii(atom[2]) &&
755  (tolower((unsigned char)atom[2]) == 'l')) {
756  if (atom[3] == '\0')
757  return ALL;
758  else if (!strcasecmp(atom + 3, "ow"))
759  return ALLOW;
760  break;
761  }
762  if (!strcasecmp(atom + 2, "so"))
763  return TOKEN_ALSO;
764  break;
765  }
766  if (isascii(atom[1]) &&
767  (tolower((unsigned char)atom[1]) == 'n')) {
768  if (!strcasecmp(atom + 2, "d"))
769  return AND;
770  if (!strcasecmp(atom + 2, "ycast-mac"))
771  return ANYCAST_MAC;
772  break;
773  }
774  if (!strcasecmp(atom + 1, "ppend"))
775  return APPEND;
776  if (!strcasecmp(atom + 1, "rray"))
777  return ARRAY;
778  if (isascii(atom[1]) &&
779  (tolower((unsigned char)atom[1]) == 't')) {
780  if (atom[2] == '\0')
781  return AT;
782  if (!strcasecmp(atom + 2, "sfp"))
783  return ATSFP;
784  break;
785  }
786  if (!strcasecmp(atom + 1, "uthoring-byte-order"))
787  return AUTHORING_BYTE_ORDER;
788  if (!strncasecmp(atom + 1, "ut", 2)) {
789  if (isascii(atom[3]) &&
790  (tolower((unsigned char)atom[3]) == 'h')) {
791  if (!strncasecmp(atom + 4, "enticat", 7)) {
792  if (!strcasecmp(atom + 11, "ed"))
793  return AUTHENTICATED;
794  if (!strcasecmp(atom + 11, "ion"))
795  return AUTHENTICATION;
796  break;
797  }
798  if (!strcasecmp(atom + 4, "oritative"))
799  return AUTHORITATIVE;
800  break;
801  }
802  if (!strcasecmp(atom + 3, "o-partner-down"))
803  return AUTO_PARTNER_DOWN;
804  break;
805  }
806  break;
807  case 'b':
808  if (!strcasecmp (atom + 1, "ackup"))
809  return TOKEN_BACKUP;
810  if (!strcasecmp (atom + 1, "ootp"))
811  return TOKEN_BOOTP;
812  if (!strcasecmp (atom + 1, "inding"))
813  return BINDING;
814  if (!strcasecmp (atom + 1, "inary-to-ascii"))
815  return BINARY_TO_ASCII;
816  if (!strcasecmp (atom + 1, "ackoff-cutoff"))
817  return BACKOFF_CUTOFF;
818  if (!strcasecmp (atom + 1, "ooting"))
819  return BOOTING;
820  if (!strcasecmp (atom + 1, "oot-unknown-clients"))
821  return BOOT_UNKNOWN_CLIENTS;
822  if (!strcasecmp (atom + 1, "reak"))
823  return BREAK;
824  if (!strcasecmp (atom + 1, "illing"))
825  return BILLING;
826  if (!strcasecmp (atom + 1, "oolean"))
827  return BOOLEAN;
828  if (!strcasecmp (atom + 1, "alance"))
829  return BALANCE;
830  if (!strcasecmp (atom + 1, "ound"))
831  return BOUND;
832  if (!strcasecmp(atom+1, "ig-endian")) {
833  return TOKEN_BIG_ENDIAN;
834  }
835  if (!strcasecmp (atom + 1, "ootp-broadcast-always"))
836  return BOOTP_BROADCAST_ALWAYS;
837  break;
838  case 'c':
839  if (!strcasecmp(atom + 1, "ase"))
840  return CASE;
841  if (!strcasecmp(atom + 1, "heck"))
842  return CHECK;
843  if (!strcasecmp(atom + 1, "iaddr"))
844  return CIADDR;
845  if (isascii(atom[1]) &&
846  tolower((unsigned char)atom[1]) == 'l') {
847  if (!strcasecmp(atom + 2, "ass"))
848  return CLASS;
849  if (!strncasecmp(atom + 2, "ient", 4)) {
850  if (!strcasecmp(atom + 6, "s"))
851  return CLIENTS;
852  if (atom[6] == '-') {
853  if (!strcasecmp(atom + 7, "hostname"))
854  return CLIENT_HOSTNAME;
855  if (!strcasecmp(atom + 7, "identifier"))
856  return CLIENT_IDENTIFIER;
857  if (!strcasecmp(atom + 7, "state"))
858  return CLIENT_STATE;
859  if (!strcasecmp(atom + 7, "updates"))
860  return CLIENT_UPDATES;
861  break;
862  }
863  break;
864  }
865  if (!strcasecmp(atom + 2, "ose"))
866  return TOKEN_CLOSE;
867  if (!strcasecmp(atom + 2, "tt"))
868  return CLTT;
869  break;
870  }
871  if (isascii(atom[1]) &&
872  tolower((unsigned char)atom[1]) == 'o') {
873  if (!strcasecmp(atom + 2, "de"))
874  return CODE;
875  if (isascii(atom[2]) &&
876  tolower((unsigned char)atom[2]) == 'm') {
877  if (!strcasecmp(atom + 3, "mit"))
878  return COMMIT;
879  if (!strcasecmp(atom + 3,
880  "munications-interrupted"))
882  if (!strcasecmp(atom + 3, "pressed"))
883  return COMPRESSED;
884  break;
885  }
886  if (isascii(atom[2]) &&
887  tolower((unsigned char)atom[2]) == 'n') {
888  if (!strcasecmp(atom + 3, "cat"))
889  return CONCAT;
890  if (!strcasecmp(atom + 3, "fig-option"))
891  return CONFIG_OPTION;
892  if (!strcasecmp(atom + 3, "flict-done"))
893  return CONFLICT_DONE;
894  if (!strcasecmp(atom + 3, "nect"))
895  return CONNECT;
896  break;
897  }
898  break;
899  }
900  if (!strcasecmp(atom + 1, "reate"))
901  return TOKEN_CREATE;
902  break;
903  case 'd':
904  if (!strcasecmp(atom + 1, "b-time-format"))
905  return DB_TIME_FORMAT;
906  if (!strcasecmp (atom + 1, "omain"))
907  return DOMAIN;
908  if (!strncasecmp (atom + 1, "omain-", 6)) {
909  if (!strcasecmp(atom + 7, "name"))
910  return DOMAIN_NAME;
911  if (!strcasecmp(atom + 7, "list"))
912  return DOMAIN_LIST;
913  }
914  if (!strcasecmp (atom + 1, "o-forward-updates"))
915  return DO_FORWARD_UPDATE;
916  /* do-forward-update is included for historical reasons */
917  if (!strcasecmp (atom + 1, "o-forward-update"))
918  return DO_FORWARD_UPDATE;
919  if (!strcasecmp (atom + 1, "ebug"))
920  return TOKEN_DEBUG;
921  if (!strcasecmp (atom + 1, "eny"))
922  return DENY;
923  if (!strcasecmp (atom + 1, "eleted"))
924  return TOKEN_DELETED;
925  if (!strcasecmp (atom + 1, "elete"))
926  return TOKEN_DELETE;
927  if (!strncasecmp (atom + 1, "efault", 6)) {
928  if (!atom [7])
929  return DEFAULT;
930  if (!strcasecmp(atom + 7, "-duid"))
931  return DEFAULT_DUID;
932  if (!strcasecmp (atom + 7, "-lease-time"))
933  return DEFAULT_LEASE_TIME;
934  break;
935  }
936  if (!strncasecmp (atom + 1, "ynamic", 6)) {
937  if (!atom [7])
938  return DYNAMIC;
939  if (!strncasecmp (atom + 7, "-bootp", 6)) {
940  if (!atom [13])
941  return DYNAMIC_BOOTP;
942  if (!strcasecmp (atom + 13, "-lease-cutoff"))
944  if (!strcasecmp (atom + 13, "-lease-length"))
946  break;
947  }
948  }
949  if (!strcasecmp (atom + 1, "uplicates"))
950  return DUPLICATES;
951  if (!strcasecmp (atom + 1, "eclines"))
952  return DECLINES;
953  if (!strncasecmp (atom + 1, "efine", 5)) {
954  if (!strcasecmp (atom + 6, "d"))
955  return DEFINED;
956  if (!atom [6])
957  return DEFINE;
958  }
959  break;
960  case 'e':
961  if (isascii (atom [1]) &&
962  tolower((unsigned char)atom[1]) == 'x') {
963  if (!strcasecmp (atom + 2, "tract-int"))
964  return EXTRACT_INT;
965  if (!strcasecmp (atom + 2, "ists"))
966  return EXISTS;
967  if (!strcasecmp (atom + 2, "piry"))
968  return EXPIRY;
969  if (!strcasecmp (atom + 2, "pire"))
970  return EXPIRE;
971  if (!strcasecmp (atom + 2, "pired"))
972  return TOKEN_EXPIRED;
973  }
974  if (!strcasecmp (atom + 1, "ncode-int"))
975  return ENCODE_INT;
976  if (!strcasecmp(atom + 1, "poch"))
977  return EPOCH;
978  if (!strcasecmp (atom + 1, "thernet"))
979  return ETHERNET;
980  if (!strcasecmp (atom + 1, "nds"))
981  return ENDS;
982  if (!strncasecmp (atom + 1, "ls", 2)) {
983  if (!strcasecmp (atom + 3, "e"))
984  return ELSE;
985  if (!strcasecmp (atom + 3, "if"))
986  return ELSIF;
987  break;
988  }
989  if (!strcasecmp (atom + 1, "rror"))
990  return ERROR;
991  if (!strcasecmp (atom + 1, "val"))
992  return EVAL;
993  if (!strcasecmp (atom + 1, "ncapsulate"))
994  return ENCAPSULATE;
995  if (!strcasecmp(atom + 1, "xecute"))
996  return EXECUTE;
997  if (!strcasecmp(atom+1, "n")) {
998  return EN;
999  }
1000  break;
1001  case 'f':
1002  if (!strcasecmp (atom + 1, "atal"))
1003  return FATAL;
1004  if (!strcasecmp (atom + 1, "ilename"))
1005  return FILENAME;
1006  if (!strcasecmp (atom + 1, "ixed-address"))
1007  return FIXED_ADDR;
1008  if (!strcasecmp (atom + 1, "ixed-address6"))
1009  return FIXED_ADDR6;
1010  if (!strcasecmp (atom + 1, "ixed-prefix6"))
1011  return FIXED_PREFIX6;
1012  if (!strcasecmp (atom + 1, "ddi"))
1013  return TOKEN_FDDI;
1014  if (!strcasecmp (atom + 1, "ormerr"))
1015  return NS_FORMERR;
1016  if (!strcasecmp (atom + 1, "unction"))
1017  return FUNCTION;
1018  if (!strcasecmp (atom + 1, "ailover"))
1019  return FAILOVER;
1020  if (!strcasecmp (atom + 1, "ree"))
1021  return TOKEN_FREE;
1022  break;
1023  case 'g':
1024  if (!strncasecmp(atom + 1, "et", 2)) {
1025  if (!strcasecmp(atom + 3, "-lease-hostnames"))
1026  return GET_LEASE_HOSTNAMES;
1027  if (!strcasecmp(atom + 3, "hostbyname"))
1028  return GETHOSTBYNAME;
1029  if (!strcasecmp(atom + 3, "hostname"))
1030  return GETHOSTNAME;
1031  break;
1032  }
1033  if (!strcasecmp (atom + 1, "iaddr"))
1034  return GIADDR;
1035  if (!strcasecmp (atom + 1, "roup"))
1036  return GROUP;
1037  break;
1038  case 'h':
1039  if (!strcasecmp(atom + 1, "ash"))
1040  return HASH;
1041  if (!strcasecmp (atom + 1, "ba"))
1042  return HBA;
1043  if (!strcasecmp (atom + 1, "ost"))
1044  return HOST;
1045  if (!strcasecmp (atom + 1, "ost-decl-name"))
1046  return HOST_DECL_NAME;
1047  if (!strcasecmp(atom + 1, "ost-identifier"))
1048  return HOST_IDENTIFIER;
1049  if (!strcasecmp (atom + 1, "ardware"))
1050  return HARDWARE;
1051  if (!strcasecmp (atom + 1, "ostname"))
1052  return HOSTNAME;
1053  if (!strcasecmp (atom + 1, "elp"))
1054  return TOKEN_HELP;
1055  if (!strcasecmp (atom + 1, "ex")) {
1056  return TOKEN_HEX;
1057  }
1058  break;
1059  case 'i':
1060  if (!strcasecmp(atom+1, "a-na"))
1061  return IA_NA;
1062  if (!strcasecmp(atom+1, "a-ta"))
1063  return IA_TA;
1064  if (!strcasecmp(atom+1, "a-pd"))
1065  return IA_PD;
1066  if (!strcasecmp(atom+1, "aaddr"))
1067  return IAADDR;
1068  if (!strcasecmp(atom+1, "aprefix"))
1069  return IAPREFIX;
1070  if (!strcasecmp (atom + 1, "nclude"))
1071  return INCLUDE;
1072  if (!strcasecmp (atom + 1, "nteger"))
1073  return INTEGER;
1074  if (!strcasecmp (atom + 1, "nfiniband"))
1075  return TOKEN_INFINIBAND;
1076  if (!strcasecmp (atom + 1, "nfinite"))
1077  return INFINITE;
1078  if (!strcasecmp (atom + 1, "nfo"))
1079  return INFO;
1080  if (!strcasecmp (atom + 1, "p-address"))
1081  return IP_ADDRESS;
1082  if (!strcasecmp (atom + 1, "p6-address"))
1083  return IP6_ADDRESS;
1084  if (!strcasecmp (atom + 1, "nitial-interval"))
1085  return INITIAL_INTERVAL;
1086  if (!strcasecmp (atom + 1, "nitial-delay"))
1087  return INITIAL_DELAY;
1088  if (!strcasecmp (atom + 1, "nterface"))
1089  return INTERFACE;
1090  if (!strcasecmp (atom + 1, "dentifier"))
1091  return IDENTIFIER;
1092  if (!strcasecmp (atom + 1, "f"))
1093  return IF;
1094  if (!strcasecmp (atom + 1, "s"))
1095  return IS;
1096  if (!strcasecmp (atom + 1, "gnore"))
1097  return IGNORE;
1098  break;
1099  case 'k':
1100  if (!strncasecmp (atom + 1, "nown", 4)) {
1101  if (!strcasecmp (atom + 5, "-clients"))
1102  return KNOWN_CLIENTS;
1103  if (!atom[5])
1104  return KNOWN;
1105  break;
1106  }
1107  if (!strcasecmp (atom + 1, "ey"))
1108  return KEY;
1109  if (!strcasecmp (atom + 1, "ey-algorithm"))
1110  return KEY_ALGORITHM;
1111  break;
1112  case 'l':
1113  if (!strcasecmp (atom + 1, "case"))
1114  return LCASE;
1115  if (!strcasecmp (atom + 1, "ease"))
1116  return LEASE;
1117  if (!strcasecmp(atom + 1, "ease6"))
1118  return LEASE6;
1119  if (!strcasecmp (atom + 1, "eased-address"))
1120  return LEASED_ADDRESS;
1121  if (!strcasecmp (atom + 1, "ease-time"))
1122  return LEASE_TIME;
1123  if (!strcasecmp(atom + 1, "easequery"))
1124  return LEASEQUERY;
1125  if (!strcasecmp(atom + 1, "ength"))
1126  return LENGTH;
1127  if (!strcasecmp (atom + 1, "imit"))
1128  return LIMIT;
1129  if (!strcasecmp (atom + 1, "et"))
1130  return LET;
1131  if (!strcasecmp (atom + 1, "oad"))
1132  return LOAD;
1133  if (!strcasecmp(atom + 1, "ocal"))
1134  return LOCAL;
1135  if (!strcasecmp (atom + 1, "og"))
1136  return LOG;
1137  if (!strcasecmp(atom+1, "lt")) {
1138  return LLT;
1139  }
1140  if (!strcasecmp(atom+1, "l")) {
1141  return LL;
1142  }
1143  if (!strcasecmp(atom+1, "ittle-endian")) {
1144  return TOKEN_LITTLE_ENDIAN;
1145  }
1146  if (!strcasecmp (atom + 1, "ease-id-format")) {
1147  return LEASE_ID_FORMAT;
1148  }
1149  break;
1150  case 'm':
1151  if (!strncasecmp (atom + 1, "ax", 2)) {
1152  if (!atom [3])
1153  return TOKEN_MAX;
1154  if (!strcasecmp (atom + 3, "-balance"))
1155  return MAX_BALANCE;
1156  if (!strncasecmp (atom + 3, "-lease-", 7)) {
1157  if (!strcasecmp(atom + 10, "misbalance"))
1158  return MAX_LEASE_MISBALANCE;
1159  if (!strcasecmp(atom + 10, "ownership"))
1160  return MAX_LEASE_OWNERSHIP;
1161  if (!strcasecmp(atom + 10, "time"))
1162  return MAX_LEASE_TIME;
1163  }
1164  if (!strcasecmp(atom + 3, "-life"))
1165  return MAX_LIFE;
1166  if (!strcasecmp (atom + 3, "-transmit-idle"))
1167  return MAX_TRANSMIT_IDLE;
1168  if (!strcasecmp (atom + 3, "-response-delay"))
1169  return MAX_RESPONSE_DELAY;
1170  if (!strcasecmp (atom + 3, "-unacked-updates"))
1171  return MAX_UNACKED_UPDATES;
1172  }
1173  if (!strncasecmp (atom + 1, "in-", 3)) {
1174  if (!strcasecmp (atom + 4, "balance"))
1175  return MIN_BALANCE;
1176  if (!strcasecmp (atom + 4, "lease-time"))
1177  return MIN_LEASE_TIME;
1178  if (!strcasecmp (atom + 4, "secs"))
1179  return MIN_SECS;
1180  break;
1181  }
1182  if (!strncasecmp (atom + 1, "edi", 3)) {
1183  if (!strcasecmp (atom + 4, "a"))
1184  return MEDIA;
1185  if (!strcasecmp (atom + 4, "um"))
1186  return MEDIUM;
1187  break;
1188  }
1189  if (!strcasecmp (atom + 1, "atch"))
1190  return MATCH;
1191  if (!strcasecmp (atom + 1, "embers"))
1192  return MEMBERS;
1193  if (!strcasecmp (atom + 1, "y"))
1194  return MY;
1195  if (!strcasecmp (atom + 1, "clt"))
1196  return MCLT;
1197  break;
1198  case 'n':
1199  if (!strcasecmp (atom + 1, "ormal"))
1200  return NORMAL;
1201  if (!strcasecmp (atom + 1, "ameserver"))
1202  return NAMESERVER;
1203  if (!strcasecmp (atom + 1, "etmask"))
1204  return NETMASK;
1205  if (!strcasecmp (atom + 1, "ever"))
1206  return NEVER;
1207  if (!strcasecmp (atom + 1, "ext-server"))
1208  return NEXT_SERVER;
1209  if (!strcasecmp (atom + 1, "ot"))
1210  return TOKEN_NOT;
1211  if (!strcasecmp (atom + 1, "o"))
1212  return TOKEN_NO;
1213  if (!strcasecmp (atom + 1, "oerror"))
1214  return NS_NOERROR;
1215  if (!strcasecmp (atom + 1, "otauth"))
1216  return NS_NOTAUTH;
1217  if (!strcasecmp (atom + 1, "otimp"))
1218  return NS_NOTIMP;
1219  if (!strcasecmp (atom + 1, "otzone"))
1220  return NS_NOTZONE;
1221  if (!strcasecmp (atom + 1, "xdomain"))
1222  return NS_NXDOMAIN;
1223  if (!strcasecmp (atom + 1, "xrrset"))
1224  return NS_NXRRSET;
1225  if (!strcasecmp (atom + 1, "ull"))
1226  return TOKEN_NULL;
1227  if (!strcasecmp (atom + 1, "ext"))
1228  return TOKEN_NEXT;
1229  if (!strcasecmp (atom + 1, "ew"))
1230  return TOKEN_NEW;
1231  break;
1232  case 'o':
1233  if (!strcasecmp (atom + 1, "mapi"))
1234  return OMAPI;
1235  if (!strcasecmp (atom + 1, "r"))
1236  return OR;
1237  if (!strcasecmp (atom + 1, "n"))
1238  return ON;
1239  if (!strcasecmp (atom + 1, "pen"))
1240  return TOKEN_OPEN;
1241  if (!strcasecmp (atom + 1, "ption"))
1242  return OPTION;
1243  if (!strcasecmp (atom + 1, "ne-lease-per-client"))
1244  return ONE_LEASE_PER_CLIENT;
1245  if (!strcasecmp (atom + 1, "f"))
1246  return OF;
1247  if (!strcasecmp (atom + 1, "wner"))
1248  return OWNER;
1249  if (!strcasecmp (atom + 1, "ctal")) {
1250  return TOKEN_OCTAL;
1251  }
1252  break;
1253  case 'p':
1254  if (!strcasecmp (atom + 1, "arse-vendor-option"))
1255  return PARSE_VENDOR_OPT;
1256  if (!strcasecmp (atom + 1, "repend"))
1257  return PREPEND;
1258  if (!strcasecmp(atom + 1, "referred-life"))
1259  return PREFERRED_LIFE;
1260  if (!strcasecmp (atom + 1, "acket"))
1261  return PACKET;
1262  if (!strcasecmp (atom + 1, "ool"))
1263  return POOL;
1264  if (!strcasecmp (atom + 1, "ool6"))
1265  return POOL6;
1266  if (!strcasecmp (atom + 1, "refix6"))
1267  return PREFIX6;
1268  if (!strcasecmp (atom + 1, "seudo"))
1269  return PSEUDO;
1270  if (!strcasecmp (atom + 1, "eer"))
1271  return PEER;
1272  if (!strcasecmp (atom + 1, "rimary"))
1273  return PRIMARY;
1274  if (!strcasecmp (atom + 1, "rimary6"))
1275  return PRIMARY6;
1276  if (!strncasecmp (atom + 1, "artner", 6)) {
1277  if (!atom [7])
1278  return PARTNER;
1279  if (!strcasecmp (atom + 7, "-down"))
1280  return PARTNER_DOWN;
1281  }
1282  if (!strcasecmp (atom + 1, "ort"))
1283  return PORT;
1284  if (!strcasecmp (atom + 1, "otential-conflict"))
1285  return POTENTIAL_CONFLICT;
1286  if (!strcasecmp (atom + 1, "ick-first-value") ||
1287  !strcasecmp (atom + 1, "ick"))
1288  return PICK;
1289  if (!strcasecmp (atom + 1, "aused"))
1290  return PAUSED;
1291  break;
1292  case 'r':
1293  if (!strcasecmp(atom + 1, "ange"))
1294  return RANGE;
1295  if (!strcasecmp(atom + 1, "ange6"))
1296  return RANGE6;
1297  if (isascii(atom[1]) &&
1298  (tolower((unsigned char)atom[1]) == 'e')) {
1299  if (!strcasecmp(atom + 2, "bind"))
1300  return REBIND;
1301  if (!strcasecmp(atom + 2, "boot"))
1302  return REBOOT;
1303  if (!strcasecmp(atom + 2, "contact-interval"))
1304  return RECONTACT_INTERVAL;
1305  if (!strncasecmp(atom + 2, "cover", 5)) {
1306  if (atom[7] == '\0')
1307  return RECOVER;
1308  if (!strcasecmp(atom + 7, "-done"))
1309  return RECOVER_DONE;
1310  if (!strcasecmp(atom + 7, "-wait"))
1311  return RECOVER_WAIT;
1312  break;
1313  }
1314  if (!strcasecmp(atom + 2, "fresh"))
1315  return REFRESH;
1316  if (!strcasecmp(atom + 2, "fused"))
1317  return NS_REFUSED;
1318  if (!strcasecmp(atom + 2, "ject"))
1319  return REJECT;
1320  if (!strcasecmp(atom + 2, "lease"))
1321  return RELEASE;
1322  if (!strcasecmp(atom + 2, "leased"))
1323  return TOKEN_RELEASED;
1324  if (!strcasecmp(atom + 2, "move"))
1325  return REMOVE;
1326  if (!strcasecmp(atom + 2, "new"))
1327  return RENEW;
1328  if (!strcasecmp(atom + 2, "quest"))
1329  return REQUEST;
1330  if (!strcasecmp(atom + 2, "quire"))
1331  return REQUIRE;
1332  if (isascii(atom[2]) &&
1333  (tolower((unsigned char)atom[2]) == 's')) {
1334  if (!strcasecmp(atom + 3, "erved"))
1335  return TOKEN_RESERVED;
1336  if (!strcasecmp(atom + 3, "et"))
1337  return TOKEN_RESET;
1338  if (!strcasecmp(atom + 3,
1339  "olution-interrupted"))
1340  return RESOLUTION_INTERRUPTED;
1341  break;
1342  }
1343  if (!strcasecmp(atom + 2, "try"))
1344  return RETRY;
1345  if (!strcasecmp(atom + 2, "turn"))
1346  return RETURN;
1347  if (!strcasecmp(atom + 2, "verse"))
1348  return REVERSE;
1349  if (!strcasecmp(atom + 2, "wind"))
1350  return REWIND;
1351  break;
1352  }
1353  break;
1354  case 's':
1355  if (!strcasecmp(atom + 1, "cript"))
1356  return SCRIPT;
1357  if (isascii(atom[1]) &&
1358  tolower((unsigned char)atom[1]) == 'e') {
1359  if (!strcasecmp(atom + 2, "arch"))
1360  return SEARCH;
1361  if (isascii(atom[2]) &&
1362  tolower((unsigned char)atom[2]) == 'c') {
1363  if (!strncasecmp(atom + 3, "ond", 3)) {
1364  if (!strcasecmp(atom + 6, "ary"))
1365  return SECONDARY;
1366  if (!strcasecmp(atom + 6, "ary6"))
1367  return SECONDARY6;
1368  if (!strcasecmp(atom + 6, "s"))
1369  return SECONDS;
1370  break;
1371  }
1372  if (!strcasecmp(atom + 3, "ret"))
1373  return SECRET;
1374  break;
1375  }
1376  if (!strncasecmp(atom + 2, "lect", 4)) {
1377  if (atom[6] == '\0')
1378  return SELECT;
1379  if (!strcasecmp(atom + 6, "-timeout"))
1380  return SELECT_TIMEOUT;
1381  break;
1382  }
1383  if (!strcasecmp(atom + 2, "nd"))
1384  return SEND;
1385  if (!strncasecmp(atom + 2, "rv", 2)) {
1386  if (!strncasecmp(atom + 4, "er", 2)) {
1387  if (atom[6] == '\0')
1388  return TOKEN_SERVER;
1389  if (atom[6] == '-') {
1390  if (!strcasecmp(atom + 7,
1391  "duid"))
1392  return SERVER_DUID;
1393  if (!strcasecmp(atom + 7,
1394  "name"))
1395  return SERVER_NAME;
1396  if (!strcasecmp(atom + 7,
1397  "identifier"))
1398  return SERVER_IDENTIFIER;
1399  break;
1400  }
1401  break;
1402  }
1403  if (!strcasecmp(atom + 4, "fail"))
1404  return NS_SERVFAIL;
1405  break;
1406  }
1407  if (!strcasecmp(atom + 2, "t"))
1408  return TOKEN_SET;
1409  break;
1410  }
1411  if (isascii(atom[1]) &&
1412  tolower((unsigned char)atom[1]) == 'h') {
1413  if (!strcasecmp(atom + 2, "ared-network"))
1414  return SHARED_NETWORK;
1415  if (!strcasecmp(atom + 2, "utdown"))
1416  return SHUTDOWN;
1417  break;
1418  }
1419  if (isascii(atom[1]) &&
1420  tolower((unsigned char)atom[1]) == 'i') {
1421  if (!strcasecmp(atom + 2, "addr"))
1422  return SIADDR;
1423  if (!strcasecmp(atom + 2, "gned"))
1424  return SIGNED;
1425  if (!strcasecmp(atom + 2, "ze"))
1426  return SIZE;
1427  break;
1428  }
1429  if (isascii(atom[1]) &&
1430  tolower((unsigned char)atom[1]) == 'p') {
1431  if (isascii(atom[2]) &&
1432  tolower((unsigned char)atom[2]) == 'a') {
1433  if (!strcasecmp(atom + 3, "ce"))
1434  return SPACE;
1435  if (!strcasecmp(atom + 3, "wn"))
1436  return SPAWN;
1437  break;
1438  }
1439  if (!strcasecmp(atom + 2, "lit"))
1440  return SPLIT;
1441  break;
1442  }
1443  if (isascii(atom[1]) &&
1444  tolower((unsigned char)atom[1]) == 't') {
1445  if (isascii(atom[2]) &&
1446  tolower((unsigned char)atom[2]) == 'a') {
1447  if(!strncasecmp(atom + 3, "rt", 2)) {
1448  if (!strcasecmp(atom + 5, "s"))
1449  return STARTS;
1450  if (!strcasecmp(atom + 5, "up"))
1451  return STARTUP;
1452  break;
1453  }
1454  if (isascii(atom[3]) &&
1455  tolower((unsigned char)atom[3]) == 't') {
1456  if (!strcasecmp(atom + 4, "e"))
1457  return STATE;
1458  if (!strcasecmp(atom + 4, "ic"))
1459  return STATIC;
1460  break;
1461  }
1462  }
1463  if (!strcasecmp(atom + 2, "ring"))
1464  return STRING_TOKEN;
1465  break;
1466  }
1467  if (!strncasecmp(atom + 1, "ub", 2)) {
1468  if (!strcasecmp(atom + 3, "class"))
1469  return SUBCLASS;
1470  if (!strcasecmp(atom + 3, "net"))
1471  return SUBNET;
1472  if (!strcasecmp(atom + 3, "net6"))
1473  return SUBNET6;
1474  if (!strcasecmp(atom + 3, "string"))
1475  return SUBSTRING;
1476  break;
1477  }
1478  if (isascii(atom[1]) &&
1479  tolower((unsigned char)atom[1]) == 'u') {
1480  if (!strcasecmp(atom + 2, "ffix"))
1481  return SUFFIX;
1482  if (!strcasecmp(atom + 2, "persede"))
1483  return SUPERSEDE;
1484  }
1485  if (!strcasecmp(atom + 1, "witch"))
1486  return SWITCH;
1487  break;
1488  case 't':
1489  if (!strcasecmp (atom + 1, "imestamp"))
1490  return TIMESTAMP;
1491  if (!strcasecmp (atom + 1, "imeout"))
1492  return TIMEOUT;
1493  if (!strcasecmp (atom + 1, "oken-ring"))
1494  return TOKEN_RING;
1495  if (!strcasecmp (atom + 1, "ext"))
1496  return TEXT;
1497  if (!strcasecmp (atom + 1, "stp"))
1498  return TSTP;
1499  if (!strcasecmp (atom + 1, "sfp"))
1500  return TSFP;
1501  if (!strcasecmp (atom + 1, "ransmission"))
1502  return TRANSMISSION;
1503  if (!strcasecmp(atom + 1, "emporary"))
1504  return TEMPORARY;
1505  break;
1506  case 'u':
1507  if (!strcasecmp (atom + 1, "case"))
1508  return UCASE;
1509  if (!strcasecmp (atom + 1, "nset"))
1510  return UNSET;
1511  if (!strcasecmp (atom + 1, "nsigned"))
1512  return UNSIGNED;
1513  if (!strcasecmp (atom + 1, "id"))
1514  return UID;
1515  if (!strncasecmp (atom + 1, "se", 2)) {
1516  if (!strcasecmp (atom + 3, "r-class"))
1517  return USER_CLASS;
1518  if (!strcasecmp (atom + 3, "-host-decl-names"))
1519  return USE_HOST_DECL_NAMES;
1520  if (!strcasecmp (atom + 3,
1521  "-lease-addr-for-default-route"))
1523  break;
1524  }
1525  if (!strncasecmp (atom + 1, "nknown", 6)) {
1526  if (!strcasecmp (atom + 7, "-clients"))
1527  return UNKNOWN_CLIENTS;
1528  if (!strcasecmp (atom + 7, "-state"))
1529  return UNKNOWN_STATE;
1530  if (!atom [7])
1531  return UNKNOWN;
1532  break;
1533  }
1534  if (!strcasecmp (atom + 1, "nauthenticated"))
1535  return UNAUTHENTICATED;
1536  if (!strcasecmp (atom + 1, "pdate"))
1537  return UPDATE;
1538  break;
1539  case 'v':
1540  if (!strcasecmp (atom + 1, "6relay"))
1541  return V6RELAY;
1542  if (!strcasecmp (atom + 1, "6relopt"))
1543  return V6RELOPT;
1544  if (!strcasecmp (atom + 1, "endor-class"))
1545  return VENDOR_CLASS;
1546  if (!strcasecmp (atom + 1, "endor"))
1547  return VENDOR;
1548  break;
1549  case 'w':
1550  if (!strcasecmp (atom + 1, "ith"))
1551  return WITH;
1552  if (!strcasecmp(atom + 1, "idth"))
1553  return WIDTH;
1554  break;
1555  case 'y':
1556  if (!strcasecmp (atom + 1, "iaddr"))
1557  return YIADDR;
1558  if (!strcasecmp (atom + 1, "xdomain"))
1559  return NS_YXDOMAIN;
1560  if (!strcasecmp (atom + 1, "xrrset"))
1561  return NS_YXRRSET;
1562  break;
1563  case 'z':
1564  if (!strcasecmp (atom + 1, "erolen"))
1565  return ZEROLEN;
1566  if (!strcasecmp (atom + 1, "one"))
1567  return ZONE;
1568  break;
1569  }
1570  return dfv;
1571 }
1572 
parse::line1
char line1[81]
Definition: dhcpd.h:314
parse::tval
char * tval
Definition: dhcpd.h:322
MAX_LEASE_TIME
@ MAX_LEASE_TIME
Definition: dhctoken.h:85
ISC_TRUE
#define ISC_TRUE
Definition: data.h:153
CLIENT_HOSTNAME
@ CLIENT_HOSTNAME
Definition: dhctoken.h:132
AUTHENTICATION
@ AUTHENTICATION
Definition: dhctoken.h:184
DYNAMIC_BOOTP_LEASE_CUTOFF
@ DYNAMIC_BOOTP_LEASE_CUTOFF
Definition: dhctoken.h:92
NS_SERVFAIL
@ NS_SERVFAIL
Definition: dhctoken.h:244
FAILOVER
@ FAILOVER
Definition: dhctoken.h:167
dhcp_token
dhcp_token
Definition: dhctoken.h:34
OF
@ OF
Definition: dhctoken.h:162
TIMESTAMP
@ TIMESTAMP
Definition: dhctoken.h:70
NEXT_SERVER
@ NEXT_SERVER
Definition: dhctoken.h:95
INFINITE
@ INFINITE
Definition: dhctoken.h:215
parse::prev_line
char * prev_line
Definition: dhcpd.h:292
IA_TA
@ IA_TA
Definition: dhctoken.h:339
ELSIF
@ ELSIF
Definition: dhctoken.h:147
PREFIX6
@ PREFIX6
Definition: dhctoken.h:357
SELECT
@ SELECT
Definition: dhctoken.h:295
WHITESPACE
@ WHITESPACE
Definition: dhctoken.h:352
RELEASE
@ RELEASE
Definition: dhctoken.h:209
save_parse_state
isc_result_t save_parse_state(struct parse *cfile)
Definition: conflex.c:128
MAX_LIFE
@ MAX_LIFE
Definition: dhctoken.h:345
SCRIPT
@ SCRIPT
Definition: dhctoken.h:108
MEDIUM
@ MEDIUM
Definition: dhctoken.h:119
WIDTH
@ WIDTH
Definition: dhctoken.h:319
log_fatal
void log_fatal(const char *,...) __attribute__((__format__(__printf__
OWNER
@ OWNER
Definition: dhctoken.h:223
parse::ugflag
int ugflag
Definition: dhcpd.h:321
TOKEN_NEW
@ TOKEN_NEW
Definition: dhctoken.h:301
LEASE_TIME
@ LEASE_TIME
Definition: dhctoken.h:212
TOKEN_MAX
@ TOKEN_MAX
Definition: dhctoken.h:261
ATSFP
@ ATSFP
Definition: dhctoken.h:316
USER_CLASS
@ USER_CLASS
Definition: dhctoken.h:87
TOKEN_RING
@ TOKEN_RING
Definition: dhctoken.h:96
RESOLUTION_INTERRUPTED
@ RESOLUTION_INTERRUPTED
Definition: dhctoken.h:264
REVERSE
@ REVERSE
Definition: dhctoken.h:201
RENEW
@ RENEW
Definition: dhctoken.h:110
APPEND
@ APPEND
Definition: dhctoken.h:129
lexline
int lexline
Definition: dhcrelay.c:51
CLASS
@ CLASS
Definition: dhctoken.h:74
MIN_SECS
@ MIN_SECS
Definition: dhctoken.h:136
PICK
@ PICK
Definition: dhctoken.h:204
line
const char int line
Definition: dhcpd.h:3793
BOOTP_BROADCAST_ALWAYS
@ BOOTP_BROADCAST_ALWAYS
Definition: dhctoken.h:380
COMMUNICATIONS_INTERRUPTED
@ COMMUNICATIONS_INTERRUPTED
Definition: dhctoken.h:178
DUPLICATES
@ DUPLICATES
Definition: dhctoken.h:219
TOKEN_CREATE
@ TOKEN_CREATE
Definition: dhctoken.h:304
EOL
#define EOL
Definition: dhcpd.h:88
KEY_ALGORITHM
@ KEY_ALGORITHM
Definition: dhctoken.h:379
SECRET
@ SECRET
Definition: dhctoken.h:257
INITIAL_INTERVAL
@ INITIAL_INTERVAL
Definition: dhctoken.h:124
token_line
char * token_line
Definition: dhcrelay.c:53
BACKOFF_CUTOFF
@ BACKOFF_CUTOFF
Definition: dhctoken.h:123
PREFERRED_LIFE
@ PREFERRED_LIFE
Definition: dhctoken.h:344
NUMBER_OR_NAME
@ NUMBER_OR_NAME
Definition: dhctoken.h:68
PRIMARY
@ PRIMARY
Definition: dhctoken.h:170
PEER
@ PEER
Definition: dhctoken.h:166
PSEUDO
@ PSEUDO
Definition: dhctoken.h:163
NETMASK
@ NETMASK
Definition: dhctoken.h:83
dhcpd.h
MIN_LEASE_TIME
@ MIN_LEASE_TIME
Definition: dhctoken.h:135
SERVER_NAME
@ SERVER_NAME
Definition: dhctoken.h:89
RETURN
@ RETURN
Definition: dhctoken.h:285
TOKEN_HEX
@ TOKEN_HEX
Definition: dhctoken.h:377
STRING_TOKEN
@ STRING_TOKEN
Definition: dhctoken.h:197
DYNAMIC_BOOTP_LEASE_LENGTH
@ DYNAMIC_BOOTP_LEASE_LENGTH
Definition: dhctoken.h:93
end_parse
isc_result_t end_parse(struct parse **cfile)
Definition: conflex.c:103
USE_LEASE_ADDR_FOR_DEFAULT_ROUTE
@ USE_LEASE_ADDR_FOR_DEFAULT_ROUTE
Definition: dhctoken.h:134
TOKEN_CLOSE
@ TOKEN_CLOSE
Definition: dhctoken.h:303
NS_NOERROR
@ NS_NOERROR
Definition: dhctoken.h:237
parse::tokbuf
char tokbuf[1500]
Definition: dhcpd.h:324
peek_raw_token
enum dhcp_token peek_raw_token(const char **rval, unsigned *rlen, struct parse *cfile)
Definition: conflex.c:454
PARTNER_DOWN
@ PARTNER_DOWN
Definition: dhctoken.h:176
LIMIT
@ LIMIT
Definition: dhctoken.h:164
GROUP
@ GROUP
Definition: dhctoken.h:97
MAX_RESPONSE_DELAY
@ MAX_RESPONSE_DELAY
Definition: dhctoken.h:175
TOKEN_OCTAL
@ TOKEN_OCTAL
Definition: dhctoken.h:378
OMAPI
@ OMAPI
Definition: dhctoken.h:279
AND
@ AND
Definition: dhctoken.h:137
NEVER
@ NEVER
Definition: dhctoken.h:214
isc_boolean_t
isc_boolean_t
Definition: data.h:150
TSTP
@ TSTP
Definition: dhctoken.h:221
ZEROLEN
@ ZEROLEN
Definition: dhctoken.h:355
NS_FORMERR
@ NS_FORMERR
Definition: dhctoken.h:236
NS_NXRRSET
@ NS_NXRRSET
Definition: dhctoken.h:242
new_parse
isc_result_t new_parse(struct parse **cfile, int file, char *inbuf, unsigned buflen, const char *name, int eolp)
Definition: conflex.c:41
TIMEOUT
@ TIMEOUT
Definition: dhctoken.h:105
SPAWN
@ SPAWN
Definition: dhctoken.h:150
V6RELAY
@ V6RELAY
Definition: dhctoken.h:370
value
Definition: data.h:205
TOKEN_DELETE
@ TOKEN_DELETE
Definition: dhctoken.h:231
REBIND
@ REBIND
Definition: dhctoken.h:111
MAX_LEASE_OWNERSHIP
@ MAX_LEASE_OWNERSHIP
Definition: dhctoken.h:327
AUTO_PARTNER_DOWN
@ AUTO_PARTNER_DOWN
Definition: dhctoken.h:361
parse::tline
int tline
Definition: dhcpd.h:319
IA_PD
@ IA_PD
Definition: dhctoken.h:340
PORT
@ PORT
Definition: dhctoken.h:173
REJECT
@ REJECT
Definition: dhctoken.h:133
TOKEN_NOT
@ TOKEN_NOT
Definition: dhctoken.h:183
IP_ADDRESS
@ IP_ADDRESS
Definition: dhctoken.h:195
FATAL
@ FATAL
Definition: dhctoken.h:281
next_raw_token
enum dhcp_token next_raw_token(const char **rval, unsigned *rlen, struct parse *cfile)
Definition: conflex.c:380
V6RELOPT
@ V6RELOPT
Definition: dhctoken.h:371
BINARY_TO_ASCII
@ BINARY_TO_ASCII
Definition: dhctoken.h:203
SHARED_NETWORK
@ SHARED_NETWORK
Definition: dhctoken.h:88
CLIENT_IDENTIFIER
@ CLIENT_IDENTIFIER
Definition: dhctoken.h:102
MAX_UNACKED_UPDATES
@ MAX_UNACKED_UPDATES
Definition: dhctoken.h:226
SEARCH
@ SEARCH
Definition: dhctoken.h:127
MATCH
@ MATCH
Definition: dhctoken.h:149
TOKEN_LITTLE_ENDIAN
@ TOKEN_LITTLE_ENDIAN
Definition: dhctoken.h:374
LOCAL
@ LOCAL
Definition: dhctoken.h:325
INTEGER
@ INTEGER
Definition: dhctoken.h:192
cleanup
void cleanup(void)
ENCODE_INT
@ ENCODE_INT
Definition: dhctoken.h:200
ONE_LEASE_PER_CLIENT
@ ONE_LEASE_PER_CLIENT
Definition: dhctoken.h:98
IDENTIFIER
@ IDENTIFIER
Definition: dhctoken.h:172
REWIND
@ REWIND
Definition: dhctoken.h:363
ETHERNET
@ ETHERNET
Definition: dhctoken.h:65
SIGNED
@ SIGNED
Definition: dhctoken.h:193
REFRESH
@ REFRESH
Definition: dhctoken.h:312
LCASE
@ LCASE
Definition: dhctoken.h:317
HOST
@ HOST
Definition: dhctoken.h:59
SIZE
@ SIZE
Definition: dhctoken.h:322
DENY
@ DENY
Definition: dhctoken.h:115
LENGTH
@ LENGTH
Definition: dhctoken.h:320
HOSTNAME
@ HOSTNAME
Definition: dhctoken.h:131
FIXED_ADDR
@ FIXED_ADDR
Definition: dhctoken.h:63
CONCAT
@ CONCAT
Definition: dhctoken.h:199
SUBSTRING
@ SUBSTRING
Definition: dhctoken.h:139
EXPIRE
@ EXPIRE
Definition: dhctoken.h:112
TOKEN_NULL
@ TOKEN_NULL
Definition: dhctoken.h:247
MAX_LEASE_MISBALANCE
@ MAX_LEASE_MISBALANCE
Definition: dhctoken.h:326
NS_NOTAUTH
@ NS_NOTAUTH
Definition: dhctoken.h:238
IS
@ IS
Definition: dhctoken.h:224
SERVER_IDENTIFIER
@ SERVER_IDENTIFIER
Definition: dhctoken.h:91
TOKEN_DEBUG
@ TOKEN_DEBUG
Definition: dhctoken.h:283
TOKEN_SET
@ TOKEN_SET
Definition: dhctoken.h:248
ENCAPSULATE
@ ENCAPSULATE
Definition: dhctoken.h:290
DEFAULT_DUID
@ DEFAULT_DUID
Definition: dhctoken.h:346
NORMAL
@ NORMAL
Definition: dhctoken.h:177
MEDIA
@ MEDIA
Definition: dhctoken.h:118
TEXT
@ TEXT
Definition: dhctoken.h:196
DEFAULT_LEASE_TIME
@ DEFAULT_LEASE_TIME
Definition: dhctoken.h:84
GETHOSTBYNAME
@ GETHOSTBYNAME
Definition: dhctoken.h:365
INCLUDE
@ INCLUDE
Definition: dhctoken.h:268
TOKEN_FREE
@ TOKEN_FREE
Definition: dhctoken.h:270
CIADDR
@ CIADDR
Definition: dhctoken.h:78
EXTRACT_INT
@ EXTRACT_INT
Definition: dhctoken.h:142
UNKNOWN_STATE
@ UNKNOWN_STATE
Definition: dhctoken.h:266
HASH
@ HASH
Definition: dhctoken.h:321
LEASEQUERY
@ LEASEQUERY
Definition: dhctoken.h:331
PARTNER
@ PARTNER
Definition: dhctoken.h:169
parse::cur_line
char * cur_line
Definition: dhcpd.h:293
EPOCH
@ EPOCH
Definition: dhctoken.h:323
HBA
@ HBA
Definition: dhctoken.h:225
parse
Definition: dhcpd.h:288
LLT
@ LLT
Definition: dhctoken.h:348
parse::tlpos
int tlpos
Definition: dhcpd.h:318
SPLIT
@ SPLIT
Definition: dhctoken.h:228
STARTUP
@ STARTUP
Definition: dhctoken.h:289
AUTHORING_BYTE_ORDER
@ AUTHORING_BYTE_ORDER
Definition: dhctoken.h:373
MIN_BALANCE
@ MIN_BALANCE
Definition: dhctoken.h:329
CONFLICT_DONE
@ CONFLICT_DONE
Definition: dhctoken.h:360
SECONDARY6
@ SECONDARY6
Definition: dhctoken.h:367
FIXED_PREFIX6
@ FIXED_PREFIX6
Definition: dhctoken.h:358
AUTHENTICATED
@ AUTHENTICATED
Definition: dhctoken.h:157
SWITCH
@ SWITCH
Definition: dhctoken.h:234
SECONDARY
@ SECONDARY
Definition: dhctoken.h:171
CLIENT_STATE
@ CLIENT_STATE
Definition: dhctoken.h:292
AFTER
@ AFTER
Definition: dhctoken.h:354
TOKEN_INFINIBAND
@ TOKEN_INFINIBAND
Definition: dhctoken.h:368
NAME
@ NAME
Definition: dhctoken.h:69
INFO
@ INFO
Definition: dhctoken.h:284
parse::bufix
size_t bufix
Definition: dhcpd.h:329
CODE
@ CODE
Definition: dhctoken.h:189
ZONE
@ ZONE
Definition: dhctoken.h:255
SUBNET
@ SUBNET
Definition: dhctoken.h:82
FIXED_ADDR6
@ FIXED_ADDR6
Definition: dhctoken.h:334
DHCP_R_NOTYET
#define DHCP_R_NOTYET
Definition: result.h:50
parse::lpos
int lpos
Definition: dhcpd.h:316
BILLING
@ BILLING
Definition: dhctoken.h:165
EXECUTE
@ EXECUTE
Definition: dhctoken.h:332
HARDWARE
@ HARDWARE
Definition: dhctoken.h:61
TOKEN_NEXT
@ TOKEN_NEXT
Definition: dhctoken.h:278
TOKEN_ALSO
@ TOKEN_ALSO
Definition: dhctoken.h:353
ENDS
@ ENDS
Definition: dhctoken.h:72
ELSE
@ ELSE
Definition: dhctoken.h:146
ISC_FALSE
#define ISC_FALSE
Definition: data.h:152
parse::file
int file
Definition: dhcpd.h:327
EVAL
@ EVAL
Definition: dhctoken.h:251
ARRAY
@ ARRAY
Definition: dhctoken.h:190
GETHOSTNAME
@ GETHOSTNAME
Definition: dhctoken.h:362
ALIAS
@ ALIAS
Definition: dhctoken.h:120
parse::eol_token
int eol_token
Definition: dhcpd.h:295
TOKEN_ABANDONED
@ TOKEN_ABANDONED
Definition: dhctoken.h:122
TOKEN_SERVER
@ TOKEN_SERVER
Definition: dhctoken.h:309
dfree
void dfree(void *, const char *, int)
Definition: alloc.c:145
MDL
#define MDL
Definition: omapip.h:567
parse::line2
char line2[81]
Definition: dhcpd.h:315
parse::buflen
size_t buflen
Definition: dhcpd.h:329
REQUIRE
@ REQUIRE
Definition: dhctoken.h:104
parse::saved_state
struct parse * saved_state
Definition: dhcpd.h:332
TEMPORARY
@ TEMPORARY
Definition: dhctoken.h:356
lexchar
int lexchar
Definition: dhcrelay.c:52
COMPRESSED
@ COMPRESSED
Definition: dhctoken.h:335
DEFINE
@ DEFINE
Definition: dhctoken.h:254
KNOWN_CLIENTS
@ KNOWN_CLIENTS
Definition: dhctoken.h:315
LOAD
@ LOAD
Definition: dhctoken.h:259
NS_REFUSED
@ NS_REFUSED
Definition: dhctoken.h:243
LEASED_ADDRESS
@ LEASED_ADDRESS
Definition: dhctoken.h:202
GET_LEASE_HOSTNAMES
@ GET_LEASE_HOSTNAMES
Definition: dhctoken.h:99
HOST_DECL_NAME
@ HOST_DECL_NAME
Definition: dhctoken.h:206
EXPIRY
@ EXPIRY
Definition: dhctoken.h:208
ALGORITHM
@ ALGORITHM
Definition: dhctoken.h:258
EN
@ EN
Definition: dhctoken.h:349
NUMBER
@ NUMBER
Definition: dhctoken.h:67
TOKEN_FDDI
@ TOKEN_FDDI
Definition: dhctoken.h:181
REQUEST
@ REQUEST
Definition: dhctoken.h:103
AUTHORITATIVE
@ AUTHORITATIVE
Definition: dhctoken.h:182
RANGE
@ RANGE
Definition: dhctoken.h:76
RECOVER
@ RECOVER
Definition: dhctoken.h:180
ALL
@ ALL
Definition: dhctoken.h:159
DOMAIN_NAME
@ DOMAIN_NAME
Definition: dhctoken.h:313
LOG
@ LOG
Definition: dhctoken.h:280
MINUS
@ MINUS
Definition: dhctoken.h:51
LET
@ LET
Definition: dhctoken.h:252
LEASE6
@ LEASE6
Definition: dhctoken.h:343
TOKEN_ACTIVE
@ TOKEN_ACTIVE
Definition: dhctoken.h:271
MCLT
@ MCLT
Definition: dhctoken.h:227
RETRY
@ RETRY
Definition: dhctoken.h:106
STATE
@ STATE
Definition: dhctoken.h:265
RECOVER_DONE
@ RECOVER_DONE
Definition: dhctoken.h:287
LEASE_ID_FORMAT
@ LEASE_ID_FORMAT
Definition: dhctoken.h:376
STARTS
@ STARTS
Definition: dhctoken.h:71
BOUND
@ BOUND
Definition: dhctoken.h:296
file
const char * file
Definition: dhcpd.h:3793
DOMAIN
@ DOMAIN
Definition: dhctoken.h:126
POTENTIAL_CONFLICT
@ POTENTIAL_CONFLICT
Definition: dhctoken.h:179
IAADDR
@ IAADDR
Definition: dhctoken.h:341
TOKEN_DELETED
@ TOKEN_DELETED
Definition: dhctoken.h:216
IAPREFIX
@ IAPREFIX
Definition: dhctoken.h:342
BREAK
@ BREAK
Definition: dhctoken.h:145
TOKEN_RESET
@ TOKEN_RESET
Definition: dhctoken.h:274
CONNECT
@ CONNECT
Definition: dhctoken.h:310
IF
@ IF
Definition: dhctoken.h:143
COMMIT
@ COMMIT
Definition: dhctoken.h:210
DO_FORWARD_UPDATE
@ DO_FORWARD_UPDATE
Definition: dhctoken.h:314
UCASE
@ UCASE
Definition: dhctoken.h:318
peek_token
enum dhcp_token peek_token(const char **rval, unsigned *rlen, struct parse *cfile)
Definition: conflex.c:443
SPACE
@ SPACE
Definition: dhctoken.h:198
TOKEN_OPEN
@ TOKEN_OPEN
Definition: dhctoken.h:305
CLTT
@ CLTT
Definition: dhctoken.h:267
INTERFACE
@ INTERFACE
Definition: dhctoken.h:109
UNAUTHENTICATED
@ UNAUTHENTICATED
Definition: dhctoken.h:158
do_peek_token
enum dhcp_token do_peek_token(const char **rval, unsigned int *rlen, struct parse *cfile, isc_boolean_t raw)
Definition: conflex.c:395
END_OF_FILE
@ END_OF_FILE
Definition: dhctoken.h:307
PREPEND
@ PREPEND
Definition: dhctoken.h:130
STRING
@ STRING
Definition: dhctoken.h:66
restore_parse_state
isc_result_t restore_parse_state(struct parse *cfile)
Definition: conflex.c:159
CLIENTS
@ CLIENTS
Definition: dhctoken.h:155
MAX_TRANSMIT_IDLE
@ MAX_TRANSMIT_IDLE
Definition: dhctoken.h:174
DYNAMIC_BOOTP
@ DYNAMIC_BOOTP
Definition: dhctoken.h:90
PACKET
@ PACKET
Definition: dhctoken.h:77
EXISTS
@ EXISTS
Definition: dhctoken.h:152
SECONDS
@ SECONDS
Definition: dhctoken.h:262
INITIAL_DELAY
@ INITIAL_DELAY
Definition: dhctoken.h:364
DB_TIME_FORMAT
@ DB_TIME_FORMAT
Definition: dhctoken.h:324
POOL
@ POOL
Definition: dhctoken.h:153
FUNCTION
@ FUNCTION
Definition: dhctoken.h:253
CLIENT_UPDATES
@ CLIENT_UPDATES
Definition: dhctoken.h:300
OPTION
@ OPTION
Definition: dhctoken.h:64
BOOLEAN
@ BOOLEAN
Definition: dhctoken.h:191
parse::tlen
int tlen
Definition: dhcpd.h:323
NS_NXDOMAIN
@ NS_NXDOMAIN
Definition: dhctoken.h:241
SERVER_DUID
@ SERVER_DUID
Definition: dhctoken.h:347
parse_warn
int parse_warn(struct parse *cfile, const char *fmt,...)
Definition: parse.c:5642
SUBCLASS
@ SUBCLASS
Definition: dhctoken.h:148
NS_NOTZONE
@ NS_NOTZONE
Definition: dhctoken.h:240
YIADDR
@ YIADDR
Definition: dhctoken.h:79
dmalloc
void * dmalloc(size_t, const char *, int)
Definition: alloc.c:57
VENDOR_CLASS
@ VENDOR_CLASS
Definition: dhctoken.h:86
STATIC
@ STATIC
Definition: dhctoken.h:213
UNKNOWN
@ UNKNOWN
Definition: dhctoken.h:154
TOKEN_NO
@ TOKEN_NO
Definition: dhctoken.h:230
SEND
@ SEND
Definition: dhctoken.h:101
parse::token_line
char * token_line
Definition: dhcpd.h:291
TOKEN_BOOTP
@ TOKEN_BOOTP
Definition: dhctoken.h:277
WITH
@ WITH
Definition: dhctoken.h:151
UID
@ UID
Definition: dhctoken.h:73
NS_YXRRSET
@ NS_YXRRSET
Definition: dhctoken.h:246
BOOTING
@ BOOTING
Definition: dhctoken.h:116
TOKEN_EXPIRED
@ TOKEN_EXPIRED
Definition: dhctoken.h:272
DOMAIN_LIST
@ DOMAIN_LIST
Definition: dhctoken.h:330
IA_NA
@ IA_NA
Definition: dhctoken.h:338
FILENAME
@ FILENAME
Definition: dhctoken.h:62
REBOOT
@ REBOOT
Definition: dhctoken.h:121
ANYCAST_MAC
@ ANYCAST_MAC
Definition: dhctoken.h:359
TOKEN_BACKUP
@ TOKEN_BACKUP
Definition: dhctoken.h:275
TOKEN_ADD
@ TOKEN_ADD
Definition: dhctoken.h:144
DECLINES
@ DECLINES
Definition: dhctoken.h:220
UNSIGNED
@ UNSIGNED
Definition: dhctoken.h:194
DYNAMIC
@ DYNAMIC
Definition: dhctoken.h:160
MEMBERS
@ MEMBERS
Definition: dhctoken.h:161
CONFIG_OPTION
@ CONFIG_OPTION
Definition: dhctoken.h:205
TRANSMISSION
@ TRANSMISSION
Definition: dhctoken.h:302
RECONTACT_INTERVAL
@ RECONTACT_INTERVAL
Definition: dhctoken.h:299
RANGE6
@ RANGE6
Definition: dhctoken.h:351
POOL6
@ POOL6
Definition: dhctoken.h:369
REMOVE
@ REMOVE
Definition: dhctoken.h:311
UPDATE
@ UPDATE
Definition: dhctoken.h:233
TOKEN_HELP
@ TOKEN_HELP
Definition: dhctoken.h:306
KEY
@ KEY
Definition: dhctoken.h:256
ADDRESS
@ ADDRESS
Definition: dhctoken.h:263
DEFAULT
@ DEFAULT
Definition: dhctoken.h:117
BINDING
@ BINDING
Definition: dhctoken.h:269
VENDOR
@ VENDOR
Definition: dhctoken.h:291
UNSET
@ UNSET
Definition: dhctoken.h:250
ERROR
@ ERROR
Definition: dhctoken.h:282
GIADDR
@ GIADDR
Definition: dhctoken.h:81
PAUSED
@ PAUSED
Definition: dhctoken.h:286
HOST_IDENTIFIER
@ HOST_IDENTIFIER
Definition: dhctoken.h:337
parse::line
int line
Definition: dhcpd.h:317
PARSE_VENDOR_OPT
@ PARSE_VENDOR_OPT
Definition: dhctoken.h:372
NS_YXDOMAIN
@ NS_YXDOMAIN
Definition: dhctoken.h:245
KNOWN
@ KNOWN
Definition: dhctoken.h:156
SIADDR
@ SIADDR
Definition: dhctoken.h:80
parse::inbuf
char * inbuf
Definition: dhcpd.h:328
LEASE
@ LEASE
Definition: dhctoken.h:75
BALANCE
@ BALANCE
Definition: dhctoken.h:260
shared_network::name
char * name
Definition: dhcpd.h:1056
NS_NOTIMP
@ NS_NOTIMP
Definition: dhctoken.h:239
PRIMARY6
@ PRIMARY6
Definition: dhctoken.h:366
TSFP
@ TSFP
Definition: dhctoken.h:222
TOKEN_BIG_ENDIAN
@ TOKEN_BIG_ENDIAN
Definition: dhctoken.h:375
TOKEN_RELEASED
@ TOKEN_RELEASED
Definition: dhctoken.h:273
SELECT_TIMEOUT
@ SELECT_TIMEOUT
Definition: dhctoken.h:107
SHUTDOWN
@ SHUTDOWN
Definition: dhctoken.h:288
IGNORE
@ IGNORE
Definition: dhctoken.h:185
ISC_R_SUCCESS
#define ISC_R_SUCCESS
parse::tlname
const char * tlname
Definition: dhcpd.h:294
CHECK
@ CHECK
Definition: dhctoken.h:141
parse::token
enum dhcp_token token
Definition: dhcpd.h:320
AT
@ AT
Definition: dhctoken.h:229
NAMESERVER
@ NAMESERVER
Definition: dhctoken.h:125
OR
@ OR
Definition: dhctoken.h:138
ALLOW
@ ALLOW
Definition: dhctoken.h:114
LL
@ LL
Definition: dhctoken.h:350
MAX_BALANCE
@ MAX_BALANCE
Definition: dhctoken.h:328
DEFINED
@ DEFINED
Definition: dhctoken.h:249
SUPERSEDE
@ SUPERSEDE
Definition: dhctoken.h:128
next_token
enum dhcp_token next_token(const char **rval, unsigned *rlen, struct parse *cfile)
Definition: conflex.c:369
SUBNET6
@ SUBNET6
Definition: dhctoken.h:336
CASE
@ CASE
Definition: dhctoken.h:235
BOOT_UNKNOWN_CLIENTS
@ BOOT_UNKNOWN_CLIENTS
Definition: dhctoken.h:94
IP6_ADDRESS
@ IP6_ADDRESS
Definition: dhctoken.h:333
TOKEN_RESERVED
@ TOKEN_RESERVED
Definition: dhctoken.h:276
parse::bufsiz
size_t bufsiz
Definition: dhcpd.h:330
MY
@ MY
Definition: dhctoken.h:168
ON
@ ON
Definition: dhctoken.h:207
RECOVER_WAIT
@ RECOVER_WAIT
Definition: dhctoken.h:308
UNKNOWN_CLIENTS
@ UNKNOWN_CLIENTS
Definition: dhctoken.h:113
SUFFIX
@ SUFFIX
Definition: dhctoken.h:140
USE_HOST_DECL_NAMES
@ USE_HOST_DECL_NAMES
Definition: dhctoken.h:100