Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Redo previous rework to generate yacc/lex output again and r...



details:   https://anonhg.NetBSD.org/src/rev/c0cf09b27872
branches:  trunk
changeset: 586379:c0cf09b27872
user:      jmc <jmc%NetBSD.org@localhost>
date:      Fri Dec 16 16:25:07 2005 +0000

description:
Redo previous rework to generate yacc/lex output again and remove generated
copies from the import as they don't compile clean across all archs.

diffstat:

 crypto/dist/ipsec-tools/src/libipsec/policy_parse.c |  1545 ----------
 crypto/dist/ipsec-tools/src/libipsec/policy_parse.h |    29 -
 crypto/dist/ipsec-tools/src/libipsec/policy_token.c |  1888 -------------
 crypto/dist/ipsec-tools/src/setkey/parse.c          |  2550 ------------------
 crypto/dist/ipsec-tools/src/setkey/parse.h          |    64 -
 crypto/dist/ipsec-tools/src/setkey/token.c          |  2677 -------------------
 lib/libipsec/Makefile                               |    12 +-
 sbin/setkey/Makefile                                |    12 +-
 8 files changed, 10 insertions(+), 8767 deletions(-)

diffs (truncated from 8835 to 300 lines):

diff -r cf913de61f46 -r c0cf09b27872 crypto/dist/ipsec-tools/src/libipsec/policy_parse.c
--- a/crypto/dist/ipsec-tools/src/libipsec/policy_parse.c       Fri Dec 16 14:16:14 2005 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,1545 +0,0 @@
-/*     $NetBSD: policy_parse.c,v 1.2 2005/11/21 14:20:28 manu Exp $    */
-
-
-/*  A Bison parser, made from policy_parse.y
-    by GNU Bison version 1.28  */
-
-#define YYBISON 1  /* Identify Bison output.  */
-
-#define yyparse __libipsecparse
-#define yylex __libipseclex
-#define yyerror __libipsecerror
-#define yylval __libipseclval
-#define yychar __libipsecchar
-#define yydebug __libipsecdebug
-#define yynerrs __libipsecnerrs
-#define        DIR     257
-#define        PRIORITY        258
-#define        PLUS    259
-#define        PRIO_BASE       260
-#define        PRIO_OFFSET     261
-#define        ACTION  262
-#define        PROTOCOL        263
-#define        MODE    264
-#define        LEVEL   265
-#define        LEVEL_SPECIFY   266
-#define        IPADDRESS       267
-#define        PORT    268
-#define        ME      269
-#define        ANY     270
-#define        SLASH   271
-#define        HYPHEN  272
-
-#line 63 "policy_parse.y"
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-#ifdef HAVE_NETINET6_IPSEC
-#  include <netinet6/ipsec.h>
-#else
-#  include <netinet/ipsec.h>
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <netdb.h>
-
-#include <errno.h>
-
-#include "config.h"
-
-#include "ipsec_strerror.h"
-#include "libpfkey.h"
-
-#ifndef INT32_MAX
-#define INT32_MAX      (0xffffffff)
-#endif
-
-#ifndef INT32_MIN
-#define INT32_MIN      (-INT32_MAX-1)
-#endif
-
-#define ATOX(c) \
-  (isdigit(c) ? (c - '0') : (isupper(c) ? (c - 'A' + 10) : (c - 'a' + 10) ))
-
-static u_int8_t *pbuf = NULL;          /* sadb_x_policy buffer */
-static int tlen = 0;                   /* total length of pbuf */
-static int offset = 0;                 /* offset of pbuf */
-static int p_dir, p_type, p_protocol, p_mode, p_level, p_reqid;
-static u_int32_t p_priority = 0;
-static long p_priority_offset = 0;
-static struct sockaddr *p_src = NULL;
-static struct sockaddr *p_dst = NULL;
-
-struct _val;
-extern void yyerror __P((char *msg));
-static struct sockaddr *parse_sockaddr __P((struct _val *addrbuf,
-    struct _val *portbuf));
-static int rule_check __P((void));
-static int init_x_policy __P((void));
-static int set_x_request __P((struct sockaddr *, struct sockaddr *));
-static int set_sockaddr __P((struct sockaddr *));
-static void policy_parse_request_init __P((void));
-static void *policy_parse __P((const char *, int));
-
-extern void __policy__strbuffer__init__ __P((const char *));
-extern void __policy__strbuffer__free__ __P((void));
-extern int yyparse __P((void));
-extern int yylex __P((void));
-
-extern char *__libipsectext;   /*XXX*/
-
-
-#line 131 "policy_parse.y"
-typedef union {
-       u_int num;
-       u_int32_t num32;
-       struct _val {
-               int len;
-               char *buf;
-       } val;
-} YYSTYPE;
-#include <stdio.h>
-
-#ifndef __cplusplus
-#ifndef __STDC__
-#define const
-#endif
-#endif
-
-
-
-#define        YYFINAL         60
-#define        YYFLAG          -32768
-#define        YYNTBASE        19
-
-#define YYTRANSLATE(x) ((unsigned)(x) <= 272 ? yytranslate[x] : 34)
-
-static const char yytranslate[] = {     0,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     1,     3,     4,     5,     6,
-     7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
-    17,    18
-};
-
-#if YYDEBUG != 0
-static const short yyprhs[] = {     0,
-     0,     1,     6,     7,    14,    15,    23,    24,    31,    32,
-    41,    42,    51,    53,    54,    57,    65,    72,    78,    83,
-    90,    94,    97,    99,   101,   103,   105,   107,   108,   113,
-   114,   121,   125
-};
-
-static const short yyrhs[] = {    -1,
-     3,     8,    20,    26,     0,     0,     3,     4,     7,     8,
-    21,    26,     0,     0,     3,     4,    18,     7,     8,    22,
-    26,     0,     0,     3,     4,     6,     8,    23,    26,     0,
-     0,     3,     4,     6,     5,     7,     8,    24,    26,     0,
-     0,     3,     4,     6,    18,     7,     8,    25,    26,     0,
-     3,     0,     0,    26,    27,     0,    28,    17,    29,    17,
-    31,    17,    30,     0,    28,    17,    29,    17,    31,    17,
-     0,    28,    17,    29,    17,    31,     0,    28,    17,    29,
-    17,     0,    28,    17,    29,    17,    17,    30,     0,    28,
-    17,    29,     0,    28,    17,     0,    28,     0,     9,     0,
-    10,     0,    11,     0,    12,     0,     0,    13,    32,    18,
-    13,     0,     0,    13,    14,    33,    18,    13,    14,     0,
-    15,    18,    16,     0,    16,    18,    15,     0
-};
-
-#endif
-
-#if YYDEBUG != 0
-static const short yyrline[] = { 0,
-   152,   167,   167,   203,   203,   225,   225,   236,   236,   258,
-   258,   280,   280,   293,   294,   306,   307,   308,   309,   310,
-   311,   312,   316,   323,   327,   331,   335,   342,   348,   353,
-   359,   364,   370
-};
-#endif
-
-
-#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
-
-static const char * const yytname[] = {   "$","error","$undefined.","DIR","PRIORITY",
-"PLUS","PRIO_BASE","PRIO_OFFSET","ACTION","PROTOCOL","MODE","LEVEL","LEVEL_SPECIFY",
-"IPADDRESS","PORT","ME","ANY","SLASH","HYPHEN","policy_spec","@1","@2","@3",
-"@4","@5","@6","rules","rule","protocol","mode","level","addresses","@7","@8", NULL
-};
-#endif
-
-static const short yyr1[] = {     0,
-    20,    19,    21,    19,    22,    19,    23,    19,    24,    19,
-    25,    19,    19,    26,    26,    27,    27,    27,    27,    27,
-    27,    27,    27,    28,    29,    30,    30,    32,    31,    33,
-    31,    31,    31
-};
-
-static const short yyr2[] = {     0,
-     0,     4,     0,     6,     0,     7,     0,     6,     0,     8,
-     0,     8,     1,     0,     2,     7,     6,     5,     4,     6,
-     3,     2,     1,     1,     1,     1,     1,     0,     4,     0,
-     6,     3,     3
-};
-
-static const short yydefact[] = {     0,
-    13,     0,     1,     0,     0,     0,    14,     0,     7,     0,
-     3,     0,     2,     0,    14,     0,    14,     5,    24,    15,
-    23,     9,     8,    11,     4,    14,    22,    14,    14,     6,
-    25,    21,    10,    12,    19,    28,     0,     0,     0,    18,
-    30,     0,     0,     0,    26,    27,    20,    17,     0,     0,
-    32,    33,    16,     0,    29,     0,    31,     0,     0,     0
-};
-
-static const short yydefgoto[] = {    58,
-     7,    17,    26,    15,    28,    29,    13,    20,    21,    32,
-    47,    40,    42,    49
-};
-
-static const short yypact[] = {     6,
-    -3,     1,-32768,    -2,    -4,     3,-32768,     8,-32768,    10,
--32768,     4,    16,    18,-32768,    19,-32768,-32768,-32768,-32768,
-    11,-32768,    16,-32768,    16,-32768,    20,-32768,-32768,    16,
--32768,    14,    16,    16,     5,    15,    17,    21,    12,    23,
--32768,    24,    22,    26,-32768,-32768,-32768,    12,    25,    31,
--32768,-32768,-32768,    32,-32768,    33,-32768,    34,    36,-32768
-};
-
-static const short yypgoto[] = {-32768,
--32768,-32768,-32768,-32768,-32768,-32768,   -15,-32768,-32768,-32768,
-   -16,-32768,-32768,-32768
-};
-
-
-#define        YYLAST          47
-
-
-static const short yytable[] = {    23,
-     2,    25,     8,    11,     3,     9,     4,     5,     1,    12,
-    30,    18,    33,    34,    14,    10,    16,    36,     6,    37,
-    38,    39,    45,    46,    19,    22,    24,    27,    41,    31,
-    35,    53,     0,    59,    43,    60,     0,    51,    44,    48,
-    52,    50,    54,    55,    56,     0,    57
-};
-
-static const short yycheck[] = {    15,
-     4,    17,     5,     8,     8,     8,     6,     7,     3,     7,
-    26,     8,    28,    29,     7,    18,     7,    13,    18,    15,
-    16,    17,    11,    12,     9,     8,     8,    17,    14,    10,
-    17,    48,    -1,     0,    18,     0,    -1,    16,    18,    17,
-    15,    18,    18,    13,    13,    -1,    14
-};
-/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
-#line 3 "/usr/lib/bison.simple"
-/* This file comes from bison-1.28.  */
-
-/* Skeleton output parser for bison,
-   Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
-
-/* This is the parser code that is written into each bison parser
-  when the %semantic_parser declaration is not specified in the grammar.
-  It was written by Richard Stallman by simplifying the hairy parser
-  used when %semantic_parser is specified.  */
-
-#ifndef YYSTACK_USE_ALLOCA
-#ifdef alloca



Home | Main Index | Thread Index | Old Index