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