Coverage Report

Created: 2026-05-16 07:04

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/radvd/gram.c
Line
Count
Source
1
/* A Bison parser, made by GNU Bison 3.8.2.  */
2
3
/* Bison implementation for Yacc-like parsers in C
4
5
   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6
   Inc.
7
8
   This program is free software: you can redistribute it and/or modify
9
   it under the terms of the GNU General Public License as published by
10
   the Free Software Foundation, either version 3 of the License, or
11
   (at your option) any later version.
12
13
   This program is distributed in the hope that it will be useful,
14
   but WITHOUT ANY WARRANTY; without even the implied warranty of
15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
   GNU General Public License for more details.
17
18
   You should have received a copy of the GNU General Public License
19
   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
20
21
/* As a special exception, you may create a larger work that contains
22
   part or all of the Bison parser skeleton and distribute that work
23
   under terms of your choice, so long as that work isn't itself a
24
   parser generator using the skeleton or a modified version thereof
25
   as a parser skeleton.  Alternatively, if you modify or redistribute
26
   the parser skeleton itself, you may (at your option) remove this
27
   special exception, which will cause the skeleton and the resulting
28
   Bison output files to be licensed under the GNU General Public
29
   License without this special exception.
30
31
   This special exception was added by the Free Software Foundation in
32
   version 2.2 of Bison.  */
33
34
/* C LALR(1) parser skeleton written by Richard Stallman, by
35
   simplifying the original so-called "semantic" parser.  */
36
37
/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38
   especially those whose name start with YY_ or yy_.  They are
39
   private implementation details that can be changed or removed.  */
40
41
/* All symbols defined below should begin with yy or YY, to avoid
42
   infringing on user name space.  This should be done even for local
43
   variables, as they might otherwise be expanded by user macros.
44
   There are some unavoidable exceptions within include files to
45
   define necessary library symbols; they are noted "INFRINGES ON
46
   USER NAME SPACE" below.  */
47
48
/* Identify Bison output, and Bison version.  */
49
#define YYBISON 30802
50
51
/* Bison version string.  */
52
#define YYBISON_VERSION "3.8.2"
53
54
/* Skeleton name.  */
55
#define YYSKELETON_NAME "yacc.c"
56
57
/* Pure parsers.  */
58
#define YYPURE 0
59
60
/* Push parsers.  */
61
#define YYPUSH 0
62
63
/* Pull parsers.  */
64
#define YYPULL 1
65
66
67
68
69
/* First part of user prologue.  */
70
#line 15 "gram.y"
71
72
#include "config.h"
73
#include "includes.h"
74
#include "radvd.h"
75
#include "defaults.h"
76
77
#define YYERROR_VERBOSE 1
78
79
int yylex (void);
80
void yyset_in (FILE * _in_str);
81
int yylex_destroy (void);
82
83
#if 0 /* no longer necessary? */
84
#ifndef HAVE_IN6_ADDR_S6_ADDR
85
# ifdef __FreeBSD__
86
#  define s6_addr32 __u6_addr.__u6_addr32
87
#  define s6_addr16 __u6_addr.__u6_addr16
88
# endif
89
#endif
90
#endif
91
92
#define ADD_TO_LL(type, list, value) \
93
0
  do { \
94
0
    if (iface->list == NULL) \
95
0
      iface->list = value; \
96
0
    else { \
97
0
      type *current = iface->list; \
98
0
      while (current->next != NULL) \
99
0
        current = current->next; \
100
0
      current->next = value; \
101
0
    } \
102
0
  } while (0)
103
104
105
#line 106 "gram.c"
106
107
# ifndef YY_CAST
108
#  ifdef __cplusplus
109
#   define YY_CAST(Type, Val) static_cast<Type> (Val)
110
#   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
111
#  else
112
2.33k
#   define YY_CAST(Type, Val) ((Type) (Val))
113
#   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
114
#  endif
115
# endif
116
# ifndef YY_NULLPTR
117
#  if defined __cplusplus
118
#   if 201103L <= __cplusplus
119
#    define YY_NULLPTR nullptr
120
#   else
121
#    define YY_NULLPTR 0
122
#   endif
123
#  else
124
#   define YY_NULLPTR ((void*)0)
125
#  endif
126
# endif
127
128
/* Use api.header.include to #include this header
129
   instead of duplicating it here.  */
130
#ifndef YY_YY_GRAM_H_INCLUDED
131
# define YY_YY_GRAM_H_INCLUDED
132
/* Debug traces.  */
133
#ifndef YYDEBUG
134
# define YYDEBUG 0
135
#endif
136
#if YYDEBUG
137
extern int yydebug;
138
#endif
139
140
/* Token kinds.  */
141
#ifndef YYTOKENTYPE
142
# define YYTOKENTYPE
143
  enum yytokentype
144
  {
145
    YYEMPTY = -2,
146
    YYEOF = 0,                     /* "end of file"  */
147
    YYerror = 256,                 /* error  */
148
    YYUNDEF = 257,                 /* "invalid token"  */
149
    T_INTERFACE = 258,             /* T_INTERFACE  */
150
    T_PREFIX = 259,                /* T_PREFIX  */
151
    T_ROUTE = 260,                 /* T_ROUTE  */
152
    T_RDNSS = 261,                 /* T_RDNSS  */
153
    T_DNSSL = 262,                 /* T_DNSSL  */
154
    T_CLIENTS = 263,               /* T_CLIENTS  */
155
    T_LOWPANCO = 264,              /* T_LOWPANCO  */
156
    T_ABRO = 265,                  /* T_ABRO  */
157
    T_RASRCADDRESS = 266,          /* T_RASRCADDRESS  */
158
    T_NAT64PREFIX = 267,           /* T_NAT64PREFIX  */
159
    T_AUTOIGNOREPREFIX = 268,      /* T_AUTOIGNOREPREFIX  */
160
    STRING = 269,                  /* STRING  */
161
    NUMBER = 270,                  /* NUMBER  */
162
    SIGNEDNUMBER = 271,            /* SIGNEDNUMBER  */
163
    DECIMAL = 272,                 /* DECIMAL  */
164
    SWITCH = 273,                  /* SWITCH  */
165
    IPV6ADDR = 274,                /* IPV6ADDR  */
166
    NOT_IPV6ADDR = 275,            /* NOT_IPV6ADDR  */
167
    INFINITY = 276,                /* INFINITY  */
168
    T_IgnoreIfMissing = 277,       /* T_IgnoreIfMissing  */
169
    T_AdvSendAdvert = 278,         /* T_AdvSendAdvert  */
170
    T_MaxRtrAdvInterval = 279,     /* T_MaxRtrAdvInterval  */
171
    T_MinRtrAdvInterval = 280,     /* T_MinRtrAdvInterval  */
172
    T_MinDelayBetweenRAs = 281,    /* T_MinDelayBetweenRAs  */
173
    T_AdvManagedFlag = 282,        /* T_AdvManagedFlag  */
174
    T_AdvOtherConfigFlag = 283,    /* T_AdvOtherConfigFlag  */
175
    T_AdvLinkMTU = 284,            /* T_AdvLinkMTU  */
176
    T_AdvRAMTU = 285,              /* T_AdvRAMTU  */
177
    T_AdvReachableTime = 286,      /* T_AdvReachableTime  */
178
    T_AdvRetransTimer = 287,       /* T_AdvRetransTimer  */
179
    T_AdvCurHopLimit = 288,        /* T_AdvCurHopLimit  */
180
    T_AdvDefaultLifetime = 289,    /* T_AdvDefaultLifetime  */
181
    T_AdvDefaultPreference = 290,  /* T_AdvDefaultPreference  */
182
    T_AdvSourceLLAddress = 291,    /* T_AdvSourceLLAddress  */
183
    T_RemoveAdvOnExit = 292,       /* T_RemoveAdvOnExit  */
184
    T_AdvOnLink = 293,             /* T_AdvOnLink  */
185
    T_AdvAutonomous = 294,         /* T_AdvAutonomous  */
186
    T_AdvValidLifetime = 295,      /* T_AdvValidLifetime  */
187
    T_AdvPreferredLifetime = 296,  /* T_AdvPreferredLifetime  */
188
    T_DeprecatePrefix = 297,       /* T_DeprecatePrefix  */
189
    T_DecrementLifetimes = 298,    /* T_DecrementLifetimes  */
190
    T_AdvRouterAddr = 299,         /* T_AdvRouterAddr  */
191
    T_AdvHomeAgentFlag = 300,      /* T_AdvHomeAgentFlag  */
192
    T_AdvIntervalOpt = 301,        /* T_AdvIntervalOpt  */
193
    T_AdvHomeAgentInfo = 302,      /* T_AdvHomeAgentInfo  */
194
    T_Base6Interface = 303,        /* T_Base6Interface  */
195
    T_Base6to4Interface = 304,     /* T_Base6to4Interface  */
196
    T_UnicastOnly = 305,           /* T_UnicastOnly  */
197
    T_UnrestrictedUnicast = 306,   /* T_UnrestrictedUnicast  */
198
    T_AdvRASolicitedUnicast = 307, /* T_AdvRASolicitedUnicast  */
199
    T_AdvCaptivePortalAPI = 308,   /* T_AdvCaptivePortalAPI  */
200
    T_HomeAgentPreference = 309,   /* T_HomeAgentPreference  */
201
    T_HomeAgentLifetime = 310,     /* T_HomeAgentLifetime  */
202
    T_AdvRoutePreference = 311,    /* T_AdvRoutePreference  */
203
    T_AdvRouteLifetime = 312,      /* T_AdvRouteLifetime  */
204
    T_RemoveRoute = 313,           /* T_RemoveRoute  */
205
    T_AdvRDNSSPreference = 314,    /* T_AdvRDNSSPreference  */
206
    T_AdvRDNSSOpenFlag = 315,      /* T_AdvRDNSSOpenFlag  */
207
    T_AdvRDNSSLifetime = 316,      /* T_AdvRDNSSLifetime  */
208
    T_FlushRDNSS = 317,            /* T_FlushRDNSS  */
209
    T_AdvDNSSLLifetime = 318,      /* T_AdvDNSSLLifetime  */
210
    T_FlushDNSSL = 319,            /* T_FlushDNSSL  */
211
    T_AdvMobRtrSupportFlag = 320,  /* T_AdvMobRtrSupportFlag  */
212
    T_AdvContextLength = 321,      /* T_AdvContextLength  */
213
    T_AdvContextCompressionFlag = 322, /* T_AdvContextCompressionFlag  */
214
    T_AdvContextID = 323,          /* T_AdvContextID  */
215
    T_AdvLifeTime = 324,           /* T_AdvLifeTime  */
216
    T_AdvContextPrefix = 325,      /* T_AdvContextPrefix  */
217
    T_AdvVersionLow = 326,         /* T_AdvVersionLow  */
218
    T_AdvVersionHigh = 327,        /* T_AdvVersionHigh  */
219
    T_Adv6LBRaddress = 328,        /* T_Adv6LBRaddress  */
220
    T_BAD_TOKEN = 329              /* T_BAD_TOKEN  */
221
  };
222
  typedef enum yytokentype yytoken_kind_t;
223
#endif
224
/* Token kinds.  */
225
2.38k
#define YYEMPTY -2
226
644
#define YYEOF 0
227
548
#define YYerror 256
228
0
#define YYUNDEF 257
229
#define T_INTERFACE 258
230
#define T_PREFIX 259
231
#define T_ROUTE 260
232
#define T_RDNSS 261
233
#define T_DNSSL 262
234
#define T_CLIENTS 263
235
#define T_LOWPANCO 264
236
#define T_ABRO 265
237
#define T_RASRCADDRESS 266
238
#define T_NAT64PREFIX 267
239
#define T_AUTOIGNOREPREFIX 268
240
#define STRING 269
241
#define NUMBER 270
242
#define SIGNEDNUMBER 271
243
#define DECIMAL 272
244
#define SWITCH 273
245
#define IPV6ADDR 274
246
#define NOT_IPV6ADDR 275
247
#define INFINITY 276
248
#define T_IgnoreIfMissing 277
249
#define T_AdvSendAdvert 278
250
#define T_MaxRtrAdvInterval 279
251
#define T_MinRtrAdvInterval 280
252
#define T_MinDelayBetweenRAs 281
253
#define T_AdvManagedFlag 282
254
#define T_AdvOtherConfigFlag 283
255
#define T_AdvLinkMTU 284
256
#define T_AdvRAMTU 285
257
#define T_AdvReachableTime 286
258
#define T_AdvRetransTimer 287
259
#define T_AdvCurHopLimit 288
260
#define T_AdvDefaultLifetime 289
261
#define T_AdvDefaultPreference 290
262
#define T_AdvSourceLLAddress 291
263
#define T_RemoveAdvOnExit 292
264
#define T_AdvOnLink 293
265
#define T_AdvAutonomous 294
266
#define T_AdvValidLifetime 295
267
#define T_AdvPreferredLifetime 296
268
#define T_DeprecatePrefix 297
269
#define T_DecrementLifetimes 298
270
#define T_AdvRouterAddr 299
271
#define T_AdvHomeAgentFlag 300
272
#define T_AdvIntervalOpt 301
273
#define T_AdvHomeAgentInfo 302
274
#define T_Base6Interface 303
275
#define T_Base6to4Interface 304
276
#define T_UnicastOnly 305
277
#define T_UnrestrictedUnicast 306
278
#define T_AdvRASolicitedUnicast 307
279
#define T_AdvCaptivePortalAPI 308
280
#define T_HomeAgentPreference 309
281
#define T_HomeAgentLifetime 310
282
#define T_AdvRoutePreference 311
283
#define T_AdvRouteLifetime 312
284
#define T_RemoveRoute 313
285
#define T_AdvRDNSSPreference 314
286
#define T_AdvRDNSSOpenFlag 315
287
#define T_AdvRDNSSLifetime 316
288
#define T_FlushRDNSS 317
289
#define T_AdvDNSSLLifetime 318
290
#define T_FlushDNSSL 319
291
#define T_AdvMobRtrSupportFlag 320
292
#define T_AdvContextLength 321
293
#define T_AdvContextCompressionFlag 322
294
#define T_AdvContextID 323
295
#define T_AdvLifeTime 324
296
#define T_AdvContextPrefix 325
297
#define T_AdvVersionLow 326
298
#define T_AdvVersionHigh 327
299
#define T_Adv6LBRaddress 328
300
#define T_BAD_TOKEN 329
301
302
/* Value type.  */
303
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
304
union YYSTYPE
305
{
306
#line 149 "gram.y"
307
308
  unsigned int    num;
309
  int     snum;
310
  double      dec;
311
  struct in6_addr   *addr;
312
  char      *str;
313
  struct AdvPrefix  *pinfo;
314
  struct AdvRoute   *rinfo;
315
  struct AdvRDNSS   *rdnssinfo;
316
  struct AdvDNSSL   *dnsslinfo;
317
  struct Clients    *ainfo;
318
  struct AdvLowpanCo  *lowpancoinfo;
319
  struct AdvAbro    *abroinfo;
320
  struct AdvRASrcAddress  *rasrcaddressinfo;
321
  struct NAT64Prefix  *nat64pinfo;
322
  struct AutogenIgnorePrefix  *igpinfo;
323
324
#line 325 "gram.c"
325
326
};
327
typedef union YYSTYPE YYSTYPE;
328
# define YYSTYPE_IS_TRIVIAL 1
329
# define YYSTYPE_IS_DECLARED 1
330
#endif
331
332
333
extern YYSTYPE yylval;
334
335
336
int yyparse (void);
337
338
339
#endif /* !YY_YY_GRAM_H_INCLUDED  */
340
/* Symbol kind.  */
341
enum yysymbol_kind_t
342
{
343
  YYSYMBOL_YYEMPTY = -2,
344
  YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
345
  YYSYMBOL_YYerror = 1,                    /* error  */
346
  YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
347
  YYSYMBOL_T_INTERFACE = 3,                /* T_INTERFACE  */
348
  YYSYMBOL_T_PREFIX = 4,                   /* T_PREFIX  */
349
  YYSYMBOL_T_ROUTE = 5,                    /* T_ROUTE  */
350
  YYSYMBOL_T_RDNSS = 6,                    /* T_RDNSS  */
351
  YYSYMBOL_T_DNSSL = 7,                    /* T_DNSSL  */
352
  YYSYMBOL_T_CLIENTS = 8,                  /* T_CLIENTS  */
353
  YYSYMBOL_T_LOWPANCO = 9,                 /* T_LOWPANCO  */
354
  YYSYMBOL_T_ABRO = 10,                    /* T_ABRO  */
355
  YYSYMBOL_T_RASRCADDRESS = 11,            /* T_RASRCADDRESS  */
356
  YYSYMBOL_T_NAT64PREFIX = 12,             /* T_NAT64PREFIX  */
357
  YYSYMBOL_T_AUTOIGNOREPREFIX = 13,        /* T_AUTOIGNOREPREFIX  */
358
  YYSYMBOL_STRING = 14,                    /* STRING  */
359
  YYSYMBOL_NUMBER = 15,                    /* NUMBER  */
360
  YYSYMBOL_SIGNEDNUMBER = 16,              /* SIGNEDNUMBER  */
361
  YYSYMBOL_DECIMAL = 17,                   /* DECIMAL  */
362
  YYSYMBOL_SWITCH = 18,                    /* SWITCH  */
363
  YYSYMBOL_IPV6ADDR = 19,                  /* IPV6ADDR  */
364
  YYSYMBOL_NOT_IPV6ADDR = 20,              /* NOT_IPV6ADDR  */
365
  YYSYMBOL_INFINITY = 21,                  /* INFINITY  */
366
  YYSYMBOL_T_IgnoreIfMissing = 22,         /* T_IgnoreIfMissing  */
367
  YYSYMBOL_T_AdvSendAdvert = 23,           /* T_AdvSendAdvert  */
368
  YYSYMBOL_T_MaxRtrAdvInterval = 24,       /* T_MaxRtrAdvInterval  */
369
  YYSYMBOL_T_MinRtrAdvInterval = 25,       /* T_MinRtrAdvInterval  */
370
  YYSYMBOL_T_MinDelayBetweenRAs = 26,      /* T_MinDelayBetweenRAs  */
371
  YYSYMBOL_T_AdvManagedFlag = 27,          /* T_AdvManagedFlag  */
372
  YYSYMBOL_T_AdvOtherConfigFlag = 28,      /* T_AdvOtherConfigFlag  */
373
  YYSYMBOL_T_AdvLinkMTU = 29,              /* T_AdvLinkMTU  */
374
  YYSYMBOL_T_AdvRAMTU = 30,                /* T_AdvRAMTU  */
375
  YYSYMBOL_T_AdvReachableTime = 31,        /* T_AdvReachableTime  */
376
  YYSYMBOL_T_AdvRetransTimer = 32,         /* T_AdvRetransTimer  */
377
  YYSYMBOL_T_AdvCurHopLimit = 33,          /* T_AdvCurHopLimit  */
378
  YYSYMBOL_T_AdvDefaultLifetime = 34,      /* T_AdvDefaultLifetime  */
379
  YYSYMBOL_T_AdvDefaultPreference = 35,    /* T_AdvDefaultPreference  */
380
  YYSYMBOL_T_AdvSourceLLAddress = 36,      /* T_AdvSourceLLAddress  */
381
  YYSYMBOL_T_RemoveAdvOnExit = 37,         /* T_RemoveAdvOnExit  */
382
  YYSYMBOL_T_AdvOnLink = 38,               /* T_AdvOnLink  */
383
  YYSYMBOL_T_AdvAutonomous = 39,           /* T_AdvAutonomous  */
384
  YYSYMBOL_T_AdvValidLifetime = 40,        /* T_AdvValidLifetime  */
385
  YYSYMBOL_T_AdvPreferredLifetime = 41,    /* T_AdvPreferredLifetime  */
386
  YYSYMBOL_T_DeprecatePrefix = 42,         /* T_DeprecatePrefix  */
387
  YYSYMBOL_T_DecrementLifetimes = 43,      /* T_DecrementLifetimes  */
388
  YYSYMBOL_T_AdvRouterAddr = 44,           /* T_AdvRouterAddr  */
389
  YYSYMBOL_T_AdvHomeAgentFlag = 45,        /* T_AdvHomeAgentFlag  */
390
  YYSYMBOL_T_AdvIntervalOpt = 46,          /* T_AdvIntervalOpt  */
391
  YYSYMBOL_T_AdvHomeAgentInfo = 47,        /* T_AdvHomeAgentInfo  */
392
  YYSYMBOL_T_Base6Interface = 48,          /* T_Base6Interface  */
393
  YYSYMBOL_T_Base6to4Interface = 49,       /* T_Base6to4Interface  */
394
  YYSYMBOL_T_UnicastOnly = 50,             /* T_UnicastOnly  */
395
  YYSYMBOL_T_UnrestrictedUnicast = 51,     /* T_UnrestrictedUnicast  */
396
  YYSYMBOL_T_AdvRASolicitedUnicast = 52,   /* T_AdvRASolicitedUnicast  */
397
  YYSYMBOL_T_AdvCaptivePortalAPI = 53,     /* T_AdvCaptivePortalAPI  */
398
  YYSYMBOL_T_HomeAgentPreference = 54,     /* T_HomeAgentPreference  */
399
  YYSYMBOL_T_HomeAgentLifetime = 55,       /* T_HomeAgentLifetime  */
400
  YYSYMBOL_T_AdvRoutePreference = 56,      /* T_AdvRoutePreference  */
401
  YYSYMBOL_T_AdvRouteLifetime = 57,        /* T_AdvRouteLifetime  */
402
  YYSYMBOL_T_RemoveRoute = 58,             /* T_RemoveRoute  */
403
  YYSYMBOL_T_AdvRDNSSPreference = 59,      /* T_AdvRDNSSPreference  */
404
  YYSYMBOL_T_AdvRDNSSOpenFlag = 60,        /* T_AdvRDNSSOpenFlag  */
405
  YYSYMBOL_T_AdvRDNSSLifetime = 61,        /* T_AdvRDNSSLifetime  */
406
  YYSYMBOL_T_FlushRDNSS = 62,              /* T_FlushRDNSS  */
407
  YYSYMBOL_T_AdvDNSSLLifetime = 63,        /* T_AdvDNSSLLifetime  */
408
  YYSYMBOL_T_FlushDNSSL = 64,              /* T_FlushDNSSL  */
409
  YYSYMBOL_T_AdvMobRtrSupportFlag = 65,    /* T_AdvMobRtrSupportFlag  */
410
  YYSYMBOL_T_AdvContextLength = 66,        /* T_AdvContextLength  */
411
  YYSYMBOL_T_AdvContextCompressionFlag = 67, /* T_AdvContextCompressionFlag  */
412
  YYSYMBOL_T_AdvContextID = 68,            /* T_AdvContextID  */
413
  YYSYMBOL_T_AdvLifeTime = 69,             /* T_AdvLifeTime  */
414
  YYSYMBOL_T_AdvContextPrefix = 70,        /* T_AdvContextPrefix  */
415
  YYSYMBOL_T_AdvVersionLow = 71,           /* T_AdvVersionLow  */
416
  YYSYMBOL_T_AdvVersionHigh = 72,          /* T_AdvVersionHigh  */
417
  YYSYMBOL_T_Adv6LBRaddress = 73,          /* T_Adv6LBRaddress  */
418
  YYSYMBOL_T_BAD_TOKEN = 74,               /* T_BAD_TOKEN  */
419
  YYSYMBOL_75_ = 75,                       /* '{'  */
420
  YYSYMBOL_76_ = 76,                       /* '}'  */
421
  YYSYMBOL_77_ = 77,                       /* ';'  */
422
  YYSYMBOL_78_ = 78,                       /* '/'  */
423
  YYSYMBOL_YYACCEPT = 79,                  /* $accept  */
424
  YYSYMBOL_grammar = 80,                   /* grammar  */
425
  YYSYMBOL_ifacedef = 81,                  /* ifacedef  */
426
  YYSYMBOL_ifacehead = 82,                 /* ifacehead  */
427
  YYSYMBOL_name = 83,                      /* name  */
428
  YYSYMBOL_ifaceparams = 84,               /* ifaceparams  */
429
  YYSYMBOL_ifaceparam = 85,                /* ifaceparam  */
430
  YYSYMBOL_ifaceval = 86,                  /* ifaceval  */
431
  YYSYMBOL_clientslist = 87,               /* clientslist  */
432
  YYSYMBOL_v6addrlist_clients = 88,        /* v6addrlist_clients  */
433
  YYSYMBOL_rasrcaddresslist = 89,          /* rasrcaddresslist  */
434
  YYSYMBOL_v6addrlist_rasrcaddress = 90,   /* v6addrlist_rasrcaddress  */
435
  YYSYMBOL_nat64prefixdef = 91,            /* nat64prefixdef  */
436
  YYSYMBOL_nat64prefixhead = 92,           /* nat64prefixhead  */
437
  YYSYMBOL_optional_nat64prefixplist = 93, /* optional_nat64prefixplist  */
438
  YYSYMBOL_nat64prefixplist = 94,          /* nat64prefixplist  */
439
  YYSYMBOL_nat64prefixparms = 95,          /* nat64prefixparms  */
440
  YYSYMBOL_ignoreprefixlist = 96,          /* ignoreprefixlist  */
441
  YYSYMBOL_ignoreprefixes = 97,            /* ignoreprefixes  */
442
  YYSYMBOL_prefixdef = 98,                 /* prefixdef  */
443
  YYSYMBOL_prefixhead = 99,                /* prefixhead  */
444
  YYSYMBOL_optional_prefixplist = 100,     /* optional_prefixplist  */
445
  YYSYMBOL_prefixplist = 101,              /* prefixplist  */
446
  YYSYMBOL_prefixparms = 102,              /* prefixparms  */
447
  YYSYMBOL_routedef = 103,                 /* routedef  */
448
  YYSYMBOL_routehead = 104,                /* routehead  */
449
  YYSYMBOL_optional_routeplist = 105,      /* optional_routeplist  */
450
  YYSYMBOL_routeplist = 106,               /* routeplist  */
451
  YYSYMBOL_routeparms = 107,               /* routeparms  */
452
  YYSYMBOL_rdnssdef = 108,                 /* rdnssdef  */
453
  YYSYMBOL_rdnssaddrs = 109,               /* rdnssaddrs  */
454
  YYSYMBOL_rdnssaddr = 110,                /* rdnssaddr  */
455
  YYSYMBOL_rdnsshead = 111,                /* rdnsshead  */
456
  YYSYMBOL_optional_rdnssplist = 112,      /* optional_rdnssplist  */
457
  YYSYMBOL_rdnssplist = 113,               /* rdnssplist  */
458
  YYSYMBOL_rdnssparms = 114,               /* rdnssparms  */
459
  YYSYMBOL_dnssldef = 115,                 /* dnssldef  */
460
  YYSYMBOL_dnsslsuffixes = 116,            /* dnsslsuffixes  */
461
  YYSYMBOL_dnsslsuffix = 117,              /* dnsslsuffix  */
462
  YYSYMBOL_dnsslhead = 118,                /* dnsslhead  */
463
  YYSYMBOL_optional_dnsslplist = 119,      /* optional_dnsslplist  */
464
  YYSYMBOL_dnsslplist = 120,               /* dnsslplist  */
465
  YYSYMBOL_dnsslparms = 121,               /* dnsslparms  */
466
  YYSYMBOL_lowpancodef = 122,              /* lowpancodef  */
467
  YYSYMBOL_lowpancohead = 123,             /* lowpancohead  */
468
  YYSYMBOL_optional_lowpancoplist = 124,   /* optional_lowpancoplist  */
469
  YYSYMBOL_lowpancoplist = 125,            /* lowpancoplist  */
470
  YYSYMBOL_lowpancoparms = 126,            /* lowpancoparms  */
471
  YYSYMBOL_abrodef = 127,                  /* abrodef  */
472
  YYSYMBOL_abrohead = 128,                 /* abrohead  */
473
  YYSYMBOL_abrohead_new = 129,             /* abrohead_new  */
474
  YYSYMBOL_abrohead_dep = 130,             /* abrohead_dep  */
475
  YYSYMBOL_optional_abroplist = 131,       /* optional_abroplist  */
476
  YYSYMBOL_abroplist = 132,                /* abroplist  */
477
  YYSYMBOL_abroparms = 133,                /* abroparms  */
478
  YYSYMBOL_number_or_infinity = 134        /* number_or_infinity  */
479
};
480
typedef enum yysymbol_kind_t yysymbol_kind_t;
481
482
483
/* Second part of user prologue.  */
484
#line 167 "gram.y"
485
486
extern int num_lines;
487
static char const * filename;
488
static struct Interface *iface;
489
static struct Interface *IfaceList;
490
static struct AdvPrefix *prefix;
491
static struct AdvRoute *route;
492
static struct AdvRDNSS *rdnss;
493
static struct AdvDNSSL *dnssl;
494
static struct AdvLowpanCo *lowpanco;
495
static struct AdvAbro  *abro;
496
static struct NAT64Prefix *nat64prefix;
497
static void cleanup(void);
498
0
#define ABORT do { cleanup(); YYABORT; } while (0);
499
static void yyerror(char const * msg);
500
501
#line 502 "gram.c"
502
503
504
#ifdef short
505
# undef short
506
#endif
507
508
/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
509
   <limits.h> and (if available) <stdint.h> are included
510
   so that the code can choose integer types of a good width.  */
511
512
#ifndef __PTRDIFF_MAX__
513
# include <limits.h> /* INFRINGES ON USER NAME SPACE */
514
# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
515
#  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
516
#  define YY_STDINT_H
517
# endif
518
#endif
519
520
/* Narrow types that promote to a signed type and that can represent a
521
   signed or unsigned integer of at least N bits.  In tables they can
522
   save space and decrease cache pressure.  Promoting to a signed type
523
   helps avoid bugs in integer arithmetic.  */
524
525
#ifdef __INT_LEAST8_MAX__
526
typedef __INT_LEAST8_TYPE__ yytype_int8;
527
#elif defined YY_STDINT_H
528
typedef int_least8_t yytype_int8;
529
#else
530
typedef signed char yytype_int8;
531
#endif
532
533
#ifdef __INT_LEAST16_MAX__
534
typedef __INT_LEAST16_TYPE__ yytype_int16;
535
#elif defined YY_STDINT_H
536
typedef int_least16_t yytype_int16;
537
#else
538
typedef short yytype_int16;
539
#endif
540
541
/* Work around bug in HP-UX 11.23, which defines these macros
542
   incorrectly for preprocessor constants.  This workaround can likely
543
   be removed in 2023, as HPE has promised support for HP-UX 11.23
544
   (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
545
   <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
546
#ifdef __hpux
547
# undef UINT_LEAST8_MAX
548
# undef UINT_LEAST16_MAX
549
# define UINT_LEAST8_MAX 255
550
# define UINT_LEAST16_MAX 65535
551
#endif
552
553
#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
554
typedef __UINT_LEAST8_TYPE__ yytype_uint8;
555
#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
556
       && UINT_LEAST8_MAX <= INT_MAX)
557
typedef uint_least8_t yytype_uint8;
558
#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
559
typedef unsigned char yytype_uint8;
560
#else
561
typedef short yytype_uint8;
562
#endif
563
564
#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
565
typedef __UINT_LEAST16_TYPE__ yytype_uint16;
566
#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
567
       && UINT_LEAST16_MAX <= INT_MAX)
568
typedef uint_least16_t yytype_uint16;
569
#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
570
typedef unsigned short yytype_uint16;
571
#else
572
typedef int yytype_uint16;
573
#endif
574
575
#ifndef YYPTRDIFF_T
576
# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
577
596
#  define YYPTRDIFF_T __PTRDIFF_TYPE__
578
#  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
579
# elif defined PTRDIFF_MAX
580
#  ifndef ptrdiff_t
581
#   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
582
#  endif
583
#  define YYPTRDIFF_T ptrdiff_t
584
#  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
585
# else
586
#  define YYPTRDIFF_T long
587
#  define YYPTRDIFF_MAXIMUM LONG_MAX
588
# endif
589
#endif
590
591
#ifndef YYSIZE_T
592
# ifdef __SIZE_TYPE__
593
#  define YYSIZE_T __SIZE_TYPE__
594
# elif defined size_t
595
#  define YYSIZE_T size_t
596
# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
597
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
598
#  define YYSIZE_T size_t
599
# else
600
#  define YYSIZE_T unsigned
601
# endif
602
#endif
603
604
#define YYSIZE_MAXIMUM                                  \
605
  YY_CAST (YYPTRDIFF_T,                                 \
606
           (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
607
            ? YYPTRDIFF_MAXIMUM                         \
608
            : YY_CAST (YYSIZE_T, -1)))
609
610
0
#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
611
612
613
/* Stored state numbers (used for stacks). */
614
typedef yytype_int16 yy_state_t;
615
616
/* State numbers in computations.  */
617
typedef int yy_state_fast_t;
618
619
#ifndef YY_
620
# if defined YYENABLE_NLS && YYENABLE_NLS
621
#  if ENABLE_NLS
622
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
623
#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
624
#  endif
625
# endif
626
# ifndef YY_
627
596
#  define YY_(Msgid) Msgid
628
# endif
629
#endif
630
631
632
#ifndef YY_ATTRIBUTE_PURE
633
# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
634
#  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
635
# else
636
#  define YY_ATTRIBUTE_PURE
637
# endif
638
#endif
639
640
#ifndef YY_ATTRIBUTE_UNUSED
641
# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
642
#  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
643
# else
644
#  define YY_ATTRIBUTE_UNUSED
645
# endif
646
#endif
647
648
/* Suppress unused-variable warnings by "using" E.  */
649
#if ! defined lint || defined __GNUC__
650
1.19k
# define YY_USE(E) ((void) (E))
651
#else
652
# define YY_USE(E) /* empty */
653
#endif
654
655
/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
656
#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
657
# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
658
#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
659
    _Pragma ("GCC diagnostic push")                                     \
660
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
661
# else
662
#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
663
    _Pragma ("GCC diagnostic push")                                     \
664
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
665
    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
666
# endif
667
# define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
668
    _Pragma ("GCC diagnostic pop")
669
#else
670
# define YY_INITIAL_VALUE(Value) Value
671
#endif
672
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
673
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
674
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
675
#endif
676
#ifndef YY_INITIAL_VALUE
677
# define YY_INITIAL_VALUE(Value) /* Nothing. */
678
#endif
679
680
#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
681
# define YY_IGNORE_USELESS_CAST_BEGIN                          \
682
    _Pragma ("GCC diagnostic push")                            \
683
    _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
684
# define YY_IGNORE_USELESS_CAST_END            \
685
    _Pragma ("GCC diagnostic pop")
686
#endif
687
#ifndef YY_IGNORE_USELESS_CAST_BEGIN
688
# define YY_IGNORE_USELESS_CAST_BEGIN
689
# define YY_IGNORE_USELESS_CAST_END
690
#endif
691
692
693
596
#define YY_ASSERT(E) ((void) (0 && (E)))
694
695
#if !defined yyoverflow
696
697
/* The parser invokes alloca or malloc; define the necessary symbols.  */
698
699
# ifdef YYSTACK_USE_ALLOCA
700
#  if YYSTACK_USE_ALLOCA
701
#   ifdef __GNUC__
702
#    define YYSTACK_ALLOC __builtin_alloca
703
#   elif defined __BUILTIN_VA_ARG_INCR
704
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
705
#   elif defined _AIX
706
#    define YYSTACK_ALLOC __alloca
707
#   elif defined _MSC_VER
708
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
709
#    define alloca _alloca
710
#   else
711
#    define YYSTACK_ALLOC alloca
712
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
713
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
714
      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
715
#     ifndef EXIT_SUCCESS
716
#      define EXIT_SUCCESS 0
717
#     endif
718
#    endif
719
#   endif
720
#  endif
721
# endif
722
723
# ifdef YYSTACK_ALLOC
724
   /* Pacify GCC's 'empty if-body' warning.  */
725
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
726
#  ifndef YYSTACK_ALLOC_MAXIMUM
727
    /* The OS might guarantee only one guard page at the bottom of the stack,
728
       and a page size can be as small as 4096 bytes.  So we cannot safely
729
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
730
       to allow for a few compiler-allocated temporary stack slots.  */
731
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
732
#  endif
733
# else
734
#  define YYSTACK_ALLOC YYMALLOC
735
0
#  define YYSTACK_FREE YYFREE
736
#  ifndef YYSTACK_ALLOC_MAXIMUM
737
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
738
#  endif
739
#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
740
       && ! ((defined YYMALLOC || defined malloc) \
741
             && (defined YYFREE || defined free)))
742
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
743
#   ifndef EXIT_SUCCESS
744
#    define EXIT_SUCCESS 0
745
#   endif
746
#  endif
747
#  ifndef YYMALLOC
748
#   define YYMALLOC malloc
749
#   if ! defined malloc && ! defined EXIT_SUCCESS
750
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
751
#   endif
752
#  endif
753
#  ifndef YYFREE
754
0
#   define YYFREE free
755
#   if ! defined free && ! defined EXIT_SUCCESS
756
void free (void *); /* INFRINGES ON USER NAME SPACE */
757
#   endif
758
#  endif
759
# endif
760
#endif /* !defined yyoverflow */
761
762
#if (! defined yyoverflow \
763
     && (! defined __cplusplus \
764
         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
765
766
/* A type that is properly aligned for any stack member.  */
767
union yyalloc
768
{
769
  yy_state_t yyss_alloc;
770
  YYSTYPE yyvs_alloc;
771
};
772
773
/* The size of the maximum gap between one aligned stack and the next.  */
774
0
# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
775
776
/* The size of an array large to enough to hold all stacks, each with
777
   N elements.  */
778
# define YYSTACK_BYTES(N) \
779
     ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
780
      + YYSTACK_GAP_MAXIMUM)
781
782
# define YYCOPY_NEEDED 1
783
784
/* Relocate STACK from its old location to the new one.  The
785
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
786
   elements in the stack, and YYPTR gives the new location of the
787
   stack.  Advance YYPTR to a properly aligned location for the next
788
   stack.  */
789
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
790
0
    do                                                                  \
791
0
      {                                                                 \
792
0
        YYPTRDIFF_T yynewbytes;                                         \
793
0
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
794
0
        Stack = &yyptr->Stack_alloc;                                    \
795
0
        yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
796
0
        yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
797
0
      }                                                                 \
798
0
    while (0)
799
800
#endif
801
802
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
803
/* Copy COUNT objects from SRC to DST.  The source and destination do
804
   not overlap.  */
805
# ifndef YYCOPY
806
#  if defined __GNUC__ && 1 < __GNUC__
807
#   define YYCOPY(Dst, Src, Count) \
808
0
      __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
809
#  else
810
#   define YYCOPY(Dst, Src, Count)              \
811
      do                                        \
812
        {                                       \
813
          YYPTRDIFF_T yyi;                      \
814
          for (yyi = 0; yyi < (Count); yyi++)   \
815
            (Dst)[yyi] = (Src)[yyi];            \
816
        }                                       \
817
      while (0)
818
#  endif
819
# endif
820
#endif /* !YYCOPY_NEEDED */
821
822
/* YYFINAL -- State number of the termination state.  */
823
596
#define YYFINAL  7
824
/* YYLAST -- Last index in YYTABLE.  */
825
1.78k
#define YYLAST   292
826
827
/* YYNTOKENS -- Number of terminals.  */
828
0
#define YYNTOKENS  79
829
/* YYNNTS -- Number of nonterminals.  */
830
#define YYNNTS  56
831
/* YYNRULES -- Number of rules.  */
832
#define YYNRULES  140
833
/* YYNSTATES -- Number of states.  */
834
#define YYNSTATES  311
835
836
/* YYMAXUTOK -- Last valid token kind.  */
837
1.74k
#define YYMAXUTOK   329
838
839
840
/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
841
   as returned by yylex, with out-of-bounds checking.  */
842
#define YYTRANSLATE(YYX)                                \
843
2.33k
  (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
844
2.33k
   ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
845
2.33k
   : YYSYMBOL_YYUNDEF)
846
847
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
848
   as returned by yylex.  */
849
static const yytype_int8 yytranslate[] =
850
{
851
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
852
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
853
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
854
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
855
       2,     2,     2,     2,     2,     2,     2,    78,     2,     2,
856
       2,     2,     2,     2,     2,     2,     2,     2,     2,    77,
857
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
858
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
859
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
860
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
861
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
862
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
863
       2,     2,     2,    75,     2,    76,     2,     2,     2,     2,
864
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
865
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
866
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
867
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
868
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
869
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
870
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
871
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
872
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
873
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
874
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
875
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
876
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
877
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
878
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
879
      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
880
      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
881
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
882
      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
883
      65,    66,    67,    68,    69,    70,    71,    72,    73,    74
884
};
885
886
#if YYDEBUG
887
/* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
888
static const yytype_int16 yyrline[] =
889
{
890
       0,   187,   187,   188,   191,   201,   230,   237,   238,   241,
891
     242,   243,   244,   245,   246,   247,   248,   249,   250,   251,
892
     254,   258,   262,   266,   270,   274,   278,   282,   286,   290,
893
     294,   298,   304,   308,   312,   316,   320,   324,   328,   332,
894
     336,   340,   344,   348,   352,   356,   360,   364,   398,   404,
895
     410,   422,   434,   447,   462,   468,   479,   493,   511,   556,
896
     557,   558,   561,   562,   565,   579,   585,   607,   632,   657,
897
     688,   689,   690,   693,   694,   697,   703,   709,   715,   722,
898
     729,   735,   741,   755,   770,   778,   802,   803,   806,   807,
899
     811,   815,   819,   825,   832,   833,   836,   866,   875,   876,
900
     879,   880,   884,   888,   892,   896,   902,   909,   910,   913,
901
     955,   964,   965,   968,   969,   973,   978,   984,   991,  1004,
902
    1005,  1008,  1009,  1012,  1016,  1020,  1024,  1030,  1037,  1037,
903
    1039,  1053,  1073,  1074,  1077,  1078,  1081,  1085,  1089,  1095,
904
    1099
905
};
906
#endif
907
908
/** Accessing symbol of state STATE.  */
909
0
#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
910
911
#if YYDEBUG || 0
912
/* The user-facing name of the symbol whose (internal) number is
913
   YYSYMBOL.  No bounds checking.  */
914
static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
915
916
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
917
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
918
static const char *const yytname[] =
919
{
920
  "\"end of file\"", "error", "\"invalid token\"", "T_INTERFACE",
921
  "T_PREFIX", "T_ROUTE", "T_RDNSS", "T_DNSSL", "T_CLIENTS", "T_LOWPANCO",
922
  "T_ABRO", "T_RASRCADDRESS", "T_NAT64PREFIX", "T_AUTOIGNOREPREFIX",
923
  "STRING", "NUMBER", "SIGNEDNUMBER", "DECIMAL", "SWITCH", "IPV6ADDR",
924
  "NOT_IPV6ADDR", "INFINITY", "T_IgnoreIfMissing", "T_AdvSendAdvert",
925
  "T_MaxRtrAdvInterval", "T_MinRtrAdvInterval", "T_MinDelayBetweenRAs",
926
  "T_AdvManagedFlag", "T_AdvOtherConfigFlag", "T_AdvLinkMTU", "T_AdvRAMTU",
927
  "T_AdvReachableTime", "T_AdvRetransTimer", "T_AdvCurHopLimit",
928
  "T_AdvDefaultLifetime", "T_AdvDefaultPreference", "T_AdvSourceLLAddress",
929
  "T_RemoveAdvOnExit", "T_AdvOnLink", "T_AdvAutonomous",
930
  "T_AdvValidLifetime", "T_AdvPreferredLifetime", "T_DeprecatePrefix",
931
  "T_DecrementLifetimes", "T_AdvRouterAddr", "T_AdvHomeAgentFlag",
932
  "T_AdvIntervalOpt", "T_AdvHomeAgentInfo", "T_Base6Interface",
933
  "T_Base6to4Interface", "T_UnicastOnly", "T_UnrestrictedUnicast",
934
  "T_AdvRASolicitedUnicast", "T_AdvCaptivePortalAPI",
935
  "T_HomeAgentPreference", "T_HomeAgentLifetime", "T_AdvRoutePreference",
936
  "T_AdvRouteLifetime", "T_RemoveRoute", "T_AdvRDNSSPreference",
937
  "T_AdvRDNSSOpenFlag", "T_AdvRDNSSLifetime", "T_FlushRDNSS",
938
  "T_AdvDNSSLLifetime", "T_FlushDNSSL", "T_AdvMobRtrSupportFlag",
939
  "T_AdvContextLength", "T_AdvContextCompressionFlag", "T_AdvContextID",
940
  "T_AdvLifeTime", "T_AdvContextPrefix", "T_AdvVersionLow",
941
  "T_AdvVersionHigh", "T_Adv6LBRaddress", "T_BAD_TOKEN", "'{'", "'}'",
942
  "';'", "'/'", "$accept", "grammar", "ifacedef", "ifacehead", "name",
943
  "ifaceparams", "ifaceparam", "ifaceval", "clientslist",
944
  "v6addrlist_clients", "rasrcaddresslist", "v6addrlist_rasrcaddress",
945
  "nat64prefixdef", "nat64prefixhead", "optional_nat64prefixplist",
946
  "nat64prefixplist", "nat64prefixparms", "ignoreprefixlist",
947
  "ignoreprefixes", "prefixdef", "prefixhead", "optional_prefixplist",
948
  "prefixplist", "prefixparms", "routedef", "routehead",
949
  "optional_routeplist", "routeplist", "routeparms", "rdnssdef",
950
  "rdnssaddrs", "rdnssaddr", "rdnsshead", "optional_rdnssplist",
951
  "rdnssplist", "rdnssparms", "dnssldef", "dnsslsuffixes", "dnsslsuffix",
952
  "dnsslhead", "optional_dnsslplist", "dnsslplist", "dnsslparms",
953
  "lowpancodef", "lowpancohead", "optional_lowpancoplist", "lowpancoplist",
954
  "lowpancoparms", "abrodef", "abrohead", "abrohead_new", "abrohead_dep",
955
  "optional_abroplist", "abroplist", "abroparms", "number_or_infinity", YY_NULLPTR
956
};
957
958
static const char *
959
yysymbol_name (yysymbol_kind_t yysymbol)
960
{
961
  return yytname[yysymbol];
962
}
963
#endif
964
965
1.19k
#define YYPACT_NINF (-90)
966
967
#define yypact_value_is_default(Yyn) \
968
1.19k
  ((Yyn) == YYPACT_NINF)
969
970
#define YYTABLE_NINF (-1)
971
972
#define yytable_value_is_error(Yyn) \
973
0
  0
974
975
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
976
   STATE-NUM.  */
977
static const yytype_int16 yypact[] =
978
{
979
      42,    45,    65,   -90,     6,   -90,   -90,   -90,   -90,   -90,
980
      -4,    84,    85,    87,    93,    33,   -90,    90,    37,    91,
981
      39,    95,    97,    49,    79,    80,    98,    99,   103,   104,
982
     105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
983
     115,   116,   117,   122,   123,   124,   119,    47,   -90,   -90,
984
     -90,   -90,   -90,    51,   -90,   -90,    52,   -90,    66,   -90,
985
      67,   -90,    68,   -90,    70,   -90,    71,   -90,   -90,    62,
986
      72,   -90,    87,   -90,   -90,    93,   -90,    69,    73,   125,
987
      74,   128,    76,    77,    78,    81,    82,    83,    86,    88,
988
      89,    92,    94,    96,   100,   101,   102,   118,   120,   121,
989
     126,   127,   129,   130,   131,   132,   133,   134,   135,   136,
990
     137,   -90,    -5,   138,    14,   139,    29,   -45,    38,   -30,
991
      20,   141,   142,   -90,   -90,   140,   143,    -9,   146,   144,
992
      -7,   147,   145,    -6,   -90,   -90,   -90,   -90,   -90,   -90,
993
     -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,
994
     -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,
995
     -90,   -90,   -90,   149,   -90,     4,   -90,   -90,   150,   152,
996
      19,    19,   154,   156,   157,    45,    45,   -90,    35,   -90,
997
     -90,   151,    19,   158,   148,    29,   -90,   165,   163,    19,
998
     164,   153,   -45,   -90,    19,   166,   155,    38,   -90,   168,
999
     167,   171,   172,   159,   -30,   -90,   173,   174,   175,   160,
1000
      20,   -90,   -90,   -90,   -90,   -90,   161,   162,   169,   -90,
1001
     -90,   170,   176,   -90,   177,   178,   180,   181,   -90,   -90,
1002
     182,   183,   -90,   -90,   184,   185,   186,   187,   188,   189,
1003
     190,   -90,   -90,   191,   192,   193,   194,   -90,   195,   196,
1004
     197,   198,   199,   -90,   200,   201,   202,   -90,   203,   204,
1005
     205,   206,   207,   -90,   208,   209,   210,   211,   -90,   -90,
1006
     -90,   -90,   -90,   -90,   212,   179,   -90,   -90,   -90,   -90,
1007
     -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,
1008
     -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,
1009
     -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   213,
1010
     -90
1011
};
1012
1013
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
1014
   Performed when YYTABLE does not specify something else to do.  Zero
1015
   means the default is an error.  */
1016
static const yytype_uint8 yydefact[] =
1017
{
1018
       0,     0,     0,     3,     0,     6,     5,     1,     2,     8,
1019
       0,     0,     0,     0,     0,     0,   118,     0,     0,     0,
1020
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1021
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1022
       0,     0,     0,     0,     0,     0,     0,     0,     7,     9,
1023
      11,    17,    18,    59,    19,    10,    70,    12,     0,    13,
1024
       0,    14,     0,    15,     0,    16,     0,   128,   129,     0,
1025
       0,    96,    97,    95,   109,   110,   108,     0,   130,     0,
1026
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1027
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1028
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1029
       0,     4,     0,     0,     0,     0,    86,    98,   111,   119,
1030
     132,     0,     0,    94,   107,     0,     0,     0,     0,     0,
1031
       0,     0,     0,     0,    26,    27,    21,    24,    20,    23,
1032
      22,    25,    28,    29,    30,    31,    32,    33,    36,    34,
1033
      35,    38,    37,    41,    39,    40,    44,    45,    46,    47,
1034
      42,    43,    48,     0,    60,     0,    63,    57,     0,     0,
1035
       0,     0,     0,     0,     0,     0,     0,    71,     0,    74,
1036
      68,     0,     0,     0,     0,    87,    89,     0,     0,     0,
1037
       0,     0,    99,   101,     0,     0,     0,   112,   114,     0,
1038
       0,     0,     0,     0,   120,   122,     0,     0,     0,     0,
1039
     133,   135,    69,    85,    50,    51,     0,     0,     0,   131,
1040
      55,     0,     0,    58,     0,     0,     0,     0,    61,    62,
1041
       0,     0,   139,   140,     0,     0,     0,     0,     0,     0,
1042
       0,    72,    73,     0,     0,     0,     0,    88,     0,     0,
1043
       0,     0,     0,   100,     0,     0,     0,   113,     0,     0,
1044
       0,     0,     0,   121,     0,     0,     0,     0,   134,    52,
1045
      53,    49,    56,    54,     0,     0,    65,    64,    75,    76,
1046
      78,    79,    80,    81,    77,    82,    83,    90,    91,    92,
1047
      84,   102,   103,   104,   105,    93,   115,   116,   106,   123,
1048
     124,   125,   126,   117,   138,   136,   137,   127,    66,     0,
1049
      67
1050
};
1051
1052
/* YYPGOTO[NTERM-NUM].  */
1053
static const yytype_int16 yypgoto[] =
1054
{
1055
     -90,   -90,   216,   -90,   -77,   -90,   -90,   -90,   -90,   -90,
1056
     -90,   -90,   -90,   -90,   -90,   -90,   -17,   -90,   -90,   -90,
1057
     -90,   -90,   -90,   -29,   -90,   -90,   -90,   -90,     8,   -90,
1058
     -90,   219,   -90,   -90,   -90,    -1,   -90,   -90,   217,   -90,
1059
     -90,   -90,     2,   -90,   -90,   -90,   -90,    -8,   -90,   -90,
1060
     -90,   -90,   -90,   -90,   -10,   -89
1061
};
1062
1063
/* YYDEFGOTO[NTERM-NUM].  */
1064
static const yytype_uint8 yydefgoto[] =
1065
{
1066
       0,     2,     3,     4,     6,    10,    48,    49,    50,   127,
1067
      51,   130,    52,    53,   113,   165,   166,    54,   133,    55,
1068
      56,   115,   178,   179,    57,    58,   184,   185,   186,    59,
1069
      72,    73,    60,   191,   192,   193,    61,    75,    76,    62,
1070
     196,   197,   198,    63,    64,   203,   204,   205,    65,    66,
1071
      67,    68,   209,   210,   211,   234
1072
};
1073
1074
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
1075
   positive, shift that token.  If negative, reduce the rule whose
1076
   number is the opposite.  If YYTABLE_NINF, syntax error.  */
1077
static const yytype_int16 yytable[] =
1078
{
1079
      11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
1080
     216,   217,   221,   225,   187,   188,   189,   190,    21,    22,
1081
      23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
1082
      33,    34,    35,    36,   232,   163,   199,   200,   201,   202,
1083
     233,    37,    38,    39,   163,     1,    40,    41,    42,    43,
1084
      44,    45,   168,   169,   170,   171,   172,   173,   174,     5,
1085
     206,    46,   175,   176,    84,     7,    85,   218,     1,   222,
1086
     226,   164,    47,   168,   169,   170,   171,   172,   173,   174,
1087
     228,     9,   235,   175,   176,   181,   182,   183,   125,   126,
1088
     177,   207,   208,   244,    86,    88,    87,    89,   239,   240,
1089
     250,   194,   195,    69,    70,   254,    71,    74,    77,    78,
1090
      80,   241,    79,    82,    81,    83,    90,    91,    92,    93,
1091
      94,    95,    96,    97,   111,    98,   112,   114,    99,   100,
1092
     101,   102,   103,   104,   105,   106,   107,   110,   108,   109,
1093
     121,   116,   117,   118,   129,   119,   120,   132,   229,   242,
1094
     122,   128,   131,   134,   135,   136,   212,   213,   137,   138,
1095
     139,   219,   223,   140,   227,   141,   142,   243,   230,   143,
1096
     231,   144,   236,   145,   237,   238,   245,   146,   147,   148,
1097
     248,   249,   251,   258,   255,   259,   260,   261,   264,   265,
1098
     266,   253,   274,   247,   309,   149,   263,   150,   151,   257,
1099
     268,     0,     0,   152,   153,     0,   154,   155,   156,   157,
1100
     158,   159,   160,   161,   162,   167,   180,   214,     8,     0,
1101
     215,   220,     0,   224,   246,     0,     0,     0,     0,   252,
1102
       0,   256,     0,     0,     0,   262,   267,     0,   269,   270,
1103
       0,     0,     0,     0,     0,     0,   271,   272,     0,     0,
1104
       0,     0,     0,   273,     0,     0,   275,   276,   277,   278,
1105
     279,   280,   281,   282,   283,   284,   285,   286,   287,   288,
1106
     289,   290,   291,   292,   293,   294,   295,   296,   297,   298,
1107
     299,   300,   301,   302,   303,   304,   305,   306,   307,   308,
1108
     310,   123,   124
1109
};
1110
1111
static const yytype_int16 yycheck[] =
1112
{
1113
       4,     5,     6,     7,     8,     9,    10,    11,    12,    13,
1114
      19,    20,    19,    19,    59,    60,    61,    62,    22,    23,
1115
      24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
1116
      34,    35,    36,    37,    15,    40,    66,    67,    68,    69,
1117
      21,    45,    46,    47,    40,     3,    50,    51,    52,    53,
1118
      54,    55,    38,    39,    40,    41,    42,    43,    44,    14,
1119
      40,    65,    48,    49,    15,     0,    17,    76,     3,    76,
1120
      76,    76,    76,    38,    39,    40,    41,    42,    43,    44,
1121
      76,    75,   171,    48,    49,    56,    57,    58,    19,    20,
1122
      76,    71,    72,   182,    15,    15,    17,    17,   175,   176,
1123
     189,    63,    64,    19,    19,   194,    19,    14,    75,    19,
1124
      19,    76,    75,    18,    75,    18,    18,    18,    15,    15,
1125
      15,    15,    15,    15,    77,    16,    75,    75,    18,    18,
1126
      18,    18,    18,    18,    18,    18,    14,    18,    15,    15,
1127
      78,    75,    75,    75,    19,    75,    75,    19,   165,   178,
1128
      78,    78,    78,    77,    77,    77,    15,    15,    77,    77,
1129
      77,    15,    15,    77,    15,    77,    77,    16,    18,    77,
1130
      18,    77,    18,    77,    18,    18,    18,    77,    77,    77,
1131
      15,    18,    18,    15,    18,    18,    15,    15,    15,    15,
1132
      15,   192,    15,   185,    15,    77,   204,    77,    77,   197,
1133
     210,    -1,    -1,    77,    77,    -1,    77,    77,    77,    77,
1134
      77,    77,    77,    77,    77,    77,    77,    77,     2,    -1,
1135
      77,    77,    -1,    78,    76,    -1,    -1,    -1,    -1,    76,
1136
      -1,    76,    -1,    -1,    -1,    76,    76,    -1,    77,    77,
1137
      -1,    -1,    -1,    -1,    -1,    -1,    77,    77,    -1,    -1,
1138
      -1,    -1,    -1,    77,    -1,    -1,    78,    77,    77,    77,
1139
      77,    77,    77,    77,    77,    77,    77,    77,    77,    77,
1140
      77,    77,    77,    77,    77,    77,    77,    77,    77,    77,
1141
      77,    77,    77,    77,    77,    77,    77,    77,    77,    77,
1142
      77,    72,    75
1143
};
1144
1145
/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
1146
   state STATE-NUM.  */
1147
static const yytype_uint8 yystos[] =
1148
{
1149
       0,     3,    80,    81,    82,    14,    83,     0,    81,    75,
1150
      84,     4,     5,     6,     7,     8,     9,    10,    11,    12,
1151
      13,    22,    23,    24,    25,    26,    27,    28,    29,    30,
1152
      31,    32,    33,    34,    35,    36,    37,    45,    46,    47,
1153
      50,    51,    52,    53,    54,    55,    65,    76,    85,    86,
1154
      87,    89,    91,    92,    96,    98,    99,   103,   104,   108,
1155
     111,   115,   118,   122,   123,   127,   128,   129,   130,    19,
1156
      19,    19,   109,   110,    14,   116,   117,    75,    19,    75,
1157
      19,    75,    18,    18,    15,    17,    15,    17,    15,    17,
1158
      18,    18,    15,    15,    15,    15,    15,    15,    16,    18,
1159
      18,    18,    18,    18,    18,    18,    18,    14,    15,    15,
1160
      18,    77,    75,    93,    75,   100,    75,    75,    75,    75,
1161
      75,    78,    78,   110,   117,    19,    20,    88,    78,    19,
1162
      90,    78,    19,    97,    77,    77,    77,    77,    77,    77,
1163
      77,    77,    77,    77,    77,    77,    77,    77,    77,    77,
1164
      77,    77,    77,    77,    77,    77,    77,    77,    77,    77,
1165
      77,    77,    77,    40,    76,    94,    95,    77,    38,    39,
1166
      40,    41,    42,    43,    44,    48,    49,    76,   101,   102,
1167
      77,    56,    57,    58,   105,   106,   107,    59,    60,    61,
1168
      62,   112,   113,   114,    63,    64,   119,   120,   121,    66,
1169
      67,    68,    69,   124,   125,   126,    40,    71,    72,   131,
1170
     132,   133,    15,    15,    77,    77,    19,    20,    76,    15,
1171
      77,    19,    76,    15,    78,    19,    76,    15,    76,    95,
1172
      18,    18,    15,    21,   134,   134,    18,    18,    18,    83,
1173
      83,    76,   102,    16,   134,    18,    76,   107,    15,    18,
1174
     134,    18,    76,   114,   134,    18,    76,   121,    15,    18,
1175
      15,    15,    76,   126,    15,    15,    15,    76,   133,    77,
1176
      77,    77,    77,    77,    15,    78,    77,    77,    77,    77,
1177
      77,    77,    77,    77,    77,    77,    77,    77,    77,    77,
1178
      77,    77,    77,    77,    77,    77,    77,    77,    77,    77,
1179
      77,    77,    77,    77,    77,    77,    77,    77,    77,    15,
1180
      77
1181
};
1182
1183
/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
1184
static const yytype_uint8 yyr1[] =
1185
{
1186
       0,    79,    80,    80,    81,    82,    83,    84,    84,    85,
1187
      85,    85,    85,    85,    85,    85,    85,    85,    85,    85,
1188
      86,    86,    86,    86,    86,    86,    86,    86,    86,    86,
1189
      86,    86,    86,    86,    86,    86,    86,    86,    86,    86,
1190
      86,    86,    86,    86,    86,    86,    86,    86,    86,    87,
1191
      88,    88,    88,    88,    89,    90,    90,    91,    92,    93,
1192
      93,    93,    94,    94,    95,    96,    97,    97,    98,    99,
1193
     100,   100,   100,   101,   101,   102,   102,   102,   102,   102,
1194
     102,   102,   102,   102,   103,   104,   105,   105,   106,   106,
1195
     107,   107,   107,   108,   109,   109,   110,   111,   112,   112,
1196
     113,   113,   114,   114,   114,   114,   115,   116,   116,   117,
1197
     118,   119,   119,   120,   120,   121,   121,   122,   123,   124,
1198
     124,   125,   125,   126,   126,   126,   126,   127,   128,   128,
1199
     129,   130,   131,   131,   132,   132,   133,   133,   133,   134,
1200
     134
1201
};
1202
1203
/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
1204
static const yytype_int8 yyr2[] =
1205
{
1206
       0,     2,     2,     1,     5,     2,     1,     2,     0,     1,
1207
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1208
       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
1209
       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
1210
       3,     3,     3,     3,     3,     3,     3,     3,     3,     5,
1211
       2,     2,     3,     3,     5,     2,     3,     3,     4,     0,
1212
       2,     3,     2,     1,     3,     5,     4,     5,     3,     4,
1213
       0,     2,     3,     2,     1,     3,     3,     3,     3,     3,
1214
       3,     3,     3,     3,     5,     4,     0,     1,     2,     1,
1215
       3,     3,     3,     5,     2,     1,     1,     2,     0,     1,
1216
       2,     1,     3,     3,     3,     3,     5,     2,     1,     1,
1217
       2,     0,     1,     2,     1,     3,     3,     5,     1,     0,
1218
       1,     2,     1,     3,     3,     3,     3,     5,     1,     1,
1219
       2,     4,     0,     1,     2,     1,     3,     3,     3,     1,
1220
       1
1221
};
1222
1223
1224
enum { YYENOMEM = -2 };
1225
1226
#define yyerrok         (yyerrstatus = 0)
1227
#define yyclearin       (yychar = YYEMPTY)
1228
1229
0
#define YYACCEPT        goto yyacceptlab
1230
596
#define YYABORT         goto yyabortlab
1231
0
#define YYERROR         goto yyerrorlab
1232
0
#define YYNOMEM         goto yyexhaustedlab
1233
1234
1235
#define YYRECOVERING()  (!!yyerrstatus)
1236
1237
#define YYBACKUP(Token, Value)                                    \
1238
  do                                                              \
1239
    if (yychar == YYEMPTY)                                        \
1240
      {                                                           \
1241
        yychar = (Token);                                         \
1242
        yylval = (Value);                                         \
1243
        YYPOPSTACK (yylen);                                       \
1244
        yystate = *yyssp;                                         \
1245
        goto yybackup;                                            \
1246
      }                                                           \
1247
    else                                                          \
1248
      {                                                           \
1249
        yyerror (YY_("syntax error: cannot back up")); \
1250
        YYERROR;                                                  \
1251
      }                                                           \
1252
  while (0)
1253
1254
/* Backward compatibility with an undocumented macro.
1255
   Use YYerror or YYUNDEF. */
1256
#define YYERRCODE YYUNDEF
1257
1258
1259
/* Enable debugging if requested.  */
1260
#if YYDEBUG
1261
1262
# ifndef YYFPRINTF
1263
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1264
#  define YYFPRINTF fprintf
1265
# endif
1266
1267
# define YYDPRINTF(Args)                        \
1268
do {                                            \
1269
  if (yydebug)                                  \
1270
    YYFPRINTF Args;                             \
1271
} while (0)
1272
1273
1274
1275
1276
# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
1277
do {                                                                      \
1278
  if (yydebug)                                                            \
1279
    {                                                                     \
1280
      YYFPRINTF (stderr, "%s ", Title);                                   \
1281
      yy_symbol_print (stderr,                                            \
1282
                  Kind, Value); \
1283
      YYFPRINTF (stderr, "\n");                                           \
1284
    }                                                                     \
1285
} while (0)
1286
1287
1288
/*-----------------------------------.
1289
| Print this symbol's value on YYO.  |
1290
`-----------------------------------*/
1291
1292
static void
1293
yy_symbol_value_print (FILE *yyo,
1294
                       yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
1295
{
1296
  FILE *yyoutput = yyo;
1297
  YY_USE (yyoutput);
1298
  if (!yyvaluep)
1299
    return;
1300
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1301
  YY_USE (yykind);
1302
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1303
}
1304
1305
1306
/*---------------------------.
1307
| Print this symbol on YYO.  |
1308
`---------------------------*/
1309
1310
static void
1311
yy_symbol_print (FILE *yyo,
1312
                 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
1313
{
1314
  YYFPRINTF (yyo, "%s %s (",
1315
             yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1316
1317
  yy_symbol_value_print (yyo, yykind, yyvaluep);
1318
  YYFPRINTF (yyo, ")");
1319
}
1320
1321
/*------------------------------------------------------------------.
1322
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1323
| TOP (included).                                                   |
1324
`------------------------------------------------------------------*/
1325
1326
static void
1327
yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1328
{
1329
  YYFPRINTF (stderr, "Stack now");
1330
  for (; yybottom <= yytop; yybottom++)
1331
    {
1332
      int yybot = *yybottom;
1333
      YYFPRINTF (stderr, " %d", yybot);
1334
    }
1335
  YYFPRINTF (stderr, "\n");
1336
}
1337
1338
# define YY_STACK_PRINT(Bottom, Top)                            \
1339
do {                                                            \
1340
  if (yydebug)                                                  \
1341
    yy_stack_print ((Bottom), (Top));                           \
1342
} while (0)
1343
1344
1345
/*------------------------------------------------.
1346
| Report that the YYRULE is going to be reduced.  |
1347
`------------------------------------------------*/
1348
1349
static void
1350
yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
1351
                 int yyrule)
1352
{
1353
  int yylno = yyrline[yyrule];
1354
  int yynrhs = yyr2[yyrule];
1355
  int yyi;
1356
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1357
             yyrule - 1, yylno);
1358
  /* The symbols being reduced.  */
1359
  for (yyi = 0; yyi < yynrhs; yyi++)
1360
    {
1361
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1362
      yy_symbol_print (stderr,
1363
                       YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1364
                       &yyvsp[(yyi + 1) - (yynrhs)]);
1365
      YYFPRINTF (stderr, "\n");
1366
    }
1367
}
1368
1369
# define YY_REDUCE_PRINT(Rule)          \
1370
do {                                    \
1371
  if (yydebug)                          \
1372
    yy_reduce_print (yyssp, yyvsp, Rule); \
1373
} while (0)
1374
1375
/* Nonzero means print parse trace.  It is left uninitialized so that
1376
   multiple parsers can coexist.  */
1377
int yydebug;
1378
#else /* !YYDEBUG */
1379
1.83k
# define YYDPRINTF(Args) ((void) 0)
1380
# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1381
# define YY_STACK_PRINT(Bottom, Top)
1382
# define YY_REDUCE_PRINT(Rule)
1383
#endif /* !YYDEBUG */
1384
1385
1386
/* YYINITDEPTH -- initial size of the parser's stacks.  */
1387
#ifndef YYINITDEPTH
1388
596
# define YYINITDEPTH 200
1389
#endif
1390
1391
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1392
   if the built-in stack extension method is used).
1393
1394
   Do not make this value too large; the results are undefined if
1395
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1396
   evaluated with infinite-precision integer arithmetic.  */
1397
1398
#ifndef YYMAXDEPTH
1399
0
# define YYMAXDEPTH 10000
1400
#endif
1401
1402
1403
1404
1405
1406
1407
/*-----------------------------------------------.
1408
| Release the memory associated to this symbol.  |
1409
`-----------------------------------------------*/
1410
1411
static void
1412
yydestruct (const char *yymsg,
1413
            yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
1414
596
{
1415
596
  YY_USE (yyvaluep);
1416
596
  if (!yymsg)
1417
0
    yymsg = "Deleting";
1418
596
  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1419
1420
596
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1421
596
  YY_USE (yykind);
1422
596
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1423
596
}
1424
1425
1426
/* Lookahead token kind.  */
1427
int yychar;
1428
1429
/* The semantic value of the lookahead symbol.  */
1430
YYSTYPE yylval;
1431
/* Number of syntax errors so far.  */
1432
int yynerrs;
1433
1434
1435
1436
1437
/*----------.
1438
| yyparse.  |
1439
`----------*/
1440
1441
int
1442
yyparse (void)
1443
596
{
1444
596
    yy_state_fast_t yystate = 0;
1445
    /* Number of tokens to shift before error messages enabled.  */
1446
596
    int yyerrstatus = 0;
1447
1448
    /* Refer to the stacks through separate pointers, to allow yyoverflow
1449
       to reallocate them elsewhere.  */
1450
1451
    /* Their size.  */
1452
596
    YYPTRDIFF_T yystacksize = YYINITDEPTH;
1453
1454
    /* The state stack: array, bottom, top.  */
1455
596
    yy_state_t yyssa[YYINITDEPTH];
1456
596
    yy_state_t *yyss = yyssa;
1457
596
    yy_state_t *yyssp = yyss;
1458
1459
    /* The semantic value stack: array, bottom, top.  */
1460
596
    YYSTYPE yyvsa[YYINITDEPTH];
1461
596
    YYSTYPE *yyvs = yyvsa;
1462
596
    YYSTYPE *yyvsp = yyvs;
1463
1464
596
  int yyn;
1465
  /* The return value of yyparse.  */
1466
596
  int yyresult;
1467
  /* Lookahead symbol kind.  */
1468
596
  yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1469
  /* The variables used to return semantic value and location from the
1470
     action routines.  */
1471
596
  YYSTYPE yyval;
1472
1473
1474
1475
596
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1476
1477
  /* The number of symbols on the RHS of the reduced rule.
1478
     Keep to zero when no symbol should be popped.  */
1479
596
  int yylen = 0;
1480
1481
596
  YYDPRINTF ((stderr, "Starting parse\n"));
1482
1483
596
  yychar = YYEMPTY; /* Cause a token to be read.  */
1484
1485
596
  goto yysetstate;
1486
1487
1488
/*------------------------------------------------------------.
1489
| yynewstate -- push a new state, which is found in yystate.  |
1490
`------------------------------------------------------------*/
1491
0
yynewstate:
1492
  /* In all cases, when you get here, the value and location stacks
1493
     have just been pushed.  So pushing a state here evens the stacks.  */
1494
0
  yyssp++;
1495
1496
1497
/*--------------------------------------------------------------------.
1498
| yysetstate -- set current state (the top of the stack) to yystate.  |
1499
`--------------------------------------------------------------------*/
1500
596
yysetstate:
1501
596
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1502
596
  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1503
596
  YY_IGNORE_USELESS_CAST_BEGIN
1504
596
  *yyssp = YY_CAST (yy_state_t, yystate);
1505
596
  YY_IGNORE_USELESS_CAST_END
1506
596
  YY_STACK_PRINT (yyss, yyssp);
1507
1508
596
  if (yyss + yystacksize - 1 <= yyssp)
1509
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1510
    YYNOMEM;
1511
#else
1512
0
    {
1513
      /* Get the current used size of the three stacks, in elements.  */
1514
0
      YYPTRDIFF_T yysize = yyssp - yyss + 1;
1515
1516
# if defined yyoverflow
1517
      {
1518
        /* Give user a chance to reallocate the stack.  Use copies of
1519
           these so that the &'s don't force the real ones into
1520
           memory.  */
1521
        yy_state_t *yyss1 = yyss;
1522
        YYSTYPE *yyvs1 = yyvs;
1523
1524
        /* Each stack pointer address is followed by the size of the
1525
           data in use in that stack, in bytes.  This used to be a
1526
           conditional around just the two extra args, but that might
1527
           be undefined if yyoverflow is a macro.  */
1528
        yyoverflow (YY_("memory exhausted"),
1529
                    &yyss1, yysize * YYSIZEOF (*yyssp),
1530
                    &yyvs1, yysize * YYSIZEOF (*yyvsp),
1531
                    &yystacksize);
1532
        yyss = yyss1;
1533
        yyvs = yyvs1;
1534
      }
1535
# else /* defined YYSTACK_RELOCATE */
1536
      /* Extend the stack our own way.  */
1537
0
      if (YYMAXDEPTH <= yystacksize)
1538
0
        YYNOMEM;
1539
0
      yystacksize *= 2;
1540
0
      if (YYMAXDEPTH < yystacksize)
1541
0
        yystacksize = YYMAXDEPTH;
1542
1543
0
      {
1544
0
        yy_state_t *yyss1 = yyss;
1545
0
        union yyalloc *yyptr =
1546
0
          YY_CAST (union yyalloc *,
1547
0
                   YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1548
0
        if (! yyptr)
1549
0
          YYNOMEM;
1550
0
        YYSTACK_RELOCATE (yyss_alloc, yyss);
1551
0
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1552
0
#  undef YYSTACK_RELOCATE
1553
0
        if (yyss1 != yyssa)
1554
0
          YYSTACK_FREE (yyss1);
1555
0
      }
1556
0
# endif
1557
1558
0
      yyssp = yyss + yysize - 1;
1559
0
      yyvsp = yyvs + yysize - 1;
1560
1561
0
      YY_IGNORE_USELESS_CAST_BEGIN
1562
0
      YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1563
0
                  YY_CAST (long, yystacksize)));
1564
0
      YY_IGNORE_USELESS_CAST_END
1565
1566
0
      if (yyss + yystacksize - 1 <= yyssp)
1567
0
        YYABORT;
1568
0
    }
1569
596
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1570
1571
1572
596
  if (yystate == YYFINAL)
1573
0
    YYACCEPT;
1574
1575
596
  goto yybackup;
1576
1577
1578
/*-----------.
1579
| yybackup.  |
1580
`-----------*/
1581
596
yybackup:
1582
  /* Do appropriate processing given the current state.  Read a
1583
     lookahead token if we need one and don't already have one.  */
1584
1585
  /* First try to decide what to do without reference to lookahead token.  */
1586
596
  yyn = yypact[yystate];
1587
596
  if (yypact_value_is_default (yyn))
1588
0
    goto yydefault;
1589
1590
  /* Not known => get a lookahead token if don't already have one.  */
1591
1592
  /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
1593
596
  if (yychar == YYEMPTY)
1594
596
    {
1595
596
      YYDPRINTF ((stderr, "Reading a token\n"));
1596
596
      yychar = yylex ();
1597
596
    }
1598
1599
596
  if (yychar <= YYEOF)
1600
48
    {
1601
48
      yychar = YYEOF;
1602
48
      yytoken = YYSYMBOL_YYEOF;
1603
48
      YYDPRINTF ((stderr, "Now at end of input.\n"));
1604
48
    }
1605
548
  else if (yychar == YYerror)
1606
0
    {
1607
      /* The scanner already issued an error message, process directly
1608
         to error recovery.  But do not keep the error token as
1609
         lookahead, it is too special and may lead us to an endless
1610
         loop in error recovery. */
1611
0
      yychar = YYUNDEF;
1612
0
      yytoken = YYSYMBOL_YYerror;
1613
0
      goto yyerrlab1;
1614
0
    }
1615
548
  else
1616
548
    {
1617
548
      yytoken = YYTRANSLATE (yychar);
1618
548
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1619
548
    }
1620
1621
  /* If the proper action on seeing token YYTOKEN is to reduce or to
1622
     detect an error, take that action.  */
1623
596
  yyn += yytoken;
1624
596
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1625
596
    goto yydefault;
1626
0
  yyn = yytable[yyn];
1627
0
  if (yyn <= 0)
1628
0
    {
1629
0
      if (yytable_value_is_error (yyn))
1630
0
        goto yyerrlab;
1631
0
      yyn = -yyn;
1632
0
      goto yyreduce;
1633
0
    }
1634
1635
  /* Count tokens shifted since error; after three, turn off error
1636
     status.  */
1637
0
  if (yyerrstatus)
1638
0
    yyerrstatus--;
1639
1640
  /* Shift the lookahead token.  */
1641
0
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1642
0
  yystate = yyn;
1643
0
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1644
0
  *++yyvsp = yylval;
1645
0
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1646
1647
  /* Discard the shifted token.  */
1648
0
  yychar = YYEMPTY;
1649
0
  goto yynewstate;
1650
1651
1652
/*-----------------------------------------------------------.
1653
| yydefault -- do the default action for the current state.  |
1654
`-----------------------------------------------------------*/
1655
596
yydefault:
1656
596
  yyn = yydefact[yystate];
1657
596
  if (yyn == 0)
1658
596
    goto yyerrlab;
1659
0
  goto yyreduce;
1660
1661
1662
/*-----------------------------.
1663
| yyreduce -- do a reduction.  |
1664
`-----------------------------*/
1665
0
yyreduce:
1666
  /* yyn is the number of a rule to reduce with.  */
1667
0
  yylen = yyr2[yyn];
1668
1669
  /* If YYLEN is nonzero, implement the default value of the action:
1670
     '$$ = $1'.
1671
1672
     Otherwise, the following line sets YYVAL to garbage.
1673
     This behavior is undocumented and Bison
1674
     users should not rely upon it.  Assigning to YYVAL
1675
     unconditionally makes the parser a bit smaller, and it avoids a
1676
     GCC warning that YYVAL may be used uninitialized.  */
1677
0
  yyval = yyvsp[1-yylen];
1678
1679
1680
0
  YY_REDUCE_PRINT (yyn);
1681
0
  switch (yyn)
1682
0
    {
1683
0
  case 4: /* ifacedef: ifacehead '{' ifaceparams '}' ';'  */
1684
0
#line 192 "gram.y"
1685
0
                {
1686
0
      dlog(LOG_DEBUG, 4, "%s interface definition ok", iface->props.name);
1687
1688
0
      iface->next = IfaceList;
1689
0
      IfaceList = iface;
1690
1691
0
      iface = NULL;
1692
0
    }
1693
0
#line 1694 "gram.c"
1694
0
    break;
1695
1696
0
  case 5: /* ifacehead: T_INTERFACE name  */
1697
0
#line 202 "gram.y"
1698
0
                {
1699
0
      iface = IfaceList;
1700
1701
0
      while (iface)
1702
0
      {
1703
0
        if (!strcmp((yyvsp[0].str), iface->props.name))
1704
0
        {
1705
0
          flog(LOG_ERR, "duplicate interface "
1706
0
            "definition for %s", (yyvsp[0].str));
1707
0
          ABORT;
1708
0
        }
1709
0
        iface = iface->next;
1710
0
      }
1711
1712
0
      iface = malloc(sizeof(struct Interface));
1713
1714
0
      if (iface == NULL) {
1715
0
        flog(LOG_CRIT, "malloc failed: %s", strerror(errno));
1716
0
        ABORT;
1717
0
      }
1718
1719
0
      iface_init_defaults(iface);
1720
0
      memset(&iface->props.name, 0, sizeof(iface->props.name));
1721
0
      strlcpy(iface->props.name, (yyvsp[0].str), sizeof(iface->props.name));
1722
0
      iface->lineno = num_lines;
1723
0
    }
1724
0
#line 1725 "gram.c"
1725
0
    break;
1726
1727
0
  case 6: /* name: STRING  */
1728
0
#line 231 "gram.y"
1729
0
                {
1730
      /* check vality */
1731
0
      (yyval.str) = (yyvsp[0].str);
1732
0
    }
1733
0
#line 1734 "gram.c"
1734
0
    break;
1735
1736
0
  case 10: /* ifaceparam: prefixdef  */
1737
0
#line 242 "gram.y"
1738
0
                                { ADD_TO_LL(struct AdvPrefix, AdvPrefixList, (yyvsp[0].pinfo)); }
1739
0
#line 1740 "gram.c"
1740
0
    break;
1741
1742
0
  case 11: /* ifaceparam: clientslist  */
1743
0
#line 243 "gram.y"
1744
0
                                { ADD_TO_LL(struct Clients, ClientList, (yyvsp[0].ainfo)); }
1745
0
#line 1746 "gram.c"
1746
0
    break;
1747
1748
0
  case 12: /* ifaceparam: routedef  */
1749
0
#line 244 "gram.y"
1750
0
                                { ADD_TO_LL(struct AdvRoute, AdvRouteList, (yyvsp[0].rinfo)); }
1751
0
#line 1752 "gram.c"
1752
0
    break;
1753
1754
0
  case 13: /* ifaceparam: rdnssdef  */
1755
0
#line 245 "gram.y"
1756
0
                                { ADD_TO_LL(struct AdvRDNSS, AdvRDNSSList, (yyvsp[0].rdnssinfo)); }
1757
0
#line 1758 "gram.c"
1758
0
    break;
1759
1760
0
  case 14: /* ifaceparam: dnssldef  */
1761
0
#line 246 "gram.y"
1762
0
                                { ADD_TO_LL(struct AdvDNSSL, AdvDNSSLList, (yyvsp[0].dnsslinfo)); }
1763
0
#line 1764 "gram.c"
1764
0
    break;
1765
1766
0
  case 15: /* ifaceparam: lowpancodef  */
1767
0
#line 247 "gram.y"
1768
0
                                { ADD_TO_LL(struct AdvLowpanCo, AdvLowpanCoList, (yyvsp[0].lowpancoinfo)); }
1769
0
#line 1770 "gram.c"
1770
0
    break;
1771
1772
0
  case 16: /* ifaceparam: abrodef  */
1773
0
#line 248 "gram.y"
1774
0
                                { ADD_TO_LL(struct AdvAbro, AdvAbroList, (yyvsp[0].abroinfo)); }
1775
0
#line 1776 "gram.c"
1776
0
    break;
1777
1778
0
  case 17: /* ifaceparam: rasrcaddresslist  */
1779
0
#line 249 "gram.y"
1780
0
                                   { ADD_TO_LL(struct AdvRASrcAddress, AdvRASrcAddressList, (yyvsp[0].rasrcaddressinfo)); }
1781
0
#line 1782 "gram.c"
1782
0
    break;
1783
1784
0
  case 18: /* ifaceparam: nat64prefixdef  */
1785
0
#line 250 "gram.y"
1786
0
                                 { ADD_TO_LL(struct NAT64Prefix, NAT64PrefixList, (yyvsp[0].nat64pinfo)); }
1787
0
#line 1788 "gram.c"
1788
0
    break;
1789
1790
0
  case 19: /* ifaceparam: ignoreprefixlist  */
1791
0
#line 251 "gram.y"
1792
0
                                   { ADD_TO_LL(struct AutogenIgnorePrefix, IgnorePrefixList, (yyvsp[0].igpinfo)); }
1793
0
#line 1794 "gram.c"
1794
0
    break;
1795
1796
0
  case 20: /* ifaceval: T_MinRtrAdvInterval NUMBER ';'  */
1797
0
#line 255 "gram.y"
1798
0
                {
1799
0
      iface->MinRtrAdvInterval = (yyvsp[-1].num);
1800
0
    }
1801
0
#line 1802 "gram.c"
1802
0
    break;
1803
1804
0
  case 21: /* ifaceval: T_MaxRtrAdvInterval NUMBER ';'  */
1805
0
#line 259 "gram.y"
1806
0
                {
1807
0
      iface->MaxRtrAdvInterval = (yyvsp[-1].num);
1808
0
    }
1809
0
#line 1810 "gram.c"
1810
0
    break;
1811
1812
0
  case 22: /* ifaceval: T_MinDelayBetweenRAs NUMBER ';'  */
1813
0
#line 263 "gram.y"
1814
0
                {
1815
0
      iface->MinDelayBetweenRAs = (yyvsp[-1].num);
1816
0
    }
1817
0
#line 1818 "gram.c"
1818
0
    break;
1819
1820
0
  case 23: /* ifaceval: T_MinRtrAdvInterval DECIMAL ';'  */
1821
0
#line 267 "gram.y"
1822
0
                {
1823
0
      iface->MinRtrAdvInterval = (yyvsp[-1].dec);
1824
0
    }
1825
0
#line 1826 "gram.c"
1826
0
    break;
1827
1828
0
  case 24: /* ifaceval: T_MaxRtrAdvInterval DECIMAL ';'  */
1829
0
#line 271 "gram.y"
1830
0
                {
1831
0
      iface->MaxRtrAdvInterval = (yyvsp[-1].dec);
1832
0
    }
1833
0
#line 1834 "gram.c"
1834
0
    break;
1835
1836
0
  case 25: /* ifaceval: T_MinDelayBetweenRAs DECIMAL ';'  */
1837
0
#line 275 "gram.y"
1838
0
                {
1839
0
      iface->MinDelayBetweenRAs = (yyvsp[-1].dec);
1840
0
    }
1841
0
#line 1842 "gram.c"
1842
0
    break;
1843
1844
0
  case 26: /* ifaceval: T_IgnoreIfMissing SWITCH ';'  */
1845
0
#line 279 "gram.y"
1846
0
                {
1847
0
      iface->IgnoreIfMissing = (yyvsp[-1].num);
1848
0
    }
1849
0
#line 1850 "gram.c"
1850
0
    break;
1851
1852
0
  case 27: /* ifaceval: T_AdvSendAdvert SWITCH ';'  */
1853
0
#line 283 "gram.y"
1854
0
                {
1855
0
      iface->AdvSendAdvert = (yyvsp[-1].num);
1856
0
    }
1857
0
#line 1858 "gram.c"
1858
0
    break;
1859
1860
0
  case 28: /* ifaceval: T_AdvManagedFlag SWITCH ';'  */
1861
0
#line 287 "gram.y"
1862
0
                {
1863
0
      iface->ra_header_info.AdvManagedFlag = (yyvsp[-1].num);
1864
0
    }
1865
0
#line 1866 "gram.c"
1866
0
    break;
1867
1868
0
  case 29: /* ifaceval: T_AdvOtherConfigFlag SWITCH ';'  */
1869
0
#line 291 "gram.y"
1870
0
                {
1871
0
      iface->ra_header_info.AdvOtherConfigFlag = (yyvsp[-1].num);
1872
0
    }
1873
0
#line 1874 "gram.c"
1874
0
    break;
1875
1876
0
  case 30: /* ifaceval: T_AdvLinkMTU NUMBER ';'  */
1877
0
#line 295 "gram.y"
1878
0
                {
1879
0
      iface->AdvLinkMTU = (yyvsp[-1].num);
1880
0
    }
1881
0
#line 1882 "gram.c"
1882
0
    break;
1883
1884
0
  case 31: /* ifaceval: T_AdvRAMTU NUMBER ';'  */
1885
0
#line 299 "gram.y"
1886
0
                {
1887
0
      iface->AdvRAMTU = (yyvsp[-1].num);
1888
0
      iface->AdvRAMTU = MAX(MIN_AdvLinkMTU, iface->AdvRAMTU);
1889
0
      iface->AdvRAMTU = MIN(MAX_AdvLinkMTU, iface->AdvRAMTU);
1890
0
    }
1891
0
#line 1892 "gram.c"
1892
0
    break;
1893
1894
0
  case 32: /* ifaceval: T_AdvReachableTime NUMBER ';'  */
1895
0
#line 305 "gram.y"
1896
0
                {
1897
0
      iface->ra_header_info.AdvReachableTime = (yyvsp[-1].num);
1898
0
    }
1899
0
#line 1900 "gram.c"
1900
0
    break;
1901
1902
0
  case 33: /* ifaceval: T_AdvRetransTimer NUMBER ';'  */
1903
0
#line 309 "gram.y"
1904
0
                {
1905
0
      iface->ra_header_info.AdvRetransTimer = (yyvsp[-1].num);
1906
0
    }
1907
0
#line 1908 "gram.c"
1908
0
    break;
1909
1910
0
  case 34: /* ifaceval: T_AdvDefaultLifetime NUMBER ';'  */
1911
0
#line 313 "gram.y"
1912
0
                {
1913
0
      iface->ra_header_info.AdvDefaultLifetime = (yyvsp[-1].num);
1914
0
    }
1915
0
#line 1916 "gram.c"
1916
0
    break;
1917
1918
0
  case 35: /* ifaceval: T_AdvDefaultPreference SIGNEDNUMBER ';'  */
1919
0
#line 317 "gram.y"
1920
0
                {
1921
0
      iface->ra_header_info.AdvDefaultPreference = (yyvsp[-1].snum);
1922
0
    }
1923
0
#line 1924 "gram.c"
1924
0
    break;
1925
1926
0
  case 36: /* ifaceval: T_AdvCurHopLimit NUMBER ';'  */
1927
0
#line 321 "gram.y"
1928
0
                {
1929
0
      iface->ra_header_info.AdvCurHopLimit = (yyvsp[-1].num);
1930
0
    }
1931
0
#line 1932 "gram.c"
1932
0
    break;
1933
1934
0
  case 37: /* ifaceval: T_RemoveAdvOnExit SWITCH ';'  */
1935
0
#line 325 "gram.y"
1936
0
                {
1937
0
      iface->RemoveAdvOnExit = (yyvsp[-1].num);
1938
0
    }
1939
0
#line 1940 "gram.c"
1940
0
    break;
1941
1942
0
  case 38: /* ifaceval: T_AdvSourceLLAddress SWITCH ';'  */
1943
0
#line 329 "gram.y"
1944
0
                {
1945
0
      iface->AdvSourceLLAddress = (yyvsp[-1].num);
1946
0
    }
1947
0
#line 1948 "gram.c"
1948
0
    break;
1949
1950
0
  case 39: /* ifaceval: T_AdvIntervalOpt SWITCH ';'  */
1951
0
#line 333 "gram.y"
1952
0
                {
1953
0
      iface->mipv6.AdvIntervalOpt = (yyvsp[-1].num);
1954
0
    }
1955
0
#line 1956 "gram.c"
1956
0
    break;
1957
1958
0
  case 40: /* ifaceval: T_AdvHomeAgentInfo SWITCH ';'  */
1959
0
#line 337 "gram.y"
1960
0
                {
1961
0
      iface->mipv6.AdvHomeAgentInfo = (yyvsp[-1].num);
1962
0
    }
1963
0
#line 1964 "gram.c"
1964
0
    break;
1965
1966
0
  case 41: /* ifaceval: T_AdvHomeAgentFlag SWITCH ';'  */
1967
0
#line 341 "gram.y"
1968
0
                {
1969
0
      iface->ra_header_info.AdvHomeAgentFlag = (yyvsp[-1].num);
1970
0
    }
1971
0
#line 1972 "gram.c"
1972
0
    break;
1973
1974
0
  case 42: /* ifaceval: T_HomeAgentPreference NUMBER ';'  */
1975
0
#line 345 "gram.y"
1976
0
                {
1977
0
      iface->mipv6.HomeAgentPreference = (yyvsp[-1].num);
1978
0
    }
1979
0
#line 1980 "gram.c"
1980
0
    break;
1981
1982
0
  case 43: /* ifaceval: T_HomeAgentLifetime NUMBER ';'  */
1983
0
#line 349 "gram.y"
1984
0
                {
1985
0
      iface->mipv6.HomeAgentLifetime = (yyvsp[-1].num);
1986
0
    }
1987
0
#line 1988 "gram.c"
1988
0
    break;
1989
1990
0
  case 44: /* ifaceval: T_UnicastOnly SWITCH ';'  */
1991
0
#line 353 "gram.y"
1992
0
                {
1993
0
      iface->UnicastOnly = (yyvsp[-1].num);
1994
0
    }
1995
0
#line 1996 "gram.c"
1996
0
    break;
1997
1998
0
  case 45: /* ifaceval: T_UnrestrictedUnicast SWITCH ';'  */
1999
0
#line 357 "gram.y"
2000
0
                {
2001
0
      iface->UnrestrictedUnicast = (yyvsp[-1].num);
2002
0
    }
2003
0
#line 2004 "gram.c"
2004
0
    break;
2005
2006
0
  case 46: /* ifaceval: T_AdvRASolicitedUnicast SWITCH ';'  */
2007
0
#line 361 "gram.y"
2008
0
                {
2009
0
      iface->AdvRASolicitedUnicast = (yyvsp[-1].num);
2010
0
    }
2011
0
#line 2012 "gram.c"
2012
0
    break;
2013
2014
0
  case 47: /* ifaceval: T_AdvCaptivePortalAPI STRING ';'  */
2015
0
#line 365 "gram.y"
2016
0
                {
2017
0
      const char *source = (yyvsp[-1].str);
2018
0
      size_t len = strlen(source);
2019
2020
0
      if (iface->AdvCaptivePortalAPI) {
2021
0
        flog(LOG_WARNING, "warning: AdvCaptivePortalAPI specified twice for interface "
2022
0
          "%s in %s, line %d", iface->props.name, filename, num_lines);
2023
2024
0
        free(iface->AdvCaptivePortalAPI);
2025
0
        iface->AdvCaptivePortalAPI = NULL;
2026
0
      }
2027
2028
      /* trim double-quotes from start and end of string */
2029
0
      if ((len > 0) && (source[0] == '"')) {
2030
0
        source++;
2031
0
        len--;
2032
0
      }
2033
0
      if ((len > 0) && (source[len-1] == '"')) {
2034
0
        len--;
2035
0
      }
2036
2037
0
      if (len <= 0) {
2038
0
        flog(LOG_ERR, "AdvCaptivePortalAPI empty URL specified for interface %s.", iface->props.name);
2039
0
        ABORT;
2040
0
      }
2041
2042
0
      iface->AdvCaptivePortalAPI = strndup(source, len);
2043
2044
0
      if (!iface->AdvCaptivePortalAPI) {
2045
0
        flog(LOG_CRIT, "malloc failed: %s", strerror(errno));
2046
0
        ABORT;
2047
0
      }
2048
0
    }
2049
0
#line 2050 "gram.c"
2050
0
    break;
2051
2052
0
  case 48: /* ifaceval: T_AdvMobRtrSupportFlag SWITCH ';'  */
2053
0
#line 399 "gram.y"
2054
0
                {
2055
0
      iface->mipv6.AdvMobRtrSupportFlag = (yyvsp[-1].num);
2056
0
    }
2057
0
#line 2058 "gram.c"
2058
0
    break;
2059
2060
0
  case 49: /* clientslist: T_CLIENTS '{' v6addrlist_clients '}' ';'  */
2061
0
#line 405 "gram.y"
2062
0
                {
2063
0
      (yyval.ainfo) = (yyvsp[-2].ainfo);
2064
0
    }
2065
0
#line 2066 "gram.c"
2066
0
    break;
2067
2068
0
  case 50: /* v6addrlist_clients: IPV6ADDR ';'  */
2069
0
#line 411 "gram.y"
2070
0
                {
2071
0
      struct Clients *new = calloc(1, sizeof(struct Clients));
2072
0
      if (new == NULL) {
2073
0
        flog(LOG_CRIT, "calloc failed: %s", strerror(errno));
2074
0
        ABORT;
2075
0
      }
2076
2077
0
      memcpy(&(new->Address), (yyvsp[-1].addr), sizeof(struct in6_addr));
2078
0
      new->ignored = 0;
2079
0
      (yyval.ainfo) = new;
2080
0
    }
2081
0
#line 2082 "gram.c"
2082
0
    break;
2083
2084
0
  case 51: /* v6addrlist_clients: NOT_IPV6ADDR ';'  */
2085
0
#line 423 "gram.y"
2086
0
                {
2087
0
      struct Clients *new = calloc(1, sizeof(struct Clients));
2088
0
      if (new == NULL) {
2089
0
        flog(LOG_CRIT, "calloc failed: %s", strerror(errno));
2090
0
        ABORT;
2091
0
      }
2092
2093
0
      memcpy(&(new->Address), (yyvsp[-1].addr), sizeof(struct in6_addr));
2094
0
      new->ignored = 1;
2095
0
      (yyval.ainfo) = new;
2096
0
    }
2097
0
#line 2098 "gram.c"
2098
0
    break;
2099
2100
0
  case 52: /* v6addrlist_clients: v6addrlist_clients IPV6ADDR ';'  */
2101
0
#line 435 "gram.y"
2102
0
                {
2103
0
      struct Clients *new = calloc(1, sizeof(struct Clients));
2104
0
      if (new == NULL) {
2105
0
        flog(LOG_CRIT, "calloc failed: %s", strerror(errno));
2106
0
        ABORT;
2107
0
      }
2108
2109
0
      memcpy(&(new->Address), (yyvsp[-1].addr), sizeof(struct in6_addr));
2110
0
      new->ignored = 0;
2111
0
      new->next = (yyvsp[-2].ainfo);
2112
0
      (yyval.ainfo) = new;
2113
0
    }
2114
0
#line 2115 "gram.c"
2115
0
    break;
2116
2117
0
  case 53: /* v6addrlist_clients: v6addrlist_clients NOT_IPV6ADDR ';'  */
2118
0
#line 448 "gram.y"
2119
0
                {
2120
0
      struct Clients *new = calloc(1, sizeof(struct Clients));
2121
0
      if (new == NULL) {
2122
0
        flog(LOG_CRIT, "calloc failed: %s", strerror(errno));
2123
0
        ABORT;
2124
0
      }
2125
2126
0
      memcpy(&(new->Address), (yyvsp[-1].addr), sizeof(struct in6_addr));
2127
0
      new->ignored = 1;
2128
0
      new->next = (yyvsp[-2].ainfo);
2129
0
      (yyval.ainfo) = new;
2130
0
    }
2131
0
#line 2132 "gram.c"
2132
0
    break;
2133
2134
0
  case 54: /* rasrcaddresslist: T_RASRCADDRESS '{' v6addrlist_rasrcaddress '}' ';'  */
2135
0
#line 463 "gram.y"
2136
0
                {
2137
0
      (yyval.rasrcaddressinfo) = (yyvsp[-2].rasrcaddressinfo);
2138
0
    }
2139
0
#line 2140 "gram.c"
2140
0
    break;
2141
2142
0
  case 55: /* v6addrlist_rasrcaddress: IPV6ADDR ';'  */
2143
0
#line 469 "gram.y"
2144
0
                {
2145
0
      struct AdvRASrcAddress *new = calloc(1, sizeof(struct AdvRASrcAddress));
2146
0
      if (new == NULL) {
2147
0
        flog(LOG_CRIT, "calloc failed: %s", strerror(errno));
2148
0
        ABORT;
2149
0
      }
2150
2151
0
      memcpy(&(new->address), (yyvsp[-1].addr), sizeof(struct in6_addr));
2152
0
      (yyval.rasrcaddressinfo) = new;
2153
0
    }
2154
0
#line 2155 "gram.c"
2155
0
    break;
2156
2157
0
  case 56: /* v6addrlist_rasrcaddress: v6addrlist_rasrcaddress IPV6ADDR ';'  */
2158
0
#line 480 "gram.y"
2159
0
                {
2160
0
      struct AdvRASrcAddress *new = calloc(1, sizeof(struct AdvRASrcAddress));
2161
0
      if (new == NULL) {
2162
0
        flog(LOG_CRIT, "calloc failed: %s", strerror(errno));
2163
0
        ABORT;
2164
0
      }
2165
2166
0
      memcpy(&(new->address), (yyvsp[-1].addr), sizeof(struct in6_addr));
2167
0
      new->next = (yyvsp[-2].rasrcaddressinfo);
2168
0
      (yyval.rasrcaddressinfo) = new;
2169
0
    }
2170
0
#line 2171 "gram.c"
2171
0
    break;
2172
2173
0
  case 57: /* nat64prefixdef: nat64prefixhead optional_nat64prefixplist ';'  */
2174
0
#line 494 "gram.y"
2175
0
                {
2176
0
      if (nat64prefix) {
2177
2178
0
        if (nat64prefix->AdvValidLifetime > DFLT_NAT64MaxValidLifetime)
2179
0
        {
2180
0
          flog(LOG_ERR, "AdvValidLifetime must be "
2181
0
            "smaller or equal to %d in %s, line %d",
2182
0
            DFLT_NAT64MaxValidLifetime, filename, num_lines);
2183
0
          ABORT;
2184
0
        }
2185
0
        nat64prefix->curr_validlft = nat64prefix->AdvValidLifetime;
2186
0
      }
2187
0
      (yyval.nat64pinfo) = nat64prefix;
2188
0
      nat64prefix = NULL;
2189
0
    }
2190
0
#line 2191 "gram.c"
2191
0
    break;
2192
2193
0
  case 58: /* nat64prefixhead: T_NAT64PREFIX IPV6ADDR '/' NUMBER  */
2194
0
#line 512 "gram.y"
2195
0
                {
2196
0
      struct in6_addr zeroaddr;
2197
0
      memset(&zeroaddr, 0, sizeof(zeroaddr));
2198
2199
0
      if (!memcmp((yyvsp[-2].addr), &zeroaddr, sizeof(struct in6_addr))) {
2200
0
        flog(LOG_ERR, "invalid all-zeros nat64prefix in %s, line %d", filename, num_lines);
2201
0
        ABORT;
2202
0
      }
2203
2204
0
      nat64prefix = malloc(sizeof(struct NAT64Prefix));
2205
2206
0
      if (nat64prefix == NULL) {
2207
0
        flog(LOG_CRIT, "malloc failed: %s", strerror(errno));
2208
0
        ABORT;
2209
0
      }
2210
2211
0
      nat64prefix_init_defaults(nat64prefix, iface);
2212
2213
0
      if ((yyvsp[0].num) > MAX_PrefixLen)
2214
0
      {
2215
0
        flog(LOG_ERR, "invalid prefix length in %s, line %d", filename, num_lines);
2216
0
        ABORT;
2217
0
      }
2218
2219
      /* RFC8781, section 4: only prefix lengths of 96, 64, 56, 48, 40, and 32 bits are valid */
2220
0
      switch ((yyvsp[0].num)) {
2221
0
      case 32:
2222
0
      case 40:
2223
0
      case 48:
2224
0
      case 56:
2225
0
      case 64:
2226
0
      case 96:
2227
0
        break;
2228
0
      default:
2229
0
        flog(LOG_ERR, "only /96, /64, /56, /48, /40 and /32 are allowed for "
2230
0
            "nat64prefix in %s:%d", filename, num_lines);
2231
0
        ABORT;
2232
0
      }
2233
0
      nat64prefix->PrefixLen = (yyvsp[0].num);
2234
2235
0
      memcpy(&nat64prefix->Prefix, (yyvsp[-2].addr), sizeof(struct in6_addr));
2236
0
    }
2237
0
#line 2238 "gram.c"
2238
0
    break;
2239
2240
0
  case 64: /* nat64prefixparms: T_AdvValidLifetime NUMBER ';'  */
2241
0
#line 566 "gram.y"
2242
0
                {
2243
0
      if ((yyvsp[-1].num) > DFLT_NAT64MaxValidLifetime)
2244
0
      {
2245
0
        flog(LOG_ERR, "maximum for NAT64 AdvValidLifetime is %d (in %s, line %d)",
2246
0
          DFLT_NAT64MaxValidLifetime, filename, num_lines);
2247
0
        ABORT;
2248
0
      }
2249
0
      if (nat64prefix) {
2250
0
        nat64prefix->AdvValidLifetime = (yyvsp[-1].num);
2251
0
      }
2252
0
    }
2253
0
#line 2254 "gram.c"
2254
0
    break;
2255
2256
0
  case 65: /* ignoreprefixlist: T_AUTOIGNOREPREFIX '{' ignoreprefixes '}' ';'  */
2257
0
#line 580 "gram.y"
2258
0
                {
2259
0
      (yyval.igpinfo) = (yyvsp[-2].igpinfo);
2260
0
    }
2261
0
#line 2262 "gram.c"
2262
0
    break;
2263
2264
0
  case 66: /* ignoreprefixes: IPV6ADDR '/' NUMBER ';'  */
2265
0
#line 586 "gram.y"
2266
0
                {
2267
0
      struct AutogenIgnorePrefix *new = calloc(1, sizeof(struct AutogenIgnorePrefix));
2268
0
      if (new == NULL) {
2269
0
        flog(LOG_CRIT, "calloc failed: %s", strerror(errno));
2270
0
        ABORT;
2271
0
      }
2272
2273
0
      memcpy(&(new->Prefix), (yyvsp[-3].addr), sizeof(struct in6_addr));
2274
2275
      // Create subnet mask from CIDR notation
2276
0
      int fullOctets = (yyvsp[-1].num) / 8;
2277
0
      for (int i = 0; i < fullOctets; ++i) {
2278
0
        new->Mask.s6_addr[i] = 0xff;
2279
0
      }
2280
2281
0
      if (fullOctets != 16) {
2282
0
        new->Mask.s6_addr[fullOctets] = ~(1 << (8 - (yyvsp[-1].num) % 8)) + 1;
2283
0
      }
2284
2285
0
      (yyval.igpinfo) = new;
2286
0
    }
2287
0
#line 2288 "gram.c"
2288
0
    break;
2289
2290
0
  case 67: /* ignoreprefixes: ignoreprefixes IPV6ADDR '/' NUMBER ';'  */
2291
0
#line 608 "gram.y"
2292
0
                {
2293
0
      struct AutogenIgnorePrefix *new = calloc(1, sizeof(struct AutogenIgnorePrefix));
2294
0
      if (new == NULL) {
2295
0
        flog(LOG_CRIT, "calloc failed: %s", strerror(errno));
2296
0
        ABORT;
2297
0
      }
2298
2299
0
      memcpy(&(new->Prefix), (yyvsp[-3].addr), sizeof(struct in6_addr));
2300
2301
      // Create subnet mask from CIDR notation
2302
0
      int fullOctets = (yyvsp[-1].num) / 8;
2303
0
      for (int i = 0; i < fullOctets; ++i) {
2304
0
        new->Mask.s6_addr[i] = 0xff;
2305
0
      }
2306
2307
0
      if (fullOctets != 16) {
2308
0
        new->Mask.s6_addr[fullOctets] = ~(1 << (8 - (yyvsp[-1].num) % 8)) + 1;
2309
0
      }
2310
2311
0
      new->next = (yyvsp[-4].igpinfo);
2312
0
      (yyval.igpinfo) = new;
2313
0
    }
2314
0
#line 2315 "gram.c"
2315
0
    break;
2316
2317
0
  case 68: /* prefixdef: prefixhead optional_prefixplist ';'  */
2318
0
#line 633 "gram.y"
2319
0
                {
2320
0
      if (prefix) {
2321
2322
0
        if (prefix->AdvPreferredLifetime > prefix->AdvValidLifetime)
2323
0
        {
2324
0
          flog(LOG_ERR, "AdvValidLifetime must be "
2325
0
            "greater than or equal to AdvPreferredLifetime in %s, line %d",
2326
0
            filename, num_lines);
2327
0
          ABORT;
2328
0
        }
2329
2330
0
        if ( prefix->if6[0] )
2331
0
        {
2332
0
          if (prefix->PrefixLen != 64) {
2333
0
            flog(LOG_ERR, "only /64 is allowed with Base6Interface.  %s:%d", filename, num_lines);
2334
0
            ABORT;
2335
0
          }
2336
0
        }
2337
0
      }
2338
0
      (yyval.pinfo) = prefix;
2339
0
      prefix = NULL;
2340
0
    }
2341
0
#line 2342 "gram.c"
2342
0
    break;
2343
2344
0
  case 69: /* prefixhead: T_PREFIX IPV6ADDR '/' NUMBER  */
2345
0
#line 658 "gram.y"
2346
0
                {
2347
0
      struct in6_addr zeroaddr;
2348
0
      memset(&zeroaddr, 0, sizeof(zeroaddr));
2349
2350
#ifndef HAVE_IFADDRS_H  // all-zeros prefix is a way to tell us to get the prefix from the interface config
2351
      if (!memcmp((yyvsp[-2].addr), &zeroaddr, sizeof(struct in6_addr))) {
2352
        flog(LOG_WARNING, "invalid all-zeros prefix in %s, line %d", filename, num_lines);
2353
      }
2354
#endif
2355
0
      prefix = malloc(sizeof(struct AdvPrefix));
2356
2357
0
      if (prefix == NULL) {
2358
0
        flog(LOG_CRIT, "malloc failed: %s", strerror(errno));
2359
0
        ABORT;
2360
0
      }
2361
2362
0
      prefix_init_defaults(prefix);
2363
2364
0
      if ((yyvsp[0].num) > MAX_PrefixLen)
2365
0
      {
2366
0
        flog(LOG_ERR, "invalid prefix length in %s, line %d", filename, num_lines);
2367
0
        ABORT;
2368
0
      }
2369
2370
0
      prefix->PrefixLen = (yyvsp[0].num);
2371
2372
0
      memcpy(&prefix->Prefix, (yyvsp[-2].addr), sizeof(struct in6_addr));
2373
0
    }
2374
0
#line 2375 "gram.c"
2375
0
    break;
2376
2377
0
  case 75: /* prefixparms: T_AdvOnLink SWITCH ';'  */
2378
0
#line 698 "gram.y"
2379
0
                {
2380
0
      if (prefix) {
2381
0
        prefix->AdvOnLinkFlag = (yyvsp[-1].num);
2382
0
      }
2383
0
    }
2384
0
#line 2385 "gram.c"
2385
0
    break;
2386
2387
0
  case 76: /* prefixparms: T_AdvAutonomous SWITCH ';'  */
2388
0
#line 704 "gram.y"
2389
0
                {
2390
0
      if (prefix) {
2391
0
        prefix->AdvAutonomousFlag = (yyvsp[-1].num);
2392
0
      }
2393
0
    }
2394
0
#line 2395 "gram.c"
2395
0
    break;
2396
2397
0
  case 77: /* prefixparms: T_AdvRouterAddr SWITCH ';'  */
2398
0
#line 710 "gram.y"
2399
0
                {
2400
0
      if (prefix) {
2401
0
        prefix->AdvRouterAddr = (yyvsp[-1].num);
2402
0
      }
2403
0
    }
2404
0
#line 2405 "gram.c"
2405
0
    break;
2406
2407
0
  case 78: /* prefixparms: T_AdvValidLifetime number_or_infinity ';'  */
2408
0
#line 716 "gram.y"
2409
0
                {
2410
0
      if (prefix) {
2411
0
        prefix->AdvValidLifetime = (yyvsp[-1].num);
2412
0
        prefix->curr_validlft = (yyvsp[-1].num);
2413
0
      }
2414
0
    }
2415
0
#line 2416 "gram.c"
2416
0
    break;
2417
2418
0
  case 79: /* prefixparms: T_AdvPreferredLifetime number_or_infinity ';'  */
2419
0
#line 723 "gram.y"
2420
0
                {
2421
0
      if (prefix) {
2422
0
        prefix->AdvPreferredLifetime = (yyvsp[-1].num);
2423
0
        prefix->curr_preferredlft = (yyvsp[-1].num);
2424
0
      }
2425
0
    }
2426
0
#line 2427 "gram.c"
2427
0
    break;
2428
2429
0
  case 80: /* prefixparms: T_DeprecatePrefix SWITCH ';'  */
2430
0
#line 730 "gram.y"
2431
0
                {
2432
0
      if (prefix) {
2433
0
        prefix->DeprecatePrefixFlag = (yyvsp[-1].num);
2434
0
      }
2435
0
    }
2436
0
#line 2437 "gram.c"
2437
0
    break;
2438
2439
0
  case 81: /* prefixparms: T_DecrementLifetimes SWITCH ';'  */
2440
0
#line 736 "gram.y"
2441
0
                {
2442
0
      if (prefix) {
2443
0
        prefix->DecrementLifetimesFlag = (yyvsp[-1].num);
2444
0
      }
2445
0
    }
2446
0
#line 2447 "gram.c"
2447
0
    break;
2448
2449
0
  case 82: /* prefixparms: T_Base6Interface name ';'  */
2450
0
#line 742 "gram.y"
2451
0
                {
2452
#ifndef HAVE_IFADDRS_H
2453
      flog(LOG_ERR, "Base6Interface not supported in %s, line %d", filename, num_lines);
2454
      ABORT;
2455
#else
2456
0
      if (prefix) {
2457
0
        dlog(LOG_DEBUG, 4, "using prefixes on interface %s for prefixes on interface %s", (yyvsp[-1].str), iface->props.name);
2458
0
        memset(&prefix->if6, 0, sizeof(prefix->if6));
2459
0
        strlcpy(prefix->if6, (yyvsp[-1].str), sizeof(prefix->if6));
2460
0
      }
2461
0
#endif
2462
0
    }
2463
0
#line 2464 "gram.c"
2464
0
    break;
2465
2466
0
  case 83: /* prefixparms: T_Base6to4Interface name ';'  */
2467
0
#line 756 "gram.y"
2468
0
                {
2469
#ifndef HAVE_IFADDRS_H
2470
      flog(LOG_ERR, "Base6to4Interface not supported in %s, line %d", filename, num_lines);
2471
      ABORT;
2472
#else
2473
0
      if (prefix) {
2474
0
        dlog(LOG_DEBUG, 4, "using interface %s for 6to4 prefixes on interface %s", (yyvsp[-1].str), iface->props.name);
2475
0
        memset(&prefix->if6to4, 0, sizeof(prefix->if6to4));
2476
0
        strlcpy(prefix->if6to4, (yyvsp[-1].str), sizeof(prefix->if6to4));
2477
0
      }
2478
0
#endif
2479
0
    }
2480
0
#line 2481 "gram.c"
2481
0
    break;
2482
2483
0
  case 84: /* routedef: routehead '{' optional_routeplist '}' ';'  */
2484
0
#line 771 "gram.y"
2485
0
                {
2486
0
      (yyval.rinfo) = route;
2487
0
      route = NULL;
2488
0
    }
2489
0
#line 2490 "gram.c"
2490
0
    break;
2491
2492
0
  case 85: /* routehead: T_ROUTE IPV6ADDR '/' NUMBER  */
2493
0
#line 779 "gram.y"
2494
0
                {
2495
0
      route = malloc(sizeof(struct AdvRoute));
2496
2497
0
      if (route == NULL) {
2498
0
        flog(LOG_CRIT, "malloc failed: %s", strerror(errno));
2499
0
        ABORT;
2500
0
      }
2501
2502
0
      route_init_defaults(route, iface);
2503
2504
0
      if ((yyvsp[0].num) > MAX_PrefixLen)
2505
0
      {
2506
0
        flog(LOG_ERR, "invalid route prefix length in %s, line %d", filename, num_lines);
2507
0
        ABORT;
2508
0
      }
2509
2510
0
      route->PrefixLen = (yyvsp[0].num);
2511
2512
0
      memcpy(&route->Prefix, (yyvsp[-2].addr), sizeof(struct in6_addr));
2513
0
    }
2514
0
#line 2515 "gram.c"
2515
0
    break;
2516
2517
0
  case 90: /* routeparms: T_AdvRoutePreference SIGNEDNUMBER ';'  */
2518
0
#line 812 "gram.y"
2519
0
                {
2520
0
      route->AdvRoutePreference = (yyvsp[-1].snum);
2521
0
    }
2522
0
#line 2523 "gram.c"
2523
0
    break;
2524
2525
0
  case 91: /* routeparms: T_AdvRouteLifetime number_or_infinity ';'  */
2526
0
#line 816 "gram.y"
2527
0
                {
2528
0
      route->AdvRouteLifetime = (yyvsp[-1].num);
2529
0
    }
2530
0
#line 2531 "gram.c"
2531
0
    break;
2532
2533
0
  case 92: /* routeparms: T_RemoveRoute SWITCH ';'  */
2534
0
#line 820 "gram.y"
2535
0
                {
2536
0
      route->RemoveRouteFlag = (yyvsp[-1].num);
2537
0
    }
2538
0
#line 2539 "gram.c"
2539
0
    break;
2540
2541
0
  case 93: /* rdnssdef: rdnsshead '{' optional_rdnssplist '}' ';'  */
2542
0
#line 826 "gram.y"
2543
0
                {
2544
0
      (yyval.rdnssinfo) = rdnss;
2545
0
      rdnss = NULL;
2546
0
    }
2547
0
#line 2548 "gram.c"
2548
0
    break;
2549
2550
0
  case 96: /* rdnssaddr: IPV6ADDR  */
2551
0
#line 837 "gram.y"
2552
0
                {
2553
0
      if (!rdnss) {
2554
        /* first IP found */
2555
0
        rdnss = malloc(sizeof(struct AdvRDNSS));
2556
2557
0
        if (rdnss == NULL) {
2558
0
          flog(LOG_CRIT, "malloc failed: %s", strerror(errno));
2559
0
          ABORT;
2560
0
        }
2561
2562
0
        rdnss_init_defaults(rdnss, iface);
2563
0
      }
2564
2565
0
      rdnss->AdvRDNSSNumber++;
2566
0
      if (rdnss->AdvRDNSSNumber > 127) {
2567
0
        flog(LOG_CRIT, "Too many RDNSS servers specified - upper limit is 127 based on RDNSSI length field being uint8, RFC8106, section 5.1");
2568
0
        ABORT;
2569
0
      }
2570
0
      rdnss->AdvRDNSSAddr =
2571
0
        realloc(rdnss->AdvRDNSSAddr,
2572
0
          rdnss->AdvRDNSSNumber * sizeof(struct in6_addr));
2573
0
      if (rdnss->AdvRDNSSAddr == NULL) {
2574
0
        flog(LOG_CRIT, "realloc failed: %s", strerror(errno));
2575
0
        ABORT;
2576
0
      }
2577
0
      memcpy(&rdnss->AdvRDNSSAddr[rdnss->AdvRDNSSNumber - 1], (yyvsp[0].addr), sizeof(struct in6_addr));
2578
0
    }
2579
0
#line 2580 "gram.c"
2580
0
    break;
2581
2582
0
  case 97: /* rdnsshead: T_RDNSS rdnssaddrs  */
2583
0
#line 867 "gram.y"
2584
0
                {
2585
0
      if (!rdnss) {
2586
0
        flog(LOG_CRIT, "no address specified in RDNSS section");
2587
0
        ABORT;
2588
0
      }
2589
0
    }
2590
0
#line 2591 "gram.c"
2591
0
    break;
2592
2593
0
  case 102: /* rdnssparms: T_AdvRDNSSPreference NUMBER ';'  */
2594
0
#line 885 "gram.y"
2595
0
                {
2596
0
      flog(LOG_WARNING, "ignoring deprecated RDNSS preference");
2597
0
    }
2598
0
#line 2599 "gram.c"
2599
0
    break;
2600
2601
0
  case 103: /* rdnssparms: T_AdvRDNSSOpenFlag SWITCH ';'  */
2602
0
#line 889 "gram.y"
2603
0
                {
2604
0
      flog(LOG_WARNING, "ignoring deprecated RDNSS open flag");
2605
0
    }
2606
0
#line 2607 "gram.c"
2607
0
    break;
2608
2609
0
  case 104: /* rdnssparms: T_AdvRDNSSLifetime number_or_infinity ';'  */
2610
0
#line 893 "gram.y"
2611
0
                {
2612
0
      rdnss->AdvRDNSSLifetime = (yyvsp[-1].num);
2613
0
    }
2614
0
#line 2615 "gram.c"
2615
0
    break;
2616
2617
0
  case 105: /* rdnssparms: T_FlushRDNSS SWITCH ';'  */
2618
0
#line 897 "gram.y"
2619
0
                {
2620
0
      rdnss->FlushRDNSSFlag = (yyvsp[-1].num);
2621
0
    }
2622
0
#line 2623 "gram.c"
2623
0
    break;
2624
2625
0
  case 106: /* dnssldef: dnsslhead '{' optional_dnsslplist '}' ';'  */
2626
0
#line 903 "gram.y"
2627
0
                {
2628
0
      (yyval.dnsslinfo) = dnssl;
2629
0
      dnssl = NULL;
2630
0
    }
2631
0
#line 2632 "gram.c"
2632
0
    break;
2633
2634
0
  case 109: /* dnsslsuffix: STRING  */
2635
0
#line 914 "gram.y"
2636
0
                {
2637
0
      char *ch;
2638
0
      for (ch = (yyvsp[0].str);*ch != '\0';ch++) {
2639
0
        if (*ch >= 'A' && *ch <= 'Z')
2640
0
          continue;
2641
0
        if (*ch >= 'a' && *ch <= 'z')
2642
0
          continue;
2643
0
        if (*ch >= '0' && *ch <= '9')
2644
0
          continue;
2645
0
        if (*ch == '-' || *ch == '.')
2646
0
          continue;
2647
2648
0
        flog(LOG_CRIT, "invalid domain suffix specified");
2649
0
        ABORT;
2650
0
      }
2651
2652
0
      if (!dnssl) {
2653
        /* first domain found */
2654
0
        dnssl = malloc(sizeof(struct AdvDNSSL));
2655
2656
0
        if (dnssl == NULL) {
2657
0
          flog(LOG_CRIT, "malloc failed: %s", strerror(errno));
2658
0
          ABORT;
2659
0
        }
2660
2661
0
        dnssl_init_defaults(dnssl, iface);
2662
0
      }
2663
2664
0
      dnssl->AdvDNSSLNumber++;
2665
0
      dnssl->AdvDNSSLSuffixes =
2666
0
        realloc(dnssl->AdvDNSSLSuffixes,
2667
0
          dnssl->AdvDNSSLNumber * sizeof(char*));
2668
0
      if (dnssl->AdvDNSSLSuffixes == NULL) {
2669
0
        flog(LOG_CRIT, "realloc failed: %s", strerror(errno));
2670
0
        ABORT;
2671
0
      }
2672
2673
0
      dnssl->AdvDNSSLSuffixes[dnssl->AdvDNSSLNumber - 1] = strdup((yyvsp[0].str));
2674
0
    }
2675
0
#line 2676 "gram.c"
2676
0
    break;
2677
2678
0
  case 110: /* dnsslhead: T_DNSSL dnsslsuffixes  */
2679
0
#line 956 "gram.y"
2680
0
                {
2681
0
      if (!dnssl) {
2682
0
        flog(LOG_CRIT, "no domain specified in DNSSL section");
2683
0
        ABORT;
2684
0
      }
2685
0
    }
2686
0
#line 2687 "gram.c"
2687
0
    break;
2688
2689
0
  case 115: /* dnsslparms: T_AdvDNSSLLifetime number_or_infinity ';'  */
2690
0
#line 974 "gram.y"
2691
0
                {
2692
0
      dnssl->AdvDNSSLLifetime = (yyvsp[-1].num);
2693
2694
0
    }
2695
0
#line 2696 "gram.c"
2696
0
    break;
2697
2698
0
  case 116: /* dnsslparms: T_FlushDNSSL SWITCH ';'  */
2699
0
#line 979 "gram.y"
2700
0
                {
2701
0
      dnssl->FlushDNSSLFlag = (yyvsp[-1].num);
2702
0
    }
2703
0
#line 2704 "gram.c"
2704
0
    break;
2705
2706
0
  case 117: /* lowpancodef: lowpancohead '{' optional_lowpancoplist '}' ';'  */
2707
0
#line 985 "gram.y"
2708
0
                {
2709
0
      (yyval.lowpancoinfo) = lowpanco;
2710
0
      lowpanco = NULL;
2711
0
    }
2712
0
#line 2713 "gram.c"
2713
0
    break;
2714
2715
0
  case 118: /* lowpancohead: T_LOWPANCO  */
2716
0
#line 992 "gram.y"
2717
0
                {
2718
0
      lowpanco = malloc(sizeof(struct AdvLowpanCo));
2719
2720
0
      if (lowpanco == NULL) {
2721
0
        flog(LOG_CRIT, "malloc failed: %s", strerror(errno));
2722
0
        ABORT;
2723
0
      }
2724
2725
0
      memset(lowpanco, 0, sizeof(struct AdvLowpanCo));
2726
0
    }
2727
0
#line 2728 "gram.c"
2728
0
    break;
2729
2730
0
  case 123: /* lowpancoparms: T_AdvContextLength NUMBER ';'  */
2731
0
#line 1013 "gram.y"
2732
0
                {
2733
0
      lowpanco->ContextLength = (yyvsp[-1].num);
2734
0
    }
2735
0
#line 2736 "gram.c"
2736
0
    break;
2737
2738
0
  case 124: /* lowpancoparms: T_AdvContextCompressionFlag SWITCH ';'  */
2739
0
#line 1017 "gram.y"
2740
0
                {
2741
0
      lowpanco->ContextCompressionFlag = (yyvsp[-1].num);
2742
0
    }
2743
0
#line 2744 "gram.c"
2744
0
    break;
2745
2746
0
  case 125: /* lowpancoparms: T_AdvContextID NUMBER ';'  */
2747
0
#line 1021 "gram.y"
2748
0
                {
2749
0
      lowpanco->AdvContextID = (yyvsp[-1].num);
2750
0
    }
2751
0
#line 2752 "gram.c"
2752
0
    break;
2753
2754
0
  case 126: /* lowpancoparms: T_AdvLifeTime NUMBER ';'  */
2755
0
#line 1025 "gram.y"
2756
0
                {
2757
0
      lowpanco->AdvLifeTime = (yyvsp[-1].num);
2758
0
    }
2759
0
#line 2760 "gram.c"
2760
0
    break;
2761
2762
0
  case 127: /* abrodef: abrohead '{' optional_abroplist '}' ';'  */
2763
0
#line 1031 "gram.y"
2764
0
                {
2765
0
      (yyval.abroinfo) = abro;
2766
0
      abro = NULL;
2767
0
    }
2768
0
#line 2769 "gram.c"
2769
0
    break;
2770
2771
0
  case 130: /* abrohead_new: T_ABRO IPV6ADDR  */
2772
0
#line 1040 "gram.y"
2773
0
                {
2774
0
      abro = malloc(sizeof(struct AdvAbro));
2775
2776
0
      if (abro == NULL) {
2777
0
        flog(LOG_CRIT, "malloc failed: %s", strerror(errno));
2778
0
        ABORT;
2779
0
      }
2780
2781
0
      memset(abro, 0, sizeof(struct AdvAbro));
2782
0
      memcpy(&abro->LBRaddress, (yyvsp[0].addr), sizeof(struct in6_addr));
2783
0
    }
2784
0
#line 2785 "gram.c"
2785
0
    break;
2786
2787
0
  case 131: /* abrohead_dep: T_ABRO IPV6ADDR '/' NUMBER  */
2788
0
#line 1054 "gram.y"
2789
0
                {
2790
0
      flog(LOG_WARNING
2791
0
        , "%s:%d abro prefix length deprecated, remove trailing '/%d'"
2792
0
        , filename
2793
0
        , num_lines
2794
0
        , (yyvsp[0].num)
2795
0
      );
2796
0
      abro = malloc(sizeof(struct AdvAbro));
2797
2798
0
      if (abro == NULL) {
2799
0
        flog(LOG_CRIT, "malloc failed: %s", strerror(errno));
2800
0
        ABORT;
2801
0
      }
2802
2803
0
      memset(abro, 0, sizeof(struct AdvAbro));
2804
0
      memcpy(&abro->LBRaddress, (yyvsp[-2].addr), sizeof(struct in6_addr));
2805
0
    }
2806
0
#line 2807 "gram.c"
2807
0
    break;
2808
2809
0
  case 136: /* abroparms: T_AdvVersionLow NUMBER ';'  */
2810
0
#line 1082 "gram.y"
2811
0
                {
2812
0
      abro->Version[1] = (yyvsp[-1].num);
2813
0
    }
2814
0
#line 2815 "gram.c"
2815
0
    break;
2816
2817
0
  case 137: /* abroparms: T_AdvVersionHigh NUMBER ';'  */
2818
0
#line 1086 "gram.y"
2819
0
                {
2820
0
      abro->Version[0] = (yyvsp[-1].num);
2821
0
    }
2822
0
#line 2823 "gram.c"
2823
0
    break;
2824
2825
0
  case 138: /* abroparms: T_AdvValidLifetime NUMBER ';'  */
2826
0
#line 1090 "gram.y"
2827
0
                {
2828
0
      abro->ValidLifeTime = (yyvsp[-1].num);
2829
0
    }
2830
0
#line 2831 "gram.c"
2831
0
    break;
2832
2833
0
  case 139: /* number_or_infinity: NUMBER  */
2834
0
#line 1096 "gram.y"
2835
0
                        {
2836
0
        (yyval.num) = (yyvsp[0].num);
2837
0
      }
2838
0
#line 2839 "gram.c"
2839
0
    break;
2840
2841
0
  case 140: /* number_or_infinity: INFINITY  */
2842
0
#line 1100 "gram.y"
2843
0
                        {
2844
0
        (yyval.num) = (uint32_t)~0;
2845
0
      }
2846
0
#line 2847 "gram.c"
2847
0
    break;
2848
2849
2850
0
#line 2851 "gram.c"
2851
2852
0
      default: break;
2853
0
    }
2854
  /* User semantic actions sometimes alter yychar, and that requires
2855
     that yytoken be updated with the new translation.  We take the
2856
     approach of translating immediately before every use of yytoken.
2857
     One alternative is translating here after every semantic action,
2858
     but that translation would be missed if the semantic action invokes
2859
     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2860
     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
2861
     incorrect destructor might then be invoked immediately.  In the
2862
     case of YYERROR or YYBACKUP, subsequent parser actions might lead
2863
     to an incorrect destructor call or verbose syntax error message
2864
     before the lookahead is translated.  */
2865
0
  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
2866
2867
0
  YYPOPSTACK (yylen);
2868
0
  yylen = 0;
2869
2870
0
  *++yyvsp = yyval;
2871
2872
  /* Now 'shift' the result of the reduction.  Determine what state
2873
     that goes to, based on the state we popped back to and the rule
2874
     number reduced by.  */
2875
0
  {
2876
0
    const int yylhs = yyr1[yyn] - YYNTOKENS;
2877
0
    const int yyi = yypgoto[yylhs] + *yyssp;
2878
0
    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2879
0
               ? yytable[yyi]
2880
0
               : yydefgoto[yylhs]);
2881
0
  }
2882
2883
0
  goto yynewstate;
2884
2885
2886
/*--------------------------------------.
2887
| yyerrlab -- here on detecting error.  |
2888
`--------------------------------------*/
2889
596
yyerrlab:
2890
  /* Make sure we have latest lookahead translation.  See comments at
2891
     user semantic actions for why this is necessary.  */
2892
596
  yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
2893
  /* If not already recovering from an error, report this error.  */
2894
596
  if (!yyerrstatus)
2895
596
    {
2896
596
      ++yynerrs;
2897
596
      yyerror (YY_("syntax error"));
2898
596
    }
2899
2900
596
  if (yyerrstatus == 3)
2901
0
    {
2902
      /* If just tried and failed to reuse lookahead token after an
2903
         error, discard it.  */
2904
2905
0
      if (yychar <= YYEOF)
2906
0
        {
2907
          /* Return failure if at end of input.  */
2908
0
          if (yychar == YYEOF)
2909
0
            YYABORT;
2910
0
        }
2911
0
      else
2912
0
        {
2913
0
          yydestruct ("Error: discarding",
2914
0
                      yytoken, &yylval);
2915
0
          yychar = YYEMPTY;
2916
0
        }
2917
0
    }
2918
2919
  /* Else will try to reuse lookahead token after shifting the error
2920
     token.  */
2921
596
  goto yyerrlab1;
2922
2923
2924
/*---------------------------------------------------.
2925
| yyerrorlab -- error raised explicitly by YYERROR.  |
2926
`---------------------------------------------------*/
2927
596
yyerrorlab:
2928
  /* Pacify compilers when the user code never invokes YYERROR and the
2929
     label yyerrorlab therefore never appears in user code.  */
2930
0
  if (0)
2931
0
    YYERROR;
2932
0
  ++yynerrs;
2933
2934
  /* Do not reclaim the symbols of the rule whose action triggered
2935
     this YYERROR.  */
2936
0
  YYPOPSTACK (yylen);
2937
0
  yylen = 0;
2938
0
  YY_STACK_PRINT (yyss, yyssp);
2939
0
  yystate = *yyssp;
2940
0
  goto yyerrlab1;
2941
2942
2943
/*-------------------------------------------------------------.
2944
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
2945
`-------------------------------------------------------------*/
2946
596
yyerrlab1:
2947
596
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
2948
2949
  /* Pop stack until we find a state that shifts the error token.  */
2950
596
  for (;;)
2951
596
    {
2952
596
      yyn = yypact[yystate];
2953
596
      if (!yypact_value_is_default (yyn))
2954
596
        {
2955
596
          yyn += YYSYMBOL_YYerror;
2956
596
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
2957
0
            {
2958
0
              yyn = yytable[yyn];
2959
0
              if (0 < yyn)
2960
0
                break;
2961
0
            }
2962
596
        }
2963
2964
      /* Pop the current state because it cannot handle the error token.  */
2965
596
      if (yyssp == yyss)
2966
596
        YYABORT;
2967
2968
2969
0
      yydestruct ("Error: popping",
2970
0
                  YY_ACCESSING_SYMBOL (yystate), yyvsp);
2971
0
      YYPOPSTACK (1);
2972
0
      yystate = *yyssp;
2973
0
      YY_STACK_PRINT (yyss, yyssp);
2974
0
    }
2975
2976
0
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2977
0
  *++yyvsp = yylval;
2978
0
  YY_IGNORE_MAYBE_UNINITIALIZED_END
2979
2980
2981
  /* Shift the error token.  */
2982
0
  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
2983
2984
0
  yystate = yyn;
2985
0
  goto yynewstate;
2986
2987
2988
/*-------------------------------------.
2989
| yyacceptlab -- YYACCEPT comes here.  |
2990
`-------------------------------------*/
2991
0
yyacceptlab:
2992
0
  yyresult = 0;
2993
0
  goto yyreturnlab;
2994
2995
2996
/*-----------------------------------.
2997
| yyabortlab -- YYABORT comes here.  |
2998
`-----------------------------------*/
2999
596
yyabortlab:
3000
596
  yyresult = 1;
3001
596
  goto yyreturnlab;
3002
3003
3004
/*-----------------------------------------------------------.
3005
| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
3006
`-----------------------------------------------------------*/
3007
0
yyexhaustedlab:
3008
0
  yyerror (YY_("memory exhausted"));
3009
0
  yyresult = 2;
3010
0
  goto yyreturnlab;
3011
3012
3013
/*----------------------------------------------------------.
3014
| yyreturnlab -- parsing is finished, clean up and return.  |
3015
`----------------------------------------------------------*/
3016
596
yyreturnlab:
3017
596
  if (yychar != YYEMPTY)
3018
596
    {
3019
      /* Make sure we have latest lookahead translation.  See comments at
3020
         user semantic actions for why this is necessary.  */
3021
596
      yytoken = YYTRANSLATE (yychar);
3022
596
      yydestruct ("Cleanup: discarding lookahead",
3023
596
                  yytoken, &yylval);
3024
596
    }
3025
  /* Do not reclaim the symbols of the rule whose action triggered
3026
     this YYABORT or YYACCEPT.  */
3027
596
  YYPOPSTACK (yylen);
3028
596
  YY_STACK_PRINT (yyss, yyssp);
3029
596
  while (yyssp != yyss)
3030
0
    {
3031
0
      yydestruct ("Cleanup: popping",
3032
0
                  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
3033
0
      YYPOPSTACK (1);
3034
0
    }
3035
596
#ifndef yyoverflow
3036
596
  if (yyss != yyssa)
3037
0
    YYSTACK_FREE (yyss);
3038
596
#endif
3039
3040
596
  return yyresult;
3041
596
}
3042
3043
#line 1105 "gram.y"
3044
3045
3046
static void cleanup(void)
3047
0
{
3048
0
  if (iface) {
3049
0
    free_ifaces(iface);
3050
0
    iface = 0;
3051
0
  }
3052
3053
0
  if (prefix) {
3054
0
    free(prefix);
3055
0
    prefix = 0;
3056
0
  }
3057
3058
0
  if (route) {
3059
0
    free(route);
3060
0
    route = 0;
3061
0
  }
3062
3063
0
  if (rdnss) {
3064
0
    free(rdnss->AdvRDNSSAddr);
3065
0
    free(rdnss);
3066
0
    rdnss = 0;
3067
0
  }
3068
3069
0
  if (dnssl) {
3070
0
    int i;
3071
0
    for (i = 0;i < dnssl->AdvDNSSLNumber;i++)
3072
0
      free(dnssl->AdvDNSSLSuffixes[i]);
3073
0
    free(dnssl->AdvDNSSLSuffixes);
3074
0
    free(dnssl);
3075
0
    dnssl = 0;
3076
0
  }
3077
3078
0
  if (lowpanco) {
3079
0
    free(lowpanco);
3080
0
    lowpanco = 0;
3081
0
  }
3082
3083
0
  if (abro) {
3084
0
    free(abro);
3085
0
    abro = 0;
3086
0
  }
3087
0
}
3088
3089
struct Interface * readin_config(char const *path)
3090
596
{
3091
596
  IfaceList = 0;
3092
596
  FILE * in = fopen(path, "r");
3093
596
  if (in) {
3094
596
    filename = path;
3095
596
    num_lines = 1;
3096
596
    iface = 0;
3097
3098
596
    yyset_in(in);
3099
596
    if (yyparse() != 0) {
3100
596
      free_ifaces(iface);
3101
596
      iface = 0;
3102
596
      IfaceList = 0;
3103
596
    } else {
3104
0
      dlog(LOG_DEBUG, 1, "config file, %s, syntax ok", path);
3105
0
    }
3106
596
    yylex_destroy();
3107
596
    fclose(in);
3108
596
  }
3109
3110
596
  return IfaceList;
3111
596
}
3112
3113
static void yyerror(char const * msg)
3114
596
{
3115
  fprintf(stderr, "%s:%d error: %s\n",
3116
596
    filename,
3117
596
    num_lines,
3118
596
    msg);
3119
596
}
3120