Coverage Report

Created: 2026-11-12 07:01

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,  378,  382,  383,  385,  386
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
      /* The UAT has its own copy; free the fields parsed into ours. */
1538
0
      if (yyextra->uat->free_cb) {
1539
0
        yyextra->uat->free_cb(yyextra->record);
1540
0
      }
1541
0
      memset(yyextra->record, 0, yyextra->uat->record_size);
1542
0
      yyterminate();
1543
0
    }
1544
0
  }
1545
1546
  /* The record was duplicated to the UAT above, now free our fields. */
1547
0
  if (yyextra->uat->free_cb) {
1548
0
    yyextra->uat->free_cb(yyextra->record);
1549
0
  }
1550
0
  memset(yyextra->record, 0, yyextra->uat->record_size);
1551
1552
0
  yyextra->valid_record = true;
1553
0
  yyextra->colnum = 0;
1554
0
  yyextra->ptrx = NULL;
1555
0
  yyextra->len = 0;
1556
1557
0
  BEGIN START_OF_LINE;
1558
0
 }
1559
0
  YY_BREAK
1560
0
case 13:
1561
0
YY_RULE_SETUP
1562
0
#line 378 "/src/wireshark/epan/uat_load.l"
1563
0
{
1564
0
  ERROR(("unexpected char %s while looking for end of line", yytext));
1565
0
}
1566
0
  YY_BREAK
1567
0
case 14:
1568
/* rule 14 can match eol */
1569
0
YY_RULE_SETUP
1570
0
#line 382 "/src/wireshark/epan/uat_load.l"
1571
0
{ yyextra->linenum++; BEGIN START_OF_LINE; }
1572
0
  YY_BREAK
1573
0
case 15:
1574
0
YY_RULE_SETUP
1575
0
#line 383 "/src/wireshark/epan/uat_load.l"
1576
0
;
1577
0
  YY_BREAK
1578
0
case 16:
1579
/* rule 16 can match eol */
1580
0
YY_RULE_SETUP
1581
0
#line 385 "/src/wireshark/epan/uat_load.l"
1582
0
{ yyextra->linenum++; ERROR(("incomplete record")); }
1583
0
  YY_BREAK
1584
0
case 17:
1585
0
YY_RULE_SETUP
1586
0
#line 386 "/src/wireshark/epan/uat_load.l"
1587
0
{ ERROR(("unexpected input")); }
1588
0
  YY_BREAK
1589
0
case 18:
1590
0
YY_RULE_SETUP
1591
0
#line 388 "/src/wireshark/epan/uat_load.l"
1592
0
ECHO;
1593
0
  YY_BREAK
1594
0
#line 1595 "/work/build/epan/uat_load.c"
1595
0
case YY_STATE_EOF(INITIAL):
1596
0
case YY_STATE_EOF(START_OF_LINE):
1597
0
case YY_STATE_EOF(NEXT_FIELD):
1598
0
case YY_STATE_EOF(SEPARATOR):
1599
0
case YY_STATE_EOF(END_OF_RECORD):
1600
0
case YY_STATE_EOF(ERRORED):
1601
0
  yyterminate();
1602
1603
0
  case YY_END_OF_BUFFER:
1604
0
    {
1605
    /* Amount of text matched not including the EOB char. */
1606
0
    int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1607
1608
    /* Undo the effects of YY_DO_BEFORE_ACTION. */
1609
0
    *yy_cp = yyg->yy_hold_char;
1610
0
    YY_RESTORE_YY_MORE_OFFSET
1611
1612
0
    if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1613
0
      {
1614
      /* We're scanning a new file or input source.  It's
1615
       * possible that this happened because the user
1616
       * just pointed yyin at a new source and called
1617
       * yylex().  If so, then we have to assure
1618
       * consistency between YY_CURRENT_BUFFER and our
1619
       * globals.  Here is the right place to do so, because
1620
       * this is the first action (other than possibly a
1621
       * back-up) that will match for the new input source.
1622
       */
1623
0
      yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1624
/* %if-c-only */
1625
0
      YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1626
/* %endif */
1627
/* %if-c++-only */
1628
/* %endif */
1629
0
      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1630
0
      }
1631
1632
    /* Note that here we test for yy_c_buf_p "<=" to the position
1633
     * of the first EOB in the buffer, since yy_c_buf_p will
1634
     * already have been incremented past the NUL character
1635
     * (since all states make transitions on EOB to the
1636
     * end-of-buffer state).  Contrast this with the test
1637
     * in input().
1638
     */
1639
0
    if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1640
0
      { /* This was really a NUL. */
1641
0
      yy_state_type yy_next_state;
1642
1643
0
      yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1644
1645
0
      yy_current_state = yy_get_previous_state( yyscanner );
1646
1647
      /* Okay, we're now positioned to make the NUL
1648
       * transition.  We couldn't have
1649
       * yy_get_previous_state() go ahead and do it
1650
       * for us because it doesn't know how to deal
1651
       * with the possibility of jamming (and we don't
1652
       * want to build jamming into it because then it
1653
       * will run more slowly).
1654
       */
1655
1656
0
      yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1657
1658
0
      yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1659
1660
0
      if ( yy_next_state )
1661
0
        {
1662
        /* Consume the NUL. */
1663
0
        yy_cp = ++yyg->yy_c_buf_p;
1664
0
        yy_current_state = yy_next_state;
1665
0
        goto yy_match;
1666
0
        }
1667
1668
0
      else
1669
0
        {
1670
/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
1671
0
        yy_cp = yyg->yy_last_accepting_cpos;
1672
0
        yy_current_state = yyg->yy_last_accepting_state;
1673
0
        goto yy_find_action;
1674
0
        }
1675
0
      }
1676
1677
0
    else switch ( yy_get_next_buffer( yyscanner ) )
1678
0
      {
1679
0
      case EOB_ACT_END_OF_FILE:
1680
0
        {
1681
0
        yyg->yy_did_buffer_switch_on_eof = 0;
1682
1683
0
        if ( yywrap( yyscanner ) )
1684
0
          {
1685
          /* Note: because we've taken care in
1686
           * yy_get_next_buffer() to have set up
1687
           * yytext, we can now set up
1688
           * yy_c_buf_p so that if some total
1689
           * hoser (like flex itself) wants to
1690
           * call the scanner after we return the
1691
           * YY_NULL, it'll still work - another
1692
           * YY_NULL will get returned.
1693
           */
1694
0
          yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1695
1696
0
          yy_act = YY_STATE_EOF(YY_START);
1697
0
          goto do_action;
1698
0
          }
1699
1700
0
        else
1701
0
          {
1702
0
          if ( ! yyg->yy_did_buffer_switch_on_eof )
1703
0
            YY_NEW_FILE;
1704
0
          }
1705
0
        break;
1706
0
        }
1707
1708
0
      case EOB_ACT_CONTINUE_SCAN:
1709
0
        yyg->yy_c_buf_p =
1710
0
          yyg->yytext_ptr + yy_amount_of_matched_text;
1711
1712
0
        yy_current_state = yy_get_previous_state( yyscanner );
1713
1714
0
        yy_cp = yyg->yy_c_buf_p;
1715
0
        yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1716
0
        goto yy_match;
1717
1718
0
      case EOB_ACT_LAST_MATCH:
1719
0
        yyg->yy_c_buf_p =
1720
0
        &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1721
1722
0
        yy_current_state = yy_get_previous_state( yyscanner );
1723
1724
0
        yy_cp = yyg->yy_c_buf_p;
1725
0
        yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1726
0
        goto yy_find_action;
1727
0
      }
1728
0
    break;
1729
0
    }
1730
1731
0
  default:
1732
0
    YY_FATAL_ERROR(
1733
0
      "fatal flex scanner internal error--no action found" );
1734
0
  } /* end of action switch */
1735
0
    } /* end of scanning one token */
1736
0
  } /* end of user's declarations */
1737
0
} /* end of yylex */
1738
/* %ok-for-header */
1739
1740
/* %if-c++-only */
1741
/* %not-for-header */
1742
/* %ok-for-header */
1743
1744
/* %endif */
1745
1746
/* yy_get_next_buffer - try to read in a new buffer
1747
 *
1748
 * Returns a code representing an action:
1749
 *  EOB_ACT_LAST_MATCH -
1750
 *  EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1751
 *  EOB_ACT_END_OF_FILE - end of file
1752
 */
1753
/* %if-c-only */
1754
static int yy_get_next_buffer (yyscan_t yyscanner)
1755
/* %endif */
1756
/* %if-c++-only */
1757
/* %endif */
1758
0
{
1759
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1760
0
  char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1761
0
  char *source = yyg->yytext_ptr;
1762
0
  int number_to_move, i;
1763
0
  int ret_val;
1764
1765
0
  if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1766
0
    YY_FATAL_ERROR(
1767
0
    "fatal flex scanner internal error--end of buffer missed" );
1768
1769
0
  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1770
0
    { /* Don't try to fill the buffer, so this is an EOF. */
1771
0
    if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1772
0
      {
1773
      /* We matched a single character, the EOB, so
1774
       * treat this as a final EOF.
1775
       */
1776
0
      return EOB_ACT_END_OF_FILE;
1777
0
      }
1778
1779
0
    else
1780
0
      {
1781
      /* We matched some text prior to the EOB, first
1782
       * process it.
1783
       */
1784
0
      return EOB_ACT_LAST_MATCH;
1785
0
      }
1786
0
    }
1787
1788
  /* Try to read more data. */
1789
1790
  /* First move last chars to start of buffer. */
1791
0
  number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
1792
1793
0
  for ( i = 0; i < number_to_move; ++i )
1794
0
    *(dest++) = *(source++);
1795
1796
0
  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1797
    /* don't do the read, it's not guaranteed to return an EOF,
1798
     * just force an EOF
1799
     */
1800
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1801
1802
0
  else
1803
0
    {
1804
0
      int num_to_read =
1805
0
      YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1806
1807
0
    while ( num_to_read <= 0 )
1808
0
      { /* Not enough room in the buffer - grow it. */
1809
1810
      /* just a shorter name for the current buffer */
1811
0
      YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1812
1813
0
      int yy_c_buf_p_offset =
1814
0
        (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1815
1816
0
      if ( b->yy_is_our_buffer )
1817
0
        {
1818
0
        int new_size = b->yy_buf_size * 2;
1819
1820
0
        if ( new_size <= 0 )
1821
0
          b->yy_buf_size += b->yy_buf_size / 8;
1822
0
        else
1823
0
          b->yy_buf_size *= 2;
1824
1825
0
        b->yy_ch_buf = (char *)
1826
          /* Include room in for 2 EOB chars. */
1827
0
          yyrealloc( (void *) b->yy_ch_buf,
1828
0
               (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
1829
0
        }
1830
0
      else
1831
        /* Can't grow it, we don't own it. */
1832
0
        b->yy_ch_buf = NULL;
1833
1834
0
      if ( ! b->yy_ch_buf )
1835
0
        YY_FATAL_ERROR(
1836
0
        "fatal error - scanner input buffer overflow" );
1837
1838
0
      yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1839
1840
0
      num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1841
0
            number_to_move - 1;
1842
1843
0
      }
1844
1845
0
    if ( num_to_read > YY_READ_BUF_SIZE )
1846
0
      num_to_read = YY_READ_BUF_SIZE;
1847
1848
    /* Read in more data. */
1849
0
    YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1850
0
      yyg->yy_n_chars, num_to_read );
1851
1852
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1853
0
    }
1854
1855
0
  if ( yyg->yy_n_chars == 0 )
1856
0
    {
1857
0
    if ( number_to_move == YY_MORE_ADJ )
1858
0
      {
1859
0
      ret_val = EOB_ACT_END_OF_FILE;
1860
0
      yyrestart( yyin  , yyscanner);
1861
0
      }
1862
1863
0
    else
1864
0
      {
1865
0
      ret_val = EOB_ACT_LAST_MATCH;
1866
0
      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1867
0
        YY_BUFFER_EOF_PENDING;
1868
0
      }
1869
0
    }
1870
1871
0
  else
1872
0
    ret_val = EOB_ACT_CONTINUE_SCAN;
1873
1874
0
  if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1875
    /* Extend the array by 50%, plus the number we really need. */
1876
0
    int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1877
0
    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1878
0
      (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
1879
0
    if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1880
0
      YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1881
    /* "- 2" to take care of EOB's */
1882
0
    YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1883
0
  }
1884
1885
0
  yyg->yy_n_chars += number_to_move;
1886
0
  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1887
0
  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1888
1889
0
  yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1890
1891
0
  return ret_val;
1892
0
}
1893
1894
/* yy_get_previous_state - get the state just before the EOB char was reached */
1895
1896
/* %if-c-only */
1897
/* %not-for-header */
1898
    static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1899
/* %endif */
1900
/* %if-c++-only */
1901
/* %endif */
1902
0
{
1903
0
  yy_state_type yy_current_state;
1904
0
  char *yy_cp;
1905
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1906
1907
/* %% [15.0] code to get the start state into yy_current_state goes here */
1908
0
  yy_current_state = yyg->yy_start;
1909
1910
0
  for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1911
0
    {
1912
/* %% [16.0] code to find the next state goes here */
1913
0
    YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1914
0
    if ( yy_accept[yy_current_state] )
1915
0
      {
1916
0
      yyg->yy_last_accepting_state = yy_current_state;
1917
0
      yyg->yy_last_accepting_cpos = yy_cp;
1918
0
      }
1919
0
    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1920
0
      {
1921
0
      yy_current_state = (int) yy_def[yy_current_state];
1922
0
      if ( yy_current_state >= 76 )
1923
0
        yy_c = yy_meta[yy_c];
1924
0
      }
1925
0
    yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1926
0
    }
1927
1928
0
  return yy_current_state;
1929
0
}
1930
1931
/* yy_try_NUL_trans - try to make a transition on the NUL character
1932
 *
1933
 * synopsis
1934
 *  next_state = yy_try_NUL_trans( current_state );
1935
 */
1936
/* %if-c-only */
1937
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
1938
/* %endif */
1939
/* %if-c++-only */
1940
/* %endif */
1941
0
{
1942
0
  int yy_is_jam;
1943
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1944
/* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
1945
0
  char *yy_cp = yyg->yy_c_buf_p;
1946
1947
0
  YY_CHAR yy_c = 1;
1948
0
  if ( yy_accept[yy_current_state] )
1949
0
    {
1950
0
    yyg->yy_last_accepting_state = yy_current_state;
1951
0
    yyg->yy_last_accepting_cpos = yy_cp;
1952
0
    }
1953
0
  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1954
0
    {
1955
0
    yy_current_state = (int) yy_def[yy_current_state];
1956
0
    if ( yy_current_state >= 76 )
1957
0
      yy_c = yy_meta[yy_c];
1958
0
    }
1959
0
  yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1960
0
  yy_is_jam = (yy_current_state == 75);
1961
1962
0
  (void)yyg;
1963
0
  return yy_is_jam ? 0 : yy_current_state;
1964
0
}
1965
1966
#ifndef YY_NO_UNPUT
1967
/* %if-c-only */
1968
1969
/* %endif */
1970
#endif
1971
1972
/* %if-c-only */
1973
#ifndef YY_NO_INPUT
1974
#ifdef __cplusplus
1975
    static int yyinput (yyscan_t yyscanner)
1976
#else
1977
    static int input  (yyscan_t yyscanner)
1978
#endif
1979
1980
/* %endif */
1981
/* %if-c++-only */
1982
/* %endif */
1983
{
1984
  int c;
1985
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1986
1987
  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1988
1989
  if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1990
    {
1991
    /* yy_c_buf_p now points to the character we want to return.
1992
     * If this occurs *before* the EOB characters, then it's a
1993
     * valid NUL; if not, then we've hit the end of the buffer.
1994
     */
1995
    if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1996
      /* This was really a NUL. */
1997
      *yyg->yy_c_buf_p = '\0';
1998
1999
    else
2000
      { /* need more input */
2001
      int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
2002
      ++yyg->yy_c_buf_p;
2003
2004
      switch ( yy_get_next_buffer( yyscanner ) )
2005
        {
2006
        case EOB_ACT_LAST_MATCH:
2007
          /* This happens because yy_g_n_b()
2008
           * sees that we've accumulated a
2009
           * token and flags that we need to
2010
           * try matching the token before
2011
           * proceeding.  But for input(),
2012
           * there's no matching to consider.
2013
           * So convert the EOB_ACT_LAST_MATCH
2014
           * to EOB_ACT_END_OF_FILE.
2015
           */
2016
2017
          /* Reset buffer status. */
2018
          yyrestart( yyin , yyscanner);
2019
2020
          /*FALLTHROUGH*/
2021
2022
        case EOB_ACT_END_OF_FILE:
2023
          {
2024
          if ( yywrap( yyscanner ) )
2025
            return 0;
2026
2027
          if ( ! yyg->yy_did_buffer_switch_on_eof )
2028
            YY_NEW_FILE;
2029
#ifdef __cplusplus
2030
          return yyinput(yyscanner);
2031
#else
2032
          return input(yyscanner);
2033
#endif
2034
          }
2035
2036
        case EOB_ACT_CONTINUE_SCAN:
2037
          yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2038
          break;
2039
        }
2040
      }
2041
    }
2042
2043
  c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2044
  *yyg->yy_c_buf_p = '\0';  /* preserve yytext */
2045
  yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2046
2047
/* %% [19.0] update BOL and yylineno */
2048
2049
  return c;
2050
}
2051
/* %if-c-only */
2052
#endif  /* ifndef YY_NO_INPUT */
2053
/* %endif */
2054
2055
/** Immediately switch to a different input stream.
2056
 * @param input_file A readable stream.
2057
 * @param yyscanner The scanner object.
2058
 * @note This function does not reset the start condition to @c INITIAL .
2059
 */
2060
/* %if-c-only */
2061
    void yyrestart  (FILE * input_file , yyscan_t yyscanner)
2062
/* %endif */
2063
/* %if-c++-only */
2064
/* %endif */
2065
0
{
2066
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2067
2068
0
  if ( ! YY_CURRENT_BUFFER ){
2069
0
        yyensure_buffer_stack (yyscanner);
2070
0
    YY_CURRENT_BUFFER_LVALUE =
2071
0
            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
2072
0
  }
2073
2074
0
  yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
2075
0
  yy_load_buffer_state( yyscanner );
2076
0
}
2077
2078
/* %if-c++-only */
2079
/* %endif */
2080
2081
/** Switch to a different input buffer.
2082
 * @param new_buffer The new input buffer.
2083
 * @param yyscanner The scanner object.
2084
 */
2085
/* %if-c-only */
2086
    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
2087
/* %endif */
2088
/* %if-c++-only */
2089
/* %endif */
2090
0
{
2091
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2092
2093
  /* TODO. We should be able to replace this entire function body
2094
   * with
2095
   *    yypop_buffer_state();
2096
   *    yypush_buffer_state(new_buffer);
2097
     */
2098
0
  yyensure_buffer_stack (yyscanner);
2099
0
  if ( YY_CURRENT_BUFFER == new_buffer )
2100
0
    return;
2101
2102
0
  if ( YY_CURRENT_BUFFER )
2103
0
    {
2104
    /* Flush out information for old buffer. */
2105
0
    *yyg->yy_c_buf_p = yyg->yy_hold_char;
2106
0
    YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2107
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2108
0
    }
2109
2110
0
  YY_CURRENT_BUFFER_LVALUE = new_buffer;
2111
0
  yy_load_buffer_state( yyscanner );
2112
2113
  /* We don't actually know whether we did this switch during
2114
   * EOF (yywrap()) processing, but the only time this flag
2115
   * is looked at is after yywrap() is called, so it's safe
2116
   * to go ahead and always set it.
2117
   */
2118
0
  yyg->yy_did_buffer_switch_on_eof = 1;
2119
0
}
2120
2121
/* %if-c-only */
2122
static void yy_load_buffer_state  (yyscan_t yyscanner)
2123
/* %endif */
2124
/* %if-c++-only */
2125
/* %endif */
2126
0
{
2127
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2128
0
  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2129
0
  yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2130
/* %if-c-only */
2131
0
  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2132
/* %endif */
2133
/* %if-c++-only */
2134
/* %endif */
2135
0
  yyg->yy_hold_char = *yyg->yy_c_buf_p;
2136
0
}
2137
2138
/** Allocate and initialize an input buffer state.
2139
 * @param file A readable stream.
2140
 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2141
 * @param yyscanner The scanner object.
2142
 * @return the allocated buffer state.
2143
 */
2144
/* %if-c-only */
2145
    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
2146
/* %endif */
2147
/* %if-c++-only */
2148
/* %endif */
2149
0
{
2150
0
  YY_BUFFER_STATE b;
2151
    
2152
0
  b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
2153
0
  if ( ! b )
2154
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2155
2156
0
  b->yy_buf_size = size;
2157
2158
  /* yy_ch_buf has to be 2 characters longer than the size given because
2159
   * we need to put in 2 end-of-buffer characters.
2160
   */
2161
0
  b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
2162
0
  if ( ! b->yy_ch_buf )
2163
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2164
2165
0
  b->yy_is_our_buffer = 1;
2166
2167
0
  yy_init_buffer( b, file , yyscanner);
2168
2169
0
  return b;
2170
0
}
2171
2172
/* %if-c++-only */
2173
/* %endif */
2174
2175
/** Destroy the buffer.
2176
 * @param b a buffer created with yy_create_buffer()
2177
 * @param yyscanner The scanner object.
2178
 */
2179
/* %if-c-only */
2180
    void yy_delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
2181
/* %endif */
2182
/* %if-c++-only */
2183
/* %endif */
2184
0
{
2185
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2186
2187
0
  if ( ! b )
2188
0
    return;
2189
2190
0
  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2191
0
    YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2192
2193
0
  if ( b->yy_is_our_buffer )
2194
0
    yyfree( (void *) b->yy_ch_buf , yyscanner );
2195
2196
0
  yyfree( (void *) b , yyscanner );
2197
0
}
2198
2199
/* Initializes or reinitializes a buffer.
2200
 * This function is sometimes called more than once on the same buffer,
2201
 * such as during a yyrestart() or at EOF.
2202
 */
2203
/* %if-c-only */
2204
    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
2205
/* %endif */
2206
/* %if-c++-only */
2207
/* %endif */
2208
2209
0
{
2210
0
  int oerrno = errno;
2211
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2212
2213
0
  yy_flush_buffer( b , yyscanner);
2214
2215
/* %if-c-only */
2216
0
  b->yy_input_file = file;
2217
/* %endif */
2218
/* %if-c++-only */
2219
/* %endif */
2220
0
  b->yy_fill_buffer = 1;
2221
2222
    /* If b is the current buffer, then yy_init_buffer was _probably_
2223
     * called from yyrestart() or through yy_get_next_buffer.
2224
     * In that case, we don't want to reset the lineno or column.
2225
     */
2226
0
    if (b != YY_CURRENT_BUFFER){
2227
0
        b->yy_bs_lineno = 1;
2228
0
        b->yy_bs_column = 0;
2229
0
    }
2230
2231
/* %if-c-only */
2232
2233
0
        b->yy_is_interactive = 0;
2234
    
2235
/* %endif */
2236
/* %if-c++-only */
2237
/* %endif */
2238
0
  errno = oerrno;
2239
0
}
2240
2241
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2242
 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2243
 * @param yyscanner The scanner object.
2244
 */
2245
/* %if-c-only */
2246
    void yy_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
2247
/* %endif */
2248
/* %if-c++-only */
2249
/* %endif */
2250
0
{
2251
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2252
0
  if ( ! b )
2253
0
    return;
2254
2255
0
  b->yy_n_chars = 0;
2256
2257
  /* We always need two end-of-buffer characters.  The first causes
2258
   * a transition to the end-of-buffer state.  The second causes
2259
   * a jam in that state.
2260
   */
2261
0
  b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2262
0
  b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2263
2264
0
  b->yy_buf_pos = &b->yy_ch_buf[0];
2265
2266
0
  b->yy_at_bol = 1;
2267
0
  b->yy_buffer_status = YY_BUFFER_NEW;
2268
2269
0
  if ( b == YY_CURRENT_BUFFER )
2270
0
    yy_load_buffer_state( yyscanner );
2271
0
}
2272
2273
/* %if-c-or-c++ */
2274
/** Pushes the new state onto the stack. The new state becomes
2275
 *  the current state. This function will allocate the stack
2276
 *  if necessary.
2277
 *  @param new_buffer The new state.
2278
 *  @param yyscanner The scanner object.
2279
 */
2280
/* %if-c-only */
2281
void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2282
/* %endif */
2283
/* %if-c++-only */
2284
/* %endif */
2285
0
{
2286
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2287
0
  if (new_buffer == NULL)
2288
0
    return;
2289
2290
0
  yyensure_buffer_stack(yyscanner);
2291
2292
  /* This block is copied from yy_switch_to_buffer. */
2293
0
  if ( YY_CURRENT_BUFFER )
2294
0
    {
2295
    /* Flush out information for old buffer. */
2296
0
    *yyg->yy_c_buf_p = yyg->yy_hold_char;
2297
0
    YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2298
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2299
0
    }
2300
2301
  /* Only push if top exists. Otherwise, replace top. */
2302
0
  if (YY_CURRENT_BUFFER)
2303
0
    yyg->yy_buffer_stack_top++;
2304
0
  YY_CURRENT_BUFFER_LVALUE = new_buffer;
2305
2306
  /* copied from yy_switch_to_buffer. */
2307
0
  yy_load_buffer_state( yyscanner );
2308
0
  yyg->yy_did_buffer_switch_on_eof = 1;
2309
0
}
2310
/* %endif */
2311
2312
/* %if-c-or-c++ */
2313
/** Removes and deletes the top of the stack, if present.
2314
 *  The next element becomes the new top.
2315
 *  @param yyscanner The scanner object.
2316
 */
2317
/* %if-c-only */
2318
void yypop_buffer_state (yyscan_t yyscanner)
2319
/* %endif */
2320
/* %if-c++-only */
2321
/* %endif */
2322
0
{
2323
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2324
0
  if (!YY_CURRENT_BUFFER)
2325
0
    return;
2326
2327
0
  yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
2328
0
  YY_CURRENT_BUFFER_LVALUE = NULL;
2329
0
  if (yyg->yy_buffer_stack_top > 0)
2330
0
    --yyg->yy_buffer_stack_top;
2331
2332
0
  if (YY_CURRENT_BUFFER) {
2333
0
    yy_load_buffer_state( yyscanner );
2334
0
    yyg->yy_did_buffer_switch_on_eof = 1;
2335
0
  }
2336
0
}
2337
/* %endif */
2338
2339
/* %if-c-or-c++ */
2340
/* Allocates the stack if it does not exist.
2341
 *  Guarantees space for at least one push.
2342
 */
2343
/* %if-c-only */
2344
static void yyensure_buffer_stack (yyscan_t yyscanner)
2345
/* %endif */
2346
/* %if-c++-only */
2347
/* %endif */
2348
0
{
2349
0
  yy_size_t num_to_alloc;
2350
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2351
2352
0
  if (!yyg->yy_buffer_stack) {
2353
2354
    /* First allocation is just for 2 elements, since we don't know if this
2355
     * scanner will even need a stack. We use 2 instead of 1 to avoid an
2356
     * immediate realloc on the next call.
2357
         */
2358
0
      num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2359
0
    yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
2360
0
                (num_to_alloc * sizeof(struct yy_buffer_state*)
2361
0
                , yyscanner);
2362
0
    if ( ! yyg->yy_buffer_stack )
2363
0
      YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2364
2365
0
    memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2366
2367
0
    yyg->yy_buffer_stack_max = num_to_alloc;
2368
0
    yyg->yy_buffer_stack_top = 0;
2369
0
    return;
2370
0
  }
2371
2372
0
  if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2373
2374
    /* Increase the buffer to prepare for a possible push. */
2375
0
    yy_size_t grow_size = 8 /* arbitrary grow size */;
2376
2377
0
    num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2378
0
    yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
2379
0
                (yyg->yy_buffer_stack,
2380
0
                num_to_alloc * sizeof(struct yy_buffer_state*)
2381
0
                , yyscanner);
2382
0
    if ( ! yyg->yy_buffer_stack )
2383
0
      YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2384
2385
    /* zero only the new slots.*/
2386
0
    memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2387
0
    yyg->yy_buffer_stack_max = num_to_alloc;
2388
0
  }
2389
0
}
2390
/* %endif */
2391
2392
/* %if-c-only */
2393
/** Setup the input buffer state to scan directly from a user-specified character buffer.
2394
 * @param base the character buffer
2395
 * @param size the size in bytes of the character buffer
2396
 * @param yyscanner The scanner object.
2397
 * @return the newly allocated buffer state object.
2398
 */
2399
YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
2400
0
{
2401
0
  YY_BUFFER_STATE b;
2402
    
2403
0
  if ( size < 2 ||
2404
0
       base[size-2] != YY_END_OF_BUFFER_CHAR ||
2405
0
       base[size-1] != YY_END_OF_BUFFER_CHAR )
2406
    /* They forgot to leave room for the EOB's. */
2407
0
    return NULL;
2408
2409
0
  b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
2410
0
  if ( ! b )
2411
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2412
2413
0
  b->yy_buf_size = (int) (size - 2);  /* "- 2" to take care of EOB's */
2414
0
  b->yy_buf_pos = b->yy_ch_buf = base;
2415
0
  b->yy_is_our_buffer = 0;
2416
0
  b->yy_input_file = NULL;
2417
0
  b->yy_n_chars = b->yy_buf_size;
2418
0
  b->yy_is_interactive = 0;
2419
0
  b->yy_at_bol = 1;
2420
0
  b->yy_fill_buffer = 0;
2421
0
  b->yy_buffer_status = YY_BUFFER_NEW;
2422
2423
0
  yy_switch_to_buffer( b , yyscanner );
2424
2425
0
  return b;
2426
0
}
2427
/* %endif */
2428
2429
/* %if-c-only */
2430
/** Setup the input buffer state to scan a string. The next call to yylex() will
2431
 * scan from a @e copy of @a str.
2432
 * @param yystr a NUL-terminated string to scan
2433
 * @param yyscanner The scanner object.
2434
 * @return the newly allocated buffer state object.
2435
 * @note If you want to scan bytes that may contain NUL values, then use
2436
 *       yy_scan_bytes() instead.
2437
 */
2438
YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
2439
0
{
2440
    
2441
0
  return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
2442
0
}
2443
/* %endif */
2444
2445
/* %if-c-only */
2446
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2447
 * scan from a @e copy of @a bytes.
2448
 * @param yybytes the byte buffer to scan
2449
 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2450
 * @param yyscanner The scanner object.
2451
 * @return the newly allocated buffer state object.
2452
 */
2453
YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
2454
0
{
2455
0
  YY_BUFFER_STATE b;
2456
0
  char *buf;
2457
0
  yy_size_t n;
2458
0
  int i;
2459
    
2460
  /* Get memory for full buffer, including space for trailing EOB's. */
2461
0
  n = (yy_size_t) (_yybytes_len + 2);
2462
0
  buf = (char *) yyalloc( n , yyscanner );
2463
0
  if ( ! buf )
2464
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2465
2466
0
  for ( i = 0; i < _yybytes_len; ++i )
2467
0
    buf[i] = yybytes[i];
2468
2469
0
  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2470
2471
0
  b = yy_scan_buffer( buf, n , yyscanner);
2472
0
  if ( ! b )
2473
0
    YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2474
2475
  /* It's okay to grow etc. this buffer, and we should throw it
2476
   * away when we're done.
2477
   */
2478
0
  b->yy_is_our_buffer = 1;
2479
2480
0
  return b;
2481
0
}
2482
/* %endif */
2483
2484
#ifndef YY_EXIT_FAILURE
2485
#define YY_EXIT_FAILURE 2
2486
#endif
2487
2488
/* %if-c-only */
2489
static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
2490
0
{
2491
0
  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2492
0
  (void)yyg;
2493
0
  fprintf( stderr, "%s\n", msg );
2494
0
  exit( YY_EXIT_FAILURE );
2495
0
}
2496
/* %endif */
2497
/* %if-c++-only */
2498
/* %endif */
2499
2500
/* Redefine yyless() so it works in section 3 code. */
2501
2502
#undef yyless
2503
#define yyless(n) \
2504
  do \
2505
    { \
2506
    /* Undo effects of setting up yytext. */ \
2507
        int yyless_macro_arg = (n); \
2508
        YY_LESS_LINENO(yyless_macro_arg);\
2509
    yytext[yyleng] = yyg->yy_hold_char; \
2510
    yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2511
    yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2512
    *yyg->yy_c_buf_p = '\0'; \
2513
    yyleng = yyless_macro_arg; \
2514
    } \
2515
  while ( 0 )
2516
2517
/* Accessor  methods (get/set functions) to struct members. */
2518
2519
/* %if-c-only */
2520
/* %if-reentrant */
2521
2522
/** Get the user-defined data for this scanner.
2523
 * @param yyscanner The scanner object.
2524
 */
2525
YY_EXTRA_TYPE yyget_extra  (yyscan_t yyscanner)
2526
0
{
2527
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2528
0
    return yyextra;
2529
0
}
2530
2531
/* %endif */
2532
2533
/** Get the current line number.
2534
 * @param yyscanner The scanner object.
2535
 */
2536
int yyget_lineno  (yyscan_t yyscanner)
2537
0
{
2538
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2539
2540
0
        if (! YY_CURRENT_BUFFER)
2541
0
            return 0;
2542
    
2543
0
    return yylineno;
2544
0
}
2545
2546
/** Get the current column number.
2547
 * @param yyscanner The scanner object.
2548
 */
2549
int yyget_column  (yyscan_t yyscanner)
2550
0
{
2551
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2552
2553
0
        if (! YY_CURRENT_BUFFER)
2554
0
            return 0;
2555
    
2556
0
    return yycolumn;
2557
0
}
2558
2559
/** Get the input stream.
2560
 * @param yyscanner The scanner object.
2561
 */
2562
FILE *yyget_in  (yyscan_t yyscanner)
2563
0
{
2564
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2565
0
    return yyin;
2566
0
}
2567
2568
/** Get the output stream.
2569
 * @param yyscanner The scanner object.
2570
 */
2571
FILE *yyget_out  (yyscan_t yyscanner)
2572
0
{
2573
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2574
0
    return yyout;
2575
0
}
2576
2577
/** Get the length of the current token.
2578
 * @param yyscanner The scanner object.
2579
 */
2580
int yyget_leng  (yyscan_t yyscanner)
2581
0
{
2582
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2583
0
    return yyleng;
2584
0
}
2585
2586
/** Get the current token.
2587
 * @param yyscanner The scanner object.
2588
 */
2589
2590
char *yyget_text  (yyscan_t yyscanner)
2591
0
{
2592
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2593
0
    return yytext;
2594
0
}
2595
2596
/* %if-reentrant */
2597
2598
/** Set the user-defined data. This data is never touched by the scanner.
2599
 * @param user_defined The data to be associated with this scanner.
2600
 * @param yyscanner The scanner object.
2601
 */
2602
void yyset_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
2603
0
{
2604
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2605
0
    yyextra = user_defined ;
2606
0
}
2607
2608
/* %endif */
2609
2610
/** Set the current line number.
2611
 * @param _line_number line number
2612
 * @param yyscanner The scanner object.
2613
 */
2614
void yyset_lineno (int  _line_number , yyscan_t yyscanner)
2615
0
{
2616
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2617
2618
        /* lineno is only valid if an input buffer exists. */
2619
0
        if (! YY_CURRENT_BUFFER )
2620
0
           YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
2621
    
2622
0
    yylineno = _line_number;
2623
0
}
2624
2625
/** Set the current column.
2626
 * @param _column_no column number
2627
 * @param yyscanner The scanner object.
2628
 */
2629
void yyset_column (int  _column_no , yyscan_t yyscanner)
2630
0
{
2631
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2632
2633
        /* column is only valid if an input buffer exists. */
2634
0
        if (! YY_CURRENT_BUFFER )
2635
0
           YY_FATAL_ERROR( "yyset_column called with no buffer" );
2636
    
2637
0
    yycolumn = _column_no;
2638
0
}
2639
2640
/** Set the input stream. This does not discard the current
2641
 * input buffer.
2642
 * @param _in_str A readable stream.
2643
 * @param yyscanner The scanner object.
2644
 * @see yy_switch_to_buffer
2645
 */
2646
void yyset_in (FILE *  _in_str , yyscan_t yyscanner)
2647
0
{
2648
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2649
0
    yyin = _in_str ;
2650
0
}
2651
2652
void yyset_out (FILE *  _out_str , yyscan_t yyscanner)
2653
0
{
2654
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2655
0
    yyout = _out_str ;
2656
0
}
2657
2658
int yyget_debug  (yyscan_t yyscanner)
2659
0
{
2660
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2661
0
    return yy_flex_debug;
2662
0
}
2663
2664
void yyset_debug (int  _bdebug , yyscan_t yyscanner)
2665
0
{
2666
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2667
0
    yy_flex_debug = _bdebug ;
2668
0
}
2669
2670
/* %endif */
2671
2672
/* %if-reentrant */
2673
/* Accessor methods for yylval and yylloc */
2674
2675
/* %if-bison-bridge */
2676
/* %endif */
2677
2678
/* User-visible API */
2679
2680
/* yylex_init is special because it creates the scanner itself, so it is
2681
 * the ONLY reentrant function that doesn't take the scanner as the last argument.
2682
 * That's why we explicitly handle the declaration, instead of using our macros.
2683
 */
2684
int yylex_init(yyscan_t* ptr_yy_globals)
2685
0
{
2686
0
    if (ptr_yy_globals == NULL){
2687
0
        errno = EINVAL;
2688
0
        return 1;
2689
0
    }
2690
2691
0
    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
2692
2693
0
    if (*ptr_yy_globals == NULL){
2694
0
        errno = ENOMEM;
2695
0
        return 1;
2696
0
    }
2697
2698
    /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2699
0
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2700
2701
0
    return yy_init_globals ( *ptr_yy_globals );
2702
0
}
2703
2704
/* yylex_init_extra has the same functionality as yylex_init, but follows the
2705
 * convention of taking the scanner as the last argument. Note however, that
2706
 * this is a *pointer* to a scanner, as it will be allocated by this call (and
2707
 * is the reason, too, why this function also must handle its own declaration).
2708
 * The user defined value in the first argument will be available to yyalloc in
2709
 * the yyextra field.
2710
 */
2711
int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
2712
0
{
2713
0
    struct yyguts_t dummy_yyguts;
2714
2715
0
    yyset_extra (yy_user_defined, &dummy_yyguts);
2716
2717
0
    if (ptr_yy_globals == NULL){
2718
0
        errno = EINVAL;
2719
0
        return 1;
2720
0
    }
2721
2722
0
    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2723
2724
0
    if (*ptr_yy_globals == NULL){
2725
0
        errno = ENOMEM;
2726
0
        return 1;
2727
0
    }
2728
2729
    /* By setting to 0xAA, we expose bugs in
2730
    yy_init_globals. Leave at 0x00 for releases. */
2731
0
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2732
2733
0
    yyset_extra (yy_user_defined, *ptr_yy_globals);
2734
2735
0
    return yy_init_globals ( *ptr_yy_globals );
2736
0
}
2737
2738
/* %endif if-c-only */
2739
2740
/* %if-c-only */
2741
static int yy_init_globals (yyscan_t yyscanner)
2742
0
{
2743
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2744
    /* Initialization is the same as for the non-reentrant scanner.
2745
     * This function is called from yylex_destroy(), so don't allocate here.
2746
     */
2747
2748
0
    yyg->yy_buffer_stack = NULL;
2749
0
    yyg->yy_buffer_stack_top = 0;
2750
0
    yyg->yy_buffer_stack_max = 0;
2751
0
    yyg->yy_c_buf_p = NULL;
2752
0
    yyg->yy_init = 0;
2753
0
    yyg->yy_start = 0;
2754
2755
0
    yyg->yy_start_stack_ptr = 0;
2756
0
    yyg->yy_start_stack_depth = 0;
2757
0
    yyg->yy_start_stack =  NULL;
2758
2759
/* Defined in main.c */
2760
#ifdef YY_STDINIT
2761
    yyin = stdin;
2762
    yyout = stdout;
2763
#else
2764
0
    yyin = NULL;
2765
0
    yyout = NULL;
2766
0
#endif
2767
2768
    /* For future reference: Set errno on error, since we are called by
2769
     * yylex_init()
2770
     */
2771
0
    return 0;
2772
0
}
2773
/* %endif */
2774
2775
/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
2776
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2777
int yylex_destroy  (yyscan_t yyscanner)
2778
0
{
2779
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2780
2781
    /* Pop the buffer stack, destroying each element. */
2782
0
  while(YY_CURRENT_BUFFER){
2783
0
    yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
2784
0
    YY_CURRENT_BUFFER_LVALUE = NULL;
2785
0
    yypop_buffer_state(yyscanner);
2786
0
  }
2787
2788
  /* Destroy the stack itself. */
2789
0
  yyfree(yyg->yy_buffer_stack , yyscanner);
2790
0
  yyg->yy_buffer_stack = NULL;
2791
2792
    /* Destroy the start condition stack. */
2793
0
        yyfree( yyg->yy_start_stack , yyscanner );
2794
0
        yyg->yy_start_stack = NULL;
2795
2796
    /* Reset the globals. This is important in a non-reentrant scanner so the next time
2797
     * yylex() is called, initialization will occur. */
2798
0
    yy_init_globals( yyscanner);
2799
2800
/* %if-reentrant */
2801
    /* Destroy the main struct (reentrant only). */
2802
0
    yyfree ( yyscanner , yyscanner );
2803
0
    yyscanner = NULL;
2804
/* %endif */
2805
0
    return 0;
2806
0
}
2807
/* %endif */
2808
2809
/*
2810
 * Internal utility routines.
2811
 */
2812
2813
#ifndef yytext_ptr
2814
static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
2815
{
2816
  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2817
  (void)yyg;
2818
2819
  int i;
2820
  for ( i = 0; i < n; ++i )
2821
    s1[i] = s2[i];
2822
}
2823
#endif
2824
2825
#ifdef YY_NEED_STRLEN
2826
static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
2827
{
2828
  int n;
2829
  for ( n = 0; s[n]; ++n )
2830
    ;
2831
2832
  return n;
2833
}
2834
#endif
2835
2836
/* %if-tables-serialization definitions */
2837
/* %define-yytables   The name for this specific scanner's tables. */
2838
#define YYTABLES_NAME "yytables"
2839
/* %endif */
2840
2841
/* %ok-for-header */
2842
2843
#line 388 "/src/wireshark/epan/uat_load.l"
2844
2845
2846
/*
2847
 * Turn diagnostics back on, so we check the code that we've written.
2848
 */
2849
DIAG_ON_FLEX()
2850
2851
bool
2852
uat_load(uat_t *uat, const char *filename, const char* app_env_var_prefix, char **errx)
2853
2.14k
{
2854
2.14k
  char *fname;
2855
2.14k
  FILE *in;
2856
2.14k
  yyscan_t scanner;
2857
2.14k
  uat_load_scanner_state_t state;
2858
2859
2.14k
  if (filename) {
2860
0
    fname = g_strdup(filename);
2861
2.14k
  } else {
2862
2.14k
    fname = uat_get_actual_filename(uat, false, app_env_var_prefix);
2863
2.14k
  }
2864
2865
2.14k
  if (!fname) {
2866
2.14k
    UAT_UPDATE(uat);
2867
2868
2.14k
    if (uat->post_update_cb)
2869
1.39k
      uat->post_update_cb();
2870
2871
2.14k
    return true;
2872
2.14k
  }
2873
2874
2875
0
  if (!(in = ws_fopen(fname,"r"))) {
2876
0
    *errx = g_strdup(g_strerror(errno));
2877
0
    g_free(fname);
2878
0
    return false;
2879
0
  }
2880
2881
0
  if (uat_load_lex_init(&scanner) != 0) {
2882
0
    *errx = g_strdup(g_strerror(errno));
2883
0
    fclose(in);
2884
0
    g_free(fname);
2885
0
    return false;
2886
0
  }
2887
2888
0
  uat_load_set_in(in, scanner);
2889
2890
0
  state.uat = uat;
2891
0
  state.parse_str = NULL; /* we're reading from a file */
2892
2893
0
  state.error = NULL;
2894
0
  state.valid_record = true;
2895
0
  state.colnum = 0;
2896
0
  state.ptrx = NULL;
2897
0
  state.len = 0;
2898
0
  state.record = g_malloc0(uat->record_size);
2899
0
  state.linenum = 1;
2900
0
  state.parse_str_pos = 0;
2901
2902
0
  DUMP(fname);
2903
0
  g_free(fname);  /* we're done with the file name now */
2904
2905
  /* Associate the state with the scanner */
2906
0
  uat_load_set_extra(&state, scanner);
2907
2908
0
  uat_load_lex(scanner);
2909
2910
0
  uat_load_lex_destroy(scanner);
2911
0
  g_free(state.record);
2912
0
  fclose(in);
2913
2914
0
  uat->changed = false;
2915
0
  uat->loaded = true;
2916
0
  UAT_UPDATE(uat);
2917
2918
0
  if (state.error) {
2919
0
    *errx = state.error;
2920
0
    return false;
2921
0
  }
2922
2923
0
  if (uat->post_update_cb)
2924
0
    uat->post_update_cb();
2925
2926
0
  *errx = NULL;
2927
0
  return true;
2928
0
}
2929
2930
bool
2931
uat_load_str(uat_t *uat, const char *entry, char **err)
2932
0
{
2933
0
  yyscan_t scanner;
2934
0
  uat_load_scanner_state_t state;
2935
2936
0
  state.uat = uat;
2937
0
  state.parse_str = ws_strdup_printf("%s\n", entry); /* Records must end with a newline */
2938
2939
0
  state.error = NULL;
2940
0
  state.valid_record = true;
2941
0
  state.colnum = 0;
2942
0
  state.ptrx = NULL;
2943
0
  state.len = 0;
2944
0
  state.record = g_malloc0(uat->record_size);
2945
0
  state.linenum = 1;
2946
0
  state.parse_str_pos = 0;
2947
2948
0
  if (uat_load_lex_init(&scanner) != 0) {
2949
0
    *err = g_strdup(g_strerror(errno));
2950
0
    g_free(state.parse_str);
2951
0
    g_free(state.record);
2952
0
    return false;
2953
0
  }
2954
2955
0
  DUMP(entry);
2956
2957
  /* Associate the state with the scanner */
2958
0
  uat_load_set_extra(&state, scanner);
2959
2960
0
  uat_load_lex(scanner);
2961
2962
0
  uat_load_lex_destroy(scanner);
2963
0
  g_free(state.record);
2964
0
  g_free(state.parse_str);
2965
2966
0
  uat->changed = true;
2967
0
  uat->loaded = true;
2968
0
  UAT_UPDATE(uat);
2969
2970
0
  if (state.error) {
2971
0
    *err = state.error;
2972
0
    return false;
2973
0
  }
2974
2975
0
  if (uat->post_update_cb)
2976
0
    uat->post_update_cb();
2977
2978
0
  *err = NULL;
2979
  return true;
2980
0
}
2981