Coverage Report

Created: 2025-08-04 07:15

/work/build/epan/dissectors/radius_dict.c
Line
Count
Source (jump to first uncovered line)
1
#line 2 "/work/build/epan/dissectors/radius_dict.c"
2
/* Include this before everything else, for various large-file definitions */
3
#include "config.h"
4
#include <wireshark.h>
5
6
#line 7 "/work/build/epan/dissectors/radius_dict.c"
7
8
#define  YY_INT_ALIGNED short int
9
10
/* A lexical scanner generated by flex */
11
12
/* %not-for-header */
13
/* %if-c-only */
14
/* %if-not-reentrant */
15
/* %endif */
16
/* %endif */
17
/* %ok-for-header */
18
19
#define FLEX_SCANNER
20
#define YY_FLEX_MAJOR_VERSION 2
21
#define YY_FLEX_MINOR_VERSION 6
22
#define YY_FLEX_SUBMINOR_VERSION 4
23
#if YY_FLEX_SUBMINOR_VERSION > 0
24
#define FLEX_BETA
25
#endif
26
27
/* %if-c++-only */
28
/* %endif */
29
30
/* %if-c-only */
31
#ifdef yy_create_buffer
32
#define Radius__create_buffer_ALREADY_DEFINED
33
#else
34
0
#define yy_create_buffer Radius__create_buffer
35
#endif
36
37
#ifdef yy_delete_buffer
38
#define Radius__delete_buffer_ALREADY_DEFINED
39
#else
40
0
#define yy_delete_buffer Radius__delete_buffer
41
#endif
42
43
#ifdef yy_scan_buffer
44
#define Radius__scan_buffer_ALREADY_DEFINED
45
#else
46
0
#define yy_scan_buffer Radius__scan_buffer
47
#endif
48
49
#ifdef yy_scan_string
50
#define Radius__scan_string_ALREADY_DEFINED
51
#else
52
#define yy_scan_string Radius__scan_string
53
#endif
54
55
#ifdef yy_scan_bytes
56
#define Radius__scan_bytes_ALREADY_DEFINED
57
#else
58
0
#define yy_scan_bytes Radius__scan_bytes
59
#endif
60
61
#ifdef yy_init_buffer
62
#define Radius__init_buffer_ALREADY_DEFINED
63
#else
64
0
#define yy_init_buffer Radius__init_buffer
65
#endif
66
67
#ifdef yy_flush_buffer
68
#define Radius__flush_buffer_ALREADY_DEFINED
69
#else
70
0
#define yy_flush_buffer Radius__flush_buffer
71
#endif
72
73
#ifdef yy_load_buffer_state
74
#define Radius__load_buffer_state_ALREADY_DEFINED
75
#else
76
0
#define yy_load_buffer_state Radius__load_buffer_state
77
#endif
78
79
#ifdef yy_switch_to_buffer
80
#define Radius__switch_to_buffer_ALREADY_DEFINED
81
#else
82
0
#define yy_switch_to_buffer Radius__switch_to_buffer
83
#endif
84
85
#ifdef yypush_buffer_state
86
#define Radius_push_buffer_state_ALREADY_DEFINED
87
#else
88
#define yypush_buffer_state Radius_push_buffer_state
89
#endif
90
91
#ifdef yypop_buffer_state
92
#define Radius_pop_buffer_state_ALREADY_DEFINED
93
#else
94
0
#define yypop_buffer_state Radius_pop_buffer_state
95
#endif
96
97
#ifdef yyensure_buffer_stack
98
#define Radius_ensure_buffer_stack_ALREADY_DEFINED
99
#else
100
0
#define yyensure_buffer_stack Radius_ensure_buffer_stack
101
#endif
102
103
#ifdef yylex
104
#define Radius_lex_ALREADY_DEFINED
105
#else
106
#define yylex Radius_lex
107
#endif
108
109
#ifdef yyrestart
110
#define Radius_restart_ALREADY_DEFINED
111
#else
112
0
#define yyrestart Radius_restart
113
#endif
114
115
#ifdef yylex_init
116
#define Radius_lex_init_ALREADY_DEFINED
117
#else
118
#define yylex_init Radius_lex_init
119
#endif
120
121
#ifdef yylex_init_extra
122
#define Radius_lex_init_extra_ALREADY_DEFINED
123
#else
124
#define yylex_init_extra Radius_lex_init_extra
125
#endif
126
127
#ifdef yylex_destroy
128
#define Radius_lex_destroy_ALREADY_DEFINED
129
#else
130
#define yylex_destroy Radius_lex_destroy
131
#endif
132
133
#ifdef yyget_debug
134
#define Radius_get_debug_ALREADY_DEFINED
135
#else
136
#define yyget_debug Radius_get_debug
137
#endif
138
139
#ifdef yyset_debug
140
#define Radius_set_debug_ALREADY_DEFINED
141
#else
142
#define yyset_debug Radius_set_debug
143
#endif
144
145
#ifdef yyget_extra
146
#define Radius_get_extra_ALREADY_DEFINED
147
#else
148
#define yyget_extra Radius_get_extra
149
#endif
150
151
#ifdef yyset_extra
152
#define Radius_set_extra_ALREADY_DEFINED
153
#else
154
0
#define yyset_extra Radius_set_extra
155
#endif
156
157
#ifdef yyget_in
158
#define Radius_get_in_ALREADY_DEFINED
159
#else
160
#define yyget_in Radius_get_in
161
#endif
162
163
#ifdef yyset_in
164
#define Radius_set_in_ALREADY_DEFINED
165
#else
166
#define yyset_in Radius_set_in
167
#endif
168
169
#ifdef yyget_out
170
#define Radius_get_out_ALREADY_DEFINED
171
#else
172
#define yyget_out Radius_get_out
173
#endif
174
175
#ifdef yyset_out
176
#define Radius_set_out_ALREADY_DEFINED
177
#else
178
#define yyset_out Radius_set_out
179
#endif
180
181
#ifdef yyget_leng
182
#define Radius_get_leng_ALREADY_DEFINED
183
#else
184
#define yyget_leng Radius_get_leng
185
#endif
186
187
#ifdef yyget_text
188
#define Radius_get_text_ALREADY_DEFINED
189
#else
190
#define yyget_text Radius_get_text
191
#endif
192
193
#ifdef yyget_lineno
194
#define Radius_get_lineno_ALREADY_DEFINED
195
#else
196
#define yyget_lineno Radius_get_lineno
197
#endif
198
199
#ifdef yyset_lineno
200
#define Radius_set_lineno_ALREADY_DEFINED
201
#else
202
#define yyset_lineno Radius_set_lineno
203
#endif
204
205
#ifdef yyget_column
206
#define Radius_get_column_ALREADY_DEFINED
207
#else
208
#define yyget_column Radius_get_column
209
#endif
210
211
#ifdef yyset_column
212
#define Radius_set_column_ALREADY_DEFINED
213
#else
214
#define yyset_column Radius_set_column
215
#endif
216
217
#ifdef yywrap
218
#define Radius_wrap_ALREADY_DEFINED
219
#else
220
0
#define yywrap Radius_wrap
221
#endif
222
223
/* %endif */
224
225
#ifdef yyalloc
226
#define Radius_alloc_ALREADY_DEFINED
227
#else
228
0
#define yyalloc Radius_alloc
229
#endif
230
231
#ifdef yyrealloc
232
#define Radius_realloc_ALREADY_DEFINED
233
#else
234
0
#define yyrealloc Radius_realloc
235
#endif
236
237
#ifdef yyfree
238
#define Radius_free_ALREADY_DEFINED
239
#else
240
0
#define yyfree Radius_free
241
#endif
242
243
/* %if-c-only */
244
245
/* %endif */
246
247
/* First, we deal with  platform-specific or compiler-specific issues. */
248
249
/* begin standard C headers. */
250
/* %if-c-only */
251
#include <stdio.h>
252
#include <string.h>
253
#include <errno.h>
254
#include <stdlib.h>
255
/* %endif */
256
257
/* %if-tables-serialization */
258
/* %endif */
259
/* end standard C headers. */
260
261
/* %if-c-or-c++ */
262
/* flex integer type definitions */
263
264
#ifndef FLEXINT_H
265
#define FLEXINT_H
266
267
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
268
269
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
270
271
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
272
 * if you want the limit (max/min) macros for int types. 
273
 */
274
#ifndef __STDC_LIMIT_MACROS
275
#define __STDC_LIMIT_MACROS 1
276
#endif
277
278
#include <inttypes.h>
279
typedef int8_t flex_int8_t;
280
typedef uint8_t flex_uint8_t;
281
typedef int16_t flex_int16_t;
282
typedef uint16_t flex_uint16_t;
283
typedef int32_t flex_int32_t;
284
typedef uint32_t flex_uint32_t;
285
#else
286
typedef signed char flex_int8_t;
287
typedef short int flex_int16_t;
288
typedef int flex_int32_t;
289
typedef unsigned char flex_uint8_t; 
290
typedef unsigned short int flex_uint16_t;
291
typedef unsigned int flex_uint32_t;
292
293
/* Limits of integral types. */
294
#ifndef INT8_MIN
295
#define INT8_MIN               (-128)
296
#endif
297
#ifndef INT16_MIN
298
#define INT16_MIN              (-32767-1)
299
#endif
300
#ifndef INT32_MIN
301
#define INT32_MIN              (-2147483647-1)
302
#endif
303
#ifndef INT8_MAX
304
#define INT8_MAX               (127)
305
#endif
306
#ifndef INT16_MAX
307
#define INT16_MAX              (32767)
308
#endif
309
#ifndef INT32_MAX
310
#define INT32_MAX              (2147483647)
311
#endif
312
#ifndef UINT8_MAX
313
#define UINT8_MAX              (255U)
314
#endif
315
#ifndef UINT16_MAX
316
#define UINT16_MAX             (65535U)
317
#endif
318
#ifndef UINT32_MAX
319
#define UINT32_MAX             (4294967295U)
320
#endif
321
322
#ifndef SIZE_MAX
323
#define SIZE_MAX               (~(size_t)0)
324
#endif
325
326
#endif /* ! C99 */
327
328
#endif /* ! FLEXINT_H */
329
330
/* %endif */
331
332
/* begin standard C++ headers. */
333
/* %if-c++-only */
334
/* %endif */
335
336
/* TODO: this is always defined, so inline it */
337
#define yyconst const
338
339
#if defined(__GNUC__) && __GNUC__ >= 3
340
#define yynoreturn __attribute__((__noreturn__))
341
#else
342
#define yynoreturn
343
#endif
344
345
/* %not-for-header */
346
/* Returned upon end-of-file. */
347
0
#define YY_NULL 0
348
/* %ok-for-header */
349
350
/* %not-for-header */
351
/* Promotes a possibly negative, possibly signed char to an
352
 *   integer in range [0..255] for use as an array index.
353
 */
354
0
#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
355
/* %ok-for-header */
356
357
/* %if-reentrant */
358
359
/* An opaque pointer. */
360
#ifndef YY_TYPEDEF_YY_SCANNER_T
361
#define YY_TYPEDEF_YY_SCANNER_T
362
typedef void* yyscan_t;
363
#endif
364
365
/* For convenience, these vars (plus the bison vars far below)
366
   are macros in the reentrant scanner. */
367
0
#define yyin yyg->yyin_r
368
0
#define yyout yyg->yyout_r
369
0
#define yyextra yyg->yyextra_r
370
0
#define yyleng yyg->yyleng_r
371
0
#define yytext yyg->yytext_r
372
0
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
373
0
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
374
0
#define yy_flex_debug yyg->yy_flex_debug_r
375
376
/* %endif */
377
378
/* %if-not-reentrant */
379
/* %endif */
380
381
/* Enter a start condition.  This macro really ought to take a parameter,
382
 * but we do it the disgusting crufty way forced on us by the ()-less
383
 * definition of BEGIN.
384
 */
385
0
#define BEGIN yyg->yy_start = 1 + 2 *
386
/* Translate the current start state into a value that can be later handed
387
 * to BEGIN to return to the state.  The YYSTATE alias is for lex
388
 * compatibility.
389
 */
390
#define YY_START ((yyg->yy_start - 1) / 2)
391
#define YYSTATE YY_START
392
/* Action number for EOF rule of a given start state. */
393
0
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
394
/* Special action meaning "start processing a new file". */
395
0
#define YY_NEW_FILE yyrestart( yyin , yyscanner )
396
0
#define YY_END_OF_BUFFER_CHAR 0
397
398
/* Size of default input buffer. */
399
#ifndef YY_BUF_SIZE
400
#ifdef __ia64__
401
/* On IA-64, the buffer size is 16k, not 8k.
402
 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
403
 * Ditto for the __ia64__ case accordingly.
404
 */
405
#define YY_BUF_SIZE 32768
406
#else
407
0
#define YY_BUF_SIZE 16384
408
#endif /* __ia64__ */
409
#endif
410
411
/* The state buf must be large enough to hold one state per character in the main buffer.
412
 */
413
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
414
415
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
416
#define YY_TYPEDEF_YY_BUFFER_STATE
417
typedef struct yy_buffer_state *YY_BUFFER_STATE;
418
#endif
419
420
#ifndef YY_TYPEDEF_YY_SIZE_T
421
#define YY_TYPEDEF_YY_SIZE_T
422
typedef size_t yy_size_t;
423
#endif
424
425
/* %if-not-reentrant */
426
/* %endif */
427
428
/* %if-c-only */
429
/* %if-not-reentrant */
430
/* %endif */
431
/* %endif */
432
433
0
#define EOB_ACT_CONTINUE_SCAN 0
434
0
#define EOB_ACT_END_OF_FILE 1
435
0
#define EOB_ACT_LAST_MATCH 2
436
    
437
    #define YY_LESS_LINENO(n)
438
    #define YY_LINENO_REWIND_TO(ptr)
439
    
440
/* Return all but the first "n" matched characters back to the input stream. */
441
#define yyless(n) \
442
  do \
443
    { \
444
    /* Undo effects of setting up yytext. */ \
445
        int yyless_macro_arg = (n); \
446
        YY_LESS_LINENO(yyless_macro_arg);\
447
    *yy_cp = yyg->yy_hold_char; \
448
    YY_RESTORE_YY_MORE_OFFSET \
449
    yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
450
    YY_DO_BEFORE_ACTION; /* set up yytext again */ \
451
    } \
452
  while ( 0 )
453
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
454
455
#ifndef YY_STRUCT_YY_BUFFER_STATE
456
#define YY_STRUCT_YY_BUFFER_STATE
457
struct yy_buffer_state
458
  {
459
/* %if-c-only */
460
  FILE *yy_input_file;
461
/* %endif */
462
463
/* %if-c++-only */
464
/* %endif */
465
466
  char *yy_ch_buf;    /* input buffer */
467
  char *yy_buf_pos;   /* current position in input buffer */
468
469
  /* Size of input buffer in bytes, not including room for EOB
470
   * characters.
471
   */
472
  int yy_buf_size;
473
474
  /* Number of characters read into yy_ch_buf, not including EOB
475
   * characters.
476
   */
477
  int yy_n_chars;
478
479
  /* Whether we "own" the buffer - i.e., we know we created it,
480
   * and can realloc() it to grow it, and should free() it to
481
   * delete it.
482
   */
483
  int yy_is_our_buffer;
484
485
  /* Whether this is an "interactive" input source; if so, and
486
   * if we're using stdio for input, then we want to use getc()
487
   * instead of fread(), to make sure we stop fetching input after
488
   * each newline.
489
   */
490
  int yy_is_interactive;
491
492
  /* Whether we're considered to be at the beginning of a line.
493
   * If so, '^' rules will be active on the next match, otherwise
494
   * not.
495
   */
496
  int yy_at_bol;
497
498
    int yy_bs_lineno; /**< The line count. */
499
    int yy_bs_column; /**< The column count. */
500
501
  /* Whether to try to fill the input buffer when we reach the
502
   * end of it.
503
   */
504
  int yy_fill_buffer;
505
506
  int yy_buffer_status;
507
508
0
#define YY_BUFFER_NEW 0
509
0
#define YY_BUFFER_NORMAL 1
510
  /* When an EOF's been seen but there's still some text to process
511
   * then we mark the buffer as YY_EOF_PENDING, to indicate that we
512
   * shouldn't try reading from the input source any more.  We might
513
   * still have a bunch of tokens to match, though, because of
514
   * possible backing-up.
515
   *
516
   * When we actually see the EOF, we change the status to "new"
517
   * (via yyrestart()), so that the user can continue scanning by
518
   * just pointing yyin at a new input file.
519
   */
520
0
#define YY_BUFFER_EOF_PENDING 2
521
522
  };
523
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
524
525
/* %if-c-only Standard (non-C++) definition */
526
/* %not-for-header */
527
/* %if-not-reentrant */
528
/* %endif */
529
/* %ok-for-header */
530
531
/* %endif */
532
533
/* We provide macros for accessing buffer states in case in the
534
 * future we want to put the buffer states in a more general
535
 * "scanner state".
536
 *
537
 * Returns the top of the stack, or NULL.
538
 */
539
0
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
540
0
                          ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
541
0
                          : NULL)
542
/* Same as previous macro, but useful when we know that the buffer stack is not
543
 * NULL or when we need an lvalue. For internal use only.
544
 */
545
0
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
546
547
/* %if-c-only Standard (non-C++) definition */
548
549
/* %if-not-reentrant */
550
/* %not-for-header */
551
/* %ok-for-header */
552
553
/* %endif */
554
555
void yyrestart ( FILE *input_file , yyscan_t yyscanner );
556
void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
557
YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
558
void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
559
void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
560
void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
561
void yypop_buffer_state ( yyscan_t yyscanner );
562
563
static void yyensure_buffer_stack ( yyscan_t yyscanner );
564
static void yy_load_buffer_state ( yyscan_t yyscanner );
565
static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
566
#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
567
568
YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
569
YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
570
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
571
572
/* %endif */
573
574
void *yyalloc ( yy_size_t , yyscan_t yyscanner );
575
void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
576
void yyfree ( void * , yyscan_t yyscanner );
577
578
#define yy_new_buffer yy_create_buffer
579
#define yy_set_interactive(is_interactive) \
580
  { \
581
  if ( ! YY_CURRENT_BUFFER ){ \
582
        yyensure_buffer_stack (yyscanner); \
583
    YY_CURRENT_BUFFER_LVALUE =    \
584
            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
585
  } \
586
  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
587
  }
588
#define yy_set_bol(at_bol) \
589
  { \
590
  if ( ! YY_CURRENT_BUFFER ){\
591
        yyensure_buffer_stack (yyscanner); \
592
    YY_CURRENT_BUFFER_LVALUE =    \
593
            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
594
  } \
595
  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
596
  }
597
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
598
599
/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
600
/* Begin user sect3 */
601
602
0
#define Radius_wrap(yyscanner) (/*CONSTCOND*/1)
603
#define YY_SKIP_YYWRAP
604
605
#define FLEX_DEBUG
606
typedef flex_uint8_t YY_CHAR;
607
608
typedef int yy_state_type;
609
610
0
#define yytext_ptr yytext_r
611
612
/* %% [1.5] DFA */
613
614
/* %if-c-only Standard (non-C++) definition */
615
616
static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
617
static yy_state_type yy_try_NUL_trans ( yy_state_type current_state  , yyscan_t yyscanner);
618
static int yy_get_next_buffer ( yyscan_t yyscanner );
619
static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
620
621
/* %endif */
622
623
/* Done after the current pattern has been matched and before the
624
 * corresponding action - sets up yytext.
625
 */
626
#define YY_DO_BEFORE_ACTION \
627
0
  yyg->yytext_ptr = yy_bp; \
628
0
/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
629
0
  yyleng = (int) (yy_cp - yy_bp); \
630
0
  yyg->yy_hold_char = *yy_cp; \
631
0
  *yy_cp = '\0'; \
632
0
/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
633
0
  yyg->yy_c_buf_p = yy_cp;
634
/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
635
#define YY_NUM_RULES 63
636
0
#define YY_END_OF_BUFFER 64
637
/* This struct is not used in this scanner,
638
   but its presence is necessary. */
639
struct yy_trans_info
640
  {
641
  flex_int32_t yy_verify;
642
  flex_int32_t yy_nxt;
643
  };
644
static const flex_int16_t yy_accept[344] =
645
    {   0,
646
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
647
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
648
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
649
       15,   15,    0,    0,    0,    0,    0,    0,    0,    0,
650
        0,    0,    0,    0,   17,   17,   64,   63,   62,    2,
651
        1,   63,    1,    1,   63,   63,   18,    1,   19,   19,
652
       30,    1,   31,   31,   50,    1,    1,   50,   50,   50,
653
       50,    1,   50,   50,   50,   50,   56,   55,    1,   55,
654
       55,   55,   57,    1,   58,   58,    2,    1,   59,   59,
655
       61,    2,    1,   63,    2,    1,   63,   12,    1,   14,
656
657
       63,   15,    2,    1,   29,   63,   25,   22,   26,   63,
658
       27,   63,   28,   16,    1,   17,    2,    1,    2,    0,
659
        0,    0,    0,    0,    0,   18,   19,    0,   30,   31,
660
        0,   50,   50,   50,   50,   50,   50,   50,   50,   50,
661
       50,   50,   50,   50,   50,   50,   55,   54,   55,   55,
662
       55,   57,   58,    2,   59,    0,   61,    2,    0,    0,
663
        2,    2,    3,   12,    0,   15,    2,    0,   23,   24,
664
       16,   17,    2,    0,    0,    0,    0,    0,    0,   20,
665
       32,   50,   50,   50,   50,   50,   50,   50,   50,   50,
666
       50,   50,   50,   50,   50,   48,   49,   54,   55,   55,
667
668
       55,   60,    2,    0,    0,    0,    0,    0,    0,    0,
669
        0,   50,   44,   50,   40,   50,   43,   50,   50,   50,
670
       50,   50,   50,   50,   50,   55,   55,   55,    0,    0,
671
        0,    0,    0,    0,    0,    6,    0,   50,   50,   42,
672
       50,   50,   50,   50,   50,   50,   45,   50,   50,   55,
673
       55,   55,    0,    0,    0,    0,    0,    0,    0,    4,
674
       50,   50,   50,   36,   50,   50,   39,   35,   46,   34,
675
       53,   55,   55,    0,    0,    0,    0,    0,    0,   11,
676
        0,   41,   50,   33,   50,   50,    0,   55,   51,    0,
677
       21,    7,    0,    0,    0,    0,   47,   37,   50,    0,
678
679
       54,   51,    0,    5,   10,    0,    0,   50,    0,   35,
680
       52,    0,    0,    9,   38,   52,    0,    0,    0,    8,
681
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
682
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
683
        0,   13,    0
684
    } ;
685
686
static const YY_CHAR yy_ec[256] =
687
    {   0,
688
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
689
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
690
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
691
        1,    2,    1,    1,    4,    5,    1,    1,    1,    1,
692
        1,    1,    1,    6,    7,    8,    9,   10,   11,   11,
693
       12,   13,   14,   15,   16,   16,   16,   17,    1,    1,
694
       18,    1,    1,    1,   19,   20,   21,   22,   23,   24,
695
       25,   26,   27,   28,   29,   30,   31,   32,   33,   34,
696
       35,   36,   37,   38,   39,   40,   28,   41,   42,   28,
697
       43,    1,   44,    1,   45,    1,   46,   47,   48,   49,
698
699
       50,   51,   52,   53,   54,   28,   29,   55,   56,   57,
700
       58,   59,   60,   61,   62,   63,   64,   65,   28,   66,
701
       67,   28,    1,    1,    1,    1,    1,    1,    1,    1,
702
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
703
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
704
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
705
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
706
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
707
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
708
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
709
710
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
711
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
712
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
713
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
714
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
715
        1,    1,    1,    1,    1
716
    } ;
717
718
static const YY_CHAR yy_meta[68] =
719
    {   0,
720
        1,    2,    3,    1,    1,    1,    4,    5,    6,    7,
721
        7,    7,    7,    7,    7,    7,    1,    8,    7,    7,
722
        7,    7,    7,    7,    4,    4,    4,    4,    4,    4,
723
        4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
724
        4,    4,    1,    1,    4,    7,    7,    7,    7,    7,
725
        7,    4,    4,    4,    4,    4,    4,    4,    4,    4,
726
        4,    4,    4,    4,    4,    4,    4
727
    } ;
728
729
static const flex_int16_t yy_base[377] =
730
    {   0,
731
        0,   55,  110,    0,  175,  232,  285,    0,  350,  407,
732
        0,   23,  464,    0,  531,    0,  598,  655,  711,  767,
733
       11,   38,  823,  879,  934,  992, 1052, 1109,   53,   83,
734
     1164, 1219,  108,  158,  133,  186,  200,  257,  300,  327,
735
      243,  361, 1276, 1333, 1388, 1443,  326, 1714, 1714,    0,
736
     1714,   16,   40,   21,   48,  112,    0,    0,  374,  213,
737
        0,    0,  406,  623,    0,   41,   39,   50,   43,   53,
738
      589,    0,   52,  239,   62,   89, 1714,  302,  289,  276,
739
      134,  299,    0,    0,    0,    0,    3,    0,  655,  270,
740
        0,  289,    0,   93,  103,  182,  287,    0,    0, 1714,
741
742
      187,    0,    0,    0, 1714,  288, 1714, 1714, 1714,   30,
743
     1714,   61, 1714,    0,    0,    0,    0,    0,    0,  291,
744
      286,  112,  225,  306,  326,    0,  388,    0,    0,  433,
745
        0,    0,  338,  328,  350,  392,  403,  404,  394,  686,
746
      396,  402,  580,  402,  582,  605,  270,    0,  593,  631,
747
      592,    0,    0,  152,  723,    0,    0,  246,  643,  651,
748
      646,  659,  647,    0,  656,    0,    0,  657, 1714, 1714,
749
        0,    0,    0,  656,  659,  670,  237,  661,  700,    0,
750
        0,  691,  706,  725,  723,  724,  728,  730,  732,  224,
751
      710,  732,  724,  731,  735,    0,    0,    0,  743,  747,
752
753
        0,    0,  740,  745,  747,  749,  763,  761,  767,  769,
754
      762,  775,    0,  765,    0,  770,    0,  777,  787,  814,
755
      787,  778,  796,  788,  807,  826,  833,  828,  816,  828,
756
      815,  829,  201,  831,  827, 1714,  827,  829,  183,    0,
757
      834,  831,  836,  832,  849,  852,    0,  872,  870,  879,
758
      884,  885,  867,  869,  879,  871,  907,  875,  884, 1714,
759
      877,  879,  887,    0,  907,  923,    0,  145,    0,    0,
760
      169,  921,  940,  123,  107,  926,  889,  920,  932, 1714,
761
      938,    0,  927,    0,  932,  947,  988,   72,  225,  955,
762
     1714, 1714,  956,  943,  953,  955,    0,    0,  963, 1018,
763
764
      174, 1714,  974, 1714, 1714,  992,  982,  978, 1064, 1714,
765
       73,  982,  990, 1714,    0,    0, 1013,  989,  994, 1714,
766
     1015, 1023, 1037,   69, 1002, 1042, 1034, 1067, 1035, 1058,
767
       53, 1060, 1066, 1080, 1083, 1078, 1082, 1093, 1100,   35,
768
     1131, 1714, 1714, 1500, 1508, 1516, 1524, 1532, 1540, 1548,
769
     1556, 1564, 1572, 1580, 1588, 1593, 1597, 1601, 1605, 1610,
770
     1617, 1625, 1633, 1641, 1649, 1657, 1662, 1669, 1677, 1682,
771
     1689, 1697,   21,    2, 1705,    0
772
    } ;
773
774
static const flex_int16_t yy_def[377] =
775
    {   0,
776
      344,  344,  344,    3,  345,  345,    3,    7,  346,  346,
777
        7,    7,  343,   13,  343,   15,  347,  347,  348,  348,
778
        7,    7,  349,  349,  350,  350,  351,  351,    7,    7,
779
      352,  352,    7,    7,    7,    7,    7,    7,    7,    7,
780
        7,    7,  353,  353,  354,  354,  343,  343,  343,  355,
781
      343,  343,  343,  343,  343,  343,  356,  356,  343,  343,
782
      357,  357,  343,  343,  358,  358,  358,  358,  358,  358,
783
      358,  358,  358,  358,  358,  358,  343,  359,  359,  359,
784
      359,  359,  360,  360,  361,  361,  362,  361,  343,  343,
785
      363,  364,  363,  365,  366,  365,  365,  367,  367,  343,
786
787
      343,  368,  369,  368,  343,  343,  343,  343,  343,  343,
788
      343,  343,  343,  370,  370,  371,  372,  371,  355,  343,
789
      343,  343,  343,  343,  343,  356,  343,  373,  357,  343,
790
      374,  358,  358,  358,  358,  358,  358,  358,  358,  358,
791
      358,  358,  358,  358,  358,  358,  359,  375,  359,  359,
792
      359,  360,  361,  362,  343,  376,  363,  364,  365,  365,
793
      366,  366,  365,  367,  343,  368,  369,  343,  343,  343,
794
      370,  371,  372,  343,  343,  343,  343,  343,  343,  373,
795
      374,  358,  358,  358,  358,  358,  358,  358,  358,  358,
796
      358,  358,  358,  358,  358,  358,  358,  375,  359,  359,
797
798
      359,  376,  366,  343,  343,  343,  343,  343,  343,  343,
799
      343,  358,  358,  358,  358,  358,  358,  358,  358,  358,
800
      358,  358,  358,  358,  358,  359,  359,  359,  343,  343,
801
      343,  343,  343,  343,  343,  343,  343,  358,  358,  358,
802
      358,  358,  358,  358,  358,  358,  358,  358,  358,  359,
803
      359,  359,  343,  343,  343,  343,  343,  343,  343,  343,
804
      358,  358,  358,  358,  358,  358,  358,  358,  358,  358,
805
      359,  359,  359,  343,  343,  343,  343,  343,  343,  343,
806
      343,  358,  358,  358,  358,  358,  343,  359,  359,  343,
807
      343,  343,  343,  343,  343,  343,  358,  358,  358,  343,
808
809
      375,  343,  343,  343,  343,  343,  343,  358,  343,  343,
810
      375,  343,  343,  343,  358,  375,  343,  343,  343,  343,
811
      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
812
      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
813
      343,  343,    0,  343,  343,  343,  343,  343,  343,  343,
814
      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
815
      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
816
      343,  343,  343,  343,  343,  343
817
    } ;
818
819
static const flex_int16_t yy_nxt[1782] =
820
    {   0,
821
      343,  343,   49,   50,  119,  153,  202,   63,  181,   64,
822
       63,   63,   63,   63,   63,   63,   51,  148,   51,   51,
823
       89,   90,   90,   90,   90,   90,   90,  180,   51,   51,
824
       63,   51,   64,   63,   63,   63,   63,   63,   63,  169,
825
      169,  341,  120,  122,  228,   51,   51,   89,   90,   90,
826
       90,   90,   90,   90,   51,  100,   51,   49,   50,  332,
827
      133,  136,   48,   48,   48,   48,   48,   48,   48,  120,
828
      122,   51,  141,   51,   51,  325,  101,  121,  316,  123,
829
      134,  170,  135,   51,   51,  100,   51,  133,  136,  301,
830
      137,  145,   48,   48,   48,   48,   48,   48,   48,  141,
831
832
       51,   51,  121,  101,  123,  134,  101,  135,  170,   51,
833
      105,   51,   49,   50,   52,  137,  145,   48,   48,   48,
834
       48,   48,   48,   48,  291,  146,   51,  160,   53,   54,
835
      124,  106,   55,  101,  125,  107,  176,  162,   51,   51,
836
      290,   51,   48,  108,   48,  108,   48,   48,   48,   56,
837
      146,  148,  160,  119,  153,   53,   54,  124,  106,   55,
838
      105,  125,  162,  176,   51,  150,   51,   48,   48,   48,
839
       48,   48,   48,   48,   56,   48,   48,   49,   50,   48,
840
       48,  106,   48,   48,  311,  311,  148,  287,  107,  262,
841
      150,   51,   48,   58,   58,   48,  108,   48,  108,   48,
842
843
       48,   48,  109,   58,   58,  110,   58,  257,  106,   48,
844
       48,   48,   48,   48,   48,   48,  160,   48,   48,  165,
845
       58,   58,  127,  127,  127,  127,  127,  127,  127,   58,
846
      302,   58,   48,   48,   49,   50,   48,   48,  220,   48,
847
       48,  160,  148,  209,  165,  113,  177,  119,   51,   48,
848
       58,   58,   48,   48,   48,   48,   48,   48,   48,  109,
849
       58,   58,  110,   58,  142,  143,   48,   48,   48,   48,
850
       48,   48,   48,  177,   48,   48,  144,   58,   58,  155,
851
      155,  155,  155,  155,  155,  155,   58,  148,   58,   48,
852
      119,  142,  143,  148,   59,   60,   60,   60,   60,   60,
853
854
       60,  144,  111,   51,   51,  112,  148,   48,  149,   48,
855
       48,   48,   48,   48,   48,   48,  148,  151,  163,  148,
856
      168,  160,  174,  175,   48,  343,  343,  343,  343,  111,
857
       51,   51,  112,  149,   48,  178,   48,   48,   48,   48,
858
       48,   48,   48,  163,  151,  168,  160,  174,  175,   48,
859
       48,   48,   49,   50,   48,   48,  343,  179,  343,  343,
860
      178,  343,  343,  113,  182,  183,   51,   48,   62,   62,
861
       48,   48,   48,   48,   48,   48,   48,  343,   62,   62,
862
      184,   62,  179,  127,  127,  127,  127,  127,  127,  127,
863
      183,  182,   48,   48,  343,   62,   62,  127,  127,  127,
864
865
      127,  127,  127,  127,   62,  184,   62,   48,   48,   49,
866
       50,   48,   48,  130,  128,  130,  130,  130,  130,  130,
867
      130,  130,  343,   51,   48,   62,   62,  343,  186,  185,
868
      187,  188,  343,  192,  193,   62,   62,  195,   62,  128,
869
      130,  343,  130,  130,  130,  130,  130,  130,  130,   48,
870
       48,  343,   62,   62,  185,  186,  188,  187,  192,  193,
871
      343,   62,  195,   62,   48,   48,   49,   50,   48,   48,
872
       65,   48,   48,   65,   65,   65,   65,   65,   65,   65,
873
       51,   48,   66,   67,   68,   69,   70,   65,   65,   65,
874
       71,   65,   72,   72,   65,   72,   73,   65,   65,   65,
875
876
       74,   75,   65,   76,   65,   65,   48,   48,   65,   66,
877
       67,   68,   69,   70,   65,   65,   65,   71,   72,   65,
878
       72,   73,   65,   65,   65,   74,   75,   65,   76,   65,
879
       65,   48,   48,   77,   50,   48,   48,   78,   48,   48,
880
       78,   78,   78,   78,   78,   78,   78,   51,   48,   79,
881
       79,   80,   78,   81,   78,   78,   82,   78,   78,   79,
882
       79,   78,   79,   78,   78,   78,   78,   78,   78,   78,
883
       78,   78,   78,   48,   48,   78,   79,   79,   80,   78,
884
       81,   78,   78,   82,   78,   79,   78,   79,   78,   78,
885
       78,   78,   78,   78,   78,   78,   78,   78,   48,   48,
886
887
       49,   50,   48,   48,  194,   48,  343,  343,  343,  148,
888
      148,  343,  138,  343,   51,   48,   84,   84,  343,  343,
889
      139,  196,  140,  197,  199,  343,   84,   84,  201,   84,
890
      130,  194,  130,  130,  130,  130,  130,  130,  130,  138,
891
       48,   48,  343,   84,   84,  139,  196,  140,  148,  199,
892
      197,  200,   84,  201,   84,   48,   48,   49,   50,   48,
893
       48,  343,   48,  131,  155,  155,  155,  155,  155,  155,
894
      155,   51,   48,   84,   84,  343,  206,  160,  200,  343,
895
      162,  160,  163,   84,   84,  160,   84,  343,  131,  343,
896
      203,  204,  205,  162,  207,  156,  208,   48,   48,  210,
897
898
       84,   84,  160,  206,  189,  162,  160,  163,  343,   84,
899
      160,   84,   48,   86,   87,  203,  204,  205,  162,  207,
900
      156,  211,  212,  208,  210,  190,  191,   88,  213,   88,
901
       88,  189,  155,  155,  155,  155,  155,  155,  155,   88,
902
       88,  221,   88,  343,  214,  215,  216,  212,  211,  217,
903
      190,  191,  218,  219,  222,  213,   88,   88,  343,  223,
904
      148,  225,  224,  226,  148,   88,  221,   88,   48,   86,
905
       87,  214,  215,  216,  162,  229,  217,  230,  231,  218,
906
      219,  222,  227,   88,  223,   88,   88,  224,  225,  232,
907
      226,  236,  233,  238,  237,   88,   88,  239,   88,  162,
908
909
      229,  241,  230,  231,  234,  240,  235,  227,  242,  245,
910
      248,  343,   88,   88,  343,  246,  232,  233,  236,  237,
911
      238,   88,  239,   88,   48,   49,   92,  343,  241,  234,
912
      240,  235,  243,  247,  253,  242,  245,  248,  249,   93,
913
      246,   93,   93,  148,  250,  148,  254,  244,  256,  259,
914
      148,   93,   93,  255,   93,  343,  263,  265,  247,  243,
915
      258,  253,  260,  249,  261,  252,  264,  266,   93,   93,
916
      343,  250,  244,  254,  251,  256,  259,   93,  255,   93,
917
       48,   49,   92,  263,  265,  258,  267,  260,  268,  261,
918
      252,  264,  266,  269,  270,   93,  148,   93,   93,  251,
919
920
      276,  148,  148,  273,  274,  283,  275,   93,   93,  277,
921
       93,  267,  343,  268,  280,  281,  271,  272,  282,  343,
922
      269,  270,  284,  343,   93,   93,  293,  276,  285,  274,
923
      273,  275,  283,   93,  277,   93,   49,   95,  148,  280,
924
      281,  271,  272,  282,  278,  286,  279,  284,  292,  294,
925
       96,  293,   96,   96,  295,  285,  343,  148,  288,  296,
926
      297,  343,   96,   96,  289,   96,  343,  298,   97,  278,
927
      299,  279,  286,  343,  294,  292,  343,  303,  304,   96,
928
       96,  295,  305,  288,  306,  297,  296,  307,   96,  308,
929
       96,  289,  298,   97,   49,   95,  343,  299,  300,  300,
930
931
      300,  300,  300,  300,  303,  304,  343,  305,   96,  306,
932
       96,   96,  307,  313,  312,  343,  308,  314,  315,  317,
933
       96,   96,  318,   96,  320,  321,   97,  309,  309,  309,
934
      309,  309,  309,  309,  343,  319,  322,   96,   96,  312,
935
      313,  326,  314,  315,  317,  323,   96,  318,   96,  320,
936
      321,   97,   48,   48,   49,   50,   48,   48,  324,   48,
937
       48,  310,  319,  322,  327,  328,  326,  330,   51,   48,
938
       99,   99,  323,  309,  309,  309,  309,  309,  309,  309,
939
       99,   99,  343,   99,  343,  324,  343,  343,  329,  343,
940
      328,  327,  330,  331,   48,   48,  333,   99,   99,  334,
941
942
      343,  343,  335,  336,  337,  338,   99,  310,   99,   48,
943
       48,   49,   50,   48,   48,  329,   48,   48,  331,  339,
944
      340,  333,  343,  343,  334,   51,   48,   99,   99,  335,
945
      336,  337,  338,  343,  343,  343,  343,   99,   99,  343,
946
       99,  342,  342,  342,  342,  342,  339,  340,  343,  343,
947
      343,   48,   48,  343,   99,   99,  343,  343,  343,  343,
948
      343,  343,  343,   99,  343,   99,   49,  103,  343,  343,
949
      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
950
      104,  343,  104,  104,  343,  343,  343,  343,  343,  343,
951
      343,  343,  104,  104,  343,  104,  343,  343,  343,  343,
952
953
      343,  343,  343,  343,  343,  343,  343,  343,  343,  104,
954
      104,  343,  343,  343,  343,  343,  343,  343,  104,  343,
955
      104,   49,  103,  343,  343,  343,  343,  343,  343,  343,
956
      343,  343,  343,  343,  343,  104,  343,  104,  104,  343,
957
      343,  343,  343,  343,  343,  343,  343,  104,  104,  343,
958
      104,  343,  343,  343,  343,  343,  343,  343,  343,  343,
959
      343,  343,  343,  343,  104,  104,  343,  343,  343,  343,
960
      343,  343,  343,  104,  343,  104,   48,   48,   49,   50,
961
       48,   48,  343,   48,   48,  343,  343,  343,  343,  343,
962
      343,  343,   51,   48,  115,  115,  343,  343,  343,  343,
963
964
      343,  343,  343,  343,  115,  115,  343,  115,  343,  343,
965
      343,  343,  343,  343,  343,  343,  343,  343,   48,   48,
966
      343,  115,  115,  343,  343,  343,  343,  343,  343,  343,
967
      115,  343,  115,   48,   48,   49,   50,   48,   48,  343,
968
       48,   48,  343,  343,  343,  343,  343,  343,  343,   51,
969
       48,  115,  115,  343,  343,  343,  343,  343,  343,  343,
970
      343,  115,  115,  343,  115,  343,  343,  343,  343,  343,
971
      343,  343,  343,  343,  343,   48,   48,  343,  115,  115,
972
      343,  343,  343,  343,  343,  343,  343,  115,  343,  115,
973
       49,  117,  343,  343,  343,  343,  343,  343,  343,  343,
974
975
      343,  343,  343,  343,  118,  343,  118,  118,  343,  343,
976
      343,  343,  343,  343,  343,  343,  118,  118,  343,  118,
977
      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
978
      343,  343,  343,  118,  118,  343,  343,  343,  343,  343,
979
      343,  343,  118,  343,  118,   49,  117,  343,  343,  343,
980
      343,  343,  343,  343,  343,  343,  343,  343,  343,  118,
981
      343,  118,  118,  343,  343,  343,  343,  343,  343,  343,
982
      343,  118,  118,  343,  118,  343,  343,  343,  343,  343,
983
      343,  343,  343,  343,  343,  343,  343,  343,  118,  118,
984
      343,  343,  343,  343,  343,  343,  343,  118,  343,  118,
985
986
       48,   48,   48,   48,   48,   48,   48,   48,   57,   57,
987
       57,   57,   57,   57,   57,   57,   61,   61,   61,   61,
988
       61,   61,   61,   61,   83,   83,   83,   83,   83,   83,
989
       83,   83,   85,   85,   85,   85,   85,   85,   85,   85,
990
       91,   91,   91,   91,   91,   91,   91,   91,   94,   94,
991
       94,   94,   94,   94,   94,   94,   98,   98,   98,   98,
992
       98,   98,   98,   98,  102,  102,  102,  102,  102,  102,
993
      102,  102,  114,  114,  114,  114,  114,  114,  114,  114,
994
      116,  116,  116,  116,  116,  116,  116,  116,  119,  119,
995
      343,  119,  119,  119,  119,  119,  126,  343,  343,  126,
996
997
      129,  129,  129,  129,  132,  343,  343,  132,  147,  343,
998
      343,  147,  147,  152,  343,  152,  152,  153,  343,  153,
999
      153,  153,  153,  153,  153,  154,  154,  154,  154,  154,
1000
      154,  154,  154,  157,  343,  343,  157,  157,  157,  157,
1001
      157,  158,  158,  343,  158,  158,  158,  158,  158,  159,
1002
      159,  343,  159,  159,  159,  159,  159,  161,  161,  343,
1003
      161,  161,  161,  161,  161,  164,  343,  343,  164,  166,
1004
      166,  343,  166,  166,  166,  166,  166,  167,  167,  343,
1005
      167,  167,  167,  167,  167,  171,  343,  343,  171,  172,
1006
      172,  343,  172,  172,  172,  172,  172,  173,  173,  343,
1007
1008
      173,  173,  173,  173,  173,  198,  198,  343,  198,  198,
1009
      198,  198,  198,   47,  343,  343,  343,  343,  343,  343,
1010
      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
1011
      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
1012
      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
1013
      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
1014
      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
1015
      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
1016
      343
1017
    } ;
1018
1019
static const flex_int16_t yy_chk[1782] =
1020
    {   0,
1021
        0,    0,    1,    1,   87,   87,  376,   11,  374,   11,
1022
       11,   11,   11,   11,   11,   11,    1,  201,    1,    1,
1023
       21,   21,   21,   21,   21,   21,   21,  373,    1,    1,
1024
       12,    1,   12,   12,   12,   12,   12,   12,   12,  110,
1025
      110,  340,   52,   54,  201,    1,    1,   22,   22,   22,
1026
       22,   22,   22,   22,    1,   29,    1,    2,    2,  331,
1027
       66,   69,   29,   29,   29,   29,   29,   29,   29,   52,
1028
       54,    2,   73,    2,    2,  324,   29,   53,  311,   55,
1029
       67,  112,   68,    2,    2,   30,    2,   66,   69,  288,
1030
       70,   75,   30,   30,   30,   30,   30,   30,   30,   73,
1031
1032
        2,    2,   53,   29,   55,   67,   30,   68,  112,    2,
1033
       33,    2,    3,    3,    3,   70,   75,   33,   33,   33,
1034
       33,   33,   33,   33,  275,   76,    3,   94,    3,    3,
1035
       56,   33,    3,   30,   56,   35,  122,   95,    3,    3,
1036
      274,    3,   35,   35,   35,   35,   35,   35,   35,    3,
1037
       76,   81,   94,  154,  154,    3,    3,   56,   33,    3,
1038
       34,   56,   95,  122,    3,   81,    3,   34,   34,   34,
1039
       34,   34,   34,   34,    3,    5,    5,    5,    5,    5,
1040
        5,   34,    5,    5,  301,  301,  271,  268,   36,  239,
1041
       81,    5,    5,    5,    5,   36,   36,   36,   36,   36,
1042
1043
       36,   36,   37,    5,    5,   37,    5,  233,   34,   37,
1044
       37,   37,   37,   37,   37,   37,   96,    5,    5,  101,
1045
        5,    5,   60,   60,   60,   60,   60,   60,   60,    5,
1046
      289,    5,    6,    6,    6,    6,    6,    6,  190,    6,
1047
        6,   96,  289,  177,  101,   41,  123,  158,    6,    6,
1048
        6,    6,   41,   41,   41,   41,   41,   41,   41,   38,
1049
        6,    6,   38,    6,   74,   74,   38,   38,   38,   38,
1050
       38,   38,   38,  123,    6,    6,   74,    6,    6,   90,
1051
       90,   90,   90,   90,   90,   90,    6,  147,    6,    7,
1052
       92,   74,   74,   80,    7,    7,    7,    7,    7,    7,
1053
1054
        7,   74,   39,    7,    7,   39,   79,    7,   80,   39,
1055
       39,   39,   39,   39,   39,   39,   82,   82,   97,   78,
1056
      106,   97,  120,  121,    7,   47,    0,    0,    0,   40,
1057
        7,    7,   40,   80,    7,  124,   40,   40,   40,   40,
1058
       40,   40,   40,   97,   82,  106,   97,  120,  121,    7,
1059
        9,    9,    9,    9,    9,    9,    0,  125,    0,    0,
1060
      124,    0,    0,   42,  133,  134,    9,    9,    9,    9,
1061
       42,   42,   42,   42,   42,   42,   42,    0,    9,    9,
1062
      135,    9,  125,   59,   59,   59,   59,   59,   59,   59,
1063
      134,  133,    9,    9,    0,    9,    9,  127,  127,  127,
1064
1065
      127,  127,  127,  127,    9,  135,    9,   10,   10,   10,
1066
       10,   10,   10,   63,   59,   63,   63,   63,   63,   63,
1067
       63,   63,    0,   10,   10,   10,   10,    0,  137,  136,
1068
      138,  139,    0,  141,  142,   10,   10,  144,   10,   59,
1069
      130,    0,  130,  130,  130,  130,  130,  130,  130,   10,
1070
       10,    0,   10,   10,  136,  137,  139,  138,  141,  142,
1071
        0,   10,  144,   10,   13,   13,   13,   13,   13,   13,
1072
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
1073
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
1074
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
1075
1076
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
1077
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
1078
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
1079
       13,   15,   15,   15,   15,   15,   15,   15,   15,   15,
1080
       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
1081
       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
1082
       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
1083
       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
1084
       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
1085
       15,   15,   15,   15,   15,   15,   15,   15,   17,   17,
1086
1087
       17,   17,   17,   17,  143,   17,    0,    0,    0,  151,
1088
      149,    0,   71,    0,   17,   17,   17,   17,    0,    0,
1089
       71,  145,   71,  146,  149,    0,   17,   17,  151,   17,
1090
       64,  143,   64,   64,   64,   64,   64,   64,   64,   71,
1091
       17,   17,    0,   17,   17,   71,  145,   71,  150,  149,
1092
      146,  150,   17,  151,   17,   18,   18,   18,   18,   18,
1093
       18,    0,   18,   64,   89,   89,   89,   89,   89,   89,
1094
       89,   18,   18,   18,   18,    0,  174,  159,  150,    0,
1095
      161,  163,  160,   18,   18,  160,   18,    0,   64,    0,
1096
      162,  165,  168,  162,  175,   89,  176,   18,   18,  178,
1097
1098
       18,   18,  159,  174,  140,  161,  163,  160,    0,   18,
1099
      160,   18,   19,   19,   19,  162,  165,  168,  162,  175,
1100
       89,  179,  182,  176,  178,  140,  140,   19,  183,   19,
1101
       19,  140,  155,  155,  155,  155,  155,  155,  155,   19,
1102
       19,  191,   19,    0,  184,  185,  186,  182,  179,  187,
1103
      140,  140,  188,  189,  192,  183,   19,   19,    0,  193,
1104
      199,  195,  194,  199,  200,   19,  191,   19,   20,   20,
1105
       20,  184,  185,  186,  203,  204,  187,  205,  206,  188,
1106
      189,  192,  200,   20,  193,   20,   20,  194,  195,  207,
1107
      199,  210,  208,  212,  211,   20,   20,  214,   20,  203,
1108
1109
      204,  218,  205,  206,  209,  216,  209,  200,  219,  221,
1110
      224,    0,   20,   20,    0,  222,  207,  208,  210,  211,
1111
      212,   20,  214,   20,   23,   23,   23,    0,  218,  209,
1112
      216,  209,  220,  223,  229,  219,  221,  224,  225,   23,
1113
      222,   23,   23,  226,  226,  228,  230,  220,  232,  235,
1114
      227,   23,   23,  231,   23,    0,  241,  243,  223,  220,
1115
      234,  229,  237,  225,  238,  228,  242,  244,   23,   23,
1116
        0,  226,  220,  230,  227,  232,  235,   23,  231,   23,
1117
       24,   24,   24,  241,  243,  234,  245,  237,  246,  238,
1118
      228,  242,  244,  248,  249,   24,  250,   24,   24,  227,
1119
1120
      255,  251,  252,  252,  253,  262,  254,   24,   24,  256,
1121
       24,  245,    0,  246,  258,  259,  250,  251,  261,    0,
1122
      248,  249,  263,    0,   24,   24,  277,  255,  265,  253,
1123
      252,  254,  262,   24,  256,   24,   25,   25,  272,  258,
1124
      259,  250,  251,  261,  257,  266,  257,  263,  276,  278,
1125
       25,  277,   25,   25,  279,  265,    0,  273,  272,  281,
1126
      283,    0,   25,   25,  273,   25,    0,  285,   25,  257,
1127
      286,  257,  266,    0,  278,  276,    0,  290,  293,   25,
1128
       25,  279,  294,  272,  295,  283,  281,  296,   25,  299,
1129
       25,  273,  285,   25,   26,   26,    0,  286,  287,  287,
1130
1131
      287,  287,  287,  287,  290,  293,    0,  294,   26,  295,
1132
       26,   26,  296,  306,  303,    0,  299,  307,  308,  312,
1133
       26,   26,  313,   26,  318,  319,   26,  300,  300,  300,
1134
      300,  300,  300,  300,    0,  317,  321,   26,   26,  303,
1135
      306,  325,  307,  308,  312,  322,   26,  313,   26,  318,
1136
      319,   26,   27,   27,   27,   27,   27,   27,  323,   27,
1137
       27,  300,  317,  321,  326,  327,  325,  329,   27,   27,
1138
       27,   27,  322,  309,  309,  309,  309,  309,  309,  309,
1139
       27,   27,    0,   27,    0,  323,    0,    0,  328,    0,
1140
      327,  326,  329,  330,   27,   27,  332,   27,   27,  333,
1141
1142
        0,    0,  334,  335,  336,  337,   27,  309,   27,   28,
1143
       28,   28,   28,   28,   28,  328,   28,   28,  330,  338,
1144
      339,  332,    0,    0,  333,   28,   28,   28,   28,  334,
1145
      335,  336,  337,    0,    0,    0,    0,   28,   28,    0,
1146
       28,  341,  341,  341,  341,  341,  338,  339,    0,    0,
1147
        0,   28,   28,    0,   28,   28,    0,    0,    0,    0,
1148
        0,    0,    0,   28,    0,   28,   31,   31,    0,    0,
1149
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1150
       31,    0,   31,   31,    0,    0,    0,    0,    0,    0,
1151
        0,    0,   31,   31,    0,   31,    0,    0,    0,    0,
1152
1153
        0,    0,    0,    0,    0,    0,    0,    0,    0,   31,
1154
       31,    0,    0,    0,    0,    0,    0,    0,   31,    0,
1155
       31,   32,   32,    0,    0,    0,    0,    0,    0,    0,
1156
        0,    0,    0,    0,    0,   32,    0,   32,   32,    0,
1157
        0,    0,    0,    0,    0,    0,    0,   32,   32,    0,
1158
       32,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1159
        0,    0,    0,    0,   32,   32,    0,    0,    0,    0,
1160
        0,    0,    0,   32,    0,   32,   43,   43,   43,   43,
1161
       43,   43,    0,   43,   43,    0,    0,    0,    0,    0,
1162
        0,    0,   43,   43,   43,   43,    0,    0,    0,    0,
1163
1164
        0,    0,    0,    0,   43,   43,    0,   43,    0,    0,
1165
        0,    0,    0,    0,    0,    0,    0,    0,   43,   43,
1166
        0,   43,   43,    0,    0,    0,    0,    0,    0,    0,
1167
       43,    0,   43,   44,   44,   44,   44,   44,   44,    0,
1168
       44,   44,    0,    0,    0,    0,    0,    0,    0,   44,
1169
       44,   44,   44,    0,    0,    0,    0,    0,    0,    0,
1170
        0,   44,   44,    0,   44,    0,    0,    0,    0,    0,
1171
        0,    0,    0,    0,    0,   44,   44,    0,   44,   44,
1172
        0,    0,    0,    0,    0,    0,    0,   44,    0,   44,
1173
       45,   45,    0,    0,    0,    0,    0,    0,    0,    0,
1174
1175
        0,    0,    0,    0,   45,    0,   45,   45,    0,    0,
1176
        0,    0,    0,    0,    0,    0,   45,   45,    0,   45,
1177
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1178
        0,    0,    0,   45,   45,    0,    0,    0,    0,    0,
1179
        0,    0,   45,    0,   45,   46,   46,    0,    0,    0,
1180
        0,    0,    0,    0,    0,    0,    0,    0,    0,   46,
1181
        0,   46,   46,    0,    0,    0,    0,    0,    0,    0,
1182
        0,   46,   46,    0,   46,    0,    0,    0,    0,    0,
1183
        0,    0,    0,    0,    0,    0,    0,    0,   46,   46,
1184
        0,    0,    0,    0,    0,    0,    0,   46,    0,   46,
1185
1186
      344,  344,  344,  344,  344,  344,  344,  344,  345,  345,
1187
      345,  345,  345,  345,  345,  345,  346,  346,  346,  346,
1188
      346,  346,  346,  346,  347,  347,  347,  347,  347,  347,
1189
      347,  347,  348,  348,  348,  348,  348,  348,  348,  348,
1190
      349,  349,  349,  349,  349,  349,  349,  349,  350,  350,
1191
      350,  350,  350,  350,  350,  350,  351,  351,  351,  351,
1192
      351,  351,  351,  351,  352,  352,  352,  352,  352,  352,
1193
      352,  352,  353,  353,  353,  353,  353,  353,  353,  353,
1194
      354,  354,  354,  354,  354,  354,  354,  354,  355,  355,
1195
        0,  355,  355,  355,  355,  355,  356,    0,    0,  356,
1196
1197
      357,  357,  357,  357,  358,    0,    0,  358,  359,    0,
1198
        0,  359,  359,  360,    0,  360,  360,  361,    0,  361,
1199
      361,  361,  361,  361,  361,  362,  362,  362,  362,  362,
1200
      362,  362,  362,  363,    0,    0,  363,  363,  363,  363,
1201
      363,  364,  364,    0,  364,  364,  364,  364,  364,  365,
1202
      365,    0,  365,  365,  365,  365,  365,  366,  366,    0,
1203
      366,  366,  366,  366,  366,  367,    0,    0,  367,  368,
1204
      368,    0,  368,  368,  368,  368,  368,  369,  369,    0,
1205
      369,  369,  369,  369,  369,  370,    0,    0,  370,  371,
1206
      371,    0,  371,  371,  371,  371,  371,  372,  372,    0,
1207
1208
      372,  372,  372,  372,  372,  375,  375,    0,  375,  375,
1209
      375,  375,  375,  343,  343,  343,  343,  343,  343,  343,
1210
      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
1211
      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
1212
      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
1213
      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
1214
      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
1215
      343,  343,  343,  343,  343,  343,  343,  343,  343,  343,
1216
      343
1217
    } ;
1218
1219
static const flex_int16_t yy_rule_linenum[63] =
1220
    {   0,
1221
      185,  186,  188,  190,  191,  192,  193,  194,  195,  196,
1222
      197,  199,  206,  222,  224,  233,  246,  261,  268,  272,
1223
      276,  279,  283,  287,  291,  292,  293,  294,  295,  301,
1224
      302,  303,  304,  305,  306,  307,  308,  309,  310,  311,
1225
      312,  313,  314,  315,  316,  317,  318,  319,  320,  321,
1226
      322,  323,  324,  325,  326,  352,  363,  364,  365,  366,
1227
      368,  444
1228
    } ;
1229
1230
/* The intent behind this definition is that it'll catch
1231
 * any uses of REJECT which flex missed.
1232
 */
1233
#define REJECT reject_used_but_not_detected
1234
#define yymore() yymore_used_but_not_detected
1235
0
#define YY_MORE_ADJ 0
1236
#define YY_RESTORE_YY_MORE_OFFSET
1237
#line 1 "/src/wireshark/epan/dissectors/radius_dict.l"
1238
1239
/*
1240
 * We want a reentrant scanner.
1241
 */
1242
/*
1243
 * We don't use input, so don't generate code for it.
1244
 */
1245
#define YY_NO_INPUT 1
1246
/*
1247
 * We don't use unput, so don't generate code for it.
1248
 */
1249
/*
1250
 * We don't read interactively from the terminal.
1251
 */
1252
/*
1253
 * We want to stop processing when we get to the end of the input.
1254
 */
1255
/*
1256
 * The language we're scanning is case-insensitive.
1257
 */
1258
/*
1259
 * The type for the state we keep for a scanner.
1260
 */
1261
/*
1262
 * We have to override the memory allocators so that we don't get
1263
 * "unused argument" warnings from the yyscanner argument (which
1264
 * we don't use, as we have a global memory allocator).
1265
 *
1266
 * We provide, as macros, our own versions of the routines generated by Flex,
1267
 * which just call malloc()/realloc()/free() (as the Flex versions do),
1268
 * discarding the extra argument.
1269
 */
1270
/*
1271
 * Prefix scanner routines with "Radius_" rather than "yy", so this scanner
1272
 * can coexist with other scanners.
1273
 */
1274
#line 62 "/src/wireshark/epan/dissectors/radius_dict.l"
1275
  /* radius_dict.l
1276
  *
1277
  * RADIUS dictionary parser
1278
  *
1279
  * Wireshark - Network traffic analyzer
1280
  * By Gerald Combs <gerald@wireshark.org>
1281
  * Copyright 1998 Gerald Combs
1282
  *
1283
  * SPDX-License-Identifier: GPL-2.0-or-later
1284
  */
1285
1286
#include <glib.h>
1287
#include <stdio.h>
1288
#include <stdlib.h>
1289
#include <string.h>
1290
#include <errno.h>
1291
#include <epan/packet.h>
1292
#include <epan/dissectors/packet-radius.h>
1293
#include <wsutil/file_util.h>
1294
1295
/*
1296
 * Disable diagnostics in the code generated by Flex.
1297
 */
1298
DIAG_OFF_FLEX()
1299
1300
/*
1301
 * See
1302
 *
1303
 *  http://freeradius.org/radiusd/man/dictionary.html
1304
 *
1305
 * for the format of RADIUS dictionary files.
1306
 *
1307
 * XXX - features not currently supported:
1308
 *
1309
 *  integer64, ipv4prefix, combo-prefix, bool, size, decimal,
1310
 *  timeval, struct, extended, long-extended, vsa, evs, vendor,
1311
 *  cidr, uint{8,16,32,64}, int{8,16,32,64} as attribute types
1312
 *  (some of these aren't documented);
1313
 *
1314
 *  octets[N], where N is an integer, as an attribute type
1315
 *  (not documented in the man page) - we support this as the octets
1316
 *  type but do not enforce the length (e.g., with an expert info).
1317
 *  FreeRADIUS uses the length for encoding; as we're just decoding,
1318
 *  we take whatever is indicated in the AVP;
1319
 *
1320
 *  internal, array, and virtual as attribute flags (not
1321
 *  documented in the man page);
1322
 *
1323
 * We alter the dictionaries for TLVs by unwrapping them. It would be
1324
 * better to support the format as-is. We look up the TLVs by name;
1325
 * this probably doesn't work with the current master (pre-4.0) version
1326
 * of FreeRADIUS's dictionary files, because the vendor prefix was removed
1327
 * from the attributes, so they're not as likely to be unique.
1328
 *
1329
 * We should, perhaps, adopt FreeRADIUS's dictionary-parsing code in
1330
 * src/lib/dict.c and use that, rather than writing our own parser.
1331
 * See bug 13176.
1332
 */
1333
0
#define YY_USER_INIT BEGIN WS_OUT;
1334
1335
#define ECHO
1336
0
#define MAX_INCLUDE_DEPTH 10
1337
1338
typedef struct {
1339
  YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
1340
  int include_stack_ptr;
1341
1342
  radius_dictionary_t* dict;
1343
  GHashTable* value_strings; /* GArray(value_string) by attribute name */
1344
1345
  char* attr_name;
1346
  char* attr_id;
1347
  radius_attr_dissector_t* attr_type;
1348
  char* attr_vendor;
1349
  char* vendor_name;
1350
  uint32_t vendor_id;
1351
  unsigned vendor_type_octets;
1352
  unsigned vendor_length_octets;
1353
  bool vendor_has_flags;
1354
  char* value_repr;
1355
  unsigned encrypted;
1356
  bool has_tag;
1357
  bool concat;
1358
  char* current_vendor;
1359
  unsigned current_vendor_evs_type;
1360
1361
  int tlv_stack_ptr;
1362
  char* tlv_stack[MAX_INCLUDE_DEPTH];
1363
1364
  char* directory;
1365
  char* fullpaths[MAX_INCLUDE_DEPTH];
1366
  int linenums[MAX_INCLUDE_DEPTH];
1367
1368
  GString* error;
1369
} Radius_scanner_state_t;
1370
1371
static void add_vendor(Radius_scanner_state_t* state, const char* name, uint32_t id, unsigned type_octets, unsigned length_octets, bool has_flags);
1372
static bool add_attribute(Radius_scanner_state_t* state, const char*,const  char*, radius_attr_dissector_t,const  char*, unsigned, bool, bool, const char*);
1373
static bool add_tlv(Radius_scanner_state_t* state, const char* name, const  char* code, radius_attr_dissector_t type, const char* attr);
1374
static void add_value(Radius_scanner_state_t* state, const char* attrib_name, const  char* repr, uint32_t value);
1375
1376
/*
1377
 * Sleazy hack to suppress compiler warnings in yy_fatal_error().
1378
 */
1379
0
#define YY_EXIT_FAILURE ((void)yyscanner, 2)
1380
1381
/*
1382
 * Macros for the allocators, to discard the extra argument.
1383
 */
1384
0
#define Radius_alloc(size, yyscanner)   (void *)malloc(size)
1385
0
#define Radius_realloc(ptr, size, yyscanner)  (void *)realloc((char *)(ptr), (size))
1386
0
#define Radius_free(ptr, yyscanner)   free((char *)ptr)
1387
1388
#line 1389 "/work/build/epan/dissectors/radius_dict.c"
1389
/* Note: FreeRadius allows VENDOR, ATTRIBUTE and VALUE names to contain any non-blank character.
1390
 *       Using a negated "blank character class" pattern below for those names fails for some reason
1391
 *       so for now the patterns for each name type include those characters found for the corresponding
1392
 *       name types in the FreeRadius dictionaries.
1393
 */
1394
1395
#line 1396 "/work/build/epan/dissectors/radius_dict.c"
1396
1397
#define INITIAL 0
1398
0
#define WS_OUT 1
1399
0
#define VENDOR 2
1400
0
#define VENDOR_W_NAME 3
1401
0
#define ATTR 4
1402
0
#define ATTR_W_NAME 5
1403
0
#define ATTR_W_ID 6
1404
0
#define ATTR_W_TYPE 7
1405
0
#define VALUE 8
1406
0
#define VALUE_W_ATTR 9
1407
0
#define VALUE_W_NAME 10
1408
0
#define INCLUDE 11
1409
0
#define JUNK 12
1410
0
#define BEGIN_VENDOR 13
1411
0
#define BEGIN_VENDOR_FORMAT 14
1412
0
#define END_VENDOR 15
1413
0
#define VENDOR_W_ID 16
1414
0
#define VENDOR_W_FORMAT 17
1415
0
#define VENDOR_W_TYPE_OCTETS 18
1416
0
#define VENDOR_W_LENGTH_OCTETS 19
1417
0
#define VENDOR_W_CONTINUATION 20
1418
0
#define BEGIN_TLV 21
1419
0
#define END_TLV 22
1420
1421
#ifndef YY_NO_UNISTD_H
1422
/* Special case for "unistd.h", since it is non-ANSI. We include it way
1423
 * down here because we want the user's section 1 to have been scanned first.
1424
 * The user has a chance to override it with an option.
1425
 */
1426
/* %if-c-only */
1427
#include <unistd.h>
1428
/* %endif */
1429
/* %if-c++-only */
1430
/* %endif */
1431
#endif
1432
1433
#define YY_EXTRA_TYPE Radius_scanner_state_t*
1434
1435
/* %if-c-only Reentrant structure and macros (non-C++). */
1436
/* %if-reentrant */
1437
1438
/* Holds the entire state of the reentrant scanner. */
1439
struct yyguts_t
1440
    {
1441
1442
    /* User-defined. Not touched by flex. */
1443
    YY_EXTRA_TYPE yyextra_r;
1444
1445
    /* The rest are the same as the globals declared in the non-reentrant scanner. */
1446
    FILE *yyin_r, *yyout_r;
1447
    size_t yy_buffer_stack_top; /**< index of top of stack. */
1448
    size_t yy_buffer_stack_max; /**< capacity of stack. */
1449
    YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
1450
    char yy_hold_char;
1451
    int yy_n_chars;
1452
    int yyleng_r;
1453
    char *yy_c_buf_p;
1454
    int yy_init;
1455
    int yy_start;
1456
    int yy_did_buffer_switch_on_eof;
1457
    int yy_start_stack_ptr;
1458
    int yy_start_stack_depth;
1459
    int *yy_start_stack;
1460
    yy_state_type yy_last_accepting_state;
1461
    char* yy_last_accepting_cpos;
1462
1463
    int yylineno_r;
1464
    int yy_flex_debug_r;
1465
1466
    char *yytext_r;
1467
    int yy_more_flag;
1468
    int yy_more_len;
1469
1470
    }; /* end struct yyguts_t */
1471
1472
/* %if-c-only */
1473
1474
static int yy_init_globals ( yyscan_t yyscanner );
1475
1476
/* %endif */
1477
1478
/* %if-reentrant */
1479
1480
int yylex_init (yyscan_t* scanner);
1481
1482
int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
1483
1484
/* %endif */
1485
1486
/* %endif End reentrant structures and macros. */
1487
1488
/* Accessor methods to globals.
1489
   These are made visible to non-reentrant scanners for convenience. */
1490
1491
int yylex_destroy ( yyscan_t yyscanner );
1492
1493
int yyget_debug ( yyscan_t yyscanner );
1494
1495
void yyset_debug ( int debug_flag , yyscan_t yyscanner );
1496
1497
YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
1498
1499
void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
1500
1501
FILE *yyget_in ( yyscan_t yyscanner );
1502
1503
void yyset_in  ( FILE * _in_str , yyscan_t yyscanner );
1504
1505
FILE *yyget_out ( yyscan_t yyscanner );
1506
1507
void yyset_out  ( FILE * _out_str , yyscan_t yyscanner );
1508
1509
      int yyget_leng ( yyscan_t yyscanner );
1510
1511
char *yyget_text ( yyscan_t yyscanner );
1512
1513
int yyget_lineno ( yyscan_t yyscanner );
1514
1515
void yyset_lineno ( int _line_number , yyscan_t yyscanner );
1516
1517
int yyget_column  ( yyscan_t yyscanner );
1518
1519
void yyset_column ( int _column_no , yyscan_t yyscanner );
1520
1521
/* %if-bison-bridge */
1522
/* %endif */
1523
1524
/* Macros after this point can all be overridden by user definitions in
1525
 * section 1.
1526
 */
1527
1528
#ifndef YY_SKIP_YYWRAP
1529
#ifdef __cplusplus
1530
extern "C" int yywrap ( yyscan_t yyscanner );
1531
#else
1532
extern int yywrap ( yyscan_t yyscanner );
1533
#endif
1534
#endif
1535
1536
/* %not-for-header */
1537
#ifndef YY_NO_UNPUT
1538
    
1539
#endif
1540
/* %ok-for-header */
1541
1542
/* %endif */
1543
1544
#ifndef yytext_ptr
1545
static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
1546
#endif
1547
1548
#ifdef YY_NEED_STRLEN
1549
static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
1550
#endif
1551
1552
#ifndef YY_NO_INPUT
1553
/* %if-c-only Standard (non-C++) definition */
1554
/* %not-for-header */
1555
#ifdef __cplusplus
1556
static int yyinput ( yyscan_t yyscanner );
1557
#else
1558
static int input ( yyscan_t yyscanner );
1559
#endif
1560
/* %ok-for-header */
1561
1562
/* %endif */
1563
#endif
1564
1565
/* %if-c-only */
1566
1567
/* %endif */
1568
1569
/* Amount of stuff to slurp up with each read. */
1570
#ifndef YY_READ_BUF_SIZE
1571
#ifdef __ia64__
1572
/* On IA-64, the buffer size is 16k, not 8k */
1573
#define YY_READ_BUF_SIZE 16384
1574
#else
1575
0
#define YY_READ_BUF_SIZE 8192
1576
#endif /* __ia64__ */
1577
#endif
1578
1579
/* Copy whatever the last rule matched to the standard output. */
1580
#ifndef ECHO
1581
/* %if-c-only Standard (non-C++) definition */
1582
/* This used to be an fputs(), but since the string might contain NUL's,
1583
 * we now use fwrite().
1584
 */
1585
#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1586
/* %endif */
1587
/* %if-c++-only C++ definition */
1588
/* %endif */
1589
#endif
1590
1591
/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
1592
 * is returned in "result".
1593
 */
1594
#ifndef YY_INPUT
1595
#define YY_INPUT(buf,result,max_size) \
1596
/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
1597
0
  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1598
0
    { \
1599
0
    int c = '*'; \
1600
0
    int n; \
1601
0
    for ( n = 0; n < max_size && \
1602
0
           (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1603
0
      buf[n] = (char) c; \
1604
0
    if ( c == '\n' ) \
1605
0
      buf[n++] = (char) c; \
1606
0
    if ( c == EOF && ferror( yyin ) ) \
1607
0
      YY_FATAL_ERROR( "input in flex scanner failed" ); \
1608
0
    result = n; \
1609
0
    } \
1610
0
  else \
1611
0
    { \
1612
0
    errno=0; \
1613
0
    while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1614
0
      { \
1615
0
      if( errno != EINTR) \
1616
0
        { \
1617
0
        YY_FATAL_ERROR( "input in flex scanner failed" ); \
1618
0
        break; \
1619
0
        } \
1620
0
      errno=0; \
1621
0
      clearerr(yyin); \
1622
0
      } \
1623
0
    }\
1624
\
1625
/* %if-c++-only C++ definition \ */\
1626
/* %endif */
1627
1628
#endif
1629
1630
/* No semi-colon after return; correct usage is to write "yyterminate();" -
1631
 * we don't want an extra ';' after the "return" because that will cause
1632
 * some compilers to complain about unreachable statements.
1633
 */
1634
#ifndef yyterminate
1635
0
#define yyterminate() return YY_NULL
1636
#endif
1637
1638
/* Number of entries by which start-condition stack grows. */
1639
#ifndef YY_START_STACK_INCR
1640
#define YY_START_STACK_INCR 25
1641
#endif
1642
1643
/* Report a fatal error. */
1644
#ifndef YY_FATAL_ERROR
1645
/* %if-c-only */
1646
0
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1647
/* %endif */
1648
/* %if-c++-only */
1649
/* %endif */
1650
#endif
1651
1652
/* %if-tables-serialization structures and prototypes */
1653
/* %not-for-header */
1654
/* %ok-for-header */
1655
1656
/* %not-for-header */
1657
/* %tables-yydmap generated elements */
1658
/* %endif */
1659
/* end tables serialization structures and prototypes */
1660
1661
/* %ok-for-header */
1662
1663
/* Default declaration of generated scanner - a define so the user can
1664
 * easily add parameters.
1665
 */
1666
#ifndef YY_DECL
1667
#define YY_DECL_IS_OURS 1
1668
/* %if-c-only Standard (non-C++) definition */
1669
1670
extern int yylex (yyscan_t yyscanner);
1671
1672
#define YY_DECL int yylex (yyscan_t yyscanner)
1673
/* %endif */
1674
/* %if-c++-only C++ definition */
1675
/* %endif */
1676
#endif /* !YY_DECL */
1677
1678
/* Code executed at the beginning of each rule, after yytext and yyleng
1679
 * have been set up.
1680
 */
1681
#ifndef YY_USER_ACTION
1682
#define YY_USER_ACTION
1683
#endif
1684
1685
/* Code executed at the end of each rule. */
1686
#ifndef YY_BREAK
1687
0
#define YY_BREAK /*LINTED*/break;
1688
#endif
1689
1690
/* %% [6.0] YY_RULE_SETUP definition goes here */
1691
#define YY_RULE_SETUP \
1692
  YY_USER_ACTION
1693
1694
/* %not-for-header */
1695
/** The main scanner function which does all the work.
1696
 */
1697
YY_DECL
1698
0
{
1699
0
  yy_state_type yy_current_state;
1700
0
  char *yy_cp, *yy_bp;
1701
0
  int yy_act;
1702
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1703
1704
0
  if ( !yyg->yy_init )
1705
0
    {
1706
0
    yyg->yy_init = 1;
1707
1708
0
#ifdef YY_USER_INIT
1709
0
    YY_USER_INIT;
1710
0
#endif
1711
1712
0
    if ( ! yyg->yy_start )
1713
0
      yyg->yy_start = 1; /* first start state */
1714
1715
0
    if ( ! yyin )
1716
/* %if-c-only */
1717
0
      yyin = stdin;
1718
/* %endif */
1719
/* %if-c++-only */
1720
/* %endif */
1721
1722
0
    if ( ! yyout )
1723
/* %if-c-only */
1724
0
      yyout = stdout;
1725
/* %endif */
1726
/* %if-c++-only */
1727
/* %endif */
1728
1729
0
    if ( ! YY_CURRENT_BUFFER ) {
1730
0
      yyensure_buffer_stack (yyscanner);
1731
0
      YY_CURRENT_BUFFER_LVALUE =
1732
0
        yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
1733
0
    }
1734
1735
0
    yy_load_buffer_state( yyscanner );
1736
0
    }
1737
1738
0
  {
1739
/* %% [7.0] user's declarations go here */
1740
0
#line 184 "/src/wireshark/epan/dissectors/radius_dict.l"
1741
1742
0
#line 1743 "/work/build/epan/dissectors/radius_dict.c"
1743
1744
0
  while ( /*CONSTCOND*/1 )    /* loops until end-of-file is reached */
1745
0
    {
1746
/* %% [8.0] yymore()-related code goes here */
1747
0
    yy_cp = yyg->yy_c_buf_p;
1748
1749
    /* Support of yytext. */
1750
0
    *yy_cp = yyg->yy_hold_char;
1751
1752
    /* yy_bp points to the position in yy_ch_buf of the start of
1753
     * the current run.
1754
     */
1755
0
    yy_bp = yy_cp;
1756
1757
/* %% [9.0] code to set up and find next match goes here */
1758
0
    yy_current_state = yyg->yy_start;
1759
0
yy_match:
1760
0
    do
1761
0
      {
1762
0
      YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1763
0
      if ( yy_accept[yy_current_state] )
1764
0
        {
1765
0
        yyg->yy_last_accepting_state = yy_current_state;
1766
0
        yyg->yy_last_accepting_cpos = yy_cp;
1767
0
        }
1768
0
      while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1769
0
        {
1770
0
        yy_current_state = (int) yy_def[yy_current_state];
1771
0
        if ( yy_current_state >= 344 )
1772
0
          yy_c = yy_meta[yy_c];
1773
0
        }
1774
0
      yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1775
0
      ++yy_cp;
1776
0
      }
1777
0
    while ( yy_current_state != 343 );
1778
0
    yy_cp = yyg->yy_last_accepting_cpos;
1779
0
    yy_current_state = yyg->yy_last_accepting_state;
1780
1781
0
yy_find_action:
1782
/* %% [10.0] code to find the action number goes here */
1783
0
    yy_act = yy_accept[yy_current_state];
1784
1785
0
    YY_DO_BEFORE_ACTION;
1786
1787
/* %% [11.0] code for yylineno update goes here */
1788
1789
0
do_action:  /* This label is used only to access EOF actions. */
1790
1791
/* %% [12.0] debug code goes here */
1792
0
    if ( yy_flex_debug )
1793
0
      {
1794
0
      if ( yy_act == 0 )
1795
0
        fprintf( stderr, "--scanner backing up\n" );
1796
0
      else if ( yy_act < 63 )
1797
0
        fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
1798
0
                 (long)yy_rule_linenum[yy_act], yytext );
1799
0
      else if ( yy_act == 63 )
1800
0
        fprintf( stderr, "--accepting default rule (\"%s\")\n",
1801
0
                 yytext );
1802
0
      else if ( yy_act == 64 )
1803
0
        fprintf( stderr, "--(end of buffer or a NUL)\n" );
1804
0
      else
1805
0
        fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
1806
0
      }
1807
1808
0
    switch ( yy_act )
1809
0
  { /* beginning of action switch */
1810
/* %% [13.0] actions go here */
1811
0
      case 0: /* must back up */
1812
      /* undo the effects of YY_DO_BEFORE_ACTION */
1813
0
      *yy_cp = yyg->yy_hold_char;
1814
0
      yy_cp = yyg->yy_last_accepting_cpos;
1815
0
      yy_current_state = yyg->yy_last_accepting_state;
1816
0
      goto yy_find_action;
1817
1818
0
case 1:
1819
0
YY_RULE_SETUP
1820
0
#line 185 "/src/wireshark/epan/dissectors/radius_dict.l"
1821
0
;
1822
0
  YY_BREAK
1823
0
case 2:
1824
0
YY_RULE_SETUP
1825
0
#line 186 "/src/wireshark/epan/dissectors/radius_dict.l"
1826
0
;
1827
0
  YY_BREAK
1828
0
case 3:
1829
0
YY_RULE_SETUP
1830
0
#line 188 "/src/wireshark/epan/dissectors/radius_dict.l"
1831
0
;
1832
0
  YY_BREAK
1833
0
case 4:
1834
0
YY_RULE_SETUP
1835
0
#line 190 "/src/wireshark/epan/dissectors/radius_dict.l"
1836
0
{ BEGIN VENDOR; }
1837
0
  YY_BREAK
1838
0
case 5:
1839
0
YY_RULE_SETUP
1840
0
#line 191 "/src/wireshark/epan/dissectors/radius_dict.l"
1841
0
{ BEGIN ATTR; }
1842
0
  YY_BREAK
1843
0
case 6:
1844
0
YY_RULE_SETUP
1845
0
#line 192 "/src/wireshark/epan/dissectors/radius_dict.l"
1846
0
{ BEGIN VALUE; }
1847
0
  YY_BREAK
1848
0
case 7:
1849
0
YY_RULE_SETUP
1850
0
#line 193 "/src/wireshark/epan/dissectors/radius_dict.l"
1851
0
{ BEGIN INCLUDE; }
1852
0
  YY_BREAK
1853
0
case 8:
1854
0
YY_RULE_SETUP
1855
0
#line 194 "/src/wireshark/epan/dissectors/radius_dict.l"
1856
0
{ BEGIN BEGIN_VENDOR; }
1857
0
  YY_BREAK
1858
0
case 9:
1859
0
YY_RULE_SETUP
1860
0
#line 195 "/src/wireshark/epan/dissectors/radius_dict.l"
1861
0
{ BEGIN END_VENDOR; }
1862
0
  YY_BREAK
1863
0
case 10:
1864
0
YY_RULE_SETUP
1865
0
#line 196 "/src/wireshark/epan/dissectors/radius_dict.l"
1866
0
{ BEGIN BEGIN_TLV; }
1867
0
  YY_BREAK
1868
0
case 11:
1869
0
YY_RULE_SETUP
1870
0
#line 197 "/src/wireshark/epan/dissectors/radius_dict.l"
1871
0
{ BEGIN END_TLV; }
1872
0
  YY_BREAK
1873
0
case 12:
1874
0
YY_RULE_SETUP
1875
0
#line 199 "/src/wireshark/epan/dissectors/radius_dict.l"
1876
0
{
1877
0
    if (yyextra->current_vendor) {
1878
0
        g_free(yyextra->current_vendor);
1879
0
    }
1880
0
    yyextra->current_vendor = g_strdup(yytext);
1881
0
    BEGIN BEGIN_VENDOR_FORMAT;
1882
0
}
1883
0
  YY_BREAK
1884
0
case 13:
1885
0
YY_RULE_SETUP
1886
0
#line 206 "/src/wireshark/epan/dissectors/radius_dict.l"
1887
0
{
1888
0
    if (strcmp(yytext, "format=Extended-Vendor-Specific-1") == 0) {
1889
0
        yyextra->current_vendor_evs_type = 241;
1890
0
    } else if(strcmp(yytext, "format=Extended-Vendor-Specific-2") == 0) {
1891
0
        yyextra->current_vendor_evs_type = 242;
1892
0
    } else if(strcmp(yytext, "format=Extended-Vendor-Specific-3") == 0) {
1893
0
        yyextra->current_vendor_evs_type = 243;
1894
0
    } else if(strcmp(yytext, "format=Extended-Vendor-Specific-4") == 0) {
1895
0
        yyextra->current_vendor_evs_type = 244;
1896
0
    } else if(strcmp(yytext, "format=Extended-Vendor-Specific-5") == 0) {
1897
0
        yyextra->current_vendor_evs_type = 245;
1898
0
    } else if(strcmp(yytext, "format=Extended-Vendor-Specific-6") == 0) {
1899
0
        yyextra->current_vendor_evs_type = 246;
1900
0
    }
1901
0
    BEGIN WS_OUT;
1902
0
}
1903
0
  YY_BREAK
1904
0
case 14:
1905
/* rule 14 can match eol */
1906
0
YY_RULE_SETUP
1907
0
#line 222 "/src/wireshark/epan/dissectors/radius_dict.l"
1908
0
{BEGIN WS_OUT;}
1909
0
  YY_BREAK
1910
0
case 15:
1911
0
YY_RULE_SETUP
1912
0
#line 224 "/src/wireshark/epan/dissectors/radius_dict.l"
1913
0
{
1914
0
  if (yyextra->current_vendor) {
1915
0
    g_free(yyextra->current_vendor);
1916
0
    yyextra->current_vendor = NULL;
1917
0
  }
1918
0
  yyextra->current_vendor_evs_type = 0;
1919
0
  BEGIN WS_OUT;
1920
0
}
1921
0
  YY_BREAK
1922
0
case 16:
1923
0
YY_RULE_SETUP
1924
0
#line 233 "/src/wireshark/epan/dissectors/radius_dict.l"
1925
0
{
1926
0
  yyextra->tlv_stack_ptr++;
1927
0
  if ( yyextra->tlv_stack_ptr >= MAX_INCLUDE_DEPTH ) {
1928
0
    g_string_append_printf(yyextra->error, "TLV %s nested too deeply in %s:%i\n",
1929
0
        yytext, yyextra->fullpaths[yyextra->include_stack_ptr],
1930
0
        yyextra->linenums[yyextra->include_stack_ptr]);
1931
0
    yyterminate();
1932
0
  }
1933
0
  yyextra->tlv_stack[yyextra->tlv_stack_ptr] = g_strdup(yytext);
1934
  /* XXX - Do we really need the BEGIN-TLV? We could do this after
1935
   * encountering a tlv type. */
1936
0
  BEGIN WS_OUT;
1937
0
}
1938
0
  YY_BREAK
1939
0
case 17:
1940
0
YY_RULE_SETUP
1941
0
#line 246 "/src/wireshark/epan/dissectors/radius_dict.l"
1942
0
{
1943
0
  if (yyextra->tlv_stack[yyextra->tlv_stack_ptr]) {
1944
0
    g_free(yyextra->tlv_stack[yyextra->tlv_stack_ptr]);
1945
0
    yyextra->tlv_stack[yyextra->tlv_stack_ptr] = NULL;
1946
0
  }
1947
0
  if ( --yyextra->tlv_stack_ptr < 0 ) {
1948
0
    g_string_append_printf(yyextra->error, "END-TLV would go below stack level 0 in %s:%i\n",
1949
0
        yyextra->fullpaths[yyextra->include_stack_ptr],
1950
0
        yyextra->linenums[yyextra->include_stack_ptr]);
1951
0
    yyterminate();
1952
0
  }
1953
  /* XXX - We could parse yytext and see if it matches */
1954
0
  BEGIN WS_OUT;
1955
0
}
1956
0
  YY_BREAK
1957
0
case 18:
1958
0
YY_RULE_SETUP
1959
0
#line 261 "/src/wireshark/epan/dissectors/radius_dict.l"
1960
0
{
1961
0
    yyextra->vendor_name = g_strdup(yytext);
1962
0
    yyextra->vendor_type_octets = 1;
1963
0
    yyextra->vendor_length_octets = 1;
1964
0
    yyextra->vendor_has_flags = false;
1965
0
    BEGIN VENDOR_W_NAME;
1966
0
}
1967
0
  YY_BREAK
1968
0
case 19:
1969
0
YY_RULE_SETUP
1970
0
#line 268 "/src/wireshark/epan/dissectors/radius_dict.l"
1971
0
{
1972
0
    yyextra->vendor_id = (uint32_t) strtoul(yytext,NULL,10);
1973
0
    BEGIN VENDOR_W_ID;
1974
0
}
1975
0
  YY_BREAK
1976
0
case 20:
1977
0
YY_RULE_SETUP
1978
0
#line 272 "/src/wireshark/epan/dissectors/radius_dict.l"
1979
0
{
1980
0
    yyextra->vendor_id = (uint32_t) strtoul(yytext,NULL,16);
1981
0
    BEGIN VENDOR_W_ID;
1982
0
}
1983
0
  YY_BREAK
1984
0
case 21:
1985
0
YY_RULE_SETUP
1986
0
#line 276 "/src/wireshark/epan/dissectors/radius_dict.l"
1987
0
{
1988
0
    BEGIN VENDOR_W_FORMAT;
1989
0
}
1990
0
  YY_BREAK
1991
0
case 22:
1992
0
YY_RULE_SETUP
1993
0
#line 279 "/src/wireshark/epan/dissectors/radius_dict.l"
1994
0
{
1995
0
    yyextra->vendor_type_octets = (unsigned) strtoul(yytext,NULL,10);
1996
0
    BEGIN VENDOR_W_TYPE_OCTETS;
1997
0
}
1998
0
  YY_BREAK
1999
0
case 23:
2000
0
YY_RULE_SETUP
2001
0
#line 283 "/src/wireshark/epan/dissectors/radius_dict.l"
2002
0
{
2003
0
    yyextra->vendor_length_octets = (unsigned) strtoul(yytext+1,NULL,10);
2004
0
    BEGIN VENDOR_W_LENGTH_OCTETS;
2005
0
}
2006
0
  YY_BREAK
2007
0
case 24:
2008
0
YY_RULE_SETUP
2009
0
#line 287 "/src/wireshark/epan/dissectors/radius_dict.l"
2010
0
{
2011
0
    yyextra->vendor_has_flags = true;
2012
0
    BEGIN VENDOR_W_CONTINUATION;
2013
0
}
2014
0
  YY_BREAK
2015
0
case 25:
2016
/* rule 25 can match eol */
2017
0
#line 292 "/src/wireshark/epan/dissectors/radius_dict.l"
2018
0
case 26:
2019
/* rule 26 can match eol */
2020
0
#line 293 "/src/wireshark/epan/dissectors/radius_dict.l"
2021
0
case 27:
2022
/* rule 27 can match eol */
2023
0
#line 294 "/src/wireshark/epan/dissectors/radius_dict.l"
2024
0
case 28:
2025
/* rule 28 can match eol */
2026
0
#line 295 "/src/wireshark/epan/dissectors/radius_dict.l"
2027
0
case 29:
2028
/* rule 29 can match eol */
2029
0
YY_RULE_SETUP
2030
0
#line 295 "/src/wireshark/epan/dissectors/radius_dict.l"
2031
0
{
2032
0
    add_vendor(yyextra, yyextra->vendor_name, yyextra->vendor_id, yyextra->vendor_type_octets, yyextra->vendor_length_octets, yyextra->vendor_has_flags);
2033
0
    g_free(yyextra->vendor_name);
2034
0
    BEGIN WS_OUT;
2035
0
}
2036
0
  YY_BREAK
2037
0
case 30:
2038
0
YY_RULE_SETUP
2039
0
#line 301 "/src/wireshark/epan/dissectors/radius_dict.l"
2040
0
{ yyextra->attr_name = g_strdup(yytext); yyextra->encrypted = 0; yyextra->has_tag = false; yyextra->concat = false; BEGIN ATTR_W_NAME; }
2041
0
  YY_BREAK
2042
0
case 31:
2043
0
YY_RULE_SETUP
2044
0
#line 302 "/src/wireshark/epan/dissectors/radius_dict.l"
2045
0
{ yyextra->attr_id = g_strdup(yytext);  BEGIN ATTR_W_ID;}
2046
0
  YY_BREAK
2047
0
case 32:
2048
0
YY_RULE_SETUP
2049
0
#line 303 "/src/wireshark/epan/dissectors/radius_dict.l"
2050
0
{ yyextra->attr_id = ws_strdup_printf("%u",(int)strtoul(yytext,NULL,16)); BEGIN ATTR_W_ID;}
2051
0
  YY_BREAK
2052
0
case 33:
2053
0
YY_RULE_SETUP
2054
0
#line 304 "/src/wireshark/epan/dissectors/radius_dict.l"
2055
0
{ yyextra->attr_type = radius_integer;  BEGIN ATTR_W_TYPE; }
2056
0
  YY_BREAK
2057
0
case 34:
2058
0
YY_RULE_SETUP
2059
0
#line 305 "/src/wireshark/epan/dissectors/radius_dict.l"
2060
0
{ yyextra->attr_type = radius_string;  BEGIN ATTR_W_TYPE; }
2061
0
  YY_BREAK
2062
0
case 35:
2063
0
YY_RULE_SETUP
2064
0
#line 306 "/src/wireshark/epan/dissectors/radius_dict.l"
2065
0
{ yyextra->attr_type = radius_octets;  BEGIN ATTR_W_TYPE; }
2066
0
  YY_BREAK
2067
0
case 36:
2068
0
YY_RULE_SETUP
2069
0
#line 307 "/src/wireshark/epan/dissectors/radius_dict.l"
2070
0
{ yyextra->attr_type = radius_ipaddr;  BEGIN ATTR_W_TYPE; }
2071
0
  YY_BREAK
2072
0
case 37:
2073
0
YY_RULE_SETUP
2074
0
#line 308 "/src/wireshark/epan/dissectors/radius_dict.l"
2075
0
{ yyextra->attr_type = radius_ipv6addr;  BEGIN ATTR_W_TYPE; }
2076
0
  YY_BREAK
2077
0
case 38:
2078
0
YY_RULE_SETUP
2079
0
#line 309 "/src/wireshark/epan/dissectors/radius_dict.l"
2080
0
{ yyextra->attr_type = radius_ipv6prefix;  BEGIN ATTR_W_TYPE; }
2081
0
  YY_BREAK
2082
0
case 39:
2083
0
YY_RULE_SETUP
2084
0
#line 310 "/src/wireshark/epan/dissectors/radius_dict.l"
2085
0
{ yyextra->attr_type = radius_ipxnet;  BEGIN ATTR_W_TYPE; }
2086
0
  YY_BREAK
2087
0
case 40:
2088
0
YY_RULE_SETUP
2089
0
#line 311 "/src/wireshark/epan/dissectors/radius_dict.l"
2090
0
{ yyextra->attr_type = radius_date;  BEGIN ATTR_W_TYPE; }
2091
0
  YY_BREAK
2092
0
case 41:
2093
0
YY_RULE_SETUP
2094
0
#line 312 "/src/wireshark/epan/dissectors/radius_dict.l"
2095
0
{ yyextra->attr_type = radius_abinary;  BEGIN ATTR_W_TYPE; }
2096
0
  YY_BREAK
2097
0
case 42:
2098
0
YY_RULE_SETUP
2099
0
#line 313 "/src/wireshark/epan/dissectors/radius_dict.l"
2100
0
{ yyextra->attr_type = radius_ether;  BEGIN ATTR_W_TYPE; }
2101
0
  YY_BREAK
2102
0
case 43:
2103
0
YY_RULE_SETUP
2104
0
#line 314 "/src/wireshark/epan/dissectors/radius_dict.l"
2105
0
{ yyextra->attr_type = radius_ifid;  BEGIN ATTR_W_TYPE; }
2106
0
  YY_BREAK
2107
0
case 44:
2108
0
YY_RULE_SETUP
2109
0
#line 315 "/src/wireshark/epan/dissectors/radius_dict.l"
2110
0
{ yyextra->attr_type = radius_integer;  BEGIN ATTR_W_TYPE; }
2111
0
  YY_BREAK
2112
0
case 45:
2113
0
YY_RULE_SETUP
2114
0
#line 316 "/src/wireshark/epan/dissectors/radius_dict.l"
2115
0
{ yyextra->attr_type = radius_integer;  BEGIN ATTR_W_TYPE; }
2116
0
  YY_BREAK
2117
0
case 46:
2118
0
YY_RULE_SETUP
2119
0
#line 317 "/src/wireshark/epan/dissectors/radius_dict.l"
2120
0
{ yyextra->attr_type = radius_signed;  BEGIN ATTR_W_TYPE; }
2121
0
  YY_BREAK
2122
0
case 47:
2123
0
YY_RULE_SETUP
2124
0
#line 318 "/src/wireshark/epan/dissectors/radius_dict.l"
2125
0
{ yyextra->attr_type = radius_combo_ip;  BEGIN ATTR_W_TYPE; }
2126
0
  YY_BREAK
2127
0
case 48:
2128
0
YY_RULE_SETUP
2129
0
#line 319 "/src/wireshark/epan/dissectors/radius_dict.l"
2130
0
{ yyextra->attr_type = radius_tlv;  BEGIN ATTR_W_TYPE; }
2131
0
  YY_BREAK
2132
0
case 49:
2133
0
YY_RULE_SETUP
2134
0
#line 320 "/src/wireshark/epan/dissectors/radius_dict.l"
2135
0
{ yyextra->attr_type = radius_octets;  BEGIN ATTR_W_TYPE; }
2136
0
  YY_BREAK
2137
0
case 50:
2138
0
YY_RULE_SETUP
2139
0
#line 321 "/src/wireshark/epan/dissectors/radius_dict.l"
2140
0
{ yyextra->attr_type = radius_octets;  BEGIN ATTR_W_TYPE; }
2141
0
  YY_BREAK
2142
0
case 51:
2143
0
YY_RULE_SETUP
2144
0
#line 322 "/src/wireshark/epan/dissectors/radius_dict.l"
2145
0
{ yyextra->has_tag = true; }
2146
0
  YY_BREAK
2147
0
case 52:
2148
0
YY_RULE_SETUP
2149
0
#line 323 "/src/wireshark/epan/dissectors/radius_dict.l"
2150
0
{ yyextra->encrypted = (unsigned) strtoul(yytext+8,NULL,10); }
2151
0
  YY_BREAK
2152
0
case 53:
2153
0
YY_RULE_SETUP
2154
0
#line 324 "/src/wireshark/epan/dissectors/radius_dict.l"
2155
0
{ yyextra->concat = true; }
2156
0
  YY_BREAK
2157
0
case 54:
2158
0
YY_RULE_SETUP
2159
0
#line 325 "/src/wireshark/epan/dissectors/radius_dict.l"
2160
0
;
2161
0
  YY_BREAK
2162
0
case 55:
2163
0
YY_RULE_SETUP
2164
0
#line 326 "/src/wireshark/epan/dissectors/radius_dict.l"
2165
0
{
2166
    /*
2167
     * Support for "ATTRIBUTE name oid type vendor", where the token
2168
     * following the type matches neither has_tag, concat, nor encrypt={1,2,3},
2169
     * but is a sequence of digits, lower-case letters, underscores,
2170
     * and hyphens.
2171
     *
2172
     * We mark this as a vendor-specific attribute (VSA), with the token
2173
     * following the type being the vendor name; this notation is deprecated
2174
     * in favor of BEGIN-VENDOR/END-VENDOR blocks.
2175
     */
2176
0
    bool attribute_ok;
2177
2178
0
    yyextra->attr_vendor = g_strdup(yytext);
2179
0
    attribute_ok = add_attribute(yyextra, yyextra->attr_name, yyextra->attr_id, yyextra->attr_type, yyextra->attr_vendor, yyextra->encrypted, yyextra->has_tag, yyextra->concat, yyextra->tlv_stack[yyextra->tlv_stack_ptr]);
2180
0
    g_free(yyextra->attr_id);
2181
0
    g_free(yyextra->attr_vendor);
2182
0
    g_free(yyextra->attr_name);
2183
0
    yyextra->attr_id = NULL;
2184
0
    yyextra->attr_vendor = NULL;
2185
0
    yyextra->attr_name = NULL;
2186
0
    if (attribute_ok)
2187
0
        BEGIN WS_OUT;
2188
0
    else
2189
0
        BEGIN JUNK;
2190
0
}
2191
0
  YY_BREAK
2192
0
case 56:
2193
/* rule 56 can match eol */
2194
0
YY_RULE_SETUP
2195
0
#line 352 "/src/wireshark/epan/dissectors/radius_dict.l"
2196
0
{
2197
0
    add_attribute(yyextra, yyextra->attr_name, yyextra->attr_id, yyextra->attr_type, yyextra->current_vendor, yyextra->encrypted, yyextra->has_tag, yyextra->concat, yyextra->tlv_stack[yyextra->tlv_stack_ptr]);
2198
0
    g_free(yyextra->attr_id);
2199
0
    g_free(yyextra->attr_name);
2200
0
    yyextra->linenums[yyextra->include_stack_ptr]++;
2201
0
    yyextra->has_tag = false;
2202
0
    yyextra->encrypted=false;
2203
0
    yyextra->concat = false;
2204
0
    BEGIN WS_OUT;
2205
0
}
2206
0
  YY_BREAK
2207
0
case 57:
2208
0
YY_RULE_SETUP
2209
0
#line 363 "/src/wireshark/epan/dissectors/radius_dict.l"
2210
0
{ yyextra->attr_name = g_strdup(yytext); BEGIN VALUE_W_ATTR; }
2211
0
  YY_BREAK
2212
0
case 58:
2213
/* rule 58 can match eol */
2214
0
YY_RULE_SETUP
2215
0
#line 364 "/src/wireshark/epan/dissectors/radius_dict.l"
2216
0
{ yyextra->value_repr = g_strdup(yytext); BEGIN VALUE_W_NAME; }
2217
0
  YY_BREAK
2218
0
case 59:
2219
0
YY_RULE_SETUP
2220
0
#line 365 "/src/wireshark/epan/dissectors/radius_dict.l"
2221
0
{ add_value(yyextra, yyextra->attr_name,yyextra->value_repr, (uint32_t) strtoul(yytext,NULL,10));  g_free(yyextra->attr_name); g_free(yyextra->value_repr); BEGIN WS_OUT;}
2222
0
  YY_BREAK
2223
0
case 60:
2224
0
YY_RULE_SETUP
2225
0
#line 366 "/src/wireshark/epan/dissectors/radius_dict.l"
2226
0
{ add_value(yyextra, yyextra->attr_name,yyextra->value_repr, (uint32_t) strtoul(yytext,NULL,16));  g_free(yyextra->attr_name); g_free(yyextra->value_repr); BEGIN WS_OUT;}
2227
0
  YY_BREAK
2228
0
case 61:
2229
0
YY_RULE_SETUP
2230
0
#line 368 "/src/wireshark/epan/dissectors/radius_dict.l"
2231
0
{
2232
0
  if ( yyextra->include_stack_ptr >= MAX_INCLUDE_DEPTH ) {
2233
0
    g_string_append_printf(yyextra->error, "$INCLUDE files nested too deeply\n");
2234
0
    yyterminate();
2235
0
  }
2236
2237
0
  yyextra->include_stack[yyextra->include_stack_ptr++] = YY_CURRENT_BUFFER;
2238
2239
0
  if (g_path_is_absolute(yytext)) {
2240
0
    yyextra->fullpaths[yyextra->include_stack_ptr] = ws_strdup(yytext);
2241
0
  } else {
2242
0
    yyextra->fullpaths[yyextra->include_stack_ptr] = g_build_filename(yyextra->directory, yytext, NULL);
2243
0
  }
2244
2245
0
  FILE *old_yyin = yyin;
2246
0
  yyin = ws_fopen( yyextra->fullpaths[yyextra->include_stack_ptr], "r" );
2247
2248
0
  if (!yyin) {
2249
0
    if (errno) {
2250
0
      g_string_append_printf(yyextra->error,
2251
0
          "Could not open file: '%s', error: %s\n",
2252
0
          yyextra->fullpaths[yyextra->include_stack_ptr],
2253
0
          g_strerror(errno) );
2254
0
    } else {
2255
0
      g_string_append_printf(yyextra->error,
2256
0
          "Could not open file: '%s', no errno\n",
2257
0
          yyextra->fullpaths[yyextra->include_stack_ptr]);
2258
0
    }
2259
0
    g_free(yyextra->fullpaths[yyextra->include_stack_ptr]);
2260
0
    yyextra->fullpaths[yyextra->include_stack_ptr] = NULL;
2261
0
    yyextra->include_stack_ptr--;
2262
0
    yyin = old_yyin;
2263
0
  } else {
2264
0
    if (g_path_is_absolute(yytext)) {
2265
0
      g_free(yyextra->directory);
2266
      /*
2267
       * Switch the directory for any relative $INCLUDEs in
2268
       * the new file.
2269
       * XXX - Follow symlinks (#6466)? FreeRADIUS doesn't.
2270
       * Use g_file_test() + g_file_read_link() to do so.
2271
       * In that case, make sure to follow symlinks when
2272
       * saving the fullpath too, for restoring the directory
2273
       * at EOF.
2274
       */
2275
0
      yyextra->directory = g_path_get_dirname(yytext);
2276
0
    }
2277
0
    yyextra->linenums[yyextra->include_stack_ptr] = 1;
2278
0
    yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner), yyscanner);
2279
0
  }
2280
2281
2282
0
  BEGIN WS_OUT;
2283
0
}
2284
0
  YY_BREAK
2285
0
case YY_STATE_EOF(INITIAL):
2286
0
case YY_STATE_EOF(WS_OUT):
2287
0
case YY_STATE_EOF(VENDOR):
2288
0
case YY_STATE_EOF(VENDOR_W_NAME):
2289
0
case YY_STATE_EOF(ATTR):
2290
0
case YY_STATE_EOF(ATTR_W_NAME):
2291
0
case YY_STATE_EOF(ATTR_W_ID):
2292
0
case YY_STATE_EOF(ATTR_W_TYPE):
2293
0
case YY_STATE_EOF(VALUE):
2294
0
case YY_STATE_EOF(VALUE_W_ATTR):
2295
0
case YY_STATE_EOF(VALUE_W_NAME):
2296
0
case YY_STATE_EOF(INCLUDE):
2297
0
case YY_STATE_EOF(JUNK):
2298
0
case YY_STATE_EOF(BEGIN_VENDOR):
2299
0
case YY_STATE_EOF(BEGIN_VENDOR_FORMAT):
2300
0
case YY_STATE_EOF(END_VENDOR):
2301
0
case YY_STATE_EOF(VENDOR_W_ID):
2302
0
case YY_STATE_EOF(VENDOR_W_FORMAT):
2303
0
case YY_STATE_EOF(VENDOR_W_TYPE_OCTETS):
2304
0
case YY_STATE_EOF(VENDOR_W_LENGTH_OCTETS):
2305
0
case YY_STATE_EOF(VENDOR_W_CONTINUATION):
2306
0
case YY_STATE_EOF(BEGIN_TLV):
2307
0
case YY_STATE_EOF(END_TLV):
2308
0
#line 422 "/src/wireshark/epan/dissectors/radius_dict.l"
2309
0
{
2310
2311
0
  fclose(yyin);
2312
0
  yyin = NULL;
2313
2314
0
  g_free(yyextra->directory);
2315
2316
0
  if ( --yyextra->include_stack_ptr < 0 ) {
2317
0
    yyterminate();
2318
0
  } else {
2319
0
    g_free(yyextra->fullpaths[yyextra->include_stack_ptr+1]);
2320
0
    yyextra->fullpaths[yyextra->include_stack_ptr+1] = NULL;
2321
2322
0
    yyextra->directory = g_path_get_dirname(yyextra->fullpaths[yyextra->include_stack_ptr]);
2323
2324
0
    Radius__delete_buffer(YY_CURRENT_BUFFER, yyscanner);
2325
0
    Radius__switch_to_buffer(yyextra->include_stack[yyextra->include_stack_ptr], yyscanner);
2326
0
  }
2327
2328
0
  BEGIN WS_OUT;
2329
0
}
2330
0
  YY_BREAK
2331
0
case 62:
2332
/* rule 62 can match eol */
2333
0
YY_RULE_SETUP
2334
0
#line 444 "/src/wireshark/epan/dissectors/radius_dict.l"
2335
0
{ yyextra->linenums[yyextra->include_stack_ptr]++; BEGIN WS_OUT; }
2336
0
  YY_BREAK
2337
0
case 63:
2338
0
YY_RULE_SETUP
2339
0
#line 447 "/src/wireshark/epan/dissectors/radius_dict.l"
2340
0
ECHO;
2341
0
  YY_BREAK
2342
0
#line 2343 "/work/build/epan/dissectors/radius_dict.c"
2343
2344
0
  case YY_END_OF_BUFFER:
2345
0
    {
2346
    /* Amount of text matched not including the EOB char. */
2347
0
    int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
2348
2349
    /* Undo the effects of YY_DO_BEFORE_ACTION. */
2350
0
    *yy_cp = yyg->yy_hold_char;
2351
0
    YY_RESTORE_YY_MORE_OFFSET
2352
2353
0
    if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2354
0
      {
2355
      /* We're scanning a new file or input source.  It's
2356
       * possible that this happened because the user
2357
       * just pointed yyin at a new source and called
2358
       * yylex().  If so, then we have to assure
2359
       * consistency between YY_CURRENT_BUFFER and our
2360
       * globals.  Here is the right place to do so, because
2361
       * this is the first action (other than possibly a
2362
       * back-up) that will match for the new input source.
2363
       */
2364
0
      yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2365
/* %if-c-only */
2366
0
      YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2367
/* %endif */
2368
/* %if-c++-only */
2369
/* %endif */
2370
0
      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2371
0
      }
2372
2373
    /* Note that here we test for yy_c_buf_p "<=" to the position
2374
     * of the first EOB in the buffer, since yy_c_buf_p will
2375
     * already have been incremented past the NUL character
2376
     * (since all states make transitions on EOB to the
2377
     * end-of-buffer state).  Contrast this with the test
2378
     * in input().
2379
     */
2380
0
    if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2381
0
      { /* This was really a NUL. */
2382
0
      yy_state_type yy_next_state;
2383
2384
0
      yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
2385
2386
0
      yy_current_state = yy_get_previous_state( yyscanner );
2387
2388
      /* Okay, we're now positioned to make the NUL
2389
       * transition.  We couldn't have
2390
       * yy_get_previous_state() go ahead and do it
2391
       * for us because it doesn't know how to deal
2392
       * with the possibility of jamming (and we don't
2393
       * want to build jamming into it because then it
2394
       * will run more slowly).
2395
       */
2396
2397
0
      yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
2398
2399
0
      yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2400
2401
0
      if ( yy_next_state )
2402
0
        {
2403
        /* Consume the NUL. */
2404
0
        yy_cp = ++yyg->yy_c_buf_p;
2405
0
        yy_current_state = yy_next_state;
2406
0
        goto yy_match;
2407
0
        }
2408
2409
0
      else
2410
0
        {
2411
/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
2412
0
        yy_cp = yyg->yy_last_accepting_cpos;
2413
0
        yy_current_state = yyg->yy_last_accepting_state;
2414
0
        goto yy_find_action;
2415
0
        }
2416
0
      }
2417
2418
0
    else switch ( yy_get_next_buffer( yyscanner ) )
2419
0
      {
2420
0
      case EOB_ACT_END_OF_FILE:
2421
0
        {
2422
0
        yyg->yy_did_buffer_switch_on_eof = 0;
2423
2424
0
        if ( yywrap( yyscanner ) )
2425
0
          {
2426
          /* Note: because we've taken care in
2427
           * yy_get_next_buffer() to have set up
2428
           * yytext, we can now set up
2429
           * yy_c_buf_p so that if some total
2430
           * hoser (like flex itself) wants to
2431
           * call the scanner after we return the
2432
           * YY_NULL, it'll still work - another
2433
           * YY_NULL will get returned.
2434
           */
2435
0
          yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
2436
2437
0
          yy_act = YY_STATE_EOF(YY_START);
2438
0
          goto do_action;
2439
0
          }
2440
2441
0
        else
2442
0
          {
2443
0
          if ( ! yyg->yy_did_buffer_switch_on_eof )
2444
0
            YY_NEW_FILE;
2445
0
          }
2446
0
        break;
2447
0
        }
2448
2449
0
      case EOB_ACT_CONTINUE_SCAN:
2450
0
        yyg->yy_c_buf_p =
2451
0
          yyg->yytext_ptr + yy_amount_of_matched_text;
2452
2453
0
        yy_current_state = yy_get_previous_state( yyscanner );
2454
2455
0
        yy_cp = yyg->yy_c_buf_p;
2456
0
        yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2457
0
        goto yy_match;
2458
2459
0
      case EOB_ACT_LAST_MATCH:
2460
0
        yyg->yy_c_buf_p =
2461
0
        &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
2462
2463
0
        yy_current_state = yy_get_previous_state( yyscanner );
2464
2465
0
        yy_cp = yyg->yy_c_buf_p;
2466
0
        yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2467
0
        goto yy_find_action;
2468
0
      }
2469
0
    break;
2470
0
    }
2471
2472
0
  default:
2473
0
    YY_FATAL_ERROR(
2474
0
      "fatal flex scanner internal error--no action found" );
2475
0
  } /* end of action switch */
2476
0
    } /* end of scanning one token */
2477
0
  } /* end of user's declarations */
2478
0
} /* end of yylex */
2479
/* %ok-for-header */
2480
2481
/* %if-c++-only */
2482
/* %not-for-header */
2483
/* %ok-for-header */
2484
2485
/* %endif */
2486
2487
/* yy_get_next_buffer - try to read in a new buffer
2488
 *
2489
 * Returns a code representing an action:
2490
 *  EOB_ACT_LAST_MATCH -
2491
 *  EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2492
 *  EOB_ACT_END_OF_FILE - end of file
2493
 */
2494
/* %if-c-only */
2495
static int yy_get_next_buffer (yyscan_t yyscanner)
2496
/* %endif */
2497
/* %if-c++-only */
2498
/* %endif */
2499
0
{
2500
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2501
0
  char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2502
0
  char *source = yyg->yytext_ptr;
2503
0
  int number_to_move, i;
2504
0
  int ret_val;
2505
2506
0
  if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
2507
0
    YY_FATAL_ERROR(
2508
0
    "fatal flex scanner internal error--end of buffer missed" );
2509
2510
0
  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2511
0
    { /* Don't try to fill the buffer, so this is an EOF. */
2512
0
    if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
2513
0
      {
2514
      /* We matched a single character, the EOB, so
2515
       * treat this as a final EOF.
2516
       */
2517
0
      return EOB_ACT_END_OF_FILE;
2518
0
      }
2519
2520
0
    else
2521
0
      {
2522
      /* We matched some text prior to the EOB, first
2523
       * process it.
2524
       */
2525
0
      return EOB_ACT_LAST_MATCH;
2526
0
      }
2527
0
    }
2528
2529
  /* Try to read more data. */
2530
2531
  /* First move last chars to start of buffer. */
2532
0
  number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
2533
2534
0
  for ( i = 0; i < number_to_move; ++i )
2535
0
    *(dest++) = *(source++);
2536
2537
0
  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2538
    /* don't do the read, it's not guaranteed to return an EOF,
2539
     * just force an EOF
2540
     */
2541
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
2542
2543
0
  else
2544
0
    {
2545
0
      int num_to_read =
2546
0
      YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2547
2548
0
    while ( num_to_read <= 0 )
2549
0
      { /* Not enough room in the buffer - grow it. */
2550
2551
      /* just a shorter name for the current buffer */
2552
0
      YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
2553
2554
0
      int yy_c_buf_p_offset =
2555
0
        (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
2556
2557
0
      if ( b->yy_is_our_buffer )
2558
0
        {
2559
0
        int new_size = b->yy_buf_size * 2;
2560
2561
0
        if ( new_size <= 0 )
2562
0
          b->yy_buf_size += b->yy_buf_size / 8;
2563
0
        else
2564
0
          b->yy_buf_size *= 2;
2565
2566
0
        b->yy_ch_buf = (char *)
2567
          /* Include room in for 2 EOB chars. */
2568
0
          yyrealloc( (void *) b->yy_ch_buf,
2569
0
               (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
2570
0
        }
2571
0
      else
2572
        /* Can't grow it, we don't own it. */
2573
0
        b->yy_ch_buf = NULL;
2574
2575
0
      if ( ! b->yy_ch_buf )
2576
0
        YY_FATAL_ERROR(
2577
0
        "fatal error - scanner input buffer overflow" );
2578
2579
0
      yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2580
2581
0
      num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2582
0
            number_to_move - 1;
2583
2584
0
      }
2585
2586
0
    if ( num_to_read > YY_READ_BUF_SIZE )
2587
0
      num_to_read = YY_READ_BUF_SIZE;
2588
2589
    /* Read in more data. */
2590
0
    YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2591
0
      yyg->yy_n_chars, num_to_read );
2592
2593
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2594
0
    }
2595
2596
0
  if ( yyg->yy_n_chars == 0 )
2597
0
    {
2598
0
    if ( number_to_move == YY_MORE_ADJ )
2599
0
      {
2600
0
      ret_val = EOB_ACT_END_OF_FILE;
2601
0
      yyrestart( yyin  , yyscanner);
2602
0
      }
2603
2604
0
    else
2605
0
      {
2606
0
      ret_val = EOB_ACT_LAST_MATCH;
2607
0
      YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2608
0
        YY_BUFFER_EOF_PENDING;
2609
0
      }
2610
0
    }
2611
2612
0
  else
2613
0
    ret_val = EOB_ACT_CONTINUE_SCAN;
2614
2615
0
  if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2616
    /* Extend the array by 50%, plus the number we really need. */
2617
0
    int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2618
0
    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
2619
0
      (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
2620
0
    if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2621
0
      YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2622
    /* "- 2" to take care of EOB's */
2623
0
    YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
2624
0
  }
2625
2626
0
  yyg->yy_n_chars += number_to_move;
2627
0
  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2628
0
  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2629
2630
0
  yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2631
2632
0
  return ret_val;
2633
0
}
2634
2635
/* yy_get_previous_state - get the state just before the EOB char was reached */
2636
2637
/* %if-c-only */
2638
/* %not-for-header */
2639
    static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
2640
/* %endif */
2641
/* %if-c++-only */
2642
/* %endif */
2643
0
{
2644
0
  yy_state_type yy_current_state;
2645
0
  char *yy_cp;
2646
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2647
2648
/* %% [15.0] code to get the start state into yy_current_state goes here */
2649
0
  yy_current_state = yyg->yy_start;
2650
2651
0
  for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2652
0
    {
2653
/* %% [16.0] code to find the next state goes here */
2654
0
    YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2655
0
    if ( yy_accept[yy_current_state] )
2656
0
      {
2657
0
      yyg->yy_last_accepting_state = yy_current_state;
2658
0
      yyg->yy_last_accepting_cpos = yy_cp;
2659
0
      }
2660
0
    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2661
0
      {
2662
0
      yy_current_state = (int) yy_def[yy_current_state];
2663
0
      if ( yy_current_state >= 344 )
2664
0
        yy_c = yy_meta[yy_c];
2665
0
      }
2666
0
    yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2667
0
    }
2668
2669
0
  return yy_current_state;
2670
0
}
2671
2672
/* yy_try_NUL_trans - try to make a transition on the NUL character
2673
 *
2674
 * synopsis
2675
 *  next_state = yy_try_NUL_trans( current_state );
2676
 */
2677
/* %if-c-only */
2678
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
2679
/* %endif */
2680
/* %if-c++-only */
2681
/* %endif */
2682
0
{
2683
0
  int yy_is_jam;
2684
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2685
/* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
2686
0
  char *yy_cp = yyg->yy_c_buf_p;
2687
2688
0
  YY_CHAR yy_c = 1;
2689
0
  if ( yy_accept[yy_current_state] )
2690
0
    {
2691
0
    yyg->yy_last_accepting_state = yy_current_state;
2692
0
    yyg->yy_last_accepting_cpos = yy_cp;
2693
0
    }
2694
0
  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2695
0
    {
2696
0
    yy_current_state = (int) yy_def[yy_current_state];
2697
0
    if ( yy_current_state >= 344 )
2698
0
      yy_c = yy_meta[yy_c];
2699
0
    }
2700
0
  yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
2701
0
  yy_is_jam = (yy_current_state == 343);
2702
2703
0
  (void)yyg;
2704
0
  return yy_is_jam ? 0 : yy_current_state;
2705
0
}
2706
2707
#ifndef YY_NO_UNPUT
2708
/* %if-c-only */
2709
2710
/* %endif */
2711
#endif
2712
2713
/* %if-c-only */
2714
#ifndef YY_NO_INPUT
2715
#ifdef __cplusplus
2716
    static int yyinput (yyscan_t yyscanner)
2717
#else
2718
    static int input  (yyscan_t yyscanner)
2719
#endif
2720
2721
/* %endif */
2722
/* %if-c++-only */
2723
/* %endif */
2724
{
2725
  int c;
2726
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2727
2728
  *yyg->yy_c_buf_p = yyg->yy_hold_char;
2729
2730
  if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2731
    {
2732
    /* yy_c_buf_p now points to the character we want to return.
2733
     * If this occurs *before* the EOB characters, then it's a
2734
     * valid NUL; if not, then we've hit the end of the buffer.
2735
     */
2736
    if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2737
      /* This was really a NUL. */
2738
      *yyg->yy_c_buf_p = '\0';
2739
2740
    else
2741
      { /* need more input */
2742
      int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
2743
      ++yyg->yy_c_buf_p;
2744
2745
      switch ( yy_get_next_buffer( yyscanner ) )
2746
        {
2747
        case EOB_ACT_LAST_MATCH:
2748
          /* This happens because yy_g_n_b()
2749
           * sees that we've accumulated a
2750
           * token and flags that we need to
2751
           * try matching the token before
2752
           * proceeding.  But for input(),
2753
           * there's no matching to consider.
2754
           * So convert the EOB_ACT_LAST_MATCH
2755
           * to EOB_ACT_END_OF_FILE.
2756
           */
2757
2758
          /* Reset buffer status. */
2759
          yyrestart( yyin , yyscanner);
2760
2761
          /*FALLTHROUGH*/
2762
2763
        case EOB_ACT_END_OF_FILE:
2764
          {
2765
          if ( yywrap( yyscanner ) )
2766
            return 0;
2767
2768
          if ( ! yyg->yy_did_buffer_switch_on_eof )
2769
            YY_NEW_FILE;
2770
#ifdef __cplusplus
2771
          return yyinput(yyscanner);
2772
#else
2773
          return input(yyscanner);
2774
#endif
2775
          }
2776
2777
        case EOB_ACT_CONTINUE_SCAN:
2778
          yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2779
          break;
2780
        }
2781
      }
2782
    }
2783
2784
  c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2785
  *yyg->yy_c_buf_p = '\0';  /* preserve yytext */
2786
  yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2787
2788
/* %% [19.0] update BOL and yylineno */
2789
2790
  return c;
2791
}
2792
/* %if-c-only */
2793
#endif  /* ifndef YY_NO_INPUT */
2794
/* %endif */
2795
2796
/** Immediately switch to a different input stream.
2797
 * @param input_file A readable stream.
2798
 * @param yyscanner The scanner object.
2799
 * @note This function does not reset the start condition to @c INITIAL .
2800
 */
2801
/* %if-c-only */
2802
    void yyrestart  (FILE * input_file , yyscan_t yyscanner)
2803
/* %endif */
2804
/* %if-c++-only */
2805
/* %endif */
2806
0
{
2807
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2808
2809
0
  if ( ! YY_CURRENT_BUFFER ){
2810
0
        yyensure_buffer_stack (yyscanner);
2811
0
    YY_CURRENT_BUFFER_LVALUE =
2812
0
            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
2813
0
  }
2814
2815
0
  yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
2816
0
  yy_load_buffer_state( yyscanner );
2817
0
}
2818
2819
/* %if-c++-only */
2820
/* %endif */
2821
2822
/** Switch to a different input buffer.
2823
 * @param new_buffer The new input buffer.
2824
 * @param yyscanner The scanner object.
2825
 */
2826
/* %if-c-only */
2827
    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
2828
/* %endif */
2829
/* %if-c++-only */
2830
/* %endif */
2831
0
{
2832
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2833
2834
  /* TODO. We should be able to replace this entire function body
2835
   * with
2836
   *    yypop_buffer_state();
2837
   *    yypush_buffer_state(new_buffer);
2838
     */
2839
0
  yyensure_buffer_stack (yyscanner);
2840
0
  if ( YY_CURRENT_BUFFER == new_buffer )
2841
0
    return;
2842
2843
0
  if ( YY_CURRENT_BUFFER )
2844
0
    {
2845
    /* Flush out information for old buffer. */
2846
0
    *yyg->yy_c_buf_p = yyg->yy_hold_char;
2847
0
    YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2848
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2849
0
    }
2850
2851
0
  YY_CURRENT_BUFFER_LVALUE = new_buffer;
2852
0
  yy_load_buffer_state( yyscanner );
2853
2854
  /* We don't actually know whether we did this switch during
2855
   * EOF (yywrap()) processing, but the only time this flag
2856
   * is looked at is after yywrap() is called, so it's safe
2857
   * to go ahead and always set it.
2858
   */
2859
0
  yyg->yy_did_buffer_switch_on_eof = 1;
2860
0
}
2861
2862
/* %if-c-only */
2863
static void yy_load_buffer_state  (yyscan_t yyscanner)
2864
/* %endif */
2865
/* %if-c++-only */
2866
/* %endif */
2867
0
{
2868
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2869
0
  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2870
0
  yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2871
/* %if-c-only */
2872
0
  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2873
/* %endif */
2874
/* %if-c++-only */
2875
/* %endif */
2876
0
  yyg->yy_hold_char = *yyg->yy_c_buf_p;
2877
0
}
2878
2879
/** Allocate and initialize an input buffer state.
2880
 * @param file A readable stream.
2881
 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2882
 * @param yyscanner The scanner object.
2883
 * @return the allocated buffer state.
2884
 */
2885
/* %if-c-only */
2886
    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
2887
/* %endif */
2888
/* %if-c++-only */
2889
/* %endif */
2890
0
{
2891
0
  YY_BUFFER_STATE b;
2892
    
2893
0
  b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
2894
0
  if ( ! b )
2895
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2896
2897
0
  b->yy_buf_size = size;
2898
2899
  /* yy_ch_buf has to be 2 characters longer than the size given because
2900
   * we need to put in 2 end-of-buffer characters.
2901
   */
2902
0
  b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
2903
0
  if ( ! b->yy_ch_buf )
2904
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2905
2906
0
  b->yy_is_our_buffer = 1;
2907
2908
0
  yy_init_buffer( b, file , yyscanner);
2909
2910
0
  return b;
2911
0
}
2912
2913
/* %if-c++-only */
2914
/* %endif */
2915
2916
/** Destroy the buffer.
2917
 * @param b a buffer created with yy_create_buffer()
2918
 * @param yyscanner The scanner object.
2919
 */
2920
/* %if-c-only */
2921
    void yy_delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
2922
/* %endif */
2923
/* %if-c++-only */
2924
/* %endif */
2925
0
{
2926
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2927
2928
0
  if ( ! b )
2929
0
    return;
2930
2931
0
  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2932
0
    YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2933
2934
0
  if ( b->yy_is_our_buffer )
2935
0
    yyfree( (void *) b->yy_ch_buf , yyscanner );
2936
2937
0
  yyfree( (void *) b , yyscanner );
2938
0
}
2939
2940
/* Initializes or reinitializes a buffer.
2941
 * This function is sometimes called more than once on the same buffer,
2942
 * such as during a yyrestart() or at EOF.
2943
 */
2944
/* %if-c-only */
2945
    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
2946
/* %endif */
2947
/* %if-c++-only */
2948
/* %endif */
2949
2950
0
{
2951
0
  int oerrno = errno;
2952
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2953
2954
0
  yy_flush_buffer( b , yyscanner);
2955
2956
/* %if-c-only */
2957
0
  b->yy_input_file = file;
2958
/* %endif */
2959
/* %if-c++-only */
2960
/* %endif */
2961
0
  b->yy_fill_buffer = 1;
2962
2963
    /* If b is the current buffer, then yy_init_buffer was _probably_
2964
     * called from yyrestart() or through yy_get_next_buffer.
2965
     * In that case, we don't want to reset the lineno or column.
2966
     */
2967
0
    if (b != YY_CURRENT_BUFFER){
2968
0
        b->yy_bs_lineno = 1;
2969
0
        b->yy_bs_column = 0;
2970
0
    }
2971
2972
/* %if-c-only */
2973
2974
0
        b->yy_is_interactive = 0;
2975
    
2976
/* %endif */
2977
/* %if-c++-only */
2978
/* %endif */
2979
0
  errno = oerrno;
2980
0
}
2981
2982
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2983
 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2984
 * @param yyscanner The scanner object.
2985
 */
2986
/* %if-c-only */
2987
    void yy_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
2988
/* %endif */
2989
/* %if-c++-only */
2990
/* %endif */
2991
0
{
2992
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2993
0
  if ( ! b )
2994
0
    return;
2995
2996
0
  b->yy_n_chars = 0;
2997
2998
  /* We always need two end-of-buffer characters.  The first causes
2999
   * a transition to the end-of-buffer state.  The second causes
3000
   * a jam in that state.
3001
   */
3002
0
  b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3003
0
  b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3004
3005
0
  b->yy_buf_pos = &b->yy_ch_buf[0];
3006
3007
0
  b->yy_at_bol = 1;
3008
0
  b->yy_buffer_status = YY_BUFFER_NEW;
3009
3010
0
  if ( b == YY_CURRENT_BUFFER )
3011
0
    yy_load_buffer_state( yyscanner );
3012
0
}
3013
3014
/* %if-c-or-c++ */
3015
/** Pushes the new state onto the stack. The new state becomes
3016
 *  the current state. This function will allocate the stack
3017
 *  if necessary.
3018
 *  @param new_buffer The new state.
3019
 *  @param yyscanner The scanner object.
3020
 */
3021
/* %if-c-only */
3022
void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
3023
/* %endif */
3024
/* %if-c++-only */
3025
/* %endif */
3026
0
{
3027
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3028
0
  if (new_buffer == NULL)
3029
0
    return;
3030
3031
0
  yyensure_buffer_stack(yyscanner);
3032
3033
  /* This block is copied from yy_switch_to_buffer. */
3034
0
  if ( YY_CURRENT_BUFFER )
3035
0
    {
3036
    /* Flush out information for old buffer. */
3037
0
    *yyg->yy_c_buf_p = yyg->yy_hold_char;
3038
0
    YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
3039
0
    YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
3040
0
    }
3041
3042
  /* Only push if top exists. Otherwise, replace top. */
3043
0
  if (YY_CURRENT_BUFFER)
3044
0
    yyg->yy_buffer_stack_top++;
3045
0
  YY_CURRENT_BUFFER_LVALUE = new_buffer;
3046
3047
  /* copied from yy_switch_to_buffer. */
3048
0
  yy_load_buffer_state( yyscanner );
3049
0
  yyg->yy_did_buffer_switch_on_eof = 1;
3050
0
}
3051
/* %endif */
3052
3053
/* %if-c-or-c++ */
3054
/** Removes and deletes the top of the stack, if present.
3055
 *  The next element becomes the new top.
3056
 *  @param yyscanner The scanner object.
3057
 */
3058
/* %if-c-only */
3059
void yypop_buffer_state (yyscan_t yyscanner)
3060
/* %endif */
3061
/* %if-c++-only */
3062
/* %endif */
3063
0
{
3064
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3065
0
  if (!YY_CURRENT_BUFFER)
3066
0
    return;
3067
3068
0
  yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
3069
0
  YY_CURRENT_BUFFER_LVALUE = NULL;
3070
0
  if (yyg->yy_buffer_stack_top > 0)
3071
0
    --yyg->yy_buffer_stack_top;
3072
3073
0
  if (YY_CURRENT_BUFFER) {
3074
0
    yy_load_buffer_state( yyscanner );
3075
0
    yyg->yy_did_buffer_switch_on_eof = 1;
3076
0
  }
3077
0
}
3078
/* %endif */
3079
3080
/* %if-c-or-c++ */
3081
/* Allocates the stack if it does not exist.
3082
 *  Guarantees space for at least one push.
3083
 */
3084
/* %if-c-only */
3085
static void yyensure_buffer_stack (yyscan_t yyscanner)
3086
/* %endif */
3087
/* %if-c++-only */
3088
/* %endif */
3089
0
{
3090
0
  yy_size_t num_to_alloc;
3091
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3092
3093
0
  if (!yyg->yy_buffer_stack) {
3094
3095
    /* First allocation is just for 2 elements, since we don't know if this
3096
     * scanner will even need a stack. We use 2 instead of 1 to avoid an
3097
     * immediate realloc on the next call.
3098
         */
3099
0
      num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
3100
0
    yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
3101
0
                (num_to_alloc * sizeof(struct yy_buffer_state*)
3102
0
                , yyscanner);
3103
0
    if ( ! yyg->yy_buffer_stack )
3104
0
      YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
3105
3106
0
    memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3107
3108
0
    yyg->yy_buffer_stack_max = num_to_alloc;
3109
0
    yyg->yy_buffer_stack_top = 0;
3110
0
    return;
3111
0
  }
3112
3113
0
  if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
3114
3115
    /* Increase the buffer to prepare for a possible push. */
3116
0
    yy_size_t grow_size = 8 /* arbitrary grow size */;
3117
3118
0
    num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
3119
0
    yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
3120
0
                (yyg->yy_buffer_stack,
3121
0
                num_to_alloc * sizeof(struct yy_buffer_state*)
3122
0
                , yyscanner);
3123
0
    if ( ! yyg->yy_buffer_stack )
3124
0
      YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
3125
3126
    /* zero only the new slots.*/
3127
0
    memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
3128
0
    yyg->yy_buffer_stack_max = num_to_alloc;
3129
0
  }
3130
0
}
3131
/* %endif */
3132
3133
/* %if-c-only */
3134
/** Setup the input buffer state to scan directly from a user-specified character buffer.
3135
 * @param base the character buffer
3136
 * @param size the size in bytes of the character buffer
3137
 * @param yyscanner The scanner object.
3138
 * @return the newly allocated buffer state object.
3139
 */
3140
YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
3141
0
{
3142
0
  YY_BUFFER_STATE b;
3143
    
3144
0
  if ( size < 2 ||
3145
0
       base[size-2] != YY_END_OF_BUFFER_CHAR ||
3146
0
       base[size-1] != YY_END_OF_BUFFER_CHAR )
3147
    /* They forgot to leave room for the EOB's. */
3148
0
    return NULL;
3149
3150
0
  b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
3151
0
  if ( ! b )
3152
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
3153
3154
0
  b->yy_buf_size = (int) (size - 2);  /* "- 2" to take care of EOB's */
3155
0
  b->yy_buf_pos = b->yy_ch_buf = base;
3156
0
  b->yy_is_our_buffer = 0;
3157
0
  b->yy_input_file = NULL;
3158
0
  b->yy_n_chars = b->yy_buf_size;
3159
0
  b->yy_is_interactive = 0;
3160
0
  b->yy_at_bol = 1;
3161
0
  b->yy_fill_buffer = 0;
3162
0
  b->yy_buffer_status = YY_BUFFER_NEW;
3163
3164
0
  yy_switch_to_buffer( b , yyscanner );
3165
3166
0
  return b;
3167
0
}
3168
/* %endif */
3169
3170
/* %if-c-only */
3171
/** Setup the input buffer state to scan a string. The next call to yylex() will
3172
 * scan from a @e copy of @a str.
3173
 * @param yystr a NUL-terminated string to scan
3174
 * @param yyscanner The scanner object.
3175
 * @return the newly allocated buffer state object.
3176
 * @note If you want to scan bytes that may contain NUL values, then use
3177
 *       yy_scan_bytes() instead.
3178
 */
3179
YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
3180
0
{
3181
    
3182
0
  return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
3183
0
}
3184
/* %endif */
3185
3186
/* %if-c-only */
3187
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
3188
 * scan from a @e copy of @a bytes.
3189
 * @param yybytes the byte buffer to scan
3190
 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
3191
 * @param yyscanner The scanner object.
3192
 * @return the newly allocated buffer state object.
3193
 */
3194
YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
3195
0
{
3196
0
  YY_BUFFER_STATE b;
3197
0
  char *buf;
3198
0
  yy_size_t n;
3199
0
  int i;
3200
    
3201
  /* Get memory for full buffer, including space for trailing EOB's. */
3202
0
  n = (yy_size_t) (_yybytes_len + 2);
3203
0
  buf = (char *) yyalloc( n , yyscanner );
3204
0
  if ( ! buf )
3205
0
    YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
3206
3207
0
  for ( i = 0; i < _yybytes_len; ++i )
3208
0
    buf[i] = yybytes[i];
3209
3210
0
  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3211
3212
0
  b = yy_scan_buffer( buf, n , yyscanner);
3213
0
  if ( ! b )
3214
0
    YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
3215
3216
  /* It's okay to grow etc. this buffer, and we should throw it
3217
   * away when we're done.
3218
   */
3219
0
  b->yy_is_our_buffer = 1;
3220
3221
0
  return b;
3222
0
}
3223
/* %endif */
3224
3225
#ifndef YY_EXIT_FAILURE
3226
#define YY_EXIT_FAILURE 2
3227
#endif
3228
3229
/* %if-c-only */
3230
static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
3231
0
{
3232
0
  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3233
0
  (void)yyg;
3234
0
  fprintf( stderr, "%s\n", msg );
3235
0
  exit( YY_EXIT_FAILURE );
3236
0
}
3237
/* %endif */
3238
/* %if-c++-only */
3239
/* %endif */
3240
3241
/* Redefine yyless() so it works in section 3 code. */
3242
3243
#undef yyless
3244
#define yyless(n) \
3245
  do \
3246
    { \
3247
    /* Undo effects of setting up yytext. */ \
3248
        int yyless_macro_arg = (n); \
3249
        YY_LESS_LINENO(yyless_macro_arg);\
3250
    yytext[yyleng] = yyg->yy_hold_char; \
3251
    yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
3252
    yyg->yy_hold_char = *yyg->yy_c_buf_p; \
3253
    *yyg->yy_c_buf_p = '\0'; \
3254
    yyleng = yyless_macro_arg; \
3255
    } \
3256
  while ( 0 )
3257
3258
/* Accessor  methods (get/set functions) to struct members. */
3259
3260
/* %if-c-only */
3261
/* %if-reentrant */
3262
3263
/** Get the user-defined data for this scanner.
3264
 * @param yyscanner The scanner object.
3265
 */
3266
YY_EXTRA_TYPE yyget_extra  (yyscan_t yyscanner)
3267
0
{
3268
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3269
0
    return yyextra;
3270
0
}
3271
3272
/* %endif */
3273
3274
/** Get the current line number.
3275
 * @param yyscanner The scanner object.
3276
 */
3277
int yyget_lineno  (yyscan_t yyscanner)
3278
0
{
3279
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3280
3281
0
        if (! YY_CURRENT_BUFFER)
3282
0
            return 0;
3283
    
3284
0
    return yylineno;
3285
0
}
3286
3287
/** Get the current column number.
3288
 * @param yyscanner The scanner object.
3289
 */
3290
int yyget_column  (yyscan_t yyscanner)
3291
0
{
3292
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3293
3294
0
        if (! YY_CURRENT_BUFFER)
3295
0
            return 0;
3296
    
3297
0
    return yycolumn;
3298
0
}
3299
3300
/** Get the input stream.
3301
 * @param yyscanner The scanner object.
3302
 */
3303
FILE *yyget_in  (yyscan_t yyscanner)
3304
0
{
3305
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3306
0
    return yyin;
3307
0
}
3308
3309
/** Get the output stream.
3310
 * @param yyscanner The scanner object.
3311
 */
3312
FILE *yyget_out  (yyscan_t yyscanner)
3313
0
{
3314
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3315
0
    return yyout;
3316
0
}
3317
3318
/** Get the length of the current token.
3319
 * @param yyscanner The scanner object.
3320
 */
3321
int yyget_leng  (yyscan_t yyscanner)
3322
0
{
3323
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3324
0
    return yyleng;
3325
0
}
3326
3327
/** Get the current token.
3328
 * @param yyscanner The scanner object.
3329
 */
3330
3331
char *yyget_text  (yyscan_t yyscanner)
3332
0
{
3333
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3334
0
    return yytext;
3335
0
}
3336
3337
/* %if-reentrant */
3338
3339
/** Set the user-defined data. This data is never touched by the scanner.
3340
 * @param user_defined The data to be associated with this scanner.
3341
 * @param yyscanner The scanner object.
3342
 */
3343
void yyset_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
3344
0
{
3345
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3346
0
    yyextra = user_defined ;
3347
0
}
3348
3349
/* %endif */
3350
3351
/** Set the current line number.
3352
 * @param _line_number line number
3353
 * @param yyscanner The scanner object.
3354
 */
3355
void yyset_lineno (int  _line_number , yyscan_t yyscanner)
3356
0
{
3357
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3358
3359
        /* lineno is only valid if an input buffer exists. */
3360
0
        if (! YY_CURRENT_BUFFER )
3361
0
           YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
3362
    
3363
0
    yylineno = _line_number;
3364
0
}
3365
3366
/** Set the current column.
3367
 * @param _column_no column number
3368
 * @param yyscanner The scanner object.
3369
 */
3370
void yyset_column (int  _column_no , yyscan_t yyscanner)
3371
0
{
3372
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3373
3374
        /* column is only valid if an input buffer exists. */
3375
0
        if (! YY_CURRENT_BUFFER )
3376
0
           YY_FATAL_ERROR( "yyset_column called with no buffer" );
3377
    
3378
0
    yycolumn = _column_no;
3379
0
}
3380
3381
/** Set the input stream. This does not discard the current
3382
 * input buffer.
3383
 * @param _in_str A readable stream.
3384
 * @param yyscanner The scanner object.
3385
 * @see yy_switch_to_buffer
3386
 */
3387
void yyset_in (FILE *  _in_str , yyscan_t yyscanner)
3388
0
{
3389
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3390
0
    yyin = _in_str ;
3391
0
}
3392
3393
void yyset_out (FILE *  _out_str , yyscan_t yyscanner)
3394
0
{
3395
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3396
0
    yyout = _out_str ;
3397
0
}
3398
3399
int yyget_debug  (yyscan_t yyscanner)
3400
0
{
3401
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3402
0
    return yy_flex_debug;
3403
0
}
3404
3405
void yyset_debug (int  _bdebug , yyscan_t yyscanner)
3406
0
{
3407
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3408
0
    yy_flex_debug = _bdebug ;
3409
0
}
3410
3411
/* %endif */
3412
3413
/* %if-reentrant */
3414
/* Accessor methods for yylval and yylloc */
3415
3416
/* %if-bison-bridge */
3417
/* %endif */
3418
3419
/* User-visible API */
3420
3421
/* yylex_init is special because it creates the scanner itself, so it is
3422
 * the ONLY reentrant function that doesn't take the scanner as the last argument.
3423
 * That's why we explicitly handle the declaration, instead of using our macros.
3424
 */
3425
int yylex_init(yyscan_t* ptr_yy_globals)
3426
0
{
3427
0
    if (ptr_yy_globals == NULL){
3428
0
        errno = EINVAL;
3429
0
        return 1;
3430
0
    }
3431
3432
0
    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
3433
3434
0
    if (*ptr_yy_globals == NULL){
3435
0
        errno = ENOMEM;
3436
0
        return 1;
3437
0
    }
3438
3439
    /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3440
0
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3441
3442
0
    return yy_init_globals ( *ptr_yy_globals );
3443
0
}
3444
3445
/* yylex_init_extra has the same functionality as yylex_init, but follows the
3446
 * convention of taking the scanner as the last argument. Note however, that
3447
 * this is a *pointer* to a scanner, as it will be allocated by this call (and
3448
 * is the reason, too, why this function also must handle its own declaration).
3449
 * The user defined value in the first argument will be available to yyalloc in
3450
 * the yyextra field.
3451
 */
3452
int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
3453
0
{
3454
0
    struct yyguts_t dummy_yyguts;
3455
3456
0
    yyset_extra (yy_user_defined, &dummy_yyguts);
3457
3458
0
    if (ptr_yy_globals == NULL){
3459
0
        errno = EINVAL;
3460
0
        return 1;
3461
0
    }
3462
3463
0
    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
3464
3465
0
    if (*ptr_yy_globals == NULL){
3466
0
        errno = ENOMEM;
3467
0
        return 1;
3468
0
    }
3469
3470
    /* By setting to 0xAA, we expose bugs in
3471
    yy_init_globals. Leave at 0x00 for releases. */
3472
0
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3473
3474
0
    yyset_extra (yy_user_defined, *ptr_yy_globals);
3475
3476
0
    return yy_init_globals ( *ptr_yy_globals );
3477
0
}
3478
3479
/* %endif if-c-only */
3480
3481
/* %if-c-only */
3482
static int yy_init_globals (yyscan_t yyscanner)
3483
0
{
3484
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3485
    /* Initialization is the same as for the non-reentrant scanner.
3486
     * This function is called from yylex_destroy(), so don't allocate here.
3487
     */
3488
3489
0
    yyg->yy_buffer_stack = NULL;
3490
0
    yyg->yy_buffer_stack_top = 0;
3491
0
    yyg->yy_buffer_stack_max = 0;
3492
0
    yyg->yy_c_buf_p = NULL;
3493
0
    yyg->yy_init = 0;
3494
0
    yyg->yy_start = 0;
3495
3496
0
    yyg->yy_start_stack_ptr = 0;
3497
0
    yyg->yy_start_stack_depth = 0;
3498
0
    yyg->yy_start_stack =  NULL;
3499
3500
/* Defined in main.c */
3501
#ifdef YY_STDINIT
3502
    yyin = stdin;
3503
    yyout = stdout;
3504
#else
3505
0
    yyin = NULL;
3506
0
    yyout = NULL;
3507
0
#endif
3508
3509
    /* For future reference: Set errno on error, since we are called by
3510
     * yylex_init()
3511
     */
3512
0
    return 0;
3513
0
}
3514
/* %endif */
3515
3516
/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
3517
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
3518
int yylex_destroy  (yyscan_t yyscanner)
3519
0
{
3520
0
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3521
3522
    /* Pop the buffer stack, destroying each element. */
3523
0
  while(YY_CURRENT_BUFFER){
3524
0
    yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
3525
0
    YY_CURRENT_BUFFER_LVALUE = NULL;
3526
0
    yypop_buffer_state(yyscanner);
3527
0
  }
3528
3529
  /* Destroy the stack itself. */
3530
0
  yyfree(yyg->yy_buffer_stack , yyscanner);
3531
0
  yyg->yy_buffer_stack = NULL;
3532
3533
    /* Destroy the start condition stack. */
3534
0
        yyfree( yyg->yy_start_stack , yyscanner );
3535
0
        yyg->yy_start_stack = NULL;
3536
3537
    /* Reset the globals. This is important in a non-reentrant scanner so the next time
3538
     * yylex() is called, initialization will occur. */
3539
0
    yy_init_globals( yyscanner);
3540
3541
/* %if-reentrant */
3542
    /* Destroy the main struct (reentrant only). */
3543
0
    yyfree ( yyscanner , yyscanner );
3544
0
    yyscanner = NULL;
3545
/* %endif */
3546
0
    return 0;
3547
0
}
3548
/* %endif */
3549
3550
/*
3551
 * Internal utility routines.
3552
 */
3553
3554
#ifndef yytext_ptr
3555
static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
3556
{
3557
  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3558
  (void)yyg;
3559
3560
  int i;
3561
  for ( i = 0; i < n; ++i )
3562
    s1[i] = s2[i];
3563
}
3564
#endif
3565
3566
#ifdef YY_NEED_STRLEN
3567
static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
3568
{
3569
  int n;
3570
  for ( n = 0; s[n]; ++n )
3571
    ;
3572
3573
  return n;
3574
}
3575
#endif
3576
3577
/* %if-tables-serialization definitions */
3578
/* %define-yytables   The name for this specific scanner's tables. */
3579
#define YYTABLES_NAME "yytables"
3580
/* %endif */
3581
3582
/* %ok-for-header */
3583
3584
#line 447 "/src/wireshark/epan/dissectors/radius_dict.l"
3585
3586
3587
/*
3588
 * Turn diagnostics back on, so we check the code that we've written.
3589
 */
3590
DIAG_ON_FLEX()
3591
3592
0
static void add_vendor(Radius_scanner_state_t* state, const char* name, uint32_t id, unsigned type_octets, unsigned length_octets, bool has_flags) {
3593
0
  radius_vendor_info_t* v;
3594
3595
0
  v = (radius_vendor_info_t *)g_hash_table_lookup(state->dict->vendors_by_id, GUINT_TO_POINTER(id));
3596
3597
0
  if (!v) {
3598
    /*
3599
     * New vendor.
3600
     * Allocate a new entry and insert it into the by-ID and
3601
     * by-name hash tables.
3602
     */
3603
0
    v = g_new(radius_vendor_info_t,1);
3604
0
    v->attrs_by_id = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, free_radius_attr_info);
3605
0
    v->code = id;
3606
0
    v->ett = -1;
3607
0
    v->name = g_strdup(name);
3608
0
    v->type_octets = type_octets;
3609
0
    v->length_octets = length_octets;
3610
0
    v->has_flags = has_flags;
3611
3612
0
    g_hash_table_insert(state->dict->vendors_by_id,GUINT_TO_POINTER(v->code),v);
3613
0
    g_hash_table_insert(state->dict->vendors_by_name, (void *) v->name, v);
3614
0
  } else {
3615
    /*
3616
     * This vendor is already in the table.
3617
     *
3618
     * Assume that the dictionary knows the 'ground truth' about
3619
     * the type/length/has_flags information and thus allow the
3620
     * dictionary to overwrite these values even for vendors that
3621
     * have already been loaded.
3622
     *
3623
     * XXX - this could be due to the vendor being in multiple
3624
     * dictionary files, rather than having been specially
3625
     * entered by the RADIUS dissector, as a side effect of
3626
     * specially entering an attribute; should we report vendors
3627
     * that appear in different dictionaries with different
3628
     * properties?
3629
     */
3630
0
    v->type_octets = type_octets;
3631
0
    v->length_octets = length_octets;
3632
0
    v->has_flags = has_flags;
3633
3634
    /*
3635
     * Did the name change?
3636
     */
3637
0
    if (g_strcmp0(v->name, name) != 0) {
3638
      /*
3639
       * Yes.  Remove the entry from the by-name hash table
3640
       * and re-insert it with the new name.
3641
       */
3642
0
      g_hash_table_remove(state->dict->vendors_by_name, (void *) v->name);
3643
0
      g_free((void *) v->name);
3644
0
      v->name = g_strdup(name);
3645
0
      g_hash_table_insert(state->dict->vendors_by_name, (void *) v->name, v);
3646
0
    }
3647
0
  }
3648
0
}
3649
3650
0
static bool add_attribute(Radius_scanner_state_t* state, const char* name, const  char* codestr, radius_attr_dissector_t type, const  char* vendor, unsigned encrypted_flag, bool tagged, bool concat, const char* attr) {
3651
0
  radius_attr_info_t* a;
3652
0
  GHashTable* by_id;
3653
0
  radius_attr_type_t code;
3654
0
  uint8_t code0 = 0, code1 = 0;
3655
0
  char *dot, *buf = NULL;
3656
3657
0
  if (attr){
3658
0
    return add_tlv(state, name, codestr, type, attr);
3659
0
  }
3660
3661
0
  buf = g_strdup(codestr);
3662
0
  dot = strchr(codestr, '.');
3663
0
  if (dot)
3664
0
    *dot = '\0';
3665
0
  code0 = (uint8_t) strtoul(buf, NULL, 10);
3666
0
  if (dot)
3667
0
    code1 = (uint8_t) strtoul(dot + 1, NULL, 10);
3668
0
  g_free(buf);
3669
3670
0
  memset(&code, 0, sizeof(code));
3671
0
  if (vendor) {
3672
0
    if (state->current_vendor_evs_type) {
3673
0
      code.u8_code[0] = (uint8_t) state->current_vendor_evs_type;
3674
0
      code.u8_code[1] = code0;
3675
0
    } else {
3676
0
      code.u8_code[0] = code0;
3677
0
      code.u8_code[1] = 0;
3678
0
    }
3679
3680
0
    radius_vendor_info_t* v = (radius_vendor_info_t *)g_hash_table_lookup(state->dict->vendors_by_name,vendor);
3681
0
    if (! v) {
3682
0
      g_string_append_printf(state->error, "Vendor: '%s', does not exist in %s:%i \n", vendor, state->fullpaths[state->include_stack_ptr], state->linenums[state->include_stack_ptr] );
3683
0
      return false;
3684
0
    } else {
3685
0
      by_id = v->attrs_by_id;
3686
0
    }
3687
0
  } else {
3688
0
    code.u8_code[0] = code0;
3689
0
    code.u8_code[1] = code1;
3690
3691
0
    by_id = state->dict->attrs_by_id;
3692
0
  }
3693
3694
  /*
3695
   * XXX - FreeRADIUS dict.c enforces that concat can only be used with
3696
   * type radius_octets, not with any other flags, and not with VSAs.
3697
   */
3698
3699
0
  a=(radius_attr_info_t*)g_hash_table_lookup(by_id, GUINT_TO_POINTER(code.value));
3700
3701
0
  if (!a) {
3702
    /*
3703
     * New attribute.
3704
     * Allocate a new entry and insert it into the by-ID and
3705
     * by-name hash tables.
3706
     */
3707
0
    a = g_new(radius_attr_info_t,1);
3708
0
    a->code = code;
3709
0
    a->name = g_strdup(name);
3710
0
    a->dissector = NULL;
3711
0
    a->encrypt = encrypted_flag;
3712
0
    a->tagged =  tagged;
3713
0
    a->concat =  concat;
3714
0
    a->type = type;
3715
0
    a->vs = NULL;
3716
0
    a->hf = -1;
3717
0
    a->hf_alt = -1;
3718
0
    a->hf_enc = -1;
3719
0
    a->hf_tag = -1;
3720
0
    a->hf_len = -1;
3721
0
    a->ett = -1;
3722
0
    a->tlvs_by_id = NULL;
3723
0
    g_hash_table_insert(by_id, GUINT_TO_POINTER(code.value),a);
3724
0
    g_hash_table_insert(state->dict->attrs_by_name,(void *) (a->name),a);
3725
0
  } else {
3726
    /*
3727
     * This attribute is already in the table.
3728
     *
3729
     * Overwrite the encrypted flag, tagged property, concat
3730
     * property, and type; the other properties don't get set
3731
     * until after we've finished reading the dictionaries.
3732
     *
3733
     * XXX - this could be due to the attribute being in
3734
     * multiple dictionary files, rather than having been
3735
     * specially entered by the RADIUS dissector to give it
3736
     * a special dissection routine; should we report attributes
3737
     * that appear in different dictionaries with different
3738
     * properties?
3739
     */
3740
0
    a->encrypt = encrypted_flag;
3741
0
    a->tagged =  tagged;
3742
0
    a->concat =  concat;
3743
0
    a->type = type;
3744
3745
    /*
3746
     * Did the name change?
3747
     */
3748
0
    if (g_strcmp0(a->name, name) != 0) {
3749
      /*
3750
       * Yes.  Steal the entry from the by-name hash table
3751
       * and re-insert it with the new name.  (Don't
3752
       * remove it - that calls the free routine, which
3753
       * frees up the entry.)
3754
       */
3755
0
      g_hash_table_steal(state->dict->attrs_by_name, (void *) (a->name));
3756
0
      g_free((void *) a->name);
3757
0
      a->name = g_strdup(name);
3758
0
      g_hash_table_insert(state->dict->attrs_by_name, (void *) (a->name),a);
3759
0
    }
3760
0
  }
3761
0
  return true;
3762
0
}
3763
3764
0
static bool add_tlv(Radius_scanner_state_t* state, const char* name, const  char* codestr, radius_attr_dissector_t type, const char* attr) {
3765
0
  radius_attr_info_t* a;
3766
0
  radius_attr_info_t* s;
3767
0
  radius_attr_type_t code;
3768
3769
0
  a = (radius_attr_info_t*)g_hash_table_lookup(state->dict->attrs_by_name, attr);
3770
3771
0
  if (!a) {
3772
0
    a = (radius_attr_info_t*)g_hash_table_lookup(state->dict->tlvs_by_name, attr);
3773
0
  }
3774
3775
0
  if (!a) {
3776
0
    g_string_append_printf(state->error, "Attr: '%s', does not exist in %s:%i \n", attr, state->fullpaths[state->include_stack_ptr], state->linenums[state->include_stack_ptr]);
3777
0
    return false;
3778
0
  }
3779
3780
0
  if (!a->tlvs_by_id) {
3781
0
    a->tlvs_by_id = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, free_radius_attr_info);
3782
0
  }
3783
3784
0
  memset(&code, 0, sizeof(code));
3785
0
  code.u8_code[0] = (uint8_t) strtoul(codestr, NULL, 10);
3786
3787
0
  s = (radius_attr_info_t*)g_hash_table_lookup(a->tlvs_by_id, GUINT_TO_POINTER(code.value));
3788
3789
0
  if (!s) {
3790
    /*
3791
     * This TLV doesn't yet exist in this attribute's TLVs-by-ID
3792
     * hash table.  Add it.
3793
     */
3794
0
    s = g_new(radius_attr_info_t,1);
3795
0
    s->name = g_strdup(name);
3796
0
    s->dissector = NULL;
3797
0
    s->code = code;
3798
0
    s->type = type;
3799
0
    s->encrypt = false;
3800
0
    s->tagged = false;
3801
0
    s->concat = false;
3802
0
    s->dissector = NULL;
3803
0
    s->vs = NULL;
3804
0
    s->hf = -1;
3805
0
    s->hf_alt = -1;
3806
0
    s->hf_tag = -1;
3807
0
    s->hf_len = -1;
3808
0
    s->ett = -1;
3809
0
    s->tlvs_by_id = NULL;
3810
3811
0
    g_hash_table_insert(a->tlvs_by_id,GUINT_TO_POINTER(s->code.value),s);
3812
0
    g_hash_table_insert(state->dict->tlvs_by_name,(void *) (s->name),s);
3813
0
  }
3814
3815
  /*
3816
   * If it *does* exist, leave it alone; there shouldn't be duplicate
3817
   * entries by name in the dictionaries (even if there might be
3818
   * multiple entries for a given attribute in the dictionaries, each
3819
   * one adding some TLV values), and we don't directly add entries
3820
   * for TLVs in the RADIUS dissector.
3821
   *
3822
   * XXX - report the duplicate entries?
3823
   */
3824
0
  return true;
3825
0
}
3826
3827
0
void add_value(Radius_scanner_state_t* state, const char* attrib_name, const char* repr, uint32_t value) {
3828
0
  value_string v;
3829
0
  GArray* a = (GArray*)g_hash_table_lookup(state->value_strings,attrib_name);
3830
3831
0
  if (! a) {
3832
    /* Ensure that the array is zero terminated. */
3833
0
    a = g_array_new(true, true, sizeof(value_string));
3834
0
    g_hash_table_insert(state->value_strings, g_strdup(attrib_name), a);
3835
0
  }
3836
3837
0
  v.value = value;
3838
0
  v.strptr = g_strdup(repr);
3839
3840
0
  g_array_append_val(a,v);
3841
0
}
3842
3843
0
static void setup_tlvs(void *k _U_, void *v, void *p) {
3844
0
  radius_attr_info_t* s = (radius_attr_info_t*)v;
3845
0
  Radius_scanner_state_t* state = (Radius_scanner_state_t*)p;
3846
0
  void *key;
3847
3848
0
  union {
3849
0
    GArray* a;
3850
0
    void *p;
3851
0
  } vs;
3852
3853
0
  if (g_hash_table_lookup_extended(state->value_strings, s->name, &key, &vs.p)) {
3854
0
    g_hash_table_steal(state->value_strings, key);
3855
0
    s->vs = (value_string*)(void *)g_array_free(vs.a, false);
3856
0
    g_free(key);
3857
0
  }
3858
3859
0
  if (s->tlvs_by_id) {
3860
0
    g_hash_table_foreach(s->tlvs_by_id, setup_tlvs, p);
3861
0
  }
3862
0
}
3863
3864
0
static void setup_attrs(void *k _U_, void *v, void *p) {
3865
0
  radius_attr_info_t* a = (radius_attr_info_t*)v;
3866
0
  Radius_scanner_state_t* state = (Radius_scanner_state_t*)p;
3867
0
  void *key;
3868
3869
0
  union {
3870
0
    GArray* a;
3871
0
    void *p;
3872
0
  } vs;
3873
3874
0
  if (g_hash_table_lookup_extended(state->value_strings, a->name, &key, &vs.p) ) {
3875
0
    g_hash_table_steal(state->value_strings, key);
3876
0
    g_array_sort(vs.a, value_str_value_compare);
3877
0
    a->vs = (value_string*)(void *)g_array_free(vs.a, false);
3878
0
    g_free(key);
3879
0
  }
3880
3881
0
  if (a->tlvs_by_id) {
3882
0
    g_hash_table_foreach(a->tlvs_by_id, setup_tlvs, p);
3883
0
  }
3884
0
}
3885
3886
0
static void setup_vendors(void *k _U_, void *v, void *p) {
3887
0
  radius_vendor_info_t* vnd = (radius_vendor_info_t*)v;
3888
3889
0
  g_hash_table_foreach(vnd->attrs_by_id,setup_attrs,p);
3890
0
}
3891
3892
0
static void destroy_value_strings(void *v) {
3893
0
  value_string* vs = (value_string*)(void *)(((GArray*)v)->data);
3894
3895
0
  for (;vs->strptr;vs++) {
3896
0
    g_free((void*)vs->strptr);
3897
0
  }
3898
3899
0
  g_array_free((GArray*)v,true);
3900
0
}
3901
3902
0
bool radius_load_dictionary (radius_dictionary_t* d, char* dir, const char* filename, char** err_str) {
3903
0
  FILE *in;
3904
0
  yyscan_t scanner;
3905
0
  Radius_scanner_state_t state;
3906
0
  int i;
3907
3908
0
  state.include_stack_ptr = 0;
3909
3910
0
  state.dict = d;
3911
0
  state.value_strings = NULL;
3912
3913
0
  state.attr_name = NULL;
3914
0
  state.attr_id = NULL;
3915
0
  state.attr_type = NULL;
3916
0
  state.attr_vendor = NULL;
3917
0
  state.vendor_name = NULL;
3918
0
  state.vendor_id = 0;
3919
0
  state.vendor_type_octets = 1;
3920
0
  state.vendor_length_octets = 1;
3921
0
  state.vendor_has_flags = false;
3922
0
  state.value_repr = NULL;
3923
0
  state.encrypted = 0;
3924
0
  state.has_tag = false;
3925
0
  state.concat = false;
3926
0
  state.current_vendor = NULL;
3927
0
  state.current_vendor_evs_type = 0;
3928
3929
0
  state.directory = g_strdup(dir);
3930
3931
0
  state.fullpaths[0] = ws_strdup_printf("%s" G_DIR_SEPARATOR_S "%s",
3932
0
      state.directory,filename);
3933
0
  state.linenums[0] = 1;
3934
0
  state.tlv_stack[0] = NULL;
3935
0
  for (i = 1; i < MAX_INCLUDE_DEPTH; i++) {
3936
0
    state.fullpaths[i] = NULL;
3937
0
    state.linenums[i] = 1;
3938
0
    state.tlv_stack[i] = NULL;
3939
0
  }
3940
3941
0
  state.tlv_stack_ptr = 0;
3942
3943
0
  state.error = g_string_new("");
3944
3945
0
  in = ws_fopen(state.fullpaths[0],"r");
3946
3947
0
  if (!in) {
3948
0
    g_string_append_printf(state.error, "Could not open file: '%s', error: %s\n", state.fullpaths[0], g_strerror(errno));
3949
0
    g_free(state.fullpaths[0]);
3950
0
    *err_str = g_string_free(state.error,FALSE);
3951
0
    return false;
3952
0
  }
3953
3954
0
  state.value_strings = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, destroy_value_strings);
3955
3956
0
  if (Radius_lex_init(&scanner) != 0) {
3957
0
    g_string_append_printf(state.error, "Can't initialize scanner: %s",
3958
0
        strerror(errno));
3959
0
    fclose(in);
3960
0
    g_free(state.fullpaths[0]);
3961
0
    *err_str = g_string_free(state.error,FALSE);
3962
0
    return false;
3963
0
  }
3964
3965
0
  Radius_set_in(in, scanner);
3966
3967
  /* Associate the state with the scanner */
3968
0
  Radius_set_extra(&state, scanner);
3969
3970
0
  Radius_lex(scanner);
3971
3972
0
  Radius_lex_destroy(scanner);
3973
  /*
3974
   * XXX - can the lexical analyzer terminate without closing
3975
   * all open input files?
3976
   */
3977
3978
0
  for (i = 0; i < MAX_INCLUDE_DEPTH; i++) {
3979
0
    g_free(state.fullpaths[i]);
3980
0
    g_free(state.tlv_stack[i]);
3981
0
  }
3982
3983
0
  g_hash_table_foreach(state.dict->attrs_by_id,setup_attrs,&state);
3984
0
  g_hash_table_foreach(state.dict->vendors_by_id,setup_vendors,&state);
3985
0
  g_hash_table_destroy(state.value_strings);
3986
3987
0
  if (state.error->len > 0) {
3988
0
    *err_str = g_string_free(state.error,FALSE);
3989
0
    return false;
3990
0
  } else {
3991
0
    *err_str = NULL;
3992
0
    g_string_free(state.error,TRUE);
3993
0
    return true;
3994
0
  }
3995
0
}
3996
3997
/*
3998
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
3999
 *
4000
 * Local variables:
4001
 * c-basic-offset: 8
4002
 * tab-width: 8
4003
 * indent-tabs-mode: t
4004
 * End:
4005
 *
4006
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
4007
 * :indentSize=8:tabSize=8:noTabs=false:
4008
 */
4009