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