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