Changes for kernel and Busybox
[tomato.git] / release / src / router / dhcpv6 / cftoken.c
blobfcccc5acfe88fd0b7c49a085c171b9648fc50e65
1 /* A lexical scanner generated by flex */
3 /* Scanner skeleton version:
4 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
5 * $FreeBSD: src/usr.bin/lex/flex.skl,v 1.8 2004/01/06 19:03:44 nectar Exp $
6 */
8 #if defined(__FreeBSD__)
9 #include <sys/cdefs.h>
10 #else
11 #define __unused
12 #endif
14 #define FLEX_SCANNER
15 #define YY_FLEX_MAJOR_VERSION 2
16 #define YY_FLEX_MINOR_VERSION 5
18 #include <stdio.h>
21 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
22 #ifdef c_plusplus
23 #ifndef __cplusplus
24 #define __cplusplus
25 #endif
26 #endif
29 #ifdef __cplusplus
31 #include <stdlib.h>
32 #include <unistd.h>
34 /* Use prototypes in function declarations. */
35 #define YY_USE_PROTOS
37 /* The "const" storage-class-modifier is valid. */
38 #define YY_USE_CONST
40 #else /* ! __cplusplus */
42 #if __STDC__
44 #define YY_USE_PROTOS
45 #define YY_USE_CONST
47 #endif /* __STDC__ */
48 #endif /* ! __cplusplus */
50 #ifdef __TURBOC__
51 #pragma warn -rch
52 #pragma warn -use
53 #include <io.h>
54 #include <stdlib.h>
55 #define YY_USE_CONST
56 #define YY_USE_PROTOS
57 #endif
59 #ifdef YY_USE_CONST
60 #define yyconst const
61 #else
62 #define yyconst
63 #endif
66 #ifdef YY_USE_PROTOS
67 #define YY_PROTO(proto) proto
68 #else
69 #define YY_PROTO(proto) ()
70 #endif
72 /* Returned upon end-of-file. */
73 #define YY_NULL 0
75 /* Promotes a possibly negative, possibly signed char to an unsigned
76 * integer for use as an array index. If the signed char is negative,
77 * we want to instead treat it as an 8-bit unsigned char, hence the
78 * double cast.
80 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
82 /* Enter a start condition. This macro really ought to take a parameter,
83 * but we do it the disgusting crufty way forced on us by the ()-less
84 * definition of BEGIN.
86 #define BEGIN yy_start = 1 + 2 *
88 /* Translate the current start state into a value that can be later handed
89 * to BEGIN to return to the state. The YYSTATE alias is for lex
90 * compatibility.
92 #define YY_START ((yy_start - 1) / 2)
93 #define YYSTATE YY_START
95 /* Action number for EOF rule of a given start state. */
96 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
98 /* Special action meaning "start processing a new file". */
99 #define YY_NEW_FILE yyrestart( yyin )
101 #define YY_END_OF_BUFFER_CHAR 0
103 /* Size of default input buffer. */
104 #define YY_BUF_SIZE 16384
106 typedef struct yy_buffer_state *YY_BUFFER_STATE;
108 extern int yyleng;
109 extern FILE *yyin, *yyout;
111 #define EOB_ACT_CONTINUE_SCAN 0
112 #define EOB_ACT_END_OF_FILE 1
113 #define EOB_ACT_LAST_MATCH 2
115 /* The funky do-while in the following #define is used to turn the definition
116 * int a single C statement (which needs a semi-colon terminator). This
117 * avoids problems with code like:
119 * if ( condition_holds )
120 * yyless( 5 );
121 * else
122 * do_something_else();
124 * Prior to using the do-while the compiler would get upset at the
125 * "else" because it interpreted the "if" statement as being all
126 * done when it reached the ';' after the yyless() call.
129 /* Return all but the first 'n' matched characters back to the input stream. */
131 #define yyless(n) \
132 do \
134 /* Undo effects of setting up yytext. */ \
135 *yy_cp = yy_hold_char; \
136 YY_RESTORE_YY_MORE_OFFSET \
137 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
138 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
140 while ( 0 )
142 #define unput(c) yyunput( c, yytext_ptr )
144 /* The following is because we cannot portably get our hands on size_t
145 * (without autoconf's help, which isn't available because we want
146 * flex-generated scanners to compile on their own).
148 typedef unsigned int yy_size_t;
151 struct yy_buffer_state
153 FILE *yy_input_file;
155 char *yy_ch_buf; /* input buffer */
156 char *yy_buf_pos; /* current position in input buffer */
158 /* Size of input buffer in bytes, not including room for EOB
159 * characters.
161 yy_size_t yy_buf_size;
163 /* Number of characters read into yy_ch_buf, not including EOB
164 * characters.
166 int yy_n_chars;
168 /* Whether we "own" the buffer - i.e., we know we created it,
169 * and can realloc() it to grow it, and should free() it to
170 * delete it.
172 int yy_is_our_buffer;
174 /* Whether this is an "interactive" input source; if so, and
175 * if we're using stdio for input, then we want to use getc()
176 * instead of fread(), to make sure we stop fetching input after
177 * each newline.
179 int yy_is_interactive;
181 /* Whether we're considered to be at the beginning of a line.
182 * If so, '^' rules will be active on the next match, otherwise
183 * not.
185 int yy_at_bol;
187 /* Whether to try to fill the input buffer when we reach the
188 * end of it.
190 int yy_fill_buffer;
192 int yy_buffer_status;
193 #define YY_BUFFER_NEW 0
194 #define YY_BUFFER_NORMAL 1
195 /* When an EOF's been seen but there's still some text to process
196 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
197 * shouldn't try reading from the input source any more. We might
198 * still have a bunch of tokens to match, though, because of
199 * possible backing-up.
201 * When we actually see the EOF, we change the status to "new"
202 * (via yyrestart()), so that the user can continue scanning by
203 * just pointing yyin at a new input file.
205 #define YY_BUFFER_EOF_PENDING 2
208 static YY_BUFFER_STATE yy_current_buffer = 0;
210 /* We provide macros for accessing buffer states in case in the
211 * future we want to put the buffer states in a more general
212 * "scanner state".
214 #define YY_CURRENT_BUFFER yy_current_buffer
217 /* yy_hold_char holds the character lost when yytext is formed. */
218 static char yy_hold_char;
220 static int yy_n_chars; /* number of characters read into yy_ch_buf */
223 int yyleng;
225 /* Points to current character in buffer. */
226 static char *yy_c_buf_p = (char *) 0;
227 static int yy_init = 1; /* whether we need to initialize */
228 static int yy_start = 0; /* start state number */
230 /* Flag which is used to allow yywrap()'s to do buffer switches
231 * instead of setting up a fresh yyin. A bit of a hack ...
233 static int yy_did_buffer_switch_on_eof;
235 void yyrestart YY_PROTO(( FILE *input_file ));
237 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
238 void yy_load_buffer_state YY_PROTO(( void ));
239 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
240 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
241 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
242 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
243 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
245 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
246 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
247 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
249 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
250 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) __unused;
251 static void yy_flex_free YY_PROTO(( void * ));
253 #define yy_new_buffer yy_create_buffer
255 #define yy_set_interactive(is_interactive) \
257 if ( ! yy_current_buffer ) \
258 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
259 yy_current_buffer->yy_is_interactive = is_interactive; \
262 #define yy_set_bol(at_bol) \
264 if ( ! yy_current_buffer ) \
265 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
266 yy_current_buffer->yy_at_bol = at_bol; \
269 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
271 typedef unsigned char YY_CHAR;
272 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
273 typedef int yy_state_type;
274 extern char *yytext;
275 #define yytext_ptr yytext
277 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
278 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
279 static int yy_get_next_buffer YY_PROTO(( void ));
280 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
282 /* Done after the current pattern has been matched and before the
283 * corresponding action - sets up yytext.
285 #define YY_DO_BEFORE_ACTION \
286 yytext_ptr = yy_bp; \
287 yyleng = (int) (yy_cp - yy_bp); \
288 yy_hold_char = *yy_cp; \
289 *yy_cp = '\0'; \
290 yy_c_buf_p = yy_cp;
292 #define YY_NUM_RULES 81
293 #define YY_END_OF_BUFFER 82
294 static yyconst short int yy_accept[517] =
295 { 0,
296 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
297 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
298 0, 0, 0, 0, 82, 81, 71, 72, 81, 73,
299 76, 80, 80, 75, 74, 77, 78, 79, 80, 80,
300 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
301 80, 80, 80, 2, 2, 2, 4, 4, 4, 74,
302 80, 80, 42, 80, 80, 43, 49, 49, 49, 62,
303 62, 62, 81, 6, 6, 6, 81, 71, 0, 70,
304 73, 80, 74, 80, 74, 80, 80, 80, 80, 80,
305 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
307 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
308 80, 80, 80, 17, 2, 2, 2, 2, 4, 4,
309 4, 4, 8, 8, 42, 80, 42, 41, 40, 49,
310 49, 49, 49, 62, 62, 62, 62, 0, 66, 6,
311 6, 6, 6, 0, 69, 80, 80, 80, 80, 80,
312 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
313 80, 80, 53, 80, 80, 80, 80, 80, 80, 80,
314 80, 80, 52, 80, 80, 80, 80, 80, 80, 80,
315 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
316 80, 7, 80, 80, 3, 80, 80, 80, 80, 80,
318 80, 80, 80, 80, 80, 80, 80, 80, 5, 80,
319 80, 80, 80, 80, 80, 80, 80, 80, 80, 15,
320 80, 80, 80, 80, 80, 80, 80, 38, 80, 80,
321 80, 80, 80, 80, 80, 22, 21, 80, 80, 80,
322 80, 80, 64, 80, 80, 80, 80, 80, 80, 80,
323 80, 80, 80, 16, 80, 63, 80, 80, 80, 80,
324 80, 80, 80, 80, 8, 80, 80, 80, 80, 80,
325 80, 80, 80, 67, 80, 80, 80, 80, 80, 80,
326 80, 80, 80, 80, 80, 80, 80, 80, 19, 80,
327 10, 80, 80, 80, 80, 80, 12, 65, 80, 45,
329 80, 80, 59, 9, 80, 80, 80, 54, 80, 80,
330 58, 80, 68, 80, 80, 80, 61, 80, 80, 80,
331 80, 80, 80, 80, 80, 80, 80, 80, 80, 14,
332 80, 46, 57, 80, 80, 80, 80, 80, 80, 56,
333 39, 47, 80, 80, 80, 80, 80, 80, 80, 80,
334 80, 80, 50, 80, 55, 80, 80, 80, 51, 80,
335 80, 80, 80, 80, 1, 80, 80, 80, 80, 80,
336 80, 80, 80, 80, 80, 80, 80, 80, 80, 13,
337 80, 80, 80, 80, 80, 80, 80, 80, 11, 80,
338 80, 80, 80, 80, 80, 80, 24, 80, 60, 80,
340 80, 80, 80, 27, 80, 80, 34, 80, 18, 80,
341 80, 80, 80, 80, 80, 80, 80, 80, 80, 20,
342 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
343 80, 80, 80, 80, 80, 48, 80, 80, 80, 80,
344 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
345 80, 80, 80, 29, 80, 80, 80, 80, 80, 80,
346 80, 80, 80, 80, 80, 37, 80, 80, 31, 80,
347 80, 44, 80, 80, 80, 80, 80, 80, 80, 80,
348 80, 80, 80, 80, 80, 80, 28, 80, 80, 80,
349 25, 80, 80, 80, 23, 80, 30, 80, 80, 32,
351 80, 80, 80, 80, 80, 80, 80, 80, 80, 35,
352 80, 26, 80, 36, 33, 0
355 static yyconst int yy_ec[256] =
356 { 0,
357 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
358 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
359 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
360 1, 2, 1, 4, 5, 1, 1, 1, 1, 1,
361 1, 1, 1, 6, 7, 8, 9, 10, 10, 10,
362 10, 10, 11, 10, 10, 10, 10, 12, 13, 1,
363 1, 1, 1, 1, 14, 15, 16, 17, 15, 15,
364 18, 19, 18, 18, 18, 18, 20, 18, 18, 18,
365 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
366 1, 1, 1, 1, 18, 1, 21, 22, 23, 24,
368 25, 26, 27, 28, 29, 18, 30, 31, 32, 33,
369 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
370 44, 18, 45, 1, 46, 1, 1, 1, 1, 1,
371 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
372 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
373 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
374 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
375 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
379 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
380 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
381 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
382 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
383 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
384 1, 1, 1, 1, 1
387 static yyconst int yy_meta[47] =
388 { 0,
389 1, 1, 2, 1, 1, 1, 3, 3, 1, 3,
390 3, 3, 1, 3, 3, 3, 3, 3, 3, 3,
391 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
392 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
393 3, 3, 3, 3, 1, 1
396 static yyconst short int yy_base[533] =
397 { 0,
398 0, 46, 74, 0, 113, 159, 0, 0, 205, 251,
399 288, 0, 8, 25, 314, 360, 406, 452, 767, 766,
400 498, 544, 765, 764, 767, 772, 764, 772, 761, 0,
401 772, 0, 4, 772, 12, 772, 772, 772, 744, 0,
402 740, 4, 719, 0, 4, 736, 726, 32, 724, 5,
403 41, 44, 724, 0, 16, 66, 0, 53, 70, 583,
404 74, 76, 117, 736, 732, 772, 0, 78, 121, 0,
405 90, 125, 751, 0, 127, 131, 750, 751, 748, 772,
406 0, 0, 133, 135, 139, 737, 726, 41, 710, 716,
407 716, 714, 716, 709, 722, 704, 734, 733, 71, 695,
409 705, 699, 701, 696, 700, 123, 118, 701, 150, 695,
410 97, 696, 709, 0, 0, 144, 164, 169, 0, 171,
411 173, 177, 181, 717, 184, 186, 190, 0, 0, 0,
412 192, 209, 213, 0, 215, 217, 221, 724, 772, 0,
413 223, 225, 229, 723, 772, 710, 688, 690, 689, 694,
414 698, 699, 698, 694, 688, 693, 676, 208, 693, 682,
415 183, 687, 682, 676, 223, 702, 679, 676, 680, 666,
416 677, 674, 0, 671, 667, 663, 659, 669, 660, 672,
417 688, 687, 600, 10, 668, 655, 649, 665, 651, 644,
418 658, 0, 649, 215, 0, 664, 660, 645, 642, 648,
420 643, 642, 166, 655, 128, 670, 638, 641, 0, 54,
421 640, 641, 613, 604, 602, 605, 604, 585, 594, 0,
422 580, 213, 617, 593, 595, 565, 573, 0, 568, 589,
423 570, 559, 563, 555, 562, 0, 0, 547, 560, 554,
424 550, 555, 0, 554, 545, 544, 552, 225, 551, 542,
425 537, 530, 549, 0, 564, 0, 544, 531, 530, 528,
426 527, 540, 540, 538, 550, 544, 549, 521, 519, 517,
427 513, 518, 534, 0, 516, 528, 504, 512, 497, 514,
428 513, 499, 492, 499, 493, 495, 503, 490, 0, 501,
429 518, 490, 500, 493, 493, 481, 0, 0, 482, 0,
431 485, 506, 0, 509, 487, 485, 488, 482, 477, 494,
432 0, 473, 0, 451, 455, 470, 0, 459, 470, 449,
433 457, 451, 446, 453, 456, 453, 449, 455, 442, 0,
434 439, 0, 0, 444, 446, 454, 439, 450, 453, 0,
435 0, 0, 444, 447, 432, 441, 444, 447, 426, 441,
436 441, 426, 0, 418, 0, 420, 423, 413, 0, 425,
437 404, 400, 411, 408, 0, 416, 407, 402, 409, 412,
438 399, 410, 395, 401, 400, 394, 396, 390, 403, 0,
439 402, 393, 388, 417, 416, 389, 384, 382, 0, 393,
440 384, 379, 396, 371, 372, 363, 392, 391, 0, 364,
442 224, 389, 388, 0, 357, 354, 0, 244, 0, 358,
443 384, 352, 355, 367, 363, 352, 352, 245, 358, 0,
444 359, 348, 348, 246, 355, 346, 346, 353, 344, 354,
445 350, 338, 346, 334, 325, 0, 332, 321, 317, 322,
446 327, 314, 329, 317, 324, 315, 323, 308, 323, 319,
447 310, 300, 296, 0, 314, 309, 312, 299, 314, 309,
448 308, 303, 294, 309, 304, 0, 290, 293, 0, 296,
449 279, 0, 269, 273, 276, 271, 258, 256, 286, 254,
450 258, 252, 282, 250, 254, 248, 0, 252, 246, 276,
451 0, 249, 243, 273, 0, 258, 0, 245, 256, 0,
453 243, 243, 253, 241, 251, 246, 214, 213, 146, 0,
454 131, 0, 115, 0, 0, 772, 643, 646, 649, 652,
455 655, 658, 661, 664, 131, 102, 87, 18, 9, 667,
456 4, 670
459 static yyconst short int yy_def[533] =
460 { 0,
461 517, 517, 2, 3, 518, 518, 2, 2, 519, 519,
462 2, 11, 2, 2, 520, 520, 521, 521, 2, 2,
463 522, 522, 2, 2, 516, 516, 516, 516, 523, 524,
464 516, 525, 525, 516, 525, 516, 516, 516, 525, 525,
465 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
466 525, 525, 525, 526, 526, 526, 527, 527, 527, 525,
467 60, 525, 525, 525, 525, 516, 528, 528, 528, 529,
468 529, 529, 530, 531, 531, 531, 532, 516, 523, 516,
469 524, 525, 525, 525, 525, 525, 525, 525, 525, 525,
470 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
472 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
473 525, 525, 525, 525, 526, 526, 526, 526, 527, 527,
474 527, 527, 525, 525, 525, 525, 525, 525, 525, 528,
475 528, 528, 528, 529, 529, 529, 529, 530, 516, 531,
476 531, 531, 531, 532, 516, 525, 525, 525, 525, 525,
477 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
478 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
479 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
480 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
481 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
483 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
484 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
485 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
486 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
487 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
488 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
489 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
490 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
491 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
492 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
494 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
495 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
496 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
497 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
498 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
499 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
500 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
501 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
502 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
503 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
505 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
506 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
507 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
508 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
509 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
510 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
511 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
512 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
513 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
514 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
516 525, 525, 525, 525, 525, 525, 525, 525, 525, 525,
517 525, 525, 525, 525, 525, 0, 516, 516, 516, 516,
518 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
519 516, 516
522 static yyconst short int yy_nxt[819] =
523 { 0,
524 26, 27, 28, 29, 30, 31, 140, 33, 34, 35,
525 35, 134, 36, 83, 83, 62, 224, 63, 63, 84,
526 130, 85, 85, 87, 97, 116, 116, 98, 91, 225,
527 88, 95, 62, 96, 63, 63, 99, 92, 105, 89,
528 64, 106, 65, 93, 37, 38, 26, 27, 28, 29,
529 30, 31, 66, 33, 34, 35, 35, 64, 36, 65,
530 102, 107, 120, 120, 108, 109, 110, 148, 111, 66,
531 103, 149, 112, 117, 113, 118, 118, 121, 251, 122,
532 122, 82, 252, 124, 124, 125, 125, 131, 131, 119,
533 37, 38, 39, 160, 40, 41, 161, 42, 43, 135,
535 135, 44, 45, 46, 115, 47, 48, 49, 50, 162,
536 51, 52, 53, 26, 27, 28, 29, 30, 31, 179,
537 55, 34, 56, 56, 126, 36, 127, 127, 132, 180,
538 133, 133, 136, 82, 137, 137, 141, 141, 142, 515,
539 143, 143, 83, 83, 83, 83, 84, 169, 85, 85,
540 171, 246, 172, 116, 116, 514, 170, 37, 38, 26,
541 27, 28, 29, 30, 31, 247, 55, 34, 56, 56,
542 174, 36, 175, 116, 116, 176, 117, 513, 118, 118,
543 120, 120, 120, 120, 121, 177, 122, 122, 84, 243,
544 85, 85, 183, 125, 125, 125, 125, 126, 244, 127,
546 127, 131, 131, 37, 38, 26, 27, 28, 29, 30,
547 31, 200, 58, 34, 59, 59, 201, 36, 131, 131,
548 132, 234, 133, 133, 135, 135, 135, 135, 136, 205,
549 137, 137, 141, 141, 141, 141, 142, 512, 143, 143,
550 196, 263, 197, 264, 415, 511, 235, 416, 286, 37,
551 38, 26, 27, 28, 29, 30, 31, 206, 58, 34,
552 59, 59, 287, 36, 421, 431, 437, 422, 432, 438,
553 510, 509, 508, 507, 506, 505, 504, 503, 502, 501,
554 500, 499, 498, 497, 496, 495, 494, 493, 492, 491,
555 490, 489, 488, 487, 486, 37, 38, 60, 60, 485,
557 484, 61, 61, 61, 61, 483, 482, 481, 61, 61,
558 61, 61, 61, 61, 26, 27, 28, 29, 30, 31,
559 480, 68, 34, 69, 69, 479, 36, 478, 477, 476,
560 475, 474, 473, 472, 471, 470, 469, 468, 467, 466,
561 465, 464, 463, 462, 461, 460, 459, 458, 457, 456,
562 455, 454, 453, 452, 451, 450, 449, 448, 37, 38,
563 26, 27, 28, 29, 30, 31, 447, 68, 34, 69,
564 69, 446, 36, 445, 444, 443, 442, 441, 440, 439,
565 436, 435, 434, 433, 430, 429, 428, 427, 426, 425,
566 424, 423, 420, 419, 418, 417, 414, 413, 412, 411,
568 410, 409, 408, 407, 37, 38, 26, 27, 28, 29,
569 30, 31, 406, 71, 34, 72, 72, 405, 36, 404,
570 403, 402, 401, 400, 399, 398, 397, 396, 395, 394,
571 393, 392, 391, 390, 389, 388, 387, 386, 385, 384,
572 383, 382, 381, 380, 379, 378, 377, 376, 375, 374,
573 37, 38, 26, 27, 28, 29, 30, 31, 373, 71,
574 34, 72, 72, 372, 36, 371, 370, 369, 368, 367,
575 366, 365, 364, 363, 362, 361, 360, 359, 358, 357,
576 356, 355, 354, 353, 352, 351, 350, 349, 348, 347,
577 346, 345, 344, 343, 342, 341, 37, 38, 26, 27,
579 28, 29, 30, 31, 340, 75, 34, 76, 76, 339,
580 36, 338, 337, 336, 335, 334, 333, 332, 331, 330,
581 329, 328, 327, 326, 325, 324, 323, 322, 321, 320,
582 319, 318, 317, 316, 315, 314, 313, 312, 311, 310,
583 309, 308, 37, 38, 26, 27, 28, 29, 30, 31,
584 307, 75, 34, 76, 76, 306, 36, 305, 304, 303,
585 302, 183, 301, 300, 299, 298, 297, 296, 295, 294,
586 293, 292, 291, 290, 289, 288, 285, 284, 283, 282,
587 281, 280, 279, 278, 277, 276, 275, 274, 37, 38,
588 84, 273, 123, 123, 272, 271, 124, 124, 124, 124,
590 270, 269, 268, 124, 124, 124, 124, 124, 124, 223,
591 223, 267, 266, 223, 223, 223, 223, 262, 261, 260,
592 223, 223, 223, 223, 223, 223, 265, 265, 259, 258,
593 265, 265, 265, 265, 257, 256, 255, 265, 265, 265,
594 265, 265, 265, 32, 32, 32, 54, 54, 54, 57,
595 57, 57, 67, 67, 67, 70, 70, 70, 74, 74,
596 74, 79, 79, 79, 81, 254, 81, 138, 138, 138,
597 144, 144, 144, 253, 250, 249, 248, 245, 242, 241,
598 240, 239, 238, 237, 236, 233, 232, 231, 230, 229,
599 228, 227, 226, 222, 221, 220, 219, 218, 217, 216,
601 215, 214, 213, 212, 211, 210, 209, 208, 207, 204,
602 203, 202, 199, 198, 195, 194, 193, 192, 191, 190,
603 189, 188, 187, 186, 185, 184, 145, 139, 183, 182,
604 181, 178, 173, 168, 167, 166, 165, 164, 163, 159,
605 158, 157, 156, 155, 154, 153, 152, 151, 150, 147,
606 146, 80, 78, 145, 139, 129, 128, 114, 104, 101,
607 100, 94, 90, 86, 80, 78, 516, 77, 77, 73,
608 73, 25, 516, 516, 516, 516, 516, 516, 516, 516,
609 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
610 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
612 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
613 516, 516, 516, 516, 516, 516, 516, 516
616 static yyconst short int yy_chk[819] =
617 { 0,
618 1, 1, 1, 1, 1, 1, 531, 1, 1, 1,
619 1, 529, 1, 33, 33, 13, 184, 13, 13, 35,
620 528, 35, 35, 40, 45, 55, 55, 45, 42, 184,
621 40, 44, 14, 44, 14, 14, 45, 42, 50, 40,
622 13, 50, 13, 42, 1, 1, 2, 2, 2, 2,
623 2, 2, 13, 2, 2, 2, 2, 14, 2, 14,
624 48, 51, 58, 58, 51, 51, 52, 88, 52, 14,
625 48, 88, 52, 56, 52, 56, 56, 59, 210, 59,
626 59, 61, 210, 61, 61, 62, 62, 68, 68, 527,
627 2, 2, 3, 99, 3, 3, 99, 3, 3, 71,
629 71, 3, 3, 3, 526, 3, 3, 3, 3, 99,
630 3, 3, 3, 5, 5, 5, 5, 5, 5, 111,
631 5, 5, 5, 5, 63, 5, 63, 63, 69, 111,
632 69, 69, 72, 525, 72, 72, 75, 75, 76, 513,
633 76, 76, 83, 83, 84, 84, 85, 106, 85, 85,
634 107, 205, 107, 116, 116, 511, 106, 5, 5, 6,
635 6, 6, 6, 6, 6, 205, 6, 6, 6, 6,
636 109, 6, 109, 117, 117, 109, 118, 509, 118, 118,
637 120, 120, 121, 121, 122, 109, 122, 122, 123, 203,
638 123, 123, 123, 125, 125, 126, 126, 127, 203, 127,
640 127, 131, 131, 6, 6, 9, 9, 9, 9, 9,
641 9, 161, 9, 9, 9, 9, 161, 9, 132, 132,
642 133, 194, 133, 133, 135, 135, 136, 136, 137, 165,
643 137, 137, 141, 141, 142, 142, 143, 508, 143, 143,
644 158, 222, 158, 222, 401, 507, 194, 401, 248, 9,
645 9, 10, 10, 10, 10, 10, 10, 165, 10, 10,
646 10, 10, 248, 10, 408, 418, 424, 408, 418, 424,
647 506, 505, 504, 503, 502, 501, 499, 498, 496, 494,
648 493, 492, 490, 489, 488, 486, 485, 484, 483, 482,
649 481, 480, 479, 478, 477, 10, 10, 11, 11, 476,
651 475, 11, 11, 11, 11, 474, 473, 471, 11, 11,
652 11, 11, 11, 11, 15, 15, 15, 15, 15, 15,
653 470, 15, 15, 15, 15, 468, 15, 467, 465, 464,
654 463, 462, 461, 460, 459, 458, 457, 456, 455, 453,
655 452, 451, 450, 449, 448, 447, 446, 445, 444, 443,
656 442, 441, 440, 439, 438, 437, 435, 434, 15, 15,
657 16, 16, 16, 16, 16, 16, 433, 16, 16, 16,
658 16, 432, 16, 431, 430, 429, 428, 427, 426, 425,
659 423, 422, 421, 419, 417, 416, 415, 414, 413, 412,
660 411, 410, 406, 405, 403, 402, 400, 398, 397, 396,
662 395, 394, 393, 392, 16, 16, 17, 17, 17, 17,
663 17, 17, 391, 17, 17, 17, 17, 390, 17, 388,
664 387, 386, 385, 384, 383, 382, 381, 379, 378, 377,
665 376, 375, 374, 373, 372, 371, 370, 369, 368, 367,
666 366, 364, 363, 362, 361, 360, 358, 357, 356, 354,
667 17, 17, 18, 18, 18, 18, 18, 18, 352, 18,
668 18, 18, 18, 351, 18, 350, 349, 348, 347, 346,
669 345, 344, 343, 339, 338, 337, 336, 335, 334, 331,
670 329, 328, 327, 326, 325, 324, 323, 322, 321, 320,
671 319, 318, 316, 315, 314, 312, 18, 18, 21, 21,
673 21, 21, 21, 21, 310, 21, 21, 21, 21, 309,
674 21, 308, 307, 306, 305, 304, 302, 301, 299, 296,
675 295, 294, 293, 292, 291, 290, 288, 287, 286, 285,
676 284, 283, 282, 281, 280, 279, 278, 277, 276, 275,
677 273, 272, 21, 21, 22, 22, 22, 22, 22, 22,
678 271, 22, 22, 22, 22, 270, 22, 269, 268, 267,
679 266, 265, 264, 263, 262, 261, 260, 259, 258, 257,
680 255, 253, 252, 251, 250, 249, 247, 246, 245, 244,
681 242, 241, 240, 239, 238, 235, 234, 233, 22, 22,
682 60, 232, 60, 60, 231, 230, 60, 60, 60, 60,
684 229, 227, 226, 60, 60, 60, 60, 60, 60, 183,
685 183, 225, 224, 183, 183, 183, 183, 221, 219, 218,
686 183, 183, 183, 183, 183, 183, 223, 223, 217, 216,
687 223, 223, 223, 223, 215, 214, 213, 223, 223, 223,
688 223, 223, 223, 517, 517, 517, 518, 518, 518, 519,
689 519, 519, 520, 520, 520, 521, 521, 521, 522, 522,
690 522, 523, 523, 523, 524, 212, 524, 530, 530, 530,
691 532, 532, 532, 211, 208, 207, 206, 204, 202, 201,
692 200, 199, 198, 197, 196, 193, 191, 190, 189, 188,
693 187, 186, 185, 182, 181, 180, 179, 178, 177, 176,
695 175, 174, 172, 171, 170, 169, 168, 167, 166, 164,
696 163, 162, 160, 159, 157, 156, 155, 154, 153, 152,
697 151, 150, 149, 148, 147, 146, 144, 138, 124, 113,
698 112, 110, 108, 105, 104, 103, 102, 101, 100, 98,
699 97, 96, 95, 94, 93, 92, 91, 90, 89, 87,
700 86, 79, 78, 77, 73, 65, 64, 53, 49, 47,
701 46, 43, 41, 39, 29, 27, 25, 24, 23, 20,
702 19, 516, 516, 516, 516, 516, 516, 516, 516, 516,
703 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
704 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
706 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
707 516, 516, 516, 516, 516, 516, 516, 516
710 static yy_state_type yy_last_accepting_state;
711 static char *yy_last_accepting_cpos;
713 /* The intent behind this definition is that it'll catch
714 * any uses of REJECT which flex missed.
716 #define REJECT reject_used_but_not_detected
717 #define yymore() yymore_used_but_not_detected
718 #define YY_MORE_ADJ 0
719 #define YY_RESTORE_YY_MORE_OFFSET
720 char *yytext;
721 #line 1 "cftoken.l"
722 #define INITIAL 0
723 /* $KAME: cftoken.l,v 1.35 2005/01/12 06:06:11 suz Exp $ */
724 #line 4 "cftoken.l"
726 * Copyright (C) 2002 WIDE Project.
727 * All rights reserved.
729 * Redistribution and use in source and binary forms, with or without
730 * modification, are permitted provided that the following conditions
731 * are met:
732 * 1. Redistributions of source code must retain the above copyright
733 * notice, this list of conditions and the following disclaimer.
734 * 2. Redistributions in binary form must reproduce the above copyright
735 * notice, this list of conditions and the following disclaimer in the
736 * documentation and/or other materials provided with the distribution.
737 * 3. Neither the name of the project nor the names of its contributors
738 * may be used to endorse or promote products derived from this software
739 * without specific prior written permission.
741 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
742 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
743 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
744 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
745 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
746 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
747 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
748 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
749 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
750 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
751 * SUCH DAMAGE.
753 #include <sys/types.h>
754 #include <sys/param.h>
755 #include <sys/socket.h>
756 #include <sys/queue.h>
757 #include <sys/time.h>
759 #include <netinet/in.h>
761 #include <errno.h>
762 #include <syslog.h>
763 #include <string.h>
764 #ifdef HAVE_STDARG_H
765 #include <stdarg.h>
766 #else
767 #include <varargs.h>
768 #endif
770 #include "dhcp6.h"
771 #include "config.h"
772 #include "common.h"
773 #include "y.tab.h"
775 #define YY_NO_UNPUT 1
777 char *configfilename;
778 int lineno = 1;
781 /* Recursion limit for includes */
782 #define MAX_INCLUDE_DEPTH 10
784 static struct include_stack {
785 char *path;
786 YY_BUFFER_STATE state;
787 int lineno;
788 } incstack[MAX_INCLUDE_DEPTH];
789 int incstackp = 0;
792 static int yy_first_time = 1;
793 static int yyerrorcount = 0;
795 #ifndef NOCONFIG_DEBUG
796 #define YYDEBUG 1
798 int cfdebug = 1;
799 #else
800 int cfdebug = 0;
801 #endif
803 extern int yyparse __P((void));
804 extern int cf_post_config __P((void));
806 static void cfdebug_print __P((char *, char *, int));
808 #define DP(str) if (cfdebug) cfdebug_print(str, yytext, yyleng)
809 #define DECHO if (cfdebug) cfdebug_print(NULL, yytext, yyleng);
810 #define DNOECHO if (cfdebug) cfdebug_print(NULL, "****", yyleng);
811 /* abbreviations */
812 #define S_CNF 1
814 #define S_IFACE 2
816 #define S_PREF 3
818 #define S_HOST 4
820 #define S_DUID 5
822 #define S_IA 6
824 #define S_AUTH 7
826 #define S_KEY 8
828 #define S_SECRET 9
830 #define S_ADDRPOOL 10
832 #define S_INCL 11
834 #line 835 "lex.yy.c"
836 /* Macros after this point can all be overridden by user definitions in
837 * section 1.
840 #ifndef YY_SKIP_YYWRAP
841 #ifdef __cplusplus
842 extern "C" int yywrap YY_PROTO(( void ));
843 #else
844 extern int yywrap YY_PROTO(( void ));
845 #endif
846 #endif
848 #ifndef YY_NO_UNPUT
849 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
850 #endif
852 #ifndef yytext_ptr
853 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
854 #endif
856 #ifdef YY_NEED_STRLEN
857 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
858 #endif
860 #ifndef YY_NO_INPUT
861 #ifdef __cplusplus
862 static int yyinput YY_PROTO(( void ));
863 #else
864 static int input YY_PROTO(( void ));
865 #endif
866 #endif
868 #if YY_STACK_USED
869 static int yy_start_stack_ptr = 0;
870 static int yy_start_stack_depth = 0;
871 static int *yy_start_stack = 0;
872 #ifndef YY_NO_PUSH_STATE
873 static void yy_push_state YY_PROTO(( int new_state ));
874 #endif
875 #ifndef YY_NO_POP_STATE
876 static void yy_pop_state YY_PROTO(( void ));
877 #endif
878 #ifndef YY_NO_TOP_STATE
879 static int yy_top_state YY_PROTO(( void ));
880 #endif
882 #else
883 #define YY_NO_PUSH_STATE 1
884 #define YY_NO_POP_STATE 1
885 #define YY_NO_TOP_STATE 1
886 #endif
888 #ifdef YY_MALLOC_DECL
889 YY_MALLOC_DECL
890 #else
891 #if __STDC__
892 #ifndef __cplusplus
893 #include <stdlib.h>
894 #endif
895 #else
896 /* Just try to get by without declaring the routines. This will fail
897 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
898 * or sizeof(void*) != sizeof(int).
900 #endif
901 #endif
903 /* Amount of stuff to slurp up with each read. */
904 #ifndef YY_READ_BUF_SIZE
905 #define YY_READ_BUF_SIZE 8192
906 #endif
908 /* Copy whatever the last rule matched to the standard output. */
910 #ifndef ECHO
911 /* This used to be an fputs(), but since the string might contain NUL's,
912 * we now use fwrite().
914 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
915 #endif
917 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
918 * is returned in "result".
920 #ifndef YY_INPUT
921 #define YY_INPUT(buf,result,max_size) \
922 if ( yy_current_buffer->yy_is_interactive ) \
924 int c = '*', n; \
925 for ( n = 0; n < max_size && \
926 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
927 buf[n] = (char) c; \
928 if ( c == '\n' ) \
929 buf[n++] = (char) c; \
930 if ( c == EOF && ferror( yyin ) ) \
931 YY_FATAL_ERROR( "input in flex scanner failed" ); \
932 result = n; \
934 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
935 && ferror( yyin ) ) \
936 YY_FATAL_ERROR( "input in flex scanner failed" );
937 #endif
939 /* No semi-colon after return; correct usage is to write "yyterminate();" -
940 * we don't want an extra ';' after the "return" because that will cause
941 * some compilers to complain about unreachable statements.
943 #ifndef yyterminate
944 #define yyterminate() return YY_NULL
945 #endif
947 /* Number of entries by which start-condition stack grows. */
948 #ifndef YY_START_STACK_INCR
949 #define YY_START_STACK_INCR 25
950 #endif
952 /* Report a fatal error. */
953 #ifndef YY_FATAL_ERROR
954 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
955 #endif
957 /* Default declaration of generated scanner - a define so the user can
958 * easily add parameters.
960 #ifndef YY_DECL
961 #define YY_DECL int yylex YY_PROTO(( void ))
962 #endif
964 /* Code executed at the beginning of each rule, after yytext and yyleng
965 * have been set up.
967 #ifndef YY_USER_ACTION
968 #define YY_USER_ACTION
969 #endif
971 /* Code executed at the end of each rule. */
972 #ifndef YY_BREAK
973 #define YY_BREAK break;
974 #endif
976 #define YY_RULE_SETUP \
977 YY_USER_ACTION
979 YY_DECL
981 register yy_state_type yy_current_state;
982 register char *yy_cp, *yy_bp;
983 register int yy_act;
985 #line 124 "cftoken.l"
988 if (yy_first_time) {
989 BEGIN S_CNF;
990 yy_first_time = 0;
993 /* interface configuration */
994 #line 995 "lex.yy.c"
996 if ( yy_init )
998 yy_init = 0;
1000 #ifdef YY_USER_INIT
1001 YY_USER_INIT;
1002 #endif
1004 if ( ! yy_start )
1005 yy_start = 1; /* first start state */
1007 if ( ! yyin )
1008 yyin = stdin;
1010 if ( ! yyout )
1011 yyout = stdout;
1013 if ( ! yy_current_buffer )
1014 yy_current_buffer =
1015 yy_create_buffer( yyin, YY_BUF_SIZE );
1017 yy_load_buffer_state();
1020 while ( 1 ) /* loops until end-of-file is reached */
1022 yy_cp = yy_c_buf_p;
1024 /* Support of yytext. */
1025 *yy_cp = yy_hold_char;
1027 /* yy_bp points to the position in yy_ch_buf of the start of
1028 * the current run.
1030 yy_bp = yy_cp;
1032 yy_current_state = yy_start;
1033 yy_match:
1036 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1037 if ( yy_accept[yy_current_state] )
1039 yy_last_accepting_state = yy_current_state;
1040 yy_last_accepting_cpos = yy_cp;
1042 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1044 yy_current_state = (int) yy_def[yy_current_state];
1045 if ( yy_current_state >= 517 )
1046 yy_c = yy_meta[(unsigned int) yy_c];
1048 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1049 ++yy_cp;
1051 while ( yy_base[yy_current_state] != 772 );
1053 yy_find_action:
1054 yy_act = yy_accept[yy_current_state];
1055 if ( yy_act == 0 )
1056 { /* have to back up */
1057 yy_cp = yy_last_accepting_cpos;
1058 yy_current_state = yy_last_accepting_state;
1059 yy_act = yy_accept[yy_current_state];
1062 YY_DO_BEFORE_ACTION;
1065 do_action: /* This label is used only to access EOF actions. */
1068 switch ( yy_act )
1069 { /* beginning of action switch */
1070 case 0: /* must back up */
1071 /* undo the effects of YY_DO_BEFORE_ACTION */
1072 *yy_cp = yy_hold_char;
1073 yy_cp = yy_last_accepting_cpos;
1074 yy_current_state = yy_last_accepting_state;
1075 goto yy_find_action;
1077 case 1:
1078 YY_RULE_SETUP
1079 #line 132 "cftoken.l"
1080 { DECHO; BEGIN S_IFACE; return (INTERFACE); }
1081 YY_BREAK
1082 case 2:
1083 YY_RULE_SETUP
1084 #line 133 "cftoken.l"
1086 DECHO;
1087 yylval.str = strdup(yytext);
1088 BEGIN S_CNF;
1089 return (IFNAME);
1091 YY_BREAK
1092 /* host configuration */
1093 case 3:
1094 YY_RULE_SETUP
1095 #line 141 "cftoken.l"
1096 { DECHO; BEGIN S_HOST; return (HOST); }
1097 YY_BREAK
1098 case 4:
1099 YY_RULE_SETUP
1100 #line 142 "cftoken.l"
1102 DECHO;
1103 yylval.str = strdup(yytext);
1104 BEGIN S_CNF;
1105 return (HOSTNAME);
1107 YY_BREAK
1108 /* address pool configuration */
1109 case 5:
1110 YY_RULE_SETUP
1111 #line 150 "cftoken.l"
1112 { DECHO; BEGIN S_ADDRPOOL; return (ADDRPOOL); }
1113 YY_BREAK
1114 case 6:
1115 YY_RULE_SETUP
1116 #line 152 "cftoken.l"
1118 DECHO;
1119 yylval.str = strdup(yytext);
1120 BEGIN S_CNF;
1121 return (POOLNAME);
1123 YY_BREAK
1124 case 7:
1125 YY_RULE_SETUP
1126 #line 159 "cftoken.l"
1127 { DECHO; BEGIN S_DUID; return (DUID); }
1128 YY_BREAK
1129 case 8:
1130 YY_RULE_SETUP
1131 #line 160 "cftoken.l"
1133 DECHO;
1134 yylval.str = strdup(yytext);
1135 BEGIN S_CNF;
1136 return (DUID_ID);
1138 YY_BREAK
1139 case 9:
1140 YY_RULE_SETUP
1141 #line 167 "cftoken.l"
1142 { DECHO; return (ADDRESS); }
1143 YY_BREAK
1144 case 10:
1145 YY_RULE_SETUP
1146 #line 169 "cftoken.l"
1147 { DECHO; return (PREFIX); }
1148 YY_BREAK
1149 case 11:
1150 YY_RULE_SETUP
1151 #line 171 "cftoken.l"
1152 { DECHO; return (PREFERENCE); }
1153 YY_BREAK
1154 case 12:
1155 YY_RULE_SETUP
1156 #line 173 "cftoken.l"
1157 { DECHO; return (SCRIPT); }
1158 YY_BREAK
1159 case 13:
1160 YY_RULE_SETUP
1161 #line 175 "cftoken.l"
1162 { DECHO; return (DELAYEDKEY); }
1163 YY_BREAK
1164 /* request */
1165 case 14:
1166 YY_RULE_SETUP
1167 #line 178 "cftoken.l"
1168 { DECHO; return (REQUEST); }
1169 YY_BREAK
1170 /* send */
1171 case 15:
1172 YY_RULE_SETUP
1173 #line 181 "cftoken.l"
1174 { DECHO; return (SEND); }
1175 YY_BREAK
1176 /* range */
1177 case 16:
1178 YY_RULE_SETUP
1179 #line 184 "cftoken.l"
1180 { DECHO; return (RANGE); }
1181 YY_BREAK
1182 case 17:
1183 YY_RULE_SETUP
1184 #line 185 "cftoken.l"
1185 { DECHO; return (TO); }
1186 YY_BREAK
1187 /* address-pool */
1188 case 18:
1189 YY_RULE_SETUP
1190 #line 188 "cftoken.l"
1191 { DECHO; return (ADDRESS_POOL); }
1192 YY_BREAK
1193 /* DHCP options */
1194 case 19:
1195 YY_RULE_SETUP
1196 #line 191 "cftoken.l"
1197 { DECHO; return (OPTION); }
1198 YY_BREAK
1199 case 20:
1200 YY_RULE_SETUP
1201 #line 193 "cftoken.l"
1202 { DECHO; return (RAPID_COMMIT); }
1203 YY_BREAK
1204 case 21:
1205 YY_RULE_SETUP
1206 #line 194 "cftoken.l"
1207 { DECHO; return (IA_PD); }
1208 YY_BREAK
1209 case 22:
1210 YY_RULE_SETUP
1211 #line 195 "cftoken.l"
1212 { DECHO; return (IA_NA); }
1213 YY_BREAK
1214 case 23:
1215 YY_RULE_SETUP
1216 #line 196 "cftoken.l"
1217 { DECHO; return (DNS_SERVERS); }
1218 YY_BREAK
1219 case 24:
1220 YY_RULE_SETUP
1221 #line 197 "cftoken.l"
1222 { DECHO; return (DNS_NAME); }
1223 YY_BREAK
1224 case 25:
1225 YY_RULE_SETUP
1226 #line 198 "cftoken.l"
1227 { DECHO; return (SIP_SERVERS); }
1228 YY_BREAK
1229 case 26:
1230 YY_RULE_SETUP
1231 #line 199 "cftoken.l"
1232 { DECHO; return (SIP_NAME); }
1233 YY_BREAK
1234 case 27:
1235 YY_RULE_SETUP
1236 #line 200 "cftoken.l"
1237 { DECHO; return (NTP_SERVERS); }
1238 YY_BREAK
1239 case 28:
1240 YY_RULE_SETUP
1241 #line 201 "cftoken.l"
1242 { DECHO; return (NIS_SERVERS); }
1243 YY_BREAK
1244 case 29:
1245 YY_RULE_SETUP
1246 #line 202 "cftoken.l"
1247 { DECHO; return (NIS_NAME); }
1248 YY_BREAK
1249 case 30:
1250 YY_RULE_SETUP
1251 #line 203 "cftoken.l"
1252 { DECHO; return (NISP_SERVERS); }
1253 YY_BREAK
1254 case 31:
1255 YY_RULE_SETUP
1256 #line 204 "cftoken.l"
1257 { DECHO; return (NISP_NAME); }
1258 YY_BREAK
1259 case 32:
1260 YY_RULE_SETUP
1261 #line 205 "cftoken.l"
1262 { DECHO; return (BCMCS_SERVERS); }
1263 YY_BREAK
1264 case 33:
1265 YY_RULE_SETUP
1266 #line 206 "cftoken.l"
1267 { DECHO; return (BCMCS_NAME); }
1268 YY_BREAK
1269 case 34:
1270 YY_RULE_SETUP
1271 #line 207 "cftoken.l"
1272 { DECHO; return (REFRESHTIME); }
1273 YY_BREAK
1274 /* provided for a backward compatibility to WIDE-DHCPv6 before Oct 1 2006 */
1275 case 35:
1276 YY_RULE_SETUP
1277 #line 210 "cftoken.l"
1278 { DECHO; return (NIS_NAME); }
1279 YY_BREAK
1280 case 36:
1281 YY_RULE_SETUP
1282 #line 211 "cftoken.l"
1283 { DECHO; return (NISP_NAME); }
1284 YY_BREAK
1285 /* generic options */
1286 case 37:
1287 YY_RULE_SETUP
1288 #line 214 "cftoken.l"
1289 { DECHO; return (INFO_ONLY); }
1290 YY_BREAK
1291 case 38:
1292 YY_RULE_SETUP
1293 #line 216 "cftoken.l"
1294 { DECHO; return (ALLOW); }
1295 YY_BREAK
1296 /* identity association */
1297 case 39:
1298 YY_RULE_SETUP
1299 #line 219 "cftoken.l"
1300 { DECHO; BEGIN S_IA; return(ID_ASSOC); }
1301 YY_BREAK
1302 case 40:
1303 YY_RULE_SETUP
1304 #line 220 "cftoken.l"
1305 { DECHO; return(IA_PD); }
1306 YY_BREAK
1307 case 41:
1308 YY_RULE_SETUP
1309 #line 221 "cftoken.l"
1310 { DECHO; return(IA_NA); }
1311 YY_BREAK
1312 case 42:
1313 YY_RULE_SETUP
1314 #line 222 "cftoken.l"
1315 { DECHO; yylval.str = strdup(yytext); return(IAID); }
1316 YY_BREAK
1317 case 43:
1318 YY_RULE_SETUP
1319 #line 223 "cftoken.l"
1320 { DP("begin of closure"); BEGIN S_CNF; return (BCL); }
1321 YY_BREAK
1323 * interface parameters for delegated prefix configuration.
1324 * when lex reads an interface name, the state will be back to
1325 * S_CNF.
1327 case 44:
1328 YY_RULE_SETUP
1329 #line 230 "cftoken.l"
1330 { DECHO; BEGIN S_IFACE; return (PREFIX_INTERFACE); }
1331 YY_BREAK
1332 case 45:
1333 YY_RULE_SETUP
1334 #line 231 "cftoken.l"
1335 { DECHO; return (SLA_ID); }
1336 YY_BREAK
1337 case 46:
1338 YY_RULE_SETUP
1339 #line 232 "cftoken.l"
1340 { DECHO; return (SLA_LEN); }
1341 YY_BREAK
1342 /* duration */
1343 case 47:
1344 YY_RULE_SETUP
1345 #line 235 "cftoken.l"
1346 { DECHO; return (INFINITY); }
1347 YY_BREAK
1348 /* authentication option */
1349 case 48:
1350 YY_RULE_SETUP
1351 #line 238 "cftoken.l"
1352 { DECHO; BEGIN S_AUTH; return (AUTHENTICATION); }
1353 YY_BREAK
1354 case 49:
1355 YY_RULE_SETUP
1356 #line 239 "cftoken.l"
1358 DECHO;
1359 yylval.str = strdup(yytext);
1360 BEGIN S_CNF;
1361 return (AUTHNAME);
1363 YY_BREAK
1364 /* authentication parameters */
1365 case 50:
1366 YY_RULE_SETUP
1367 #line 247 "cftoken.l"
1368 { DECHO; return (PROTOCOL); };
1369 YY_BREAK
1370 case 51:
1371 YY_RULE_SETUP
1372 #line 248 "cftoken.l"
1373 { DECHO; return (ALGORITHM); };
1374 YY_BREAK
1375 case 52:
1376 YY_RULE_SETUP
1377 #line 249 "cftoken.l"
1378 { DECHO; return (RDM); };
1379 YY_BREAK
1380 case 53:
1381 YY_RULE_SETUP
1382 #line 250 "cftoken.l"
1383 { DECHO; return (KEY); };
1384 YY_BREAK
1385 /* authentication protocols */
1386 case 54:
1387 YY_RULE_SETUP
1388 #line 253 "cftoken.l"
1389 { DECHO; return (DELAYED); };
1390 YY_BREAK
1391 case 55:
1392 YY_RULE_SETUP
1393 #line 254 "cftoken.l"
1394 { DECHO; return (RECONFIG); };
1395 YY_BREAK
1396 /* authentication algorithms */
1397 case 56:
1398 YY_RULE_SETUP
1399 #line 257 "cftoken.l"
1400 { DECHO; return (HMACMD5); };
1401 YY_BREAK
1402 case 57:
1403 YY_RULE_SETUP
1404 #line 258 "cftoken.l"
1405 { DECHO; return (HMACMD5); };
1406 YY_BREAK
1407 case 58:
1408 YY_RULE_SETUP
1409 #line 259 "cftoken.l"
1410 { DECHO; return (HMACMD5); };
1411 YY_BREAK
1412 case 59:
1413 YY_RULE_SETUP
1414 #line 260 "cftoken.l"
1415 { DECHO; return (HMACMD5); };
1416 YY_BREAK
1417 /* authentication RDM */
1418 case 60:
1419 YY_RULE_SETUP
1420 #line 263 "cftoken.l"
1421 { DECHO; return (MONOCOUNTER); };
1422 YY_BREAK
1423 /* secret keys */
1424 case 61:
1425 YY_RULE_SETUP
1426 #line 266 "cftoken.l"
1427 { DECHO; BEGIN S_KEY; return (KEYINFO); }
1428 YY_BREAK
1429 case 62:
1430 YY_RULE_SETUP
1431 #line 267 "cftoken.l"
1433 DECHO;
1434 yylval.str = strdup(yytext);
1435 BEGIN S_CNF;
1436 return (KEYNAME);
1438 YY_BREAK
1439 /* key parameters */
1440 case 63:
1441 YY_RULE_SETUP
1442 #line 275 "cftoken.l"
1443 { DECHO; return (REALM); }
1444 YY_BREAK
1445 case 64:
1446 YY_RULE_SETUP
1447 #line 276 "cftoken.l"
1448 { DECHO; return (KEYID); }
1449 YY_BREAK
1450 case 65:
1451 YY_RULE_SETUP
1452 #line 277 "cftoken.l"
1453 { DECHO; BEGIN S_SECRET; return (SECRET); }
1454 YY_BREAK
1455 case 66:
1456 YY_RULE_SETUP
1457 #line 278 "cftoken.l"
1459 DNOECHO;
1460 yylval.str = strdup(yytext);
1461 BEGIN S_CNF;
1462 return (QSTRING);
1464 YY_BREAK
1465 case 67:
1466 YY_RULE_SETUP
1467 #line 284 "cftoken.l"
1468 { DECHO; return (EXPIRE); }
1469 YY_BREAK
1470 /* include */
1471 case 68:
1472 YY_RULE_SETUP
1473 #line 287 "cftoken.l"
1474 { DECHO; BEGIN S_INCL; return (INCLUDE); }
1475 YY_BREAK
1476 case 69:
1477 YY_RULE_SETUP
1478 #line 288 "cftoken.l"
1480 DECHO;
1481 yylval.str = strdup(yytext);
1482 BEGIN S_CNF;
1483 return (QSTRING);
1485 YY_BREAK
1486 /* quoted string */
1487 case 70:
1488 YY_RULE_SETUP
1489 #line 296 "cftoken.l"
1491 DECHO;
1492 yylval.str = strdup(yytext);
1493 return (QSTRING);
1495 YY_BREAK
1496 /* misc */
1497 case 71:
1498 YY_RULE_SETUP
1499 #line 303 "cftoken.l"
1500 { ; }
1501 YY_BREAK
1502 case 72:
1503 YY_RULE_SETUP
1504 #line 304 "cftoken.l"
1505 { lineno++; }
1506 YY_BREAK
1507 case 73:
1508 YY_RULE_SETUP
1509 #line 305 "cftoken.l"
1510 { DP("comment"); }
1511 YY_BREAK
1512 case 74:
1513 YY_RULE_SETUP
1514 #line 306 "cftoken.l"
1516 DECHO;
1517 yylval.num = strtoll(yytext, NULL, 10);
1518 return (NUMBER);
1520 YY_BREAK
1521 case 75:
1522 YY_RULE_SETUP
1523 #line 311 "cftoken.l"
1524 { DECHO; return (SLASH); }
1525 YY_BREAK
1526 case 76:
1527 YY_RULE_SETUP
1528 #line 312 "cftoken.l"
1529 { DECHO; return (COMMA); }
1530 YY_BREAK
1531 case 77:
1532 YY_RULE_SETUP
1533 #line 313 "cftoken.l"
1534 { DP("end of sentence"); return (EOS); }
1535 YY_BREAK
1536 case 78:
1537 YY_RULE_SETUP
1538 #line 314 "cftoken.l"
1539 { DP("begin of closure"); return (BCL); }
1540 YY_BREAK
1541 case 79:
1542 YY_RULE_SETUP
1543 #line 315 "cftoken.l"
1544 { DP("end of closure"); return (ECL); }
1545 YY_BREAK
1546 /* generic string */
1547 case 80:
1548 YY_RULE_SETUP
1549 #line 318 "cftoken.l"
1551 DECHO;
1552 yylval.str = strdup(yytext);
1553 return (STRING);
1555 YY_BREAK
1556 case YY_STATE_EOF(INITIAL):
1557 case YY_STATE_EOF(S_CNF):
1558 case YY_STATE_EOF(S_IFACE):
1559 case YY_STATE_EOF(S_PREF):
1560 case YY_STATE_EOF(S_HOST):
1561 case YY_STATE_EOF(S_DUID):
1562 case YY_STATE_EOF(S_IA):
1563 case YY_STATE_EOF(S_AUTH):
1564 case YY_STATE_EOF(S_KEY):
1565 case YY_STATE_EOF(S_SECRET):
1566 case YY_STATE_EOF(S_ADDRPOOL):
1567 case YY_STATE_EOF(S_INCL):
1568 #line 324 "cftoken.l"
1570 if (--incstackp < 0)
1571 yyterminate();
1572 else {
1573 yy_delete_buffer(YY_CURRENT_BUFFER);
1574 free(incstack[incstackp + 1].path);
1575 configfilename = incstack[incstackp].path;
1576 lineno = incstack[incstackp].lineno;
1577 yy_switch_to_buffer(incstack[incstackp].state);
1580 YY_BREAK
1581 case 81:
1582 YY_RULE_SETUP
1583 #line 336 "cftoken.l"
1584 ECHO;
1585 YY_BREAK
1586 #line 1587 "lex.yy.c"
1588 case YY_END_OF_BUFFER:
1590 /* Amount of text matched not including the EOB char. */
1591 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1593 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1594 *yy_cp = yy_hold_char;
1595 YY_RESTORE_YY_MORE_OFFSET
1597 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1599 /* We're scanning a new file or input source. It's
1600 * possible that this happened because the user
1601 * just pointed yyin at a new source and called
1602 * yylex(). If so, then we have to assure
1603 * consistency between yy_current_buffer and our
1604 * globals. Here is the right place to do so, because
1605 * this is the first action (other than possibly a
1606 * back-up) that will match for the new input source.
1608 yy_n_chars = yy_current_buffer->yy_n_chars;
1609 yy_current_buffer->yy_input_file = yyin;
1610 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1613 /* Note that here we test for yy_c_buf_p "<=" to the position
1614 * of the first EOB in the buffer, since yy_c_buf_p will
1615 * already have been incremented past the NUL character
1616 * (since all states make transitions on EOB to the
1617 * end-of-buffer state). Contrast this with the test
1618 * in input().
1620 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1621 { /* This was really a NUL. */
1622 yy_state_type yy_next_state;
1624 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1626 yy_current_state = yy_get_previous_state();
1628 /* Okay, we're now positioned to make the NUL
1629 * transition. We couldn't have
1630 * yy_get_previous_state() go ahead and do it
1631 * for us because it doesn't know how to deal
1632 * with the possibility of jamming (and we don't
1633 * want to build jamming into it because then it
1634 * will run more slowly).
1637 yy_next_state = yy_try_NUL_trans( yy_current_state );
1639 yy_bp = yytext_ptr + YY_MORE_ADJ;
1641 if ( yy_next_state )
1643 /* Consume the NUL. */
1644 yy_cp = ++yy_c_buf_p;
1645 yy_current_state = yy_next_state;
1646 goto yy_match;
1649 else
1651 yy_cp = yy_c_buf_p;
1652 goto yy_find_action;
1656 else switch ( yy_get_next_buffer() )
1658 case EOB_ACT_END_OF_FILE:
1660 yy_did_buffer_switch_on_eof = 0;
1662 if ( yywrap() )
1664 /* Note: because we've taken care in
1665 * yy_get_next_buffer() to have set up
1666 * yytext, we can now set up
1667 * yy_c_buf_p so that if some total
1668 * hoser (like flex itself) wants to
1669 * call the scanner after we return the
1670 * YY_NULL, it'll still work - another
1671 * YY_NULL will get returned.
1673 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1675 yy_act = YY_STATE_EOF(YY_START);
1676 goto do_action;
1679 else
1681 if ( ! yy_did_buffer_switch_on_eof )
1682 YY_NEW_FILE;
1684 break;
1687 case EOB_ACT_CONTINUE_SCAN:
1688 yy_c_buf_p =
1689 yytext_ptr + yy_amount_of_matched_text;
1691 yy_current_state = yy_get_previous_state();
1693 yy_cp = yy_c_buf_p;
1694 yy_bp = yytext_ptr + YY_MORE_ADJ;
1695 goto yy_match;
1697 case EOB_ACT_LAST_MATCH:
1698 yy_c_buf_p =
1699 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1701 yy_current_state = yy_get_previous_state();
1703 yy_cp = yy_c_buf_p;
1704 yy_bp = yytext_ptr + YY_MORE_ADJ;
1705 goto yy_find_action;
1707 break;
1710 default:
1711 YY_FATAL_ERROR(
1712 "fatal flex scanner internal error--no action found" );
1713 } /* end of action switch */
1714 } /* end of scanning one token */
1715 } /* end of yylex */
1718 /* yy_get_next_buffer - try to read in a new buffer
1720 * Returns a code representing an action:
1721 * EOB_ACT_LAST_MATCH -
1722 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1723 * EOB_ACT_END_OF_FILE - end of file
1726 static int yy_get_next_buffer()
1728 register char *dest = yy_current_buffer->yy_ch_buf;
1729 register char *source = yytext_ptr;
1730 register int number_to_move, i;
1731 int ret_val;
1733 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1734 YY_FATAL_ERROR(
1735 "fatal flex scanner internal error--end of buffer missed" );
1737 if ( yy_current_buffer->yy_fill_buffer == 0 )
1738 { /* Don't try to fill the buffer, so this is an EOF. */
1739 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1741 /* We matched a single character, the EOB, so
1742 * treat this as a final EOF.
1744 return EOB_ACT_END_OF_FILE;
1747 else
1749 /* We matched some text prior to the EOB, first
1750 * process it.
1752 return EOB_ACT_LAST_MATCH;
1756 /* Try to read more data. */
1758 /* First move last chars to start of buffer. */
1759 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1761 for ( i = 0; i < number_to_move; ++i )
1762 *(dest++) = *(source++);
1764 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1765 /* don't do the read, it's not guaranteed to return an EOF,
1766 * just force an EOF
1768 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1770 else
1772 int num_to_read =
1773 yy_current_buffer->yy_buf_size - number_to_move - 1;
1775 while ( num_to_read <= 0 )
1776 { /* Not enough room in the buffer - grow it. */
1777 #ifdef YY_USES_REJECT
1778 YY_FATAL_ERROR(
1779 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1780 #else
1782 /* just a shorter name for the current buffer */
1783 YY_BUFFER_STATE b = yy_current_buffer;
1785 int yy_c_buf_p_offset =
1786 (int) (yy_c_buf_p - b->yy_ch_buf);
1788 if ( b->yy_is_our_buffer )
1790 int new_size = b->yy_buf_size * 2;
1792 if ( new_size <= 0 )
1793 b->yy_buf_size += b->yy_buf_size / 8;
1794 else
1795 b->yy_buf_size *= 2;
1797 b->yy_ch_buf = (char *)
1798 /* Include room in for 2 EOB chars. */
1799 yy_flex_realloc( (void *) b->yy_ch_buf,
1800 b->yy_buf_size + 2 );
1802 else
1803 /* Can't grow it, we don't own it. */
1804 b->yy_ch_buf = 0;
1806 if ( ! b->yy_ch_buf )
1807 YY_FATAL_ERROR(
1808 "fatal error - scanner input buffer overflow" );
1810 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1812 num_to_read = yy_current_buffer->yy_buf_size -
1813 number_to_move - 1;
1814 #endif
1817 if ( num_to_read > YY_READ_BUF_SIZE )
1818 num_to_read = YY_READ_BUF_SIZE;
1820 /* Read in more data. */
1821 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1822 yy_n_chars, num_to_read );
1824 yy_current_buffer->yy_n_chars = yy_n_chars;
1827 if ( yy_n_chars == 0 )
1829 if ( number_to_move == YY_MORE_ADJ )
1831 ret_val = EOB_ACT_END_OF_FILE;
1832 yyrestart( yyin );
1835 else
1837 ret_val = EOB_ACT_LAST_MATCH;
1838 yy_current_buffer->yy_buffer_status =
1839 YY_BUFFER_EOF_PENDING;
1843 else
1844 ret_val = EOB_ACT_CONTINUE_SCAN;
1846 yy_n_chars += number_to_move;
1847 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1848 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1850 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1852 return ret_val;
1856 /* yy_get_previous_state - get the state just before the EOB char was reached */
1858 static yy_state_type yy_get_previous_state()
1860 register yy_state_type yy_current_state;
1861 register char *yy_cp;
1863 yy_current_state = yy_start;
1865 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1867 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1868 if ( yy_accept[yy_current_state] )
1870 yy_last_accepting_state = yy_current_state;
1871 yy_last_accepting_cpos = yy_cp;
1873 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1875 yy_current_state = (int) yy_def[yy_current_state];
1876 if ( yy_current_state >= 517 )
1877 yy_c = yy_meta[(unsigned int) yy_c];
1879 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1882 return yy_current_state;
1886 /* yy_try_NUL_trans - try to make a transition on the NUL character
1888 * synopsis
1889 * next_state = yy_try_NUL_trans( current_state );
1892 #ifdef YY_USE_PROTOS
1893 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1894 #else
1895 static yy_state_type yy_try_NUL_trans( yy_current_state )
1896 yy_state_type yy_current_state;
1897 #endif
1899 register int yy_is_jam;
1900 register char *yy_cp = yy_c_buf_p;
1902 register YY_CHAR yy_c = 1;
1903 if ( yy_accept[yy_current_state] )
1905 yy_last_accepting_state = yy_current_state;
1906 yy_last_accepting_cpos = yy_cp;
1908 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1910 yy_current_state = (int) yy_def[yy_current_state];
1911 if ( yy_current_state >= 517 )
1912 yy_c = yy_meta[(unsigned int) yy_c];
1914 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1915 yy_is_jam = (yy_current_state == 516);
1917 return yy_is_jam ? 0 : yy_current_state;
1921 #ifndef YY_NO_UNPUT
1922 #ifdef YY_USE_PROTOS
1923 static void yyunput( int c, register char *yy_bp )
1924 #else
1925 static void yyunput( c, yy_bp )
1926 int c;
1927 register char *yy_bp;
1928 #endif
1930 register char *yy_cp = yy_c_buf_p;
1932 /* undo effects of setting up yytext */
1933 *yy_cp = yy_hold_char;
1935 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1936 { /* need to shift things up to make room */
1937 /* +2 for EOB chars. */
1938 register int number_to_move = yy_n_chars + 2;
1939 register char *dest = &yy_current_buffer->yy_ch_buf[
1940 yy_current_buffer->yy_buf_size + 2];
1941 register char *source =
1942 &yy_current_buffer->yy_ch_buf[number_to_move];
1944 while ( source > yy_current_buffer->yy_ch_buf )
1945 *--dest = *--source;
1947 yy_cp += (int) (dest - source);
1948 yy_bp += (int) (dest - source);
1949 yy_current_buffer->yy_n_chars =
1950 yy_n_chars = yy_current_buffer->yy_buf_size;
1952 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1953 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1956 *--yy_cp = (char) c;
1959 yytext_ptr = yy_bp;
1960 yy_hold_char = *yy_cp;
1961 yy_c_buf_p = yy_cp;
1963 #endif /* ifndef YY_NO_UNPUT */
1966 #ifdef __cplusplus
1967 static int yyinput()
1968 #else
1969 static int input()
1970 #endif
1972 int c;
1974 *yy_c_buf_p = yy_hold_char;
1976 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1978 /* yy_c_buf_p now points to the character we want to return.
1979 * If this occurs *before* the EOB characters, then it's a
1980 * valid NUL; if not, then we've hit the end of the buffer.
1982 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1983 /* This was really a NUL. */
1984 *yy_c_buf_p = '\0';
1986 else
1987 { /* need more input */
1988 int offset = yy_c_buf_p - yytext_ptr;
1989 ++yy_c_buf_p;
1991 switch ( yy_get_next_buffer() )
1993 case EOB_ACT_LAST_MATCH:
1994 /* This happens because yy_g_n_b()
1995 * sees that we've accumulated a
1996 * token and flags that we need to
1997 * try matching the token before
1998 * proceeding. But for input(),
1999 * there's no matching to consider.
2000 * So convert the EOB_ACT_LAST_MATCH
2001 * to EOB_ACT_END_OF_FILE.
2004 /* Reset buffer status. */
2005 yyrestart( yyin );
2007 /* fall through */
2009 case EOB_ACT_END_OF_FILE:
2011 if ( yywrap() )
2012 return EOF;
2014 if ( ! yy_did_buffer_switch_on_eof )
2015 YY_NEW_FILE;
2016 #ifdef __cplusplus
2017 return yyinput();
2018 #else
2019 return input();
2020 #endif
2023 case EOB_ACT_CONTINUE_SCAN:
2024 yy_c_buf_p = yytext_ptr + offset;
2025 break;
2030 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
2031 *yy_c_buf_p = '\0'; /* preserve yytext */
2032 yy_hold_char = *++yy_c_buf_p;
2035 return c;
2039 #ifdef YY_USE_PROTOS
2040 void yyrestart( FILE *input_file )
2041 #else
2042 void yyrestart( input_file )
2043 FILE *input_file;
2044 #endif
2046 if ( ! yy_current_buffer )
2047 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
2049 yy_init_buffer( yy_current_buffer, input_file );
2050 yy_load_buffer_state();
2054 #ifdef YY_USE_PROTOS
2055 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
2056 #else
2057 void yy_switch_to_buffer( new_buffer )
2058 YY_BUFFER_STATE new_buffer;
2059 #endif
2061 if ( yy_current_buffer == new_buffer )
2062 return;
2064 if ( yy_current_buffer )
2066 /* Flush out information for old buffer. */
2067 *yy_c_buf_p = yy_hold_char;
2068 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
2069 yy_current_buffer->yy_n_chars = yy_n_chars;
2072 yy_current_buffer = new_buffer;
2073 yy_load_buffer_state();
2075 /* We don't actually know whether we did this switch during
2076 * EOF (yywrap()) processing, but the only time this flag
2077 * is looked at is after yywrap() is called, so it's safe
2078 * to go ahead and always set it.
2080 yy_did_buffer_switch_on_eof = 1;
2084 #ifdef YY_USE_PROTOS
2085 void yy_load_buffer_state( void )
2086 #else
2087 void yy_load_buffer_state()
2088 #endif
2090 yy_n_chars = yy_current_buffer->yy_n_chars;
2091 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
2092 yyin = yy_current_buffer->yy_input_file;
2093 yy_hold_char = *yy_c_buf_p;
2097 #ifdef YY_USE_PROTOS
2098 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
2099 #else
2100 YY_BUFFER_STATE yy_create_buffer( file, size )
2101 FILE *file;
2102 int size;
2103 #endif
2105 YY_BUFFER_STATE b;
2107 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2108 if ( ! b )
2109 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2111 b->yy_buf_size = size;
2113 /* yy_ch_buf has to be 2 characters longer than the size given because
2114 * we need to put in 2 end-of-buffer characters.
2116 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
2117 if ( ! b->yy_ch_buf )
2118 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2120 b->yy_is_our_buffer = 1;
2122 yy_init_buffer( b, file );
2124 return b;
2128 #ifdef YY_USE_PROTOS
2129 void yy_delete_buffer( YY_BUFFER_STATE b )
2130 #else
2131 void yy_delete_buffer( b )
2132 YY_BUFFER_STATE b;
2133 #endif
2135 if ( ! b )
2136 return;
2138 if ( b == yy_current_buffer )
2139 yy_current_buffer = (YY_BUFFER_STATE) 0;
2141 if ( b->yy_is_our_buffer )
2142 yy_flex_free( (void *) b->yy_ch_buf );
2144 yy_flex_free( (void *) b );
2148 #ifndef YY_ALWAYS_INTERACTIVE
2149 #ifndef YY_NEVER_INTERACTIVE
2150 extern int isatty YY_PROTO(( int ));
2151 #endif
2152 #endif
2154 #ifdef YY_USE_PROTOS
2155 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2156 #else
2157 void yy_init_buffer( b, file )
2158 YY_BUFFER_STATE b;
2159 FILE *file;
2160 #endif
2164 yy_flush_buffer( b );
2166 b->yy_input_file = file;
2167 b->yy_fill_buffer = 1;
2169 #if YY_ALWAYS_INTERACTIVE
2170 b->yy_is_interactive = 1;
2171 #else
2172 #if YY_NEVER_INTERACTIVE
2173 b->yy_is_interactive = 0;
2174 #else
2175 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2176 #endif
2177 #endif
2181 #ifdef YY_USE_PROTOS
2182 void yy_flush_buffer( YY_BUFFER_STATE b )
2183 #else
2184 void yy_flush_buffer( b )
2185 YY_BUFFER_STATE b;
2186 #endif
2189 if ( ! b )
2190 return;
2192 b->yy_n_chars = 0;
2194 /* We always need two end-of-buffer characters. The first causes
2195 * a transition to the end-of-buffer state. The second causes
2196 * a jam in that state.
2198 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2199 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2201 b->yy_buf_pos = &b->yy_ch_buf[0];
2203 b->yy_at_bol = 1;
2204 b->yy_buffer_status = YY_BUFFER_NEW;
2206 if ( b == yy_current_buffer )
2207 yy_load_buffer_state();
2211 #ifndef YY_NO_SCAN_BUFFER
2212 #ifdef YY_USE_PROTOS
2213 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2214 #else
2215 YY_BUFFER_STATE yy_scan_buffer( base, size )
2216 char *base;
2217 yy_size_t size;
2218 #endif
2220 YY_BUFFER_STATE b;
2222 if ( size < 2 ||
2223 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2224 base[size-1] != YY_END_OF_BUFFER_CHAR )
2225 /* They forgot to leave room for the EOB's. */
2226 return 0;
2228 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2229 if ( ! b )
2230 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2232 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2233 b->yy_buf_pos = b->yy_ch_buf = base;
2234 b->yy_is_our_buffer = 0;
2235 b->yy_input_file = 0;
2236 b->yy_n_chars = b->yy_buf_size;
2237 b->yy_is_interactive = 0;
2238 b->yy_at_bol = 1;
2239 b->yy_fill_buffer = 0;
2240 b->yy_buffer_status = YY_BUFFER_NEW;
2242 yy_switch_to_buffer( b );
2244 return b;
2246 #endif
2249 #ifndef YY_NO_SCAN_STRING
2250 #ifdef YY_USE_PROTOS
2251 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2252 #else
2253 YY_BUFFER_STATE yy_scan_string( yy_str )
2254 yyconst char *yy_str;
2255 #endif
2257 int len;
2258 for ( len = 0; yy_str[len]; ++len )
2261 return yy_scan_bytes( yy_str, len );
2263 #endif
2266 #ifndef YY_NO_SCAN_BYTES
2267 #ifdef YY_USE_PROTOS
2268 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2269 #else
2270 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2271 yyconst char *bytes;
2272 int len;
2273 #endif
2275 YY_BUFFER_STATE b;
2276 char *buf;
2277 yy_size_t n;
2278 int i;
2280 /* Get memory for full buffer, including space for trailing EOB's. */
2281 n = len + 2;
2282 buf = (char *) yy_flex_alloc( n );
2283 if ( ! buf )
2284 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2286 for ( i = 0; i < len; ++i )
2287 buf[i] = bytes[i];
2289 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2291 b = yy_scan_buffer( buf, n );
2292 if ( ! b )
2293 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2295 /* It's okay to grow etc. this buffer, and we should throw it
2296 * away when we're done.
2298 b->yy_is_our_buffer = 1;
2300 return b;
2302 #endif
2305 #ifndef YY_NO_PUSH_STATE
2306 #ifdef YY_USE_PROTOS
2307 static void yy_push_state( int new_state )
2308 #else
2309 static void yy_push_state( new_state )
2310 int new_state;
2311 #endif
2313 if ( yy_start_stack_ptr >= yy_start_stack_depth )
2315 yy_size_t new_size;
2317 yy_start_stack_depth += YY_START_STACK_INCR;
2318 new_size = yy_start_stack_depth * sizeof( int );
2320 if ( ! yy_start_stack )
2321 yy_start_stack = (int *) yy_flex_alloc( new_size );
2323 else
2324 yy_start_stack = (int *) yy_flex_realloc(
2325 (void *) yy_start_stack, new_size );
2327 if ( ! yy_start_stack )
2328 YY_FATAL_ERROR(
2329 "out of memory expanding start-condition stack" );
2332 yy_start_stack[yy_start_stack_ptr++] = YY_START;
2334 BEGIN(new_state);
2336 #endif
2339 #ifndef YY_NO_POP_STATE
2340 static void yy_pop_state()
2342 if ( --yy_start_stack_ptr < 0 )
2343 YY_FATAL_ERROR( "start-condition stack underflow" );
2345 BEGIN(yy_start_stack[yy_start_stack_ptr]);
2347 #endif
2350 #ifndef YY_NO_TOP_STATE
2351 static int yy_top_state()
2353 return yy_start_stack[yy_start_stack_ptr - 1];
2355 #endif
2357 #ifndef YY_EXIT_FAILURE
2358 #define YY_EXIT_FAILURE 2
2359 #endif
2361 #ifdef YY_USE_PROTOS
2362 static void yy_fatal_error( yyconst char msg[] )
2363 #else
2364 static void yy_fatal_error( msg )
2365 char msg[];
2366 #endif
2368 (void) fprintf( stderr, "%s\n", msg );
2369 exit( YY_EXIT_FAILURE );
2374 /* Redefine yyless() so it works in section 3 code. */
2376 #undef yyless
2377 #define yyless(n) \
2378 do \
2380 /* Undo effects of setting up yytext. */ \
2381 yytext[yyleng] = yy_hold_char; \
2382 yy_c_buf_p = yytext + n; \
2383 yy_hold_char = *yy_c_buf_p; \
2384 *yy_c_buf_p = '\0'; \
2385 yyleng = n; \
2387 while ( 0 )
2390 /* Internal utility routines. */
2392 #ifndef yytext_ptr
2393 #ifdef YY_USE_PROTOS
2394 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2395 #else
2396 static void yy_flex_strncpy( s1, s2, n )
2397 char *s1;
2398 yyconst char *s2;
2399 int n;
2400 #endif
2402 register int i;
2403 for ( i = 0; i < n; ++i )
2404 s1[i] = s2[i];
2406 #endif
2408 #ifdef YY_NEED_STRLEN
2409 #ifdef YY_USE_PROTOS
2410 static int yy_flex_strlen( yyconst char *s )
2411 #else
2412 static int yy_flex_strlen( s )
2413 yyconst char *s;
2414 #endif
2416 register int n;
2417 for ( n = 0; s[n]; ++n )
2420 return n;
2422 #endif
2425 #ifdef YY_USE_PROTOS
2426 static void *yy_flex_alloc( yy_size_t size )
2427 #else
2428 static void *yy_flex_alloc( size )
2429 yy_size_t size;
2430 #endif
2432 return (void *) malloc( size );
2435 #ifdef YY_USE_PROTOS
2436 static void *yy_flex_realloc( void *ptr, yy_size_t size )
2437 #else
2438 static void *yy_flex_realloc( ptr, size )
2439 void *ptr;
2440 yy_size_t size;
2441 #endif
2443 /* The cast to (char *) in the following accommodates both
2444 * implementations that use char* generic pointers, and those
2445 * that use void* generic pointers. It works with the latter
2446 * because both ANSI C and C++ allow castless assignment from
2447 * any pointer type to void*, and deal with argument conversions
2448 * as though doing an assignment.
2450 return (void *) realloc( (char *) ptr, size );
2453 #ifdef YY_USE_PROTOS
2454 static void yy_flex_free( void *ptr )
2455 #else
2456 static void yy_flex_free( ptr )
2457 void *ptr;
2458 #endif
2460 free( ptr );
2463 #if YY_MAIN
2464 int main()
2466 yylex();
2467 return 0;
2469 #endif
2470 #line 336 "cftoken.l"
2472 static void
2473 cfdebug_print(w, t, l)
2474 char *w, *t;
2475 int l;
2477 if (w) {
2478 dprintf(LOG_DEBUG, FNAME,
2479 "<%d>%s [%s] (%d)", yy_start, w, t, l);
2480 } else {
2481 dprintf(LOG_DEBUG, FNAME,
2482 "<%d>[%s] (%d)", yy_start, t, l);
2486 static void
2487 yyerror0(int level, char *s, va_list ap)
2489 char ebuf[BUFSIZ], *bp, *ep;
2491 bp = ebuf;
2492 ep = ebuf + sizeof(ebuf);
2493 bp += snprintf(bp, ep - bp, "%s %d: ", configfilename, lineno);
2494 if (bp < ep)
2495 bp += vsnprintf(bp, ep - bp, s, ap);
2497 dprintf(level, FNAME, ebuf);
2500 void
2501 yyerror(char *s, ...)
2503 va_list ap;
2504 #ifdef HAVE_STDARG_H
2505 va_start(ap, s);
2506 #else
2507 va_start(ap);
2508 #endif
2509 yyerror0(LOG_ERR, s, ap);
2510 va_end(ap);
2511 yyerrorcount++;
2514 void
2515 yywarn(char *s, ...)
2517 va_list ap;
2518 #ifdef HAVE_STDARG_H
2519 va_start(ap, s);
2520 #else
2521 va_start(ap);
2522 #endif
2523 yyerror0(LOG_WARNING, s, ap);
2524 va_end(ap);
2528 cfswitch_buffer(incl)
2529 char *incl;
2531 char *path = qstrdup(incl);
2532 FILE *fp;
2534 if (incstackp >= MAX_INCLUDE_DEPTH) {
2535 dprintf(LOG_ERR, FNAME, "cfparse: includes nested too deeply");
2536 return (-1);
2538 incstack[incstackp].path = configfilename;
2539 incstack[incstackp].state = YY_CURRENT_BUFFER;
2540 incstack[incstackp].lineno = lineno;
2542 fp = fopen(path, "r");
2543 if (fp == NULL) {
2544 dprintf(LOG_ERR, FNAME, "cfparse: fopen(%s): %s",
2545 path, strerror(errno));
2546 if (errno == ENOENT)
2547 return (0);
2548 return (-1);
2550 incstackp++;
2551 configfilename = path;
2552 lineno = 1;
2553 yy_switch_to_buffer(yy_create_buffer(fp, YY_BUF_SIZE));
2555 BEGIN(S_CNF);
2557 return (0);
2561 cfparse(conf)
2562 char *conf;
2564 configfilename = conf;
2565 if ((yyin = fopen(configfilename, "r")) == NULL) {
2566 dprintf(LOG_ERR, FNAME, "cfparse: fopen(%s): %s",
2567 configfilename, strerror(errno));
2568 if (errno == ENOENT)
2569 return (0);
2570 return (-1);
2573 if (yyparse() || yyerrorcount) {
2574 if (yyerrorcount) {
2575 yyerror("fatal parse failure: exiting (%d errors)",
2576 yyerrorcount);
2577 } else
2578 yyerror("fatal parse failure: exiting");
2579 return (-1);
2582 return (cf_post_config());