File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / ipsec-tools / src / racoon / cfparse.c
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Sun Jun 15 16:37:11 2014 UTC (10 years ago) by misho
Branches: ipsec-tools, MAIN
CVS tags: v0_8_2p2, v0_8_1p0, v0_8_1, HEAD
ipsec-tools 0.8.1

    1: /* A Bison parser, made by GNU Bison 2.6.2.  */
    2: 
    3: /* Bison implementation for Yacc-like parsers in C
    4:    
    5:       Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
    6:    
    7:    This program is free software: you can redistribute it and/or modify
    8:    it under the terms of the GNU General Public License as published by
    9:    the Free Software Foundation, either version 3 of the License, or
   10:    (at your option) any later version.
   11:    
   12:    This program is distributed in the hope that it will be useful,
   13:    but WITHOUT ANY WARRANTY; without even the implied warranty of
   14:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15:    GNU General Public License for more details.
   16:    
   17:    You should have received a copy of the GNU General Public License
   18:    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
   19: 
   20: /* As a special exception, you may create a larger work that contains
   21:    part or all of the Bison parser skeleton and distribute that work
   22:    under terms of your choice, so long as that work isn't itself a
   23:    parser generator using the skeleton or a modified version thereof
   24:    as a parser skeleton.  Alternatively, if you modify or redistribute
   25:    the parser skeleton itself, you may (at your option) remove this
   26:    special exception, which will cause the skeleton and the resulting
   27:    Bison output files to be licensed under the GNU General Public
   28:    License without this special exception.
   29:    
   30:    This special exception was added by the Free Software Foundation in
   31:    version 2.2 of Bison.  */
   32: 
   33: /* C LALR(1) parser skeleton written by Richard Stallman, by
   34:    simplifying the original so-called "semantic" parser.  */
   35: 
   36: /* All symbols defined below should begin with yy or YY, to avoid
   37:    infringing on user name space.  This should be done even for local
   38:    variables, as they might otherwise be expanded by user macros.
   39:    There are some unavoidable exceptions within include files to
   40:    define necessary library symbols; they are noted "INFRINGES ON
   41:    USER NAME SPACE" below.  */
   42: 
   43: /* Identify Bison output.  */
   44: #define YYBISON 1
   45: 
   46: /* Bison version.  */
   47: #define YYBISON_VERSION "2.6.2"
   48: 
   49: /* Skeleton name.  */
   50: #define YYSKELETON_NAME "yacc.c"
   51: 
   52: /* Pure parsers.  */
   53: #define YYPURE 0
   54: 
   55: /* Push parsers.  */
   56: #define YYPUSH 0
   57: 
   58: /* Pull parsers.  */
   59: #define YYPULL 1
   60: 
   61: 
   62: 
   63: 
   64: /* Copy the first part of user declarations.  */
   65: /* Line 336 of yacc.c  */
   66: #line 5 "cfparse.y"
   67: 
   68: /*
   69:  * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 and 2003 WIDE Project.
   70:  * All rights reserved.
   71:  *
   72:  * Redistribution and use in source and binary forms, with or without
   73:  * modification, are permitted provided that the following conditions
   74:  * are met:
   75:  * 1. Redistributions of source code must retain the above copyright
   76:  *    notice, this list of conditions and the following disclaimer.
   77:  * 2. Redistributions in binary form must reproduce the above copyright
   78:  *    notice, this list of conditions and the following disclaimer in the
   79:  *    documentation and/or other materials provided with the distribution.
   80:  * 3. Neither the name of the project nor the names of its contributors
   81:  *    may be used to endorse or promote products derived from this software
   82:  *    without specific prior written permission.
   83:  *
   84:  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
   85:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   86:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   87:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
   88:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   89:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   90:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   91:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   92:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   93:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   94:  * SUCH DAMAGE.
   95:  */
   96: 
   97: #include "config.h"
   98: 
   99: #include <sys/types.h>
  100: #include <sys/param.h>
  101: #include <sys/queue.h>
  102: #include <sys/socket.h>
  103: 
  104: #include <netinet/in.h>
  105: #include PATH_IPSEC_H
  106: 
  107: #ifdef ENABLE_HYBRID
  108: #include <arpa/inet.h>
  109: #endif
  110: 
  111: #include <stdlib.h>
  112: #include <stdio.h>
  113: #include <string.h>
  114: #include <errno.h>
  115: #include <netdb.h>
  116: #include <pwd.h>
  117: #include <grp.h>
  118: 
  119: #include "var.h"
  120: #include "misc.h"
  121: #include "vmbuf.h"
  122: #include "plog.h"
  123: #include "sockmisc.h"
  124: #include "str2val.h"
  125: #include "genlist.h"
  126: #include "debug.h"
  127: 
  128: #include "admin.h"
  129: #include "privsep.h"
  130: #include "cfparse_proto.h"
  131: #include "cftoken_proto.h"
  132: #include "algorithm.h"
  133: #include "localconf.h"
  134: #include "policy.h"
  135: #include "sainfo.h"
  136: #include "oakley.h"
  137: #include "pfkey.h"
  138: #include "remoteconf.h"
  139: #include "grabmyaddr.h"
  140: #include "isakmp_var.h"
  141: #include "handler.h"
  142: #include "isakmp.h"
  143: #include "nattraversal.h"
  144: #include "isakmp_frag.h"
  145: #ifdef ENABLE_HYBRID
  146: #include "resolv.h"
  147: #include "isakmp_unity.h"
  148: #include "isakmp_xauth.h"
  149: #include "isakmp_cfg.h"
  150: #endif
  151: #include "ipsec_doi.h"
  152: #include "strnames.h"
  153: #include "gcmalloc.h"
  154: #ifdef HAVE_GSSAPI
  155: #include "gssapi.h"
  156: #endif
  157: #include "vendorid.h"
  158: #include "rsalist.h"
  159: #include "crypto_openssl.h"
  160: 
  161: struct secprotospec {
  162: 	int prop_no;
  163: 	int trns_no;
  164: 	int strength;		/* for isakmp/ipsec */
  165: 	int encklen;		/* for isakmp/ipsec */
  166: 	time_t lifetime;	/* for isakmp */
  167: 	int lifebyte;		/* for isakmp */
  168: 	int proto_id;		/* for ipsec (isakmp?) */
  169: 	int ipsec_level;	/* for ipsec */
  170: 	int encmode;		/* for ipsec */
  171: 	int vendorid;		/* for isakmp */
  172: 	char *gssid;
  173: 	struct sockaddr *remote;
  174: 	int algclass[MAXALGCLASS];
  175: 
  176: 	struct secprotospec *next;	/* the tail is the most prefiered. */
  177: 	struct secprotospec *prev;
  178: };
  179: 
  180: static int num2dhgroup[] = {
  181: 	0,
  182: 	OAKLEY_ATTR_GRP_DESC_MODP768,
  183: 	OAKLEY_ATTR_GRP_DESC_MODP1024,
  184: 	OAKLEY_ATTR_GRP_DESC_EC2N155,
  185: 	OAKLEY_ATTR_GRP_DESC_EC2N185,
  186: 	OAKLEY_ATTR_GRP_DESC_MODP1536,
  187: 	0,
  188: 	0,
  189: 	0,
  190: 	0,
  191: 	0,
  192: 	0,
  193: 	0,
  194: 	0,
  195: 	OAKLEY_ATTR_GRP_DESC_MODP2048,
  196: 	OAKLEY_ATTR_GRP_DESC_MODP3072,
  197: 	OAKLEY_ATTR_GRP_DESC_MODP4096,
  198: 	OAKLEY_ATTR_GRP_DESC_MODP6144,
  199: 	OAKLEY_ATTR_GRP_DESC_MODP8192
  200: };
  201: 
  202: static struct remoteconf *cur_rmconf;
  203: static int tmpalgtype[MAXALGCLASS];
  204: static struct sainfo *cur_sainfo;
  205: static int cur_algclass;
  206: static int oldloglevel = LLV_BASE;
  207: 
  208: static struct secprotospec *newspspec __P((void));
  209: static void insspspec __P((struct remoteconf *, struct secprotospec *));
  210: void dupspspec_list __P((struct remoteconf *dst, struct remoteconf *src));
  211: void flushspspec __P((struct remoteconf *));
  212: static void adminsock_conf __P((vchar_t *, vchar_t *, vchar_t *, int));
  213: 
  214: static int set_isakmp_proposal __P((struct remoteconf *));
  215: static void clean_tmpalgtype __P((void));
  216: static int expand_isakmpspec __P((int, int, int *,
  217: 	int, int, time_t, int, int, int, char *, struct remoteconf *));
  218: 
  219: void freeetypes (struct etypes **etypes);
  220: 
  221: static int load_x509(const char *file, char **filenameptr,
  222: 		     vchar_t **certptr)
  223: {
  224: 	char path[PATH_MAX];
  225: 
  226: 	getpathname(path, sizeof(path), LC_PATHTYPE_CERT, file);
  227: 	*certptr = eay_get_x509cert(path);
  228: 	if (*certptr == NULL)
  229: 		return -1;
  230: 
  231: 	*filenameptr = racoon_strdup(file);
  232: 	STRDUP_FATAL(*filenameptr);
  233: 
  234: 	return 0;
  235: }
  236: 
  237: static int process_rmconf()
  238: {
  239: 
  240: 	/* check a exchange mode */
  241: 	if (cur_rmconf->etypes == NULL) {
  242: 		yyerror("no exchange mode specified.\n");
  243: 		return -1;
  244: 	}
  245: 
  246: 	if (cur_rmconf->idvtype == IDTYPE_UNDEFINED)
  247: 		cur_rmconf->idvtype = IDTYPE_ADDRESS;
  248: 
  249: 	if (cur_rmconf->idvtype == IDTYPE_ASN1DN) {
  250: 		if (cur_rmconf->mycertfile) {
  251: 			if (cur_rmconf->idv)
  252: 				yywarn("Both CERT and ASN1 ID "
  253: 				       "are set. Hope this is OK.\n");
  254: 			/* TODO: Preparse the DN here */
  255: 		} else if (cur_rmconf->idv) {
  256: 			/* OK, using asn1dn without X.509. */
  257: 		} else {
  258: 			yyerror("ASN1 ID not specified "
  259: 				"and no CERT defined!\n");
  260: 			return -1;
  261: 		}
  262: 	}
  263: 
  264: 	if (duprmconf_finish(cur_rmconf))
  265: 		return -1;
  266: 
  267: 	if (set_isakmp_proposal(cur_rmconf) != 0)
  268: 		return -1;
  269: 
  270: 	/* DH group settting if aggressive mode is there. */
  271: 	if (check_etypeok(cur_rmconf, (void*) ISAKMP_ETYPE_AGG)) {
  272: 		struct isakmpsa *p;
  273: 		int b = 0;
  274: 
  275: 		/* DH group */
  276: 		for (p = cur_rmconf->proposal; p; p = p->next) {
  277: 			if (b == 0 || (b && b == p->dh_group)) {
  278: 				b = p->dh_group;
  279: 				continue;
  280: 			}
  281: 			yyerror("DH group must be equal "
  282: 				"in all proposals "
  283: 				"when aggressive mode is "
  284: 				"used.\n");
  285: 			return -1;
  286: 		}
  287: 		cur_rmconf->dh_group = b;
  288: 
  289: 		if (cur_rmconf->dh_group == 0) {
  290: 			yyerror("DH group must be set in the proposal.\n");
  291: 			return -1;
  292: 		}
  293: 
  294: 		/* DH group settting if PFS is required. */
  295: 		if (oakley_setdhgroup(cur_rmconf->dh_group,
  296: 				&cur_rmconf->dhgrp) < 0) {
  297: 			yyerror("failed to set DH value.\n");
  298: 			return -1;
  299: 		}
  300: 	}
  301: 
  302: 	insrmconf(cur_rmconf);
  303: 
  304: 	return 0;
  305: }
  306: 
  307: 
  308: /* Line 336 of yacc.c  */
  309: #line 310 "cfparse.c"
  310: 
  311: # ifndef YY_NULL
  312: #  if defined __cplusplus && 201103L <= __cplusplus
  313: #   define YY_NULL nullptr
  314: #  else
  315: #   define YY_NULL 0
  316: #  endif
  317: # endif
  318: 
  319: /* Enabling verbose error messages.  */
  320: #ifdef YYERROR_VERBOSE
  321: # undef YYERROR_VERBOSE
  322: # define YYERROR_VERBOSE 1
  323: #else
  324: # define YYERROR_VERBOSE 0
  325: #endif
  326: 
  327: /* In a future release of Bison, this section will be replaced
  328:    by #include "y.tab.h".  */
  329: #ifndef YY_Y_TAB_H
  330: # define YY_Y_TAB_H
  331: /* Enabling traces.  */
  332: #ifndef YYDEBUG
  333: # define YYDEBUG 0
  334: #endif
  335: #if YYDEBUG
  336: extern int yydebug;
  337: #endif
  338: 
  339: /* Tokens.  */
  340: #ifndef YYTOKENTYPE
  341: # define YYTOKENTYPE
  342:    /* Put the tokens into the symbol table, so that GDB and other debuggers
  343:       know about them.  */
  344:    enum yytokentype {
  345:      PRIVSEP = 258,
  346:      USER = 259,
  347:      GROUP = 260,
  348:      CHROOT = 261,
  349:      PATH = 262,
  350:      PATHTYPE = 263,
  351:      INCLUDE = 264,
  352:      PFKEY_BUFFER = 265,
  353:      LOGGING = 266,
  354:      LOGLEV = 267,
  355:      PADDING = 268,
  356:      PAD_RANDOMIZE = 269,
  357:      PAD_RANDOMIZELEN = 270,
  358:      PAD_MAXLEN = 271,
  359:      PAD_STRICT = 272,
  360:      PAD_EXCLTAIL = 273,
  361:      LISTEN = 274,
  362:      X_ISAKMP = 275,
  363:      X_ISAKMP_NATT = 276,
  364:      X_ADMIN = 277,
  365:      STRICT_ADDRESS = 278,
  366:      ADMINSOCK = 279,
  367:      DISABLED = 280,
  368:      LDAPCFG = 281,
  369:      LDAP_HOST = 282,
  370:      LDAP_PORT = 283,
  371:      LDAP_PVER = 284,
  372:      LDAP_BASE = 285,
  373:      LDAP_BIND_DN = 286,
  374:      LDAP_BIND_PW = 287,
  375:      LDAP_SUBTREE = 288,
  376:      LDAP_ATTR_USER = 289,
  377:      LDAP_ATTR_ADDR = 290,
  378:      LDAP_ATTR_MASK = 291,
  379:      LDAP_ATTR_GROUP = 292,
  380:      LDAP_ATTR_MEMBER = 293,
  381:      RADCFG = 294,
  382:      RAD_AUTH = 295,
  383:      RAD_ACCT = 296,
  384:      RAD_TIMEOUT = 297,
  385:      RAD_RETRIES = 298,
  386:      MODECFG = 299,
  387:      CFG_NET4 = 300,
  388:      CFG_MASK4 = 301,
  389:      CFG_DNS4 = 302,
  390:      CFG_NBNS4 = 303,
  391:      CFG_DEFAULT_DOMAIN = 304,
  392:      CFG_AUTH_SOURCE = 305,
  393:      CFG_AUTH_GROUPS = 306,
  394:      CFG_SYSTEM = 307,
  395:      CFG_RADIUS = 308,
  396:      CFG_PAM = 309,
  397:      CFG_LDAP = 310,
  398:      CFG_LOCAL = 311,
  399:      CFG_NONE = 312,
  400:      CFG_GROUP_SOURCE = 313,
  401:      CFG_ACCOUNTING = 314,
  402:      CFG_CONF_SOURCE = 315,
  403:      CFG_MOTD = 316,
  404:      CFG_POOL_SIZE = 317,
  405:      CFG_AUTH_THROTTLE = 318,
  406:      CFG_SPLIT_NETWORK = 319,
  407:      CFG_SPLIT_LOCAL = 320,
  408:      CFG_SPLIT_INCLUDE = 321,
  409:      CFG_SPLIT_DNS = 322,
  410:      CFG_PFS_GROUP = 323,
  411:      CFG_SAVE_PASSWD = 324,
  412:      RETRY = 325,
  413:      RETRY_COUNTER = 326,
  414:      RETRY_INTERVAL = 327,
  415:      RETRY_PERSEND = 328,
  416:      RETRY_PHASE1 = 329,
  417:      RETRY_PHASE2 = 330,
  418:      NATT_KA = 331,
  419:      ALGORITHM_CLASS = 332,
  420:      ALGORITHMTYPE = 333,
  421:      STRENGTHTYPE = 334,
  422:      SAINFO = 335,
  423:      FROM = 336,
  424:      REMOTE = 337,
  425:      ANONYMOUS = 338,
  426:      CLIENTADDR = 339,
  427:      INHERIT = 340,
  428:      REMOTE_ADDRESS = 341,
  429:      EXCHANGE_MODE = 342,
  430:      EXCHANGETYPE = 343,
  431:      DOI = 344,
  432:      DOITYPE = 345,
  433:      SITUATION = 346,
  434:      SITUATIONTYPE = 347,
  435:      CERTIFICATE_TYPE = 348,
  436:      CERTTYPE = 349,
  437:      PEERS_CERTFILE = 350,
  438:      CA_TYPE = 351,
  439:      VERIFY_CERT = 352,
  440:      SEND_CERT = 353,
  441:      SEND_CR = 354,
  442:      MATCH_EMPTY_CR = 355,
  443:      IDENTIFIERTYPE = 356,
  444:      IDENTIFIERQUAL = 357,
  445:      MY_IDENTIFIER = 358,
  446:      PEERS_IDENTIFIER = 359,
  447:      VERIFY_IDENTIFIER = 360,
  448:      DNSSEC = 361,
  449:      CERT_X509 = 362,
  450:      CERT_PLAINRSA = 363,
  451:      NONCE_SIZE = 364,
  452:      DH_GROUP = 365,
  453:      KEEPALIVE = 366,
  454:      PASSIVE = 367,
  455:      INITIAL_CONTACT = 368,
  456:      NAT_TRAVERSAL = 369,
  457:      REMOTE_FORCE_LEVEL = 370,
  458:      PROPOSAL_CHECK = 371,
  459:      PROPOSAL_CHECK_LEVEL = 372,
  460:      GENERATE_POLICY = 373,
  461:      GENERATE_LEVEL = 374,
  462:      SUPPORT_PROXY = 375,
  463:      PROPOSAL = 376,
  464:      EXEC_PATH = 377,
  465:      EXEC_COMMAND = 378,
  466:      EXEC_SUCCESS = 379,
  467:      EXEC_FAILURE = 380,
  468:      GSS_ID = 381,
  469:      GSS_ID_ENC = 382,
  470:      GSS_ID_ENCTYPE = 383,
  471:      COMPLEX_BUNDLE = 384,
  472:      DPD = 385,
  473:      DPD_DELAY = 386,
  474:      DPD_RETRY = 387,
  475:      DPD_MAXFAIL = 388,
  476:      PH1ID = 389,
  477:      XAUTH_LOGIN = 390,
  478:      WEAK_PHASE1_CHECK = 391,
  479:      REKEY = 392,
  480:      PREFIX = 393,
  481:      PORT = 394,
  482:      PORTANY = 395,
  483:      UL_PROTO = 396,
  484:      ANY = 397,
  485:      IKE_FRAG = 398,
  486:      ESP_FRAG = 399,
  487:      MODE_CFG = 400,
  488:      PFS_GROUP = 401,
  489:      LIFETIME = 402,
  490:      LIFETYPE_TIME = 403,
  491:      LIFETYPE_BYTE = 404,
  492:      STRENGTH = 405,
  493:      REMOTEID = 406,
  494:      SCRIPT = 407,
  495:      PHASE1_UP = 408,
  496:      PHASE1_DOWN = 409,
  497:      PHASE1_DEAD = 410,
  498:      NUMBER = 411,
  499:      SWITCH = 412,
  500:      BOOLEAN = 413,
  501:      HEXSTRING = 414,
  502:      QUOTEDSTRING = 415,
  503:      ADDRSTRING = 416,
  504:      ADDRRANGE = 417,
  505:      UNITTYPE_BYTE = 418,
  506:      UNITTYPE_KBYTES = 419,
  507:      UNITTYPE_MBYTES = 420,
  508:      UNITTYPE_TBYTES = 421,
  509:      UNITTYPE_SEC = 422,
  510:      UNITTYPE_MIN = 423,
  511:      UNITTYPE_HOUR = 424,
  512:      EOS = 425,
  513:      BOC = 426,
  514:      EOC = 427,
  515:      COMMA = 428
  516:    };
  517: #endif
  518: /* Tokens.  */
  519: #define PRIVSEP 258
  520: #define USER 259
  521: #define GROUP 260
  522: #define CHROOT 261
  523: #define PATH 262
  524: #define PATHTYPE 263
  525: #define INCLUDE 264
  526: #define PFKEY_BUFFER 265
  527: #define LOGGING 266
  528: #define LOGLEV 267
  529: #define PADDING 268
  530: #define PAD_RANDOMIZE 269
  531: #define PAD_RANDOMIZELEN 270
  532: #define PAD_MAXLEN 271
  533: #define PAD_STRICT 272
  534: #define PAD_EXCLTAIL 273
  535: #define LISTEN 274
  536: #define X_ISAKMP 275
  537: #define X_ISAKMP_NATT 276
  538: #define X_ADMIN 277
  539: #define STRICT_ADDRESS 278
  540: #define ADMINSOCK 279
  541: #define DISABLED 280
  542: #define LDAPCFG 281
  543: #define LDAP_HOST 282
  544: #define LDAP_PORT 283
  545: #define LDAP_PVER 284
  546: #define LDAP_BASE 285
  547: #define LDAP_BIND_DN 286
  548: #define LDAP_BIND_PW 287
  549: #define LDAP_SUBTREE 288
  550: #define LDAP_ATTR_USER 289
  551: #define LDAP_ATTR_ADDR 290
  552: #define LDAP_ATTR_MASK 291
  553: #define LDAP_ATTR_GROUP 292
  554: #define LDAP_ATTR_MEMBER 293
  555: #define RADCFG 294
  556: #define RAD_AUTH 295
  557: #define RAD_ACCT 296
  558: #define RAD_TIMEOUT 297
  559: #define RAD_RETRIES 298
  560: #define MODECFG 299
  561: #define CFG_NET4 300
  562: #define CFG_MASK4 301
  563: #define CFG_DNS4 302
  564: #define CFG_NBNS4 303
  565: #define CFG_DEFAULT_DOMAIN 304
  566: #define CFG_AUTH_SOURCE 305
  567: #define CFG_AUTH_GROUPS 306
  568: #define CFG_SYSTEM 307
  569: #define CFG_RADIUS 308
  570: #define CFG_PAM 309
  571: #define CFG_LDAP 310
  572: #define CFG_LOCAL 311
  573: #define CFG_NONE 312
  574: #define CFG_GROUP_SOURCE 313
  575: #define CFG_ACCOUNTING 314
  576: #define CFG_CONF_SOURCE 315
  577: #define CFG_MOTD 316
  578: #define CFG_POOL_SIZE 317
  579: #define CFG_AUTH_THROTTLE 318
  580: #define CFG_SPLIT_NETWORK 319
  581: #define CFG_SPLIT_LOCAL 320
  582: #define CFG_SPLIT_INCLUDE 321
  583: #define CFG_SPLIT_DNS 322
  584: #define CFG_PFS_GROUP 323
  585: #define CFG_SAVE_PASSWD 324
  586: #define RETRY 325
  587: #define RETRY_COUNTER 326
  588: #define RETRY_INTERVAL 327
  589: #define RETRY_PERSEND 328
  590: #define RETRY_PHASE1 329
  591: #define RETRY_PHASE2 330
  592: #define NATT_KA 331
  593: #define ALGORITHM_CLASS 332
  594: #define ALGORITHMTYPE 333
  595: #define STRENGTHTYPE 334
  596: #define SAINFO 335
  597: #define FROM 336
  598: #define REMOTE 337
  599: #define ANONYMOUS 338
  600: #define CLIENTADDR 339
  601: #define INHERIT 340
  602: #define REMOTE_ADDRESS 341
  603: #define EXCHANGE_MODE 342
  604: #define EXCHANGETYPE 343
  605: #define DOI 344
  606: #define DOITYPE 345
  607: #define SITUATION 346
  608: #define SITUATIONTYPE 347
  609: #define CERTIFICATE_TYPE 348
  610: #define CERTTYPE 349
  611: #define PEERS_CERTFILE 350
  612: #define CA_TYPE 351
  613: #define VERIFY_CERT 352
  614: #define SEND_CERT 353
  615: #define SEND_CR 354
  616: #define MATCH_EMPTY_CR 355
  617: #define IDENTIFIERTYPE 356
  618: #define IDENTIFIERQUAL 357
  619: #define MY_IDENTIFIER 358
  620: #define PEERS_IDENTIFIER 359
  621: #define VERIFY_IDENTIFIER 360
  622: #define DNSSEC 361
  623: #define CERT_X509 362
  624: #define CERT_PLAINRSA 363
  625: #define NONCE_SIZE 364
  626: #define DH_GROUP 365
  627: #define KEEPALIVE 366
  628: #define PASSIVE 367
  629: #define INITIAL_CONTACT 368
  630: #define NAT_TRAVERSAL 369
  631: #define REMOTE_FORCE_LEVEL 370
  632: #define PROPOSAL_CHECK 371
  633: #define PROPOSAL_CHECK_LEVEL 372
  634: #define GENERATE_POLICY 373
  635: #define GENERATE_LEVEL 374
  636: #define SUPPORT_PROXY 375
  637: #define PROPOSAL 376
  638: #define EXEC_PATH 377
  639: #define EXEC_COMMAND 378
  640: #define EXEC_SUCCESS 379
  641: #define EXEC_FAILURE 380
  642: #define GSS_ID 381
  643: #define GSS_ID_ENC 382
  644: #define GSS_ID_ENCTYPE 383
  645: #define COMPLEX_BUNDLE 384
  646: #define DPD 385
  647: #define DPD_DELAY 386
  648: #define DPD_RETRY 387
  649: #define DPD_MAXFAIL 388
  650: #define PH1ID 389
  651: #define XAUTH_LOGIN 390
  652: #define WEAK_PHASE1_CHECK 391
  653: #define REKEY 392
  654: #define PREFIX 393
  655: #define PORT 394
  656: #define PORTANY 395
  657: #define UL_PROTO 396
  658: #define ANY 397
  659: #define IKE_FRAG 398
  660: #define ESP_FRAG 399
  661: #define MODE_CFG 400
  662: #define PFS_GROUP 401
  663: #define LIFETIME 402
  664: #define LIFETYPE_TIME 403
  665: #define LIFETYPE_BYTE 404
  666: #define STRENGTH 405
  667: #define REMOTEID 406
  668: #define SCRIPT 407
  669: #define PHASE1_UP 408
  670: #define PHASE1_DOWN 409
  671: #define PHASE1_DEAD 410
  672: #define NUMBER 411
  673: #define SWITCH 412
  674: #define BOOLEAN 413
  675: #define HEXSTRING 414
  676: #define QUOTEDSTRING 415
  677: #define ADDRSTRING 416
  678: #define ADDRRANGE 417
  679: #define UNITTYPE_BYTE 418
  680: #define UNITTYPE_KBYTES 419
  681: #define UNITTYPE_MBYTES 420
  682: #define UNITTYPE_TBYTES 421
  683: #define UNITTYPE_SEC 422
  684: #define UNITTYPE_MIN 423
  685: #define UNITTYPE_HOUR 424
  686: #define EOS 425
  687: #define BOC 426
  688: #define EOC 427
  689: #define COMMA 428
  690: 
  691: 
  692: 
  693: #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
  694: typedef union YYSTYPE
  695: {
  696: /* Line 350 of yacc.c  */
  697: #line 247 "cfparse.y"
  698: 
  699: 	unsigned long num;
  700: 	vchar_t *val;
  701: 	struct remoteconf *rmconf;
  702: 	struct sockaddr *saddr;
  703: 	struct sainfoalg *alg;
  704: 
  705: 
  706: /* Line 350 of yacc.c  */
  707: #line 708 "cfparse.c"
  708: } YYSTYPE;
  709: # define YYSTYPE_IS_TRIVIAL 1
  710: # define yystype YYSTYPE /* obsolescent; will be withdrawn */
  711: # define YYSTYPE_IS_DECLARED 1
  712: #endif
  713: 
  714: extern YYSTYPE yylval;
  715: 
  716: #ifdef YYPARSE_PARAM
  717: #if defined __STDC__ || defined __cplusplus
  718: int yyparse (void *YYPARSE_PARAM);
  719: #else
  720: int yyparse ();
  721: #endif
  722: #else /* ! YYPARSE_PARAM */
  723: #if defined __STDC__ || defined __cplusplus
  724: int yyparse (void);
  725: #else
  726: int yyparse ();
  727: #endif
  728: #endif /* ! YYPARSE_PARAM */
  729: 
  730: #endif /* !YY_Y_TAB_H  */
  731: 
  732: /* Copy the second part of user declarations.  */
  733: 
  734: /* Line 353 of yacc.c  */
  735: #line 736 "cfparse.c"
  736: 
  737: #ifdef short
  738: # undef short
  739: #endif
  740: 
  741: #ifdef YYTYPE_UINT8
  742: typedef YYTYPE_UINT8 yytype_uint8;
  743: #else
  744: typedef unsigned char yytype_uint8;
  745: #endif
  746: 
  747: #ifdef YYTYPE_INT8
  748: typedef YYTYPE_INT8 yytype_int8;
  749: #elif (defined __STDC__ || defined __C99__FUNC__ \
  750:      || defined __cplusplus || defined _MSC_VER)
  751: typedef signed char yytype_int8;
  752: #else
  753: typedef short int yytype_int8;
  754: #endif
  755: 
  756: #ifdef YYTYPE_UINT16
  757: typedef YYTYPE_UINT16 yytype_uint16;
  758: #else
  759: typedef unsigned short int yytype_uint16;
  760: #endif
  761: 
  762: #ifdef YYTYPE_INT16
  763: typedef YYTYPE_INT16 yytype_int16;
  764: #else
  765: typedef short int yytype_int16;
  766: #endif
  767: 
  768: #ifndef YYSIZE_T
  769: # ifdef __SIZE_TYPE__
  770: #  define YYSIZE_T __SIZE_TYPE__
  771: # elif defined size_t
  772: #  define YYSIZE_T size_t
  773: # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
  774:      || defined __cplusplus || defined _MSC_VER)
  775: #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  776: #  define YYSIZE_T size_t
  777: # else
  778: #  define YYSIZE_T unsigned int
  779: # endif
  780: #endif
  781: 
  782: #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
  783: 
  784: #ifndef YY_
  785: # if defined YYENABLE_NLS && YYENABLE_NLS
  786: #  if ENABLE_NLS
  787: #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
  788: #   define YY_(msgid) dgettext ("bison-runtime", msgid)
  789: #  endif
  790: # endif
  791: # ifndef YY_
  792: #  define YY_(msgid) msgid
  793: # endif
  794: #endif
  795: 
  796: /* Suppress unused-variable warnings by "using" E.  */
  797: #if ! defined lint || defined __GNUC__
  798: # define YYUSE(e) ((void) (e))
  799: #else
  800: # define YYUSE(e) /* empty */
  801: #endif
  802: 
  803: /* Identity function, used to suppress warnings about constant conditions.  */
  804: #ifndef lint
  805: # define YYID(n) (n)
  806: #else
  807: #if (defined __STDC__ || defined __C99__FUNC__ \
  808:      || defined __cplusplus || defined _MSC_VER)
  809: static int
  810: YYID (int yyi)
  811: #else
  812: static int
  813: YYID (yyi)
  814:     int yyi;
  815: #endif
  816: {
  817:   return yyi;
  818: }
  819: #endif
  820: 
  821: #if ! defined yyoverflow || YYERROR_VERBOSE
  822: 
  823: /* The parser invokes alloca or malloc; define the necessary symbols.  */
  824: 
  825: # ifdef YYSTACK_USE_ALLOCA
  826: #  if YYSTACK_USE_ALLOCA
  827: #   ifdef __GNUC__
  828: #    define YYSTACK_ALLOC __builtin_alloca
  829: #   elif defined __BUILTIN_VA_ARG_INCR
  830: #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
  831: #   elif defined _AIX
  832: #    define YYSTACK_ALLOC __alloca
  833: #   elif defined _MSC_VER
  834: #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
  835: #    define alloca _alloca
  836: #   else
  837: #    define YYSTACK_ALLOC alloca
  838: #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
  839:      || defined __cplusplus || defined _MSC_VER)
  840: #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  841:       /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
  842: #     ifndef EXIT_SUCCESS
  843: #      define EXIT_SUCCESS 0
  844: #     endif
  845: #    endif
  846: #   endif
  847: #  endif
  848: # endif
  849: 
  850: # ifdef YYSTACK_ALLOC
  851:    /* Pacify GCC's `empty if-body' warning.  */
  852: #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
  853: #  ifndef YYSTACK_ALLOC_MAXIMUM
  854:     /* The OS might guarantee only one guard page at the bottom of the stack,
  855:        and a page size can be as small as 4096 bytes.  So we cannot safely
  856:        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
  857:        to allow for a few compiler-allocated temporary stack slots.  */
  858: #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
  859: #  endif
  860: # else
  861: #  define YYSTACK_ALLOC YYMALLOC
  862: #  define YYSTACK_FREE YYFREE
  863: #  ifndef YYSTACK_ALLOC_MAXIMUM
  864: #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
  865: #  endif
  866: #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
  867:        && ! ((defined YYMALLOC || defined malloc) \
  868: 	     && (defined YYFREE || defined free)))
  869: #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  870: #   ifndef EXIT_SUCCESS
  871: #    define EXIT_SUCCESS 0
  872: #   endif
  873: #  endif
  874: #  ifndef YYMALLOC
  875: #   define YYMALLOC malloc
  876: #   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
  877:      || defined __cplusplus || defined _MSC_VER)
  878: void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
  879: #   endif
  880: #  endif
  881: #  ifndef YYFREE
  882: #   define YYFREE free
  883: #   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
  884:      || defined __cplusplus || defined _MSC_VER)
  885: void free (void *); /* INFRINGES ON USER NAME SPACE */
  886: #   endif
  887: #  endif
  888: # endif
  889: #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
  890: 
  891: 
  892: #if (! defined yyoverflow \
  893:      && (! defined __cplusplus \
  894: 	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
  895: 
  896: /* A type that is properly aligned for any stack member.  */
  897: union yyalloc
  898: {
  899:   yytype_int16 yyss_alloc;
  900:   YYSTYPE yyvs_alloc;
  901: };
  902: 
  903: /* The size of the maximum gap between one aligned stack and the next.  */
  904: # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
  905: 
  906: /* The size of an array large to enough to hold all stacks, each with
  907:    N elements.  */
  908: # define YYSTACK_BYTES(N) \
  909:      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
  910:       + YYSTACK_GAP_MAXIMUM)
  911: 
  912: # define YYCOPY_NEEDED 1
  913: 
  914: /* Relocate STACK from its old location to the new one.  The
  915:    local variables YYSIZE and YYSTACKSIZE give the old and new number of
  916:    elements in the stack, and YYPTR gives the new location of the
  917:    stack.  Advance YYPTR to a properly aligned location for the next
  918:    stack.  */
  919: # define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
  920:     do									\
  921:       {									\
  922: 	YYSIZE_T yynewbytes;						\
  923: 	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
  924: 	Stack = &yyptr->Stack_alloc;					\
  925: 	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
  926: 	yyptr += yynewbytes / sizeof (*yyptr);				\
  927:       }									\
  928:     while (YYID (0))
  929: 
  930: #endif
  931: 
  932: #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
  933: /* Copy COUNT objects from SRC to DST.  The source and destination do
  934:    not overlap.  */
  935: # ifndef YYCOPY
  936: #  if defined __GNUC__ && 1 < __GNUC__
  937: #   define YYCOPY(Dst, Src, Count) \
  938:       __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
  939: #  else
  940: #   define YYCOPY(Dst, Src, Count)              \
  941:       do                                        \
  942:         {                                       \
  943:           YYSIZE_T yyi;                         \
  944:           for (yyi = 0; yyi < (Count); yyi++)   \
  945:             (Dst)[yyi] = (Src)[yyi];            \
  946:         }                                       \
  947:       while (YYID (0))
  948: #  endif
  949: # endif
  950: #endif /* !YYCOPY_NEEDED */
  951: 
  952: /* YYFINAL -- State number of the termination state.  */
  953: #define YYFINAL  2
  954: /* YYLAST -- Last index in YYTABLE.  */
  955: #define YYLAST   534
  956: 
  957: /* YYNTOKENS -- Number of terminals.  */
  958: #define YYNTOKENS  174
  959: /* YYNNTS -- Number of nonterminals.  */
  960: #define YYNNTS  204
  961: /* YYNRULES -- Number of rules.  */
  962: #define YYNRULES  381
  963: /* YYNRULES -- Number of states.  */
  964: #define YYNSTATES  691
  965: 
  966: /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
  967: #define YYUNDEFTOK  2
  968: #define YYMAXUTOK   428
  969: 
  970: #define YYTRANSLATE(YYX)						\
  971:   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
  972: 
  973: /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
  974: static const yytype_uint8 yytranslate[] =
  975: {
  976:        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  977:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  978:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  979:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  980:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  981:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  982:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  983:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  984:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  985:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  986:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  987:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  988:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  989:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  990:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  991:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  992:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  993:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  994:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  995:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  996:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  997:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  998:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  999:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 1000:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 1001:        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
 1002:        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
 1003:       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
 1004:       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
 1005:       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
 1006:       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
 1007:       55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
 1008:       65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
 1009:       75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
 1010:       85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
 1011:       95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
 1012:      105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
 1013:      115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
 1014:      125,   126,   127,   128,   129,   130,   131,   132,   133,   134,
 1015:      135,   136,   137,   138,   139,   140,   141,   142,   143,   144,
 1016:      145,   146,   147,   148,   149,   150,   151,   152,   153,   154,
 1017:      155,   156,   157,   158,   159,   160,   161,   162,   163,   164,
 1018:      165,   166,   167,   168,   169,   170,   171,   172,   173
 1019: };
 1020: 
 1021: #if YYDEBUG
 1022: /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
 1023:    YYRHS.  */
 1024: static const yytype_uint16 yyprhs[] =
 1025: {
 1026:        0,     0,     3,     4,     7,     9,    11,    13,    15,    17,
 1027:       19,    21,    23,    25,    27,    29,    31,    33,    35,    37,
 1028:       42,    43,    46,    47,    52,    53,    58,    59,    64,    65,
 1029:       70,    71,    76,    77,    83,    84,    89,    93,    97,   101,
 1030:      105,   107,   112,   113,   116,   117,   122,   123,   128,   129,
 1031:      134,   135,   140,   141,   146,   151,   152,   155,   156,   161,
 1032:      162,   167,   168,   176,   177,   182,   183,   188,   189,   193,
 1033:      196,   197,   199,   200,   206,   207,   210,   211,   217,   218,
 1034:      225,   226,   232,   233,   240,   241,   246,   247,   252,   253,
 1035:      259,   260,   263,   264,   269,   270,   275,   276,   281,   282,
 1036:      287,   288,   293,   294,   299,   300,   305,   306,   311,   312,
 1037:      317,   318,   323,   324,   329,   330,   335,   340,   341,   344,
 1038:      345,   350,   351,   356,   360,   364,   365,   371,   372,   378,
 1039:      379,   384,   385,   390,   391,   396,   397,   402,   403,   408,
 1040:      409,   414,   415,   420,   421,   426,   427,   432,   433,   438,
 1041:      439,   444,   445,   450,   451,   456,   457,   462,   463,   468,
 1042:      469,   474,   475,   480,   481,   486,   487,   492,   493,   498,
 1043:      499,   504,   506,   510,   512,   514,   518,   520,   522,   526,
 1044:      529,   531,   535,   537,   539,   543,   545,   550,   551,   554,
 1045:      555,   560,   561,   567,   568,   573,   574,   580,   581,   587,
 1046:      588,   594,   595,   596,   605,   607,   610,   613,   616,   619,
 1047:      622,   628,   635,   638,   639,   643,   646,   647,   650,   651,
 1048:      656,   657,   662,   663,   670,   671,   678,   679,   684,   686,
 1049:      687,   692,   695,   696,   698,   699,   701,   703,   705,   707,
 1050:      709,   710,   712,   713,   720,   721,   726,   727,   734,   735,
 1051:      740,   742,   744,   748,   751,   753,   754,   757,   758,   763,
 1052:      764,   769,   770,   775,   776,   781,   784,   785,   790,   791,
 1053:      797,   798,   804,   805,   810,   811,   817,   818,   823,   824,
 1054:      829,   830,   835,   836,   841,   842,   848,   849,   856,   857,
 1055:      862,   863,   869,   870,   877,   878,   883,   884,   889,   890,
 1056:      895,   896,   901,   902,   907,   908,   913,   914,   919,   920,
 1057:      926,   927,   933,   934,   940,   941,   946,   947,   952,   953,
 1058:      958,   959,   964,   965,   970,   971,   976,   977,   982,   983,
 1059:      988,   989,   994,   995,  1000,  1001,  1006,  1007,  1012,  1013,
 1060:     1018,  1019,  1024,  1025,  1030,  1031,  1038,  1039,  1044,  1045,
 1061:     1052,  1053,  1059,  1060,  1063,  1064,  1070,  1071,  1076,  1078,
 1062:     1080,  1081,  1083,  1085,  1086,  1089,  1090,  1097,  1098,  1105,
 1063:     1106,  1111,  1112,  1117,  1118,  1124,  1126,  1128,  1130,  1132,
 1064:     1134,  1136
 1065: };
 1066: 
 1067: /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
 1068: static const yytype_int16 yyrhs[] =
 1069: {
 1070:      175,     0,    -1,    -1,   175,   176,    -1,   177,    -1,   185,
 1071:       -1,   189,    -1,   190,    -1,   191,    -1,   192,    -1,   194,
 1072:       -1,   202,    -1,   223,    -1,   213,    -1,   239,    -1,   277,
 1073:       -1,   286,    -1,   306,    -1,   187,    -1,     3,   171,   178,
 1074:      172,    -1,    -1,   178,   179,    -1,    -1,     4,   160,   180,
 1075:      170,    -1,    -1,     4,   156,   181,   170,    -1,    -1,     5,
 1076:      160,   182,   170,    -1,    -1,     5,   156,   183,   170,    -1,
 1077:       -1,     6,   160,   184,   170,    -1,    -1,     7,     8,   160,
 1078:      186,   170,    -1,    -1,   129,   157,   188,   170,    -1,     9,
 1079:      160,   170,    -1,    10,   156,   170,    -1,   127,   128,   170,
 1080:       -1,    11,   193,   170,    -1,    12,    -1,    13,   171,   195,
 1081:      172,    -1,    -1,   195,   196,    -1,    -1,    14,   157,   197,
 1082:      170,    -1,    -1,    15,   157,   198,   170,    -1,    -1,    16,
 1083:      156,   199,   170,    -1,    -1,    17,   157,   200,   170,    -1,
 1084:       -1,    18,   157,   201,   170,    -1,    19,   171,   203,   172,
 1085:       -1,    -1,   203,   204,    -1,    -1,    20,   211,   205,   170,
 1086:       -1,    -1,    21,   211,   206,   170,    -1,    -1,    24,   160,
 1087:      160,   160,   156,   207,   170,    -1,    -1,    24,   160,   208,
 1088:      170,    -1,    -1,    24,    25,   209,   170,    -1,    -1,    23,
 1089:      210,   170,    -1,   161,   212,    -1,    -1,   139,    -1,    -1,
 1090:       39,   214,   171,   215,   172,    -1,    -1,   215,   216,    -1,
 1091:       -1,    40,   160,   160,   217,   170,    -1,    -1,    40,   160,
 1092:      156,   160,   218,   170,    -1,    -1,    41,   160,   160,   219,
 1093:      170,    -1,    -1,    41,   160,   156,   160,   220,   170,    -1,
 1094:       -1,    42,   156,   221,   170,    -1,    -1,    43,   156,   222,
 1095:      170,    -1,    -1,    26,   224,   171,   225,   172,    -1,    -1,
 1096:      225,   226,    -1,    -1,    29,   156,   227,   170,    -1,    -1,
 1097:       27,   160,   228,   170,    -1,    -1,    28,   156,   229,   170,
 1098:       -1,    -1,    30,   160,   230,   170,    -1,    -1,    33,   157,
 1099:      231,   170,    -1,    -1,    31,   160,   232,   170,    -1,    -1,
 1100:       32,   160,   233,   170,    -1,    -1,    34,   160,   234,   170,
 1101:       -1,    -1,    35,   160,   235,   170,    -1,    -1,    36,   160,
 1102:      236,   170,    -1,    -1,    37,   160,   237,   170,    -1,    -1,
 1103:       38,   160,   238,   170,    -1,    44,   171,   240,   172,    -1,
 1104:       -1,   240,   241,    -1,    -1,    45,   161,   242,   170,    -1,
 1105:       -1,    46,   161,   243,   170,    -1,    47,   267,   170,    -1,
 1106:       48,   269,   170,    -1,    -1,    64,    65,   271,   244,   170,
 1107:       -1,    -1,    64,    66,   271,   245,   170,    -1,    -1,    67,
 1108:      275,   246,   170,    -1,    -1,    49,   160,   247,   170,    -1,
 1109:       -1,    50,    52,   248,   170,    -1,    -1,    50,    53,   249,
 1110:      170,    -1,    -1,    50,    54,   250,   170,    -1,    -1,    50,
 1111:       55,   251,   170,    -1,    -1,    51,   273,   252,   170,    -1,
 1112:       -1,    58,    52,   253,   170,    -1,    -1,    58,    55,   254,
 1113:      170,    -1,    -1,    59,    57,   255,   170,    -1,    -1,    59,
 1114:       52,   256,   170,    -1,    -1,    59,    53,   257,   170,    -1,
 1115:       -1,    59,    54,   258,   170,    -1,    -1,    62,   156,   259,
 1116:      170,    -1,    -1,    68,   156,   260,   170,    -1,    -1,    69,
 1117:      157,   261,   170,    -1,    -1,    63,   156,   262,   170,    -1,
 1118:       -1,    60,    56,   263,   170,    -1,    -1,    60,    53,   264,
 1119:      170,    -1,    -1,    60,    55,   265,   170,    -1,    -1,    61,
 1120:      160,   266,   170,    -1,   268,    -1,   268,   173,   267,    -1,
 1121:      161,    -1,   270,    -1,   270,   173,   269,    -1,   161,    -1,
 1122:      272,    -1,   271,   173,   272,    -1,   161,   138,    -1,   274,
 1123:       -1,   274,   173,   273,    -1,   160,    -1,   276,    -1,   276,
 1124:      173,   275,    -1,   160,    -1,    70,   171,   278,   172,    -1,
 1125:       -1,   278,   279,    -1,    -1,    71,   156,   280,   170,    -1,
 1126:       -1,    72,   156,   376,   281,   170,    -1,    -1,    73,   156,
 1127:      282,   170,    -1,    -1,    74,   156,   376,   283,   170,    -1,
 1128:       -1,    75,   156,   376,   284,   170,    -1,    -1,    76,   156,
 1129:      376,   285,   170,    -1,    -1,    -1,    80,   287,   289,   291,
 1130:      171,   292,   288,   172,    -1,    83,    -1,    83,    84,    -1,
 1131:       83,   290,    -1,   290,    83,    -1,   290,    84,    -1,   290,
 1132:      290,    -1,   101,   161,   302,   303,   304,    -1,   101,   161,
 1133:      162,   302,   303,   304,    -1,   101,   160,    -1,    -1,    81,
 1134:      101,   368,    -1,     5,   160,    -1,    -1,   292,   293,    -1,
 1135:       -1,   146,   367,   294,   170,    -1,    -1,   151,   156,   295,
 1136:      170,    -1,    -1,   147,   148,   156,   376,   296,   170,    -1,
 1137:       -1,   147,   149,   156,   377,   297,   170,    -1,    -1,    77,
 1138:      298,   299,   170,    -1,   301,    -1,    -1,   301,   300,   173,
 1139:      299,    -1,    78,   305,    -1,    -1,   138,    -1,    -1,   139,
 1140:       -1,   140,    -1,   156,    -1,   141,    -1,   142,    -1,    -1,
 1141:      156,    -1,    -1,    82,   160,    85,   160,   307,   311,    -1,
 1142:       -1,    82,   160,   308,   312,    -1,    -1,    82,   313,    85,
 1143:      313,   309,   311,    -1,    -1,    82,   313,   310,   312,    -1,
 1144:      312,    -1,   170,    -1,   171,   314,   172,    -1,    83,   212,
 1145:       -1,   211,    -1,    -1,   314,   315,    -1,    -1,    86,   211,
 1146:      316,   170,    -1,    -1,    87,   317,   363,   170,    -1,    -1,
 1147:       89,    90,   318,   170,    -1,    -1,    91,    92,   319,   170,
 1148:       -1,    93,   364,    -1,    -1,    95,   160,   320,   170,    -1,
 1149:       -1,    95,   107,   160,   321,   170,    -1,    -1,    95,   108,
 1150:      160,   322,   170,    -1,    -1,    95,   106,   323,   170,    -1,
 1151:       -1,    96,   107,   160,   324,   170,    -1,    -1,    97,   157,
 1152:      325,   170,    -1,    -1,    98,   157,   326,   170,    -1,    -1,
 1153:       99,   157,   327,   170,    -1,    -1,   100,   157,   328,   170,
 1154:       -1,    -1,   103,   101,   368,   329,   170,    -1,    -1,   103,
 1155:      101,   102,   368,   330,   170,    -1,    -1,   135,   368,   331,
 1156:      170,    -1,    -1,   104,   101,   368,   332,   170,    -1,    -1,
 1157:      104,   101,   102,   368,   333,   170,    -1,    -1,   105,   157,
 1158:      334,   170,    -1,    -1,   109,   156,   335,   170,    -1,    -1,
 1159:      110,   336,   367,   170,    -1,    -1,   112,   157,   337,   170,
 1160:       -1,    -1,   143,   157,   338,   170,    -1,    -1,   143,   115,
 1161:      339,   170,    -1,    -1,   144,   156,   340,   170,    -1,    -1,
 1162:      152,   160,   153,   341,   170,    -1,    -1,   152,   160,   154,
 1163:      342,   170,    -1,    -1,   152,   160,   155,   343,   170,    -1,
 1164:       -1,   145,   157,   344,   170,    -1,    -1,   136,   157,   345,
 1165:      170,    -1,    -1,   118,   157,   346,   170,    -1,    -1,   118,
 1166:      119,   347,   170,    -1,    -1,   120,   157,   348,   170,    -1,
 1167:       -1,   113,   157,   349,   170,    -1,    -1,   114,   157,   350,
 1168:      170,    -1,    -1,   114,   115,   351,   170,    -1,    -1,   130,
 1169:      157,   352,   170,    -1,    -1,   131,   156,   353,   170,    -1,
 1170:       -1,   132,   156,   354,   170,    -1,    -1,   133,   156,   355,
 1171:      170,    -1,    -1,   137,   157,   356,   170,    -1,    -1,   137,
 1172:      115,   357,   170,    -1,    -1,   134,   156,   358,   170,    -1,
 1173:       -1,   147,   148,   156,   376,   359,   170,    -1,    -1,   116,
 1174:      117,   360,   170,    -1,    -1,   147,   149,   156,   377,   361,
 1175:      170,    -1,    -1,   121,   362,   171,   369,   172,    -1,    -1,
 1176:      363,    88,    -1,    -1,   107,   160,   160,   365,   170,    -1,
 1177:       -1,   108,   160,   366,   170,    -1,    78,    -1,   156,    -1,
 1178:       -1,   161,    -1,   160,    -1,    -1,   369,   370,    -1,    -1,
 1179:      147,   148,   156,   376,   371,   170,    -1,    -1,   147,   149,
 1180:      156,   377,   372,   170,    -1,    -1,   110,   367,   373,   170,
 1181:       -1,    -1,   126,   160,   374,   170,    -1,    -1,    77,    78,
 1182:      305,   375,   170,    -1,   167,    -1,   168,    -1,   169,    -1,
 1183:      163,    -1,   164,    -1,   165,    -1,   166,    -1
 1184: };
 1185: 
 1186: /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 1187: static const yytype_uint16 yyrline[] =
 1188: {
 1189:        0,   336,   336,   338,   341,   342,   343,   344,   345,   346,
 1190:      347,   348,   349,   350,   351,   352,   353,   354,   355,   360,
 1191:      362,   364,   368,   367,   378,   378,   380,   379,   390,   390,
 1192:      391,   391,   397,   396,   417,   417,   422,   436,   443,   455,
 1193:      458,   472,   474,   476,   479,   479,   480,   480,   481,   481,
 1194:      482,   482,   483,   483,   488,   490,   492,   496,   495,   502,
 1195:      501,   513,   512,   522,   521,   531,   530,   539,   539,   542,
 1196:      554,   555,   560,   560,   577,   579,   583,   582,   601,   600,
 1197:      619,   618,   637,   636,   655,   654,   664,   663,   676,   676,
 1198:      687,   689,   693,   692,   704,   703,   715,   714,   724,   723,
 1199:      735,   734,   744,   743,   755,   754,   766,   765,   777,   776,
 1200:      788,   787,   799,   798,   810,   809,   824,   826,   828,   832,
 1201:      831,   843,   842,   853,   855,   858,   857,   867,   866,   876,
 1202:      875,   883,   882,   895,   894,   904,   903,   917,   916,   930,
 1203:      929,   943,   942,   950,   949,   959,   958,   972,   971,   981,
 1204:      980,   990,   989,  1003,  1002,  1016,  1015,  1026,  1025,  1035,
 1205:     1034,  1044,  1043,  1053,  1052,  1062,  1061,  1075,  1074,  1088,
 1206:     1087,  1101,  1102,  1105,  1122,  1123,  1126,  1143,  1144,  1147,
 1207:     1170,  1171,  1174,  1208,  1209,  1212,  1249,  1251,  1253,  1257,
 1208:     1256,  1262,  1261,  1267,  1266,  1272,  1271,  1277,  1276,  1282,
 1209:     1281,  1298,  1306,  1297,  1345,  1350,  1355,  1360,  1365,  1370,
 1210:     1377,  1426,  1491,  1520,  1523,  1548,  1561,  1563,  1567,  1566,
 1211:     1572,  1571,  1577,  1576,  1582,  1581,  1593,  1593,  1600,  1605,
 1212:     1604,  1611,  1667,  1668,  1671,  1672,  1673,  1676,  1677,  1678,
 1213:     1681,  1682,  1688,  1687,  1718,  1717,  1738,  1737,  1761,  1760,
 1214:     1777,  1778,  1786,  1793,  1799,  1808,  1810,  1814,  1813,  1823,
 1215:     1822,  1827,  1827,  1828,  1828,  1829,  1831,  1830,  1851,  1850,
 1216:     1868,  1867,  1898,  1897,  1912,  1911,  1928,  1928,  1929,  1929,
 1217:     1930,  1930,  1931,  1931,  1933,  1932,  1942,  1941,  1951,  1950,
 1218:     1968,  1967,  1985,  1984,  2001,  2001,  2002,  2002,  2004,  2003,
 1219:     2009,  2009,  2010,  2010,  2011,  2011,  2012,  2012,  2022,  2022,
 1220:     2029,  2029,  2036,  2036,  2043,  2043,  2044,  2044,  2047,  2047,
 1221:     2048,  2048,  2049,  2049,  2050,  2050,  2052,  2051,  2063,  2062,
 1222:     2074,  2073,  2082,  2081,  2091,  2090,  2100,  2099,  2108,  2108,
 1223:     2109,  2109,  2111,  2110,  2116,  2115,  2120,  2120,  2122,  2121,
 1224:     2136,  2135,  2146,  2148,  2172,  2171,  2193,  2192,  2226,  2234,
 1225:     2246,  2247,  2248,  2250,  2252,  2256,  2255,  2261,  2260,  2273,
 1226:     2272,  2278,  2277,  2291,  2290,  2388,  2389,  2390,  2393,  2394,
 1227:     2395,  2396
 1228: };
 1229: #endif
 1230: 
 1231: #if YYDEBUG || YYERROR_VERBOSE || 0
 1232: /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
 1233:    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 1234: static const char *const yytname[] =
 1235: {
 1236:   "$end", "error", "$undefined", "PRIVSEP", "USER", "GROUP", "CHROOT",
 1237:   "PATH", "PATHTYPE", "INCLUDE", "PFKEY_BUFFER", "LOGGING", "LOGLEV",
 1238:   "PADDING", "PAD_RANDOMIZE", "PAD_RANDOMIZELEN", "PAD_MAXLEN",
 1239:   "PAD_STRICT", "PAD_EXCLTAIL", "LISTEN", "X_ISAKMP", "X_ISAKMP_NATT",
 1240:   "X_ADMIN", "STRICT_ADDRESS", "ADMINSOCK", "DISABLED", "LDAPCFG",
 1241:   "LDAP_HOST", "LDAP_PORT", "LDAP_PVER", "LDAP_BASE", "LDAP_BIND_DN",
 1242:   "LDAP_BIND_PW", "LDAP_SUBTREE", "LDAP_ATTR_USER", "LDAP_ATTR_ADDR",
 1243:   "LDAP_ATTR_MASK", "LDAP_ATTR_GROUP", "LDAP_ATTR_MEMBER", "RADCFG",
 1244:   "RAD_AUTH", "RAD_ACCT", "RAD_TIMEOUT", "RAD_RETRIES", "MODECFG",
 1245:   "CFG_NET4", "CFG_MASK4", "CFG_DNS4", "CFG_NBNS4", "CFG_DEFAULT_DOMAIN",
 1246:   "CFG_AUTH_SOURCE", "CFG_AUTH_GROUPS", "CFG_SYSTEM", "CFG_RADIUS",
 1247:   "CFG_PAM", "CFG_LDAP", "CFG_LOCAL", "CFG_NONE", "CFG_GROUP_SOURCE",
 1248:   "CFG_ACCOUNTING", "CFG_CONF_SOURCE", "CFG_MOTD", "CFG_POOL_SIZE",
 1249:   "CFG_AUTH_THROTTLE", "CFG_SPLIT_NETWORK", "CFG_SPLIT_LOCAL",
 1250:   "CFG_SPLIT_INCLUDE", "CFG_SPLIT_DNS", "CFG_PFS_GROUP", "CFG_SAVE_PASSWD",
 1251:   "RETRY", "RETRY_COUNTER", "RETRY_INTERVAL", "RETRY_PERSEND",
 1252:   "RETRY_PHASE1", "RETRY_PHASE2", "NATT_KA", "ALGORITHM_CLASS",
 1253:   "ALGORITHMTYPE", "STRENGTHTYPE", "SAINFO", "FROM", "REMOTE", "ANONYMOUS",
 1254:   "CLIENTADDR", "INHERIT", "REMOTE_ADDRESS", "EXCHANGE_MODE",
 1255:   "EXCHANGETYPE", "DOI", "DOITYPE", "SITUATION", "SITUATIONTYPE",
 1256:   "CERTIFICATE_TYPE", "CERTTYPE", "PEERS_CERTFILE", "CA_TYPE",
 1257:   "VERIFY_CERT", "SEND_CERT", "SEND_CR", "MATCH_EMPTY_CR",
 1258:   "IDENTIFIERTYPE", "IDENTIFIERQUAL", "MY_IDENTIFIER", "PEERS_IDENTIFIER",
 1259:   "VERIFY_IDENTIFIER", "DNSSEC", "CERT_X509", "CERT_PLAINRSA",
 1260:   "NONCE_SIZE", "DH_GROUP", "KEEPALIVE", "PASSIVE", "INITIAL_CONTACT",
 1261:   "NAT_TRAVERSAL", "REMOTE_FORCE_LEVEL", "PROPOSAL_CHECK",
 1262:   "PROPOSAL_CHECK_LEVEL", "GENERATE_POLICY", "GENERATE_LEVEL",
 1263:   "SUPPORT_PROXY", "PROPOSAL", "EXEC_PATH", "EXEC_COMMAND", "EXEC_SUCCESS",
 1264:   "EXEC_FAILURE", "GSS_ID", "GSS_ID_ENC", "GSS_ID_ENCTYPE",
 1265:   "COMPLEX_BUNDLE", "DPD", "DPD_DELAY", "DPD_RETRY", "DPD_MAXFAIL",
 1266:   "PH1ID", "XAUTH_LOGIN", "WEAK_PHASE1_CHECK", "REKEY", "PREFIX", "PORT",
 1267:   "PORTANY", "UL_PROTO", "ANY", "IKE_FRAG", "ESP_FRAG", "MODE_CFG",
 1268:   "PFS_GROUP", "LIFETIME", "LIFETYPE_TIME", "LIFETYPE_BYTE", "STRENGTH",
 1269:   "REMOTEID", "SCRIPT", "PHASE1_UP", "PHASE1_DOWN", "PHASE1_DEAD",
 1270:   "NUMBER", "SWITCH", "BOOLEAN", "HEXSTRING", "QUOTEDSTRING", "ADDRSTRING",
 1271:   "ADDRRANGE", "UNITTYPE_BYTE", "UNITTYPE_KBYTES", "UNITTYPE_MBYTES",
 1272:   "UNITTYPE_TBYTES", "UNITTYPE_SEC", "UNITTYPE_MIN", "UNITTYPE_HOUR",
 1273:   "EOS", "BOC", "EOC", "COMMA", "$accept", "statements", "statement",
 1274:   "privsep_statement", "privsep_stmts", "privsep_stmt", "$@1", "$@2",
 1275:   "$@3", "$@4", "$@5", "path_statement", "$@6", "special_statement", "$@7",
 1276:   "include_statement", "pfkey_statement", "gssenc_statement",
 1277:   "logging_statement", "log_level", "padding_statement", "padding_stmts",
 1278:   "padding_stmt", "$@8", "$@9", "$@10", "$@11", "$@12", "listen_statement",
 1279:   "listen_stmts", "listen_stmt", "$@13", "$@14", "$@15", "$@16", "$@17",
 1280:   "$@18", "ike_addrinfo_port", "ike_port", "radcfg_statement", "$@19",
 1281:   "radcfg_stmts", "radcfg_stmt", "$@20", "$@21", "$@22", "$@23", "$@24",
 1282:   "$@25", "ldapcfg_statement", "$@26", "ldapcfg_stmts", "ldapcfg_stmt",
 1283:   "$@27", "$@28", "$@29", "$@30", "$@31", "$@32", "$@33", "$@34", "$@35",
 1284:   "$@36", "$@37", "$@38", "modecfg_statement", "modecfg_stmts",
 1285:   "modecfg_stmt", "$@39", "$@40", "$@41", "$@42", "$@43", "$@44", "$@45",
 1286:   "$@46", "$@47", "$@48", "$@49", "$@50", "$@51", "$@52", "$@53", "$@54",
 1287:   "$@55", "$@56", "$@57", "$@58", "$@59", "$@60", "$@61", "$@62", "$@63",
 1288:   "addrdnslist", "addrdns", "addrwinslist", "addrwins", "splitnetlist",
 1289:   "splitnet", "authgrouplist", "authgroup", "splitdnslist", "splitdns",
 1290:   "timer_statement", "timer_stmts", "timer_stmt", "$@64", "$@65", "$@66",
 1291:   "$@67", "$@68", "$@69", "sainfo_statement", "$@70", "$@71",
 1292:   "sainfo_name", "sainfo_id", "sainfo_param", "sainfo_specs",
 1293:   "sainfo_spec", "$@72", "$@73", "$@74", "$@75", "$@76", "algorithms",
 1294:   "$@77", "algorithm", "prefix", "port", "ul_proto", "keylength",
 1295:   "remote_statement", "$@78", "$@79", "$@80", "$@81",
 1296:   "remote_specs_inherit_block", "remote_specs_block", "remote_index",
 1297:   "remote_specs", "remote_spec", "$@82", "$@83", "$@84", "$@85", "$@86",
 1298:   "$@87", "$@88", "$@89", "$@90", "$@91", "$@92", "$@93", "$@94", "$@95",
 1299:   "$@96", "$@97", "$@98", "$@99", "$@100", "$@101", "$@102", "$@103",
 1300:   "$@104", "$@105", "$@106", "$@107", "$@108", "$@109", "$@110", "$@111",
 1301:   "$@112", "$@113", "$@114", "$@115", "$@116", "$@117", "$@118", "$@119",
 1302:   "$@120", "$@121", "$@122", "$@123", "$@124", "$@125", "$@126", "$@127",
 1303:   "$@128", "exchange_types", "cert_spec", "$@129", "$@130", "dh_group_num",
 1304:   "identifierstring", "isakmpproposal_specs", "isakmpproposal_spec",
 1305:   "$@131", "$@132", "$@133", "$@134", "$@135", "unittype_time",
 1306:   "unittype_byte", YY_NULL
 1307: };
 1308: #endif
 1309: 
 1310: # ifdef YYPRINT
 1311: /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
 1312:    token YYLEX-NUM.  */
 1313: static const yytype_uint16 yytoknum[] =
 1314: {
 1315:        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
 1316:      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
 1317:      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
 1318:      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
 1319:      295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
 1320:      305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
 1321:      315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
 1322:      325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
 1323:      335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
 1324:      345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
 1325:      355,   356,   357,   358,   359,   360,   361,   362,   363,   364,
 1326:      365,   366,   367,   368,   369,   370,   371,   372,   373,   374,
 1327:      375,   376,   377,   378,   379,   380,   381,   382,   383,   384,
 1328:      385,   386,   387,   388,   389,   390,   391,   392,   393,   394,
 1329:      395,   396,   397,   398,   399,   400,   401,   402,   403,   404,
 1330:      405,   406,   407,   408,   409,   410,   411,   412,   413,   414,
 1331:      415,   416,   417,   418,   419,   420,   421,   422,   423,   424,
 1332:      425,   426,   427,   428
 1333: };
 1334: # endif
 1335: 
 1336: /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 1337: static const yytype_uint16 yyr1[] =
 1338: {
 1339:        0,   174,   175,   175,   176,   176,   176,   176,   176,   176,
 1340:      176,   176,   176,   176,   176,   176,   176,   176,   176,   177,
 1341:      178,   178,   180,   179,   181,   179,   182,   179,   183,   179,
 1342:      184,   179,   186,   185,   188,   187,   189,   190,   191,   192,
 1343:      193,   194,   195,   195,   197,   196,   198,   196,   199,   196,
 1344:      200,   196,   201,   196,   202,   203,   203,   205,   204,   206,
 1345:      204,   207,   204,   208,   204,   209,   204,   210,   204,   211,
 1346:      212,   212,   214,   213,   215,   215,   217,   216,   218,   216,
 1347:      219,   216,   220,   216,   221,   216,   222,   216,   224,   223,
 1348:      225,   225,   227,   226,   228,   226,   229,   226,   230,   226,
 1349:      231,   226,   232,   226,   233,   226,   234,   226,   235,   226,
 1350:      236,   226,   237,   226,   238,   226,   239,   240,   240,   242,
 1351:      241,   243,   241,   241,   241,   244,   241,   245,   241,   246,
 1352:      241,   247,   241,   248,   241,   249,   241,   250,   241,   251,
 1353:      241,   252,   241,   253,   241,   254,   241,   255,   241,   256,
 1354:      241,   257,   241,   258,   241,   259,   241,   260,   241,   261,
 1355:      241,   262,   241,   263,   241,   264,   241,   265,   241,   266,
 1356:      241,   267,   267,   268,   269,   269,   270,   271,   271,   272,
 1357:      273,   273,   274,   275,   275,   276,   277,   278,   278,   280,
 1358:      279,   281,   279,   282,   279,   283,   279,   284,   279,   285,
 1359:      279,   287,   288,   286,   289,   289,   289,   289,   289,   289,
 1360:      290,   290,   290,   291,   291,   291,   292,   292,   294,   293,
 1361:      295,   293,   296,   293,   297,   293,   298,   293,   299,   300,
 1362:      299,   301,   302,   302,   303,   303,   303,   304,   304,   304,
 1363:      305,   305,   307,   306,   308,   306,   309,   306,   310,   306,
 1364:      311,   311,   312,   313,   313,   314,   314,   316,   315,   317,
 1365:      315,   318,   315,   319,   315,   315,   320,   315,   321,   315,
 1366:      322,   315,   323,   315,   324,   315,   325,   315,   326,   315,
 1367:      327,   315,   328,   315,   329,   315,   330,   315,   331,   315,
 1368:      332,   315,   333,   315,   334,   315,   335,   315,   336,   315,
 1369:      337,   315,   338,   315,   339,   315,   340,   315,   341,   315,
 1370:      342,   315,   343,   315,   344,   315,   345,   315,   346,   315,
 1371:      347,   315,   348,   315,   349,   315,   350,   315,   351,   315,
 1372:      352,   315,   353,   315,   354,   315,   355,   315,   356,   315,
 1373:      357,   315,   358,   315,   359,   315,   360,   315,   361,   315,
 1374:      362,   315,   363,   363,   365,   364,   366,   364,   367,   367,
 1375:      368,   368,   368,   369,   369,   371,   370,   372,   370,   373,
 1376:      370,   374,   370,   375,   370,   376,   376,   376,   377,   377,
 1377:      377,   377
 1378: };
 1379: 
 1380: /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
 1381: static const yytype_uint8 yyr2[] =
 1382: {
 1383:        0,     2,     0,     2,     1,     1,     1,     1,     1,     1,
 1384:        1,     1,     1,     1,     1,     1,     1,     1,     1,     4,
 1385:        0,     2,     0,     4,     0,     4,     0,     4,     0,     4,
 1386:        0,     4,     0,     5,     0,     4,     3,     3,     3,     3,
 1387:        1,     4,     0,     2,     0,     4,     0,     4,     0,     4,
 1388:        0,     4,     0,     4,     4,     0,     2,     0,     4,     0,
 1389:        4,     0,     7,     0,     4,     0,     4,     0,     3,     2,
 1390:        0,     1,     0,     5,     0,     2,     0,     5,     0,     6,
 1391:        0,     5,     0,     6,     0,     4,     0,     4,     0,     5,
 1392:        0,     2,     0,     4,     0,     4,     0,     4,     0,     4,
 1393:        0,     4,     0,     4,     0,     4,     0,     4,     0,     4,
 1394:        0,     4,     0,     4,     0,     4,     4,     0,     2,     0,
 1395:        4,     0,     4,     3,     3,     0,     5,     0,     5,     0,
 1396:        4,     0,     4,     0,     4,     0,     4,     0,     4,     0,
 1397:        4,     0,     4,     0,     4,     0,     4,     0,     4,     0,
 1398:        4,     0,     4,     0,     4,     0,     4,     0,     4,     0,
 1399:        4,     0,     4,     0,     4,     0,     4,     0,     4,     0,
 1400:        4,     1,     3,     1,     1,     3,     1,     1,     3,     2,
 1401:        1,     3,     1,     1,     3,     1,     4,     0,     2,     0,
 1402:        4,     0,     5,     0,     4,     0,     5,     0,     5,     0,
 1403:        5,     0,     0,     8,     1,     2,     2,     2,     2,     2,
 1404:        5,     6,     2,     0,     3,     2,     0,     2,     0,     4,
 1405:        0,     4,     0,     6,     0,     6,     0,     4,     1,     0,
 1406:        4,     2,     0,     1,     0,     1,     1,     1,     1,     1,
 1407:        0,     1,     0,     6,     0,     4,     0,     6,     0,     4,
 1408:        1,     1,     3,     2,     1,     0,     2,     0,     4,     0,
 1409:        4,     0,     4,     0,     4,     2,     0,     4,     0,     5,
 1410:        0,     5,     0,     4,     0,     5,     0,     4,     0,     4,
 1411:        0,     4,     0,     4,     0,     5,     0,     6,     0,     4,
 1412:        0,     5,     0,     6,     0,     4,     0,     4,     0,     4,
 1413:        0,     4,     0,     4,     0,     4,     0,     4,     0,     5,
 1414:        0,     5,     0,     5,     0,     4,     0,     4,     0,     4,
 1415:        0,     4,     0,     4,     0,     4,     0,     4,     0,     4,
 1416:        0,     4,     0,     4,     0,     4,     0,     4,     0,     4,
 1417:        0,     4,     0,     4,     0,     6,     0,     4,     0,     6,
 1418:        0,     5,     0,     2,     0,     5,     0,     4,     1,     1,
 1419:        0,     1,     1,     0,     2,     0,     6,     0,     6,     0,
 1420:        4,     0,     4,     0,     5,     1,     1,     1,     1,     1,
 1421:        1,     1
 1422: };
 1423: 
 1424: /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
 1425:    Performed when YYTABLE doesn't specify something else to do.  Zero
 1426:    means the default is an error.  */
 1427: static const yytype_uint16 yydefact[] =
 1428: {
 1429:        2,     0,     1,     0,     0,     0,     0,     0,     0,     0,
 1430:       88,    72,     0,     0,   201,     0,     0,     0,     3,     4,
 1431:        5,    18,     6,     7,     8,     9,    10,    11,    13,    12,
 1432:       14,    15,    16,    17,    20,     0,     0,     0,    40,     0,
 1433:       42,    55,     0,     0,   117,   187,     0,    70,   244,    70,
 1434:      254,   248,     0,    34,     0,    32,    36,    37,    39,     0,
 1435:        0,    90,    74,     0,     0,   204,     0,   213,     0,    71,
 1436:      253,     0,     0,    69,     0,     0,    38,     0,     0,     0,
 1437:        0,    19,    21,     0,     0,     0,     0,     0,     0,    41,
 1438:       43,     0,     0,    67,     0,    54,    56,     0,     0,     0,
 1439:        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 1440:        0,     0,     0,     0,     0,     0,   116,   118,     0,     0,
 1441:        0,     0,     0,     0,   186,   188,   205,   206,   212,   232,
 1442:        0,     0,     0,   207,   208,   209,   242,   255,   245,   246,
 1443:      249,    35,    24,    22,    28,    26,    30,    33,    44,    46,
 1444:       48,    50,    52,    57,    59,     0,    65,    63,     0,     0,
 1445:        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 1446:       89,    91,     0,     0,     0,     0,    73,    75,   119,   121,
 1447:      173,     0,   171,   176,     0,   174,   131,   133,   135,   137,
 1448:      139,   182,   141,   180,   143,   145,   149,   151,   153,   147,
 1449:      165,   167,   163,   169,   155,   161,     0,     0,   185,   129,
 1450:      183,   157,   159,   189,     0,   193,     0,     0,     0,   233,
 1451:      232,   234,   215,   360,   216,     0,     0,     0,     0,     0,
 1452:        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 1453:       68,     0,     0,     0,    94,    96,    92,    98,   102,   104,
 1454:      100,   106,   108,   110,   112,   114,     0,     0,    84,    86,
 1455:        0,     0,   123,     0,   124,     0,     0,     0,     0,     0,
 1456:        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 1457:        0,     0,     0,     0,     0,     0,   125,   177,   127,     0,
 1458:        0,     0,     0,     0,   375,   376,   377,   191,     0,   195,
 1459:      197,   199,   234,   235,   236,     0,   362,   361,   214,   202,
 1460:      251,   243,   250,     0,   259,     0,     0,     0,     0,     0,
 1461:        0,     0,     0,     0,     0,     0,     0,     0,   298,     0,
 1462:        0,     0,     0,     0,     0,   350,     0,     0,     0,     0,
 1463:        0,   360,     0,     0,     0,     0,     0,     0,     0,   252,
 1464:      256,   247,    25,    23,    29,    27,    31,    45,    47,    49,
 1465:       51,    53,    58,    60,    66,     0,    64,     0,     0,     0,
 1466:        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 1467:       76,     0,    80,     0,     0,   120,   122,   172,   175,   132,
 1468:      134,   136,   138,   140,   142,   181,   144,   146,   150,   152,
 1469:      154,   148,   166,   168,   164,   170,   156,   162,   179,     0,
 1470:        0,     0,   130,   184,   158,   160,   190,     0,   194,     0,
 1471:        0,     0,     0,   238,   239,   237,   210,   226,     0,     0,
 1472:        0,     0,   217,   257,   352,   261,   263,     0,     0,   265,
 1473:      272,     0,     0,   266,     0,   276,   278,   280,   282,   360,
 1474:      360,   294,   296,     0,   300,   324,   328,   326,   346,   320,
 1475:      318,   322,     0,   330,   332,   334,   336,   342,   288,   316,
 1476:      340,   338,   304,   302,   306,   314,     0,     0,     0,    61,
 1477:       95,    97,    93,    99,   103,   105,   101,   107,   109,   111,
 1478:      113,   115,    78,     0,    82,     0,    85,    87,   178,   126,
 1479:      128,   192,   196,   198,   200,   211,     0,   358,   359,   218,
 1480:        0,     0,   220,   203,     0,     0,     0,     0,     0,   356,
 1481:        0,   268,   270,     0,   274,     0,     0,     0,     0,   360,
 1482:      284,   360,   290,     0,     0,     0,     0,     0,     0,     0,
 1483:        0,     0,     0,     0,   363,     0,     0,     0,     0,     0,
 1484:        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 1485:      308,   310,   312,     0,     0,    77,     0,    81,   240,     0,
 1486:      228,     0,     0,     0,     0,   258,   353,   260,   262,   264,
 1487:      354,     0,   273,     0,     0,   267,     0,   277,   279,   281,
 1488:      283,   286,     0,   292,     0,   295,   297,   299,   301,   325,
 1489:      329,   327,   347,   321,   319,   323,     0,   331,   333,   335,
 1490:      337,   343,   289,   317,   341,   339,   305,   303,   307,   315,
 1491:      344,   378,   379,   380,   381,   348,     0,     0,     0,    62,
 1492:       79,    83,   241,   231,   227,     0,   219,   222,   224,   221,
 1493:        0,   357,   269,   271,   275,     0,   285,     0,   291,     0,
 1494:        0,     0,     0,   351,   364,     0,     0,   309,   311,   313,
 1495:        0,     0,     0,   355,   287,   293,   240,   369,   371,     0,
 1496:        0,   345,   349,   230,   223,   225,   373,     0,     0,     0,
 1497:        0,     0,   370,   372,   365,   367,   374,     0,     0,   366,
 1498:      368
 1499: };
 1500: 
 1501: /* YYDEFGOTO[NTERM-NUM].  */
 1502: static const yytype_int16 yydefgoto[] =
 1503: {
 1504:       -1,     1,    18,    19,    54,    82,   229,   228,   231,   230,
 1505:      232,    20,    83,    21,    77,    22,    23,    24,    25,    39,
 1506:       26,    59,    90,   233,   234,   235,   236,   237,    27,    60,
 1507:       96,   238,   239,   563,   243,   241,   155,    50,    70,    28,
 1508:       43,    98,   177,   493,   564,   495,   566,   383,   384,    29,
 1509:       42,    97,   171,   369,   367,   368,   370,   373,   371,   372,
 1510:      374,   375,   376,   377,   378,    30,    63,   117,   260,   261,
 1511:      410,   411,   289,   266,   267,   268,   269,   270,   271,   273,
 1512:      274,   278,   275,   276,   277,   283,   291,   292,   284,   281,
 1513:      279,   280,   282,   181,   182,   184,   185,   286,   287,   192,
 1514:      193,   209,   210,    31,    64,   125,   293,   417,   298,   419,
 1515:      420,   421,    32,    46,   431,    67,    68,   132,   309,   432,
 1516:      571,   574,   661,   662,   506,   569,   635,   570,   221,   305,
 1517:      426,   633,    33,   225,    72,   227,    75,   311,   312,    51,
 1518:      226,   350,   514,   434,   516,   517,   523,   583,   584,   520,
 1519:      586,   525,   526,   527,   528,   592,   645,   550,   594,   647,
 1520:      533,   534,   453,   536,   555,   554,   556,   626,   627,   628,
 1521:      557,   551,   542,   541,   543,   537,   539,   538,   545,   546,
 1522:      547,   548,   553,   552,   549,   655,   540,   656,   462,   515,
 1523:      439,   640,   581,   509,   308,   606,   654,   687,   688,   677,
 1524:      678,   681,   297,   625
 1525: };
 1526: 
 1527: /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
 1528:    STATE-NUM.  */
 1529: #define YYPACT_NINF -542
 1530: static const yytype_int16 yypact[] =
 1531: {
 1532:     -542,    42,  -542,  -124,    46,   -87,   -72,    82,   -63,   -39,
 1533:     -542,  -542,   -29,   -15,  -542,   -50,    34,     7,  -542,  -542,
 1534:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1535:     -542,  -542,  -542,  -542,  -542,    12,    10,    21,  -542,    25,
 1536:     -542,  -542,    38,    40,  -542,  -542,    30,    66,    89,    66,
 1537:     -542,   143,    37,  -542,     3,  -542,  -542,  -542,  -542,    -4,
 1538:       -5,  -542,  -542,    29,    -9,    35,   -11,    36,    45,  -542,
 1539:     -542,    72,    63,  -542,   -45,    63,  -542,    71,   -53,   -13,
 1540:       76,  -542,  -542,    73,    85,    87,    90,    88,    99,  -542,
 1541:     -542,    94,    94,  -542,    -8,  -542,  -542,    -7,    -6,    96,
 1542:       97,   102,   104,   107,   106,   108,    54,    81,     4,   110,
 1543:      103,   115,   122,   112,   118,   109,  -542,  -542,   119,   120,
 1544:      121,   123,   124,   125,  -542,  -542,  -542,  -542,  -542,   -90,
 1545:      113,   177,   111,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1546:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1547:     -542,  -542,  -542,  -542,  -542,   114,  -542,   126,   127,   129,
 1548:      132,   130,   131,   133,   135,   134,   136,   137,   138,   139,
 1549:     -542,  -542,   140,   141,   146,   147,  -542,  -542,  -542,  -542,
 1550:     -542,   142,   144,  -542,   145,   148,  -542,  -542,  -542,  -542,
 1551:     -542,  -542,  -542,   149,  -542,  -542,  -542,  -542,  -542,  -542,
 1552:     -542,  -542,  -542,  -542,  -542,  -542,   150,   150,  -542,  -542,
 1553:      151,  -542,  -542,  -542,    14,  -542,    14,    14,    14,  -542,
 1554:      157,    50,  -542,    32,  -542,    27,   117,    27,   153,   155,
 1555:      156,   158,   159,   160,   161,   162,   163,   164,   165,   166,
 1556:     -542,   167,   154,   168,  -542,  -542,  -542,  -542,  -542,  -542,
 1557:     -542,  -542,  -542,  -542,  -542,  -542,   -12,    -3,  -542,  -542,
 1558:      169,   170,  -542,   102,  -542,   104,   171,   173,   174,   175,
 1559:      176,   178,   108,   179,   180,   181,   182,   183,   184,   185,
 1560:      187,   188,   189,   190,   191,   172,   192,  -542,   192,   193,
 1561:      112,   194,   196,   197,  -542,  -542,  -542,  -542,   198,  -542,
 1562:     -542,  -542,    50,  -542,  -542,    -1,  -542,  -542,  -542,   -21,
 1563:     -542,  -542,  -542,    94,  -542,   214,   213,    92,   -37,   199,
 1564:      152,   205,   212,   215,   206,   207,   216,   218,  -542,   219,
 1565:      220,   -57,   201,   -75,   221,  -542,   222,   224,   225,   226,
 1566:      227,    32,   228,   -30,   -20,   230,   231,    70,   210,  -542,
 1567:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1568:     -542,  -542,  -542,  -542,  -542,   233,  -542,   217,   223,   229,
 1569:      232,   234,   235,   236,   237,   238,   239,   240,   241,   211,
 1570:     -542,   243,  -542,   242,   244,  -542,  -542,  -542,  -542,  -542,
 1571:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1572:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,   150,
 1573:      245,   246,  -542,  -542,  -542,  -542,  -542,   247,  -542,   248,
 1574:      249,   250,    -1,  -542,  -542,  -542,  -542,  -542,   -38,    75,
 1575:      257,   203,  -542,  -542,  -542,  -542,  -542,   261,   262,  -542,
 1576:     -542,   263,   264,  -542,   265,  -542,  -542,  -542,  -542,   -59,
 1577:      -56,  -542,  -542,   -38,  -542,  -542,  -542,  -542,  -542,  -542,
 1578:     -542,  -542,   255,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1579:     -542,  -542,  -542,  -542,  -542,  -542,   271,   272,    31,  -542,
 1580:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1581:     -542,  -542,  -542,   259,  -542,   260,  -542,  -542,  -542,  -542,
 1582:     -542,  -542,  -542,  -542,  -542,  -542,   269,  -542,  -542,  -542,
 1583:      275,   276,  -542,  -542,   266,   -49,   267,   268,   273,  -542,
 1584:      270,  -542,  -542,   274,  -542,   277,   278,   279,   280,    32,
 1585:     -542,    32,  -542,   281,   282,   283,   284,   285,   286,   287,
 1586:      288,   289,   290,   291,  -542,   292,   294,   295,   296,   297,
 1587:      298,   299,   300,   301,   302,   303,   304,   305,    14,    13,
 1588:     -542,  -542,  -542,   306,   307,  -542,   308,  -542,   323,   310,
 1589:      309,   311,    14,    13,   313,  -542,  -542,  -542,  -542,  -542,
 1590:     -542,   314,  -542,   315,   316,  -542,   317,  -542,  -542,  -542,
 1591:     -542,  -542,   318,  -542,   319,  -542,  -542,  -542,  -542,  -542,
 1592:     -542,  -542,  -542,  -542,  -542,  -542,   -27,  -542,  -542,  -542,
 1593:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1594:     -542,  -542,  -542,  -542,  -542,  -542,   320,   321,   322,  -542,
 1595:     -542,  -542,  -542,  -542,  -542,   324,  -542,  -542,  -542,  -542,
 1596:      325,  -542,  -542,  -542,  -542,   326,  -542,   328,  -542,   312,
 1597:      -38,   333,    91,  -542,  -542,   329,   330,  -542,  -542,  -542,
 1598:      269,   331,   332,  -542,  -542,  -542,   323,  -542,  -542,   338,
 1599:      347,  -542,  -542,  -542,  -542,  -542,  -542,   334,   335,    14,
 1600:       13,   336,  -542,  -542,  -542,  -542,  -542,   337,   339,  -542,
 1601:     -542
 1602: };
 1603: 
 1604: /* YYPGOTO[NTERM-NUM].  */
 1605: static const yytype_int16 yypgoto[] =
 1606: {
 1607:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1608:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1609:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1610:     -542,  -542,  -542,  -542,  -542,  -542,  -542,   -88,   342,  -542,
 1611:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1612:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1613:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1614:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1615:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1616:     -542,  -542,  -542,    20,  -542,    48,  -542,   327,   -93,    47,
 1617:     -542,   105,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1618:     -542,  -542,  -542,  -542,  -542,  -542,    86,  -542,  -542,  -542,
 1619:     -542,  -542,  -542,  -542,  -542,  -340,  -542,  -542,   293,    95,
 1620:      -95,  -282,  -542,  -542,  -542,  -542,  -542,   208,    98,   360,
 1621:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1622:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1623:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1624:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1625:     -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,  -542,
 1626:     -542,  -542,  -542,  -448,  -335,  -542,  -542,  -542,  -542,  -542,
 1627:     -542,  -542,  -216,  -541
 1628: };
 1629: 
 1630: /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
 1631:    positive, shift that token.  If negative, reduce the rule which
 1632:    number is the opposite.  If YYTABLE_NINF, syntax error.  */
 1633: #define YYTABLE_NINF -230
 1634: static const yytype_int16 yytable[] =
 1635: {
 1636:      299,   300,   301,   153,   154,   535,   468,    78,    79,    80,
 1637:       84,    85,    86,    87,    88,    91,    92,   156,    93,    94,
 1638:      158,   159,   160,   161,   162,   163,   164,   165,   166,   167,
 1639:      168,   169,   638,    47,   172,   173,   174,   175,    47,   576,
 1640:      507,   130,     2,   529,   459,     3,   531,    34,   219,     4,
 1641:      649,     5,     6,     7,    35,     8,   427,   200,   456,   201,
 1642:      202,     9,   118,   119,   120,   121,   122,   123,    10,   440,
 1643:      441,   442,   220,    36,    99,   100,   101,   102,   103,   104,
 1644:      105,    11,   460,   650,    37,   470,    12,   106,   107,   108,
 1645:      109,   110,   111,   112,    38,   472,   113,   114,   115,   651,
 1646:      457,   306,   307,   142,   306,   307,   194,   143,    40,   195,
 1647:       48,    49,    13,    65,   530,   532,    49,   131,   508,   126,
 1648:      652,   577,    14,   443,    15,   428,   429,   471,   133,   134,
 1649:      430,    66,    41,   196,   197,   198,    66,   473,   199,   685,
 1650:      423,   424,    44,   144,   379,   653,    66,   145,   380,   128,
 1651:      129,   127,   157,   381,   135,   425,    45,   382,   187,   188,
 1652:      189,   190,    52,   124,    53,   170,   176,    95,    89,    16,
 1653:      138,    17,    55,   140,    71,    81,   621,   622,   623,   624,
 1654:       56,   294,   295,   296,   560,   561,   562,   206,   207,   303,
 1655:      304,    57,   306,   307,   591,    58,   593,   310,   137,   437,
 1656:      438,   116,   667,   313,   314,    69,   315,    76,   316,    61,
 1657:      317,    62,   318,   319,   320,   321,   322,   323,   476,   477,
 1658:      324,   325,   326,   510,   511,   433,   327,   328,    74,   329,
 1659:      330,   331,   136,   332,   137,   333,   146,   334,   335,   669,
 1660:      670,   141,   148,   147,   149,   151,   150,   336,   337,   338,
 1661:      339,   340,   341,   342,   343,    49,   152,   178,   179,   204,
 1662:      344,   345,   346,   180,   347,   183,   212,   186,   191,   348,
 1663:      203,   205,   208,   222,   211,   213,   214,   215,   223,   216,
 1664:      217,   218,   224,   387,   240,   245,   242,   244,   246,   349,
 1665:      247,   248,   250,   249,   251,   219,   252,   253,   254,   255,
 1666:      256,   257,   258,   259,   435,   436,   444,   449,   450,   445,
 1667:      408,   285,   262,   388,   365,   264,   498,   263,   458,   395,
 1668:      673,   265,   272,   352,   290,   353,   354,   505,   355,   356,
 1669:      357,   358,   359,   360,   361,   362,   363,   364,   366,   385,
 1670:      386,   389,   620,   390,   391,   392,   393,   568,   394,   396,
 1671:      397,   398,   399,   400,   401,   402,   637,   403,   404,   405,
 1672:      406,   407,   446,   412,   414,   409,   415,   416,   418,   447,
 1673:      478,   492,   448,   451,   452,   513,   454,   455,   461,   463,
 1674:      464,   465,   466,   467,   676,   469,   474,   480,   475,   479,
 1675:      666,    73,     0,   481,     0,   413,     0,   422,     0,   482,
 1676:        0,     0,   483,   494,   484,   485,   486,   487,   488,   489,
 1677:      490,   491,   496,   512,   497,   499,   500,   501,   502,   503,
 1678:      504,   518,   519,   521,   522,   524,   544,   558,   559,   565,
 1679:      567,   572,   573,   580,   139,   351,   575,   578,   579,     0,
 1680:      582,     0,     0,     0,   585,     0,     0,   587,   588,   589,
 1681:      590,   595,   596,   597,   598,   599,   600,   601,   602,   603,
 1682:      604,   605,   607,   684,   608,   609,   610,   611,   612,   613,
 1683:      614,   615,   616,   617,   618,   619,   629,   630,   631,   632,
 1684:      634,   636,  -229,   639,   641,   642,   643,   644,   646,   648,
 1685:      657,   658,   659,   668,   679,   663,   664,   660,   665,   671,
 1686:      672,   674,   675,   680,   682,   683,   686,   689,     0,   690,
 1687:        0,     0,     0,   302,     0,     0,     0,     0,     0,     0,
 1688:        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 1689:        0,     0,     0,     0,   288
 1690: };
 1691: 
 1692: #define yypact_value_is_default(yystate) \
 1693:   ((yystate) == (-542))
 1694: 
 1695: #define yytable_value_is_error(yytable_value) \
 1696:   YYID (0)
 1697: 
 1698: static const yytype_int16 yycheck[] =
 1699: {
 1700:      216,   217,   218,    91,    92,   453,   341,     4,     5,     6,
 1701:       14,    15,    16,    17,    18,    20,    21,    25,    23,    24,
 1702:       27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
 1703:       37,    38,   573,    83,    40,    41,    42,    43,    83,    88,
 1704:       78,     5,     0,   102,   119,     3,   102,   171,   138,     7,
 1705:       77,     9,    10,    11,     8,    13,    77,    53,   115,    55,
 1706:       56,    19,    71,    72,    73,    74,    75,    76,    26,   106,
 1707:      107,   108,   162,   160,    45,    46,    47,    48,    49,    50,
 1708:       51,    39,   157,   110,   156,   115,    44,    58,    59,    60,
 1709:       61,    62,    63,    64,    12,   115,    67,    68,    69,   126,
 1710:      157,   160,   161,   156,   160,   161,    52,   160,   171,    55,
 1711:      160,   161,    70,    83,   449,   450,   161,    81,   156,    84,
 1712:      147,   170,    80,   160,    82,   146,   147,   157,    83,    84,
 1713:      151,   101,   171,    52,    53,    54,   101,   157,    57,   680,
 1714:      141,   142,   171,   156,   156,   172,   101,   160,   160,   160,
 1715:      161,    65,   160,   156,    68,   156,   171,   160,    52,    53,
 1716:       54,    55,   128,   172,   157,   172,   172,   172,   172,   127,
 1717:       72,   129,   160,    75,    85,   172,   163,   164,   165,   166,
 1718:      170,   167,   168,   169,   153,   154,   155,    65,    66,   139,
 1719:      140,   170,   160,   161,   529,   170,   531,   170,   171,   107,
 1720:      108,   172,   650,    86,    87,   139,    89,   170,    91,   171,
 1721:       93,   171,    95,    96,    97,    98,    99,   100,   148,   149,
 1722:      103,   104,   105,   148,   149,   313,   109,   110,    85,   112,
 1723:      113,   114,   160,   116,   171,   118,   160,   120,   121,   148,
 1724:      149,   170,   157,   170,   157,   157,   156,   130,   131,   132,
 1725:      133,   134,   135,   136,   137,   161,   157,   161,   161,   156,
 1726:      143,   144,   145,   161,   147,   161,   157,   160,   160,   152,
 1727:      160,   156,   160,   160,   156,   156,   156,   156,   101,   156,
 1728:      156,   156,   171,   263,   170,   156,   160,   160,   156,   172,
 1729:      160,   160,   157,   160,   160,   138,   160,   160,   160,   160,
 1730:      160,   160,   156,   156,    90,    92,   107,   101,   101,   157,
 1731:      138,   161,   170,   265,   160,   170,   409,   173,   117,   272,
 1732:      660,   173,   173,   170,   173,   170,   170,   422,   170,   170,
 1733:      170,   170,   170,   170,   170,   170,   170,   170,   170,   170,
 1734:      170,   170,   558,   170,   170,   170,   170,    78,   170,   170,
 1735:      170,   170,   170,   170,   170,   170,   572,   170,   170,   170,
 1736:      170,   170,   157,   170,   170,   173,   170,   170,   170,   157,
 1737:      160,   160,   157,   157,   156,   172,   157,   157,   157,   157,
 1738:      156,   156,   156,   156,   666,   157,   156,   170,   157,   156,
 1739:       78,    49,    -1,   170,    -1,   290,    -1,   302,    -1,   170,
 1740:       -1,    -1,   170,   160,   170,   170,   170,   170,   170,   170,
 1741:      170,   170,   170,   156,   170,   170,   170,   170,   170,   170,
 1742:      170,   160,   160,   160,   160,   160,   171,   156,   156,   170,
 1743:      170,   156,   156,   160,    74,   227,   170,   170,   170,    -1,
 1744:      170,    -1,    -1,    -1,   170,    -1,    -1,   170,   170,   170,
 1745:      170,   170,   170,   170,   170,   170,   170,   170,   170,   170,
 1746:      170,   170,   170,   679,   170,   170,   170,   170,   170,   170,
 1747:      170,   170,   170,   170,   170,   170,   170,   170,   170,   156,
 1748:      170,   170,   173,   170,   170,   170,   170,   170,   170,   170,
 1749:      170,   170,   170,   160,   156,   170,   170,   173,   170,   170,
 1750:      170,   170,   170,   156,   170,   170,   170,   170,    -1,   170,
 1751:       -1,    -1,    -1,   220,    -1,    -1,    -1,    -1,    -1,    -1,
 1752:       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
 1753:       -1,    -1,    -1,    -1,   207
 1754: };
 1755: 
 1756: /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
 1757:    symbol of state STATE-NUM.  */
 1758: static const yytype_uint16 yystos[] =
 1759: {
 1760:        0,   175,     0,     3,     7,     9,    10,    11,    13,    19,
 1761:       26,    39,    44,    70,    80,    82,   127,   129,   176,   177,
 1762:      185,   187,   189,   190,   191,   192,   194,   202,   213,   223,
 1763:      239,   277,   286,   306,   171,     8,   160,   156,    12,   193,
 1764:      171,   171,   224,   214,   171,   171,   287,    83,   160,   161,
 1765:      211,   313,   128,   157,   178,   160,   170,   170,   170,   195,
 1766:      203,   171,   171,   240,   278,    83,   101,   289,   290,   139,
 1767:      212,    85,   308,   212,    85,   310,   170,   188,     4,     5,
 1768:        6,   172,   179,   186,    14,    15,    16,    17,    18,   172,
 1769:      196,    20,    21,    23,    24,   172,   204,   225,   215,    45,
 1770:       46,    47,    48,    49,    50,    51,    58,    59,    60,    61,
 1771:       62,    63,    64,    67,    68,    69,   172,   241,    71,    72,
 1772:       73,    74,    75,    76,   172,   279,    84,   290,   160,   161,
 1773:        5,    81,   291,    83,    84,   290,   160,   171,   312,   313,
 1774:      312,   170,   156,   160,   156,   160,   160,   170,   157,   157,
 1775:      156,   157,   157,   211,   211,   210,    25,   160,    27,    28,
 1776:       29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
 1777:      172,   226,    40,    41,    42,    43,   172,   216,   161,   161,
 1778:      161,   267,   268,   161,   269,   270,   160,    52,    53,    54,
 1779:       55,   160,   273,   274,    52,    55,    52,    53,    54,    57,
 1780:       53,    55,    56,   160,   156,   156,    65,    66,   160,   275,
 1781:      276,   156,   157,   156,   156,   156,   156,   156,   156,   138,
 1782:      162,   302,   160,   101,   171,   307,   314,   309,   181,   180,
 1783:      183,   182,   184,   197,   198,   199,   200,   201,   205,   206,
 1784:      170,   209,   160,   208,   160,   156,   156,   160,   160,   160,
 1785:      157,   160,   160,   160,   160,   160,   160,   160,   156,   156,
 1786:      242,   243,   170,   173,   170,   173,   247,   248,   249,   250,
 1787:      251,   252,   173,   253,   254,   256,   257,   258,   255,   264,
 1788:      265,   263,   266,   259,   262,   161,   271,   272,   271,   246,
 1789:      173,   260,   261,   280,   167,   168,   169,   376,   282,   376,
 1790:      376,   376,   302,   139,   140,   303,   160,   161,   368,   292,
 1791:      170,   311,   312,    86,    87,    89,    91,    93,    95,    96,
 1792:       97,    98,    99,   100,   103,   104,   105,   109,   110,   112,
 1793:      113,   114,   116,   118,   120,   121,   130,   131,   132,   133,
 1794:      134,   135,   136,   137,   143,   144,   145,   147,   152,   172,
 1795:      315,   311,   170,   170,   170,   170,   170,   170,   170,   170,
 1796:      170,   170,   170,   170,   170,   160,   170,   228,   229,   227,
 1797:      230,   232,   233,   231,   234,   235,   236,   237,   238,   156,
 1798:      160,   156,   160,   221,   222,   170,   170,   267,   269,   170,
 1799:      170,   170,   170,   170,   170,   273,   170,   170,   170,   170,
 1800:      170,   170,   170,   170,   170,   170,   170,   170,   138,   173,
 1801:      244,   245,   170,   275,   170,   170,   170,   281,   170,   283,
 1802:      284,   285,   303,   141,   142,   156,   304,    77,   146,   147,
 1803:      151,   288,   293,   211,   317,    90,    92,   107,   108,   364,
 1804:      106,   107,   108,   160,   107,   157,   157,   157,   157,   101,
 1805:      101,   157,   156,   336,   157,   157,   115,   157,   117,   119,
 1806:      157,   157,   362,   157,   156,   156,   156,   156,   368,   157,
 1807:      115,   157,   115,   157,   156,   157,   148,   149,   160,   156,
 1808:      170,   170,   170,   170,   170,   170,   170,   170,   170,   170,
 1809:      170,   170,   160,   217,   160,   219,   170,   170,   272,   170,
 1810:      170,   170,   170,   170,   170,   304,   298,    78,   156,   367,
 1811:      148,   149,   156,   172,   316,   363,   318,   319,   160,   160,
 1812:      323,   160,   160,   320,   160,   325,   326,   327,   328,   102,
 1813:      368,   102,   368,   334,   335,   367,   337,   349,   351,   350,
 1814:      360,   347,   346,   348,   171,   352,   353,   354,   355,   358,
 1815:      331,   345,   357,   356,   339,   338,   340,   344,   156,   156,
 1816:      153,   154,   155,   207,   218,   170,   220,   170,    78,   299,
 1817:      301,   294,   156,   156,   295,   170,    88,   170,   170,   170,
 1818:      160,   366,   170,   321,   322,   170,   324,   170,   170,   170,
 1819:      170,   368,   329,   368,   332,   170,   170,   170,   170,   170,
 1820:      170,   170,   170,   170,   170,   170,   369,   170,   170,   170,
 1821:      170,   170,   170,   170,   170,   170,   170,   170,   170,   170,
 1822:      376,   163,   164,   165,   166,   377,   341,   342,   343,   170,
 1823:      170,   170,   156,   305,   170,   300,   170,   376,   377,   170,
 1824:      365,   170,   170,   170,   170,   330,   170,   333,   170,    77,
 1825:      110,   126,   147,   172,   370,   359,   361,   170,   170,   170,
 1826:      173,   296,   297,   170,   170,   170,    78,   367,   160,   148,
 1827:      149,   170,   170,   299,   170,   170,   305,   373,   374,   156,
 1828:      156,   375,   170,   170,   376,   377,   170,   371,   372,   170,
 1829:      170
 1830: };
 1831: 
 1832: #define yyerrok		(yyerrstatus = 0)
 1833: #define yyclearin	(yychar = YYEMPTY)
 1834: #define YYEMPTY		(-2)
 1835: #define YYEOF		0
 1836: 
 1837: #define YYACCEPT	goto yyacceptlab
 1838: #define YYABORT		goto yyabortlab
 1839: #define YYERROR		goto yyerrorlab
 1840: 
 1841: 
 1842: /* Like YYERROR except do call yyerror.  This remains here temporarily
 1843:    to ease the transition to the new meaning of YYERROR, for GCC.
 1844:    Once GCC version 2 has supplanted version 1, this can go.  However,
 1845:    YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
 1846:    in Bison 2.4.2's NEWS entry, where a plan to phase it out is
 1847:    discussed.  */
 1848: 
 1849: #define YYFAIL		goto yyerrlab
 1850: #if defined YYFAIL
 1851:   /* This is here to suppress warnings from the GCC cpp's
 1852:      -Wunused-macros.  Normally we don't worry about that warning, but
 1853:      some users do, and we want to make it easy for users to remove
 1854:      YYFAIL uses, which will produce warnings from Bison 2.5.  */
 1855: #endif
 1856: 
 1857: #define YYRECOVERING()  (!!yyerrstatus)
 1858: 
 1859: #define YYBACKUP(Token, Value)                                  \
 1860: do                                                              \
 1861:   if (yychar == YYEMPTY)                                        \
 1862:     {                                                           \
 1863:       yychar = (Token);                                         \
 1864:       yylval = (Value);                                         \
 1865:       YYPOPSTACK (yylen);                                       \
 1866:       yystate = *yyssp;                                         \
 1867:       goto yybackup;                                            \
 1868:     }                                                           \
 1869:   else                                                          \
 1870:     {                                                           \
 1871:       yyerror (YY_("syntax error: cannot back up")); \
 1872:       YYERROR;							\
 1873:     }								\
 1874: while (YYID (0))
 1875: 
 1876: 
 1877: #define YYTERROR	1
 1878: #define YYERRCODE	256
 1879: 
 1880: /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
 1881:    If N is 0, then set CURRENT to the empty location which ends
 1882:    the previous symbol: RHS[0] (always defined).  */
 1883: 
 1884: #ifndef YYLLOC_DEFAULT
 1885: # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
 1886:     do                                                                  \
 1887:       if (YYID (N))                                                     \
 1888:         {                                                               \
 1889:           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
 1890:           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
 1891:           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
 1892:           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
 1893:         }                                                               \
 1894:       else                                                              \
 1895:         {                                                               \
 1896:           (Current).first_line   = (Current).last_line   =              \
 1897:             YYRHSLOC (Rhs, 0).last_line;                                \
 1898:           (Current).first_column = (Current).last_column =              \
 1899:             YYRHSLOC (Rhs, 0).last_column;                              \
 1900:         }                                                               \
 1901:     while (YYID (0))
 1902: #endif
 1903: 
 1904: #define YYRHSLOC(Rhs, K) ((Rhs)[K])
 1905: 
 1906: 
 1907: 
 1908: /* This macro is provided for backward compatibility. */
 1909: 
 1910: #ifndef YY_LOCATION_PRINT
 1911: # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
 1912: #endif
 1913: 
 1914: 
 1915: /* YYLEX -- calling `yylex' with the right arguments.  */
 1916: 
 1917: #ifdef YYLEX_PARAM
 1918: # define YYLEX yylex (YYLEX_PARAM)
 1919: #else
 1920: # define YYLEX yylex ()
 1921: #endif
 1922: 
 1923: /* Enable debugging if requested.  */
 1924: #if YYDEBUG
 1925: 
 1926: # ifndef YYFPRINTF
 1927: #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
 1928: #  define YYFPRINTF fprintf
 1929: # endif
 1930: 
 1931: # define YYDPRINTF(Args)			\
 1932: do {						\
 1933:   if (yydebug)					\
 1934:     YYFPRINTF Args;				\
 1935: } while (YYID (0))
 1936: 
 1937: # define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
 1938: do {									  \
 1939:   if (yydebug)								  \
 1940:     {									  \
 1941:       YYFPRINTF (stderr, "%s ", Title);					  \
 1942:       yy_symbol_print (stderr,						  \
 1943: 		  Type, Value); \
 1944:       YYFPRINTF (stderr, "\n");						  \
 1945:     }									  \
 1946: } while (YYID (0))
 1947: 
 1948: 
 1949: /*--------------------------------.
 1950: | Print this symbol on YYOUTPUT.  |
 1951: `--------------------------------*/
 1952: 
 1953: /*ARGSUSED*/
 1954: #if (defined __STDC__ || defined __C99__FUNC__ \
 1955:      || defined __cplusplus || defined _MSC_VER)
 1956: static void
 1957: yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 1958: #else
 1959: static void
 1960: yy_symbol_value_print (yyoutput, yytype, yyvaluep)
 1961:     FILE *yyoutput;
 1962:     int yytype;
 1963:     YYSTYPE const * const yyvaluep;
 1964: #endif
 1965: {
 1966:   FILE *yyo = yyoutput;
 1967:   YYUSE (yyo);
 1968:   if (!yyvaluep)
 1969:     return;
 1970: # ifdef YYPRINT
 1971:   if (yytype < YYNTOKENS)
 1972:     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
 1973: # else
 1974:   YYUSE (yyoutput);
 1975: # endif
 1976:   switch (yytype)
 1977:     {
 1978:       default:
 1979: 	break;
 1980:     }
 1981: }
 1982: 
 1983: 
 1984: /*--------------------------------.
 1985: | Print this symbol on YYOUTPUT.  |
 1986: `--------------------------------*/
 1987: 
 1988: #if (defined __STDC__ || defined __C99__FUNC__ \
 1989:      || defined __cplusplus || defined _MSC_VER)
 1990: static void
 1991: yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 1992: #else
 1993: static void
 1994: yy_symbol_print (yyoutput, yytype, yyvaluep)
 1995:     FILE *yyoutput;
 1996:     int yytype;
 1997:     YYSTYPE const * const yyvaluep;
 1998: #endif
 1999: {
 2000:   if (yytype < YYNTOKENS)
 2001:     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
 2002:   else
 2003:     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
 2004: 
 2005:   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
 2006:   YYFPRINTF (yyoutput, ")");
 2007: }
 2008: 
 2009: /*------------------------------------------------------------------.
 2010: | yy_stack_print -- Print the state stack from its BOTTOM up to its |
 2011: | TOP (included).                                                   |
 2012: `------------------------------------------------------------------*/
 2013: 
 2014: #if (defined __STDC__ || defined __C99__FUNC__ \
 2015:      || defined __cplusplus || defined _MSC_VER)
 2016: static void
 2017: yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
 2018: #else
 2019: static void
 2020: yy_stack_print (yybottom, yytop)
 2021:     yytype_int16 *yybottom;
 2022:     yytype_int16 *yytop;
 2023: #endif
 2024: {
 2025:   YYFPRINTF (stderr, "Stack now");
 2026:   for (; yybottom <= yytop; yybottom++)
 2027:     {
 2028:       int yybot = *yybottom;
 2029:       YYFPRINTF (stderr, " %d", yybot);
 2030:     }
 2031:   YYFPRINTF (stderr, "\n");
 2032: }
 2033: 
 2034: # define YY_STACK_PRINT(Bottom, Top)				\
 2035: do {								\
 2036:   if (yydebug)							\
 2037:     yy_stack_print ((Bottom), (Top));				\
 2038: } while (YYID (0))
 2039: 
 2040: 
 2041: /*------------------------------------------------.
 2042: | Report that the YYRULE is going to be reduced.  |
 2043: `------------------------------------------------*/
 2044: 
 2045: #if (defined __STDC__ || defined __C99__FUNC__ \
 2046:      || defined __cplusplus || defined _MSC_VER)
 2047: static void
 2048: yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
 2049: #else
 2050: static void
 2051: yy_reduce_print (yyvsp, yyrule)
 2052:     YYSTYPE *yyvsp;
 2053:     int yyrule;
 2054: #endif
 2055: {
 2056:   int yynrhs = yyr2[yyrule];
 2057:   int yyi;
 2058:   unsigned long int yylno = yyrline[yyrule];
 2059:   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
 2060: 	     yyrule - 1, yylno);
 2061:   /* The symbols being reduced.  */
 2062:   for (yyi = 0; yyi < yynrhs; yyi++)
 2063:     {
 2064:       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
 2065:       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
 2066: 		       &(yyvsp[(yyi + 1) - (yynrhs)])
 2067: 		       		       );
 2068:       YYFPRINTF (stderr, "\n");
 2069:     }
 2070: }
 2071: 
 2072: # define YY_REDUCE_PRINT(Rule)		\
 2073: do {					\
 2074:   if (yydebug)				\
 2075:     yy_reduce_print (yyvsp, Rule); \
 2076: } while (YYID (0))
 2077: 
 2078: /* Nonzero means print parse trace.  It is left uninitialized so that
 2079:    multiple parsers can coexist.  */
 2080: int yydebug;
 2081: #else /* !YYDEBUG */
 2082: # define YYDPRINTF(Args)
 2083: # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
 2084: # define YY_STACK_PRINT(Bottom, Top)
 2085: # define YY_REDUCE_PRINT(Rule)
 2086: #endif /* !YYDEBUG */
 2087: 
 2088: 
 2089: /* YYINITDEPTH -- initial size of the parser's stacks.  */
 2090: #ifndef	YYINITDEPTH
 2091: # define YYINITDEPTH 200
 2092: #endif
 2093: 
 2094: /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
 2095:    if the built-in stack extension method is used).
 2096: 
 2097:    Do not make this value too large; the results are undefined if
 2098:    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
 2099:    evaluated with infinite-precision integer arithmetic.  */
 2100: 
 2101: #ifndef YYMAXDEPTH
 2102: # define YYMAXDEPTH 10000
 2103: #endif
 2104: 
 2105: 
 2106: #if YYERROR_VERBOSE
 2107: 
 2108: # ifndef yystrlen
 2109: #  if defined __GLIBC__ && defined _STRING_H
 2110: #   define yystrlen strlen
 2111: #  else
 2112: /* Return the length of YYSTR.  */
 2113: #if (defined __STDC__ || defined __C99__FUNC__ \
 2114:      || defined __cplusplus || defined _MSC_VER)
 2115: static YYSIZE_T
 2116: yystrlen (const char *yystr)
 2117: #else
 2118: static YYSIZE_T
 2119: yystrlen (yystr)
 2120:     const char *yystr;
 2121: #endif
 2122: {
 2123:   YYSIZE_T yylen;
 2124:   for (yylen = 0; yystr[yylen]; yylen++)
 2125:     continue;
 2126:   return yylen;
 2127: }
 2128: #  endif
 2129: # endif
 2130: 
 2131: # ifndef yystpcpy
 2132: #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
 2133: #   define yystpcpy stpcpy
 2134: #  else
 2135: /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
 2136:    YYDEST.  */
 2137: #if (defined __STDC__ || defined __C99__FUNC__ \
 2138:      || defined __cplusplus || defined _MSC_VER)
 2139: static char *
 2140: yystpcpy (char *yydest, const char *yysrc)
 2141: #else
 2142: static char *
 2143: yystpcpy (yydest, yysrc)
 2144:     char *yydest;
 2145:     const char *yysrc;
 2146: #endif
 2147: {
 2148:   char *yyd = yydest;
 2149:   const char *yys = yysrc;
 2150: 
 2151:   while ((*yyd++ = *yys++) != '\0')
 2152:     continue;
 2153: 
 2154:   return yyd - 1;
 2155: }
 2156: #  endif
 2157: # endif
 2158: 
 2159: # ifndef yytnamerr
 2160: /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
 2161:    quotes and backslashes, so that it's suitable for yyerror.  The
 2162:    heuristic is that double-quoting is unnecessary unless the string
 2163:    contains an apostrophe, a comma, or backslash (other than
 2164:    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
 2165:    null, do not copy; instead, return the length of what the result
 2166:    would have been.  */
 2167: static YYSIZE_T
 2168: yytnamerr (char *yyres, const char *yystr)
 2169: {
 2170:   if (*yystr == '"')
 2171:     {
 2172:       YYSIZE_T yyn = 0;
 2173:       char const *yyp = yystr;
 2174: 
 2175:       for (;;)
 2176: 	switch (*++yyp)
 2177: 	  {
 2178: 	  case '\'':
 2179: 	  case ',':
 2180: 	    goto do_not_strip_quotes;
 2181: 
 2182: 	  case '\\':
 2183: 	    if (*++yyp != '\\')
 2184: 	      goto do_not_strip_quotes;
 2185: 	    /* Fall through.  */
 2186: 	  default:
 2187: 	    if (yyres)
 2188: 	      yyres[yyn] = *yyp;
 2189: 	    yyn++;
 2190: 	    break;
 2191: 
 2192: 	  case '"':
 2193: 	    if (yyres)
 2194: 	      yyres[yyn] = '\0';
 2195: 	    return yyn;
 2196: 	  }
 2197:     do_not_strip_quotes: ;
 2198:     }
 2199: 
 2200:   if (! yyres)
 2201:     return yystrlen (yystr);
 2202: 
 2203:   return yystpcpy (yyres, yystr) - yyres;
 2204: }
 2205: # endif
 2206: 
 2207: /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
 2208:    about the unexpected token YYTOKEN for the state stack whose top is
 2209:    YYSSP.
 2210: 
 2211:    Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
 2212:    not large enough to hold the message.  In that case, also set
 2213:    *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
 2214:    required number of bytes is too large to store.  */
 2215: static int
 2216: yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
 2217:                 yytype_int16 *yyssp, int yytoken)
 2218: {
 2219:   YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
 2220:   YYSIZE_T yysize = yysize0;
 2221:   YYSIZE_T yysize1;
 2222:   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
 2223:   /* Internationalized format string. */
 2224:   const char *yyformat = YY_NULL;
 2225:   /* Arguments of yyformat. */
 2226:   char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
 2227:   /* Number of reported tokens (one for the "unexpected", one per
 2228:      "expected"). */
 2229:   int yycount = 0;
 2230: 
 2231:   /* There are many possibilities here to consider:
 2232:      - Assume YYFAIL is not used.  It's too flawed to consider.  See
 2233:        <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
 2234:        for details.  YYERROR is fine as it does not invoke this
 2235:        function.
 2236:      - If this state is a consistent state with a default action, then
 2237:        the only way this function was invoked is if the default action
 2238:        is an error action.  In that case, don't check for expected
 2239:        tokens because there are none.
 2240:      - The only way there can be no lookahead present (in yychar) is if
 2241:        this state is a consistent state with a default action.  Thus,
 2242:        detecting the absence of a lookahead is sufficient to determine
 2243:        that there is no unexpected or expected token to report.  In that
 2244:        case, just report a simple "syntax error".
 2245:      - Don't assume there isn't a lookahead just because this state is a
 2246:        consistent state with a default action.  There might have been a
 2247:        previous inconsistent state, consistent state with a non-default
 2248:        action, or user semantic action that manipulated yychar.
 2249:      - Of course, the expected token list depends on states to have
 2250:        correct lookahead information, and it depends on the parser not
 2251:        to perform extra reductions after fetching a lookahead from the
 2252:        scanner and before detecting a syntax error.  Thus, state merging
 2253:        (from LALR or IELR) and default reductions corrupt the expected
 2254:        token list.  However, the list is correct for canonical LR with
 2255:        one exception: it will still contain any token that will not be
 2256:        accepted due to an error action in a later state.
 2257:   */
 2258:   if (yytoken != YYEMPTY)
 2259:     {
 2260:       int yyn = yypact[*yyssp];
 2261:       yyarg[yycount++] = yytname[yytoken];
 2262:       if (!yypact_value_is_default (yyn))
 2263:         {
 2264:           /* Start YYX at -YYN if negative to avoid negative indexes in
 2265:              YYCHECK.  In other words, skip the first -YYN actions for
 2266:              this state because they are default actions.  */
 2267:           int yyxbegin = yyn < 0 ? -yyn : 0;
 2268:           /* Stay within bounds of both yycheck and yytname.  */
 2269:           int yychecklim = YYLAST - yyn + 1;
 2270:           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
 2271:           int yyx;
 2272: 
 2273:           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
 2274:             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
 2275:                 && !yytable_value_is_error (yytable[yyx + yyn]))
 2276:               {
 2277:                 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
 2278:                   {
 2279:                     yycount = 1;
 2280:                     yysize = yysize0;
 2281:                     break;
 2282:                   }
 2283:                 yyarg[yycount++] = yytname[yyx];
 2284:                 yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
 2285:                 if (! (yysize <= yysize1
 2286:                        && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
 2287:                   return 2;
 2288:                 yysize = yysize1;
 2289:               }
 2290:         }
 2291:     }
 2292: 
 2293:   switch (yycount)
 2294:     {
 2295: # define YYCASE_(N, S)                      \
 2296:       case N:                               \
 2297:         yyformat = S;                       \
 2298:       break
 2299:       YYCASE_(0, YY_("syntax error"));
 2300:       YYCASE_(1, YY_("syntax error, unexpected %s"));
 2301:       YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
 2302:       YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
 2303:       YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
 2304:       YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
 2305: # undef YYCASE_
 2306:     }
 2307: 
 2308:   yysize1 = yysize + yystrlen (yyformat);
 2309:   if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
 2310:     return 2;
 2311:   yysize = yysize1;
 2312: 
 2313:   if (*yymsg_alloc < yysize)
 2314:     {
 2315:       *yymsg_alloc = 2 * yysize;
 2316:       if (! (yysize <= *yymsg_alloc
 2317:              && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
 2318:         *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
 2319:       return 1;
 2320:     }
 2321: 
 2322:   /* Avoid sprintf, as that infringes on the user's name space.
 2323:      Don't have undefined behavior even if the translation
 2324:      produced a string with the wrong number of "%s"s.  */
 2325:   {
 2326:     char *yyp = *yymsg;
 2327:     int yyi = 0;
 2328:     while ((*yyp = *yyformat) != '\0')
 2329:       if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
 2330:         {
 2331:           yyp += yytnamerr (yyp, yyarg[yyi++]);
 2332:           yyformat += 2;
 2333:         }
 2334:       else
 2335:         {
 2336:           yyp++;
 2337:           yyformat++;
 2338:         }
 2339:   }
 2340:   return 0;
 2341: }
 2342: #endif /* YYERROR_VERBOSE */
 2343: 
 2344: /*-----------------------------------------------.
 2345: | Release the memory associated to this symbol.  |
 2346: `-----------------------------------------------*/
 2347: 
 2348: /*ARGSUSED*/
 2349: #if (defined __STDC__ || defined __C99__FUNC__ \
 2350:      || defined __cplusplus || defined _MSC_VER)
 2351: static void
 2352: yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
 2353: #else
 2354: static void
 2355: yydestruct (yymsg, yytype, yyvaluep)
 2356:     const char *yymsg;
 2357:     int yytype;
 2358:     YYSTYPE *yyvaluep;
 2359: #endif
 2360: {
 2361:   YYUSE (yyvaluep);
 2362: 
 2363:   if (!yymsg)
 2364:     yymsg = "Deleting";
 2365:   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
 2366: 
 2367:   switch (yytype)
 2368:     {
 2369: 
 2370:       default:
 2371: 	break;
 2372:     }
 2373: }
 2374: 
 2375: 
 2376: 
 2377: 
 2378: /* The lookahead symbol.  */
 2379: int yychar;
 2380: 
 2381: /* The semantic value of the lookahead symbol.  */
 2382: YYSTYPE yylval;
 2383: 
 2384: /* Number of syntax errors so far.  */
 2385: int yynerrs;
 2386: 
 2387: 
 2388: /*----------.
 2389: | yyparse.  |
 2390: `----------*/
 2391: 
 2392: #ifdef YYPARSE_PARAM
 2393: #if (defined __STDC__ || defined __C99__FUNC__ \
 2394:      || defined __cplusplus || defined _MSC_VER)
 2395: int
 2396: yyparse (void *YYPARSE_PARAM)
 2397: #else
 2398: int
 2399: yyparse (YYPARSE_PARAM)
 2400:     void *YYPARSE_PARAM;
 2401: #endif
 2402: #else /* ! YYPARSE_PARAM */
 2403: #if (defined __STDC__ || defined __C99__FUNC__ \
 2404:      || defined __cplusplus || defined _MSC_VER)
 2405: int
 2406: yyparse (void)
 2407: #else
 2408: int
 2409: yyparse ()
 2410: 
 2411: #endif
 2412: #endif
 2413: {
 2414:     int yystate;
 2415:     /* Number of tokens to shift before error messages enabled.  */
 2416:     int yyerrstatus;
 2417: 
 2418:     /* The stacks and their tools:
 2419:        `yyss': related to states.
 2420:        `yyvs': related to semantic values.
 2421: 
 2422:        Refer to the stacks through separate pointers, to allow yyoverflow
 2423:        to reallocate them elsewhere.  */
 2424: 
 2425:     /* The state stack.  */
 2426:     yytype_int16 yyssa[YYINITDEPTH];
 2427:     yytype_int16 *yyss;
 2428:     yytype_int16 *yyssp;
 2429: 
 2430:     /* The semantic value stack.  */
 2431:     YYSTYPE yyvsa[YYINITDEPTH];
 2432:     YYSTYPE *yyvs;
 2433:     YYSTYPE *yyvsp;
 2434: 
 2435:     YYSIZE_T yystacksize;
 2436: 
 2437:   int yyn;
 2438:   int yyresult;
 2439:   /* Lookahead token as an internal (translated) token number.  */
 2440:   int yytoken;
 2441:   /* The variables used to return semantic value and location from the
 2442:      action routines.  */
 2443:   YYSTYPE yyval;
 2444: 
 2445: #if YYERROR_VERBOSE
 2446:   /* Buffer for error messages, and its allocated size.  */
 2447:   char yymsgbuf[128];
 2448:   char *yymsg = yymsgbuf;
 2449:   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
 2450: #endif
 2451: 
 2452: #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 2453: 
 2454:   /* The number of symbols on the RHS of the reduced rule.
 2455:      Keep to zero when no symbol should be popped.  */
 2456:   int yylen = 0;
 2457: 
 2458:   yytoken = 0;
 2459:   yyss = yyssa;
 2460:   yyvs = yyvsa;
 2461:   yystacksize = YYINITDEPTH;
 2462: 
 2463:   YYDPRINTF ((stderr, "Starting parse\n"));
 2464: 
 2465:   yystate = 0;
 2466:   yyerrstatus = 0;
 2467:   yynerrs = 0;
 2468:   yychar = YYEMPTY; /* Cause a token to be read.  */
 2469: 
 2470:   /* Initialize stack pointers.
 2471:      Waste one element of value and location stack
 2472:      so that they stay on the same level as the state stack.
 2473:      The wasted elements are never initialized.  */
 2474:   yyssp = yyss;
 2475:   yyvsp = yyvs;
 2476:   goto yysetstate;
 2477: 
 2478: /*------------------------------------------------------------.
 2479: | yynewstate -- Push a new state, which is found in yystate.  |
 2480: `------------------------------------------------------------*/
 2481:  yynewstate:
 2482:   /* In all cases, when you get here, the value and location stacks
 2483:      have just been pushed.  So pushing a state here evens the stacks.  */
 2484:   yyssp++;
 2485: 
 2486:  yysetstate:
 2487:   *yyssp = yystate;
 2488: 
 2489:   if (yyss + yystacksize - 1 <= yyssp)
 2490:     {
 2491:       /* Get the current used size of the three stacks, in elements.  */
 2492:       YYSIZE_T yysize = yyssp - yyss + 1;
 2493: 
 2494: #ifdef yyoverflow
 2495:       {
 2496: 	/* Give user a chance to reallocate the stack.  Use copies of
 2497: 	   these so that the &'s don't force the real ones into
 2498: 	   memory.  */
 2499: 	YYSTYPE *yyvs1 = yyvs;
 2500: 	yytype_int16 *yyss1 = yyss;
 2501: 
 2502: 	/* Each stack pointer address is followed by the size of the
 2503: 	   data in use in that stack, in bytes.  This used to be a
 2504: 	   conditional around just the two extra args, but that might
 2505: 	   be undefined if yyoverflow is a macro.  */
 2506: 	yyoverflow (YY_("memory exhausted"),
 2507: 		    &yyss1, yysize * sizeof (*yyssp),
 2508: 		    &yyvs1, yysize * sizeof (*yyvsp),
 2509: 		    &yystacksize);
 2510: 
 2511: 	yyss = yyss1;
 2512: 	yyvs = yyvs1;
 2513:       }
 2514: #else /* no yyoverflow */
 2515: # ifndef YYSTACK_RELOCATE
 2516:       goto yyexhaustedlab;
 2517: # else
 2518:       /* Extend the stack our own way.  */
 2519:       if (YYMAXDEPTH <= yystacksize)
 2520: 	goto yyexhaustedlab;
 2521:       yystacksize *= 2;
 2522:       if (YYMAXDEPTH < yystacksize)
 2523: 	yystacksize = YYMAXDEPTH;
 2524: 
 2525:       {
 2526: 	yytype_int16 *yyss1 = yyss;
 2527: 	union yyalloc *yyptr =
 2528: 	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
 2529: 	if (! yyptr)
 2530: 	  goto yyexhaustedlab;
 2531: 	YYSTACK_RELOCATE (yyss_alloc, yyss);
 2532: 	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
 2533: #  undef YYSTACK_RELOCATE
 2534: 	if (yyss1 != yyssa)
 2535: 	  YYSTACK_FREE (yyss1);
 2536:       }
 2537: # endif
 2538: #endif /* no yyoverflow */
 2539: 
 2540:       yyssp = yyss + yysize - 1;
 2541:       yyvsp = yyvs + yysize - 1;
 2542: 
 2543:       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
 2544: 		  (unsigned long int) yystacksize));
 2545: 
 2546:       if (yyss + yystacksize - 1 <= yyssp)
 2547: 	YYABORT;
 2548:     }
 2549: 
 2550:   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
 2551: 
 2552:   if (yystate == YYFINAL)
 2553:     YYACCEPT;
 2554: 
 2555:   goto yybackup;
 2556: 
 2557: /*-----------.
 2558: | yybackup.  |
 2559: `-----------*/
 2560: yybackup:
 2561: 
 2562:   /* Do appropriate processing given the current state.  Read a
 2563:      lookahead token if we need one and don't already have one.  */
 2564: 
 2565:   /* First try to decide what to do without reference to lookahead token.  */
 2566:   yyn = yypact[yystate];
 2567:   if (yypact_value_is_default (yyn))
 2568:     goto yydefault;
 2569: 
 2570:   /* Not known => get a lookahead token if don't already have one.  */
 2571: 
 2572:   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
 2573:   if (yychar == YYEMPTY)
 2574:     {
 2575:       YYDPRINTF ((stderr, "Reading a token: "));
 2576:       yychar = YYLEX;
 2577:     }
 2578: 
 2579:   if (yychar <= YYEOF)
 2580:     {
 2581:       yychar = yytoken = YYEOF;
 2582:       YYDPRINTF ((stderr, "Now at end of input.\n"));
 2583:     }
 2584:   else
 2585:     {
 2586:       yytoken = YYTRANSLATE (yychar);
 2587:       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
 2588:     }
 2589: 
 2590:   /* If the proper action on seeing token YYTOKEN is to reduce or to
 2591:      detect an error, take that action.  */
 2592:   yyn += yytoken;
 2593:   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
 2594:     goto yydefault;
 2595:   yyn = yytable[yyn];
 2596:   if (yyn <= 0)
 2597:     {
 2598:       if (yytable_value_is_error (yyn))
 2599:         goto yyerrlab;
 2600:       yyn = -yyn;
 2601:       goto yyreduce;
 2602:     }
 2603: 
 2604:   /* Count tokens shifted since error; after three, turn off error
 2605:      status.  */
 2606:   if (yyerrstatus)
 2607:     yyerrstatus--;
 2608: 
 2609:   /* Shift the lookahead token.  */
 2610:   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
 2611: 
 2612:   /* Discard the shifted token.  */
 2613:   yychar = YYEMPTY;
 2614: 
 2615:   yystate = yyn;
 2616:   *++yyvsp = yylval;
 2617: 
 2618:   goto yynewstate;
 2619: 
 2620: 
 2621: /*-----------------------------------------------------------.
 2622: | yydefault -- do the default action for the current state.  |
 2623: `-----------------------------------------------------------*/
 2624: yydefault:
 2625:   yyn = yydefact[yystate];
 2626:   if (yyn == 0)
 2627:     goto yyerrlab;
 2628:   goto yyreduce;
 2629: 
 2630: 
 2631: /*-----------------------------.
 2632: | yyreduce -- Do a reduction.  |
 2633: `-----------------------------*/
 2634: yyreduce:
 2635:   /* yyn is the number of a rule to reduce with.  */
 2636:   yylen = yyr2[yyn];
 2637: 
 2638:   /* If YYLEN is nonzero, implement the default value of the action:
 2639:      `$$ = $1'.
 2640: 
 2641:      Otherwise, the following line sets YYVAL to garbage.
 2642:      This behavior is undocumented and Bison
 2643:      users should not rely upon it.  Assigning to YYVAL
 2644:      unconditionally makes the parser a bit smaller, and it avoids a
 2645:      GCC warning that YYVAL may be used uninitialized.  */
 2646:   yyval = yyvsp[1-yylen];
 2647: 
 2648: 
 2649:   YY_REDUCE_PRINT (yyn);
 2650:   switch (yyn)
 2651:     {
 2652:         case 22:
 2653: /* Line 1787 of yacc.c  */
 2654: #line 368 "cfparse.y"
 2655:     {
 2656: 			struct passwd *pw;
 2657: 
 2658: 			if ((pw = getpwnam((yyvsp[(2) - (2)].val)->v)) == NULL) {
 2659: 				yyerror("unknown user \"%s\"", (yyvsp[(2) - (2)].val)->v);
 2660: 				return -1;
 2661: 			}
 2662: 			lcconf->uid = pw->pw_uid;
 2663: 		}
 2664:     break;
 2665: 
 2666:   case 24:
 2667: /* Line 1787 of yacc.c  */
 2668: #line 378 "cfparse.y"
 2669:     { lcconf->uid = (yyvsp[(2) - (2)].num); }
 2670:     break;
 2671: 
 2672:   case 26:
 2673: /* Line 1787 of yacc.c  */
 2674: #line 380 "cfparse.y"
 2675:     {
 2676: 			struct group *gr;
 2677: 
 2678: 			if ((gr = getgrnam((yyvsp[(2) - (2)].val)->v)) == NULL) {
 2679: 				yyerror("unknown group \"%s\"", (yyvsp[(2) - (2)].val)->v);
 2680: 				return -1;
 2681: 			}
 2682: 			lcconf->gid = gr->gr_gid;
 2683: 		}
 2684:     break;
 2685: 
 2686:   case 28:
 2687: /* Line 1787 of yacc.c  */
 2688: #line 390 "cfparse.y"
 2689:     { lcconf->gid = (yyvsp[(2) - (2)].num); }
 2690:     break;
 2691: 
 2692:   case 30:
 2693: /* Line 1787 of yacc.c  */
 2694: #line 391 "cfparse.y"
 2695:     { lcconf->chroot = (yyvsp[(2) - (2)].val)->v; }
 2696:     break;
 2697: 
 2698:   case 32:
 2699: /* Line 1787 of yacc.c  */
 2700: #line 397 "cfparse.y"
 2701:     {
 2702: 			if ((yyvsp[(2) - (3)].num) >= LC_PATHTYPE_MAX) {
 2703: 				yyerror("invalid path type %d", (yyvsp[(2) - (3)].num));
 2704: 				return -1;
 2705: 			}
 2706: 
 2707: 			/* free old pathinfo */
 2708: 			if (lcconf->pathinfo[(yyvsp[(2) - (3)].num)])
 2709: 				racoon_free(lcconf->pathinfo[(yyvsp[(2) - (3)].num)]);
 2710: 
 2711: 			/* set new pathinfo */
 2712: 			lcconf->pathinfo[(yyvsp[(2) - (3)].num)] = racoon_strdup((yyvsp[(3) - (3)].val)->v);
 2713: 			STRDUP_FATAL(lcconf->pathinfo[(yyvsp[(2) - (3)].num)]);
 2714: 			vfree((yyvsp[(3) - (3)].val));
 2715: 		}
 2716:     break;
 2717: 
 2718:   case 34:
 2719: /* Line 1787 of yacc.c  */
 2720: #line 417 "cfparse.y"
 2721:     { lcconf->complex_bundle = (yyvsp[(2) - (2)].num); }
 2722:     break;
 2723: 
 2724:   case 36:
 2725: /* Line 1787 of yacc.c  */
 2726: #line 423 "cfparse.y"
 2727:     {
 2728: 			char path[MAXPATHLEN];
 2729: 
 2730: 			getpathname(path, sizeof(path),
 2731: 				LC_PATHTYPE_INCLUDE, (yyvsp[(2) - (3)].val)->v);
 2732: 			vfree((yyvsp[(2) - (3)].val));
 2733: 			if (yycf_switch_buffer(path) != 0)
 2734: 				return -1;
 2735: 		}
 2736:     break;
 2737: 
 2738:   case 37:
 2739: /* Line 1787 of yacc.c  */
 2740: #line 437 "cfparse.y"
 2741:     {
 2742: 			lcconf->pfkey_buffer_size = (yyvsp[(2) - (3)].num);
 2743:         }
 2744:     break;
 2745: 
 2746:   case 38:
 2747: /* Line 1787 of yacc.c  */
 2748: #line 444 "cfparse.y"
 2749:     {
 2750: 			if ((yyvsp[(2) - (3)].num) >= LC_GSSENC_MAX) {
 2751: 				yyerror("invalid GSS ID encoding %d", (yyvsp[(2) - (3)].num));
 2752: 				return -1;
 2753: 			}
 2754: 			lcconf->gss_id_enc = (yyvsp[(2) - (3)].num);
 2755: 		}
 2756:     break;
 2757: 
 2758:   case 40:
 2759: /* Line 1787 of yacc.c  */
 2760: #line 459 "cfparse.y"
 2761:     {
 2762: 			/*
 2763: 			 * set the loglevel to the value specified
 2764: 			 * in the configuration file plus the number
 2765: 			 * of -d options specified on the command line
 2766: 			 */
 2767: 			loglevel += (yyvsp[(1) - (1)].num) - oldloglevel;
 2768: 			oldloglevel = (yyvsp[(1) - (1)].num);
 2769: 		}
 2770:     break;
 2771: 
 2772:   case 44:
 2773: /* Line 1787 of yacc.c  */
 2774: #line 479 "cfparse.y"
 2775:     { lcconf->pad_random = (yyvsp[(2) - (2)].num); }
 2776:     break;
 2777: 
 2778:   case 46:
 2779: /* Line 1787 of yacc.c  */
 2780: #line 480 "cfparse.y"
 2781:     { lcconf->pad_randomlen = (yyvsp[(2) - (2)].num); }
 2782:     break;
 2783: 
 2784:   case 48:
 2785: /* Line 1787 of yacc.c  */
 2786: #line 481 "cfparse.y"
 2787:     { lcconf->pad_maxsize = (yyvsp[(2) - (2)].num); }
 2788:     break;
 2789: 
 2790:   case 50:
 2791: /* Line 1787 of yacc.c  */
 2792: #line 482 "cfparse.y"
 2793:     { lcconf->pad_strict = (yyvsp[(2) - (2)].num); }
 2794:     break;
 2795: 
 2796:   case 52:
 2797: /* Line 1787 of yacc.c  */
 2798: #line 483 "cfparse.y"
 2799:     { lcconf->pad_excltail = (yyvsp[(2) - (2)].num); }
 2800:     break;
 2801: 
 2802:   case 57:
 2803: /* Line 1787 of yacc.c  */
 2804: #line 496 "cfparse.y"
 2805:     {
 2806: 			myaddr_listen((yyvsp[(2) - (2)].saddr), FALSE);
 2807: 			racoon_free((yyvsp[(2) - (2)].saddr));
 2808: 		}
 2809:     break;
 2810: 
 2811:   case 59:
 2812: /* Line 1787 of yacc.c  */
 2813: #line 502 "cfparse.y"
 2814:     {
 2815: #ifdef ENABLE_NATT
 2816: 			myaddr_listen((yyvsp[(2) - (2)].saddr), TRUE);
 2817: 			racoon_free((yyvsp[(2) - (2)].saddr));
 2818: #else
 2819: 			racoon_free((yyvsp[(2) - (2)].saddr));
 2820: 			yyerror("NAT-T support not compiled in.");
 2821: #endif
 2822: 		}
 2823:     break;
 2824: 
 2825:   case 61:
 2826: /* Line 1787 of yacc.c  */
 2827: #line 513 "cfparse.y"
 2828:     {
 2829: #ifdef ENABLE_ADMINPORT
 2830: 			adminsock_conf((yyvsp[(2) - (5)].val), (yyvsp[(3) - (5)].val), (yyvsp[(4) - (5)].val), (yyvsp[(5) - (5)].num));
 2831: #else
 2832: 			yywarn("admin port support not compiled in");
 2833: #endif
 2834: 		}
 2835:     break;
 2836: 
 2837:   case 63:
 2838: /* Line 1787 of yacc.c  */
 2839: #line 522 "cfparse.y"
 2840:     {
 2841: #ifdef ENABLE_ADMINPORT
 2842: 			adminsock_conf((yyvsp[(2) - (2)].val), NULL, NULL, -1);
 2843: #else
 2844: 			yywarn("admin port support not compiled in");
 2845: #endif
 2846: 		}
 2847:     break;
 2848: 
 2849:   case 65:
 2850: /* Line 1787 of yacc.c  */
 2851: #line 531 "cfparse.y"
 2852:     {
 2853: #ifdef ENABLE_ADMINPORT
 2854: 			adminsock_path = NULL;
 2855: #else
 2856: 			yywarn("admin port support not compiled in");
 2857: #endif
 2858: 		}
 2859:     break;
 2860: 
 2861:   case 67:
 2862: /* Line 1787 of yacc.c  */
 2863: #line 539 "cfparse.y"
 2864:     { lcconf->strict_address = TRUE; }
 2865:     break;
 2866: 
 2867:   case 69:
 2868: /* Line 1787 of yacc.c  */
 2869: #line 543 "cfparse.y"
 2870:     {
 2871: 			char portbuf[10];
 2872: 
 2873: 			snprintf(portbuf, sizeof(portbuf), "%ld", (yyvsp[(2) - (2)].num));
 2874: 			(yyval.saddr) = str2saddr((yyvsp[(1) - (2)].val)->v, portbuf);
 2875: 			vfree((yyvsp[(1) - (2)].val));
 2876: 			if (!(yyval.saddr))
 2877: 				return -1;
 2878: 		}
 2879:     break;
 2880: 
 2881:   case 70:
 2882: /* Line 1787 of yacc.c  */
 2883: #line 554 "cfparse.y"
 2884:     { (yyval.num) = PORT_ISAKMP; }
 2885:     break;
 2886: 
 2887:   case 71:
 2888: /* Line 1787 of yacc.c  */
 2889: #line 555 "cfparse.y"
 2890:     { (yyval.num) = (yyvsp[(1) - (1)].num); }
 2891:     break;
 2892: 
 2893:   case 72:
 2894: /* Line 1787 of yacc.c  */
 2895: #line 560 "cfparse.y"
 2896:     {
 2897: #ifndef ENABLE_HYBRID
 2898: 			yyerror("racoon not configured with --enable-hybrid");
 2899: 			return -1;
 2900: #endif
 2901: #ifndef HAVE_LIBRADIUS
 2902: 			yyerror("racoon not configured with --with-libradius");
 2903: 			return -1;
 2904: #endif
 2905: #ifdef ENABLE_HYBRID
 2906: #ifdef HAVE_LIBRADIUS
 2907: 			xauth_rad_config.timeout = 3;
 2908: 			xauth_rad_config.retries = 3;
 2909: #endif
 2910: #endif
 2911: 		}
 2912:     break;
 2913: 
 2914:   case 76:
 2915: /* Line 1787 of yacc.c  */
 2916: #line 583 "cfparse.y"
 2917:     {
 2918: #ifdef ENABLE_HYBRID
 2919: #ifdef HAVE_LIBRADIUS
 2920: 			int i = xauth_rad_config.auth_server_count;
 2921: 			if (i == RADIUS_MAX_SERVERS) {
 2922: 				yyerror("maximum radius auth servers exceeded");
 2923: 				return -1;
 2924: 			}
 2925: 
 2926: 			xauth_rad_config.auth_server_list[i].host = vdup((yyvsp[(2) - (3)].val));
 2927: 			xauth_rad_config.auth_server_list[i].secret = vdup((yyvsp[(3) - (3)].val));
 2928: 			xauth_rad_config.auth_server_list[i].port = 0; // default port
 2929: 			xauth_rad_config.auth_server_count++;
 2930: #endif
 2931: #endif
 2932: 		}
 2933:     break;
 2934: 
 2935:   case 78:
 2936: /* Line 1787 of yacc.c  */
 2937: #line 601 "cfparse.y"
 2938:     {
 2939: #ifdef ENABLE_HYBRID
 2940: #ifdef HAVE_LIBRADIUS
 2941: 			int i = xauth_rad_config.auth_server_count;
 2942: 			if (i == RADIUS_MAX_SERVERS) {
 2943: 				yyerror("maximum radius auth servers exceeded");
 2944: 				return -1;
 2945: 			}
 2946: 
 2947: 			xauth_rad_config.auth_server_list[i].host = vdup((yyvsp[(2) - (4)].val));
 2948: 			xauth_rad_config.auth_server_list[i].secret = vdup((yyvsp[(4) - (4)].val));
 2949: 			xauth_rad_config.auth_server_list[i].port = (yyvsp[(3) - (4)].num);
 2950: 			xauth_rad_config.auth_server_count++;
 2951: #endif
 2952: #endif
 2953: 		}
 2954:     break;
 2955: 
 2956:   case 80:
 2957: /* Line 1787 of yacc.c  */
 2958: #line 619 "cfparse.y"
 2959:     {
 2960: #ifdef ENABLE_HYBRID
 2961: #ifdef HAVE_LIBRADIUS
 2962: 			int i = xauth_rad_config.acct_server_count;
 2963: 			if (i == RADIUS_MAX_SERVERS) {
 2964: 				yyerror("maximum radius account servers exceeded");
 2965: 				return -1;
 2966: 			}
 2967: 
 2968: 			xauth_rad_config.acct_server_list[i].host = vdup((yyvsp[(2) - (3)].val));
 2969: 			xauth_rad_config.acct_server_list[i].secret = vdup((yyvsp[(3) - (3)].val));
 2970: 			xauth_rad_config.acct_server_list[i].port = 0; // default port
 2971: 			xauth_rad_config.acct_server_count++;
 2972: #endif
 2973: #endif
 2974: 		}
 2975:     break;
 2976: 
 2977:   case 82:
 2978: /* Line 1787 of yacc.c  */
 2979: #line 637 "cfparse.y"
 2980:     {
 2981: #ifdef ENABLE_HYBRID
 2982: #ifdef HAVE_LIBRADIUS
 2983: 			int i = xauth_rad_config.acct_server_count;
 2984: 			if (i == RADIUS_MAX_SERVERS) {
 2985: 				yyerror("maximum radius account servers exceeded");
 2986: 				return -1;
 2987: 			}
 2988: 
 2989: 			xauth_rad_config.acct_server_list[i].host = vdup((yyvsp[(2) - (4)].val));
 2990: 			xauth_rad_config.acct_server_list[i].secret = vdup((yyvsp[(4) - (4)].val));
 2991: 			xauth_rad_config.acct_server_list[i].port = (yyvsp[(3) - (4)].num);
 2992: 			xauth_rad_config.acct_server_count++;
 2993: #endif
 2994: #endif
 2995: 		}
 2996:     break;
 2997: 
 2998:   case 84:
 2999: /* Line 1787 of yacc.c  */
 3000: #line 655 "cfparse.y"
 3001:     {
 3002: #ifdef ENABLE_HYBRID
 3003: #ifdef HAVE_LIBRADIUS
 3004: 			xauth_rad_config.timeout = (yyvsp[(2) - (2)].num);
 3005: #endif
 3006: #endif
 3007: 		}
 3008:     break;
 3009: 
 3010:   case 86:
 3011: /* Line 1787 of yacc.c  */
 3012: #line 664 "cfparse.y"
 3013:     {
 3014: #ifdef ENABLE_HYBRID
 3015: #ifdef HAVE_LIBRADIUS
 3016: 			xauth_rad_config.retries = (yyvsp[(2) - (2)].num);
 3017: #endif
 3018: #endif
 3019: 		}
 3020:     break;
 3021: 
 3022:   case 88:
 3023: /* Line 1787 of yacc.c  */
 3024: #line 676 "cfparse.y"
 3025:     {
 3026: #ifndef ENABLE_HYBRID
 3027: 			yyerror("racoon not configured with --enable-hybrid");
 3028: 			return -1;
 3029: #endif
 3030: #ifndef HAVE_LIBLDAP
 3031: 			yyerror("racoon not configured with --with-libldap");
 3032: 			return -1;
 3033: #endif
 3034: 		}
 3035:     break;
 3036: 
 3037:   case 92:
 3038: /* Line 1787 of yacc.c  */
 3039: #line 693 "cfparse.y"
 3040:     {
 3041: #ifdef ENABLE_HYBRID
 3042: #ifdef HAVE_LIBLDAP
 3043: 			if (((yyvsp[(2) - (2)].num)<2)||((yyvsp[(2) - (2)].num)>3))
 3044: 				yyerror("invalid ldap protocol version (2|3)");
 3045: 			xauth_ldap_config.pver = (yyvsp[(2) - (2)].num);
 3046: #endif
 3047: #endif
 3048: 		}
 3049:     break;
 3050: 
 3051:   case 94:
 3052: /* Line 1787 of yacc.c  */
 3053: #line 704 "cfparse.y"
 3054:     {
 3055: #ifdef ENABLE_HYBRID
 3056: #ifdef HAVE_LIBLDAP
 3057: 			if (xauth_ldap_config.host != NULL)
 3058: 				vfree(xauth_ldap_config.host);
 3059: 			xauth_ldap_config.host = vdup((yyvsp[(2) - (2)].val));
 3060: #endif
 3061: #endif
 3062: 		}
 3063:     break;
 3064: 
 3065:   case 96:
 3066: /* Line 1787 of yacc.c  */
 3067: #line 715 "cfparse.y"
 3068:     {
 3069: #ifdef ENABLE_HYBRID
 3070: #ifdef HAVE_LIBLDAP
 3071: 			xauth_ldap_config.port = (yyvsp[(2) - (2)].num);
 3072: #endif
 3073: #endif
 3074: 		}
 3075:     break;
 3076: 
 3077:   case 98:
 3078: /* Line 1787 of yacc.c  */
 3079: #line 724 "cfparse.y"
 3080:     {
 3081: #ifdef ENABLE_HYBRID
 3082: #ifdef HAVE_LIBLDAP
 3083: 			if (xauth_ldap_config.base != NULL)
 3084: 				vfree(xauth_ldap_config.base);
 3085: 			xauth_ldap_config.base = vdup((yyvsp[(2) - (2)].val));
 3086: #endif
 3087: #endif
 3088: 		}
 3089:     break;
 3090: 
 3091:   case 100:
 3092: /* Line 1787 of yacc.c  */
 3093: #line 735 "cfparse.y"
 3094:     {
 3095: #ifdef ENABLE_HYBRID
 3096: #ifdef HAVE_LIBLDAP
 3097: 			xauth_ldap_config.subtree = (yyvsp[(2) - (2)].num);
 3098: #endif
 3099: #endif
 3100: 		}
 3101:     break;
 3102: 
 3103:   case 102:
 3104: /* Line 1787 of yacc.c  */
 3105: #line 744 "cfparse.y"
 3106:     {
 3107: #ifdef ENABLE_HYBRID
 3108: #ifdef HAVE_LIBLDAP
 3109: 			if (xauth_ldap_config.bind_dn != NULL)
 3110: 				vfree(xauth_ldap_config.bind_dn);
 3111: 			xauth_ldap_config.bind_dn = vdup((yyvsp[(2) - (2)].val));
 3112: #endif
 3113: #endif
 3114: 		}
 3115:     break;
 3116: 
 3117:   case 104:
 3118: /* Line 1787 of yacc.c  */
 3119: #line 755 "cfparse.y"
 3120:     {
 3121: #ifdef ENABLE_HYBRID
 3122: #ifdef HAVE_LIBLDAP
 3123: 			if (xauth_ldap_config.bind_pw != NULL)
 3124: 				vfree(xauth_ldap_config.bind_pw);
 3125: 			xauth_ldap_config.bind_pw = vdup((yyvsp[(2) - (2)].val));
 3126: #endif
 3127: #endif
 3128: 		}
 3129:     break;
 3130: 
 3131:   case 106:
 3132: /* Line 1787 of yacc.c  */
 3133: #line 766 "cfparse.y"
 3134:     {
 3135: #ifdef ENABLE_HYBRID
 3136: #ifdef HAVE_LIBLDAP
 3137: 			if (xauth_ldap_config.attr_user != NULL)
 3138: 				vfree(xauth_ldap_config.attr_user);
 3139: 			xauth_ldap_config.attr_user = vdup((yyvsp[(2) - (2)].val));
 3140: #endif
 3141: #endif
 3142: 		}
 3143:     break;
 3144: 
 3145:   case 108:
 3146: /* Line 1787 of yacc.c  */
 3147: #line 777 "cfparse.y"
 3148:     {
 3149: #ifdef ENABLE_HYBRID
 3150: #ifdef HAVE_LIBLDAP
 3151: 			if (xauth_ldap_config.attr_addr != NULL)
 3152: 				vfree(xauth_ldap_config.attr_addr);
 3153: 			xauth_ldap_config.attr_addr = vdup((yyvsp[(2) - (2)].val));
 3154: #endif
 3155: #endif
 3156: 		}
 3157:     break;
 3158: 
 3159:   case 110:
 3160: /* Line 1787 of yacc.c  */
 3161: #line 788 "cfparse.y"
 3162:     {
 3163: #ifdef ENABLE_HYBRID
 3164: #ifdef HAVE_LIBLDAP
 3165: 			if (xauth_ldap_config.attr_mask != NULL)
 3166: 				vfree(xauth_ldap_config.attr_mask);
 3167: 			xauth_ldap_config.attr_mask = vdup((yyvsp[(2) - (2)].val));
 3168: #endif
 3169: #endif
 3170: 		}
 3171:     break;
 3172: 
 3173:   case 112:
 3174: /* Line 1787 of yacc.c  */
 3175: #line 799 "cfparse.y"
 3176:     {
 3177: #ifdef ENABLE_HYBRID
 3178: #ifdef HAVE_LIBLDAP
 3179: 			if (xauth_ldap_config.attr_group != NULL)
 3180: 				vfree(xauth_ldap_config.attr_group);
 3181: 			xauth_ldap_config.attr_group = vdup((yyvsp[(2) - (2)].val));
 3182: #endif
 3183: #endif
 3184: 		}
 3185:     break;
 3186: 
 3187:   case 114:
 3188: /* Line 1787 of yacc.c  */
 3189: #line 810 "cfparse.y"
 3190:     {
 3191: #ifdef ENABLE_HYBRID
 3192: #ifdef HAVE_LIBLDAP
 3193: 			if (xauth_ldap_config.attr_member != NULL)
 3194: 				vfree(xauth_ldap_config.attr_member);
 3195: 			xauth_ldap_config.attr_member = vdup((yyvsp[(2) - (2)].val));
 3196: #endif
 3197: #endif
 3198: 		}
 3199:     break;
 3200: 
 3201:   case 119:
 3202: /* Line 1787 of yacc.c  */
 3203: #line 832 "cfparse.y"
 3204:     {
 3205: #ifdef ENABLE_HYBRID
 3206: 			if (inet_pton(AF_INET, (yyvsp[(2) - (2)].val)->v,
 3207: 			     &isakmp_cfg_config.network4) != 1)
 3208: 				yyerror("bad IPv4 network address.");
 3209: #else
 3210: 			yyerror("racoon not configured with --enable-hybrid");
 3211: #endif
 3212: 		}
 3213:     break;
 3214: 
 3215:   case 121:
 3216: /* Line 1787 of yacc.c  */
 3217: #line 843 "cfparse.y"
 3218:     {
 3219: #ifdef ENABLE_HYBRID
 3220: 			if (inet_pton(AF_INET, (yyvsp[(2) - (2)].val)->v,
 3221: 			    &isakmp_cfg_config.netmask4) != 1)
 3222: 				yyerror("bad IPv4 netmask address.");
 3223: #else
 3224: 			yyerror("racoon not configured with --enable-hybrid");
 3225: #endif
 3226: 		}
 3227:     break;
 3228: 
 3229:   case 125:
 3230: /* Line 1787 of yacc.c  */
 3231: #line 858 "cfparse.y"
 3232:     {
 3233: #ifdef ENABLE_HYBRID
 3234: 			isakmp_cfg_config.splitnet_type = UNITY_LOCAL_LAN;
 3235: #else
 3236: 			yyerror("racoon not configured with --enable-hybrid");
 3237: #endif
 3238: 		}
 3239:     break;
 3240: 
 3241:   case 127:
 3242: /* Line 1787 of yacc.c  */
 3243: #line 867 "cfparse.y"
 3244:     {
 3245: #ifdef ENABLE_HYBRID
 3246: 			isakmp_cfg_config.splitnet_type = UNITY_SPLIT_INCLUDE;
 3247: #else
 3248: 			yyerror("racoon not configured with --enable-hybrid");
 3249: #endif
 3250: 		}
 3251:     break;
 3252: 
 3253:   case 129:
 3254: /* Line 1787 of yacc.c  */
 3255: #line 876 "cfparse.y"
 3256:     {
 3257: #ifndef ENABLE_HYBRID
 3258: 			yyerror("racoon not configured with --enable-hybrid");
 3259: #endif
 3260: 		}
 3261:     break;
 3262: 
 3263:   case 131:
 3264: /* Line 1787 of yacc.c  */
 3265: #line 883 "cfparse.y"
 3266:     {
 3267: #ifdef ENABLE_HYBRID
 3268: 			strncpy(&isakmp_cfg_config.default_domain[0], 
 3269: 			    (yyvsp[(2) - (2)].val)->v, MAXPATHLEN);
 3270: 			isakmp_cfg_config.default_domain[MAXPATHLEN] = '\0';
 3271: 			vfree((yyvsp[(2) - (2)].val));
 3272: #else
 3273: 			yyerror("racoon not configured with --enable-hybrid");
 3274: #endif
 3275: 		}
 3276:     break;
 3277: 
 3278:   case 133:
 3279: /* Line 1787 of yacc.c  */
 3280: #line 895 "cfparse.y"
 3281:     {
 3282: #ifdef ENABLE_HYBRID
 3283: 			isakmp_cfg_config.authsource = ISAKMP_CFG_AUTH_SYSTEM;
 3284: #else
 3285: 			yyerror("racoon not configured with --enable-hybrid");
 3286: #endif
 3287: 		}
 3288:     break;
 3289: 
 3290:   case 135:
 3291: /* Line 1787 of yacc.c  */
 3292: #line 904 "cfparse.y"
 3293:     {
 3294: #ifdef ENABLE_HYBRID
 3295: #ifdef HAVE_LIBRADIUS
 3296: 			isakmp_cfg_config.authsource = ISAKMP_CFG_AUTH_RADIUS;
 3297: #else /* HAVE_LIBRADIUS */
 3298: 			yyerror("racoon not configured with --with-libradius");
 3299: #endif /* HAVE_LIBRADIUS */
 3300: #else /* ENABLE_HYBRID */
 3301: 			yyerror("racoon not configured with --enable-hybrid");
 3302: #endif /* ENABLE_HYBRID */
 3303: 		}
 3304:     break;
 3305: 
 3306:   case 137:
 3307: /* Line 1787 of yacc.c  */
 3308: #line 917 "cfparse.y"
 3309:     {
 3310: #ifdef ENABLE_HYBRID
 3311: #ifdef HAVE_LIBPAM
 3312: 			isakmp_cfg_config.authsource = ISAKMP_CFG_AUTH_PAM;
 3313: #else /* HAVE_LIBPAM */
 3314: 			yyerror("racoon not configured with --with-libpam");
 3315: #endif /* HAVE_LIBPAM */
 3316: #else /* ENABLE_HYBRID */
 3317: 			yyerror("racoon not configured with --enable-hybrid");
 3318: #endif /* ENABLE_HYBRID */
 3319: 		}
 3320:     break;
 3321: 
 3322:   case 139:
 3323: /* Line 1787 of yacc.c  */
 3324: #line 930 "cfparse.y"
 3325:     {
 3326: #ifdef ENABLE_HYBRID
 3327: #ifdef HAVE_LIBLDAP
 3328: 			isakmp_cfg_config.authsource = ISAKMP_CFG_AUTH_LDAP;
 3329: #else /* HAVE_LIBLDAP */
 3330: 			yyerror("racoon not configured with --with-libldap");
 3331: #endif /* HAVE_LIBLDAP */
 3332: #else /* ENABLE_HYBRID */
 3333: 			yyerror("racoon not configured with --enable-hybrid");
 3334: #endif /* ENABLE_HYBRID */
 3335: 		}
 3336:     break;
 3337: 
 3338:   case 141:
 3339: /* Line 1787 of yacc.c  */
 3340: #line 943 "cfparse.y"
 3341:     {
 3342: #ifndef ENABLE_HYBRID
 3343: 			yyerror("racoon not configured with --enable-hybrid");
 3344: #endif
 3345: 		}
 3346:     break;
 3347: 
 3348:   case 143:
 3349: /* Line 1787 of yacc.c  */
 3350: #line 950 "cfparse.y"
 3351:     {
 3352: #ifdef ENABLE_HYBRID
 3353: 			isakmp_cfg_config.groupsource = ISAKMP_CFG_GROUP_SYSTEM;
 3354: #else
 3355: 			yyerror("racoon not configured with --enable-hybrid");
 3356: #endif
 3357: 		}
 3358:     break;
 3359: 
 3360:   case 145:
 3361: /* Line 1787 of yacc.c  */
 3362: #line 959 "cfparse.y"
 3363:     {
 3364: #ifdef ENABLE_HYBRID
 3365: #ifdef HAVE_LIBLDAP
 3366: 			isakmp_cfg_config.groupsource = ISAKMP_CFG_GROUP_LDAP;
 3367: #else /* HAVE_LIBLDAP */
 3368: 			yyerror("racoon not configured with --with-libldap");
 3369: #endif /* HAVE_LIBLDAP */
 3370: #else /* ENABLE_HYBRID */
 3371: 			yyerror("racoon not configured with --enable-hybrid");
 3372: #endif /* ENABLE_HYBRID */
 3373: 		}
 3374:     break;
 3375: 
 3376:   case 147:
 3377: /* Line 1787 of yacc.c  */
 3378: #line 972 "cfparse.y"
 3379:     {
 3380: #ifdef ENABLE_HYBRID
 3381: 			isakmp_cfg_config.accounting = ISAKMP_CFG_ACCT_NONE;
 3382: #else
 3383: 			yyerror("racoon not configured with --enable-hybrid");
 3384: #endif
 3385: 		}
 3386:     break;
 3387: 
 3388:   case 149:
 3389: /* Line 1787 of yacc.c  */
 3390: #line 981 "cfparse.y"
 3391:     {
 3392: #ifdef ENABLE_HYBRID
 3393: 			isakmp_cfg_config.accounting = ISAKMP_CFG_ACCT_SYSTEM;
 3394: #else
 3395: 			yyerror("racoon not configured with --enable-hybrid");
 3396: #endif
 3397: 		}
 3398:     break;
 3399: 
 3400:   case 151:
 3401: /* Line 1787 of yacc.c  */
 3402: #line 990 "cfparse.y"
 3403:     {
 3404: #ifdef ENABLE_HYBRID
 3405: #ifdef HAVE_LIBRADIUS
 3406: 			isakmp_cfg_config.accounting = ISAKMP_CFG_ACCT_RADIUS;
 3407: #else /* HAVE_LIBRADIUS */
 3408: 			yyerror("racoon not configured with --with-libradius");
 3409: #endif /* HAVE_LIBRADIUS */
 3410: #else /* ENABLE_HYBRID */
 3411: 			yyerror("racoon not configured with --enable-hybrid");
 3412: #endif /* ENABLE_HYBRID */
 3413: 		}
 3414:     break;
 3415: 
 3416:   case 153:
 3417: /* Line 1787 of yacc.c  */
 3418: #line 1003 "cfparse.y"
 3419:     {
 3420: #ifdef ENABLE_HYBRID
 3421: #ifdef HAVE_LIBPAM
 3422: 			isakmp_cfg_config.accounting = ISAKMP_CFG_ACCT_PAM;
 3423: #else /* HAVE_LIBPAM */
 3424: 			yyerror("racoon not configured with --with-libpam");
 3425: #endif /* HAVE_LIBPAM */
 3426: #else /* ENABLE_HYBRID */
 3427: 			yyerror("racoon not configured with --enable-hybrid");
 3428: #endif /* ENABLE_HYBRID */
 3429: 		}
 3430:     break;
 3431: 
 3432:   case 155:
 3433: /* Line 1787 of yacc.c  */
 3434: #line 1016 "cfparse.y"
 3435:     {
 3436: #ifdef ENABLE_HYBRID
 3437: 			if (isakmp_cfg_resize_pool((yyvsp[(2) - (2)].num)) != 0)
 3438: 				yyerror("cannot allocate memory for pool");
 3439: #else /* ENABLE_HYBRID */
 3440: 			yyerror("racoon not configured with --enable-hybrid");
 3441: #endif /* ENABLE_HYBRID */
 3442: 		}
 3443:     break;
 3444: 
 3445:   case 157:
 3446: /* Line 1787 of yacc.c  */
 3447: #line 1026 "cfparse.y"
 3448:     {
 3449: #ifdef ENABLE_HYBRID
 3450: 			isakmp_cfg_config.pfs_group = (yyvsp[(2) - (2)].num);
 3451: #else /* ENABLE_HYBRID */
 3452: 			yyerror("racoon not configured with --enable-hybrid");
 3453: #endif /* ENABLE_HYBRID */
 3454: 		}
 3455:     break;
 3456: 
 3457:   case 159:
 3458: /* Line 1787 of yacc.c  */
 3459: #line 1035 "cfparse.y"
 3460:     {
 3461: #ifdef ENABLE_HYBRID
 3462: 			isakmp_cfg_config.save_passwd = (yyvsp[(2) - (2)].num);
 3463: #else /* ENABLE_HYBRID */
 3464: 			yyerror("racoon not configured with --enable-hybrid");
 3465: #endif /* ENABLE_HYBRID */
 3466: 		}
 3467:     break;
 3468: 
 3469:   case 161:
 3470: /* Line 1787 of yacc.c  */
 3471: #line 1044 "cfparse.y"
 3472:     {
 3473: #ifdef ENABLE_HYBRID
 3474: 			isakmp_cfg_config.auth_throttle = (yyvsp[(2) - (2)].num);
 3475: #else /* ENABLE_HYBRID */
 3476: 			yyerror("racoon not configured with --enable-hybrid");
 3477: #endif /* ENABLE_HYBRID */
 3478: 		}
 3479:     break;
 3480: 
 3481:   case 163:
 3482: /* Line 1787 of yacc.c  */
 3483: #line 1053 "cfparse.y"
 3484:     {
 3485: #ifdef ENABLE_HYBRID
 3486: 			isakmp_cfg_config.confsource = ISAKMP_CFG_CONF_LOCAL;
 3487: #else /* ENABLE_HYBRID */
 3488: 			yyerror("racoon not configured with --enable-hybrid");
 3489: #endif /* ENABLE_HYBRID */
 3490: 		}
 3491:     break;
 3492: 
 3493:   case 165:
 3494: /* Line 1787 of yacc.c  */
 3495: #line 1062 "cfparse.y"
 3496:     {
 3497: #ifdef ENABLE_HYBRID
 3498: #ifdef HAVE_LIBRADIUS
 3499: 			isakmp_cfg_config.confsource = ISAKMP_CFG_CONF_RADIUS;
 3500: #else /* HAVE_LIBRADIUS */
 3501: 			yyerror("racoon not configured with --with-libradius");
 3502: #endif /* HAVE_LIBRADIUS */
 3503: #else /* ENABLE_HYBRID */
 3504: 			yyerror("racoon not configured with --enable-hybrid");
 3505: #endif /* ENABLE_HYBRID */
 3506: 		}
 3507:     break;
 3508: 
 3509:   case 167:
 3510: /* Line 1787 of yacc.c  */
 3511: #line 1075 "cfparse.y"
 3512:     {
 3513: #ifdef ENABLE_HYBRID
 3514: #ifdef HAVE_LIBLDAP
 3515: 			isakmp_cfg_config.confsource = ISAKMP_CFG_CONF_LDAP;
 3516: #else /* HAVE_LIBLDAP */
 3517: 			yyerror("racoon not configured with --with-libldap");
 3518: #endif /* HAVE_LIBLDAP */
 3519: #else /* ENABLE_HYBRID */
 3520: 			yyerror("racoon not configured with --enable-hybrid");
 3521: #endif /* ENABLE_HYBRID */
 3522: 		}
 3523:     break;
 3524: 
 3525:   case 169:
 3526: /* Line 1787 of yacc.c  */
 3527: #line 1088 "cfparse.y"
 3528:     {
 3529: #ifdef ENABLE_HYBRID
 3530: 			strncpy(&isakmp_cfg_config.motd[0], (yyvsp[(2) - (2)].val)->v, MAXPATHLEN);
 3531: 			isakmp_cfg_config.motd[MAXPATHLEN] = '\0';
 3532: 			vfree((yyvsp[(2) - (2)].val));
 3533: #else
 3534: 			yyerror("racoon not configured with --enable-hybrid");
 3535: #endif
 3536: 		}
 3537:     break;
 3538: 
 3539:   case 173:
 3540: /* Line 1787 of yacc.c  */
 3541: #line 1106 "cfparse.y"
 3542:     {
 3543: #ifdef ENABLE_HYBRID
 3544: 			struct isakmp_cfg_config *icc = &isakmp_cfg_config;
 3545: 
 3546: 			if (icc->dns4_index > MAXNS)
 3547: 				yyerror("No more than %d DNS", MAXNS);
 3548: 			if (inet_pton(AF_INET, (yyvsp[(1) - (1)].val)->v,
 3549: 			    &icc->dns4[icc->dns4_index++]) != 1)
 3550: 				yyerror("bad IPv4 DNS address.");
 3551: #else
 3552: 			yyerror("racoon not configured with --enable-hybrid");
 3553: #endif
 3554: 		}
 3555:     break;
 3556: 
 3557:   case 176:
 3558: /* Line 1787 of yacc.c  */
 3559: #line 1127 "cfparse.y"
 3560:     {
 3561: #ifdef ENABLE_HYBRID
 3562: 			struct isakmp_cfg_config *icc = &isakmp_cfg_config;
 3563: 
 3564: 			if (icc->nbns4_index > MAXWINS)
 3565: 				yyerror("No more than %d WINS", MAXWINS);
 3566: 			if (inet_pton(AF_INET, (yyvsp[(1) - (1)].val)->v,
 3567: 			    &icc->nbns4[icc->nbns4_index++]) != 1)
 3568: 				yyerror("bad IPv4 WINS address.");
 3569: #else
 3570: 			yyerror("racoon not configured with --enable-hybrid");
 3571: #endif
 3572: 		}
 3573:     break;
 3574: 
 3575:   case 179:
 3576: /* Line 1787 of yacc.c  */
 3577: #line 1148 "cfparse.y"
 3578:     {
 3579: #ifdef ENABLE_HYBRID
 3580: 			struct isakmp_cfg_config *icc = &isakmp_cfg_config;
 3581: 			struct unity_network network;
 3582: 			memset(&network,0,sizeof(network));
 3583: 
 3584: 			if (inet_pton(AF_INET, (yyvsp[(1) - (2)].val)->v, &network.addr4) != 1)
 3585: 				yyerror("bad IPv4 SPLIT address.");
 3586: 
 3587: 			/* Turn $2 (the prefix) into a subnet mask */
 3588: 			network.mask4.s_addr = ((yyvsp[(2) - (2)].num)) ? htonl(~((1 << (32 - (yyvsp[(2) - (2)].num))) - 1)) : 0;
 3589: 
 3590: 			/* add the network to our list */ 
 3591: 			if (splitnet_list_add(&icc->splitnet_list, &network,&icc->splitnet_count))
 3592: 				yyerror("Unable to allocate split network");
 3593: #else
 3594: 			yyerror("racoon not configured with --enable-hybrid");
 3595: #endif
 3596: 		}
 3597:     break;
 3598: 
 3599:   case 182:
 3600: /* Line 1787 of yacc.c  */
 3601: #line 1175 "cfparse.y"
 3602:     {
 3603: #ifdef ENABLE_HYBRID
 3604: 			char * groupname = NULL;
 3605: 			char ** grouplist = NULL;
 3606: 			struct isakmp_cfg_config *icc = &isakmp_cfg_config;
 3607: 
 3608: 			grouplist = racoon_realloc(icc->grouplist,
 3609: 					sizeof(char**)*(icc->groupcount+1));
 3610: 			if (grouplist == NULL) {
 3611: 				yyerror("unable to allocate auth group list");
 3612: 				return -1;
 3613: 			}
 3614: 
 3615: 			groupname = racoon_malloc((yyvsp[(1) - (1)].val)->l+1);
 3616: 			if (groupname == NULL) {
 3617: 				yyerror("unable to allocate auth group name");
 3618: 				return -1;
 3619: 			}
 3620: 
 3621: 			memcpy(groupname,(yyvsp[(1) - (1)].val)->v,(yyvsp[(1) - (1)].val)->l);
 3622: 			groupname[(yyvsp[(1) - (1)].val)->l]=0;
 3623: 			grouplist[icc->groupcount]=groupname;
 3624: 			icc->grouplist = grouplist;
 3625: 			icc->groupcount++;
 3626: 
 3627: 			vfree((yyvsp[(1) - (1)].val));
 3628: #else
 3629: 			yyerror("racoon not configured with --enable-hybrid");
 3630: #endif
 3631: 		}
 3632:     break;
 3633: 
 3634:   case 185:
 3635: /* Line 1787 of yacc.c  */
 3636: #line 1213 "cfparse.y"
 3637:     {
 3638: #ifdef ENABLE_HYBRID
 3639: 			struct isakmp_cfg_config *icc = &isakmp_cfg_config;
 3640: 
 3641: 			if (!icc->splitdns_len)
 3642: 			{
 3643: 				icc->splitdns_list = racoon_malloc((yyvsp[(1) - (1)].val)->l);
 3644: 				if(icc->splitdns_list == NULL) {
 3645: 					yyerror("error allocating splitdns list buffer");
 3646: 					return -1;
 3647: 				}
 3648: 				memcpy(icc->splitdns_list,(yyvsp[(1) - (1)].val)->v,(yyvsp[(1) - (1)].val)->l);
 3649: 				icc->splitdns_len = (yyvsp[(1) - (1)].val)->l;
 3650: 			}
 3651: 			else
 3652: 			{
 3653: 				int len = icc->splitdns_len + (yyvsp[(1) - (1)].val)->l + 1;
 3654: 				icc->splitdns_list = racoon_realloc(icc->splitdns_list,len);
 3655: 				if(icc->splitdns_list == NULL) {
 3656: 					yyerror("error allocating splitdns list buffer");
 3657: 					return -1;
 3658: 				}
 3659: 				icc->splitdns_list[icc->splitdns_len] = ',';
 3660: 				memcpy(icc->splitdns_list + icc->splitdns_len + 1, (yyvsp[(1) - (1)].val)->v, (yyvsp[(1) - (1)].val)->l);
 3661: 				icc->splitdns_len = len;
 3662: 			}
 3663: 			vfree((yyvsp[(1) - (1)].val));
 3664: #else
 3665: 			yyerror("racoon not configured with --enable-hybrid");
 3666: #endif
 3667: 		}
 3668:     break;
 3669: 
 3670:   case 189:
 3671: /* Line 1787 of yacc.c  */
 3672: #line 1257 "cfparse.y"
 3673:     {
 3674: 			lcconf->retry_counter = (yyvsp[(2) - (2)].num);
 3675: 		}
 3676:     break;
 3677: 
 3678:   case 191:
 3679: /* Line 1787 of yacc.c  */
 3680: #line 1262 "cfparse.y"
 3681:     {
 3682: 			lcconf->retry_interval = (yyvsp[(2) - (3)].num) * (yyvsp[(3) - (3)].num);
 3683: 		}
 3684:     break;
 3685: 
 3686:   case 193:
 3687: /* Line 1787 of yacc.c  */
 3688: #line 1267 "cfparse.y"
 3689:     {
 3690: 			lcconf->count_persend = (yyvsp[(2) - (2)].num);
 3691: 		}
 3692:     break;
 3693: 
 3694:   case 195:
 3695: /* Line 1787 of yacc.c  */
 3696: #line 1272 "cfparse.y"
 3697:     {
 3698: 			lcconf->retry_checkph1 = (yyvsp[(2) - (3)].num) * (yyvsp[(3) - (3)].num);
 3699: 		}
 3700:     break;
 3701: 
 3702:   case 197:
 3703: /* Line 1787 of yacc.c  */
 3704: #line 1277 "cfparse.y"
 3705:     {
 3706: 			lcconf->wait_ph2complete = (yyvsp[(2) - (3)].num) * (yyvsp[(3) - (3)].num);
 3707: 		}
 3708:     break;
 3709: 
 3710:   case 199:
 3711: /* Line 1787 of yacc.c  */
 3712: #line 1282 "cfparse.y"
 3713:     {
 3714: #ifdef ENABLE_NATT
 3715:         		if (libipsec_opt & LIBIPSEC_OPT_NATT)
 3716: 				lcconf->natt_ka_interval = (yyvsp[(2) - (3)].num) * (yyvsp[(3) - (3)].num);
 3717: 			else
 3718:                 		yyerror("libipsec lacks NAT-T support");
 3719: #else
 3720: 			yyerror("NAT-T support not compiled in.");
 3721: #endif
 3722: 		}
 3723:     break;
 3724: 
 3725:   case 201:
 3726: /* Line 1787 of yacc.c  */
 3727: #line 1298 "cfparse.y"
 3728:     {
 3729: 			cur_sainfo = newsainfo();
 3730: 			if (cur_sainfo == NULL) {
 3731: 				yyerror("failed to allocate sainfo");
 3732: 				return -1;
 3733: 			}
 3734: 		}
 3735:     break;
 3736: 
 3737:   case 202:
 3738: /* Line 1787 of yacc.c  */
 3739: #line 1306 "cfparse.y"
 3740:     {
 3741: 			struct sainfo *check;
 3742: 
 3743: 			/* default */
 3744: 			if (cur_sainfo->algs[algclass_ipsec_enc] == 0) {
 3745: 				yyerror("no encryption algorithm at %s",
 3746: 					sainfo2str(cur_sainfo));
 3747: 				return -1;
 3748: 			}
 3749: 			if (cur_sainfo->algs[algclass_ipsec_auth] == 0) {
 3750: 				yyerror("no authentication algorithm at %s",
 3751: 					sainfo2str(cur_sainfo));
 3752: 				return -1;
 3753: 			}
 3754: 			if (cur_sainfo->algs[algclass_ipsec_comp] == 0) {
 3755: 				yyerror("no compression algorithm at %s",
 3756: 					sainfo2str(cur_sainfo));
 3757: 				return -1;
 3758: 			}
 3759: 
 3760: 			/* duplicate check */
 3761: 			check = getsainfo(cur_sainfo->idsrc,
 3762: 					  cur_sainfo->iddst,
 3763: 					  cur_sainfo->id_i,
 3764: 					  NULL,
 3765: 					  cur_sainfo->remoteid);
 3766: 
 3767: 			if (check && ((check->idsrc != SAINFO_ANONYMOUS) &&
 3768: 				      (cur_sainfo->idsrc != SAINFO_ANONYMOUS))) {
 3769: 				yyerror("duplicated sainfo: %s",
 3770: 					sainfo2str(cur_sainfo));
 3771: 				return -1;
 3772: 			}
 3773: 
 3774: 			inssainfo(cur_sainfo);
 3775: 		}
 3776:     break;
 3777: 
 3778:   case 204:
 3779: /* Line 1787 of yacc.c  */
 3780: #line 1346 "cfparse.y"
 3781:     {
 3782: 			cur_sainfo->idsrc = SAINFO_ANONYMOUS;
 3783: 			cur_sainfo->iddst = SAINFO_ANONYMOUS;
 3784: 		}
 3785:     break;
 3786: 
 3787:   case 205:
 3788: /* Line 1787 of yacc.c  */
 3789: #line 1351 "cfparse.y"
 3790:     {
 3791: 			cur_sainfo->idsrc = SAINFO_ANONYMOUS;
 3792: 			cur_sainfo->iddst = SAINFO_CLIENTADDR;
 3793: 		}
 3794:     break;
 3795: 
 3796:   case 206:
 3797: /* Line 1787 of yacc.c  */
 3798: #line 1356 "cfparse.y"
 3799:     {
 3800: 			cur_sainfo->idsrc = SAINFO_ANONYMOUS;
 3801: 			cur_sainfo->iddst = (yyvsp[(2) - (2)].val);
 3802: 		}
 3803:     break;
 3804: 
 3805:   case 207:
 3806: /* Line 1787 of yacc.c  */
 3807: #line 1361 "cfparse.y"
 3808:     {
 3809: 			cur_sainfo->idsrc = (yyvsp[(1) - (2)].val);
 3810: 			cur_sainfo->iddst = SAINFO_ANONYMOUS;
 3811: 		}
 3812:     break;
 3813: 
 3814:   case 208:
 3815: /* Line 1787 of yacc.c  */
 3816: #line 1366 "cfparse.y"
 3817:     {
 3818: 			cur_sainfo->idsrc = (yyvsp[(1) - (2)].val);
 3819: 			cur_sainfo->iddst = SAINFO_CLIENTADDR;
 3820: 		}
 3821:     break;
 3822: 
 3823:   case 209:
 3824: /* Line 1787 of yacc.c  */
 3825: #line 1371 "cfparse.y"
 3826:     {
 3827: 			cur_sainfo->idsrc = (yyvsp[(1) - (2)].val);
 3828: 			cur_sainfo->iddst = (yyvsp[(2) - (2)].val);
 3829: 		}
 3830:     break;
 3831: 
 3832:   case 210:
 3833: /* Line 1787 of yacc.c  */
 3834: #line 1378 "cfparse.y"
 3835:     {
 3836: 			char portbuf[10];
 3837: 			struct sockaddr *saddr;
 3838: 
 3839: 			if (((yyvsp[(5) - (5)].num) == IPPROTO_ICMP || (yyvsp[(5) - (5)].num) == IPPROTO_ICMPV6)
 3840: 			 && ((yyvsp[(4) - (5)].num) != IPSEC_PORT_ANY || (yyvsp[(4) - (5)].num) != IPSEC_PORT_ANY)) {
 3841: 				yyerror("port number must be \"any\".");
 3842: 				return -1;
 3843: 			}
 3844: 
 3845: 			snprintf(portbuf, sizeof(portbuf), "%lu", (yyvsp[(4) - (5)].num));
 3846: 			saddr = str2saddr((yyvsp[(2) - (5)].val)->v, portbuf);
 3847: 			vfree((yyvsp[(2) - (5)].val));
 3848: 			if (saddr == NULL)
 3849: 				return -1;
 3850: 
 3851: 			switch (saddr->sa_family) {
 3852: 			case AF_INET:
 3853: 				if ((yyvsp[(5) - (5)].num) == IPPROTO_ICMPV6) {
 3854: 					yyerror("upper layer protocol mismatched.\n");
 3855: 					racoon_free(saddr);
 3856: 					return -1;
 3857: 				}
 3858: 				(yyval.val) = ipsecdoi_sockaddr2id(saddr,
 3859: 										  (yyvsp[(3) - (5)].num) == ~0 ? (sizeof(struct in_addr) << 3): (yyvsp[(3) - (5)].num),
 3860: 										  (yyvsp[(5) - (5)].num));
 3861: 				break;
 3862: #ifdef INET6
 3863: 			case AF_INET6:
 3864: 				if ((yyvsp[(5) - (5)].num) == IPPROTO_ICMP) {
 3865: 					yyerror("upper layer protocol mismatched.\n");
 3866: 					racoon_free(saddr);
 3867: 					return -1;
 3868: 				}
 3869: 				(yyval.val) = ipsecdoi_sockaddr2id(saddr, 
 3870: 										  (yyvsp[(3) - (5)].num) == ~0 ? (sizeof(struct in6_addr) << 3): (yyvsp[(3) - (5)].num),
 3871: 										  (yyvsp[(5) - (5)].num));
 3872: 				break;
 3873: #endif
 3874: 			default:
 3875: 				yyerror("invalid family: %d", saddr->sa_family);
 3876: 				(yyval.val) = NULL;
 3877: 				break;
 3878: 			}
 3879: 			racoon_free(saddr);
 3880: 			if ((yyval.val) == NULL)
 3881: 				return -1;
 3882: 		}
 3883:     break;
 3884: 
 3885:   case 211:
 3886: /* Line 1787 of yacc.c  */
 3887: #line 1427 "cfparse.y"
 3888:     {
 3889: 			char portbuf[10];
 3890: 			struct sockaddr *laddr = NULL, *haddr = NULL;
 3891: 			char *cur = NULL;
 3892: 
 3893: 			if (((yyvsp[(6) - (6)].num) == IPPROTO_ICMP || (yyvsp[(6) - (6)].num) == IPPROTO_ICMPV6)
 3894: 			 && ((yyvsp[(5) - (6)].num) != IPSEC_PORT_ANY || (yyvsp[(5) - (6)].num) != IPSEC_PORT_ANY)) {
 3895: 				yyerror("port number must be \"any\".");
 3896: 				return -1;
 3897: 			}
 3898: 
 3899: 			snprintf(portbuf, sizeof(portbuf), "%lu", (yyvsp[(5) - (6)].num));
 3900: 			
 3901: 			laddr = str2saddr((yyvsp[(2) - (6)].val)->v, portbuf);
 3902: 			if (laddr == NULL) {
 3903: 			    return -1;
 3904: 			}
 3905: 			vfree((yyvsp[(2) - (6)].val));
 3906: 			haddr = str2saddr((yyvsp[(3) - (6)].val)->v, portbuf);
 3907: 			if (haddr == NULL) {
 3908: 			    racoon_free(laddr);
 3909: 			    return -1;
 3910: 			}
 3911: 			vfree((yyvsp[(3) - (6)].val));
 3912: 
 3913: 			switch (laddr->sa_family) {
 3914: 			case AF_INET:
 3915: 				if ((yyvsp[(6) - (6)].num) == IPPROTO_ICMPV6) {
 3916: 				    yyerror("upper layer protocol mismatched.\n");
 3917: 				    if (laddr)
 3918: 					racoon_free(laddr);
 3919: 				    if (haddr)
 3920: 					racoon_free(haddr);
 3921: 				    return -1;
 3922: 				}
 3923:                                 (yyval.val) = ipsecdoi_sockrange2id(laddr, haddr, 
 3924: 							   (yyvsp[(6) - (6)].num));
 3925: 				break;
 3926: #ifdef INET6
 3927: 			case AF_INET6:
 3928: 				if ((yyvsp[(6) - (6)].num) == IPPROTO_ICMP) {
 3929: 					yyerror("upper layer protocol mismatched.\n");
 3930: 					if (laddr)
 3931: 					    racoon_free(laddr);
 3932: 					if (haddr)
 3933: 					    racoon_free(haddr);
 3934: 					return -1;
 3935: 				}
 3936: 				(yyval.val) = ipsecdoi_sockrange2id(laddr, haddr, 
 3937: 							       (yyvsp[(6) - (6)].num));
 3938: 				break;
 3939: #endif
 3940: 			default:
 3941: 				yyerror("invalid family: %d", laddr->sa_family);
 3942: 				(yyval.val) = NULL;
 3943: 				break;
 3944: 			}
 3945: 			if (laddr)
 3946: 			    racoon_free(laddr);
 3947: 			if (haddr)
 3948: 			    racoon_free(haddr);
 3949: 			if ((yyval.val) == NULL)
 3950: 				return -1;
 3951: 		}
 3952:     break;
 3953: 
 3954:   case 212:
 3955: /* Line 1787 of yacc.c  */
 3956: #line 1492 "cfparse.y"
 3957:     {
 3958: 			struct ipsecdoi_id_b *id_b;
 3959: 
 3960: 			if ((yyvsp[(1) - (2)].num) == IDTYPE_ASN1DN) {
 3961: 				yyerror("id type forbidden: %d", (yyvsp[(1) - (2)].num));
 3962: 				(yyval.val) = NULL;
 3963: 				return -1;
 3964: 			}
 3965: 
 3966: 			(yyvsp[(2) - (2)].val)->l--;
 3967: 
 3968: 			(yyval.val) = vmalloc(sizeof(*id_b) + (yyvsp[(2) - (2)].val)->l);
 3969: 			if ((yyval.val) == NULL) {
 3970: 				yyerror("failed to allocate identifier");
 3971: 				return -1;
 3972: 			}
 3973: 
 3974: 			id_b = (struct ipsecdoi_id_b *)(yyval.val)->v;
 3975: 			id_b->type = idtype2doi((yyvsp[(1) - (2)].num));
 3976: 
 3977: 			id_b->proto_id = 0;
 3978: 			id_b->port = 0;
 3979: 
 3980: 			memcpy((yyval.val)->v + sizeof(*id_b), (yyvsp[(2) - (2)].val)->v, (yyvsp[(2) - (2)].val)->l);
 3981: 		}
 3982:     break;
 3983: 
 3984:   case 213:
 3985: /* Line 1787 of yacc.c  */
 3986: #line 1520 "cfparse.y"
 3987:     {
 3988: 			cur_sainfo->id_i = NULL;
 3989: 		}
 3990:     break;
 3991: 
 3992:   case 214:
 3993: /* Line 1787 of yacc.c  */
 3994: #line 1524 "cfparse.y"
 3995:     {
 3996: 			struct ipsecdoi_id_b *id_b;
 3997: 			vchar_t *idv;
 3998: 
 3999: 			if (set_identifier(&idv, (yyvsp[(2) - (3)].num), (yyvsp[(3) - (3)].val)) != 0) {
 4000: 				yyerror("failed to set identifer.\n");
 4001: 				return -1;
 4002: 			}
 4003: 			cur_sainfo->id_i = vmalloc(sizeof(*id_b) + idv->l);
 4004: 			if (cur_sainfo->id_i == NULL) {
 4005: 				yyerror("failed to allocate identifier");
 4006: 				return -1;
 4007: 			}
 4008: 
 4009: 			id_b = (struct ipsecdoi_id_b *)cur_sainfo->id_i->v;
 4010: 			id_b->type = idtype2doi((yyvsp[(2) - (3)].num));
 4011: 
 4012: 			id_b->proto_id = 0;
 4013: 			id_b->port = 0;
 4014: 
 4015: 			memcpy(cur_sainfo->id_i->v + sizeof(*id_b),
 4016: 			       idv->v, idv->l);
 4017: 			vfree(idv);
 4018: 		}
 4019:     break;
 4020: 
 4021:   case 215:
 4022: /* Line 1787 of yacc.c  */
 4023: #line 1549 "cfparse.y"
 4024:     {
 4025: #ifdef ENABLE_HYBRID
 4026: 			if ((cur_sainfo->group = vdup((yyvsp[(2) - (2)].val))) == NULL) {
 4027: 				yyerror("failed to set sainfo xauth group.\n");
 4028: 				return -1;
 4029: 			}
 4030: #else
 4031: 			yyerror("racoon not configured with --enable-hybrid");
 4032: 			return -1;
 4033: #endif
 4034:  		}
 4035:     break;
 4036: 
 4037:   case 218:
 4038: /* Line 1787 of yacc.c  */
 4039: #line 1567 "cfparse.y"
 4040:     {
 4041: 			cur_sainfo->pfs_group = (yyvsp[(2) - (2)].num);
 4042: 		}
 4043:     break;
 4044: 
 4045:   case 220:
 4046: /* Line 1787 of yacc.c  */
 4047: #line 1572 "cfparse.y"
 4048:     {
 4049: 			cur_sainfo->remoteid = (yyvsp[(2) - (2)].num);
 4050: 		}
 4051:     break;
 4052: 
 4053:   case 222:
 4054: /* Line 1787 of yacc.c  */
 4055: #line 1577 "cfparse.y"
 4056:     {
 4057: 			cur_sainfo->lifetime = (yyvsp[(3) - (4)].num) * (yyvsp[(4) - (4)].num);
 4058: 		}
 4059:     break;
 4060: 
 4061:   case 224:
 4062: /* Line 1787 of yacc.c  */
 4063: #line 1582 "cfparse.y"
 4064:     {
 4065: #if 1
 4066: 			yyerror("byte lifetime support is deprecated");
 4067: 			return -1;
 4068: #else
 4069: 			cur_sainfo->lifebyte = fix_lifebyte((yyvsp[(3) - (4)].num) * (yyvsp[(4) - (4)].num));
 4070: 			if (cur_sainfo->lifebyte == 0)
 4071: 				return -1;
 4072: #endif
 4073: 		}
 4074:     break;
 4075: 
 4076:   case 226:
 4077: /* Line 1787 of yacc.c  */
 4078: #line 1593 "cfparse.y"
 4079:     {
 4080: 			cur_algclass = (yyvsp[(1) - (1)].num);
 4081: 		}
 4082:     break;
 4083: 
 4084:   case 228:
 4085: /* Line 1787 of yacc.c  */
 4086: #line 1601 "cfparse.y"
 4087:     {
 4088: 			inssainfoalg(&cur_sainfo->algs[cur_algclass], (yyvsp[(1) - (1)].alg));
 4089: 		}
 4090:     break;
 4091: 
 4092:   case 229:
 4093: /* Line 1787 of yacc.c  */
 4094: #line 1605 "cfparse.y"
 4095:     {
 4096: 			inssainfoalg(&cur_sainfo->algs[cur_algclass], (yyvsp[(1) - (1)].alg));
 4097: 		}
 4098:     break;
 4099: 
 4100:   case 231:
 4101: /* Line 1787 of yacc.c  */
 4102: #line 1612 "cfparse.y"
 4103:     {
 4104: 			int defklen;
 4105: 
 4106: 			(yyval.alg) = newsainfoalg();
 4107: 			if ((yyval.alg) == NULL) {
 4108: 				yyerror("failed to get algorithm allocation");
 4109: 				return -1;
 4110: 			}
 4111: 
 4112: 			(yyval.alg)->alg = algtype2doi(cur_algclass, (yyvsp[(1) - (2)].num));
 4113: 			if ((yyval.alg)->alg == -1) {
 4114: 				yyerror("algorithm mismatched");
 4115: 				racoon_free((yyval.alg));
 4116: 				(yyval.alg) = NULL;
 4117: 				return -1;
 4118: 			}
 4119: 
 4120: 			defklen = default_keylen(cur_algclass, (yyvsp[(1) - (2)].num));
 4121: 			if (defklen == 0) {
 4122: 				if ((yyvsp[(2) - (2)].num)) {
 4123: 					yyerror("keylen not allowed");
 4124: 					racoon_free((yyval.alg));
 4125: 					(yyval.alg) = NULL;
 4126: 					return -1;
 4127: 				}
 4128: 			} else {
 4129: 				if ((yyvsp[(2) - (2)].num) && check_keylen(cur_algclass, (yyvsp[(1) - (2)].num), (yyvsp[(2) - (2)].num)) < 0) {
 4130: 					yyerror("invalid keylen %d", (yyvsp[(2) - (2)].num));
 4131: 					racoon_free((yyval.alg));
 4132: 					(yyval.alg) = NULL;
 4133: 					return -1;
 4134: 				}
 4135: 			}
 4136: 
 4137: 			if ((yyvsp[(2) - (2)].num))
 4138: 				(yyval.alg)->encklen = (yyvsp[(2) - (2)].num);
 4139: 			else
 4140: 				(yyval.alg)->encklen = defklen;
 4141: 
 4142: 			/* check if it's supported algorithm by kernel */
 4143: 			if (!(cur_algclass == algclass_ipsec_auth && (yyvsp[(1) - (2)].num) == algtype_non_auth)
 4144: 			 && pk_checkalg(cur_algclass, (yyvsp[(1) - (2)].num), (yyval.alg)->encklen)) {
 4145: 				int a = algclass2doi(cur_algclass);
 4146: 				int b = algtype2doi(cur_algclass, (yyvsp[(1) - (2)].num));
 4147: 				if (a == IPSECDOI_ATTR_AUTH)
 4148: 					a = IPSECDOI_PROTO_IPSEC_AH;
 4149: 				yyerror("algorithm %s not supported by the kernel (missing module?)",
 4150: 					s_ipsecdoi_trns(a, b));
 4151: 				racoon_free((yyval.alg));
 4152: 				(yyval.alg) = NULL;
 4153: 				return -1;
 4154: 			}
 4155: 		}
 4156:     break;
 4157: 
 4158:   case 232:
 4159: /* Line 1787 of yacc.c  */
 4160: #line 1667 "cfparse.y"
 4161:     { (yyval.num) = ~0; }
 4162:     break;
 4163: 
 4164:   case 233:
 4165: /* Line 1787 of yacc.c  */
 4166: #line 1668 "cfparse.y"
 4167:     { (yyval.num) = (yyvsp[(1) - (1)].num); }
 4168:     break;
 4169: 
 4170:   case 234:
 4171: /* Line 1787 of yacc.c  */
 4172: #line 1671 "cfparse.y"
 4173:     { (yyval.num) = IPSEC_PORT_ANY; }
 4174:     break;
 4175: 
 4176:   case 235:
 4177: /* Line 1787 of yacc.c  */
 4178: #line 1672 "cfparse.y"
 4179:     { (yyval.num) = (yyvsp[(1) - (1)].num); }
 4180:     break;
 4181: 
 4182:   case 236:
 4183: /* Line 1787 of yacc.c  */
 4184: #line 1673 "cfparse.y"
 4185:     { (yyval.num) = IPSEC_PORT_ANY; }
 4186:     break;
 4187: 
 4188:   case 237:
 4189: /* Line 1787 of yacc.c  */
 4190: #line 1676 "cfparse.y"
 4191:     { (yyval.num) = (yyvsp[(1) - (1)].num); }
 4192:     break;
 4193: 
 4194:   case 238:
 4195: /* Line 1787 of yacc.c  */
 4196: #line 1677 "cfparse.y"
 4197:     { (yyval.num) = (yyvsp[(1) - (1)].num); }
 4198:     break;
 4199: 
 4200:   case 239:
 4201: /* Line 1787 of yacc.c  */
 4202: #line 1678 "cfparse.y"
 4203:     { (yyval.num) = IPSEC_ULPROTO_ANY; }
 4204:     break;
 4205: 
 4206:   case 240:
 4207: /* Line 1787 of yacc.c  */
 4208: #line 1681 "cfparse.y"
 4209:     { (yyval.num) = 0; }
 4210:     break;
 4211: 
 4212:   case 241:
 4213: /* Line 1787 of yacc.c  */
 4214: #line 1682 "cfparse.y"
 4215:     { (yyval.num) = (yyvsp[(1) - (1)].num); }
 4216:     break;
 4217: 
 4218:   case 242:
 4219: /* Line 1787 of yacc.c  */
 4220: #line 1688 "cfparse.y"
 4221:     {
 4222: 			struct remoteconf *from, *new;
 4223: 
 4224: 			if (getrmconf_by_name((yyvsp[(2) - (4)].val)->v) != NULL) {
 4225: 				yyerror("named remoteconf \"%s\" already exists.");
 4226: 				return -1;
 4227: 			}
 4228: 
 4229: 			from = getrmconf_by_name((yyvsp[(4) - (4)].val)->v);
 4230: 			if (from == NULL) {
 4231: 				yyerror("named parent remoteconf \"%s\" does not exist.",
 4232: 					(yyvsp[(4) - (4)].val)->v);
 4233: 				return -1;
 4234: 			}
 4235: 
 4236: 			new = duprmconf_shallow(from);
 4237: 			if (new == NULL) {
 4238: 				yyerror("failed to duplicate remoteconf from \"%s\".",
 4239: 					(yyvsp[(4) - (4)].val)->v);
 4240: 				return -1;
 4241: 			}
 4242: 
 4243: 			new->name = racoon_strdup((yyvsp[(2) - (4)].val)->v);
 4244: 			cur_rmconf = new;
 4245: 
 4246: 			vfree((yyvsp[(2) - (4)].val));
 4247: 			vfree((yyvsp[(4) - (4)].val));
 4248: 		}
 4249:     break;
 4250: 
 4251:   case 244:
 4252: /* Line 1787 of yacc.c  */
 4253: #line 1718 "cfparse.y"
 4254:     {
 4255: 			struct remoteconf *new;
 4256: 
 4257: 			if (getrmconf_by_name((yyvsp[(2) - (2)].val)->v) != NULL) {
 4258: 				yyerror("Named remoteconf \"%s\" already exists.");
 4259: 				return -1;
 4260: 			}
 4261: 
 4262: 			new = newrmconf();
 4263: 			if (new == NULL) {
 4264: 				yyerror("failed to get new remoteconf.");
 4265: 				return -1;
 4266: 			}
 4267: 			new->name = racoon_strdup((yyvsp[(2) - (2)].val)->v);
 4268: 			cur_rmconf = new;
 4269: 
 4270: 			vfree((yyvsp[(2) - (2)].val));
 4271: 		}
 4272:     break;
 4273: 
 4274:   case 246:
 4275: /* Line 1787 of yacc.c  */
 4276: #line 1738 "cfparse.y"
 4277:     {
 4278: 			struct remoteconf *from, *new;
 4279: 
 4280: 			from = getrmconf((yyvsp[(4) - (4)].saddr), GETRMCONF_F_NO_ANONYMOUS);
 4281: 			if (from == NULL) {
 4282: 				yyerror("failed to get remoteconf for %s.",
 4283: 					saddr2str((yyvsp[(4) - (4)].saddr)));
 4284: 				return -1;
 4285: 			}
 4286: 
 4287: 			new = duprmconf_shallow(from);
 4288: 			if (new == NULL) {
 4289: 				yyerror("failed to duplicate remoteconf from %s.",
 4290: 					saddr2str((yyvsp[(4) - (4)].saddr)));
 4291: 				return -1;
 4292: 			}
 4293: 
 4294: 			racoon_free((yyvsp[(4) - (4)].saddr));
 4295: 			new->remote = (yyvsp[(2) - (4)].saddr);
 4296: 			cur_rmconf = new;
 4297: 		}
 4298:     break;
 4299: 
 4300:   case 248:
 4301: /* Line 1787 of yacc.c  */
 4302: #line 1761 "cfparse.y"
 4303:     {
 4304: 			struct remoteconf *new;
 4305: 
 4306: 			new = newrmconf();
 4307: 			if (new == NULL) {
 4308: 				yyerror("failed to get new remoteconf.");
 4309: 				return -1;
 4310: 			}
 4311: 
 4312: 			new->remote = (yyvsp[(2) - (2)].saddr);
 4313: 			cur_rmconf = new;
 4314: 		}
 4315:     break;
 4316: 
 4317:   case 251:
 4318: /* Line 1787 of yacc.c  */
 4319: #line 1779 "cfparse.y"
 4320:     {
 4321: 			if (process_rmconf() != 0)
 4322: 				return -1;
 4323: 		}
 4324:     break;
 4325: 
 4326:   case 252:
 4327: /* Line 1787 of yacc.c  */
 4328: #line 1787 "cfparse.y"
 4329:     {
 4330: 			if (process_rmconf() != 0)
 4331: 				return -1;
 4332: 		}
 4333:     break;
 4334: 
 4335:   case 253:
 4336: /* Line 1787 of yacc.c  */
 4337: #line 1794 "cfparse.y"
 4338:     {
 4339: 			(yyval.saddr) = newsaddr(sizeof(struct sockaddr));
 4340: 			(yyval.saddr)->sa_family = AF_UNSPEC;
 4341: 			((struct sockaddr_in *)(yyval.saddr))->sin_port = htons((yyvsp[(2) - (2)].num));
 4342: 		}
 4343:     break;
 4344: 
 4345:   case 254:
 4346: /* Line 1787 of yacc.c  */
 4347: #line 1800 "cfparse.y"
 4348:     {
 4349: 			(yyval.saddr) = (yyvsp[(1) - (1)].saddr);
 4350: 			if ((yyval.saddr) == NULL) {
 4351: 				yyerror("failed to allocate sockaddr");
 4352: 				return -1;
 4353: 			}
 4354: 		}
 4355:     break;
 4356: 
 4357:   case 257:
 4358: /* Line 1787 of yacc.c  */
 4359: #line 1814 "cfparse.y"
 4360:     {
 4361: 			if (cur_rmconf->remote != NULL) {
 4362: 				yyerror("remote_address already specified");
 4363: 				return -1;
 4364: 			}
 4365: 			cur_rmconf->remote = (yyvsp[(2) - (2)].saddr);
 4366: 		}
 4367:     break;
 4368: 
 4369:   case 259:
 4370: /* Line 1787 of yacc.c  */
 4371: #line 1823 "cfparse.y"
 4372:     {
 4373: 			cur_rmconf->etypes = NULL;
 4374: 		}
 4375:     break;
 4376: 
 4377:   case 261:
 4378: /* Line 1787 of yacc.c  */
 4379: #line 1827 "cfparse.y"
 4380:     { cur_rmconf->doitype = (yyvsp[(2) - (2)].num); }
 4381:     break;
 4382: 
 4383:   case 263:
 4384: /* Line 1787 of yacc.c  */
 4385: #line 1828 "cfparse.y"
 4386:     { cur_rmconf->sittype = (yyvsp[(2) - (2)].num); }
 4387:     break;
 4388: 
 4389:   case 266:
 4390: /* Line 1787 of yacc.c  */
 4391: #line 1831 "cfparse.y"
 4392:     {
 4393: 			yywarn("This directive without certtype will be removed!\n");
 4394: 			yywarn("Please use 'peers_certfile x509 \"%s\";' instead\n", (yyvsp[(2) - (2)].val)->v);
 4395: 
 4396: 			if (cur_rmconf->peerscert != NULL) {
 4397: 				yyerror("peers_certfile already defined\n");
 4398: 				return -1;
 4399: 			}
 4400: 
 4401: 			if (load_x509((yyvsp[(2) - (2)].val)->v, &cur_rmconf->peerscertfile,
 4402: 				      &cur_rmconf->peerscert)) {
 4403: 				yyerror("failed to load certificate \"%s\"\n",
 4404: 					(yyvsp[(2) - (2)].val)->v);
 4405: 				return -1;
 4406: 			}
 4407: 
 4408: 			vfree((yyvsp[(2) - (2)].val));
 4409: 		}
 4410:     break;
 4411: 
 4412:   case 268:
 4413: /* Line 1787 of yacc.c  */
 4414: #line 1851 "cfparse.y"
 4415:     {
 4416: 			if (cur_rmconf->peerscert != NULL) {
 4417: 				yyerror("peers_certfile already defined\n");
 4418: 				return -1;
 4419: 			}
 4420: 
 4421: 			if (load_x509((yyvsp[(3) - (3)].val)->v, &cur_rmconf->peerscertfile,
 4422: 				      &cur_rmconf->peerscert)) {
 4423: 				yyerror("failed to load certificate \"%s\"\n",
 4424: 					(yyvsp[(3) - (3)].val)->v);
 4425: 				return -1;
 4426: 			}
 4427: 
 4428: 			vfree((yyvsp[(3) - (3)].val));
 4429: 		}
 4430:     break;
 4431: 
 4432:   case 270:
 4433: /* Line 1787 of yacc.c  */
 4434: #line 1868 "cfparse.y"
 4435:     {
 4436: 			char path[MAXPATHLEN];
 4437: 			int ret = 0;
 4438: 
 4439: 			if (cur_rmconf->peerscert != NULL) {
 4440: 				yyerror("peers_certfile already defined\n");
 4441: 				return -1;
 4442: 			}
 4443: 
 4444: 			cur_rmconf->peerscert = vmalloc(1);
 4445: 			if (cur_rmconf->peerscert == NULL) {
 4446: 				yyerror("failed to allocate peerscert");
 4447: 				return -1;
 4448: 			}
 4449: 			cur_rmconf->peerscert->v[0] = ISAKMP_CERT_PLAINRSA;
 4450: 
 4451: 			getpathname(path, sizeof(path),
 4452: 				    LC_PATHTYPE_CERT, (yyvsp[(3) - (3)].val)->v);
 4453: 			if (rsa_parse_file(cur_rmconf->rsa_public, path,
 4454: 					   RSA_TYPE_PUBLIC)) {
 4455: 				yyerror("Couldn't parse keyfile.\n", path);
 4456: 				return -1;
 4457: 			}
 4458: 			plog(LLV_DEBUG, LOCATION, NULL,
 4459: 			     "Public PlainRSA keyfile parsed: %s\n", path);
 4460: 
 4461: 			vfree((yyvsp[(3) - (3)].val));
 4462: 		}
 4463:     break;
 4464: 
 4465:   case 272:
 4466: /* Line 1787 of yacc.c  */
 4467: #line 1898 "cfparse.y"
 4468:     {
 4469: 			if (cur_rmconf->peerscert != NULL) {
 4470: 				yyerror("peers_certfile already defined\n");
 4471: 				return -1;
 4472: 			}
 4473: 			cur_rmconf->peerscert = vmalloc(1);
 4474: 			if (cur_rmconf->peerscert == NULL) {
 4475: 				yyerror("failed to allocate peerscert");
 4476: 				return -1;
 4477: 			}
 4478: 			cur_rmconf->peerscert->v[0] = ISAKMP_CERT_DNS;
 4479: 		}
 4480:     break;
 4481: 
 4482:   case 274:
 4483: /* Line 1787 of yacc.c  */
 4484: #line 1912 "cfparse.y"
 4485:     {
 4486: 			if (cur_rmconf->cacert != NULL) {
 4487: 				yyerror("ca_type already defined\n");
 4488: 				return -1;
 4489: 			}
 4490: 
 4491: 			if (load_x509((yyvsp[(3) - (3)].val)->v, &cur_rmconf->cacertfile,
 4492: 				      &cur_rmconf->cacert)) {
 4493: 				yyerror("failed to load certificate \"%s\"\n",
 4494: 					(yyvsp[(3) - (3)].val)->v);
 4495: 				return -1;
 4496: 			}
 4497: 
 4498: 			vfree((yyvsp[(3) - (3)].val));
 4499: 		}
 4500:     break;
 4501: 
 4502:   case 276:
 4503: /* Line 1787 of yacc.c  */
 4504: #line 1928 "cfparse.y"
 4505:     { cur_rmconf->verify_cert = (yyvsp[(2) - (2)].num); }
 4506:     break;
 4507: 
 4508:   case 278:
 4509: /* Line 1787 of yacc.c  */
 4510: #line 1929 "cfparse.y"
 4511:     { cur_rmconf->send_cert = (yyvsp[(2) - (2)].num); }
 4512:     break;
 4513: 
 4514:   case 280:
 4515: /* Line 1787 of yacc.c  */
 4516: #line 1930 "cfparse.y"
 4517:     { cur_rmconf->send_cr = (yyvsp[(2) - (2)].num); }
 4518:     break;
 4519: 
 4520:   case 282:
 4521: /* Line 1787 of yacc.c  */
 4522: #line 1931 "cfparse.y"
 4523:     { cur_rmconf->match_empty_cr = (yyvsp[(2) - (2)].num); }
 4524:     break;
 4525: 
 4526:   case 284:
 4527: /* Line 1787 of yacc.c  */
 4528: #line 1933 "cfparse.y"
 4529:     {
 4530: 			if (set_identifier(&cur_rmconf->idv, (yyvsp[(2) - (3)].num), (yyvsp[(3) - (3)].val)) != 0) {
 4531: 				yyerror("failed to set identifer.\n");
 4532: 				return -1;
 4533: 			}
 4534: 			cur_rmconf->idvtype = (yyvsp[(2) - (3)].num);
 4535: 		}
 4536:     break;
 4537: 
 4538:   case 286:
 4539: /* Line 1787 of yacc.c  */
 4540: #line 1942 "cfparse.y"
 4541:     {
 4542: 			if (set_identifier_qual(&cur_rmconf->idv, (yyvsp[(2) - (4)].num), (yyvsp[(4) - (4)].val), (yyvsp[(3) - (4)].num)) != 0) {
 4543: 				yyerror("failed to set identifer.\n");
 4544: 				return -1;
 4545: 			}
 4546: 			cur_rmconf->idvtype = (yyvsp[(2) - (4)].num);
 4547: 		}
 4548:     break;
 4549: 
 4550:   case 288:
 4551: /* Line 1787 of yacc.c  */
 4552: #line 1951 "cfparse.y"
 4553:     {
 4554: #ifdef ENABLE_HYBRID
 4555: 			/* formerly identifier type login */
 4556: 			if (xauth_rmconf_used(&cur_rmconf->xauth) == -1) {
 4557: 				yyerror("failed to allocate xauth state\n");
 4558: 				return -1;
 4559: 			}
 4560: 			if ((cur_rmconf->xauth->login = vdup((yyvsp[(2) - (2)].val))) == NULL) {
 4561: 				yyerror("failed to set identifer.\n");
 4562: 				return -1;
 4563: 			}
 4564: #else
 4565: 			yyerror("racoon not configured with --enable-hybrid");
 4566: #endif
 4567: 		}
 4568:     break;
 4569: 
 4570:   case 290:
 4571: /* Line 1787 of yacc.c  */
 4572: #line 1968 "cfparse.y"
 4573:     {
 4574: 			struct idspec  *id;
 4575: 			id = newidspec();
 4576: 			if (id == NULL) {
 4577: 				yyerror("failed to allocate idspec");
 4578: 				return -1;
 4579: 			}
 4580: 			if (set_identifier(&id->id, (yyvsp[(2) - (3)].num), (yyvsp[(3) - (3)].val)) != 0) {
 4581: 				yyerror("failed to set identifer.\n");
 4582: 				racoon_free(id);
 4583: 				return -1;
 4584: 			}
 4585: 			id->idtype = (yyvsp[(2) - (3)].num);
 4586: 			genlist_append (cur_rmconf->idvl_p, id);
 4587: 		}
 4588:     break;
 4589: 
 4590:   case 292:
 4591: /* Line 1787 of yacc.c  */
 4592: #line 1985 "cfparse.y"
 4593:     {
 4594: 			struct idspec  *id;
 4595: 			id = newidspec();
 4596: 			if (id == NULL) {
 4597: 				yyerror("failed to allocate idspec");
 4598: 				return -1;
 4599: 			}
 4600: 			if (set_identifier_qual(&id->id, (yyvsp[(2) - (4)].num), (yyvsp[(4) - (4)].val), (yyvsp[(3) - (4)].num)) != 0) {
 4601: 				yyerror("failed to set identifer.\n");
 4602: 				racoon_free(id);
 4603: 				return -1;
 4604: 			}
 4605: 			id->idtype = (yyvsp[(2) - (4)].num);
 4606: 			genlist_append (cur_rmconf->idvl_p, id);
 4607: 		}
 4608:     break;
 4609: 
 4610:   case 294:
 4611: /* Line 1787 of yacc.c  */
 4612: #line 2001 "cfparse.y"
 4613:     { cur_rmconf->verify_identifier = (yyvsp[(2) - (2)].num); }
 4614:     break;
 4615: 
 4616:   case 296:
 4617: /* Line 1787 of yacc.c  */
 4618: #line 2002 "cfparse.y"
 4619:     { cur_rmconf->nonce_size = (yyvsp[(2) - (2)].num); }
 4620:     break;
 4621: 
 4622:   case 298:
 4623: /* Line 1787 of yacc.c  */
 4624: #line 2004 "cfparse.y"
 4625:     {
 4626: 			yyerror("dh_group cannot be defined here.");
 4627: 			return -1;
 4628: 		}
 4629:     break;
 4630: 
 4631:   case 300:
 4632: /* Line 1787 of yacc.c  */
 4633: #line 2009 "cfparse.y"
 4634:     { cur_rmconf->passive = (yyvsp[(2) - (2)].num); }
 4635:     break;
 4636: 
 4637:   case 302:
 4638: /* Line 1787 of yacc.c  */
 4639: #line 2010 "cfparse.y"
 4640:     { cur_rmconf->ike_frag = (yyvsp[(2) - (2)].num); }
 4641:     break;
 4642: 
 4643:   case 304:
 4644: /* Line 1787 of yacc.c  */
 4645: #line 2011 "cfparse.y"
 4646:     { cur_rmconf->ike_frag = ISAKMP_FRAG_FORCE; }
 4647:     break;
 4648: 
 4649:   case 306:
 4650: /* Line 1787 of yacc.c  */
 4651: #line 2012 "cfparse.y"
 4652:     { 
 4653: #ifdef SADB_X_EXT_NAT_T_FRAG
 4654:         		if (libipsec_opt & LIBIPSEC_OPT_FRAG)
 4655: 				cur_rmconf->esp_frag = (yyvsp[(2) - (2)].num); 
 4656: 			else
 4657:                 		yywarn("libipsec lacks IKE frag support");
 4658: #else
 4659: 			yywarn("Your kernel does not support esp_frag");
 4660: #endif
 4661: 		}
 4662:     break;
 4663: 
 4664:   case 308:
 4665: /* Line 1787 of yacc.c  */
 4666: #line 2022 "cfparse.y"
 4667:     { 
 4668: 			if (cur_rmconf->script[SCRIPT_PHASE1_UP] != NULL)
 4669: 				vfree(cur_rmconf->script[SCRIPT_PHASE1_UP]);
 4670: 
 4671: 			cur_rmconf->script[SCRIPT_PHASE1_UP] = 
 4672: 			    script_path_add(vdup((yyvsp[(2) - (3)].val)));
 4673: 		}
 4674:     break;
 4675: 
 4676:   case 310:
 4677: /* Line 1787 of yacc.c  */
 4678: #line 2029 "cfparse.y"
 4679:     { 
 4680: 			if (cur_rmconf->script[SCRIPT_PHASE1_DOWN] != NULL)
 4681: 				vfree(cur_rmconf->script[SCRIPT_PHASE1_DOWN]);
 4682: 
 4683: 			cur_rmconf->script[SCRIPT_PHASE1_DOWN] = 
 4684: 			    script_path_add(vdup((yyvsp[(2) - (3)].val)));
 4685: 		}
 4686:     break;
 4687: 
 4688:   case 312:
 4689: /* Line 1787 of yacc.c  */
 4690: #line 2036 "cfparse.y"
 4691:     { 
 4692: 			if (cur_rmconf->script[SCRIPT_PHASE1_DEAD] != NULL)
 4693: 				vfree(cur_rmconf->script[SCRIPT_PHASE1_DEAD]);
 4694: 
 4695: 			cur_rmconf->script[SCRIPT_PHASE1_DEAD] = 
 4696: 			    script_path_add(vdup((yyvsp[(2) - (3)].val)));
 4697: 		}
 4698:     break;
 4699: 
 4700:   case 314:
 4701: /* Line 1787 of yacc.c  */
 4702: #line 2043 "cfparse.y"
 4703:     { cur_rmconf->mode_cfg = (yyvsp[(2) - (2)].num); }
 4704:     break;
 4705: 
 4706:   case 316:
 4707: /* Line 1787 of yacc.c  */
 4708: #line 2044 "cfparse.y"
 4709:     {
 4710: 			cur_rmconf->weak_phase1_check = (yyvsp[(2) - (2)].num);
 4711: 		}
 4712:     break;
 4713: 
 4714:   case 318:
 4715: /* Line 1787 of yacc.c  */
 4716: #line 2047 "cfparse.y"
 4717:     { cur_rmconf->gen_policy = (yyvsp[(2) - (2)].num); }
 4718:     break;
 4719: 
 4720:   case 320:
 4721: /* Line 1787 of yacc.c  */
 4722: #line 2048 "cfparse.y"
 4723:     { cur_rmconf->gen_policy = (yyvsp[(2) - (2)].num); }
 4724:     break;
 4725: 
 4726:   case 322:
 4727: /* Line 1787 of yacc.c  */
 4728: #line 2049 "cfparse.y"
 4729:     { cur_rmconf->support_proxy = (yyvsp[(2) - (2)].num); }
 4730:     break;
 4731: 
 4732:   case 324:
 4733: /* Line 1787 of yacc.c  */
 4734: #line 2050 "cfparse.y"
 4735:     { cur_rmconf->ini_contact = (yyvsp[(2) - (2)].num); }
 4736:     break;
 4737: 
 4738:   case 326:
 4739: /* Line 1787 of yacc.c  */
 4740: #line 2052 "cfparse.y"
 4741:     {
 4742: #ifdef ENABLE_NATT
 4743:         		if (libipsec_opt & LIBIPSEC_OPT_NATT)
 4744: 				cur_rmconf->nat_traversal = (yyvsp[(2) - (2)].num);
 4745: 			else
 4746:                 		yyerror("libipsec lacks NAT-T support");
 4747: #else
 4748: 			yyerror("NAT-T support not compiled in.");
 4749: #endif
 4750: 		}
 4751:     break;
 4752: 
 4753:   case 328:
 4754: /* Line 1787 of yacc.c  */
 4755: #line 2063 "cfparse.y"
 4756:     {
 4757: #ifdef ENABLE_NATT
 4758: 			if (libipsec_opt & LIBIPSEC_OPT_NATT)
 4759: 				cur_rmconf->nat_traversal = NATT_FORCE;
 4760: 			else
 4761:                 		yyerror("libipsec lacks NAT-T support");
 4762: #else
 4763: 			yyerror("NAT-T support not compiled in.");
 4764: #endif
 4765: 		}
 4766:     break;
 4767: 
 4768:   case 330:
 4769: /* Line 1787 of yacc.c  */
 4770: #line 2074 "cfparse.y"
 4771:     {
 4772: #ifdef ENABLE_DPD
 4773: 			cur_rmconf->dpd = (yyvsp[(2) - (2)].num);
 4774: #else
 4775: 			yyerror("DPD support not compiled in.");
 4776: #endif
 4777: 		}
 4778:     break;
 4779: 
 4780:   case 332:
 4781: /* Line 1787 of yacc.c  */
 4782: #line 2082 "cfparse.y"
 4783:     {
 4784: #ifdef ENABLE_DPD
 4785: 			cur_rmconf->dpd_interval = (yyvsp[(2) - (2)].num);
 4786: #else
 4787: 			yyerror("DPD support not compiled in.");
 4788: #endif
 4789: 		}
 4790:     break;
 4791: 
 4792:   case 334:
 4793: /* Line 1787 of yacc.c  */
 4794: #line 2091 "cfparse.y"
 4795:     {
 4796: #ifdef ENABLE_DPD
 4797: 			cur_rmconf->dpd_retry = (yyvsp[(2) - (2)].num);
 4798: #else
 4799: 			yyerror("DPD support not compiled in.");
 4800: #endif
 4801: 		}
 4802:     break;
 4803: 
 4804:   case 336:
 4805: /* Line 1787 of yacc.c  */
 4806: #line 2100 "cfparse.y"
 4807:     {
 4808: #ifdef ENABLE_DPD
 4809: 			cur_rmconf->dpd_maxfails = (yyvsp[(2) - (2)].num);
 4810: #else
 4811: 			yyerror("DPD support not compiled in.");
 4812: #endif
 4813: 		}
 4814:     break;
 4815: 
 4816:   case 338:
 4817: /* Line 1787 of yacc.c  */
 4818: #line 2108 "cfparse.y"
 4819:     { cur_rmconf->rekey = (yyvsp[(2) - (2)].num); }
 4820:     break;
 4821: 
 4822:   case 340:
 4823: /* Line 1787 of yacc.c  */
 4824: #line 2109 "cfparse.y"
 4825:     { cur_rmconf->rekey = REKEY_FORCE; }
 4826:     break;
 4827: 
 4828:   case 342:
 4829: /* Line 1787 of yacc.c  */
 4830: #line 2111 "cfparse.y"
 4831:     {
 4832: 			cur_rmconf->ph1id = (yyvsp[(2) - (2)].num);
 4833: 		}
 4834:     break;
 4835: 
 4836:   case 344:
 4837: /* Line 1787 of yacc.c  */
 4838: #line 2116 "cfparse.y"
 4839:     {
 4840: 			cur_rmconf->lifetime = (yyvsp[(3) - (4)].num) * (yyvsp[(4) - (4)].num);
 4841: 		}
 4842:     break;
 4843: 
 4844:   case 346:
 4845: /* Line 1787 of yacc.c  */
 4846: #line 2120 "cfparse.y"
 4847:     { cur_rmconf->pcheck_level = (yyvsp[(2) - (2)].num); }
 4848:     break;
 4849: 
 4850:   case 348:
 4851: /* Line 1787 of yacc.c  */
 4852: #line 2122 "cfparse.y"
 4853:     {
 4854: #if 1
 4855: 			yyerror("byte lifetime support is deprecated in Phase1");
 4856: 			return -1;
 4857: #else
 4858: 			yywarn("the lifetime of bytes in phase 1 "
 4859: 				"will be ignored at the moment.");
 4860: 			cur_rmconf->lifebyte = fix_lifebyte((yyvsp[(3) - (4)].num) * (yyvsp[(4) - (4)].num));
 4861: 			if (cur_rmconf->lifebyte == 0)
 4862: 				return -1;
 4863: #endif
 4864: 		}
 4865:     break;
 4866: 
 4867:   case 350:
 4868: /* Line 1787 of yacc.c  */
 4869: #line 2136 "cfparse.y"
 4870:     {
 4871: 			struct secprotospec *spspec;
 4872: 
 4873: 			spspec = newspspec();
 4874: 			if (spspec == NULL)
 4875: 				return -1;
 4876: 			insspspec(cur_rmconf, spspec);
 4877: 		}
 4878:     break;
 4879: 
 4880:   case 353:
 4881: /* Line 1787 of yacc.c  */
 4882: #line 2149 "cfparse.y"
 4883:     {
 4884: 			struct etypes *new;
 4885: 			new = racoon_malloc(sizeof(struct etypes));
 4886: 			if (new == NULL) {
 4887: 				yyerror("failed to allocate etypes");
 4888: 				return -1;
 4889: 			}
 4890: 			new->type = (yyvsp[(2) - (2)].num);
 4891: 			new->next = NULL;
 4892: 			if (cur_rmconf->etypes == NULL)
 4893: 				cur_rmconf->etypes = new;
 4894: 			else {
 4895: 				struct etypes *p;
 4896: 				for (p = cur_rmconf->etypes;
 4897: 				     p->next != NULL;
 4898: 				     p = p->next)
 4899: 					;
 4900: 				p->next = new;
 4901: 			}
 4902: 		}
 4903:     break;
 4904: 
 4905:   case 354:
 4906: /* Line 1787 of yacc.c  */
 4907: #line 2172 "cfparse.y"
 4908:     {
 4909: 			if (cur_rmconf->mycert != NULL) {
 4910: 				yyerror("certificate_type already defined\n");
 4911: 				return -1;
 4912: 			}
 4913: 
 4914: 			if (load_x509((yyvsp[(2) - (3)].val)->v, &cur_rmconf->mycertfile,
 4915: 				      &cur_rmconf->mycert)) {
 4916: 				yyerror("failed to load certificate \"%s\"\n",
 4917: 					(yyvsp[(2) - (3)].val)->v);
 4918: 				return -1;
 4919: 			}
 4920: 
 4921: 			cur_rmconf->myprivfile = racoon_strdup((yyvsp[(3) - (3)].val)->v);
 4922: 			STRDUP_FATAL(cur_rmconf->myprivfile);
 4923: 
 4924: 			vfree((yyvsp[(2) - (3)].val));
 4925: 			vfree((yyvsp[(3) - (3)].val));
 4926: 		}
 4927:     break;
 4928: 
 4929:   case 356:
 4930: /* Line 1787 of yacc.c  */
 4931: #line 2193 "cfparse.y"
 4932:     {
 4933: 			char path[MAXPATHLEN];
 4934: 			int ret = 0;
 4935: 
 4936: 			if (cur_rmconf->mycert != NULL) {
 4937: 				yyerror("certificate_type already defined\n");
 4938: 				return -1;
 4939: 			}
 4940: 
 4941: 			cur_rmconf->mycert = vmalloc(1);
 4942: 			if (cur_rmconf->mycert == NULL) {
 4943: 				yyerror("failed to allocate mycert");
 4944: 				return -1;
 4945: 			}
 4946: 			cur_rmconf->mycert->v[0] = ISAKMP_CERT_PLAINRSA;
 4947: 
 4948: 			getpathname(path, sizeof(path),
 4949: 				    LC_PATHTYPE_CERT, (yyvsp[(2) - (2)].val)->v);
 4950: 			cur_rmconf->send_cr = FALSE;
 4951: 			cur_rmconf->send_cert = FALSE;
 4952: 			cur_rmconf->verify_cert = FALSE;
 4953: 			if (rsa_parse_file(cur_rmconf->rsa_private, path,
 4954: 					   RSA_TYPE_PRIVATE)) {
 4955: 				yyerror("Couldn't parse keyfile.\n", path);
 4956: 				return -1;
 4957: 			}
 4958: 			plog(LLV_DEBUG, LOCATION, NULL,
 4959: 			     "Private PlainRSA keyfile parsed: %s\n", path);
 4960: 			vfree((yyvsp[(2) - (2)].val));
 4961: 		}
 4962:     break;
 4963: 
 4964:   case 358:
 4965: /* Line 1787 of yacc.c  */
 4966: #line 2227 "cfparse.y"
 4967:     {
 4968: 			(yyval.num) = algtype2doi(algclass_isakmp_dh, (yyvsp[(1) - (1)].num));
 4969: 			if ((yyval.num) == -1) {
 4970: 				yyerror("must be DH group");
 4971: 				return -1;
 4972: 			}
 4973: 		}
 4974:     break;
 4975: 
 4976:   case 359:
 4977: /* Line 1787 of yacc.c  */
 4978: #line 2235 "cfparse.y"
 4979:     {
 4980: 			if (ARRAYLEN(num2dhgroup) > (yyvsp[(1) - (1)].num) && num2dhgroup[(yyvsp[(1) - (1)].num)] != 0) {
 4981: 				(yyval.num) = num2dhgroup[(yyvsp[(1) - (1)].num)];
 4982: 			} else {
 4983: 				yyerror("must be DH group");
 4984: 				(yyval.num) = 0;
 4985: 				return -1;
 4986: 			}
 4987: 		}
 4988:     break;
 4989: 
 4990:   case 360:
 4991: /* Line 1787 of yacc.c  */
 4992: #line 2246 "cfparse.y"
 4993:     { (yyval.val) = NULL; }
 4994:     break;
 4995: 
 4996:   case 361:
 4997: /* Line 1787 of yacc.c  */
 4998: #line 2247 "cfparse.y"
 4999:     { (yyval.val) = (yyvsp[(1) - (1)].val); }
 5000:     break;
 5001: 
 5002:   case 362:
 5003: /* Line 1787 of yacc.c  */
 5004: #line 2248 "cfparse.y"
 5005:     { (yyval.val) = (yyvsp[(1) - (1)].val); }
 5006:     break;
 5007: 
 5008:   case 365:
 5009: /* Line 1787 of yacc.c  */
 5010: #line 2256 "cfparse.y"
 5011:     {
 5012: 			cur_rmconf->spspec->lifetime = (yyvsp[(3) - (4)].num) * (yyvsp[(4) - (4)].num);
 5013: 		}
 5014:     break;
 5015: 
 5016:   case 367:
 5017: /* Line 1787 of yacc.c  */
 5018: #line 2261 "cfparse.y"
 5019:     {
 5020: #if 1
 5021: 			yyerror("byte lifetime support is deprecated");
 5022: 			return -1;
 5023: #else
 5024: 			cur_rmconf->spspec->lifebyte = fix_lifebyte((yyvsp[(3) - (4)].num) * (yyvsp[(4) - (4)].num));
 5025: 			if (cur_rmconf->spspec->lifebyte == 0)
 5026: 				return -1;
 5027: #endif
 5028: 		}
 5029:     break;
 5030: 
 5031:   case 369:
 5032: /* Line 1787 of yacc.c  */
 5033: #line 2273 "cfparse.y"
 5034:     {
 5035: 			cur_rmconf->spspec->algclass[algclass_isakmp_dh] = (yyvsp[(2) - (2)].num);
 5036: 		}
 5037:     break;
 5038: 
 5039:   case 371:
 5040: /* Line 1787 of yacc.c  */
 5041: #line 2278 "cfparse.y"
 5042:     {
 5043: 			if (cur_rmconf->spspec->vendorid != VENDORID_GSSAPI) {
 5044: 				yyerror("wrong Vendor ID for gssapi_id");
 5045: 				return -1;
 5046: 			}
 5047: 			if (cur_rmconf->spspec->gssid != NULL)
 5048: 				racoon_free(cur_rmconf->spspec->gssid);
 5049: 			cur_rmconf->spspec->gssid =
 5050: 			    racoon_strdup((yyvsp[(2) - (2)].val)->v);
 5051: 			STRDUP_FATAL(cur_rmconf->spspec->gssid);
 5052: 		}
 5053:     break;
 5054: 
 5055:   case 373:
 5056: /* Line 1787 of yacc.c  */
 5057: #line 2291 "cfparse.y"
 5058:     {
 5059: 			int doi;
 5060: 			int defklen;
 5061: 
 5062: 			doi = algtype2doi((yyvsp[(1) - (3)].num), (yyvsp[(2) - (3)].num));
 5063: 			if (doi == -1) {
 5064: 				yyerror("algorithm mismatched 1");
 5065: 				return -1;
 5066: 			}
 5067: 
 5068: 			switch ((yyvsp[(1) - (3)].num)) {
 5069: 			case algclass_isakmp_enc:
 5070: 			/* reject suppressed algorithms */
 5071: #ifndef HAVE_OPENSSL_RC5_H
 5072: 				if ((yyvsp[(2) - (3)].num) == algtype_rc5) {
 5073: 					yyerror("algorithm %s not supported",
 5074: 					    s_attr_isakmp_enc(doi));
 5075: 					return -1;
 5076: 				}
 5077: #endif
 5078: #ifndef HAVE_OPENSSL_IDEA_H
 5079: 				if ((yyvsp[(2) - (3)].num) == algtype_idea) {
 5080: 					yyerror("algorithm %s not supported",
 5081: 					    s_attr_isakmp_enc(doi));
 5082: 					return -1;
 5083: 				}
 5084: #endif
 5085: 
 5086: 				cur_rmconf->spspec->algclass[algclass_isakmp_enc] = doi;
 5087: 				defklen = default_keylen((yyvsp[(1) - (3)].num), (yyvsp[(2) - (3)].num));
 5088: 				if (defklen == 0) {
 5089: 					if ((yyvsp[(3) - (3)].num)) {
 5090: 						yyerror("keylen not allowed");
 5091: 						return -1;
 5092: 					}
 5093: 				} else {
 5094: 					if ((yyvsp[(3) - (3)].num) && check_keylen((yyvsp[(1) - (3)].num), (yyvsp[(2) - (3)].num), (yyvsp[(3) - (3)].num)) < 0) {
 5095: 						yyerror("invalid keylen %d", (yyvsp[(3) - (3)].num));
 5096: 						return -1;
 5097: 					}
 5098: 				}
 5099: 				if ((yyvsp[(3) - (3)].num))
 5100: 					cur_rmconf->spspec->encklen = (yyvsp[(3) - (3)].num);
 5101: 				else
 5102: 					cur_rmconf->spspec->encklen = defklen;
 5103: 				break;
 5104: 			case algclass_isakmp_hash:
 5105: 				cur_rmconf->spspec->algclass[algclass_isakmp_hash] = doi;
 5106: 				break;
 5107: 			case algclass_isakmp_ameth:
 5108: 				cur_rmconf->spspec->algclass[algclass_isakmp_ameth] = doi;
 5109: 				/*
 5110: 				 * We may have to set the Vendor ID for the
 5111: 				 * authentication method we're using.
 5112: 				 */
 5113: 				switch ((yyvsp[(2) - (3)].num)) {
 5114: 				case algtype_gssapikrb:
 5115: 					if (cur_rmconf->spspec->vendorid !=
 5116: 					    VENDORID_UNKNOWN) {
 5117: 						yyerror("Vendor ID mismatch "
 5118: 						    "for auth method");
 5119: 						return -1;
 5120: 					}
 5121: 					/*
 5122: 					 * For interoperability with Win2k,
 5123: 					 * we set the Vendor ID to "GSSAPI".
 5124: 					 */
 5125: 					cur_rmconf->spspec->vendorid =
 5126: 					    VENDORID_GSSAPI;
 5127: 					break;
 5128: 				case algtype_rsasig:
 5129: 					if (oakley_get_certtype(cur_rmconf->peerscert) == ISAKMP_CERT_PLAINRSA) {
 5130: 						if (rsa_list_count(cur_rmconf->rsa_private) == 0) {
 5131: 							yyerror ("Private PlainRSA key not set. "
 5132: 								 "Use directive 'certificate_type plainrsa ...'\n");
 5133: 							return -1;
 5134: 						}
 5135: 						if (rsa_list_count(cur_rmconf->rsa_public) == 0) {
 5136: 							yyerror ("Public PlainRSA keys not set. "
 5137: 								 "Use directive 'peers_certfile plainrsa ...'\n");
 5138: 							return -1;
 5139: 						}
 5140: 					}
 5141: 					break;
 5142: 				default:
 5143: 					break;
 5144: 				}
 5145: 				break;
 5146: 			default:
 5147: 				yyerror("algorithm mismatched 2");
 5148: 				return -1;
 5149: 			}
 5150: 		}
 5151:     break;
 5152: 
 5153:   case 375:
 5154: /* Line 1787 of yacc.c  */
 5155: #line 2388 "cfparse.y"
 5156:     { (yyval.num) = 1; }
 5157:     break;
 5158: 
 5159:   case 376:
 5160: /* Line 1787 of yacc.c  */
 5161: #line 2389 "cfparse.y"
 5162:     { (yyval.num) = 60; }
 5163:     break;
 5164: 
 5165:   case 377:
 5166: /* Line 1787 of yacc.c  */
 5167: #line 2390 "cfparse.y"
 5168:     { (yyval.num) = (60 * 60); }
 5169:     break;
 5170: 
 5171:   case 378:
 5172: /* Line 1787 of yacc.c  */
 5173: #line 2393 "cfparse.y"
 5174:     { (yyval.num) = 1; }
 5175:     break;
 5176: 
 5177:   case 379:
 5178: /* Line 1787 of yacc.c  */
 5179: #line 2394 "cfparse.y"
 5180:     { (yyval.num) = 1024; }
 5181:     break;
 5182: 
 5183:   case 380:
 5184: /* Line 1787 of yacc.c  */
 5185: #line 2395 "cfparse.y"
 5186:     { (yyval.num) = (1024 * 1024); }
 5187:     break;
 5188: 
 5189:   case 381:
 5190: /* Line 1787 of yacc.c  */
 5191: #line 2396 "cfparse.y"
 5192:     { (yyval.num) = (1024 * 1024 * 1024); }
 5193:     break;
 5194: 
 5195: 
 5196: /* Line 1787 of yacc.c  */
 5197: #line 5198 "cfparse.c"
 5198:       default: break;
 5199:     }
 5200:   /* User semantic actions sometimes alter yychar, and that requires
 5201:      that yytoken be updated with the new translation.  We take the
 5202:      approach of translating immediately before every use of yytoken.
 5203:      One alternative is translating here after every semantic action,
 5204:      but that translation would be missed if the semantic action invokes
 5205:      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
 5206:      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
 5207:      incorrect destructor might then be invoked immediately.  In the
 5208:      case of YYERROR or YYBACKUP, subsequent parser actions might lead
 5209:      to an incorrect destructor call or verbose syntax error message
 5210:      before the lookahead is translated.  */
 5211:   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
 5212: 
 5213:   YYPOPSTACK (yylen);
 5214:   yylen = 0;
 5215:   YY_STACK_PRINT (yyss, yyssp);
 5216: 
 5217:   *++yyvsp = yyval;
 5218: 
 5219:   /* Now `shift' the result of the reduction.  Determine what state
 5220:      that goes to, based on the state we popped back to and the rule
 5221:      number reduced by.  */
 5222: 
 5223:   yyn = yyr1[yyn];
 5224: 
 5225:   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
 5226:   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
 5227:     yystate = yytable[yystate];
 5228:   else
 5229:     yystate = yydefgoto[yyn - YYNTOKENS];
 5230: 
 5231:   goto yynewstate;
 5232: 
 5233: 
 5234: /*------------------------------------.
 5235: | yyerrlab -- here on detecting error |
 5236: `------------------------------------*/
 5237: yyerrlab:
 5238:   /* Make sure we have latest lookahead translation.  See comments at
 5239:      user semantic actions for why this is necessary.  */
 5240:   yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
 5241: 
 5242:   /* If not already recovering from an error, report this error.  */
 5243:   if (!yyerrstatus)
 5244:     {
 5245:       ++yynerrs;
 5246: #if ! YYERROR_VERBOSE
 5247:       yyerror (YY_("syntax error"));
 5248: #else
 5249: # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
 5250:                                         yyssp, yytoken)
 5251:       {
 5252:         char const *yymsgp = YY_("syntax error");
 5253:         int yysyntax_error_status;
 5254:         yysyntax_error_status = YYSYNTAX_ERROR;
 5255:         if (yysyntax_error_status == 0)
 5256:           yymsgp = yymsg;
 5257:         else if (yysyntax_error_status == 1)
 5258:           {
 5259:             if (yymsg != yymsgbuf)
 5260:               YYSTACK_FREE (yymsg);
 5261:             yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
 5262:             if (!yymsg)
 5263:               {
 5264:                 yymsg = yymsgbuf;
 5265:                 yymsg_alloc = sizeof yymsgbuf;
 5266:                 yysyntax_error_status = 2;
 5267:               }
 5268:             else
 5269:               {
 5270:                 yysyntax_error_status = YYSYNTAX_ERROR;
 5271:                 yymsgp = yymsg;
 5272:               }
 5273:           }
 5274:         yyerror (yymsgp);
 5275:         if (yysyntax_error_status == 2)
 5276:           goto yyexhaustedlab;
 5277:       }
 5278: # undef YYSYNTAX_ERROR
 5279: #endif
 5280:     }
 5281: 
 5282: 
 5283: 
 5284:   if (yyerrstatus == 3)
 5285:     {
 5286:       /* If just tried and failed to reuse lookahead token after an
 5287: 	 error, discard it.  */
 5288: 
 5289:       if (yychar <= YYEOF)
 5290: 	{
 5291: 	  /* Return failure if at end of input.  */
 5292: 	  if (yychar == YYEOF)
 5293: 	    YYABORT;
 5294: 	}
 5295:       else
 5296: 	{
 5297: 	  yydestruct ("Error: discarding",
 5298: 		      yytoken, &yylval);
 5299: 	  yychar = YYEMPTY;
 5300: 	}
 5301:     }
 5302: 
 5303:   /* Else will try to reuse lookahead token after shifting the error
 5304:      token.  */
 5305:   goto yyerrlab1;
 5306: 
 5307: 
 5308: /*---------------------------------------------------.
 5309: | yyerrorlab -- error raised explicitly by YYERROR.  |
 5310: `---------------------------------------------------*/
 5311: yyerrorlab:
 5312: 
 5313:   /* Pacify compilers like GCC when the user code never invokes
 5314:      YYERROR and the label yyerrorlab therefore never appears in user
 5315:      code.  */
 5316:   if (/*CONSTCOND*/ 0)
 5317:      goto yyerrorlab;
 5318: 
 5319:   /* Do not reclaim the symbols of the rule which action triggered
 5320:      this YYERROR.  */
 5321:   YYPOPSTACK (yylen);
 5322:   yylen = 0;
 5323:   YY_STACK_PRINT (yyss, yyssp);
 5324:   yystate = *yyssp;
 5325:   goto yyerrlab1;
 5326: 
 5327: 
 5328: /*-------------------------------------------------------------.
 5329: | yyerrlab1 -- common code for both syntax error and YYERROR.  |
 5330: `-------------------------------------------------------------*/
 5331: yyerrlab1:
 5332:   yyerrstatus = 3;	/* Each real token shifted decrements this.  */
 5333: 
 5334:   for (;;)
 5335:     {
 5336:       yyn = yypact[yystate];
 5337:       if (!yypact_value_is_default (yyn))
 5338: 	{
 5339: 	  yyn += YYTERROR;
 5340: 	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
 5341: 	    {
 5342: 	      yyn = yytable[yyn];
 5343: 	      if (0 < yyn)
 5344: 		break;
 5345: 	    }
 5346: 	}
 5347: 
 5348:       /* Pop the current state because it cannot handle the error token.  */
 5349:       if (yyssp == yyss)
 5350: 	YYABORT;
 5351: 
 5352: 
 5353:       yydestruct ("Error: popping",
 5354: 		  yystos[yystate], yyvsp);
 5355:       YYPOPSTACK (1);
 5356:       yystate = *yyssp;
 5357:       YY_STACK_PRINT (yyss, yyssp);
 5358:     }
 5359: 
 5360:   *++yyvsp = yylval;
 5361: 
 5362: 
 5363:   /* Shift the error token.  */
 5364:   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
 5365: 
 5366:   yystate = yyn;
 5367:   goto yynewstate;
 5368: 
 5369: 
 5370: /*-------------------------------------.
 5371: | yyacceptlab -- YYACCEPT comes here.  |
 5372: `-------------------------------------*/
 5373: yyacceptlab:
 5374:   yyresult = 0;
 5375:   goto yyreturn;
 5376: 
 5377: /*-----------------------------------.
 5378: | yyabortlab -- YYABORT comes here.  |
 5379: `-----------------------------------*/
 5380: yyabortlab:
 5381:   yyresult = 1;
 5382:   goto yyreturn;
 5383: 
 5384: #if !defined yyoverflow || YYERROR_VERBOSE
 5385: /*-------------------------------------------------.
 5386: | yyexhaustedlab -- memory exhaustion comes here.  |
 5387: `-------------------------------------------------*/
 5388: yyexhaustedlab:
 5389:   yyerror (YY_("memory exhausted"));
 5390:   yyresult = 2;
 5391:   /* Fall through.  */
 5392: #endif
 5393: 
 5394: yyreturn:
 5395:   if (yychar != YYEMPTY)
 5396:     {
 5397:       /* Make sure we have latest lookahead translation.  See comments at
 5398:          user semantic actions for why this is necessary.  */
 5399:       yytoken = YYTRANSLATE (yychar);
 5400:       yydestruct ("Cleanup: discarding lookahead",
 5401:                   yytoken, &yylval);
 5402:     }
 5403:   /* Do not reclaim the symbols of the rule which action triggered
 5404:      this YYABORT or YYACCEPT.  */
 5405:   YYPOPSTACK (yylen);
 5406:   YY_STACK_PRINT (yyss, yyssp);
 5407:   while (yyssp != yyss)
 5408:     {
 5409:       yydestruct ("Cleanup: popping",
 5410: 		  yystos[*yyssp], yyvsp);
 5411:       YYPOPSTACK (1);
 5412:     }
 5413: #ifndef yyoverflow
 5414:   if (yyss != yyssa)
 5415:     YYSTACK_FREE (yyss);
 5416: #endif
 5417: #if YYERROR_VERBOSE
 5418:   if (yymsg != yymsgbuf)
 5419:     YYSTACK_FREE (yymsg);
 5420: #endif
 5421:   /* Make sure YYID is used.  */
 5422:   return YYID (yyresult);
 5423: }
 5424: 
 5425: 
 5426: /* Line 2048 of yacc.c  */
 5427: #line 2398 "cfparse.y"
 5428: 
 5429: 
 5430: static struct secprotospec *
 5431: newspspec()
 5432: {
 5433: 	struct secprotospec *new;
 5434: 
 5435: 	new = racoon_calloc(1, sizeof(*new));
 5436: 	if (new == NULL) {
 5437: 		yyerror("failed to allocate spproto");
 5438: 		return NULL;
 5439: 	}
 5440: 
 5441: 	new->encklen = 0;	/*XXX*/
 5442: 
 5443: 	/*
 5444: 	 * Default to "uknown" vendor -- we will override this
 5445: 	 * as necessary.  When we send a Vendor ID payload, an
 5446: 	 * "unknown" will be translated to a KAME/racoon ID.
 5447: 	 */
 5448: 	new->vendorid = VENDORID_UNKNOWN;
 5449: 
 5450: 	return new;
 5451: }
 5452: 
 5453: /*
 5454:  * insert into head of list.
 5455:  */
 5456: static void
 5457: insspspec(rmconf, spspec)
 5458: 	struct remoteconf *rmconf;
 5459: 	struct secprotospec *spspec;
 5460: {
 5461: 	if (rmconf->spspec != NULL)
 5462: 		rmconf->spspec->prev = spspec;
 5463: 	spspec->next = rmconf->spspec;
 5464: 	rmconf->spspec = spspec;
 5465: }
 5466: 
 5467: static struct secprotospec *
 5468: dupspspec(spspec)
 5469: 	struct secprotospec *spspec;
 5470: {
 5471: 	struct secprotospec *new;
 5472: 
 5473: 	new = newspspec();
 5474: 	if (new == NULL) {
 5475: 		plog(LLV_ERROR, LOCATION, NULL, 
 5476: 		    "dupspspec: malloc failed\n");
 5477: 		return NULL;
 5478: 	}
 5479: 	memcpy(new, spspec, sizeof(*new));
 5480: 
 5481: 	if (spspec->gssid) {
 5482: 		new->gssid = racoon_strdup(spspec->gssid);
 5483: 		STRDUP_FATAL(new->gssid);
 5484: 	}
 5485: 	if (spspec->remote) {
 5486: 		new->remote = racoon_malloc(sizeof(*new->remote));
 5487: 		if (new->remote == NULL) {
 5488: 			plog(LLV_ERROR, LOCATION, NULL, 
 5489: 			    "dupspspec: malloc failed (remote)\n");
 5490: 			return NULL;
 5491: 		}
 5492: 		memcpy(new->remote, spspec->remote, sizeof(*new->remote));
 5493: 	}
 5494: 
 5495: 	return new;
 5496: }
 5497: 
 5498: /*
 5499:  * copy the whole list
 5500:  */
 5501: void
 5502: dupspspec_list(dst, src)
 5503: 	struct remoteconf *dst, *src;
 5504: {
 5505: 	struct secprotospec *p, *new, *last;
 5506: 
 5507: 	for(p = src->spspec, last = NULL; p; p = p->next, last = new) {
 5508: 		new = dupspspec(p);
 5509: 		if (new == NULL)
 5510: 			exit(1);
 5511: 
 5512: 		new->prev = last;
 5513: 		new->next = NULL; /* not necessary but clean */
 5514: 
 5515: 		if (last)
 5516: 			last->next = new;
 5517: 		else /* first element */
 5518: 			dst->spspec = new;
 5519: 
 5520: 	}
 5521: }
 5522: 
 5523: /*
 5524:  * delete the whole list
 5525:  */
 5526: void
 5527: flushspspec(rmconf)
 5528: 	struct remoteconf *rmconf;
 5529: {
 5530: 	struct secprotospec *p;
 5531: 
 5532: 	while(rmconf->spspec != NULL) {
 5533: 		p = rmconf->spspec;
 5534: 		rmconf->spspec = p->next;
 5535: 		if (p->next != NULL)
 5536: 			p->next->prev = NULL; /* not necessary but clean */
 5537: 
 5538: 		if (p->gssid)
 5539: 			racoon_free(p->gssid);
 5540: 		if (p->remote)
 5541: 			racoon_free(p->remote);
 5542: 		racoon_free(p);
 5543: 	}
 5544: 	rmconf->spspec = NULL;
 5545: }
 5546: 
 5547: /* set final acceptable proposal */
 5548: static int
 5549: set_isakmp_proposal(rmconf)
 5550: 	struct remoteconf *rmconf;
 5551: {
 5552: 	struct secprotospec *s;
 5553: 	int prop_no = 1; 
 5554: 	int trns_no = 1;
 5555: 	int32_t types[MAXALGCLASS];
 5556: 
 5557: 	/* mandatory check */
 5558: 	if (rmconf->spspec == NULL) {
 5559: 		yyerror("no remote specification found: %s.\n",
 5560: 			saddr2str(rmconf->remote));
 5561: 		return -1;
 5562: 	}
 5563: 	for (s = rmconf->spspec; s != NULL; s = s->next) {
 5564: 		/* XXX need more to check */
 5565: 		if (s->algclass[algclass_isakmp_enc] == 0) {
 5566: 			yyerror("encryption algorithm required.");
 5567: 			return -1;
 5568: 		}
 5569: 		if (s->algclass[algclass_isakmp_hash] == 0) {
 5570: 			yyerror("hash algorithm required.");
 5571: 			return -1;
 5572: 		}
 5573: 		if (s->algclass[algclass_isakmp_dh] == 0) {
 5574: 			yyerror("DH group required.");
 5575: 			return -1;
 5576: 		}
 5577: 		if (s->algclass[algclass_isakmp_ameth] == 0) {
 5578: 			yyerror("authentication method required.");
 5579: 			return -1;
 5580: 		}
 5581: 	}
 5582: 
 5583: 	/* skip to last part */
 5584: 	for (s = rmconf->spspec; s->next != NULL; s = s->next)
 5585: 		;
 5586: 
 5587: 	while (s != NULL) {
 5588: 		plog(LLV_DEBUG2, LOCATION, NULL,
 5589: 			"lifetime = %ld\n", (long)
 5590: 			(s->lifetime ? s->lifetime : rmconf->lifetime));
 5591: 		plog(LLV_DEBUG2, LOCATION, NULL,
 5592: 			"lifebyte = %d\n",
 5593: 			s->lifebyte ? s->lifebyte : rmconf->lifebyte);
 5594: 		plog(LLV_DEBUG2, LOCATION, NULL,
 5595: 			"encklen=%d\n", s->encklen);
 5596: 
 5597: 		memset(types, 0, ARRAYLEN(types));
 5598: 		types[algclass_isakmp_enc] = s->algclass[algclass_isakmp_enc];
 5599: 		types[algclass_isakmp_hash] = s->algclass[algclass_isakmp_hash];
 5600: 		types[algclass_isakmp_dh] = s->algclass[algclass_isakmp_dh];
 5601: 		types[algclass_isakmp_ameth] =
 5602: 		    s->algclass[algclass_isakmp_ameth];
 5603: 
 5604: 		/* expanding spspec */
 5605: 		clean_tmpalgtype();
 5606: 		trns_no = expand_isakmpspec(prop_no, trns_no, types,
 5607: 				algclass_isakmp_enc, algclass_isakmp_ameth + 1,
 5608: 				s->lifetime ? s->lifetime : rmconf->lifetime,
 5609: 				s->lifebyte ? s->lifebyte : rmconf->lifebyte,
 5610: 				s->encklen, s->vendorid, s->gssid,
 5611: 				rmconf);
 5612: 		if (trns_no == -1) {
 5613: 			plog(LLV_ERROR, LOCATION, NULL,
 5614: 				"failed to expand isakmp proposal.\n");
 5615: 			return -1;
 5616: 		}
 5617: 
 5618: 		s = s->prev;
 5619: 	}
 5620: 
 5621: 	if (rmconf->proposal == NULL) {
 5622: 		plog(LLV_ERROR, LOCATION, NULL,
 5623: 			"no proposal found.\n");
 5624: 		return -1;
 5625: 	}
 5626: 
 5627: 	return 0;
 5628: }
 5629: 
 5630: static void
 5631: clean_tmpalgtype()
 5632: {
 5633: 	int i;
 5634: 	for (i = 0; i < MAXALGCLASS; i++)
 5635: 		tmpalgtype[i] = 0;	/* means algorithm undefined. */
 5636: }
 5637: 
 5638: static int
 5639: expand_isakmpspec(prop_no, trns_no, types,
 5640: 		class, last, lifetime, lifebyte, encklen, vendorid, gssid,
 5641: 		rmconf)
 5642: 	int prop_no, trns_no;
 5643: 	int *types, class, last;
 5644: 	time_t lifetime;
 5645: 	int lifebyte;
 5646: 	int encklen;
 5647: 	int vendorid;
 5648: 	char *gssid;
 5649: 	struct remoteconf *rmconf;
 5650: {
 5651: 	struct isakmpsa *new;
 5652: 
 5653: 	/* debugging */
 5654:     {
 5655: 	int j;
 5656: 	char tb[10];
 5657: 	plog(LLV_DEBUG2, LOCATION, NULL,
 5658: 		"p:%d t:%d\n", prop_no, trns_no);
 5659: 	for (j = class; j < MAXALGCLASS; j++) {
 5660: 		snprintf(tb, sizeof(tb), "%d", types[j]);
 5661: 		plog(LLV_DEBUG2, LOCATION, NULL,
 5662: 			"%s%s%s%s\n",
 5663: 			s_algtype(j, types[j]),
 5664: 			types[j] ? "(" : "",
 5665: 			tb[0] == '0' ? "" : tb,
 5666: 			types[j] ? ")" : "");
 5667: 	}
 5668: 	plog(LLV_DEBUG2, LOCATION, NULL, "\n");
 5669:     }
 5670: 
 5671: #define TMPALGTYPE2STR(n) \
 5672: 	s_algtype(algclass_isakmp_##n, types[algclass_isakmp_##n])
 5673: 		/* check mandatory values */
 5674: 		if (types[algclass_isakmp_enc] == 0
 5675: 		 || types[algclass_isakmp_ameth] == 0
 5676: 		 || types[algclass_isakmp_hash] == 0
 5677: 		 || types[algclass_isakmp_dh] == 0) {
 5678: 			yyerror("few definition of algorithm "
 5679: 				"enc=%s ameth=%s hash=%s dhgroup=%s.\n",
 5680: 				TMPALGTYPE2STR(enc),
 5681: 				TMPALGTYPE2STR(ameth),
 5682: 				TMPALGTYPE2STR(hash),
 5683: 				TMPALGTYPE2STR(dh));
 5684: 			return -1;
 5685: 		}
 5686: #undef TMPALGTYPE2STR
 5687: 
 5688: 	/* set new sa */
 5689: 	new = newisakmpsa();
 5690: 	if (new == NULL) {
 5691: 		yyerror("failed to allocate isakmp sa");
 5692: 		return -1;
 5693: 	}
 5694: 	new->prop_no = prop_no;
 5695: 	new->trns_no = trns_no++;
 5696: 	new->lifetime = lifetime;
 5697: 	new->lifebyte = lifebyte;
 5698: 	new->enctype = types[algclass_isakmp_enc];
 5699: 	new->encklen = encklen;
 5700: 	new->authmethod = types[algclass_isakmp_ameth];
 5701: 	new->hashtype = types[algclass_isakmp_hash];
 5702: 	new->dh_group = types[algclass_isakmp_dh];
 5703: 	new->vendorid = vendorid;
 5704: #ifdef HAVE_GSSAPI
 5705: 	if (new->authmethod == OAKLEY_ATTR_AUTH_METHOD_GSSAPI_KRB) {
 5706: 		if (gssid != NULL) {
 5707: 			if ((new->gssid = vmalloc(strlen(gssid))) == NULL) {
 5708: 				racoon_free(new);
 5709: 				yyerror("failed to allocate gssid");
 5710: 				return -1;
 5711: 			}
 5712: 			memcpy(new->gssid->v, gssid, new->gssid->l);
 5713: 			racoon_free(gssid);
 5714: 		} else {
 5715: 			/*
 5716: 			 * Allocate the default ID so that it gets put
 5717: 			 * into a GSS ID attribute during the Phase 1
 5718: 			 * exchange.
 5719: 			 */
 5720: 			new->gssid = gssapi_get_default_gss_id();
 5721: 		}
 5722: 	}
 5723: #endif
 5724: 	insisakmpsa(new, rmconf);
 5725: 
 5726: 	return trns_no;
 5727: }
 5728: 
 5729: #if 0
 5730: /*
 5731:  * fix lifebyte.
 5732:  * Must be more than 1024B because its unit is kilobytes.
 5733:  * That is defined RFC2407.
 5734:  */
 5735: static int
 5736: fix_lifebyte(t)
 5737: 	unsigned long t;
 5738: {
 5739: 	if (t < 1024) {
 5740: 		yyerror("byte size should be more than 1024B.");
 5741: 		return 0;
 5742: 	}
 5743: 
 5744: 	return(t / 1024);
 5745: }
 5746: #endif
 5747: 
 5748: int
 5749: cfparse()
 5750: {
 5751: 	int error;
 5752: 
 5753: 	yyerrorcount = 0;
 5754: 	yycf_init_buffer();
 5755: 
 5756: 	if (yycf_switch_buffer(lcconf->racoon_conf) != 0) {
 5757: 		plog(LLV_ERROR, LOCATION, NULL, 
 5758: 		    "could not read configuration file \"%s\"\n", 
 5759: 		    lcconf->racoon_conf);
 5760: 		return -1;
 5761: 	}
 5762: 
 5763: 	error = yyparse();
 5764: 	if (error != 0) {
 5765: 		if (yyerrorcount) {
 5766: 			plog(LLV_ERROR, LOCATION, NULL,
 5767: 				"fatal parse failure (%d errors)\n",
 5768: 				yyerrorcount);
 5769: 		} else {
 5770: 			plog(LLV_ERROR, LOCATION, NULL,
 5771: 				"fatal parse failure.\n");
 5772: 		}
 5773: 		return -1;
 5774: 	}
 5775: 
 5776: 	if (error == 0 && yyerrorcount) {
 5777: 		plog(LLV_ERROR, LOCATION, NULL,
 5778: 			"parse error is nothing, but yyerrorcount is %d.\n",
 5779: 				yyerrorcount);
 5780: 		exit(1);
 5781: 	}
 5782: 
 5783: 	yycf_clean_buffer();
 5784: 
 5785: 	plog(LLV_DEBUG2, LOCATION, NULL, "parse successed.\n");
 5786: 
 5787: 	return 0;
 5788: }
 5789: 
 5790: int
 5791: cfreparse()
 5792: {
 5793: 	flushph2();
 5794: 	flushph1();
 5795: 	flushrmconf();
 5796: 	flushsainfo();
 5797: 	clean_tmpalgtype();
 5798: 	return(cfparse());
 5799: }
 5800: 
 5801: #ifdef ENABLE_ADMINPORT
 5802: static void
 5803: adminsock_conf(path, owner, group, mode_dec)
 5804: 	vchar_t *path;
 5805: 	vchar_t *owner;
 5806: 	vchar_t *group;
 5807: 	int mode_dec;
 5808: {
 5809: 	struct passwd *pw = NULL;
 5810: 	struct group *gr = NULL;
 5811: 	mode_t mode = 0;
 5812: 	uid_t uid;
 5813: 	gid_t gid;
 5814: 	int isnum;
 5815: 
 5816: 	adminsock_path = path->v;
 5817: 
 5818: 	if (owner == NULL)
 5819: 		return;
 5820: 
 5821: 	errno = 0;
 5822: 	uid = atoi(owner->v);
 5823: 	isnum = !errno;
 5824: 	if (((pw = getpwnam(owner->v)) == NULL) && !isnum)
 5825: 		yyerror("User \"%s\" does not exist", owner->v);
 5826: 
 5827: 	if (pw)
 5828: 		adminsock_owner = pw->pw_uid;
 5829: 	else
 5830: 		adminsock_owner = uid;
 5831: 
 5832: 	if (group == NULL)
 5833: 		return;
 5834: 
 5835: 	errno = 0;
 5836: 	gid = atoi(group->v);
 5837: 	isnum = !errno;
 5838: 	if (((gr = getgrnam(group->v)) == NULL) && !isnum)
 5839: 		yyerror("Group \"%s\" does not exist", group->v);
 5840: 
 5841: 	if (gr)
 5842: 		adminsock_group = gr->gr_gid;
 5843: 	else
 5844: 		adminsock_group = gid;
 5845: 
 5846: 	if (mode_dec == -1)
 5847: 		return;
 5848: 
 5849: 	if (mode_dec > 777)
 5850: 		yyerror("Mode 0%03o is invalid", mode_dec);
 5851: 	if (mode_dec >= 400) { mode += 0400; mode_dec -= 400; }
 5852: 	if (mode_dec >= 200) { mode += 0200; mode_dec -= 200; }
 5853: 	if (mode_dec >= 100) { mode += 0200; mode_dec -= 100; }
 5854: 
 5855: 	if (mode_dec > 77)
 5856: 		yyerror("Mode 0%03o is invalid", mode_dec);
 5857: 	if (mode_dec >= 40) { mode += 040; mode_dec -= 40; }
 5858: 	if (mode_dec >= 20) { mode += 020; mode_dec -= 20; }
 5859: 	if (mode_dec >= 10) { mode += 020; mode_dec -= 10; }
 5860: 
 5861: 	if (mode_dec > 7)
 5862: 		yyerror("Mode 0%03o is invalid", mode_dec);
 5863: 	if (mode_dec >= 4) { mode += 04; mode_dec -= 4; }
 5864: 	if (mode_dec >= 2) { mode += 02; mode_dec -= 2; }
 5865: 	if (mode_dec >= 1) { mode += 02; mode_dec -= 1; }
 5866: 	
 5867: 	adminsock_mode = mode;
 5868: 
 5869: 	return;
 5870: }
 5871: #endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>