Coverage Report

Created: 2026-03-30 07:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/work/build/epan/uat_load.c
Line
Count
Source
1
#line 2 "/work/build/epan/uat_load.c"
2
/* Include this before everything else, for various large-file definitions */
3
#include "config.h"
4
0
#define WS_LOG_DOMAIN LOG_DOMAIN_UAT
5
6
#include <wireshark.h>
7
8
/* #define DEBUG_UAT_LOAD 1 */
9
10
#line 11 "/work/build/epan/uat_load.c"
11
12
#define  YY_INT_ALIGNED short int
13
14
/* A lexical scanner generated by flex */
15
16
/* %not-for-header */
17
/* %if-c-only */
18
/* %if-not-reentrant */
19
/* %endif */
20
/* %endif */
21
/* %ok-for-header */
22
23
#define FLEX_SCANNER
24
#define YY_FLEX_MAJOR_VERSION 2
25
#define YY_FLEX_MINOR_VERSION 6
26
#define YY_FLEX_SUBMINOR_VERSION 4
27
#if YY_FLEX_SUBMINOR_VERSION > 0
28
#define FLEX_BETA
29
#endif
30
31
/* %if-c++-only */
32
/* %endif */
33
34
/* %if-c-only */
35
#ifdef yy_create_buffer
36
#define uat_load__create_buffer_ALREADY_DEFINED
37
#else
38
0
#define yy_create_buffer uat_load__create_buffer
39
#endif
40
41
#ifdef yy_delete_buffer
42
#define uat_load__delete_buffer_ALREADY_DEFINED
43
#else
44
0
#define yy_delete_buffer uat_load__delete_buffer
45
#endif
46
47
#ifdef yy_scan_buffer
48
#define uat_load__scan_buffer_ALREADY_DEFINED
49
#else
50
0
#define yy_scan_buffer uat_load__scan_buffer
51
#endif
52
53
#ifdef yy_scan_string
54
#define uat_load__scan_string_ALREADY_DEFINED
55
#else
56
#define yy_scan_string uat_load__scan_string
57
#endif
58
59
#ifdef yy_scan_bytes
60
#define uat_load__scan_bytes_ALREADY_DEFINED
61
#else
62
0
#define yy_scan_bytes uat_load__scan_bytes
63
#endif
64
65
#ifdef yy_init_buffer
66
#define uat_load__init_buffer_ALREADY_DEFINED
67
#else
68
0
#define yy_init_buffer uat_load__init_buffer
69
#endif
70
71
#ifdef yy_flush_buffer
72
#define uat_load__flush_buffer_ALREADY_DEFINED
73
#else
74
0
#define yy_flush_buffer uat_load__flush_buffer
75
#endif
76
77
#ifdef yy_load_buffer_state
78
#define uat_load__load_buffer_state_ALREADY_DEFINED
79
#else
80
0
#define yy_load_buffer_state uat_load__load_buffer_state
81
#endif
82
83
#ifdef yy_switch_to_buffer
84
#define uat_load__switch_to_buffer_ALREADY_DEFINED
85
#else
86
0
#define yy_switch_to_buffer uat_load__switch_to_buffer
87
#endif
88
89
#ifdef yypush_buffer_state
90
#define uat_load_push_buffer_state_ALREADY_DEFINED
91
#else
92
#define yypush_buffer_state uat_load_push_buffer_state
93
#endif
94
95
#ifdef yypop_buffer_state
96
#define uat_load_pop_buffer_state_ALREADY_DEFINED
97
#else
98
0
#define yypop_buffer_state uat_load_pop_buffer_state
99
#endif
100
101
#ifdef yyensure_buffer_stack
102
#define uat_load_ensure_buffer_stack_ALREADY_DEFINED
103
#else
104
0
#define yyensure_buffer_stack uat_load_ensure_buffer_stack
105
#endif
106
107
#ifdef yylex
108
#define uat_load_lex_ALREADY_DEFINED
109
#else
110
#define yylex uat_load_lex
111
#endif
112
113
#ifdef yyrestart
114
#define uat_load_restart_ALREADY_DEFINED
115
#else
116
0
#define yyrestart uat_load_restart
117
#endif
118
119
#ifdef yylex_init
120
#define uat_load_lex_init_ALREADY_DEFINED
121
#else
122
#define yylex_init uat_load_lex_init
123
#endif
124
125
#ifdef yylex_init_extra
126
#define uat_load_lex_init_extra_ALREADY_DEFINED
127
#else
128
#define yylex_init_extra uat_load_lex_init_extra
129
#endif
130
131
#ifdef yylex_destroy
132
#define uat_load_lex_destroy_ALREADY_DEFINED
133
#else
134
#define yylex_destroy uat_load_lex_destroy
135
#endif
136
137
#ifdef yyget_debug
138
#define uat_load_get_debug_ALREADY_DEFINED
139
#else
140
#define yyget_debug uat_load_get_debug
141
#endif
142
143
#ifdef yyset_debug
144
#define uat_load_set_debug_ALREADY_DEFINED
145
#else
146
#define yyset_debug uat_load_set_debug
147
#endif
148
149
#ifdef yyget_extra
150
#define uat_load_get_extra_ALREADY_DEFINED
151
#else
152
#define yyget_extra uat_load_get_extra
153
#endif
154
155
#ifdef yyset_extra
156
#define uat_load_set_extra_ALREADY_DEFINED
157
#else
158
0
#define yyset_extra uat_load_set_extra
159
#endif
160
161
#ifdef yyget_in
162
#define uat_load_get_in_ALREADY_DEFINED
163
#else
164
#define yyget_in uat_load_get_in
165
#endif
166
167
#ifdef yyset_in
168
#define uat_load_set_in_ALREADY_DEFINED
169
#else
170
#define yyset_in uat_load_set_in
171
#endif
172
173
#ifdef yyget_out
174
#define uat_load_get_out_ALREADY_DEFINED
175
#else
176
#define yyget_out uat_load_get_out
177
#endif
178
179
#ifdef yyset_out
180
#define uat_load_set_out_ALREADY_DEFINED
181
#else
182
#define yyset_out uat_load_set_out
183
#endif
184
185
#ifdef yyget_leng
186
#define uat_load_get_leng_ALREADY_DEFINED
187
#else
188
#define yyget_leng uat_load_get_leng
189
#endif
190
191
#ifdef yyget_text
192
#define uat_load_get_text_ALREADY_DEFINED
193
#else
194
#define yyget_text uat_load_get_text
195
#endif
196
197
#ifdef yyget_lineno
198
#define uat_load_get_lineno_ALREADY_DEFINED
199
#else
200
#define yyget_lineno uat_load_get_lineno
201
#endif
202
203
#ifdef yyset_lineno
204
#define uat_load_set_lineno_ALREADY_DEFINED
205
#else
206
#define yyset_lineno uat_load_set_lineno
207
#endif
208
209
#ifdef yyget_column
210
#define uat_load_get_column_ALREADY_DEFINED
211
#else
212
#define yyget_column uat_load_get_column
213
#endif
214
215
#ifdef yyset_column
216
#define uat_load_set_column_ALREADY_DEFINED
217
#else
218
#define yyset_column uat_load_set_column
219
#endif
220
221
#ifdef yywrap
222
#define uat_load_wrap_ALREADY_DEFINED
223
#else
224
0
#define yywrap uat_load_wrap
225
#endif
226
227
/* %endif */
228
229
#ifdef yyalloc
230
#define uat_load_alloc_ALREADY_DEFINED
231
#else
232
0
#define yyalloc uat_load_alloc
233
#endif
234
235
#ifdef yyrealloc
236
#define uat_load_realloc_ALREADY_DEFINED
237
#else
238
0
#define yyrealloc uat_load_realloc
239
#endif
240
241
#ifdef yyfree
242
#define uat_load_free_ALREADY_DEFINED
243
#else
244
0
#define yyfree uat_load_free
245
#endif
246
247
/* %if-c-only */
248
249
/* %endif */
250
251
/* First, we deal with  platform-specific or compiler-specific issues. */
252
253
/* begin standard C headers. */
254
/* %if-c-only */
255
#include <stdio.h>
256
#include <string.h>
257
#include <errno.h>
258
#include <stdlib.h>
259
/* %endif */
260
261
/* %if-tables-serialization */
262
/* %endif */
263
/* end standard C headers. */
264
265
/* %if-c-or-c++ */
266
/* flex integer type definitions */
267
268
#ifndef FLEXINT_H
269
#define FLEXINT_H
270
271
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
272
273
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
274
275
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
276
 * if you want the limit (max/min) macros for int types. 
277
 */
278
#ifndef __STDC_LIMIT_MACROS
279
#define __STDC_LIMIT_MACROS 1
280
#endif
281
282
#include <inttypes.h>
283
typedef int8_t flex_int8_t;
284
typedef uint8_t flex_uint8_t;
285
typedef int16_t flex_int16_t;
286
typedef uint16_t flex_uint16_t;
287
typedef int32_t flex_int32_t;
288
typedef uint32_t flex_uint32_t;
289
#else
290
typedef signed char flex_int8_t;
291
typedef short int flex_int16_t;
292
typedef int flex_int32_t;
293
typedef unsigned char flex_uint8_t; 
294
typedef unsigned short int flex_uint16_t;
295
typedef unsigned int flex_uint32_t;
296
297
/* Limits of integral types. */
298
#ifndef INT8_MIN
299
#define INT8_MIN               (-128)
300
#endif
301
#ifndef INT16_MIN
302
#define INT16_MIN              (-32767-1)
303
#endif
304
#ifndef INT32_MIN
305
#define INT32_MIN              (-2147483647-1)
306
#endif
307
#ifndef INT8_MAX
308
#define INT8_MAX               (127)
309
#endif
310
#ifndef INT16_MAX
311
#define INT16_MAX              (32767)
312
#endif
313
#ifndef INT32_MAX
314
#define INT32_MAX              (2147483647)
315
#endif
316
#ifndef UINT8_MAX
317
#define UINT8_MAX              (255U)
318
#endif
319
#ifndef UINT16_MAX
320
#define UINT16_MAX             (65535U)
321
#endif
322
#ifndef UINT32_MAX
323
#define UINT32_MAX             (4294967295U)
324
#endif
325
326
#ifndef SIZE_MAX
327
#define SIZE_MAX               (~(size_t)0)
328
#endif
329
330
#endif /* ! C99 */
331
332
#endif /* ! FLEXINT_H */
333
334
/* %endif */
335
336
/* begin standard C++ headers. */
337
/* %if-c++-only */
338
/* %endif */
339
340
/* TODO: this is always defined, so inline it */
341
#define yyconst const
342
343
#if defined(__GNUC__) && __GNUC__ >= 3
344
#define yynoreturn __attribute__((__noreturn__))
345
#else
346
#define yynoreturn
347
#endif
348
349
/* %not-for-header */
350
/* Returned upon end-of-file. */
351
0
#define YY_NULL 0
352
/* %ok-for-header */
353
354
/* %not-for-header */
355
/* Promotes a possibly negative, possibly signed char to an
356
 *   integer in range [0..255] for use as an array index.
357
 */
358
0
#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
359
/* %ok-for-header */
360
361
/* %if-reentrant */
362
363
/* An opaque pointer. */
364
#ifndef YY_TYPEDEF_YY_SCANNER_T
365
#define YY_TYPEDEF_YY_SCANNER_T
366
typedef void* yyscan_t;
367
#endif
368
369
/* For convenience, these vars (plus the bison vars far below)
370
   are macros in the reentrant scanner. */
371
0
#define yyin yyg->yyin_r
372
0
#define yyout yyg->yyout_r
373
0
#define yyextra yyg->yyextra_r
374
0
#define yyleng yyg->yyleng_r
375
0
#define yytext yyg->yytext_r
376
0
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
377
0
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
378
0
#define yy_flex_debug yyg->yy_flex_debug_r
379
380
/* %endif */
381
382
/* %if-not-reentrant */
383
/* %endif */
384
385
/* Enter a start condition.  This macro really ought to take a parameter,
386
 * but we do it the disgusting crufty way forced on us by the ()-less
387
 * definition of BEGIN.
388
 */
389
0
#define BEGIN yyg->yy_start = 1 + 2 *
390
/* Translate the current start state into a value that can be later handed
391
 * to BEGIN to return to the state.  The YYSTATE alias is for lex
392
 * compatibility.
393
 */
394
#define YY_START ((yyg->yy_start - 1) / 2)
395
#define YYSTATE YY_START
396
/* Action number for EOF rule of a given start state. */
397
0
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
398
/* Special action meaning "start processing a new file". */
399
0
#define YY_NEW_FILE yyrestart( yyin , yyscanner )
400
0
#define YY_END_OF_BUFFER_CHAR 0
401
402
/* Size of default input buffer. */
403
#ifndef YY_BUF_SIZE
404
#ifdef __ia64__
405
/* On IA-64, the buffer size is 16k, not 8k.
406
 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
407
 * Ditto for the __ia64__ case accordingly.
408
 */
409
#define YY_BUF_SIZE 32768
410
#else
411
0
#define YY_BUF_SIZE 16384
412
#endif /* __ia64__ */
413
#endif
414
415
/* The state buf must be large enough to hold one state per character in the main buffer.
416
 */
417
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
418
419
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
420
#define YY_TYPEDEF_YY_BUFFER_STATE
421
typedef struct yy_buffer_state *YY_BUFFER_STATE;
422
#endif
423
424
#ifndef YY_TYPEDEF_YY_SIZE_T
425
#define YY_TYPEDEF_YY_SIZE_T
426
typedef size_t yy_size_t;
427
#endif
428
429
/* %if-not-reentrant */
430
/* %endif */
431
432
/* %if-c-only */
433
/* %if-not-reentrant */
434
/* %endif */
435
/* %endif */
436
437
0
#define EOB_ACT_CONTINUE_SCAN 0
438
0
#define EOB_ACT_END_OF_FILE 1
439
0
#define EOB_ACT_LAST_MATCH 2
440
    
441
    #define YY_LESS_LINENO(n)
442
    #define YY_LINENO_REWIND_TO(ptr)
443
    
444
/* Return all but the first "n" matched characters back to the input stream. */
445
#define yyless(n) \
446
0
  do \
447
0
    { \
448
0
    /* Undo effects of setting up yytext. */ \
449
0
        int yyless_macro_arg = (n); \
450
0
        YY_LESS_LINENO(yyless_macro_arg);\
451
0
    *yy_cp = yyg->yy_hold_char; \
452
0
    YY_RESTORE_YY_MORE_OFFSET \
453
0
    yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
454
0
    YY_DO_BEFORE_ACTION; /* set up yytext again */ \
455
0
    } \
456
0
  while ( 0 )
457
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
458
459
#ifndef YY_STRUCT_YY_BUFFER_STATE
460
#define YY_STRUCT_YY_BUFFER_STATE
461
struct yy_buffer_state
462
  {
463
/* %if-c-only */
464
  FILE *yy_input_file;
465
/* %endif */
466
467
/* %if-c++-only */
468
/* %endif */
469
470
  char *yy_ch_buf;    /* input buffer */
471
  char *yy_buf_pos;   /* current position in input buffer */
472
473
  /* Size of input buffer in bytes, not including room for EOB
474
   * characters.
475
   */
476
  int yy_buf_size;
477
478
  /* Number of characters read into yy_ch_buf, not including EOB
479
   * characters.
480
   */
481
  int yy_n_chars;
482
483
  /* Whether we "own" the buffer - i.e., we know we created it,
484
   * and can realloc() it to grow it, and should free() it to
485
   * delete it.
486
   */
487
  int yy_is_our_buffer;
488
489
  /* Whether this is an "interactive" input source; if so, and
490
   * if we're using stdio for input, then we want to use getc()
491
   * instead of fread(), to make sure we stop fetching input after
492
   * each newline.
493
   */
494
  int yy_is_interactive;
495
496
  /* Whether we're considered to be at the beginning of a line.
497
   * If so, '^' rules will be active on the next match, otherwise
498
   * not.
499
   */
500
  int yy_at_bol;
501
502
    int yy_bs_lineno; /**< The line count. */
503
    int yy_bs_column; /**< The column count. */
504
505
  /* Whether to try to fill the input buffer when we reach the
506
   * end of it.
507
   */
508
  int yy_fill_buffer;
509
510
  int yy_buffer_status;
511
512
0
#define YY_BUFFER_NEW 0
513
0
#define YY_BUFFER_NORMAL 1
514
  /* When an EOF's been seen but there's still some text to process
515
   * then we mark the buffer as YY_EOF_PENDING, to indicate that we
516
   * shouldn't try reading from the input source any more.  We might
517
   * still have a bunch of tokens to match, though, because of
518
   * possible backing-up.
519
   *
520
   * When we actually see the EOF, we change the status to "new"
521
   * (via yyrestart()), so that the user can continue scanning by
522
   * just pointing yyin at a new input file.
523
   */
524
0
#define YY_BUFFER_EOF_PENDING 2
525
526
  };
527
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
528
529
/* %if-c-only Standard (non-C++) definition */
530
/* %not-for-header */
531
/* %if-not-reentrant */
532
/* %endif */
533
/* %ok-for-header */
534
535
/* %endif */
536
537
/* We provide macros for accessing buffer states in case in the
538
 * future we want to put the buffer states in a more general
539
 * "scanner state".
540
 *
541
 * Returns the top of the stack, or NULL.
542
 */
543
0
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
544
0
                          ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
545
0
                          : NULL)
546
/* Same as previous macro, but useful when we know that the buffer stack is not
547
 * NULL or when we need an lvalue. For internal use only.
548
 */
549
0
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
550
551
/* %if-c-only Standard (non-C++) definition */
552
553
/* %if-not-reentrant */
554
/* %not-for-header */
555
/* %ok-for-header */
556
557
/* %endif */
558
559
void yyrestart ( FILE *input_file , yyscan_t yyscanner );
560
void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
561
YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
562
void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
563
void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
564
void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
565
void yypop_buffer_state ( yyscan_t yyscanner );
566
567
static void yyensure_buffer_stack ( yyscan_t yyscanner );
568
static void yy_load_buffer_state ( yyscan_t yyscanner );
569
static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
570
#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
571
572
YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
573
YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
574
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
575
576
/* %endif */
577
578
void *yyalloc ( yy_size_t , yyscan_t yyscanner );
579
void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
580
void yyfree ( void * , yyscan_t yyscanner );
581
582
#define yy_new_buffer yy_create_buffer
583
#define yy_set_interactive(is_interactive) \
584
  { \
585
  if ( ! YY_CURRENT_BUFFER ){ \
586
        yyensure_buffer_stack (yyscanner); \
587
    YY_CURRENT_BUFFER_LVALUE =    \
588
            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
589
  } \
590
  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
591
  }
592
#define yy_set_bol(at_bol) \
593
  { \
594
  if ( ! YY_CURRENT_BUFFER ){\
595
        yyensure_buffer_stack (yyscanner); \
596
    YY_CURRENT_BUFFER_LVALUE =    \
597
            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
598
  } \
599
  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
600
  }
601
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
602
603
/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
604
/* Begin user sect3 */
605
606
0
#define uat_load_wrap(yyscanner) (/*CONSTCOND*/1)
607
#define YY_SKIP_YYWRAP
608
609
#define FLEX_DEBUG
610
typedef flex_uint8_t YY_CHAR;
611
612
typedef int yy_state_type;
613
614
0
#define yytext_ptr yytext_r
615
616
/* %% [1.5] DFA */
617
618
/* %if-c-only Standard (non-C++) definition */
619
620
static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
621
static yy_state_type yy_try_NUL_trans ( yy_state_type current_state  , yyscan_t yyscanner);
622
static int yy_get_next_buffer ( yyscan_t yyscanner );
623
static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
624
625
/* %endif */
626
627
/* Done after the current pattern has been matched and before the
628
 * corresponding action - sets up yytext.
629
 */
630
#define YY_DO_BEFORE_ACTION \
631
0
  yyg->yytext_ptr = yy_bp; \
632
0
/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
633
0
  yyleng = (int) (yy_cp - yy_bp); \
634
0
  yyg->yy_hold_char = *yy_cp; \
635
0
  *yy_cp = '\0'; \
636
0
/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
637
0
  yyg->yy_c_buf_p = yy_cp;
638
/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
639
#define YY_NUM_RULES 18
640
0
#define YY_END_OF_BUFFER 19
641
/* This struct is not used in this scanner,
642
   but its presence is necessary. */
643
struct yy_trans_info
644
  {
645
  flex_int32_t yy_verify;
646
  flex_int32_t yy_nxt;
647
  };
648
static const flex_int16_t yy_accept[76] =
649
    {   0,
650
        0,    0,    7,    7,    7,    7,    0,    0,    0,    0,
651
        0,    0,   19,   17,   17,   16,   17,   18,    1,    2,
652
       18,   18,   18,    4,   18,    1,    5,   18,   10,   10,
653
        9,   10,    8,   13,   13,   12,   13,   13,   15,   15,
654
       14,   15,    0,   16,    0,    1,    2,    0,    4,    0,
655
        6,    0,    0,    3,    7,    1,    5,    0,    0,    9,
656
        0,    8,    0,   12,    0,    0,    0,    0,   14,    0,
657
        6,    0,    0,   11,    0
658
    } ;
659
660
static const YY_CHAR yy_ec[256] =
661
    {   0,
662
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
663
        1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
664
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
665
        1,    2,    1,    5,    6,    1,    1,    1,    1,    1,
666
        1,    1,    1,    7,    1,    1,    1,    8,    8,    8,
667
        8,    8,    8,    8,    8,    8,    8,    1,    1,    1,
668
        1,    1,    1,    1,    8,    8,    8,    8,    8,    8,
669
        8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
670
        8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
671
        1,    9,    1,    1,    1,    1,    8,    8,    8,    8,
672
673
        8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
674
        8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
675
        8,    8,    1,    1,    1,    1,    1,    1,    1,    1,
676
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
677
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
678
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
679
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
680
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
681
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
682
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
683
684
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
685
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
686
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
687
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
688
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
689
        1,    1,    1,    1,    1
690
    } ;
691
692
static const YY_CHAR yy_meta[10] =
693
    {   0,
694
        1,    1,    2,    1,    1,    1,    1,    1,    1
695
    } ;
696
697
static const flex_int16_t yy_base[81] =
698
    {   0,
699
        0,    3,    7,    0,   15,    0,   21,    0,   30,    0,
700
       38,   41,  102,  103,   44,  103,   98,  103,   47,  103,
701
       97,   50,   96,  103,   90,   58,  103,   94,  103,   64,
702
      103,   93,  103,  103,   70,  103,   92,   89,  103,   76,
703
      103,   81,    0,  103,   80,    0,  103,   79,  103,   76,
704
      103,   71,   72,  103,   62,    0,  103,   66,    0,  103,
705
       61,  103,    0,  103,   60,   53,   52,    0,  103,   53,
706
        0,   45,   47,   15,  103,   85,   87,   89,   91,    0
707
    } ;
708
709
static const flex_int16_t yy_def[81] =
710
    {   0,
711
       76,   76,   75,    3,    3,    5,   75,    7,   75,    9,
712
       77,   77,   75,   75,   75,   75,   75,   75,   75,   75,
713
       75,   78,   79,   75,   75,   75,   75,   75,   75,   75,
714
       75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
715
       75,   75,   15,   75,   75,   19,   75,   75,   75,   78,
716
       75,   50,   79,   75,   75,   26,   75,   75,   30,   75,
717
       75,   75,   35,   75,   75,   75,   80,   40,   75,   75,
718
       50,   75,   80,   80,    0,   75,   75,   75,   75,   75
719
    } ;
720
721
static const flex_int16_t yy_nxt[113] =
722
    {   0,
723
       73,   15,   16,   17,   15,   16,   17,   18,   19,   20,
724
       21,   22,   23,   24,   25,   18,   26,   27,   28,   74,
725
       18,   29,   30,   31,   32,   29,   29,   33,   29,   29,
726
       34,   35,   36,   37,   34,   34,   38,   34,   34,   40,
727
       41,   42,   40,   41,   42,   43,   44,   45,   46,   47,
728
       48,   74,   55,   49,   51,   69,   74,   67,   52,   56,
729
       57,   58,   64,   60,   49,   59,   60,   61,   57,   72,
730
       62,   63,   64,   65,   54,   71,   66,   68,   69,   70,
731
       51,   47,   44,   69,   52,   14,   14,   39,   39,   50,
732
       50,   53,   53,   67,   64,   60,   57,   55,   54,   47,
733
734
       44,   75,   13,   75,   75,   75,   75,   75,   75,   75,
735
       75,   75
736
    } ;
737
738
static const flex_int16_t yy_chk[113] =
739
    {   0,
740
       80,    1,    1,    1,    2,    2,    2,    3,    3,    3,
741
        3,    3,    3,    3,    3,    3,    5,    5,    5,   74,
742
        5,    7,    7,    7,    7,    7,    7,    7,    7,    7,
743
        9,    9,    9,    9,    9,    9,    9,    9,    9,   11,
744
       11,   11,   12,   12,   12,   15,   15,   15,   19,   19,
745
       19,   73,   72,   19,   22,   70,   67,   66,   22,   26,
746
       26,   26,   65,   61,   26,   30,   30,   30,   58,   55,
747
       30,   35,   35,   35,   53,   52,   35,   40,   40,   40,
748
       50,   48,   45,   42,   50,   76,   76,   77,   77,   78,
749
       78,   79,   79,   38,   37,   32,   28,   25,   23,   21,
750
751
       17,   13,   75,   75,   75,   75,   75,   75,   75,   75,
752
       75,   75
753
    } ;
754
755
static const flex_int16_t yy_rule_linenum[18] =
756
    {   0,
757
      235,  236,  237,  239,  254,  272,  285,  301,  314,  328,
758
      332,  338,  373,  377,  378,  380,  381
759
    } ;
760
761
/* The intent behind this definition is that it'll catch
762
 * any uses of REJECT which flex missed.
763
 */
764
#define REJECT reject_used_but_not_detected
765
#define yymore() yymore_used_but_not_detected
766
0
#define YY_MORE_ADJ 0
767
#define YY_RESTORE_YY_MORE_OFFSET
768
#line 1 "/src/wireshark/epan/uat_load.l"
769
770
/*
771
 * We want a reentrant scanner.
772
 */
773
/*
774
 * We don't use input, so don't generate code for it.
775
 */
776
#define YY_NO_INPUT 1
777
/*
778
 * We don't use unput, so don't generate code for it.
779
 */
780
/*
781
 * We don't read interactively from the terminal.
782
 */
783
/*
784
 * We want to stop processing when we get to the end of the input.
785
 */
786
/*
787
 * The type for the state we keep for a scanner.
788
 */
789
/*
790
 * We have to override the memory allocators so that we don't get
791
 * "unused argument" warnings from the yyscanner argument (which
792
 * we don't use, as we have a global memory allocator).
793
 *
794
 * We provide, as macros, our own versions of the routines generated by Flex,
795
 * which just call malloc()/realloc()/free() (as the Flex versions do),
796
 * discarding the extra argument.
797
 */
798
/*
799
 * Prefix scanner routines with "uat_load_" rather than "yy", so this scanner
800
 * can coexist with other scanners.
801
 */
802
#line 61 "/src/wireshark/epan/uat_load.l"
803
  /*
804
   * uat_load.l
805
   *
806
   *  User Accessible Tables
807
   *  Maintain an array of user accessible data strucures
808
   *  One parser to fit them all
809
   *
810
   * (c) 2007, Luis E. Garcia Ontanon <luis@ontanon.org>
811
   *
812
   * Wireshark - Network traffic analyzer
813
   * By Gerald Combs <gerald@wireshark.org>
814
   * Copyright 2001 Gerald Combs
815
   *
816
   * SPDX-License-Identifier: GPL-2.0-or-later
817
   */
818
#include <stdlib.h>
819
#include <stdio.h>
820
#include <string.h>
821
#include <errno.h>
822
823
#include <glib.h>
824
825
#include "uat-int.h"
826
#include <wsutil/file_util.h>
827
828
/*
829
 * Disable diagnostics in the code generated by Flex.
830
 */
831
DIAG_OFF_FLEX()
832
833
typedef struct {
834
  uat_t* uat;
835
  char *parse_str;
836
837
  char* error;
838
  bool valid_record;
839
  unsigned colnum;
840
  char* ptrx;
841
  unsigned len;
842
  void* record;
843
  unsigned linenum;
844
  size_t parse_str_pos;
845
} uat_load_scanner_state_t;
846
847
/*
848
 * Signal a fatal error and stops parsing.
849
 * Since the record is internal to the parsing process, its contents must also
850
 * be cleared before terminating. Any values that are not handled yet (ptrx)
851
 * must also be freed.
852
 */
853
0
#define ERROR(fmtd) do { \
854
0
  char* fmt_str = ws_strdup_printf fmtd; \
855
0
  g_free(yyextra->error); \
856
0
  yyextra->error = ws_strdup_printf("%s:%d: %s",yyextra->uat->filename,yyextra->linenum,fmt_str); \
857
0
  g_free(fmt_str); \
858
0
  if (yyextra->uat->free_cb) { \
859
0
    yyextra->uat->free_cb(yyextra->record); \
860
0
  } \
861
0
  g_free(yyextra->ptrx); \
862
0
  yyterminate(); \
863
0
} while(0)
864
865
/*
866
 * Sets the field of the current (scanner-internal) record, using the parsed
867
 * value. If the field validation function exists and returns an error, then
868
 * the record is marked as invalid and an error message is stored such that it
869
 * can be shown after parsing. (If other errors occur after this issue, then
870
 * this message will be overwritten though.)
871
 */
872
#define SET_FIELD() \
873
0
  { char* errx; \
874
0
  if (yyextra->uat->fields[yyextra->colnum].cb.chk) { \
875
0
    if ( ! yyextra->uat->fields[yyextra->colnum].cb.chk(yyextra->record, yyextra->ptrx, yyextra->len, yyextra->uat->fields[yyextra->colnum].cbdata.chk, yyextra->uat->fields[yyextra->colnum].fld_data, &errx) ) { \
876
0
      g_free(yyextra->error); \
877
0
      yyextra->error = ws_strdup_printf("%s:%d: %s",yyextra->uat->filename,yyextra->linenum,errx); \
878
0
      g_free(errx); \
879
0
      yyextra->valid_record = false; \
880
0
    }\
881
0
  }\
882
0
  yyextra->uat->fields[yyextra->colnum].cb.set(yyextra->record, yyextra->ptrx, yyextra->len, yyextra->uat->fields[yyextra->colnum].cbdata.set, yyextra->uat->fields[yyextra->colnum].fld_data);\
883
0
  g_free(yyextra->ptrx);\
884
0
  yyextra->ptrx = NULL;\
885
0
  yyextra->colnum++; \
886
0
  } while(0)
887
888
#ifdef DEBUG_UAT_LOAD
889
#define DUMP_FIELD(str) \
890
    { unsigned i; printf("%s: %s='",str,yyextra->uat->fields[yyextra->colnum].name); for(i=0;i<yyextra->len;i++) if (yyextra->uat->fields[yyextra->colnum].mode == PT_TXTMOD_HEXBYTES) { printf("%.2x ",((uint8_t*)yyextra->ptrx)[i]); } else putc(yyextra->ptrx[i],stdout); printf("'[%d]\n",yyextra->len); }
891
892
#define DUMP(str) printf("%s\n",str)
893
#else
894
#define DUMP_FIELD(s)
895
#define DUMP(s)
896
#endif
897
898
#define FILL_DEFAULTS() \
899
0
  { unsigned colnum = yyextra->colnum; \
900
0
  colnum++; \
901
0
  while (colnum < yyextra->uat->ncols) { \
902
0
    if (!yyextra->uat->default_values) break; \
903
0
    const char *default_value = yyextra->uat->default_values[colnum]; \
904
0
    if (!default_value) break; \
905
0
    yyextra->uat->fields[colnum].cb.set(yyextra->record, default_value, (unsigned) strlen(default_value), yyextra->uat->fields[colnum].cbdata.set, yyextra->uat->fields[colnum].fld_data); \
906
0
    ws_log(WS_LOG_DOMAIN, LOG_LEVEL_INFO, "%s:%d: Set %s to %s.", \
907
0
      yyextra->uat->filename, yyextra->linenum, yyextra->uat->fields[colnum].name, default_value); \
908
0
    colnum++; \
909
0
  } \
910
0
  if (colnum < yyextra->uat->ncols) { \
911
0
    ERROR(("expecting field %s", yyextra->uat->fields[colnum].name)); \
912
0
  } \
913
0
  } while(0)
914
915
/* Modified version of YY_INPUT generated by Flex 2.91 */
916
#define YY_INPUT(buf,result,max_size) \
917
0
  if ( yyextra->parse_str ) \
918
0
    { \
919
0
    size_t n = 0; \
920
0
    size_t pslen = strlen(yyextra->parse_str); \
921
0
    if (yyextra->parse_str_pos < pslen) \
922
0
      { \
923
0
      n = pslen - yyextra->parse_str_pos; \
924
0
      if (n > max_size) n = max_size; \
925
0
      memcpy(buf, yyextra->parse_str + yyextra->parse_str_pos, n); \
926
0
      yyextra->parse_str_pos += n; \
927
0
      } \
928
0
    result = n; \
929
0
    } \
930
0
  else \
931
0
    { \
932
0
    errno=0; \
933
0
    while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
934
0
      { \
935
0
      if( errno != EINTR) \
936
0
        { \
937
0
        YY_FATAL_ERROR( "input in flex scanner failed" ); \
938
0
        break; \
939
0
        } \
940
0
      errno=0; \
941
0
      clearerr(yyin); \
942
0
      } \
943
0
    }
944
945
    /*
946
     * XXX
947
     * quoted_string below fails badly on "...\\"
948
     * workarround in uat_save(), using /x5c and /x22
949
     */
950
951
0
#define YY_USER_INIT BEGIN START_OF_LINE;
952
953
/*
954
 * Sleazy hack to suppress compiler warnings in yy_fatal_error().
955
 */
956
0
#define YY_EXIT_FAILURE ((void)yyscanner, 2)
957
958
/*
959
 * Macros for the allocators, to discard the extra argument.
960
 */
961
0
#define uat_load_alloc(size, yyscanner)   (void *)malloc(size)
962
0
#define uat_load_realloc(ptr, size, yyscanner)  (void *)realloc((char *)(ptr), (size))
963
0
#define uat_load_free(ptr, yyscanner)   free((char *)ptr)
964
965
#line 966 "/work/build/epan/uat_load.c"
966
967
#line 968 "/work/build/epan/uat_load.c"
968
969
#define INITIAL 0
970
0
#define START_OF_LINE 1
971
0
#define NEXT_FIELD 2
972
0
#define SEPARATOR 3
973
0
#define END_OF_RECORD 4
974
#define ERRORED 5
975
976
#ifndef YY_NO_UNISTD_H
977
/* Special case for "unistd.h", since it is non-ANSI. We include it way
978
 * down here because we want the user's section 1 to have been scanned first.
979
 * The user has a chance to override it with an option.
980
 */
981
/* %if-c-only */
982
#include <unistd.h>
983
/* %endif */
984
/* %if-c++-only */
985
/* %endif */
986
#endif
987
988
#define YY_EXTRA_TYPE uat_load_scanner_state_t *
989
990
/* %if-c-only Reentrant structure and macros (non-C++). */
991
/* %if-reentrant */
992
993
/* Holds the entire state of the reentrant scanner. */
994
struct yyguts_t
995
    {
996
997
    /* User-defined. Not touched by flex. */
998
    YY_EXTRA_TYPE yyextra_r;
999
1000
    /* The rest are the same as the globals declared in the non-reentrant scanner. */
1001
    FILE *yyin_r, *yyout_r;
1002
    size_t yy_buffer_stack_top; /**< index of top of stack. */
1003
    size_t yy_buffer_stack_max; /**< capacity of stack. */
1004
    YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
1005
    char yy_hold_char;
1006
    int yy_n_chars;
1007
    int yyleng_r;
1008
    char *yy_c_buf_p;
1009
    int yy_init;
1010
    int yy_start;
1011
    int yy_did_buffer_switch_on_eof;
1012
    int yy_start_stack_ptr;
1013
    int yy_start_stack_depth;
1014
    int *yy_start_stack;
1015
    yy_state_type yy_last_accepting_state;
1016
    char* yy_last_accepting_cpos;
1017
1018
    int yylineno_r;
1019
    int yy_flex_debug_r;
1020
1021
    char *yytext_r;
1022
    int yy_more_flag;
1023
    int yy_more_len;
1024
1025
    }; /* end struct yyguts_t */
1026
1027
/* %if-c-only */
1028
1029
static int yy_init_globals ( yyscan_t yyscanner );
1030
1031
/* %endif */
1032
1033
/* %if-reentrant */
1034
1035
int yylex_init (yyscan_t* scanner);
1036
1037
int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
1038
1039
/* %endif */
1040
1041
/* %endif End reentrant structures and macros. */
1042
1043
/* Accessor methods to globals.
1044
   These are made visible to non-reentrant scanners for convenience. */
1045
1046
int yylex_destroy ( yyscan_t yyscanner );
1047
1048
int yyget_debug ( yyscan_t yyscanner );
1049
1050
void yyset_debug ( int debug_flag , yyscan_t yyscanner );
1051
1052
YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
1053
1054
void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
1055
1056
FILE *yyget_in ( yyscan_t yyscanner );
1057
1058
void yyset_in  ( FILE * _in_str , yyscan_t yyscanner );
1059
1060
FILE *yyget_out ( yyscan_t yyscanner );
1061
1062
void yyset_out  ( FILE * _out_str , yyscan_t yyscanner );
1063
1064
      int yyget_leng ( yyscan_t yyscanner );
1065
1066
char *yyget_text ( yyscan_t yyscanner );
1067
1068
int yyget_lineno ( yyscan_t yyscanner );
1069
1070
void yyset_lineno ( int _line_number , yyscan_t yyscanner );
1071
1072
int yyget_column  ( yyscan_t yyscanner );
1073
1074
void yyset_column ( int _column_no , yyscan_t yyscanner );
1075
1076
/* %if-bison-bridge */
1077
/* %endif */
1078
1079
/* Macros after this point can all be overridden by user definitions in
1080
 * section 1.
1081
 */
1082
1083
#ifndef YY_SKIP_YYWRAP
1084
#ifdef __cplusplus
1085
extern "C" int yywrap ( yyscan_t yyscanner );
1086
#else
1087
extern int yywrap ( yyscan_t yyscanner );
1088
#endif
1089
#endif
1090
1091
/* %not-for-header */
1092
#ifndef YY_NO_UNPUT
1093
    
1094
#endif
1095
/* %ok-for-header */
1096
1097
/* %endif */
1098
1099
#ifndef yytext_ptr
1100
static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
1101
#endif
1102
1103
#ifdef YY_NEED_STRLEN
1104
static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
1105
#endif
1106
1107
#ifndef YY_NO_INPUT
1108
/* %if-c-only Standard (non-C++) definition */
1109
/* %not-for-header */
1110
#ifdef __cplusplus
1111
static int yyinput ( yyscan_t yyscanner );
1112
#else
1113
static int input ( yyscan_t yyscanner );
1114
#endif
1115
/* %ok-for-header */
1116
1117
/* %endif */
1118
#endif
1119
1120
/* %if-c-only */
1121
1122
/* %endif */
1123
1124
/* Amount of stuff to slurp up with each read. */
1125
#ifndef YY_READ_BUF_SIZE
1126
#ifdef __ia64__
1127
/* On IA-64, the buffer size is 16k, not 8k */
1128
#define YY_READ_BUF_SIZE 16384
1129
#else
1130
0
#define YY_READ_BUF_SIZE 8192
1131
#endif /* __ia64__ */
1132
#endif
1133
1134
/* Copy whatever the last rule matched to the standard output. */
1135
#ifndef ECHO
1136
/* %if-c-only Standard (non-C++) definition */
1137
/* This used to be an fputs(), but since the string might contain NUL's,
1138
 * we now use fwrite().
1139
 */
1140
0
#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1141
/* %endif */
1142
/* %if-c++-only C++ definition */
1143
/* %endif */
1144
#endif
1145
1146
/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
1147
 * is returned in "result".
1148
 */
1149
#ifndef YY_INPUT
1150
#define YY_INPUT(buf,result,max_size) \
1151
/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
1152
  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1153
    { \
1154
    int c = '*'; \
1155
    int n; \
1156
    for ( n = 0; n < max_size && \
1157
           (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1158
      buf[n] = (char) c; \
1159
    if ( c == '\n' ) \
1160
      buf[n++] = (char) c; \
1161
    if ( c == EOF && ferror( yyin ) ) \
1162
      YY_FATAL_ERROR( "input in flex scanner failed" ); \
1163
    result = n; \
1164
    } \
1165
  else \
1166
    { \
1167
    errno=0; \
1168
    while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1169
      { \
1170
      if( errno != EINTR) \
1171
        { \
1172
        YY_FATAL_ERROR( "input in flex scanner failed" ); \
1173
        break; \
1174
        } \
1175
      errno=0; \
1176
      clearerr(yyin); \
1177
      } \
1178
    }\
1179
\
1180
/* %if-c++-only C++ definition \ */\
1181
/* %endif */
1182
1183
#endif
1184
1185
/* No semi-colon after return; correct usage is to write "yyterminate();" -
1186
 * we don't want an extra ';' after the "return" because that will cause
1187
 * some compilers to complain about unreachable statements.
1188
 */
1189
#ifndef yyterminate
1190
0
#define yyterminate() return YY_NULL
1191
#endif
1192
1193
/* Number of entries by which start-condition stack grows. */
1194
#ifndef YY_START_STACK_INCR
1195
#define YY_START_STACK_INCR 25
1196
#endif
1197
1198
/* Report a fatal error. */
1199
#ifndef YY_FATAL_ERROR
1200
/* %if-c-only */
1201
0
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1202
/* %endif */
1203
/* %if-c++-only */
1204
/* %endif */
1205
#endif
1206
1207
/* %if-tables-serialization structures and prototypes */
1208
/* %not-for-header */
1209
/* %ok-for-header */
1210
1211
/* %not-for-header */
1212
/* %tables-yydmap generated elements */
1213
/* %endif */
1214
/* end tables serialization structures and prototypes */
1215
1216
/* %ok-for-header */
1217
1218
/* Default declaration of generated scanner - a define so the user can
1219
 * easily add parameters.
1220
 */
1221
#ifndef YY_DECL
1222
#define YY_DECL_IS_OURS 1
1223
/* %if-c-only Standard (non-C++) definition */
1224
1225
extern int yylex (yyscan_t yyscanner);
1226
1227
#define YY_DECL int yylex (yyscan_t yyscanner)
1228
/* %endif */
1229
/* %if-c++-only C++ definition */
1230
/* %endif */
1231
#endif /* !YY_DECL */
1232
1233
/* Code executed at the beginning of each rule, after yytext and yyleng
1234
 * have been set up.
1235
 */
1236
#ifndef YY_USER_ACTION
1237
#define YY_USER_ACTION
1238
#endif
1239
1240
/* Code executed at the end of each rule. */
1241
#ifndef YY_BREAK
1242
0
#define YY_BREAK /*LINTED*/break;
1243
#endif
1244
1245
/* %% [6.0] YY_RULE_SETUP definition goes here */
1246
#define YY_RULE_SETUP \
1247
  YY_USER_ACTION
1248
1249
/* %not-for-header */
1250
/** The main scanner function which does all the work.
1251
 */
1252
YY_DECL
1253
0
{
1254
0
  yy_state_type yy_current_state;
1255
0
  char *yy_cp, *yy_bp;
1256
0
  int yy_act;
1257
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1258
1259
0
  if ( !yyg->yy_init )
1260
0
    {
1261
0
    yyg->yy_init = 1;
1262
1263
0
#ifdef YY_USER_INIT
1264
0
    YY_USER_INIT;
1265
0
#endif
1266
1267
0
    if ( ! yyg->yy_start )
1268
0
      yyg->yy_start = 1; /* first start state */
1269
1270
0
    if ( ! yyin )
1271
/* %if-c-only */
1272
0
      yyin = stdin;
1273
/* %endif */
1274
/* %if-c++-only */
1275
/* %endif */
1276
1277
0
    if ( ! yyout )
1278
/* %if-c-only */
1279
0
      yyout = stdout;
1280
/* %endif */
1281
/* %if-c++-only */
1282
/* %endif */
1283
1284
0
    if ( ! YY_CURRENT_BUFFER ) {
1285
0
      yyensure_buffer_stack (yyscanner);
1286
0
      YY_CURRENT_BUFFER_LVALUE =
1287
0
        yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
1288
0
    }
1289
1290
0
    yy_load_buffer_state( yyscanner );
1291
0
    }
1292
1293
0
  {
1294
/* %% [7.0] user's declarations go here */
1295
0
#line 234 "/src/wireshark/epan/uat_load.l"
1296
1297
0
#line 1298 "/work/build/epan/uat_load.c"
1298
1299
0
  while ( /*CONSTCOND*/1 )    /* loops until end-of-file is reached */
1300
0
    {
1301
/* %% [8.0] yymore()-related code goes here */
1302
0
    yy_cp = yyg->yy_c_buf_p;
1303
1304
    /* Support of yytext. */
1305
0
    *yy_cp = yyg->yy_hold_char;
1306
1307
    /* yy_bp points to the position in yy_ch_buf of the start of
1308
     * the current run.
1309
     */
1310
0
    yy_bp = yy_cp;
1311
1312
/* %% [9.0] code to set up and find next match goes here */
1313
0
    yy_current_state = yyg->yy_start;
1314
0
yy_match:
1315
0
    do
1316
0
      {
1317
0
      YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1318
0
      if ( yy_accept[yy_current_state] )
1319
0
        {
1320
0
        yyg->yy_last_accepting_state = yy_current_state;
1321
0
        yyg->yy_last_accepting_cpos = yy_cp;
1322
0
        }
1323
0
      while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1324
0
        {
1325
0
        yy_current_state = (int) yy_def[yy_current_state];
1326
0
        if ( yy_current_state >= 76 )
1327
0
          yy_c = yy_meta[yy_c];
1328
0
        }
1329
0
      yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1330
0
      ++yy_cp;
1331
0
      }
1332
0
    while ( yy_current_state != 75 );
1333
0
    yy_cp = yyg->yy_last_accepting_cpos;
1334
0
    yy_current_state = yyg->yy_last_accepting_state;
1335
1336
0
yy_find_action:
1337
/* %% [10.0] code to find the action number goes here */
1338
0
    yy_act = yy_accept[yy_current_state];
1339
1340
0
    YY_DO_BEFORE_ACTION;
1341
1342
/* %% [11.0] code for yylineno update goes here */
1343
1344
0
do_action:  /* This label is used only to access EOF actions. */
1345
1346
/* %% [12.0] debug code goes here */
1347
0
    if ( yy_flex_debug )
1348
0
      {
1349
0
      if ( yy_act == 0 )
1350
0
        fprintf( stderr, "--scanner backing up\n" );
1351
0
      else if ( yy_act < 18 )
1352
0
        fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
1353
0
                 (long)yy_rule_linenum[yy_act], yytext );
1354
0
      else if ( yy_act == 18 )
1355
0
        fprintf( stderr, "--accepting default rule (\"%s\")\n",
1356
0
                 yytext );
1357
0
      else if ( yy_act == 19 )
1358
0
        fprintf( stderr, "--(end of buffer or a NUL)\n" );
1359
0
      else
1360
0
        fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
1361
0
      }
1362
1363
0
    switch ( yy_act )
1364
0
  { /* beginning of action switch */
1365
/* %% [13.0] actions go here */
1366
0
      case 0: /* must back up */
1367
      /* undo the effects of YY_DO_BEFORE_ACTION */
1368
0
      *yy_cp = yyg->yy_hold_char;
1369
0
      yy_cp = yyg->yy_last_accepting_cpos;
1370
0
      yy_current_state = yyg->yy_last_accepting_state;
1371
0
      goto yy_find_action;
1372
1373
0
case 1:
1374
0
YY_RULE_SETUP
1375
0
#line 235 "/src/wireshark/epan/uat_load.l"
1376
0
;
1377
0
  YY_BREAK
1378
0
case 2:
1379
/* rule 2 can match eol */
1380
0
YY_RULE_SETUP
1381
0
#line 236 "/src/wireshark/epan/uat_load.l"
1382
0
yyextra->linenum++;
1383
0
  YY_BREAK
1384
0
case 3:
1385
/* rule 3 can match eol */
1386
0
YY_RULE_SETUP
1387
0
#line 237 "/src/wireshark/epan/uat_load.l"
1388
0
yyextra->linenum++;
1389
0
  YY_BREAK
1390
0
case 4:
1391
0
YY_RULE_SETUP
1392
0
#line 239 "/src/wireshark/epan/uat_load.l"
1393
0
{
1394
0
  yyextra->ptrx = g_strdup("");
1395
0
  yyextra->len = 0;
1396
1397
0
  DUMP_FIELD("empty->next");
1398
1399
0
  SET_FIELD();
1400
1401
0
  if ( yyextra->colnum >= yyextra->uat->ncols ) {
1402
0
    ERROR(("more fields than required"));
1403
0
  }
1404
1405
0
  BEGIN NEXT_FIELD;
1406
0
}
1407
0
  YY_BREAK
1408
0
case 5:
1409
/* rule 5 can match eol */
1410
0
YY_RULE_SETUP
1411
0
#line 254 "/src/wireshark/epan/uat_load.l"
1412
0
{
1413
0
  yyextra->ptrx = g_strdup("");
1414
0
  yyextra->len = 0;
1415
1416
0
  DUMP("empty->newline");
1417
1418
  /*
1419
   * We've run out of fields. Check to see if we got enough, and
1420
   * if not, if we have any default values that we can fill in.
1421
   * The empty field for the current column will be filled in below
1422
   * in <END_OF_RECORD>{newline}.
1423
   */
1424
0
  FILL_DEFAULTS();
1425
1426
0
  BEGIN END_OF_RECORD;
1427
0
  yyless(0);
1428
0
}
1429
0
  YY_BREAK
1430
0
case 6:
1431
/* rule 6 can match eol */
1432
0
YY_RULE_SETUP
1433
0
#line 272 "/src/wireshark/epan/uat_load.l"
1434
0
{
1435
0
  yyextra->ptrx = uat_undquote(yytext, (unsigned) yyleng, &yyextra->len);
1436
1437
1438
0
  if (yyextra->colnum < yyextra->uat->ncols - 1) {
1439
0
    DUMP("quoted_str->s");
1440
0
    BEGIN SEPARATOR;
1441
0
  } else {
1442
0
    DUMP("quoted_str->eor");
1443
0
    BEGIN END_OF_RECORD;
1444
0
  }
1445
0
}
1446
0
  YY_BREAK
1447
0
case 7:
1448
0
YY_RULE_SETUP
1449
0
#line 285 "/src/wireshark/epan/uat_load.l"
1450
0
{
1451
0
  yyextra->ptrx = uat_unbinstring(yytext,  (unsigned) yyleng, &yyextra->len);
1452
1453
0
  if (!yyextra->ptrx) {
1454
0
    ERROR(("uneven hexstring for field %s",yyextra->uat->fields[yyextra->colnum].name));
1455
0
  }
1456
1457
0
  if ( yyextra->colnum < yyextra->uat->ncols - 1 ) {
1458
0
    DUMP("binstring->s");
1459
0
    BEGIN SEPARATOR;
1460
0
  } else {
1461
0
    DUMP("binstring->eor");
1462
0
    BEGIN END_OF_RECORD;
1463
0
  }
1464
0
}
1465
0
  YY_BREAK
1466
0
case 8:
1467
0
YY_RULE_SETUP
1468
0
#line 301 "/src/wireshark/epan/uat_load.l"
1469
0
{
1470
1471
0
  DUMP_FIELD("separator->next");
1472
1473
0
  SET_FIELD();
1474
1475
0
  if ( yyextra->colnum >= yyextra->uat->ncols ) {
1476
0
    ERROR(("more fields than required"));
1477
0
  }
1478
1479
0
  BEGIN NEXT_FIELD;
1480
0
}
1481
0
  YY_BREAK
1482
0
case 9:
1483
/* rule 9 can match eol */
1484
0
YY_RULE_SETUP
1485
0
#line 314 "/src/wireshark/epan/uat_load.l"
1486
0
{
1487
0
  DUMP("separator->newline");
1488
1489
  /*
1490
   * We've run out of fields. Check to see if we have any default
1491
   * values that we can fill in. The field for the current column
1492
   * will be filled in below in <END_OF_RECORD>{newline}.
1493
   */
1494
0
  FILL_DEFAULTS();
1495
1496
0
  BEGIN END_OF_RECORD;
1497
0
  yyless(0);
1498
0
}
1499
0
  YY_BREAK
1500
0
case 10:
1501
0
YY_RULE_SETUP
1502
0
#line 328 "/src/wireshark/epan/uat_load.l"
1503
0
{
1504
0
  ERROR(("unexpected char '%s' while looking for field %s",yytext,yyextra->uat->fields[yyextra->colnum].name));
1505
0
}
1506
0
  YY_BREAK
1507
0
case 11:
1508
0
YY_RULE_SETUP
1509
0
#line 332 "/src/wireshark/epan/uat_load.l"
1510
0
{
1511
  /* If we wanted to be really fancy we could retain the extra data. */
1512
0
  ws_log(WS_LOG_DOMAIN, LOG_LEVEL_WARNING, "%s:%d: More fields than required. Discarding '%s'.",
1513
0
    yyextra->uat->filename, yyextra->linenum, yytext);
1514
0
}
1515
0
  YY_BREAK
1516
0
case 12:
1517
/* rule 12 can match eol */
1518
0
YY_RULE_SETUP
1519
0
#line 338 "/src/wireshark/epan/uat_load.l"
1520
0
{
1521
0
  void* rec;
1522
0
  char* err = NULL;
1523
1524
0
  yyextra->linenum++;
1525
1526
0
  DUMP_FIELD("newline->start");
1527
1528
0
  SET_FIELD();
1529
1530
  /* Last field was processed, try to store the full record in the UAT. */
1531
0
  rec = uat_add_record(yyextra->uat, yyextra->record, yyextra->valid_record);
1532
1533
0
  if ((yyextra->uat->update_cb) && (rec != NULL)) {
1534
0
    if (!yyextra->uat->update_cb(rec,&err)) {
1535
0
      g_free(yyextra->error);
1536
0
      yyextra->error = err;
1537
0
      yyterminate();
1538
0
    }
1539
0
  }
1540
1541
  /* The record was duplicated to the UAT above, now free our fields. */
1542
0
  if (yyextra->uat->free_cb) {
1543
0
    yyextra->uat->free_cb(yyextra->record);
1544
0
  }
1545
0
  memset(yyextra->record, 0, yyextra->uat->record_size);
1546
1547
0
  yyextra->valid_record = true;
1548
0
  yyextra->colnum = 0;
1549
0
  yyextra->ptrx = NULL;
1550
0
  yyextra->len = 0;
1551
1552
0
  BEGIN START_OF_LINE;
1553
0
 }
1554
0
  YY_BREAK
1555
0
case 13:
1556
0
YY_RULE_SETUP
1557
0
#line 373 "/src/wireshark/epan/uat_load.l"
1558
0
{
1559
0
  ERROR(("unexpected char %s while looking for end of line", yytext));
1560
0
}
1561
0
  YY_BREAK
1562
0
case 14:
1563
/* rule 14 can match eol */
1564
0
YY_RULE_SETUP
1565
0
#line 377 "/src/wireshark/epan/uat_load.l"
1566
0
{ yyextra->linenum++; BEGIN START_OF_LINE; }
1567
0
  YY_BREAK
1568
0
case 15:
1569
0
YY_RULE_SETUP
1570
0
#line 378 "/src/wireshark/epan/uat_load.l"
1571
0
;
1572
0
  YY_BREAK
1573
0
case 16:
1574
/* rule 16 can match eol */
1575
0
YY_RULE_SETUP
1576
0
#line 380 "/src/wireshark/epan/uat_load.l"
1577
0
{ yyextra->linenum++; ERROR(("incomplete record")); }
1578
0
  YY_BREAK
1579
0
case 17:
1580
0
YY_RULE_SETUP
1581
0
#line 381 "/src/wireshark/epan/uat_load.l"
1582
0
{ ERROR(("unexpected input")); }
1583
0
  YY_BREAK
1584
0
case 18:
1585
0
YY_RULE_SETUP
1586
0
#line 383 "/src/wireshark/epan/uat_load.l"
1587
0
ECHO;
1588
0
  YY_BREAK
1589
0
#line 1590 "/work/build/epan/uat_load.c"
1590
0
case YY_STATE_EOF(INITIAL):
1591
0
case YY_STATE_EOF(START_OF_LINE):
1592
0
case YY_STATE_EOF(NEXT_FIELD):
1593
0
case YY_STATE_EOF(SEPARATOR):
1594
0
case YY_STATE_EOF(END_OF_RECORD):
1595
0
case YY_STATE_EOF(ERRORED):
1596
0
  yyterminate();
1597
1598
0
  case YY_END_OF_BUFFER:
1599
0
    {
1600
    /* Amount of text matched not including the EOB char. */
1601
0
    int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1602
1603
    /* Undo the effects of YY_DO_BEFORE_ACTION. */
1604
0
    *yy_cp = yyg->yy_hold_char;
1605
0
    YY_RESTORE_YY_MORE_OFFSET
1606
1607
0
    if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1608
0
      {
1609
      /* We're scanning a new file or input source.  It's
1610
       * possible that this happened because the user
1611
       * just pointed yyin at a new source and called
1612
       * yylex().  If so, then we have to assure
1613
       * consistency between YY_CURRENT_BUFFER and our
1614
       * globals.  Here is the right place to do so, because
1615
       * this is the first action (other than possibly a
1616
       * back-up) that will match for the new input source.
1617
       */
1618
0
      yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1619
/* %if-c-only */
1620
0
      YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1621
/* %endif */
1622
/* %if-c++-only */
1623
/* %endif */
1624
0
      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1625
0
      }
1626
1627
    /* Note that here we test for yy_c_buf_p "<=" to the position
1628
     * of the first EOB in the buffer, since yy_c_buf_p will
1629
     * already have been incremented past the NUL character
1630
     * (since all states make transitions on EOB to the
1631
     * end-of-buffer state).  Contrast this with the test
1632
     * in input().
1633
     */
1634
0
    if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1635
0
      { /* This was really a NUL. */
1636
0
      yy_state_type yy_next_state;
1637
1638
0
      yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1639
1640
0
      yy_current_state = yy_get_previous_state( yyscanner );
1641
1642
      /* Okay, we're now positioned to make the NUL
1643
       * transition.  We couldn't have
1644
       * yy_get_previous_state() go ahead and do it
1645
       * for us because it doesn't know how to deal
1646
       * with the possibility of jamming (and we don't
1647
       * want to build jamming into it because then it
1648
       * will run more slowly).
1649
       */
1650
1651
0
      yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1652
1653
0
      yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1654
1655
0
      if ( yy_next_state )
1656
0
        {
1657
        /* Consume the NUL. */
1658
0
        yy_cp = ++yyg->yy_c_buf_p;
1659
0
        yy_current_state = yy_next_state;
1660
0
        goto yy_match;
1661
0
        }
1662
1663
0
      else
1664
0
        {
1665
/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
1666
0
        yy_cp = yyg->yy_last_accepting_cpos;
1667
0
        yy_current_state = yyg->yy_last_accepting_state;
1668
0
        goto yy_find_action;
1669
0
        }
1670
0
      }
1671
1672
0
    else switch ( yy_get_next_buffer( yyscanner ) )
1673
0
      {
1674
0
      case EOB_ACT_END_OF_FILE:
1675
0
        {
1676
0
        yyg->yy_did_buffer_switch_on_eof = 0;
1677
1678
0
        if ( yywrap( yyscanner ) )
1679
0
          {
1680
          /* Note: because we've taken care in
1681
           * yy_get_next_buffer() to have set up
1682
           * yytext, we can now set up
1683
           * yy_c_buf_p so that if some total
1684
           * hoser (like flex itself) wants to
1685
           * call the scanner after we return the
1686
           * YY_NULL, it'll still work - another
1687
           * YY_NULL will get returned.
1688
           */
1689
0
          yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1690
1691
0
          yy_act = YY_STATE_EOF(YY_START);
1692
0
          goto do_action;
1693
0
          }
1694
1695
0
        else
1696
0
          {
1697
0
          if ( ! yyg->yy_did_buffer_switch_on_eof )
1698
0
            YY_NEW_FILE;
1699
0
          }
1700
0
        break;
1701
0
        }
1702
1703
0
      case EOB_ACT_CONTINUE_SCAN:
1704
0
        yyg->yy_c_buf_p =
1705
0
          yyg->yytext_ptr + yy_amount_of_matched_text;
1706
1707
0
        yy_current_state = yy_get_previous_state( yyscanner );
1708
1709
0
        yy_cp = yyg->yy_c_buf_p;
1710
0
        yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1711
0
        goto yy_match;
1712
1713
0
      case EOB_ACT_LAST_MATCH:
1714
0
        yyg->yy_c_buf_p =
1715
0
        &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1716
1717
0
        yy_current_state = yy_get_previous_state( yyscanner );
1718
1719
0
        yy_cp = yyg->yy_c_buf_p;
1720
0
        yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1721
0
        goto yy_find_action;
1722
0
      }
1723
0
    break;
1724
0
    }
1725
1726
0
  default:
1727
0
    YY_FATAL_ERROR(
1728
0
      "fatal flex scanner internal error--no action found" );
1729
0
  } /* end of action switch */
1730
0
    } /* end of scanning one token */
1731
0
  } /* end of user's declarations */
1732
0
} /* end of yylex */
1733
/* %ok-for-header */
1734
1735
/* %if-c++-only */
1736
/* %not-for-header */
1737
/* %ok-for-header */
1738
1739
/* %endif */
1740
1741
/* yy_get_next_buffer - try to read in a new buffer
1742
 *
1743
 * Returns a code representing an action:
1744
 *  EOB_ACT_LAST_MATCH -
1745
 *  EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1746
 *  EOB_ACT_END_OF_FILE - end of file
1747
 */
1748
/* %if-c-only */
1749
static int yy_get_next_buffer (yyscan_t yyscanner)
1750
/* %endif */
1751
/* %if-c++-only */
1752
/* %endif */
1753
0
{
1754
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1755
0
  char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1756
0
  char *source = yyg->yytext_ptr;
1757
0
  int number_to_move, i;
1758
0
  int ret_val;
1759
1760
0
  if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1761
0
    YY_FATAL_ERROR(
1762
0
    "fatal flex scanner internal error--end of buffer missed" );
1763
1764
0
  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1765
0
    { /* Don't try to fill the buffer, so this is an EOF. */
1766
0
    if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1767
0
      {
1768
      /* We matched a single character, the EOB, so
1769
       * treat this as a final EOF.
1770
       */
1771
0
      return EOB_ACT_END_OF_FILE;
1772
0
      }
1773
1774
0
    else
1775
0
      {
1776
      /* We matched some text prior to the EOB, first
1777
       * process it.
1778
       */
1779
0
      return EOB_ACT_LAST_MATCH;
1780
0
      }
1781
0
    }
1782
1783
  /* Try to read more data. */
1784
1785
  /* First move last chars to start of buffer. */
1786
0
  number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
1787
1788
0
  for ( i = 0; i < number_to_move; ++i )
1789
0
    *(dest++) = *(source++);
1790
1791
0
  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1792
    /* don't do the read, it's not guaranteed to return an EOF,
1793
     * just force an EOF
1794
     */
1795
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1796
1797
0
  else
1798
0
    {
1799
0
      int num_to_read =
1800
0
      YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1801
1802
0
    while ( num_to_read <= 0 )
1803
0
      { /* Not enough room in the buffer - grow it. */
1804
1805
      /* just a shorter name for the current buffer */
1806
0
      YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1807
1808
0
      int yy_c_buf_p_offset =
1809
0
        (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1810
1811
0
      if ( b->yy_is_our_buffer )
1812
0
        {
1813
0
        int new_size = b->yy_buf_size * 2;
1814
1815
0
        if ( new_size <= 0 )
1816
0
          b->yy_buf_size += b->yy_buf_size / 8;
1817
0
        else
1818
0
          b->yy_buf_size *= 2;
1819
1820
0
        b->yy_ch_buf = (char *)
1821
          /* Include room in for 2 EOB chars. */
1822
0
          yyrealloc( (void *) b->yy_ch_buf,
1823
0
               (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
1824
0
        }
1825
0
      else
1826
        /* Can't grow it, we don't own it. */
1827
0
        b->yy_ch_buf = NULL;
1828
1829
0
      if ( ! b->yy_ch_buf )
1830
0
        YY_FATAL_ERROR(
1831
0
        "fatal error - scanner input buffer overflow" );
1832
1833
0
      yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1834
1835
0
      num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1836
0
            number_to_move - 1;
1837
1838
0
      }
1839
1840
0
    if ( num_to_read > YY_READ_BUF_SIZE )
1841
0
      num_to_read = YY_READ_BUF_SIZE;
1842
1843
    /* Read in more data. */
1844
0
    YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1845
0
      yyg->yy_n_chars, num_to_read );
1846
1847
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1848
0
    }
1849
1850
0
  if ( yyg->yy_n_chars == 0 )
1851
0
    {
1852
0
    if ( number_to_move == YY_MORE_ADJ )
1853
0
      {
1854
0
      ret_val = EOB_ACT_END_OF_FILE;
1855
0
      yyrestart( yyin  , yyscanner);
1856
0
      }
1857
1858
0
    else
1859
0
      {
1860
0
      ret_val = EOB_ACT_LAST_MATCH;
1861
0
      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1862
0
        YY_BUFFER_EOF_PENDING;
1863
0
      }
1864
0
    }
1865
1866
0
  else
1867
0
    ret_val = EOB_ACT_CONTINUE_SCAN;
1868
1869
0
  if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1870
    /* Extend the array by 50%, plus the number we really need. */
1871
0
    int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1872
0
    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1873
0
      (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
1874
0
    if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1875
0
      YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1876
    /* "- 2" to take care of EOB's */
1877
0
    YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1878
0
  }
1879
1880
0
  yyg->yy_n_chars += number_to_move;
1881
0
  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1882
0
  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1883
1884
0
  yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1885
1886
0
  return ret_val;
1887
0
}
1888
1889
/* yy_get_previous_state - get the state just before the EOB char was reached */
1890
1891
/* %if-c-only */
1892
/* %not-for-header */
1893
    static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1894
/* %endif */
1895
/* %if-c++-only */
1896
/* %endif */
1897
0
{
1898
0
  yy_state_type yy_current_state;
1899
0
  char *yy_cp;
1900
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1901
1902
/* %% [15.0] code to get the start state into yy_current_state goes here */
1903
0
  yy_current_state = yyg->yy_start;
1904
1905
0
  for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1906
0
    {
1907
/* %% [16.0] code to find the next state goes here */
1908
0
    YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1909
0
    if ( yy_accept[yy_current_state] )
1910
0
      {
1911
0
      yyg->yy_last_accepting_state = yy_current_state;
1912
0
      yyg->yy_last_accepting_cpos = yy_cp;
1913
0
      }
1914
0
    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1915
0
      {
1916
0
      yy_current_state = (int) yy_def[yy_current_state];
1917
0
      if ( yy_current_state >= 76 )
1918
0
        yy_c = yy_meta[yy_c];
1919
0
      }
1920
0
    yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1921
0
    }
1922
1923
0
  return yy_current_state;
1924
0
}
1925
1926
/* yy_try_NUL_trans - try to make a transition on the NUL character
1927
 *
1928
 * synopsis
1929
 *  next_state = yy_try_NUL_trans( current_state );
1930
 */
1931
/* %if-c-only */
1932
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
1933
/* %endif */
1934
/* %if-c++-only */
1935
/* %endif */
1936
0
{
1937
0
  int yy_is_jam;
1938
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1939
/* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
1940
0
  char *yy_cp = yyg->yy_c_buf_p;
1941
1942
0
  YY_CHAR yy_c = 1;
1943
0
  if ( yy_accept[yy_current_state] )
1944
0
    {
1945
0
    yyg->yy_last_accepting_state = yy_current_state;
1946
0
    yyg->yy_last_accepting_cpos = yy_cp;
1947
0
    }
1948
0
  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1949
0
    {
1950
0
    yy_current_state = (int) yy_def[yy_current_state];
1951
0
    if ( yy_current_state >= 76 )
1952
0
      yy_c = yy_meta[yy_c];
1953
0
    }
1954
0
  yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1955
0
  yy_is_jam = (yy_current_state == 75);
1956
1957
0
  (void)yyg;
1958
0
  return yy_is_jam ? 0 : yy_current_state;
1959
0
}
1960
1961
#ifndef YY_NO_UNPUT
1962
/* %if-c-only */
1963
1964
/* %endif */
1965
#endif
1966
1967
/* %if-c-only */
1968
#ifndef YY_NO_INPUT
1969
#ifdef __cplusplus
1970
    static int yyinput (yyscan_t yyscanner)
1971
#else
1972
    static int input  (yyscan_t yyscanner)
1973
#endif
1974
1975
/* %endif */
1976
/* %if-c++-only */
1977
/* %endif */
1978
{
1979
  int c;
1980
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1981
1982
  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1983
1984
  if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1985
    {
1986
    /* yy_c_buf_p now points to the character we want to return.
1987
     * If this occurs *before* the EOB characters, then it's a
1988
     * valid NUL; if not, then we've hit the end of the buffer.
1989
     */
1990
    if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1991
      /* This was really a NUL. */
1992
      *yyg->yy_c_buf_p = '\0';
1993
1994
    else
1995
      { /* need more input */
1996
      int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
1997
      ++yyg->yy_c_buf_p;
1998
1999
      switch ( yy_get_next_buffer( yyscanner ) )
2000
        {
2001
        case EOB_ACT_LAST_MATCH:
2002
          /* This happens because yy_g_n_b()
2003
           * sees that we've accumulated a
2004
           * token and flags that we need to
2005
           * try matching the token before
2006
           * proceeding.  But for input(),
2007
           * there's no matching to consider.
2008
           * So convert the EOB_ACT_LAST_MATCH
2009
           * to EOB_ACT_END_OF_FILE.
2010
           */
2011
2012
          /* Reset buffer status. */
2013
          yyrestart( yyin , yyscanner);
2014
2015
          /*FALLTHROUGH*/
2016
2017
        case EOB_ACT_END_OF_FILE:
2018
          {
2019
          if ( yywrap( yyscanner ) )
2020
            return 0;
2021
2022
          if ( ! yyg->yy_did_buffer_switch_on_eof )
2023
            YY_NEW_FILE;
2024
#ifdef __cplusplus
2025
          return yyinput(yyscanner);
2026
#else
2027
          return input(yyscanner);
2028
#endif
2029
          }
2030
2031
        case EOB_ACT_CONTINUE_SCAN:
2032
          yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2033
          break;
2034
        }
2035
      }
2036
    }
2037
2038
  c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2039
  *yyg->yy_c_buf_p = '\0';  /* preserve yytext */
2040
  yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2041
2042
/* %% [19.0] update BOL and yylineno */
2043
2044
  return c;
2045
}
2046
/* %if-c-only */
2047
#endif  /* ifndef YY_NO_INPUT */
2048
/* %endif */
2049
2050
/** Immediately switch to a different input stream.
2051
 * @param input_file A readable stream.
2052
 * @param yyscanner The scanner object.
2053
 * @note This function does not reset the start condition to @c INITIAL .
2054
 */
2055
/* %if-c-only */
2056
    void yyrestart  (FILE * input_file , yyscan_t yyscanner)
2057
/* %endif */
2058
/* %if-c++-only */
2059
/* %endif */
2060
0
{
2061
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2062
2063
0
  if ( ! YY_CURRENT_BUFFER ){
2064
0
        yyensure_buffer_stack (yyscanner);
2065
0
    YY_CURRENT_BUFFER_LVALUE =
2066
0
            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
2067
0
  }
2068
2069
0
  yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
2070
0
  yy_load_buffer_state( yyscanner );
2071
0
}
2072
2073
/* %if-c++-only */
2074
/* %endif */
2075
2076
/** Switch to a different input buffer.
2077
 * @param new_buffer The new input buffer.
2078
 * @param yyscanner The scanner object.
2079
 */
2080
/* %if-c-only */
2081
    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
2082
/* %endif */
2083
/* %if-c++-only */
2084
/* %endif */
2085
0
{
2086
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2087
2088
  /* TODO. We should be able to replace this entire function body
2089
   * with
2090
   *    yypop_buffer_state();
2091
   *    yypush_buffer_state(new_buffer);
2092
     */
2093
0
  yyensure_buffer_stack (yyscanner);
2094
0
  if ( YY_CURRENT_BUFFER == new_buffer )
2095
0
    return;
2096
2097
0
  if ( YY_CURRENT_BUFFER )
2098
0
    {
2099
    /* Flush out information for old buffer. */
2100
0
    *yyg->yy_c_buf_p = yyg->yy_hold_char;
2101
0
    YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2102
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2103
0
    }
2104
2105
0
  YY_CURRENT_BUFFER_LVALUE = new_buffer;
2106
0
  yy_load_buffer_state( yyscanner );
2107
2108
  /* We don't actually know whether we did this switch during
2109
   * EOF (yywrap()) processing, but the only time this flag
2110
   * is looked at is after yywrap() is called, so it's safe
2111
   * to go ahead and always set it.
2112
   */
2113
0
  yyg->yy_did_buffer_switch_on_eof = 1;
2114
0
}
2115
2116
/* %if-c-only */
2117
static void yy_load_buffer_state  (yyscan_t yyscanner)
2118
/* %endif */
2119
/* %if-c++-only */
2120
/* %endif */
2121
0
{
2122
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2123
0
  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2124
0
  yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2125
/* %if-c-only */
2126
0
  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2127
/* %endif */
2128
/* %if-c++-only */
2129
/* %endif */
2130
0
  yyg->yy_hold_char = *yyg->yy_c_buf_p;
2131
0
}
2132
2133
/** Allocate and initialize an input buffer state.
2134
 * @param file A readable stream.
2135
 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2136
 * @param yyscanner The scanner object.
2137
 * @return the allocated buffer state.
2138
 */
2139
/* %if-c-only */
2140
    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
2141
/* %endif */
2142
/* %if-c++-only */
2143
/* %endif */
2144
0
{
2145
0
  YY_BUFFER_STATE b;
2146
    
2147
0
  b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
2148
0
  if ( ! b )
2149
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2150
2151
0
  b->yy_buf_size = size;
2152
2153
  /* yy_ch_buf has to be 2 characters longer than the size given because
2154
   * we need to put in 2 end-of-buffer characters.
2155
   */
2156
0
  b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
2157
0
  if ( ! b->yy_ch_buf )
2158
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2159
2160
0
  b->yy_is_our_buffer = 1;
2161
2162
0
  yy_init_buffer( b, file , yyscanner);
2163
2164
0
  return b;
2165
0
}
2166
2167
/* %if-c++-only */
2168
/* %endif */
2169
2170
/** Destroy the buffer.
2171
 * @param b a buffer created with yy_create_buffer()
2172
 * @param yyscanner The scanner object.
2173
 */
2174
/* %if-c-only */
2175
    void yy_delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
2176
/* %endif */
2177
/* %if-c++-only */
2178
/* %endif */
2179
0
{
2180
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2181
2182
0
  if ( ! b )
2183
0
    return;
2184
2185
0
  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2186
0
    YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2187
2188
0
  if ( b->yy_is_our_buffer )
2189
0
    yyfree( (void *) b->yy_ch_buf , yyscanner );
2190
2191
0
  yyfree( (void *) b , yyscanner );
2192
0
}
2193
2194
/* Initializes or reinitializes a buffer.
2195
 * This function is sometimes called more than once on the same buffer,
2196
 * such as during a yyrestart() or at EOF.
2197
 */
2198
/* %if-c-only */
2199
    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
2200
/* %endif */
2201
/* %if-c++-only */
2202
/* %endif */
2203
2204
0
{
2205
0
  int oerrno = errno;
2206
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2207
2208
0
  yy_flush_buffer( b , yyscanner);
2209
2210
/* %if-c-only */
2211
0
  b->yy_input_file = file;
2212
/* %endif */
2213
/* %if-c++-only */
2214
/* %endif */
2215
0
  b->yy_fill_buffer = 1;
2216
2217
    /* If b is the current buffer, then yy_init_buffer was _probably_
2218
     * called from yyrestart() or through yy_get_next_buffer.
2219
     * In that case, we don't want to reset the lineno or column.
2220
     */
2221
0
    if (b != YY_CURRENT_BUFFER){
2222
0
        b->yy_bs_lineno = 1;
2223
0
        b->yy_bs_column = 0;
2224
0
    }
2225
2226
/* %if-c-only */
2227
2228
0
        b->yy_is_interactive = 0;
2229
    
2230
/* %endif */
2231
/* %if-c++-only */
2232
/* %endif */
2233
0
  errno = oerrno;
2234
0
}
2235
2236
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2237
 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2238
 * @param yyscanner The scanner object.
2239
 */
2240
/* %if-c-only */
2241
    void yy_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
2242
/* %endif */
2243
/* %if-c++-only */
2244
/* %endif */
2245
0
{
2246
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2247
0
  if ( ! b )
2248
0
    return;
2249
2250
0
  b->yy_n_chars = 0;
2251
2252
  /* We always need two end-of-buffer characters.  The first causes
2253
   * a transition to the end-of-buffer state.  The second causes
2254
   * a jam in that state.
2255
   */
2256
0
  b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2257
0
  b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2258
2259
0
  b->yy_buf_pos = &b->yy_ch_buf[0];
2260
2261
0
  b->yy_at_bol = 1;
2262
0
  b->yy_buffer_status = YY_BUFFER_NEW;
2263
2264
0
  if ( b == YY_CURRENT_BUFFER )
2265
0
    yy_load_buffer_state( yyscanner );
2266
0
}
2267
2268
/* %if-c-or-c++ */
2269
/** Pushes the new state onto the stack. The new state becomes
2270
 *  the current state. This function will allocate the stack
2271
 *  if necessary.
2272
 *  @param new_buffer The new state.
2273
 *  @param yyscanner The scanner object.
2274
 */
2275
/* %if-c-only */
2276
void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2277
/* %endif */
2278
/* %if-c++-only */
2279
/* %endif */
2280
0
{
2281
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2282
0
  if (new_buffer == NULL)
2283
0
    return;
2284
2285
0
  yyensure_buffer_stack(yyscanner);
2286
2287
  /* This block is copied from yy_switch_to_buffer. */
2288
0
  if ( YY_CURRENT_BUFFER )
2289
0
    {
2290
    /* Flush out information for old buffer. */
2291
0
    *yyg->yy_c_buf_p = yyg->yy_hold_char;
2292
0
    YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2293
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2294
0
    }
2295
2296
  /* Only push if top exists. Otherwise, replace top. */
2297
0
  if (YY_CURRENT_BUFFER)
2298
0
    yyg->yy_buffer_stack_top++;
2299
0
  YY_CURRENT_BUFFER_LVALUE = new_buffer;
2300
2301
  /* copied from yy_switch_to_buffer. */
2302
0
  yy_load_buffer_state( yyscanner );
2303
0
  yyg->yy_did_buffer_switch_on_eof = 1;
2304
0
}
2305
/* %endif */
2306
2307
/* %if-c-or-c++ */
2308
/** Removes and deletes the top of the stack, if present.
2309
 *  The next element becomes the new top.
2310
 *  @param yyscanner The scanner object.
2311
 */
2312
/* %if-c-only */
2313
void yypop_buffer_state (yyscan_t yyscanner)
2314
/* %endif */
2315
/* %if-c++-only */
2316
/* %endif */
2317
0
{
2318
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2319
0
  if (!YY_CURRENT_BUFFER)
2320
0
    return;
2321
2322
0
  yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
2323
0
  YY_CURRENT_BUFFER_LVALUE = NULL;
2324
0
  if (yyg->yy_buffer_stack_top > 0)
2325
0
    --yyg->yy_buffer_stack_top;
2326
2327
0
  if (YY_CURRENT_BUFFER) {
2328
0
    yy_load_buffer_state( yyscanner );
2329
0
    yyg->yy_did_buffer_switch_on_eof = 1;
2330
0
  }
2331
0
}
2332
/* %endif */
2333
2334
/* %if-c-or-c++ */
2335
/* Allocates the stack if it does not exist.
2336
 *  Guarantees space for at least one push.
2337
 */
2338
/* %if-c-only */
2339
static void yyensure_buffer_stack (yyscan_t yyscanner)
2340
/* %endif */
2341
/* %if-c++-only */
2342
/* %endif */
2343
0
{
2344
0
  yy_size_t num_to_alloc;
2345
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2346
2347
0
  if (!yyg->yy_buffer_stack) {
2348
2349
    /* First allocation is just for 2 elements, since we don't know if this
2350
     * scanner will even need a stack. We use 2 instead of 1 to avoid an
2351
     * immediate realloc on the next call.
2352
         */
2353
0
      num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2354
0
    yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
2355
0
                (num_to_alloc * sizeof(struct yy_buffer_state*)
2356
0
                , yyscanner);
2357
0
    if ( ! yyg->yy_buffer_stack )
2358
0
      YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2359
2360
0
    memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2361
2362
0
    yyg->yy_buffer_stack_max = num_to_alloc;
2363
0
    yyg->yy_buffer_stack_top = 0;
2364
0
    return;
2365
0
  }
2366
2367
0
  if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2368
2369
    /* Increase the buffer to prepare for a possible push. */
2370
0
    yy_size_t grow_size = 8 /* arbitrary grow size */;
2371
2372
0
    num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2373
0
    yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
2374
0
                (yyg->yy_buffer_stack,
2375
0
                num_to_alloc * sizeof(struct yy_buffer_state*)
2376
0
                , yyscanner);
2377
0
    if ( ! yyg->yy_buffer_stack )
2378
0
      YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2379
2380
    /* zero only the new slots.*/
2381
0
    memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2382
0
    yyg->yy_buffer_stack_max = num_to_alloc;
2383
0
  }
2384
0
}
2385
/* %endif */
2386
2387
/* %if-c-only */
2388
/** Setup the input buffer state to scan directly from a user-specified character buffer.
2389
 * @param base the character buffer
2390
 * @param size the size in bytes of the character buffer
2391
 * @param yyscanner The scanner object.
2392
 * @return the newly allocated buffer state object.
2393
 */
2394
YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
2395
0
{
2396
0
  YY_BUFFER_STATE b;
2397
    
2398
0
  if ( size < 2 ||
2399
0
       base[size-2] != YY_END_OF_BUFFER_CHAR ||
2400
0
       base[size-1] != YY_END_OF_BUFFER_CHAR )
2401
    /* They forgot to leave room for the EOB's. */
2402
0
    return NULL;
2403
2404
0
  b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
2405
0
  if ( ! b )
2406
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2407
2408
0
  b->yy_buf_size = (int) (size - 2);  /* "- 2" to take care of EOB's */
2409
0
  b->yy_buf_pos = b->yy_ch_buf = base;
2410
0
  b->yy_is_our_buffer = 0;
2411
0
  b->yy_input_file = NULL;
2412
0
  b->yy_n_chars = b->yy_buf_size;
2413
0
  b->yy_is_interactive = 0;
2414
0
  b->yy_at_bol = 1;
2415
0
  b->yy_fill_buffer = 0;
2416
0
  b->yy_buffer_status = YY_BUFFER_NEW;
2417
2418
0
  yy_switch_to_buffer( b , yyscanner );
2419
2420
0
  return b;
2421
0
}
2422
/* %endif */
2423
2424
/* %if-c-only */
2425
/** Setup the input buffer state to scan a string. The next call to yylex() will
2426
 * scan from a @e copy of @a str.
2427
 * @param yystr a NUL-terminated string to scan
2428
 * @param yyscanner The scanner object.
2429
 * @return the newly allocated buffer state object.
2430
 * @note If you want to scan bytes that may contain NUL values, then use
2431
 *       yy_scan_bytes() instead.
2432
 */
2433
YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
2434
0
{
2435
    
2436
0
  return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
2437
0
}
2438
/* %endif */
2439
2440
/* %if-c-only */
2441
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2442
 * scan from a @e copy of @a bytes.
2443
 * @param yybytes the byte buffer to scan
2444
 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2445
 * @param yyscanner The scanner object.
2446
 * @return the newly allocated buffer state object.
2447
 */
2448
YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
2449
0
{
2450
0
  YY_BUFFER_STATE b;
2451
0
  char *buf;
2452
0
  yy_size_t n;
2453
0
  int i;
2454
    
2455
  /* Get memory for full buffer, including space for trailing EOB's. */
2456
0
  n = (yy_size_t) (_yybytes_len + 2);
2457
0
  buf = (char *) yyalloc( n , yyscanner );
2458
0
  if ( ! buf )
2459
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2460
2461
0
  for ( i = 0; i < _yybytes_len; ++i )
2462
0
    buf[i] = yybytes[i];
2463
2464
0
  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2465
2466
0
  b = yy_scan_buffer( buf, n , yyscanner);
2467
0
  if ( ! b )
2468
0
    YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2469
2470
  /* It's okay to grow etc. this buffer, and we should throw it
2471
   * away when we're done.
2472
   */
2473
0
  b->yy_is_our_buffer = 1;
2474
2475
0
  return b;
2476
0
}
2477
/* %endif */
2478
2479
#ifndef YY_EXIT_FAILURE
2480
#define YY_EXIT_FAILURE 2
2481
#endif
2482
2483
/* %if-c-only */
2484
static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
2485
0
{
2486
0
  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2487
0
  (void)yyg;
2488
0
  fprintf( stderr, "%s\n", msg );
2489
0
  exit( YY_EXIT_FAILURE );
2490
0
}
2491
/* %endif */
2492
/* %if-c++-only */
2493
/* %endif */
2494
2495
/* Redefine yyless() so it works in section 3 code. */
2496
2497
#undef yyless
2498
#define yyless(n) \
2499
  do \
2500
    { \
2501
    /* Undo effects of setting up yytext. */ \
2502
        int yyless_macro_arg = (n); \
2503
        YY_LESS_LINENO(yyless_macro_arg);\
2504
    yytext[yyleng] = yyg->yy_hold_char; \
2505
    yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2506
    yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2507
    *yyg->yy_c_buf_p = '\0'; \
2508
    yyleng = yyless_macro_arg; \
2509
    } \
2510
  while ( 0 )
2511
2512
/* Accessor  methods (get/set functions) to struct members. */
2513
2514
/* %if-c-only */
2515
/* %if-reentrant */
2516
2517
/** Get the user-defined data for this scanner.
2518
 * @param yyscanner The scanner object.
2519
 */
2520
YY_EXTRA_TYPE yyget_extra  (yyscan_t yyscanner)
2521
0
{
2522
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2523
0
    return yyextra;
2524
0
}
2525
2526
/* %endif */
2527
2528
/** Get the current line number.
2529
 * @param yyscanner The scanner object.
2530
 */
2531
int yyget_lineno  (yyscan_t yyscanner)
2532
0
{
2533
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2534
2535
0
        if (! YY_CURRENT_BUFFER)
2536
0
            return 0;
2537
    
2538
0
    return yylineno;
2539
0
}
2540
2541
/** Get the current column number.
2542
 * @param yyscanner The scanner object.
2543
 */
2544
int yyget_column  (yyscan_t yyscanner)
2545
0
{
2546
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2547
2548
0
        if (! YY_CURRENT_BUFFER)
2549
0
            return 0;
2550
    
2551
0
    return yycolumn;
2552
0
}
2553
2554
/** Get the input stream.
2555
 * @param yyscanner The scanner object.
2556
 */
2557
FILE *yyget_in  (yyscan_t yyscanner)
2558
0
{
2559
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2560
0
    return yyin;
2561
0
}
2562
2563
/** Get the output stream.
2564
 * @param yyscanner The scanner object.
2565
 */
2566
FILE *yyget_out  (yyscan_t yyscanner)
2567
0
{
2568
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2569
0
    return yyout;
2570
0
}
2571
2572
/** Get the length of the current token.
2573
 * @param yyscanner The scanner object.
2574
 */
2575
int yyget_leng  (yyscan_t yyscanner)
2576
0
{
2577
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2578
0
    return yyleng;
2579
0
}
2580
2581
/** Get the current token.
2582
 * @param yyscanner The scanner object.
2583
 */
2584
2585
char *yyget_text  (yyscan_t yyscanner)
2586
0
{
2587
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2588
0
    return yytext;
2589
0
}
2590
2591
/* %if-reentrant */
2592
2593
/** Set the user-defined data. This data is never touched by the scanner.
2594
 * @param user_defined The data to be associated with this scanner.
2595
 * @param yyscanner The scanner object.
2596
 */
2597
void yyset_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
2598
0
{
2599
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2600
0
    yyextra = user_defined ;
2601
0
}
2602
2603
/* %endif */
2604
2605
/** Set the current line number.
2606
 * @param _line_number line number
2607
 * @param yyscanner The scanner object.
2608
 */
2609
void yyset_lineno (int  _line_number , yyscan_t yyscanner)
2610
0
{
2611
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2612
2613
        /* lineno is only valid if an input buffer exists. */
2614
0
        if (! YY_CURRENT_BUFFER )
2615
0
           YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
2616
    
2617
0
    yylineno = _line_number;
2618
0
}
2619
2620
/** Set the current column.
2621
 * @param _column_no column number
2622
 * @param yyscanner The scanner object.
2623
 */
2624
void yyset_column (int  _column_no , yyscan_t yyscanner)
2625
0
{
2626
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2627
2628
        /* column is only valid if an input buffer exists. */
2629
0
        if (! YY_CURRENT_BUFFER )
2630
0
           YY_FATAL_ERROR( "yyset_column called with no buffer" );
2631
    
2632
0
    yycolumn = _column_no;
2633
0
}
2634
2635
/** Set the input stream. This does not discard the current
2636
 * input buffer.
2637
 * @param _in_str A readable stream.
2638
 * @param yyscanner The scanner object.
2639
 * @see yy_switch_to_buffer
2640
 */
2641
void yyset_in (FILE *  _in_str , yyscan_t yyscanner)
2642
0
{
2643
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2644
0
    yyin = _in_str ;
2645
0
}
2646
2647
void yyset_out (FILE *  _out_str , yyscan_t yyscanner)
2648
0
{
2649
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2650
0
    yyout = _out_str ;
2651
0
}
2652
2653
int yyget_debug  (yyscan_t yyscanner)
2654
0
{
2655
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2656
0
    return yy_flex_debug;
2657
0
}
2658
2659
void yyset_debug (int  _bdebug , yyscan_t yyscanner)
2660
0
{
2661
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2662
0
    yy_flex_debug = _bdebug ;
2663
0
}
2664
2665
/* %endif */
2666
2667
/* %if-reentrant */
2668
/* Accessor methods for yylval and yylloc */
2669
2670
/* %if-bison-bridge */
2671
/* %endif */
2672
2673
/* User-visible API */
2674
2675
/* yylex_init is special because it creates the scanner itself, so it is
2676
 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2677
 * That's why we explicitly handle the declaration, instead of using our macros.
2678
 */
2679
int yylex_init(yyscan_t* ptr_yy_globals)
2680
0
{
2681
0
    if (ptr_yy_globals == NULL){
2682
0
        errno = EINVAL;
2683
0
        return 1;
2684
0
    }
2685
2686
0
    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
2687
2688
0
    if (*ptr_yy_globals == NULL){
2689
0
        errno = ENOMEM;
2690
0
        return 1;
2691
0
    }
2692
2693
    /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2694
0
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2695
2696
0
    return yy_init_globals ( *ptr_yy_globals );
2697
0
}
2698
2699
/* yylex_init_extra has the same functionality as yylex_init, but follows the
2700
 * convention of taking the scanner as the last argument. Note however, that
2701
 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2702
 * is the reason, too, why this function also must handle its own declaration).
2703
 * The user defined value in the first argument will be available to yyalloc in
2704
 * the yyextra field.
2705
 */
2706
int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
2707
0
{
2708
0
    struct yyguts_t dummy_yyguts;
2709
2710
0
    yyset_extra (yy_user_defined, &dummy_yyguts);
2711
2712
0
    if (ptr_yy_globals == NULL){
2713
0
        errno = EINVAL;
2714
0
        return 1;
2715
0
    }
2716
2717
0
    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2718
2719
0
    if (*ptr_yy_globals == NULL){
2720
0
        errno = ENOMEM;
2721
0
        return 1;
2722
0
    }
2723
2724
    /* By setting to 0xAA, we expose bugs in
2725
    yy_init_globals. Leave at 0x00 for releases. */
2726
0
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2727
2728
0
    yyset_extra (yy_user_defined, *ptr_yy_globals);
2729
2730
0
    return yy_init_globals ( *ptr_yy_globals );
2731
0
}
2732
2733
/* %endif if-c-only */
2734
2735
/* %if-c-only */
2736
static int yy_init_globals (yyscan_t yyscanner)
2737
0
{
2738
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2739
    /* Initialization is the same as for the non-reentrant scanner.
2740
     * This function is called from yylex_destroy(), so don't allocate here.
2741
     */
2742
2743
0
    yyg->yy_buffer_stack = NULL;
2744
0
    yyg->yy_buffer_stack_top = 0;
2745
0
    yyg->yy_buffer_stack_max = 0;
2746
0
    yyg->yy_c_buf_p = NULL;
2747
0
    yyg->yy_init = 0;
2748
0
    yyg->yy_start = 0;
2749
2750
0
    yyg->yy_start_stack_ptr = 0;
2751
0
    yyg->yy_start_stack_depth = 0;
2752
0
    yyg->yy_start_stack =  NULL;
2753
2754
/* Defined in main.c */
2755
#ifdef YY_STDINIT
2756
    yyin = stdin;
2757
    yyout = stdout;
2758
#else
2759
0
    yyin = NULL;
2760
0
    yyout = NULL;
2761
0
#endif
2762
2763
    /* For future reference: Set errno on error, since we are called by
2764
     * yylex_init()
2765
     */
2766
0
    return 0;
2767
0
}
2768
/* %endif */
2769
2770
/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
2771
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2772
int yylex_destroy  (yyscan_t yyscanner)
2773
0
{
2774
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2775
2776
    /* Pop the buffer stack, destroying each element. */
2777
0
  while(YY_CURRENT_BUFFER){
2778
0
    yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
2779
0
    YY_CURRENT_BUFFER_LVALUE = NULL;
2780
0
    yypop_buffer_state(yyscanner);
2781
0
  }
2782
2783
  /* Destroy the stack itself. */
2784
0
  yyfree(yyg->yy_buffer_stack , yyscanner);
2785
0
  yyg->yy_buffer_stack = NULL;
2786
2787
    /* Destroy the start condition stack. */
2788
0
        yyfree( yyg->yy_start_stack , yyscanner );
2789
0
        yyg->yy_start_stack = NULL;
2790
2791
    /* Reset the globals. This is important in a non-reentrant scanner so the next time
2792
     * yylex() is called, initialization will occur. */
2793
0
    yy_init_globals( yyscanner);
2794
2795
/* %if-reentrant */
2796
    /* Destroy the main struct (reentrant only). */
2797
0
    yyfree ( yyscanner , yyscanner );
2798
0
    yyscanner = NULL;
2799
/* %endif */
2800
0
    return 0;
2801
0
}
2802
/* %endif */
2803
2804
/*
2805
 * Internal utility routines.
2806
 */
2807
2808
#ifndef yytext_ptr
2809
static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
2810
{
2811
  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2812
  (void)yyg;
2813
2814
  int i;
2815
  for ( i = 0; i < n; ++i )
2816
    s1[i] = s2[i];
2817
}
2818
#endif
2819
2820
#ifdef YY_NEED_STRLEN
2821
static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
2822
{
2823
  int n;
2824
  for ( n = 0; s[n]; ++n )
2825
    ;
2826
2827
  return n;
2828
}
2829
#endif
2830
2831
/* %if-tables-serialization definitions */
2832
/* %define-yytables   The name for this specific scanner's tables. */
2833
#define YYTABLES_NAME "yytables"
2834
/* %endif */
2835
2836
/* %ok-for-header */
2837
2838
#line 383 "/src/wireshark/epan/uat_load.l"
2839
2840
2841
/*
2842
 * Turn diagnostics back on, so we check the code that we've written.
2843
 */
2844
DIAG_ON_FLEX()
2845
2846
bool
2847
uat_load(uat_t *uat, const char *filename, const char* app_env_var_prefix, char **errx)
2848
1.83k
{
2849
1.83k
  char *fname;
2850
1.83k
  FILE *in;
2851
1.83k
  yyscan_t scanner;
2852
1.83k
  uat_load_scanner_state_t state;
2853
2854
1.83k
  if (filename) {
2855
0
    fname = g_strdup(filename);
2856
1.83k
  } else {
2857
1.83k
    fname = uat_get_actual_filename(uat, false, app_env_var_prefix);
2858
1.83k
  }
2859
2860
1.83k
  if (!fname) {
2861
1.83k
    UAT_UPDATE(uat);
2862
2863
1.83k
    if (uat->post_update_cb)
2864
1.20k
      uat->post_update_cb();
2865
2866
1.83k
    return true;
2867
1.83k
  }
2868
2869
2870
0
  if (!(in = ws_fopen(fname,"r"))) {
2871
0
    *errx = g_strdup(g_strerror(errno));
2872
0
    g_free(fname);
2873
0
    return false;
2874
0
  }
2875
2876
0
  if (uat_load_lex_init(&scanner) != 0) {
2877
0
    *errx = g_strdup(g_strerror(errno));
2878
0
    fclose(in);
2879
0
    g_free(fname);
2880
0
    return false;
2881
0
  }
2882
2883
0
  uat_load_set_in(in, scanner);
2884
2885
0
  state.uat = uat;
2886
0
  state.parse_str = NULL; /* we're reading from a file */
2887
2888
0
  state.error = NULL;
2889
0
  state.valid_record = true;
2890
0
  state.colnum = 0;
2891
0
  state.ptrx = NULL;
2892
0
  state.len = 0;
2893
0
  state.record = g_malloc0(uat->record_size);
2894
0
  state.linenum = 1;
2895
0
  state.parse_str_pos = 0;
2896
2897
0
  DUMP(fname);
2898
0
  g_free(fname);  /* we're done with the file name now */
2899
2900
  /* Associate the state with the scanner */
2901
0
  uat_load_set_extra(&state, scanner);
2902
2903
0
  uat_load_lex(scanner);
2904
2905
0
  uat_load_lex_destroy(scanner);
2906
0
  g_free(state.record);
2907
0
  fclose(in);
2908
2909
0
  uat->changed = false;
2910
0
  uat->loaded = true;
2911
0
  UAT_UPDATE(uat);
2912
2913
0
  if (state.error) {
2914
0
    *errx = state.error;
2915
0
    return false;
2916
0
  }
2917
2918
0
  if (uat->post_update_cb)
2919
0
    uat->post_update_cb();
2920
2921
0
  *errx = NULL;
2922
0
  return true;
2923
0
}
2924
2925
bool
2926
uat_load_str(uat_t *uat, const char *entry, char **err)
2927
0
{
2928
0
  yyscan_t scanner;
2929
0
  uat_load_scanner_state_t state;
2930
2931
0
  state.uat = uat;
2932
0
  state.parse_str = ws_strdup_printf("%s\n", entry); /* Records must end with a newline */
2933
2934
0
  state.error = NULL;
2935
0
  state.valid_record = true;
2936
0
  state.colnum = 0;
2937
0
  state.ptrx = NULL;
2938
0
  state.len = 0;
2939
0
  state.record = g_malloc0(uat->record_size);
2940
0
  state.linenum = 1;
2941
0
  state.parse_str_pos = 0;
2942
2943
0
  if (uat_load_lex_init(&scanner) != 0) {
2944
0
    *err = g_strdup(g_strerror(errno));
2945
0
    g_free(state.parse_str);
2946
0
    g_free(state.record);
2947
0
    return false;
2948
0
  }
2949
2950
0
  DUMP(entry);
2951
2952
  /* Associate the state with the scanner */
2953
0
  uat_load_set_extra(&state, scanner);
2954
2955
0
  uat_load_lex(scanner);
2956
2957
0
  uat_load_lex_destroy(scanner);
2958
0
  g_free(state.record);
2959
0
  g_free(state.parse_str);
2960
2961
0
  uat->changed = true;
2962
0
  uat->loaded = true;
2963
0
  UAT_UPDATE(uat);
2964
2965
0
  if (state.error) {
2966
0
    *err = state.error;
2967
0
    return false;
2968
0
  }
2969
2970
0
  if (uat->post_update_cb)
2971
0
    uat->post_update_cb();
2972
2973
0
  *err = NULL;
2974
  return true;
2975
0
}
2976