Coverage Report

Created: 2026-11-12 07:15

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