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