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