File: | src/usr.sbin/npppd/npppd/obj/parse.c |
Warning: | line 1579, column 13 Attempt to free released memory |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | #include <stdlib.h> | |||
2 | #include <string.h> | |||
3 | #define YYBYACC1 1 | |||
4 | #define YYMAJOR1 1 | |||
5 | #define YYMINOR9 9 | |||
6 | #define YYLEXyylex() yylex() | |||
7 | #define YYEMPTY-1 -1 | |||
8 | #define yyclearin(yychar=(-1)) (yychar=(YYEMPTY-1)) | |||
9 | #define yyerrok(yyerrflag=0) (yyerrflag=0) | |||
10 | #define YYRECOVERING()(yyerrflag!=0) (yyerrflag!=0) | |||
11 | #define YYPREFIX"yy" "yy" | |||
12 | #line 23 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
13 | #include <sys/types.h> | |||
14 | #include <sys/socket.h> | |||
15 | #include <sys/queue.h> | |||
16 | #include <netinet/in.h> | |||
17 | #include <arpa/inet.h> | |||
18 | #include <net/if.h> | |||
19 | ||||
20 | #include <ctype.h> | |||
21 | #include <errno(*__errno()).h> | |||
22 | #include <inttypes.h> | |||
23 | #include <limits.h> | |||
24 | #include <stdarg.h> | |||
25 | #include <stdio.h> | |||
26 | #include <stdlib.h> | |||
27 | #include <string.h> | |||
28 | #include <syslog.h> | |||
29 | #include <netdb.h> | |||
30 | #include <event.h> | |||
31 | ||||
32 | #include <stdbool.h> | |||
33 | #include <stdarg.h> | |||
34 | #include "npppd_auth.h" | |||
35 | #include "npppd.h" | |||
36 | #ifdef USE_NPPPD_RADIUS1 | |||
37 | #include "radius_req.h" | |||
38 | #endif | |||
39 | #include "privsep.h" | |||
40 | #include "log.h" | |||
41 | ||||
42 | TAILQ_HEAD(files, file)struct files { struct file *tqh_first; struct file **tqh_last ; } files = TAILQ_HEAD_INITIALIZER(files){ ((void *)0), &(files).tqh_first }; | |||
43 | static struct file { | |||
44 | TAILQ_ENTRY(file)struct { struct file *tqe_next; struct file **tqe_prev; } entry; | |||
45 | FILE *stream; | |||
46 | char *name; | |||
47 | int lineno; | |||
48 | int errors; | |||
49 | } *file, *topfile; | |||
50 | struct file *pushfile(const char *); | |||
51 | int popfile(void); | |||
52 | int yyparse(void); | |||
53 | int yylex(void); | |||
54 | int yyerror(const char *, ...) | |||
55 | __attribute__((__format__ (printf, 1, 2))) | |||
56 | __attribute__((__nonnull__ (1))); | |||
57 | int kw_cmp(const void *, const void *); | |||
58 | int lookup(char *); | |||
59 | int lgetc(int); | |||
60 | int lungetc(int); | |||
61 | int findeol(void); | |||
62 | ||||
63 | static void tunnconf_init (struct tunnconf *, int); | |||
64 | static void tunnconf_fini (struct tunnconf *); | |||
65 | static struct tunnconf *tunnconf_find (const char *); | |||
66 | static void authconf_init (struct authconf *); | |||
67 | static void authconf_fini (struct authconf *); | |||
68 | static void radconf_fini (struct radconf *); | |||
69 | static struct authconf *authconf_find (const char *); | |||
70 | static void ipcpconf_init (struct ipcpconf *); | |||
71 | static void ipcpconf_fini (struct ipcpconf *); | |||
72 | static struct ipcpconf *ipcpconf_find (const char *); | |||
73 | static struct iface *iface_find (const char *); | |||
74 | static void sa_set_in_addr_any(struct sockaddr *); | |||
75 | ||||
76 | struct npppd_conf *conf; | |||
77 | struct ipcpconf *curr_ipcpconf; | |||
78 | struct tunnconf *curr_tunnconf; | |||
79 | struct authconf *curr_authconf; | |||
80 | struct radconf *curr_radconf; | |||
81 | ||||
82 | typedef struct { | |||
83 | union { | |||
84 | int64_t number; | |||
85 | char *string; | |||
86 | struct sockaddr_storage address; | |||
87 | struct in_addr in4_addr; | |||
88 | bool_Bool yesno; | |||
89 | } v; | |||
90 | int lineno; | |||
91 | } YYSTYPE; | |||
92 | ||||
93 | #line 94 "parse.c" | |||
94 | #define SET257 257 | |||
95 | #define MAX_SESSION258 258 | |||
96 | #define USER_MAX_SESSION259 259 | |||
97 | #define TUNNEL260 260 | |||
98 | #define LISTEN261 261 | |||
99 | #define ON262 262 | |||
100 | #define PROTOCOL263 263 | |||
101 | #define MRU264 264 | |||
102 | #define IP265 265 | |||
103 | #define LCP266 266 | |||
104 | #define PAP267 267 | |||
105 | #define CHAP268 268 | |||
106 | #define EAP269 269 | |||
107 | #define MPPE270 270 | |||
108 | #define CCP271 271 | |||
109 | #define MSCHAPV2272 272 | |||
110 | #define STATEFUL273 273 | |||
111 | #define STATELESS274 274 | |||
112 | #define REQUIRED275 275 | |||
113 | #define YES276 276 | |||
114 | #define NO277 277 | |||
115 | #define L2TP278 278 | |||
116 | #define PPTP279 279 | |||
117 | #define PPPOE280 280 | |||
118 | #define L2TP_HOSTNAME281 281 | |||
119 | #define L2TP_VENDOR_NAME282 282 | |||
120 | #define L2TP_DATA_USE_SEQ283 283 | |||
121 | #define L2TP_REQUIRE_IPSEC284 284 | |||
122 | #define L2TP_LCP_RENEGOTIATION285 285 | |||
123 | #define L2TP_FORCE_LCP_RENEGOTIATION286 286 | |||
124 | #define L2TP_CTRL_IN_PKTDUMP287 287 | |||
125 | #define L2TP_CTRL_OUT_PKTDUMP288 288 | |||
126 | #define L2TP_DATA_IN_PKTDUMP289 289 | |||
127 | #define L2TP_DATA_OUT_PKTDUMP290 290 | |||
128 | #define PPTP_HOSTNAME291 291 | |||
129 | #define PPTP_VENDOR_NAME292 292 | |||
130 | #define PPTP_ECHO_INTERVAL293 293 | |||
131 | #define PPTP_ECHO_TIMEOUT294 294 | |||
132 | #define PPTP_CTRL_IN_PKTDUMP295 295 | |||
133 | #define PPTP_CTRL_OUT_PKTDUMP296 296 | |||
134 | #define PPTP_DATA_IN_PKTDUMP297 297 | |||
135 | #define PPTP_DATA_OUT_PKTDUMP298 298 | |||
136 | #define PPPOE_SERVICE_NAME299 299 | |||
137 | #define PPPOE_ACCEPT_ANY_SERVICE300 300 | |||
138 | #define PPPOE_AC_NAME301 301 | |||
139 | #define PPPOE_DESC_IN_PKTDUMP302 302 | |||
140 | #define PPPOE_DESC_OUT_PKTDUMP303 303 | |||
141 | #define PPPOE_SESSION_IN_PKTDUMP304 304 | |||
142 | #define PPPOE_SESSION_OUT_PKTDUMP305 305 | |||
143 | #define LCP_TIMEOUT306 306 | |||
144 | #define LCP_MAX_CONFIGURE307 307 | |||
145 | #define LCP_MAX_TERMINATE308 308 | |||
146 | #define LCP_MAX_NAK_LOOP309 309 | |||
147 | #define LCP_KEEPALIVE310 310 | |||
148 | #define LCP_KEEPALIVE_INTERVAL311 311 | |||
149 | #define LCP_KEEPALIVE_RETRY_INTERVAL312 312 | |||
150 | #define LCP_KEEPALIVE_MAX_RETRIES313 313 | |||
151 | #define AUTHENTICATION_METHOD314 314 | |||
152 | #define CHAP_NAME315 315 | |||
153 | #define IPCP_TIMEOUT316 316 | |||
154 | #define IPCP_MAX_CONFIGURE317 317 | |||
155 | #define IPCP_MAX_TERMINATE318 318 | |||
156 | #define IPCP_MAX_NAK_LOOP319 319 | |||
157 | #define CCP_TIMEOUT320 320 | |||
158 | #define CCP_MAX_CONFIGURE321 321 | |||
159 | #define CCP_MAX_TERMINATE322 322 | |||
160 | #define CCP_MAX_NAK_LOOP323 323 | |||
161 | #define L2TP_HELLO_INTERVAL324 324 | |||
162 | #define L2TP_HELLO_TIMEOUT325 325 | |||
163 | #define L2TP_ACCEPT_DIALIN326 326 | |||
164 | #define MPPE_KEY_LENGTH327 327 | |||
165 | #define MPPE_KEY_STATE328 328 | |||
166 | #define IDLE_TIMEOUT329 329 | |||
167 | #define TCP_MSS_ADJUST330 330 | |||
168 | #define INGRESS_FILTER331 331 | |||
169 | #define CALLNUM_CHECK332 332 | |||
170 | #define PIPEX333 333 | |||
171 | #define DEBUG_DUMP_PKTIN334 334 | |||
172 | #define DEBUG_DUMP_PKTOUT335 335 | |||
173 | #define AUTHENTICATION336 336 | |||
174 | #define TYPE337 337 | |||
175 | #define LOCAL338 338 | |||
176 | #define USERNAME_SUFFIX339 339 | |||
177 | #define USERNAME_PREFIX340 340 | |||
178 | #define EAP_CAPABLE341 341 | |||
179 | #define STRIP_NT_DOMAIN342 342 | |||
180 | #define STRIP_ATMARK_REALM343 343 | |||
181 | #define USERS_FILE344 344 | |||
182 | #define RADIUS345 345 | |||
183 | #define AUTHENTICATION_SERVER346 346 | |||
184 | #define ACCOUNTING_SERVER347 347 | |||
185 | #define PORT348 348 | |||
186 | #define X_TIMEOUT349 349 | |||
187 | #define MAX_TRIES350 350 | |||
188 | #define MAX_FAILOVERS351 351 | |||
189 | #define SECRET352 352 | |||
190 | #define POOL_ADDRESS353 353 | |||
191 | #define DNS_SERVERS354 354 | |||
192 | #define NBNS_SERVERS355 355 | |||
193 | #define FOR356 356 | |||
194 | #define STATIC357 357 | |||
195 | #define DYNAMIC358 358 | |||
196 | #define RESOLVER359 359 | |||
197 | #define ALLOW_USER_SELECTED_ADDRESS360 360 | |||
198 | #define INTERFACE361 361 | |||
199 | #define ADDRESS362 362 | |||
200 | #define IPCP363 363 | |||
201 | #define BIND364 364 | |||
202 | #define FROM365 365 | |||
203 | #define AUTHENTICATED366 366 | |||
204 | #define BY367 367 | |||
205 | #define TO368 368 | |||
206 | #define ERROR369 369 | |||
207 | #define STRING370 370 | |||
208 | #define NUMBER371 371 | |||
209 | #define YYERRCODE256 256 | |||
210 | const short yylhs[] = | |||
211 | { -1, | |||
212 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, | |||
213 | 18, 25, 19, 24, 24, 27, 27, 27, 28, 28, | |||
214 | 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, | |||
215 | 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, | |||
216 | 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, | |||
217 | 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, | |||
218 | 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, | |||
219 | 28, 28, 28, 28, 28, 28, 28, 6, 6, 6, | |||
220 | 7, 7, 7, 2, 3, 5, 16, 16, 15, 15, | |||
221 | 15, 9, 9, 8, 11, 11, 10, 10, 13, 13, | |||
222 | 12, 12, 12, 12, 12, 12, 12, 12, 30, 20, | |||
223 | 31, 31, 31, 32, 32, 32, 32, 32, 32, 33, | |||
224 | 32, 35, 32, 4, 4, 14, 14, 34, 34, 34, | |||
225 | 36, 36, 36, 36, 37, 21, 38, 38, 38, 39, | |||
226 | 39, 39, 39, 39, 39, 39, 39, 17, 17, 17, | |||
227 | 22, 23, 1, 1, 26, 26, 29, | |||
228 | }; | |||
229 | const short yylen[] = | |||
230 | { 2, | |||
231 | 0, 2, 3, 3, 3, 3, 3, 3, 3, 3, | |||
232 | 3, 0, 6, 0, 4, 0, 3, 2, 3, 4, | |||
233 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |||
234 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |||
235 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |||
236 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |||
237 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |||
238 | 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, | |||
239 | 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, | |||
240 | 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, | |||
241 | 1, 1, 1, 1, 1, 1, 1, 1, 0, 9, | |||
242 | 0, 3, 2, 2, 2, 2, 2, 2, 2, 0, | |||
243 | 6, 0, 6, 0, 2, 1, 1, 0, 3, 2, | |||
244 | 5, 2, 2, 2, 0, 7, 0, 3, 2, 3, | |||
245 | 2, 3, 2, 3, 2, 2, 2, 0, 2, 2, | |||
246 | 6, 9, 1, 1, 2, 0, 2, | |||
247 | }; | |||
248 | const short yydefred[] = | |||
249 | { 1, | |||
250 | 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, | |||
251 | 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, | |||
252 | 0, 135, 0, 3, 4, 5, 6, 7, 8, 10, | |||
253 | 11, 0, 0, 0, 0, 0, 78, 79, 80, 12, | |||
254 | 126, 127, 109, 86, 0, 0, 0, 0, 0, 0, | |||
255 | 0, 0, 0, 0, 13, 0, 151, 155, 0, 0, | |||
256 | 0, 0, 0, 0, 0, 0, 0, 0, 147, 0, | |||
257 | 141, 0, 0, 153, 154, 146, 136, 0, 139, 0, | |||
258 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
259 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
260 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
261 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
262 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
263 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
264 | 0, 0, 0, 0, 0, 0, 120, 122, 0, 0, | |||
265 | 0, 140, 142, 144, 0, 138, 0, 0, 25, 83, | |||
266 | 81, 82, 68, 40, 41, 45, 46, 47, 48, 49, | |||
267 | 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, | |||
268 | 60, 61, 62, 63, 64, 65, 66, 67, 21, 22, | |||
269 | 23, 24, 26, 27, 28, 29, 89, 90, 91, 87, | |||
270 | 0, 31, 32, 33, 34, 35, 36, 37, 38, 39, | |||
271 | 42, 43, 44, 94, 92, 0, 97, 98, 95, 0, | |||
272 | 72, 71, 73, 74, 75, 101, 102, 103, 104, 105, | |||
273 | 106, 107, 108, 99, 0, 0, 15, 0, 18, 119, | |||
274 | 114, 115, 116, 117, 118, 0, 0, 110, 0, 113, | |||
275 | 150, 149, 157, 152, 0, 84, 0, 19, 88, 93, | |||
276 | 96, 100, 17, 0, 0, 112, 20, 0, 85, 0, | |||
277 | 0, 125, 0, 0, 0, 0, 0, 0, 0, 132, | |||
278 | 133, 134, 0, 121, 0, 130, 123, 0, 129, 0, | |||
279 | 131, | |||
280 | }; | |||
281 | const short yydgoto[] = | |||
282 | { 1, | |||
283 | 76, 257, 258, 269, 45, 40, 163, 215, 216, 219, | |||
284 | 220, 234, 235, 43, 200, 201, 152, 10, 11, 12, | |||
285 | 13, 14, 15, 55, 48, 52, 139, 140, 156, 49, | |||
286 | 149, 150, 246, 277, 247, 278, 35, 64, 65, | |||
287 | }; | |||
288 | const short yysindex[] = | |||
289 | { 0, | |||
290 | -10, 14, -249, -335, -321, -314, -311, -194, 0, 57, | |||
291 | 58, 60, 61, 62, 63, 0, -297, -296, -187, -259, | |||
292 | -285, 0, -286, 0, 0, 0, 0, 0, 0, 0, | |||
293 | 0, -240, -304, -290, -42, -288, 0, 0, 0, 0, | |||
294 | 0, 0, 0, 0, -280, 75, -276, -30, -28, -274, | |||
295 | 75, -256, -273, 75, 0, 75, 0, 0, -271, -269, | |||
296 | -344, -290, -225, -97, 75, -268, 424, -255, 0, -253, | |||
297 | 0, -290, -290, 0, 0, 0, 0, 95, 0, -262, | |||
298 | -155, -263, -230, -261, -258, -225, -225, -225, -225, -225, | |||
299 | -225, -225, -225, -257, -254, -252, -250, -225, -225, -225, | |||
300 | -225, -247, -225, -246, -225, -225, -225, -225, -245, -244, | |||
301 | -242, -241, -225, -239, -238, -237, -260, -234, -233, -232, | |||
302 | -231, -228, -226, -223, -222, -221, -219, -218, -225, -216, | |||
303 | -220, -215, -225, -225, -225, -225, -248, -248, 867, 75, | |||
304 | -214, -212, -225, -225, -225, -210, 0, 0, -124, 75, | |||
305 | -295, 0, 0, 0, 75, 0, -208, -334, 0, 0, | |||
306 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
307 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
308 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
309 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
310 | -260, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
311 | 0, 0, 0, 0, 0, -216, 0, 0, 0, -220, | |||
312 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
313 | 0, 0, 0, 0, -248, -248, 0, 95, 0, 0, | |||
314 | 0, 0, 0, 0, 0, -13, -9, 0, 95, 0, | |||
315 | 0, 0, 0, 0, -207, 0, -211, 0, 0, 0, | |||
316 | 0, 0, 0, 75, 75, 0, 0, -206, 0, -320, | |||
317 | -320, 0, -205, -204, -203, -201, -122, 75, -119, 0, | |||
318 | 0, 0, -211, 0, 95, 0, 0, -235, 0, -199, | |||
319 | 0,}; | |||
320 | const short yyrindex[] = | |||
321 | { 0, | |||
322 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
323 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
324 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
325 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
326 | 0, 0, 0, 0, 0, -88, 0, 108, 0, 0, | |||
327 | 732, -3, 0, 943, 0, -68, 0, 0, 0, 0, | |||
328 | 0, 0, 0, 0, -88, 0, 16, 17, 0, -5, | |||
329 | 0, 3, 6, 0, 0, 0, 0, 0, 0, 0, | |||
330 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
331 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
332 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
333 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
334 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
335 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 943, | |||
336 | 0, 0, 0, 0, 0, 0, 0, 0, 0, -68, | |||
337 | 0, 0, 0, 0, 732, 0, 0, 0, 0, 0, | |||
338 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
339 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
340 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
341 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
342 | 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
343 | 0, 0, 0, 0, 0, 176, 0, 0, 0, 252, | |||
344 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
345 | 0, 0, 0, 0, 579, 654, 0, 0, 0, 0, | |||
346 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
347 | 0, 0, 0, 0, 0, 0, 327, 0, 0, 0, | |||
348 | 0, 0, 0, -114, -114, 0, 0, 0, 0, 21, | |||
349 | 21, 0, 0, 0, 0, 0, 0, -114, 0, 0, | |||
350 | 0, 0, -227, 0, 0, 0, 0, 0, 0, 0, | |||
351 | 0,}; | |||
352 | const short yygindex[] = | |||
353 | { 0, | |||
354 | 199, -129, 0, -132, -29, 0, 0, -52, 0, -48, | |||
355 | 0, -171, 35, 0, -27, 0, 0, 0, 0, 0, | |||
356 | 0, 0, 0, 0, 0, 4, 0, 36, -224, 0, | |||
357 | 0, 27, 0, -94, 0, -229, 0, 0, 114, | |||
358 | }; | |||
359 | #define YYTABLESIZE1278 1278 | |||
360 | const short yytable[] = | |||
361 | { 9, | |||
362 | 248, 59, 284, 141, 148, 287, 197, 198, 17, 18, | |||
363 | 156, 199, 143, 263, 71, 145, 226, 227, 228, 229, | |||
364 | 230, 231, 232, 16, 266, 44, 255, 77, 273, 274, | |||
365 | 275, 72, 73, 41, 19, 256, 156, 37, 38, 39, | |||
366 | 42, 276, 153, 154, 160, 161, 162, 285, 20, 285, | |||
367 | 74, 75, 217, 218, 58, 21, 156, 67, 22, 68, | |||
368 | 289, 251, 252, 262, 262, 23, 24, 25, 79, 26, | |||
369 | 27, 28, 29, 30, 31, 32, 34, 33, 36, 44, | |||
370 | 46, 47, 50, 142, 51, 143, 144, 145, 146, 53, | |||
371 | 147, 148, 54, 66, 56, 57, 60, 61, 62, 69, | |||
372 | 70, 80, 151, 63, 155, 157, 158, 159, 164, 264, | |||
373 | 30, 165, 174, 265, 233, 175, 290, 14, 176, 148, | |||
374 | 177, 137, 182, 184, 124, 189, 190, 143, 191, 192, | |||
375 | 145, 194, 195, 196, 141, 202, 268, 203, 204, 205, | |||
376 | 16, 111, 206, 239, 207, 128, 283, 208, 209, 210, | |||
377 | 288, 211, 212, 250, 214, 221, 240, 241, 253, 245, | |||
378 | 59, 254, 267, 260, 272, 280, 281, 282, 256, 156, | |||
379 | 291, 261, 236, 259, 238, 249, 279, 78, 0, 0, | |||
380 | 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, | |||
381 | 156, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
382 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
383 | 0, 0, 0, 0, 142, 0, 143, 144, 145, 146, | |||
384 | 0, 147, 148, 0, 0, 30, 273, 274, 275, 273, | |||
385 | 274, 275, 0, 0, 156, 156, 156, 0, 0, 276, | |||
386 | 0, 0, 276, 0, 0, 2, 3, 156, 0, 4, | |||
387 | 0, 0, 148, 0, 0, 60, 61, 62, 0, 0, | |||
388 | 143, 70, 63, 145, 156, 156, 156, 270, 271, 0, | |||
389 | 156, 156, 156, 156, 156, 156, 0, 156, 156, 0, | |||
390 | 0, 286, 0, 0, 166, 167, 168, 169, 170, 171, | |||
391 | 172, 173, 0, 0, 0, 0, 178, 179, 180, 181, | |||
392 | 69, 183, 0, 185, 186, 187, 188, 0, 0, 0, | |||
393 | 0, 193, 0, 0, 0, 0, 0, 0, 0, 0, | |||
394 | 0, 0, 0, 0, 0, 5, 0, 213, 0, 0, | |||
395 | 0, 222, 223, 224, 225, 0, 124, 0, 0, 0, | |||
396 | 0, 242, 243, 244, 0, 0, 0, 148, 148, 148, | |||
397 | 6, 0, 7, 8, 148, 143, 143, 143, 145, 145, | |||
398 | 145, 30, 143, 0, 30, 145, 0, 0, 0, 0, | |||
399 | 30, 0, 0, 0, 0, 0, 70, 0, 0, 0, | |||
400 | 0, 30, 30, 30, 30, 30, 30, 30, 30, 30, | |||
401 | 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, | |||
402 | 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, | |||
403 | 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, | |||
404 | 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, | |||
405 | 30, 30, 30, 30, 30, 30, 69, 0, 0, 69, | |||
406 | 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, | |||
407 | 0, 124, 0, 0, 0, 0, 69, 69, 69, 69, | |||
408 | 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, | |||
409 | 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, | |||
410 | 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, | |||
411 | 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, | |||
412 | 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, | |||
413 | 69, 0, 70, 0, 0, 70, 0, 0, 0, 0, | |||
414 | 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, | |||
415 | 0, 0, 70, 70, 70, 70, 70, 70, 70, 70, | |||
416 | 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, | |||
417 | 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, | |||
418 | 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, | |||
419 | 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, | |||
420 | 70, 70, 70, 70, 70, 70, 70, 124, 76, 0, | |||
421 | 124, 0, 0, 0, 0, 0, 124, 0, 0, 0, | |||
422 | 0, 0, 0, 0, 0, 0, 0, 124, 124, 124, | |||
423 | 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, | |||
424 | 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, | |||
425 | 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, | |||
426 | 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, | |||
427 | 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, | |||
428 | 124, 124, 0, 77, 0, 0, 0, 0, 0, 0, | |||
429 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
430 | 0, 0, 0, 0, 81, 0, 0, 82, 0, 0, | |||
431 | 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, | |||
432 | 0, 0, 0, 76, 84, 85, 86, 87, 88, 89, | |||
433 | 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, | |||
434 | 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, | |||
435 | 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, | |||
436 | 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, | |||
437 | 130, 131, 132, 133, 134, 135, 136, 137, 138, 0, | |||
438 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
439 | 0, 0, 0, 0, 0, 0, 0, 0, 77, 0, | |||
440 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
441 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
442 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
443 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
444 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
445 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, | |||
446 | 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, | |||
447 | 0, 0, 0, 0, 0, 0, 156, 0, 0, 76, | |||
448 | 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, | |||
449 | 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, | |||
450 | 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, | |||
451 | 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, | |||
452 | 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, | |||
453 | 76, 76, 76, 76, 77, 0, 0, 77, 0, 0, | |||
454 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
455 | 0, 0, 0, 0, 77, 77, 77, 77, 77, 77, | |||
456 | 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, | |||
457 | 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, | |||
458 | 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, | |||
459 | 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, | |||
460 | 77, 77, 77, 77, 77, 77, 77, 77, 77, 156, | |||
461 | 156, 237, 156, 0, 0, 156, 0, 0, 0, 0, | |||
462 | 0, 156, 0, 0, 0, 0, 0, 0, 0, 0, | |||
463 | 0, 0, 156, 156, 156, 156, 156, 156, 156, 156, | |||
464 | 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, | |||
465 | 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, | |||
466 | 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, | |||
467 | 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, | |||
468 | 156, 156, 156, 156, 156, 156, 156, 156, 0, 0, | |||
469 | 156, 0, 156, 156, 156, 156, 0, 156, 156, 0, | |||
470 | 156, 156, 156, 0, 156, 156, 156, 0, 0, 0, | |||
471 | 0, 156, 0, 156, 0, 0, 0, 0, 0, 0, | |||
472 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
473 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |||
474 | 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, | |||
475 | 82, 0, 0, 0, 0, 0, 83, 0, 0, 0, | |||
476 | 0, 0, 0, 0, 0, 0, 0, 84, 85, 86, | |||
477 | 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, | |||
478 | 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, | |||
479 | 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, | |||
480 | 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, | |||
481 | 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, | |||
482 | 137, 138, 0, 156, 0, 0, 156, 0, 0, 0, | |||
483 | 0, 0, 156, 0, 0, 0, 0, 0, 0, 0, | |||
484 | 0, 0, 0, 156, 156, 156, 156, 156, 156, 156, | |||
485 | 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, | |||
486 | 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, | |||
487 | 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, | |||
488 | 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, | |||
489 | 156, 156, 156, 156, 156, 156, 156, 156, | |||
490 | }; | |||
491 | const short yycheck[] = | |||
492 | { 10, | |||
493 | 125, 258, 125, 259, 10, 125, 267, 268, 258, 259, | |||
494 | 125, 272, 10, 238, 359, 10, 265, 266, 267, 268, | |||
495 | 269, 270, 271, 10, 249, 370, 361, 125, 349, 350, | |||
496 | 351, 61, 62, 338, 370, 370, 125, 278, 279, 280, | |||
497 | 345, 362, 72, 73, 275, 276, 277, 277, 370, 279, | |||
498 | 276, 277, 273, 274, 51, 370, 125, 54, 370, 56, | |||
499 | 285, 357, 358, 235, 236, 260, 10, 10, 65, 10, | |||
500 | 10, 10, 10, 371, 371, 263, 362, 337, 365, 370, | |||
501 | 123, 370, 363, 339, 10, 341, 342, 343, 344, 366, | |||
502 | 346, 347, 123, 367, 123, 370, 353, 354, 355, 371, | |||
503 | 370, 370, 356, 360, 10, 368, 262, 371, 370, 123, | |||
504 | 10, 370, 370, 123, 363, 370, 352, 10, 371, 125, | |||
505 | 371, 125, 370, 370, 352, 371, 371, 125, 371, 371, | |||
506 | 125, 371, 371, 371, 259, 370, 348, 371, 371, 371, | |||
507 | 125, 125, 371, 140, 371, 125, 276, 371, 371, 371, | |||
508 | 283, 371, 371, 150, 371, 371, 371, 370, 155, 370, | |||
509 | 258, 370, 370, 216, 371, 371, 371, 371, 370, 258, | |||
510 | 370, 220, 138, 201, 139, 149, 271, 64, -1, -1, | |||
511 | -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, | |||
512 | 259, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |||
513 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |||
514 | -1, -1, -1, -1, 339, -1, 341, 342, 343, 344, | |||
515 | -1, 346, 347, -1, -1, 125, 349, 350, 351, 349, | |||
516 | 350, 351, -1, -1, 349, 350, 351, -1, -1, 362, | |||
517 | -1, -1, 362, -1, -1, 256, 257, 362, -1, 260, | |||
518 | -1, -1, 258, -1, -1, 353, 354, 355, -1, -1, | |||
519 | 258, 10, 360, 258, 353, 354, 355, 264, 265, -1, | |||
520 | 339, 360, 341, 342, 343, 344, -1, 346, 347, -1, | |||
521 | -1, 278, -1, -1, 86, 87, 88, 89, 90, 91, | |||
522 | 92, 93, -1, -1, -1, -1, 98, 99, 100, 101, | |||
523 | 125, 103, -1, 105, 106, 107, 108, -1, -1, -1, | |||
524 | -1, 113, -1, -1, -1, -1, -1, -1, -1, -1, | |||
525 | -1, -1, -1, -1, -1, 336, -1, 129, -1, -1, | |||
526 | -1, 133, 134, 135, 136, -1, 10, -1, -1, -1, | |||
527 | -1, 143, 144, 145, -1, -1, -1, 353, 354, 355, | |||
528 | 361, -1, 363, 364, 360, 353, 354, 355, 353, 354, | |||
529 | 355, 261, 360, -1, 264, 360, -1, -1, -1, -1, | |||
530 | 270, -1, -1, -1, -1, -1, 125, -1, -1, -1, | |||
531 | -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, | |||
532 | 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, | |||
533 | 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, | |||
534 | 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, | |||
535 | 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, | |||
536 | 330, 331, 332, 333, 334, 335, 261, -1, -1, 264, | |||
537 | -1, -1, -1, -1, -1, 270, -1, -1, -1, -1, | |||
538 | -1, 125, -1, -1, -1, -1, 281, 282, 283, 284, | |||
539 | 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, | |||
540 | 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, | |||
541 | 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, | |||
542 | 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, | |||
543 | 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, | |||
544 | 335, -1, 261, -1, -1, 264, -1, -1, -1, -1, | |||
545 | -1, 270, -1, -1, -1, -1, -1, -1, -1, -1, | |||
546 | -1, -1, 281, 282, 283, 284, 285, 286, 287, 288, | |||
547 | 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, | |||
548 | 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, | |||
549 | 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, | |||
550 | 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, | |||
551 | 329, 330, 331, 332, 333, 334, 335, 261, 10, -1, | |||
552 | 264, -1, -1, -1, -1, -1, 270, -1, -1, -1, | |||
553 | -1, -1, -1, -1, -1, -1, -1, 281, 282, 283, | |||
554 | 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, | |||
555 | 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, | |||
556 | 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, | |||
557 | 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, | |||
558 | 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, | |||
559 | 334, 335, -1, 10, -1, -1, -1, -1, -1, -1, | |||
560 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |||
561 | -1, -1, -1, -1, 261, -1, -1, 264, -1, -1, | |||
562 | -1, -1, -1, 270, -1, -1, -1, -1, -1, -1, | |||
563 | -1, -1, -1, 125, 281, 282, 283, 284, 285, 286, | |||
564 | 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, | |||
565 | 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, | |||
566 | 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, | |||
567 | 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, | |||
568 | 327, 328, 329, 330, 331, 332, 333, 334, 335, -1, | |||
569 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |||
570 | -1, -1, -1, -1, -1, -1, -1, -1, 125, -1, | |||
571 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |||
572 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |||
573 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |||
574 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |||
575 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |||
576 | -1, -1, -1, -1, -1, -1, -1, -1, -1, 261, | |||
577 | -1, -1, 264, -1, -1, -1, -1, -1, -1, -1, | |||
578 | -1, -1, -1, -1, -1, -1, 125, -1, -1, 281, | |||
579 | 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, | |||
580 | 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, | |||
581 | 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, | |||
582 | 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, | |||
583 | 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, | |||
584 | 332, 333, 334, 335, 261, -1, -1, 264, -1, -1, | |||
585 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |||
586 | -1, -1, -1, -1, 281, 282, 283, 284, 285, 286, | |||
587 | 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, | |||
588 | 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, | |||
589 | 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, | |||
590 | 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, | |||
591 | 327, 328, 329, 330, 331, 332, 333, 334, 335, 258, | |||
592 | 259, 125, 261, -1, -1, 264, -1, -1, -1, -1, | |||
593 | -1, 270, -1, -1, -1, -1, -1, -1, -1, -1, | |||
594 | -1, -1, 281, 282, 283, 284, 285, 286, 287, 288, | |||
595 | 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, | |||
596 | 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, | |||
597 | 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, | |||
598 | 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, | |||
599 | 329, 330, 331, 332, 333, 334, 335, 125, -1, -1, | |||
600 | 339, -1, 341, 342, 343, 344, -1, 346, 347, -1, | |||
601 | 349, 350, 351, -1, 353, 354, 355, -1, -1, -1, | |||
602 | -1, 360, -1, 362, -1, -1, -1, -1, -1, -1, | |||
603 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |||
604 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |||
605 | -1, -1, -1, -1, -1, -1, -1, 261, -1, -1, | |||
606 | 264, -1, -1, -1, -1, -1, 270, -1, -1, -1, | |||
607 | -1, -1, -1, -1, -1, -1, -1, 281, 282, 283, | |||
608 | 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, | |||
609 | 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, | |||
610 | 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, | |||
611 | 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, | |||
612 | 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, | |||
613 | 334, 335, -1, 261, -1, -1, 264, -1, -1, -1, | |||
614 | -1, -1, 270, -1, -1, -1, -1, -1, -1, -1, | |||
615 | -1, -1, -1, 281, 282, 283, 284, 285, 286, 287, | |||
616 | 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, | |||
617 | 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, | |||
618 | 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, | |||
619 | 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, | |||
620 | 328, 329, 330, 331, 332, 333, 334, 335, | |||
621 | }; | |||
622 | #define YYFINAL1 1 | |||
623 | #ifndef YYDEBUG0 | |||
624 | #define YYDEBUG0 0 | |||
625 | #endif | |||
626 | #define YYMAXTOKEN371 371 | |||
627 | #if YYDEBUG0 | |||
628 | const char * const yyname[] = | |||
629 | { | |||
630 | "end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | |||
631 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | |||
632 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | |||
633 | 0,0,0,0,0,0,0,0,0,0,0,0,"'{'",0,"'}'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | |||
634 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | |||
635 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | |||
636 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"SET","MAX_SESSION", | |||
637 | "USER_MAX_SESSION","TUNNEL","LISTEN","ON","PROTOCOL","MRU","IP","LCP","PAP", | |||
638 | "CHAP","EAP","MPPE","CCP","MSCHAPV2","STATEFUL","STATELESS","REQUIRED","YES", | |||
639 | "NO","L2TP","PPTP","PPPOE","L2TP_HOSTNAME","L2TP_VENDOR_NAME", | |||
640 | "L2TP_DATA_USE_SEQ","L2TP_REQUIRE_IPSEC","L2TP_LCP_RENEGOTIATION", | |||
641 | "L2TP_FORCE_LCP_RENEGOTIATION","L2TP_CTRL_IN_PKTDUMP","L2TP_CTRL_OUT_PKTDUMP", | |||
642 | "L2TP_DATA_IN_PKTDUMP","L2TP_DATA_OUT_PKTDUMP","PPTP_HOSTNAME", | |||
643 | "PPTP_VENDOR_NAME","PPTP_ECHO_INTERVAL","PPTP_ECHO_TIMEOUT", | |||
644 | "PPTP_CTRL_IN_PKTDUMP","PPTP_CTRL_OUT_PKTDUMP","PPTP_DATA_IN_PKTDUMP", | |||
645 | "PPTP_DATA_OUT_PKTDUMP","PPPOE_SERVICE_NAME","PPPOE_ACCEPT_ANY_SERVICE", | |||
646 | "PPPOE_AC_NAME","PPPOE_DESC_IN_PKTDUMP","PPPOE_DESC_OUT_PKTDUMP", | |||
647 | "PPPOE_SESSION_IN_PKTDUMP","PPPOE_SESSION_OUT_PKTDUMP","LCP_TIMEOUT", | |||
648 | "LCP_MAX_CONFIGURE","LCP_MAX_TERMINATE","LCP_MAX_NAK_LOOP","LCP_KEEPALIVE", | |||
649 | "LCP_KEEPALIVE_INTERVAL","LCP_KEEPALIVE_RETRY_INTERVAL", | |||
650 | "LCP_KEEPALIVE_MAX_RETRIES","AUTHENTICATION_METHOD","CHAP_NAME","IPCP_TIMEOUT", | |||
651 | "IPCP_MAX_CONFIGURE","IPCP_MAX_TERMINATE","IPCP_MAX_NAK_LOOP","CCP_TIMEOUT", | |||
652 | "CCP_MAX_CONFIGURE","CCP_MAX_TERMINATE","CCP_MAX_NAK_LOOP", | |||
653 | "L2TP_HELLO_INTERVAL","L2TP_HELLO_TIMEOUT","L2TP_ACCEPT_DIALIN", | |||
654 | "MPPE_KEY_LENGTH","MPPE_KEY_STATE","IDLE_TIMEOUT","TCP_MSS_ADJUST", | |||
655 | "INGRESS_FILTER","CALLNUM_CHECK","PIPEX","DEBUG_DUMP_PKTIN","DEBUG_DUMP_PKTOUT", | |||
656 | "AUTHENTICATION","TYPE","LOCAL","USERNAME_SUFFIX","USERNAME_PREFIX", | |||
657 | "EAP_CAPABLE","STRIP_NT_DOMAIN","STRIP_ATMARK_REALM","USERS_FILE","RADIUS", | |||
658 | "AUTHENTICATION_SERVER","ACCOUNTING_SERVER","PORT","X_TIMEOUT","MAX_TRIES", | |||
659 | "MAX_FAILOVERS","SECRET","POOL_ADDRESS","DNS_SERVERS","NBNS_SERVERS","FOR", | |||
660 | "STATIC","DYNAMIC","RESOLVER","ALLOW_USER_SELECTED_ADDRESS","INTERFACE", | |||
661 | "ADDRESS","IPCP","BIND","FROM","AUTHENTICATED","BY","TO","ERROR","STRING", | |||
662 | "NUMBER", | |||
663 | }; | |||
664 | const char * const yyrule[] = | |||
665 | {"$accept : grammar", | |||
666 | "grammar :", | |||
667 | "grammar : grammar '\\n'", | |||
668 | "grammar : grammar set '\\n'", | |||
669 | "grammar : grammar tunnel '\\n'", | |||
670 | "grammar : grammar authentication '\\n'", | |||
671 | "grammar : grammar ipcp '\\n'", | |||
672 | "grammar : grammar interface '\\n'", | |||
673 | "grammar : grammar bind '\\n'", | |||
674 | "grammar : grammar error '\\n'", | |||
675 | "set : SET MAX_SESSION NUMBER", | |||
676 | "set : SET USER_MAX_SESSION NUMBER", | |||
677 | "$$1 :", | |||
678 | "tunnel : TUNNEL STRING PROTOCOL tunnelproto $$1 tunnopts", | |||
679 | "tunnopts :", | |||
680 | "tunnopts : '{' optnl tunnopt_l '}'", | |||
681 | "tunnopt_l :", | |||
682 | "tunnopt_l : tunnopt_l tunnopt nl", | |||
683 | "tunnopt_l : tunnopt optnl", | |||
684 | "tunnopt : LISTEN ON addressport", | |||
685 | "tunnopt : LISTEN ON INTERFACE STRING", | |||
686 | "tunnopt : LCP_TIMEOUT NUMBER", | |||
687 | "tunnopt : LCP_MAX_CONFIGURE NUMBER", | |||
688 | "tunnopt : LCP_MAX_TERMINATE NUMBER", | |||
689 | "tunnopt : LCP_MAX_NAK_LOOP NUMBER", | |||
690 | "tunnopt : MRU NUMBER", | |||
691 | "tunnopt : LCP_KEEPALIVE yesno", | |||
692 | "tunnopt : LCP_KEEPALIVE_INTERVAL NUMBER", | |||
693 | "tunnopt : LCP_KEEPALIVE_RETRY_INTERVAL NUMBER", | |||
694 | "tunnopt : LCP_KEEPALIVE_MAX_RETRIES NUMBER", | |||
695 | "tunnopt : AUTHENTICATION_METHOD authmethod_l", | |||
696 | "tunnopt : CHAP_NAME STRING", | |||
697 | "tunnopt : IPCP_TIMEOUT NUMBER", | |||
698 | "tunnopt : IPCP_MAX_CONFIGURE NUMBER", | |||
699 | "tunnopt : IPCP_MAX_TERMINATE NUMBER", | |||
700 | "tunnopt : IPCP_MAX_NAK_LOOP NUMBER", | |||
701 | "tunnopt : CCP_TIMEOUT NUMBER", | |||
702 | "tunnopt : CCP_MAX_CONFIGURE NUMBER", | |||
703 | "tunnopt : CCP_MAX_TERMINATE NUMBER", | |||
704 | "tunnopt : CCP_MAX_NAK_LOOP NUMBER", | |||
705 | "tunnopt : L2TP_HOSTNAME STRING", | |||
706 | "tunnopt : L2TP_VENDOR_NAME STRING", | |||
707 | "tunnopt : L2TP_HELLO_INTERVAL NUMBER", | |||
708 | "tunnopt : L2TP_HELLO_TIMEOUT NUMBER", | |||
709 | "tunnopt : L2TP_ACCEPT_DIALIN yesno", | |||
710 | "tunnopt : L2TP_DATA_USE_SEQ yesno", | |||
711 | "tunnopt : L2TP_REQUIRE_IPSEC yesno", | |||
712 | "tunnopt : L2TP_LCP_RENEGOTIATION yesno", | |||
713 | "tunnopt : L2TP_FORCE_LCP_RENEGOTIATION yesno", | |||
714 | "tunnopt : L2TP_CTRL_IN_PKTDUMP yesno", | |||
715 | "tunnopt : L2TP_CTRL_OUT_PKTDUMP yesno", | |||
716 | "tunnopt : L2TP_DATA_IN_PKTDUMP yesno", | |||
717 | "tunnopt : L2TP_DATA_OUT_PKTDUMP yesno", | |||
718 | "tunnopt : PPTP_HOSTNAME STRING", | |||
719 | "tunnopt : PPTP_VENDOR_NAME STRING", | |||
720 | "tunnopt : PPTP_ECHO_INTERVAL NUMBER", | |||
721 | "tunnopt : PPTP_ECHO_TIMEOUT NUMBER", | |||
722 | "tunnopt : PPTP_CTRL_IN_PKTDUMP yesno", | |||
723 | "tunnopt : PPTP_CTRL_OUT_PKTDUMP yesno", | |||
724 | "tunnopt : PPTP_DATA_IN_PKTDUMP yesno", | |||
725 | "tunnopt : PPTP_DATA_OUT_PKTDUMP yesno", | |||
726 | "tunnopt : PPPOE_SERVICE_NAME STRING", | |||
727 | "tunnopt : PPPOE_ACCEPT_ANY_SERVICE yesno", | |||
728 | "tunnopt : PPPOE_AC_NAME STRING", | |||
729 | "tunnopt : PPPOE_DESC_IN_PKTDUMP yesno", | |||
730 | "tunnopt : PPPOE_DESC_OUT_PKTDUMP yesno", | |||
731 | "tunnopt : PPPOE_SESSION_IN_PKTDUMP yesno", | |||
732 | "tunnopt : PPPOE_SESSION_OUT_PKTDUMP yesno", | |||
733 | "tunnopt : MPPE mppeyesno", | |||
734 | "tunnopt : MPPE_KEY_LENGTH mppekeylen_l", | |||
735 | "tunnopt : MPPE_KEY_STATE mppekeystate_l", | |||
736 | "tunnopt : TCP_MSS_ADJUST yesno", | |||
737 | "tunnopt : IDLE_TIMEOUT NUMBER", | |||
738 | "tunnopt : INGRESS_FILTER yesno", | |||
739 | "tunnopt : CALLNUM_CHECK yesno", | |||
740 | "tunnopt : PIPEX yesno", | |||
741 | "tunnopt : DEBUG_DUMP_PKTIN protobit_l", | |||
742 | "tunnopt : DEBUG_DUMP_PKTOUT protobit_l", | |||
743 | "tunnelproto : L2TP", | |||
744 | "tunnelproto : PPTP", | |||
745 | "tunnelproto : PPPOE", | |||
746 | "mppeyesno : YES", | |||
747 | "mppeyesno : NO", | |||
748 | "mppeyesno : REQUIRED", | |||
749 | "address : STRING", | |||
750 | "addressport : address optport", | |||
751 | "in4_addr : STRING", | |||
752 | "authmethod_l : authmethod", | |||
753 | "authmethod_l : authmethod_l authmethod", | |||
754 | "authmethod : PAP", | |||
755 | "authmethod : CHAP", | |||
756 | "authmethod : MSCHAPV2", | |||
757 | "mppekeylen_l : mppekeylen", | |||
758 | "mppekeylen_l : mppekeylen_l mppekeylen", | |||
759 | "mppekeylen : NUMBER", | |||
760 | "mppekeystate_l : mppekeystate", | |||
761 | "mppekeystate_l : mppekeystate_l mppekeystate", | |||
762 | "mppekeystate : STATEFUL", | |||
763 | "mppekeystate : STATELESS", | |||
764 | "protobit_l : protobit", | |||
765 | "protobit_l : protobit_l protobit", | |||
766 | "protobit : IP", | |||
767 | "protobit : LCP", | |||
768 | "protobit : PAP", | |||
769 | "protobit : CHAP", | |||
770 | "protobit : EAP", | |||
771 | "protobit : MPPE", | |||
772 | "protobit : CCP", | |||
773 | "protobit : IPCP", | |||
774 | "$$2 :", | |||
775 | "authentication : AUTHENTICATION STRING TYPE authtype $$2 '{' optnl authopt_l '}'", | |||
776 | "authopt_l :", | |||
777 | "authopt_l : authopt_l authopt nl", | |||
778 | "authopt_l : authopt optnl", | |||
779 | "authopt : USERNAME_SUFFIX STRING", | |||
780 | "authopt : EAP_CAPABLE yesno", | |||
781 | "authopt : STRIP_NT_DOMAIN yesno", | |||
782 | "authopt : STRIP_ATMARK_REALM yesno", | |||
783 | "authopt : USERS_FILE STRING", | |||
784 | "authopt : USER_MAX_SESSION NUMBER", | |||
785 | "$$3 :", | |||
786 | "authopt : AUTHENTICATION_SERVER $$3 '{' optnl radopt_l '}'", | |||
787 | "$$4 :", | |||
788 | "authopt : ACCOUNTING_SERVER $$4 '{' optnl radopt_l '}'", | |||
789 | "optport :", | |||
790 | "optport : PORT NUMBER", | |||
791 | "authtype : LOCAL", | |||
792 | "authtype : RADIUS", | |||
793 | "radopt_l :", | |||
794 | "radopt_l : radopt_l radopt nl", | |||
795 | "radopt_l : radopt optnl", | |||
796 | "radopt : ADDRESS address optport SECRET STRING", | |||
797 | "radopt : X_TIMEOUT NUMBER", | |||
798 | "radopt : MAX_TRIES NUMBER", | |||
799 | "radopt : MAX_FAILOVERS NUMBER", | |||
800 | "$$5 :", | |||
801 | "ipcp : IPCP STRING $$5 '{' optnl ipcpopt_l '}'", | |||
802 | "ipcpopt_l :", | |||
803 | "ipcpopt_l : ipcpopt_l ipcpopt nl", | |||
804 | "ipcpopt_l : ipcpopt optnl", | |||
805 | "ipcpopt : POOL_ADDRESS STRING ipcppooltype", | |||
806 | "ipcpopt : DNS_SERVERS RESOLVER", | |||
807 | "ipcpopt : DNS_SERVERS in4_addr in4_addr", | |||
808 | "ipcpopt : DNS_SERVERS in4_addr", | |||
809 | "ipcpopt : NBNS_SERVERS in4_addr in4_addr", | |||
810 | "ipcpopt : NBNS_SERVERS in4_addr", | |||
811 | "ipcpopt : ALLOW_USER_SELECTED_ADDRESS yesno", | |||
812 | "ipcpopt : MAX_SESSION NUMBER", | |||
813 | "ipcppooltype :", | |||
814 | "ipcppooltype : FOR DYNAMIC", | |||
815 | "ipcppooltype : FOR STATIC", | |||
816 | "interface : INTERFACE STRING ADDRESS in4_addr IPCP STRING", | |||
817 | "bind : BIND TUNNEL FROM STRING AUTHENTICATED BY STRING TO STRING", | |||
818 | "yesno : YES", | |||
819 | "yesno : NO", | |||
820 | "optnl : '\\n' optnl", | |||
821 | "optnl :", | |||
822 | "nl : '\\n' optnl", | |||
823 | }; | |||
824 | #endif | |||
825 | #ifdef YYSTACKSIZE10000 | |||
826 | #undef YYMAXDEPTH10000 | |||
827 | #define YYMAXDEPTH10000 YYSTACKSIZE10000 | |||
828 | #else | |||
829 | #ifdef YYMAXDEPTH10000 | |||
830 | #define YYSTACKSIZE10000 YYMAXDEPTH10000 | |||
831 | #else | |||
832 | #define YYSTACKSIZE10000 10000 | |||
833 | #define YYMAXDEPTH10000 10000 | |||
834 | #endif | |||
835 | #endif | |||
836 | #define YYINITSTACKSIZE200 200 | |||
837 | /* LINTUSED */ | |||
838 | int yydebug; | |||
839 | int yynerrs; | |||
840 | int yyerrflag; | |||
841 | int yychar; | |||
842 | short *yyssp; | |||
843 | YYSTYPE *yyvsp; | |||
844 | YYSTYPE yyval; | |||
845 | YYSTYPE yylval; | |||
846 | short *yyss; | |||
847 | short *yysslim; | |||
848 | YYSTYPE *yyvs; | |||
849 | unsigned int yystacksize; | |||
850 | int yyparse(void); | |||
851 | #line 953 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
852 | ||||
853 | struct keywords { | |||
854 | const char *k_name; | |||
855 | int k_val; | |||
856 | }; | |||
857 | ||||
858 | int | |||
859 | yyerror(const char *fmt, ...) | |||
860 | { | |||
861 | va_list ap; | |||
862 | char *msg; | |||
863 | ||||
864 | file->errors++; | |||
865 | va_start(ap, fmt)__builtin_va_start(ap, fmt); | |||
866 | if (vasprintf(&msg, fmt, ap) == -1) | |||
867 | fatalx("yyerror vasprintf"); | |||
868 | va_end(ap)__builtin_va_end(ap); | |||
869 | logit(LOG_CRIT2, "%s:%d: %s", file->name, yylval.lineno, msg); | |||
870 | free(msg); | |||
871 | return (0); | |||
872 | } | |||
873 | ||||
874 | int | |||
875 | kw_cmp(const void *k, const void *e) | |||
876 | { | |||
877 | return (strcmp(k, ((const struct keywords *)e)->k_name)); | |||
878 | } | |||
879 | ||||
880 | int | |||
881 | lookup(char *s) | |||
882 | { | |||
883 | /* this has to be sorted always */ | |||
884 | static const struct keywords keywords[] = { | |||
885 | { "accounting-server", ACCOUNTING_SERVER347}, | |||
886 | { "address", ADDRESS362}, | |||
887 | { "allow-user-selected-address", ALLOW_USER_SELECTED_ADDRESS360}, | |||
888 | { "authenticated", AUTHENTICATED366}, | |||
889 | { "authentication", AUTHENTICATION336}, | |||
890 | { "authentication-method", AUTHENTICATION_METHOD314}, | |||
891 | { "authentication-server", AUTHENTICATION_SERVER346}, | |||
892 | { "bind", BIND364}, | |||
893 | { "by", BY367}, | |||
894 | { "callnum-check", CALLNUM_CHECK332}, | |||
895 | { "ccp", CCP271}, | |||
896 | { "ccp-max-configure", CCP_MAX_CONFIGURE321}, | |||
897 | { "ccp-max-nak-loop", CCP_MAX_NAK_LOOP323}, | |||
898 | { "ccp-max-terminate", CCP_MAX_TERMINATE322}, | |||
899 | { "ccp-timeout", CCP_TIMEOUT320}, | |||
900 | { "chap", CHAP268}, | |||
901 | { "chap-name", CHAP_NAME315}, | |||
902 | { "debug-dump-pktin", DEBUG_DUMP_PKTIN334}, | |||
903 | { "debug-dump-pktout", DEBUG_DUMP_PKTOUT335}, | |||
904 | { "dns-servers", DNS_SERVERS354}, | |||
905 | { "dynamic", DYNAMIC358}, | |||
906 | { "eap", EAP269}, | |||
907 | { "eap-capable", EAP_CAPABLE341}, | |||
908 | { "for", FOR356}, | |||
909 | { "from", FROM365}, | |||
910 | { "idle-timeout", IDLE_TIMEOUT329}, | |||
911 | { "ingress-filter", INGRESS_FILTER331}, | |||
912 | { "interface", INTERFACE361}, | |||
913 | { "ip", IP265}, | |||
914 | { "ipcp", IPCP363}, | |||
915 | { "ipcp-max-configure", IPCP_MAX_CONFIGURE317}, | |||
916 | { "ipcp-max-nak-loop", IPCP_MAX_NAK_LOOP319}, | |||
917 | { "ipcp-max-terminate", IPCP_MAX_TERMINATE318}, | |||
918 | { "ipcp-timeout", IPCP_TIMEOUT316}, | |||
919 | { "l2tp", L2TP278}, | |||
920 | { "l2tp-accept-dialin", L2TP_ACCEPT_DIALIN326}, | |||
921 | { "l2tp-ctrl-in-pktdump", L2TP_CTRL_IN_PKTDUMP287}, | |||
922 | { "l2tp-ctrl-out-pktdump", L2TP_CTRL_OUT_PKTDUMP288}, | |||
923 | { "l2tp-data-in-pktdump", L2TP_DATA_IN_PKTDUMP289}, | |||
924 | { "l2tp-data-out-pktdump", L2TP_DATA_OUT_PKTDUMP290}, | |||
925 | { "l2tp-data-use-seq", L2TP_DATA_USE_SEQ283}, | |||
926 | { "l2tp-force-lcp-renegotiation", L2TP_FORCE_LCP_RENEGOTIATION286}, | |||
927 | { "l2tp-hello-interval", L2TP_HELLO_INTERVAL324}, | |||
928 | { "l2tp-hello-timeout", L2TP_HELLO_TIMEOUT325}, | |||
929 | { "l2tp-hostname", L2TP_HOSTNAME281}, | |||
930 | { "l2tp-lcp-renegotiation", L2TP_LCP_RENEGOTIATION285}, | |||
931 | { "l2tp-require-ipsec", L2TP_REQUIRE_IPSEC284}, | |||
932 | { "l2tp-vendor-name", L2TP_VENDOR_NAME282}, | |||
933 | { "lcp", LCP266}, | |||
934 | { "lcp-keepalive", LCP_KEEPALIVE310}, | |||
935 | { "lcp-keepalive-interval", LCP_KEEPALIVE_INTERVAL311}, | |||
936 | { "lcp-keepalive-max-retries", LCP_KEEPALIVE_MAX_RETRIES313 }, | |||
937 | { "lcp-keepalive-retry-interval", LCP_KEEPALIVE_RETRY_INTERVAL312}, | |||
938 | { "lcp-max-configure", LCP_MAX_CONFIGURE307}, | |||
939 | { "lcp-max-nak-loop", LCP_MAX_NAK_LOOP309}, | |||
940 | { "lcp-max-terminate", LCP_MAX_TERMINATE308}, | |||
941 | { "lcp-timeout", LCP_TIMEOUT306}, | |||
942 | { "listen", LISTEN261}, | |||
943 | { "local", LOCAL338}, | |||
944 | { "max-failovers", MAX_FAILOVERS351}, | |||
945 | { "max-session", MAX_SESSION258}, | |||
946 | { "max-tries", MAX_TRIES350}, | |||
947 | { "mppe", MPPE270}, | |||
948 | { "mppe-key-length", MPPE_KEY_LENGTH327}, | |||
949 | { "mppe-key-state", MPPE_KEY_STATE328}, | |||
950 | { "mru", MRU264}, | |||
951 | { "mschapv2", MSCHAPV2272}, | |||
952 | { "nbns-servers", NBNS_SERVERS355}, | |||
953 | { "no", NO277}, | |||
954 | { "on", ON262}, | |||
955 | { "pap", PAP267}, | |||
956 | { "pipex", PIPEX333}, | |||
957 | { "pool-address", POOL_ADDRESS353}, | |||
958 | { "port", PORT348}, | |||
959 | { "pppoe", PPPOE280}, | |||
960 | { "pppoe-ac-name", PPPOE_AC_NAME301}, | |||
961 | { "pppoe-accept-any-service", PPPOE_ACCEPT_ANY_SERVICE300}, | |||
962 | { "pppoe-desc-in-pktdump", PPPOE_DESC_IN_PKTDUMP302}, | |||
963 | { "pppoe-desc-out-pktdump", PPPOE_DESC_OUT_PKTDUMP303}, | |||
964 | { "pppoe-service-name", PPPOE_SERVICE_NAME299}, | |||
965 | { "pppoe-session-in-pktdump", PPPOE_SESSION_IN_PKTDUMP304}, | |||
966 | { "pppoe-session-out-pktdump", PPPOE_SESSION_OUT_PKTDUMP305}, | |||
967 | { "pptp", PPTP279}, | |||
968 | { "pptp-ctrl-in-pktdump", PPTP_CTRL_IN_PKTDUMP295}, | |||
969 | { "pptp-ctrl-out-pktdump", PPTP_CTRL_OUT_PKTDUMP296}, | |||
970 | { "pptp-data-in-pktdump", PPTP_DATA_IN_PKTDUMP297}, | |||
971 | { "pptp-data-out-pktdump", PPTP_DATA_OUT_PKTDUMP298}, | |||
972 | { "pptp-echo-interval", PPTP_ECHO_INTERVAL293}, | |||
973 | { "pptp-echo-timeout", PPTP_ECHO_TIMEOUT294}, | |||
974 | { "pptp-hostname", PPTP_HOSTNAME291}, | |||
975 | { "pptp-vendor-name", PPTP_VENDOR_NAME292}, | |||
976 | { "protocol", PROTOCOL263}, | |||
977 | { "radius", RADIUS345}, | |||
978 | { "required", REQUIRED275}, | |||
979 | { "resolver", RESOLVER359}, | |||
980 | { "secret", SECRET352}, | |||
981 | { "set", SET257}, | |||
982 | { "stateful", STATEFUL273}, | |||
983 | { "stateless", STATELESS274}, | |||
984 | { "static", STATIC357}, | |||
985 | { "strip-atmark-realm", STRIP_ATMARK_REALM343}, | |||
986 | { "strip-nt-domain", STRIP_NT_DOMAIN342}, | |||
987 | { "tcp-mss-adjust", TCP_MSS_ADJUST330}, | |||
988 | { "timeout", X_TIMEOUT349}, | |||
989 | { "to", TO368}, | |||
990 | { "tunnel", TUNNEL260}, | |||
991 | { "type", TYPE337}, | |||
992 | { "user-max-session", USER_MAX_SESSION259}, | |||
993 | { "username-suffix", USERNAME_SUFFIX339}, | |||
994 | { "users-file", USERS_FILE344}, | |||
995 | { "yes", YES276} | |||
996 | }; | |||
997 | const struct keywords *p; | |||
998 | ||||
999 | p = bsearch(s, keywords, sizeof(keywords)/sizeof(keywords[0]), | |||
1000 | sizeof(keywords[0]), kw_cmp); | |||
1001 | ||||
1002 | if (p) | |||
1003 | return (p->k_val); | |||
1004 | else | |||
1005 | return (STRING370); | |||
1006 | } | |||
1007 | ||||
1008 | #define MAXPUSHBACK128 128 | |||
1009 | ||||
1010 | char *parsebuf; | |||
1011 | int parseindex; | |||
1012 | char pushback_buffer[MAXPUSHBACK128]; | |||
1013 | int pushback_index = 0; | |||
1014 | ||||
1015 | int | |||
1016 | lgetc(int quotec) | |||
1017 | { | |||
1018 | int c, next; | |||
1019 | ||||
1020 | if (parsebuf) { | |||
1021 | /* Read character from the parsebuffer instead of input. */ | |||
1022 | if (parseindex >= 0) { | |||
1023 | c = (unsigned char)parsebuf[parseindex++]; | |||
1024 | if (c != '\0') | |||
1025 | return (c); | |||
1026 | parsebuf = NULL((void *)0); | |||
1027 | } else | |||
1028 | parseindex++; | |||
1029 | } | |||
1030 | ||||
1031 | if (pushback_index) | |||
1032 | return ((unsigned char)pushback_buffer[--pushback_index]); | |||
1033 | ||||
1034 | if (quotec) { | |||
1035 | if ((c = getc(file->stream)(!__isthreaded ? (--(file->stream)->_r < 0 ? __srget (file->stream) : (int)(*(file->stream)->_p++)) : (getc )(file->stream))) == EOF(-1)) { | |||
1036 | yyerror("reached end of file while parsing " | |||
1037 | "quoted string"); | |||
1038 | if (file == topfile || popfile() == EOF(-1)) | |||
1039 | return (EOF(-1)); | |||
1040 | return (quotec); | |||
1041 | } | |||
1042 | return (c); | |||
1043 | } | |||
1044 | ||||
1045 | while ((c = getc(file->stream)(!__isthreaded ? (--(file->stream)->_r < 0 ? __srget (file->stream) : (int)(*(file->stream)->_p++)) : (getc )(file->stream))) == '\\') { | |||
1046 | next = getc(file->stream)(!__isthreaded ? (--(file->stream)->_r < 0 ? __srget (file->stream) : (int)(*(file->stream)->_p++)) : (getc )(file->stream)); | |||
1047 | if (next != '\n') { | |||
1048 | c = next; | |||
1049 | break; | |||
1050 | } | |||
1051 | yylval.lineno = file->lineno; | |||
1052 | file->lineno++; | |||
1053 | } | |||
1054 | ||||
1055 | while (c == EOF(-1)) { | |||
1056 | if (file == topfile || popfile() == EOF(-1)) | |||
1057 | return (EOF(-1)); | |||
1058 | c = getc(file->stream)(!__isthreaded ? (--(file->stream)->_r < 0 ? __srget (file->stream) : (int)(*(file->stream)->_p++)) : (getc )(file->stream)); | |||
1059 | } | |||
1060 | return (c); | |||
1061 | } | |||
1062 | ||||
1063 | int | |||
1064 | lungetc(int c) | |||
1065 | { | |||
1066 | if (c == EOF(-1)) | |||
1067 | return (EOF(-1)); | |||
1068 | if (parsebuf) { | |||
1069 | parseindex--; | |||
1070 | if (parseindex >= 0) | |||
1071 | return (c); | |||
1072 | } | |||
1073 | if (pushback_index + 1 >= MAXPUSHBACK128) | |||
1074 | return (EOF(-1)); | |||
1075 | pushback_buffer[pushback_index++] = c; | |||
1076 | return (c); | |||
1077 | } | |||
1078 | ||||
1079 | int | |||
1080 | findeol(void) | |||
1081 | { | |||
1082 | int c; | |||
1083 | ||||
1084 | parsebuf = NULL((void *)0); | |||
1085 | ||||
1086 | /* skip to either EOF or the first real EOL */ | |||
1087 | while (1) { | |||
1088 | if (pushback_index) | |||
1089 | c = (unsigned char)pushback_buffer[--pushback_index]; | |||
1090 | else | |||
1091 | c = lgetc(0); | |||
1092 | if (c == '\n') { | |||
1093 | file->lineno++; | |||
1094 | break; | |||
1095 | } | |||
1096 | if (c == EOF(-1)) | |||
1097 | break; | |||
1098 | } | |||
1099 | return (ERROR369); | |||
1100 | } | |||
1101 | ||||
1102 | int | |||
1103 | yylex(void) | |||
1104 | { | |||
1105 | char buf[8096]; | |||
1106 | char *p; | |||
1107 | int quotec, next, c; | |||
1108 | int token; | |||
1109 | ||||
1110 | p = buf; | |||
1111 | while ((c = lgetc(0)) == ' ' || c == '\t') | |||
1112 | ; /* nothing */ | |||
1113 | ||||
1114 | yylval.lineno = file->lineno; | |||
1115 | if (c == '#') | |||
1116 | while ((c = lgetc(0)) != '\n' && c != EOF(-1)) | |||
1117 | ; /* nothing */ | |||
1118 | ||||
1119 | switch (c) { | |||
1120 | case '\'': | |||
1121 | case '"': | |||
1122 | quotec = c; | |||
1123 | while (1) { | |||
1124 | if ((c = lgetc(quotec)) == EOF(-1)) | |||
1125 | return (0); | |||
1126 | if (c == '\n') { | |||
1127 | file->lineno++; | |||
1128 | continue; | |||
1129 | } else if (c == '\\') { | |||
1130 | if ((next = lgetc(quotec)) == EOF(-1)) | |||
1131 | return (0); | |||
1132 | if (next == quotec || next == ' ' || | |||
1133 | next == '\t') | |||
1134 | c = next; | |||
1135 | else if (next == '\n') { | |||
1136 | file->lineno++; | |||
1137 | continue; | |||
1138 | } else | |||
1139 | lungetc(next); | |||
1140 | } else if (c == quotec) { | |||
1141 | *p = '\0'; | |||
1142 | break; | |||
1143 | } else if (c == '\0') { | |||
1144 | yyerror("syntax error"); | |||
1145 | return (findeol()); | |||
1146 | } | |||
1147 | if (p + 1 >= buf + sizeof(buf) - 1) { | |||
1148 | yyerror("string too long"); | |||
1149 | return (findeol()); | |||
1150 | } | |||
1151 | *p++ = c; | |||
1152 | } | |||
1153 | yylval.v.string = strdup(buf); | |||
1154 | if (yylval.v.string == NULL((void *)0)) | |||
1155 | fatal("yylex: strdup"); | |||
1156 | return (STRING370); | |||
1157 | } | |||
1158 | ||||
1159 | #define allowed_to_end_number(x)(isspace(x) || x == ')' || x ==',' || x == '/' || x == '}' || x == '=') \ | |||
1160 | (isspace(x) || x == ')' || x ==',' || x == '/' || x == '}' || x == '=') | |||
1161 | ||||
1162 | if (c == '-' || isdigit(c)) { | |||
1163 | do { | |||
1164 | *p++ = c; | |||
1165 | if ((size_t)(p-buf) >= sizeof(buf)) { | |||
1166 | yyerror("string too long"); | |||
1167 | return (findeol()); | |||
1168 | } | |||
1169 | } while ((c = lgetc(0)) != EOF(-1) && isdigit(c)); | |||
1170 | lungetc(c); | |||
1171 | if (p == buf + 1 && buf[0] == '-') | |||
1172 | goto nodigits; | |||
1173 | if (c == EOF(-1) || allowed_to_end_number(c)(isspace(c) || c == ')' || c ==',' || c == '/' || c == '}' || c == '=')) { | |||
1174 | const char *errstr = NULL((void *)0); | |||
1175 | ||||
1176 | *p = '\0'; | |||
1177 | yylval.v.number = strtonum(buf, LLONG_MIN(-9223372036854775807LL -1LL), | |||
1178 | LLONG_MAX9223372036854775807LL, &errstr); | |||
1179 | if (errstr) { | |||
1180 | yyerror("\"%s\" invalid number: %s", | |||
1181 | buf, errstr); | |||
1182 | return (findeol()); | |||
1183 | } | |||
1184 | return (NUMBER371); | |||
1185 | } else { | |||
1186 | nodigits: | |||
1187 | while (p > buf + 1) | |||
1188 | lungetc((unsigned char)*--p); | |||
1189 | c = (unsigned char)*--p; | |||
1190 | if (c == '-') | |||
1191 | return (c); | |||
1192 | } | |||
1193 | } | |||
1194 | ||||
1195 | #define allowed_in_string(x)(isalnum(x) || (ispunct(x) && x != '(' && x != ')' && x != '{' && x != '}' && x != '<' && x != '>' && x != '!' && x != '=' && x != '/' && x != '#' && x != ',') ) \ | |||
1196 | (isalnum(x) || (ispunct(x) && x != '(' && x != ')' && \ | |||
1197 | x != '{' && x != '}' && x != '<' && x != '>' && \ | |||
1198 | x != '!' && x != '=' && x != '/' && x != '#' && \ | |||
1199 | x != ',')) | |||
1200 | ||||
1201 | if (isalnum(c) || c == ':' || c == '_' || c == '*') { | |||
1202 | do { | |||
1203 | *p++ = c; | |||
1204 | if ((size_t)(p-buf) >= sizeof(buf)) { | |||
1205 | yyerror("string too long"); | |||
1206 | return (findeol()); | |||
1207 | } | |||
1208 | } while ((c = lgetc(0)) != EOF(-1) && (allowed_in_string(c)(isalnum(c) || (ispunct(c) && c != '(' && c != ')' && c != '{' && c != '}' && c != '<' && c != '>' && c != '!' && c != '=' && c != '/' && c != '#' && c != ',') ))); | |||
1209 | lungetc(c); | |||
1210 | *p = '\0'; | |||
1211 | if ((token = lookup(buf)) == STRING370) | |||
1212 | if ((yylval.v.string = strdup(buf)) == NULL((void *)0)) | |||
1213 | fatal("yylex: strdup"); | |||
1214 | return (token); | |||
1215 | } | |||
1216 | if (c == '\n') { | |||
1217 | yylval.lineno = file->lineno; | |||
1218 | file->lineno++; | |||
1219 | } | |||
1220 | if (c == EOF(-1)) | |||
1221 | return (0); | |||
1222 | return (c); | |||
1223 | } | |||
1224 | ||||
1225 | struct file * | |||
1226 | pushfile(const char *name) | |||
1227 | { | |||
1228 | struct file *nfile; | |||
1229 | ||||
1230 | if ((nfile = calloc(1, sizeof(struct file))) == NULL((void *)0)) { | |||
1231 | log_warn("%s", __func__); | |||
1232 | return (NULL((void *)0)); | |||
1233 | } | |||
1234 | if ((nfile->name = strdup(name)) == NULL((void *)0)) { | |||
1235 | log_warn("%s", __func__); | |||
1236 | free(nfile); | |||
1237 | return (NULL((void *)0)); | |||
1238 | } | |||
1239 | #ifdef NO_PRIVSEP | |||
1240 | if ((nfile->stream = fopen(nfile->name, "r")) == NULL((void *)0)) { | |||
1241 | #else | |||
1242 | if ((nfile->stream = priv_fopen(nfile->name)) == NULL((void *)0)) { | |||
1243 | #endif | |||
1244 | log_warn("%s: %s", __func__, nfile->name); | |||
1245 | free(nfile->name); | |||
1246 | free(nfile); | |||
1247 | return (NULL((void *)0)); | |||
1248 | } | |||
1249 | nfile->lineno = 1; | |||
1250 | TAILQ_INSERT_TAIL(&files, nfile, entry)do { (nfile)->entry.tqe_next = ((void *)0); (nfile)->entry .tqe_prev = (&files)->tqh_last; *(&files)->tqh_last = (nfile); (&files)->tqh_last = &(nfile)->entry .tqe_next; } while (0); | |||
1251 | return (nfile); | |||
1252 | } | |||
1253 | ||||
1254 | int | |||
1255 | popfile(void) | |||
1256 | { | |||
1257 | struct file *prev; | |||
1258 | ||||
1259 | if ((prev = TAILQ_PREV(file, files, entry)(*(((struct files *)((file)->entry.tqe_prev))->tqh_last ))) != NULL((void *)0)) | |||
1260 | prev->errors += file->errors; | |||
1261 | ||||
1262 | TAILQ_REMOVE(&files, file, entry)do { if (((file)->entry.tqe_next) != ((void *)0)) (file)-> entry.tqe_next->entry.tqe_prev = (file)->entry.tqe_prev ; else (&files)->tqh_last = (file)->entry.tqe_prev; *(file)->entry.tqe_prev = (file)->entry.tqe_next; ; ; } while (0); | |||
1263 | fclose(file->stream); | |||
1264 | free(file->name); | |||
1265 | free(file); | |||
1266 | file = prev; | |||
1267 | return (file ? 0 : EOF(-1)); | |||
1268 | } | |||
1269 | ||||
1270 | int | |||
1271 | npppd_conf_parse(struct npppd_conf *xconf, const char *filename) | |||
1272 | { | |||
1273 | int errors = 0; | |||
1274 | ||||
1275 | conf = xconf; | |||
1276 | ||||
1277 | if ((file = pushfile(filename)) == NULL((void *)0)) { | |||
1278 | return (-1); | |||
1279 | } | |||
1280 | topfile = file; | |||
1281 | ||||
1282 | yyparse(); | |||
1283 | errors = file->errors; | |||
1284 | popfile(); | |||
1285 | ||||
1286 | if (curr_tunnconf != NULL((void *)0)) { | |||
1287 | tunnconf_fini(curr_tunnconf); | |||
1288 | free(curr_tunnconf); | |||
1289 | } | |||
1290 | curr_tunnconf = NULL((void *)0); | |||
1291 | if (curr_authconf != NULL((void *)0)) { | |||
1292 | authconf_fini(curr_authconf); | |||
1293 | free(curr_authconf); | |||
1294 | } | |||
1295 | curr_authconf = NULL((void *)0); | |||
1296 | if (curr_ipcpconf != NULL((void *)0)) { | |||
1297 | ipcpconf_fini(curr_ipcpconf); | |||
1298 | free(curr_ipcpconf); | |||
1299 | } | |||
1300 | curr_ipcpconf = NULL((void *)0); | |||
1301 | ||||
1302 | if (errors) | |||
1303 | npppd_conf_fini(xconf); | |||
1304 | ||||
1305 | return (errors ? -1 : 0); | |||
1306 | } | |||
1307 | ||||
1308 | void | |||
1309 | npppd_conf_init(struct npppd_conf *xconf) | |||
1310 | { | |||
1311 | memset(xconf, 0, sizeof(struct npppd_conf)); | |||
1312 | TAILQ_INIT(&xconf->tunnconfs)do { (&xconf->tunnconfs)->tqh_first = ((void *)0); ( &xconf->tunnconfs)->tqh_last = &(&xconf-> tunnconfs)->tqh_first; } while (0); | |||
1313 | TAILQ_INIT(&xconf->authconfs)do { (&xconf->authconfs)->tqh_first = ((void *)0); ( &xconf->authconfs)->tqh_last = &(&xconf-> authconfs)->tqh_first; } while (0); | |||
1314 | TAILQ_INIT(&xconf->ipcpconfs)do { (&xconf->ipcpconfs)->tqh_first = ((void *)0); ( &xconf->ipcpconfs)->tqh_last = &(&xconf-> ipcpconfs)->tqh_first; } while (0); | |||
1315 | TAILQ_INIT(&xconf->ifaces)do { (&xconf->ifaces)->tqh_first = ((void *)0); (& xconf->ifaces)->tqh_last = &(&xconf->ifaces) ->tqh_first; } while (0); | |||
1316 | TAILQ_INIT(&xconf->confbinds)do { (&xconf->confbinds)->tqh_first = ((void *)0); ( &xconf->confbinds)->tqh_last = &(&xconf-> confbinds)->tqh_first; } while (0); | |||
1317 | TAILQ_INIT(&xconf->l2tp_confs)do { (&xconf->l2tp_confs)->tqh_first = ((void *)0); (&xconf->l2tp_confs)->tqh_last = &(&xconf-> l2tp_confs)->tqh_first; } while (0); | |||
1318 | TAILQ_INIT(&xconf->pptp_confs)do { (&xconf->pptp_confs)->tqh_first = ((void *)0); (&xconf->pptp_confs)->tqh_last = &(&xconf-> pptp_confs)->tqh_first; } while (0); | |||
1319 | TAILQ_INIT(&xconf->pppoe_confs)do { (&xconf->pppoe_confs)->tqh_first = ((void *)0) ; (&xconf->pppoe_confs)->tqh_last = &(&xconf ->pppoe_confs)->tqh_first; } while (0); | |||
1320 | } | |||
1321 | ||||
1322 | void | |||
1323 | npppd_conf_fini(struct npppd_conf *xconf) | |||
1324 | { | |||
1325 | struct tunnconf *tunn, *tunn0; | |||
1326 | struct authconf *auth, *auth0; | |||
1327 | struct ipcpconf *ipcp, *ipcp0; | |||
1328 | struct iface *iface, *iface0; | |||
1329 | struct confbind *confbind, *confbind0; | |||
1330 | ||||
1331 | TAILQ_FOREACH_SAFE(tunn, &xconf->tunnconfs, entry, tunn0)for ((tunn) = ((&xconf->tunnconfs)->tqh_first); (tunn ) != ((void *)0) && ((tunn0) = ((tunn)->entry.tqe_next ), 1); (tunn) = (tunn0)) { | |||
1332 | tunnconf_fini(tunn); | |||
1333 | } | |||
1334 | TAILQ_FOREACH_SAFE(auth, &xconf->authconfs, entry, auth0)for ((auth) = ((&xconf->authconfs)->tqh_first); (auth ) != ((void *)0) && ((auth0) = ((auth)->entry.tqe_next ), 1); (auth) = (auth0)) { | |||
1335 | authconf_fini(auth); | |||
1336 | } | |||
1337 | TAILQ_FOREACH_SAFE(ipcp, &xconf->ipcpconfs, entry, ipcp0)for ((ipcp) = ((&xconf->ipcpconfs)->tqh_first); (ipcp ) != ((void *)0) && ((ipcp0) = ((ipcp)->entry.tqe_next ), 1); (ipcp) = (ipcp0)) { | |||
1338 | ipcpconf_fini(ipcp); | |||
1339 | } | |||
1340 | TAILQ_FOREACH_SAFE(iface, &xconf->ifaces, entry, iface0)for ((iface) = ((&xconf->ifaces)->tqh_first); (iface ) != ((void *)0) && ((iface0) = ((iface)->entry.tqe_next ), 1); (iface) = (iface0)) { | |||
1341 | free(iface); | |||
1342 | } | |||
1343 | TAILQ_FOREACH_SAFE(confbind, &xconf->confbinds, entry, confbind0)for ((confbind) = ((&xconf->confbinds)->tqh_first); (confbind) != ((void *)0) && ((confbind0) = ((confbind )->entry.tqe_next), 1); (confbind) = (confbind0)) { | |||
1344 | free(confbind); | |||
1345 | } | |||
1346 | TAILQ_INIT(&xconf->l2tp_confs)do { (&xconf->l2tp_confs)->tqh_first = ((void *)0); (&xconf->l2tp_confs)->tqh_last = &(&xconf-> l2tp_confs)->tqh_first; } while (0); | |||
1347 | TAILQ_INIT(&xconf->pptp_confs)do { (&xconf->pptp_confs)->tqh_first = ((void *)0); (&xconf->pptp_confs)->tqh_last = &(&xconf-> pptp_confs)->tqh_first; } while (0); | |||
1348 | TAILQ_INIT(&xconf->pppoe_confs)do { (&xconf->pppoe_confs)->tqh_first = ((void *)0) ; (&xconf->pppoe_confs)->tqh_last = &(&xconf ->pppoe_confs)->tqh_first; } while (0); | |||
1349 | } | |||
1350 | ||||
1351 | void | |||
1352 | tunnconf_fini(struct tunnconf *tun) | |||
1353 | { | |||
1354 | if (tun->chap_name != NULL((void *)0)) | |||
1355 | free(tun->chap_name); | |||
1356 | tun->chap_name = NULL((void *)0); | |||
1357 | ||||
1358 | switch (tun->protocol) { | |||
1359 | case NPPPD_TUNNEL_L2TP1: | |||
1360 | { | |||
1361 | struct l2tp_listen_addr *l_addr, *l_tmp; | |||
1362 | ||||
1363 | if (tun->proto.l2tp.hostname != NULL((void *)0)) | |||
1364 | free(tun->proto.l2tp.hostname); | |||
1365 | tun->proto.l2tp.hostname = NULL((void *)0); | |||
1366 | if (tun->proto.l2tp.vendor_name != NULL((void *)0)) | |||
1367 | free(tun->proto.l2tp.vendor_name); | |||
1368 | tun->proto.l2tp.vendor_name = NULL((void *)0); | |||
1369 | TAILQ_FOREACH_SAFE(l_addr, &tun->proto.l2tp.listen, entry,for ((l_addr) = ((&tun->proto.l2tp.listen)->tqh_first ); (l_addr) != ((void *)0) && ((l_tmp) = ((l_addr)-> entry.tqe_next), 1); (l_addr) = (l_tmp)) | |||
1370 | l_tmp)for ((l_addr) = ((&tun->proto.l2tp.listen)->tqh_first ); (l_addr) != ((void *)0) && ((l_tmp) = ((l_addr)-> entry.tqe_next), 1); (l_addr) = (l_tmp)) { | |||
1371 | TAILQ_REMOVE(&tun->proto.l2tp.listen, l_addr, entry)do { if (((l_addr)->entry.tqe_next) != ((void *)0)) (l_addr )->entry.tqe_next->entry.tqe_prev = (l_addr)->entry. tqe_prev; else (&tun->proto.l2tp.listen)->tqh_last = (l_addr)->entry.tqe_prev; *(l_addr)->entry.tqe_prev = ( l_addr)->entry.tqe_next; ; ; } while (0); | |||
1372 | free(l_addr); | |||
1373 | } | |||
1374 | break; | |||
1375 | } | |||
1376 | case NPPPD_TUNNEL_PPTP2: | |||
1377 | { | |||
1378 | struct pptp_listen_addr *p_addr, *p_tmp; | |||
1379 | ||||
1380 | if (tun->proto.pptp.hostname != NULL((void *)0)) | |||
1381 | free(tun->proto.pptp.hostname); | |||
1382 | tun->proto.pptp.hostname = NULL((void *)0); | |||
1383 | if (tun->proto.pptp.vendor_name != NULL((void *)0)) | |||
1384 | free(tun->proto.pptp.vendor_name); | |||
1385 | tun->proto.pptp.vendor_name = NULL((void *)0); | |||
1386 | TAILQ_FOREACH_SAFE(p_addr, &tun->proto.pptp.listen, entry,for ((p_addr) = ((&tun->proto.pptp.listen)->tqh_first ); (p_addr) != ((void *)0) && ((p_tmp) = ((p_addr)-> entry.tqe_next), 1); (p_addr) = (p_tmp)) | |||
1387 | p_tmp)for ((p_addr) = ((&tun->proto.pptp.listen)->tqh_first ); (p_addr) != ((void *)0) && ((p_tmp) = ((p_addr)-> entry.tqe_next), 1); (p_addr) = (p_tmp)) { | |||
1388 | TAILQ_REMOVE(&tun->proto.pptp.listen, p_addr, entry)do { if (((p_addr)->entry.tqe_next) != ((void *)0)) (p_addr )->entry.tqe_next->entry.tqe_prev = (p_addr)->entry. tqe_prev; else (&tun->proto.pptp.listen)->tqh_last = (p_addr)->entry.tqe_prev; *(p_addr)->entry.tqe_prev = ( p_addr)->entry.tqe_next; ; ; } while (0); | |||
1389 | free(p_addr); | |||
1390 | } | |||
1391 | break; | |||
1392 | } | |||
1393 | case NPPPD_TUNNEL_PPPOE3: | |||
1394 | if (tun->proto.pppoe.service_name != NULL((void *)0)) | |||
1395 | free(tun->proto.pppoe.service_name); | |||
1396 | tun->proto.pppoe.service_name = NULL((void *)0); | |||
1397 | if (tun->proto.pppoe.ac_name != NULL((void *)0)) | |||
1398 | free(tun->proto.pppoe.ac_name); | |||
1399 | tun->proto.pppoe.ac_name = NULL((void *)0); | |||
1400 | break; | |||
1401 | } | |||
1402 | } | |||
1403 | ||||
1404 | void | |||
1405 | tunnconf_init(struct tunnconf *tun, int protocol) | |||
1406 | { | |||
1407 | extern struct tunnconf tunnconf_default_l2tp, tunnconf_default_pptp; | |||
1408 | extern struct tunnconf tunnconf_default_pppoe; | |||
1409 | ||||
1410 | switch (protocol) { | |||
1411 | case NPPPD_TUNNEL_L2TP1: | |||
1412 | memcpy(tun, &tunnconf_default_l2tp, sizeof(struct tunnconf)); | |||
1413 | TAILQ_INIT(&tun->proto.l2tp.listen)do { (&tun->proto.l2tp.listen)->tqh_first = ((void * )0); (&tun->proto.l2tp.listen)->tqh_last = &(& tun->proto.l2tp.listen)->tqh_first; } while (0); | |||
1414 | break; | |||
1415 | case NPPPD_TUNNEL_PPTP2: | |||
1416 | memcpy(tun, &tunnconf_default_pptp, sizeof(struct tunnconf)); | |||
1417 | TAILQ_INIT(&tun->proto.pptp.listen)do { (&tun->proto.pptp.listen)->tqh_first = ((void * )0); (&tun->proto.pptp.listen)->tqh_last = &(& tun->proto.pptp.listen)->tqh_first; } while (0); | |||
1418 | break; | |||
1419 | case NPPPD_TUNNEL_PPPOE3: | |||
1420 | memcpy(tun, &tunnconf_default_pppoe, sizeof(struct tunnconf)); | |||
1421 | break; | |||
1422 | } | |||
1423 | } | |||
1424 | ||||
1425 | struct tunnconf * | |||
1426 | tunnconf_find(const char *name) | |||
1427 | { | |||
1428 | struct tunnconf *tunn; | |||
1429 | ||||
1430 | TAILQ_FOREACH(tunn, &conf->tunnconfs, entry)for((tunn) = ((&conf->tunnconfs)->tqh_first); (tunn ) != ((void *)0); (tunn) = ((tunn)->entry.tqe_next)) { | |||
1431 | if (strcmp(tunn->name, name) == 0) | |||
1432 | return tunn; | |||
1433 | } | |||
1434 | ||||
1435 | return NULL((void *)0); | |||
1436 | } | |||
1437 | ||||
1438 | void | |||
1439 | authconf_init(struct authconf *auth) | |||
1440 | { | |||
1441 | memset(auth, 0, sizeof(struct authconf)); | |||
1442 | auth->eap_capable = true1; | |||
1443 | auth->strip_nt_domain = true1; | |||
1444 | auth->strip_atmark_realm = false0; | |||
1445 | } | |||
1446 | ||||
1447 | void | |||
1448 | authconf_fini(struct authconf *auth) | |||
1449 | { | |||
1450 | if (auth->username_suffix != NULL((void *)0)) | |||
1451 | free(auth->username_suffix); | |||
1452 | auth->username_suffix = NULL((void *)0); | |||
1453 | ||||
1454 | switch (auth->auth_type) { | |||
1455 | case NPPPD_AUTH_TYPE_RADIUS2: | |||
1456 | radconf_fini(&auth->data.radius.auth); | |||
1457 | radconf_fini(&auth->data.radius.acct); | |||
1458 | break; | |||
1459 | } | |||
1460 | } | |||
1461 | ||||
1462 | void | |||
1463 | radconf_fini(struct radconf *radconf) | |||
1464 | { | |||
1465 | struct radserver *server, *server0; | |||
1466 | ||||
1467 | TAILQ_FOREACH_SAFE(server, &radconf->servers, entry, server0)for ((server) = ((&radconf->servers)->tqh_first); ( server) != ((void *)0) && ((server0) = ((server)-> entry.tqe_next), 1); (server) = (server0)) { | |||
1468 | if (server->secret != NULL((void *)0)) | |||
1469 | free(server->secret); | |||
1470 | server->secret = NULL((void *)0); | |||
1471 | } | |||
1472 | } | |||
1473 | ||||
1474 | struct authconf * | |||
1475 | authconf_find(const char *name) | |||
1476 | { | |||
1477 | struct authconf *auth; | |||
1478 | ||||
1479 | TAILQ_FOREACH(auth, &conf->authconfs, entry)for((auth) = ((&conf->authconfs)->tqh_first); (auth ) != ((void *)0); (auth) = ((auth)->entry.tqe_next)) { | |||
1480 | if (strcmp(auth->name, name) == 0) | |||
1481 | return auth; | |||
1482 | } | |||
1483 | ||||
1484 | return NULL((void *)0); | |||
1485 | } | |||
1486 | ||||
1487 | void | |||
1488 | ipcpconf_init(struct ipcpconf *ipcp) | |||
1489 | { | |||
1490 | memset(ipcp, 0, sizeof(struct ipcpconf)); | |||
1491 | } | |||
1492 | ||||
1493 | void | |||
1494 | ipcpconf_fini(struct ipcpconf *ipcp) | |||
1495 | { | |||
1496 | if (ipcp->dynamic_pool != NULL((void *)0)) | |||
1497 | in_addr_range_list_remove_all(&ipcp->dynamic_pool); | |||
1498 | if (ipcp->static_pool != NULL((void *)0)) | |||
1499 | in_addr_range_list_remove_all(&ipcp->static_pool); | |||
1500 | } | |||
1501 | ||||
1502 | struct ipcpconf * | |||
1503 | ipcpconf_find(const char *name) | |||
1504 | { | |||
1505 | struct ipcpconf *ipcp; | |||
1506 | ||||
1507 | TAILQ_FOREACH(ipcp, &conf->ipcpconfs, entry)for((ipcp) = ((&conf->ipcpconfs)->tqh_first); (ipcp ) != ((void *)0); (ipcp) = ((ipcp)->entry.tqe_next)) { | |||
1508 | if (strcmp(ipcp->name, name) == 0) | |||
1509 | return ipcp; | |||
1510 | } | |||
1511 | ||||
1512 | return NULL((void *)0); | |||
1513 | } | |||
1514 | ||||
1515 | struct iface * | |||
1516 | iface_find(const char *name) | |||
1517 | { | |||
1518 | struct iface *iface; | |||
1519 | ||||
1520 | TAILQ_FOREACH(iface, &conf->ifaces, entry)for((iface) = ((&conf->ifaces)->tqh_first); (iface) != ((void *)0); (iface) = ((iface)->entry.tqe_next)) { | |||
1521 | if (strcmp(iface->name, name) == 0) | |||
1522 | return iface; | |||
1523 | } | |||
1524 | ||||
1525 | return NULL((void *)0); | |||
1526 | } | |||
1527 | ||||
1528 | void | |||
1529 | sa_set_in_addr_any(struct sockaddr *sa) | |||
1530 | { | |||
1531 | memset(sa, 0, sizeof(struct sockaddr_in)); | |||
1532 | ||||
1533 | sa->sa_family = AF_INET2, | |||
1534 | sa->sa_len = sizeof(struct sockaddr_in); | |||
1535 | ((struct sockaddr_in *)sa)->sin_addr.s_addr = htonl(INADDR_ANY)(__uint32_t)(__builtin_constant_p(((u_int32_t)(0x00000000))) ? (__uint32_t)(((__uint32_t)(((u_int32_t)(0x00000000))) & 0xff ) << 24 | ((__uint32_t)(((u_int32_t)(0x00000000))) & 0xff00) << 8 | ((__uint32_t)(((u_int32_t)(0x00000000)) ) & 0xff0000) >> 8 | ((__uint32_t)(((u_int32_t)(0x00000000 ))) & 0xff000000) >> 24) : __swap32md(((u_int32_t)( 0x00000000)))); | |||
1536 | } | |||
1537 | #line 1530 "parse.c" | |||
1538 | /* allocate initial stack or double stack size, up to YYMAXDEPTH */ | |||
1539 | static int yygrowstack(void) | |||
1540 | { | |||
1541 | unsigned int newsize; | |||
1542 | long sslen; | |||
1543 | short *newss; | |||
1544 | YYSTYPE *newvs; | |||
1545 | ||||
1546 | if ((newsize = yystacksize) == 0) | |||
1547 | newsize = YYINITSTACKSIZE200; | |||
1548 | else if (newsize >= YYMAXDEPTH10000) | |||
1549 | return -1; | |||
1550 | else if ((newsize *= 2) > YYMAXDEPTH10000) | |||
1551 | newsize = YYMAXDEPTH10000; | |||
1552 | sslen = yyssp - yyss; | |||
1553 | #ifdef SIZE_MAX0xffffffffffffffffUL | |||
1554 | #define YY_SIZE_MAX0xffffffffffffffffUL SIZE_MAX0xffffffffffffffffUL | |||
1555 | #else | |||
1556 | #define YY_SIZE_MAX0xffffffffffffffffUL 0xffffffffU | |||
1557 | #endif | |||
1558 | if (newsize && YY_SIZE_MAX0xffffffffffffffffUL / newsize < sizeof *newss) | |||
1559 | goto bail; | |||
1560 | newss = (short *)realloc(yyss, newsize * sizeof *newss); | |||
1561 | if (newss == NULL((void *)0)) | |||
1562 | goto bail; | |||
1563 | yyss = newss; | |||
1564 | yyssp = newss + sslen; | |||
1565 | if (newsize
| |||
1566 | goto bail; | |||
1567 | newvs = (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs); | |||
1568 | if (newvs == NULL((void *)0)) | |||
1569 | goto bail; | |||
1570 | yyvs = newvs; | |||
1571 | yyvsp = newvs + sslen; | |||
1572 | yystacksize = newsize; | |||
1573 | yysslim = yyss + newsize - 1; | |||
1574 | return 0; | |||
1575 | bail: | |||
1576 | if (yyss
| |||
1577 | free(yyss); | |||
1578 | if (yyvs) | |||
1579 | free(yyvs); | |||
| ||||
1580 | yyss = yyssp = NULL((void *)0); | |||
1581 | yyvs = yyvsp = NULL((void *)0); | |||
1582 | yystacksize = 0; | |||
1583 | return -1; | |||
1584 | } | |||
1585 | ||||
1586 | #define YYABORTgoto yyabort goto yyabort | |||
1587 | #define YYREJECTgoto yyabort goto yyabort | |||
1588 | #define YYACCEPTgoto yyaccept goto yyaccept | |||
1589 | #define YYERRORgoto yyerrlab goto yyerrlab | |||
1590 | int | |||
1591 | yyparse(void) | |||
1592 | { | |||
1593 | int yym, yyn, yystate; | |||
1594 | #if YYDEBUG0 | |||
1595 | const char *yys; | |||
1596 | ||||
1597 | if ((yys = getenv("YYDEBUG"))) | |||
1598 | { | |||
1599 | yyn = *yys; | |||
1600 | if (yyn >= '0' && yyn <= '9') | |||
1601 | yydebug = yyn - '0'; | |||
1602 | } | |||
1603 | #endif /* YYDEBUG */ | |||
1604 | ||||
1605 | yynerrs = 0; | |||
1606 | yyerrflag = 0; | |||
1607 | yychar = (-1); | |||
1608 | ||||
1609 | if (yyss == NULL((void *)0) && yygrowstack()) goto yyoverflow; | |||
| ||||
1610 | yyssp = yyss; | |||
1611 | yyvsp = yyvs; | |||
1612 | *yyssp = yystate = 0; | |||
1613 | ||||
1614 | yyloop: | |||
1615 | if ((yyn = yydefred[yystate]) != 0) goto yyreduce; | |||
1616 | if (yychar < 0) | |||
1617 | { | |||
1618 | if ((yychar = yylex()) < 0) yychar = 0; | |||
1619 | #if YYDEBUG0 | |||
1620 | if (yydebug) | |||
1621 | { | |||
1622 | yys = 0; | |||
1623 | if (yychar <= YYMAXTOKEN371) yys = yyname[yychar]; | |||
1624 | if (!yys) yys = "illegal-symbol"; | |||
1625 | printf("%sdebug: state %d, reading %d (%s)\n", | |||
1626 | YYPREFIX"yy", yystate, yychar, yys); | |||
1627 | } | |||
1628 | #endif | |||
1629 | } | |||
1630 | if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && | |||
1631 | yyn <= YYTABLESIZE1278 && yycheck[yyn] == yychar) | |||
1632 | { | |||
1633 | #if YYDEBUG0 | |||
1634 | if (yydebug) | |||
1635 | printf("%sdebug: state %d, shifting to state %d\n", | |||
1636 | YYPREFIX"yy", yystate, yytable[yyn]); | |||
1637 | #endif | |||
1638 | if (yyssp >= yysslim && yygrowstack()) | |||
1639 | { | |||
1640 | goto yyoverflow; | |||
1641 | } | |||
1642 | *++yyssp = yystate = yytable[yyn]; | |||
1643 | *++yyvsp = yylval; | |||
1644 | yychar = (-1); | |||
1645 | if (yyerrflag > 0) --yyerrflag; | |||
1646 | goto yyloop; | |||
1647 | } | |||
1648 | if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && | |||
1649 | yyn <= YYTABLESIZE1278 && yycheck[yyn] == yychar) | |||
1650 | { | |||
1651 | yyn = yytable[yyn]; | |||
1652 | goto yyreduce; | |||
1653 | } | |||
1654 | if (yyerrflag) goto yyinrecovery; | |||
1655 | #if defined(__GNUC__4) | |||
1656 | goto yynewerror; | |||
1657 | #endif | |||
1658 | yynewerror: | |||
1659 | yyerror("syntax error"); | |||
1660 | #if defined(__GNUC__4) | |||
1661 | goto yyerrlab; | |||
1662 | #endif | |||
1663 | yyerrlab: | |||
1664 | ++yynerrs; | |||
1665 | yyinrecovery: | |||
1666 | if (yyerrflag < 3) | |||
1667 | { | |||
1668 | yyerrflag = 3; | |||
1669 | for (;;) | |||
1670 | { | |||
1671 | if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE256) >= 0 && | |||
1672 | yyn <= YYTABLESIZE1278 && yycheck[yyn] == YYERRCODE256) | |||
1673 | { | |||
1674 | #if YYDEBUG0 | |||
1675 | if (yydebug) | |||
1676 | printf("%sdebug: state %d, error recovery shifting\ | |||
1677 | to state %d\n", YYPREFIX"yy", *yyssp, yytable[yyn]); | |||
1678 | #endif | |||
1679 | if (yyssp >= yysslim && yygrowstack()) | |||
1680 | { | |||
1681 | goto yyoverflow; | |||
1682 | } | |||
1683 | *++yyssp = yystate = yytable[yyn]; | |||
1684 | *++yyvsp = yylval; | |||
1685 | goto yyloop; | |||
1686 | } | |||
1687 | else | |||
1688 | { | |||
1689 | #if YYDEBUG0 | |||
1690 | if (yydebug) | |||
1691 | printf("%sdebug: error recovery discarding state %d\n", | |||
1692 | YYPREFIX"yy", *yyssp); | |||
1693 | #endif | |||
1694 | if (yyssp <= yyss) goto yyabort; | |||
1695 | --yyssp; | |||
1696 | --yyvsp; | |||
1697 | } | |||
1698 | } | |||
1699 | } | |||
1700 | else | |||
1701 | { | |||
1702 | if (yychar == 0) goto yyabort; | |||
1703 | #if YYDEBUG0 | |||
1704 | if (yydebug) | |||
1705 | { | |||
1706 | yys = 0; | |||
1707 | if (yychar <= YYMAXTOKEN371) yys = yyname[yychar]; | |||
1708 | if (!yys) yys = "illegal-symbol"; | |||
1709 | printf("%sdebug: state %d, error recovery discards token %d (%s)\n", | |||
1710 | YYPREFIX"yy", yystate, yychar, yys); | |||
1711 | } | |||
1712 | #endif | |||
1713 | yychar = (-1); | |||
1714 | goto yyloop; | |||
1715 | } | |||
1716 | yyreduce: | |||
1717 | #if YYDEBUG0 | |||
1718 | if (yydebug) | |||
1719 | printf("%sdebug: state %d, reducing by rule %d (%s)\n", | |||
1720 | YYPREFIX"yy", yystate, yyn, yyrule[yyn]); | |||
1721 | #endif | |||
1722 | yym = yylen[yyn]; | |||
1723 | if (yym) | |||
1724 | yyval = yyvsp[1-yym]; | |||
1725 | else | |||
1726 | memset(&yyval, 0, sizeof yyval); | |||
1727 | switch (yyn) | |||
1728 | { | |||
1729 | case 9: | |||
1730 | #line 168 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1731 | { file->errors++; } | |||
1732 | break; | |||
1733 | case 10: | |||
1734 | #line 172 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1735 | { conf->max_session = yyvsp[0].v.number; } | |||
1736 | break; | |||
1737 | case 11: | |||
1738 | #line 173 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1739 | { conf->user_max_session = yyvsp[0].v.number; } | |||
1740 | break; | |||
1741 | case 12: | |||
1742 | #line 179 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1743 | { | |||
1744 | struct tunnconf *n; | |||
1745 | ||||
1746 | if (tunnconf_find(yyvsp[-2].v.string) != NULL((void *)0)) { | |||
1747 | yyerror("tunnel name = %s is already in use.", | |||
1748 | yyvsp[-2].v.string); | |||
1749 | free(yyvsp[-2].v.string); | |||
1750 | YYERRORgoto yyerrlab; | |||
1751 | } | |||
1752 | ||||
1753 | if ((n = malloc(sizeof(struct tunnconf))) == NULL((void *)0)) { | |||
1754 | yyerror("out of memory"); | |||
1755 | free(yyvsp[-2].v.string); | |||
1756 | YYERRORgoto yyerrlab; | |||
1757 | } | |||
1758 | tunnconf_init(n, yyvsp[0].v.number); | |||
1759 | switch (yyvsp[0].v.number) { | |||
1760 | case NPPPD_TUNNEL_L2TP1: | |||
1761 | strlcpy(n->proto.l2tp.name, yyvsp[-2].v.string, | |||
1762 | sizeof(n->proto.l2tp.name)); | |||
1763 | n->name = n->proto.l2tp.name; | |||
1764 | break; | |||
1765 | case NPPPD_TUNNEL_PPTP2: | |||
1766 | strlcpy(n->proto.pptp.name, yyvsp[-2].v.string, | |||
1767 | sizeof(n->proto.pptp.name)); | |||
1768 | n->name = n->proto.pptp.name; | |||
1769 | break; | |||
1770 | case NPPPD_TUNNEL_PPPOE3: | |||
1771 | strlcpy(n->proto.pppoe.name, yyvsp[-2].v.string, | |||
1772 | sizeof(n->proto.pppoe.name)); | |||
1773 | n->name = n->proto.pppoe.name; | |||
1774 | break; | |||
1775 | } | |||
1776 | free(yyvsp[-2].v.string); | |||
1777 | n->protocol = yyvsp[0].v.number; | |||
1778 | curr_tunnconf = n; | |||
1779 | } | |||
1780 | break; | |||
1781 | case 13: | |||
1782 | #line 215 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1783 | { | |||
1784 | TAILQ_INSERT_TAIL(&conf->tunnconfs, curr_tunnconf,do { (curr_tunnconf)->entry.tqe_next = ((void *)0); (curr_tunnconf )->entry.tqe_prev = (&conf->tunnconfs)->tqh_last ; *(&conf->tunnconfs)->tqh_last = (curr_tunnconf); ( &conf->tunnconfs)->tqh_last = &(curr_tunnconf)-> entry.tqe_next; } while (0) | |||
1785 | entry)do { (curr_tunnconf)->entry.tqe_next = ((void *)0); (curr_tunnconf )->entry.tqe_prev = (&conf->tunnconfs)->tqh_last ; *(&conf->tunnconfs)->tqh_last = (curr_tunnconf); ( &conf->tunnconfs)->tqh_last = &(curr_tunnconf)-> entry.tqe_next; } while (0); | |||
1786 | switch (curr_tunnconf->protocol) { | |||
1787 | #ifdef USE_NPPPD_L2TP1 | |||
1788 | case NPPPD_TUNNEL_L2TP1: | |||
1789 | if (TAILQ_EMPTY((((&curr_tunnconf->proto.l2tp.listen)->tqh_first) == ((void *)0)) | |||
1790 | &curr_tunnconf->proto.l2tp.listen)(((&curr_tunnconf->proto.l2tp.listen)->tqh_first) == ((void *)0))) { | |||
1791 | struct l2tp_listen_addr *addr; | |||
1792 | ||||
1793 | if ((addr = malloc(sizeof(struct | |||
1794 | l2tp_listen_addr))) == NULL((void *)0)) { | |||
1795 | free(curr_tunnconf); | |||
1796 | yyerror("out of memory"); | |||
1797 | YYERRORgoto yyerrlab; | |||
1798 | } | |||
1799 | sa_set_in_addr_any( | |||
1800 | (struct sockaddr *)&addr->addr); | |||
1801 | TAILQ_INSERT_TAIL(&curr_tunnconf->proto.do { (addr)->entry.tqe_next = ((void *)0); (addr)->entry .tqe_prev = (&curr_tunnconf->proto. l2tp.listen)->tqh_last ; *(&curr_tunnconf->proto. l2tp.listen)->tqh_last = (addr); (&curr_tunnconf->proto. l2tp.listen)->tqh_last = &(addr)->entry.tqe_next; } while (0) | |||
1802 | l2tp.listen, addr, entry)do { (addr)->entry.tqe_next = ((void *)0); (addr)->entry .tqe_prev = (&curr_tunnconf->proto. l2tp.listen)->tqh_last ; *(&curr_tunnconf->proto. l2tp.listen)->tqh_last = (addr); (&curr_tunnconf->proto. l2tp.listen)->tqh_last = &(addr)->entry.tqe_next; } while (0); | |||
1803 | } | |||
1804 | TAILQ_INSERT_TAIL(&conf->l2tp_confs,do { (&curr_tunnconf->proto.l2tp)->entry.tqe_next = ((void *)0); (&curr_tunnconf->proto.l2tp)->entry.tqe_prev = (&conf->l2tp_confs)->tqh_last; *(&conf->l2tp_confs )->tqh_last = (&curr_tunnconf->proto.l2tp); (&conf ->l2tp_confs)->tqh_last = &(&curr_tunnconf-> proto.l2tp)->entry.tqe_next; } while (0) | |||
1805 | &curr_tunnconf->proto.l2tp, entry)do { (&curr_tunnconf->proto.l2tp)->entry.tqe_next = ((void *)0); (&curr_tunnconf->proto.l2tp)->entry.tqe_prev = (&conf->l2tp_confs)->tqh_last; *(&conf->l2tp_confs )->tqh_last = (&curr_tunnconf->proto.l2tp); (&conf ->l2tp_confs)->tqh_last = &(&curr_tunnconf-> proto.l2tp)->entry.tqe_next; } while (0); | |||
1806 | break; | |||
1807 | #endif | |||
1808 | #ifdef USE_NPPPD_PPTP1 | |||
1809 | case NPPPD_TUNNEL_PPTP2: | |||
1810 | if (TAILQ_EMPTY((((&curr_tunnconf->proto.pptp.listen)->tqh_first) == ((void *)0)) | |||
1811 | &curr_tunnconf->proto.pptp.listen)(((&curr_tunnconf->proto.pptp.listen)->tqh_first) == ((void *)0))) { | |||
1812 | struct pptp_listen_addr *addr; | |||
1813 | ||||
1814 | if ((addr = malloc(sizeof(struct | |||
1815 | pptp_listen_addr))) == NULL((void *)0)) { | |||
1816 | free(curr_tunnconf); | |||
1817 | yyerror("out of memory"); | |||
1818 | YYERRORgoto yyerrlab; | |||
1819 | } | |||
1820 | sa_set_in_addr_any( | |||
1821 | (struct sockaddr *)&addr->addr); | |||
1822 | TAILQ_INSERT_TAIL(&curr_tunnconf->proto.do { (addr)->entry.tqe_next = ((void *)0); (addr)->entry .tqe_prev = (&curr_tunnconf->proto. pptp.listen)->tqh_last ; *(&curr_tunnconf->proto. pptp.listen)->tqh_last = (addr); (&curr_tunnconf->proto. pptp.listen)->tqh_last = &(addr)->entry.tqe_next; } while (0) | |||
1823 | pptp.listen, addr, entry)do { (addr)->entry.tqe_next = ((void *)0); (addr)->entry .tqe_prev = (&curr_tunnconf->proto. pptp.listen)->tqh_last ; *(&curr_tunnconf->proto. pptp.listen)->tqh_last = (addr); (&curr_tunnconf->proto. pptp.listen)->tqh_last = &(addr)->entry.tqe_next; } while (0); | |||
1824 | } | |||
1825 | TAILQ_INSERT_TAIL(&conf->pptp_confs,do { (&curr_tunnconf->proto.pptp)->entry.tqe_next = ((void *)0); (&curr_tunnconf->proto.pptp)->entry.tqe_prev = (&conf->pptp_confs)->tqh_last; *(&conf->pptp_confs )->tqh_last = (&curr_tunnconf->proto.pptp); (&conf ->pptp_confs)->tqh_last = &(&curr_tunnconf-> proto.pptp)->entry.tqe_next; } while (0) | |||
1826 | &curr_tunnconf->proto.pptp, entry)do { (&curr_tunnconf->proto.pptp)->entry.tqe_next = ((void *)0); (&curr_tunnconf->proto.pptp)->entry.tqe_prev = (&conf->pptp_confs)->tqh_last; *(&conf->pptp_confs )->tqh_last = (&curr_tunnconf->proto.pptp); (&conf ->pptp_confs)->tqh_last = &(&curr_tunnconf-> proto.pptp)->entry.tqe_next; } while (0); | |||
1827 | break; | |||
1828 | #endif | |||
1829 | #ifdef USE_NPPPD_PPPOE1 | |||
1830 | case NPPPD_TUNNEL_PPPOE3: | |||
1831 | TAILQ_INSERT_TAIL(&conf->pppoe_confs,do { (&curr_tunnconf->proto.pppoe)->entry.tqe_next = ((void *)0); (&curr_tunnconf->proto.pppoe)->entry. tqe_prev = (&conf->pppoe_confs)->tqh_last; *(&conf ->pppoe_confs)->tqh_last = (&curr_tunnconf->proto .pppoe); (&conf->pppoe_confs)->tqh_last = &(& curr_tunnconf->proto.pppoe)->entry.tqe_next; } while (0 ) | |||
1832 | &curr_tunnconf->proto.pppoe, entry)do { (&curr_tunnconf->proto.pppoe)->entry.tqe_next = ((void *)0); (&curr_tunnconf->proto.pppoe)->entry. tqe_prev = (&conf->pppoe_confs)->tqh_last; *(&conf ->pppoe_confs)->tqh_last = (&curr_tunnconf->proto .pppoe); (&conf->pppoe_confs)->tqh_last = &(& curr_tunnconf->proto.pppoe)->entry.tqe_next; } while (0 ); | |||
1833 | break; | |||
1834 | #endif | |||
1835 | default: | |||
1836 | yyerror("%s is not enabled.", | |||
1837 | npppd_tunnel_protocol_name( | |||
1838 | curr_tunnconf->protocol)); | |||
1839 | tunnconf_fini(curr_tunnconf); | |||
1840 | free(curr_tunnconf); | |||
1841 | YYERRORgoto yyerrlab; | |||
1842 | } | |||
1843 | curr_tunnconf = NULL((void *)0); | |||
1844 | } | |||
1845 | break; | |||
1846 | case 19: | |||
1847 | #line 289 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1848 | { | |||
1849 | ||||
1850 | switch (curr_tunnconf->protocol) { | |||
1851 | case NPPPD_TUNNEL_L2TP1: | |||
1852 | { | |||
1853 | struct l2tp_listen_addr *l_listen; | |||
1854 | ||||
1855 | if ((l_listen = malloc(sizeof( | |||
1856 | struct l2tp_listen_addr))) == NULL((void *)0)) { | |||
1857 | yyerror("out of memory"); | |||
1858 | YYERRORgoto yyerrlab; | |||
1859 | } | |||
1860 | l_listen->addr = yyvsp[0].v.address; | |||
1861 | TAILQ_INSERT_TAIL(&curr_tunnconf->protodo { (l_listen)->entry.tqe_next = ((void *)0); (l_listen)-> entry.tqe_prev = (&curr_tunnconf->proto .l2tp.listen)-> tqh_last; *(&curr_tunnconf->proto .l2tp.listen)->tqh_last = (l_listen); (&curr_tunnconf->proto .l2tp.listen)-> tqh_last = &(l_listen)->entry.tqe_next; } while (0) | |||
1862 | .l2tp.listen, l_listen, entry)do { (l_listen)->entry.tqe_next = ((void *)0); (l_listen)-> entry.tqe_prev = (&curr_tunnconf->proto .l2tp.listen)-> tqh_last; *(&curr_tunnconf->proto .l2tp.listen)->tqh_last = (l_listen); (&curr_tunnconf->proto .l2tp.listen)-> tqh_last = &(l_listen)->entry.tqe_next; } while (0); | |||
1863 | break; | |||
1864 | } | |||
1865 | case NPPPD_TUNNEL_PPTP2: | |||
1866 | if (yyvsp[0].v.address.ss_family == AF_INET624) { | |||
1867 | yyerror("listen on IPv6 address is not " | |||
1868 | "supported by pptp tunnel"); | |||
1869 | YYERRORgoto yyerrlab; | |||
1870 | } | |||
1871 | { | |||
1872 | struct pptp_listen_addr *p_listen; | |||
1873 | ||||
1874 | if ((p_listen = malloc(sizeof( | |||
1875 | struct pptp_listen_addr))) == NULL((void *)0)) { | |||
1876 | yyerror("out of memory"); | |||
1877 | YYERRORgoto yyerrlab; | |||
1878 | } | |||
1879 | p_listen->addr = yyvsp[0].v.address; | |||
1880 | TAILQ_INSERT_TAIL(&curr_tunnconf->protodo { (p_listen)->entry.tqe_next = ((void *)0); (p_listen)-> entry.tqe_prev = (&curr_tunnconf->proto .pptp.listen)-> tqh_last; *(&curr_tunnconf->proto .pptp.listen)->tqh_last = (p_listen); (&curr_tunnconf->proto .pptp.listen)-> tqh_last = &(p_listen)->entry.tqe_next; } while (0) | |||
1881 | .pptp.listen, p_listen, entry)do { (p_listen)->entry.tqe_next = ((void *)0); (p_listen)-> entry.tqe_prev = (&curr_tunnconf->proto .pptp.listen)-> tqh_last; *(&curr_tunnconf->proto .pptp.listen)->tqh_last = (p_listen); (&curr_tunnconf->proto .pptp.listen)-> tqh_last = &(p_listen)->entry.tqe_next; } while (0); | |||
1882 | break; | |||
1883 | } | |||
1884 | default: | |||
1885 | yyerror("listen on address is not supported " | |||
1886 | "for specified protocol.\n"); | |||
1887 | YYERRORgoto yyerrlab; | |||
1888 | } | |||
1889 | } | |||
1890 | break; | |||
1891 | case 20: | |||
1892 | #line 331 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1893 | { | |||
1894 | switch (curr_tunnconf->protocol) { | |||
1895 | case NPPPD_TUNNEL_PPPOE3: | |||
1896 | strlcpy(curr_tunnconf->proto.pppoe.if_name, yyvsp[0].v.string, | |||
1897 | sizeof(curr_tunnconf->proto.pppoe.if_name)); | |||
1898 | free(yyvsp[0].v.string); | |||
1899 | break; | |||
1900 | default: | |||
1901 | free(yyvsp[0].v.string); | |||
1902 | yyerror("listen on interface is not supported " | |||
1903 | "for specified protocol.\n"); | |||
1904 | YYERRORgoto yyerrlab; | |||
1905 | } | |||
1906 | } | |||
1907 | break; | |||
1908 | case 21: | |||
1909 | #line 345 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1910 | { | |||
1911 | curr_tunnconf->lcp_timeout = yyvsp[0].v.number; | |||
1912 | } | |||
1913 | break; | |||
1914 | case 22: | |||
1915 | #line 348 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1916 | { | |||
1917 | curr_tunnconf->lcp_max_configure = yyvsp[0].v.number; | |||
1918 | } | |||
1919 | break; | |||
1920 | case 23: | |||
1921 | #line 351 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1922 | { | |||
1923 | curr_tunnconf->lcp_max_terminate = yyvsp[0].v.number; | |||
1924 | } | |||
1925 | break; | |||
1926 | case 24: | |||
1927 | #line 354 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1928 | { | |||
1929 | curr_tunnconf->lcp_max_nak_loop = yyvsp[0].v.number; | |||
1930 | } | |||
1931 | break; | |||
1932 | case 25: | |||
1933 | #line 357 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1934 | { | |||
1935 | curr_tunnconf->mru = yyvsp[0].v.number; | |||
1936 | } | |||
1937 | break; | |||
1938 | case 26: | |||
1939 | #line 360 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1940 | { | |||
1941 | curr_tunnconf->lcp_keepalive = yyvsp[0].v.yesno; | |||
1942 | } | |||
1943 | break; | |||
1944 | case 27: | |||
1945 | #line 363 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1946 | { | |||
1947 | curr_tunnconf->lcp_keepalive_interval = yyvsp[0].v.number; | |||
1948 | } | |||
1949 | break; | |||
1950 | case 28: | |||
1951 | #line 366 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1952 | { | |||
1953 | curr_tunnconf->lcp_keepalive_retry_interval = yyvsp[0].v.number; | |||
1954 | } | |||
1955 | break; | |||
1956 | case 29: | |||
1957 | #line 369 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1958 | { | |||
1959 | curr_tunnconf->lcp_keepalive_max_retries = yyvsp[0].v.number; | |||
1960 | } | |||
1961 | break; | |||
1962 | case 30: | |||
1963 | #line 372 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1964 | { | |||
1965 | curr_tunnconf->auth_methods = yyvsp[0].v.number; | |||
1966 | } | |||
1967 | break; | |||
1968 | case 31: | |||
1969 | #line 375 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1970 | { | |||
1971 | curr_tunnconf->chap_name = yyvsp[0].v.string; | |||
1972 | } | |||
1973 | break; | |||
1974 | case 32: | |||
1975 | #line 378 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1976 | { | |||
1977 | curr_tunnconf->ipcp_timeout = yyvsp[0].v.number; | |||
1978 | } | |||
1979 | break; | |||
1980 | case 33: | |||
1981 | #line 381 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1982 | { | |||
1983 | curr_tunnconf->ipcp_max_configure = yyvsp[0].v.number; | |||
1984 | } | |||
1985 | break; | |||
1986 | case 34: | |||
1987 | #line 384 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1988 | { | |||
1989 | curr_tunnconf->ipcp_max_terminate = yyvsp[0].v.number; | |||
1990 | } | |||
1991 | break; | |||
1992 | case 35: | |||
1993 | #line 387 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
1994 | { | |||
1995 | curr_tunnconf->ipcp_max_nak_loop = yyvsp[0].v.number; | |||
1996 | } | |||
1997 | break; | |||
1998 | case 36: | |||
1999 | #line 390 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2000 | { | |||
2001 | curr_tunnconf->ccp_timeout = yyvsp[0].v.number; | |||
2002 | } | |||
2003 | break; | |||
2004 | case 37: | |||
2005 | #line 393 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2006 | { | |||
2007 | curr_tunnconf->ccp_max_configure = yyvsp[0].v.number; | |||
2008 | } | |||
2009 | break; | |||
2010 | case 38: | |||
2011 | #line 396 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2012 | { | |||
2013 | curr_tunnconf->ccp_max_terminate = yyvsp[0].v.number; | |||
2014 | } | |||
2015 | break; | |||
2016 | case 39: | |||
2017 | #line 399 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2018 | { | |||
2019 | curr_tunnconf->ccp_max_nak_loop = yyvsp[0].v.number; | |||
2020 | } | |||
2021 | break; | |||
2022 | case 40: | |||
2023 | #line 402 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2024 | { | |||
2025 | curr_tunnconf->proto.l2tp.hostname = yyvsp[0].v.string; | |||
2026 | } | |||
2027 | break; | |||
2028 | case 41: | |||
2029 | #line 405 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2030 | { | |||
2031 | curr_tunnconf->proto.l2tp.vendor_name = yyvsp[0].v.string; | |||
2032 | } | |||
2033 | break; | |||
2034 | case 42: | |||
2035 | #line 408 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2036 | { | |||
2037 | curr_tunnconf->proto.l2tp.hello_interval = yyvsp[0].v.number; | |||
2038 | } | |||
2039 | break; | |||
2040 | case 43: | |||
2041 | #line 411 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2042 | { | |||
2043 | curr_tunnconf->proto.l2tp.hello_timeout = yyvsp[0].v.number; | |||
2044 | } | |||
2045 | break; | |||
2046 | case 44: | |||
2047 | #line 414 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2048 | { | |||
2049 | curr_tunnconf->proto.l2tp.accept_dialin = yyvsp[0].v.yesno; | |||
2050 | } | |||
2051 | break; | |||
2052 | case 45: | |||
2053 | #line 417 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2054 | { | |||
2055 | curr_tunnconf->proto.l2tp.data_use_seq = yyvsp[0].v.yesno; | |||
2056 | } | |||
2057 | break; | |||
2058 | case 46: | |||
2059 | #line 420 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2060 | { | |||
2061 | curr_tunnconf->proto.l2tp.require_ipsec = yyvsp[0].v.yesno; | |||
2062 | } | |||
2063 | break; | |||
2064 | case 47: | |||
2065 | #line 423 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2066 | { | |||
2067 | curr_tunnconf->proto.l2tp.lcp_renegotiation = yyvsp[0].v.yesno; | |||
2068 | } | |||
2069 | break; | |||
2070 | case 48: | |||
2071 | #line 426 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2072 | { | |||
2073 | curr_tunnconf->proto.l2tp.force_lcp_renegotiation = yyvsp[0].v.yesno; | |||
2074 | } | |||
2075 | break; | |||
2076 | case 49: | |||
2077 | #line 429 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2078 | { | |||
2079 | curr_tunnconf->proto.l2tp.ctrl_in_pktdump = yyvsp[0].v.yesno; | |||
2080 | } | |||
2081 | break; | |||
2082 | case 50: | |||
2083 | #line 432 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2084 | { | |||
2085 | curr_tunnconf->proto.l2tp.ctrl_out_pktdump = yyvsp[0].v.yesno; | |||
2086 | } | |||
2087 | break; | |||
2088 | case 51: | |||
2089 | #line 435 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2090 | { | |||
2091 | curr_tunnconf->proto.l2tp.data_in_pktdump = yyvsp[0].v.yesno; | |||
2092 | } | |||
2093 | break; | |||
2094 | case 52: | |||
2095 | #line 438 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2096 | { | |||
2097 | curr_tunnconf->proto.l2tp.data_out_pktdump = yyvsp[0].v.yesno; | |||
2098 | } | |||
2099 | break; | |||
2100 | case 53: | |||
2101 | #line 441 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2102 | { | |||
2103 | curr_tunnconf->proto.pptp.hostname = yyvsp[0].v.string; | |||
2104 | } | |||
2105 | break; | |||
2106 | case 54: | |||
2107 | #line 444 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2108 | { | |||
2109 | curr_tunnconf->proto.pptp.vendor_name = yyvsp[0].v.string; | |||
2110 | } | |||
2111 | break; | |||
2112 | case 55: | |||
2113 | #line 447 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2114 | { | |||
2115 | curr_tunnconf->proto.pptp.echo_interval = yyvsp[0].v.number; | |||
2116 | } | |||
2117 | break; | |||
2118 | case 56: | |||
2119 | #line 450 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2120 | { | |||
2121 | curr_tunnconf->proto.pptp.echo_timeout = yyvsp[0].v.number; | |||
2122 | } | |||
2123 | break; | |||
2124 | case 57: | |||
2125 | #line 453 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2126 | { | |||
2127 | curr_tunnconf->proto.pptp.ctrl_in_pktdump = yyvsp[0].v.yesno; | |||
2128 | } | |||
2129 | break; | |||
2130 | case 58: | |||
2131 | #line 456 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2132 | { | |||
2133 | curr_tunnconf->proto.pptp.ctrl_out_pktdump = yyvsp[0].v.yesno; | |||
2134 | } | |||
2135 | break; | |||
2136 | case 59: | |||
2137 | #line 459 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2138 | { | |||
2139 | curr_tunnconf->proto.pptp.data_in_pktdump = yyvsp[0].v.yesno; | |||
2140 | } | |||
2141 | break; | |||
2142 | case 60: | |||
2143 | #line 462 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2144 | { | |||
2145 | curr_tunnconf->proto.pptp.data_out_pktdump = yyvsp[0].v.yesno; | |||
2146 | } | |||
2147 | break; | |||
2148 | case 61: | |||
2149 | #line 465 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2150 | { | |||
2151 | curr_tunnconf->proto.pppoe.service_name = yyvsp[0].v.string; | |||
2152 | } | |||
2153 | break; | |||
2154 | case 62: | |||
2155 | #line 468 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2156 | { | |||
2157 | curr_tunnconf->proto.pppoe.accept_any_service = yyvsp[0].v.yesno; | |||
2158 | } | |||
2159 | break; | |||
2160 | case 63: | |||
2161 | #line 471 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2162 | { | |||
2163 | curr_tunnconf->proto.pppoe.ac_name = yyvsp[0].v.string; | |||
2164 | } | |||
2165 | break; | |||
2166 | case 64: | |||
2167 | #line 474 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2168 | { | |||
2169 | curr_tunnconf->proto.pppoe.desc_in_pktdump = yyvsp[0].v.yesno; | |||
2170 | } | |||
2171 | break; | |||
2172 | case 65: | |||
2173 | #line 477 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2174 | { | |||
2175 | curr_tunnconf->proto.pppoe.desc_out_pktdump = yyvsp[0].v.yesno; | |||
2176 | } | |||
2177 | break; | |||
2178 | case 66: | |||
2179 | #line 480 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2180 | { | |||
2181 | curr_tunnconf->proto.pppoe.session_in_pktdump = yyvsp[0].v.yesno; | |||
2182 | } | |||
2183 | break; | |||
2184 | case 67: | |||
2185 | #line 483 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2186 | { | |||
2187 | curr_tunnconf->proto.pppoe.session_out_pktdump = yyvsp[0].v.yesno; | |||
2188 | } | |||
2189 | break; | |||
2190 | case 68: | |||
2191 | #line 486 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2192 | { | |||
2193 | curr_tunnconf->mppe_yesno = yyvsp[0].v.number; | |||
2194 | } | |||
2195 | break; | |||
2196 | case 69: | |||
2197 | #line 489 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2198 | { | |||
2199 | curr_tunnconf->mppe_keylen = yyvsp[0].v.number; | |||
2200 | } | |||
2201 | break; | |||
2202 | case 70: | |||
2203 | #line 492 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2204 | { | |||
2205 | curr_tunnconf->mppe_keystate = yyvsp[0].v.number; | |||
2206 | } | |||
2207 | break; | |||
2208 | case 71: | |||
2209 | #line 495 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2210 | { | |||
2211 | curr_tunnconf->tcp_mss_adjust = yyvsp[0].v.yesno; | |||
2212 | } | |||
2213 | break; | |||
2214 | case 72: | |||
2215 | #line 498 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2216 | { | |||
2217 | curr_tunnconf->idle_timeout = yyvsp[0].v.number; | |||
2218 | } | |||
2219 | break; | |||
2220 | case 73: | |||
2221 | #line 501 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2222 | { | |||
2223 | curr_tunnconf->ingress_filter = yyvsp[0].v.yesno; | |||
2224 | } | |||
2225 | break; | |||
2226 | case 74: | |||
2227 | #line 504 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2228 | { | |||
2229 | curr_tunnconf->callnum_check = yyvsp[0].v.yesno; | |||
2230 | } | |||
2231 | break; | |||
2232 | case 75: | |||
2233 | #line 507 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2234 | { | |||
2235 | curr_tunnconf->pipex = yyvsp[0].v.yesno; | |||
2236 | } | |||
2237 | break; | |||
2238 | case 76: | |||
2239 | #line 510 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2240 | { | |||
2241 | curr_tunnconf->debug_dump_pktin = yyvsp[0].v.number; | |||
2242 | } | |||
2243 | break; | |||
2244 | case 77: | |||
2245 | #line 513 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2246 | { | |||
2247 | curr_tunnconf->debug_dump_pktout = yyvsp[0].v.number; | |||
2248 | } | |||
2249 | break; | |||
2250 | case 78: | |||
2251 | #line 518 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2252 | { yyval.v.number = NPPPD_TUNNEL_L2TP1; } | |||
2253 | break; | |||
2254 | case 79: | |||
2255 | #line 519 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2256 | { yyval.v.number = NPPPD_TUNNEL_PPTP2; } | |||
2257 | break; | |||
2258 | case 80: | |||
2259 | #line 520 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2260 | { yyval.v.number = NPPPD_TUNNEL_PPPOE3; } | |||
2261 | break; | |||
2262 | case 81: | |||
2263 | #line 523 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2264 | { yyval.v.number = NPPPD_MPPE_ENABLED0x0001; } | |||
2265 | break; | |||
2266 | case 82: | |||
2267 | #line 524 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2268 | { yyval.v.number = NPPPD_MPPE_DISABLED0x0000; } | |||
2269 | break; | |||
2270 | case 83: | |||
2271 | #line 525 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2272 | { yyval.v.number = NPPPD_MPPE_REQUIRED0x0002; } | |||
2273 | break; | |||
2274 | case 84: | |||
2275 | #line 528 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2276 | { | |||
2277 | int retval; | |||
2278 | struct addrinfo hint, *res; | |||
2279 | ||||
2280 | memset(&hint, 0, sizeof(hint)); | |||
2281 | hint.ai_family = PF_UNSPEC0; | |||
2282 | hint.ai_socktype = SOCK_DGRAM2; /* dummy */ | |||
2283 | hint.ai_flags = AI_NUMERICHOST4; | |||
2284 | ||||
2285 | if ((retval = getaddrinfo(yyvsp[0].v.string, NULL((void *)0), &hint, &res)) | |||
2286 | != 0) { | |||
2287 | yyerror("could not parse the address %s: %s", | |||
2288 | yyvsp[0].v.string, gai_strerror(retval)); | |||
2289 | free(yyvsp[0].v.string); | |||
2290 | YYERRORgoto yyerrlab; | |||
2291 | } | |||
2292 | free(yyvsp[0].v.string); | |||
2293 | ||||
2294 | if (res->ai_family != AF_INET2 && | |||
2295 | res->ai_family != AF_INET624) { | |||
2296 | yyerror("address family(%d) is not supported", | |||
2297 | res->ai_family); | |||
2298 | freeaddrinfo(res); | |||
2299 | YYERRORgoto yyerrlab; | |||
2300 | } | |||
2301 | memcpy(&(yyval.v.address), res->ai_addr, res->ai_addrlen); | |||
2302 | ||||
2303 | freeaddrinfo(res); | |||
2304 | } | |||
2305 | break; | |||
2306 | case 85: | |||
2307 | #line 559 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2308 | { | |||
2309 | yyval.v.address = yyvsp[-1].v.address; | |||
2310 | ((struct sockaddr_in *)&(yyval.v.address))->sin_port = htons(yyvsp[0].v.number)(__uint16_t)(__builtin_constant_p(yyvsp[0].v.number) ? (__uint16_t )(((__uint16_t)(yyvsp[0].v.number) & 0xffU) << 8 | ( (__uint16_t)(yyvsp[0].v.number) & 0xff00U) >> 8) : __swap16md (yyvsp[0].v.number)); | |||
2311 | } | |||
2312 | break; | |||
2313 | case 86: | |||
2314 | #line 565 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2315 | { | |||
2316 | if (inet_aton(yyvsp[0].v.string, &(yyval.v.in4_addr)) != 1) { | |||
2317 | yyerror("could not parse the address %s", yyvsp[0].v.string); | |||
2318 | free(yyvsp[0].v.string); | |||
2319 | YYERRORgoto yyerrlab; | |||
2320 | } | |||
2321 | } | |||
2322 | break; | |||
2323 | case 87: | |||
2324 | #line 574 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2325 | { yyval.v.number = yyvsp[0].v.number; } | |||
2326 | break; | |||
2327 | case 88: | |||
2328 | #line 575 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2329 | { yyval.v.number |= yyvsp[0].v.number; } | |||
2330 | break; | |||
2331 | case 89: | |||
2332 | #line 578 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2333 | { yyval.v.number = NPPPD_AUTH_METHODS_PAP0x0001; } | |||
2334 | break; | |||
2335 | case 90: | |||
2336 | #line 579 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2337 | { yyval.v.number = NPPPD_AUTH_METHODS_CHAP0x0002; } | |||
2338 | break; | |||
2339 | case 91: | |||
2340 | #line 580 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2341 | { | |||
2342 | yyval.v.number = NPPPD_AUTH_METHODS_MSCHAPV20x0004; | |||
2343 | } | |||
2344 | break; | |||
2345 | case 92: | |||
2346 | #line 585 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2347 | { yyval.v.number = yyvsp[0].v.number; } | |||
2348 | break; | |||
2349 | case 93: | |||
2350 | #line 586 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2351 | { yyval.v.number |= yyvsp[0].v.number; } | |||
2352 | break; | |||
2353 | case 94: | |||
2354 | #line 589 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2355 | { | |||
2356 | if (yyvsp[0].v.number == 40) yyval.v.number = NPPPD_MPPE_40BIT0x0001; | |||
2357 | else if (yyvsp[0].v.number == 56) yyval.v.number = NPPPD_MPPE_56BIT0x0002; | |||
2358 | else if (yyvsp[0].v.number == 128) yyval.v.number = NPPPD_MPPE_128BIT0x0004; | |||
2359 | else { | |||
2360 | yyerror("%"PRId64"lld"": unknown mppe key length", | |||
2361 | yyval.v.number); | |||
2362 | YYERRORgoto yyerrlab; | |||
2363 | } | |||
2364 | } | |||
2365 | break; | |||
2366 | case 95: | |||
2367 | #line 601 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2368 | { yyval.v.number = yyvsp[0].v.number; } | |||
2369 | break; | |||
2370 | case 96: | |||
2371 | #line 602 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2372 | { yyval.v.number |= yyvsp[0].v.number; } | |||
2373 | break; | |||
2374 | case 97: | |||
2375 | #line 605 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2376 | { yyval.v.number = NPPPD_MPPE_STATEFUL0x0001; } | |||
2377 | break; | |||
2378 | case 98: | |||
2379 | #line 606 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2380 | { yyval.v.number = NPPPD_MPPE_STATELESS0x0002; } | |||
2381 | break; | |||
2382 | case 99: | |||
2383 | #line 609 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2384 | { yyval.v.number = yyvsp[0].v.number; } | |||
2385 | break; | |||
2386 | case 100: | |||
2387 | #line 610 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2388 | { yyval.v.number |= yyvsp[0].v.number; } | |||
2389 | break; | |||
2390 | case 101: | |||
2391 | #line 613 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2392 | { yyval.v.number = NPPPD_PROTO_BIT_IP0x0001; } | |||
2393 | break; | |||
2394 | case 102: | |||
2395 | #line 614 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2396 | { yyval.v.number = NPPPD_PROTO_BIT_LCP0x0002; } | |||
2397 | break; | |||
2398 | case 103: | |||
2399 | #line 615 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2400 | { yyval.v.number = NPPPD_PROTO_BIT_PAP0x0004; } | |||
2401 | break; | |||
2402 | case 104: | |||
2403 | #line 616 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2404 | { yyval.v.number = NPPPD_PROTO_BIT_CHAP0x0008; } | |||
2405 | break; | |||
2406 | case 105: | |||
2407 | #line 617 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2408 | { yyval.v.number = NPPPD_PROTO_BIT_EAP0x0010; } | |||
2409 | break; | |||
2410 | case 106: | |||
2411 | #line 618 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2412 | { yyval.v.number = NPPPD_PROTO_BIT_MPPE0x0020; } | |||
2413 | break; | |||
2414 | case 107: | |||
2415 | #line 619 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2416 | { yyval.v.number = NPPPD_PROTO_BIT_CCP0x0040; } | |||
2417 | break; | |||
2418 | case 108: | |||
2419 | #line 620 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2420 | { yyval.v.number = NPPPD_PROTO_BIT_IPCP0x0080; } | |||
2421 | break; | |||
2422 | case 109: | |||
2423 | #line 626 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2424 | { | |||
2425 | struct authconf *n; | |||
2426 | ||||
2427 | if (authconf_find(yyvsp[-2].v.string) != NULL((void *)0)) { | |||
2428 | yyerror("authentication name %s is already in " | |||
2429 | "use.", yyvsp[-2].v.string); | |||
2430 | free(yyvsp[-2].v.string); | |||
2431 | YYERRORgoto yyerrlab; | |||
2432 | } | |||
2433 | if ((n = malloc(sizeof(struct authconf))) == NULL((void *)0)) { | |||
2434 | yyerror("out of memory"); | |||
2435 | free(yyvsp[-2].v.string); | |||
2436 | YYERRORgoto yyerrlab; | |||
2437 | } | |||
2438 | authconf_init(n); | |||
2439 | strlcpy(n->name, yyvsp[-2].v.string, sizeof(n->name)); | |||
2440 | free(yyvsp[-2].v.string); | |||
2441 | n->auth_type = yyvsp[0].v.number; | |||
2442 | if (yyvsp[0].v.number == NPPPD_AUTH_TYPE_RADIUS2) { | |||
2443 | TAILQ_INIT(&n->data.radius.auth.servers)do { (&n->data.radius.auth.servers)->tqh_first = (( void *)0); (&n->data.radius.auth.servers)->tqh_last = &(&n->data.radius.auth.servers)->tqh_first; } while (0); | |||
2444 | TAILQ_INIT(&n->data.radius.acct.servers)do { (&n->data.radius.acct.servers)->tqh_first = (( void *)0); (&n->data.radius.acct.servers)->tqh_last = &(&n->data.radius.acct.servers)->tqh_first; } while (0); | |||
2445 | } | |||
2446 | curr_authconf = n; | |||
2447 | } | |||
2448 | break; | |||
2449 | case 110: | |||
2450 | #line 649 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2451 | { | |||
2452 | TAILQ_INSERT_TAIL(&conf->authconfs, curr_authconf,do { (curr_authconf)->entry.tqe_next = ((void *)0); (curr_authconf )->entry.tqe_prev = (&conf->authconfs)->tqh_last ; *(&conf->authconfs)->tqh_last = (curr_authconf); ( &conf->authconfs)->tqh_last = &(curr_authconf)-> entry.tqe_next; } while (0) | |||
2453 | entry)do { (curr_authconf)->entry.tqe_next = ((void *)0); (curr_authconf )->entry.tqe_prev = (&conf->authconfs)->tqh_last ; *(&conf->authconfs)->tqh_last = (curr_authconf); ( &conf->authconfs)->tqh_last = &(curr_authconf)-> entry.tqe_next; } while (0); | |||
2454 | curr_authconf = NULL((void *)0); | |||
2455 | } | |||
2456 | break; | |||
2457 | case 114: | |||
2458 | #line 661 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2459 | { | |||
2460 | curr_authconf->username_suffix = yyvsp[0].v.string; | |||
2461 | } | |||
2462 | break; | |||
2463 | case 115: | |||
2464 | #line 664 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2465 | { | |||
2466 | curr_authconf->eap_capable = yyvsp[0].v.yesno; | |||
2467 | } | |||
2468 | break; | |||
2469 | case 116: | |||
2470 | #line 667 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2471 | { | |||
2472 | curr_authconf->strip_nt_domain = yyvsp[0].v.yesno; | |||
2473 | } | |||
2474 | break; | |||
2475 | case 117: | |||
2476 | #line 670 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2477 | { | |||
2478 | curr_authconf->strip_atmark_realm = yyvsp[0].v.yesno; | |||
2479 | } | |||
2480 | break; | |||
2481 | case 118: | |||
2482 | #line 673 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2483 | { | |||
2484 | strlcpy(curr_authconf->users_file_path, yyvsp[0].v.string, | |||
2485 | sizeof(curr_authconf->users_file_path)); | |||
2486 | free(yyvsp[0].v.string); | |||
2487 | } | |||
2488 | break; | |||
2489 | case 119: | |||
2490 | #line 678 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2491 | { | |||
2492 | curr_authconf->user_max_session = yyvsp[0].v.number; | |||
2493 | } | |||
2494 | break; | |||
2495 | case 120: | |||
2496 | #line 681 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2497 | { | |||
2498 | if (curr_authconf->auth_type != NPPPD_AUTH_TYPE_RADIUS2){ | |||
2499 | yyerror("`authentication-server' can not be " | |||
2500 | "used for this type."); | |||
2501 | YYERRORgoto yyerrlab; | |||
2502 | } | |||
2503 | curr_radconf = &curr_authconf->data.radius.auth; | |||
2504 | } | |||
2505 | break; | |||
2506 | case 122: | |||
2507 | #line 689 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2508 | { | |||
2509 | if (curr_authconf->auth_type != NPPPD_AUTH_TYPE_RADIUS2){ | |||
2510 | yyerror("`accounting-server' can not be used " | |||
2511 | "for this type."); | |||
2512 | YYERRORgoto yyerrlab; | |||
2513 | } | |||
2514 | curr_radconf = &curr_authconf->data.radius.acct; | |||
2515 | } | |||
2516 | break; | |||
2517 | case 124: | |||
2518 | #line 699 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2519 | { yyval.v.number = 0; } | |||
2520 | break; | |||
2521 | case 125: | |||
2522 | #line 700 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2523 | { yyval.v.number = yyvsp[0].v.number; } | |||
2524 | break; | |||
2525 | case 126: | |||
2526 | #line 703 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2527 | { yyval.v.number = NPPPD_AUTH_TYPE_LOCAL1; } | |||
2528 | break; | |||
2529 | case 127: | |||
2530 | #line 704 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2531 | { yyval.v.number = NPPPD_AUTH_TYPE_RADIUS2; } | |||
2532 | break; | |||
2533 | case 131: | |||
2534 | #line 712 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2535 | { | |||
2536 | int cnt; | |||
2537 | struct radserver *n; | |||
2538 | ||||
2539 | if (strlen(yyvsp[0].v.string) > MAX_RADIUS_SECRET128 - 1) { | |||
2540 | yyerror("`secret' is too long. " | |||
2541 | "use less than %d chars.", | |||
2542 | MAX_RADIUS_SECRET128 - 1); | |||
2543 | YYERRORgoto yyerrlab; | |||
2544 | } | |||
2545 | cnt = 0; | |||
2546 | TAILQ_FOREACH(n, &curr_radconf->servers, entry)for((n) = ((&curr_radconf->servers)->tqh_first); (n ) != ((void *)0); (n) = ((n)->entry.tqe_next)) { | |||
2547 | cnt++; | |||
2548 | } | |||
2549 | if (cnt >= MAX_RADIUS_SERVERS16) { | |||
2550 | yyerror("too many radius servers. use less " | |||
2551 | "than or equal to %d servers.", | |||
2552 | MAX_RADIUS_SERVERS16); | |||
2553 | YYERRORgoto yyerrlab; | |||
2554 | } | |||
2555 | if ((n = malloc(sizeof(struct radserver))) == NULL((void *)0)) { | |||
2556 | yyerror("out of memory"); | |||
2557 | YYERRORgoto yyerrlab; | |||
2558 | } | |||
2559 | n->address = yyvsp[-3].v.address; | |||
2560 | ((struct sockaddr_in *)&n->address)->sin_port = | |||
2561 | htons(yyvsp[-2].v.number)(__uint16_t)(__builtin_constant_p(yyvsp[-2].v.number) ? (__uint16_t )(((__uint16_t)(yyvsp[-2].v.number) & 0xffU) << 8 | ((__uint16_t)(yyvsp[-2].v.number) & 0xff00U) >> 8) : __swap16md(yyvsp[-2].v.number)); | |||
2562 | n->secret = yyvsp[0].v.string; | |||
2563 | TAILQ_INSERT_TAIL(&curr_radconf->servers, n, entry)do { (n)->entry.tqe_next = ((void *)0); (n)->entry.tqe_prev = (&curr_radconf->servers)->tqh_last; *(&curr_radconf ->servers)->tqh_last = (n); (&curr_radconf->servers )->tqh_last = &(n)->entry.tqe_next; } while (0); | |||
2564 | } | |||
2565 | break; | |||
2566 | case 132: | |||
2567 | #line 742 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2568 | { | |||
2569 | curr_radconf->timeout = yyvsp[0].v.number; | |||
2570 | } | |||
2571 | break; | |||
2572 | case 133: | |||
2573 | #line 745 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2574 | { | |||
2575 | curr_radconf->max_tries = yyvsp[0].v.number; | |||
2576 | } | |||
2577 | break; | |||
2578 | case 134: | |||
2579 | #line 748 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2580 | { | |||
2581 | curr_radconf->max_failovers = yyvsp[0].v.number; | |||
2582 | } | |||
2583 | break; | |||
2584 | case 135: | |||
2585 | #line 755 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2586 | { | |||
2587 | int cnt; | |||
2588 | struct ipcpconf *n; | |||
2589 | ||||
2590 | cnt = 0; | |||
2591 | /* | |||
2592 | TAILQ_FOREACH(n, &conf->ipcpconfs, entry) { | |||
2593 | cnt++; | |||
2594 | } | |||
2595 | if (cnt >= NPPPD_MAX_POOL) { | |||
2596 | yyerror("too many `ipcp' settings. it must be " | |||
2597 | "less than or euals to %d.", | |||
2598 | NPPPD_MAX_POOL); | |||
2599 | YYERROR; | |||
2600 | } | |||
2601 | */ | |||
2602 | ||||
2603 | if (ipcpconf_find(yyvsp[0].v.string) != NULL((void *)0)) { | |||
2604 | yyerror("ipcp name %s is already in use.", yyvsp[0].v.string); | |||
2605 | free(yyvsp[0].v.string); | |||
2606 | YYERRORgoto yyerrlab; | |||
2607 | } | |||
2608 | if ((n = malloc(sizeof(struct ipcpconf))) == NULL((void *)0)) { | |||
2609 | yyerror("out of memory"); | |||
2610 | free(yyvsp[0].v.string); | |||
2611 | YYERRORgoto yyerrlab; | |||
2612 | } | |||
2613 | ipcpconf_init(n); | |||
2614 | strlcpy(n->name, yyvsp[0].v.string, sizeof(n->name)); | |||
2615 | free(yyvsp[0].v.string); | |||
2616 | curr_ipcpconf = n; | |||
2617 | } | |||
2618 | break; | |||
2619 | case 136: | |||
2620 | #line 786 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2621 | { | |||
2622 | TAILQ_INSERT_TAIL(&conf->ipcpconfs, curr_ipcpconf,do { (curr_ipcpconf)->entry.tqe_next = ((void *)0); (curr_ipcpconf )->entry.tqe_prev = (&conf->ipcpconfs)->tqh_last ; *(&conf->ipcpconfs)->tqh_last = (curr_ipcpconf); ( &conf->ipcpconfs)->tqh_last = &(curr_ipcpconf)-> entry.tqe_next; } while (0) | |||
2623 | entry)do { (curr_ipcpconf)->entry.tqe_next = ((void *)0); (curr_ipcpconf )->entry.tqe_prev = (&conf->ipcpconfs)->tqh_last ; *(&conf->ipcpconfs)->tqh_last = (curr_ipcpconf); ( &conf->ipcpconfs)->tqh_last = &(curr_ipcpconf)-> entry.tqe_next; } while (0); | |||
2624 | curr_ipcpconf = NULL((void *)0); | |||
2625 | } | |||
2626 | break; | |||
2627 | case 140: | |||
2628 | #line 798 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2629 | { | |||
2630 | if (yyvsp[0].v.number != 1) { | |||
2631 | if (in_addr_range_list_add( | |||
2632 | &curr_ipcpconf->dynamic_pool, yyvsp[-1].v.string) != 0) { | |||
2633 | yyerror("out of memory"); | |||
2634 | free(yyvsp[-1].v.string); | |||
2635 | YYERRORgoto yyerrlab; | |||
2636 | } | |||
2637 | } | |||
2638 | if (in_addr_range_list_add( | |||
2639 | &curr_ipcpconf->static_pool, yyvsp[-1].v.string) != 0) { | |||
2640 | yyerror("out of memory"); | |||
2641 | free(yyvsp[-1].v.string); | |||
2642 | YYERRORgoto yyerrlab; | |||
2643 | } | |||
2644 | free(yyvsp[-1].v.string); | |||
2645 | } | |||
2646 | break; | |||
2647 | case 141: | |||
2648 | #line 815 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2649 | { | |||
2650 | curr_ipcpconf->dns_use_resolver = true1; | |||
2651 | curr_ipcpconf->dns_servers[0].s_addr = 0; | |||
2652 | curr_ipcpconf->dns_servers[1].s_addr = 0; | |||
2653 | } | |||
2654 | break; | |||
2655 | case 142: | |||
2656 | #line 820 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2657 | { | |||
2658 | curr_ipcpconf->dns_use_resolver = false0; | |||
2659 | curr_ipcpconf->dns_servers[0] = yyvsp[-1].v.in4_addr; | |||
2660 | curr_ipcpconf->dns_servers[1] = yyvsp[0].v.in4_addr; | |||
2661 | } | |||
2662 | break; | |||
2663 | case 143: | |||
2664 | #line 825 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2665 | { | |||
2666 | curr_ipcpconf->dns_use_resolver = false0; | |||
2667 | curr_ipcpconf->dns_servers[0] = yyvsp[0].v.in4_addr; | |||
2668 | curr_ipcpconf->dns_servers[1].s_addr = 0; | |||
2669 | } | |||
2670 | break; | |||
2671 | case 144: | |||
2672 | #line 830 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2673 | { | |||
2674 | curr_ipcpconf->nbns_servers[0] = yyvsp[-1].v.in4_addr; | |||
2675 | curr_ipcpconf->nbns_servers[1] = yyvsp[0].v.in4_addr; | |||
2676 | } | |||
2677 | break; | |||
2678 | case 145: | |||
2679 | #line 834 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2680 | { | |||
2681 | curr_ipcpconf->nbns_servers[0] = yyvsp[0].v.in4_addr; | |||
2682 | curr_ipcpconf->nbns_servers[1].s_addr = 0; | |||
2683 | } | |||
2684 | break; | |||
2685 | case 146: | |||
2686 | #line 838 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2687 | { | |||
2688 | curr_ipcpconf->allow_user_select = yyvsp[0].v.yesno; | |||
2689 | } | |||
2690 | break; | |||
2691 | case 147: | |||
2692 | #line 841 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2693 | { | |||
2694 | curr_ipcpconf->max_session = yyvsp[0].v.number; | |||
2695 | } | |||
2696 | break; | |||
2697 | case 148: | |||
2698 | #line 846 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2699 | { yyval.v.number = 0; } | |||
2700 | break; | |||
2701 | case 149: | |||
2702 | #line 847 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2703 | { yyval.v.number = 0; } | |||
2704 | break; | |||
2705 | case 150: | |||
2706 | #line 848 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2707 | { yyval.v.number = 1; } | |||
2708 | break; | |||
2709 | case 151: | |||
2710 | #line 855 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2711 | { | |||
2712 | int cnt; | |||
2713 | struct iface *n; | |||
2714 | struct ipcpconf *ipcp; | |||
2715 | ||||
2716 | cnt = 0; | |||
2717 | TAILQ_FOREACH(n, &conf->ifaces, entry)for((n) = ((&conf->ifaces)->tqh_first); (n) != ((void *)0); (n) = ((n)->entry.tqe_next)) { | |||
2718 | cnt++; | |||
2719 | } | |||
2720 | if (cnt >= NPPPD_MAX_IFACE8) { | |||
2721 | yyerror("too many interfaces. use less than " | |||
2722 | "or equal to %d", NPPPD_MAX_IFACE8); | |||
2723 | YYERRORgoto yyerrlab; | |||
2724 | } | |||
2725 | ||||
2726 | if ((ipcp = ipcpconf_find(yyvsp[0].v.string)) == NULL((void *)0)) { | |||
2727 | yyerror("ipcp %s is not found", yyvsp[0].v.string); | |||
2728 | free(yyvsp[-4].v.string); | |||
2729 | YYERRORgoto yyerrlab; | |||
2730 | } | |||
2731 | if (iface_find(yyvsp[-4].v.string) != NULL((void *)0)) { | |||
2732 | yyerror("interface %s is already in used.", yyvsp[-4].v.string); | |||
2733 | free(yyvsp[-4].v.string); | |||
2734 | YYERRORgoto yyerrlab; | |||
2735 | } | |||
2736 | ||||
2737 | if ((n = calloc(1, sizeof(struct iface))) == NULL((void *)0)) { | |||
2738 | yyerror("out of memory"); | |||
2739 | free(yyvsp[-4].v.string); | |||
2740 | YYERRORgoto yyerrlab; | |||
2741 | } | |||
2742 | strlcpy(n->name, yyvsp[-4].v.string, sizeof(n->name)); | |||
2743 | free(yyvsp[-4].v.string); | |||
2744 | n->ip4addr = yyvsp[-2].v.in4_addr; | |||
2745 | if (strncmp(n->name, "pppx", 4) == 0) | |||
2746 | n->is_pppx = true1; | |||
2747 | ||||
2748 | n->ipcpconf = ipcp; | |||
2749 | TAILQ_INSERT_TAIL(&conf->ifaces, n, entry)do { (n)->entry.tqe_next = ((void *)0); (n)->entry.tqe_prev = (&conf->ifaces)->tqh_last; *(&conf->ifaces )->tqh_last = (n); (&conf->ifaces)->tqh_last = & (n)->entry.tqe_next; } while (0); | |||
2750 | } | |||
2751 | break; | |||
2752 | case 152: | |||
2753 | #line 900 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2754 | { | |||
2755 | struct authconf *auth; | |||
2756 | struct tunnconf *tunn; | |||
2757 | struct iface *iface; | |||
2758 | struct confbind *n; | |||
2759 | ||||
2760 | if ((tunn = tunnconf_find(yyvsp[-5].v.string)) == NULL((void *)0)) { | |||
2761 | yyerror("tunnel %s is not found", yyvsp[-5].v.string); | |||
2762 | free(yyvsp[-5].v.string); | |||
2763 | free(yyvsp[-2].v.string); | |||
2764 | free(yyvsp[0].v.string); | |||
2765 | YYERRORgoto yyerrlab; | |||
2766 | } | |||
2767 | if ((auth = authconf_find(yyvsp[-2].v.string)) == NULL((void *)0)) { | |||
2768 | yyerror("authentication %s is not found", yyvsp[-2].v.string); | |||
2769 | free(yyvsp[-5].v.string); | |||
2770 | free(yyvsp[-2].v.string); | |||
2771 | free(yyvsp[0].v.string); | |||
2772 | YYERRORgoto yyerrlab; | |||
2773 | } | |||
2774 | if ((iface = iface_find(yyvsp[0].v.string)) == NULL((void *)0)) { | |||
2775 | yyerror("interface %s is not found", yyvsp[0].v.string); | |||
2776 | free(yyvsp[-5].v.string); | |||
2777 | free(yyvsp[-2].v.string); | |||
2778 | free(yyvsp[0].v.string); | |||
2779 | YYERRORgoto yyerrlab; | |||
2780 | } | |||
2781 | if ((n = malloc(sizeof(struct confbind))) == NULL((void *)0)) { | |||
2782 | yyerror("out of memory"); | |||
2783 | free(yyvsp[-5].v.string); | |||
2784 | free(yyvsp[-2].v.string); | |||
2785 | free(yyvsp[0].v.string); | |||
2786 | YYERRORgoto yyerrlab; | |||
2787 | } | |||
2788 | n->tunnconf = tunn; | |||
2789 | n->authconf = auth; | |||
2790 | n->iface = iface; | |||
2791 | TAILQ_INSERT_TAIL(&conf->confbinds, n, entry)do { (n)->entry.tqe_next = ((void *)0); (n)->entry.tqe_prev = (&conf->confbinds)->tqh_last; *(&conf->confbinds )->tqh_last = (n); (&conf->confbinds)->tqh_last = &(n)->entry.tqe_next; } while (0); | |||
2792 | } | |||
2793 | break; | |||
2794 | case 153: | |||
2795 | #line 941 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2796 | { yyval.v.yesno = true1; } | |||
2797 | break; | |||
2798 | case 154: | |||
2799 | #line 942 "/usr/src/usr.sbin/npppd/npppd/parse.y" | |||
2800 | { yyval.v.yesno = false0; } | |||
2801 | break; | |||
2802 | #line 2795 "parse.c" | |||
2803 | } | |||
2804 | yyssp -= yym; | |||
2805 | yystate = *yyssp; | |||
2806 | yyvsp -= yym; | |||
2807 | yym = yylhs[yyn]; | |||
2808 | if (yystate == 0 && yym == 0) | |||
2809 | { | |||
2810 | #if YYDEBUG0 | |||
2811 | if (yydebug) | |||
2812 | printf("%sdebug: after reduction, shifting from state 0 to\ | |||
2813 | state %d\n", YYPREFIX"yy", YYFINAL1); | |||
2814 | #endif | |||
2815 | yystate = YYFINAL1; | |||
2816 | *++yyssp = YYFINAL1; | |||
2817 | *++yyvsp = yyval; | |||
2818 | if (yychar < 0) | |||
2819 | { | |||
2820 | if ((yychar = yylex()) < 0) yychar = 0; | |||
2821 | #if YYDEBUG0 | |||
2822 | if (yydebug) | |||
2823 | { | |||
2824 | yys = 0; | |||
2825 | if (yychar <= YYMAXTOKEN371) yys = yyname[yychar]; | |||
2826 | if (!yys) yys = "illegal-symbol"; | |||
2827 | printf("%sdebug: state %d, reading %d (%s)\n", | |||
2828 | YYPREFIX"yy", YYFINAL1, yychar, yys); | |||
2829 | } | |||
2830 | #endif | |||
2831 | } | |||
2832 | if (yychar == 0) goto yyaccept; | |||
2833 | goto yyloop; | |||
2834 | } | |||
2835 | if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && | |||
2836 | yyn <= YYTABLESIZE1278 && yycheck[yyn] == yystate) | |||
2837 | yystate = yytable[yyn]; | |||
2838 | else | |||
2839 | yystate = yydgoto[yym]; | |||
2840 | #if YYDEBUG0 | |||
2841 | if (yydebug) | |||
2842 | printf("%sdebug: after reduction, shifting from state %d \ | |||
2843 | to state %d\n", YYPREFIX"yy", *yyssp, yystate); | |||
2844 | #endif | |||
2845 | if (yyssp >= yysslim && yygrowstack()) | |||
2846 | { | |||
2847 | goto yyoverflow; | |||
2848 | } | |||
2849 | *++yyssp = yystate; | |||
2850 | *++yyvsp = yyval; | |||
2851 | goto yyloop; | |||
2852 | yyoverflow: | |||
2853 | yyerror("yacc stack overflow"); | |||
2854 | yyabort: | |||
2855 | if (yyss) | |||
2856 | free(yyss); | |||
2857 | if (yyvs) | |||
2858 | free(yyvs); | |||
2859 | yyss = yyssp = NULL((void *)0); | |||
2860 | yyvs = yyvsp = NULL((void *)0); | |||
2861 | yystacksize = 0; | |||
2862 | return (1); | |||
2863 | yyaccept: | |||
2864 | if (yyss) | |||
2865 | free(yyss); | |||
2866 | if (yyvs) | |||
2867 | free(yyvs); | |||
2868 | yyss = yyssp = NULL((void *)0); | |||
2869 | yyvs = yyvsp = NULL((void *)0); | |||
2870 | yystacksize = 0; | |||
2871 | return (0); | |||
2872 | } |