source: rtems-libbsd/freebsd/lib/libipsec/policy_token.c @ f41a394

55-freebsd-126-freebsd-12freebsd-9.3
Last change on this file since f41a394 was e35a65e, checked in by Chris Johns <chrisj@…>, on 05/24/15 at 03:11:01

Regenerate with FreeBSD lex, yacc, and rpcgen tools.

Use the FreeBSD lex, yacc and rpcgen tools to generate the various
sources used in LibBSD. The change also removes an RTEMS specific change
added when using other hosts operating systems to generate the files.

LibBSD should use FreeBSD version of the tools to generate the source
because the FreeBSD kernel is developed using them.

The change is supported by the waf build which disables generating
the files unless enabled. I am not sure the effect with the Makefile
build support.

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