$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
--- ipsec-tools-0.7.2.orig/src/setkey/token.c	2008-07-23 10:26:58.000000000 +0200
+++ ipsec-tools-0.7.2/src/setkey/token.c	2009-05-29 15:26:39.126303087 +0200
@@ -8,7 +8,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 34
+#define YY_FLEX_SUBMINOR_VERSION 35
 #if YY_FLEX_SUBMINOR_VERSION > 0
 #define FLEX_BETA
 #endif
@@ -178,13 +178,6 @@ extern FILE *yyin, *yyout;
 
 #define unput(c) yyunput( c, (yytext_ptr)  )
 
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- * Given that the standard has decreed that size_t exists since 1989,
- * I guess we can afford to depend on it. Manoj.
- */
-
 #ifndef YY_TYPEDEF_YY_SIZE_T
 #define YY_TYPEDEF_YY_SIZE_T
 typedef size_t yy_size_t;
@@ -1069,9 +1062,10 @@ char *yytext;
 #if defined(SADB_X_EALG_AES) && ! defined(SADB_X_EALG_AESCBC)
 #define SADB_X_EALG_AESCBC  SADB_X_EALG_AES
 #endif
+int yywrap(void) { return 1; }
 /* common section */
 
-#line 1075 "token.c"
+#line 1069 "token.c"
 
 #define INITIAL 0
 #define S_PL 1
@@ -1092,6 +1086,35 @@ char *yytext;
 
 static int yy_init_globals (void );
 
+/* Accessor methods to globals.
+   These are made visible to non-reentrant scanners for convenience. */
+
+int yylex_destroy (void );
+
+int yyget_debug (void );
+
+void yyset_debug (int debug_flag  );
+
+YY_EXTRA_TYPE yyget_extra (void );
+
+void yyset_extra (YY_EXTRA_TYPE user_defined  );
+
+FILE *yyget_in (void );
+
+void yyset_in  (FILE * in_str  );
+
+FILE *yyget_out (void );
+
+void yyset_out  (FILE * out_str  );
+
+int yyget_leng (void );
+
+char *yyget_text (void );
+
+int yyget_lineno (void );
+
+void yyset_lineno (int line_number  );
+
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
  */
@@ -1227,10 +1250,10 @@ YY_DECL
 	register char *yy_cp, *yy_bp;
 	register int yy_act;
     
-#line 114 "token.l"
+#line 115 "token.l"
 
 
-#line 1234 "token.c"
+#line 1257 "token.c"
 
 	if ( !(yy_init) )
 		{
@@ -1321,84 +1344,84 @@ do_action:	/* This label is used only to
 
 case 1:
 YY_RULE_SETUP
-#line 116 "token.l"
+#line 117 "token.l"
 { return(ADD); }
 	YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 117 "token.l"
+#line 118 "token.l"
 { return(DELETE); }
 	YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 118 "token.l"
+#line 119 "token.l"
 { return(DELETEALL); }
 	YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 119 "token.l"
+#line 120 "token.l"
 { return(GET); }
 	YY_BREAK
 case 5:
 YY_RULE_SETUP
-#line 120 "token.l"
+#line 121 "token.l"
 { return(FLUSH); }
 	YY_BREAK
 case 6:
 YY_RULE_SETUP
-#line 121 "token.l"
+#line 122 "token.l"
 { return(DUMP); }
 	YY_BREAK
 case 7:
 YY_RULE_SETUP
-#line 122 "token.l"
+#line 123 "token.l"
 { return(EXIT); }
 	YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 123 "token.l"
+#line 124 "token.l"
 { return(EXIT); }
 	YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 124 "token.l"
+#line 125 "token.l"
 { return(EXIT); }
 	YY_BREAK
 /* for management SPD */
 case 10:
 YY_RULE_SETUP
-#line 127 "token.l"
+#line 128 "token.l"
 { return(SPDADD); }
 	YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 128 "token.l"
+#line 129 "token.l"
 { return(SPDDELETE); }
 	YY_BREAK
 case 12:
 YY_RULE_SETUP
-#line 129 "token.l"
+#line 130 "token.l"
 { return(SPDDUMP); }
 	YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 130 "token.l"
+#line 131 "token.l"
 { return(SPDFLUSH); }
 	YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 131 "token.l"
+#line 132 "token.l"
 { return(TAGGED); }
 	YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 132 "token.l"
+#line 133 "token.l"
 { BEGIN S_PL; return(F_POLICY); }
 	YY_BREAK
 case 16:
 /* rule 16 can match eol */
 YY_RULE_SETUP
-#line 133 "token.l"
+#line 134 "token.l"
 {
 			yymore();
 
@@ -1420,13 +1443,13 @@ YY_RULE_SETUP
 	YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 151 "token.l"
+#line 152 "token.l"
 { BEGIN INITIAL; return(EOT); }
 	YY_BREAK
 /* address resolution flags */
 case 18:
 YY_RULE_SETUP
-#line 154 "token.l"
+#line 155 "token.l"
 {
 			yylval.val.len = strlen(yytext);
 			yylval.val.buf = strdup(yytext);
@@ -1438,37 +1461,37 @@ YY_RULE_SETUP
 /* security protocols */
 case 19:
 YY_RULE_SETUP
-#line 163 "token.l"
+#line 164 "token.l"
 { yylval.num = 0; return(PR_AH); }
 	YY_BREAK
 case 20:
 YY_RULE_SETUP
-#line 164 "token.l"
+#line 165 "token.l"
 { yylval.num = 0; return(PR_ESP); }
 	YY_BREAK
 case 21:
 YY_RULE_SETUP
-#line 165 "token.l"
+#line 166 "token.l"
 { yylval.num = 1; return(PR_AH); }
 	YY_BREAK
 case 22:
 YY_RULE_SETUP
-#line 166 "token.l"
+#line 167 "token.l"
 { yylval.num = 1; return(PR_ESP); }
 	YY_BREAK
 case 23:
 YY_RULE_SETUP
-#line 167 "token.l"
+#line 168 "token.l"
 { yylval.num = 0; return(PR_ESPUDP); }
 	YY_BREAK
 case 24:
 YY_RULE_SETUP
-#line 168 "token.l"
+#line 169 "token.l"
 { yylval.num = 0; return(PR_IPCOMP); }
 	YY_BREAK
 case 25:
 YY_RULE_SETUP
-#line 169 "token.l"
+#line 170 "token.l"
 { 
 			yylval.num = 0; return(PR_TCP); 
 		}
@@ -1476,72 +1499,72 @@ YY_RULE_SETUP
 /* authentication alogorithm */
 case 26:
 YY_RULE_SETUP
-#line 174 "token.l"
+#line 175 "token.l"
 { BEGIN S_AUTHALG; return(F_AUTH); }
 	YY_BREAK
 case 27:
 YY_RULE_SETUP
-#line 175 "token.l"
+#line 176 "token.l"
 { yylval.num = SADB_AALG_MD5HMAC; BEGIN INITIAL; return(ALG_AUTH); }
 	YY_BREAK
 case 28:
 YY_RULE_SETUP
-#line 176 "token.l"
+#line 177 "token.l"
 { yylval.num = SADB_AALG_SHA1HMAC; BEGIN INITIAL; return(ALG_AUTH); }
 	YY_BREAK
 case 29:
 YY_RULE_SETUP
-#line 177 "token.l"
+#line 178 "token.l"
 { yylval.num = SADB_X_AALG_MD5; BEGIN INITIAL; return(ALG_AUTH); }
 	YY_BREAK
 case 30:
 YY_RULE_SETUP
-#line 178 "token.l"
+#line 179 "token.l"
 { yylval.num = SADB_X_AALG_SHA; BEGIN INITIAL; return(ALG_AUTH); }
 	YY_BREAK
 case 31:
 YY_RULE_SETUP
-#line 179 "token.l"
+#line 180 "token.l"
 { yylval.num = SADB_X_AALG_SHA2_256; BEGIN INITIAL; return(ALG_AUTH); }
 	YY_BREAK
 case 32:
 YY_RULE_SETUP
-#line 180 "token.l"
+#line 181 "token.l"
 { yylval.num = SADB_X_AALG_SHA2_256; BEGIN INITIAL; return(ALG_AUTH); }
 	YY_BREAK
 case 33:
 YY_RULE_SETUP
-#line 181 "token.l"
+#line 182 "token.l"
 { yylval.num = SADB_X_AALG_SHA2_384; BEGIN INITIAL; return(ALG_AUTH); }
 	YY_BREAK
 case 34:
 YY_RULE_SETUP
-#line 182 "token.l"
+#line 183 "token.l"
 { yylval.num = SADB_X_AALG_SHA2_384; BEGIN INITIAL; return(ALG_AUTH); }
 	YY_BREAK
 case 35:
 YY_RULE_SETUP
-#line 183 "token.l"
+#line 184 "token.l"
 { yylval.num = SADB_X_AALG_SHA2_512; BEGIN INITIAL; return(ALG_AUTH); }
 	YY_BREAK
 case 36:
 YY_RULE_SETUP
-#line 184 "token.l"
+#line 185 "token.l"
 { yylval.num = SADB_X_AALG_SHA2_512; BEGIN INITIAL; return(ALG_AUTH); }
 	YY_BREAK
 case 37:
 YY_RULE_SETUP
-#line 185 "token.l"
+#line 186 "token.l"
 { yylval.num = SADB_X_AALG_RIPEMD160HMAC; BEGIN INITIAL; return(ALG_AUTH); }
 	YY_BREAK
 case 38:
 YY_RULE_SETUP
-#line 186 "token.l"
+#line 187 "token.l"
 { yylval.num = SADB_X_AALG_AES_XCBC_MAC; BEGIN INITIAL; return(ALG_AUTH); }
 	YY_BREAK
 case 39:
 YY_RULE_SETUP
-#line 187 "token.l"
+#line 188 "token.l"
 { 
 #ifdef SADB_X_AALG_TCP_MD5
 				yylval.num = SADB_X_AALG_TCP_MD5; 
@@ -1552,63 +1575,63 @@ YY_RULE_SETUP
 	YY_BREAK
 case 40:
 YY_RULE_SETUP
-#line 194 "token.l"
+#line 195 "token.l"
 { yylval.num = SADB_X_AALG_NULL; BEGIN INITIAL; return(ALG_AUTH_NOKEY); }
 	YY_BREAK
 /* encryption alogorithm */
 case 41:
 YY_RULE_SETUP
-#line 197 "token.l"
+#line 198 "token.l"
 { BEGIN S_ENCALG; return(F_ENC); }
 	YY_BREAK
 case 42:
 YY_RULE_SETUP
-#line 198 "token.l"
+#line 199 "token.l"
 { yylval.num = SADB_EALG_DESCBC; BEGIN INITIAL; return(ALG_ENC); }
 	YY_BREAK
 case 43:
 YY_RULE_SETUP
-#line 199 "token.l"
+#line 200 "token.l"
 { yylval.num = SADB_EALG_3DESCBC; BEGIN INITIAL; return(ALG_ENC); }
 	YY_BREAK
 case 44:
 YY_RULE_SETUP
-#line 200 "token.l"
+#line 201 "token.l"
 { yylval.num = SADB_EALG_NULL; BEGIN INITIAL; return(ALG_ENC_NOKEY); }
 	YY_BREAK
 case 45:
 YY_RULE_SETUP
-#line 201 "token.l"
+#line 202 "token.l"
 { yylval.num = SADB_EALG_NULL; BEGIN INITIAL; return(ALG_ENC_OLD); }
 	YY_BREAK
 case 46:
 YY_RULE_SETUP
-#line 202 "token.l"
+#line 203 "token.l"
 { yylval.num = SADB_X_EALG_BLOWFISHCBC; BEGIN INITIAL; return(ALG_ENC); }
 	YY_BREAK
 case 47:
 YY_RULE_SETUP
-#line 203 "token.l"
+#line 204 "token.l"
 { yylval.num = SADB_X_EALG_CAST128CBC; BEGIN INITIAL; return(ALG_ENC); }
 	YY_BREAK
 case 48:
 YY_RULE_SETUP
-#line 204 "token.l"
+#line 205 "token.l"
 { yylval.num = SADB_EALG_DESCBC; BEGIN INITIAL; return(ALG_ENC_DESDERIV); }
 	YY_BREAK
 case 49:
 YY_RULE_SETUP
-#line 205 "token.l"
+#line 206 "token.l"
 { yylval.num = SADB_EALG_DESCBC; BEGIN INITIAL; return(ALG_ENC_DES32IV); }
 	YY_BREAK
 case 50:
 YY_RULE_SETUP
-#line 206 "token.l"
+#line 207 "token.l"
 { yylval.num = SADB_X_EALG_TWOFISHCBC; BEGIN INITIAL; return(ALG_ENC); }
 	YY_BREAK
 case 51:
 YY_RULE_SETUP
-#line 207 "token.l"
+#line 208 "token.l"
 { 
 #ifdef SADB_X_EALG_AESCBC
 	yylval.num = SADB_X_EALG_AESCBC; BEGIN INITIAL; return(ALG_ENC); 
@@ -1617,7 +1640,7 @@ YY_RULE_SETUP
 	YY_BREAK
 case 52:
 YY_RULE_SETUP
-#line 212 "token.l"
+#line 213 "token.l"
 { 
 #ifdef SADB_X_EALG_AESCBC
 	yylval.num = SADB_X_EALG_AESCBC; BEGIN INITIAL; return(ALG_ENC); 
@@ -1626,12 +1649,12 @@ YY_RULE_SETUP
 	YY_BREAK
 case 53:
 YY_RULE_SETUP
-#line 217 "token.l"
+#line 218 "token.l"
 { yylval.num = SADB_X_EALG_AESCTR; BEGIN INITIAL; return(ALG_ENC); }
 	YY_BREAK
 case 54:
 YY_RULE_SETUP
-#line 218 "token.l"
+#line 219 "token.l"
 { 
 #ifdef SADB_X_EALG_CAMELLIACBC
 	yylval.num = SADB_X_EALG_CAMELLIACBC; BEGIN INITIAL; return(ALG_ENC); 
@@ -1641,152 +1664,152 @@ YY_RULE_SETUP
 /* compression algorithms */
 case 55:
 YY_RULE_SETUP
-#line 225 "token.l"
+#line 226 "token.l"
 { return(F_COMP); }
 	YY_BREAK
 case 56:
 YY_RULE_SETUP
-#line 226 "token.l"
+#line 227 "token.l"
 { yylval.num = SADB_X_CALG_OUI; return(ALG_COMP); }
 	YY_BREAK
 case 57:
 YY_RULE_SETUP
-#line 227 "token.l"
+#line 228 "token.l"
 { yylval.num = SADB_X_CALG_DEFLATE; return(ALG_COMP); }
 	YY_BREAK
 case 58:
 YY_RULE_SETUP
-#line 228 "token.l"
+#line 229 "token.l"
 { yylval.num = SADB_X_CALG_LZS; return(ALG_COMP); }
 	YY_BREAK
 case 59:
 YY_RULE_SETUP
-#line 229 "token.l"
+#line 230 "token.l"
 { return(F_RAWCPI); }
 	YY_BREAK
 /* extension */
 case 60:
 YY_RULE_SETUP
-#line 232 "token.l"
+#line 233 "token.l"
 { return(F_MODE); }
 	YY_BREAK
 case 61:
 YY_RULE_SETUP
-#line 233 "token.l"
+#line 234 "token.l"
 { yylval.num = IPSEC_MODE_TRANSPORT; return(MODE); }
 	YY_BREAK
 case 62:
 YY_RULE_SETUP
-#line 234 "token.l"
+#line 235 "token.l"
 { yylval.num = IPSEC_MODE_TUNNEL; return(MODE); }
 	YY_BREAK
 case 63:
 YY_RULE_SETUP
-#line 235 "token.l"
+#line 236 "token.l"
 { return(F_REQID); }
 	YY_BREAK
 case 64:
 YY_RULE_SETUP
-#line 236 "token.l"
+#line 237 "token.l"
 { return(F_EXT); }
 	YY_BREAK
 case 65:
 YY_RULE_SETUP
-#line 237 "token.l"
+#line 238 "token.l"
 { yylval.num = SADB_X_EXT_PRAND; return(EXTENSION); }
 	YY_BREAK
 case 66:
 YY_RULE_SETUP
-#line 238 "token.l"
+#line 239 "token.l"
 { yylval.num = SADB_X_EXT_PSEQ; return(EXTENSION); }
 	YY_BREAK
 case 67:
 YY_RULE_SETUP
-#line 239 "token.l"
+#line 240 "token.l"
 { yylval.num = SADB_X_EXT_PZERO; return(EXTENSION); }
 	YY_BREAK
 case 68:
 YY_RULE_SETUP
-#line 240 "token.l"
+#line 241 "token.l"
 { return(NOCYCLICSEQ); }
 	YY_BREAK
 case 69:
 YY_RULE_SETUP
-#line 241 "token.l"
+#line 242 "token.l"
 { return(F_REPLAY); }
 	YY_BREAK
 case 70:
 YY_RULE_SETUP
-#line 242 "token.l"
+#line 243 "token.l"
 { return(F_LIFETIME_HARD); }
 	YY_BREAK
 case 71:
 YY_RULE_SETUP
-#line 243 "token.l"
+#line 244 "token.l"
 { return(F_LIFETIME_SOFT); }
 	YY_BREAK
 case 72:
 YY_RULE_SETUP
-#line 244 "token.l"
+#line 245 "token.l"
 { return(F_LIFEBYTE_HARD); }
 	YY_BREAK
 case 73:
 YY_RULE_SETUP
-#line 245 "token.l"
+#line 246 "token.l"
 { return(F_LIFEBYTE_SOFT); }
 	YY_BREAK
 case 74:
 YY_RULE_SETUP
-#line 246 "token.l"
+#line 247 "token.l"
 { return(SECURITY_CTX); }
 	YY_BREAK
 /* ... */
 case 75:
 YY_RULE_SETUP
-#line 249 "token.l"
+#line 250 "token.l"
 { return(ANY); }
 	YY_BREAK
 case 76:
 YY_RULE_SETUP
-#line 250 "token.l"
+#line 251 "token.l"
 { }
 	YY_BREAK
 case 77:
 /* rule 77 can match eol */
 YY_RULE_SETUP
-#line 251 "token.l"
+#line 252 "token.l"
 { lineno++; }
 	YY_BREAK
 case 78:
 YY_RULE_SETUP
-#line 252 "token.l"
+#line 253 "token.l"
 
 	YY_BREAK
 case 79:
 YY_RULE_SETUP
-#line 253 "token.l"
+#line 254 "token.l"
 { return(EOT); }
 	YY_BREAK
 /* for address parameters: /prefix, [port] */
 case 80:
 YY_RULE_SETUP
-#line 256 "token.l"
+#line 257 "token.l"
 { return SLASH; }
 	YY_BREAK
 case 81:
 YY_RULE_SETUP
-#line 257 "token.l"
+#line 258 "token.l"
 { return BLCL; }
 	YY_BREAK
 case 82:
 YY_RULE_SETUP
-#line 258 "token.l"
+#line 259 "token.l"
 { return ELCL; }
 	YY_BREAK
 /* parameter */
 case 83:
 YY_RULE_SETUP
-#line 261 "token.l"
+#line 262 "token.l"
 {
 			char *bp;
 
@@ -1796,7 +1819,7 @@ YY_RULE_SETUP
 	YY_BREAK
 case 84:
 YY_RULE_SETUP
-#line 268 "token.l"
+#line 269 "token.l"
 {
 			yylval.val.buf = strdup(yytext + 2);
 			if (!yylval.val.buf)
@@ -1809,7 +1832,7 @@ YY_RULE_SETUP
 case 85:
 /* rule 85 can match eol */
 YY_RULE_SETUP
-#line 277 "token.l"
+#line 278 "token.l"
 {
 			char *p = yytext;
 			while (*++p != '"') ;
@@ -1825,7 +1848,7 @@ YY_RULE_SETUP
 	YY_BREAK
 case 86:
 YY_RULE_SETUP
-#line 290 "token.l"
+#line 291 "token.l"
 {
 			yylval.val.len = yyleng;
 			yylval.val.buf = strdup(yytext);
@@ -1836,7 +1859,7 @@ YY_RULE_SETUP
 	YY_BREAK
 case 87:
 YY_RULE_SETUP
-#line 298 "token.l"
+#line 299 "token.l"
 {
 			yylval.val.len = yyleng;
 			yylval.val.buf = strdup(yytext);
@@ -1847,7 +1870,7 @@ YY_RULE_SETUP
 	YY_BREAK
 case 88:
 YY_RULE_SETUP
-#line 306 "token.l"
+#line 307 "token.l"
 {
 			yyfatal("Syntax error");
 			/*NOTREACHED*/
@@ -1855,10 +1878,10 @@ YY_RULE_SETUP
 	YY_BREAK
 case 89:
 YY_RULE_SETUP
-#line 311 "token.l"
+#line 312 "token.l"
 ECHO;
 	YY_BREAK
-#line 1862 "token.c"
+#line 1885 "token.c"
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(S_PL):
 case YY_STATE_EOF(S_AUTHALG):
@@ -2411,9 +2434,19 @@ static void yy_load_buffer_state  (void)
 	yyfree((void *) b  );
 }
 
-#ifndef __cplusplus
+#ifndef _UNISTD_H /* assume unistd.h has isatty() for us */
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __THROW /* this is a gnuism */
+extern int isatty (int ) __THROW;
+#else
 extern int isatty (int );
-#endif /* __cplusplus */
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
     
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
@@ -2859,7 +2892,7 @@ void yyfree (void * ptr )
 
 #define YYTABLES_NAME "yytables"
 
-#line 311 "token.l"
+#line 312 "token.l"
 
 
 
