libnl  3.2.7
/builddir/build/BUILD/libnl-3.2.7/lib/route/pktloc_grammar.c
00001 #line 2 "route/pktloc_grammar.c"
00002 
00003 #line 4 "route/pktloc_grammar.c"
00004 
00005 #define  YY_INT_ALIGNED short int
00006 
00007 /* A lexical scanner generated by flex */
00008 
00009 #define FLEX_SCANNER
00010 #define YY_FLEX_MAJOR_VERSION 2
00011 #define YY_FLEX_MINOR_VERSION 5
00012 #define YY_FLEX_SUBMINOR_VERSION 35
00013 #if YY_FLEX_SUBMINOR_VERSION > 0
00014 #define FLEX_BETA
00015 #endif
00016 
00017 /* First, we deal with  platform-specific or compiler-specific issues. */
00018 
00019 /* begin standard C headers. */
00020 #include <stdio.h>
00021 #include <string.h>
00022 #include <errno.h>
00023 #include <stdlib.h>
00024 
00025 /* end standard C headers. */
00026 
00027 /* flex integer type definitions */
00028 
00029 #ifndef FLEXINT_H
00030 #define FLEXINT_H
00031 
00032 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
00033 
00034 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
00035 
00036 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
00037  * if you want the limit (max/min) macros for int types. 
00038  */
00039 #ifndef __STDC_LIMIT_MACROS
00040 #define __STDC_LIMIT_MACROS 1
00041 #endif
00042 
00043 #include <inttypes.h>
00044 typedef int8_t flex_int8_t;
00045 typedef uint8_t flex_uint8_t;
00046 typedef int16_t flex_int16_t;
00047 typedef uint16_t flex_uint16_t;
00048 typedef int32_t flex_int32_t;
00049 typedef uint32_t flex_uint32_t;
00050 #else
00051 typedef signed char flex_int8_t;
00052 typedef short int flex_int16_t;
00053 typedef int flex_int32_t;
00054 typedef unsigned char flex_uint8_t; 
00055 typedef unsigned short int flex_uint16_t;
00056 typedef unsigned int flex_uint32_t;
00057 #endif /* ! C99 */
00058 
00059 /* Limits of integral types. */
00060 #ifndef INT8_MIN
00061 #define INT8_MIN               (-128)
00062 #endif
00063 #ifndef INT16_MIN
00064 #define INT16_MIN              (-32767-1)
00065 #endif
00066 #ifndef INT32_MIN
00067 #define INT32_MIN              (-2147483647-1)
00068 #endif
00069 #ifndef INT8_MAX
00070 #define INT8_MAX               (127)
00071 #endif
00072 #ifndef INT16_MAX
00073 #define INT16_MAX              (32767)
00074 #endif
00075 #ifndef INT32_MAX
00076 #define INT32_MAX              (2147483647)
00077 #endif
00078 #ifndef UINT8_MAX
00079 #define UINT8_MAX              (255U)
00080 #endif
00081 #ifndef UINT16_MAX
00082 #define UINT16_MAX             (65535U)
00083 #endif
00084 #ifndef UINT32_MAX
00085 #define UINT32_MAX             (4294967295U)
00086 #endif
00087 
00088 #endif /* ! FLEXINT_H */
00089 
00090 #ifdef __cplusplus
00091 
00092 /* The "const" storage-class-modifier is valid. */
00093 #define YY_USE_CONST
00094 
00095 #else   /* ! __cplusplus */
00096 
00097 /* C99 requires __STDC__ to be defined as 1. */
00098 #if defined (__STDC__)
00099 
00100 #define YY_USE_CONST
00101 
00102 #endif  /* defined (__STDC__) */
00103 #endif  /* ! __cplusplus */
00104 
00105 #ifdef YY_USE_CONST
00106 #define yyconst const
00107 #else
00108 #define yyconst
00109 #endif
00110 
00111 /* Returned upon end-of-file. */
00112 #define YY_NULL 0
00113 
00114 /* Promotes a possibly negative, possibly signed char to an unsigned
00115  * integer for use as an array index.  If the signed char is negative,
00116  * we want to instead treat it as an 8-bit unsigned char, hence the
00117  * double cast.
00118  */
00119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
00120 
00121 /* An opaque pointer. */
00122 #ifndef YY_TYPEDEF_YY_SCANNER_T
00123 #define YY_TYPEDEF_YY_SCANNER_T
00124 typedef void* yyscan_t;
00125 #endif
00126 
00127 /* For convenience, these vars (plus the bison vars far below)
00128    are macros in the reentrant scanner. */
00129 #define yyin yyg->yyin_r
00130 #define yyout yyg->yyout_r
00131 #define yyextra yyg->yyextra_r
00132 #define yyleng yyg->yyleng_r
00133 #define yytext yyg->yytext_r
00134 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
00135 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
00136 #define yy_flex_debug yyg->yy_flex_debug_r
00137 
00138 /* Enter a start condition.  This macro really ought to take a parameter,
00139  * but we do it the disgusting crufty way forced on us by the ()-less
00140  * definition of BEGIN.
00141  */
00142 #define BEGIN yyg->yy_start = 1 + 2 *
00143 
00144 /* Translate the current start state into a value that can be later handed
00145  * to BEGIN to return to the state.  The YYSTATE alias is for lex
00146  * compatibility.
00147  */
00148 #define YY_START ((yyg->yy_start - 1) / 2)
00149 #define YYSTATE YY_START
00150 
00151 /* Action number for EOF rule of a given start state. */
00152 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
00153 
00154 /* Special action meaning "start processing a new file". */
00155 #define YY_NEW_FILE pktloc_restart(yyin ,yyscanner )
00156 
00157 #define YY_END_OF_BUFFER_CHAR 0
00158 
00159 /* Size of default input buffer. */
00160 #ifndef YY_BUF_SIZE
00161 #define YY_BUF_SIZE 16384
00162 #endif
00163 
00164 /* The state buf must be large enough to hold one state per character in the main buffer.
00165  */
00166 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
00167 
00168 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
00169 #define YY_TYPEDEF_YY_BUFFER_STATE
00170 typedef struct yy_buffer_state *YY_BUFFER_STATE;
00171 #endif
00172 
00173 #define EOB_ACT_CONTINUE_SCAN 0
00174 #define EOB_ACT_END_OF_FILE 1
00175 #define EOB_ACT_LAST_MATCH 2
00176 
00177     #define YY_LESS_LINENO(n)
00178     
00179 /* Return all but the first "n" matched characters back to the input stream. */
00180 #define yyless(n) \
00181         do \
00182                 { \
00183                 /* Undo effects of setting up yytext. */ \
00184         int yyless_macro_arg = (n); \
00185         YY_LESS_LINENO(yyless_macro_arg);\
00186                 *yy_cp = yyg->yy_hold_char; \
00187                 YY_RESTORE_YY_MORE_OFFSET \
00188                 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
00189                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
00190                 } \
00191         while ( 0 )
00192 
00193 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
00194 
00195 #ifndef YY_TYPEDEF_YY_SIZE_T
00196 #define YY_TYPEDEF_YY_SIZE_T
00197 typedef size_t yy_size_t;
00198 #endif
00199 
00200 #ifndef YY_STRUCT_YY_BUFFER_STATE
00201 #define YY_STRUCT_YY_BUFFER_STATE
00202 struct yy_buffer_state
00203         {
00204         FILE *yy_input_file;
00205 
00206         char *yy_ch_buf;                /* input buffer */
00207         char *yy_buf_pos;               /* current position in input buffer */
00208 
00209         /* Size of input buffer in bytes, not including room for EOB
00210          * characters.
00211          */
00212         yy_size_t yy_buf_size;
00213 
00214         /* Number of characters read into yy_ch_buf, not including EOB
00215          * characters.
00216          */
00217         int yy_n_chars;
00218 
00219         /* Whether we "own" the buffer - i.e., we know we created it,
00220          * and can realloc() it to grow it, and should free() it to
00221          * delete it.
00222          */
00223         int yy_is_our_buffer;
00224 
00225         /* Whether this is an "interactive" input source; if so, and
00226          * if we're using stdio for input, then we want to use getc()
00227          * instead of fread(), to make sure we stop fetching input after
00228          * each newline.
00229          */
00230         int yy_is_interactive;
00231 
00232         /* Whether we're considered to be at the beginning of a line.
00233          * If so, '^' rules will be active on the next match, otherwise
00234          * not.
00235          */
00236         int yy_at_bol;
00237 
00238     int yy_bs_lineno; /**< The line count. */
00239     int yy_bs_column; /**< The column count. */
00240     
00241         /* Whether to try to fill the input buffer when we reach the
00242          * end of it.
00243          */
00244         int yy_fill_buffer;
00245 
00246         int yy_buffer_status;
00247 
00248 #define YY_BUFFER_NEW 0
00249 #define YY_BUFFER_NORMAL 1
00250         /* When an EOF's been seen but there's still some text to process
00251          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
00252          * shouldn't try reading from the input source any more.  We might
00253          * still have a bunch of tokens to match, though, because of
00254          * possible backing-up.
00255          *
00256          * When we actually see the EOF, we change the status to "new"
00257          * (via pktloc_restart()), so that the user can continue scanning by
00258          * just pointing yyin at a new input file.
00259          */
00260 #define YY_BUFFER_EOF_PENDING 2
00261 
00262         };
00263 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
00264 
00265 /* We provide macros for accessing buffer states in case in the
00266  * future we want to put the buffer states in a more general
00267  * "scanner state".
00268  *
00269  * Returns the top of the stack, or NULL.
00270  */
00271 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
00272                           ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
00273                           : NULL)
00274 
00275 /* Same as previous macro, but useful when we know that the buffer stack is not
00276  * NULL or when we need an lvalue. For internal use only.
00277  */
00278 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
00279 
00280 void pktloc_restart (FILE *input_file ,yyscan_t yyscanner );
00281 void pktloc__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
00282 YY_BUFFER_STATE pktloc__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
00283 void pktloc__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
00284 void pktloc__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
00285 void pktloc_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
00286 void pktloc_pop_buffer_state (yyscan_t yyscanner );
00287 
00288 static void pktloc_ensure_buffer_stack (yyscan_t yyscanner );
00289 static void pktloc__load_buffer_state (yyscan_t yyscanner );
00290 static void pktloc__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
00291 
00292 #define YY_FLUSH_BUFFER pktloc__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
00293 
00294 YY_BUFFER_STATE pktloc__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
00295 YY_BUFFER_STATE pktloc__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
00296 YY_BUFFER_STATE pktloc__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
00297 
00298 void *pktloc_alloc (yy_size_t ,yyscan_t yyscanner );
00299 void *pktloc_realloc (void *,yy_size_t ,yyscan_t yyscanner );
00300 void pktloc_free (void * ,yyscan_t yyscanner );
00301 
00302 #define yy_new_buffer pktloc__create_buffer
00303 
00304 #define yy_set_interactive(is_interactive) \
00305         { \
00306         if ( ! YY_CURRENT_BUFFER ){ \
00307         pktloc_ensure_buffer_stack (yyscanner); \
00308                 YY_CURRENT_BUFFER_LVALUE =    \
00309             pktloc__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
00310         } \
00311         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
00312         }
00313 
00314 #define yy_set_bol(at_bol) \
00315         { \
00316         if ( ! YY_CURRENT_BUFFER ){\
00317         pktloc_ensure_buffer_stack (yyscanner); \
00318                 YY_CURRENT_BUFFER_LVALUE =    \
00319             pktloc__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
00320         } \
00321         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
00322         }
00323 
00324 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
00325 
00326 #define pktloc_wrap(n) 1
00327 #define YY_SKIP_YYWRAP
00328 
00329 typedef unsigned char YY_CHAR;
00330 
00331 typedef int yy_state_type;
00332 
00333 #define yytext_ptr yytext_r
00334 
00335 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
00336 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  ,yyscan_t yyscanner);
00337 static int yy_get_next_buffer (yyscan_t yyscanner );
00338 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
00339 
00340 /* Done after the current pattern has been matched and before the
00341  * corresponding action - sets up yytext.
00342  */
00343 #define YY_DO_BEFORE_ACTION \
00344         yyg->yytext_ptr = yy_bp; \
00345         yyleng = (size_t) (yy_cp - yy_bp); \
00346         yyg->yy_hold_char = *yy_cp; \
00347         *yy_cp = '\0'; \
00348         yyg->yy_c_buf_p = yy_cp;
00349 
00350 #define YY_NUM_RULES 16
00351 #define YY_END_OF_BUFFER 17
00352 /* This struct is not used in this scanner,
00353    but its presence is necessary. */
00354 struct yy_trans_info
00355         {
00356         flex_int32_t yy_verify;
00357         flex_int32_t yy_nxt;
00358         };
00359 static yyconst flex_int16_t yy_accept[47] =
00360     {   0,
00361         0,    0,   17,   15,    1,    2,    5,    3,    3,   15,
00362        15,   15,   15,   15,   15,   15,    1,    2,    2,    3,
00363        15,   15,   12,   15,   15,   15,   15,   15,   15,    6,
00364         4,   10,   15,   11,   14,   15,    7,    8,    9,   15,
00365        15,   15,   15,   15,   13,    0
00366     } ;
00367 
00368 static yyconst flex_int32_t yy_ec[256] =
00369     {   0,
00370         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
00371         1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
00372         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00373         1,    2,    1,    1,    4,    1,    1,    1,    1,    1,
00374         1,    1,    5,    1,    1,    1,    1,    6,    7,    8,
00375         9,   10,   10,   11,   10,   12,   10,    1,    1,    1,
00376         1,    1,    1,    1,   13,   14,   15,   14,   16,   14,
00377         1,   17,   18,    1,   19,   20,    1,   21,   22,   23,
00378         1,   24,   25,   26,   27,    1,    1,   28,    1,    1,
00379         1,    1,    1,    1,    1,    1,   13,   14,   15,   14,
00380 
00381        16,   14,    1,   17,   18,    1,   19,   20,    1,   21,
00382        22,   23,    1,   24,   25,   26,   27,    1,    1,   28,
00383         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00384         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00385         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00386         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00387         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00388         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00389         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00390         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00391 
00392         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00393         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00394         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00395         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00396         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00397         1,    1,    1,    1,    1
00398     } ;
00399 
00400 static yyconst flex_int32_t yy_meta[29] =
00401     {   0,
00402         1,    2,    3,    1,    2,    1,    1,    1,    1,    1,
00403         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00404         1,    1,    1,    1,    1,    1,    1,    1
00405     } ;
00406 
00407 static yyconst flex_int16_t yy_base[50] =
00408     {   0,
00409         0,    0,   86,    0,   27,   29,   87,   29,   57,   58,
00410        60,   64,   65,   18,   36,    0,   44,   47,    0,   52,
00411        52,   62,    0,   57,   51,   53,   62,   63,   65,    0,
00412         0,    0,   37,    0,    0,   34,    0,    0,    0,   29,
00413        30,   29,   26,   18,    0,   87,   31,   68,   70
00414     } ;
00415 
00416 static yyconst flex_int16_t yy_def[50] =
00417     {   0,
00418        46,    1,   46,   47,   46,   48,   46,   47,    8,   47,
00419        47,   47,   47,   47,   47,   47,   46,   48,   49,    8,
00420        47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
00421        21,   47,   47,   47,   47,   47,   47,   47,   47,   47,
00422        47,   47,   47,   47,   47,    0,   46,   46,   46
00423     } ;
00424 
00425 static yyconst flex_int16_t yy_nxt[116] =
00426     {   0,
00427         4,    5,    5,    6,    7,    8,    9,    9,    9,    9,
00428         9,    9,    4,    4,    4,   10,    4,   11,    4,   12,
00429        13,    4,    4,    4,    4,   14,   15,    4,   17,   17,
00430        19,   16,   26,   19,   20,   20,   20,   20,   20,   20,
00431        20,   27,   28,   45,   29,   17,   17,   30,   19,   44,
00432        43,   19,   42,   41,   40,   39,   21,   31,   31,   31,
00433        31,   31,   31,   31,   31,   31,   31,   31,   18,   18,
00434        19,   19,   38,   37,   36,   35,   34,   33,   32,   16,
00435        25,   24,   23,   22,   16,   46,    3,   46,   46,   46,
00436        46,   46,   46,   46,   46,   46,   46,   46,   46,   46,
00437 
00438        46,   46,   46,   46,   46,   46,   46,   46,   46,   46,
00439        46,   46,   46,   46,   46
00440     } ;
00441 
00442 static yyconst flex_int16_t yy_chk[116] =
00443     {   0,
00444         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00445         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00446         1,    1,    1,    1,    1,    1,    1,    1,    5,    5,
00447         6,   47,   14,    6,    8,    8,    8,    8,    8,    8,
00448         8,   14,   15,   44,   15,   17,   17,   15,   18,   43,
00449        42,   18,   41,   40,   36,   33,    8,   21,   21,   21,
00450        21,   21,   21,   21,   21,   21,   21,   21,   48,   48,
00451        49,   49,   29,   28,   27,   26,   25,   24,   22,   20,
00452        13,   12,   11,   10,    9,    3,   46,   46,   46,   46,
00453        46,   46,   46,   46,   46,   46,   46,   46,   46,   46,
00454 
00455        46,   46,   46,   46,   46,   46,   46,   46,   46,   46,
00456        46,   46,   46,   46,   46
00457     } ;
00458 
00459 /* The intent behind this definition is that it'll catch
00460  * any uses of REJECT which flex missed.
00461  */
00462 #define REJECT reject_used_but_not_detected
00463 #define yymore() yymore_used_but_not_detected
00464 #define YY_MORE_ADJ 0
00465 #define YY_RESTORE_YY_MORE_OFFSET
00466 #line 1 "route/pktloc_grammar.l"
00467 #line 2 "route/pktloc_grammar.l"
00468  #include <netlink-local.h>
00469  #include <netlink-tc.h>
00470  #include <netlink/netlink.h>
00471  #include <netlink/utils.h>
00472  #include <netlink/route/pktloc.h>
00473  #include "pktloc_syntax.h"
00474 #define YY_NO_INPUT 1
00475 #line 476 "route/pktloc_grammar.c"
00476 
00477 #define INITIAL 0
00478 
00479 #ifndef YY_NO_UNISTD_H
00480 /* Special case for "unistd.h", since it is non-ANSI. We include it way
00481  * down here because we want the user's section 1 to have been scanned first.
00482  * The user has a chance to override it with an option.
00483  */
00484 #include <unistd.h>
00485 #endif
00486 
00487 #ifndef YY_EXTRA_TYPE
00488 #define YY_EXTRA_TYPE void *
00489 #endif
00490 
00491 /* Holds the entire state of the reentrant scanner. */
00492 struct yyguts_t
00493     {
00494 
00495     /* User-defined. Not touched by flex. */
00496     YY_EXTRA_TYPE yyextra_r;
00497 
00498     /* The rest are the same as the globals declared in the non-reentrant scanner. */
00499     FILE *yyin_r, *yyout_r;
00500     size_t yy_buffer_stack_top; /**< index of top of stack. */
00501     size_t yy_buffer_stack_max; /**< capacity of stack. */
00502     YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
00503     char yy_hold_char;
00504     int yy_n_chars;
00505     int yyleng_r;
00506     char *yy_c_buf_p;
00507     int yy_init;
00508     int yy_start;
00509     int yy_did_buffer_switch_on_eof;
00510     int yy_start_stack_ptr;
00511     int yy_start_stack_depth;
00512     int *yy_start_stack;
00513     yy_state_type yy_last_accepting_state;
00514     char* yy_last_accepting_cpos;
00515 
00516     int yylineno_r;
00517     int yy_flex_debug_r;
00518 
00519     char *yytext_r;
00520     int yy_more_flag;
00521     int yy_more_len;
00522 
00523     YYSTYPE * yylval_r;
00524 
00525     YYLTYPE * yylloc_r;
00526 
00527     }; /* end struct yyguts_t */
00528 
00529 static int yy_init_globals (yyscan_t yyscanner );
00530 
00531     /* This must go here because YYSTYPE and YYLTYPE are included
00532      * from bison output in section 1.*/
00533     #    define yylval yyg->yylval_r
00534     
00535     #    define yylloc yyg->yylloc_r
00536     
00537 int pktloc_lex_init (yyscan_t* scanner);
00538 
00539 int pktloc_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
00540 
00541 /* Accessor methods to globals.
00542    These are made visible to non-reentrant scanners for convenience. */
00543 
00544 int pktloc_lex_destroy (yyscan_t yyscanner );
00545 
00546 int pktloc_get_debug (yyscan_t yyscanner );
00547 
00548 void pktloc_set_debug (int debug_flag ,yyscan_t yyscanner );
00549 
00550 YY_EXTRA_TYPE pktloc_get_extra (yyscan_t yyscanner );
00551 
00552 void pktloc_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
00553 
00554 FILE *pktloc_get_in (yyscan_t yyscanner );
00555 
00556 void pktloc_set_in  (FILE * in_str ,yyscan_t yyscanner );
00557 
00558 FILE *pktloc_get_out (yyscan_t yyscanner );
00559 
00560 void pktloc_set_out  (FILE * out_str ,yyscan_t yyscanner );
00561 
00562 int pktloc_get_leng (yyscan_t yyscanner );
00563 
00564 char *pktloc_get_text (yyscan_t yyscanner );
00565 
00566 int pktloc_get_lineno (yyscan_t yyscanner );
00567 
00568 void pktloc_set_lineno (int line_number ,yyscan_t yyscanner );
00569 
00570 int pktloc_get_column  (yyscan_t yyscanner );
00571 
00572 void pktloc_set_column (int column_no ,yyscan_t yyscanner );
00573 
00574 YYSTYPE * pktloc_get_lval (yyscan_t yyscanner );
00575 
00576 void pktloc_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
00577 
00578        YYLTYPE *pktloc_get_lloc (yyscan_t yyscanner );
00579     
00580         void pktloc_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
00581     
00582 /* Macros after this point can all be overridden by user definitions in
00583  * section 1.
00584  */
00585 
00586 #ifndef YY_SKIP_YYWRAP
00587 #ifdef __cplusplus
00588 extern "C" int pktloc_wrap (yyscan_t yyscanner );
00589 #else
00590 extern int pktloc_wrap (yyscan_t yyscanner );
00591 #endif
00592 #endif
00593 
00594 #ifndef yytext_ptr
00595 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
00596 #endif
00597 
00598 #ifdef YY_NEED_STRLEN
00599 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
00600 #endif
00601 
00602 #ifndef YY_NO_INPUT
00603 
00604 #ifdef __cplusplus
00605 static int yyinput (yyscan_t yyscanner );
00606 #else
00607 static int input (yyscan_t yyscanner );
00608 #endif
00609 
00610 #endif
00611 
00612 /* Amount of stuff to slurp up with each read. */
00613 #ifndef YY_READ_BUF_SIZE
00614 #define YY_READ_BUF_SIZE 8192
00615 #endif
00616 
00617 /* Copy whatever the last rule matched to the standard output. */
00618 #ifndef ECHO
00619 /* This used to be an fputs(), but since the string might contain NUL's,
00620  * we now use fwrite().
00621  */
00622 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
00623 #endif
00624 
00625 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
00626  * is returned in "result".
00627  */
00628 #ifndef YY_INPUT
00629 #define YY_INPUT(buf,result,max_size) \
00630         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
00631                 { \
00632                 int c = '*'; \
00633                 unsigned n; \
00634                 for ( n = 0; n < max_size && \
00635                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
00636                         buf[n] = (char) c; \
00637                 if ( c == '\n' ) \
00638                         buf[n++] = (char) c; \
00639                 if ( c == EOF && ferror( yyin ) ) \
00640                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
00641                 result = n; \
00642                 } \
00643         else \
00644                 { \
00645                 errno=0; \
00646                 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
00647                         { \
00648                         if( errno != EINTR) \
00649                                 { \
00650                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
00651                                 break; \
00652                                 } \
00653                         errno=0; \
00654                         clearerr(yyin); \
00655                         } \
00656                 }\
00657 \
00658 
00659 #endif
00660 
00661 /* No semi-colon after return; correct usage is to write "yyterminate();" -
00662  * we don't want an extra ';' after the "return" because that will cause
00663  * some compilers to complain about unreachable statements.
00664  */
00665 #ifndef yyterminate
00666 #define yyterminate() return YY_NULL
00667 #endif
00668 
00669 /* Number of entries by which start-condition stack grows. */
00670 #ifndef YY_START_STACK_INCR
00671 #define YY_START_STACK_INCR 25
00672 #endif
00673 
00674 /* Report a fatal error. */
00675 #ifndef YY_FATAL_ERROR
00676 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
00677 #endif
00678 
00679 /* end tables serialization structures and prototypes */
00680 
00681 /* Default declaration of generated scanner - a define so the user can
00682  * easily add parameters.
00683  */
00684 #ifndef YY_DECL
00685 #define YY_DECL_IS_OURS 1
00686 
00687 extern int pktloc_lex \
00688                (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
00689 
00690 #define YY_DECL int pktloc_lex \
00691                (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
00692 #endif /* !YY_DECL */
00693 
00694 /* Code executed at the beginning of each rule, after yytext and yyleng
00695  * have been set up.
00696  */
00697 #ifndef YY_USER_ACTION
00698 #define YY_USER_ACTION
00699 #endif
00700 
00701 /* Code executed at the end of each rule. */
00702 #ifndef YY_BREAK
00703 #define YY_BREAK break;
00704 #endif
00705 
00706 #define YY_RULE_SETUP \
00707         YY_USER_ACTION
00708 
00709 /** The main scanner function which does all the work.
00710  */
00711 YY_DECL
00712 {
00713         register yy_state_type yy_current_state;
00714         register char *yy_cp, *yy_bp;
00715         register int yy_act;
00716     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
00717 
00718 #line 20 "route/pktloc_grammar.l"
00719 
00720 
00721 #line 722 "route/pktloc_grammar.c"
00722 
00723     yylval = yylval_param;
00724 
00725     yylloc = yylloc_param;
00726 
00727         if ( !yyg->yy_init )
00728                 {
00729                 yyg->yy_init = 1;
00730 
00731 #ifdef YY_USER_INIT
00732                 YY_USER_INIT;
00733 #endif
00734 
00735                 if ( ! yyg->yy_start )
00736                         yyg->yy_start = 1;      /* first start state */
00737 
00738                 if ( ! yyin )
00739                         yyin = stdin;
00740 
00741                 if ( ! yyout )
00742                         yyout = stdout;
00743 
00744                 if ( ! YY_CURRENT_BUFFER ) {
00745                         pktloc_ensure_buffer_stack (yyscanner);
00746                         YY_CURRENT_BUFFER_LVALUE =
00747                                 pktloc__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
00748                 }
00749 
00750                 pktloc__load_buffer_state(yyscanner );
00751                 }
00752 
00753         while ( 1 )             /* loops until end-of-file is reached */
00754                 {
00755                 yy_cp = yyg->yy_c_buf_p;
00756 
00757                 /* Support of yytext. */
00758                 *yy_cp = yyg->yy_hold_char;
00759 
00760                 /* yy_bp points to the position in yy_ch_buf of the start of
00761                  * the current run.
00762                  */
00763                 yy_bp = yy_cp;
00764 
00765                 yy_current_state = yyg->yy_start;
00766 yy_match:
00767                 do
00768                         {
00769                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
00770                         if ( yy_accept[yy_current_state] )
00771                                 {
00772                                 yyg->yy_last_accepting_state = yy_current_state;
00773                                 yyg->yy_last_accepting_cpos = yy_cp;
00774                                 }
00775                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
00776                                 {
00777                                 yy_current_state = (int) yy_def[yy_current_state];
00778                                 if ( yy_current_state >= 47 )
00779                                         yy_c = yy_meta[(unsigned int) yy_c];
00780                                 }
00781                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
00782                         ++yy_cp;
00783                         }
00784                 while ( yy_base[yy_current_state] != 87 );
00785 
00786 yy_find_action:
00787                 yy_act = yy_accept[yy_current_state];
00788                 if ( yy_act == 0 )
00789                         { /* have to back up */
00790                         yy_cp = yyg->yy_last_accepting_cpos;
00791                         yy_current_state = yyg->yy_last_accepting_state;
00792                         yy_act = yy_accept[yy_current_state];
00793                         }
00794 
00795                 YY_DO_BEFORE_ACTION;
00796 
00797 do_action:      /* This label is used only to access EOF actions. */
00798 
00799                 switch ( yy_act )
00800         { /* beginning of action switch */
00801                         case 0: /* must back up */
00802                         /* undo the effects of YY_DO_BEFORE_ACTION */
00803                         *yy_cp = yyg->yy_hold_char;
00804                         yy_cp = yyg->yy_last_accepting_cpos;
00805                         yy_current_state = yyg->yy_last_accepting_state;
00806                         goto yy_find_action;
00807 
00808 case 1:
00809 /* rule 1 can match eol */
00810 YY_RULE_SETUP
00811 #line 22 "route/pktloc_grammar.l"
00812 
00813         YY_BREAK
00814 case 2:
00815 YY_RULE_SETUP
00816 #line 24 "route/pktloc_grammar.l"
00817 
00818         YY_BREAK
00819 case 3:
00820 #line 27 "route/pktloc_grammar.l"
00821 case 4:
00822 YY_RULE_SETUP
00823 #line 27 "route/pktloc_grammar.l"
00824 {
00825                                 yylval->i = strtoul(yytext, NULL, 0);
00826                                 return NUMBER;
00827                         }
00828         YY_BREAK
00829 case 5:
00830 YY_RULE_SETUP
00831 #line 32 "route/pktloc_grammar.l"
00832 { return yylval->i = yytext[0]; }
00833         YY_BREAK
00834 case 6:
00835 YY_RULE_SETUP
00836 #line 34 "route/pktloc_grammar.l"
00837 { yylval->i = TCF_EM_ALIGN_U8; return ALIGN; }
00838         YY_BREAK
00839 case 7:
00840 YY_RULE_SETUP
00841 #line 35 "route/pktloc_grammar.l"
00842 { yylval->i = TCF_EM_ALIGN_U16; return ALIGN; }
00843         YY_BREAK
00844 case 8:
00845 YY_RULE_SETUP
00846 #line 36 "route/pktloc_grammar.l"
00847 { yylval->i = TCF_EM_ALIGN_U32; return ALIGN; }
00848         YY_BREAK
00849 case 9:
00850 #line 39 "route/pktloc_grammar.l"
00851 case 10:
00852 YY_RULE_SETUP
00853 #line 39 "route/pktloc_grammar.l"
00854 { yylval->i = TCF_LAYER_LINK; return LAYER; }
00855         YY_BREAK
00856 case 11:
00857 #line 41 "route/pktloc_grammar.l"
00858 case 12:
00859 YY_RULE_SETUP
00860 #line 41 "route/pktloc_grammar.l"
00861 { yylval->i = TCF_LAYER_NETWORK; return LAYER; }
00862         YY_BREAK
00863 case 13:
00864 #line 43 "route/pktloc_grammar.l"
00865 case 14:
00866 YY_RULE_SETUP
00867 #line 43 "route/pktloc_grammar.l"
00868 { yylval->i = TCF_LAYER_TRANSPORT; return LAYER; }
00869         YY_BREAK
00870 case 15:
00871 YY_RULE_SETUP
00872 #line 46 "route/pktloc_grammar.l"
00873 {
00874                                 yylval->s = strdup(yytext);
00875                                 if (yylval->s == NULL)
00876                                         return ERROR;
00877                                 return NAME;
00878                         }
00879         YY_BREAK
00880 case 16:
00881 YY_RULE_SETUP
00882 #line 52 "route/pktloc_grammar.l"
00883 ECHO;
00884         YY_BREAK
00885 #line 886 "route/pktloc_grammar.c"
00886 case YY_STATE_EOF(INITIAL):
00887         yyterminate();
00888 
00889         case YY_END_OF_BUFFER:
00890                 {
00891                 /* Amount of text matched not including the EOB char. */
00892                 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
00893 
00894                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
00895                 *yy_cp = yyg->yy_hold_char;
00896                 YY_RESTORE_YY_MORE_OFFSET
00897 
00898                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
00899                         {
00900                         /* We're scanning a new file or input source.  It's
00901                          * possible that this happened because the user
00902                          * just pointed yyin at a new source and called
00903                          * pktloc_lex().  If so, then we have to assure
00904                          * consistency between YY_CURRENT_BUFFER and our
00905                          * globals.  Here is the right place to do so, because
00906                          * this is the first action (other than possibly a
00907                          * back-up) that will match for the new input source.
00908                          */
00909                         yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
00910                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
00911                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
00912                         }
00913 
00914                 /* Note that here we test for yy_c_buf_p "<=" to the position
00915                  * of the first EOB in the buffer, since yy_c_buf_p will
00916                  * already have been incremented past the NUL character
00917                  * (since all states make transitions on EOB to the
00918                  * end-of-buffer state).  Contrast this with the test
00919                  * in input().
00920                  */
00921                 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
00922                         { /* This was really a NUL. */
00923                         yy_state_type yy_next_state;
00924 
00925                         yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
00926 
00927                         yy_current_state = yy_get_previous_state( yyscanner );
00928 
00929                         /* Okay, we're now positioned to make the NUL
00930                          * transition.  We couldn't have
00931                          * yy_get_previous_state() go ahead and do it
00932                          * for us because it doesn't know how to deal
00933                          * with the possibility of jamming (and we don't
00934                          * want to build jamming into it because then it
00935                          * will run more slowly).
00936                          */
00937 
00938                         yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
00939 
00940                         yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
00941 
00942                         if ( yy_next_state )
00943                                 {
00944                                 /* Consume the NUL. */
00945                                 yy_cp = ++yyg->yy_c_buf_p;
00946                                 yy_current_state = yy_next_state;
00947                                 goto yy_match;
00948                                 }
00949 
00950                         else
00951                                 {
00952                                 yy_cp = yyg->yy_c_buf_p;
00953                                 goto yy_find_action;
00954                                 }
00955                         }
00956 
00957                 else switch ( yy_get_next_buffer( yyscanner ) )
00958                         {
00959                         case EOB_ACT_END_OF_FILE:
00960                                 {
00961                                 yyg->yy_did_buffer_switch_on_eof = 0;
00962 
00963                                 if ( pktloc_wrap(yyscanner ) )
00964                                         {
00965                                         /* Note: because we've taken care in
00966                                          * yy_get_next_buffer() to have set up
00967                                          * yytext, we can now set up
00968                                          * yy_c_buf_p so that if some total
00969                                          * hoser (like flex itself) wants to
00970                                          * call the scanner after we return the
00971                                          * YY_NULL, it'll still work - another
00972                                          * YY_NULL will get returned.
00973                                          */
00974                                         yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
00975 
00976                                         yy_act = YY_STATE_EOF(YY_START);
00977                                         goto do_action;
00978                                         }
00979 
00980                                 else
00981                                         {
00982                                         if ( ! yyg->yy_did_buffer_switch_on_eof )
00983                                                 YY_NEW_FILE;
00984                                         }
00985                                 break;
00986                                 }
00987 
00988                         case EOB_ACT_CONTINUE_SCAN:
00989                                 yyg->yy_c_buf_p =
00990                                         yyg->yytext_ptr + yy_amount_of_matched_text;
00991 
00992                                 yy_current_state = yy_get_previous_state( yyscanner );
00993 
00994                                 yy_cp = yyg->yy_c_buf_p;
00995                                 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
00996                                 goto yy_match;
00997 
00998                         case EOB_ACT_LAST_MATCH:
00999                                 yyg->yy_c_buf_p =
01000                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
01001 
01002                                 yy_current_state = yy_get_previous_state( yyscanner );
01003 
01004                                 yy_cp = yyg->yy_c_buf_p;
01005                                 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
01006                                 goto yy_find_action;
01007                         }
01008                 break;
01009                 }
01010 
01011         default:
01012                 YY_FATAL_ERROR(
01013                         "fatal flex scanner internal error--no action found" );
01014         } /* end of action switch */
01015                 } /* end of scanning one token */
01016 } /* end of pktloc_lex */
01017 
01018 /* yy_get_next_buffer - try to read in a new buffer
01019  *
01020  * Returns a code representing an action:
01021  *      EOB_ACT_LAST_MATCH -
01022  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
01023  *      EOB_ACT_END_OF_FILE - end of file
01024  */
01025 static int yy_get_next_buffer (yyscan_t yyscanner)
01026 {
01027     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01028         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
01029         register char *source = yyg->yytext_ptr;
01030         register int number_to_move, i;
01031         int ret_val;
01032 
01033         if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
01034                 YY_FATAL_ERROR(
01035                 "fatal flex scanner internal error--end of buffer missed" );
01036 
01037         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
01038                 { /* Don't try to fill the buffer, so this is an EOF. */
01039                 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
01040                         {
01041                         /* We matched a single character, the EOB, so
01042                          * treat this as a final EOF.
01043                          */
01044                         return EOB_ACT_END_OF_FILE;
01045                         }
01046 
01047                 else
01048                         {
01049                         /* We matched some text prior to the EOB, first
01050                          * process it.
01051                          */
01052                         return EOB_ACT_LAST_MATCH;
01053                         }
01054                 }
01055 
01056         /* Try to read more data. */
01057 
01058         /* First move last chars to start of buffer. */
01059         number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
01060 
01061         for ( i = 0; i < number_to_move; ++i )
01062                 *(dest++) = *(source++);
01063 
01064         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
01065                 /* don't do the read, it's not guaranteed to return an EOF,
01066                  * just force an EOF
01067                  */
01068                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
01069 
01070         else
01071                 {
01072                         int num_to_read =
01073                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
01074 
01075                 while ( num_to_read <= 0 )
01076                         { /* Not enough room in the buffer - grow it. */
01077 
01078                         /* just a shorter name for the current buffer */
01079                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
01080 
01081                         int yy_c_buf_p_offset =
01082                                 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
01083 
01084                         if ( b->yy_is_our_buffer )
01085                                 {
01086                                 int new_size = b->yy_buf_size * 2;
01087 
01088                                 if ( new_size <= 0 )
01089                                         b->yy_buf_size += b->yy_buf_size / 8;
01090                                 else
01091                                         b->yy_buf_size *= 2;
01092 
01093                                 b->yy_ch_buf = (char *)
01094                                         /* Include room in for 2 EOB chars. */
01095                                         pktloc_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
01096                                 }
01097                         else
01098                                 /* Can't grow it, we don't own it. */
01099                                 b->yy_ch_buf = 0;
01100 
01101                         if ( ! b->yy_ch_buf )
01102                                 YY_FATAL_ERROR(
01103                                 "fatal error - scanner input buffer overflow" );
01104 
01105                         yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
01106 
01107                         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
01108                                                 number_to_move - 1;
01109 
01110                         }
01111 
01112                 if ( num_to_read > YY_READ_BUF_SIZE )
01113                         num_to_read = YY_READ_BUF_SIZE;
01114 
01115                 /* Read in more data. */
01116                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
01117                         yyg->yy_n_chars, (size_t) num_to_read );
01118 
01119                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
01120                 }
01121 
01122         if ( yyg->yy_n_chars == 0 )
01123                 {
01124                 if ( number_to_move == YY_MORE_ADJ )
01125                         {
01126                         ret_val = EOB_ACT_END_OF_FILE;
01127                         pktloc_restart(yyin  ,yyscanner);
01128                         }
01129 
01130                 else
01131                         {
01132                         ret_val = EOB_ACT_LAST_MATCH;
01133                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
01134                                 YY_BUFFER_EOF_PENDING;
01135                         }
01136                 }
01137 
01138         else
01139                 ret_val = EOB_ACT_CONTINUE_SCAN;
01140 
01141         if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
01142                 /* Extend the array by 50%, plus the number we really need. */
01143                 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
01144                 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) pktloc_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
01145                 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
01146                         YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
01147         }
01148 
01149         yyg->yy_n_chars += number_to_move;
01150         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
01151         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
01152 
01153         yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
01154 
01155         return ret_val;
01156 }
01157 
01158 /* yy_get_previous_state - get the state just before the EOB char was reached */
01159 
01160     static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
01161 {
01162         register yy_state_type yy_current_state;
01163         register char *yy_cp;
01164     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01165 
01166         yy_current_state = yyg->yy_start;
01167 
01168         for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
01169                 {
01170                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
01171                 if ( yy_accept[yy_current_state] )
01172                         {
01173                         yyg->yy_last_accepting_state = yy_current_state;
01174                         yyg->yy_last_accepting_cpos = yy_cp;
01175                         }
01176                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01177                         {
01178                         yy_current_state = (int) yy_def[yy_current_state];
01179                         if ( yy_current_state >= 47 )
01180                                 yy_c = yy_meta[(unsigned int) yy_c];
01181                         }
01182                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01183                 }
01184 
01185         return yy_current_state;
01186 }
01187 
01188 /* yy_try_NUL_trans - try to make a transition on the NUL character
01189  *
01190  * synopsis
01191  *      next_state = yy_try_NUL_trans( current_state );
01192  */
01193     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
01194 {
01195         register int yy_is_jam;
01196     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
01197         register char *yy_cp = yyg->yy_c_buf_p;
01198 
01199         register YY_CHAR yy_c = 1;
01200         if ( yy_accept[yy_current_state] )
01201                 {
01202                 yyg->yy_last_accepting_state = yy_current_state;
01203                 yyg->yy_last_accepting_cpos = yy_cp;
01204                 }
01205         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01206                 {
01207                 yy_current_state = (int) yy_def[yy_current_state];
01208                 if ( yy_current_state >= 47 )
01209                         yy_c = yy_meta[(unsigned int) yy_c];
01210                 }
01211         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01212         yy_is_jam = (yy_current_state == 46);
01213 
01214         return yy_is_jam ? 0 : yy_current_state;
01215 }
01216 
01217 #ifndef YY_NO_INPUT
01218 #ifdef __cplusplus
01219     static int yyinput (yyscan_t yyscanner)
01220 #else
01221     static int input  (yyscan_t yyscanner)
01222 #endif
01223 
01224 {
01225         int c;
01226     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01227 
01228         *yyg->yy_c_buf_p = yyg->yy_hold_char;
01229 
01230         if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
01231                 {
01232                 /* yy_c_buf_p now points to the character we want to return.
01233                  * If this occurs *before* the EOB characters, then it's a
01234                  * valid NUL; if not, then we've hit the end of the buffer.
01235                  */
01236                 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
01237                         /* This was really a NUL. */
01238                         *yyg->yy_c_buf_p = '\0';
01239 
01240                 else
01241                         { /* need more input */
01242                         int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
01243                         ++yyg->yy_c_buf_p;
01244 
01245                         switch ( yy_get_next_buffer( yyscanner ) )
01246                                 {
01247                                 case EOB_ACT_LAST_MATCH:
01248                                         /* This happens because yy_g_n_b()
01249                                          * sees that we've accumulated a
01250                                          * token and flags that we need to
01251                                          * try matching the token before
01252                                          * proceeding.  But for input(),
01253                                          * there's no matching to consider.
01254                                          * So convert the EOB_ACT_LAST_MATCH
01255                                          * to EOB_ACT_END_OF_FILE.
01256                                          */
01257 
01258                                         /* Reset buffer status. */
01259                                         pktloc_restart(yyin ,yyscanner);
01260 
01261                                         /*FALLTHROUGH*/
01262 
01263                                 case EOB_ACT_END_OF_FILE:
01264                                         {
01265                                         if ( pktloc_wrap(yyscanner ) )
01266                                                 return EOF;
01267 
01268                                         if ( ! yyg->yy_did_buffer_switch_on_eof )
01269                                                 YY_NEW_FILE;
01270 #ifdef __cplusplus
01271                                         return yyinput(yyscanner);
01272 #else
01273                                         return input(yyscanner);
01274 #endif
01275                                         }
01276 
01277                                 case EOB_ACT_CONTINUE_SCAN:
01278                                         yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
01279                                         break;
01280                                 }
01281                         }
01282                 }
01283 
01284         c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
01285         *yyg->yy_c_buf_p = '\0';        /* preserve yytext */
01286         yyg->yy_hold_char = *++yyg->yy_c_buf_p;
01287 
01288         return c;
01289 }
01290 #endif  /* ifndef YY_NO_INPUT */
01291 
01292 /** Immediately switch to a different input stream.
01293  * @param input_file A readable stream.
01294  * @param yyscanner The scanner object.
01295  * @note This function does not reset the start condition to @c INITIAL .
01296  */
01297     void pktloc_restart  (FILE * input_file , yyscan_t yyscanner)
01298 {
01299     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01300 
01301         if ( ! YY_CURRENT_BUFFER ){
01302         pktloc_ensure_buffer_stack (yyscanner);
01303                 YY_CURRENT_BUFFER_LVALUE =
01304             pktloc__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
01305         }
01306 
01307         pktloc__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
01308         pktloc__load_buffer_state(yyscanner );
01309 }
01310 
01311 /** Switch to a different input buffer.
01312  * @param new_buffer The new input buffer.
01313  * @param yyscanner The scanner object.
01314  */
01315     void pktloc__switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
01316 {
01317     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01318 
01319         /* TODO. We should be able to replace this entire function body
01320          * with
01321          *              pktloc_pop_buffer_state();
01322          *              pktloc_push_buffer_state(new_buffer);
01323      */
01324         pktloc_ensure_buffer_stack (yyscanner);
01325         if ( YY_CURRENT_BUFFER == new_buffer )
01326                 return;
01327 
01328         if ( YY_CURRENT_BUFFER )
01329                 {
01330                 /* Flush out information for old buffer. */
01331                 *yyg->yy_c_buf_p = yyg->yy_hold_char;
01332                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
01333                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
01334                 }
01335 
01336         YY_CURRENT_BUFFER_LVALUE = new_buffer;
01337         pktloc__load_buffer_state(yyscanner );
01338 
01339         /* We don't actually know whether we did this switch during
01340          * EOF (pktloc_wrap()) processing, but the only time this flag
01341          * is looked at is after pktloc_wrap() is called, so it's safe
01342          * to go ahead and always set it.
01343          */
01344         yyg->yy_did_buffer_switch_on_eof = 1;
01345 }
01346 
01347 static void pktloc__load_buffer_state  (yyscan_t yyscanner)
01348 {
01349     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01350         yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
01351         yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
01352         yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
01353         yyg->yy_hold_char = *yyg->yy_c_buf_p;
01354 }
01355 
01356 /** Allocate and initialize an input buffer state.
01357  * @param file A readable stream.
01358  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
01359  * @param yyscanner The scanner object.
01360  * @return the allocated buffer state.
01361  */
01362     YY_BUFFER_STATE pktloc__create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
01363 {
01364         YY_BUFFER_STATE b;
01365     
01366         b = (YY_BUFFER_STATE) pktloc_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
01367         if ( ! b )
01368                 YY_FATAL_ERROR( "out of dynamic memory in pktloc__create_buffer()" );
01369 
01370         b->yy_buf_size = size;
01371 
01372         /* yy_ch_buf has to be 2 characters longer than the size given because
01373          * we need to put in 2 end-of-buffer characters.
01374          */
01375         b->yy_ch_buf = (char *) pktloc_alloc(b->yy_buf_size + 2 ,yyscanner );
01376         if ( ! b->yy_ch_buf )
01377                 YY_FATAL_ERROR( "out of dynamic memory in pktloc__create_buffer()" );
01378 
01379         b->yy_is_our_buffer = 1;
01380 
01381         pktloc__init_buffer(b,file ,yyscanner);
01382 
01383         return b;
01384 }
01385 
01386 /** Destroy the buffer.
01387  * @param b a buffer created with pktloc__create_buffer()
01388  * @param yyscanner The scanner object.
01389  */
01390     void pktloc__delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
01391 {
01392     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01393 
01394         if ( ! b )
01395                 return;
01396 
01397         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
01398                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
01399 
01400         if ( b->yy_is_our_buffer )
01401                 pktloc_free((void *) b->yy_ch_buf ,yyscanner );
01402 
01403         pktloc_free((void *) b ,yyscanner );
01404 }
01405 
01406 #ifndef __cplusplus
01407 extern int isatty (int );
01408 #endif /* __cplusplus */
01409     
01410 /* Initializes or reinitializes a buffer.
01411  * This function is sometimes called more than once on the same buffer,
01412  * such as during a pktloc_restart() or at EOF.
01413  */
01414     static void pktloc__init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
01415 
01416 {
01417         int oerrno = errno;
01418     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01419 
01420         pktloc__flush_buffer(b ,yyscanner);
01421 
01422         b->yy_input_file = file;
01423         b->yy_fill_buffer = 1;
01424 
01425     /* If b is the current buffer, then pktloc__init_buffer was _probably_
01426      * called from pktloc_restart() or through yy_get_next_buffer.
01427      * In that case, we don't want to reset the lineno or column.
01428      */
01429     if (b != YY_CURRENT_BUFFER){
01430         b->yy_bs_lineno = 1;
01431         b->yy_bs_column = 0;
01432     }
01433 
01434         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
01435     
01436         errno = oerrno;
01437 }
01438 
01439 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
01440  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
01441  * @param yyscanner The scanner object.
01442  */
01443     void pktloc__flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
01444 {
01445     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01446         if ( ! b )
01447                 return;
01448 
01449         b->yy_n_chars = 0;
01450 
01451         /* We always need two end-of-buffer characters.  The first causes
01452          * a transition to the end-of-buffer state.  The second causes
01453          * a jam in that state.
01454          */
01455         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
01456         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
01457 
01458         b->yy_buf_pos = &b->yy_ch_buf[0];
01459 
01460         b->yy_at_bol = 1;
01461         b->yy_buffer_status = YY_BUFFER_NEW;
01462 
01463         if ( b == YY_CURRENT_BUFFER )
01464                 pktloc__load_buffer_state(yyscanner );
01465 }
01466 
01467 /** Pushes the new state onto the stack. The new state becomes
01468  *  the current state. This function will allocate the stack
01469  *  if necessary.
01470  *  @param new_buffer The new state.
01471  *  @param yyscanner The scanner object.
01472  */
01473 void pktloc_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
01474 {
01475     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01476         if (new_buffer == NULL)
01477                 return;
01478 
01479         pktloc_ensure_buffer_stack(yyscanner);
01480 
01481         /* This block is copied from pktloc__switch_to_buffer. */
01482         if ( YY_CURRENT_BUFFER )
01483                 {
01484                 /* Flush out information for old buffer. */
01485                 *yyg->yy_c_buf_p = yyg->yy_hold_char;
01486                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
01487                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
01488                 }
01489 
01490         /* Only push if top exists. Otherwise, replace top. */
01491         if (YY_CURRENT_BUFFER)
01492                 yyg->yy_buffer_stack_top++;
01493         YY_CURRENT_BUFFER_LVALUE = new_buffer;
01494 
01495         /* copied from pktloc__switch_to_buffer. */
01496         pktloc__load_buffer_state(yyscanner );
01497         yyg->yy_did_buffer_switch_on_eof = 1;
01498 }
01499 
01500 /** Removes and deletes the top of the stack, if present.
01501  *  The next element becomes the new top.
01502  *  @param yyscanner The scanner object.
01503  */
01504 void pktloc_pop_buffer_state (yyscan_t yyscanner)
01505 {
01506     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01507         if (!YY_CURRENT_BUFFER)
01508                 return;
01509 
01510         pktloc__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
01511         YY_CURRENT_BUFFER_LVALUE = NULL;
01512         if (yyg->yy_buffer_stack_top > 0)
01513                 --yyg->yy_buffer_stack_top;
01514 
01515         if (YY_CURRENT_BUFFER) {
01516                 pktloc__load_buffer_state(yyscanner );
01517                 yyg->yy_did_buffer_switch_on_eof = 1;
01518         }
01519 }
01520 
01521 /* Allocates the stack if it does not exist.
01522  *  Guarantees space for at least one push.
01523  */
01524 static void pktloc_ensure_buffer_stack (yyscan_t yyscanner)
01525 {
01526         int num_to_alloc;
01527     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01528 
01529         if (!yyg->yy_buffer_stack) {
01530 
01531                 /* First allocation is just for 2 elements, since we don't know if this
01532                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
01533                  * immediate realloc on the next call.
01534          */
01535                 num_to_alloc = 1;
01536                 yyg->yy_buffer_stack = (struct yy_buffer_state**)pktloc_alloc
01537                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
01538                                                                 , yyscanner);
01539                 if ( ! yyg->yy_buffer_stack )
01540                         YY_FATAL_ERROR( "out of dynamic memory in pktloc_ensure_buffer_stack()" );
01541                                                                   
01542                 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
01543                                 
01544                 yyg->yy_buffer_stack_max = num_to_alloc;
01545                 yyg->yy_buffer_stack_top = 0;
01546                 return;
01547         }
01548 
01549         if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
01550 
01551                 /* Increase the buffer to prepare for a possible push. */
01552                 int grow_size = 8 /* arbitrary grow size */;
01553 
01554                 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
01555                 yyg->yy_buffer_stack = (struct yy_buffer_state**)pktloc_realloc
01556                                                                 (yyg->yy_buffer_stack,
01557                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
01558                                                                 , yyscanner);
01559                 if ( ! yyg->yy_buffer_stack )
01560                         YY_FATAL_ERROR( "out of dynamic memory in pktloc_ensure_buffer_stack()" );
01561 
01562                 /* zero only the new slots.*/
01563                 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
01564                 yyg->yy_buffer_stack_max = num_to_alloc;
01565         }
01566 }
01567 
01568 /** Setup the input buffer state to scan directly from a user-specified character buffer.
01569  * @param base the character buffer
01570  * @param size the size in bytes of the character buffer
01571  * @param yyscanner The scanner object.
01572  * @return the newly allocated buffer state object. 
01573  */
01574 YY_BUFFER_STATE pktloc__scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
01575 {
01576         YY_BUFFER_STATE b;
01577     
01578         if ( size < 2 ||
01579              base[size-2] != YY_END_OF_BUFFER_CHAR ||
01580              base[size-1] != YY_END_OF_BUFFER_CHAR )
01581                 /* They forgot to leave room for the EOB's. */
01582                 return 0;
01583 
01584         b = (YY_BUFFER_STATE) pktloc_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
01585         if ( ! b )
01586                 YY_FATAL_ERROR( "out of dynamic memory in pktloc__scan_buffer()" );
01587 
01588         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
01589         b->yy_buf_pos = b->yy_ch_buf = base;
01590         b->yy_is_our_buffer = 0;
01591         b->yy_input_file = 0;
01592         b->yy_n_chars = b->yy_buf_size;
01593         b->yy_is_interactive = 0;
01594         b->yy_at_bol = 1;
01595         b->yy_fill_buffer = 0;
01596         b->yy_buffer_status = YY_BUFFER_NEW;
01597 
01598         pktloc__switch_to_buffer(b ,yyscanner );
01599 
01600         return b;
01601 }
01602 
01603 /** Setup the input buffer state to scan a string. The next call to pktloc_lex() will
01604  * scan from a @e copy of @a str.
01605  * @param yystr a NUL-terminated string to scan
01606  * @param yyscanner The scanner object.
01607  * @return the newly allocated buffer state object.
01608  * @note If you want to scan bytes that may contain NUL values, then use
01609  *       pktloc__scan_bytes() instead.
01610  */
01611 YY_BUFFER_STATE pktloc__scan_string (yyconst char * yystr , yyscan_t yyscanner)
01612 {
01613     
01614         return pktloc__scan_bytes(yystr,strlen(yystr) ,yyscanner);
01615 }
01616 
01617 /** Setup the input buffer state to scan the given bytes. The next call to pktloc_lex() will
01618  * scan from a @e copy of @a bytes.
01619  * @param bytes the byte buffer to scan
01620  * @param len the number of bytes in the buffer pointed to by @a bytes.
01621  * @param yyscanner The scanner object.
01622  * @return the newly allocated buffer state object.
01623  */
01624 YY_BUFFER_STATE pktloc__scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
01625 {
01626         YY_BUFFER_STATE b;
01627         char *buf;
01628         yy_size_t n;
01629         int i;
01630     
01631         /* Get memory for full buffer, including space for trailing EOB's. */
01632         n = _yybytes_len + 2;
01633         buf = (char *) pktloc_alloc(n ,yyscanner );
01634         if ( ! buf )
01635                 YY_FATAL_ERROR( "out of dynamic memory in pktloc__scan_bytes()" );
01636 
01637         for ( i = 0; i < _yybytes_len; ++i )
01638                 buf[i] = yybytes[i];
01639 
01640         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
01641 
01642         b = pktloc__scan_buffer(buf,n ,yyscanner);
01643         if ( ! b )
01644                 YY_FATAL_ERROR( "bad buffer in pktloc__scan_bytes()" );
01645 
01646         /* It's okay to grow etc. this buffer, and we should throw it
01647          * away when we're done.
01648          */
01649         b->yy_is_our_buffer = 1;
01650 
01651         return b;
01652 }
01653 
01654 #ifndef YY_EXIT_FAILURE
01655 #define YY_EXIT_FAILURE 2
01656 #endif
01657 
01658 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
01659 {
01660         (void) fprintf( stderr, "%s\n", msg );
01661         exit( YY_EXIT_FAILURE );
01662 }
01663 
01664 /* Redefine yyless() so it works in section 3 code. */
01665 
01666 #undef yyless
01667 #define yyless(n) \
01668         do \
01669                 { \
01670                 /* Undo effects of setting up yytext. */ \
01671         int yyless_macro_arg = (n); \
01672         YY_LESS_LINENO(yyless_macro_arg);\
01673                 yytext[yyleng] = yyg->yy_hold_char; \
01674                 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
01675                 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
01676                 *yyg->yy_c_buf_p = '\0'; \
01677                 yyleng = yyless_macro_arg; \
01678                 } \
01679         while ( 0 )
01680 
01681 /* Accessor  methods (get/set functions) to struct members. */
01682 
01683 /** Get the user-defined data for this scanner.
01684  * @param yyscanner The scanner object.
01685  */
01686 YY_EXTRA_TYPE pktloc_get_extra  (yyscan_t yyscanner)
01687 {
01688     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01689     return yyextra;
01690 }
01691 
01692 /** Get the current line number.
01693  * @param yyscanner The scanner object.
01694  */
01695 int pktloc_get_lineno  (yyscan_t yyscanner)
01696 {
01697     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01698     
01699         if (! YY_CURRENT_BUFFER)
01700             return 0;
01701     
01702     return yylineno;
01703 }
01704 
01705 /** Get the current column number.
01706  * @param yyscanner The scanner object.
01707  */
01708 int pktloc_get_column  (yyscan_t yyscanner)
01709 {
01710     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01711     
01712         if (! YY_CURRENT_BUFFER)
01713             return 0;
01714     
01715     return yycolumn;
01716 }
01717 
01718 /** Get the input stream.
01719  * @param yyscanner The scanner object.
01720  */
01721 FILE *pktloc_get_in  (yyscan_t yyscanner)
01722 {
01723     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01724     return yyin;
01725 }
01726 
01727 /** Get the output stream.
01728  * @param yyscanner The scanner object.
01729  */
01730 FILE *pktloc_get_out  (yyscan_t yyscanner)
01731 {
01732     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01733     return yyout;
01734 }
01735 
01736 /** Get the length of the current token.
01737  * @param yyscanner The scanner object.
01738  */
01739 int pktloc_get_leng  (yyscan_t yyscanner)
01740 {
01741     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01742     return yyleng;
01743 }
01744 
01745 /** Get the current token.
01746  * @param yyscanner The scanner object.
01747  */
01748 
01749 char *pktloc_get_text  (yyscan_t yyscanner)
01750 {
01751     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01752     return yytext;
01753 }
01754 
01755 /** Set the user-defined data. This data is never touched by the scanner.
01756  * @param user_defined The data to be associated with this scanner.
01757  * @param yyscanner The scanner object.
01758  */
01759 void pktloc_set_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
01760 {
01761     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01762     yyextra = user_defined ;
01763 }
01764 
01765 /** Set the current line number.
01766  * @param line_number
01767  * @param yyscanner The scanner object.
01768  */
01769 void pktloc_set_lineno (int  line_number , yyscan_t yyscanner)
01770 {
01771     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01772 
01773         /* lineno is only valid if an input buffer exists. */
01774         if (! YY_CURRENT_BUFFER )
01775            yy_fatal_error( "pktloc_set_lineno called with no buffer" , yyscanner); 
01776     
01777     yylineno = line_number;
01778 }
01779 
01780 /** Set the current column.
01781  * @param line_number
01782  * @param yyscanner The scanner object.
01783  */
01784 void pktloc_set_column (int  column_no , yyscan_t yyscanner)
01785 {
01786     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01787 
01788         /* column is only valid if an input buffer exists. */
01789         if (! YY_CURRENT_BUFFER )
01790            yy_fatal_error( "pktloc_set_column called with no buffer" , yyscanner); 
01791     
01792     yycolumn = column_no;
01793 }
01794 
01795 /** Set the input stream. This does not discard the current
01796  * input buffer.
01797  * @param in_str A readable stream.
01798  * @param yyscanner The scanner object.
01799  * @see pktloc__switch_to_buffer
01800  */
01801 void pktloc_set_in (FILE *  in_str , yyscan_t yyscanner)
01802 {
01803     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01804     yyin = in_str ;
01805 }
01806 
01807 void pktloc_set_out (FILE *  out_str , yyscan_t yyscanner)
01808 {
01809     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01810     yyout = out_str ;
01811 }
01812 
01813 int pktloc_get_debug  (yyscan_t yyscanner)
01814 {
01815     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01816     return yy_flex_debug;
01817 }
01818 
01819 void pktloc_set_debug (int  bdebug , yyscan_t yyscanner)
01820 {
01821     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01822     yy_flex_debug = bdebug ;
01823 }
01824 
01825 /* Accessor methods for yylval and yylloc */
01826 
01827 YYSTYPE * pktloc_get_lval  (yyscan_t yyscanner)
01828 {
01829     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01830     return yylval;
01831 }
01832 
01833 void pktloc_set_lval (YYSTYPE *  yylval_param , yyscan_t yyscanner)
01834 {
01835     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01836     yylval = yylval_param;
01837 }
01838 
01839 YYLTYPE *pktloc_get_lloc  (yyscan_t yyscanner)
01840 {
01841     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01842     return yylloc;
01843 }
01844     
01845 void pktloc_set_lloc (YYLTYPE *  yylloc_param , yyscan_t yyscanner)
01846 {
01847     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01848     yylloc = yylloc_param;
01849 }
01850     
01851 /* User-visible API */
01852 
01853 /* pktloc_lex_init is special because it creates the scanner itself, so it is
01854  * the ONLY reentrant function that doesn't take the scanner as the last argument.
01855  * That's why we explicitly handle the declaration, instead of using our macros.
01856  */
01857 
01858 int pktloc_lex_init(yyscan_t* ptr_yy_globals)
01859 
01860 {
01861     if (ptr_yy_globals == NULL){
01862         errno = EINVAL;
01863         return 1;
01864     }
01865 
01866     *ptr_yy_globals = (yyscan_t) pktloc_alloc ( sizeof( struct yyguts_t ), NULL );
01867 
01868     if (*ptr_yy_globals == NULL){
01869         errno = ENOMEM;
01870         return 1;
01871     }
01872 
01873     /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
01874     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
01875 
01876     return yy_init_globals ( *ptr_yy_globals );
01877 }
01878 
01879 /* pktloc_lex_init_extra has the same functionality as pktloc_lex_init, but follows the
01880  * convention of taking the scanner as the last argument. Note however, that
01881  * this is a *pointer* to a scanner, as it will be allocated by this call (and
01882  * is the reason, too, why this function also must handle its own declaration).
01883  * The user defined value in the first argument will be available to pktloc_alloc in
01884  * the yyextra field.
01885  */
01886 
01887 int pktloc_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
01888 
01889 {
01890     struct yyguts_t dummy_yyguts;
01891 
01892     pktloc_set_extra (yy_user_defined, &dummy_yyguts);
01893 
01894     if (ptr_yy_globals == NULL){
01895         errno = EINVAL;
01896         return 1;
01897     }
01898         
01899     *ptr_yy_globals = (yyscan_t) pktloc_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
01900         
01901     if (*ptr_yy_globals == NULL){
01902         errno = ENOMEM;
01903         return 1;
01904     }
01905     
01906     /* By setting to 0xAA, we expose bugs in
01907     yy_init_globals. Leave at 0x00 for releases. */
01908     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
01909     
01910     pktloc_set_extra (yy_user_defined, *ptr_yy_globals);
01911     
01912     return yy_init_globals ( *ptr_yy_globals );
01913 }
01914 
01915 static int yy_init_globals (yyscan_t yyscanner)
01916 {
01917     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01918     /* Initialization is the same as for the non-reentrant scanner.
01919      * This function is called from pktloc_lex_destroy(), so don't allocate here.
01920      */
01921 
01922     yyg->yy_buffer_stack = 0;
01923     yyg->yy_buffer_stack_top = 0;
01924     yyg->yy_buffer_stack_max = 0;
01925     yyg->yy_c_buf_p = (char *) 0;
01926     yyg->yy_init = 0;
01927     yyg->yy_start = 0;
01928 
01929     yyg->yy_start_stack_ptr = 0;
01930     yyg->yy_start_stack_depth = 0;
01931     yyg->yy_start_stack =  NULL;
01932 
01933 /* Defined in main.c */
01934 #ifdef YY_STDINIT
01935     yyin = stdin;
01936     yyout = stdout;
01937 #else
01938     yyin = (FILE *) 0;
01939     yyout = (FILE *) 0;
01940 #endif
01941 
01942     /* For future reference: Set errno on error, since we are called by
01943      * pktloc_lex_init()
01944      */
01945     return 0;
01946 }
01947 
01948 /* pktloc_lex_destroy is for both reentrant and non-reentrant scanners. */
01949 int pktloc_lex_destroy  (yyscan_t yyscanner)
01950 {
01951     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
01952 
01953     /* Pop the buffer stack, destroying each element. */
01954         while(YY_CURRENT_BUFFER){
01955                 pktloc__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
01956                 YY_CURRENT_BUFFER_LVALUE = NULL;
01957                 pktloc_pop_buffer_state(yyscanner);
01958         }
01959 
01960         /* Destroy the stack itself. */
01961         pktloc_free(yyg->yy_buffer_stack ,yyscanner);
01962         yyg->yy_buffer_stack = NULL;
01963 
01964     /* Destroy the start condition stack. */
01965         pktloc_free(yyg->yy_start_stack ,yyscanner );
01966         yyg->yy_start_stack = NULL;
01967 
01968     /* Reset the globals. This is important in a non-reentrant scanner so the next time
01969      * pktloc_lex() is called, initialization will occur. */
01970     yy_init_globals( yyscanner);
01971 
01972     /* Destroy the main struct (reentrant only). */
01973     pktloc_free ( yyscanner , yyscanner );
01974     yyscanner = NULL;
01975     return 0;
01976 }
01977 
01978 /*
01979  * Internal utility routines.
01980  */
01981 
01982 #ifndef yytext_ptr
01983 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
01984 {
01985         register int i;
01986         for ( i = 0; i < n; ++i )
01987                 s1[i] = s2[i];
01988 }
01989 #endif
01990 
01991 #ifdef YY_NEED_STRLEN
01992 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
01993 {
01994         register int n;
01995         for ( n = 0; s[n]; ++n )
01996                 ;
01997 
01998         return n;
01999 }
02000 #endif
02001 
02002 void *pktloc_alloc (yy_size_t  size , yyscan_t yyscanner)
02003 {
02004         return (void *) malloc( size );
02005 }
02006 
02007 void *pktloc_realloc  (void * ptr, yy_size_t  size , yyscan_t yyscanner)
02008 {
02009         /* The cast to (char *) in the following accommodates both
02010          * implementations that use char* generic pointers, and those
02011          * that use void* generic pointers.  It works with the latter
02012          * because both ANSI C and C++ allow castless assignment from
02013          * any pointer type to void*, and deal with argument conversions
02014          * as though doing an assignment.
02015          */
02016         return (void *) realloc( (char *) ptr, size );
02017 }
02018 
02019 void pktloc_free (void * ptr , yyscan_t yyscanner)
02020 {
02021         free( (char *) ptr );   /* see pktloc_realloc() for (char *) cast */
02022 }
02023 
02024 #define YYTABLES_NAME "yytables"
02025 
02026 #line 52 "route/pktloc_grammar.l"