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