Changeset b376ae1 in rtems-libbsd
- Timestamp:
- 05/03/18 12:15:11 (6 years ago)
- Branches:
- 5, 5-freebsd-12, 6-freebsd-12, master
- Children:
- 5e13963
- Parents:
- 8645c9d7
- git-author:
- Christian Mauderer <christian.mauderer@…> (05/03/18 12:15:11)
- git-committer:
- Christian Mauderer <christian.mauderer@…> (08/02/18 08:25:37)
- Files:
-
- 70 added
- 11 deleted
- 88 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
ipsec-tools/src/libipsec/ipsec_dump_policy.c
r8645c9d7 rb376ae1 1 #include <machine/rtems-bsd-user-space.h> 2 1 3 /* $NetBSD: ipsec_dump_policy.c,v 1.9 2010/12/03 15:01:11 tteras Exp $ */ 2 4 -
ipsec-tools/src/libipsec/ipsec_get_policylen.c
r8645c9d7 rb376ae1 1 #include <machine/rtems-bsd-user-space.h> 2 1 3 /* $NetBSD: ipsec_get_policylen.c,v 1.7 2007/07/18 12:07:50 vanhu Exp $ */ 2 4 -
ipsec-tools/src/libipsec/ipsec_strerror.c
r8645c9d7 rb376ae1 1 #include <machine/rtems-bsd-user-space.h> 2 1 3 /* $NetBSD: ipsec_strerror.c,v 1.6 2010/04/07 14:53:52 vanhu Exp $ */ 2 4 -
ipsec-tools/src/libipsec/key_debug.c
r8645c9d7 rb376ae1 1 #include <machine/rtems-bsd-user-space.h> 2 1 3 /* $NetBSD: key_debug.c,v 1.9 2008/12/05 06:02:20 tteras Exp $ */ 2 4 -
ipsec-tools/src/libipsec/libpfkey.h
r8645c9d7 rb376ae1 94 94 95 95 /* The options built into libipsec */ 96 #ifndef __rtems__ 96 97 extern int libipsec_opt; 98 #else /* __rtems__ */ 99 extern const int libipsec_opt; 100 #endif /* __rtems__ */ 97 101 #define LIBIPSEC_OPT_NATT 0x01 98 102 #define LIBIPSEC_OPT_FRAG 0x02 … … 109 113 void kdebug_sadb __P((struct sadb_msg *)); 110 114 ipsec_policy_t ipsec_set_policy __P((__ipsec_const char *, int)); 115 #ifdef __rtems__ 116 extern void ipsec_free_policy(ipsec_policy_t buf); 117 #endif /* __rtems__ */ 111 118 int ipsec_get_policylen __P((ipsec_policy_t)); 112 119 char *ipsec_dump_policy __P((ipsec_policy_t, __ipsec_const char *)); -
ipsec-tools/src/libipsec/pfkey.c
r8645c9d7 rb376ae1 1 #include <machine/rtems-bsd-user-space.h> 2 1 3 /* $NetBSD: pfkey.c,v 1.21.2.1 2011/11/14 13:25:06 tteras Exp $ */ 2 4 … … 96 98 #endif 97 99 100 #ifndef __rtems__ 98 101 int libipsec_opt = 0 102 #else /* __rtems__ */ 103 const int libipsec_opt = 0 104 #endif /* __rtems__ */ 99 105 #ifdef SADB_X_EXT_NAT_T_TYPE 100 106 | LIBIPSEC_OPT_NATT … … 117 123 }; 118 124 125 #ifndef __rtems__ 119 126 static int supported_map[] = { 127 #else /* __rtems__ */ 128 static const int supported_map[] = { 129 #endif /* __rtems__ */ 120 130 SADB_SATYPE_AH, 121 131 SADB_SATYPE_ESP, -
ipsec-tools/src/libipsec/pfkey_dump.c
r8645c9d7 rb376ae1 1 #include <machine/rtems-bsd-user-space.h> 2 1 3 /* $NetBSD: pfkey_dump.c,v 1.18 2010/12/03 14:32:52 tteras Exp $ */ 2 4 … … 123 125 * Must to be re-written about following strings. 124 126 */ 127 #ifndef __rtems__ 125 128 static char *str_satype[] = { 129 #else /* __rtems__ */ 130 static const char *str_satype[] = { 131 #endif /* __rtems__ */ 126 132 "unspec", 127 133 "unknown", … … 138 144 }; 139 145 146 #ifndef __rtems__ 140 147 static char *str_mode[] = { 148 #else /* __rtems__ */ 149 static const char *str_mode[] = { 150 #endif /* __rtems__ */ 141 151 "any", 142 152 "transport", … … 144 154 }; 145 155 156 #ifndef __rtems__ 146 157 static char *str_state[] = { 158 #else /* __rtems__ */ 159 static const char *str_state[] = { 160 #endif /* __rtems__ */ 147 161 "larval", 148 162 "mature", … … 151 165 }; 152 166 167 #ifndef __rtems__ 153 168 static struct val2str str_alg_auth[] = { 169 #else /* __rtems__ */ 170 static const struct val2str str_alg_auth[] = { 171 #endif /* __rtems__ */ 154 172 { SADB_AALG_NONE, "none", }, 155 173 { SADB_AALG_MD5HMAC, "hmac-md5", }, … … 179 197 }; 180 198 199 #ifndef __rtems__ 181 200 static struct val2str str_alg_enc[] = { 201 #else /* __rtems__ */ 202 static const struct val2str str_alg_enc[] = { 203 #endif /* __rtems__ */ 182 204 { SADB_EALG_NONE, "none", }, 183 205 { SADB_EALG_DESCBC, "des-cbc", }, … … 204 226 }; 205 227 228 #ifndef __rtems__ 206 229 static struct val2str str_alg_comp[] = { 230 #else /* __rtems__ */ 231 static const struct val2str str_alg_comp[] = { 232 #endif /* __rtems__ */ 207 233 { SADB_X_CALG_NONE, "none", }, 208 234 { SADB_X_CALG_OUI, "oui", }, -
ipsec-tools/src/libipsec/policy_parse.c
r8645c9d7 rb376ae1 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. */ 1 /* original parser id follows */ 2 /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 5 #define YYBYACC 1 6 #define YYMAJOR 1 7 #define YYMINOR 9 8 #define YYPATCH 20170201 9 10 #define YYEMPTY (-1) 11 #define yyclearin (yychar = YYEMPTY) 12 #define yyerrok (yyerrflag = 0) 13 #define YYRECOVERING() (yyerrflag != 0) 14 #define YYENOMEM (-2) 15 #define YYEOF 0 16 17 #ifndef yyparse 18 #define yyparse __libipsecparse 19 #endif /* yyparse */ 20 21 #ifndef yylex 22 #define yylex __libipseclex 23 #endif /* yylex */ 24 25 #ifndef yyerror 26 #define yyerror __libipsecerror 27 #endif /* yyerror */ 28 29 #ifndef yychar 30 #define yychar __libipsecchar 31 #endif /* yychar */ 32 33 #ifndef yyval 34 #define yyval __libipsecval 35 #endif /* yyval */ 36 37 #ifndef yylval 38 #define yylval __libipseclval 39 #endif /* yylval */ 40 41 #ifndef yydebug 42 #define yydebug __libipsecdebug 43 #endif /* yydebug */ 44 45 #ifndef yynerrs 46 #define yynerrs __libipsecnerrs 47 #endif /* yynerrs */ 48 49 #ifndef yyerrflag 50 #define yyerrflag __libipsecerrflag 51 #endif /* yyerrflag */ 52 53 #ifndef yylhs 54 #define yylhs __libipseclhs 55 #endif /* yylhs */ 56 57 #ifndef yylen 58 #define yylen __libipseclen 59 #endif /* yylen */ 60 61 #ifndef yydefred 62 #define yydefred __libipsecdefred 63 #endif /* yydefred */ 64 65 #ifndef yydgoto 66 #define yydgoto __libipsecdgoto 67 #endif /* yydgoto */ 68 69 #ifndef yysindex 70 #define yysindex __libipsecsindex 71 #endif /* yysindex */ 72 73 #ifndef yyrindex 74 #define yyrindex __libipsecrindex 75 #endif /* yyrindex */ 76 77 #ifndef yygindex 78 #define yygindex __libipsecgindex 79 #endif /* yygindex */ 80 81 #ifndef yytable 82 #define yytable __libipsectable 83 #endif /* yytable */ 84 85 #ifndef yycheck 86 #define yycheck __libipseccheck 87 #endif /* yycheck */ 88 89 #ifndef yyname 90 #define yyname __libipsecname 91 #endif /* yyname */ 92 93 #ifndef yyrule 94 #define yyrule __libipsecrule 95 #endif /* yyrule */ 96 #define YYPREFIX "__libipsec" 97 53 98 #define YYPURE 0 54 99 55 /* Push parsers. */ 56 #define YYPUSH 0 57 58 /* Pull parsers. */ 59 #define YYPULL 1 60 61 62 /* Substitute the variable and function names. */ 63 #define yyparse __libipsecparse 64 #define yylex __libipseclex 65 #define yyerror __libipsecerror 66 #define yylval __libipseclval 67 #define yychar __libipsecchar 68 #define yydebug __libipsecdebug 69 #define yynerrs __libipsecnerrs 70 71 /* Copy the first part of user declarations. */ 72 /* Line 336 of yacc.c */ 73 #line 65 "policy_parse.y" 74 100 #line 66 "../../ipsec-tools/src/libipsec/policy_parse.y" 101 #ifdef __rtems__ 102 #include <machine/rtems-bsd-user-space.h> 103 #endif /* __rtems__ */ 75 104 #ifdef HAVE_CONFIG_H 76 105 #include "config.h" … … 134 163 extern char *__libipsectext; /*XXX*/ 135 164 136 137 /* Line 336 of yacc.c */ 138 #line 139 "policy_parse.c" 139 140 # ifndef YY_NULL 141 # if defined __cplusplus && 201103L <= __cplusplus 142 # define YY_NULL nullptr 143 # else 144 # define YY_NULL 0 145 # endif 146 # endif 147 148 /* Enabling verbose error messages. */ 149 #ifdef YYERROR_VERBOSE 150 # undef YYERROR_VERBOSE 151 # define YYERROR_VERBOSE 1 152 #else 153 # define YYERROR_VERBOSE 0 154 #endif 155 156 /* In a future release of Bison, this section will be replaced 157 by #include "y.tab.h". */ 158 #ifndef _LIBIPSEC_Y_TAB_H 159 # define _LIBIPSEC_Y_TAB_H 160 /* Enabling traces. */ 161 #ifndef YYDEBUG 162 # define YYDEBUG 0 163 #endif 164 #if YYDEBUG 165 extern int __libipsecdebug; 166 #endif 167 168 /* Tokens. */ 169 #ifndef YYTOKENTYPE 170 # define YYTOKENTYPE 171 /* Put the tokens into the symbol table, so that GDB and other debuggers 172 know about them. */ 173 enum yytokentype { 174 DIR = 258, 175 PRIORITY = 259, 176 PLUS = 260, 177 PRIO_BASE = 261, 178 PRIO_OFFSET = 262, 179 ACTION = 263, 180 PROTOCOL = 264, 181 MODE = 265, 182 LEVEL = 266, 183 LEVEL_SPECIFY = 267, 184 IPADDRESS = 268, 185 PORT = 269, 186 ME = 270, 187 ANY = 271, 188 SLASH = 272, 189 HYPHEN = 273 190 }; 191 #endif 192 /* Tokens. */ 193 #define DIR 258 194 #define PRIORITY 259 195 #define PLUS 260 196 #define PRIO_BASE 261 197 #define PRIO_OFFSET 262 198 #define ACTION 263 199 #define PROTOCOL 264 200 #define MODE 265 201 #define LEVEL 266 202 #define LEVEL_SPECIFY 267 203 #define IPADDRESS 268 204 #define PORT 269 205 #define ME 270 206 #define ANY 271 207 #define SLASH 272 208 #define HYPHEN 273 209 210 211 212 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 213 typedef union YYSTYPE 214 { 215 /* Line 350 of yacc.c */ 216 #line 129 "policy_parse.y" 217 165 #ifdef YYSTYPE 166 #undef YYSTYPE_IS_DECLARED 167 #define YYSTYPE_IS_DECLARED 1 168 #endif 169 #ifndef YYSTYPE_IS_DECLARED 170 #define YYSTYPE_IS_DECLARED 1 171 #line 132 "../../ipsec-tools/src/libipsec/policy_parse.y" 172 typedef union { 218 173 u_int num; 219 174 u_int32_t num32; … … 222 177 char *buf; 223 178 } val; 224 225 226 /* Line 350 of yacc.c */227 #line 228 "policy_parse.c"228 179 } YYSTYPE; 229 # define YYSTYPE_IS_TRIVIAL 1 230 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 231 # define YYSTYPE_IS_DECLARED 1 232 #endif 233 234 extern YYSTYPE __libipseclval; 235 180 #endif /* !YYSTYPE_IS_DECLARED */ 181 #line 182 "__libipsec.tab.c" 182 183 /* compatibility with bison */ 236 184 #ifdef YYPARSE_PARAM 237 #if defined __STDC__ || defined __cplusplus 238 int __libipsecparse (void *YYPARSE_PARAM); 185 /* compatibility with FreeBSD */ 186 # ifdef YYPARSE_PARAM_TYPE 187 # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) 188 # else 189 # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) 190 # endif 239 191 #else 240 int __libipsecparse (); 241 #endif 242 #else /* ! YYPARSE_PARAM */ 243 #if defined __STDC__ || defined __cplusplus 244 int __libipsecparse (void); 192 # define YYPARSE_DECL() yyparse(void) 193 #endif 194 195 /* Parameters sent to lex. */ 196 #ifdef YYLEX_PARAM 197 # define YYLEX_DECL() yylex(void *YYLEX_PARAM) 198 # define YYLEX yylex(YYLEX_PARAM) 245 199 #else 246 int __libipsecparse (); 247 #endif 248 #endif /* ! YYPARSE_PARAM */ 249 250 #endif /* !_LIBIPSEC_Y_TAB_H */ 251 252 /* Copy the second part of user declarations. */ 253 254 /* Line 353 of yacc.c */ 255 #line 256 "policy_parse.c" 256 257 #ifdef short 258 # undef short 259 #endif 260 261 #ifdef YYTYPE_UINT8 262 typedef YYTYPE_UINT8 yytype_uint8; 200 # define YYLEX_DECL() yylex(void) 201 # define YYLEX yylex() 202 #endif 203 204 /* Parameters sent to yyerror. */ 205 #ifndef YYERROR_DECL 206 #define YYERROR_DECL() yyerror(const char *s) 207 #endif 208 #ifndef YYERROR_CALL 209 #define YYERROR_CALL(msg) yyerror(msg) 210 #endif 211 212 extern int YYPARSE_DECL(); 213 214 #define DIR 257 215 #define PRIORITY 258 216 #define PLUS 259 217 #define PRIO_BASE 260 218 #define PRIO_OFFSET 261 219 #define ACTION 262 220 #define PROTOCOL 263 221 #define MODE 264 222 #define LEVEL 265 223 #define LEVEL_SPECIFY 266 224 #define IPADDRESS 267 225 #define PORT 268 226 #define ME 269 227 #define ANY 270 228 #define SLASH 271 229 #define HYPHEN 272 230 #define YYERRCODE 256 231 typedef int YYINT; 232 static const YYINT __libipseclhs[] = { -1, 233 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 234 7, 0, 0, 1, 1, 8, 8, 8, 8, 8, 235 8, 8, 8, 9, 10, 12, 12, 13, 11, 14, 236 11, 11, 11, 237 }; 238 static const YYINT __libipseclen[] = { 2, 239 0, 4, 0, 6, 0, 7, 0, 6, 0, 8, 240 0, 8, 1, 0, 2, 7, 6, 5, 4, 6, 241 3, 2, 1, 1, 1, 1, 1, 0, 4, 0, 242 6, 3, 3, 243 }; 244 static const YYINT __libipsecdefred[] = { 0, 245 0, 0, 0, 1, 0, 0, 0, 14, 0, 7, 246 0, 3, 0, 0, 0, 14, 0, 14, 5, 24, 247 15, 0, 9, 0, 11, 0, 14, 0, 14, 14, 248 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 249 0, 30, 0, 0, 0, 26, 27, 20, 0, 0, 250 0, 32, 33, 16, 0, 29, 0, 31, 251 }; 252 static const YYINT __libipsecdgoto[] = { 2, 253 14, 8, 18, 27, 16, 29, 30, 21, 22, 33, 254 41, 48, 43, 50, 255 }; 256 static const YYINT __libipsecsindex[] = { -257, 257 -250, 0, -246, 0, -249, -251, -245, 0, -244, 0, 258 -239, 0, -243, -231, -238, 0, -229, 0, 0, 0, 259 0, -237, 0, -231, 0, -231, 0, -228, 0, 0, 260 -231, 0, -236, -231, -231, -242, -230, -233, -232, -235, 261 -234, 0, -227, -226, -223, 0, 0, 0, -235, -225, 262 -224, 0, 0, 0, -219, 0, -218, 0, 263 }; 264 static const YYINT __libipsecrindex[] = { 0, 265 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 266 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 267 0, 1, 0, 49, 0, 51, 0, 2, 0, 0, 268 52, 0, 3, 53, 54, 4, -217, 0, 0, 0, 269 5, 0, 0, 0, 0, 0, 0, 0, 6, 0, 270 0, 0, 0, 0, 0, 0, 0, 0, 271 }; 272 static const YYINT __libipsecgindex[] = { 0, 273 -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 274 0, 7, 0, 0, 275 }; 276 #define YYTABLESIZE 269 277 static const YYINT __libipsectable[] = { 1, 278 23, 22, 21, 19, 18, 17, 24, 3, 26, 9, 279 12, 4, 10, 5, 6, 13, 15, 31, 19, 34, 280 35, 17, 11, 23, 37, 7, 38, 39, 40, 46, 281 47, 20, 25, 28, 36, 32, 49, 42, 44, 45, 282 13, 2, 56, 52, 51, 53, 55, 57, 8, 58, 283 4, 6, 10, 12, 28, 54, 0, 0, 0, 0, 284 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 285 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 286 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 288 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 289 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 290 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 291 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 292 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 293 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 294 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 295 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 296 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 297 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 298 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 299 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 300 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 301 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 302 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 303 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 304 0, 0, 0, 23, 22, 21, 19, 18, 17, 305 }; 306 static const YYINT __libipseccheck[] = { 257, 307 0, 0, 0, 0, 0, 0, 16, 258, 18, 259, 308 262, 262, 262, 260, 261, 261, 261, 27, 262, 29, 309 30, 261, 272, 262, 267, 272, 269, 270, 271, 265, 310 266, 263, 262, 271, 271, 264, 271, 268, 272, 272, 311 0, 0, 267, 270, 272, 269, 272, 267, 0, 268, 312 0, 0, 0, 0, 272, 49, -1, -1, -1, -1, 313 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 314 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 315 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 316 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 317 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 318 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 319 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 320 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 321 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 322 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 323 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 324 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 325 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 326 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 327 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 328 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 329 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 330 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 331 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 332 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 333 -1, -1, -1, 263, 263, 263, 263, 263, 263, 334 }; 335 #define YYFINAL 2 336 #ifndef YYDEBUG 337 #define YYDEBUG 0 338 #endif 339 #define YYMAXTOKEN 272 340 #define YYUNDFTOKEN 289 341 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) 342 #if YYDEBUG 343 static const char *const __libipsecname[] = { 344 345 "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 346 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 347 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 348 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 349 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 350 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 351 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"DIR","PRIORITY","PLUS", 352 "PRIO_BASE","PRIO_OFFSET","ACTION","PROTOCOL","MODE","LEVEL","LEVEL_SPECIFY", 353 "IPADDRESS","PORT","ME","ANY","SLASH","HYPHEN",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 354 "illegal-symbol", 355 }; 356 static const char *const __libipsecrule[] = { 357 "$accept : policy_spec", 358 "$$1 :", 359 "policy_spec : DIR ACTION $$1 rules", 360 "$$2 :", 361 "policy_spec : DIR PRIORITY PRIO_OFFSET ACTION $$2 rules", 362 "$$3 :", 363 "policy_spec : DIR PRIORITY HYPHEN PRIO_OFFSET ACTION $$3 rules", 364 "$$4 :", 365 "policy_spec : DIR PRIORITY PRIO_BASE ACTION $$4 rules", 366 "$$5 :", 367 "policy_spec : DIR PRIORITY PRIO_BASE PLUS PRIO_OFFSET ACTION $$5 rules", 368 "$$6 :", 369 "policy_spec : DIR PRIORITY PRIO_BASE HYPHEN PRIO_OFFSET ACTION $$6 rules", 370 "policy_spec : DIR", 371 "rules :", 372 "rules : rules rule", 373 "rule : protocol SLASH mode SLASH addresses SLASH level", 374 "rule : protocol SLASH mode SLASH addresses SLASH", 375 "rule : protocol SLASH mode SLASH addresses", 376 "rule : protocol SLASH mode SLASH", 377 "rule : protocol SLASH mode SLASH SLASH level", 378 "rule : protocol SLASH mode", 379 "rule : protocol SLASH", 380 "rule : protocol", 381 "protocol : PROTOCOL", 382 "mode : MODE", 383 "level : LEVEL", 384 "level : LEVEL_SPECIFY", 385 "$$7 :", 386 "addresses : IPADDRESS $$7 HYPHEN IPADDRESS", 387 "$$8 :", 388 "addresses : IPADDRESS PORT $$8 HYPHEN IPADDRESS PORT", 389 "addresses : ME HYPHEN ANY", 390 "addresses : ANY HYPHEN ME", 391 392 }; 393 #endif 394 395 int yydebug; 396 int yynerrs; 397 398 int yyerrflag; 399 int yychar; 400 YYSTYPE yyval; 401 YYSTYPE yylval; 402 403 /* define the initial stack-sizes */ 404 #ifdef YYSTACKSIZE 405 #undef YYMAXDEPTH 406 #define YYMAXDEPTH YYSTACKSIZE 263 407 #else 264 typedef unsigned char yytype_uint8; 265 #endif 266 267 #ifdef YYTYPE_INT8 268 typedef YYTYPE_INT8 yytype_int8; 269 #elif (defined __STDC__ || defined __C99__FUNC__ \ 270 || defined __cplusplus || defined _MSC_VER) 271 typedef signed char yytype_int8; 408 #ifdef YYMAXDEPTH 409 #define YYSTACKSIZE YYMAXDEPTH 272 410 #else 273 typedef short int yytype_int8; 274 #endif 275 276 #ifdef YYTYPE_UINT16 277 typedef YYTYPE_UINT16 yytype_uint16; 278 #else 279 typedef unsigned short int yytype_uint16; 280 #endif 281 282 #ifdef YYTYPE_INT16 283 typedef YYTYPE_INT16 yytype_int16; 284 #else 285 typedef short int yytype_int16; 286 #endif 287 288 #ifndef YYSIZE_T 289 # ifdef __SIZE_TYPE__ 290 # define YYSIZE_T __SIZE_TYPE__ 291 # elif defined size_t 292 # define YYSIZE_T size_t 293 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 294 || defined __cplusplus || defined _MSC_VER) 295 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 296 # define YYSIZE_T size_t 297 # else 298 # define YYSIZE_T unsigned int 299 # endif 300 #endif 301 302 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 303 304 #ifndef YY_ 305 # if defined YYENABLE_NLS && YYENABLE_NLS 306 # if ENABLE_NLS 307 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 308 # define YY_(msgid) dgettext ("bison-runtime", msgid) 309 # endif 310 # endif 311 # ifndef YY_ 312 # define YY_(msgid) msgid 313 # endif 314 #endif 315 316 /* Suppress unused-variable warnings by "using" E. */ 317 #if ! defined lint || defined __GNUC__ 318 # define YYUSE(e) ((void) (e)) 319 #else 320 # define YYUSE(e) /* empty */ 321 #endif 322 323 /* Identity function, used to suppress warnings about constant conditions. */ 324 #ifndef lint 325 # define YYID(n) (n) 326 #else 327 #if (defined __STDC__ || defined __C99__FUNC__ \ 328 || defined __cplusplus || defined _MSC_VER) 329 static int 330 YYID (int yyi) 331 #else 332 static int 333 YYID (yyi) 334 int yyi; 335 #endif 336 { 337 return yyi; 338 } 339 #endif 340 341 #if ! defined yyoverflow || YYERROR_VERBOSE 342 343 /* The parser invokes alloca or malloc; define the necessary symbols. */ 344 345 # ifdef YYSTACK_USE_ALLOCA 346 # if YYSTACK_USE_ALLOCA 347 # ifdef __GNUC__ 348 # define YYSTACK_ALLOC __builtin_alloca 349 # elif defined __BUILTIN_VA_ARG_INCR 350 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 351 # elif defined _AIX 352 # define YYSTACK_ALLOC __alloca 353 # elif defined _MSC_VER 354 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 355 # define alloca _alloca 356 # else 357 # define YYSTACK_ALLOC alloca 358 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 359 || defined __cplusplus || defined _MSC_VER) 360 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 361 /* Use EXIT_SUCCESS as a witness for stdlib.h. */ 362 # ifndef EXIT_SUCCESS 363 # define EXIT_SUCCESS 0 364 # endif 365 # endif 366 # endif 367 # endif 368 # endif 369 370 # ifdef YYSTACK_ALLOC 371 /* Pacify GCC's `empty if-body' warning. */ 372 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 373 # ifndef YYSTACK_ALLOC_MAXIMUM 374 /* The OS might guarantee only one guard page at the bottom of the stack, 375 and a page size can be as small as 4096 bytes. So we cannot safely 376 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 377 to allow for a few compiler-allocated temporary stack slots. */ 378 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 379 # endif 380 # else 381 # define YYSTACK_ALLOC YYMALLOC 382 # define YYSTACK_FREE YYFREE 383 # ifndef YYSTACK_ALLOC_MAXIMUM 384 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 385 # endif 386 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 387 && ! ((defined YYMALLOC || defined malloc) \ 388 && (defined YYFREE || defined free))) 389 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 390 # ifndef EXIT_SUCCESS 391 # define EXIT_SUCCESS 0 392 # endif 393 # endif 394 # ifndef YYMALLOC 395 # define YYMALLOC malloc 396 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 397 || defined __cplusplus || defined _MSC_VER) 398 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 399 # endif 400 # endif 401 # ifndef YYFREE 402 # define YYFREE free 403 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 404 || defined __cplusplus || defined _MSC_VER) 405 void free (void *); /* INFRINGES ON USER NAME SPACE */ 406 # endif 407 # endif 408 # endif 409 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 410 411 412 #if (! defined yyoverflow \ 413 && (! defined __cplusplus \ 414 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 415 416 /* A type that is properly aligned for any stack member. */ 417 union yyalloc 418 { 419 yytype_int16 yyss_alloc; 420 YYSTYPE yyvs_alloc; 421 }; 422 423 /* The size of the maximum gap between one aligned stack and the next. */ 424 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 425 426 /* The size of an array large to enough to hold all stacks, each with 427 N elements. */ 428 # define YYSTACK_BYTES(N) \ 429 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 430 + YYSTACK_GAP_MAXIMUM) 431 432 # define YYCOPY_NEEDED 1 433 434 /* Relocate STACK from its old location to the new one. The 435 local variables YYSIZE and YYSTACKSIZE give the old and new number of 436 elements in the stack, and YYPTR gives the new location of the 437 stack. Advance YYPTR to a properly aligned location for the next 438 stack. */ 439 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 440 do \ 441 { \ 442 YYSIZE_T yynewbytes; \ 443 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 444 Stack = &yyptr->Stack_alloc; \ 445 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 446 yyptr += yynewbytes / sizeof (*yyptr); \ 447 } \ 448 while (YYID (0)) 449 450 #endif 451 452 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED 453 /* Copy COUNT objects from SRC to DST. The source and destination do 454 not overlap. */ 455 # ifndef YYCOPY 456 # if defined __GNUC__ && 1 < __GNUC__ 457 # define YYCOPY(Dst, Src, Count) \ 458 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) 459 # else 460 # define YYCOPY(Dst, Src, Count) \ 461 do \ 462 { \ 463 YYSIZE_T yyi; \ 464 for (yyi = 0; yyi < (Count); yyi++) \ 465 (Dst)[yyi] = (Src)[yyi]; \ 466 } \ 467 while (YYID (0)) 468 # endif 469 # endif 470 #endif /* !YYCOPY_NEEDED */ 471 472 /* YYFINAL -- State number of the termination state. */ 473 #define YYFINAL 5 474 /* YYLAST -- Last index in YYTABLE. */ 475 #define YYLAST 48 476 477 /* YYNTOKENS -- Number of terminals. */ 478 #define YYNTOKENS 19 479 /* YYNNTS -- Number of nonterminals. */ 480 #define YYNNTS 16 481 /* YYNRULES -- Number of rules. */ 482 #define YYNRULES 34 483 /* YYNRULES -- Number of states. */ 484 #define YYNSTATES 60 485 486 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 487 #define YYUNDEFTOK 2 488 #define YYMAXUTOK 273 489 490 #define YYTRANSLATE(YYX) \ 491 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 492 493 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 494 static const yytype_uint8 yytranslate[] = 495 { 496 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 497 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 498 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 499 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 500 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 501 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 502 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 503 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 504 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 505 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 506 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 507 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 508 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 509 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 510 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 511 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 512 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 513 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 514 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 515 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 516 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 517 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 518 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 519 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 520 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 521 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 522 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 523 15, 16, 17, 18 524 }; 525 526 #if YYDEBUG 527 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 528 YYRHS. */ 529 static const yytype_uint8 yyprhs[] = 530 { 531 0, 0, 3, 4, 9, 10, 17, 18, 26, 27, 532 34, 35, 44, 45, 54, 56, 57, 60, 68, 75, 533 81, 86, 93, 97, 100, 102, 104, 106, 108, 110, 534 111, 116, 117, 124, 128 535 }; 536 537 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ 538 static const yytype_int8 yyrhs[] = 539 { 540 20, 0, -1, -1, 3, 8, 21, 27, -1, -1, 541 3, 4, 7, 8, 22, 27, -1, -1, 3, 4, 542 18, 7, 8, 23, 27, -1, -1, 3, 4, 6, 543 8, 24, 27, -1, -1, 3, 4, 6, 5, 7, 544 8, 25, 27, -1, -1, 3, 4, 6, 18, 7, 545 8, 26, 27, -1, 3, -1, -1, 27, 28, -1, 546 29, 17, 30, 17, 32, 17, 31, -1, 29, 17, 547 30, 17, 32, 17, -1, 29, 17, 30, 17, 32, 548 -1, 29, 17, 30, 17, -1, 29, 17, 30, 17, 549 17, 31, -1, 29, 17, 30, -1, 29, 17, -1, 550 29, -1, 9, -1, 10, -1, 11, -1, 12, -1, 551 -1, 13, 33, 18, 13, -1, -1, 13, 14, 34, 552 18, 13, 14, -1, 15, 18, 16, -1, 16, 18, 553 15, -1 554 }; 555 556 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 557 static const yytype_uint16 yyrline[] = 558 { 559 0, 151, 151, 150, 166, 165, 185, 184, 207, 206, 560 218, 217, 240, 239, 261, 273, 275, 287, 288, 289, 561 290, 291, 292, 293, 297, 304, 308, 312, 316, 323, 562 323, 334, 334, 345, 351 563 }; 564 #endif 565 566 #if YYDEBUG || YYERROR_VERBOSE || 0 567 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 568 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 569 static const char *const yytname[] = 570 { 571 "$end", "error", "$undefined", "DIR", "PRIORITY", "PLUS", "PRIO_BASE", 572 "PRIO_OFFSET", "ACTION", "PROTOCOL", "MODE", "LEVEL", "LEVEL_SPECIFY", 573 "IPADDRESS", "PORT", "ME", "ANY", "SLASH", "HYPHEN", "$accept", 574 "policy_spec", "$@1", "$@2", "$@3", "$@4", "$@5", "$@6", "rules", "rule", 575 "protocol", "mode", "level", "addresses", "$@7", "$@8", YY_NULL 576 }; 577 #endif 578 579 # ifdef YYPRINT 580 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 581 token YYLEX-NUM. */ 582 static const yytype_uint16 yytoknum[] = 583 { 584 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 585 265, 266, 267, 268, 269, 270, 271, 272, 273 586 }; 587 # endif 588 589 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 590 static const yytype_uint8 yyr1[] = 591 { 592 0, 19, 21, 20, 22, 20, 23, 20, 24, 20, 593 25, 20, 26, 20, 20, 27, 27, 28, 28, 28, 594 28, 28, 28, 28, 28, 29, 30, 31, 31, 33, 595 32, 34, 32, 32, 32 596 }; 597 598 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 599 static const yytype_uint8 yyr2[] = 600 { 601 0, 2, 0, 4, 0, 6, 0, 7, 0, 6, 602 0, 8, 0, 8, 1, 0, 2, 7, 6, 5, 603 4, 6, 3, 2, 1, 1, 1, 1, 1, 0, 604 4, 0, 6, 3, 3 605 }; 606 607 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. 608 Performed when YYTABLE doesn't specify something else to do. Zero 609 means the default is an error. */ 610 static const yytype_uint8 yydefact[] = 611 { 612 0, 14, 0, 0, 2, 1, 0, 0, 0, 15, 613 0, 8, 0, 4, 0, 3, 0, 15, 0, 15, 614 6, 25, 16, 24, 10, 9, 12, 5, 15, 23, 615 15, 15, 7, 26, 22, 11, 13, 20, 29, 0, 616 0, 0, 19, 31, 0, 0, 0, 27, 28, 21, 617 18, 0, 0, 33, 34, 17, 0, 30, 0, 32 618 }; 619 620 /* YYDEFGOTO[NTERM-NUM]. */ 621 static const yytype_int8 yydefgoto[] = 622 { 623 -1, 2, 9, 19, 28, 17, 30, 31, 15, 22, 624 23, 34, 49, 42, 44, 51 625 }; 626 627 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 628 STATE-NUM. */ 629 #define YYPACT_NINF -18 630 static const yytype_int8 yypact[] = 631 { 632 6, -3, 4, 1, -18, -18, -2, 2, 8, -18, 633 10, -18, 18, -18, 19, 3, 20, -18, 21, -18, 634 -18, -18, -18, 9, -18, 3, -18, 3, -18, 22, 635 -18, -18, 3, -18, 13, 3, 3, 5, 17, 15, 636 16, 12, 23, -18, 24, 25, 28, -18, -18, -18, 637 12, 26, 32, -18, -18, -18, 33, -18, 34, -18 638 }; 639 640 /* YYPGOTO[NTERM-NUM]. */ 641 static const yytype_int8 yypgoto[] = 642 { 643 -18, -18, -18, -18, -18, -18, -18, -18, -17, -18, 644 -18, -18, -15, -18, -18, -18 645 }; 646 647 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 648 positive, shift that token. If negative, reduce the rule which 649 number is the opposite. If YYTABLE_NINF, syntax error. */ 650 #define YYTABLE_NINF -1 651 static const yytype_uint8 yytable[] = 652 { 653 25, 3, 27, 10, 5, 4, 11, 6, 7, 1, 654 13, 32, 21, 35, 36, 14, 12, 16, 38, 8, 655 39, 40, 41, 47, 48, 18, 29, 20, 24, 26, 656 37, 43, 33, 45, 46, 55, 0, 0, 0, 0, 657 50, 53, 52, 54, 56, 57, 58, 0, 59 658 }; 659 660 #define yypact_value_is_default(yystate) \ 661 ((yystate) == (-18)) 662 663 #define yytable_value_is_error(yytable_value) \ 664 YYID (0) 665 666 static const yytype_int8 yycheck[] = 667 { 668 17, 4, 19, 5, 0, 8, 8, 6, 7, 3, 669 8, 28, 9, 30, 31, 7, 18, 7, 13, 18, 670 15, 16, 17, 11, 12, 7, 17, 8, 8, 8, 671 17, 14, 10, 18, 18, 50, -1, -1, -1, -1, 672 17, 16, 18, 15, 18, 13, 13, -1, 14 673 }; 674 675 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 676 symbol of state STATE-NUM. */ 677 static const yytype_uint8 yystos[] = 678 { 679 0, 3, 20, 4, 8, 0, 6, 7, 18, 21, 680 5, 8, 18, 8, 7, 27, 7, 24, 7, 22, 681 8, 9, 28, 29, 8, 27, 8, 27, 23, 17, 682 25, 26, 27, 10, 30, 27, 27, 17, 13, 15, 683 16, 17, 32, 14, 33, 18, 18, 11, 12, 31, 684 17, 34, 18, 16, 15, 31, 18, 13, 13, 14 685 }; 686 687 #define yyerrok (yyerrstatus = 0) 688 #define yyclearin (yychar = YYEMPTY) 689 #define YYEMPTY (-2) 690 #define YYEOF 0 691 692 #define YYACCEPT goto yyacceptlab 693 #define YYABORT goto yyabortlab 694 #define YYERROR goto yyerrorlab 695 696 697 /* Like YYERROR except do call yyerror. This remains here temporarily 698 to ease the transition to the new meaning of YYERROR, for GCC. 699 Once GCC version 2 has supplanted version 1, this can go. However, 700 YYFAIL appears to be in use. Nevertheless, it is formally deprecated 701 in Bison 2.4.2's NEWS entry, where a plan to phase it out is 702 discussed. */ 703 704 #define YYFAIL goto yyerrlab 705 #if defined YYFAIL 706 /* This is here to suppress warnings from the GCC cpp's 707 -Wunused-macros. Normally we don't worry about that warning, but 708 some users do, and we want to make it easy for users to remove 709 YYFAIL uses, which will produce warnings from Bison 2.5. */ 710 #endif 711 712 #define YYRECOVERING() (!!yyerrstatus) 713 714 #define YYBACKUP(Token, Value) \ 715 do \ 716 if (yychar == YYEMPTY) \ 717 { \ 718 yychar = (Token); \ 719 yylval = (Value); \ 720 YYPOPSTACK (yylen); \ 721 yystate = *yyssp; \ 722 goto yybackup; \ 723 } \ 724 else \ 725 { \ 726 yyerror (YY_("syntax error: cannot back up")); \ 727 YYERROR; \ 728 } \ 729 while (YYID (0)) 730 731 732 #define YYTERROR 1 733 #define YYERRCODE 256 734 735 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 736 If N is 0, then set CURRENT to the empty location which ends 737 the previous symbol: RHS[0] (always defined). */ 738 739 #ifndef YYLLOC_DEFAULT 740 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 741 do \ 742 if (YYID (N)) \ 743 { \ 744 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 745 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 746 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 747 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 748 } \ 749 else \ 750 { \ 751 (Current).first_line = (Current).last_line = \ 752 YYRHSLOC (Rhs, 0).last_line; \ 753 (Current).first_column = (Current).last_column = \ 754 YYRHSLOC (Rhs, 0).last_column; \ 755 } \ 756 while (YYID (0)) 757 #endif 758 759 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 760 761 762 763 /* This macro is provided for backward compatibility. */ 764 765 #ifndef YY_LOCATION_PRINT 766 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 767 #endif 768 769 770 /* YYLEX -- calling `yylex' with the right arguments. */ 771 772 #ifdef YYLEX_PARAM 773 # define YYLEX yylex (YYLEX_PARAM) 774 #else 775 # define YYLEX yylex () 776 #endif 777 778 /* Enable debugging if requested. */ 779 #if YYDEBUG 780 781 # ifndef YYFPRINTF 782 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 783 # define YYFPRINTF fprintf 784 # endif 785 786 # define YYDPRINTF(Args) \ 787 do { \ 788 if (yydebug) \ 789 YYFPRINTF Args; \ 790 } while (YYID (0)) 791 792 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 793 do { \ 794 if (yydebug) \ 795 { \ 796 YYFPRINTF (stderr, "%s ", Title); \ 797 yy_symbol_print (stderr, \ 798 Type, Value); \ 799 YYFPRINTF (stderr, "\n"); \ 800 } \ 801 } while (YYID (0)) 802 803 804 /*--------------------------------. 805 | Print this symbol on YYOUTPUT. | 806 `--------------------------------*/ 807 808 /*ARGSUSED*/ 809 #if (defined __STDC__ || defined __C99__FUNC__ \ 810 || defined __cplusplus || defined _MSC_VER) 811 static void 812 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 813 #else 814 static void 815 yy_symbol_value_print (yyoutput, yytype, yyvaluep) 816 FILE *yyoutput; 817 int yytype; 818 YYSTYPE const * const yyvaluep; 819 #endif 820 { 821 FILE *yyo = yyoutput; 822 YYUSE (yyo); 823 if (!yyvaluep) 824 return; 825 # ifdef YYPRINT 826 if (yytype < YYNTOKENS) 827 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 828 # else 829 YYUSE (yyoutput); 830 # endif 831 switch (yytype) 832 { 833 default: 834 break; 835 } 836 } 837 838 839 /*--------------------------------. 840 | Print this symbol on YYOUTPUT. | 841 `--------------------------------*/ 842 843 #if (defined __STDC__ || defined __C99__FUNC__ \ 844 || defined __cplusplus || defined _MSC_VER) 845 static void 846 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 847 #else 848 static void 849 yy_symbol_print (yyoutput, yytype, yyvaluep) 850 FILE *yyoutput; 851 int yytype; 852 YYSTYPE const * const yyvaluep; 853 #endif 854 { 855 if (yytype < YYNTOKENS) 856 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 857 else 858 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 859 860 yy_symbol_value_print (yyoutput, yytype, yyvaluep); 861 YYFPRINTF (yyoutput, ")"); 862 } 863 864 /*------------------------------------------------------------------. 865 | yy_stack_print -- Print the state stack from its BOTTOM up to its | 866 | TOP (included). | 867 `------------------------------------------------------------------*/ 868 869 #if (defined __STDC__ || defined __C99__FUNC__ \ 870 || defined __cplusplus || defined _MSC_VER) 871 static void 872 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 873 #else 874 static void 875 yy_stack_print (yybottom, yytop) 876 yytype_int16 *yybottom; 877 yytype_int16 *yytop; 878 #endif 879 { 880 YYFPRINTF (stderr, "Stack now"); 881 for (; yybottom <= yytop; yybottom++) 882 { 883 int yybot = *yybottom; 884 YYFPRINTF (stderr, " %d", yybot); 885 } 886 YYFPRINTF (stderr, "\n"); 887 } 888 889 # define YY_STACK_PRINT(Bottom, Top) \ 890 do { \ 891 if (yydebug) \ 892 yy_stack_print ((Bottom), (Top)); \ 893 } while (YYID (0)) 894 895 896 /*------------------------------------------------. 897 | Report that the YYRULE is going to be reduced. | 898 `------------------------------------------------*/ 899 900 #if (defined __STDC__ || defined __C99__FUNC__ \ 901 || defined __cplusplus || defined _MSC_VER) 902 static void 903 yy_reduce_print (YYSTYPE *yyvsp, int yyrule) 904 #else 905 static void 906 yy_reduce_print (yyvsp, yyrule) 907 YYSTYPE *yyvsp; 908 int yyrule; 909 #endif 910 { 911 int yynrhs = yyr2[yyrule]; 912 int yyi; 913 unsigned long int yylno = yyrline[yyrule]; 914 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 915 yyrule - 1, yylno); 916 /* The symbols being reduced. */ 917 for (yyi = 0; yyi < yynrhs; yyi++) 918 { 919 YYFPRINTF (stderr, " $%d = ", yyi + 1); 920 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 921 &(yyvsp[(yyi + 1) - (yynrhs)]) 922 ); 923 YYFPRINTF (stderr, "\n"); 924 } 925 } 926 927 # define YY_REDUCE_PRINT(Rule) \ 928 do { \ 929 if (yydebug) \ 930 yy_reduce_print (yyvsp, Rule); \ 931 } while (YYID (0)) 932 933 /* Nonzero means print parse trace. It is left uninitialized so that 934 multiple parsers can coexist. */ 935 int yydebug; 936 #else /* !YYDEBUG */ 937 # define YYDPRINTF(Args) 938 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 939 # define YY_STACK_PRINT(Bottom, Top) 940 # define YY_REDUCE_PRINT(Rule) 941 #endif /* !YYDEBUG */ 942 943 944 /* YYINITDEPTH -- initial size of the parser's stacks. */ 945 #ifndef YYINITDEPTH 946 # define YYINITDEPTH 200 947 #endif 948 949 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 950 if the built-in stack extension method is used). 951 952 Do not make this value too large; the results are undefined if 953 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 954 evaluated with infinite-precision integer arithmetic. */ 955 956 #ifndef YYMAXDEPTH 957 # define YYMAXDEPTH 10000 958 #endif 959 960 961 #if YYERROR_VERBOSE 962 963 # ifndef yystrlen 964 # if defined __GLIBC__ && defined _STRING_H 965 # define yystrlen strlen 966 # else 967 /* Return the length of YYSTR. */ 968 #if (defined __STDC__ || defined __C99__FUNC__ \ 969 || defined __cplusplus || defined _MSC_VER) 970 static YYSIZE_T 971 yystrlen (const char *yystr) 972 #else 973 static YYSIZE_T 974 yystrlen (yystr) 975 const char *yystr; 976 #endif 977 { 978 YYSIZE_T yylen; 979 for (yylen = 0; yystr[yylen]; yylen++) 980 continue; 981 return yylen; 982 } 983 # endif 984 # endif 985 986 # ifndef yystpcpy 987 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 988 # define yystpcpy stpcpy 989 # else 990 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 991 YYDEST. */ 992 #if (defined __STDC__ || defined __C99__FUNC__ \ 993 || defined __cplusplus || defined _MSC_VER) 994 static char * 995 yystpcpy (char *yydest, const char *yysrc) 996 #else 997 static char * 998 yystpcpy (yydest, yysrc) 999 char *yydest; 1000 const char *yysrc; 1001 #endif 1002 { 1003 char *yyd = yydest; 1004 const char *yys = yysrc; 1005 1006 while ((*yyd++ = *yys++) != '\0') 1007 continue; 1008 1009 return yyd - 1; 1010 } 1011 # endif 1012 # endif 1013 1014 # ifndef yytnamerr 1015 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary 1016 quotes and backslashes, so that it's suitable for yyerror. The 1017 heuristic is that double-quoting is unnecessary unless the string 1018 contains an apostrophe, a comma, or backslash (other than 1019 backslash-backslash). YYSTR is taken from yytname. If YYRES is 1020 null, do not copy; instead, return the length of what the result 1021 would have been. */ 1022 static YYSIZE_T 1023 yytnamerr (char *yyres, const char *yystr) 1024 { 1025 if (*yystr == '"') 1026 { 1027 YYSIZE_T yyn = 0; 1028 char const *yyp = yystr; 1029 1030 for (;;) 1031 switch (*++yyp) 1032 { 1033 case '\'': 1034 case ',': 1035 goto do_not_strip_quotes; 1036 1037 case '\\': 1038 if (*++yyp != '\\') 1039 goto do_not_strip_quotes; 1040 /* Fall through. */ 1041 default: 1042 if (yyres) 1043 yyres[yyn] = *yyp; 1044 yyn++; 1045 break; 1046 1047 case '"': 1048 if (yyres) 1049 yyres[yyn] = '\0'; 1050 return yyn; 1051 } 1052 do_not_strip_quotes: ; 1053 } 1054 1055 if (! yyres) 1056 return yystrlen (yystr); 1057 1058 return yystpcpy (yyres, yystr) - yyres; 1059 } 1060 # endif 1061 1062 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message 1063 about the unexpected token YYTOKEN for the state stack whose top is 1064 YYSSP. 1065 1066 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is 1067 not large enough to hold the message. In that case, also set 1068 *YYMSG_ALLOC to the required number of bytes. Return 2 if the 1069 required number of bytes is too large to store. */ 1070 static int 1071 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 1072 yytype_int16 *yyssp, int yytoken) 1073 { 1074 YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); 1075 YYSIZE_T yysize = yysize0; 1076 YYSIZE_T yysize1; 1077 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 1078 /* Internationalized format string. */ 1079 const char *yyformat = YY_NULL; 1080 /* Arguments of yyformat. */ 1081 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 1082 /* Number of reported tokens (one for the "unexpected", one per 1083 "expected"). */ 1084 int yycount = 0; 1085 1086 /* There are many possibilities here to consider: 1087 - Assume YYFAIL is not used. It's too flawed to consider. See 1088 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> 1089 for details. YYERROR is fine as it does not invoke this 1090 function. 1091 - If this state is a consistent state with a default action, then 1092 the only way this function was invoked is if the default action 1093 is an error action. In that case, don't check for expected 1094 tokens because there are none. 1095 - The only way there can be no lookahead present (in yychar) is if 1096 this state is a consistent state with a default action. Thus, 1097 detecting the absence of a lookahead is sufficient to determine 1098 that there is no unexpected or expected token to report. In that 1099 case, just report a simple "syntax error". 1100 - Don't assume there isn't a lookahead just because this state is a 1101 consistent state with a default action. There might have been a 1102 previous inconsistent state, consistent state with a non-default 1103 action, or user semantic action that manipulated yychar. 1104 - Of course, the expected token list depends on states to have 1105 correct lookahead information, and it depends on the parser not 1106 to perform extra reductions after fetching a lookahead from the 1107 scanner and before detecting a syntax error. Thus, state merging 1108 (from LALR or IELR) and default reductions corrupt the expected 1109 token list. However, the list is correct for canonical LR with 1110 one exception: it will still contain any token that will not be 1111 accepted due to an error action in a later state. 1112 */ 1113 if (yytoken != YYEMPTY) 1114 { 1115 int yyn = yypact[*yyssp]; 1116 yyarg[yycount++] = yytname[yytoken]; 1117 if (!yypact_value_is_default (yyn)) 1118 { 1119 /* Start YYX at -YYN if negative to avoid negative indexes in 1120 YYCHECK. In other words, skip the first -YYN actions for 1121 this state because they are default actions. */ 1122 int yyxbegin = yyn < 0 ? -yyn : 0; 1123 /* Stay within bounds of both yycheck and yytname. */ 1124 int yychecklim = YYLAST - yyn + 1; 1125 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 1126 int yyx; 1127 1128 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 1129 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR 1130 && !yytable_value_is_error (yytable[yyx + yyn])) 1131 { 1132 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 1133 { 1134 yycount = 1; 1135 yysize = yysize0; 1136 break; 1137 } 1138 yyarg[yycount++] = yytname[yyx]; 1139 yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); 1140 if (! (yysize <= yysize1 1141 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1142 return 2; 1143 yysize = yysize1; 1144 } 1145 } 1146 } 1147 1148 switch (yycount) 1149 { 1150 # define YYCASE_(N, S) \ 1151 case N: \ 1152 yyformat = S; \ 1153 break 1154 YYCASE_(0, YY_("syntax error")); 1155 YYCASE_(1, YY_("syntax error, unexpected %s")); 1156 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 1157 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 1158 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 1159 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 1160 # undef YYCASE_ 1161 } 1162 1163 yysize1 = yysize + yystrlen (yyformat); 1164 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1165 return 2; 1166 yysize = yysize1; 1167 1168 if (*yymsg_alloc < yysize) 1169 { 1170 *yymsg_alloc = 2 * yysize; 1171 if (! (yysize <= *yymsg_alloc 1172 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) 1173 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; 1174 return 1; 1175 } 1176 1177 /* Avoid sprintf, as that infringes on the user's name space. 1178 Don't have undefined behavior even if the translation 1179 produced a string with the wrong number of "%s"s. */ 1180 { 1181 char *yyp = *yymsg; 1182 int yyi = 0; 1183 while ((*yyp = *yyformat) != '\0') 1184 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) 1185 { 1186 yyp += yytnamerr (yyp, yyarg[yyi++]); 1187 yyformat += 2; 1188 } 1189 else 1190 { 1191 yyp++; 1192 yyformat++; 1193 } 1194 } 1195 return 0; 1196 } 1197 #endif /* YYERROR_VERBOSE */ 1198 1199 /*-----------------------------------------------. 1200 | Release the memory associated to this symbol. | 1201 `-----------------------------------------------*/ 1202 1203 /*ARGSUSED*/ 1204 #if (defined __STDC__ || defined __C99__FUNC__ \ 1205 || defined __cplusplus || defined _MSC_VER) 1206 static void 1207 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 1208 #else 1209 static void 1210 yydestruct (yymsg, yytype, yyvaluep) 1211 const char *yymsg; 1212 int yytype; 1213 YYSTYPE *yyvaluep; 1214 #endif 1215 { 1216 YYUSE (yyvaluep); 1217 1218 if (!yymsg) 1219 yymsg = "Deleting"; 1220 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 1221 1222 switch (yytype) 1223 { 1224 1225 default: 1226 break; 1227 } 1228 } 1229 1230 1231 1232 1233 /* The lookahead symbol. */ 1234 int yychar; 1235 1236 /* The semantic value of the lookahead symbol. */ 1237 YYSTYPE yylval; 1238 1239 /* Number of syntax errors so far. */ 1240 int yynerrs; 1241 1242 1243 /*----------. 1244 | yyparse. | 1245 `----------*/ 1246 1247 #ifdef YYPARSE_PARAM 1248 #if (defined __STDC__ || defined __C99__FUNC__ \ 1249 || defined __cplusplus || defined _MSC_VER) 1250 int 1251 yyparse (void *YYPARSE_PARAM) 1252 #else 1253 int 1254 yyparse (YYPARSE_PARAM) 1255 void *YYPARSE_PARAM; 1256 #endif 1257 #else /* ! YYPARSE_PARAM */ 1258 #if (defined __STDC__ || defined __C99__FUNC__ \ 1259 || defined __cplusplus || defined _MSC_VER) 1260 int 1261 yyparse (void) 1262 #else 1263 int 1264 yyparse () 1265 1266 #endif 1267 #endif 1268 { 1269 int yystate; 1270 /* Number of tokens to shift before error messages enabled. */ 1271 int yyerrstatus; 1272 1273 /* The stacks and their tools: 1274 `yyss': related to states. 1275 `yyvs': related to semantic values. 1276 1277 Refer to the stacks through separate pointers, to allow yyoverflow 1278 to reallocate them elsewhere. */ 1279 1280 /* The state stack. */ 1281 yytype_int16 yyssa[YYINITDEPTH]; 1282 yytype_int16 *yyss; 1283 yytype_int16 *yyssp; 1284 1285 /* The semantic value stack. */ 1286 YYSTYPE yyvsa[YYINITDEPTH]; 1287 YYSTYPE *yyvs; 1288 YYSTYPE *yyvsp; 1289 1290 YYSIZE_T yystacksize; 1291 1292 int yyn; 1293 int yyresult; 1294 /* Lookahead token as an internal (translated) token number. */ 1295 int yytoken; 1296 /* The variables used to return semantic value and location from the 1297 action routines. */ 1298 YYSTYPE yyval; 1299 1300 #if YYERROR_VERBOSE 1301 /* Buffer for error messages, and its allocated size. */ 1302 char yymsgbuf[128]; 1303 char *yymsg = yymsgbuf; 1304 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 1305 #endif 1306 1307 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1308 1309 /* The number of symbols on the RHS of the reduced rule. 1310 Keep to zero when no symbol should be popped. */ 1311 int yylen = 0; 1312 1313 yytoken = 0; 1314 yyss = yyssa; 1315 yyvs = yyvsa; 1316 yystacksize = YYINITDEPTH; 1317 1318 YYDPRINTF ((stderr, "Starting parse\n")); 1319 1320 yystate = 0; 1321 yyerrstatus = 0; 1322 yynerrs = 0; 1323 yychar = YYEMPTY; /* Cause a token to be read. */ 1324 1325 /* Initialize stack pointers. 1326 Waste one element of value and location stack 1327 so that they stay on the same level as the state stack. 1328 The wasted elements are never initialized. */ 1329 yyssp = yyss; 1330 yyvsp = yyvs; 1331 goto yysetstate; 1332 1333 /*------------------------------------------------------------. 1334 | yynewstate -- Push a new state, which is found in yystate. | 1335 `------------------------------------------------------------*/ 1336 yynewstate: 1337 /* In all cases, when you get here, the value and location stacks 1338 have just been pushed. So pushing a state here evens the stacks. */ 1339 yyssp++; 1340 1341 yysetstate: 1342 *yyssp = yystate; 1343 1344 if (yyss + yystacksize - 1 <= yyssp) 1345 { 1346 /* Get the current used size of the three stacks, in elements. */ 1347 YYSIZE_T yysize = yyssp - yyss + 1; 1348 1349 #ifdef yyoverflow 1350 { 1351 /* Give user a chance to reallocate the stack. Use copies of 1352 these so that the &'s don't force the real ones into 1353 memory. */ 1354 YYSTYPE *yyvs1 = yyvs; 1355 yytype_int16 *yyss1 = yyss; 1356 1357 /* Each stack pointer address is followed by the size of the 1358 data in use in that stack, in bytes. This used to be a 1359 conditional around just the two extra args, but that might 1360 be undefined if yyoverflow is a macro. */ 1361 yyoverflow (YY_("memory exhausted"), 1362 &yyss1, yysize * sizeof (*yyssp), 1363 &yyvs1, yysize * sizeof (*yyvsp), 1364 &yystacksize); 1365 1366 yyss = yyss1; 1367 yyvs = yyvs1; 1368 } 1369 #else /* no yyoverflow */ 1370 # ifndef YYSTACK_RELOCATE 1371 goto yyexhaustedlab; 1372 # else 1373 /* Extend the stack our own way. */ 1374 if (YYMAXDEPTH <= yystacksize) 1375 goto yyexhaustedlab; 1376 yystacksize *= 2; 1377 if (YYMAXDEPTH < yystacksize) 1378 yystacksize = YYMAXDEPTH; 1379 1380 { 1381 yytype_int16 *yyss1 = yyss; 1382 union yyalloc *yyptr = 1383 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1384 if (! yyptr) 1385 goto yyexhaustedlab; 1386 YYSTACK_RELOCATE (yyss_alloc, yyss); 1387 YYSTACK_RELOCATE (yyvs_alloc, yyvs); 1388 # undef YYSTACK_RELOCATE 1389 if (yyss1 != yyssa) 1390 YYSTACK_FREE (yyss1); 1391 } 1392 # endif 1393 #endif /* no yyoverflow */ 1394 1395 yyssp = yyss + yysize - 1; 1396 yyvsp = yyvs + yysize - 1; 1397 1398 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1399 (unsigned long int) yystacksize)); 1400 1401 if (yyss + yystacksize - 1 <= yyssp) 1402 YYABORT; 1403 } 1404 1405 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1406 1407 if (yystate == YYFINAL) 1408 YYACCEPT; 1409 1410 goto yybackup; 1411 1412 /*-----------. 1413 | yybackup. | 1414 `-----------*/ 1415 yybackup: 1416 1417 /* Do appropriate processing given the current state. Read a 1418 lookahead token if we need one and don't already have one. */ 1419 1420 /* First try to decide what to do without reference to lookahead token. */ 1421 yyn = yypact[yystate]; 1422 if (yypact_value_is_default (yyn)) 1423 goto yydefault; 1424 1425 /* Not known => get a lookahead token if don't already have one. */ 1426 1427 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 1428 if (yychar == YYEMPTY) 1429 { 1430 YYDPRINTF ((stderr, "Reading a token: ")); 1431 yychar = YYLEX; 1432 } 1433 1434 if (yychar <= YYEOF) 1435 { 1436 yychar = yytoken = YYEOF; 1437 YYDPRINTF ((stderr, "Now at end of input.\n")); 1438 } 1439 else 1440 { 1441 yytoken = YYTRANSLATE (yychar); 1442 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 1443 } 1444 1445 /* If the proper action on seeing token YYTOKEN is to reduce or to 1446 detect an error, take that action. */ 1447 yyn += yytoken; 1448 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 1449 goto yydefault; 1450 yyn = yytable[yyn]; 1451 if (yyn <= 0) 1452 { 1453 if (yytable_value_is_error (yyn)) 1454 goto yyerrlab; 1455 yyn = -yyn; 1456 goto yyreduce; 1457 } 1458 1459 /* Count tokens shifted since error; after three, turn off error 1460 status. */ 1461 if (yyerrstatus) 1462 yyerrstatus--; 1463 1464 /* Shift the lookahead token. */ 1465 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1466 1467 /* Discard the shifted token. */ 1468 yychar = YYEMPTY; 1469 1470 yystate = yyn; 1471 *++yyvsp = yylval; 1472 1473 goto yynewstate; 1474 1475 1476 /*-----------------------------------------------------------. 1477 | yydefault -- do the default action for the current state. | 1478 `-----------------------------------------------------------*/ 1479 yydefault: 1480 yyn = yydefact[yystate]; 1481 if (yyn == 0) 1482 goto yyerrlab; 1483 goto yyreduce; 1484 1485 1486 /*-----------------------------. 1487 | yyreduce -- Do a reduction. | 1488 `-----------------------------*/ 1489 yyreduce: 1490 /* yyn is the number of a rule to reduce with. */ 1491 yylen = yyr2[yyn]; 1492 1493 /* If YYLEN is nonzero, implement the default value of the action: 1494 `$$ = $1'. 1495 1496 Otherwise, the following line sets YYVAL to garbage. 1497 This behavior is undocumented and Bison 1498 users should not rely upon it. Assigning to YYVAL 1499 unconditionally makes the parser a bit smaller, and it avoids a 1500 GCC warning that YYVAL may be used uninitialized. */ 1501 yyval = yyvsp[1-yylen]; 1502 1503 1504 YY_REDUCE_PRINT (yyn); 1505 switch (yyn) 1506 { 1507 case 2: 1508 /* Line 1787 of yacc.c */ 1509 #line 151 "policy_parse.y" 1510 { 1511 p_dir = (yyvsp[(1) - (2)].num); 1512 p_type = (yyvsp[(2) - (2)].num); 1513 1514 #ifdef HAVE_PFKEY_POLICY_PRIORITY 1515 p_priority = PRIORITY_DEFAULT; 1516 #else 1517 p_priority = 0; 1518 #endif 1519 1520 if (init_x_policy()) 1521 return -1; 1522 } 1523 break; 1524 1525 case 4: 1526 /* Line 1787 of yacc.c */ 1527 #line 166 "policy_parse.y" 1528 { 1529 p_dir = (yyvsp[(1) - (4)].num); 1530 p_type = (yyvsp[(4) - (4)].num); 1531 p_priority_offset = -atol((yyvsp[(3) - (4)].val).buf); 1532 1533 errno = 0; 1534 if (errno != 0 || p_priority_offset < INT32_MIN) 1535 { 1536 __ipsec_errcode = EIPSEC_INVAL_PRIORITY_OFFSET; 1537 return -1; 1538 } 1539 1540 p_priority = PRIORITY_DEFAULT + (u_int32_t) p_priority_offset; 1541 1542 if (init_x_policy()) 1543 return -1; 1544 } 1545 break; 1546 1547 case 6: 1548 /* Line 1787 of yacc.c */ 1549 #line 185 "policy_parse.y" 1550 { 1551 p_dir = (yyvsp[(1) - (5)].num); 1552 p_type = (yyvsp[(5) - (5)].num); 1553 1554 errno = 0; 1555 p_priority_offset = atol((yyvsp[(4) - (5)].val).buf); 1556 1557 if (errno != 0 || p_priority_offset > INT32_MAX) 1558 { 1559 __ipsec_errcode = EIPSEC_INVAL_PRIORITY_OFFSET; 1560 return -1; 1561 } 1562 1563 /* negative input value means lower priority, therefore higher 1564 actual value so that is closer to the end of the list */ 1565 p_priority = PRIORITY_DEFAULT + (u_int32_t) p_priority_offset; 1566 1567 if (init_x_policy()) 1568 return -1; 1569 } 1570 break; 1571 1572 case 8: 1573 /* Line 1787 of yacc.c */ 1574 #line 207 "policy_parse.y" 1575 { 1576 p_dir = (yyvsp[(1) - (4)].num); 1577 p_type = (yyvsp[(4) - (4)].num); 1578 1579 p_priority = (yyvsp[(3) - (4)].num32); 1580 1581 if (init_x_policy()) 1582 return -1; 1583 } 1584 break; 1585 1586 case 10: 1587 /* Line 1787 of yacc.c */ 1588 #line 218 "policy_parse.y" 1589 { 1590 p_dir = (yyvsp[(1) - (6)].num); 1591 p_type = (yyvsp[(6) - (6)].num); 1592 1593 errno = 0; 1594 p_priority_offset = atol((yyvsp[(5) - (6)].val).buf); 1595 1596 if (errno != 0 || p_priority_offset > PRIORITY_OFFSET_NEGATIVE_MAX) 1597 { 1598 __ipsec_errcode = EIPSEC_INVAL_PRIORITY_BASE_OFFSET; 1599 return -1; 1600 } 1601 1602 /* adding value means higher priority, therefore lower 1603 actual value so that is closer to the beginning of the list */ 1604 p_priority = (yyvsp[(3) - (6)].num32) - (u_int32_t) p_priority_offset; 1605 1606 if (init_x_policy()) 1607 return -1; 1608 } 1609 break; 1610 1611 case 12: 1612 /* Line 1787 of yacc.c */ 1613 #line 240 "policy_parse.y" 1614 { 1615 p_dir = (yyvsp[(1) - (6)].num); 1616 p_type = (yyvsp[(6) - (6)].num); 1617 1618 errno = 0; 1619 p_priority_offset = atol((yyvsp[(5) - (6)].val).buf); 1620 1621 if (errno != 0 || p_priority_offset > PRIORITY_OFFSET_POSITIVE_MAX) 1622 { 1623 __ipsec_errcode = EIPSEC_INVAL_PRIORITY_BASE_OFFSET; 1624 return -1; 1625 } 1626 1627 /* subtracting value means lower priority, therefore higher 1628 actual value so that is closer to the end of the list */ 1629 p_priority = (yyvsp[(3) - (6)].num32) + (u_int32_t) p_priority_offset; 1630 1631 if (init_x_policy()) 1632 return -1; 1633 } 1634 break; 1635 1636 case 14: 1637 /* Line 1787 of yacc.c */ 1638 #line 262 "policy_parse.y" 1639 { 1640 p_dir = (yyvsp[(1) - (1)].num); 1641 p_type = 0; /* ignored it by kernel */ 1642 1643 p_priority = 0; 1644 1645 if (init_x_policy()) 1646 return -1; 1647 } 1648 break; 1649 1650 case 16: 1651 /* Line 1787 of yacc.c */ 1652 #line 275 "policy_parse.y" 1653 { 1654 if (rule_check() < 0) 1655 return -1; 1656 1657 if (set_x_request(p_src, p_dst) < 0) 1658 return -1; 1659 1660 policy_parse_request_init(); 1661 } 1662 break; 1663 1664 case 23: 1665 /* Line 1787 of yacc.c */ 1666 #line 293 "policy_parse.y" 1667 { 1668 __ipsec_errcode = EIPSEC_FEW_ARGUMENTS; 1669 return -1; 1670 } 1671 break; 1672 1673 case 24: 1674 /* Line 1787 of yacc.c */ 1675 #line 297 "policy_parse.y" 1676 { 1677 __ipsec_errcode = EIPSEC_FEW_ARGUMENTS; 1678 return -1; 1679 } 1680 break; 1681 1682 case 25: 1683 /* Line 1787 of yacc.c */ 1684 #line 304 "policy_parse.y" 1685 { p_protocol = (yyvsp[(1) - (1)].num); } 1686 break; 1687 1688 case 26: 1689 /* Line 1787 of yacc.c */ 1690 #line 308 "policy_parse.y" 1691 { p_mode = (yyvsp[(1) - (1)].num); } 1692 break; 1693 1694 case 27: 1695 /* Line 1787 of yacc.c */ 1696 #line 312 "policy_parse.y" 1697 { 1698 p_level = (yyvsp[(1) - (1)].num); 1699 p_reqid = 0; 1700 } 1701 break; 1702 1703 case 28: 1704 /* Line 1787 of yacc.c */ 1705 #line 316 "policy_parse.y" 1706 { 1707 p_level = IPSEC_LEVEL_UNIQUE; 1708 p_reqid = atol((yyvsp[(1) - (1)].val).buf); /* atol() is good. */ 1709 } 1710 break; 1711 1712 case 29: 1713 /* Line 1787 of yacc.c */ 1714 #line 323 "policy_parse.y" 1715 { 1716 p_src = parse_sockaddr(&(yyvsp[(1) - (1)].val), NULL); 1717 if (p_src == NULL) 1718 return -1; 1719 } 1720 break; 1721 1722 case 30: 1723 /* Line 1787 of yacc.c */ 1724 #line 329 "policy_parse.y" 1725 { 1726 p_dst = parse_sockaddr(&(yyvsp[(4) - (4)].val), NULL); 1727 if (p_dst == NULL) 1728 return -1; 1729 } 1730 break; 1731 1732 case 31: 1733 /* Line 1787 of yacc.c */ 1734 #line 334 "policy_parse.y" 1735 { 1736 p_src = parse_sockaddr(&(yyvsp[(1) - (2)].val), &(yyvsp[(2) - (2)].val)); 1737 if (p_src == NULL) 1738 return -1; 1739 } 1740 break; 1741 1742 case 32: 1743 /* Line 1787 of yacc.c */ 1744 #line 340 "policy_parse.y" 1745 { 1746 p_dst = parse_sockaddr(&(yyvsp[(5) - (6)].val), &(yyvsp[(6) - (6)].val)); 1747 if (p_dst == NULL) 1748 return -1; 1749 } 1750 break; 1751 1752 case 33: 1753 /* Line 1787 of yacc.c */ 1754 #line 345 "policy_parse.y" 1755 { 1756 if (p_dir != IPSEC_DIR_OUTBOUND) { 1757 __ipsec_errcode = EIPSEC_INVAL_DIR; 1758 return -1; 1759 } 1760 } 1761 break; 1762 1763 case 34: 1764 /* Line 1787 of yacc.c */ 1765 #line 351 "policy_parse.y" 1766 { 1767 if (p_dir != IPSEC_DIR_INBOUND) { 1768 __ipsec_errcode = EIPSEC_INVAL_DIR; 1769 return -1; 1770 } 1771 } 1772 break; 1773 1774 1775 /* Line 1787 of yacc.c */ 1776 #line 1777 "policy_parse.c" 1777 default: break; 1778 } 1779 /* User semantic actions sometimes alter yychar, and that requires 1780 that yytoken be updated with the new translation. We take the 1781 approach of translating immediately before every use of yytoken. 1782 One alternative is translating here after every semantic action, 1783 but that translation would be missed if the semantic action invokes 1784 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 1785 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an 1786 incorrect destructor might then be invoked immediately. In the 1787 case of YYERROR or YYBACKUP, subsequent parser actions might lead 1788 to an incorrect destructor call or verbose syntax error message 1789 before the lookahead is translated. */ 1790 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 1791 1792 YYPOPSTACK (yylen); 1793 yylen = 0; 1794 YY_STACK_PRINT (yyss, yyssp); 1795 1796 *++yyvsp = yyval; 1797 1798 /* Now `shift' the result of the reduction. Determine what state 1799 that goes to, based on the state we popped back to and the rule 1800 number reduced by. */ 1801 1802 yyn = yyr1[yyn]; 1803 1804 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 1805 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 1806 yystate = yytable[yystate]; 1807 else 1808 yystate = yydefgoto[yyn - YYNTOKENS]; 1809 1810 goto yynewstate; 1811 1812 1813 /*------------------------------------. 1814 | yyerrlab -- here on detecting error | 1815 `------------------------------------*/ 1816 yyerrlab: 1817 /* Make sure we have latest lookahead translation. See comments at 1818 user semantic actions for why this is necessary. */ 1819 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); 1820 1821 /* If not already recovering from an error, report this error. */ 1822 if (!yyerrstatus) 1823 { 1824 ++yynerrs; 1825 #if ! YYERROR_VERBOSE 1826 yyerror (YY_("syntax error")); 1827 #else 1828 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 1829 yyssp, yytoken) 1830 { 1831 char const *yymsgp = YY_("syntax error"); 1832 int yysyntax_error_status; 1833 yysyntax_error_status = YYSYNTAX_ERROR; 1834 if (yysyntax_error_status == 0) 1835 yymsgp = yymsg; 1836 else if (yysyntax_error_status == 1) 1837 { 1838 if (yymsg != yymsgbuf) 1839 YYSTACK_FREE (yymsg); 1840 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); 1841 if (!yymsg) 1842 { 1843 yymsg = yymsgbuf; 1844 yymsg_alloc = sizeof yymsgbuf; 1845 yysyntax_error_status = 2; 1846 } 1847 else 1848 { 1849 yysyntax_error_status = YYSYNTAX_ERROR; 1850 yymsgp = yymsg; 1851 } 1852 } 1853 yyerror (yymsgp); 1854 if (yysyntax_error_status == 2) 1855 goto yyexhaustedlab; 1856 } 1857 # undef YYSYNTAX_ERROR 1858 #endif 1859 } 1860 1861 1862 1863 if (yyerrstatus == 3) 1864 { 1865 /* If just tried and failed to reuse lookahead token after an 1866 error, discard it. */ 1867 1868 if (yychar <= YYEOF) 1869 { 1870 /* Return failure if at end of input. */ 1871 if (yychar == YYEOF) 1872 YYABORT; 1873 } 1874 else 1875 { 1876 yydestruct ("Error: discarding", 1877 yytoken, &yylval); 1878 yychar = YYEMPTY; 1879 } 1880 } 1881 1882 /* Else will try to reuse lookahead token after shifting the error 1883 token. */ 1884 goto yyerrlab1; 1885 1886 1887 /*---------------------------------------------------. 1888 | yyerrorlab -- error raised explicitly by YYERROR. | 1889 `---------------------------------------------------*/ 1890 yyerrorlab: 1891 1892 /* Pacify compilers like GCC when the user code never invokes 1893 YYERROR and the label yyerrorlab therefore never appears in user 1894 code. */ 1895 if (/*CONSTCOND*/ 0) 1896 goto yyerrorlab; 1897 1898 /* Do not reclaim the symbols of the rule which action triggered 1899 this YYERROR. */ 1900 YYPOPSTACK (yylen); 1901 yylen = 0; 1902 YY_STACK_PRINT (yyss, yyssp); 1903 yystate = *yyssp; 1904 goto yyerrlab1; 1905 1906 1907 /*-------------------------------------------------------------. 1908 | yyerrlab1 -- common code for both syntax error and YYERROR. | 1909 `-------------------------------------------------------------*/ 1910 yyerrlab1: 1911 yyerrstatus = 3; /* Each real token shifted decrements this. */ 1912 1913 for (;;) 1914 { 1915 yyn = yypact[yystate]; 1916 if (!yypact_value_is_default (yyn)) 1917 { 1918 yyn += YYTERROR; 1919 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 1920 { 1921 yyn = yytable[yyn]; 1922 if (0 < yyn) 1923 break; 1924 } 1925 } 1926 1927 /* Pop the current state because it cannot handle the error token. */ 1928 if (yyssp == yyss) 1929 YYABORT; 1930 1931 1932 yydestruct ("Error: popping", 1933 yystos[yystate], yyvsp); 1934 YYPOPSTACK (1); 1935 yystate = *yyssp; 1936 YY_STACK_PRINT (yyss, yyssp); 1937 } 1938 1939 *++yyvsp = yylval; 1940 1941 1942 /* Shift the error token. */ 1943 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 1944 1945 yystate = yyn; 1946 goto yynewstate; 1947 1948 1949 /*-------------------------------------. 1950 | yyacceptlab -- YYACCEPT comes here. | 1951 `-------------------------------------*/ 1952 yyacceptlab: 1953 yyresult = 0; 1954 goto yyreturn; 1955 1956 /*-----------------------------------. 1957 | yyabortlab -- YYABORT comes here. | 1958 `-----------------------------------*/ 1959 yyabortlab: 1960 yyresult = 1; 1961 goto yyreturn; 1962 1963 #if !defined yyoverflow || YYERROR_VERBOSE 1964 /*-------------------------------------------------. 1965 | yyexhaustedlab -- memory exhaustion comes here. | 1966 `-------------------------------------------------*/ 1967 yyexhaustedlab: 1968 yyerror (YY_("memory exhausted")); 1969 yyresult = 2; 1970 /* Fall through. */ 1971 #endif 1972 1973 yyreturn: 1974 if (yychar != YYEMPTY) 1975 { 1976 /* Make sure we have latest lookahead translation. See comments at 1977 user semantic actions for why this is necessary. */ 1978 yytoken = YYTRANSLATE (yychar); 1979 yydestruct ("Cleanup: discarding lookahead", 1980 yytoken, &yylval); 1981 } 1982 /* Do not reclaim the symbols of the rule which action triggered 1983 this YYABORT or YYACCEPT. */ 1984 YYPOPSTACK (yylen); 1985 YY_STACK_PRINT (yyss, yyssp); 1986 while (yyssp != yyss) 1987 { 1988 yydestruct ("Cleanup: popping", 1989 yystos[*yyssp], yyvsp); 1990 YYPOPSTACK (1); 1991 } 1992 #ifndef yyoverflow 1993 if (yyss != yyssa) 1994 YYSTACK_FREE (yyss); 1995 #endif 1996 #if YYERROR_VERBOSE 1997 if (yymsg != yymsgbuf) 1998 YYSTACK_FREE (yymsg); 1999 #endif 2000 /* Make sure YYID is used. */ 2001 return YYID (yyresult); 2002 } 2003 2004 2005 /* Line 2048 of yacc.c */ 2006 #line 362 "policy_parse.y" 2007 411 #define YYSTACKSIZE 10000 412 #define YYMAXDEPTH 10000 413 #endif 414 #endif 415 416 #define YYINITSTACKSIZE 200 417 418 typedef struct { 419 unsigned stacksize; 420 YYINT *s_base; 421 YYINT *s_mark; 422 YYINT *s_last; 423 YYSTYPE *l_base; 424 YYSTYPE *l_mark; 425 } YYSTACKDATA; 426 /* variables for the parser stack */ 427 static YYSTACKDATA yystack; 428 #line 366 "../../ipsec-tools/src/libipsec/policy_parse.y" 2008 429 2009 430 void … … 2246 667 error = yyparse(); /* it must be set errcode. */ 2247 668 __policy__strbuffer__free__(); 669 #ifdef __rtems__ 670 /* This frees the p_src and p_dst buffers. */ 671 policy_parse_request_init(); 672 #endif /* __rtems__ */ 2248 673 2249 674 if (error) { … … 2278 703 return policy; 2279 704 } 705 #ifdef __rtems__ 706 707 void 708 ipsec_free_policy(ipsec_policy_t buf) 709 { 710 free(buf); 711 } 712 #endif /* __rtems__ */ 713 #line 714 "__libipsec.tab.c" 714 715 #if YYDEBUG 716 #include <stdio.h> /* needed for printf */ 717 #endif 718 719 #include <stdlib.h> /* needed for malloc, etc */ 720 #include <string.h> /* needed for memset */ 721 722 /* allocate initial stack or double stack size, up to YYMAXDEPTH */ 723 static int yygrowstack(YYSTACKDATA *data) 724 { 725 int i; 726 unsigned newsize; 727 YYINT *newss; 728 YYSTYPE *newvs; 729 730 if ((newsize = data->stacksize) == 0) 731 newsize = YYINITSTACKSIZE; 732 else if (newsize >= YYMAXDEPTH) 733 return YYENOMEM; 734 else if ((newsize *= 2) > YYMAXDEPTH) 735 newsize = YYMAXDEPTH; 736 737 i = (int) (data->s_mark - data->s_base); 738 newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); 739 if (newss == 0) 740 return YYENOMEM; 741 742 data->s_base = newss; 743 data->s_mark = newss + i; 744 745 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); 746 if (newvs == 0) 747 return YYENOMEM; 748 749 data->l_base = newvs; 750 data->l_mark = newvs + i; 751 752 data->stacksize = newsize; 753 data->s_last = data->s_base + newsize - 1; 754 return 0; 755 } 756 757 #if YYPURE || defined(YY_NO_LEAKS) 758 static void yyfreestack(YYSTACKDATA *data) 759 { 760 free(data->s_base); 761 free(data->l_base); 762 memset(data, 0, sizeof(*data)); 763 } 764 #else 765 #define yyfreestack(data) /* nothing */ 766 #endif 767 768 #define YYABORT goto yyabort 769 #define YYREJECT goto yyabort 770 #define YYACCEPT goto yyaccept 771 #define YYERROR goto yyerrlab 772 773 int 774 YYPARSE_DECL() 775 { 776 int yym, yyn, yystate; 777 #if YYDEBUG 778 const char *yys; 779 780 if ((yys = getenv("YYDEBUG")) != 0) 781 { 782 yyn = *yys; 783 if (yyn >= '0' && yyn <= '9') 784 yydebug = yyn - '0'; 785 } 786 #endif 787 788 yym = 0; 789 yyn = 0; 790 yynerrs = 0; 791 yyerrflag = 0; 792 yychar = YYEMPTY; 793 yystate = 0; 794 795 #if YYPURE 796 memset(&yystack, 0, sizeof(yystack)); 797 #endif 798 799 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 800 yystack.s_mark = yystack.s_base; 801 yystack.l_mark = yystack.l_base; 802 yystate = 0; 803 *yystack.s_mark = 0; 804 805 yyloop: 806 if ((yyn = yydefred[yystate]) != 0) goto yyreduce; 807 if (yychar < 0) 808 { 809 yychar = YYLEX; 810 if (yychar < 0) yychar = YYEOF; 811 #if YYDEBUG 812 if (yydebug) 813 { 814 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 815 printf("%sdebug: state %d, reading %d (%s)\n", 816 YYPREFIX, yystate, yychar, yys); 817 } 818 #endif 819 } 820 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 && 821 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 822 { 823 #if YYDEBUG 824 if (yydebug) 825 printf("%sdebug: state %d, shifting to state %d\n", 826 YYPREFIX, yystate, yytable[yyn]); 827 #endif 828 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 829 yystate = yytable[yyn]; 830 *++yystack.s_mark = yytable[yyn]; 831 *++yystack.l_mark = yylval; 832 yychar = YYEMPTY; 833 if (yyerrflag > 0) --yyerrflag; 834 goto yyloop; 835 } 836 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 && 837 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 838 { 839 yyn = yytable[yyn]; 840 goto yyreduce; 841 } 842 if (yyerrflag != 0) goto yyinrecovery; 843 844 YYERROR_CALL("syntax error"); 845 846 goto yyerrlab; /* redundant goto avoids 'unused label' warning */ 847 yyerrlab: 848 ++yynerrs; 849 850 yyinrecovery: 851 if (yyerrflag < 3) 852 { 853 yyerrflag = 3; 854 for (;;) 855 { 856 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 && 857 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE) 858 { 859 #if YYDEBUG 860 if (yydebug) 861 printf("%sdebug: state %d, error recovery shifting\ 862 to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); 863 #endif 864 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 865 yystate = yytable[yyn]; 866 *++yystack.s_mark = yytable[yyn]; 867 *++yystack.l_mark = yylval; 868 goto yyloop; 869 } 870 else 871 { 872 #if YYDEBUG 873 if (yydebug) 874 printf("%sdebug: error recovery discarding state %d\n", 875 YYPREFIX, *yystack.s_mark); 876 #endif 877 if (yystack.s_mark <= yystack.s_base) goto yyabort; 878 --yystack.s_mark; 879 --yystack.l_mark; 880 } 881 } 882 } 883 else 884 { 885 if (yychar == YYEOF) goto yyabort; 886 #if YYDEBUG 887 if (yydebug) 888 { 889 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 890 printf("%sdebug: state %d, error recovery discards token %d (%s)\n", 891 YYPREFIX, yystate, yychar, yys); 892 } 893 #endif 894 yychar = YYEMPTY; 895 goto yyloop; 896 } 897 898 yyreduce: 899 #if YYDEBUG 900 if (yydebug) 901 printf("%sdebug: state %d, reducing by rule %d (%s)\n", 902 YYPREFIX, yystate, yyn, yyrule[yyn]); 903 #endif 904 yym = yylen[yyn]; 905 if (yym > 0) 906 yyval = yystack.l_mark[1-yym]; 907 else 908 memset(&yyval, 0, sizeof yyval); 909 910 switch (yyn) 911 { 912 case 1: 913 #line 154 "../../ipsec-tools/src/libipsec/policy_parse.y" 914 { 915 p_dir = yystack.l_mark[-1].num; 916 p_type = yystack.l_mark[0].num; 917 918 #ifdef HAVE_PFKEY_POLICY_PRIORITY 919 p_priority = PRIORITY_DEFAULT; 920 #else 921 p_priority = 0; 922 #endif 923 924 if (init_x_policy()) 925 return -1; 926 } 927 break; 928 case 3: 929 #line 169 "../../ipsec-tools/src/libipsec/policy_parse.y" 930 { 931 p_dir = yystack.l_mark[-3].num; 932 p_type = yystack.l_mark[0].num; 933 p_priority_offset = -atol(yystack.l_mark[-1].val.buf); 934 935 errno = 0; 936 if (errno != 0 || p_priority_offset < INT32_MIN) 937 { 938 __ipsec_errcode = EIPSEC_INVAL_PRIORITY_OFFSET; 939 return -1; 940 } 941 942 p_priority = PRIORITY_DEFAULT + (u_int32_t) p_priority_offset; 943 944 if (init_x_policy()) 945 return -1; 946 } 947 break; 948 case 5: 949 #line 188 "../../ipsec-tools/src/libipsec/policy_parse.y" 950 { 951 p_dir = yystack.l_mark[-4].num; 952 p_type = yystack.l_mark[0].num; 953 954 errno = 0; 955 p_priority_offset = atol(yystack.l_mark[-1].val.buf); 956 957 if (errno != 0 || p_priority_offset > INT32_MAX) 958 { 959 __ipsec_errcode = EIPSEC_INVAL_PRIORITY_OFFSET; 960 return -1; 961 } 962 963 /* negative input value means lower priority, therefore higher 964 actual value so that is closer to the end of the list */ 965 p_priority = PRIORITY_DEFAULT + (u_int32_t) p_priority_offset; 966 967 if (init_x_policy()) 968 return -1; 969 } 970 break; 971 case 7: 972 #line 210 "../../ipsec-tools/src/libipsec/policy_parse.y" 973 { 974 p_dir = yystack.l_mark[-3].num; 975 p_type = yystack.l_mark[0].num; 976 977 p_priority = yystack.l_mark[-1].num32; 978 979 if (init_x_policy()) 980 return -1; 981 } 982 break; 983 case 9: 984 #line 221 "../../ipsec-tools/src/libipsec/policy_parse.y" 985 { 986 p_dir = yystack.l_mark[-5].num; 987 p_type = yystack.l_mark[0].num; 988 989 errno = 0; 990 p_priority_offset = atol(yystack.l_mark[-1].val.buf); 991 992 if (errno != 0 || p_priority_offset > PRIORITY_OFFSET_NEGATIVE_MAX) 993 { 994 __ipsec_errcode = EIPSEC_INVAL_PRIORITY_BASE_OFFSET; 995 return -1; 996 } 997 998 /* adding value means higher priority, therefore lower 999 actual value so that is closer to the beginning of the list */ 1000 p_priority = yystack.l_mark[-3].num32 - (u_int32_t) p_priority_offset; 1001 1002 if (init_x_policy()) 1003 return -1; 1004 } 1005 break; 1006 case 11: 1007 #line 243 "../../ipsec-tools/src/libipsec/policy_parse.y" 1008 { 1009 p_dir = yystack.l_mark[-5].num; 1010 p_type = yystack.l_mark[0].num; 1011 1012 errno = 0; 1013 p_priority_offset = atol(yystack.l_mark[-1].val.buf); 1014 1015 if (errno != 0 || p_priority_offset > PRIORITY_OFFSET_POSITIVE_MAX) 1016 { 1017 __ipsec_errcode = EIPSEC_INVAL_PRIORITY_BASE_OFFSET; 1018 return -1; 1019 } 1020 1021 /* subtracting value means lower priority, therefore higher 1022 actual value so that is closer to the end of the list */ 1023 p_priority = yystack.l_mark[-3].num32 + (u_int32_t) p_priority_offset; 1024 1025 if (init_x_policy()) 1026 return -1; 1027 } 1028 break; 1029 case 13: 1030 #line 265 "../../ipsec-tools/src/libipsec/policy_parse.y" 1031 { 1032 p_dir = yystack.l_mark[0].num; 1033 p_type = 0; /* ignored it by kernel */ 1034 1035 p_priority = 0; 1036 1037 if (init_x_policy()) 1038 return -1; 1039 } 1040 break; 1041 case 15: 1042 #line 278 "../../ipsec-tools/src/libipsec/policy_parse.y" 1043 { 1044 if (rule_check() < 0) 1045 return -1; 1046 1047 if (set_x_request(p_src, p_dst) < 0) 1048 return -1; 1049 1050 policy_parse_request_init(); 1051 } 1052 break; 1053 case 22: 1054 #line 296 "../../ipsec-tools/src/libipsec/policy_parse.y" 1055 { 1056 __ipsec_errcode = EIPSEC_FEW_ARGUMENTS; 1057 return -1; 1058 } 1059 break; 1060 case 23: 1061 #line 300 "../../ipsec-tools/src/libipsec/policy_parse.y" 1062 { 1063 __ipsec_errcode = EIPSEC_FEW_ARGUMENTS; 1064 return -1; 1065 } 1066 break; 1067 case 24: 1068 #line 307 "../../ipsec-tools/src/libipsec/policy_parse.y" 1069 { p_protocol = yystack.l_mark[0].num; } 1070 break; 1071 case 25: 1072 #line 311 "../../ipsec-tools/src/libipsec/policy_parse.y" 1073 { p_mode = yystack.l_mark[0].num; } 1074 break; 1075 case 26: 1076 #line 315 "../../ipsec-tools/src/libipsec/policy_parse.y" 1077 { 1078 p_level = yystack.l_mark[0].num; 1079 p_reqid = 0; 1080 } 1081 break; 1082 case 27: 1083 #line 319 "../../ipsec-tools/src/libipsec/policy_parse.y" 1084 { 1085 p_level = IPSEC_LEVEL_UNIQUE; 1086 p_reqid = atol(yystack.l_mark[0].val.buf); /* atol() is good. */ 1087 } 1088 break; 1089 case 28: 1090 #line 326 "../../ipsec-tools/src/libipsec/policy_parse.y" 1091 { 1092 p_src = parse_sockaddr(&yystack.l_mark[0].val, NULL); 1093 if (p_src == NULL) 1094 return -1; 1095 } 1096 break; 1097 case 29: 1098 #line 332 "../../ipsec-tools/src/libipsec/policy_parse.y" 1099 { 1100 p_dst = parse_sockaddr(&yystack.l_mark[0].val, NULL); 1101 if (p_dst == NULL) 1102 return -1; 1103 } 1104 break; 1105 case 30: 1106 #line 337 "../../ipsec-tools/src/libipsec/policy_parse.y" 1107 { 1108 p_src = parse_sockaddr(&yystack.l_mark[-1].val, &yystack.l_mark[0].val); 1109 if (p_src == NULL) 1110 return -1; 1111 } 1112 break; 1113 case 31: 1114 #line 343 "../../ipsec-tools/src/libipsec/policy_parse.y" 1115 { 1116 p_dst = parse_sockaddr(&yystack.l_mark[-1].val, &yystack.l_mark[0].val); 1117 if (p_dst == NULL) 1118 return -1; 1119 } 1120 break; 1121 case 32: 1122 #line 348 "../../ipsec-tools/src/libipsec/policy_parse.y" 1123 { 1124 if (p_dir != IPSEC_DIR_OUTBOUND) { 1125 __ipsec_errcode = EIPSEC_INVAL_DIR; 1126 return -1; 1127 } 1128 } 1129 break; 1130 case 33: 1131 #line 354 "../../ipsec-tools/src/libipsec/policy_parse.y" 1132 { 1133 if (p_dir != IPSEC_DIR_INBOUND) { 1134 __ipsec_errcode = EIPSEC_INVAL_DIR; 1135 return -1; 1136 } 1137 } 1138 break; 1139 #line 1140 "__libipsec.tab.c" 1140 } 1141 yystack.s_mark -= yym; 1142 yystate = *yystack.s_mark; 1143 yystack.l_mark -= yym; 1144 yym = yylhs[yyn]; 1145 if (yystate == 0 && yym == 0) 1146 { 1147 #if YYDEBUG 1148 if (yydebug) 1149 printf("%sdebug: after reduction, shifting from state 0 to\ 1150 state %d\n", YYPREFIX, YYFINAL); 1151 #endif 1152 yystate = YYFINAL; 1153 *++yystack.s_mark = YYFINAL; 1154 *++yystack.l_mark = yyval; 1155 if (yychar < 0) 1156 { 1157 yychar = YYLEX; 1158 if (yychar < 0) yychar = YYEOF; 1159 #if YYDEBUG 1160 if (yydebug) 1161 { 1162 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 1163 printf("%sdebug: state %d, reading %d (%s)\n", 1164 YYPREFIX, YYFINAL, yychar, yys); 1165 } 1166 #endif 1167 } 1168 if (yychar == YYEOF) goto yyaccept; 1169 goto yyloop; 1170 } 1171 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 && 1172 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate) 1173 yystate = yytable[yyn]; 1174 else 1175 yystate = yydgoto[yym]; 1176 #if YYDEBUG 1177 if (yydebug) 1178 printf("%sdebug: after reduction, shifting from state %d \ 1179 to state %d\n", YYPREFIX, *yystack.s_mark, yystate); 1180 #endif 1181 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 1182 *++yystack.s_mark = (YYINT) yystate; 1183 *++yystack.l_mark = yyval; 1184 goto yyloop; 1185 1186 yyoverflow: 1187 YYERROR_CALL("yacc stack overflow"); 1188 1189 yyabort: 1190 yyfreestack(&yystack); 1191 return (1); 1192 1193 yyaccept: 1194 yyfreestack(&yystack); 1195 return (0); 1196 } -
ipsec-tools/src/libipsec/policy_parse.h
r8645c9d7 rb376ae1 1 /* A Bison parser, made by GNU Bison 2.6.2. */ 2 3 /* Bison interface 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 #ifndef _LIBIPSEC_POLICY_PARSE_H 34 # define _LIBIPSEC_POLICY_PARSE_H 35 /* Enabling traces. */ 36 #ifndef YYDEBUG 37 # define YYDEBUG 0 1 #define DIR 257 2 #define PRIORITY 258 3 #define PLUS 259 4 #define PRIO_BASE 260 5 #define PRIO_OFFSET 261 6 #define ACTION 262 7 #define PROTOCOL 263 8 #define MODE 264 9 #define LEVEL 265 10 #define LEVEL_SPECIFY 266 11 #define IPADDRESS 267 12 #define PORT 268 13 #define ME 269 14 #define ANY 270 15 #define SLASH 271 16 #define HYPHEN 272 17 #ifdef YYSTYPE 18 #undef YYSTYPE_IS_DECLARED 19 #define YYSTYPE_IS_DECLARED 1 38 20 #endif 39 #if YYDEBUG 40 extern int __libipsecdebug; 41 #endif 42 43 /* Tokens. */ 44 #ifndef YYTOKENTYPE 45 # define YYTOKENTYPE 46 /* Put the tokens into the symbol table, so that GDB and other debuggers 47 know about them. */ 48 enum yytokentype { 49 DIR = 258, 50 PRIORITY = 259, 51 PLUS = 260, 52 PRIO_BASE = 261, 53 PRIO_OFFSET = 262, 54 ACTION = 263, 55 PROTOCOL = 264, 56 MODE = 265, 57 LEVEL = 266, 58 LEVEL_SPECIFY = 267, 59 IPADDRESS = 268, 60 PORT = 269, 61 ME = 270, 62 ANY = 271, 63 SLASH = 272, 64 HYPHEN = 273 65 }; 66 #endif 67 /* Tokens. */ 68 #define DIR 258 69 #define PRIORITY 259 70 #define PLUS 260 71 #define PRIO_BASE 261 72 #define PRIO_OFFSET 262 73 #define ACTION 263 74 #define PROTOCOL 264 75 #define MODE 265 76 #define LEVEL 266 77 #define LEVEL_SPECIFY 267 78 #define IPADDRESS 268 79 #define PORT 269 80 #define ME 270 81 #define ANY 271 82 #define SLASH 272 83 #define HYPHEN 273 84 85 86 87 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 88 typedef union YYSTYPE 89 { 90 /* Line 2049 of yacc.c */ 91 #line 129 "policy_parse.y" 92 21 #ifndef YYSTYPE_IS_DECLARED 22 #define YYSTYPE_IS_DECLARED 1 23 typedef union { 93 24 u_int num; 94 25 u_int32_t num32; … … 97 28 char *buf; 98 29 } val; 99 100 101 /* Line 2049 of yacc.c */102 #line 103 "policy_parse.h"103 30 } YYSTYPE; 104 # define YYSTYPE_IS_TRIVIAL 1 105 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 106 # define YYSTYPE_IS_DECLARED 1 107 #endif 108 31 #endif /* !YYSTYPE_IS_DECLARED */ 109 32 extern YYSTYPE __libipseclval; 110 111 #ifdef YYPARSE_PARAM112 #if defined __STDC__ || defined __cplusplus113 int __libipsecparse (void *YYPARSE_PARAM);114 #else115 int __libipsecparse ();116 #endif117 #else /* ! YYPARSE_PARAM */118 #if defined __STDC__ || defined __cplusplus119 int __libipsecparse (void);120 #else121 int __libipsecparse ();122 #endif123 #endif /* ! YYPARSE_PARAM */124 125 #endif /* !_LIBIPSEC_POLICY_PARSE_H */ -
ipsec-tools/src/libipsec/policy_parse.y
r8645c9d7 rb376ae1 64 64 65 65 %{ 66 #ifdef __rtems__ 67 #include <machine/rtems-bsd-user-space.h> 68 #endif /* __rtems__ */ 66 69 #ifdef HAVE_CONFIG_H 67 70 #include "config.h" … … 601 604 error = yyparse(); /* it must be set errcode. */ 602 605 __policy__strbuffer__free__(); 606 #ifdef __rtems__ 607 /* This frees the p_src and p_dst buffers. */ 608 policy_parse_request_init(); 609 #endif /* __rtems__ */ 603 610 604 611 if (error) { … … 633 640 return policy; 634 641 } 642 #ifdef __rtems__ 643 644 void 645 ipsec_free_policy(ipsec_policy_t buf) 646 { 647 free(buf); 648 } 649 #endif /* __rtems__ */ -
ipsec-tools/src/libipsec/policy_token.c
r8645c9d7 rb376ae1 1 #line 2 "policy_token.c" 2 3 #line 4 "policy_token.c" 1 2 #line 3 "<stdout>" 4 3 5 4 #define YY_INT_ALIGNED short int … … 36 35 /* First, we deal with platform-specific or compiler-specific issues. */ 37 36 37 #if defined(__FreeBSD__) 38 #ifndef __STDC_LIMIT_MACROS 39 #define __STDC_LIMIT_MACROS 40 #endif 41 #include <sys/cdefs.h> 42 #include <stdint.h> 43 #else 44 #define __dead2 45 #endif 46 38 47 /* begin standard C headers. */ 39 48 #include <stdio.h> … … 51 60 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 52 61 53 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 62 #if defined(__FreeBSD__) || \ 63 (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) 54 64 55 65 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, … … 162 172 /* Size of default input buffer. */ 163 173 #ifndef YY_BUF_SIZE 164 #define YY_BUF_SIZE 1 6384174 #define YY_BUF_SIZE 1024 165 175 #endif 166 176 … … 284 294 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 285 295 : NULL) 296 #define yy_current_buffer YY_CURRENT_BUFFER 286 297 287 298 /* Same as previous macro, but useful when we know that the buffer stack is not … … 372 383 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); 373 384 static int yy_get_next_buffer (void ); 374 static void yy_fatal_error (yyconst char msg[] ) ;385 static void yy_fatal_error (yyconst char msg[] ) __dead2; 375 386 376 387 /* Done after the current pattern has been matched and before the … … 566 577 #define YY_RESTORE_YY_MORE_OFFSET 567 578 char *__libipsectext; 568 #line 1 " policy_token.l"579 #line 1 "../../ipsec-tools/src/libipsec/policy_token.l" 569 580 /* $NetBSD: policy_token.l,v 1.7 2007/07/18 12:07:50 vanhu Exp $ */ 570 581 /* Id: policy_token.l,v 1.12 2005/05/05 12:32:18 manubsd Exp */ … … 597 608 * SUCH DAMAGE. 598 609 */ 599 #line 35 "policy_token.l" 610 #line 35 "../../ipsec-tools/src/libipsec/policy_token.l" 611 #ifdef __rtems__ 612 #include <machine/rtems-bsd-user-space.h> 613 #endif /* __rtems__ */ 600 614 #ifdef HAVE_CONFIG_H 601 615 #include "config.h" … … 627 641 int __libipseclex __P((void)); 628 642 /* common section */ 629 #line 6 30 "policy_token.c"643 #line 644 "<stdout>" 630 644 631 645 #define INITIAL 0 … … 803 817 YY_DECL 804 818 { 805 registeryy_state_type yy_current_state;806 registerchar *yy_cp, *yy_bp;807 registerint yy_act;819 yy_state_type yy_current_state; 820 char *yy_cp, *yy_bp; 821 int yy_act; 808 822 809 #line 97 "policy_token.l"810 811 812 #line 8 13 "policy_token.c"823 #line 100 "../../ipsec-tools/src/libipsec/policy_token.l" 824 825 826 #line 827 "<stdout>" 813 827 814 828 if ( !(yy_init) ) … … 854 868 do 855 869 { 856 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];870 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; 857 871 if ( yy_accept[yy_current_state] ) 858 872 { … … 895 909 case 1: 896 910 YY_RULE_SETUP 897 #line 99 "policy_token.l"911 #line 102 "../../ipsec-tools/src/libipsec/policy_token.l" 898 912 { yylval.num = IPSEC_DIR_INBOUND; return(DIR); } 899 913 YY_BREAK 900 914 case 2: 901 915 YY_RULE_SETUP 902 #line 10 0 "policy_token.l"916 #line 103 "../../ipsec-tools/src/libipsec/policy_token.l" 903 917 { yylval.num = IPSEC_DIR_OUTBOUND; return(DIR); } 904 918 YY_BREAK 905 919 case 3: 906 920 YY_RULE_SETUP 907 #line 10 1 "policy_token.l"921 #line 104 "../../ipsec-tools/src/libipsec/policy_token.l" 908 922 { 909 923 #ifdef HAVE_POLICY_FWD … … 916 930 case 4: 917 931 YY_RULE_SETUP 918 #line 1 09 "policy_token.l"932 #line 112 "../../ipsec-tools/src/libipsec/policy_token.l" 919 933 { return(PRIORITY); } 920 934 YY_BREAK 921 935 case 5: 922 936 YY_RULE_SETUP 923 #line 11 0 "policy_token.l"937 #line 113 "../../ipsec-tools/src/libipsec/policy_token.l" 924 938 { return(PRIORITY); } 925 939 YY_BREAK 926 940 case 6: 927 941 YY_RULE_SETUP 928 #line 11 1 "policy_token.l"942 #line 114 "../../ipsec-tools/src/libipsec/policy_token.l" 929 943 { yylval.num32 = PRIORITY_LOW; return(PRIO_BASE); } 930 944 YY_BREAK 931 945 case 7: 932 946 YY_RULE_SETUP 933 #line 11 2 "policy_token.l"947 #line 115 "../../ipsec-tools/src/libipsec/policy_token.l" 934 948 { yylval.num32 = PRIORITY_DEFAULT; return(PRIO_BASE); } 935 949 YY_BREAK 936 950 case 8: 937 951 YY_RULE_SETUP 938 #line 11 3 "policy_token.l"952 #line 116 "../../ipsec-tools/src/libipsec/policy_token.l" 939 953 { yylval.num32 = PRIORITY_HIGH; return(PRIO_BASE); } 940 954 YY_BREAK 941 955 case 9: 942 956 YY_RULE_SETUP 943 #line 11 4 "policy_token.l"957 #line 117 "../../ipsec-tools/src/libipsec/policy_token.l" 944 958 { return(PLUS); } 945 959 YY_BREAK 946 960 case 10: 947 961 YY_RULE_SETUP 948 #line 11 5 "policy_token.l"962 #line 118 "../../ipsec-tools/src/libipsec/policy_token.l" 949 963 { 950 964 yylval.val.len = strlen(__libipsectext); … … 955 969 case 11: 956 970 YY_RULE_SETUP 957 #line 12 1 "policy_token.l"971 #line 124 "../../ipsec-tools/src/libipsec/policy_token.l" 958 972 { yylval.num = IPSEC_POLICY_DISCARD; return(ACTION); } 959 973 YY_BREAK 960 974 case 12: 961 975 YY_RULE_SETUP 962 #line 12 2 "policy_token.l"976 #line 125 "../../ipsec-tools/src/libipsec/policy_token.l" 963 977 { yylval.num = IPSEC_POLICY_NONE; return(ACTION); } 964 978 YY_BREAK 965 979 case 13: 966 980 YY_RULE_SETUP 967 #line 12 3 "policy_token.l"981 #line 126 "../../ipsec-tools/src/libipsec/policy_token.l" 968 982 { yylval.num = IPSEC_POLICY_IPSEC; return(ACTION); } 969 983 YY_BREAK 970 984 case 14: 971 985 YY_RULE_SETUP 972 #line 12 4 "policy_token.l"986 #line 127 "../../ipsec-tools/src/libipsec/policy_token.l" 973 987 { yylval.num = IPSEC_POLICY_BYPASS; return(ACTION); } 974 988 YY_BREAK 975 989 case 15: 976 990 YY_RULE_SETUP 977 #line 12 5 "policy_token.l"991 #line 128 "../../ipsec-tools/src/libipsec/policy_token.l" 978 992 { yylval.num = IPSEC_POLICY_ENTRUST; return(ACTION); } 979 993 YY_BREAK 980 994 case 16: 981 995 YY_RULE_SETUP 982 #line 1 27 "policy_token.l"996 #line 130 "../../ipsec-tools/src/libipsec/policy_token.l" 983 997 { yylval.num = IPPROTO_ESP; return(PROTOCOL); } 984 998 YY_BREAK 985 999 case 17: 986 1000 YY_RULE_SETUP 987 #line 1 28 "policy_token.l"1001 #line 131 "../../ipsec-tools/src/libipsec/policy_token.l" 988 1002 { yylval.num = IPPROTO_AH; return(PROTOCOL); } 989 1003 YY_BREAK 990 1004 case 18: 991 1005 YY_RULE_SETUP 992 #line 1 29 "policy_token.l"1006 #line 132 "../../ipsec-tools/src/libipsec/policy_token.l" 993 1007 { yylval.num = IPPROTO_IPCOMP; return(PROTOCOL); } 994 1008 YY_BREAK 995 1009 case 19: 996 1010 YY_RULE_SETUP 997 #line 13 1 "policy_token.l"1011 #line 134 "../../ipsec-tools/src/libipsec/policy_token.l" 998 1012 { yylval.num = IPSEC_MODE_TRANSPORT; return(MODE); } 999 1013 YY_BREAK 1000 1014 case 20: 1001 1015 YY_RULE_SETUP 1002 #line 13 2 "policy_token.l"1016 #line 135 "../../ipsec-tools/src/libipsec/policy_token.l" 1003 1017 { yylval.num = IPSEC_MODE_TUNNEL; return(MODE); } 1004 1018 YY_BREAK 1005 1019 case 21: 1006 1020 YY_RULE_SETUP 1007 #line 13 4 "policy_token.l"1021 #line 137 "../../ipsec-tools/src/libipsec/policy_token.l" 1008 1022 { return(ME); } 1009 1023 YY_BREAK 1010 1024 case 22: 1011 1025 YY_RULE_SETUP 1012 #line 13 5 "policy_token.l"1026 #line 138 "../../ipsec-tools/src/libipsec/policy_token.l" 1013 1027 { return(ANY); } 1014 1028 YY_BREAK 1015 1029 case 23: 1016 1030 YY_RULE_SETUP 1017 #line 1 37 "policy_token.l"1031 #line 140 "../../ipsec-tools/src/libipsec/policy_token.l" 1018 1032 { yylval.num = IPSEC_LEVEL_DEFAULT; return(LEVEL); } 1019 1033 YY_BREAK 1020 1034 case 24: 1021 1035 YY_RULE_SETUP 1022 #line 1 38 "policy_token.l"1036 #line 141 "../../ipsec-tools/src/libipsec/policy_token.l" 1023 1037 { yylval.num = IPSEC_LEVEL_USE; return(LEVEL); } 1024 1038 YY_BREAK 1025 1039 case 25: 1026 1040 YY_RULE_SETUP 1027 #line 1 39 "policy_token.l"1041 #line 142 "../../ipsec-tools/src/libipsec/policy_token.l" 1028 1042 { yylval.num = IPSEC_LEVEL_REQUIRE; return(LEVEL); } 1029 1043 YY_BREAK 1030 1044 case 26: 1031 1045 YY_RULE_SETUP 1032 #line 14 0 "policy_token.l"1046 #line 143 "../../ipsec-tools/src/libipsec/policy_token.l" 1033 1047 { 1034 1048 yylval.val.len = strlen(__libipsectext + 7); … … 1039 1053 case 27: 1040 1054 YY_RULE_SETUP 1041 #line 14 5 "policy_token.l"1055 #line 148 "../../ipsec-tools/src/libipsec/policy_token.l" 1042 1056 { yylval.num = IPSEC_LEVEL_UNIQUE; return(LEVEL); } 1043 1057 YY_BREAK 1044 1058 case 28: 1045 1059 YY_RULE_SETUP 1046 #line 14 6 "policy_token.l"1060 #line 149 "../../ipsec-tools/src/libipsec/policy_token.l" 1047 1061 { return(SLASH); } 1048 1062 YY_BREAK 1049 1063 case 29: 1050 1064 YY_RULE_SETUP 1051 #line 1 48 "policy_token.l"1065 #line 151 "../../ipsec-tools/src/libipsec/policy_token.l" 1052 1066 { 1053 1067 yylval.val.len = strlen(__libipsectext); … … 1058 1072 case 30: 1059 1073 YY_RULE_SETUP 1060 #line 15 4 "policy_token.l"1074 #line 157 "../../ipsec-tools/src/libipsec/policy_token.l" 1061 1075 { return(HYPHEN); } 1062 1076 YY_BREAK 1063 1077 case 31: 1064 1078 YY_RULE_SETUP 1065 #line 15 6 "policy_token.l"1079 #line 159 "../../ipsec-tools/src/libipsec/policy_token.l" 1066 1080 { 1067 1081 /* Remove leading '[' and trailing ']' */ … … 1074 1088 case 32: 1075 1089 YY_RULE_SETUP 1076 #line 16 4 "policy_token.l"1090 #line 167 "../../ipsec-tools/src/libipsec/policy_token.l" 1077 1091 { ; } 1078 1092 YY_BREAK … … 1080 1094 /* rule 33 can match eol */ 1081 1095 YY_RULE_SETUP 1082 #line 16 5 "policy_token.l"1096 #line 168 "../../ipsec-tools/src/libipsec/policy_token.l" 1083 1097 { ; } 1084 1098 YY_BREAK 1085 1099 case 34: 1086 1100 YY_RULE_SETUP 1087 #line 1 67 "policy_token.l"1101 #line 170 "../../ipsec-tools/src/libipsec/policy_token.l" 1088 1102 ECHO; 1089 1103 YY_BREAK 1090 #line 1 091 "policy_token.c"1104 #line 1105 "<stdout>" 1091 1105 case YY_STATE_EOF(INITIAL): 1092 1106 yyterminate(); … … 1230 1244 static int yy_get_next_buffer (void) 1231 1245 { 1232 registerchar *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;1233 registerchar *source = (yytext_ptr);1234 registerint number_to_move, i;1246 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 1247 char *source = (yytext_ptr); 1248 int number_to_move, i; 1235 1249 int ret_val; 1236 1250 … … 1364 1378 static yy_state_type yy_get_previous_state (void) 1365 1379 { 1366 registeryy_state_type yy_current_state;1367 registerchar *yy_cp;1380 yy_state_type yy_current_state; 1381 char *yy_cp; 1368 1382 1369 1383 yy_current_state = (yy_start); … … 1371 1385 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) 1372 1386 { 1373 registerYY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);1387 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1374 1388 if ( yy_accept[yy_current_state] ) 1375 1389 { … … 1396 1410 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) 1397 1411 { 1398 registerint yy_is_jam;1399 registerchar *yy_cp = (yy_c_buf_p);1400 1401 registerYY_CHAR yy_c = 1;1412 int yy_is_jam; 1413 char *yy_cp = (yy_c_buf_p); 1414 1415 YY_CHAR yy_c = 1; 1402 1416 if ( yy_accept[yy_current_state] ) 1403 1417 { … … 1815 1829 char *buf; 1816 1830 yy_size_t n; 1817 int i;1831 yy_size_t i; 1818 1832 1819 1833 /* Get memory for full buffer, including space for trailing EOB's. */ … … 2004 2018 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) 2005 2019 { 2006 registerint i;2020 int i; 2007 2021 for ( i = 0; i < n; ++i ) 2008 2022 s1[i] = s2[i]; … … 2013 2027 static int yy_flex_strlen (yyconst char * s ) 2014 2028 { 2015 registerint n;2029 int n; 2016 2030 for ( n = 0; s[n]; ++n ) 2017 2031 ; … … 2045 2059 #define YYTABLES_NAME "yytables" 2046 2060 2047 #line 1 67 "policy_token.l"2061 #line 170 "../../ipsec-tools/src/libipsec/policy_token.l" 2048 2062 2049 2063 -
ipsec-tools/src/libipsec/policy_token.l
r8645c9d7 rb376ae1 33 33 34 34 %{ 35 #ifdef __rtems__ 36 #include <machine/rtems-bsd-user-space.h> 37 #endif /* __rtems__ */ 35 38 #ifdef HAVE_CONFIG_H 36 39 #include "config.h" -
ipsec-tools/src/libipsec/test-policy.c
r8645c9d7 rb376ae1 1 #include <machine/rtems-bsd-user-space.h> 2 1 3 /* $NetBSD: test-policy.c,v 1.4 2006/09/09 16:22:09 manu Exp $ */ 2 4 … … 52 54 int result; /* expected result; 0:ok 1:ng */ 53 55 char *str; 56 #ifndef __rtems__ 54 57 } reqs[] = { 58 #else /* __rtems__ */ 59 }; 60 61 static const struct req_t reqs[] = { 62 #endif /* __rtems__ */ 55 63 { 0, "out ipsec" }, 56 64 { 1, "must_error" }, … … 125 133 int 126 134 test1sub1(req) 135 #ifndef __rtems__ 127 136 struct req_t *req; 137 #else /* __rtems__ */ 138 const struct req_t *req; 139 #endif /* __rtems__ */ 128 140 { 129 141 char *buf; -
ipsec-tools/src/racoon/admin.c
r8645c9d7 rb376ae1 1 #include <machine/rtems-bsd-user-space.h> 2 #ifdef __rtems__ 3 #include <machine/rtems-bsd-program.h> 4 #include "rtems-bsd-racoon-namespace.h" 5 #endif /* __rtems__ */ 6 1 7 /* $NetBSD: admin.c,v 1.38.4.1 2013/06/03 05:49:59 tteras Exp $ */ 2 8 … … 774 780 775 781 #endif 782 #ifdef __rtems__ 783 #include "rtems-bsd-racoon-admin-data.h" 784 #endif /* __rtems__ */ -
ipsec-tools/src/racoon/algorithm.c
r8645c9d7 rb376ae1 1 #include <machine/rtems-bsd-user-space.h> 2 #ifdef __rtems__ 3 #include <machine/rtems-bsd-program.h> 4 #include "rtems-bsd-racoon-namespace.h" 5 #endif /* __rtems__ */ 6 1 7 /* $NetBSD: algorithm.c,v 1.8 2006/10/06 12:02:27 manu Exp $ */ 2 8 … … 956 962 return -1; 957 963 } 964 #ifdef __rtems__ 965 #include "rtems-bsd-racoon-algorithm-data.h" 966 #endif /* __rtems__ */ -
ipsec-tools/src/racoon/algorithm.h
r8645c9d7 rb376ae1 35 35 #define _ALGORITHM_H 36 36 37 #ifndef __rtems__ 37 38 #include <gnuc.h> 39 #else /* __rtems__ */ 40 #include "gnuc.h" 41 #endif /* __rtems__ */ 38 42 39 43 /* algorithm class */ -
ipsec-tools/src/racoon/backupsa.c
r8645c9d7 rb376ae1 1 #include <machine/rtems-bsd-user-space.h> 2 #ifdef __rtems__ 3 #include <machine/rtems-bsd-program.h> 4 #include "rtems-bsd-racoon-namespace.h" 5 #endif /* __rtems__ */ 6 1 7 /* $NetBSD: backupsa.c,v 1.10 2010/04/02 15:15:00 christos Exp $ */ 2 8 … … 37 43 #include <sys/param.h> 38 44 #include <sys/socket.h> 45 #ifdef __rtems__ 46 #define strtouq strtoull 47 #endif /* __rtems__ */ 39 48 40 49 #include <stdlib.h> … … 468 477 } 469 478 #endif 479 #ifdef __rtems__ 480 #include "rtems-bsd-racoon-backupsa-data.h" 481 #endif /* __rtems__ */ -
ipsec-tools/src/racoon/cfparse.c
r8645c9d7 rb376ae1 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. */ 1 /* original parser id follows */ 2 /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 5 #define YYBYACC 1 6 #define YYMAJOR 1 7 #define YYMINOR 9 8 #define YYPATCH 20170201 9 10 #define YYEMPTY (-1) 11 #define yyclearin (yychar = YYEMPTY) 12 #define yyerrok (yyerrflag = 0) 13 #define YYRECOVERING() (yyerrflag != 0) 14 #define YYENOMEM (-2) 15 #define YYEOF 0 16 17 #ifndef yyparse 18 #define yyparse racoonyyparse 19 #endif /* yyparse */ 20 21 #ifndef yylex 22 #define yylex racoonyylex 23 #endif /* yylex */ 24 25 #ifndef yyerror 26 #define yyerror racoonyyerror 27 #endif /* yyerror */ 28 29 #ifndef yychar 30 #define yychar racoonyychar 31 #endif /* yychar */ 32 33 #ifndef yyval 34 #define yyval racoonyyval 35 #endif /* yyval */ 36 37 #ifndef yylval 38 #define yylval racoonyylval 39 #endif /* yylval */ 40 41 #ifndef yydebug 42 #define yydebug racoonyydebug 43 #endif /* yydebug */ 44 45 #ifndef yynerrs 46 #define yynerrs racoonyynerrs 47 #endif /* yynerrs */ 48 49 #ifndef yyerrflag 50 #define yyerrflag racoonyyerrflag 51 #endif /* yyerrflag */ 52 53 #ifndef yylhs 54 #define yylhs racoonyylhs 55 #endif /* yylhs */ 56 57 #ifndef yylen 58 #define yylen racoonyylen 59 #endif /* yylen */ 60 61 #ifndef yydefred 62 #define yydefred racoonyydefred 63 #endif /* yydefred */ 64 65 #ifndef yydgoto 66 #define yydgoto racoonyydgoto 67 #endif /* yydgoto */ 68 69 #ifndef yysindex 70 #define yysindex racoonyysindex 71 #endif /* yysindex */ 72 73 #ifndef yyrindex 74 #define yyrindex racoonyyrindex 75 #endif /* yyrindex */ 76 77 #ifndef yygindex 78 #define yygindex racoonyygindex 79 #endif /* yygindex */ 80 81 #ifndef yytable 82 #define yytable racoonyytable 83 #endif /* yytable */ 84 85 #ifndef yycheck 86 #define yycheck racoonyycheck 87 #endif /* yycheck */ 88 89 #ifndef yyname 90 #define yyname racoonyyname 91 #endif /* yyname */ 92 93 #ifndef yyrule 94 #define yyrule racoonyyrule 95 #endif /* yyrule */ 96 #define YYPREFIX "racoonyy" 97 53 98 #define YYPURE 0 54 99 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 100 #line 6 "../../ipsec-tools/src/racoon/cfparse.y" 68 101 /* 69 102 * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 and 2003 WIDE Project. … … 305 338 } 306 339 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 340 #ifdef YYSTYPE 341 #undef YYSTYPE_IS_DECLARED 342 #define YYSTYPE_IS_DECLARED 1 343 #endif 344 #ifndef YYSTYPE_IS_DECLARED 345 #define YYSTYPE_IS_DECLARED 1 346 #line 247 "../../ipsec-tools/src/racoon/cfparse.y" 347 typedef union { 699 348 unsigned long num; 700 349 vchar_t *val; … … 702 351 struct sockaddr *saddr; 703 352 struct sainfoalg *alg; 704 705 706 /* Line 350 of yacc.c */707 #line 708 "cfparse.c"708 353 } 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 354 #endif /* !YYSTYPE_IS_DECLARED */ 355 #line 356 "racoonyy.tab.c" 356 357 /* compatibility with bison */ 716 358 #ifdef YYPARSE_PARAM 717 #if defined __STDC__ || defined __cplusplus 718 int yyparse (void *YYPARSE_PARAM); 359 /* compatibility with FreeBSD */ 360 # ifdef YYPARSE_PARAM_TYPE 361 # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) 362 # else 363 # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) 364 # endif 719 365 #else 720 int yyparse (); 721 #endif 722 #else /* ! YYPARSE_PARAM */ 723 #if defined __STDC__ || defined __cplusplus 724 int yyparse (void); 366 # define YYPARSE_DECL() yyparse(void) 367 #endif 368 369 /* Parameters sent to lex. */ 370 #ifdef YYLEX_PARAM 371 # define YYLEX_DECL() yylex(void *YYLEX_PARAM) 372 # define YYLEX yylex(YYLEX_PARAM) 725 373 #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; 374 # define YYLEX_DECL() yylex(void) 375 # define YYLEX yylex() 376 #endif 377 378 /* Parameters sent to yyerror. */ 379 #ifndef YYERROR_DECL 380 #define YYERROR_DECL() yyerror(const char *s) 381 #endif 382 #ifndef YYERROR_CALL 383 #define YYERROR_CALL(msg) yyerror(msg) 384 #endif 385 386 extern int YYPARSE_DECL(); 387 388 #define PRIVSEP 257 389 #define USER 258 390 #define GROUP 259 391 #define CHROOT 260 392 #define PATH 261 393 #define PATHTYPE 262 394 #define INCLUDE 263 395 #define PFKEY_BUFFER 264 396 #define LOGGING 265 397 #define LOGLEV 266 398 #define PADDING 267 399 #define PAD_RANDOMIZE 268 400 #define PAD_RANDOMIZELEN 269 401 #define PAD_MAXLEN 270 402 #define PAD_STRICT 271 403 #define PAD_EXCLTAIL 272 404 #define LISTEN 273 405 #define X_ISAKMP 274 406 #define X_ISAKMP_NATT 275 407 #define X_ADMIN 276 408 #define STRICT_ADDRESS 277 409 #define ADMINSOCK 278 410 #define DISABLED 279 411 #define LDAPCFG 280 412 #define LDAP_HOST 281 413 #define LDAP_PORT 282 414 #define LDAP_PVER 283 415 #define LDAP_BASE 284 416 #define LDAP_BIND_DN 285 417 #define LDAP_BIND_PW 286 418 #define LDAP_SUBTREE 287 419 #define LDAP_ATTR_USER 288 420 #define LDAP_ATTR_ADDR 289 421 #define LDAP_ATTR_MASK 290 422 #define LDAP_ATTR_GROUP 291 423 #define LDAP_ATTR_MEMBER 292 424 #define RADCFG 293 425 #define RAD_AUTH 294 426 #define RAD_ACCT 295 427 #define RAD_TIMEOUT 296 428 #define RAD_RETRIES 297 429 #define MODECFG 298 430 #define CFG_NET4 299 431 #define CFG_MASK4 300 432 #define CFG_DNS4 301 433 #define CFG_NBNS4 302 434 #define CFG_DEFAULT_DOMAIN 303 435 #define CFG_AUTH_SOURCE 304 436 #define CFG_AUTH_GROUPS 305 437 #define CFG_SYSTEM 306 438 #define CFG_RADIUS 307 439 #define CFG_PAM 308 440 #define CFG_LDAP 309 441 #define CFG_LOCAL 310 442 #define CFG_NONE 311 443 #define CFG_GROUP_SOURCE 312 444 #define CFG_ACCOUNTING 313 445 #define CFG_CONF_SOURCE 314 446 #define CFG_MOTD 315 447 #define CFG_POOL_SIZE 316 448 #define CFG_AUTH_THROTTLE 317 449 #define CFG_SPLIT_NETWORK 318 450 #define CFG_SPLIT_LOCAL 319 451 #define CFG_SPLIT_INCLUDE 320 452 #define CFG_SPLIT_DNS 321 453 #define CFG_PFS_GROUP 322 454 #define CFG_SAVE_PASSWD 323 455 #define RETRY 324 456 #define RETRY_COUNTER 325 457 #define RETRY_INTERVAL 326 458 #define RETRY_PERSEND 327 459 #define RETRY_PHASE1 328 460 #define RETRY_PHASE2 329 461 #define NATT_KA 330 462 #define ALGORITHM_CLASS 331 463 #define ALGORITHMTYPE 332 464 #define STRENGTHTYPE 333 465 #define SAINFO 334 466 #define FROM 335 467 #define REMOTE 336 468 #define ANONYMOUS 337 469 #define CLIENTADDR 338 470 #define INHERIT 339 471 #define REMOTE_ADDRESS 340 472 #define EXCHANGE_MODE 341 473 #define EXCHANGETYPE 342 474 #define DOI 343 475 #define DOITYPE 344 476 #define SITUATION 345 477 #define SITUATIONTYPE 346 478 #define CERTIFICATE_TYPE 347 479 #define CERTTYPE 348 480 #define PEERS_CERTFILE 349 481 #define CA_TYPE 350 482 #define VERIFY_CERT 351 483 #define SEND_CERT 352 484 #define SEND_CR 353 485 #define MATCH_EMPTY_CR 354 486 #define IDENTIFIERTYPE 355 487 #define IDENTIFIERQUAL 356 488 #define MY_IDENTIFIER 357 489 #define PEERS_IDENTIFIER 358 490 #define VERIFY_IDENTIFIER 359 491 #define DNSSEC 360 492 #define CERT_X509 361 493 #define CERT_PLAINRSA 362 494 #define NONCE_SIZE 363 495 #define DH_GROUP 364 496 #define KEEPALIVE 365 497 #define PASSIVE 366 498 #define INITIAL_CONTACT 367 499 #define NAT_TRAVERSAL 368 500 #define REMOTE_FORCE_LEVEL 369 501 #define PROPOSAL_CHECK 370 502 #define PROPOSAL_CHECK_LEVEL 371 503 #define GENERATE_POLICY 372 504 #define GENERATE_LEVEL 373 505 #define SUPPORT_PROXY 374 506 #define PROPOSAL 375 507 #define EXEC_PATH 376 508 #define EXEC_COMMAND 377 509 #define EXEC_SUCCESS 378 510 #define EXEC_FAILURE 379 511 #define GSS_ID 380 512 #define GSS_ID_ENC 381 513 #define GSS_ID_ENCTYPE 382 514 #define COMPLEX_BUNDLE 383 515 #define DPD 384 516 #define DPD_DELAY 385 517 #define DPD_RETRY 386 518 #define DPD_MAXFAIL 387 519 #define PH1ID 388 520 #define XAUTH_LOGIN 389 521 #define WEAK_PHASE1_CHECK 390 522 #define REKEY 391 523 #define PREFIX 392 524 #define PORT 393 525 #define PORTANY 394 526 #define UL_PROTO 395 527 #define ANY 396 528 #define IKE_FRAG 397 529 #define ESP_FRAG 398 530 #define MODE_CFG 399 531 #define PFS_GROUP 400 532 #define LIFETIME 401 533 #define LIFETYPE_TIME 402 534 #define LIFETYPE_BYTE 403 535 #define STRENGTH 404 536 #define REMOTEID 405 537 #define SCRIPT 406 538 #define PHASE1_UP 407 539 #define PHASE1_DOWN 408 540 #define PHASE1_DEAD 409 541 #define NUMBER 410 542 #define SWITCH 411 543 #define BOOLEAN 412 544 #define HEXSTRING 413 545 #define QUOTEDSTRING 414 546 #define ADDRSTRING 415 547 #define ADDRRANGE 416 548 #define UNITTYPE_BYTE 417 549 #define UNITTYPE_KBYTES 418 550 #define UNITTYPE_MBYTES 419 551 #define UNITTYPE_TBYTES 420 552 #define UNITTYPE_SEC 421 553 #define UNITTYPE_MIN 422 554 #define UNITTYPE_HOUR 423 555 #define EOS 424 556 #define BOC 425 557 #define EOC 426 558 #define COMMA 427 559 #define YYERRCODE 256 560 typedef int YYINT; 561 static const YYINT racoonyylhs[] = { -1, 562 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 563 14, 14, 14, 14, 14, 14, 14, 15, 30, 30, 564 32, 31, 33, 31, 34, 31, 35, 31, 36, 31, 565 37, 16, 38, 29, 17, 18, 19, 20, 39, 21, 566 40, 40, 42, 41, 43, 41, 44, 41, 45, 41, 567 46, 41, 22, 47, 47, 49, 48, 50, 48, 51, 568 48, 52, 48, 53, 48, 54, 48, 12, 5, 5, 569 55, 24, 56, 56, 58, 57, 59, 57, 60, 57, 570 61, 57, 62, 57, 63, 57, 64, 23, 65, 65, 571 67, 66, 68, 66, 69, 66, 70, 66, 71, 66, 572 72, 66, 73, 66, 74, 66, 75, 66, 76, 66, 573 77, 66, 78, 66, 25, 79, 79, 81, 80, 82, 574 80, 80, 80, 86, 80, 87, 80, 89, 80, 90, 575 80, 91, 80, 92, 80, 93, 80, 94, 80, 96, 576 80, 97, 80, 98, 80, 99, 80, 100, 80, 101, 577 80, 102, 80, 103, 80, 104, 80, 105, 80, 106, 578 80, 107, 80, 108, 80, 109, 80, 110, 80, 83, 579 83, 111, 84, 84, 112, 85, 85, 113, 95, 95, 580 114, 88, 88, 115, 26, 116, 116, 118, 117, 119, 581 117, 120, 117, 121, 117, 122, 117, 123, 117, 125, 582 128, 27, 124, 124, 124, 124, 124, 124, 9, 9, 583 9, 126, 126, 126, 127, 127, 130, 129, 131, 129, 584 132, 129, 133, 129, 135, 129, 134, 136, 134, 13, 585 3, 3, 4, 4, 4, 6, 6, 6, 1, 1, 586 138, 28, 140, 28, 141, 28, 142, 28, 137, 137, 587 139, 11, 11, 143, 143, 145, 144, 147, 144, 148, 588 144, 149, 144, 144, 151, 144, 152, 144, 153, 144, 589 154, 144, 155, 144, 156, 144, 157, 144, 158, 144, 590 159, 144, 160, 144, 161, 144, 162, 144, 163, 144, 591 164, 144, 165, 144, 166, 144, 167, 144, 168, 144, 592 169, 144, 170, 144, 171, 144, 172, 144, 173, 144, 593 174, 144, 175, 144, 176, 144, 177, 144, 178, 144, 594 179, 144, 180, 144, 181, 144, 182, 144, 183, 144, 595 184, 144, 185, 144, 186, 144, 187, 144, 188, 144, 596 189, 144, 190, 144, 191, 144, 192, 144, 193, 144, 597 146, 146, 195, 150, 196, 150, 2, 2, 10, 10, 598 10, 194, 194, 198, 197, 199, 197, 200, 197, 201, 599 197, 202, 197, 7, 7, 7, 8, 8, 8, 8, 600 }; 601 static const YYINT racoonyylen[] = { 2, 602 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 603 1, 1, 1, 1, 1, 1, 1, 4, 0, 2, 604 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 605 0, 5, 0, 4, 3, 3, 3, 3, 1, 4, 606 0, 2, 0, 4, 0, 4, 0, 4, 0, 4, 607 0, 4, 4, 0, 2, 0, 4, 0, 4, 0, 608 7, 0, 4, 0, 4, 0, 3, 2, 0, 1, 609 0, 5, 0, 2, 0, 5, 0, 6, 0, 5, 610 0, 6, 0, 4, 0, 4, 0, 5, 0, 2, 611 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 612 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 613 0, 4, 0, 4, 4, 0, 2, 0, 4, 0, 614 4, 3, 3, 0, 5, 0, 5, 0, 4, 0, 615 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 616 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 617 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 618 4, 0, 4, 0, 4, 0, 4, 0, 4, 1, 619 3, 1, 1, 3, 1, 1, 3, 2, 1, 3, 620 1, 1, 3, 1, 4, 0, 2, 0, 4, 0, 621 5, 0, 4, 0, 5, 0, 5, 0, 5, 0, 622 0, 8, 1, 2, 2, 2, 2, 2, 5, 6, 623 2, 0, 3, 2, 0, 2, 0, 4, 0, 4, 624 0, 6, 0, 6, 0, 4, 1, 0, 4, 2, 625 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 626 0, 6, 0, 4, 0, 6, 0, 4, 1, 1, 627 3, 2, 1, 0, 2, 0, 4, 0, 4, 0, 628 4, 0, 4, 2, 0, 4, 0, 5, 0, 5, 629 0, 4, 0, 5, 0, 4, 0, 4, 0, 4, 630 0, 4, 0, 5, 0, 6, 0, 4, 0, 5, 631 0, 6, 0, 4, 0, 4, 0, 4, 0, 4, 632 0, 4, 0, 4, 0, 4, 0, 5, 0, 5, 633 0, 5, 0, 4, 0, 4, 0, 4, 0, 4, 634 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 635 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 636 0, 4, 0, 6, 0, 4, 0, 6, 0, 5, 637 0, 2, 0, 5, 0, 4, 1, 1, 0, 1, 638 1, 0, 2, 0, 6, 0, 6, 0, 4, 0, 639 4, 0, 5, 1, 1, 1, 1, 1, 1, 1, 640 }; 641 static const YYINT racoonyydefred[] = { 1, 642 0, 0, 0, 0, 0, 0, 0, 0, 87, 71, 643 0, 0, 200, 0, 0, 0, 2, 3, 4, 5, 644 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 645 16, 17, 19, 0, 0, 0, 39, 0, 41, 54, 646 0, 0, 116, 186, 0, 0, 0, 0, 0, 253, 647 0, 33, 0, 31, 35, 36, 38, 0, 0, 89, 648 73, 0, 0, 0, 0, 0, 0, 70, 252, 0, 649 0, 68, 0, 0, 37, 0, 0, 0, 0, 18, 650 20, 0, 0, 0, 0, 0, 0, 40, 42, 0, 651 0, 66, 0, 53, 55, 0, 0, 0, 0, 0, 652 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 653 0, 0, 0, 0, 115, 117, 0, 0, 0, 0, 654 0, 0, 185, 187, 204, 205, 211, 0, 206, 207, 655 208, 0, 0, 0, 241, 254, 244, 245, 248, 34, 656 23, 21, 27, 25, 29, 32, 43, 45, 47, 49, 657 51, 56, 58, 0, 64, 0, 0, 0, 0, 0, 658 0, 0, 0, 0, 0, 0, 0, 0, 88, 90, 659 0, 0, 0, 0, 72, 74, 118, 120, 172, 0, 660 0, 175, 0, 0, 130, 132, 134, 136, 138, 181, 661 140, 0, 142, 144, 148, 150, 152, 146, 164, 166, 662 162, 168, 154, 160, 0, 0, 184, 128, 0, 156, 663 158, 188, 0, 192, 0, 0, 0, 232, 0, 0, 664 214, 0, 215, 0, 0, 0, 0, 0, 0, 0, 665 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 666 0, 0, 93, 95, 91, 97, 101, 103, 99, 105, 667 107, 109, 111, 113, 0, 0, 83, 85, 0, 0, 668 122, 0, 123, 0, 0, 0, 0, 0, 0, 0, 669 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 670 0, 0, 0, 0, 0, 176, 0, 0, 0, 0, 671 0, 0, 374, 375, 376, 190, 0, 194, 196, 198, 672 0, 234, 235, 0, 361, 360, 213, 0, 250, 242, 673 249, 0, 258, 0, 0, 0, 0, 0, 0, 0, 674 0, 0, 0, 0, 0, 0, 297, 0, 0, 0, 675 0, 0, 0, 349, 0, 0, 0, 0, 0, 0, 676 0, 0, 0, 0, 0, 0, 0, 251, 255, 246, 677 24, 22, 28, 26, 30, 44, 46, 48, 50, 52, 678 57, 59, 65, 0, 63, 0, 0, 0, 0, 0, 679 0, 0, 0, 0, 0, 0, 0, 0, 75, 0, 680 79, 0, 0, 119, 121, 171, 174, 131, 133, 135, 681 137, 139, 141, 180, 143, 145, 149, 151, 153, 147, 682 165, 167, 163, 169, 155, 161, 178, 0, 0, 0, 683 129, 183, 157, 159, 189, 0, 193, 0, 0, 0, 684 0, 237, 238, 236, 209, 225, 0, 0, 0, 0, 685 216, 256, 351, 260, 262, 0, 0, 264, 271, 0, 686 0, 265, 0, 275, 277, 279, 281, 0, 0, 293, 687 295, 0, 299, 323, 327, 325, 345, 319, 317, 321, 688 0, 329, 331, 333, 335, 341, 287, 315, 339, 337, 689 303, 301, 305, 313, 0, 0, 0, 60, 94, 96, 690 92, 98, 102, 104, 100, 106, 108, 110, 112, 114, 691 77, 0, 81, 0, 84, 86, 177, 125, 127, 191, 692 195, 197, 199, 210, 0, 357, 358, 217, 0, 0, 693 219, 202, 0, 0, 0, 0, 0, 355, 0, 267, 694 269, 0, 273, 0, 0, 0, 0, 0, 283, 0, 695 289, 0, 0, 0, 0, 0, 0, 0, 0, 0, 696 0, 0, 362, 0, 0, 0, 0, 0, 0, 0, 697 0, 0, 0, 0, 0, 0, 0, 0, 307, 309, 698 311, 0, 0, 76, 0, 80, 0, 0, 0, 0, 699 0, 0, 0, 257, 352, 259, 261, 263, 353, 0, 700 272, 0, 0, 266, 0, 276, 278, 280, 282, 285, 701 0, 291, 0, 294, 296, 298, 300, 324, 328, 326, 702 346, 320, 318, 322, 0, 330, 332, 334, 336, 342, 703 288, 316, 340, 338, 304, 302, 306, 314, 343, 377, 704 378, 379, 380, 347, 0, 0, 0, 61, 78, 82, 705 240, 230, 0, 226, 218, 221, 223, 220, 0, 356, 706 268, 270, 274, 0, 284, 0, 290, 0, 0, 0, 707 0, 350, 363, 0, 0, 308, 310, 312, 0, 0, 708 0, 354, 286, 292, 0, 368, 370, 0, 0, 344, 709 348, 229, 222, 224, 372, 0, 0, 0, 0, 0, 710 369, 371, 364, 366, 373, 0, 0, 365, 367, 711 }; 712 static const YYINT racoonyydgoto[] = { 1, 713 632, 508, 220, 304, 69, 425, 296, 624, 66, 307, 714 49, 50, 568, 17, 18, 19, 20, 21, 22, 23, 715 24, 25, 26, 27, 28, 29, 30, 31, 32, 53, 716 81, 228, 227, 230, 229, 231, 82, 76, 38, 58, 717 89, 232, 233, 234, 235, 236, 59, 95, 237, 238, 718 562, 242, 240, 154, 42, 97, 176, 492, 563, 494, 719 565, 382, 383, 41, 96, 170, 368, 366, 367, 369, 720 372, 370, 371, 373, 374, 375, 376, 377, 62, 116, 721 259, 260, 180, 183, 285, 409, 410, 208, 288, 265, 722 266, 267, 268, 269, 191, 270, 272, 273, 277, 274, 723 275, 276, 282, 290, 291, 283, 280, 278, 279, 281, 724 181, 184, 286, 192, 209, 63, 124, 292, 416, 297, 725 418, 419, 420, 67, 45, 134, 308, 430, 431, 570, 726 573, 660, 661, 569, 505, 633, 310, 224, 311, 71, 727 226, 74, 225, 349, 513, 514, 433, 515, 516, 438, 728 522, 582, 583, 519, 585, 524, 525, 526, 527, 591, 729 644, 549, 593, 646, 532, 533, 452, 535, 554, 553, 730 555, 625, 626, 627, 556, 550, 541, 540, 542, 536, 731 538, 537, 544, 545, 546, 547, 552, 551, 548, 654, 732 539, 655, 461, 605, 639, 580, 653, 686, 687, 676, 733 677, 680, 734 }; 735 static const YYINT racoonyysindex[] = { 0, 736 -193, -348, -174, -292, -306, -130, -266, -246, 0, 0, 737 -244, -234, 0, -268, -217, -216, 0, 0, 0, 0, 738 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 739 0, 0, 0, -264, -220, -191, 0, -168, 0, 0, 740 -219, -196, 0, 0, -252, -185, -146, -185, -108, 0, 741 -164, 0, -251, 0, 0, 0, 0, -257, -258, 0, 742 0, -256, -275, -231, -321, -242, -218, 0, 0, -171, 743 -163, 0, -255, -163, 0, -159, -284, -282, -143, 0, 744 0, -152, -138, -137, -134, -132, -131, 0, 0, -128, 745 -128, 0, -261, 0, 0, -260, -259, -127, -126, -125, 746 -124, -129, -122, -121, -200, -209, -136, -120, -118, -115, 747 -165, -117, -114, -113, 0, 0, -111, -110, -109, -106, 748 -105, -104, 0, 0, 0, 0, 0, -308, 0, 0, 749 0, -112, -80, -148, 0, 0, 0, 0, 0, 0, 750 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 751 0, 0, 0, -142, 0, -103, -102, -101, -100, -99, 752 -98, -97, -93, -95, -94, -92, -91, -90, 0, 0, 753 -89, -88, -96, -83, 0, 0, 0, 0, 0, -141, 754 -149, 0, -116, -86, 0, 0, 0, 0, 0, 0, 755 0, -84, 0, 0, 0, 0, 0, 0, 0, 0, 756 0, 0, 0, 0, -85, -85, 0, 0, -82, 0, 757 0, 0, -201, 0, -201, -201, -201, 0, -79, -195, 758 0, -199, 0, -172, -140, -172, -78, -77, -76, -75, 759 -74, -73, -72, -71, -70, -69, -67, -66, 0, -65, 760 -81, -64, 0, 0, 0, 0, 0, 0, 0, 0, 761 0, 0, 0, 0, -265, -262, 0, 0, -63, -62, 762 0, -125, 0, -124, -61, -60, -59, -58, -57, -56, 763 -121, -55, -54, -53, -52, -51, -50, -49, -48, -47, 764 -46, -45, -44, -11, -43, 0, -43, -42, -117, -41, 765 -39, -38, 0, 0, 0, 0, -37, 0, 0, 0, 766 -195, 0, 0, -238, 0, 0, 0, -289, 0, 0, 767 0, -128, 0, -23, -18, -107, -270, -32, -22, -21, 768 -20, -19, -24, -17, -16, -14, 0, -13, -12, -293, 769 -68, -310, -10, 0, -9, -7, -6, -5, -4, -199, 770 -3, -288, -286, -1, 1, -139, -26, 0, 0, 0, 771 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 772 0, 0, 0, 3, 0, -31, -30, -27, -8, -2, 773 2, 4, 5, 6, 7, 8, 9, 10, 0, 11, 774 0, 12, 13, 0, 0, 0, 0, 0, 0, 0, 775 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 776 0, 0, 0, 0, 0, 0, 0, -85, 14, 15, 777 0, 0, 0, 0, 0, 16, 0, 17, 18, 19, 778 -238, 0, 0, 0, 0, 0, -254, -135, 24, -145, 779 0, 0, 0, 0, 0, 21, 30, 0, 0, 31, 780 32, 0, 33, 0, 0, 0, 0, -281, -277, 0, 781 0, -254, 0, 0, 0, 0, 0, 0, 0, 0, 782 -25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 783 0, 0, 0, 0, 38, 39, -167, 0, 0, 0, 784 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 785 0, 26, 0, 27, 0, 0, 0, 0, 0, 0, 786 0, 0, 0, 0, 75, 0, 0, 0, 42, 43, 787 0, 0, 34, -303, 35, 36, 40, 0, 37, 0, 788 0, 41, 0, 44, 45, 46, 47, -199, 0, -199, 789 0, 48, 49, 50, 51, 52, 53, 54, 55, 56, 790 57, 58, 0, 59, 60, 61, 62, 64, 65, 66, 791 67, 68, 69, 70, 71, 72, -201, -181, 0, 0, 792 0, 73, 74, 0, 76, 0, 77, 0, 78, 79, 793 -201, -181, 80, 0, 0, 0, 0, 0, 0, 81, 794 0, 82, 83, 0, 84, 0, 0, 0, 0, 0, 795 85, 0, 86, 0, 0, 0, 0, 0, 0, 0, 796 0, 0, 0, 0, -291, 0, 0, 0, 0, 0, 797 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 798 0, 0, 0, 0, 87, 88, 89, 0, 0, 0, 799 0, 0, 28, 0, 0, 0, 0, 0, 90, 0, 800 0, 0, 0, 91, 0, 92, 0, 95, -254, 103, 801 -133, 0, 0, 94, 96, 0, 0, 0, 75, 97, 802 98, 0, 0, 0, 77, 0, 0, 109, 113, 0, 803 0, 0, 0, 0, 0, 100, 101, -201, -181, 102, 804 0, 0, 0, 0, 0, 104, 105, 0, 0, 805 }; 806 static const YYINT racoonyyrindex[] = { 0, 807 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 808 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 809 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 810 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 811 0, 0, 0, 0, 0, -305, -15, -305, 106, 0, 812 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 813 0, 0, 0, -249, 0, 0, 107, 0, 0, 0, 814 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 815 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 816 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 817 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 818 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 819 0, 0, 0, 0, 0, 0, 0, -232, 0, 0, 820 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 821 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 822 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 823 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 824 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 825 111, 0, 0, 112, 0, 0, 0, 0, 0, 0, 826 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 827 0, 0, 0, 0, 0, 0, 0, 0, 115, 0, 828 0, 0, 0, 0, 0, 0, 0, 0, -232, -213, 829 0, 108, 0, 0, 0, 0, 0, 0, 0, 0, 830 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 831 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 832 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 833 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 834 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 835 0, 0, 0, 0, 116, 0, 117, 0, 0, 0, 836 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 837 -213, 0, 0, 0, 0, 0, 0, -119, 0, 0, 838 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 839 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 840 0, 0, 0, 0, 0, 0, 0, 0, 0, -70, 841 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 842 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 843 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 844 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 845 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 846 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 847 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 848 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 849 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 850 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 851 0, 0, 0, 0, 0, 0, 0, -70, -70, 0, 852 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 853 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 854 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 855 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 856 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 857 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 858 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 859 0, 0, 0, 0, 0, 0, 0, -70, 0, -70, 860 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 861 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 862 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 863 0, 0, 0, 0, 0, 0, -285, -247, 0, 0, 864 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 865 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 866 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 867 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 868 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 869 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 870 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 871 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 872 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 873 0, 0, 0, 0, -142, 0, 0, 0, 0, 0, 874 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875 0, 0, 0, 0, 0, 0, 0, 0, 0, 876 }; 877 static const YYINT racoonyygindex[] = { 0, 878 -381, -447, 120, 119, 284, 121, -215, -539, 63, -334, 879 261, -87, 0, 0, 0, 0, 0, 0, 0, 0, 880 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 881 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 882 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 883 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 884 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 885 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 886 0, 0, 149, 150, 129, 0, 0, 126, 0, 0, 887 0, 0, 0, 0, 146, 0, 0, 0, 0, 0, 888 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 889 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 890 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 891 0, 0, 0, -323, 0, 0, 192, 0, 118, 0, 892 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 893 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 894 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 895 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 896 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 897 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 898 0, 0, 899 }; 900 #define YYTABLESIZE 542 901 static const YYINT racoonyytable[] = { 298, 902 299, 300, 152, 153, 534, 467, 77, 78, 79, 203, 903 83, 84, 85, 86, 87, 90, 91, 155, 92, 93, 904 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 905 167, 168, 637, 69, 171, 172, 173, 174, 575, 648, 906 132, 426, 98, 99, 100, 101, 102, 103, 104, 117, 907 118, 119, 120, 121, 122, 105, 106, 107, 108, 109, 908 110, 111, 458, 2, 112, 113, 114, 3, 46, 4, 909 5, 6, 649, 7, 528, 455, 33, 506, 530, 8, 910 469, 46, 471, 218, 64, 203, 9, 34, 650, 439, 911 440, 441, 127, 128, 129, 130, 195, 196, 197, 10, 912 459, 198, 65, 36, 11, 193, 125, 219, 194, 651, 913 427, 428, 65, 529, 531, 429, 133, 456, 69, 69, 914 576, 35, 470, 65, 472, 141, 126, 143, 131, 142, 915 12, 144, 305, 306, 652, 37, 305, 306, 239, 684, 916 13, 239, 14, 442, 378, 47, 48, 380, 379, 54, 917 123, 381, 156, 205, 206, 507, 422, 423, 39, 48, 918 231, 231, 231, 231, 51, 169, 175, 94, 88, 115, 919 199, 424, 200, 201, 80, 203, 227, 231, 40, 228, 920 43, 233, 233, 186, 187, 188, 189, 15, 137, 16, 921 44, 139, 70, 590, 52, 592, 233, 302, 303, 312, 922 313, 666, 314, 55, 315, 60, 316, 68, 317, 318, 923 319, 320, 321, 322, 305, 306, 323, 324, 325, 293, 924 294, 295, 326, 327, 432, 328, 329, 330, 61, 331, 925 73, 332, 56, 333, 334, 620, 621, 622, 623, 559, 926 560, 561, 135, 335, 336, 337, 338, 339, 340, 341, 927 342, 309, 136, 436, 437, 57, 343, 344, 345, 75, 928 346, 136, 475, 476, 140, 347, 509, 510, 668, 669, 929 145, 146, 147, 148, 222, 149, 223, 262, 150, 151, 930 512, 239, 261, 675, 185, 348, 48, 177, 178, 179, 931 182, 203, 190, 202, 204, 210, 207, 211, 212, 213, 932 214, 221, 457, 215, 216, 217, 201, 263, 244, 245, 933 241, 243, 218, 257, 246, 247, 248, 249, 250, 251, 934 434, 252, 253, 254, 255, 256, 258, 435, 443, 284, 935 448, 72, 364, 138, 287, 672, 0, 449, 301, 0, 936 264, 619, 271, 0, 289, 351, 352, 353, 354, 355, 937 356, 357, 358, 359, 360, 636, 361, 362, 363, 365, 938 384, 385, 388, 389, 390, 391, 392, 393, 395, 396, 939 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 940 407, 411, 413, 408, 414, 415, 417, 477, 444, 445, 941 446, 447, 479, 480, 450, 451, 481, 453, 454, 543, 942 460, 462, 463, 464, 465, 466, 567, 468, 473, 243, 943 386, 474, 478, 387, 412, 482, 394, 350, 0, 421, 944 0, 483, 0, 491, 493, 484, 665, 485, 486, 487, 945 488, 489, 490, 511, 517, 495, 496, 498, 499, 500, 946 501, 502, 503, 518, 520, 521, 523, 557, 558, 564, 947 566, 571, 572, 579, 659, 0, 0, 574, 577, 578, 948 581, 0, 683, 0, 584, 0, 0, 586, 587, 588, 949 589, 594, 595, 596, 597, 598, 599, 600, 601, 602, 950 603, 604, 606, 607, 608, 609, 631, 610, 611, 612, 951 613, 614, 615, 616, 617, 618, 628, 629, 0, 630, 952 497, 634, 635, 638, 640, 641, 642, 643, 645, 647, 953 656, 657, 658, 662, 663, 664, 667, 670, 678, 671, 954 673, 674, 679, 681, 682, 685, 0, 688, 689, 0, 955 247, 212, 359, 62, 170, 173, 0, 179, 182, 124, 956 126, 504, 957 }; 958 static const YYINT racoonyycheck[] = { 215, 959 216, 217, 90, 91, 452, 340, 258, 259, 260, 259, 960 268, 269, 270, 271, 272, 274, 275, 279, 277, 278, 961 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 962 291, 292, 572, 339, 294, 295, 296, 297, 342, 331, 963 259, 331, 299, 300, 301, 302, 303, 304, 305, 325, 964 326, 327, 328, 329, 330, 312, 313, 314, 315, 316, 965 317, 318, 373, 257, 321, 322, 323, 261, 337, 263, 966 264, 265, 364, 267, 356, 369, 425, 332, 356, 273, 967 369, 337, 369, 392, 337, 335, 280, 262, 380, 360, 968 361, 362, 414, 415, 337, 338, 306, 307, 308, 293, 969 411, 311, 355, 410, 298, 306, 338, 416, 309, 401, 970 400, 401, 355, 448, 449, 405, 335, 411, 424, 425, 971 424, 414, 411, 355, 411, 410, 64, 410, 66, 414, 972 324, 414, 414, 415, 426, 266, 414, 415, 424, 679, 973 334, 427, 336, 414, 410, 414, 415, 410, 414, 414, 974 426, 414, 414, 319, 320, 410, 395, 396, 425, 415, 975 393, 394, 395, 396, 382, 426, 426, 426, 426, 426, 976 307, 410, 309, 310, 426, 425, 424, 410, 425, 427, 977 425, 395, 396, 306, 307, 308, 309, 381, 71, 383, 978 425, 74, 339, 528, 411, 530, 410, 393, 394, 340, 979 341, 649, 343, 424, 345, 425, 347, 393, 349, 350, 980 351, 352, 353, 354, 414, 415, 357, 358, 359, 421, 981 422, 423, 363, 364, 312, 366, 367, 368, 425, 370, 982 339, 372, 424, 374, 375, 417, 418, 419, 420, 407, 983 408, 409, 414, 384, 385, 386, 387, 388, 389, 390, 984 391, 424, 425, 361, 362, 424, 397, 398, 399, 424, 985 401, 425, 402, 403, 424, 406, 402, 403, 402, 403, 986 414, 424, 411, 411, 355, 410, 425, 427, 411, 411, 987 426, 424, 424, 665, 414, 426, 415, 415, 415, 415, 988 415, 410, 414, 414, 410, 410, 414, 411, 410, 410, 989 410, 414, 371, 410, 410, 410, 426, 424, 410, 410, 990 414, 414, 392, 410, 414, 414, 414, 411, 414, 414, 991 344, 414, 414, 414, 414, 414, 410, 346, 361, 415, 992 355, 48, 414, 73, 206, 659, -1, 355, 219, -1, 993 427, 557, 427, -1, 427, 424, 424, 424, 424, 424, 994 424, 424, 424, 424, 424, 571, 424, 424, 424, 424, 995 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, 996 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, 997 392, 424, 424, 427, 424, 424, 424, 414, 411, 411, 998 411, 411, 424, 424, 411, 410, 424, 411, 411, 425, 999 411, 411, 410, 410, 410, 410, 332, 411, 410, 425, 1000 262, 411, 410, 264, 289, 424, 271, 226, -1, 301, 1001 -1, 424, -1, 414, 414, 424, 332, 424, 424, 424, 1002 424, 424, 424, 410, 414, 424, 424, 424, 424, 424, 1003 424, 424, 424, 414, 414, 414, 414, 410, 410, 424, 1004 424, 410, 410, 414, 427, -1, -1, 424, 424, 424, 1005 424, -1, 678, -1, 424, -1, -1, 424, 424, 424, 1006 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, 1007 424, 424, 424, 424, 424, 424, 410, 424, 424, 424, 1008 424, 424, 424, 424, 424, 424, 424, 424, -1, 424, 1009 408, 424, 424, 424, 424, 424, 424, 424, 424, 424, 1010 424, 424, 424, 424, 424, 424, 414, 424, 410, 424, 1011 424, 424, 410, 424, 424, 424, -1, 424, 424, -1, 1012 425, 425, 425, 424, 424, 424, -1, 424, 424, 424, 1013 424, 421, 1014 }; 1015 #define YYFINAL 1 1016 #ifndef YYDEBUG 1017 #define YYDEBUG 0 1018 #endif 1019 #define YYMAXTOKEN 427 1020 #define YYUNDFTOKEN 632 1021 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) 1022 #if YYDEBUG 1023 static const char *const racoonyyname[] = { 1024 1025 "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1026 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1027 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1028 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1029 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1030 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1031 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"PRIVSEP","USER","GROUP","CHROOT", 1032 "PATH","PATHTYPE","INCLUDE","PFKEY_BUFFER","LOGGING","LOGLEV","PADDING", 1033 "PAD_RANDOMIZE","PAD_RANDOMIZELEN","PAD_MAXLEN","PAD_STRICT","PAD_EXCLTAIL", 1034 "LISTEN","X_ISAKMP","X_ISAKMP_NATT","X_ADMIN","STRICT_ADDRESS","ADMINSOCK", 1035 "DISABLED","LDAPCFG","LDAP_HOST","LDAP_PORT","LDAP_PVER","LDAP_BASE", 1036 "LDAP_BIND_DN","LDAP_BIND_PW","LDAP_SUBTREE","LDAP_ATTR_USER","LDAP_ATTR_ADDR", 1037 "LDAP_ATTR_MASK","LDAP_ATTR_GROUP","LDAP_ATTR_MEMBER","RADCFG","RAD_AUTH", 1038 "RAD_ACCT","RAD_TIMEOUT","RAD_RETRIES","MODECFG","CFG_NET4","CFG_MASK4", 1039 "CFG_DNS4","CFG_NBNS4","CFG_DEFAULT_DOMAIN","CFG_AUTH_SOURCE","CFG_AUTH_GROUPS", 1040 "CFG_SYSTEM","CFG_RADIUS","CFG_PAM","CFG_LDAP","CFG_LOCAL","CFG_NONE", 1041 "CFG_GROUP_SOURCE","CFG_ACCOUNTING","CFG_CONF_SOURCE","CFG_MOTD", 1042 "CFG_POOL_SIZE","CFG_AUTH_THROTTLE","CFG_SPLIT_NETWORK","CFG_SPLIT_LOCAL", 1043 "CFG_SPLIT_INCLUDE","CFG_SPLIT_DNS","CFG_PFS_GROUP","CFG_SAVE_PASSWD","RETRY", 1044 "RETRY_COUNTER","RETRY_INTERVAL","RETRY_PERSEND","RETRY_PHASE1","RETRY_PHASE2", 1045 "NATT_KA","ALGORITHM_CLASS","ALGORITHMTYPE","STRENGTHTYPE","SAINFO","FROM", 1046 "REMOTE","ANONYMOUS","CLIENTADDR","INHERIT","REMOTE_ADDRESS","EXCHANGE_MODE", 1047 "EXCHANGETYPE","DOI","DOITYPE","SITUATION","SITUATIONTYPE","CERTIFICATE_TYPE", 1048 "CERTTYPE","PEERS_CERTFILE","CA_TYPE","VERIFY_CERT","SEND_CERT","SEND_CR", 1049 "MATCH_EMPTY_CR","IDENTIFIERTYPE","IDENTIFIERQUAL","MY_IDENTIFIER", 1050 "PEERS_IDENTIFIER","VERIFY_IDENTIFIER","DNSSEC","CERT_X509","CERT_PLAINRSA", 1051 "NONCE_SIZE","DH_GROUP","KEEPALIVE","PASSIVE","INITIAL_CONTACT","NAT_TRAVERSAL", 1052 "REMOTE_FORCE_LEVEL","PROPOSAL_CHECK","PROPOSAL_CHECK_LEVEL","GENERATE_POLICY", 1053 "GENERATE_LEVEL","SUPPORT_PROXY","PROPOSAL","EXEC_PATH","EXEC_COMMAND", 1054 "EXEC_SUCCESS","EXEC_FAILURE","GSS_ID","GSS_ID_ENC","GSS_ID_ENCTYPE", 1055 "COMPLEX_BUNDLE","DPD","DPD_DELAY","DPD_RETRY","DPD_MAXFAIL","PH1ID", 1056 "XAUTH_LOGIN","WEAK_PHASE1_CHECK","REKEY","PREFIX","PORT","PORTANY","UL_PROTO", 1057 "ANY","IKE_FRAG","ESP_FRAG","MODE_CFG","PFS_GROUP","LIFETIME","LIFETYPE_TIME", 1058 "LIFETYPE_BYTE","STRENGTH","REMOTEID","SCRIPT","PHASE1_UP","PHASE1_DOWN", 1059 "PHASE1_DEAD","NUMBER","SWITCH","BOOLEAN","HEXSTRING","QUOTEDSTRING", 1060 "ADDRSTRING","ADDRRANGE","UNITTYPE_BYTE","UNITTYPE_KBYTES","UNITTYPE_MBYTES", 1061 "UNITTYPE_TBYTES","UNITTYPE_SEC","UNITTYPE_MIN","UNITTYPE_HOUR","EOS","BOC", 1062 "EOC","COMMA",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1063 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1064 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1065 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1066 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1067 0,0,0,0,0,0,0,0,0,0,0,"illegal-symbol", 1068 }; 1069 static const char *const racoonyyrule[] = { 1070 "$accept : statements", 1071 "statements :", 1072 "statements : statements statement", 1073 "statement : privsep_statement", 1074 "statement : path_statement", 1075 "statement : include_statement", 1076 "statement : pfkey_statement", 1077 "statement : gssenc_statement", 1078 "statement : logging_statement", 1079 "statement : padding_statement", 1080 "statement : listen_statement", 1081 "statement : ldapcfg_statement", 1082 "statement : radcfg_statement", 1083 "statement : modecfg_statement", 1084 "statement : timer_statement", 1085 "statement : sainfo_statement", 1086 "statement : remote_statement", 1087 "statement : special_statement", 1088 "privsep_statement : PRIVSEP BOC privsep_stmts EOC", 1089 "privsep_stmts :", 1090 "privsep_stmts : privsep_stmts privsep_stmt", 1091 "$$1 :", 1092 "privsep_stmt : USER QUOTEDSTRING $$1 EOS", 1093 "$$2 :", 1094 "privsep_stmt : USER NUMBER $$2 EOS", 1095 "$$3 :", 1096 "privsep_stmt : GROUP QUOTEDSTRING $$3 EOS", 1097 "$$4 :", 1098 "privsep_stmt : GROUP NUMBER $$4 EOS", 1099 "$$5 :", 1100 "privsep_stmt : CHROOT QUOTEDSTRING $$5 EOS", 1101 "$$6 :", 1102 "path_statement : PATH PATHTYPE QUOTEDSTRING $$6 EOS", 1103 "$$7 :", 1104 "special_statement : COMPLEX_BUNDLE SWITCH $$7 EOS", 1105 "include_statement : INCLUDE QUOTEDSTRING EOS", 1106 "pfkey_statement : PFKEY_BUFFER NUMBER EOS", 1107 "gssenc_statement : GSS_ID_ENC GSS_ID_ENCTYPE EOS", 1108 "logging_statement : LOGGING log_level EOS", 1109 "log_level : LOGLEV", 1110 "padding_statement : PADDING BOC padding_stmts EOC", 1111 "padding_stmts :", 1112 "padding_stmts : padding_stmts padding_stmt", 1113 "$$8 :", 1114 "padding_stmt : PAD_RANDOMIZE SWITCH $$8 EOS", 1115 "$$9 :", 1116 "padding_stmt : PAD_RANDOMIZELEN SWITCH $$9 EOS", 1117 "$$10 :", 1118 "padding_stmt : PAD_MAXLEN NUMBER $$10 EOS", 1119 "$$11 :", 1120 "padding_stmt : PAD_STRICT SWITCH $$11 EOS", 1121 "$$12 :", 1122 "padding_stmt : PAD_EXCLTAIL SWITCH $$12 EOS", 1123 "listen_statement : LISTEN BOC listen_stmts EOC", 1124 "listen_stmts :", 1125 "listen_stmts : listen_stmts listen_stmt", 1126 "$$13 :", 1127 "listen_stmt : X_ISAKMP ike_addrinfo_port $$13 EOS", 1128 "$$14 :", 1129 "listen_stmt : X_ISAKMP_NATT ike_addrinfo_port $$14 EOS", 1130 "$$15 :", 1131 "listen_stmt : ADMINSOCK QUOTEDSTRING QUOTEDSTRING QUOTEDSTRING NUMBER $$15 EOS", 1132 "$$16 :", 1133 "listen_stmt : ADMINSOCK QUOTEDSTRING $$16 EOS", 1134 "$$17 :", 1135 "listen_stmt : ADMINSOCK DISABLED $$17 EOS", 1136 "$$18 :", 1137 "listen_stmt : STRICT_ADDRESS $$18 EOS", 1138 "ike_addrinfo_port : ADDRSTRING ike_port", 1139 "ike_port :", 1140 "ike_port : PORT", 1141 "$$19 :", 1142 "radcfg_statement : RADCFG $$19 BOC radcfg_stmts EOC", 1143 "radcfg_stmts :", 1144 "radcfg_stmts : radcfg_stmts radcfg_stmt", 1145 "$$20 :", 1146 "radcfg_stmt : RAD_AUTH QUOTEDSTRING QUOTEDSTRING $$20 EOS", 1147 "$$21 :", 1148 "radcfg_stmt : RAD_AUTH QUOTEDSTRING NUMBER QUOTEDSTRING $$21 EOS", 1149 "$$22 :", 1150 "radcfg_stmt : RAD_ACCT QUOTEDSTRING QUOTEDSTRING $$22 EOS", 1151 "$$23 :", 1152 "radcfg_stmt : RAD_ACCT QUOTEDSTRING NUMBER QUOTEDSTRING $$23 EOS", 1153 "$$24 :", 1154 "radcfg_stmt : RAD_TIMEOUT NUMBER $$24 EOS", 1155 "$$25 :", 1156 "radcfg_stmt : RAD_RETRIES NUMBER $$25 EOS", 1157 "$$26 :", 1158 "ldapcfg_statement : LDAPCFG $$26 BOC ldapcfg_stmts EOC", 1159 "ldapcfg_stmts :", 1160 "ldapcfg_stmts : ldapcfg_stmts ldapcfg_stmt", 1161 "$$27 :", 1162 "ldapcfg_stmt : LDAP_PVER NUMBER $$27 EOS", 1163 "$$28 :", 1164 "ldapcfg_stmt : LDAP_HOST QUOTEDSTRING $$28 EOS", 1165 "$$29 :", 1166 "ldapcfg_stmt : LDAP_PORT NUMBER $$29 EOS", 1167 "$$30 :", 1168 "ldapcfg_stmt : LDAP_BASE QUOTEDSTRING $$30 EOS", 1169 "$$31 :", 1170 "ldapcfg_stmt : LDAP_SUBTREE SWITCH $$31 EOS", 1171 "$$32 :", 1172 "ldapcfg_stmt : LDAP_BIND_DN QUOTEDSTRING $$32 EOS", 1173 "$$33 :", 1174 "ldapcfg_stmt : LDAP_BIND_PW QUOTEDSTRING $$33 EOS", 1175 "$$34 :", 1176 "ldapcfg_stmt : LDAP_ATTR_USER QUOTEDSTRING $$34 EOS", 1177 "$$35 :", 1178 "ldapcfg_stmt : LDAP_ATTR_ADDR QUOTEDSTRING $$35 EOS", 1179 "$$36 :", 1180 "ldapcfg_stmt : LDAP_ATTR_MASK QUOTEDSTRING $$36 EOS", 1181 "$$37 :", 1182 "ldapcfg_stmt : LDAP_ATTR_GROUP QUOTEDSTRING $$37 EOS", 1183 "$$38 :", 1184 "ldapcfg_stmt : LDAP_ATTR_MEMBER QUOTEDSTRING $$38 EOS", 1185 "modecfg_statement : MODECFG BOC modecfg_stmts EOC", 1186 "modecfg_stmts :", 1187 "modecfg_stmts : modecfg_stmts modecfg_stmt", 1188 "$$39 :", 1189 "modecfg_stmt : CFG_NET4 ADDRSTRING $$39 EOS", 1190 "$$40 :", 1191 "modecfg_stmt : CFG_MASK4 ADDRSTRING $$40 EOS", 1192 "modecfg_stmt : CFG_DNS4 addrdnslist EOS", 1193 "modecfg_stmt : CFG_NBNS4 addrwinslist EOS", 1194 "$$41 :", 1195 "modecfg_stmt : CFG_SPLIT_NETWORK CFG_SPLIT_LOCAL splitnetlist $$41 EOS", 1196 "$$42 :", 1197 "modecfg_stmt : CFG_SPLIT_NETWORK CFG_SPLIT_INCLUDE splitnetlist $$42 EOS", 1198 "$$43 :", 1199 "modecfg_stmt : CFG_SPLIT_DNS splitdnslist $$43 EOS", 1200 "$$44 :", 1201 "modecfg_stmt : CFG_DEFAULT_DOMAIN QUOTEDSTRING $$44 EOS", 1202 "$$45 :", 1203 "modecfg_stmt : CFG_AUTH_SOURCE CFG_SYSTEM $$45 EOS", 1204 "$$46 :", 1205 "modecfg_stmt : CFG_AUTH_SOURCE CFG_RADIUS $$46 EOS", 1206 "$$47 :", 1207 "modecfg_stmt : CFG_AUTH_SOURCE CFG_PAM $$47 EOS", 1208 "$$48 :", 1209 "modecfg_stmt : CFG_AUTH_SOURCE CFG_LDAP $$48 EOS", 1210 "$$49 :", 1211 "modecfg_stmt : CFG_AUTH_GROUPS authgrouplist $$49 EOS", 1212 "$$50 :", 1213 "modecfg_stmt : CFG_GROUP_SOURCE CFG_SYSTEM $$50 EOS", 1214 "$$51 :", 1215 "modecfg_stmt : CFG_GROUP_SOURCE CFG_LDAP $$51 EOS", 1216 "$$52 :", 1217 "modecfg_stmt : CFG_ACCOUNTING CFG_NONE $$52 EOS", 1218 "$$53 :", 1219 "modecfg_stmt : CFG_ACCOUNTING CFG_SYSTEM $$53 EOS", 1220 "$$54 :", 1221 "modecfg_stmt : CFG_ACCOUNTING CFG_RADIUS $$54 EOS", 1222 "$$55 :", 1223 "modecfg_stmt : CFG_ACCOUNTING CFG_PAM $$55 EOS", 1224 "$$56 :", 1225 "modecfg_stmt : CFG_POOL_SIZE NUMBER $$56 EOS", 1226 "$$57 :", 1227 "modecfg_stmt : CFG_PFS_GROUP NUMBER $$57 EOS", 1228 "$$58 :", 1229 "modecfg_stmt : CFG_SAVE_PASSWD SWITCH $$58 EOS", 1230 "$$59 :", 1231 "modecfg_stmt : CFG_AUTH_THROTTLE NUMBER $$59 EOS", 1232 "$$60 :", 1233 "modecfg_stmt : CFG_CONF_SOURCE CFG_LOCAL $$60 EOS", 1234 "$$61 :", 1235 "modecfg_stmt : CFG_CONF_SOURCE CFG_RADIUS $$61 EOS", 1236 "$$62 :", 1237 "modecfg_stmt : CFG_CONF_SOURCE CFG_LDAP $$62 EOS", 1238 "$$63 :", 1239 "modecfg_stmt : CFG_MOTD QUOTEDSTRING $$63 EOS", 1240 "addrdnslist : addrdns", 1241 "addrdnslist : addrdns COMMA addrdnslist", 1242 "addrdns : ADDRSTRING", 1243 "addrwinslist : addrwins", 1244 "addrwinslist : addrwins COMMA addrwinslist", 1245 "addrwins : ADDRSTRING", 1246 "splitnetlist : splitnet", 1247 "splitnetlist : splitnetlist COMMA splitnet", 1248 "splitnet : ADDRSTRING PREFIX", 1249 "authgrouplist : authgroup", 1250 "authgrouplist : authgroup COMMA authgrouplist", 1251 "authgroup : QUOTEDSTRING", 1252 "splitdnslist : splitdns", 1253 "splitdnslist : splitdns COMMA splitdnslist", 1254 "splitdns : QUOTEDSTRING", 1255 "timer_statement : RETRY BOC timer_stmts EOC", 1256 "timer_stmts :", 1257 "timer_stmts : timer_stmts timer_stmt", 1258 "$$64 :", 1259 "timer_stmt : RETRY_COUNTER NUMBER $$64 EOS", 1260 "$$65 :", 1261 "timer_stmt : RETRY_INTERVAL NUMBER unittype_time $$65 EOS", 1262 "$$66 :", 1263 "timer_stmt : RETRY_PERSEND NUMBER $$66 EOS", 1264 "$$67 :", 1265 "timer_stmt : RETRY_PHASE1 NUMBER unittype_time $$67 EOS", 1266 "$$68 :", 1267 "timer_stmt : RETRY_PHASE2 NUMBER unittype_time $$68 EOS", 1268 "$$69 :", 1269 "timer_stmt : NATT_KA NUMBER unittype_time $$69 EOS", 1270 "$$70 :", 1271 "$$71 :", 1272 "sainfo_statement : SAINFO $$70 sainfo_name sainfo_param BOC sainfo_specs $$71 EOC", 1273 "sainfo_name : ANONYMOUS", 1274 "sainfo_name : ANONYMOUS CLIENTADDR", 1275 "sainfo_name : ANONYMOUS sainfo_id", 1276 "sainfo_name : sainfo_id ANONYMOUS", 1277 "sainfo_name : sainfo_id CLIENTADDR", 1278 "sainfo_name : sainfo_id sainfo_id", 1279 "sainfo_id : IDENTIFIERTYPE ADDRSTRING prefix port ul_proto", 1280 "sainfo_id : IDENTIFIERTYPE ADDRSTRING ADDRRANGE prefix port ul_proto", 1281 "sainfo_id : IDENTIFIERTYPE QUOTEDSTRING", 1282 "sainfo_param :", 1283 "sainfo_param : FROM IDENTIFIERTYPE identifierstring", 1284 "sainfo_param : GROUP QUOTEDSTRING", 1285 "sainfo_specs :", 1286 "sainfo_specs : sainfo_specs sainfo_spec", 1287 "$$72 :", 1288 "sainfo_spec : PFS_GROUP dh_group_num $$72 EOS", 1289 "$$73 :", 1290 "sainfo_spec : REMOTEID NUMBER $$73 EOS", 1291 "$$74 :", 1292 "sainfo_spec : LIFETIME LIFETYPE_TIME NUMBER unittype_time $$74 EOS", 1293 "$$75 :", 1294 "sainfo_spec : LIFETIME LIFETYPE_BYTE NUMBER unittype_byte $$75 EOS", 1295 "$$76 :", 1296 "sainfo_spec : ALGORITHM_CLASS $$76 algorithms EOS", 1297 "algorithms : algorithm", 1298 "$$77 :", 1299 "algorithms : algorithm $$77 COMMA algorithms", 1300 "algorithm : ALGORITHMTYPE keylength", 1301 "prefix :", 1302 "prefix : PREFIX", 1303 "port :", 1304 "port : PORT", 1305 "port : PORTANY", 1306 "ul_proto : NUMBER", 1307 "ul_proto : UL_PROTO", 1308 "ul_proto : ANY", 1309 "keylength :", 1310 "keylength : NUMBER", 1311 "$$78 :", 1312 "remote_statement : REMOTE QUOTEDSTRING INHERIT QUOTEDSTRING $$78 remote_specs_inherit_block", 1313 "$$79 :", 1314 "remote_statement : REMOTE QUOTEDSTRING $$79 remote_specs_block", 1315 "$$80 :", 1316 "remote_statement : REMOTE remote_index INHERIT remote_index $$80 remote_specs_inherit_block", 1317 "$$81 :", 1318 "remote_statement : REMOTE remote_index $$81 remote_specs_block", 1319 "remote_specs_inherit_block : remote_specs_block", 1320 "remote_specs_inherit_block : EOS", 1321 "remote_specs_block : BOC remote_specs EOC", 1322 "remote_index : ANONYMOUS ike_port", 1323 "remote_index : ike_addrinfo_port", 1324 "remote_specs :", 1325 "remote_specs : remote_specs remote_spec", 1326 "$$82 :", 1327 "remote_spec : REMOTE_ADDRESS ike_addrinfo_port $$82 EOS", 1328 "$$83 :", 1329 "remote_spec : EXCHANGE_MODE $$83 exchange_types EOS", 1330 "$$84 :", 1331 "remote_spec : DOI DOITYPE $$84 EOS", 1332 "$$85 :", 1333 "remote_spec : SITUATION SITUATIONTYPE $$85 EOS", 1334 "remote_spec : CERTIFICATE_TYPE cert_spec", 1335 "$$86 :", 1336 "remote_spec : PEERS_CERTFILE QUOTEDSTRING $$86 EOS", 1337 "$$87 :", 1338 "remote_spec : PEERS_CERTFILE CERT_X509 QUOTEDSTRING $$87 EOS", 1339 "$$88 :", 1340 "remote_spec : PEERS_CERTFILE CERT_PLAINRSA QUOTEDSTRING $$88 EOS", 1341 "$$89 :", 1342 "remote_spec : PEERS_CERTFILE DNSSEC $$89 EOS", 1343 "$$90 :", 1344 "remote_spec : CA_TYPE CERT_X509 QUOTEDSTRING $$90 EOS", 1345 "$$91 :", 1346 "remote_spec : VERIFY_CERT SWITCH $$91 EOS", 1347 "$$92 :", 1348 "remote_spec : SEND_CERT SWITCH $$92 EOS", 1349 "$$93 :", 1350 "remote_spec : SEND_CR SWITCH $$93 EOS", 1351 "$$94 :", 1352 "remote_spec : MATCH_EMPTY_CR SWITCH $$94 EOS", 1353 "$$95 :", 1354 "remote_spec : MY_IDENTIFIER IDENTIFIERTYPE identifierstring $$95 EOS", 1355 "$$96 :", 1356 "remote_spec : MY_IDENTIFIER IDENTIFIERTYPE IDENTIFIERQUAL identifierstring $$96 EOS", 1357 "$$97 :", 1358 "remote_spec : XAUTH_LOGIN identifierstring $$97 EOS", 1359 "$$98 :", 1360 "remote_spec : PEERS_IDENTIFIER IDENTIFIERTYPE identifierstring $$98 EOS", 1361 "$$99 :", 1362 "remote_spec : PEERS_IDENTIFIER IDENTIFIERTYPE IDENTIFIERQUAL identifierstring $$99 EOS", 1363 "$$100 :", 1364 "remote_spec : VERIFY_IDENTIFIER SWITCH $$100 EOS", 1365 "$$101 :", 1366 "remote_spec : NONCE_SIZE NUMBER $$101 EOS", 1367 "$$102 :", 1368 "remote_spec : DH_GROUP $$102 dh_group_num EOS", 1369 "$$103 :", 1370 "remote_spec : PASSIVE SWITCH $$103 EOS", 1371 "$$104 :", 1372 "remote_spec : IKE_FRAG SWITCH $$104 EOS", 1373 "$$105 :", 1374 "remote_spec : IKE_FRAG REMOTE_FORCE_LEVEL $$105 EOS", 1375 "$$106 :", 1376 "remote_spec : ESP_FRAG NUMBER $$106 EOS", 1377 "$$107 :", 1378 "remote_spec : SCRIPT QUOTEDSTRING PHASE1_UP $$107 EOS", 1379 "$$108 :", 1380 "remote_spec : SCRIPT QUOTEDSTRING PHASE1_DOWN $$108 EOS", 1381 "$$109 :", 1382 "remote_spec : SCRIPT QUOTEDSTRING PHASE1_DEAD $$109 EOS", 1383 "$$110 :", 1384 "remote_spec : MODE_CFG SWITCH $$110 EOS", 1385 "$$111 :", 1386 "remote_spec : WEAK_PHASE1_CHECK SWITCH $$111 EOS", 1387 "$$112 :", 1388 "remote_spec : GENERATE_POLICY SWITCH $$112 EOS", 1389 "$$113 :", 1390 "remote_spec : GENERATE_POLICY GENERATE_LEVEL $$113 EOS", 1391 "$$114 :", 1392 "remote_spec : SUPPORT_PROXY SWITCH $$114 EOS", 1393 "$$115 :", 1394 "remote_spec : INITIAL_CONTACT SWITCH $$115 EOS", 1395 "$$116 :", 1396 "remote_spec : NAT_TRAVERSAL SWITCH $$116 EOS", 1397 "$$117 :", 1398 "remote_spec : NAT_TRAVERSAL REMOTE_FORCE_LEVEL $$117 EOS", 1399 "$$118 :", 1400 "remote_spec : DPD SWITCH $$118 EOS", 1401 "$$119 :", 1402 "remote_spec : DPD_DELAY NUMBER $$119 EOS", 1403 "$$120 :", 1404 "remote_spec : DPD_RETRY NUMBER $$120 EOS", 1405 "$$121 :", 1406 "remote_spec : DPD_MAXFAIL NUMBER $$121 EOS", 1407 "$$122 :", 1408 "remote_spec : REKEY SWITCH $$122 EOS", 1409 "$$123 :", 1410 "remote_spec : REKEY REMOTE_FORCE_LEVEL $$123 EOS", 1411 "$$124 :", 1412 "remote_spec : PH1ID NUMBER $$124 EOS", 1413 "$$125 :", 1414 "remote_spec : LIFETIME LIFETYPE_TIME NUMBER unittype_time $$125 EOS", 1415 "$$126 :", 1416 "remote_spec : PROPOSAL_CHECK PROPOSAL_CHECK_LEVEL $$126 EOS", 1417 "$$127 :", 1418 "remote_spec : LIFETIME LIFETYPE_BYTE NUMBER unittype_byte $$127 EOS", 1419 "$$128 :", 1420 "remote_spec : PROPOSAL $$128 BOC isakmpproposal_specs EOC", 1421 "exchange_types :", 1422 "exchange_types : exchange_types EXCHANGETYPE", 1423 "$$129 :", 1424 "cert_spec : CERT_X509 QUOTEDSTRING QUOTEDSTRING $$129 EOS", 1425 "$$130 :", 1426 "cert_spec : CERT_PLAINRSA QUOTEDSTRING $$130 EOS", 1427 "dh_group_num : ALGORITHMTYPE", 1428 "dh_group_num : NUMBER", 1429 "identifierstring :", 1430 "identifierstring : ADDRSTRING", 1431 "identifierstring : QUOTEDSTRING", 1432 "isakmpproposal_specs :", 1433 "isakmpproposal_specs : isakmpproposal_specs isakmpproposal_spec", 1434 "$$131 :", 1435 "isakmpproposal_spec : LIFETIME LIFETYPE_TIME NUMBER unittype_time $$131 EOS", 1436 "$$132 :", 1437 "isakmpproposal_spec : LIFETIME LIFETYPE_BYTE NUMBER unittype_byte $$132 EOS", 1438 "$$133 :", 1439 "isakmpproposal_spec : DH_GROUP dh_group_num $$133 EOS", 1440 "$$134 :", 1441 "isakmpproposal_spec : GSS_ID QUOTEDSTRING $$134 EOS", 1442 "$$135 :", 1443 "isakmpproposal_spec : ALGORITHM_CLASS ALGORITHMTYPE keylength $$135 EOS", 1444 "unittype_time : UNITTYPE_SEC", 1445 "unittype_time : UNITTYPE_MIN", 1446 "unittype_time : UNITTYPE_HOUR", 1447 "unittype_byte : UNITTYPE_BYTE", 1448 "unittype_byte : UNITTYPE_KBYTES", 1449 "unittype_byte : UNITTYPE_MBYTES", 1450 "unittype_byte : UNITTYPE_TBYTES", 1451 1452 }; 1453 #endif 1454 1455 int yydebug; 1456 int yynerrs; 1457 1458 int yyerrflag; 1459 int yychar; 1460 YYSTYPE yyval; 1461 YYSTYPE yylval; 1462 1463 /* define the initial stack-sizes */ 1464 #ifdef YYSTACKSIZE 1465 #undef YYMAXDEPTH 1466 #define YYMAXDEPTH YYSTACKSIZE 743 1467 #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; 1468 #ifdef YYMAXDEPTH 1469 #define YYSTACKSIZE YYMAXDEPTH 752 1470 #else 753 typedef short int yytype_int8; 754 #endif 755 756 #ifdef YYTYPE_UINT16 757 typedef YYTYPE_UINT16 yytype_uint16; 1471 #define YYSTACKSIZE 10000 1472 #define YYMAXDEPTH 10000 1473 #endif 1474 #endif 1475 1476 #define YYINITSTACKSIZE 200 1477 1478 typedef struct { 1479 unsigned stacksize; 1480 YYINT *s_base; 1481 YYINT *s_mark; 1482 YYINT *s_last; 1483 YYSTYPE *l_base; 1484 YYSTYPE *l_mark; 1485 } YYSTACKDATA; 1486 /* variables for the parser stack */ 1487 static YYSTACKDATA yystack; 1488 #line 2399 "../../ipsec-tools/src/racoon/cfparse.y" 1489 1490 static struct secprotospec * 1491 newspspec() 1492 { 1493 struct secprotospec *new; 1494 1495 new = racoon_calloc(1, sizeof(*new)); 1496 if (new == NULL) { 1497 yyerror("failed to allocate spproto"); 1498 return NULL; 1499 } 1500 1501 new->encklen = 0; /*XXX*/ 1502 1503 /* 1504 * Default to "uknown" vendor -- we will override this 1505 * as necessary. When we send a Vendor ID payload, an 1506 * "unknown" will be translated to a KAME/racoon ID. 1507 */ 1508 new->vendorid = VENDORID_UNKNOWN; 1509 1510 return new; 1511 } 1512 1513 /* 1514 * insert into head of list. 1515 */ 1516 static void 1517 insspspec(rmconf, spspec) 1518 struct remoteconf *rmconf; 1519 struct secprotospec *spspec; 1520 { 1521 if (rmconf->spspec != NULL) 1522 rmconf->spspec->prev = spspec; 1523 spspec->next = rmconf->spspec; 1524 rmconf->spspec = spspec; 1525 } 1526 1527 static struct secprotospec * 1528 dupspspec(spspec) 1529 struct secprotospec *spspec; 1530 { 1531 struct secprotospec *new; 1532 1533 new = newspspec(); 1534 if (new == NULL) { 1535 plog(LLV_ERROR, LOCATION, NULL, 1536 "dupspspec: malloc failed\n"); 1537 return NULL; 1538 } 1539 memcpy(new, spspec, sizeof(*new)); 1540 1541 if (spspec->gssid) { 1542 new->gssid = racoon_strdup(spspec->gssid); 1543 STRDUP_FATAL(new->gssid); 1544 } 1545 if (spspec->remote) { 1546 new->remote = racoon_malloc(sizeof(*new->remote)); 1547 if (new->remote == NULL) { 1548 plog(LLV_ERROR, LOCATION, NULL, 1549 "dupspspec: malloc failed (remote)\n"); 1550 return NULL; 1551 } 1552 memcpy(new->remote, spspec->remote, sizeof(*new->remote)); 1553 } 1554 1555 return new; 1556 } 1557 1558 /* 1559 * copy the whole list 1560 */ 1561 void 1562 dupspspec_list(dst, src) 1563 struct remoteconf *dst, *src; 1564 { 1565 struct secprotospec *p, *new, *last; 1566 1567 for(p = src->spspec, last = NULL; p; p = p->next, last = new) { 1568 new = dupspspec(p); 1569 if (new == NULL) 1570 exit(1); 1571 1572 new->prev = last; 1573 new->next = NULL; /* not necessary but clean */ 1574 1575 if (last) 1576 last->next = new; 1577 else /* first element */ 1578 dst->spspec = new; 1579 1580 } 1581 } 1582 1583 /* 1584 * delete the whole list 1585 */ 1586 void 1587 flushspspec(rmconf) 1588 struct remoteconf *rmconf; 1589 { 1590 struct secprotospec *p; 1591 1592 while(rmconf->spspec != NULL) { 1593 p = rmconf->spspec; 1594 rmconf->spspec = p->next; 1595 if (p->next != NULL) 1596 p->next->prev = NULL; /* not necessary but clean */ 1597 1598 if (p->gssid) 1599 racoon_free(p->gssid); 1600 if (p->remote) 1601 racoon_free(p->remote); 1602 racoon_free(p); 1603 } 1604 rmconf->spspec = NULL; 1605 } 1606 1607 /* set final acceptable proposal */ 1608 static int 1609 set_isakmp_proposal(rmconf) 1610 struct remoteconf *rmconf; 1611 { 1612 struct secprotospec *s; 1613 int prop_no = 1; 1614 int trns_no = 1; 1615 int32_t types[MAXALGCLASS]; 1616 1617 /* mandatory check */ 1618 if (rmconf->spspec == NULL) { 1619 yyerror("no remote specification found: %s.\n", 1620 saddr2str(rmconf->remote)); 1621 return -1; 1622 } 1623 for (s = rmconf->spspec; s != NULL; s = s->next) { 1624 /* XXX need more to check */ 1625 if (s->algclass[algclass_isakmp_enc] == 0) { 1626 yyerror("encryption algorithm required."); 1627 return -1; 1628 } 1629 if (s->algclass[algclass_isakmp_hash] == 0) { 1630 yyerror("hash algorithm required."); 1631 return -1; 1632 } 1633 if (s->algclass[algclass_isakmp_dh] == 0) { 1634 yyerror("DH group required."); 1635 return -1; 1636 } 1637 if (s->algclass[algclass_isakmp_ameth] == 0) { 1638 yyerror("authentication method required."); 1639 return -1; 1640 } 1641 } 1642 1643 /* skip to last part */ 1644 for (s = rmconf->spspec; s->next != NULL; s = s->next) 1645 ; 1646 1647 while (s != NULL) { 1648 plog(LLV_DEBUG2, LOCATION, NULL, 1649 "lifetime = %ld\n", (long) 1650 (s->lifetime ? s->lifetime : rmconf->lifetime)); 1651 plog(LLV_DEBUG2, LOCATION, NULL, 1652 "lifebyte = %d\n", 1653 s->lifebyte ? s->lifebyte : rmconf->lifebyte); 1654 plog(LLV_DEBUG2, LOCATION, NULL, 1655 "encklen=%d\n", s->encklen); 1656 1657 memset(types, 0, ARRAYLEN(types)); 1658 types[algclass_isakmp_enc] = s->algclass[algclass_isakmp_enc]; 1659 types[algclass_isakmp_hash] = s->algclass[algclass_isakmp_hash]; 1660 types[algclass_isakmp_dh] = s->algclass[algclass_isakmp_dh]; 1661 types[algclass_isakmp_ameth] = 1662 s->algclass[algclass_isakmp_ameth]; 1663 1664 /* expanding spspec */ 1665 clean_tmpalgtype(); 1666 trns_no = expand_isakmpspec(prop_no, trns_no, types, 1667 algclass_isakmp_enc, algclass_isakmp_ameth + 1, 1668 s->lifetime ? s->lifetime : rmconf->lifetime, 1669 s->lifebyte ? s->lifebyte : rmconf->lifebyte, 1670 s->encklen, s->vendorid, s->gssid, 1671 rmconf); 1672 if (trns_no == -1) { 1673 plog(LLV_ERROR, LOCATION, NULL, 1674 "failed to expand isakmp proposal.\n"); 1675 return -1; 1676 } 1677 1678 s = s->prev; 1679 } 1680 1681 if (rmconf->proposal == NULL) { 1682 plog(LLV_ERROR, LOCATION, NULL, 1683 "no proposal found.\n"); 1684 return -1; 1685 } 1686 1687 return 0; 1688 } 1689 1690 static void 1691 clean_tmpalgtype() 1692 { 1693 int i; 1694 for (i = 0; i < MAXALGCLASS; i++) 1695 tmpalgtype[i] = 0; /* means algorithm undefined. */ 1696 } 1697 1698 static int 1699 expand_isakmpspec(prop_no, trns_no, types, 1700 class, last, lifetime, lifebyte, encklen, vendorid, gssid, 1701 rmconf) 1702 int prop_no, trns_no; 1703 int *types, class, last; 1704 time_t lifetime; 1705 int lifebyte; 1706 int encklen; 1707 int vendorid; 1708 char *gssid; 1709 struct remoteconf *rmconf; 1710 { 1711 struct isakmpsa *new; 1712 1713 /* debugging */ 1714 { 1715 int j; 1716 char tb[10]; 1717 plog(LLV_DEBUG2, LOCATION, NULL, 1718 "p:%d t:%d\n", prop_no, trns_no); 1719 for (j = class; j < MAXALGCLASS; j++) { 1720 snprintf(tb, sizeof(tb), "%d", types[j]); 1721 plog(LLV_DEBUG2, LOCATION, NULL, 1722 "%s%s%s%s\n", 1723 s_algtype(j, types[j]), 1724 types[j] ? "(" : "", 1725 tb[0] == '0' ? "" : tb, 1726 types[j] ? ")" : ""); 1727 } 1728 plog(LLV_DEBUG2, LOCATION, NULL, "\n"); 1729 } 1730 1731 #define TMPALGTYPE2STR(n) \ 1732 s_algtype(algclass_isakmp_##n, types[algclass_isakmp_##n]) 1733 /* check mandatory values */ 1734 if (types[algclass_isakmp_enc] == 0 1735 || types[algclass_isakmp_ameth] == 0 1736 || types[algclass_isakmp_hash] == 0 1737 || types[algclass_isakmp_dh] == 0) { 1738 yyerror("few definition of algorithm " 1739 "enc=%s ameth=%s hash=%s dhgroup=%s.\n", 1740 TMPALGTYPE2STR(enc), 1741 TMPALGTYPE2STR(ameth), 1742 TMPALGTYPE2STR(hash), 1743 TMPALGTYPE2STR(dh)); 1744 return -1; 1745 } 1746 #undef TMPALGTYPE2STR 1747 1748 /* set new sa */ 1749 new = newisakmpsa(); 1750 if (new == NULL) { 1751 &