1
2#line 3 "lex.cpyy.c"
3
4#define  YY_INT_ALIGNED short int
5
6/* A lexical scanner generated by flex */
7
8#define yy_create_buffer cpyy_create_buffer
9#define yy_delete_buffer cpyy_delete_buffer
10#define yy_flex_debug cpyy_flex_debug
11#define yy_init_buffer cpyy_init_buffer
12#define yy_flush_buffer cpyy_flush_buffer
13#define yy_load_buffer_state cpyy_load_buffer_state
14#define yy_switch_to_buffer cpyy_switch_to_buffer
15#define yyin cpyyin
16#define yyleng cpyyleng
17#define yylex cpyylex
18#define yylineno cpyylineno
19#define yyout cpyyout
20#define yyrestart cpyyrestart
21#define yytext cpyytext
22#define yywrap cpyywrap
23#define yyalloc cpyyalloc
24#define yyrealloc cpyyrealloc
25#define yyfree cpyyfree
26
27#define FLEX_SCANNER
28#define YY_FLEX_MAJOR_VERSION 2
29#define YY_FLEX_MINOR_VERSION 5
30#define YY_FLEX_SUBMINOR_VERSION 35
31#if YY_FLEX_SUBMINOR_VERSION > 0
32#define FLEX_BETA
33#endif
34
35/* First, we deal with  platform-specific or compiler-specific issues. */
36
37/* begin standard C headers. */
38#include <stdio.h>
39#include <string.h>
40#include <errno.h>
41#include <stdlib.h>
42
43/* end standard C headers. */
44
45/* flex integer type definitions */
46
47#ifndef FLEXINT_H
48#define FLEXINT_H
49
50/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
51
52#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
53
54/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
55 * if you want the limit (max/min) macros for int types.
56 */
57#ifndef __STDC_LIMIT_MACROS
58#define __STDC_LIMIT_MACROS 1
59#endif
60
61#include <inttypes.h>
62typedef int8_t flex_int8_t;
63typedef uint8_t flex_uint8_t;
64typedef int16_t flex_int16_t;
65typedef uint16_t flex_uint16_t;
66typedef int32_t flex_int32_t;
67typedef uint32_t flex_uint32_t;
68#else
69typedef signed char flex_int8_t;
70typedef short int flex_int16_t;
71typedef int flex_int32_t;
72typedef unsigned char flex_uint8_t;
73typedef unsigned short int flex_uint16_t;
74typedef unsigned int flex_uint32_t;
75#endif /* ! C99 */
76
77/* Limits of integral types. */
78#ifndef INT8_MIN
79#define INT8_MIN               (-128)
80#endif
81#ifndef INT16_MIN
82#define INT16_MIN              (-32767-1)
83#endif
84#ifndef INT32_MIN
85#define INT32_MIN              (-2147483647-1)
86#endif
87#ifndef INT8_MAX
88#define INT8_MAX               (127)
89#endif
90#ifndef INT16_MAX
91#define INT16_MAX              (32767)
92#endif
93#ifndef INT32_MAX
94#define INT32_MAX              (2147483647)
95#endif
96#ifndef UINT8_MAX
97#define UINT8_MAX              (255U)
98#endif
99#ifndef UINT16_MAX
100#define UINT16_MAX             (65535U)
101#endif
102#ifndef UINT32_MAX
103#define UINT32_MAX             (4294967295U)
104#endif
105
106#endif /* ! FLEXINT_H */
107
108#ifdef __cplusplus
109
110/* The "const" storage-class-modifier is valid. */
111#define YY_USE_CONST
112
113#else	/* ! __cplusplus */
114
115/* C99 requires __STDC__ to be defined as 1. */
116#if defined (__STDC__)
117
118#define YY_USE_CONST
119
120#endif	/* defined (__STDC__) */
121#endif	/* ! __cplusplus */
122
123#ifdef YY_USE_CONST
124#define yyconst const
125#else
126#define yyconst
127#endif
128
129/* Returned upon end-of-file. */
130#define YY_NULL 0
131
132/* Promotes a possibly negative, possibly signed char to an unsigned
133 * integer for use as an array index.  If the signed char is negative,
134 * we want to instead treat it as an 8-bit unsigned char, hence the
135 * double cast.
136 */
137#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
138
139/* Enter a start condition.  This macro really ought to take a parameter,
140 * but we do it the disgusting crufty way forced on us by the ()-less
141 * definition of BEGIN.
142 */
143#define BEGIN (yy_start) = 1 + 2 *
144
145/* Translate the current start state into a value that can be later handed
146 * to BEGIN to return to the state.  The YYSTATE alias is for lex
147 * compatibility.
148 */
149#define YY_START (((yy_start) - 1) / 2)
150#define YYSTATE YY_START
151
152/* Action number for EOF rule of a given start state. */
153#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
154
155/* Special action meaning "start processing a new file". */
156#define YY_NEW_FILE cpyyrestart(cpyyin  )
157
158#define YY_END_OF_BUFFER_CHAR 0
159
160/* Size of default input buffer. */
161#ifndef YY_BUF_SIZE
162#define YY_BUF_SIZE 16384
163#endif
164
165/* The state buf must be large enough to hold one state per character in the main buffer.
166 */
167#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
168
169#ifndef YY_TYPEDEF_YY_BUFFER_STATE
170#define YY_TYPEDEF_YY_BUFFER_STATE
171typedef struct yy_buffer_state *YY_BUFFER_STATE;
172#endif
173
174extern int cpyyleng;
175
176extern FILE *cpyyin, *cpyyout;
177
178#define EOB_ACT_CONTINUE_SCAN 0
179#define EOB_ACT_END_OF_FILE 1
180#define EOB_ACT_LAST_MATCH 2
181
182    #define YY_LESS_LINENO(n)
183
184/* Return all but the first "n" matched characters back to the input stream. */
185#define yyless(n) \
186	do \
187		{ \
188		/* Undo effects of setting up cpyytext. */ \
189        int yyless_macro_arg = (n); \
190        YY_LESS_LINENO(yyless_macro_arg);\
191		*yy_cp = (yy_hold_char); \
192		YY_RESTORE_YY_MORE_OFFSET \
193		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
194		YY_DO_BEFORE_ACTION; /* set up cpyytext again */ \
195		} \
196	while ( 0 )
197
198#define unput(c) yyunput( c, (yytext_ptr)  )
199
200#ifndef YY_TYPEDEF_YY_SIZE_T
201#define YY_TYPEDEF_YY_SIZE_T
202typedef size_t yy_size_t;
203#endif
204
205#ifndef YY_STRUCT_YY_BUFFER_STATE
206#define YY_STRUCT_YY_BUFFER_STATE
207struct yy_buffer_state
208	{
209	FILE *yy_input_file;
210
211	char *yy_ch_buf;		/* input buffer */
212	char *yy_buf_pos;		/* current position in input buffer */
213
214	/* Size of input buffer in bytes, not including room for EOB
215	 * characters.
216	 */
217	yy_size_t yy_buf_size;
218
219	/* Number of characters read into yy_ch_buf, not including EOB
220	 * characters.
221	 */
222	int yy_n_chars;
223
224	/* Whether we "own" the buffer - i.e., we know we created it,
225	 * and can realloc() it to grow it, and should free() it to
226	 * delete it.
227	 */
228	int yy_is_our_buffer;
229
230	/* Whether this is an "interactive" input source; if so, and
231	 * if we're using stdio for input, then we want to use getc()
232	 * instead of fread(), to make sure we stop fetching input after
233	 * each newline.
234	 */
235	int yy_is_interactive;
236
237	/* Whether we're considered to be at the beginning of a line.
238	 * If so, '^' rules will be active on the next match, otherwise
239	 * not.
240	 */
241	int yy_at_bol;
242
243    int yy_bs_lineno; /**< The line count. */
244    int yy_bs_column; /**< The column count. */
245
246	/* Whether to try to fill the input buffer when we reach the
247	 * end of it.
248	 */
249	int yy_fill_buffer;
250
251	int yy_buffer_status;
252
253#define YY_BUFFER_NEW 0
254#define YY_BUFFER_NORMAL 1
255	/* When an EOF's been seen but there's still some text to process
256	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
257	 * shouldn't try reading from the input source any more.  We might
258	 * still have a bunch of tokens to match, though, because of
259	 * possible backing-up.
260	 *
261	 * When we actually see the EOF, we change the status to "new"
262	 * (via cpyyrestart()), so that the user can continue scanning by
263	 * just pointing cpyyin at a new input file.
264	 */
265#define YY_BUFFER_EOF_PENDING 2
266
267	};
268#endif /* !YY_STRUCT_YY_BUFFER_STATE */
269
270/* Stack of input buffers. */
271static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
272static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
273static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
274
275/* We provide macros for accessing buffer states in case in the
276 * future we want to put the buffer states in a more general
277 * "scanner state".
278 *
279 * Returns the top of the stack, or NULL.
280 */
281#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
282                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
283                          : NULL)
284
285/* Same as previous macro, but useful when we know that the buffer stack is not
286 * NULL or when we need an lvalue. For internal use only.
287 */
288#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
289
290/* yy_hold_char holds the character lost when cpyytext is formed. */
291static char yy_hold_char;
292static int yy_n_chars;		/* number of characters read into yy_ch_buf */
293int cpyyleng;
294
295/* Points to current character in buffer. */
296static char *yy_c_buf_p = (char *) 0;
297static int yy_init = 0;		/* whether we need to initialize */
298static int yy_start = 0;	/* start state number */
299
300/* Flag which is used to allow cpyywrap()'s to do buffer switches
301 * instead of setting up a fresh cpyyin.  A bit of a hack ...
302 */
303static int yy_did_buffer_switch_on_eof;
304
305void cpyyrestart (FILE *input_file  );
306void cpyy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
307YY_BUFFER_STATE cpyy_create_buffer (FILE *file,int size  );
308void cpyy_delete_buffer (YY_BUFFER_STATE b  );
309void cpyy_flush_buffer (YY_BUFFER_STATE b  );
310void cpyypush_buffer_state (YY_BUFFER_STATE new_buffer  );
311void cpyypop_buffer_state (void );
312
313static void cpyyensure_buffer_stack (void );
314static void cpyy_load_buffer_state (void );
315static void cpyy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
316
317#define YY_FLUSH_BUFFER cpyy_flush_buffer(YY_CURRENT_BUFFER )
318
319YY_BUFFER_STATE cpyy_scan_buffer (char *base,yy_size_t size  );
320YY_BUFFER_STATE cpyy_scan_string (yyconst char *yy_str  );
321YY_BUFFER_STATE cpyy_scan_bytes (yyconst char *bytes,int len  );
322
323void *cpyyalloc (yy_size_t  );
324void *cpyyrealloc (void *,yy_size_t  );
325void cpyyfree (void *  );
326
327#define yy_new_buffer cpyy_create_buffer
328
329#define yy_set_interactive(is_interactive) \
330	{ \
331	if ( ! YY_CURRENT_BUFFER ){ \
332        cpyyensure_buffer_stack (); \
333		YY_CURRENT_BUFFER_LVALUE =    \
334            cpyy_create_buffer(cpyyin,YY_BUF_SIZE ); \
335	} \
336	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
337	}
338
339#define yy_set_bol(at_bol) \
340	{ \
341	if ( ! YY_CURRENT_BUFFER ){\
342        cpyyensure_buffer_stack (); \
343		YY_CURRENT_BUFFER_LVALUE =    \
344            cpyy_create_buffer(cpyyin,YY_BUF_SIZE ); \
345	} \
346	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
347	}
348
349#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
350
351/* Begin user sect3 */
352
353#define cpyywrap(n) 1
354#define YY_SKIP_YYWRAP
355
356typedef unsigned char YY_CHAR;
357
358FILE *cpyyin = (FILE *) 0, *cpyyout = (FILE *) 0;
359
360typedef int yy_state_type;
361
362extern int cpyylineno;
363
364int cpyylineno = 1;
365
366extern char *cpyytext;
367#define yytext_ptr cpyytext
368
369static yy_state_type yy_get_previous_state (void );
370static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
371static int yy_get_next_buffer (void );
372static void yy_fatal_error (yyconst char msg[]  );
373
374/* Done after the current pattern has been matched and before the
375 * corresponding action - sets up cpyytext.
376 */
377#define YY_DO_BEFORE_ACTION \
378	(yytext_ptr) = yy_bp; \
379	cpyyleng = (size_t) (yy_cp - yy_bp); \
380	(yy_hold_char) = *yy_cp; \
381	*yy_cp = '\0'; \
382	(yy_c_buf_p) = yy_cp;
383
384#define YY_NUM_RULES 41
385#define YY_END_OF_BUFFER 42
386/* This struct is not used in this scanner,
387   but its presence is necessary. */
388struct yy_trans_info
389	{
390	flex_int32_t yy_verify;
391	flex_int32_t yy_nxt;
392	};
393static yyconst flex_int16_t yy_accept[311] =
394    {   0,
395        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
396        0,    0,   42,   41,   31,   32,   33,   36,   40,   35,
397       34,   37,   38,   39,   40,   40,   40,   40,   40,   40,
398       40,   40,   40,   40,   40,   40,   40,   34,   40,   40,
399       31,   33,   40,   34,   40,   40,   40,   40,   40,   40,
400       40,   40,   40,   40,   40,   40,   40,   40,   40,   40,
401       40,    2,   40,   34,   40,   40,   40,   40,   40,   40,
402       40,   40,   40,   40,   40,   40,   40,   40,   40,   40,
403       40,   40,   40,   40,   40,   40,   40,   40,   40,   34,
404       40,    5,    5,   40,   40,   40,    6,   40,   40,   40,
405
406       40,   40,    0,   40,   40,   40,   40,   40,   40,   13,
407        0,   40,   40,   40,   40,    0,   34,   40,   40,    5,
408       40,    5,   40,   40,    0,    0,    0,   40,   40,   40,
409        0,   40,   40,   40,   40,   40,   40,   40,    0,   40,
410        0,    0,   40,    0,    0,   40,    5,    5,    5,   40,
411       40,    0,    0,    0,   40,   40,   40,    0,   14,   40,
412        4,    0,   40,    0,   40,    0,   40,    0,    0,    0,
413        0,    0,   40,   40,    5,    3,    0,    0,    0,    0,
414       40,   40,   40,    0,    0,    0,    0,    0,    0,   12,
415        0,   40,    0,    0,    0,   29,   28,   40,   40,    0,
416
417        0,    0,    0,    0,   22,   40,   40,    0,    0,    0,
418        0,    0,    0,    0,    0,    0,    0,    0,   40,   40,
419        0,    0,   30,   25,   26,   40,    1,    0,    0,    0,
420        0,    0,    0,    0,    0,    0,    0,    0,    5,   40,
421        0,    0,   40,    0,    0,    0,    0,    0,    9,    0,
422        0,    0,   24,    0,    5,   27,    0,   40,   19,    0,
423        0,    0,   10,   18,    0,    0,    0,    5,    0,    0,
424        0,    0,   15,   23,   21,    0,    0,    0,    0,    0,
425        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
426        7,    0,   20,    8,    0,    0,   16,    0,    0,   17,
427
428        0,    0,    0,    0,    0,    0,    0,    0,   11,    0
429    } ;
430
431static yyconst flex_int32_t yy_ec[256] =
432    {   0,
433        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
434        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
435        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
436        1,    2,    1,    1,    4,    1,    1,    1,    1,    1,
437        1,    1,    1,    5,    6,    7,    8,    9,    9,    9,
438        9,    9,    9,    9,    9,    9,    9,   10,   11,    1,
439        1,    1,    1,    1,   12,   12,   12,   12,   12,   12,
440       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
441       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
442        1,    1,    1,    1,   14,    1,   15,   16,   17,   18,
443
444       19,   20,   21,   13,   22,   13,   13,   23,   24,   25,
445       26,   27,   28,   29,   30,   31,   32,   33,   34,   35,
446       36,   13,   37,    1,   38,    1,    1,    1,    1,    1,
447        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
448        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
449        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
450        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
451        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
452        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
453        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
454
455        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
456        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
457        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
458        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
459        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
460        1,    1,    1,    1,    1
461    } ;
462
463static yyconst flex_int32_t yy_meta[39] =
464    {   0,
465        1,    1,    2,    1,    1,    1,    3,    1,    3,    3,
466        1,    3,    3,    3,    3,    3,    3,    3,    3,    3,
467        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
468        3,    3,    3,    3,    3,    3,    1,    1
469    } ;
470
471static yyconst flex_int16_t yy_base[316] =
472    {   0,
473        0,   38,   62,    0,   97,  135,  165,    0,    0,    0,
474        0,    0,  421,  422,  418,  422,    0,  422,    0,  422,
475      410,  422,  422,  422,  400,    0,    0,  386,  389,  386,
476        1,    2,  395,  383,  397,  389,    3,  177,  400,  400,
477      406,    0,    0,  398,  388,  381,  382,    8,    3,  376,
478      371,  382,  373,   20,  374,  371,  374,  372,  376,  371,
479      375,  383,   43,  189,  201,  382,  380,  360,  373,  369,
480      368,  370,  366,    5,  364,  376,  359,  360,  357,  356,
481      358,  344,  357,  368,  351,  345,  342,  348,  363,  213,
482      359,  227,   47,  348,  344,  359,    0,  358,  357,  337,
483
484      332,  331,  329,  332,    0,  339,  331,  321,  335,    0,
485      323,  335,  345,  344,  331,   29,   51,  338,  338,  239,
486      336,   55,  315,  319,  312,  316,  315,  318,  315,  318,
487      318,  311,  306,  299,  327,  314,  325,  300,  310,  306,
488      312,  309,  319,  305,  297,   56,  251,  315,  311,  290,
489      313,  296,  292,  291,  284,  299,  298,  283,    0,  305,
490      304,  292,  302,  276,  275,  276,  273,  285,  279,  278,
491      272,  276,  289,   59,  287,    0,   44,  272,  272,  271,
492      257,  261,  274,  257,  266,  270,  261,  255,  263,    0,
493      251,  277,  264,  266,  257,  422,  422,   63,  258,  242,
494
495      247,  242,  217,  216,    0,  228,  230,  222,  218,  219,
496      211,  205,  202,  205,  197,  186,  184,  192,  194,   64,
497      172,  176,  422,  422,  422,  173,    0,  162,  170,  165,
498      155,  154,  157,  142,  145,  150,  138,  148,  157,  158,
499      133,  144,  137,  131,  141,  140,  136,  138,  422,  126,
500      132,  124,  422,  147,  143,  422,  145,  144,  422,  142,
501      126,  102,  422,  422,   96,  101,   99,    0,   99,  102,
502       96,  111,  422,  422,  422,  103,  105,   98,  100,   90,
503       96,   90,   95,   93,   94,   96,   81,   77,   93,   84,
504      422,   90,  422,  422,   71,   61,   80,   55,   61,  422,
505
506       57,   50,   60,   49,   54,   40,   34,   10,  422,  422,
507      271,  274,  277,   11,    4
508    } ;
509
510static yyconst flex_int16_t yy_def[316] =
511    {   0,
512      311,  311,    2,    3,  312,  312,    2,    7,    2,    2,
513        2,    2,  310,  310,  310,  310,  313,  310,  314,  310,
514      314,  310,  310,  310,  314,  314,  314,  314,  314,  314,
515      314,  314,  314,  314,  314,  314,  315,  314,  314,   38,
516      310,  313,  314,  314,  314,  314,  314,  314,  314,  314,
517      314,  314,  314,  314,  314,  314,  314,  314,  314,  314,
518      314,  314,  315,   38,   38,   64,   65,  314,  314,  314,
519      314,  314,  314,  314,  314,  314,  314,  314,  314,  314,
520      314,  314,  314,  314,  314,  314,  314,  314,  314,   64,
521       90,   90,   92,  314,  314,  314,  314,  314,  314,  314,
522
523      314,  314,  310,  314,  314,  314,  314,  314,  314,  314,
524      310,  314,  314,  314,  314,  310,  314,  314,  314,   92,
525       65,  120,  314,  314,  310,  310,  310,  314,  314,  314,
526      310,  314,  314,  314,  314,  314,  314,  314,  310,  314,
527      310,  310,  314,  310,  310,  314,  120,  147,   65,  314,
528      314,  310,  310,  310,  314,  314,  314,  310,  314,  314,
529      314,  310,  314,  310,  314,  310,  314,  310,  310,  310,
530      310,  310,  314,  314,  314,  314,  310,  310,  310,  310,
531      314,  314,  314,  310,  310,  310,  310,  310,  310,  314,
532      310,  314,  310,  310,  310,  310,  310,  314,  314,  310,
533
534      310,  310,  310,  310,  314,  314,  314,  310,  310,  310,
535      310,  310,  310,  310,  310,  310,  310,  310,  314,  314,
536      310,  310,  310,  310,  310,  314,  314,  310,  310,  310,
537      310,  310,  310,  310,  310,  310,  310,  310,  314,  314,
538      310,  310,  314,  310,  310,  310,  310,  310,  310,  310,
539      310,  310,  310,  310,  314,  310,  310,  314,  310,  310,
540      310,  310,  310,  310,  310,  310,  310,  314,  310,  310,
541      310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
542      310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
543      310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
544
545      310,  310,  310,  310,  310,  310,  310,  310,  310,    0,
546      310,  310,  310,  310,  310
547    } ;
548
549static yyconst flex_int16_t yy_nxt[461] =
550    {   0,
551       14,   15,   16,   17,   18,   14,   63,   20,   21,   43,
552       22,   62,   43,   43,   48,   53,   43,  310,  133,   54,
553       55,  134,   74,   56,   49,   46,  100,   57,  309,   71,
554      101,   47,   72,   75,   73,   80,   23,   24,   14,   15,
555       16,   17,   18,   14,   81,   20,   21,   82,   22,   43,
556      308,   62,   43,   43,  307,  122,   43,  144,  145,   44,
557       65,   43,  173,  148,  174,  173,  200,  199,  201,  219,
558      219,  220,  240,  306,   23,   24,   25,  305,  304,   26,
559      303,  302,  301,   27,  300,  299,   28,   29,   30,  298,
560       31,   32,   33,   34,   35,  297,   36,   14,   15,   16,
561
562       17,   18,   14,   19,   20,   21,   19,   22,  296,  295,
563       19,  294,  293,  292,  291,  290,  289,  288,  287,  286,
564      285,  284,  283,  282,  281,  280,  279,  278,  277,  276,
565      275,  274,  273,   23,   24,   14,   15,   16,   17,   18,
566       14,   19,   20,   21,   19,   22,  272,  271,   19,  270,
567      269,  268,  267,  266,  265,  264,  263,  262,  261,  260,
568      259,  258,  257,  256,  219,  255,  254,  253,  252,  251,
569      250,   23,   24,   38,   39,  249,   40,  248,  247,   40,
570       40,   40,   40,   40,   40,   64,   65,  246,   66,  245,
571      244,   66,   66,   66,   66,   66,   66,   90,  243,  242,
572
573       91,  241,  239,   91,   91,   91,   91,   91,   91,   92,
574       67,  238,   93,  237,  236,   93,   93,   93,   93,   93,
575       93,  117,  235,  234,  118,  233,  232,  118,  118,  118,
576      118,  118,  118,  119,  231,  120,  121,  230,  122,  229,
577      228,  122,  122,  122,  122,  122,  122,  147,  227,  226,
578      148,  225,  224,  148,  148,  148,  148,  148,  148,  175,
579      223,  222,  175,  221,  173,  175,  175,  175,  175,  175,
580      175,   19,   19,   19,   37,   37,   37,   42,  218,   42,
581      217,  216,  215,  214,  213,  212,  211,  210,  209,  208,
582      207,  206,  205,  204,  203,  202,  121,  198,  197,  196,
583
584      195,  194,  193,  192,  191,  190,  189,  188,  187,  186,
585      185,  184,  183,  182,  181,  180,  179,  178,  177,  176,
586       43,   43,  172,  171,  170,  169,  168,  167,  166,  165,
587      164,  163,  162,  161,  160,  159,  158,  157,  156,  155,
588      154,  153,  152,  151,  150,  149,  146,   65,  143,  142,
589      141,  140,  139,  138,  137,  136,  135,  132,  131,  130,
590      129,  128,  127,  126,  125,  124,  123,  118,  116,  115,
591      114,  113,  112,  111,  110,  109,  108,  107,  106,  105,
592      104,  103,  102,   99,   98,   97,   96,   95,   94,   43,
593       91,   62,   89,   88,   87,   86,   85,   84,   83,   79,
594
595       78,   77,   76,   70,   69,   68,   44,   41,   66,   67,
596       61,   60,   59,   58,   52,   51,   50,   45,   44,   41,
597      310,   13,  310,  310,  310,  310,  310,  310,  310,  310,
598      310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
599      310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
600      310,  310,  310,  310,  310,  310,  310,  310,  310,  310
601    } ;
602
603static yyconst flex_int16_t yy_chk[461] =
604    {   0,
605        1,    1,    1,    1,    1,    1,  315,    1,    1,   37,
606        1,   37,   37,  314,   27,   31,   37,    0,  105,   31,
607       32,  105,   49,   32,   27,   26,   74,   32,  308,   48,
608       74,   26,   48,   49,   48,   54,    1,    1,    2,    2,
609        2,    2,    2,    2,   54,    2,    2,   54,    2,   63,
610      307,   63,   63,   93,  306,   93,   63,  116,  116,  117,
611      117,  122,  146,  122,  146,  174,  177,  174,  177,  198,
612      220,  198,  220,  305,    2,    2,    3,  304,  303,    3,
613      302,  301,  299,    3,  298,  297,    3,    3,    3,  296,
614        3,    3,    3,    3,    3,  295,    3,    5,    5,    5,
615
616        5,    5,    5,    5,    5,    5,    5,    5,  292,  290,
617        5,  289,  288,  287,  286,  285,  284,  283,  282,  281,
618      280,  279,  278,  277,  276,  272,  271,  270,  269,  267,
619      266,  265,  262,    5,    5,    6,    6,    6,    6,    6,
620        6,    6,    6,    6,    6,    6,  261,  260,    6,  258,
621      257,  255,  254,  252,  251,  250,  248,  247,  246,  245,
622      244,  243,  242,  241,  240,  239,  238,  237,  236,  235,
623      234,    6,    6,    7,    7,  233,    7,  232,  231,    7,
624        7,    7,    7,    7,    7,   38,   38,  230,   38,  229,
625      228,   38,   38,   38,   38,   38,   38,   64,  226,  222,
626
627       64,  221,  219,   64,   64,   64,   64,   64,   64,   65,
628       65,  218,   65,  217,  216,   65,   65,   65,   65,   65,
629       65,   90,  215,  214,   90,  213,  212,   90,   90,   90,
630       90,   90,   90,   92,  211,   92,   92,  210,   92,  209,
631      208,   92,   92,   92,   92,   92,   92,  120,  207,  206,
632      120,  204,  203,  120,  120,  120,  120,  120,  120,  147,
633      202,  201,  147,  200,  199,  147,  147,  147,  147,  147,
634      147,  311,  311,  311,  312,  312,  312,  313,  195,  313,
635      194,  193,  192,  191,  189,  188,  187,  186,  185,  184,
636      183,  182,  181,  180,  179,  178,  175,  173,  172,  171,
637
638      170,  169,  168,  167,  166,  165,  164,  163,  162,  161,
639      160,  158,  157,  156,  155,  154,  153,  152,  151,  150,
640      149,  148,  145,  144,  143,  142,  141,  140,  139,  138,
641      137,  136,  135,  134,  133,  132,  131,  130,  129,  128,
642      127,  126,  125,  124,  123,  121,  119,  118,  115,  114,
643      113,  112,  111,  109,  108,  107,  106,  104,  103,  102,
644      101,  100,   99,   98,   96,   95,   94,   91,   89,   88,
645       87,   86,   85,   84,   83,   82,   81,   80,   79,   78,
646       77,   76,   75,   73,   72,   71,   70,   69,   68,   67,
647       66,   62,   61,   60,   59,   58,   57,   56,   55,   53,
648
649       52,   51,   50,   47,   46,   45,   44,   41,   40,   39,
650       36,   35,   34,   33,   30,   29,   28,   25,   21,   15,
651       13,  310,  310,  310,  310,  310,  310,  310,  310,  310,
652      310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
653      310,  310,  310,  310,  310,  310,  310,  310,  310,  310,
654      310,  310,  310,  310,  310,  310,  310,  310,  310,  310
655    } ;
656
657static yy_state_type yy_last_accepting_state;
658static char *yy_last_accepting_cpos;
659
660extern int cpyy_flex_debug;
661int cpyy_flex_debug = 0;
662
663/* The intent behind this definition is that it'll catch
664 * any uses of REJECT which flex missed.
665 */
666#define REJECT reject_used_but_not_detected
667#define yymore() yymore_used_but_not_detected
668#define YY_MORE_ADJ 0
669#define YY_RESTORE_YY_MORE_OFFSET
670char *cpyytext;
671#line 1 "client6_token.l"
672/*	$Id: client6_token.l,v 1.1.1.1 2006/12/04 00:45:22 Exp $	*/
673/*	ported from KAME: cftoken.l,v 1.15 2002/09/24 14:20:49 itojun Exp	*/
674/*
675 * Copyright (C) 2002 WIDE Project.
676 * All rights reserved.
677 *
678 * Redistribution and use in source and binary forms, with or without
679 * modification, are permitted provided that the following conditions
680 * are met:
681 * 1. Redistributions of source code must retain the above copyright
682 *    notice, this list of conditions and the following disclaimer.
683 * 2. Redistributions in binary form must reproduce the above copyright
684 *    notice, this list of conditions and the following disclaimer in the
685 *    documentation and/or other materials provided with the distribution.
686 * 3. Neither the name of the project nor the names of its contributors
687 *    may be used to endorse or promote products derived from this software
688 *    without specific prior written permission.
689 *
690 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
691 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
692 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
693 * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
694 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
695 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
696 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
697 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
698 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
699 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
700 * SUCH DAMAGE.
701 */
702#line 36 "client6_token.l"
703#include <sys/types.h>
704#include <sys/socket.h>
705
706#include <netinet/in.h>
707#include <arpa/inet.h>
708
709#include <errno.h>
710#include <syslog.h>
711#include <string.h>
712#ifdef HAVE_STDARG_H
713#include <stdarg.h>
714#else
715#include <varargs.h>
716#endif
717
718#include "queue.h"
719#include "dhcp6.h"
720#include "config.h"
721#include "common.h"
722#include "cp.tab.h"
723
724const char *configfilename;
725int lineno = 1;
726
727static int cpyy_first_time = 1;
728static int cpyyerrorcount = 0;
729
730
731#ifndef NOCONFIG_DEBUG
732#define YYDEBUG 1
733
734int cfdebug = 1;
735#else
736int cfdebug = 0;
737#endif
738
739static void cfdebug_print __P((char *, char *, int));
740extern int cf_post_config __P((void));
741
742extern int cpyyparse(void);
743extern int cf_post_config(void);
744
745#define DP(str) if (cfdebug) cfdebug_print(str, cpyytext, cpyyleng)
746#define DECHO if (cfdebug) cfdebug_print(NULL, cpyytext, cpyyleng);
747/* abbreviations */
748
749
750
751
752
753#line 754 "lex.cpyy.c"
754
755#define INITIAL 0
756#define S_CNF 1
757#define S_IFACE 2
758#define S_ADDR 3
759#define S_RNT 4
760#define S_RBT 5
761
762#ifndef YY_NO_UNISTD_H
763/* Special case for "unistd.h", since it is non-ANSI. We include it way
764 * down here because we want the user's section 1 to have been scanned first.
765 * The user has a chance to override it with an option.
766 */
767#include <unistd.h>
768#endif
769
770#ifndef YY_EXTRA_TYPE
771#define YY_EXTRA_TYPE void *
772#endif
773
774static int yy_init_globals (void );
775
776/* Accessor methods to globals.
777   These are made visible to non-reentrant scanners for convenience. */
778
779int cpyylex_destroy (void );
780
781int cpyyget_debug (void );
782
783void cpyyset_debug (int debug_flag  );
784
785YY_EXTRA_TYPE cpyyget_extra (void );
786
787void cpyyset_extra (YY_EXTRA_TYPE user_defined  );
788
789FILE *cpyyget_in (void );
790
791void cpyyset_in  (FILE * in_str  );
792
793FILE *cpyyget_out (void );
794
795void cpyyset_out  (FILE * out_str  );
796
797int cpyyget_leng (void );
798
799char *cpyyget_text (void );
800
801int cpyyget_lineno (void );
802
803void cpyyset_lineno (int line_number  );
804
805/* Macros after this point can all be overridden by user definitions in
806 * section 1.
807 */
808
809#ifndef YY_SKIP_YYWRAP
810#ifdef __cplusplus
811extern "C" int cpyywrap (void );
812#else
813extern int cpyywrap (void );
814#endif
815#endif
816
817    static void yyunput (int c,char *buf_ptr  );
818
819#ifndef yytext_ptr
820static void yy_flex_strncpy (char *,yyconst char *,int );
821#endif
822
823#ifdef YY_NEED_STRLEN
824static int yy_flex_strlen (yyconst char * );
825#endif
826
827#ifndef YY_NO_INPUT
828
829#ifdef __cplusplus
830static int yyinput (void );
831#else
832static int input (void );
833#endif
834
835#endif
836
837/* Amount of stuff to slurp up with each read. */
838#ifndef YY_READ_BUF_SIZE
839#define YY_READ_BUF_SIZE 8192
840#endif
841
842/* Copy whatever the last rule matched to the standard output. */
843#ifndef ECHO
844/* This used to be an fputs(), but since the string might contain NUL's,
845 * we now use fwrite().
846 */
847#define ECHO fwrite( cpyytext, cpyyleng, 1, cpyyout )
848#endif
849
850/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
851 * is returned in "result".
852 */
853#ifndef YY_INPUT
854#define YY_INPUT(buf,result,max_size) \
855	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
856		{ \
857		int c = '*'; \
858		unsigned n; \
859		for ( n = 0; n < max_size && \
860			     (c = getc( cpyyin )) != EOF && c != '\n'; ++n ) \
861			buf[n] = (char) c; \
862		if ( c == '\n' ) \
863			buf[n++] = (char) c; \
864		if ( c == EOF && ferror( cpyyin ) ) \
865			YY_FATAL_ERROR( "input in flex scanner failed" ); \
866		result = n; \
867		} \
868	else \
869		{ \
870		errno=0; \
871		while ( (result = fread(buf, 1, max_size, cpyyin))==0 && ferror(cpyyin)) \
872			{ \
873			if( errno != EINTR) \
874				{ \
875				YY_FATAL_ERROR( "input in flex scanner failed" ); \
876				break; \
877				} \
878			errno=0; \
879			clearerr(cpyyin); \
880			} \
881		}\
882\
883
884#endif
885
886/* No semi-colon after return; correct usage is to write "yyterminate();" -
887 * we don't want an extra ';' after the "return" because that will cause
888 * some compilers to complain about unreachable statements.
889 */
890#ifndef yyterminate
891#define yyterminate() return YY_NULL
892#endif
893
894/* Number of entries by which start-condition stack grows. */
895#ifndef YY_START_STACK_INCR
896#define YY_START_STACK_INCR 25
897#endif
898
899/* Report a fatal error. */
900#ifndef YY_FATAL_ERROR
901#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
902#endif
903
904/* end tables serialization structures and prototypes */
905
906/* Default declaration of generated scanner - a define so the user can
907 * easily add parameters.
908 */
909#ifndef YY_DECL
910#define YY_DECL_IS_OURS 1
911
912extern int cpyylex (void);
913
914#define YY_DECL int cpyylex (void)
915#endif /* !YY_DECL */
916
917/* Code executed at the beginning of each rule, after cpyytext and cpyyleng
918 * have been set up.
919 */
920#ifndef YY_USER_ACTION
921#define YY_USER_ACTION
922#endif
923
924/* Code executed at the end of each rule. */
925#ifndef YY_BREAK
926#define YY_BREAK break;
927#endif
928
929#define YY_RULE_SETUP \
930	YY_USER_ACTION
931
932/** The main scanner function which does all the work.
933 */
934YY_DECL
935{
936	register yy_state_type yy_current_state;
937	register char *yy_cp, *yy_bp;
938	register int yy_act;
939
940#line 111 "client6_token.l"
941
942
943	if (cpyy_first_time) {
944		BEGIN S_CNF;
945		cpyy_first_time = 0;
946	}
947
948	/* interface configuration */
949#line 950 "lex.cpyy.c"
950
951	if ( !(yy_init) )
952		{
953		(yy_init) = 1;
954
955#ifdef YY_USER_INIT
956		YY_USER_INIT;
957#endif
958
959		if ( ! (yy_start) )
960			(yy_start) = 1;	/* first start state */
961
962		if ( ! cpyyin )
963			cpyyin = stdin;
964
965		if ( ! cpyyout )
966			cpyyout = stdout;
967
968		if ( ! YY_CURRENT_BUFFER ) {
969			cpyyensure_buffer_stack ();
970			YY_CURRENT_BUFFER_LVALUE =
971				cpyy_create_buffer(cpyyin,YY_BUF_SIZE );
972		}
973
974		cpyy_load_buffer_state( );
975		}
976
977	while ( 1 )		/* loops until end-of-file is reached */
978		{
979		yy_cp = (yy_c_buf_p);
980
981		/* Support of cpyytext. */
982		*yy_cp = (yy_hold_char);
983
984		/* yy_bp points to the position in yy_ch_buf of the start of
985		 * the current run.
986		 */
987		yy_bp = yy_cp;
988
989		yy_current_state = (yy_start);
990yy_match:
991		do
992			{
993			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
994			if ( yy_accept[yy_current_state] )
995				{
996				(yy_last_accepting_state) = yy_current_state;
997				(yy_last_accepting_cpos) = yy_cp;
998				}
999			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1000				{
1001				yy_current_state = (int) yy_def[yy_current_state];
1002				if ( yy_current_state >= 311 )
1003					yy_c = yy_meta[(unsigned int) yy_c];
1004				}
1005			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1006			++yy_cp;
1007			}
1008		while ( yy_base[yy_current_state] != 422 );
1009
1010yy_find_action:
1011		yy_act = yy_accept[yy_current_state];
1012		if ( yy_act == 0 )
1013			{ /* have to back up */
1014			yy_cp = (yy_last_accepting_cpos);
1015			yy_current_state = (yy_last_accepting_state);
1016			yy_act = yy_accept[yy_current_state];
1017			}
1018
1019		YY_DO_BEFORE_ACTION;
1020
1021do_action:	/* This label is used only to access EOF actions. */
1022
1023		switch ( yy_act )
1024	{ /* beginning of action switch */
1025			case 0: /* must back up */
1026			/* undo the effects of YY_DO_BEFORE_ACTION */
1027			*yy_cp = (yy_hold_char);
1028			yy_cp = (yy_last_accepting_cpos);
1029			yy_current_state = (yy_last_accepting_state);
1030			goto yy_find_action;
1031
1032case 1:
1033YY_RULE_SETUP
1034#line 119 "client6_token.l"
1035{ DECHO; BEGIN S_IFACE; return (INTERFACE); }
1036	YY_BREAK
1037case 2:
1038YY_RULE_SETUP
1039#line 120 "client6_token.l"
1040{
1041	DECHO;
1042	cpyylval.str = strdup(cpyytext);
1043	BEGIN S_CNF;
1044	return (IFNAME);
1045}
1046	YY_BREAK
1047case 3:
1048YY_RULE_SETUP
1049#line 127 "client6_token.l"
1050{ DECHO; BEGIN S_ADDR; return (ADDRESS); }
1051	YY_BREAK
1052case 4:
1053YY_RULE_SETUP
1054#line 129 "client6_token.l"
1055{ DECHO; BEGIN S_ADDR; return (PREFIX); }
1056	YY_BREAK
1057case 5:
1058YY_RULE_SETUP
1059#line 130 "client6_token.l"
1060{
1061	struct in6_addr addr;
1062	DECHO;
1063	if (inet_pton(AF_INET6, cpyytext, &addr) < 1) {
1064		dprintf(LOG_ERR, "invalid address in line %d", lineno);
1065		return (-1);
1066	}
1067	cpyylval.addr = addr;
1068	BEGIN S_CNF;
1069	return (IPV6ADDR);
1070}
1071	YY_BREAK
1072case 6:
1073YY_RULE_SETUP
1074#line 141 "client6_token.l"
1075{ DECHO; return (IAID); }
1076	YY_BREAK
1077case 7:
1078YY_RULE_SETUP
1079#line 142 "client6_token.l"
1080{ DECHO; return (V_TIME); }
1081	YY_BREAK
1082case 8:
1083YY_RULE_SETUP
1084#line 143 "client6_token.l"
1085{ DECHO; return (P_TIME); }
1086	YY_BREAK
1087case 9:
1088YY_RULE_SETUP
1089#line 144 "client6_token.l"
1090{ DECHO; return (RENEW_TIME); }
1091	YY_BREAK
1092case 10:
1093YY_RULE_SETUP
1094#line 145 "client6_token.l"
1095{ DECHO; return (REBIND_TIME); }
1096	YY_BREAK
1097case 11:
1098YY_RULE_SETUP
1099#line 146 "client6_token.l"
1100{ DECHO; return (PREFIX_DELEGATION_INTERFACE); }
1101	YY_BREAK
1102/* request */
1103case 12:
1104YY_RULE_SETUP
1105#line 148 "client6_token.l"
1106{ DECHO; return (REQUEST); }
1107	YY_BREAK
1108/* send */
1109case 13:
1110YY_RULE_SETUP
1111#line 151 "client6_token.l"
1112{ DECHO; return (SEND); }
1113	YY_BREAK
1114/* DHCP options */
1115case 14:
1116YY_RULE_SETUP
1117#line 153 "client6_token.l"
1118{ DECHO; return (OPTION); }
1119	YY_BREAK
1120case 15:
1121YY_RULE_SETUP
1122#line 155 "client6_token.l"
1123{ DECHO; return (RAPID_COMMIT); }
1124	YY_BREAK
1125case 16:
1126YY_RULE_SETUP
1127#line 156 "client6_token.l"
1128{ DECHO; return (PREFIX_DELEGATION); }
1129	YY_BREAK
1130case 17:
1131YY_RULE_SETUP
1132#line 157 "client6_token.l"
1133{ DECHO; return (DNS_SERVERS); }
1134	YY_BREAK
1135case 18:
1136YY_RULE_SETUP
1137#line 158 "client6_token.l"
1138{ DECHO; return (SIP_SERVERS); }
1139	YY_BREAK
1140case 19:
1141YY_RULE_SETUP
1142#line 159 "client6_token.l"
1143{ DECHO; return (NTP_SERVERS); }
1144	YY_BREAK
1145/* generic options */
1146case 20:
1147YY_RULE_SETUP
1148#line 161 "client6_token.l"
1149{ DECHO; return (INFO_ONLY); }
1150	YY_BREAK
1151case 21:
1152YY_RULE_SETUP
1153#line 162 "client6_token.l"
1154{ DECHO; return (TEMP_ADDR); }
1155	YY_BREAK
1156/* duration */
1157case 22:
1158YY_RULE_SETUP
1159#line 164 "client6_token.l"
1160{ DECHO; return (INFINITY); }
1161	YY_BREAK
1162/* Foxconn added start pling 08/26/2009 */
1163case 23:
1164YY_RULE_SETUP
1165#line 167 "client6_token.l"
1166{ DECHO; return (SOLICIT_ONLY); }
1167	YY_BREAK
1168/* Foxconn added start pling 08/26/2009 */
1169/* Foxconn added start pling 09/07/2010 */
1170case 24:
1171YY_RULE_SETUP
1172#line 171 "client6_token.l"
1173{ DECHO; return (USER_CLASS); }
1174	YY_BREAK
1175/* Foxconn added end pling 09/07/2010 */
1176/* Foxconn added start pling 09/21/2010 */
1177/* For DHCPv6 readylogo test, to request IANA only or IAPD only */
1178case 25:
1179YY_RULE_SETUP
1180#line 176 "client6_token.l"
1181{ DECHO; return (IANA_ONLY); }
1182	YY_BREAK
1183case 26:
1184YY_RULE_SETUP
1185#line 177 "client6_token.l"
1186{ DECHO; return (IAPD_ONLY); }
1187	YY_BREAK
1188case 27:
1189YY_RULE_SETUP
1190#line 178 "client6_token.l"
1191{ DECHO; return (DOMAIN_LIST); }
1192	YY_BREAK
1193/* Foxconn added end pling 09/21/2010 */
1194/* Foxconn added start pling 10/07/2010 */
1195case 28:
1196YY_RULE_SETUP
1197#line 182 "client6_token.l"
1198{ DECHO; return (XID_SOL); }
1199	YY_BREAK
1200case 29:
1201YY_RULE_SETUP
1202#line 183 "client6_token.l"
1203{ DECHO; return (XID_REQ); }
1204	YY_BREAK
1205case 30:
1206YY_RULE_SETUP
1207#line 184 "client6_token.l"
1208{ DECHO; return (DUID_TIME); }
1209	YY_BREAK
1210/* Foxconn added end pling 10/07/2010 */
1211/* misc */
1212case 31:
1213YY_RULE_SETUP
1214#line 188 "client6_token.l"
1215{ ; }
1216	YY_BREAK
1217case 32:
1218/* rule 32 can match eol */
1219YY_RULE_SETUP
1220#line 189 "client6_token.l"
1221{ lineno++; }
1222	YY_BREAK
1223case 33:
1224YY_RULE_SETUP
1225#line 190 "client6_token.l"
1226{ DP("comment"); }
1227	YY_BREAK
1228case 34:
1229YY_RULE_SETUP
1230#line 191 "client6_token.l"
1231{
1232	DECHO;
1233	cpyylval.num = strtoll(cpyytext, NULL, 10);
1234	return (NUMBER);
1235}
1236	YY_BREAK
1237case 35:
1238YY_RULE_SETUP
1239#line 196 "client6_token.l"
1240{ DECHO; return (SLASH); }
1241	YY_BREAK
1242case 36:
1243YY_RULE_SETUP
1244#line 197 "client6_token.l"
1245{ DECHO; return (COMMA); }
1246	YY_BREAK
1247case 37:
1248YY_RULE_SETUP
1249#line 198 "client6_token.l"
1250{ DP("end of sentence"); return (EOS); }
1251	YY_BREAK
1252case 38:
1253YY_RULE_SETUP
1254#line 199 "client6_token.l"
1255{ DP("begin of closure"); return (BCL); }
1256	YY_BREAK
1257case 39:
1258YY_RULE_SETUP
1259#line 200 "client6_token.l"
1260{ DP("end of closure"); return (ECL); }
1261	YY_BREAK
1262/* generic string */
1263case 40:
1264YY_RULE_SETUP
1265#line 203 "client6_token.l"
1266{
1267		DECHO;
1268		cpyylval.str = strdup(cpyytext);
1269		return (STRING);
1270	}
1271	YY_BREAK
1272case 41:
1273YY_RULE_SETUP
1274#line 209 "client6_token.l"
1275ECHO;
1276	YY_BREAK
1277#line 1278 "lex.cpyy.c"
1278case YY_STATE_EOF(INITIAL):
1279case YY_STATE_EOF(S_CNF):
1280case YY_STATE_EOF(S_IFACE):
1281case YY_STATE_EOF(S_ADDR):
1282case YY_STATE_EOF(S_RNT):
1283case YY_STATE_EOF(S_RBT):
1284	yyterminate();
1285
1286	case YY_END_OF_BUFFER:
1287		{
1288		/* Amount of text matched not including the EOB char. */
1289		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1290
1291		/* Undo the effects of YY_DO_BEFORE_ACTION. */
1292		*yy_cp = (yy_hold_char);
1293		YY_RESTORE_YY_MORE_OFFSET
1294
1295		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1296			{
1297			/* We're scanning a new file or input source.  It's
1298			 * possible that this happened because the user
1299			 * just pointed cpyyin at a new source and called
1300			 * cpyylex().  If so, then we have to assure
1301			 * consistency between YY_CURRENT_BUFFER and our
1302			 * globals.  Here is the right place to do so, because
1303			 * this is the first action (other than possibly a
1304			 * back-up) that will match for the new input source.
1305			 */
1306			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1307			YY_CURRENT_BUFFER_LVALUE->yy_input_file = cpyyin;
1308			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1309			}
1310
1311		/* Note that here we test for yy_c_buf_p "<=" to the position
1312		 * of the first EOB in the buffer, since yy_c_buf_p will
1313		 * already have been incremented past the NUL character
1314		 * (since all states make transitions on EOB to the
1315		 * end-of-buffer state).  Contrast this with the test
1316		 * in input().
1317		 */
1318		if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1319			{ /* This was really a NUL. */
1320			yy_state_type yy_next_state;
1321
1322			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1323
1324			yy_current_state = yy_get_previous_state(  );
1325
1326			/* Okay, we're now positioned to make the NUL
1327			 * transition.  We couldn't have
1328			 * yy_get_previous_state() go ahead and do it
1329			 * for us because it doesn't know how to deal
1330			 * with the possibility of jamming (and we don't
1331			 * want to build jamming into it because then it
1332			 * will run more slowly).
1333			 */
1334
1335			yy_next_state = yy_try_NUL_trans( yy_current_state );
1336
1337			yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1338
1339			if ( yy_next_state )
1340				{
1341				/* Consume the NUL. */
1342				yy_cp = ++(yy_c_buf_p);
1343				yy_current_state = yy_next_state;
1344				goto yy_match;
1345				}
1346
1347			else
1348				{
1349				yy_cp = (yy_c_buf_p);
1350				goto yy_find_action;
1351				}
1352			}
1353
1354		else switch ( yy_get_next_buffer(  ) )
1355			{
1356			case EOB_ACT_END_OF_FILE:
1357				{
1358				(yy_did_buffer_switch_on_eof) = 0;
1359
1360				if ( cpyywrap( ) )
1361					{
1362					/* Note: because we've taken care in
1363					 * yy_get_next_buffer() to have set up
1364					 * cpyytext, we can now set up
1365					 * yy_c_buf_p so that if some total
1366					 * hoser (like flex itself) wants to
1367					 * call the scanner after we return the
1368					 * YY_NULL, it'll still work - another
1369					 * YY_NULL will get returned.
1370					 */
1371					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1372
1373					yy_act = YY_STATE_EOF(YY_START);
1374					goto do_action;
1375					}
1376
1377				else
1378					{
1379					if ( ! (yy_did_buffer_switch_on_eof) )
1380						YY_NEW_FILE;
1381					}
1382				break;
1383				}
1384
1385			case EOB_ACT_CONTINUE_SCAN:
1386				(yy_c_buf_p) =
1387					(yytext_ptr) + yy_amount_of_matched_text;
1388
1389				yy_current_state = yy_get_previous_state(  );
1390
1391				yy_cp = (yy_c_buf_p);
1392				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1393				goto yy_match;
1394
1395			case EOB_ACT_LAST_MATCH:
1396				(yy_c_buf_p) =
1397				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1398
1399				yy_current_state = yy_get_previous_state(  );
1400
1401				yy_cp = (yy_c_buf_p);
1402				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1403				goto yy_find_action;
1404			}
1405		break;
1406		}
1407
1408	default:
1409		YY_FATAL_ERROR(
1410			"fatal flex scanner internal error--no action found" );
1411	} /* end of action switch */
1412		} /* end of scanning one token */
1413} /* end of cpyylex */
1414
1415/* yy_get_next_buffer - try to read in a new buffer
1416 *
1417 * Returns a code representing an action:
1418 *	EOB_ACT_LAST_MATCH -
1419 *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1420 *	EOB_ACT_END_OF_FILE - end of file
1421 */
1422static int yy_get_next_buffer (void)
1423{
1424    	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1425	register char *source = (yytext_ptr);
1426	register int number_to_move, i;
1427	int ret_val;
1428
1429	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1430		YY_FATAL_ERROR(
1431		"fatal flex scanner internal error--end of buffer missed" );
1432
1433	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1434		{ /* Don't try to fill the buffer, so this is an EOF. */
1435		if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1436			{
1437			/* We matched a single character, the EOB, so
1438			 * treat this as a final EOF.
1439			 */
1440			return EOB_ACT_END_OF_FILE;
1441			}
1442
1443		else
1444			{
1445			/* We matched some text prior to the EOB, first
1446			 * process it.
1447			 */
1448			return EOB_ACT_LAST_MATCH;
1449			}
1450		}
1451
1452	/* Try to read more data. */
1453
1454	/* First move last chars to start of buffer. */
1455	number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1456
1457	for ( i = 0; i < number_to_move; ++i )
1458		*(dest++) = *(source++);
1459
1460	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1461		/* don't do the read, it's not guaranteed to return an EOF,
1462		 * just force an EOF
1463		 */
1464		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1465
1466	else
1467		{
1468			int num_to_read =
1469			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1470
1471		while ( num_to_read <= 0 )
1472			{ /* Not enough room in the buffer - grow it. */
1473
1474			/* just a shorter name for the current buffer */
1475			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1476
1477			int yy_c_buf_p_offset =
1478				(int) ((yy_c_buf_p) - b->yy_ch_buf);
1479
1480			if ( b->yy_is_our_buffer )
1481				{
1482				int new_size = b->yy_buf_size * 2;
1483
1484				if ( new_size <= 0 )
1485					b->yy_buf_size += b->yy_buf_size / 8;
1486				else
1487					b->yy_buf_size *= 2;
1488
1489				b->yy_ch_buf = (char *)
1490					/* Include room in for 2 EOB chars. */
1491					cpyyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
1492				}
1493			else
1494				/* Can't grow it, we don't own it. */
1495				b->yy_ch_buf = 0;
1496
1497			if ( ! b->yy_ch_buf )
1498				YY_FATAL_ERROR(
1499				"fatal error - scanner input buffer overflow" );
1500
1501			(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1502
1503			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1504						number_to_move - 1;
1505
1506			}
1507
1508		if ( num_to_read > YY_READ_BUF_SIZE )
1509			num_to_read = YY_READ_BUF_SIZE;
1510
1511		/* Read in more data. */
1512		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1513			(yy_n_chars), (size_t) num_to_read );
1514
1515		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1516		}
1517
1518	if ( (yy_n_chars) == 0 )
1519		{
1520		if ( number_to_move == YY_MORE_ADJ )
1521			{
1522			ret_val = EOB_ACT_END_OF_FILE;
1523			cpyyrestart(cpyyin  );
1524			}
1525
1526		else
1527			{
1528			ret_val = EOB_ACT_LAST_MATCH;
1529			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1530				YY_BUFFER_EOF_PENDING;
1531			}
1532		}
1533
1534	else
1535		ret_val = EOB_ACT_CONTINUE_SCAN;
1536
1537	if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1538		/* Extend the array by 50%, plus the number we really need. */
1539		yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1540		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) cpyyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
1541		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1542			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1543	}
1544
1545	(yy_n_chars) += number_to_move;
1546	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1547	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1548
1549	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1550
1551	return ret_val;
1552}
1553
1554/* yy_get_previous_state - get the state just before the EOB char was reached */
1555
1556    static yy_state_type yy_get_previous_state (void)
1557{
1558	register yy_state_type yy_current_state;
1559	register char *yy_cp;
1560
1561	yy_current_state = (yy_start);
1562
1563	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1564		{
1565		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1566		if ( yy_accept[yy_current_state] )
1567			{
1568			(yy_last_accepting_state) = yy_current_state;
1569			(yy_last_accepting_cpos) = yy_cp;
1570			}
1571		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1572			{
1573			yy_current_state = (int) yy_def[yy_current_state];
1574			if ( yy_current_state >= 311 )
1575				yy_c = yy_meta[(unsigned int) yy_c];
1576			}
1577		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1578		}
1579
1580	return yy_current_state;
1581}
1582
1583/* yy_try_NUL_trans - try to make a transition on the NUL character
1584 *
1585 * synopsis
1586 *	next_state = yy_try_NUL_trans( current_state );
1587 */
1588    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
1589{
1590	register int yy_is_jam;
1591    	register char *yy_cp = (yy_c_buf_p);
1592
1593	register YY_CHAR yy_c = 1;
1594	if ( yy_accept[yy_current_state] )
1595		{
1596		(yy_last_accepting_state) = yy_current_state;
1597		(yy_last_accepting_cpos) = yy_cp;
1598		}
1599	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1600		{
1601		yy_current_state = (int) yy_def[yy_current_state];
1602		if ( yy_current_state >= 311 )
1603			yy_c = yy_meta[(unsigned int) yy_c];
1604		}
1605	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1606	yy_is_jam = (yy_current_state == 310);
1607
1608	return yy_is_jam ? 0 : yy_current_state;
1609}
1610
1611    static void yyunput (int c, register char * yy_bp )
1612{
1613	register char *yy_cp;
1614
1615    yy_cp = (yy_c_buf_p);
1616
1617	/* undo effects of setting up cpyytext */
1618	*yy_cp = (yy_hold_char);
1619
1620	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1621		{ /* need to shift things up to make room */
1622		/* +2 for EOB chars. */
1623		register int number_to_move = (yy_n_chars) + 2;
1624		register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1625					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1626		register char *source =
1627				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1628
1629		while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1630			*--dest = *--source;
1631
1632		yy_cp += (int) (dest - source);
1633		yy_bp += (int) (dest - source);
1634		YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1635			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1636
1637		if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1638			YY_FATAL_ERROR( "flex scanner push-back overflow" );
1639		}
1640
1641	*--yy_cp = (char) c;
1642
1643	(yytext_ptr) = yy_bp;
1644	(yy_hold_char) = *yy_cp;
1645	(yy_c_buf_p) = yy_cp;
1646}
1647
1648#ifndef YY_NO_INPUT
1649#ifdef __cplusplus
1650    static int yyinput (void)
1651#else
1652    static int input  (void)
1653#endif
1654
1655{
1656	int c;
1657
1658	*(yy_c_buf_p) = (yy_hold_char);
1659
1660	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1661		{
1662		/* yy_c_buf_p now points to the character we want to return.
1663		 * If this occurs *before* the EOB characters, then it's a
1664		 * valid NUL; if not, then we've hit the end of the buffer.
1665		 */
1666		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1667			/* This was really a NUL. */
1668			*(yy_c_buf_p) = '\0';
1669
1670		else
1671			{ /* need more input */
1672			int offset = (yy_c_buf_p) - (yytext_ptr);
1673			++(yy_c_buf_p);
1674
1675			switch ( yy_get_next_buffer(  ) )
1676				{
1677				case EOB_ACT_LAST_MATCH:
1678					/* This happens because yy_g_n_b()
1679					 * sees that we've accumulated a
1680					 * token and flags that we need to
1681					 * try matching the token before
1682					 * proceeding.  But for input(),
1683					 * there's no matching to consider.
1684					 * So convert the EOB_ACT_LAST_MATCH
1685					 * to EOB_ACT_END_OF_FILE.
1686					 */
1687
1688					/* Reset buffer status. */
1689					cpyyrestart(cpyyin );
1690
1691					/*FALLTHROUGH*/
1692
1693				case EOB_ACT_END_OF_FILE:
1694					{
1695					if ( cpyywrap( ) )
1696						return EOF;
1697
1698					if ( ! (yy_did_buffer_switch_on_eof) )
1699						YY_NEW_FILE;
1700#ifdef __cplusplus
1701					return yyinput();
1702#else
1703					return input();
1704#endif
1705					}
1706
1707				case EOB_ACT_CONTINUE_SCAN:
1708					(yy_c_buf_p) = (yytext_ptr) + offset;
1709					break;
1710				}
1711			}
1712		}
1713
1714	c = *(unsigned char *) (yy_c_buf_p);	/* cast for 8-bit char's */
1715	*(yy_c_buf_p) = '\0';	/* preserve cpyytext */
1716	(yy_hold_char) = *++(yy_c_buf_p);
1717
1718	return c;
1719}
1720#endif	/* ifndef YY_NO_INPUT */
1721
1722/** Immediately switch to a different input stream.
1723 * @param input_file A readable stream.
1724 *
1725 * @note This function does not reset the start condition to @c INITIAL .
1726 */
1727    void cpyyrestart  (FILE * input_file )
1728{
1729
1730	if ( ! YY_CURRENT_BUFFER ){
1731        cpyyensure_buffer_stack ();
1732		YY_CURRENT_BUFFER_LVALUE =
1733            cpyy_create_buffer(cpyyin,YY_BUF_SIZE );
1734	}
1735
1736	cpyy_init_buffer(YY_CURRENT_BUFFER,input_file );
1737	cpyy_load_buffer_state( );
1738}
1739
1740/** Switch to a different input buffer.
1741 * @param new_buffer The new input buffer.
1742 *
1743 */
1744    void cpyy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
1745{
1746
1747	/* TODO. We should be able to replace this entire function body
1748	 * with
1749	 *		cpyypop_buffer_state();
1750	 *		cpyypush_buffer_state(new_buffer);
1751     */
1752	cpyyensure_buffer_stack ();
1753	if ( YY_CURRENT_BUFFER == new_buffer )
1754		return;
1755
1756	if ( YY_CURRENT_BUFFER )
1757		{
1758		/* Flush out information for old buffer. */
1759		*(yy_c_buf_p) = (yy_hold_char);
1760		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1761		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1762		}
1763
1764	YY_CURRENT_BUFFER_LVALUE = new_buffer;
1765	cpyy_load_buffer_state( );
1766
1767	/* We don't actually know whether we did this switch during
1768	 * EOF (cpyywrap()) processing, but the only time this flag
1769	 * is looked at is after cpyywrap() is called, so it's safe
1770	 * to go ahead and always set it.
1771	 */
1772	(yy_did_buffer_switch_on_eof) = 1;
1773}
1774
1775static void cpyy_load_buffer_state  (void)
1776{
1777    	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1778	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1779	cpyyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1780	(yy_hold_char) = *(yy_c_buf_p);
1781}
1782
1783/** Allocate and initialize an input buffer state.
1784 * @param file A readable stream.
1785 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1786 *
1787 * @return the allocated buffer state.
1788 */
1789    YY_BUFFER_STATE cpyy_create_buffer  (FILE * file, int  size )
1790{
1791	YY_BUFFER_STATE b;
1792
1793	b = (YY_BUFFER_STATE) cpyyalloc(sizeof( struct yy_buffer_state )  );
1794	if ( ! b )
1795		YY_FATAL_ERROR( "out of dynamic memory in cpyy_create_buffer()" );
1796
1797	b->yy_buf_size = size;
1798
1799	/* yy_ch_buf has to be 2 characters longer than the size given because
1800	 * we need to put in 2 end-of-buffer characters.
1801	 */
1802	b->yy_ch_buf = (char *) cpyyalloc(b->yy_buf_size + 2  );
1803	if ( ! b->yy_ch_buf )
1804		YY_FATAL_ERROR( "out of dynamic memory in cpyy_create_buffer()" );
1805
1806	b->yy_is_our_buffer = 1;
1807
1808	cpyy_init_buffer(b,file );
1809
1810	return b;
1811}
1812
1813/** Destroy the buffer.
1814 * @param b a buffer created with cpyy_create_buffer()
1815 *
1816 */
1817    void cpyy_delete_buffer (YY_BUFFER_STATE  b )
1818{
1819
1820	if ( ! b )
1821		return;
1822
1823	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1824		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1825
1826	if ( b->yy_is_our_buffer )
1827		cpyyfree((void *) b->yy_ch_buf  );
1828
1829	cpyyfree((void *) b  );
1830}
1831
1832#ifndef __cplusplus
1833extern int isatty (int );
1834#endif /* __cplusplus */
1835
1836/* Initializes or reinitializes a buffer.
1837 * This function is sometimes called more than once on the same buffer,
1838 * such as during a cpyyrestart() or at EOF.
1839 */
1840    static void cpyy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
1841
1842{
1843	int oerrno = errno;
1844
1845	cpyy_flush_buffer(b );
1846
1847	b->yy_input_file = file;
1848	b->yy_fill_buffer = 1;
1849
1850    /* If b is the current buffer, then cpyy_init_buffer was _probably_
1851     * called from cpyyrestart() or through yy_get_next_buffer.
1852     * In that case, we don't want to reset the lineno or column.
1853     */
1854    if (b != YY_CURRENT_BUFFER){
1855        b->yy_bs_lineno = 1;
1856        b->yy_bs_column = 0;
1857    }
1858
1859        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1860
1861	errno = oerrno;
1862}
1863
1864/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1865 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1866 *
1867 */
1868    void cpyy_flush_buffer (YY_BUFFER_STATE  b )
1869{
1870    	if ( ! b )
1871		return;
1872
1873	b->yy_n_chars = 0;
1874
1875	/* We always need two end-of-buffer characters.  The first causes
1876	 * a transition to the end-of-buffer state.  The second causes
1877	 * a jam in that state.
1878	 */
1879	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1880	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1881
1882	b->yy_buf_pos = &b->yy_ch_buf[0];
1883
1884	b->yy_at_bol = 1;
1885	b->yy_buffer_status = YY_BUFFER_NEW;
1886
1887	if ( b == YY_CURRENT_BUFFER )
1888		cpyy_load_buffer_state( );
1889}
1890
1891/** Pushes the new state onto the stack. The new state becomes
1892 *  the current state. This function will allocate the stack
1893 *  if necessary.
1894 *  @param new_buffer The new state.
1895 *
1896 */
1897void cpyypush_buffer_state (YY_BUFFER_STATE new_buffer )
1898{
1899    	if (new_buffer == NULL)
1900		return;
1901
1902	cpyyensure_buffer_stack();
1903
1904	/* This block is copied from cpyy_switch_to_buffer. */
1905	if ( YY_CURRENT_BUFFER )
1906		{
1907		/* Flush out information for old buffer. */
1908		*(yy_c_buf_p) = (yy_hold_char);
1909		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1910		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1911		}
1912
1913	/* Only push if top exists. Otherwise, replace top. */
1914	if (YY_CURRENT_BUFFER)
1915		(yy_buffer_stack_top)++;
1916	YY_CURRENT_BUFFER_LVALUE = new_buffer;
1917
1918	/* copied from cpyy_switch_to_buffer. */
1919	cpyy_load_buffer_state( );
1920	(yy_did_buffer_switch_on_eof) = 1;
1921}
1922
1923/** Removes and deletes the top of the stack, if present.
1924 *  The next element becomes the new top.
1925 *
1926 */
1927void cpyypop_buffer_state (void)
1928{
1929    	if (!YY_CURRENT_BUFFER)
1930		return;
1931
1932	cpyy_delete_buffer(YY_CURRENT_BUFFER );
1933	YY_CURRENT_BUFFER_LVALUE = NULL;
1934	if ((yy_buffer_stack_top) > 0)
1935		--(yy_buffer_stack_top);
1936
1937	if (YY_CURRENT_BUFFER) {
1938		cpyy_load_buffer_state( );
1939		(yy_did_buffer_switch_on_eof) = 1;
1940	}
1941}
1942
1943/* Allocates the stack if it does not exist.
1944 *  Guarantees space for at least one push.
1945 */
1946static void cpyyensure_buffer_stack (void)
1947{
1948	int num_to_alloc;
1949
1950	if (!(yy_buffer_stack)) {
1951
1952		/* First allocation is just for 2 elements, since we don't know if this
1953		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1954		 * immediate realloc on the next call.
1955         */
1956		num_to_alloc = 1;
1957		(yy_buffer_stack) = (struct yy_buffer_state**)cpyyalloc
1958								(num_to_alloc * sizeof(struct yy_buffer_state*)
1959								);
1960		if ( ! (yy_buffer_stack) )
1961			YY_FATAL_ERROR( "out of dynamic memory in cpyyensure_buffer_stack()" );
1962
1963		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1964
1965		(yy_buffer_stack_max) = num_to_alloc;
1966		(yy_buffer_stack_top) = 0;
1967		return;
1968	}
1969
1970	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1971
1972		/* Increase the buffer to prepare for a possible push. */
1973		int grow_size = 8 /* arbitrary grow size */;
1974
1975		num_to_alloc = (yy_buffer_stack_max) + grow_size;
1976		(yy_buffer_stack) = (struct yy_buffer_state**)cpyyrealloc
1977								((yy_buffer_stack),
1978								num_to_alloc * sizeof(struct yy_buffer_state*)
1979								);
1980		if ( ! (yy_buffer_stack) )
1981			YY_FATAL_ERROR( "out of dynamic memory in cpyyensure_buffer_stack()" );
1982
1983		/* zero only the new slots.*/
1984		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1985		(yy_buffer_stack_max) = num_to_alloc;
1986	}
1987}
1988
1989/** Setup the input buffer state to scan directly from a user-specified character buffer.
1990 * @param base the character buffer
1991 * @param size the size in bytes of the character buffer
1992 *
1993 * @return the newly allocated buffer state object.
1994 */
1995YY_BUFFER_STATE cpyy_scan_buffer  (char * base, yy_size_t  size )
1996{
1997	YY_BUFFER_STATE b;
1998
1999	if ( size < 2 ||
2000	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
2001	     base[size-1] != YY_END_OF_BUFFER_CHAR )
2002		/* They forgot to leave room for the EOB's. */
2003		return 0;
2004
2005	b = (YY_BUFFER_STATE) cpyyalloc(sizeof( struct yy_buffer_state )  );
2006	if ( ! b )
2007		YY_FATAL_ERROR( "out of dynamic memory in cpyy_scan_buffer()" );
2008
2009	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
2010	b->yy_buf_pos = b->yy_ch_buf = base;
2011	b->yy_is_our_buffer = 0;
2012	b->yy_input_file = 0;
2013	b->yy_n_chars = b->yy_buf_size;
2014	b->yy_is_interactive = 0;
2015	b->yy_at_bol = 1;
2016	b->yy_fill_buffer = 0;
2017	b->yy_buffer_status = YY_BUFFER_NEW;
2018
2019	cpyy_switch_to_buffer(b  );
2020
2021	return b;
2022}
2023
2024/** Setup the input buffer state to scan a string. The next call to cpyylex() will
2025 * scan from a @e copy of @a str.
2026 * @param yystr a NUL-terminated string to scan
2027 *
2028 * @return the newly allocated buffer state object.
2029 * @note If you want to scan bytes that may contain NUL values, then use
2030 *       cpyy_scan_bytes() instead.
2031 */
2032YY_BUFFER_STATE cpyy_scan_string (yyconst char * yystr )
2033{
2034
2035	return cpyy_scan_bytes(yystr,strlen(yystr) );
2036}
2037
2038/** Setup the input buffer state to scan the given bytes. The next call to cpyylex() will
2039 * scan from a @e copy of @a bytes.
2040 * @param bytes the byte buffer to scan
2041 * @param len the number of bytes in the buffer pointed to by @a bytes.
2042 *
2043 * @return the newly allocated buffer state object.
2044 */
2045YY_BUFFER_STATE cpyy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
2046{
2047	YY_BUFFER_STATE b;
2048	char *buf;
2049	yy_size_t n;
2050	int i;
2051
2052	/* Get memory for full buffer, including space for trailing EOB's. */
2053	n = _yybytes_len + 2;
2054	buf = (char *) cpyyalloc(n  );
2055	if ( ! buf )
2056		YY_FATAL_ERROR( "out of dynamic memory in cpyy_scan_bytes()" );
2057
2058	for ( i = 0; i < _yybytes_len; ++i )
2059		buf[i] = yybytes[i];
2060
2061	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2062
2063	b = cpyy_scan_buffer(buf,n );
2064	if ( ! b )
2065		YY_FATAL_ERROR( "bad buffer in cpyy_scan_bytes()" );
2066
2067	/* It's okay to grow etc. this buffer, and we should throw it
2068	 * away when we're done.
2069	 */
2070	b->yy_is_our_buffer = 1;
2071
2072	return b;
2073}
2074
2075#ifndef YY_EXIT_FAILURE
2076#define YY_EXIT_FAILURE 2
2077#endif
2078
2079static void yy_fatal_error (yyconst char* msg )
2080{
2081    	(void) fprintf( stderr, "%s\n", msg );
2082	exit( YY_EXIT_FAILURE );
2083}
2084
2085/* Redefine yyless() so it works in section 3 code. */
2086
2087#undef yyless
2088#define yyless(n) \
2089	do \
2090		{ \
2091		/* Undo effects of setting up cpyytext. */ \
2092        int yyless_macro_arg = (n); \
2093        YY_LESS_LINENO(yyless_macro_arg);\
2094		cpyytext[cpyyleng] = (yy_hold_char); \
2095		(yy_c_buf_p) = cpyytext + yyless_macro_arg; \
2096		(yy_hold_char) = *(yy_c_buf_p); \
2097		*(yy_c_buf_p) = '\0'; \
2098		cpyyleng = yyless_macro_arg; \
2099		} \
2100	while ( 0 )
2101
2102/* Accessor  methods (get/set functions) to struct members. */
2103
2104/** Get the current line number.
2105 *
2106 */
2107int cpyyget_lineno  (void)
2108{
2109
2110    return cpyylineno;
2111}
2112
2113/** Get the input stream.
2114 *
2115 */
2116FILE *cpyyget_in  (void)
2117{
2118        return cpyyin;
2119}
2120
2121/** Get the output stream.
2122 *
2123 */
2124FILE *cpyyget_out  (void)
2125{
2126        return cpyyout;
2127}
2128
2129/** Get the length of the current token.
2130 *
2131 */
2132int cpyyget_leng  (void)
2133{
2134        return cpyyleng;
2135}
2136
2137/** Get the current token.
2138 *
2139 */
2140
2141char *cpyyget_text  (void)
2142{
2143        return cpyytext;
2144}
2145
2146/** Set the current line number.
2147 * @param line_number
2148 *
2149 */
2150void cpyyset_lineno (int  line_number )
2151{
2152
2153    cpyylineno = line_number;
2154}
2155
2156/** Set the input stream. This does not discard the current
2157 * input buffer.
2158 * @param in_str A readable stream.
2159 *
2160 * @see cpyy_switch_to_buffer
2161 */
2162void cpyyset_in (FILE *  in_str )
2163{
2164        cpyyin = in_str ;
2165}
2166
2167void cpyyset_out (FILE *  out_str )
2168{
2169        cpyyout = out_str ;
2170}
2171
2172int cpyyget_debug  (void)
2173{
2174        return cpyy_flex_debug;
2175}
2176
2177void cpyyset_debug (int  bdebug )
2178{
2179        cpyy_flex_debug = bdebug ;
2180}
2181
2182static int yy_init_globals (void)
2183{
2184        /* Initialization is the same as for the non-reentrant scanner.
2185     * This function is called from cpyylex_destroy(), so don't allocate here.
2186     */
2187
2188    (yy_buffer_stack) = 0;
2189    (yy_buffer_stack_top) = 0;
2190    (yy_buffer_stack_max) = 0;
2191    (yy_c_buf_p) = (char *) 0;
2192    (yy_init) = 0;
2193    (yy_start) = 0;
2194
2195/* Defined in main.c */
2196#ifdef YY_STDINIT
2197    cpyyin = stdin;
2198    cpyyout = stdout;
2199#else
2200    cpyyin = (FILE *) 0;
2201    cpyyout = (FILE *) 0;
2202#endif
2203
2204    /* For future reference: Set errno on error, since we are called by
2205     * cpyylex_init()
2206     */
2207    return 0;
2208}
2209
2210/* cpyylex_destroy is for both reentrant and non-reentrant scanners. */
2211int cpyylex_destroy  (void)
2212{
2213
2214    /* Pop the buffer stack, destroying each element. */
2215	while(YY_CURRENT_BUFFER){
2216		cpyy_delete_buffer(YY_CURRENT_BUFFER  );
2217		YY_CURRENT_BUFFER_LVALUE = NULL;
2218		cpyypop_buffer_state();
2219	}
2220
2221	/* Destroy the stack itself. */
2222	cpyyfree((yy_buffer_stack) );
2223	(yy_buffer_stack) = NULL;
2224
2225    /* Reset the globals. This is important in a non-reentrant scanner so the next time
2226     * cpyylex() is called, initialization will occur. */
2227    yy_init_globals( );
2228
2229    return 0;
2230}
2231
2232/*
2233 * Internal utility routines.
2234 */
2235
2236#ifndef yytext_ptr
2237static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2238{
2239	register int i;
2240	for ( i = 0; i < n; ++i )
2241		s1[i] = s2[i];
2242}
2243#endif
2244
2245#ifdef YY_NEED_STRLEN
2246static int yy_flex_strlen (yyconst char * s )
2247{
2248	register int n;
2249	for ( n = 0; s[n]; ++n )
2250		;
2251
2252	return n;
2253}
2254#endif
2255
2256void *cpyyalloc (yy_size_t  size )
2257{
2258	return (void *) malloc( size );
2259}
2260
2261void *cpyyrealloc  (void * ptr, yy_size_t  size )
2262{
2263	/* The cast to (char *) in the following accommodates both
2264	 * implementations that use char* generic pointers, and those
2265	 * that use void* generic pointers.  It works with the latter
2266	 * because both ANSI C and C++ allow castless assignment from
2267	 * any pointer type to void*, and deal with argument conversions
2268	 * as though doing an assignment.
2269	 */
2270	return (void *) realloc( (char *) ptr, size );
2271}
2272
2273void cpyyfree (void * ptr )
2274{
2275	free( (char *) ptr );	/* see cpyyrealloc() for (char *) cast */
2276}
2277
2278#define YYTABLES_NAME "yytables"
2279
2280#line 209 "client6_token.l"
2281
2282
2283static void
2284cfdebug_print(w, t, l)
2285	char *w, *t;
2286	int l;
2287{
2288	if (w)
2289		dprintf(LOG_DEBUG, "<%d>%s [%s] (%d)", yy_start, w, t, l);
2290	else
2291		dprintf(LOG_DEBUG, "<%d>[%s] (%d)", yy_start, t, l);
2292}
2293
2294static void
2295cpyyerror0(int level, char *s, va_list ap)
2296{
2297	char ebuf[BUFSIZ], *bp, *ep;
2298
2299	bp = ebuf;
2300	ep = ebuf + sizeof(ebuf);
2301	bp += snprintf(bp, ep - bp, "%s %d: ", configfilename, lineno);
2302	if (bp < ep)
2303		bp += vsnprintf(bp, ep - bp, s, ap);
2304
2305	dprintf(level, ebuf);
2306}
2307
2308void
2309cpyyerror(char *s, ...)
2310{
2311	va_list ap;
2312#ifdef HAVE_STDARG_H
2313	va_start(ap, s);
2314#else
2315	va_start(ap);
2316#endif
2317	cpyyerror0(LOG_ERR, s, ap);
2318	va_end(ap);
2319	cpyyerrorcount++;
2320}
2321
2322void
2323cpyywarn(char *s, ...)
2324{
2325	va_list ap;
2326#ifdef HAVE_STDARG_H
2327	va_start(ap, s);
2328#else
2329	va_start(ap);
2330#endif
2331	cpyyerror0(LOG_WARNING, s, ap);
2332	va_end(ap);
2333}
2334
2335int
2336cfparse(const char *conf)
2337{
2338	configfilename = conf;
2339	if ((cpyyin = fopen(configfilename, "r")) == NULL) {
2340		if (errno == ENOENT)
2341			return (0);
2342		dprintf(LOG_ERR, "cfparse: fopen(%s): %s",
2343			configfilename, strerror(errno));
2344		return (-1);
2345	}
2346
2347	if (cpyyparse() || cpyyerrorcount) {
2348		if (cpyyerrorcount) {
2349			cpyyerror("fatal parse failure: exiting (%d errors)",
2350				cpyyerrorcount);
2351		} else
2352			cpyyerror("fatal parse failure: exiting");
2353		return (-1);
2354	}
2355
2356	return (cf_post_config());
2357}
2358
2359