diff -ruN GNUmakefile GNUmakefile *** GNUmakefile Tue Aug 31 07:50:05 1999 --- GNUmakefile Wed Dec 31 19:00:00 1969 *************** *** 1,206 **** - # $Id: GNUmakefile,v 1.5 1999/05/02 00:35:02 ho Exp $ - - # - # Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions - # are met: - # 1. Redistributions of source code must retain the above copyright - # notice, this list of conditions and the following disclaimer. - # 2. Redistributions in binary form must reproduce the above copyright - # notice, this list of conditions and the following disclaimer in the - # documentation and/or other materials provided with the distribution. - # 3. All advertising materials mentioning features or use of this software - # must display the following acknowledgement: - # This product includes software developed by Ericsson Radio Systems. - # 4. The name of the author may not be used to endorse or promote products - # derived from this software without specific prior written permission. - # - # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # - - # - # This code was written under funding by Ericsson Radio Systems. - # - - # - # This makefile is a GNU makefile, which is generally available on most - # systems, either as "make" or (often) "gmake". It has been converted from - # a 'pmake' makefile (OpenBSDs 'make'), and some care has been taken to - # produce similar behaviour. - # - - # openbsd means 2.5 or newer, openbsd-encap is for older kernels with PF_ENCAP - # linux is the name for Linux with FreeS/WAN integrated - #OS= openbsd - #OS= openbsd-encap - OS= linux - - .CURDIR:= $(shell pwd) - VPATH= ${.CURDIR}/sysdep/${OS} - - PROG= isakmpd - - ifndef BINDIR - BINDIR= /sbin - endif - - SRCS= app.c asn.c asn_useful.c attribute.c cert.c connection.c \ - constants.c conf.c cookie.c crypto.c dh.c doi.c exchange.c \ - exchange_num.c field.c gmp_util.c hash.c if.c ike_auth.c \ - ike_aggressive.c ike_main_mode.c ike_phase_1.c \ - ike_quick_mode.c init.c ipsec.c ipsec_fld.c ipsec_num.c \ - isakmpd.c isakmp_doi.c isakmp_fld.c isakmp_num.c log.c \ - message.c math_2n.c math_ec2n.c math_group.c \ - pkcs.c prf.c sa.c sysdep.c timer.c transport.c udp.c ui.c \ - util.c x509.c - - GENERATED= exchange_num.h ipsec_fld.h ipsec_num.h isakmp_fld.h \ - isakmp_num.h - CLEANFILES= exchange_num.c exchange_num.h ipsec_num.c ipsec_num.h \ - isakmp_num.c isakmp_num.h ipsec_fld.c ipsec_fld.h \ - isakmp_fld.c isakmp_fld.h - MAN= isakmpd.8 isakmpd.conf.5 - - CFLAGS+= -O2 ${DEBUG} -Wall -DNEED_SYSDEP_APP \ - -I${.CURDIR} -I${.CURDIR}/sysdep/${OS} -I. \ - - # Different debugging & profiling suggestions - - # Include symbolic debugging info - DEBUG= -g - - # Do execution time profiles - #CFLAGS+= -pg - - # If you have ElectricFence available, you can spot abuses of the heap. - # (/usr/ports/devel/ElectricFence) - #LDADD+= -L/usr/local/lib -lefence - #DPADD+= /usr/local/lib/libefence.a - - # If you like to use Boehm's garbage collector (/usr/ports/devel/boehm-gc). - #LDADD+= -L/usr/local/lib -lgc - #DPADD+= /usr/local/lib/libgc.a - - # You can also use Boehm's garbage collector as a means to find leaks. - # XXX The defines below are GCC-specific. I think it is OK to require - # XXX GCC if you are debugging isakmpd in this way. - #LDADD+= -L/usr/local/lib -lleak - #DPADD+= /usr/local/lib/libleak.a - #CFLAGS+= -D'malloc(x)=({ \ - # void *GC_debug_malloc (size_t, char *, int); \ - # GC_debug_malloc ((x), __FILE__, __LINE__); \ - # })' \ - # -D'realloc(x,y)=({ \ - # void *GC_debug_realloc (void *, size_t, char *, int); \ - # GC_debug_realloc ((x), (y), __FILE__, __LINE__); \ - # })' \ - # -D'free(x)=({ \ - # void GC_debug_free (void *); \ - # GC_debug_free (x); \ - # })' \ - # -D'calloc(x,y)=malloc((x) * (y))' \ - # -D'strdup(x)=({ \ - # char *strcpy (char *, const char *); \ - # const char *_x_ = (x); \ - # char *_y_ = malloc (strlen (_x_) + 1); \ - # strcpy (_y_, _x_); \ - # })' - - # Ignore any files with these names... - .PHONY: mksubdirs all clean cleandir cleandepend beforedepend \ - afterdepend realclean realcleandepend - - # Default target, it needs to be the first target in makefile... :( - - all: ${PROG} mksubdirs - - ifneq ($(findstring install,$(MAKECMDGOALS)),install) - # Skip 'regress' until the regress/ structure has gmake makefiles for it. - #SUBDIR:= regress - SUBDIR:= - mksubdirs: - $(foreach DIR, ${SUBDIR}, \ - cd ${DIR}; ${MAKE} ${MAKEFLAGS} CFLAGS="${CFLAGS}" \ - MKDEP="${MKDEP}" ${MAKECMDGOALS}) - else - mksubdirs: - endif - - # DEPSRCS handling is *ugly*, I know... - # What is does; keep orig SRCS in ORIGSRCS; potentially add stuff to - # SRCS (include); let DEPSRCS be ORIGSRCS (sysdep.c -> sysdep//sysdep.c) - # _plus_ any new sources, located either in cwd or sysdep/. Phew. - - ORIGSRCS:= ${SRCS} - -include sysdep/${OS}/GNUmakefile.sysdep - DEPSRCS:= $(subst sysdep.c,${VPATH}/sysdep.c,${ORIGSRCS}) \ - $(foreach FILE, $(filter-out ${ORIGSRCS},${SRCS}), \ - $(wildcard ./${FILE} ${VPATH}/${FILE})) - OBJS:= $(SRCS:%.c=%.o) - - # Generated targets - exchange_num.c exchange_num.h: genconstants.sh exchange_num.cst - /bin/sh ${.CURDIR}/genconstants.sh ${.CURDIR}/exchange_num - - ipsec_fld.c ipsec_fld.h: genfields.sh ipsec_fld.fld - /bin/sh ${.CURDIR}/genfields.sh ${.CURDIR}/ipsec_fld - - ipsec_num.c ipsec_num.h: genconstants.sh ipsec_num.cst - /bin/sh ${.CURDIR}/genconstants.sh ${.CURDIR}/ipsec_num - - isakmp_fld.c isakmp_fld.h: genfields.sh isakmp_fld.fld - /bin/sh ${.CURDIR}/genfields.sh ${.CURDIR}/isakmp_fld - - isakmp_num.c isakmp_num.h: genconstants.sh isakmp_num.cst - /bin/sh ${.CURDIR}/genconstants.sh ${.CURDIR}/isakmp_num - - # Program rules - ${PROG} beforedepend: ${GENERATED} - - ${PROG}: ${OBJS} ${DPADD} - ${CC} ${DEBUG} ${LDFLAGS} ${LDSTATIC} -o $@ ${OBJS} ${LDADD} - - # Depend rules - depend: beforedepend .depend mksubdirs afterdepend - @true - - # Since 'mkdep' et al maybe doesn't exist... - MKDEP:= ${CC} -MM - - .depend: ${SRCS} - @rm -f .depend - ${MKDEP} ${CFLAGS} ${DEPSRCS} > .depend - - afterdepend: - - ifneq ($(findstring clean, $(MAKECMDGOALS)), clean) - # This will initially fail (when .depend does not exist), continue - # to create .depend, then make will automatically restart to include - # the generated .depend correctly. The '-' inhibits the warning msg. - -include .depend - endif - - # Clean rules - - cleandir: realclean realcleandepend mksubdirs - - clean: realclean mksubdirs - - cleandepend: realcleandepend mksubdirs - - realclean: - rm -f a.out core *.core ${PROG} ${OBJS} ${CLEANFILES} - - realcleandepend: - rm -f .depend tags --- 0 ---- diff -ruN Makefile Makefile *** Makefile Tue Aug 31 07:50:06 1999 --- Makefile Wed Dec 31 19:00:00 1969 *************** *** 1,137 **** - # $Id: Makefile,v 1.54 1999/06/07 00:00:49 ho Exp $ - - # - # Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions - # are met: - # 1. Redistributions of source code must retain the above copyright - # notice, this list of conditions and the following disclaimer. - # 2. Redistributions in binary form must reproduce the above copyright - # notice, this list of conditions and the following disclaimer in the - # documentation and/or other materials provided with the distribution. - # 3. All advertising materials mentioning features or use of this software - # must display the following acknowledgement: - # This product includes software developed by Ericsson Radio Systems. - # 4. The name of the author may not be used to endorse or promote products - # derived from this software without specific prior written permission. - # - # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # - - # - # This code was written under funding by Ericsson Radio Systems. - # - - # - # This makefile is a "pmake" one, i.e. the make variant commonly found in - # BSD derived systems, where it is indeed named "make". Other systems - # may provide this make variant as "pmake" or maybe "bsdmake". - # - - # openbsd means 2.5 or newer, openbsd-encap is for older kernels with PF_ENCAP - # linux is the name for Linux with FreeS/WAN integrated - OS= openbsd - #OS= openbsd-encap - #OS= linux - - .PATH: ${.CURDIR}/sysdep/${OS} - - PROG= isakmpd - BINDIR?= /sbin - SRCS= app.c asn.c asn_useful.c attribute.c cert.c connection.c \ - constants.c conf.c cookie.c crypto.c dh.c doi.c exchange.c \ - exchange_num.c field.c gmp_util.c hash.c if.c ike_auth.c \ - ike_aggressive.c ike_main_mode.c ike_phase_1.c \ - ike_quick_mode.c init.c ipsec.c ipsec_fld.c ipsec_num.c \ - isakmpd.c isakmp_doi.c isakmp_fld.c isakmp_num.c log.c \ - message.c math_2n.c math_ec2n.c math_group.c \ - pkcs.c prf.c sa.c sysdep.c timer.c transport.c udp.c ui.c \ - util.c x509.c - - GENERATED= exchange_num.h ipsec_fld.h ipsec_num.h isakmp_fld.h \ - isakmp_num.h - CLEANFILES= exchange_num.c exchange_num.h ipsec_num.c ipsec_num.h \ - isakmp_num.c isakmp_num.h ipsec_fld.c ipsec_fld.h \ - isakmp_fld.c isakmp_fld.h - MAN= isakmpd.8 isakmpd.conf.5 - CFLAGS+= -Wall -DNEED_SYSDEP_APP \ - -I${.CURDIR} -I${.CURDIR}/sysdep/${OS} -I. - - # Different debugging & profiling suggestions - - # Include symbolic debugging info - DEBUG= -g - - # Do execution time profiles - #CFLAGS+= -pg - - # If you have ElectricFence available, you can spot abuses of the heap. - # (/usr/ports/devel/ElectricFence) - #LDADD+= -L/usr/local/lib -lefence - #DPADD+= /usr/local/lib/libefence.a - - # If you like to use Boehm's garbage collector (/usr/ports/devel/boehm-gc). - #LDADD+= -L/usr/local/lib -lgc - #DPADD+= /usr/local/lib/libgc.a - - # You can also use Boehm's garbage collector as a means to find leaks. - # XXX The defines below are GCC-specific. I think it is OK to require - # XXX GCC if you are debugging isakmpd in this way. - #LDADD+= -L/usr/local/lib -lleak - #DPADD+= /usr/local/lib/libleak.a - #CFLAGS+= -D'malloc(x)=({ \ - # void *GC_debug_malloc (size_t, char *, int); \ - # GC_debug_malloc ((x), __FILE__, __LINE__); \ - # })' \ - # -D'realloc(x,y)=({ \ - # void *GC_debug_realloc (void *, size_t, char *, int); \ - # GC_debug_realloc ((x), (y), __FILE__, __LINE__); \ - # })' \ - # -D'free(x)=({ \ - # void GC_debug_free (void *); \ - # GC_debug_free (x); \ - # })' \ - # -D'calloc(x,y)=malloc((x) * (y))' \ - # -D'strdup(x)=({ \ - # char *strcpy (char *, const char *); \ - # const char *_x_ = (x); \ - # char *_y_ = malloc (strlen (_x_) + 1); \ - # strcpy (_y_, _x_); \ - # })' - - .if !make(install) - SUBDIR= regress - .endif - - .include "sysdep/${OS}/Makefile.sysdep" - - exchange_num.c exchange_num.h: genconstants.sh exchange_num.cst - /bin/sh ${.CURDIR}/genconstants.sh ${.CURDIR}/exchange_num - - ipsec_fld.c ipsec_fld.h: genfields.sh ipsec_fld.fld - /bin/sh ${.CURDIR}/genfields.sh ${.CURDIR}/ipsec_fld - - ipsec_num.c ipsec_num.h: genconstants.sh ipsec_num.cst - /bin/sh ${.CURDIR}/genconstants.sh ${.CURDIR}/ipsec_num - - isakmp_fld.c isakmp_fld.h: genfields.sh isakmp_fld.fld - /bin/sh ${.CURDIR}/genfields.sh ${.CURDIR}/isakmp_fld - - isakmp_num.c isakmp_num.h: genconstants.sh isakmp_num.cst - /bin/sh ${.CURDIR}/genconstants.sh ${.CURDIR}/isakmp_num - - ${PROG} beforedepend: ${GENERATED} - - .include - .include --- 0 ---- diff -ruN Makefile.am Makefile.am *** Makefile.am Wed Dec 31 19:00:00 1969 --- Makefile.am Mon Dec 20 11:16:42 1999 *************** *** 0 **** --- 1,81 ---- + ## Process this file with automake to produce Makefile.in + # Copyright (c) 1999 BBN Corporation + # + # Permission to use, copy, modify, and distribute this software + # and its documentation for any purpose is hereby granted without + # fee, provided that the above copyright notice and this permission + # appear in all copies and in supporting documentation, and that the + # name of BBN Corporation not be used in advertising or publicity + # pertaining to distribution of the software without specific, + # written prior permission. BBN makes no representations about the + # suitability of this software for any purposes. It is provided "AS + # IS" without express or implied warranties. + # + # This software and its documentation was written by BBN Corporation + # under sponsorship by the Defense Advanced Research Projects Agency. + + # $Header: /IR-CVS/isakmpd/Makefile.am,v 1.6 1999/12/17 22:52:55 fredette Exp $ + # $Author: fredette $ + # $Date: 1999/12/17 22:52:55 $ + # $Id: Makefile.am,v 1.6 1999/12/17 22:52:55 fredette Exp $ + # $Revision: 1.6 $ + + AUTOMAKE_OPTIONS = 1.3 foreign ansi2knr + + # regress doesn't have Makefile.ams yet. when it does, add it + # here and remove it from EXTRA_DIST. + SUBDIRS = sysdep + + sbin_PROGRAMS = isakmpd + man_MANS = isakmpd.8 isakmpd.conf.5 + BUILT_SOURCES = exchange_num.c exchange_num.h \ + ipsec_fld.c ipsec_fld.h \ + ipsec_num.c ipsec_num.h \ + isakmp_fld.c isakmp_fld.h \ + isakmp_num.c isakmp_num.h + isakmpd_SOURCES = app.c app.h asn.c asn.h asn_useful.c asn_useful.h \ + attribute.c attribute.h cert.c cert.h connection.c connection.h \ + constants.c constants.h conf.c conf.h cookie.c cookie.h \ + crypto.c crypto.h dh.c dh.h doi.c doi.h exchange.c exchange.h \ + field.c field.h gmp_util.c gmp_util.h hash.c hash.h if.c if.h \ + ike_auth.c ike_auth.h ike_aggressive.c ike_aggressive.h \ + ike_main_mode.c ike_main_mode.h ike_phase_1.c ike_phase_1.h \ + ike_quick_mode.c ike_quick_mode.h init.c init.h ipsec.c ipsec.h \ + isakmpd.c isakmp.h isakmp_doi.c isakmp_doi.h log.c log.h \ + message.c message.h math_2n.c math_2n.h math_ec2n.c math_ec2n.h \ + math_group.c math_group.h pkcs.c pkcs.h prf.c prf.h sa.c sa.h \ + sysdep.c sysdep.h timer.c timer.h transport.c transport.h \ + udp.c udp.h ui.c ui.h util.c util.h x509.c x509.h ipsec_doi.h \ + $(BUILT_SOURCES) + EXTRA_isakmpd_SOURCES = pf_key_v2.c pf_key_v2.h pf_encap.c pf_encap.h + INCLUDES = -DNEED_SYSDEP_APP -DSYSCONFDIR=\"$(sysconfdir)\" @TARGET_INCLUDES@ @BOEHM_LEAK_INCLUDES@ + isakmpd_DEPENDENCIES = @isakmpd_DEPENDENCIES@ + isakmpd_LDADD = $(isakmpd_DEPENDENCIES) -lgmp -ldes \ + @EFENCE_LDADD@ @BOEHM_GC_LDADD@ @BOEHM_LEAK_LDADD@ @LIBSYSDEP_LDADD@ + EXTRA_DIST = $(man_MANS) \ + genconstants.sh exchange_num.cst ipsec_num.cst isakmp_num.cst \ + genfields.sh ipsec_fld.fld isakmp_fld.fld \ + isakmpd_cert.sample isakmpd_key.pub.sample isakmpd_key.sample \ + samples regress policy.c policy.h \ + isakmpd_cert.sample isakmpd_key.pub.sample isakmpd_key.sample \ + BUGS DESIGN-NOTES QUESTIONS RELEASE-NOTES TO-DO + + # Generated targets + exchange_num.c exchange_num.h: genconstants.sh exchange_num.cst + $(SHELL) $(srcdir)/genconstants.sh $(srcdir)/exchange_num + + ipsec_fld.c ipsec_fld.h: genfields.sh ipsec_fld.fld + $(SHELL) $(srcdir)/genfields.sh $(srcdir)/ipsec_fld + + ipsec_num.c ipsec_num.h: genconstants.sh ipsec_num.cst + $(SHELL) $(srcdir)/genconstants.sh $(srcdir)/ipsec_num + + isakmp_fld.c isakmp_fld.h: genfields.sh isakmp_fld.fld + $(SHELL) $(srcdir)/genfields.sh $(srcdir)/isakmp_fld + + isakmp_num.c isakmp_num.h: genconstants.sh isakmp_num.cst + $(SHELL) $(srcdir)/genconstants.sh $(srcdir)/isakmp_num + + # finish the distribution: + dist-hook: + rm -rf `find $(distdir) -name CVS -print` diff -ruN Makefile.in Makefile.in *** Makefile.in Wed Dec 31 19:00:00 1969 --- Makefile.in Mon Dec 20 14:04:57 1999 *************** *** 0 **** --- 1,882 ---- + # Makefile.in generated automatically by automake 1.4 from Makefile.am + + # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY, to the extent permitted by law; without + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A + # PARTICULAR PURPOSE. + + # Copyright (c) 1999 BBN Corporation + # + # Permission to use, copy, modify, and distribute this software + # and its documentation for any purpose is hereby granted without + # fee, provided that the above copyright notice and this permission + # appear in all copies and in supporting documentation, and that the + # name of BBN Corporation not be used in advertising or publicity + # pertaining to distribution of the software without specific, + # written prior permission. BBN makes no representations about the + # suitability of this software for any purposes. It is provided "AS + # IS" without express or implied warranties. + # + # This software and its documentation was written by BBN Corporation + # under sponsorship by the Defense Advanced Research Projects Agency. + + # $Header: /IR-CVS/isakmpd/Makefile.am,v 1.6 1999/12/17 22:52:55 fredette Exp $ + # $Author: fredette $ + # $Date: 1999/12/17 22:52:55 $ + # $Id: Makefile.am,v 1.6 1999/12/17 22:52:55 fredette Exp $ + # $Revision: 1.6 $ + + + SHELL = @SHELL@ + + srcdir = @srcdir@ + top_srcdir = @top_srcdir@ + VPATH = @srcdir@ + prefix = @prefix@ + exec_prefix = @exec_prefix@ + + bindir = @bindir@ + sbindir = @sbindir@ + libexecdir = @libexecdir@ + datadir = @datadir@ + sysconfdir = @sysconfdir@ + sharedstatedir = @sharedstatedir@ + localstatedir = @localstatedir@ + libdir = @libdir@ + infodir = @infodir@ + mandir = @mandir@ + includedir = @includedir@ + oldincludedir = /usr/include + + DESTDIR = + + pkgdatadir = $(datadir)/@PACKAGE@ + pkglibdir = $(libdir)/@PACKAGE@ + pkgincludedir = $(includedir)/@PACKAGE@ + + top_builddir = . + + ACLOCAL = @ACLOCAL@ + AUTOCONF = @AUTOCONF@ + AUTOMAKE = @AUTOMAKE@ + AUTOHEADER = @AUTOHEADER@ + + INSTALL = @INSTALL@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) + INSTALL_DATA = @INSTALL_DATA@ + INSTALL_SCRIPT = @INSTALL_SCRIPT@ + transform = @program_transform_name@ + + NORMAL_INSTALL = : + PRE_INSTALL = : + POST_INSTALL = : + NORMAL_UNINSTALL = : + PRE_UNINSTALL = : + POST_UNINSTALL = : + build_alias = @build_alias@ + build_triplet = @build@ + host_alias = @host_alias@ + host_triplet = @host@ + target_alias = @target_alias@ + target_triplet = @target@ + BOEHM_GC_LDADD = @BOEHM_GC_LDADD@ + BOEHM_LEAK_INCLUDES = @BOEHM_LEAK_INCLUDES@ + BOEHM_LEAK_LDADD = @BOEHM_LEAK_LDADD@ + CC = @CC@ + CPP = @CPP@ + CXX = @CXX@ + EFENCE_LDADD = @EFENCE_LDADD@ + GLIB_CFLAGS = @GLIB_CFLAGS@ + GLIB_CONFIG = @GLIB_CONFIG@ + GLIB_LIBS = @GLIB_LIBS@ + GTK_CFLAGS = @GTK_CFLAGS@ + GTK_CONFIG = @GTK_CONFIG@ + GTK_LIBS = @GTK_LIBS@ + KAME_CFLAGS = @KAME_CFLAGS@ + KAME_LIBS = @KAME_LIBS@ + LIBMALLOC_LDADD = @LIBMALLOC_LDADD@ + LIBSYSDEP_LDADD = @LIBSYSDEP_LDADD@ + MAKEINFO = @MAKEINFO@ + PACKAGE = @PACKAGE@ + RANLIB = @RANLIB@ + TARGET_INCLUDES = @TARGET_INCLUDES@ + U = @U@ + VERSION = @VERSION@ + + AUTOMAKE_OPTIONS = 1.3 foreign ansi2knr + + # regress doesn't have Makefile.ams yet. when it does, add it + # here and remove it from EXTRA_DIST. + SUBDIRS = sysdep + + sbin_PROGRAMS = isakmpd + man_MANS = isakmpd.8 isakmpd.conf.5 + BUILT_SOURCES = exchange_num.c exchange_num.h ipsec_fld.c ipsec_fld.h ipsec_num.c ipsec_num.h isakmp_fld.c isakmp_fld.h isakmp_num.c isakmp_num.h + + isakmpd_SOURCES = app.c app.h asn.c asn.h asn_useful.c asn_useful.h attribute.c attribute.h cert.c cert.h connection.c connection.h constants.c constants.h conf.c conf.h cookie.c cookie.h crypto.c crypto.h dh.c dh.h doi.c doi.h exchange.c exchange.h field.c field.h gmp_util.c gmp_util.h hash.c hash.h if.c if.h ike_auth.c ike_auth.h ike_aggressive.c ike_aggressive.h ike_main_mode.c ike_main_mode.h ike_phase_1.c ike_phase_1.h ike_quick_mode.c ike_quick_mode.h init.c init.h ipsec.c ipsec.h isakmpd.c isakmp.h isakmp_doi.c isakmp_doi.h log.c log.h message.c message.h math_2n.c math_2n.h math_ec2n.c math_ec2n.h math_group.c math_group.h pkcs.c pkcs.h prf.c prf.h sa.c sa.h sysdep.c sysdep.h timer.c timer.h transport.c transport.h udp.c udp.h ui.c ui.h util.c util.h x509.c x509.h ipsec_doi.h $(BUILT_SOURCES) + + EXTRA_isakmpd_SOURCES = pf_key_v2.c pf_key_v2.h pf_encap.c pf_encap.h + INCLUDES = -DNEED_SYSDEP_APP -DSYSCONFDIR=\"$(sysconfdir)\" @TARGET_INCLUDES@ @BOEHM_LEAK_INCLUDES@ + isakmpd_DEPENDENCIES = @isakmpd_DEPENDENCIES@ + isakmpd_LDADD = $(isakmpd_DEPENDENCIES) -lgmp -ldes @EFENCE_LDADD@ @BOEHM_GC_LDADD@ @BOEHM_LEAK_LDADD@ @LIBSYSDEP_LDADD@ + + EXTRA_DIST = $(man_MANS) genconstants.sh exchange_num.cst ipsec_num.cst isakmp_num.cst genfields.sh ipsec_fld.fld isakmp_fld.fld isakmpd_cert.sample isakmpd_key.pub.sample isakmpd_key.sample samples regress policy.c policy.h isakmpd_cert.sample isakmpd_key.pub.sample isakmpd_key.sample BUGS DESIGN-NOTES QUESTIONS RELEASE-NOTES TO-DO + + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + CONFIG_HEADER = config.h + CONFIG_CLEAN_FILES = + PROGRAMS = $(sbin_PROGRAMS) + + + DEFS = @DEFS@ -I. -I$(srcdir) -I. + CPPFLAGS = @CPPFLAGS@ + LDFLAGS = @LDFLAGS@ + LIBS = @LIBS@ + X_CFLAGS = @X_CFLAGS@ + X_LIBS = @X_LIBS@ + X_EXTRA_LIBS = @X_EXTRA_LIBS@ + X_PRE_LIBS = @X_PRE_LIBS@ + ANSI2KNR = @ANSI2KNR@ + isakmpd_OBJECTS = app$U.o asn$U.o asn_useful$U.o attribute$U.o cert$U.o \ + connection$U.o constants$U.o conf$U.o cookie$U.o crypto$U.o dh$U.o \ + doi$U.o exchange$U.o field$U.o gmp_util$U.o hash$U.o if$U.o \ + ike_auth$U.o ike_aggressive$U.o ike_main_mode$U.o ike_phase_1$U.o \ + ike_quick_mode$U.o init$U.o ipsec$U.o isakmpd$U.o isakmp_doi$U.o \ + log$U.o message$U.o math_2n$U.o math_ec2n$U.o math_group$U.o pkcs$U.o \ + prf$U.o sa$U.o sysdep$U.o timer$U.o transport$U.o udp$U.o ui$U.o \ + util$U.o x509$U.o exchange_num$U.o ipsec_fld$U.o ipsec_num$U.o \ + isakmp_fld$U.o isakmp_num$U.o + isakmpd_LDFLAGS = + CFLAGS = @CFLAGS@ + COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + CCLD = $(CC) + LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ + man5dir = $(mandir)/man5 + man8dir = $(mandir)/man8 + MANS = $(man_MANS) + + NROFF = nroff + DIST_COMMON = README ./stamp-h.in Makefile.am Makefile.in acconfig.h \ + aclocal.m4 ansi2knr.1 ansi2knr.c config.guess config.h.in config.sub \ + configure configure.in install-sh missing mkinstalldirs + + + DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + + TAR = tar + GZIP_ENV = --best + SOURCES = $(isakmpd_SOURCES) $(EXTRA_isakmpd_SOURCES) + OBJECTS = $(isakmpd_OBJECTS) + + all: all-redirect + .SUFFIXES: + .SUFFIXES: .S .c .o .s + $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps Makefile + + Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + + $(ACLOCAL_M4): configure.in + cd $(srcdir) && $(ACLOCAL) + + config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + + config.h: stamp-h + @if test ! -f $@; then \ + rm -f stamp-h; \ + $(MAKE) stamp-h; \ + else :; fi + stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES= CONFIG_HEADERS=config.h \ + $(SHELL) ./config.status + @echo timestamp > stamp-h 2> /dev/null + $(srcdir)/config.h.in: $(srcdir)/stamp-h.in + @if test ! -f $@; then \ + rm -f $(srcdir)/stamp-h.in; \ + $(MAKE) $(srcdir)/stamp-h.in; \ + else :; fi + $(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h + cd $(top_srcdir) && $(AUTOHEADER) + @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null + + mostlyclean-hdr: + + clean-hdr: + + distclean-hdr: + -rm -f config.h + + maintainer-clean-hdr: + + mostlyclean-sbinPROGRAMS: + + clean-sbinPROGRAMS: + -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) + + distclean-sbinPROGRAMS: + + maintainer-clean-sbinPROGRAMS: + + install-sbinPROGRAMS: $(sbin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(sbindir) + @list='$(sbin_PROGRAMS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + else :; fi; \ + done + + uninstall-sbinPROGRAMS: + @$(NORMAL_UNINSTALL) + list='$(sbin_PROGRAMS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + done + + .c.o: + $(COMPILE) -c $< + + .s.o: + $(COMPILE) -c $< + + .S.o: + $(COMPILE) -c $< + + mostlyclean-compile: + -rm -f *.o core *.core + + clean-compile: + + distclean-compile: + -rm -f *.tab.c + + maintainer-clean-compile: + + mostlyclean-krextra: + + clean-krextra: + -rm -f ansi2knr + + distclean-krextra: + + maintainer-clean-krextra: + ansi2knr: ansi2knr.o + $(LINK) ansi2knr.o $(LIBS) + ansi2knr.o: $(CONFIG_HEADER) + + + mostlyclean-kr: + -rm -f *_.c + + clean-kr: + + distclean-kr: + + maintainer-clean-kr: + + isakmpd: $(isakmpd_OBJECTS) $(isakmpd_DEPENDENCIES) + @rm -f isakmpd + $(LINK) $(isakmpd_LDFLAGS) $(isakmpd_OBJECTS) $(isakmpd_LDADD) $(LIBS) + app_.c: app.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/app.c; then echo $(srcdir)/app.c; else echo app.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > app_.c + asn_.c: asn.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/asn.c; then echo $(srcdir)/asn.c; else echo asn.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > asn_.c + asn_useful_.c: asn_useful.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/asn_useful.c; then echo $(srcdir)/asn_useful.c; else echo asn_useful.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > asn_useful_.c + attribute_.c: attribute.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/attribute.c; then echo $(srcdir)/attribute.c; else echo attribute.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > attribute_.c + cert_.c: cert.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/cert.c; then echo $(srcdir)/cert.c; else echo cert.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > cert_.c + conf_.c: conf.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/conf.c; then echo $(srcdir)/conf.c; else echo conf.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > conf_.c + connection_.c: connection.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/connection.c; then echo $(srcdir)/connection.c; else echo connection.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > connection_.c + constants_.c: constants.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/constants.c; then echo $(srcdir)/constants.c; else echo constants.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > constants_.c + cookie_.c: cookie.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/cookie.c; then echo $(srcdir)/cookie.c; else echo cookie.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > cookie_.c + crypto_.c: crypto.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/crypto.c; then echo $(srcdir)/crypto.c; else echo crypto.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > crypto_.c + dh_.c: dh.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/dh.c; then echo $(srcdir)/dh.c; else echo dh.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > dh_.c + doi_.c: doi.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/doi.c; then echo $(srcdir)/doi.c; else echo doi.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > doi_.c + exchange_.c: exchange.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/exchange.c; then echo $(srcdir)/exchange.c; else echo exchange.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > exchange_.c + exchange_num_.c: exchange_num.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/exchange_num.c; then echo $(srcdir)/exchange_num.c; else echo exchange_num.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > exchange_num_.c + field_.c: field.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/field.c; then echo $(srcdir)/field.c; else echo field.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > field_.c + gmp_util_.c: gmp_util.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/gmp_util.c; then echo $(srcdir)/gmp_util.c; else echo gmp_util.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > gmp_util_.c + hash_.c: hash.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/hash.c; then echo $(srcdir)/hash.c; else echo hash.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > hash_.c + if_.c: if.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/if.c; then echo $(srcdir)/if.c; else echo if.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > if_.c + ike_aggressive_.c: ike_aggressive.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ike_aggressive.c; then echo $(srcdir)/ike_aggressive.c; else echo ike_aggressive.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ike_aggressive_.c + ike_auth_.c: ike_auth.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ike_auth.c; then echo $(srcdir)/ike_auth.c; else echo ike_auth.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ike_auth_.c + ike_main_mode_.c: ike_main_mode.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ike_main_mode.c; then echo $(srcdir)/ike_main_mode.c; else echo ike_main_mode.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ike_main_mode_.c + ike_phase_1_.c: ike_phase_1.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ike_phase_1.c; then echo $(srcdir)/ike_phase_1.c; else echo ike_phase_1.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ike_phase_1_.c + ike_quick_mode_.c: ike_quick_mode.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ike_quick_mode.c; then echo $(srcdir)/ike_quick_mode.c; else echo ike_quick_mode.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ike_quick_mode_.c + init_.c: init.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/init.c; then echo $(srcdir)/init.c; else echo init.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > init_.c + ipsec_.c: ipsec.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ipsec.c; then echo $(srcdir)/ipsec.c; else echo ipsec.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ipsec_.c + ipsec_fld_.c: ipsec_fld.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ipsec_fld.c; then echo $(srcdir)/ipsec_fld.c; else echo ipsec_fld.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ipsec_fld_.c + ipsec_num_.c: ipsec_num.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ipsec_num.c; then echo $(srcdir)/ipsec_num.c; else echo ipsec_num.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ipsec_num_.c + isakmp_doi_.c: isakmp_doi.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/isakmp_doi.c; then echo $(srcdir)/isakmp_doi.c; else echo isakmp_doi.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > isakmp_doi_.c + isakmp_fld_.c: isakmp_fld.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/isakmp_fld.c; then echo $(srcdir)/isakmp_fld.c; else echo isakmp_fld.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > isakmp_fld_.c + isakmp_num_.c: isakmp_num.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/isakmp_num.c; then echo $(srcdir)/isakmp_num.c; else echo isakmp_num.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > isakmp_num_.c + isakmpd_.c: isakmpd.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/isakmpd.c; then echo $(srcdir)/isakmpd.c; else echo isakmpd.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > isakmpd_.c + log_.c: log.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/log.c; then echo $(srcdir)/log.c; else echo log.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > log_.c + math_2n_.c: math_2n.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/math_2n.c; then echo $(srcdir)/math_2n.c; else echo math_2n.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > math_2n_.c + math_ec2n_.c: math_ec2n.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/math_ec2n.c; then echo $(srcdir)/math_ec2n.c; else echo math_ec2n.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > math_ec2n_.c + math_group_.c: math_group.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/math_group.c; then echo $(srcdir)/math_group.c; else echo math_group.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > math_group_.c + message_.c: message.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/message.c; then echo $(srcdir)/message.c; else echo message.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > message_.c + pf_encap_.c: pf_encap.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/pf_encap.c; then echo $(srcdir)/pf_encap.c; else echo pf_encap.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > pf_encap_.c + pf_key_v2_.c: pf_key_v2.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/pf_key_v2.c; then echo $(srcdir)/pf_key_v2.c; else echo pf_key_v2.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > pf_key_v2_.c + pkcs_.c: pkcs.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/pkcs.c; then echo $(srcdir)/pkcs.c; else echo pkcs.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > pkcs_.c + prf_.c: prf.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/prf.c; then echo $(srcdir)/prf.c; else echo prf.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > prf_.c + sa_.c: sa.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/sa.c; then echo $(srcdir)/sa.c; else echo sa.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > sa_.c + sysdep_.c: sysdep.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/sysdep.c; then echo $(srcdir)/sysdep.c; else echo sysdep.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > sysdep_.c + timer_.c: timer.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/timer.c; then echo $(srcdir)/timer.c; else echo timer.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > timer_.c + transport_.c: transport.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/transport.c; then echo $(srcdir)/transport.c; else echo transport.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > transport_.c + udp_.c: udp.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/udp.c; then echo $(srcdir)/udp.c; else echo udp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > udp_.c + ui_.c: ui.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ui.c; then echo $(srcdir)/ui.c; else echo ui.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ui_.c + util_.c: util.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/util.c; then echo $(srcdir)/util.c; else echo util.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > util_.c + x509_.c: x509.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/x509.c; then echo $(srcdir)/x509.c; else echo x509.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > x509_.c + app_.o asn_.o asn_useful_.o attribute_.o cert_.o conf_.o connection_.o \ + constants_.o cookie_.o crypto_.o dh_.o doi_.o exchange_.o \ + exchange_num_.o field_.o gmp_util_.o hash_.o if_.o ike_aggressive_.o \ + ike_auth_.o ike_main_mode_.o ike_phase_1_.o ike_quick_mode_.o init_.o \ + ipsec_.o ipsec_fld_.o ipsec_num_.o isakmp_doi_.o isakmp_fld_.o \ + isakmp_num_.o isakmpd_.o log_.o math_2n_.o math_ec2n_.o math_group_.o \ + message_.o pf_encap_.o pf_key_v2_.o pkcs_.o prf_.o sa_.o sysdep_.o \ + timer_.o transport_.o udp_.o ui_.o util_.o x509_.o : $(ANSI2KNR) + + install-man5: + $(mkinstalldirs) $(DESTDIR)$(man5dir) + @list='$(man5_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.5*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst; \ + done + + uninstall-man5: + @list='$(man5_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.5*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man5dir)/$$inst"; \ + rm -f $(DESTDIR)$(man5dir)/$$inst; \ + done + + install-man8: + $(mkinstalldirs) $(DESTDIR)$(man8dir) + @list='$(man8_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.8*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \ + done + + uninstall-man8: + @list='$(man8_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.8*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \ + rm -f $(DESTDIR)$(man8dir)/$$inst; \ + done + install-man: $(MANS) + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-man5 install-man8 + uninstall-man: + @$(NORMAL_UNINSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-man5 uninstall-man8 + + # This directory's subdirectories are mostly independent; you can cd + # into them and run `make' without going through this Makefile. + # To change the values of `make' variables: instead of editing Makefiles, + # (1) if the variable is set in `config.status', edit `config.status' + # (which will cause the Makefiles to be regenerated when you run `make'); + # (2) otherwise, pass the desired values on the `make' command line. + + @SET_MAKE@ + + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + + mostlyclean-recursive clean-recursive distclean-recursive \ + maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" + tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + + tags: TAGS + + ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + + TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS) + + mostlyclean-tags: + + clean-tags: + + distclean-tags: + -rm -f TAGS ID + + maintainer-clean-tags: + + distdir = $(PACKAGE)-$(VERSION) + top_distdir = $(distdir) + + # This target untars the dist file and tries a VPATH configuration. Then + # it guarantees that the distribution is self-contained by making another + # tarfile. + distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" + dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) + dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) + distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook + app.o: app.c sysdep.h sysdep/freebsd/sysdep-os.h app.h log.h + asn.o: asn.c sysdep.h sysdep/freebsd/sysdep-os.h log.h asn.h gmp_util.h + asn_useful.o: asn_useful.c sysdep.h sysdep/freebsd/sysdep-os.h asn.h \ + asn_useful.h + attribute.o: attribute.c sysdep.h sysdep/freebsd/sysdep-os.h attribute.h \ + conf.h sysdep/linux/sys/queue.h log.h isakmp.h isakmp_fld.h \ + field.h isakmp_num.h constants.h util.h + cert.o: cert.c sysdep.h sysdep/freebsd/sysdep-os.h cert.h \ + sysdep/linux/sys/queue.h isakmp_num.h constants.h log.h x509.h \ + pkcs.h + conf.o: conf.c sysdep/linux/sys/queue.h sysdep.h \ + sysdep/freebsd/sysdep-os.h app.h conf.h log.h + connection.o: connection.c sysdep/linux/sys/queue.h sysdep.h \ + sysdep/freebsd/sysdep-os.h conf.h connection.h ipsec.h \ + ipsec_doi.h ipsec_fld.h field.h ipsec_num.h constants.h \ + isakmp.h isakmp_fld.h isakmp_num.h log.h timer.h util.h + constants.o: constants.c sysdep.h sysdep/freebsd/sysdep-os.h constants.h + cookie.o: cookie.c sysdep/linux/sha1.h sysdep.h \ + sysdep/freebsd/sysdep-os.h cookie.h exchange.h \ + sysdep/linux/sys/queue.h exchange_num.h constants.h isakmp.h \ + isakmp_fld.h field.h isakmp_num.h hash.h log.h timer.h \ + transport.h util.h + crypto.o: crypto.c sysdep.h sysdep/freebsd/sysdep-os.h crypto.h \ + sysdep/linux/blf.h sysdep/linux/cast.h log.h + dh.o: dh.c sysdep.h sysdep/freebsd/sysdep-os.h math_group.h dh.h log.h + doi.o: doi.c sysdep.h sysdep/freebsd/sysdep-os.h doi.h \ + sysdep/linux/sys/queue.h + exchange.o: exchange.c config.h sysdep/linux/sys/queue.h sysdep.h \ + sysdep/freebsd/sysdep-os.h cert.h conf.h connection.h \ + constants.h cookie.h crypto.h sysdep/linux/blf.h \ + sysdep/linux/cast.h doi.h exchange.h exchange_num.h isakmp.h \ + isakmp_fld.h field.h isakmp_num.h ipsec_num.h log.h message.h \ + timer.h transport.h sa.h util.h + exchange_num.o: exchange_num.c sysdep.h sysdep/freebsd/sysdep-os.h \ + constants.h exchange_num.h + field.o: field.c sysdep.h sysdep/freebsd/sysdep-os.h constants.h field.h \ + log.h util.h + gmp_util.o: gmp_util.c sysdep.h sysdep/freebsd/sysdep-os.h gmp_util.h + hash.o: hash.c sysdep/linux/md5.h sysdep/linux/sha1.h sysdep.h \ + sysdep/freebsd/sysdep-os.h hash.h + if.o: if.c config.h sysdep.h sysdep/freebsd/sysdep-os.h log.h if.h + ike_aggressive.o: ike_aggressive.c sysdep/linux/sys/queue.h sysdep.h \ + sysdep/freebsd/sysdep-os.h attribute.h conf.h constants.h \ + crypto.h sysdep/linux/blf.h sysdep/linux/cast.h dh.h doi.h \ + exchange.h exchange_num.h isakmp.h isakmp_fld.h field.h \ + isakmp_num.h hash.h ike_auth.h ike_aggressive.h ike_phase_1.h \ + ipsec.h ipsec_doi.h ipsec_fld.h ipsec_num.h log.h math_group.h \ + message.h prf.h sa.h transport.h util.h + ike_auth.o: ike_auth.c sysdep/linux/sys/queue.h sysdep.h \ + sysdep/freebsd/sysdep-os.h asn.h cert.h conf.h constants.h \ + exchange.h exchange_num.h isakmp.h isakmp_fld.h field.h \ + isakmp_num.h gmp_util.h hash.h ike_auth.h ipsec.h ipsec_doi.h \ + ipsec_fld.h ipsec_num.h log.h message.h pkcs.h prf.h \ + transport.h util.h + ike_main_mode.o: ike_main_mode.c sysdep/linux/sys/queue.h sysdep.h \ + sysdep/freebsd/sysdep-os.h attribute.h conf.h constants.h \ + crypto.h sysdep/linux/blf.h sysdep/linux/cast.h dh.h doi.h \ + exchange.h exchange_num.h isakmp.h isakmp_fld.h field.h \ + isakmp_num.h hash.h ike_auth.h ike_main_mode.h ike_phase_1.h \ + ipsec.h ipsec_doi.h ipsec_fld.h ipsec_num.h log.h math_group.h \ + message.h prf.h sa.h transport.h util.h + ike_phase_1.o: ike_phase_1.c sysdep/linux/sys/queue.h sysdep.h \ + sysdep/freebsd/sysdep-os.h attribute.h conf.h constants.h \ + crypto.h sysdep/linux/blf.h sysdep/linux/cast.h dh.h doi.h \ + exchange.h exchange_num.h isakmp.h isakmp_fld.h field.h \ + isakmp_num.h hash.h ike_auth.h ike_phase_1.h ipsec.h \ + ipsec_doi.h ipsec_fld.h ipsec_num.h log.h math_group.h \ + message.h prf.h sa.h transport.h util.h + ike_quick_mode.o: ike_quick_mode.c config.h sysdep/linux/sys/queue.h \ + sysdep.h sysdep/freebsd/sysdep-os.h attribute.h conf.h \ + connection.h dh.h doi.h exchange.h exchange_num.h constants.h \ + isakmp.h isakmp_fld.h field.h isakmp_num.h hash.h \ + ike_quick_mode.h ipsec.h ipsec_doi.h ipsec_fld.h ipsec_num.h \ + log.h math_group.h message.h prf.h sa.h transport.h + init.o: init.c sysdep.h sysdep/freebsd/sysdep-os.h app.h conf.h \ + sysdep/linux/sys/queue.h connection.h cookie.h doi.h exchange.h \ + exchange_num.h constants.h isakmp.h isakmp_fld.h field.h \ + isakmp_num.h init.h ipsec.h ipsec_doi.h ipsec_fld.h ipsec_num.h \ + isakmp_doi.h math_group.h sa.h timer.h transport.h udp.h ui.h + ipsec.o: ipsec.c sysdep/linux/sys/queue.h sysdep.h \ + sysdep/freebsd/sysdep-os.h attribute.h conf.h constants.h \ + crypto.h sysdep/linux/blf.h sysdep/linux/cast.h dh.h doi.h \ + exchange.h exchange_num.h isakmp.h isakmp_fld.h field.h \ + isakmp_num.h hash.h ike_aggressive.h ike_auth.h ike_main_mode.h \ + ike_quick_mode.h ipsec.h ipsec_doi.h ipsec_fld.h ipsec_num.h \ + log.h math_group.h message.h prf.h sa.h timer.h transport.h \ + util.h + ipsec_fld.o: ipsec_fld.c sysdep.h sysdep/freebsd/sysdep-os.h constants.h \ + field.h ipsec_fld.h isakmp_num.h ipsec_num.h + ipsec_num.o: ipsec_num.c sysdep.h sysdep/freebsd/sysdep-os.h constants.h \ + ipsec_num.h + isakmp_doi.o: isakmp_doi.c sysdep.h sysdep/freebsd/sysdep-os.h doi.h \ + sysdep/linux/sys/queue.h exchange.h exchange_num.h constants.h \ + isakmp.h isakmp_fld.h field.h isakmp_num.h log.h message.h sa.h \ + util.h + isakmp_fld.o: isakmp_fld.c sysdep.h sysdep/freebsd/sysdep-os.h \ + constants.h field.h isakmp_fld.h isakmp_num.h ipsec_num.h + isakmp_num.o: isakmp_num.c sysdep.h sysdep/freebsd/sysdep-os.h \ + constants.h isakmp_num.h + isakmpd.o: isakmpd.c sysdep.h sysdep/freebsd/sysdep-os.h app.h conf.h \ + sysdep/linux/sys/queue.h connection.h init.h log.h timer.h \ + transport.h udp.h ui.h + log.o: log.c sysdep.h sysdep/freebsd/sysdep-os.h log.h + math_2n.o: math_2n.c sysdep.h sysdep/freebsd/sysdep-os.h math_2n.h \ + util.h + math_ec2n.o: math_ec2n.c sysdep.h sysdep/freebsd/sysdep-os.h math_2n.h \ + math_ec2n.h + math_group.o: math_group.c sysdep.h sysdep/freebsd/sysdep-os.h \ + gmp_util.h log.h math_2n.h math_ec2n.h math_group.h + message.o: message.c sysdep/linux/sys/queue.h sysdep.h \ + sysdep/freebsd/sysdep-os.h attribute.h cert.h constants.h \ + crypto.h sysdep/linux/blf.h sysdep/linux/cast.h doi.h \ + exchange.h exchange_num.h isakmp.h isakmp_fld.h field.h \ + isakmp_num.h log.h message.h sa.h timer.h transport.h util.h + pf_key_v2.o: pf_key_v2.c config.h sysdep/linux/sys/queue.h sysdep.h \ + sysdep/freebsd/sysdep-os.h conf.h connection.h exchange.h \ + exchange_num.h constants.h isakmp.h isakmp_fld.h field.h \ + isakmp_num.h ipsec.h ipsec_doi.h ipsec_fld.h ipsec_num.h log.h \ + pf_key_v2.h sa.h timer.h transport.h if.h + pkcs.o: pkcs.c sysdep.h sysdep/freebsd/sysdep-os.h gmp_util.h log.h \ + asn.h asn_useful.h pkcs.h + prf.o: prf.c sysdep.h sysdep/freebsd/sysdep-os.h hash.h log.h prf.h + sa.o: sa.c sysdep.h sysdep/freebsd/sysdep-os.h cookie.h doi.h \ + sysdep/linux/sys/queue.h exchange.h exchange_num.h constants.h \ + isakmp.h isakmp_fld.h field.h isakmp_num.h log.h message.h sa.h \ + timer.h transport.h util.h + sysdep.o: sysdep.c sysdep/linux/sys/queue.h sysdep.h \ + sysdep/freebsd/sysdep-os.h app.h conf.h ipsec.h ipsec_doi.h \ + ipsec_fld.h field.h ipsec_num.h constants.h pf_key_v2.h log.h + timer.o: timer.c sysdep/linux/sys/queue.h sysdep.h \ + sysdep/freebsd/sysdep-os.h log.h timer.h + transport.o: transport.c sysdep/linux/sys/queue.h sysdep.h \ + sysdep/freebsd/sysdep-os.h conf.h exchange.h exchange_num.h \ + constants.h isakmp.h isakmp_fld.h field.h isakmp_num.h log.h \ + message.h sa.h timer.h transport.h + udp.o: udp.c config.h sysdep/linux/sys/queue.h sysdep.h \ + sysdep/freebsd/sysdep-os.h conf.h if.h isakmp.h isakmp_fld.h \ + field.h isakmp_num.h constants.h log.h message.h transport.h \ + udp.h util.h + ui.o: ui.c sysdep.h sysdep/freebsd/sysdep-os.h conf.h \ + sysdep/linux/sys/queue.h connection.h doi.h exchange.h \ + exchange_num.h constants.h isakmp.h isakmp_fld.h field.h \ + isakmp_num.h log.h sa.h timer.h transport.h ui.h util.h udp.h + util.o: util.c sysdep.h sysdep/freebsd/sysdep-os.h log.h message.h \ + sysdep/linux/sys/queue.h isakmp.h isakmp_fld.h field.h \ + isakmp_num.h constants.h transport.h util.h + x509.o: x509.c sysdep.h sysdep/freebsd/sysdep-os.h conf.h \ + sysdep/linux/sys/queue.h exchange.h exchange_num.h constants.h \ + isakmp.h isakmp_fld.h field.h isakmp_num.h hash.h ike_auth.h \ + sa.h ipsec.h ipsec_doi.h ipsec_fld.h ipsec_num.h log.h asn.h \ + asn_useful.h pkcs.h x509.h + + info-am: + info: info-recursive + dvi-am: + dvi: dvi-recursive + check-am: all-am + check: check-recursive + installcheck-am: + installcheck: installcheck-recursive + all-recursive-am: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + + install-exec-am: install-sbinPROGRAMS + install-exec: install-exec-recursive + + install-data-am: install-man + install-data: install-data-recursive + + install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + install: install-recursive + uninstall-am: uninstall-sbinPROGRAMS uninstall-man + uninstall: uninstall-recursive + all-am: Makefile $(ANSI2KNR) $(PROGRAMS) $(MANS) config.h + all-redirect: all-recursive-am + install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install + installdirs: installdirs-recursive + installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man5 \ + $(DESTDIR)$(mandir)/man8 + + + mostlyclean-generic: + + clean-generic: + + distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + + maintainer-clean-generic: + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + mostlyclean-am: mostlyclean-hdr mostlyclean-sbinPROGRAMS \ + mostlyclean-compile mostlyclean-krextra mostlyclean-kr \ + mostlyclean-tags mostlyclean-generic + + mostlyclean: mostlyclean-recursive + + clean-am: clean-hdr clean-sbinPROGRAMS clean-compile clean-krextra \ + clean-kr clean-tags clean-generic mostlyclean-am + + clean: clean-recursive + + distclean-am: distclean-hdr distclean-sbinPROGRAMS distclean-compile \ + distclean-krextra distclean-kr distclean-tags \ + distclean-generic clean-am + + distclean: distclean-recursive + -rm -f config.status + + maintainer-clean-am: maintainer-clean-hdr maintainer-clean-sbinPROGRAMS \ + maintainer-clean-compile maintainer-clean-krextra \ + maintainer-clean-kr maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + + maintainer-clean: maintainer-clean-recursive + -rm -f config.status + + .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ + mostlyclean-sbinPROGRAMS distclean-sbinPROGRAMS clean-sbinPROGRAMS \ + maintainer-clean-sbinPROGRAMS uninstall-sbinPROGRAMS \ + install-sbinPROGRAMS mostlyclean-compile distclean-compile \ + clean-compile maintainer-clean-compile mostlyclean-krextra \ + distclean-krextra clean-krextra maintainer-clean-krextra mostlyclean-kr \ + distclean-kr clean-kr maintainer-clean-kr install-man5 uninstall-man5 \ + install-man8 uninstall-man8 install-man uninstall-man \ + install-data-recursive uninstall-data-recursive install-exec-recursive \ + uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ + all-recursive check-recursive installcheck-recursive info-recursive \ + dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ + maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ + distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ + dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \ + install-exec-am install-exec install-data-am install-data install-am \ + install uninstall-am uninstall all-redirect all-am all installdirs-am \ + installdirs mostlyclean-generic distclean-generic clean-generic \ + maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + + # Generated targets + exchange_num.c exchange_num.h: genconstants.sh exchange_num.cst + $(SHELL) $(srcdir)/genconstants.sh $(srcdir)/exchange_num + + ipsec_fld.c ipsec_fld.h: genfields.sh ipsec_fld.fld + $(SHELL) $(srcdir)/genfields.sh $(srcdir)/ipsec_fld + + ipsec_num.c ipsec_num.h: genconstants.sh ipsec_num.cst + $(SHELL) $(srcdir)/genconstants.sh $(srcdir)/ipsec_num + + isakmp_fld.c isakmp_fld.h: genfields.sh isakmp_fld.fld + $(SHELL) $(srcdir)/genfields.sh $(srcdir)/isakmp_fld + + isakmp_num.c isakmp_num.h: genconstants.sh isakmp_num.cst + $(SHELL) $(srcdir)/genconstants.sh $(srcdir)/isakmp_num + + # finish the distribution: + dist-hook: + rm -rf `find $(distdir) -name CVS -print` + + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. + .NOEXPORT: diff -ruN acconfig.h acconfig.h *** acconfig.h Wed Dec 31 19:00:00 1969 --- acconfig.h Wed Sep 22 16:05:25 1999 *************** *** 0 **** --- 1,286 ---- + /* acconfig.h + This file is in the public domain. + + Descriptive text for the C preprocessor macros that + the distributed Autoconf macros can define. + No software package will use all of them; autoheader copies the ones + your configure.in uses into your configuration header file templates. + + The entries are in sort -df order: alphabetical, case insensitive, + ignoring punctuation (such as underscores). Although this order + can split up related entries, it makes it easier to check whether + a given entry is in the file. + + Leave the following blank line there!! Autoheader needs it. */ + + + /* Define if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ + #ifndef _ALL_SOURCE + #undef _ALL_SOURCE + #endif + + /* Define if using alloca.c. */ + #undef C_ALLOCA + + /* Define if type char is unsigned and you are not using gcc. */ + #ifndef __CHAR_UNSIGNED__ + #undef __CHAR_UNSIGNED__ + #endif + + /* Define if the closedir function returns void instead of int. */ + #undef CLOSEDIR_VOID + + /* Define to empty if the keyword does not work. */ + #undef const + + /* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. + This function is required for alloca.c support on those systems. */ + #undef CRAY_STACKSEG_END + + /* Define for DGUX with . */ + #undef DGUX + + /* Define if you have . */ + #undef DIRENT + + /* Define to enable support for initiating arbitrary SAs. */ + #undef ENABLE_ANY_ON_DEMAND + + /* Define to enable support for asymmetric links. */ + #undef ENABLE_SYMMETRIC_LINKS + + /* Define to the type of elements in the array set by `getgroups'. + Usually this is either `int' or `gid_t'. */ + #undef GETGROUPS_T + + /* Define if the `getloadavg' function needs to be run setuid or setgid. */ + #undef GETLOADAVG_PRIVILEGED + + /* Define if the `getpgrp' function takes no argument. */ + #undef GETPGRP_VOID + + /* Define to `int' if doesn't define. */ + #undef gid_t + + /* Define if you have alloca, as a function or macro. */ + #undef HAVE_ALLOCA + + /* Define if you have and it should be used (not on Ultrix). */ + #undef HAVE_ALLOCA_H + + /* Define if you don't have vprintf but do have _doprnt. */ + #undef HAVE_DOPRNT + + /* Define if your system has a working fnmatch function. */ + #undef HAVE_FNMATCH + + /* Define if your system has its own `getloadavg' function. */ + #undef HAVE_GETLOADAVG + + /* Define if you have the getmntent function. */ + #undef HAVE_GETMNTENT + + /* Define if the `long double' type works. */ + #undef HAVE_LONG_DOUBLE + + /* Define if you support file names longer than 14 characters. */ + #undef HAVE_LONG_FILE_NAMES + + /* Define if you have a working `mmap' system call. */ + #undef HAVE_MMAP + + /* Define if system calls automatically restart after interruption + by a signal. */ + #undef HAVE_RESTARTABLE_SYSCALLS + + /* Define if your struct sockaddr has sa_len. */ + #undef HAVE_SOCKADDR_SA_LEN + + /* Define if your struct stat has st_blksize. */ + #undef HAVE_ST_BLKSIZE + + /* Define if your struct stat has st_blocks. */ + #undef HAVE_ST_BLOCKS + + /* Define if you have the strcoll function and it is properly defined. */ + #undef HAVE_STRCOLL + + /* Define if your struct stat has st_rdev. */ + #undef HAVE_ST_RDEV + + /* Define if you have the strftime function. */ + #undef HAVE_STRFTIME + + /* Define if you have the ANSI # stringizing operator in cpp. */ + #undef HAVE_STRINGIZE + + /* Define if you have that is POSIX.1 compatible. */ + #undef HAVE_SYS_WAIT_H + + /* Define if your struct tm has tm_zone. */ + #undef HAVE_TM_ZONE + + /* Define if you don't have tm_zone but do have the external array + tzname. */ + #undef HAVE_TZNAME + + /* Define if you have . */ + #undef HAVE_UNISTD_H + + /* Define if utime(file, NULL) sets file's timestamp to the present. */ + #undef HAVE_UTIME_NULL + + /* Define if you have . */ + #undef HAVE_VFORK_H + + /* Define if you have the vprintf function. */ + #undef HAVE_VPRINTF + + /* Define if you have the wait3 system call. */ + #undef HAVE_WAIT3 + + /* Define as __inline if that's what the C compiler calls it. */ + #undef inline + + /* Define if int is 16 bits instead of 32. */ + #undef INT_16_BITS + + /* Define if long int is 64 bits. */ + #undef LONG_64_BITS + + /* Define if major, minor, and makedev are declared in . */ + #undef MAJOR_IN_MKDEV + + /* Define if major, minor, and makedev are declared in . */ + #undef MAJOR_IN_SYSMACROS + + /* Define if on MINIX. */ + #undef _MINIX + + /* Define to `int' if doesn't define. */ + #undef mode_t + + /* Define if you don't have , but have . */ + #undef NDIR + + /* Define if you have , and doesn't declare the + mem* functions. */ + #undef NEED_MEMORY_H + + /* Define if your struct nlist has an n_un member. */ + #undef NLIST_NAME_UNION + + /* Define if you have . */ + #undef NLIST_STRUCT + + /* Define if your C compiler doesn't accept -c and -o together. */ + #undef NO_MINUS_C_MINUS_O + + /* Define if your Fortran 77 compiler doesn't accept -c and -o together. */ + #undef F77_NO_MINUS_C_MINUS_O + + /* Define to `long' if doesn't define. */ + #undef off_t + + /* Define to `int' if doesn't define. */ + #undef pid_t + + /* Define if the system does not provide POSIX.1 features except + with this defined. */ + #undef _POSIX_1_SOURCE + + /* Define if you need to in order for stat and other things to work. */ + #undef _POSIX_SOURCE + + /* Define as the return type of signal handlers (int or void). */ + #undef RETSIGTYPE + + /* Define to the type of arg1 for select(). */ + #undef SELECT_TYPE_ARG1 + + /* Define to the type of args 2, 3 and 4 for select(). */ + #undef SELECT_TYPE_ARG234 + + /* Define to the type of arg5 for select(). */ + #undef SELECT_TYPE_ARG5 + + /* Define if the `setpgrp' function takes no argument. */ + #undef SETPGRP_VOID + + /* Define if the setvbuf function takes the buffering type as its second + argument and the buffer pointer as the third, as on System V + before release 3. */ + #undef SETVBUF_REVERSED + + /* Define to `unsigned' if doesn't define. */ + #undef size_t + + /* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown + */ + #undef STACK_DIRECTION + + /* Define if the `S_IS*' macros in do not work properly. */ + #undef STAT_MACROS_BROKEN + + /* Define if you have the ANSI C header files. */ + #undef STDC_HEADERS + + /* Define on System V Release 4. */ + #undef SVR4 + + /* Define if you don't have , but have . */ + #undef SYSDIR + + /* Define if you don't have , but have . */ + #undef SYSNDIR + + /* Define if `sys_siglist' is declared by . */ + #undef SYS_SIGLIST_DECLARED + + /* Define if you can safely include both and . */ + #undef TIME_WITH_SYS_TIME + + /* Define if your declares struct tm. */ + #undef TM_IN_SYS_TIME + + /* Define to `int' if doesn't define. */ + #undef uid_t + + /* Define for Encore UMAX. */ + #undef UMAX + + /* Define for Encore UMAX 4.3 that has + instead of . */ + #undef UMAX4_3 + + /* Define if you do not have , index, bzero, etc.. */ + #undef USG + + /* Define vfork as fork if vfork does not work. */ + #undef vfork + + /* Define if the closedir function returns void instead of int. */ + #undef VOID_CLOSEDIR + + /* Define if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX). */ + #undef WORDS_BIGENDIAN + + /* Define if the X Window System is missing or not being used. */ + #undef X_DISPLAY_MISSING + + /* Define if lex declares yytext as a char * by default, not a char[]. */ + #undef YYTEXT_POINTER + + + /* Leave that blank line there!! Autoheader needs it. + If you're adding to this file, keep in mind: + The entries are in sort -df order: alphabetical, case insensitive, + ignoring punctuation (such as underscores). */ diff -ruN aclocal.m4 aclocal.m4 *** aclocal.m4 Wed Dec 31 19:00:00 1969 --- aclocal.m4 Mon Dec 20 11:46:56 1999 *************** *** 0 **** --- 1,1136 ---- + dnl aclocal.m4 generated automatically by aclocal 1.4 + + dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. + dnl This file is free software; the Free Software Foundation + dnl gives unlimited permission to copy and/or distribute it, + dnl with or without modifications, as long as this notice is preserved. + + dnl This program is distributed in the hope that it will be useful, + dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without + dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A + dnl PARTICULAR PURPOSE. + + # Do all the work for Automake. This macro actually does too much -- + # some checks are only needed if your package does certain things. + # But this isn't really a big deal. + + # serial 1 + + dnl Usage: + dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + + AC_DEFUN(AM_INIT_AUTOMAKE, + [AC_REQUIRE([AC_PROG_INSTALL]) + PACKAGE=[$1] + AC_SUBST(PACKAGE) + VERSION=[$2] + AC_SUBST(VERSION) + dnl test to see if srcdir already configured + if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi + ifelse([$3],, + AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) + AC_REQUIRE([AM_SANITY_CHECK]) + AC_REQUIRE([AC_ARG_PROGRAM]) + dnl FIXME This is truly gross. + missing_dir=`cd $ac_aux_dir && pwd` + AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) + AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) + AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) + AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) + AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) + AC_REQUIRE([AC_PROG_MAKE_SET])]) + + # + # Check to make sure that the build environment is sane. + # + + AC_DEFUN(AM_SANITY_CHECK, + [AC_MSG_CHECKING([whether build environment is sane]) + # Just in case + sleep 1 + echo timestamp > conftestfile + # Do `set' in a subshell so we don't clobber the current shell's + # arguments. Must try -L first in case configure is actually a + # symlink; some systems play weird games with the mod time of symlinks + # (eg FreeBSD returns the mod time of the symlink's containing + # directory). + if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + + test "[$]2" = conftestfile + ) + then + # Ok. + : + else + AC_MSG_ERROR([newly created file is older than distributed files! + Check your system clock]) + fi + rm -f conftest* + AC_MSG_RESULT(yes)]) + + dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) + dnl The program must properly implement --version. + AC_DEFUN(AM_MISSING_PROG, + [AC_MSG_CHECKING(for working $2) + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. + # Redirect stdin to placate older versions of autoconf. Sigh. + if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) + else + $1="$3/missing $2" + AC_MSG_RESULT(missing) + fi + AC_SUBST($1)]) + + # Like AC_CONFIG_HEADER, but automatically create stamp file. + + AC_DEFUN(AM_CONFIG_HEADER, + [AC_PREREQ([2.12]) + AC_CONFIG_HEADER([$1]) + dnl When config.status generates a header, we must update the stamp-h file. + dnl This file resides in the same directory as the config header + dnl that is generated. We must strip everything past the first ":", + dnl and everything past the last "/". + AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl + ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, + <>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, + <>; do + case " <<$>>CONFIG_HEADERS " in + *" <<$>>am_file "*<<)>> + echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx + ;; + esac + am_indx=`expr "<<$>>am_indx" + 1` + done<<>>dnl>>) + changequote([,]))]) + + + # serial 1 + + AC_DEFUN(AM_C_PROTOTYPES, + [AC_REQUIRE([AM_PROG_CC_STDC]) + AC_REQUIRE([AC_PROG_CPP]) + AC_MSG_CHECKING([for function prototypes]) + if test "$am_cv_prog_cc_stdc" != no; then + AC_MSG_RESULT(yes) + AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes]) + U= ANSI2KNR= + else + AC_MSG_RESULT(no) + U=_ ANSI2KNR=./ansi2knr + # Ensure some checks needed by ansi2knr itself. + AC_HEADER_STDC + AC_CHECK_HEADERS(string.h) + fi + AC_SUBST(U)dnl + AC_SUBST(ANSI2KNR)dnl + ]) + + + # serial 1 + + # @defmac AC_PROG_CC_STDC + # @maindex PROG_CC_STDC + # @ovindex CC + # If the C compiler in not in ANSI C mode by default, try to add an option + # to output variable @code{CC} to make it so. This macro tries various + # options that select ANSI C on some system or another. It considers the + # compiler to be in ANSI C mode if it handles function prototypes correctly. + # + # If you use this macro, you should check after calling it whether the C + # compiler has been set to accept ANSI C; if not, the shell variable + # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source + # code in ANSI C, you can make an un-ANSIfied copy of it by using the + # program @code{ansi2knr}, which comes with Ghostscript. + # @end defmac + + AC_DEFUN(AM_PROG_CC_STDC, + [AC_REQUIRE([AC_PROG_CC]) + AC_BEFORE([$0], [AC_C_INLINE]) + AC_BEFORE([$0], [AC_C_CONST]) + dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require + dnl a magic option to avoid problems with ANSI preprocessor commands + dnl like #elif. + dnl FIXME: can't do this because then AC_AIX won't work due to a + dnl circular dependency. + dnl AC_BEFORE([$0], [AC_PROG_CPP]) + AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) + AC_CACHE_VAL(am_cv_prog_cc_stdc, + [am_cv_prog_cc_stdc=no + ac_save_CC="$CC" + # Don't try gcc -ansi; that turns off useful extensions and + # breaks some systems' header files. + # AIX -qlanglvl=ansi + # Ultrix and OSF/1 -std1 + # HP-UX -Aa -D_HPUX_SOURCE + # SVR4 -Xc -D__EXTENSIONS__ + for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" + do + CC="$ac_save_CC $ac_arg" + AC_TRY_COMPILE( + [#include + #include + #include + #include + /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ + struct buf { int x; }; + FILE * (*rcsopen) (struct buf *, struct stat *, int); + static char *e (p, i) + char **p; + int i; + { + return p[i]; + } + static char *f (char * (*g) (char **, int), char **p, ...) + { + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; + } + int test (int i, double x); + struct s1 {int (*f) (int a);}; + struct s2 {int (*f) (double a);}; + int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); + int argc; + char **argv; + ], [ + return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ], + [am_cv_prog_cc_stdc="$ac_arg"; break]) + done + CC="$ac_save_CC" + ]) + if test -z "$am_cv_prog_cc_stdc"; then + AC_MSG_RESULT([none needed]) + else + AC_MSG_RESULT($am_cv_prog_cc_stdc) + fi + case "x$am_cv_prog_cc_stdc" in + x|xno) ;; + *) CC="$CC $am_cv_prog_cc_stdc" ;; + esac + ]) + + dnl Copyright (c) 1999 BBN Corporation + dnl + dnl Permission to use, copy, modify, and distribute this software + dnl and its documentation for any purpose is hereby granted without + dnl fee, provided that the above copyright notice and this permission + dnl appear in all copies and in supporting documentation, and that the + dnl name of BBN Corporation not be used in advertising or publicity + dnl pertaining to distribution of the software without specific, + dnl written prior permission. BBN makes no representations about the + dnl suitability of this software for any purposes. It is provided "AS + dnl IS" without express or implied warranties. + dnl + dnl This software and its documentation was written by BBN Corporation + dnl under sponsorship by the Defense Advanced Research Projects Agency. + dnl + dnl $Header: /IR-CVS/bbn-aclocal/bbn-ac.m4,v 1.1 1999/12/03 17:10:08 fredette Exp $ + dnl $Author: fredette $ + dnl $Date: 1999/12/03 17:10:08 $ + dnl $Id: bbn-ac.m4,v 1.1 1999/12/03 17:10:08 fredette Exp $ + dnl $Revision: 1.1 $ + + dnl AC_SYS_SOCKADDR_SA_LEN + undefine(AC_SYS_SOCKADDR_SA_LEN) + AC_DEFUN(AC_SYS_SOCKADDR_SA_LEN, + [AC_CACHE_CHECK(for sa_len in struct sockaddr, ac_cv_sys_sockaddr_sa_len, + [AC_TRY_COMPILE([ + #include + #include + ], [ + int length; + struct sockaddr sock; + length = sock.sa_len; + ], ac_cv_sys_sockaddr_sa_len=yes, ac_cv_sys_sockaddr_sa_len=no)]) + dnl + if test $ac_cv_sys_sockaddr_sa_len = yes; then + AC_DEFINE_UNQUOTED(HAVE_SOCKADDR_SA_LEN) + fi dnl + ])dnl + + dnl AC_SYS_MSGHDR_MSG_CONTROL + undefine(AC_SYS_MSGHDR_MSG_CONTROL) + AC_DEFUN(AC_SYS_MSGHDR_MSG_CONTROL, + [AC_CACHE_CHECK(for msg_control in struct msghdr, ac_cv_sys_msghdr_msg_control, + [AC_TRY_COMPILE([ + #include + #include + ], [ + char *control; + struct msghdr mhdr; + control = mhdr.msg_control; + ], ac_cv_sys_msghdr_msg_control=yes, ac_cv_sys_msghdr_msg_control=no)]) + dnl + if test $ac_cv_sys_msghdr_msg_control = yes; then + AC_DEFINE_UNQUOTED(HAVE_MSGHDR_MSG_CONTROL) + fi dnl + ])dnl + + dnl AC_SYS_UIO_MAXIOVEC + undefine(AC_SYS_UIO_MAXIOVEC) + AC_DEFUN(AC_SYS_UIO_MAXIOVEC, + [AC_CACHE_CHECK(for the maximum number of iovecs readv and writev accept, ac_cv_sys_uio_maxiovec, + [uio_maxiovec=2 + while true; do + next_uio_maxiovec=`expr $uio_maxiovec '*' 2` + AC_EGREP_CPP(next_uio_maxiovec_ok, + [#include + #define KERNEL + #include + #undef KERNEL + #ifndef UIO_MAXIOV + #ifdef IOV_MAX + #define UIO_MAXIOV IOV_MAX + #else + #define UIO_MAXIOV $uio_maxiovec + #endif + #endif + #if UIO_MAXIOV >= $next_uio_maxiovec + next_uio_maxiovec_ok + ], uio_maxiovec=$next_uio_maxiovec, break) + done + ac_cv_sys_uio_maxiovec=$uio_maxiovec]) + dnl + AC_DEFINE_UNQUOTED(UIO_MAXIOVEC, $ac_cv_sys_uio_maxiovec) + ])dnl + + dnl AC_CONFIG_SUBDIRS_NOW(SUBDIRS [, CONFIGURE-OPTIONS]) + undefine(AC_CONFIG_SUBDIRS_NOW) + AC_DEFUN(AC_CONFIG_SUBDIRS_NOW, + [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl + AC_CACHE_SAVE + ac_configure_args_SAVE="$ac_configure_args" + INSTALL_SAVE="$INSTALL" + ac_configure_args="$ac_configure_args $2" + AC_OUTPUT_SUBDIRS($1) + ac_configure_args="$ac_configure_args_SAVE" + INSTALL="$INSTALL_SAVE" + AC_CACHE_LOAD + ])dnl + + + # Define a conditional. + + AC_DEFUN(AM_CONDITIONAL, + [AC_SUBST($1_TRUE) + AC_SUBST($1_FALSE) + if $2; then + $1_TRUE= + $1_FALSE='#' + else + $1_TRUE='#' + $1_FALSE= + fi]) + + dnl Copyright (c) 1999 BBN Corporation + dnl + dnl Permission to use, copy, modify, and distribute this software + dnl and its documentation for any purpose is hereby granted without + dnl fee, provided that the above copyright notice and this permission + dnl appear in all copies and in supporting documentation, and that the + dnl name of BBN Corporation not be used in advertising or publicity + dnl pertaining to distribution of the software without specific, + dnl written prior permission. BBN makes no representations about the + dnl suitability of this software for any purposes. It is provided "AS + dnl IS" without express or implied warranties. + dnl + dnl This software and its documentation was written by BBN Corporation + dnl under sponsorship by the Defense Advanced Research Projects Agency. + dnl + dnl $Header: /IR-CVS/bbn-aclocal/bbn.m4,v 1.1 1999/12/03 17:10:09 fredette Exp $ + dnl $Author: fredette $ + dnl $Date: 1999/12/03 17:10:09 $ + dnl $Id: bbn.m4,v 1.1 1999/12/03 17:10:09 fredette Exp $ + dnl $Revision: 1.1 $ + + dnl BBN_PROG_PERL(VARIABLE [, PROGS-TO-CHECK-FOR, [, VALUE-IF-NOT-FOUND [, VERSION-CHECKING-CODE [, PATH]]]]) + undefine(BBN_PROG_PERL) + AC_DEFUN(BBN_PROG_PERL, + [dnl + for bbn_perl_prog in ifelse([$2], , [perl4.036 perl4 perl perl5], [$2]); do + AC_PATH_PROG($1, [$]bbn_perl_prog, $3, $5) + if test x[$]$1 = x$3; then continue; fi + changequote(<<, >>)dnl + ifelse(<<$4>>, , <>, << + dnl the assignment to dollar-left-bracket is to keep + dnl m4's quoting mechanism happy (otherwise, it would + dnl see the dollar-right-bracket as a close-quote): + AC_MSG_CHECKING(what version <<$>>$1 is) + bbn_perl_version=`<<$>>$1 -e '$[ = 0; print ($] + 0);'` + AC_MSG_RESULT($bbn_perl_version) + case "$bbn_perl_version" in + $4 + ;; + esac + >>) + changequote([, ])dnl + $1=$3 + done + AC_SUBST($1) + ])dnl + + dnl BBN_PATH_EFENCE([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) + undefine(BBN_PATH_EFENCE) + AC_DEFUN(BBN_PATH_EFENCE, + [dnl + AC_ARG_WITH(efence, + [ --with-efence[=DIR] link programs with Electric Fence, found in optional DIR (default=don't)], + [ ], [with_efence=no]) + EFENCE_LDADD= + if test "x$with_efence" != "xno"; then + save_LDFLAGS="$LDFLAGS" + EFENCE_LDADD="-lefence" + if test "x$with_efence" != "xyes"; then + LDFLAGS="$LDFLAGS -L$with_efence" + EFENCE_LDADD="-L$with_efence $EFENCE_LDADD" + fi + AC_CHECK_LIB(efence, EF_Print, $2, $3) + LDFLAGS="$save_LDFLAGS" + fi + AC_SUBST(EFENCE_LDADD) + ])dnl + + dnl BBN_PATH_LIBMALLOC([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) + undefine(BBN_PATH_LIBMALLOC) + AC_DEFUN(BBN_PATH_LIBMALLOC, + [dnl + AC_ARG_WITH(libmalloc, + [ --with-libmalloc[=DIR] link programs with libmalloc_d, found in optional DIR (default=don't)], + [ ], [with_libmalloc=no]) + LIBMALLOC_LDADD= + if test "x$with_libmalloc" != "xno"; then + save_LDFLAGS="$LDFLAGS" + LIBMALLOC_LDADD="-lmalloc_d" + if test "x$with_libmalloc" != "xyes"; then + LDFLAGS="$LDFLAGS -L$with_libmalloc" + LIBMALLOC_LDADD="-L$with_libmalloc $LIBMALLOC_LDADD" + fi + AC_CHECK_LIB(malloc_d, mal_statsdump, $2, $3) + LDFLAGS="$save_LDFLAGS" + fi + AC_SUBST(LIBMALLOC_LDADD) + ])dnl + + dnl BBN_PATH_BOEHM_GC + undefine(BBN_PATH_BOEHM_GC) + AC_DEFUN(BBN_PATH_BOEHM_GC, + [dnl + AC_ARG_WITH(boehm-gc, + [ --with-boehm-gc[=DIR] link programs with Boehm's GC library, found in optional DIR (default=don't)], + [ ], [with_boehm_gc=no]) + BOEHM_GC_LDADD= + if test "x$with_boehm_gc" != "xno"; then + save_LDFLAGS="$LDFLAGS" + BOEHM_GC_LDADD="-lgc" + if test "x$with_boehm_gc" != "xyes"; then + LDFLAGS="$LDFLAGS -L$with_boehm_gc" + BOEHM_GC_LDADD="-L$with_boehm_gc $BOEHM_GC_LDADD" + fi + AC_CHECK_LIB(gc, main, [ ], AC_MSG_ERROR([cannot find Boehm's garbage collector])) + LDFLAGS="$save_LDFLAGS" + fi + AC_SUBST(BOEHM_GC_LDADD) + ])dnl + + dnl BBN_PATH_BOEHM_LEAK + undefine(BBN_PATH_BOEHM_LEAK) + AC_DEFUN(BBN_PATH_BOEHM_LEAK, + [dnl + AC_REQUIRE([AC_PROG_CC]) + AC_ARG_WITH(boehm-leak, + [ --with-boehm-leak[=DIR] link programs with Boehm's leak library, found in optional DIR (default=don't)], + [ ], [with_boehm_leak=no]) + BOEHM_LEAK_INCLUDES= + BOEHM_LEAK_LDADD= + if test "x$with_boehm_leak" != "xno"; then + if test "x$GCC" != "xyes"; then + AC_MSG_ERROR([you can only use Boehm's leak library when compiling with GCC]) + fi + BOEHM_LEAK_INCLUDES="-D'malloc(x)=({ \ + void *GC_debug_malloc (size_t, char *, int); \ + GC_debug_malloc ((x), __FILE__, __LINE__); \ + })' \ + -D'realloc(x,y)=({ \ + void *GC_debug_realloc (void *, size_t, char *, int); \ + GC_debug_realloc ((x), (y), __FILE__, __LINE__); \ + })' \ + -D'free(x)=({ \ + void GC_debug_free (void *); \ + GC_debug_free (x); \ + })' \ + -D'calloc(x,y)=malloc((x) * (y))' \ + -D'strdup(x)=({ \ + char *strcpy (char *, const char *); \ + const char *_x_ = (x); \ + char *_y_ = malloc (strlen (_x_) + 1); \ + strcpy (_y_, _x_); \ + })'" + save_LDFLAGS="$LDFLAGS" + BOEHM_LEAK_LDADD="-lleak" + if test "x$with_boehm_leak" != "xyes"; then + LDFLAGS="$LDFLAGS -L$with_boehm_leak" + BOEHM_LEAK_LDADD="-L$with_boehm_leak $BOEHM_LEAK_LDADD" + fi + AC_CHECK_LIB(leak, main, [ ], AC_MSG_ERROR([cannot find Boehm's memory leak library])) + LDFLAGS="$save_LDFLAGS" + fi + AC_SUBST(BOEHM_LEAK_INCLUDES) + AC_SUBST(BOEHM_LEAK_LDADD) + ])dnl + + dnl BBN_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) + undefine(BBN_PATH_GLIB) + AC_DEFUN(BBN_PATH_GLIB, + [dnl + AC_ARG_WITH(glib, + [ --with-glib=DIR use an uninstalled glib in DIR (optional)], + [ with_glib=`cd $with_glib 2>/dev/null && pwd` ], [ ]) + bbn_glib_found=false + if test x$with_glib != x; then + dnl we assume that the user is pointing us at a recent enough + dnl version (read: desired version) of glib, so we don't bother + dnl checking its version or compiling a test program: + GLIB_CONFIG="$with_glib/glib-config" + glib_modules="" + for glib_module in . $4; do + case "$glib_module" in + glib | gmodule | gthread) glib_modules="$glib_modules $glib_module" ;; + esac + done + if $GLIB_CONFIG --version >/dev/null 2>&1; then + GLIB_CFLAGS="-I$with_glib `$GLIB_CONFIG --cflags $glib_modules`" + GLIB_LIBS="" + for glib_lib in . `$GLIB_CONFIG --libs $glib_modules`; do + case "$glib_lib" in + -l* ) + glib_lib_lt="$with_glib`echo $glib_lib | sed 's/^\-l//'`.la" + if test -r $glib_lib_lt; then glib_lib=$glib_lib_lt; fi + GLIB_LIBS="$GLIB_LIBS $glib_lib" + ;; + * ) + GLIB_LIBS="$GLIB_LIBS $glib_lib" + ;; + esac + done + AC_SUBST(GLIB_CFLAGS) + AC_SUBST(GLIB_LIBS) + bbn_glib_found=true + fi + else + AM_PATH_GLIB($1, bbn_glib_found=true, ,$4) + fi + if $bbn_glib_found; then + $2 + else + $3 + fi + ])dnl + + dnl BBN_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) + undefine(BBN_PATH_GTK) + AC_DEFUN(BBN_PATH_GTK, + [dnl + AC_ARG_WITH(gtk, + [ --with-gtk=DIR use an uninstalled gtk in DIR (optional)], + [ with_gtk=`cd $with_gtk 2>/dev/null && pwd` ], [ ]) + bbn_gtk_found=false + AC_REQUIRE([AC_PATH_X]) + AC_REQUIRE([AC_PATH_XTRA]) + if test "x$x_includes" = "x"; then + x_includes="/usr/include" + fi + if test "x$x_libraries" = "x"; then + x_libraries="/usr/lib" + fi + if test "x$no_x" != "xyes"; then + if test x$with_gtk != x; then + dnl we assume that the user is pointing us at a recent enough + dnl version (read: desired version) of gtk, so we don't bother + dnl checking its version or compiling a test program: + GTK_CONFIG="$with_gtk/gtk-config" + gtk_modules="" + for gtk_module in . $4; do + case "$gtk_module" in + gtk | gthread) gtk_modules="$gtk_modules $gtk_module" ;; + esac + done + if $GTK_CONFIG --version >/dev/null 2>&1; then + GTK_CFLAGS="-I$with_gtk `$GTK_CONFIG --cflags $gtk_modules`" + GTK_LIBS="" + for gtk_lib in . `$GTK_CONFIG --libs $gtk_modules`; do + case "$gtk_lib" in + -l* ) + gtk_lib_lt="$with_gtk`echo $gtk_lib | sed 's/^\-l//'`.la" + if test -r $gtk_lib_lt; then gtk_lib=$gtk_lib_lt; fi + GTK_LIBS="$GTK_LIBS $gtk_lib" + ;; + * ) + GTK_LIBS="$GTK_LIBS $gtk_lib" + ;; + esac + done + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) + bbn_gtk_found=true + fi + else + AM_PATH_GTK($1, bbn_gtk_found=true, ,$4) + fi + fi + if $bbn_gtk_found; then + $2 + else + $3 + fi + ])dnl + + dnl BBN_PATH_KAME([MINIMUM-SNAP [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, LIBS, FUNCTIONS]]]]) + undefine(BBN_PATH_KAME) + AC_DEFUN(BBN_PATH_KAME, + [dnl + AC_REQUIRE([AC_CANONICAL_SYSTEM]) + AC_ARG_WITH(kame, + [ --with-kame=DIR use an uninstalled kame in DIR (optional)], + [ with_kame=`cd $with_kame 2>/dev/null && pwd` ], [ ]) + if test x$with_kame != x; then + AC_MSG_CHECKING([for KAME support]) + case ${target} in + *-*-freebsdelf3*) kame_os_name=freebsd3 kame_sys_includes=sys ;; + *-*-netbsd*) kame_os_name=netbsd kame_sys_includes=sys ;; + *-*-bsdi*) kame_os_name=bsdi kame_sys_includes=sys ;; + *) kame_os_name= ;; + esac + if test x$kame_os_name != x; then + AC_MSG_RESULT(yes) + AC_MSG_CHECKING([for $with_kame/$kame_os_name/INSTALL]) + if test -r "$with_kame/$kame_os_name/INSTALL"; then + AC_MSG_RESULT(yes) + AC_MSG_CHECKING([for $with_kame/kame/sys/netinet6/ipsec.h]) + if test -r "$with_kame/kame/sys/netinet6/ipsec.h"; then + AC_MSG_RESULT(yes) + KAME_CFLAGS="-I$with_kame/$kame_os_name/$kame_sys_includes -I$with_kame/kame/sys" + KAME_LIBS="-L$with_kame/kame/kame/libinet6" + else + AC_MSG_RESULT(no) + kame_os_name= + fi + else + AC_MSG_RESULT(no) + kame_os_name= + fi + fi + else + KAME_CFLAGS= + KAME_LIBS= + kame_os_name= + AC_CHECK_HEADER(netkey/keyv2.h, [AC_EGREP_HEADER(sadb_x_ipsecrequest, netkey/keyv2.h, kame_os_name=true)]) + fi + if test x$kame_os_name != x; then + kame_libs="$4" + kame_funcs="$5" + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$KAME_LIBS $LDFLAGS" + while test x$kame_libs != x; do + set $kame_libs; kame_lib=[$]1; shift; kame_libs=[$]* + set $kame_funcs; kame_func=[$]1; shift; kame_funcs=[$]* + AC_CHECK_LIB($kame_lib, $kame_func, [ ], [kame_os_name= ; break]) + KAME_LIBS="$KAME_LIBS -l$kame_lib" + done + LDFLAGS="$save_LDFLAGS" + fi + if test x$kame_os_name != x; then + $2 + else + KAME_CFLAGS= + KAME_LIBS= + $3 + fi + AC_SUBST(KAME_CFLAGS) + AC_SUBST(KAME_LIBS) + ])dnl + + dnl BBN_CHECK_SIZEOF(NAME, INCLUDES, TYPE, [CROSS-SIZE]) + undefine(BBN_CHECK_SIZEOF) + AC_DEFUN(BBN_CHECK_SIZEOF, + [changequote(<<, >>)dnl + dnl The name to #define. + define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl + dnl The cache variable name. + define(<>, translit(bbn_cv_sizeof_$1, [ *], [_p]))dnl + changequote([, ])dnl + AC_CACHE_CHECK(for size of $1, BBN_CV_NAME, + [AC_TRY_RUN([ + #include + $2 + $3 bbn_thing; + main() + { + FILE *fp; + if ((fp = fopen("conftestval", "w")) == NULL) exit(1); + fprintf(fp, "%d\n", sizeof(bbn_thing)); + exit(0); + }], BBN_CV_NAME=`cat conftestval`, BBN_CV_NAME=0, ifelse([$4], , , BBN_CV_NAME=$4))]) + AC_DEFINE_UNQUOTED(BBN_TYPE_NAME, $BBN_CV_NAME) + undefine(BBN_TYPE_NAME)dnl + undefine(BBN_CV_NAME)dnl + ])dnl + + dnl BBN_C_CFLAGS([CXX]) + undefine(BBN_C_CFLAGS) + AC_DEFUN(BBN_C_CFLAGS, + [dnl + AC_REQUIRE([AC_PROG_CC]) + ifelse([$1], CXX, [AC_REQUIRE([AC_PROG_CXX])]) + AC_ARG_ENABLE(debug, + [ --disable-debug don't compile debuggable libraries and programs (default=do)], + [ ], [enable_debug=yes]) + if test "x$enable_debug" = "xyes"; then + CFLAGS="${CFLAGS-} -O0" + ifelse([$1], CXX, [CXXFLAGS="${CXXFLAGS-} -O0"]) + fi + AC_ARG_ENABLE(warnings, + [ --disable-warnings don't compile with warnings turned on (default=do)], + [ ], [enable_warnings=yes]) + if test "x$enable_warnings" = "xyes"; then + if test "x$GCC" = "xyes"; then + CFLAGS="${CFLAGS-} -Wall -Wmissing-prototypes -Wstrict-prototypes"; + fi + ifelse([$1], CXX, [dnl + if test "x$GXX" = "xyes"; then + changequote(<<, >>)dnl + if test `$CXX --version | sed 's/^[0-9][0-9]*\.\([0-9][0-9]*\).*$/\1/'` -lt 8; then + cxx_handle_ex="-fhandle-exceptions" + fi + changequote([, ])dnl + CXXFLAGS="${CXXFLAGS-} ${cxx_handle_ex-} -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-uninitialized" + fi + ]) + fi + AC_ARG_ENABLE(profiled, + [ --enable-profiled compile profilable libraries and programs (default=don't)], + [ ], [enable_profiled=no]) + if test "x$enable_profiled" = "xyes"; then + CFLAGS="${CFLAGS-} -pg" + ifelse([$1], CXX, [CXXFLAGS="${CXXFLAGS-} -pg"]) + fi + ])dnl + + + # Configure paths for GLIB + # Owen Taylor 97-11-3 + + dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) + dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or + dnl gthread is specified in MODULES, pass to glib-config + dnl + AC_DEFUN(AM_PATH_GLIB, + [dnl + dnl Get the cflags and libraries from the glib-config script + dnl + AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)], + glib_config_prefix="$withval", glib_config_prefix="") + AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)], + glib_config_exec_prefix="$withval", glib_config_exec_prefix="") + AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program], + , enable_glibtest=yes) + + if test x$glib_config_exec_prefix != x ; then + glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" + if test x${GLIB_CONFIG+set} != xset ; then + GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config + fi + fi + if test x$glib_config_prefix != x ; then + glib_config_args="$glib_config_args --prefix=$glib_config_prefix" + if test x${GLIB_CONFIG+set} != xset ; then + GLIB_CONFIG=$glib_config_prefix/bin/glib-config + fi + fi + + for module in . $4 + do + case "$module" in + gmodule) + glib_config_args="$glib_config_args gmodule" + ;; + gthread) + glib_config_args="$glib_config_args gthread" + ;; + esac + done + + AC_PATH_PROG(GLIB_CONFIG, glib-config, no) + min_glib_version=ifelse([$1], ,0.99.7,$1) + AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) + no_glib="" + if test "$GLIB_CONFIG" = "no" ; then + no_glib=yes + else + GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags` + GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs` + glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_glibtest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$GLIB_LIBS $LIBS" + dnl + dnl Now check if the installed GLIB is sufficiently new. (Also sanity + dnl checks the results of glib-config to some extent + dnl + rm -f conf.glibtest + AC_TRY_RUN([ + #include + #include + #include + + int + main () + { + int major, minor, micro; + char *tmp_version; + + system ("touch conf.glibtest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_glib_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_glib_version"); + exit(1); + } + + if ((glib_major_version != $glib_config_major_version) || + (glib_minor_version != $glib_config_minor_version) || + (glib_micro_version != $glib_config_micro_version)) + { + printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", + $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, + glib_major_version, glib_minor_version, glib_micro_version); + printf ("*** was found! If glib-config was correct, then it is best\n"); + printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n"); + printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } + else if ((glib_major_version != GLIB_MAJOR_VERSION) || + (glib_minor_version != GLIB_MINOR_VERSION) || + (glib_micro_version != GLIB_MICRO_VERSION)) + { + printf("*** GLIB header files (version %d.%d.%d) do not match\n", + GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + glib_major_version, glib_minor_version, glib_micro_version); + } + else + { + if ((glib_major_version > major) || + ((glib_major_version == major) && (glib_minor_version > minor)) || + ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", + glib_major_version, glib_minor_version, glib_micro_version); + printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the glib-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n"); + printf("*** correct copy of glib-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; + } + ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_glib" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$GLIB_CONFIG" = "no" ; then + echo "*** The glib-config script installed by GLIB could not be found" + echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the GLIB_CONFIG environment variable to the" + echo "*** full path to glib-config." + else + if test -f conf.glibtest ; then + : + else + echo "*** Could not run GLIB test program, checking why..." + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$LIBS $GLIB_LIBS" + AC_TRY_LINK([ + #include + #include + ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GLIB or finding the wrong" + echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" + echo "***" + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" + echo "*** came with the system with the command" + echo "***" + echo "*** rpm --erase --nodeps gtk gtk-devel" ], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GLIB was incorrectly installed" + echo "*** or that you have moved GLIB since it was installed. In the latter case, you" + echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GLIB_CFLAGS="" + GLIB_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GLIB_CFLAGS) + AC_SUBST(GLIB_LIBS) + rm -f conf.glibtest + ]) + + # Configure paths for GTK+ + # Owen Taylor 97-11-3 + + dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) + dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS + dnl + AC_DEFUN(AM_PATH_GTK, + [dnl + dnl Get the cflags and libraries from the gtk-config script + dnl + AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], + gtk_config_prefix="$withval", gtk_config_prefix="") + AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], + gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") + AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], + , enable_gtktest=yes) + + for module in . $4 + do + case "$module" in + gthread) + gtk_config_args="$gtk_config_args gthread" + ;; + esac + done + + if test x$gtk_config_exec_prefix != x ; then + gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config + fi + fi + if test x$gtk_config_prefix != x ; then + gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_prefix/bin/gtk-config + fi + fi + + AC_PATH_PROG(GTK_CONFIG, gtk-config, no) + min_gtk_version=ifelse([$1], ,0.99.7,$1) + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) + no_gtk="" + if test "$GTK_CONFIG" = "no" ; then + no_gtk=yes + else + GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` + GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` + gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_gtktest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$GTK_LIBS $LIBS" + dnl + dnl Now check if the installed GTK is sufficiently new. (Also sanity + dnl checks the results of gtk-config to some extent + dnl + rm -f conf.gtktest + AC_TRY_RUN([ + #include + #include + #include + + int + main () + { + int major, minor, micro; + char *tmp_version; + + system ("touch conf.gtktest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_gtk_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_gtk_version"); + exit(1); + } + + if ((gtk_major_version != $gtk_config_major_version) || + (gtk_minor_version != $gtk_config_minor_version) || + (gtk_micro_version != $gtk_config_micro_version)) + { + printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf ("*** was found! If gtk-config was correct, then it is best\n"); + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); + printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } + #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) + else if ((gtk_major_version != GTK_MAJOR_VERSION) || + (gtk_minor_version != GTK_MINOR_VERSION) || + (gtk_micro_version != GTK_MICRO_VERSION)) + { + printf("*** GTK+ header files (version %d.%d.%d) do not match\n", + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + } + #endif /* defined (GTK_MAJOR_VERSION) ... */ + else + { + if ((gtk_major_version > major) || + ((gtk_major_version == major) && (gtk_minor_version > minor)) || + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); + printf("*** correct copy of gtk-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; + } + ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_gtk" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$GTK_CONFIG" = "no" ; then + echo "*** The gtk-config script installed by GTK could not be found" + echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the GTK_CONFIG environment variable to the" + echo "*** full path to gtk-config." + else + if test -f conf.gtktest ; then + : + else + echo "*** Could not run GTK test program, checking why..." + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + AC_TRY_LINK([ + #include + #include + ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GTK or finding the wrong" + echo "*** version of GTK. If it is not finding GTK, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" + echo "***" + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" + echo "*** came with the system with the command" + echo "***" + echo "*** rpm --erase --nodeps gtk gtk-devel" ], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GTK was incorrectly installed" + echo "*** or that you have moved GTK since it was installed. In the latter case, you" + echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GTK_CFLAGS="" + GTK_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) + rm -f conf.gtktest + ]) + diff -ruN ansi2knr.1 ansi2knr.1 *** ansi2knr.1 Wed Dec 31 19:00:00 1969 --- ansi2knr.1 Fri Feb 12 23:07:48 1999 *************** *** 0 **** --- 1,36 ---- + .TH ANSI2KNR 1 "19 Jan 1996" + .SH NAME + ansi2knr \- convert ANSI C to Kernighan & Ritchie C + .SH SYNOPSIS + .I ansi2knr + [--varargs] input_file [output_file] + .SH DESCRIPTION + If no output_file is supplied, output goes to stdout. + .br + There are no error messages. + .sp + .I ansi2knr + recognizes function definitions by seeing a non-keyword identifier at the left + margin, followed by a left parenthesis, with a right parenthesis as the last + character on the line, and with a left brace as the first token on the + following line (ignoring possible intervening comments). It will recognize a + multi-line header provided that no intervening line ends with a left or right + brace or a semicolon. These algorithms ignore whitespace and comments, except + that the function name must be the first thing on the line. + .sp + The following constructs will confuse it: + .br + - Any other construct that starts at the left margin and follows the + above syntax (such as a macro or function call). + .br + - Some macros that tinker with the syntax of the function header. + .sp + The --varargs switch is obsolete, and is recognized only for + backwards compatibility. The present version of + .I ansi2knr + will always attempt to convert a ... argument to va_alist and va_dcl. + .SH AUTHOR + L. Peter Deutsch wrote the original ansi2knr and + continues to maintain the current version; most of the code in the current + version is his work. ansi2knr also includes contributions by Francois + Pinard and Jim Avera . diff -ruN ansi2knr.c ansi2knr.c *** ansi2knr.c Wed Dec 31 19:00:00 1969 --- ansi2knr.c Fri Feb 12 23:07:48 1999 *************** *** 0 **** --- 1,609 ---- + /* Copyright (C) 1989, 1997, 1998 Aladdin Enterprises. All rights reserved. */ + + /*$Id: ansi2knr.c,v 1.10 1998/12/02 12:42:23 tromey Exp $*/ + /* Convert ANSI C function definitions to K&R ("traditional C") syntax */ + + /* + ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY. No author or distributor accepts responsibility to anyone for the + consequences of using it or for whether it serves any particular purpose or + works at all, unless he says so in writing. Refer to the GNU General Public + License (the "GPL") for full details. + + Everyone is granted permission to copy, modify and redistribute ansi2knr, + but only under the conditions described in the GPL. A copy of this license + is supposed to have been given to you along with ansi2knr so you can know + your rights and responsibilities. It should be in a file named COPYLEFT, + or, if there is no file named COPYLEFT, a file named COPYING. Among other + things, the copyright notice and this notice must be preserved on all + copies. + + We explicitly state here what we believe is already implied by the GPL: if + the ansi2knr program is distributed as a separate set of sources and a + separate executable file which are aggregated on a storage medium together + with another program, this in itself does not bring the other program under + the GPL, nor does the mere fact that such a program or the procedures for + constructing it invoke the ansi2knr executable bring any other part of the + program under the GPL. + */ + + /* + * Usage: + ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]] + * --filename provides the file name for the #line directive in the output, + * overriding input_file (if present). + * If no input_file is supplied, input is read from stdin. + * If no output_file is supplied, output goes to stdout. + * There are no error messages. + * + * ansi2knr recognizes function definitions by seeing a non-keyword + * identifier at the left margin, followed by a left parenthesis, + * with a right parenthesis as the last character on the line, + * and with a left brace as the first token on the following line + * (ignoring possible intervening comments), except that a line + * consisting of only + * identifier1(identifier2) + * will not be considered a function definition unless identifier2 is + * the word "void". ansi2knr will recognize a multi-line header provided + * that no intervening line ends with a left or right brace or a semicolon. + * These algorithms ignore whitespace and comments, except that + * the function name must be the first thing on the line. + * The following constructs will confuse it: + * - Any other construct that starts at the left margin and + * follows the above syntax (such as a macro or function call). + * - Some macros that tinker with the syntax of the function header. + */ + + /* + * The original and principal author of ansi2knr is L. Peter Deutsch + * . Other authors are noted in the change history + * that follows (in reverse chronological order): + lpd 1998-11-09 added further hack to recognize identifier(void) + as being a procedure + lpd 1998-10-23 added hack to recognize lines consisting of + identifier1(identifier2) as *not* being procedures + lpd 1997-12-08 made input_file optional; only closes input and/or + output file if not stdin or stdout respectively; prints + usage message on stderr rather than stdout; adds + --filename switch (changes suggested by + ) + lpd 1996-01-21 added code to cope with not HAVE_CONFIG_H and with + compilers that don't understand void, as suggested by + Tom Lane + lpd 1996-01-15 changed to require that the first non-comment token + on the line following a function header be a left brace, + to reduce sensitivity to macros, as suggested by Tom Lane + + lpd 1995-06-22 removed #ifndefs whose sole purpose was to define + undefined preprocessor symbols as 0; changed all #ifdefs + for configuration symbols to #ifs + lpd 1995-04-05 changed copyright notice to make it clear that + including ansi2knr in a program does not bring the entire + program under the GPL + lpd 1994-12-18 added conditionals for systems where ctype macros + don't handle 8-bit characters properly, suggested by + Francois Pinard ; + removed --varargs switch (this is now the default) + lpd 1994-10-10 removed CONFIG_BROKETS conditional + lpd 1994-07-16 added some conditionals to help GNU `configure', + suggested by Francois Pinard ; + properly erase prototype args in function parameters, + contributed by Jim Avera ; + correct error in writeblanks (it shouldn't erase EOLs) + lpd 1989-xx-xx original version + */ + + /* Most of the conditionals here are to make ansi2knr work with */ + /* or without the GNU configure machinery. */ + + #if HAVE_CONFIG_H + # include + #endif + + #include + #include + + #if HAVE_CONFIG_H + + /* + For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h). + This will define HAVE_CONFIG_H and so, activate the following lines. + */ + + # if STDC_HEADERS || HAVE_STRING_H + # include + # else + # include + # endif + + #else /* not HAVE_CONFIG_H */ + + /* Otherwise do it the hard way */ + + # ifdef BSD + # include + # else + # ifdef VMS + extern int strlen(), strncmp(); + # else + # include + # endif + # endif + + #endif /* not HAVE_CONFIG_H */ + + #if STDC_HEADERS + # include + #else + /* + malloc and free should be declared in stdlib.h, + but if you've got a K&R compiler, they probably aren't. + */ + # ifdef MSDOS + # include + # else + # ifdef VMS + extern char *malloc(); + extern void free(); + # else + extern char *malloc(); + extern int free(); + # endif + # endif + + #endif + + /* + * The ctype macros don't always handle 8-bit characters correctly. + * Compensate for this here. + */ + #ifdef isascii + # undef HAVE_ISASCII /* just in case */ + # define HAVE_ISASCII 1 + #else + #endif + #if STDC_HEADERS || !HAVE_ISASCII + # define is_ascii(c) 1 + #else + # define is_ascii(c) isascii(c) + #endif + + #define is_space(c) (is_ascii(c) && isspace(c)) + #define is_alpha(c) (is_ascii(c) && isalpha(c)) + #define is_alnum(c) (is_ascii(c) && isalnum(c)) + + /* Scanning macros */ + #define isidchar(ch) (is_alnum(ch) || (ch) == '_') + #define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_') + + /* Forward references */ + char *skipspace(); + int writeblanks(); + int test1(); + int convert1(); + + /* The main program */ + int + main(argc, argv) + int argc; + char *argv[]; + { FILE *in = stdin; + FILE *out = stdout; + char *filename = 0; + #define bufsize 5000 /* arbitrary size */ + char *buf; + char *line; + char *more; + char *usage = + "Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]\n"; + /* + * In previous versions, ansi2knr recognized a --varargs switch. + * If this switch was supplied, ansi2knr would attempt to convert + * a ... argument to va_alist and va_dcl; if this switch was not + * supplied, ansi2knr would simply drop any such arguments. + * Now, ansi2knr always does this conversion, and we only + * check for this switch for backward compatibility. + */ + int convert_varargs = 1; + + while ( argc > 1 && argv[1][0] == '-' ) { + if ( !strcmp(argv[1], "--varargs") ) { + convert_varargs = 1; + argc--; + argv++; + continue; + } + if ( !strcmp(argv[1], "--filename") && argc > 2 ) { + filename = argv[2]; + argc -= 2; + argv += 2; + continue; + } + fprintf(stderr, "Unrecognized switch: %s\n", argv[1]); + fprintf(stderr, usage); + exit(1); + } + switch ( argc ) + { + default: + fprintf(stderr, usage); + exit(0); + case 3: + out = fopen(argv[2], "w"); + if ( out == NULL ) { + fprintf(stderr, "Cannot open output file %s\n", argv[2]); + exit(1); + } + /* falls through */ + case 2: + in = fopen(argv[1], "r"); + if ( in == NULL ) { + fprintf(stderr, "Cannot open input file %s\n", argv[1]); + exit(1); + } + if ( filename == 0 ) + filename = argv[1]; + /* falls through */ + case 1: + break; + } + if ( filename ) + fprintf(out, "#line 1 \"%s\"\n", filename); + buf = malloc(bufsize); + line = buf; + while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL ) + { + test: line += strlen(line); + switch ( test1(buf) ) + { + case 2: /* a function header */ + convert1(buf, out, 1, convert_varargs); + break; + case 1: /* a function */ + /* Check for a { at the start of the next line. */ + more = ++line; + f: if ( line >= buf + (bufsize - 1) ) /* overflow check */ + goto wl; + if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL ) + goto wl; + switch ( *skipspace(more, 1) ) + { + case '{': + /* Definitely a function header. */ + convert1(buf, out, 0, convert_varargs); + fputs(more, out); + break; + case 0: + /* The next line was blank or a comment: */ + /* keep scanning for a non-comment. */ + line += strlen(line); + goto f; + default: + /* buf isn't a function header, but */ + /* more might be. */ + fputs(buf, out); + strcpy(buf, more); + line = buf; + goto test; + } + break; + case -1: /* maybe the start of a function */ + if ( line != buf + (bufsize - 1) ) /* overflow check */ + continue; + /* falls through */ + default: /* not a function */ + wl: fputs(buf, out); + break; + } + line = buf; + } + if ( line != buf ) + fputs(buf, out); + free(buf); + if ( out != stdout ) + fclose(out); + if ( in != stdin ) + fclose(in); + return 0; + } + + /* Skip over space and comments, in either direction. */ + char * + skipspace(p, dir) + register char *p; + register int dir; /* 1 for forward, -1 for backward */ + { for ( ; ; ) + { while ( is_space(*p) ) + p += dir; + if ( !(*p == '/' && p[dir] == '*') ) + break; + p += dir; p += dir; + while ( !(*p == '*' && p[dir] == '/') ) + { if ( *p == 0 ) + return p; /* multi-line comment?? */ + p += dir; + } + p += dir; p += dir; + } + return p; + } + + /* + * Write blanks over part of a string. + * Don't overwrite end-of-line characters. + */ + int + writeblanks(start, end) + char *start; + char *end; + { char *p; + for ( p = start; p < end; p++ ) + if ( *p != '\r' && *p != '\n' ) + *p = ' '; + return 0; + } + + /* + * Test whether the string in buf is a function definition. + * The string may contain and/or end with a newline. + * Return as follows: + * 0 - definitely not a function definition; + * 1 - definitely a function definition; + * 2 - definitely a function prototype (NOT USED); + * -1 - may be the beginning of a function definition, + * append another line and look again. + * The reason we don't attempt to convert function prototypes is that + * Ghostscript's declaration-generating macros look too much like + * prototypes, and confuse the algorithms. + */ + int + test1(buf) + char *buf; + { register char *p = buf; + char *bend; + char *endfn; + int contin; + + if ( !isidfirstchar(*p) ) + return 0; /* no name at left margin */ + bend = skipspace(buf + strlen(buf) - 1, -1); + switch ( *bend ) + { + case ';': contin = 0 /*2*/; break; + case ')': contin = 1; break; + case '{': return 0; /* not a function */ + case '}': return 0; /* not a function */ + default: contin = -1; + } + while ( isidchar(*p) ) + p++; + endfn = p; + p = skipspace(p, 1); + if ( *p++ != '(' ) + return 0; /* not a function */ + p = skipspace(p, 1); + if ( *p == ')' ) + return 0; /* no parameters */ + /* Check that the apparent function name isn't a keyword. */ + /* We only need to check for keywords that could be followed */ + /* by a left parenthesis (which, unfortunately, is most of them). */ + { static char *words[] = + { "asm", "auto", "case", "char", "const", "double", + "extern", "float", "for", "if", "int", "long", + "register", "return", "short", "signed", "sizeof", + "static", "switch", "typedef", "unsigned", + "void", "volatile", "while", 0 + }; + char **key = words; + char *kp; + int len = endfn - buf; + + while ( (kp = *key) != 0 ) + { if ( strlen(kp) == len && !strncmp(kp, buf, len) ) + return 0; /* name is a keyword */ + key++; + } + } + { + char *id = p; + int len; + /* + * Check for identifier1(identifier2) and not + * identifier1(void). + */ + + while ( isidchar(*p) ) + p++; + len = p - id; + p = skipspace(p, 1); + if ( *p == ')' && (len != 4 || strncmp(id, "void", 4)) ) + return 0; /* not a function */ + } + /* + * If the last significant character was a ), we need to count + * parentheses, because it might be part of a formal parameter + * that is a procedure. + */ + if (contin > 0) { + int level = 0; + + for (p = skipspace(buf, 1); *p; p = skipspace(p + 1, 1)) + level += (*p == '(' ? 1 : *p == ')' ? -1 : 0); + if (level > 0) + contin = -1; + } + return contin; + } + + /* Convert a recognized function definition or header to K&R syntax. */ + int + convert1(buf, out, header, convert_varargs) + char *buf; + FILE *out; + int header; /* Boolean */ + int convert_varargs; /* Boolean */ + { char *endfn; + register char *p; + /* + * The breaks table contains pointers to the beginning and end + * of each argument. + */ + char **breaks; + unsigned num_breaks = 2; /* for testing */ + char **btop; + char **bp; + char **ap; + char *vararg = 0; + + /* Pre-ANSI implementations don't agree on whether strchr */ + /* is called strchr or index, so we open-code it here. */ + for ( endfn = buf; *(endfn++) != '('; ) + ; + top: p = endfn; + breaks = (char **)malloc(sizeof(char *) * num_breaks * 2); + if ( breaks == 0 ) + { /* Couldn't allocate break table, give up */ + fprintf(stderr, "Unable to allocate break table!\n"); + fputs(buf, out); + return -1; + } + btop = breaks + num_breaks * 2 - 2; + bp = breaks; + /* Parse the argument list */ + do + { int level = 0; + char *lp = NULL; + char *rp; + char *end = NULL; + + if ( bp >= btop ) + { /* Filled up break table. */ + /* Allocate a bigger one and start over. */ + free((char *)breaks); + num_breaks <<= 1; + goto top; + } + *bp++ = p; + /* Find the end of the argument */ + for ( ; end == NULL; p++ ) + { switch(*p) + { + case ',': + if ( !level ) end = p; + break; + case '(': + if ( !level ) lp = p; + level++; + break; + case ')': + if ( --level < 0 ) end = p; + else rp = p; + break; + case '/': + p = skipspace(p, 1) - 1; + break; + default: + ; + } + } + /* Erase any embedded prototype parameters. */ + if ( lp ) + writeblanks(lp + 1, rp); + p--; /* back up over terminator */ + /* Find the name being declared. */ + /* This is complicated because of procedure and */ + /* array modifiers. */ + for ( ; ; ) + { p = skipspace(p - 1, -1); + switch ( *p ) + { + case ']': /* skip array dimension(s) */ + case ')': /* skip procedure args OR name */ + { int level = 1; + while ( level ) + switch ( *--p ) + { + case ']': case ')': level++; break; + case '[': case '(': level--; break; + case '/': p = skipspace(p, -1) + 1; break; + default: ; + } + } + if ( *p == '(' && *skipspace(p + 1, 1) == '*' ) + { /* We found the name being declared */ + while ( !isidfirstchar(*p) ) + p = skipspace(p, 1) + 1; + goto found; + } + break; + default: + goto found; + } + } + found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' ) + { if ( convert_varargs ) + { *bp++ = "va_alist"; + vararg = p-2; + } + else + { p++; + if ( bp == breaks + 1 ) /* sole argument */ + writeblanks(breaks[0], p); + else + writeblanks(bp[-1] - 1, p); + bp--; + } + } + else + { while ( isidchar(*p) ) p--; + *bp++ = p+1; + } + p = end; + } + while ( *p++ == ',' ); + *bp = p; + /* Make a special check for 'void' arglist */ + if ( bp == breaks+2 ) + { p = skipspace(breaks[0], 1); + if ( !strncmp(p, "void", 4) ) + { p = skipspace(p+4, 1); + if ( p == breaks[2] - 1 ) + { bp = breaks; /* yup, pretend arglist is empty */ + writeblanks(breaks[0], p + 1); + } + } + } + /* Put out the function name and left parenthesis. */ + p = buf; + while ( p != endfn ) putc(*p, out), p++; + /* Put out the declaration. */ + if ( header ) + { fputs(");", out); + for ( p = breaks[0]; *p; p++ ) + if ( *p == '\r' || *p == '\n' ) + putc(*p, out); + } + else + { for ( ap = breaks+1; ap < bp; ap += 2 ) + { p = *ap; + while ( isidchar(*p) ) + putc(*p, out), p++; + if ( ap < bp - 1 ) + fputs(", ", out); + } + fputs(") ", out); + /* Put out the argument declarations */ + for ( ap = breaks+2; ap <= bp; ap += 2 ) + (*ap)[-1] = ';'; + if ( vararg != 0 ) + { *vararg = 0; + fputs(breaks[0], out); /* any prior args */ + fputs("va_dcl", out); /* the final arg */ + fputs(bp[0], out); + } + else + fputs(breaks[0], out); + } + free((char *)breaks); + return 0; + } diff -ruN asn_useful.c asn_useful.c *** asn_useful.c Thu Apr 1 19:57:27 1999 --- asn_useful.c Fri Sep 24 17:03:52 1999 *************** *** 131,139 **** --- 131,141 ---- { "md2WithRSAEncryption", ASN_ID_MD2WITHRSAENC }, { "md4WithRSAEncryption", ASN_ID_MD4WITHRSAENC }, { "md5WithRSAEncryption", ASN_ID_MD5WITHRSAENC }, + { "sha1WithRSAEncryption", ASN_ID_SHA1WITHRSAENC }, { "md2", ASN_ID_MD2 }, { "md4", ASN_ID_MD4 }, { "md5", ASN_ID_MD5 }, + { "sha1", ASN_ID_SHA1 }, { "emailAddress", ASN_ID_EMAILADDRESS }, { "id-ce", ASN_ID_CE }, { "subjectAltName", ASN_ID_SUBJECT_ALT_NAME }, diff -ruN asn_useful.h asn_useful.h *** asn_useful.h Fri Aug 21 09:47:57 1998 --- asn_useful.h Fri Sep 24 17:03:06 1999 *************** *** 82,91 **** --- 82,93 ---- #define ASN_ID_MD2 "1 2 840 113549 2 2" #define ASN_ID_MD4 "1 2 840 113549 2 4" #define ASN_ID_MD5 "1 2 840 113549 2 5" + #define ASN_ID_SHA1 "1 3 14 3 2 26" #define ASN_ID_RSAENCRYPTION ASN_ID_PKCS" 1" #define ASN_ID_MD2WITHRSAENC ASN_ID_PKCS" 2" #define ASN_ID_MD4WITHRSAENC ASN_ID_PKCS" 3" #define ASN_ID_MD5WITHRSAENC ASN_ID_PKCS" 4" + #define ASN_ID_SHA1WITHRSAENC ASN_ID_PKCS" 5" #define ASN_ID_EMAILADDRESS "1 2 840 113549 1 9 1" diff -ruN conf.c conf.c *** conf.c Tue Aug 31 07:50:08 1999 --- conf.c Wed Sep 22 15:41:41 1999 *************** *** 93,121 **** /* * Insert a tag-value combination from LINE (the equal sign is at POS) * into SECTION of our configuration database. - * XXX Should really be a hash table implementation. */ static void conf_set (char *section, char *line, int pos) { - struct conf_binding *node; int i; node = malloc (sizeof *node); if (!node) log_fatal ("conf_set: out of memory"); node->section = section; ! node->tag = line; ! for (i = 0; line[i] && i < pos; i++) ! ; ! line[i] = '\0'; ! if (conf_get_str (section, line)) { log_print ("conf_set: duplicate tag [%s]:%s, ignoring...\n", section, ! line); return; } ! node->value = line + pos + 1 + strspn (line + pos + 1, " \t"); LIST_INSERT_HEAD (&conf_bindings, node, link); log_debug (LOG_MISC, 70, "(%s,%s)->%s", node->section, node->tag, node->value); --- 93,131 ---- /* * Insert a tag-value combination from LINE (the equal sign is at POS) * into SECTION of our configuration database. */ static void conf_set (char *section, char *line, int pos) { int i; + for (i = 0; line[i] && i < pos; i++) + ; + line[i] = '\0'; + conf_set_str (section, line, line + pos + 1 + strspn (line + pos + 1, " \t")); + } + + /* + * Insert a tag-value combination from TAG and VALUE + * into SECTION of our configuration database. + * XXX Should really be a hash table implementation. + */ + void + conf_set_str (char *section, char *tag, char *value) + { + struct conf_binding *node; node = malloc (sizeof *node); if (!node) log_fatal ("conf_set: out of memory"); node->section = section; ! node->tag = tag; ! if (conf_get_str (section, tag)) { log_print ("conf_set: duplicate tag [%s]:%s, ignoring...\n", section, ! tag); return; } ! node->value = value; LIST_INSERT_HEAD (&conf_bindings, node, link); log_debug (LOG_MISC, 70, "(%s,%s)->%s", node->section, node->tag, node->value); diff -ruN conf.h conf.h *** conf.h Tue Aug 31 07:50:08 1999 --- conf.h Wed Sep 22 15:41:04 1999 *************** *** 40,46 **** #include #include ! #define CONFIG_FILE "/etc/isakmpd.conf" struct conf_list_node { TAILQ_ENTRY (conf_list_node) link; --- 40,46 ---- #include #include ! #define CONFIG_FILE SYSCONFDIR "/isakmpd.conf" struct conf_list_node { TAILQ_ENTRY (conf_list_node) link; *************** *** 61,66 **** --- 61,67 ---- extern struct conf_list *conf_get_tag_list (char *); extern int conf_get_num (char *, char *, int); extern char *conf_get_str (char *, char *); + extern void conf_set_str (char *, char *, char *); extern void conf_init (void); extern int conf_match_num (char *, char *, int); diff -ruN config.guess config.guess *** config.guess Wed Dec 31 19:00:00 1969 --- config.guess Fri Feb 12 23:07:50 1999 *************** *** 0 **** --- 1,973 ---- + #! /bin/sh + # Attempt to guess a canonical system name. + # Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. + # + # This file 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 of the License, 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 to the GNU General Public License, if you + # distribute this file as part of a program that contains a + # configuration script generated by Autoconf, you may include it under + # the same distribution terms that you use for the rest of that program. + + # Written by Per Bothner . + # The master version of this file is at the FSF in /home/gd/gnu/lib. + # + # This script attempts to guess a canonical system name similar to + # config.sub. If it succeeds, it prints the system name on stdout, and + # exits with 0. Otherwise, it exits with 1. + # + # The plan is that this can be called by configure scripts if you + # don't specify an explicit system type (host/target name). + # + # Only a few systems have been added to this list; please add others + # (but try to keep the structure clean). + # + + # This is needed to find uname on a Pyramid OSx when run in the BSD universe. + # (ghazi@noc.rutgers.edu 8/24/94.) + if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH + fi + + UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown + UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown + UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown + UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + + dummy=dummy-$$ + trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 + + # Note: order is significant - the case branches are not exclusive. + + case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + cat <$dummy.s + .globl main + .ent main + main: + .frame \$30,0,\$26,0 + .prologue 0 + .long 0x47e03d80 # implver $0 + lda \$2,259 + .long 0x47e20c21 # amask $2,$1 + srl \$1,8,\$2 + sll \$2,2,\$2 + sll \$0,3,\$0 + addl \$1,\$0,\$0 + addl \$2,\$0,\$0 + ret \$31,(\$26),1 + .end main + EOF + ${CC-cc} $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + esac + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]` + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-cbm-sysv4 + exit 0;; + amiga:NetBSD:*:*) + echo m68k-cbm-netbsd${UNAME_RELEASE} + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + arc64:OpenBSD:*:*) + echo mips64el-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hkmips:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + arm32:NetBSD:*:*) + echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + SR2?01:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + atari*:NetBSD:*:*) + echo m68k-atari-netbsd${UNAME_RELEASE} + exit 0 ;; + atari*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3*:NetBSD:*:*) + echo m68k-sun-netbsd${UNAME_RELEASE} + exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:NetBSD:*:*) + echo m68k-apple-netbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + macppc:NetBSD:*:*) + echo powerpc-apple-netbsd${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + sed 's/^ //' << EOF >$dummy.c + int main (argc, argv) int argc; char **argv; { + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } + EOF + ${CC-cc} $dummy.c -o $dummy \ + && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ + -o ${TARGET_BINARY_INTERFACE}x = x ] ; then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i?86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } + EOF + ${CC-cc} $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:4) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=4.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 ) + sed 's/^ //' << EOF >$dummy.c + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } + EOF + (${CC-cc} $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + rm -f $dummy.c $dummy + esac + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } + EOF + ${CC-cc} $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i?86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} + exit 0 ;; + CRAY*T3E:*:*:*) + echo t3e-cray-unicosmk${UNAME_RELEASE} + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F300:UNIX_System_V:*:*) + FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + F301:UNIX_System_V:*:*) + echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` + exit 0 ;; + hp3[0-9][05]:NetBSD:*:*) + echo m68k-hp-netbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + i?86:BSD/386:*:* | i?86:BSD/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:NetBSD:*:*) + echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + *:Linux:*:*) + # uname on the ARM produces all sorts of strangeness, and we need to + # filter it out. + case "$UNAME_MACHINE" in + arm* | sa110*) UNAME_MACHINE="arm" ;; + esac + + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. + ld_help_string=`ld --help 2>&1` + ld_supported_emulations=`echo $ld_help_string \ + | sed -ne '/supported emulations:/!d + s/[ ][ ]*/ /g + s/.*supported emulations: *// + s/ .*// + p'` + case "$ld_supported_emulations" in + i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; + i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; + sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;; + esac + + if test "${UNAME_MACHINE}" = "alpha" ; then + sed 's/^ //' <$dummy.s + .globl main + .ent main + main: + .frame \$30,0,\$26,0 + .prologue 0 + .long 0x47e03d80 # implver $0 + lda \$2,259 + .long 0x47e20c21 # amask $2,$1 + srl \$1,8,\$2 + sll \$2,2,\$2 + sll \$0,3,\$0 + addl \$1,\$0,\$0 + addl \$2,\$0,\$0 + ret \$31,(\$26),1 + .end main + EOF + LIBC="" + ${CC-cc} $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + esac + + objdump --private-headers $dummy | \ + grep ld.so.1 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 + elif test "${UNAME_MACHINE}" = "mips" ; then + cat >$dummy.c </dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + else + # Either a pre-BFD a.out linker (linux-gnuoldld) + # or one that does not give us useful --help. + # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. + # If ld does not provide *any* "supported emulations:" + # that means it is gnuoldld. + echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" + test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + + case "${UNAME_MACHINE}" in + i?86) + VENDOR=pc; + ;; + *) + VENDOR=unknown; + ;; + esac + # Determine whether the default compiler is a.out or elf + cat >$dummy.c < + main(argc, argv) + int argc; + char *argv[]; + { + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); + # else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); + # endif + # else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); + # endif + #else + printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); + #endif + return 0; + } + EOF + ${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + fi ;; + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions + # are messed up and put the nodename in both sysname and nodename. + i?86:DYNIX/ptx:4*:*) + echo i386-sequent-sysv4 + exit 0 ;; + i?86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} + fi + exit 0 ;; + i?86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i?86:UnixWare:*:*) + if /bin/uname -X 2>/dev/null >/dev/null ; then + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + fi + echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION} + exit 0 ;; + pc:*:*:*) + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i?86:LynxOS:2.*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:*:6*) + echo mips-sony-newsos6 + exit 0 ;; + R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + esac + + #echo '(No uname command or uname output not recognized.)' 1>&2 + #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + + cat >$dummy.c < + # include + #endif + main () + { + #if defined (sony) + #if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); + #else + #include + printf ("m68k-sony-newsos%s\n", + #ifdef NEWSOS4 + "4" + #else + "" + #endif + ); exit (0); + #endif + #endif + + #if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); + #endif + + #if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); + #endif + + #if defined (NeXT) + #if !defined (__ARCHITECTURE__) + #define __ARCHITECTURE__ "m68k" + #endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); + #endif + + #if defined (MULTIMAX) || defined (n16) + #if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); + #else + #if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); + #else + printf ("ns32k-encore-bsd\n"); exit (0); + #endif + #endif + #endif + + #if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); + #endif + + #if defined (sequent) + #if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); + #endif + #if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); + #endif + #endif + + #if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + + #endif + + #if defined (vax) + #if !defined (ultrix) + printf ("vax-dec-bsd\n"); exit (0); + #else + printf ("vax-dec-ultrix\n"); exit (0); + #endif + #endif + + #if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); + #endif + + exit (1); + } + EOF + + ${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + + # Apollos put the system type in the environment. + + test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + + # Convex versions that predate uname can use getsysinfo(1) + + if [ -x /usr/convex/getsysinfo ] + then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac + fi + + #echo '(Unable to guess system type)' 1>&2 + + exit 1 diff -ruN config.h.in config.h.in *** config.h.in Wed Dec 31 19:00:00 1969 --- config.h.in Wed Dec 15 09:56:53 1999 *************** *** 0 **** --- 1,61 ---- + /* config.h.in. Generated automatically from configure.in by autoheader. */ + + /* Define to empty if the keyword does not work. */ + #undef const + + /* Define as __inline if that's what the C compiler calls it. */ + #undef inline + + /* Define if you have the ANSI C header files. */ + #undef STDC_HEADERS + + /* Define if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX). */ + #undef WORDS_BIGENDIAN + + /* Define to empty if the keyword does not work. */ + #undef const + + /* Define to enable support for initiating arbitrary SAs. */ + #undef ENABLE_ANY_ON_DEMAND + + /* Define to enable support for asymmetric links. */ + #undef ENABLE_SYMMETRIC_LINKS + + /* Define if your struct sockaddr has sa_len. */ + #undef HAVE_SOCKADDR_SA_LEN + + /* Define as __inline if that's what the C compiler calls it. */ + #undef inline + + /* Define if you have the ANSI C header files. */ + #undef STDC_HEADERS + + /* Define if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX). */ + #undef WORDS_BIGENDIAN + + /* Define if you have the header file. */ + #undef HAVE_MEMORY_H + + /* Define if you have the header file. */ + #undef HAVE_STDIO_H + + /* Define if you have the header file. */ + #undef HAVE_STRING_H + + /* Define if you have the header file. */ + #undef HAVE_UNISTD_H + + /* Define if you have the efence library (-lefence). */ + #undef HAVE_LIBEFENCE + + /* Name of package */ + #undef PACKAGE + + /* Version number of package */ + #undef VERSION + + /* Define if compiler has function prototypes */ + #undef PROTOTYPES + diff -ruN config.sub config.sub *** config.sub Wed Dec 31 19:00:00 1969 --- config.sub Fri Feb 12 23:07:50 1999 *************** *** 0 **** --- 1,956 ---- + #! /bin/sh + # Configuration validation subroutine script, version 1.1. + # Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc. + # This file is (in principle) common to ALL GNU software. + # The presence of a machine in this file suggests that SOME GNU software + # can handle that machine. It does not imply ALL GNU software can. + # + # This file 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 of the License, 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 to the GNU General Public License, if you + # distribute this file as part of a program that contains a + # configuration script generated by Autoconf, you may include it under + # the same distribution terms that you use for the rest of that program. + + # Configuration subroutine to validate and canonicalize a configuration type. + # Supply the specified configuration type as an argument. + # If it is invalid, we print an error message on stderr and exit with code 1. + # Otherwise, we print the canonical config type on stdout and succeed. + + # This file is supposed to be the same for all GNU packages + # and recognize all the CPU types, system types and aliases + # that are meaningful with *any* GNU software. + # Each package is responsible for reporting which valid configurations + # it does not support. The user should be able to distinguish + # a failure to support a valid configuration from a meaningless + # configuration. + + # The goal of this file is to map all the various variations of a given + # machine specification into a single specification in the form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM + # or in some cases, the newer four-part form: + # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM + # It is wrong to echo any other type of specification. + + if [ x$1 = x ] + then + echo Configuration name missing. 1>&2 + echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 + echo "or $0 ALIAS" 1>&2 + echo where ALIAS is a recognized configuration type. 1>&2 + exit 1 + fi + + # First pass through any local machine types. + case $1 in + *local*) + echo $1 + exit 0 + ;; + *) + ;; + esac + + # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). + # Here we must recognize all the valid KERNEL-OS combinations. + maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + case $maybe_os in + linux-gnu*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; + esac + + ### Let's recognize common machines as not being operating systems so + ### that things like config.sub decstation-3100 work. We also + ### recognize some manufacturers as not being operating systems, so we + ### can provide default operating systems below. + case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple) + os= + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + esac + + # Decode aliases for certain CPU-COMPANY combinations. + case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ + | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ + | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \ + | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \ + | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \ + | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ + | mipstx39 | mipstx39el \ + | sparc | sparclet | sparclite | sparc64 | v850) + basic_machine=$basic_machine-unknown + ;; + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i[34567]86) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ + | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ + | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ + | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ + | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \ + | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \ + | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \ + | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ + | sparc64-* | mips64-* | mipsel-* \ + | mips64el-* | mips64orion-* | mips64orionel-* \ + | mipstx39-* | mipstx39el-* \ + | f301-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-cbm + ;; + amigaos | amigados) + basic_machine=m68k-cbm + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-cbm + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | ymp) + basic_machine=ymp-cray + os=-unicos + ;; + cray2) + basic_machine=cray2-cray + os=-unicos + ;; + [ctj]90-cray) + basic_machine=c90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + os=-mvs + ;; + # I'm not sure what "Sysv32" means. Should this be sysv3.2? + i[34567]86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i[34567]86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i[34567]86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i[34567]86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + miniframe) + basic_machine=m68000-convergent + ;; + mipsel*-linux*) + basic_machine=mipsel-unknown + os=-linux-gnu + ;; + mips*-linux*) + basic_machine=mips-unknown + os=-linux-gnu + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + np1) + basic_machine=np1-gould + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | nexen) + basic_machine=i586-pc + ;; + pentiumpro | p6 | k6 | 6x86) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | nexen-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | k6-* | 6x86-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=rs6000-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + xmp) + basic_machine=xmp-cray + os=-unicos + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + none) + basic_machine=none-none + os=-none + ;; + + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + mips) + if [ x$os = x-linux-gnu ]; then + basic_machine=mips-unknown + else + basic_machine=mips-mips + fi + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sparc) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + esac + + # Here we canonicalize certain aliases for manufacturers. + case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; + esac + + # Decode manufacturer-specific aliases for certain operating systems. + + if [ x"$os" != x"" ] + then + case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -rhapsody* \ + | -openstep*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -ctix* | -uts*) + os=-sysv + ;; + -ns2 ) + os=-nextstep2 + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -xenix) + os=-xenix + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; + esac + else + + # Here we handle the default operating systems that come with various machines. + # The value should be what the vendor currently ships out the door with their + # machine or put another way, the most popular os provided with the machine. + + # Note that if you're going to try to match "-MANUFACTURER" here (say, + # "-sun"), then you have to tell the case statement up towards the top + # that MANUFACTURER isn't an operating system. Otherwise, code above + # will signal an error saying that MANUFACTURER isn't an operating + # system, and we'll never get to this point. + + case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-semi) + os=-aout + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f301-fujitsu) + os=-uxpv + ;; + *) + os=-none + ;; + esac + fi + + # Here we handle the case where we know the os, and the CPU type, but not the + # manufacturer. We pick the logical manufacturer. + vendor=unknown + case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -hpux*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; + esac + + echo $basic_machine$os diff -ruN configure configure *** configure Wed Dec 31 19:00:00 1969 --- configure Mon Dec 20 11:46:56 1999 *************** *** 0 **** --- 1,2838 ---- + #! /bin/sh + + # Guess values for system-dependent variables and create Makefiles. + # Generated automatically using autoconf version 2.13 + # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. + # + # This configure script is free software; the Free Software Foundation + # gives unlimited permission to copy, distribute and modify it. + + # Defaults: + ac_help= + ac_default_prefix=/usr/local + # Any additions from configure.in: + ac_help="$ac_help + --enable-asymmetric-links enable support for asymmetric links (default=don't)" + ac_help="$ac_help + --enable-any-on-demand enable support for initating arbitrary SAs on-demand (default=don't)" + ac_help="$ac_help + --with-efence[=DIR] link programs with Electric Fence, found in optional DIR (default=don't)" + ac_help="$ac_help + --with-boehm-gc[=DIR] link programs with Boehm's GC library, found in optional DIR (default=don't)" + ac_help="$ac_help + --with-boehm-leak[=DIR] link programs with Boehm's leak library, found in optional DIR (default=don't)" + ac_help="$ac_help + --disable-debug don't compile debuggable libraries and programs (default=do)" + ac_help="$ac_help + --disable-warnings don't compile with warnings turned on (default=do)" + ac_help="$ac_help + --enable-profiled compile profilable libraries and programs (default=don't)" + + # Initialize some variables set by options. + # The variables have the same names as the options, with + # dashes changed to underlines. + build=NONE + cache_file=./config.cache + exec_prefix=NONE + host=NONE + no_create= + nonopt=NONE + no_recursion= + prefix=NONE + program_prefix=NONE + program_suffix=NONE + program_transform_name=s,x,x, + silent= + site= + srcdir= + target=NONE + verbose= + x_includes=NONE + x_libraries=NONE + bindir='${exec_prefix}/bin' + sbindir='${exec_prefix}/sbin' + libexecdir='${exec_prefix}/libexec' + datadir='${prefix}/share' + sysconfdir='${prefix}/etc' + sharedstatedir='${prefix}/com' + localstatedir='${prefix}/var' + libdir='${exec_prefix}/lib' + includedir='${prefix}/include' + oldincludedir='/usr/include' + infodir='${prefix}/info' + mandir='${prefix}/man' + + # Initialize some other variables. + subdirs= + MFLAGS= MAKEFLAGS= + SHELL=${CONFIG_SHELL-/bin/sh} + # Maximum number of lines to put in a shell here document. + ac_max_here_lines=12 + + ac_prev= + for ac_option + do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF + Usage: configure [options] [host] + Options: [defaults in brackets after descriptions] + Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure + Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names + EOF + cat << EOF + Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] + Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR + EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac + done + + if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } + fi + + trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + + # File descriptor usage: + # 0 standard input + # 1 file creation + # 2 errors and warnings + # 3 some systems may open it to /dev/tty + # 4 used on the Kubota Titan + # 6 checking for... messages and results + # 5 compiler messages saved in config.log + if test "$silent" = yes; then + exec 6>/dev/null + else + exec 6>&1 + fi + exec 5>./config.log + + echo "\ + This file contains any messages produced by compilers while + running configure, to aid debugging if configure makes a mistake. + " 1>&5 + + # Strip out --no-create and --no-recursion so they do not pile up. + # Also quote any args containing shell metacharacters. + ac_configure_args= + for ac_arg + do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac + done + + # NLS nuisances. + # Only set these to C if already set. These must not be set unconditionally + # because not all systems understand e.g. LANG=C (notably SCO). + # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! + # Non-C LC_CTYPE values break the ctype check. + if test "${LANG+set}" = set; then LANG=C; export LANG; fi + if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi + if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi + if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + + # confdefs.h avoids OS command line length limits that DEFS can exceed. + rm -rf conftest* confdefs.h + # AIX cpp loses on an empty file, so make sure it contains at least a newline. + echo > confdefs.h + + # A filename unique to this package, relative to the directory that + # configure is in, which we can look for to find out if srcdir is correct. + ac_unique_file=ike_phase_1.c + + # Find the source files, if location was not specified. + if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi + else + ac_srcdir_defaulted=no + fi + if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi + fi + srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + + # Prefer explicitly selected file to automatically selected ones. + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi + for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi + done + + if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file + else + echo "creating cache $cache_file" + > $cache_file + fi + + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_cpp='$CPP $CPPFLAGS' + ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' + ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' + cross_compiling=$ac_cv_prog_cc_cross + + ac_exeext= + ac_objext=o + if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' + ' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi + else + ac_n= ac_c='\c' ac_t= + fi + + + ac_aux_dir= + for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi + done + if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } + fi + ac_config_guess=$ac_aux_dir/config.guess + ac_config_sub=$ac_aux_dir/config.sub + ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + + # Do some error checking and defaulting for the host and target type. + # The inputs are: + # configure --host=HOST --target=TARGET --build=BUILD NONOPT + # + # The rules are: + # 1. You are not allowed to specify --host, --target, and nonopt at the + # same time. + # 2. Host defaults to nonopt. + # 3. If nonopt is not specified, then host defaults to the current host, + # as determined by config.guess. + # 4. Target and build default to nonopt. + # 5. If nonopt is not specified, then target and build default to host. + + # The aliases save the names the user supplied, while $host etc. + # will get canonicalized. + case $host---$target---$nonopt in + NONE---*---* | *---NONE---* | *---*---NONE) ;; + *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; + esac + + + # Make sure we can run config.sub. + if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : + else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } + fi + + echo $ac_n "checking host system type""... $ac_c" 1>&6 + echo "configure:588: checking host system type" >&5 + + host_alias=$host + case "$host_alias" in + NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; + esac + + host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` + host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + echo "$ac_t""$host" 1>&6 + + echo $ac_n "checking target system type""... $ac_c" 1>&6 + echo "configure:609: checking target system type" >&5 + + target_alias=$target + case "$target_alias" in + NONE) + case $nonopt in + NONE) target_alias=$host_alias ;; + *) target_alias=$nonopt ;; + esac ;; + esac + + target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` + target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + echo "$ac_t""$target" 1>&6 + + echo $ac_n "checking build system type""... $ac_c" 1>&6 + echo "configure:627: checking build system type" >&5 + + build_alias=$build + case "$build_alias" in + NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; + esac + + build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` + build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + echo "$ac_t""$build" 1>&6 + + test "$host_alias" != "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + + # Find a good install program. We prefer a C program (faster), + # so one script is as good as another. But avoid the broken or + # incompatible versions: + # SysV /etc/install, /usr/sbin/install + # SunOS /usr/etc/install + # IRIX /sbin/install + # AIX /bin/install + # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag + # AFS /usr/afsws/bin/install, which mishandles nonexistent args + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" + # ./install, which can be erroneously created by make from ./install.sh. + echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 + echo "configure:661: checking for a BSD compatible install" >&5 + if test -z "$INSTALL"; then + if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + + fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi + fi + echo "$ac_t""$INSTALL" 1>&6 + + # Use test -z because SunOS4 sh mishandles braces in ${var-val}. + # It thinks the first close brace ends the variable substitution. + test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + + test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 + echo "configure:714: checking whether build environment is sane" >&5 + # Just in case + sleep 1 + echo timestamp > conftestfile + # Do `set' in a subshell so we don't clobber the current shell's + # arguments. Must try -L first in case configure is actually a + # symlink; some systems play weird games with the mod time of symlinks + # (eg FreeBSD returns the mod time of the symlink's containing + # directory). + if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken + alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) + then + # Ok. + : + else + { echo "configure: error: newly created file is older than distributed files! + Check your system clock" 1>&2; exit 1; } + fi + rm -f conftest* + echo "$ac_t""yes" 1>&6 + if test "$program_transform_name" = s,x,x,; then + program_transform_name= + else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed + s,\\,\\\\,g; s,\$,$$,g + EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed + fi + test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" + # Use a double $ so make ignores it. + test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + + # sed with no file args requires a program. + test "$program_transform_name" = "" && program_transform_name="s,x,x," + + echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 + echo "configure:771: checking whether ${MAKE-make} sets \${MAKE}" >&5 + set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftestmake <<\EOF + all: + @echo 'ac_maketemp="${MAKE}"' + EOF + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` + if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes + else + eval ac_cv_prog_make_${ac_make}_set=no + fi + rm -f conftestmake + fi + if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= + else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" + fi + + + PACKAGE=isakmpd + + VERSION=1.0.1 + + if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } + fi + cat >> confdefs.h <> confdefs.h <&6 + echo "configure:817: checking for working aclocal" >&5 + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. + # Redirect stdin to placate older versions of autoconf. Sigh. + if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 + else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 + fi + + echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 + echo "configure:830: checking for working autoconf" >&5 + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. + # Redirect stdin to placate older versions of autoconf. Sigh. + if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 + else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 + fi + + echo $ac_n "checking for working automake""... $ac_c" 1>&6 + echo "configure:843: checking for working automake" >&5 + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. + # Redirect stdin to placate older versions of autoconf. Sigh. + if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 + else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 + fi + + echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 + echo "configure:856: checking for working autoheader" >&5 + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. + # Redirect stdin to placate older versions of autoconf. Sigh. + if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 + else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 + fi + + echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 + echo "configure:869: checking for working makeinfo" >&5 + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. + # Redirect stdin to placate older versions of autoconf. Sigh. + if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 + else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 + fi + + + + + + + + # Extract the first word of "gcc", so it can be a program name with args. + set dummy gcc; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:890: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" + fi + fi + CC="$ac_cv_prog_CC" + if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + + if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. + set dummy cc; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:920: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" + if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi + fi + fi + fi + CC="$ac_cv_prog_CC" + if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. + set dummy cl; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:971: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" + fi + fi + CC="$ac_cv_prog_CC" + if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } + fi + + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 + echo "configure:1003: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_cpp='$CPP $CPPFLAGS' + ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' + ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' + cross_compiling=$ac_cv_prog_cc_cross + + cat > conftest.$ac_ext << EOF + + #line 1014 "configure" + #include "confdefs.h" + + main(){return(0);} + EOF + if { (eval echo configure:1019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no + fi + rm -fr conftest* + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_cpp='$CPP $CPPFLAGS' + ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' + ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' + cross_compiling=$ac_cv_prog_cc_cross + + echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 + if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } + fi + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 + echo "configure:1045: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 + echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 + cross_compiling=$ac_cv_prog_cc_cross + + echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 + echo "configure:1050: checking whether we are using GNU C" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes + else + ac_cv_prog_gcc=no + fi + fi + + echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + + if test $ac_cv_prog_gcc = yes; then + GCC=yes + else + GCC= + fi + + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 + echo "configure:1078: checking whether ${CC-cc} accepts -g" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + echo 'void f(){}' > conftest.c + if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes + else + ac_cv_prog_cc_g=no + fi + rm -f conftest* + + fi + + echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi + else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi + fi + + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 + echo "configure:1110: checking how to run the C preprocessor" >&5 + # On Suns, sometimes $CPP names a directory. + if test -n "$CPP" && test -d "$CPP"; then + CPP= + fi + if test -z "$CPP"; then + if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:1131: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:1148: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:1165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp + fi + rm -f conftest* + fi + rm -f conftest* + fi + rm -f conftest* + ac_cv_prog_CPP="$CPP" + fi + CPP="$ac_cv_prog_CPP" + else + ac_cv_prog_CPP="$CPP" + fi + echo "$ac_t""$CPP" 1>&6 + + # Extract the first word of "ranlib", so it can be a program name with args. + set dummy ranlib; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:1192: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. + else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" + fi + fi + RANLIB="$ac_cv_prog_RANLIB" + if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + + # Find a good install program. We prefer a C program (faster), + # so one script is as good as another. But avoid the broken or + # incompatible versions: + # SysV /etc/install, /usr/sbin/install + # SunOS /usr/etc/install + # IRIX /sbin/install + # AIX /bin/install + # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag + # AFS /usr/afsws/bin/install, which mishandles nonexistent args + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" + # ./install, which can be erroneously created by make from ./install.sh. + echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 + echo "configure:1231: checking for a BSD compatible install" >&5 + if test -z "$INSTALL"; then + if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + + fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi + fi + echo "$ac_t""$INSTALL" 1>&6 + + # Use test -z because SunOS4 sh mishandles braces in ${var-val}. + # It thinks the first close brace ends the variable substitution. + test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + + test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 + echo "configure:1284: checking whether ${MAKE-make} sets \${MAKE}" >&5 + set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftestmake <<\EOF + all: + @echo 'ac_maketemp="${MAKE}"' + EOF + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` + if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes + else + eval ac_cv_prog_make_${ac_make}_set=no + fi + rm -f conftestmake + fi + if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= + else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" + fi + + + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 + echo "configure:1312: checking for ANSI C header files" >&5 + if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include + #include + #include + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:1325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no + fi + rm -f conftest* + + if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat > conftest.$ac_ext < + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : + else + rm -rf conftest* + ac_cv_header_stdc=no + fi + rm -f conftest* + + fi + + if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat > conftest.$ac_ext < + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : + else + rm -rf conftest* + ac_cv_header_stdc=no + fi + rm -f conftest* + + fi + + if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : + else + cat > conftest.$ac_ext < + #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') + #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) + #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) + int main () { int i; for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); + exit (0); } + + EOF + if { (eval echo configure:1392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + : + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no + fi + rm -fr conftest* + fi + + fi + fi + + echo "$ac_t""$ac_cv_header_stdc" 1>&6 + if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF + #define STDC_HEADERS 1 + EOF + + fi + + for ac_hdr in unistd.h stdio.h memory.h + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 + echo "configure:1419: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:1429: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" + fi + rm -f conftest* + fi + if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 + fi + done + + + + + + echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 + echo "configure:1460: checking for ${CC-cc} option to accept ANSI C" >&5 + if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + am_cv_prog_cc_stdc=no + ac_save_CC="$CC" + # Don't try gcc -ansi; that turns off useful extensions and + # breaks some systems' header files. + # AIX -qlanglvl=ansi + # Ultrix and OSF/1 -std1 + # HP-UX -Aa -D_HPUX_SOURCE + # SVR4 -Xc -D__EXTENSIONS__ + for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" + do + CC="$ac_save_CC $ac_arg" + cat > conftest.$ac_ext < + #include + #include + #include + /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ + struct buf { int x; }; + FILE * (*rcsopen) (struct buf *, struct stat *, int); + static char *e (p, i) + char **p; + int i; + { + return p[i]; + } + static char *f (char * (*g) (char **, int), char **p, ...) + { + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; + } + int test (int i, double x); + struct s1 {int (*f) (int a);}; + struct s2 {int (*f) (double a);}; + int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); + int argc; + char **argv; + + int main() { + + return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + + ; return 0; } + EOF + if { (eval echo configure:1513: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + am_cv_prog_cc_stdc="$ac_arg"; break + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* + done + CC="$ac_save_CC" + + fi + + if test -z "$am_cv_prog_cc_stdc"; then + echo "$ac_t""none needed" 1>&6 + else + echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6 + fi + case "x$am_cv_prog_cc_stdc" in + x|xno) ;; + *) CC="$CC $am_cv_prog_cc_stdc" ;; + esac + + + + echo $ac_n "checking for function prototypes""... $ac_c" 1>&6 + echo "configure:1539: checking for function prototypes" >&5 + if test "$am_cv_prog_cc_stdc" != no; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF + #define PROTOTYPES 1 + EOF + + U= ANSI2KNR= + else + echo "$ac_t""no" 1>&6 + U=_ ANSI2KNR=./ansi2knr + # Ensure some checks needed by ansi2knr itself. + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 + echo "configure:1552: checking for ANSI C header files" >&5 + if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include + #include + #include + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:1565: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no + fi + rm -f conftest* + + if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat > conftest.$ac_ext < + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : + else + rm -rf conftest* + ac_cv_header_stdc=no + fi + rm -f conftest* + + fi + + if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat > conftest.$ac_ext < + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : + else + rm -rf conftest* + ac_cv_header_stdc=no + fi + rm -f conftest* + + fi + + if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : + else + cat > conftest.$ac_ext < + #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') + #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) + #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) + int main () { int i; for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); + exit (0); } + + EOF + if { (eval echo configure:1632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + : + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no + fi + rm -fr conftest* + fi + + fi + fi + + echo "$ac_t""$ac_cv_header_stdc" 1>&6 + if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF + #define STDC_HEADERS 1 + EOF + + fi + + for ac_hdr in string.h + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 + echo "configure:1659: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:1669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" + fi + rm -f conftest* + fi + if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 + fi + done + + fi + + echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 + echo "configure:1698: checking whether byte ordering is bigendian" >&5 + if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_cv_c_bigendian=unknown + # See if sys/param.h defines the BYTE_ORDER macro. + cat > conftest.$ac_ext < + #include + int main() { + + #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros + #endif + ; return 0; } + EOF + if { (eval echo configure:1716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + # It does; now see whether it defined to BIG_ENDIAN or not. + cat > conftest.$ac_ext < + #include + int main() { + + #if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + ; return 0; } + EOF + if { (eval echo configure:1731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_bigendian=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_bigendian=no + fi + rm -f conftest* + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* + if test $ac_cv_c_bigendian = unknown; then + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_c_bigendian=no + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_c_bigendian=yes + fi + rm -fr conftest* + fi + + fi + fi + + echo "$ac_t""$ac_cv_c_bigendian" 1>&6 + if test $ac_cv_c_bigendian = yes; then + cat >> confdefs.h <<\EOF + #define WORDS_BIGENDIAN 1 + EOF + + fi + + echo $ac_n "checking for working const""... $ac_c" 1>&6 + echo "configure:1788: checking for working const" >&5 + if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } + + ; return 0; } + EOF + if { (eval echo configure:1842: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_const=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_const=no + fi + rm -f conftest* + fi + + echo "$ac_t""$ac_cv_c_const" 1>&6 + if test $ac_cv_c_const = no; then + cat >> confdefs.h <<\EOF + #define const + EOF + + fi + + echo $ac_n "checking for inline""... $ac_c" 1>&6 + echo "configure:1863: checking for inline" >&5 + if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_cv_c_inline=no + for ac_kw in inline __inline__ __inline; do + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_inline=$ac_kw; break + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* + done + + fi + + echo "$ac_t""$ac_cv_c_inline" 1>&6 + case "$ac_cv_c_inline" in + inline | yes) ;; + no) cat >> confdefs.h <<\EOF + #define inline + EOF + ;; + *) cat >> confdefs.h <&6 + echo "configure:1905: checking whether ${CC-cc} needs -traditional" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_pattern="Autoconf.*'x'" + cat > conftest.$ac_ext < + Autoconf TIOCGETP + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "$ac_pattern" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_prog_gcc_traditional=yes + else + rm -rf conftest* + ac_cv_prog_gcc_traditional=no + fi + rm -f conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat > conftest.$ac_ext < + Autoconf TCGETA + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "$ac_pattern" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_prog_gcc_traditional=yes + fi + rm -f conftest* + + fi + fi + + echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi + fi + + echo $ac_n "checking for sa_len in struct sockaddr""... $ac_c" 1>&6 + echo "configure:1951: checking for sa_len in struct sockaddr" >&5 + if eval "test \"`echo '$''{'ac_cv_sys_sockaddr_sa_len'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include + + int main() { + + int length; + struct sockaddr sock; + length = sock.sa_len; + + ; return 0; } + EOF + if { (eval echo configure:1970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sys_sockaddr_sa_len=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_sys_sockaddr_sa_len=no + fi + rm -f conftest* + fi + + echo "$ac_t""$ac_cv_sys_sockaddr_sa_len" 1>&6 + if test $ac_cv_sys_sockaddr_sa_len = yes; then + cat >> confdefs.h <&6 + echo "configure:1991: checking for mpz_powm in -lgmp" >&5 + ac_lib_var=`echo gmp'_'mpz_powm | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" + LIBS="-lgmp $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* + LIBS="$ac_save_LIBS" + + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + with_libgmp=yes + else + echo "$ac_t""no" 1>&6 + with_libgmp=no + fi + + if test $with_libgmp = no; then + { echo "configure: error: could not find libgmp" 1>&2; exit 1; } + fi + echo $ac_n "checking for des_cbc_encrypt in -ldes""... $ac_c" 1>&6 + echo "configure:2035: checking for des_cbc_encrypt in -ldes" >&5 + ac_lib_var=`echo des'_'des_cbc_encrypt | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" + LIBS="-ldes $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* + LIBS="$ac_save_LIBS" + + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + with_libdes=yes + else + echo "$ac_t""no" 1>&6 + with_libdes=no + fi + + if test $with_libdes = no; then + { echo "configure: error: could not find libdes" 1>&2; exit 1; } + fi + + # Check whether --enable-asymmetric-links or --disable-asymmetric-links was given. + if test "${enable_asymmetric_links+set}" = set; then + enableval="$enable_asymmetric_links" + + else + enable_asymmetric_links=no + fi + + if test $enable_asymmetric_links = yes; then + cat >> confdefs.h <<\EOF + #define ENABLE_SYMMETRIC_LINKS 1 + EOF + + fi + + # Check whether --enable-any-on-demand or --disable-any-on-demand was given. + if test "${enable_any_on_demand+set}" = set; then + enableval="$enable_any_on_demand" + + else + enable_any_on_demand=no + fi + + if test $enable_any_on_demand = yes; then + cat >> confdefs.h <<\EOF + #define ENABLE_ANY_ON_DEMAND 1 + EOF + + fi + + LIBSYSDEP_DIR= + LIBSYSDEP_LDADD= + isakmpd_DEPENDENCIES= + use_pf_key_v2=true + case $target in + *linux*) TARGET=linux use_pf_key_v2=false ;; + *openbsd1* | *openbsd2.[01234]*) TARGET=openbsd-encap ;; + *openbsd*) TARGET=openbsd ;; + *freebsd*) + TARGET=freebsd + TARGET_INCLUDES="-I\$(srcdir)/sysdep/$TARGET -I\$(srcdir)/sysdep/linux" + LIBSYSDEP_DIR=linux ;; + *) { echo "configure: error: don't know how to build for $target" 1>&2; exit 1; } ;; + esac + if test "x$LIBSYSDEP_DIR" != x && test -d $srcdir/sysdep/$TARGET/libsysdep; then + LIBSYSDEP_DIR="sysdep/$TARGET/libsysdep" + fi + if test "x$LIBSYSDEP_DIR" != x; then + + + if test $LIBSYSDEP_DIR = linux; then + LIBSYSDEP_LINUX_TRUE= + LIBSYSDEP_LINUX_FALSE='#' + else + LIBSYSDEP_LINUX_TRUE='#' + LIBSYSDEP_LINUX_FALSE= + fi + LIBSYSDEP_DIR="sysdep/$LIBSYSDEP_DIR/libsysdep" + LIBSYSDEP_LDADD="$LIBSYSDEP_DIR/libsysdep.a" + fi + if test "x$TARGET_INCLUDES" = x; then + TARGET_INCLUDES="-I\$(srcdir)/sysdep/$TARGET" + fi + if $use_pf_key_v2; then + TARGET_INCLUDES="$TARGET_INCLUDES -DUSE_PF_KEY_V2" + isakmpd_DEPENDENCIES=pf_key_v2.o + fi + + + + + + # Check whether --with-efence or --without-efence was given. + if test "${with_efence+set}" = set; then + withval="$with_efence" + + else + with_efence=no + fi + + EFENCE_LDADD= + if test "x$with_efence" != "xno"; then + save_LDFLAGS="$LDFLAGS" + EFENCE_LDADD="-lefence" + if test "x$with_efence" != "xyes"; then + LDFLAGS="$LDFLAGS -L$with_efence" + EFENCE_LDADD="-L$with_efence $EFENCE_LDADD" + fi + echo $ac_n "checking for EF_Print in -lefence""... $ac_c" 1>&6 + echo "configure:2168: checking for EF_Print in -lefence" >&5 + ac_lib_var=`echo efence'_'EF_Print | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" + LIBS="-lefence $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* + LIBS="$ac_save_LIBS" + + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo efence | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 + fi + + LDFLAGS="$save_LDFLAGS" + fi + + + # Check whether --with-boehm-gc or --without-boehm-gc was given. + if test "${with_boehm_gc+set}" = set; then + withval="$with_boehm_gc" + + else + with_boehm_gc=no + fi + + BOEHM_GC_LDADD= + if test "x$with_boehm_gc" != "xno"; then + save_LDFLAGS="$LDFLAGS" + BOEHM_GC_LDADD="-lgc" + if test "x$with_boehm_gc" != "xyes"; then + LDFLAGS="$LDFLAGS -L$with_boehm_gc" + BOEHM_GC_LDADD="-L$with_boehm_gc $BOEHM_GC_LDADD" + fi + echo $ac_n "checking for main in -lgc""... $ac_c" 1>&6 + echo "configure:2235: checking for main in -lgc" >&5 + ac_lib_var=`echo gc'_'main | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" + LIBS="-lgc $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* + LIBS="$ac_save_LIBS" + + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + else + echo "$ac_t""no" 1>&6 + { echo "configure: error: cannot find Boehm's garbage collector" 1>&2; exit 1; } + fi + + LDFLAGS="$save_LDFLAGS" + fi + + + + # Check whether --with-boehm-leak or --without-boehm-leak was given. + if test "${with_boehm_leak+set}" = set; then + withval="$with_boehm_leak" + + else + with_boehm_leak=no + fi + + BOEHM_LEAK_INCLUDES= + BOEHM_LEAK_LDADD= + if test "x$with_boehm_leak" != "xno"; then + if test "x$GCC" != "xyes"; then + { echo "configure: error: you can only use Boehm's leak library when compiling with GCC" 1>&2; exit 1; } + fi + BOEHM_LEAK_INCLUDES="-D'malloc(x)=({ \ + void *GC_debug_malloc (size_t, char *, int); \ + GC_debug_malloc ((x), __FILE__, __LINE__); \ + })' \ + -D'realloc(x,y)=({ \ + void *GC_debug_realloc (void *, size_t, char *, int); \ + GC_debug_realloc ((x), (y), __FILE__, __LINE__); \ + })' \ + -D'free(x)=({ \ + void GC_debug_free (void *); \ + GC_debug_free (x); \ + })' \ + -D'calloc(x,y)=malloc((x) * (y))' \ + -D'strdup(x)=({ \ + char *strcpy (char *, const char *); \ + const char *_x_ = (x); \ + char *_y_ = malloc (strlen (_x_) + 1); \ + strcpy (_y_, _x_); \ + })'" + save_LDFLAGS="$LDFLAGS" + BOEHM_LEAK_LDADD="-lleak" + if test "x$with_boehm_leak" != "xyes"; then + LDFLAGS="$LDFLAGS -L$with_boehm_leak" + BOEHM_LEAK_LDADD="-L$with_boehm_leak $BOEHM_LEAK_LDADD" + fi + echo $ac_n "checking for main in -lleak""... $ac_c" 1>&6 + echo "configure:2316: checking for main in -lleak" >&5 + ac_lib_var=`echo leak'_'main | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" + LIBS="-lleak $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* + LIBS="$ac_save_LIBS" + + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + else + echo "$ac_t""no" 1>&6 + { echo "configure: error: cannot find Boehm's memory leak library" 1>&2; exit 1; } + fi + + LDFLAGS="$save_LDFLAGS" + fi + + + + + + + # Check whether --enable-debug or --disable-debug was given. + if test "${enable_debug+set}" = set; then + enableval="$enable_debug" + + else + enable_debug=yes + fi + + if test "x$enable_debug" = "xyes"; then + CFLAGS="${CFLAGS-} -O0" + + fi + # Check whether --enable-warnings or --disable-warnings was given. + if test "${enable_warnings+set}" = set; then + enableval="$enable_warnings" + + else + enable_warnings=yes + fi + + if test "x$enable_warnings" = "xyes"; then + if test "x$GCC" = "xyes"; then + CFLAGS="${CFLAGS-} -Wall -Wmissing-prototypes -Wstrict-prototypes"; + fi + + fi + # Check whether --enable-profiled or --disable-profiled was given. + if test "${enable_profiled+set}" = set; then + enableval="$enable_profiled" + + else + enable_profiled=no + fi + + if test "x$enable_profiled" = "xyes"; then + CFLAGS="${CFLAGS-} -pg" + + fi + + + trap '' 1 2 15 + cat > confcache <<\EOF + # This file is a shell script that caches the results of configure + # tests run on this system so they can be shared between configure + # scripts and configure runs. It is not useful on other systems. + # If it contains results you don't want to keep, you may remove or edit it. + # + # By default, configure uses ./config.cache as the cache file, + # creating it if it does not exist already. You can give configure + # the --cache-file=FILE option to use a different cache file; that is + # what configure does when it calls configure scripts in + # subdirectories, so they share the cache. + # Giving --cache-file=/dev/null disables caching, for debugging configure. + # config.status only pays attention to the cache file if you give it the + # --recheck option to rerun configure. + # + EOF + # The following way of writing the cache mishandles newlines in values, + # but we know of no workaround that is simple, portable, and efficient. + # So, don't put newlines in cache variables' values. + # Ultrix sh set writes to stderr and can't be redirected directly, + # and sets the high bit in the cache file unless we assign to the vars. + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache + if cmp -s $cache_file confcache; then + : + else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi + fi + rm -f confcache + + trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + + test "x$prefix" = xNONE && prefix=$ac_default_prefix + # Let make expand exec_prefix. + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + + # Any assignment to VPATH causes Sun make to only execute + # the first set of double-colon rules, so remove it if not needed. + # If there is a colon in the path, we need to keep it. + if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' + fi + + trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + + DEFS=-DHAVE_CONFIG_H + + # Without the "./", some shells look in PATH for config.status. + : ${CONFIG_STATUS=./config.status} + + echo creating $CONFIG_STATUS + rm -f $CONFIG_STATUS + cat > $CONFIG_STATUS </dev/null | sed 1q`: + # + # $0 $ac_configure_args + # + # Compiler output produced by configure, useful for debugging + # configure, is in ./config.log if it exists. + + ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" + for ac_option + do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac + done + + ac_given_srcdir=$srcdir + ac_given_INSTALL="$INSTALL" + + trap 'rm -fr `echo "Makefile sysdep/Makefile sysdep/linux/Makefile sysdep/linux/libsysdep/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 + EOF + cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF + $ac_vpsub + $extrasub + s%@SHELL@%$SHELL%g + s%@CFLAGS@%$CFLAGS%g + s%@CPPFLAGS@%$CPPFLAGS%g + s%@CXXFLAGS@%$CXXFLAGS%g + s%@FFLAGS@%$FFLAGS%g + s%@DEFS@%$DEFS%g + s%@LDFLAGS@%$LDFLAGS%g + s%@LIBS@%$LIBS%g + s%@exec_prefix@%$exec_prefix%g + s%@prefix@%$prefix%g + s%@program_transform_name@%$program_transform_name%g + s%@bindir@%$bindir%g + s%@sbindir@%$sbindir%g + s%@libexecdir@%$libexecdir%g + s%@datadir@%$datadir%g + s%@sysconfdir@%$sysconfdir%g + s%@sharedstatedir@%$sharedstatedir%g + s%@localstatedir@%$localstatedir%g + s%@libdir@%$libdir%g + s%@includedir@%$includedir%g + s%@oldincludedir@%$oldincludedir%g + s%@infodir@%$infodir%g + s%@mandir@%$mandir%g + s%@host@%$host%g + s%@host_alias@%$host_alias%g + s%@host_cpu@%$host_cpu%g + s%@host_vendor@%$host_vendor%g + s%@host_os@%$host_os%g + s%@target@%$target%g + s%@target_alias@%$target_alias%g + s%@target_cpu@%$target_cpu%g + s%@target_vendor@%$target_vendor%g + s%@target_os@%$target_os%g + s%@build@%$build%g + s%@build_alias@%$build_alias%g + s%@build_cpu@%$build_cpu%g + s%@build_vendor@%$build_vendor%g + s%@build_os@%$build_os%g + s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g + s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g + s%@INSTALL_DATA@%$INSTALL_DATA%g + s%@PACKAGE@%$PACKAGE%g + s%@VERSION@%$VERSION%g + s%@ACLOCAL@%$ACLOCAL%g + s%@AUTOCONF@%$AUTOCONF%g + s%@AUTOMAKE@%$AUTOMAKE%g + s%@AUTOHEADER@%$AUTOHEADER%g + s%@MAKEINFO@%$MAKEINFO%g + s%@SET_MAKE@%$SET_MAKE%g + s%@CC@%$CC%g + s%@CPP@%$CPP%g + s%@RANLIB@%$RANLIB%g + s%@U@%$U%g + s%@ANSI2KNR@%$ANSI2KNR%g + s%@LIBSYSDEP_LINUX_TRUE@%$LIBSYSDEP_LINUX_TRUE%g + s%@LIBSYSDEP_LINUX_FALSE@%$LIBSYSDEP_LINUX_FALSE%g + s%@TARGET_INCLUDES@%$TARGET_INCLUDES%g + s%@LIBSYSDEP_LDADD@%$LIBSYSDEP_LDADD%g + s%@isakmpd_DEPENDENCIES@%$isakmpd_DEPENDENCIES%g + s%@EFENCE_LDADD@%$EFENCE_LDADD%g + s%@BOEHM_GC_LDADD@%$BOEHM_GC_LDADD%g + s%@BOEHM_LEAK_INCLUDES@%$BOEHM_LEAK_INCLUDES%g + s%@BOEHM_LEAK_LDADD@%$BOEHM_LEAK_LDADD%g + + CEOF + EOF + + cat >> $CONFIG_STATUS <<\EOF + + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. + ac_file=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_cmds # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds="" + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi + EOF + + cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ + # $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub + s%@configure_input@%$configure_input%g + s%@srcdir@%$srcdir%g + s%@top_srcdir@%$top_srcdir%g + s%@INSTALL@%$INSTALL%g + " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file + fi; done + rm -f conftest.s* + + # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where + # NAME is the cpp macro being defined and VALUE is the value it is being given. + # + # ac_d sets the value in "#define NAME VALUE" lines. + ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' + ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' + ac_dC='\3' + ac_dD='%g' + # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". + ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' + ac_uB='\([ ]\)%\1#\2define\3' + ac_uC=' ' + ac_uD='\4%g' + # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". + ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' + ac_eB='$%\1#\2define\3' + ac_eC=' ' + ac_eD='%g' + + if test "${CONFIG_HEADERS+set}" != set; then + EOF + cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + fi + for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in + + EOF + + # Transform confdefs.h into a sed script conftest.vals that substitutes + # the proper values into config.h.in to produce config.h. And first: + # Protect against being on the right side of a sed subst in config.status. + # Protect against being in an unquoted here document in config.status. + rm -f conftest.vals + cat > conftest.hdr <<\EOF + s/[\\&%]/\\&/g + s%[\\$`]%\\&%g + s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp + s%ac_d%ac_u%gp + s%ac_u%ac_e%gp + EOF + sed -n -f conftest.hdr confdefs.h > conftest.vals + rm -f conftest.hdr + + # This sed command replaces #undef with comments. This is necessary, for + # example, in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + cat >> conftest.vals <<\EOF + s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% + EOF + + # Break up conftest.vals because some shells have a limit on + # the size of here documents, and old seds have small limits too. + + rm -f conftest.tail + while : + do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in + ' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals + done + rm -f conftest.vals + + cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi + rm -f $ac_file + mv conftest.h $ac_file + fi + fi; done + + EOF + + cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + srcdir=$ac_given_srcdir + while test -n "$ac_sources"; do + set $ac_dests; ac_dest=$1; shift; ac_dests=$* + set $ac_sources; ac_source=$1; shift; ac_sources=$* + + echo "linking $srcdir/$ac_source to $ac_dest" + + if test ! -r $srcdir/$ac_source; then + { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; } + fi + rm -f $ac_dest + + # Make relative symlinks. + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'` + if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then + # The dest file is in a subdirectory. + test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir" + ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dest_dir_suffix. + ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dest_dir_suffix= ac_dots= + fi + + case "$srcdir" in + [/$]*) ac_rel_source="$srcdir/$ac_source" ;; + *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;; + esac + + # Make a symlink if possible; otherwise try a hard link. + if ln -s $ac_rel_source $ac_dest 2>/dev/null || + ln $srcdir/$ac_source $ac_dest; then : + else + { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; } + fi + done + EOF + cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h + + exit 0 + EOF + chmod +x $CONFIG_STATUS + rm -fr confdefs* $ac_clean_files + test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + + diff -ruN configure.in configure.in *** configure.in Wed Dec 31 19:00:00 1969 --- configure.in Fri Dec 3 12:16:12 1999 *************** *** 0 **** --- 1,140 ---- + dnl Process this file with autoconf to produce a configure script. + + dnl Copyright (c) 1996, 1997, 1998, 1999 BBN Corporation + dnl + dnl Permission to use, copy, modify, and distribute this software + dnl and its documentation for any purpose is hereby granted without + dnl fee, provided that the above copyright notice and this permission + dnl appear in all copies and in supporting documentation, and that the + dnl name of BBN Corporation not be used in advertising or publicity + dnl pertaining to distribution of the software without specific, + dnl written prior permission. BBN makes no representations about the + dnl suitability of this software for any purposes. It is provided "AS + dnl IS" without express or implied warranties. + dnl + dnl This software and its documentation was written by BBN Corporation + dnl under sponsorship by the Defense Advanced Research Projects Agency. + dnl + dnl $Header: /IR-CVS/isakmpd/configure.in,v 1.3 1999/12/03 17:16:12 fredette Exp $ + dnl $Author: fredette $ + dnl $Date: 1999/12/03 17:16:12 $ + dnl $Id: configure.in,v 1.3 1999/12/03 17:16:12 fredette Exp $ + dnl $Revision: 1.3 $ + + dnl Checks that we are given a good source directory. + AC_INIT(ike_phase_1.c) + AC_CANONICAL_SYSTEM + AM_INIT_AUTOMAKE(isakmpd, 1.0.1) + + dnl Write configuration out to config.h through config.h.in. + AM_CONFIG_HEADER(config.h) + + dnl Checks for programs. + AC_PROG_CC + AC_PROG_CPP + AC_PROG_RANLIB + AC_PROG_INSTALL + AC_PROG_MAKE_SET + + dnl Checks for header files. + AC_HEADER_STDC + AC_CHECK_HEADERS(unistd.h stdio.h memory.h) + + dnl Checks for typedefs, structures, and compiler characteristics. + AM_C_PROTOTYPES + AC_C_BIGENDIAN + AC_C_CONST + AC_C_INLINE + dnl AC_CHECK_SIZEOF(long, 4) + dnl AC_CHECK_SIZEOF(int, 4) + dnl AC_CHECK_SIZEOF(short, 2) + dnl AC_TYPE_OFF_T + dnl AC_TYPE_SIZE_T + dnl AC_CHECK_TYPE(uint16_t, u_int16_t) + dnl if test "$ac_cv_type_uint16_t" = "no"; then + dnl AC_CHECK_TYPE(u_int16_t, unsigned short) + dnl fi + dnl AC_CHECK_TYPE(int32_t, long) + dnl AC_CHECK_TYPE(uint32_t, u_int32_t) + dnl if test "$ac_cv_type_uint32_t" = "no"; then + dnl AC_CHECK_TYPE(u_int32_t, unsigned long) + dnl fi + + dnl Checks for library functions and system characteristics. + AC_PROG_GCC_TRADITIONAL + AC_SYS_SOCKADDR_SA_LEN + + dnl Check for libgmp and libdes. + AC_CHECK_LIB(gmp, mpz_powm, [with_libgmp=yes], [with_libgmp=no]) + if test $with_libgmp = no; then + AC_MSG_ERROR([could not find libgmp]) + fi + AC_CHECK_LIB(des, des_cbc_encrypt, [with_libdes=yes], [with_libdes=no]) + if test $with_libdes = no; then + AC_MSG_ERROR([could not find libdes]) + fi + + dnl Configure for asymmetric links. + AC_ARG_ENABLE(asymmetric-links, + [ --enable-asymmetric-links enable support for asymmetric links (default=don't)], + [ ], [enable_asymmetric_links=no]) + if test $enable_asymmetric_links = yes; then + AC_DEFINE(ENABLE_SYMMETRIC_LINKS) + fi + + dnl Configure for initiating arbitrary SAs on-demand. + AC_ARG_ENABLE(any-on-demand, + [ --enable-any-on-demand enable support for initating arbitrary SAs on-demand (default=don't)], + [ ], [enable_any_on_demand=no]) + if test $enable_any_on_demand = yes; then + AC_DEFINE(ENABLE_ANY_ON_DEMAND) + fi + + dnl Choose system-dependent stuff and some CFLAGS based on the target. + LIBSYSDEP_DIR= + LIBSYSDEP_LDADD= + isakmpd_DEPENDENCIES= + use_pf_key_v2=true + case $target in + *linux*) TARGET=linux use_pf_key_v2=false ;; + changequote(<<, >>)dnl + *openbsd1* | *openbsd2.[01234]*) TARGET=openbsd-encap ;; + changequote([, ])dnl + *openbsd*) TARGET=openbsd ;; + *freebsd*) + TARGET=freebsd + TARGET_INCLUDES="-I\$(srcdir)/sysdep/$TARGET -I\$(srcdir)/sysdep/linux" + LIBSYSDEP_DIR=linux ;; + *) AC_MSG_ERROR([don't know how to build for $target]) ;; + esac + if test "x$LIBSYSDEP_DIR" != x && test -d $srcdir/sysdep/$TARGET/libsysdep; then + LIBSYSDEP_DIR="sysdep/$TARGET/libsysdep" + fi + if test "x$LIBSYSDEP_DIR" != x; then + AM_CONDITIONAL(LIBSYSDEP_LINUX, test $LIBSYSDEP_DIR = linux) + LIBSYSDEP_DIR="sysdep/$LIBSYSDEP_DIR/libsysdep" + LIBSYSDEP_LDADD="$LIBSYSDEP_DIR/libsysdep.a" + fi + if test "x$TARGET_INCLUDES" = x; then + TARGET_INCLUDES="-I\$(srcdir)/sysdep/$TARGET" + fi + if $use_pf_key_v2; then + TARGET_INCLUDES="$TARGET_INCLUDES -DUSE_PF_KEY_V2" + isakmpd_DEPENDENCIES=pf_key_v2.o + fi + AC_SUBST(TARGET_INCLUDES) + AC_SUBST(LIBSYSDEP_LDADD) + AC_SUBST(isakmpd_DEPENDENCIES) + AC_LINK_FILES(sysdep/$TARGET/sysdep.c, sysdep.c) + + dnl Configure for Electric Fence, and Boehm's garbage collector and leak detector. + BBN_PATH_EFENCE + BBN_PATH_BOEHM_GC + BBN_PATH_BOEHM_LEAK + + dnl Configure debugging and/or warnings and/or profiling. + BBN_C_CFLAGS + + dnl Writes files. + AC_OUTPUT(Makefile sysdep/Makefile sysdep/linux/Makefile sysdep/linux/libsysdep/Makefile) + diff -ruN exchange.c exchange.c *** exchange.c Tue Aug 31 07:44:13 1999 --- exchange.c Thu Nov 4 12:11:21 1999 *************** *** 33,38 **** --- 33,41 ---- * This code was written under funding by Ericsson Radio Systems. */ + #ifdef HAVE_CONFIG_H + #include + #endif /* HAVE_CONFIG_H */ #include #include #include *************** *** 967,979 **** } else { ! name = conf_get_str ("Phase 1", "Default"); if (!name) { log_print ("exchange_setup_p1: " ! "no \"Default\" tag in [Phase 1] section"); return 0; } } policy = conf_get_str (name, "Configuration"); --- 970,994 ---- } else { ! #ifndef ENABLE_ANY_ON_DEMAND ! log_print ("exchange_setup_p1: " ! "\"Respond-any-on-demand\" tag in [General] section not supported"); ! return 0; ! #else /* ENABLE_ANY_ON_DEMAND */ ! name = conf_get_str ("General", "Respond-any-on-demand"); if (!name) { log_print ("exchange_setup_p1: " ! "no \"Respond-any-on-demand\" tag in [General] section"); ! return 0; ! } ! if (strcasecmp (name, "no") == 0) ! { ! log_print ("exchange_setup_p1: " ! "\"Respond-any-on-demand\" tag in [General] section says \"no\""); return 0; } + #endif /* ENABLE_ANY_ON_DEMAND */ } policy = conf_get_str (name, "Configuration"); diff -ruN exchange_num.c exchange_num.c *** exchange_num.c Wed Dec 31 19:00:00 1969 --- exchange_num.c Wed Dec 15 09:58:17 1999 *************** *** 0 **** --- 1,18 ---- + /* DO NOT EDIT-- this file is automatically generated. */ + + #include "sysdep.h" + + #include "constants.h" + #include "exchange_num.h" + + + + + struct constant_map exchange_script_cst[] = { + { EXCHANGE_SCRIPT_AUTH, "AUTH", 0 }, + { EXCHANGE_SCRIPT_INFO, "INFO", 0 }, + { EXCHANGE_SCRIPT_SWITCH, "SWITCH", 0 }, + { EXCHANGE_SCRIPT_END, "END", 0 }, + { 0, 0 } + }; + diff -ruN exchange_num.h exchange_num.h *** exchange_num.h Wed Dec 31 19:00:00 1969 --- exchange_num.h Wed Dec 15 09:58:17 1999 *************** *** 0 **** --- 1,20 ---- + /* DO NOT EDIT-- this file is automatically generated. */ + + #ifndef _EXCHANGE_NUM_H_ + #define _EXCHANGE_NUM_H_ + + #include "sysdep.h" + + #include "constants.h" + + + + + extern struct constant_map exchange_script_cst[]; + + #define EXCHANGE_SCRIPT_AUTH -1 + #define EXCHANGE_SCRIPT_INFO -2 + #define EXCHANGE_SCRIPT_SWITCH -3 + #define EXCHANGE_SCRIPT_END -4 + + #endif /* _EXCHANGE_NUM_H_ */ diff -ruN if.c if.c *** if.c Mon Apr 5 14:26:30 1999 --- if.c Wed Sep 22 15:42:29 1999 *************** *** 33,38 **** --- 33,41 ---- * This code was written under funding by Ericsson Radio Systems. */ + #ifdef HAVE_CONFIG_H + #include + #endif /* HAVE_CONFIG_H */ #include #include #include *************** *** 120,126 **** { ifrp = (struct ifreq *)p; (*func) (ifrp, arg); ! #ifdef USE_OLD_SOCKADDR len = sizeof ifrp->ifr_name + sizeof ifrp->ifr_addr; #else len = sizeof ifrp->ifr_name --- 123,129 ---- { ifrp = (struct ifreq *)p; (*func) (ifrp, arg); ! #ifndef HAVE_SOCKADDR_SA_LEN len = sizeof ifrp->ifr_name + sizeof ifrp->ifr_addr; #else len = sizeof ifrp->ifr_name diff -ruN ike_auth.c ike_auth.c *** ike_auth.c Wed Jul 21 10:30:23 1999 --- ike_auth.c Fri Sep 24 17:09:24 1999 *************** *** 406,421 **** return -1; } ! /* Check that the sig is of the correct size. */ ! if (GET_ISAKMP_GEN_LENGTH (p->p) - ISAKMP_SIG_SZ != mpz_sizeinoctets (key.n)) ! { ! pkcs_free_public_key (&key); ! log_print ("rsa_sig_decode_hash: " ! "SIG payload length does not match public key"); ! return -1; ! } ! ! if (!pkcs_rsa_decrypt (PKCS_PRIVATE, &key, 0, p->p + ISAKMP_SIG_DATA_OFF, hash_p, &len)) { pkcs_free_public_key (&key); --- 406,412 ---- return -1; } ! if (!pkcs_rsa_decrypt (PKCS_PRIVATE, &key, 0, p->p + ISAKMP_SIG_DATA_OFF, GET_ISAKMP_GEN_LENGTH (p->p) - ISAKMP_SIG_SZ, hash_p, &len)) { pkcs_free_public_key (&key); diff -ruN ike_quick_mode.c ike_quick_mode.c *** ike_quick_mode.c Tue Aug 31 07:44:58 1999 --- ike_quick_mode.c Thu Nov 4 12:27:52 1999 *************** *** 33,38 **** --- 33,45 ---- * This code was written under funding by Ericsson Radio Systems. */ + #ifdef HAVE_CONFIG_H + #include + #endif /* HAVE_CONFIG_H */ + #include + #include + #include + #include #include #include *************** *** 670,675 **** --- 677,684 ---- size_t hashsize = hash->hashsize; u_int8_t *rest; size_t rest_len; + struct sockaddr *src, *dst; + socklen_t srclen, dstlen; /* * As we are getting an answer on our transform offer, only one transform *************** *** 806,811 **** --- 815,864 ---- "initiator_recv_HASH_SA_NONCE: IDcr", ie->id_cr + ISAKMP_GEN_SZ, ie->id_cr_sz - ISAKMP_GEN_SZ); } + else + { + /* + * If client identifiers are not present in the exchange, + * we fake them. RFC 2409 states: + * The identities of the SAs negotiated in Quick Mode are + * implicitly assumed to be the IP addresses of the ISAKMP + * peers, without any constraints on the protocol or port + * numbers allowed, unless client identifiers are specified + * in Quick Mode. + * + * -- Michael Paddon (mwp@aba.net.au) + */ + + /* Get initiator address. */ + msg->transport->vtbl->get_src (msg->transport, &src, &srclen); + ie->id_ci_sz = ISAKMP_ID_DATA_OFF + + sizeof ((struct sockaddr_in *)src)->sin_addr.s_addr; + ie->id_ci = malloc (ie->id_ci_sz); + if (!ie->id_ci) + { + log_fatal ("initiator_recv_HASH_SA_NONCE: malloc (%d) failed", + ie->id_ci_sz); + } + SET_ISAKMP_ID_TYPE (ie->id_ci, IPSEC_ID_IPV4_ADDR); + memcpy (ie->id_ci + ISAKMP_ID_DATA_OFF, + &((struct sockaddr_in *)src)->sin_addr.s_addr, + sizeof ((struct sockaddr_in *)src)->sin_addr.s_addr); + + /* Get responder address. */ + msg->transport->vtbl->get_dst (msg->transport, &dst, &dstlen); + ie->id_cr_sz = ISAKMP_ID_DATA_OFF + + sizeof ((struct sockaddr_in *)dst)->sin_addr.s_addr; + ie->id_cr = malloc (ie->id_cr_sz); + if (!ie->id_cr) + { + log_fatal ("initiator_recv_HASH_SA_NONCE: malloc (%d) failed", + ie->id_cr_sz); + } + SET_ISAKMP_ID_TYPE (ie->id_cr, IPSEC_ID_IPV4_ADDR); + memcpy (ie->id_cr + ISAKMP_ID_DATA_OFF, + &((struct sockaddr_in *)dst)->sin_addr.s_addr, + sizeof ((struct sockaddr_in *)dst)->sin_addr.s_addr); + } return 0; } *************** *** 1002,1007 **** --- 1055,1064 ---- char *name; #endif + #ifdef ENABLE_ANY_ON_DEMAND + char *conn_name_ipsec, *id_name, *id_address; + #endif /* ENABLE_ANY_ON_DEMAND */ + hashp = TAILQ_FIRST (&msg->payload[ISAKMP_PAYLOAD_HASH]); hash = hashp->p; hashp->flags |= PL_MARK; *************** *** 1220,1225 **** --- 1277,1338 ---- * name and set it on the exchange. */ name = connection_passive_lookup_by_ids (ie->id_ci, ie->id_cr); + #ifdef ENABLE_ANY_ON_DEMAND + /* if we have no Phase 2 connection that matches these identities, + but these identities are the IP addresses of the peers, add a + Phase 2 connection that covers them: */ + /* XXX maybe we should only do this when the ISAKMP peer used is the + one associated with Respond-any-on-demand? */ + /* XXX IPv4 specific: */ + if (name == NULL) { + msg->transport->vtbl->get_dst (msg->transport, &dst, &dstlen); + msg->transport->vtbl->get_src (msg->transport, &src, &srclen); + if ( + #define _IS_ADDRESS(id, id_sz, addr) (\ + GET_ISAKMP_ID_TYPE(id) == IPSEC_ID_IPV4_ADDR && \ + id_sz == (ISAKMP_ID_DATA_OFF + \ + sizeof ((struct sockaddr_in *) addr)->sin_addr.s_addr) && \ + !memcmp(id + ISAKMP_ID_DATA_OFF, \ + &((struct sockaddr_in *) addr)->sin_addr.s_addr, \ + sizeof ((struct sockaddr_in *) addr)->sin_addr.s_addr)) + _IS_ADDRESS(ie->id_ci, ie->id_ci_sz, dst) && + _IS_ADDRESS(ie->id_cr, ie->id_cr_sz, src) + #undef _IS_ADDRESS + ) { + if ((conn_name_ipsec = malloc(strlen("auto-ipsec-RFFFFFFFF:FFFFFFFF") + 1)) == NULL) + log_fatal("responder_recv_HASH_SA_NONCE: out of memory"); + sprintf(conn_name_ipsec, "auto-ipsec-R%08x:%08x", + ((struct sockaddr_in *) src)->sin_addr.s_addr, + ((struct sockaddr_in *) dst)->sin_addr.s_addr); + conf_set_str(conn_name_ipsec, "Phase", "2"); + conf_set_str(conn_name_ipsec, "Configuration", "auto-quick-mode"); + if ((id_name = malloc(strlen("auto-ID-FFFFFFFF") + 1)) == NULL) + log_fatal("responder_recv_HASH_SA_NONCE: out of memory"); + sprintf(id_name, "auto-ID-%08x", + ((struct sockaddr_in *) src)->sin_addr.s_addr); + if (conf_get_str(id_name, "ID-type") == NULL) { + if ((id_address = strdup(inet_ntoa (((struct sockaddr_in *) src)->sin_addr))) == NULL) + log_fatal("exchange_setup_p1: out of memory"); + conf_set_str(id_name, "ID-type", "IPV4_ADDR"); + conf_set_str(id_name, "Address", id_address); + } + conf_set_str(conn_name_ipsec, "Local-ID", id_name); + if ((id_name = malloc(strlen("auto-ID-FFFFFFFF") + 1)) == NULL) + log_fatal("responder_recv_HASH_SA_NONCE: out of memory"); + sprintf(id_name, "auto-ID-%08x", + ((struct sockaddr_in *) dst)->sin_addr.s_addr); + if (conf_get_str(id_name, "ID-type") == NULL) { + if ((id_address = strdup(inet_ntoa (((struct sockaddr_in *)dst)->sin_addr))) == NULL) + log_fatal("responder_recv_HASH_SA_NONCE: out of memory"); + conf_set_str(id_name, "ID-type", "IPV4_ADDR"); + conf_set_str(id_name, "Address", id_address); + } + conf_set_str(conn_name_ipsec, "Remote-ID", id_name); + connection_record_passive(conn_name_ipsec); + name = connection_passive_lookup_by_ids (ie->id_ci, ie->id_cr); + } + } + #endif /* ENABLE_ANY_ON_DEMAND */ if (!name) { /* XXX Notify peer and log. */ diff -ruN install-sh install-sh *** install-sh Wed Dec 31 19:00:00 1969 --- install-sh Fri Feb 12 23:07:50 1999 *************** *** 0 **** --- 1,251 ---- + #!/bin/sh + # + # install - install a program, script, or datafile + # This comes from X11R5 (mit/util/scripts/install.sh). + # + # Copyright 1991 by the Massachusetts Institute of Technology + # + # Permission to use, copy, modify, distribute, and sell this software and its + # documentation for any purpose is hereby granted without fee, provided that + # the above copyright notice appear in all copies and that both that + # copyright notice and this permission notice appear in supporting + # documentation, and that the name of M.I.T. not be used in advertising or + # publicity pertaining to distribution of the software without specific, + # written prior permission. M.I.T. makes no representations about the + # suitability of this software for any purpose. It is provided "as is" + # without express or implied warranty. + # + # Calling this script install-sh is preferred over install.sh, to prevent + # `make' implicit rules from creating a file called install from it + # when there is no Makefile. + # + # This script is compatible with the BSD install script, but was written + # from scratch. It can only install one file at a time, a restriction + # shared with many OS's install programs. + + + # set DOITPROG to echo to test this script + + # Don't use :- since 4.3BSD and earlier shells don't like it. + doit="${DOITPROG-}" + + + # put in absolute paths if you don't have them in your path; or use env. vars. + + mvprog="${MVPROG-mv}" + cpprog="${CPPROG-cp}" + chmodprog="${CHMODPROG-chmod}" + chownprog="${CHOWNPROG-chown}" + chgrpprog="${CHGRPPROG-chgrp}" + stripprog="${STRIPPROG-strip}" + rmprog="${RMPROG-rm}" + mkdirprog="${MKDIRPROG-mkdir}" + + transformbasename="" + transform_arg="" + instcmd="$mvprog" + chmodcmd="$chmodprog 0755" + chowncmd="" + chgrpcmd="" + stripcmd="" + rmcmd="$rmprog -f" + mvcmd="$mvprog" + src="" + dst="" + dir_arg="" + + while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac + done + + if [ x"$src" = x ] + then + echo "install: no input file specified" + exit 1 + else + true + fi + + if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi + else + + # Waiting for this to be detected by the "$instcmd $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + + # If destination is a directory, append the input filename; if your system + # does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi + fi + + ## this sed command emulates the dirname command + dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + + # Make sure that the destination directory exists. + # this part is taken from Noah Friedman's mkinstalldirs script + + # Skip lots of stat calls in the usual case. + if [ ! -d "$dstdir" ]; then + defaultIFS=' + ' + IFS="${IFS-${defaultIFS}}" + + oIFS="${IFS}" + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` + IFS="${oIFS}" + + pathcomp='' + + while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" + done + fi + + if [ x"$dir_arg" != x ] + then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi + else + + # If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + + # don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + + # Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + + # Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + + # and set any options; do chmod last to preserve setuid bits + + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + + # Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + + fi && + + + exit 0 diff -ruN ipsec.c ipsec.c *** ipsec.c Tue Aug 31 07:45:31 1999 --- ipsec.c Wed Sep 22 15:51:59 1999 *************** *** 291,301 **** for (proto = TAILQ_FIRST (&sa->protos), last_proto = 0; proto; proto = TAILQ_NEXT (proto, link)) { ! if (sysdep_ipsec_set_spi (sa, proto, 0) || (last_proto && sysdep_ipsec_group_spis (sa, last_proto, proto, 0)) ! || sysdep_ipsec_set_spi (sa, proto, 1) || (last_proto && sysdep_ipsec_group_spis (sa, last_proto, proto, 1))) --- 291,301 ---- for (proto = TAILQ_FIRST (&sa->protos), last_proto = 0; proto; proto = TAILQ_NEXT (proto, link)) { ! if (sysdep_ipsec_set_spi (exchange, sa, proto, 0) || (last_proto && sysdep_ipsec_group_spis (sa, last_proto, proto, 0)) ! || sysdep_ipsec_set_spi (exchange, sa, proto, 1) || (last_proto && sysdep_ipsec_group_spis (sa, last_proto, proto, 1))) *************** *** 1234,1240 **** transport->vtbl->get_src (transport, &dst, &dstlen); /* The peer is the source. */ transport->vtbl->get_dst (transport, &src, &srclen); ! return sysdep_ipsec_get_spi (sz, proto, src, srclen, dst, dstlen); } } --- 1234,1240 ---- transport->vtbl->get_src (transport, &dst, &dstlen); /* The peer is the source. */ transport->vtbl->get_dst (transport, &src, &srclen); ! return sysdep_ipsec_get_spi (msg->exchange, sz, proto, src, srclen, dst, dstlen); } } diff -ruN ipsec_fld.c ipsec_fld.c *** ipsec_fld.c Wed Dec 31 19:00:00 1969 --- ipsec_fld.c Wed Dec 15 09:58:17 1999 *************** *** 0 **** --- 1,36 ---- + /* DO NOT EDIT-- this file is automatically generated. */ + + #include "sysdep.h" + + #include "constants.h" + #include "field.h" + #include "ipsec_fld.h" + #include "isakmp_num.h" + #include "ipsec_num.h" + + + + + + struct field ipsec_sit_fld[] = { + { "SIT", 0, 4, mask, ipsec_sit_sit_maps }, + { "LABELED_DOMAIN_ID", 4, 4, num, 0 }, + { "SECRECY_LENGTH", 8, 2, num, 0 }, + { "RESERVED_1", 10, 2, ign, 0 }, + { "SECRECY_CAT_LENGTH", 12, 2, num, 0 }, + { "RESERVED_2", 14, 2, ign, 0 }, + { "INTEGRITY_LENGTH", 16, 2, num, 0 }, + { "RESERVED_3", 18, 2, ign, 0 }, + { "INTEGRITY_CAT_LENGTH", 20, 2, num, 0 }, + { "RESERVED_4", 22, 2, ign, 0 }, + { 0, 0, 0, 0, 0 } + }; + + struct constant_map *ipsec_sit_sit_maps[] = { ipsec_sit_cst,0 }; + + struct field ipsec_id_fld[] = { + { "PROTO", 0, 1, num, 0 }, + { "PORT", 1, 2, num, 0 }, + { 0, 0, 0, 0, 0 } + }; + diff -ruN ipsec_fld.h ipsec_fld.h *** ipsec_fld.h Wed Dec 31 19:00:00 1969 --- ipsec_fld.h Wed Dec 15 09:58:17 1999 *************** *** 0 **** --- 1,73 ---- + /* DO NOT EDIT-- this file is automatically generated. */ + + #ifndef _IPSEC_FLD_H_ + #define _IPSEC_FLD_H_ + + #include "sysdep.h" + + #include "field.h" + + struct constant_map; + + + + + + extern struct field ipsec_sit_fld[]; + + #define IPSEC_SIT_SIT_OFF 0 + #define IPSEC_SIT_SIT_LEN 4 + extern struct constant_map *ipsec_sit_sit_maps[]; + #define GET_IPSEC_SIT_SIT(buf) field_get_num (ipsec_sit_fld + 0, buf) + #define SET_IPSEC_SIT_SIT(buf, val) field_set_num (ipsec_sit_fld + 0, buf, val) + #define IPSEC_SIT_LABELED_DOMAIN_ID_OFF 4 + #define IPSEC_SIT_LABELED_DOMAIN_ID_LEN 4 + #define GET_IPSEC_SIT_LABELED_DOMAIN_ID(buf) field_get_num (ipsec_sit_fld + 1, buf) + #define SET_IPSEC_SIT_LABELED_DOMAIN_ID(buf, val) field_set_num (ipsec_sit_fld + 1, buf, val) + #define IPSEC_SIT_SECRECY_LENGTH_OFF 8 + #define IPSEC_SIT_SECRECY_LENGTH_LEN 2 + #define GET_IPSEC_SIT_SECRECY_LENGTH(buf) field_get_num (ipsec_sit_fld + 2, buf) + #define SET_IPSEC_SIT_SECRECY_LENGTH(buf, val) field_set_num (ipsec_sit_fld + 2, buf, val) + #define IPSEC_SIT_RESERVED_1_OFF 10 + #define IPSEC_SIT_RESERVED_1_LEN 2 + #define GET_IPSEC_SIT_RESERVED_1(buf) field_get_num (ipsec_sit_fld + 3, buf) + #define SET_IPSEC_SIT_RESERVED_1(buf, val) field_set_num (ipsec_sit_fld + 3, buf, val) + #define IPSEC_SIT_SECRECY_CAT_LENGTH_OFF 12 + #define IPSEC_SIT_SECRECY_CAT_LENGTH_LEN 2 + #define GET_IPSEC_SIT_SECRECY_CAT_LENGTH(buf) field_get_num (ipsec_sit_fld + 4, buf) + #define SET_IPSEC_SIT_SECRECY_CAT_LENGTH(buf, val) field_set_num (ipsec_sit_fld + 4, buf, val) + #define IPSEC_SIT_RESERVED_2_OFF 14 + #define IPSEC_SIT_RESERVED_2_LEN 2 + #define GET_IPSEC_SIT_RESERVED_2(buf) field_get_num (ipsec_sit_fld + 5, buf) + #define SET_IPSEC_SIT_RESERVED_2(buf, val) field_set_num (ipsec_sit_fld + 5, buf, val) + #define IPSEC_SIT_INTEGRITY_LENGTH_OFF 16 + #define IPSEC_SIT_INTEGRITY_LENGTH_LEN 2 + #define GET_IPSEC_SIT_INTEGRITY_LENGTH(buf) field_get_num (ipsec_sit_fld + 6, buf) + #define SET_IPSEC_SIT_INTEGRITY_LENGTH(buf, val) field_set_num (ipsec_sit_fld + 6, buf, val) + #define IPSEC_SIT_RESERVED_3_OFF 18 + #define IPSEC_SIT_RESERVED_3_LEN 2 + #define GET_IPSEC_SIT_RESERVED_3(buf) field_get_num (ipsec_sit_fld + 7, buf) + #define SET_IPSEC_SIT_RESERVED_3(buf, val) field_set_num (ipsec_sit_fld + 7, buf, val) + #define IPSEC_SIT_INTEGRITY_CAT_LENGTH_OFF 20 + #define IPSEC_SIT_INTEGRITY_CAT_LENGTH_LEN 2 + #define GET_IPSEC_SIT_INTEGRITY_CAT_LENGTH(buf) field_get_num (ipsec_sit_fld + 8, buf) + #define SET_IPSEC_SIT_INTEGRITY_CAT_LENGTH(buf, val) field_set_num (ipsec_sit_fld + 8, buf, val) + #define IPSEC_SIT_RESERVED_4_OFF 22 + #define IPSEC_SIT_RESERVED_4_LEN 2 + #define GET_IPSEC_SIT_RESERVED_4(buf) field_get_num (ipsec_sit_fld + 9, buf) + #define SET_IPSEC_SIT_RESERVED_4(buf, val) field_set_num (ipsec_sit_fld + 9, buf, val) + #define IPSEC_SIT_SZ 24 + + extern struct field ipsec_id_fld[]; + + #define IPSEC_ID_PROTO_OFF 0 + #define IPSEC_ID_PROTO_LEN 1 + #define GET_IPSEC_ID_PROTO(buf) field_get_num (ipsec_id_fld + 0, buf) + #define SET_IPSEC_ID_PROTO(buf, val) field_set_num (ipsec_id_fld + 0, buf, val) + #define IPSEC_ID_PORT_OFF 1 + #define IPSEC_ID_PORT_LEN 2 + #define GET_IPSEC_ID_PORT(buf) field_get_num (ipsec_id_fld + 1, buf) + #define SET_IPSEC_ID_PORT(buf, val) field_set_num (ipsec_id_fld + 1, buf, val) + #define IPSEC_ID_SZ 3 + + #endif /* _IPSEC_FLD_H_ */ diff -ruN ipsec_num.c ipsec_num.c *** ipsec_num.c Wed Dec 31 19:00:00 1969 --- ipsec_num.c Wed Dec 15 09:58:17 1999 *************** *** 0 **** --- 1,220 ---- + /* DO NOT EDIT-- this file is automatically generated. */ + + #include "sysdep.h" + + #include "constants.h" + #include "ipsec_num.h" + + + + + + struct constant_map ipsec_doi_cst[] = { + { IPSEC_DOI_IPSEC, "IPSEC", 0 }, + { 0, 0 } + }; + + + struct constant_map ipsec_attr_cst[] = { + { IPSEC_ATTR_SA_LIFE_TYPE, "SA_LIFE_TYPE", 0 }, + { IPSEC_ATTR_SA_LIFE_DURATION, "SA_LIFE_DURATION", 0 }, + { IPSEC_ATTR_GROUP_DESCRIPTION, "GROUP_DESCRIPTION", 0 }, + { IPSEC_ATTR_ENCAPSULATION_MODE, "ENCAPSULATION_MODE", 0 }, + { IPSEC_ATTR_AUTHENTICATION_ALGORITHM, "AUTHENTICATION_ALGORITHM", 0 }, + { IPSEC_ATTR_KEY_LENGTH, "KEY_LENGTH", 0 }, + { IPSEC_ATTR_KEY_ROUNDS, "KEY_ROUNDS", 0 }, + { IPSEC_ATTR_COMPRESS_DICTIONARY_SIZE, "COMPRESS_DICTIONARY_SIZE", 0 }, + { IPSEC_ATTR_COMPRESS_PRIVATE_ALGORITHM, "COMPRESS_PRIVATE_ALGORITHM", 0 }, + { 0, 0 } + }; + + + struct constant_map ipsec_duration_cst[] = { + { IPSEC_DURATION_SECONDS, "SECONDS", 0 }, + { IPSEC_DURATION_KILOBYTES, "KILOBYTES", 0 }, + { 0, 0 } + }; + + + struct constant_map ipsec_encap_cst[] = { + { IPSEC_ENCAP_TUNNEL, "TUNNEL", 0 }, + { IPSEC_ENCAP_TRANSPORT, "TRANSPORT", 0 }, + { 0, 0 } + }; + + + struct constant_map ipsec_auth_cst[] = { + { IPSEC_AUTH_HMAC_MD5, "HMAC_MD5", 0 }, + { IPSEC_AUTH_HMAC_SHA, "HMAC_SHA", 0 }, + { IPSEC_AUTH_DES_MAC, "DES_MAC", 0 }, + { IPSEC_AUTH_KPDK, "KPDK", 0 }, + { 0, 0 } + }; + + + struct constant_map ipsec_id_cst[] = { + { IPSEC_ID_IPV4_ADDR, "IPV4_ADDR", 0 }, + { IPSEC_ID_FQDN, "FQDN", 0 }, + { IPSEC_ID_USER_FQDN, "USER_FQDN", 0 }, + { IPSEC_ID_IPV4_ADDR_SUBNET, "IPV4_ADDR_SUBNET", 0 }, + { IPSEC_ID_IPV6_ADDR, "IPV6_ADDR", 0 }, + { IPSEC_ID_IPV6_ADDR_SUBNET, "IPV6_ADDR_SUBNET", 0 }, + { IPSEC_ID_IPV4_RANGE, "IPV4_RANGE", 0 }, + { IPSEC_ID_IPV6_RANGE, "IPV6_RANGE", 0 }, + { IPSEC_ID_DER_ASN1_DN, "DER_ASN1_DN", 0 }, + { IPSEC_ID_DER_ASN1_GN, "DER_ASN1_GN", 0 }, + { IPSEC_ID_KEY_ID, "KEY_ID", 0 }, + { 0, 0 } + }; + + + struct constant_map ike_attr_cst[] = { + { IKE_ATTR_ENCRYPTION_ALGORITHM, "ENCRYPTION_ALGORITHM", ike_encrypt_cst }, + { IKE_ATTR_HASH_ALGORITHM, "HASH_ALGORITHM", ike_hash_cst }, + { IKE_ATTR_AUTHENTICATION_METHOD, "AUTHENTICATION_METHOD", ike_auth_cst }, + { IKE_ATTR_GROUP_DESCRIPTION, "GROUP_DESCRIPTION", ike_group_desc_cst }, + { IKE_ATTR_GROUP_TYPE, "GROUP_TYPE", ike_group_cst }, + { IKE_ATTR_GROUP_PRIME, "GROUP_PRIME", 0 }, + { IKE_ATTR_GROUP_GENERATOR_1, "GROUP_GENERATOR_1", 0 }, + { IKE_ATTR_GROUP_GENERATOR_2, "GROUP_GENERATOR_2", 0 }, + { IKE_ATTR_GROUP_CURVE_A, "GROUP_CURVE_A", 0 }, + { IKE_ATTR_GROUP_CURVE_B, "GROUP_CURVE_B", 0 }, + { IKE_ATTR_LIFE_TYPE, "LIFE_TYPE", ike_duration_cst }, + { IKE_ATTR_LIFE_DURATION, "LIFE_DURATION", 0 }, + { IKE_ATTR_PRF, "PRF", ike_prf_cst }, + { IKE_ATTR_KEY_LENGTH, "KEY_LENGTH", 0 }, + { IKE_ATTR_FIELD_SIZE, "FIELD_SIZE", 0 }, + { IKE_ATTR_GROUP_ORDER, "GROUP_ORDER", 0 }, + { 0, 0 } + }; + + + + struct constant_map ike_encrypt_cst[] = { + { IKE_ENCRYPT_DES_CBC, "DES_CBC", 0 }, + { IKE_ENCRYPT_IDEA_CBC, "IDEA_CBC", 0 }, + { IKE_ENCRYPT_BLOWFISH_CBC, "BLOWFISH_CBC", 0 }, + { IKE_ENCRYPT_RC5_R16_B64_CBC, "RC5_R16_B64_CBC", 0 }, + { IKE_ENCRYPT_3DES_CBC, "3DES_CBC", 0 }, + { IKE_ENCRYPT_CAST_CBC, "CAST_CBC", 0 }, + { 0, 0 } + }; + + + struct constant_map ike_hash_cst[] = { + { IKE_HASH_MD5, "MD5", 0 }, + { IKE_HASH_SHA, "SHA", 0 }, + { IKE_HASH_TIGER, "TIGER", 0 }, + { 0, 0 } + }; + + + struct constant_map ike_auth_cst[] = { + { IKE_AUTH_PRE_SHARED, "PRE_SHARED", 0 }, + { IKE_AUTH_DSS, "DSS", 0 }, + { IKE_AUTH_RSA_SIG, "RSA_SIG", 0 }, + { IKE_AUTH_RSA_ENC, "RSA_ENC", 0 }, + { IKE_AUTH_RSA_ENC_REV, "RSA_ENC_REV", 0 }, + { 0, 0 } + }; + + + struct constant_map ike_group_desc_cst[] = { + { IKE_GROUP_DESC_MODP_768, "MODP_768", 0 }, + { IKE_GROUP_DESC_MODP_1024, "MODP_1024", 0 }, + { IKE_GROUP_DESC_EC2N_155, "EC2N_155", 0 }, + { IKE_GROUP_DESC_EC2N_185, "EC2N_185", 0 }, + { IKE_GROUP_DESC_MODP_1536, "MODP_1536", 0 }, + { 0, 0 } + }; + + + struct constant_map ike_group_cst[] = { + { IKE_GROUP_MODP, "MODP", 0 }, + { IKE_GROUP_ECP, "ECP", 0 }, + { IKE_GROUP_EC2N, "EC2N", 0 }, + { 0, 0 } + }; + + + struct constant_map ike_duration_cst[] = { + { IKE_DURATION_SECONDS, "SECONDS", 0 }, + { IKE_DURATION_KILOBYTES, "KILOBYTES", 0 }, + { 0, 0 } + }; + + + struct constant_map ike_prf_cst[] = { + { 0, 0 } + }; + + + struct constant_map ipsec_sit_cst[] = { + { IPSEC_SIT_IDENTITY_ONLY, "IDENTITY_ONLY", 0 }, + { IPSEC_SIT_SECRECY, "SECRECY", 0 }, + { IPSEC_SIT_INTEGRITY, "INTEGRITY", 0 }, + { 0, 0 } + }; + + + struct constant_map ipsec_proto_cst[] = { + { IPSEC_PROTO_IPSEC_AH, "IPSEC_AH", 0 }, + { IPSEC_PROTO_IPSEC_ESP, "IPSEC_ESP", 0 }, + { IPSEC_PROTO_IPCOMP, "IPCOMP", 0 }, + { 0, 0 } + }; + + + struct constant_map ipsec_transform_cst[] = { + { IPSEC_TRANSFORM_KEY_IKE, "KEY_IKE", 0 }, + { 0, 0 } + }; + + + struct constant_map ipsec_ah_cst[] = { + { IPSEC_AH_MD5, "MD5", 0 }, + { IPSEC_AH_SHA, "SHA", 0 }, + { IPSEC_AH_DES, "DES", 0 }, + { 0, 0 } + }; + + + struct constant_map ipsec_esp_cst[] = { + { IPSEC_ESP_DES_IV64, "DES_IV64", 0 }, + { IPSEC_ESP_DES, "DES", 0 }, + { IPSEC_ESP_3DES, "3DES", 0 }, + { IPSEC_ESP_RC5, "RC5", 0 }, + { IPSEC_ESP_IDEA, "IDEA", 0 }, + { IPSEC_ESP_CAST, "CAST", 0 }, + { IPSEC_ESP_BLOWFISH, "BLOWFISH", 0 }, + { IPSEC_ESP_3IDEA, "3IDEA", 0 }, + { IPSEC_ESP_DES_IV32, "DES_IV32", 0 }, + { IPSEC_ESP_RC4, "RC4", 0 }, + { IPSEC_ESP_NULL, "NULL", 0 }, + { 0, 0 } + }; + + + struct constant_map ipsec_ipcomp_cst[] = { + { IPSEC_IPCOMP_OUI, "OUI", 0 }, + { IPSEC_IPCOMP_DEFLATE, "DEFLATE", 0 }, + { IPSEC_IPCOMP_LZS, "LZS", 0 }, + { IPSEC_IPCOMP_V42BIS, "V42BIS", 0 }, + { 0, 0 } + }; + + + struct constant_map ipsec_notify_cst[] = { + { IPSEC_NOTIFY_RESPONDER_LIFETIME, "RESPONDER_LIFETIME", 0 }, + { IPSEC_NOTIFY_REPLAY_STATUS, "REPLAY_STATUS", 0 }, + { IPSEC_NOTIFY_INITIAL_CONTACT, "INITIAL_CONTACT", 0 }, + { 0, 0 } + }; + + + struct constant_map ike_exch_cst[] = { + { IKE_EXCH_QUICK_MODE, "QUICK_MODE", 0 }, + { IKE_EXCH_NEW_GROUP_MODE, "NEW_GROUP_MODE", 0 }, + { 0, 0 } + }; + diff -ruN ipsec_num.h ipsec_num.h *** ipsec_num.h Wed Dec 31 19:00:00 1969 --- ipsec_num.h Wed Dec 15 09:58:17 1999 *************** *** 0 **** --- 1,180 ---- + /* DO NOT EDIT-- this file is automatically generated. */ + + #ifndef _IPSEC_NUM_H_ + #define _IPSEC_NUM_H_ + + #include "sysdep.h" + + #include "constants.h" + + + + + + extern struct constant_map ipsec_doi_cst[]; + + #define IPSEC_DOI_IPSEC 1 + + extern struct constant_map ipsec_attr_cst[]; + + #define IPSEC_ATTR_SA_LIFE_TYPE 1 + #define IPSEC_ATTR_SA_LIFE_DURATION 2 + #define IPSEC_ATTR_GROUP_DESCRIPTION 3 + #define IPSEC_ATTR_ENCAPSULATION_MODE 4 + #define IPSEC_ATTR_AUTHENTICATION_ALGORITHM 5 + #define IPSEC_ATTR_KEY_LENGTH 6 + #define IPSEC_ATTR_KEY_ROUNDS 7 + #define IPSEC_ATTR_COMPRESS_DICTIONARY_SIZE 8 + #define IPSEC_ATTR_COMPRESS_PRIVATE_ALGORITHM 9 + + extern struct constant_map ipsec_duration_cst[]; + + #define IPSEC_DURATION_SECONDS 1 + #define IPSEC_DURATION_KILOBYTES 2 + + extern struct constant_map ipsec_encap_cst[]; + + #define IPSEC_ENCAP_TUNNEL 1 + #define IPSEC_ENCAP_TRANSPORT 2 + + extern struct constant_map ipsec_auth_cst[]; + + #define IPSEC_AUTH_HMAC_MD5 1 + #define IPSEC_AUTH_HMAC_SHA 2 + #define IPSEC_AUTH_DES_MAC 3 + #define IPSEC_AUTH_KPDK 4 + + extern struct constant_map ipsec_id_cst[]; + + #define IPSEC_ID_IPV4_ADDR 1 + #define IPSEC_ID_FQDN 2 + #define IPSEC_ID_USER_FQDN 3 + #define IPSEC_ID_IPV4_ADDR_SUBNET 4 + #define IPSEC_ID_IPV6_ADDR 5 + #define IPSEC_ID_IPV6_ADDR_SUBNET 6 + #define IPSEC_ID_IPV4_RANGE 7 + #define IPSEC_ID_IPV6_RANGE 8 + #define IPSEC_ID_DER_ASN1_DN 9 + #define IPSEC_ID_DER_ASN1_GN 10 + #define IPSEC_ID_KEY_ID 11 + + extern struct constant_map ike_attr_cst[]; + + #define IKE_ATTR_ENCRYPTION_ALGORITHM 1 + #define IKE_ATTR_HASH_ALGORITHM 2 + #define IKE_ATTR_AUTHENTICATION_METHOD 3 + #define IKE_ATTR_GROUP_DESCRIPTION 4 + #define IKE_ATTR_GROUP_TYPE 5 + #define IKE_ATTR_GROUP_PRIME 6 + #define IKE_ATTR_GROUP_GENERATOR_1 7 + #define IKE_ATTR_GROUP_GENERATOR_2 8 + #define IKE_ATTR_GROUP_CURVE_A 9 + #define IKE_ATTR_GROUP_CURVE_B 10 + #define IKE_ATTR_LIFE_TYPE 11 + #define IKE_ATTR_LIFE_DURATION 12 + #define IKE_ATTR_PRF 13 + #define IKE_ATTR_KEY_LENGTH 14 + #define IKE_ATTR_FIELD_SIZE 15 + #define IKE_ATTR_GROUP_ORDER 16 + + + extern struct constant_map ike_encrypt_cst[]; + + #define IKE_ENCRYPT_DES_CBC 1 + #define IKE_ENCRYPT_IDEA_CBC 2 + #define IKE_ENCRYPT_BLOWFISH_CBC 3 + #define IKE_ENCRYPT_RC5_R16_B64_CBC 4 + #define IKE_ENCRYPT_3DES_CBC 5 + #define IKE_ENCRYPT_CAST_CBC 6 + + extern struct constant_map ike_hash_cst[]; + + #define IKE_HASH_MD5 1 + #define IKE_HASH_SHA 2 + #define IKE_HASH_TIGER 3 + + extern struct constant_map ike_auth_cst[]; + + #define IKE_AUTH_PRE_SHARED 1 + #define IKE_AUTH_DSS 2 + #define IKE_AUTH_RSA_SIG 3 + #define IKE_AUTH_RSA_ENC 4 + #define IKE_AUTH_RSA_ENC_REV 5 + + extern struct constant_map ike_group_desc_cst[]; + + #define IKE_GROUP_DESC_MODP_768 1 + #define IKE_GROUP_DESC_MODP_1024 2 + #define IKE_GROUP_DESC_EC2N_155 3 + #define IKE_GROUP_DESC_EC2N_185 4 + #define IKE_GROUP_DESC_MODP_1536 5 + + extern struct constant_map ike_group_cst[]; + + #define IKE_GROUP_MODP 1 + #define IKE_GROUP_ECP 2 + #define IKE_GROUP_EC2N 3 + + extern struct constant_map ike_duration_cst[]; + + #define IKE_DURATION_SECONDS 1 + #define IKE_DURATION_KILOBYTES 2 + + extern struct constant_map ike_prf_cst[]; + + + extern struct constant_map ipsec_sit_cst[]; + + #define IPSEC_SIT_IDENTITY_ONLY 1 + #define IPSEC_SIT_SECRECY 2 + #define IPSEC_SIT_INTEGRITY 4 + + extern struct constant_map ipsec_proto_cst[]; + + #define IPSEC_PROTO_IPSEC_AH 2 + #define IPSEC_PROTO_IPSEC_ESP 3 + #define IPSEC_PROTO_IPCOMP 4 + + extern struct constant_map ipsec_transform_cst[]; + + #define IPSEC_TRANSFORM_KEY_IKE 1 + + extern struct constant_map ipsec_ah_cst[]; + + #define IPSEC_AH_MD5 2 + #define IPSEC_AH_SHA 3 + #define IPSEC_AH_DES 4 + + extern struct constant_map ipsec_esp_cst[]; + + #define IPSEC_ESP_DES_IV64 1 + #define IPSEC_ESP_DES 2 + #define IPSEC_ESP_3DES 3 + #define IPSEC_ESP_RC5 4 + #define IPSEC_ESP_IDEA 5 + #define IPSEC_ESP_CAST 6 + #define IPSEC_ESP_BLOWFISH 7 + #define IPSEC_ESP_3IDEA 8 + #define IPSEC_ESP_DES_IV32 9 + #define IPSEC_ESP_RC4 10 + #define IPSEC_ESP_NULL 11 + + extern struct constant_map ipsec_ipcomp_cst[]; + + #define IPSEC_IPCOMP_OUI 1 + #define IPSEC_IPCOMP_DEFLATE 2 + #define IPSEC_IPCOMP_LZS 3 + #define IPSEC_IPCOMP_V42BIS 4 + + extern struct constant_map ipsec_notify_cst[]; + + #define IPSEC_NOTIFY_RESPONDER_LIFETIME 24576 + #define IPSEC_NOTIFY_REPLAY_STATUS 24577 + #define IPSEC_NOTIFY_INITIAL_CONTACT 24578 + + extern struct constant_map ike_exch_cst[]; + + #define IKE_EXCH_QUICK_MODE 32 + #define IKE_EXCH_NEW_GROUP_MODE 33 + + #endif /* _IPSEC_NUM_H_ */ diff -ruN isakmp_fld.c isakmp_fld.c *** isakmp_fld.c Wed Dec 31 19:00:00 1969 --- isakmp_fld.c Wed Dec 15 09:58:19 1999 *************** *** 0 **** --- 1,154 ---- + /* DO NOT EDIT-- this file is automatically generated. */ + + #include "sysdep.h" + + #include "constants.h" + #include "field.h" + #include "isakmp_fld.h" + #include "isakmp_num.h" + #include "ipsec_num.h" + + + + + + struct field isakmp_hdr_fld[] = { + { "ICOOKIE", 0, 8, raw, 0 }, + { "RCOOKIE", 8, 8, raw, 0 }, + { "NEXT_PAYLOAD", 16, 1, cst, isakmp_hdr_next_payload_maps }, + { "VERSION", 17, 1, num, 0 }, + { "EXCH_TYPE", 18, 1, cst, isakmp_hdr_exch_type_maps }, + { "FLAGS", 19, 1, mask, isakmp_hdr_flags_maps }, + { "MESSAGE_ID", 20, 4, raw, 0 }, + { "LENGTH", 24, 4, num, 0 }, + { 0, 0, 0, 0, 0 } + }; + + struct constant_map *isakmp_hdr_exch_type_maps[] = { ike_exch_cst,isakmp_exch_cst,0 }; + struct constant_map *isakmp_hdr_flags_maps[] = { isakmp_flags_cst,0 }; + struct constant_map *isakmp_hdr_next_payload_maps[] = { isakmp_payload_cst,0 }; + + struct field isakmp_gen_fld[] = { + { "NEXT_PAYLOAD", 0, 1, cst, isakmp_gen_next_payload_maps }, + { "RESERVED", 1, 1, ign, 0 }, + { "LENGTH", 2, 2, num, 0 }, + { 0, 0, 0, 0, 0 } + }; + + struct constant_map *isakmp_gen_next_payload_maps[] = { isakmp_payload_cst,0 }; + + struct field isakmp_attr_fld[] = { + { "TYPE", 0, 2, num, isakmp_attr_type_maps }, + { "LENGTH_VALUE", 2, 2, num, 0 }, + { "VALUE", 4, 0, raw, 0 }, + { 0, 0, 0, 0, 0 } + }; + + struct constant_map *isakmp_attr_type_maps[] = { ike_attr_cst,ipsec_attr_cst,0 }; + + struct field isakmp_sa_fld[] = { + { "DOI", 4, 4, num, isakmp_sa_doi_maps }, + { "SIT", 8, 0, raw, 0 }, + { 0, 0, 0, 0, 0 } + }; + + struct constant_map *isakmp_sa_doi_maps[] = { isakmp_doi_cst,ipsec_doi_cst,0 }; + + struct field isakmp_prop_fld[] = { + { "NO", 4, 1, num, 0 }, + { "PROTO", 5, 1, cst, isakmp_prop_proto_maps }, + { "SPI_SZ", 6, 1, num, 0 }, + { "NTRANSFORMS", 7, 1, num, 0 }, + { "SPI", 8, 0, raw, 0 }, + { 0, 0, 0, 0, 0 } + }; + + struct constant_map *isakmp_prop_proto_maps[] = { isakmp_proto_cst,ipsec_proto_cst,0 }; + + struct field isakmp_transform_fld[] = { + { "NO", 4, 1, num, 0 }, + { "ID", 5, 1, num, 0 }, + { "RESERVED", 6, 2, ign, 0 }, + { "SA_ATTRS", 8, 0, raw, 0 }, + { 0, 0, 0, 0, 0 } + }; + + + struct field isakmp_ke_fld[] = { + { "DATA", 4, 0, raw, 0 }, + { 0, 0, 0, 0, 0 } + }; + + + struct field isakmp_id_fld[] = { + { "TYPE", 4, 1, num, 0 }, + { "DOI_DATA", 5, 3, raw, 0 }, + { "DATA", 8, 0, raw, 0 }, + { 0, 0, 0, 0, 0 } + }; + + + struct field isakmp_cert_fld[] = { + { "ENCODING", 4, 1, cst, isakmp_cert_encoding_maps }, + { "DATA", 5, 0, raw, 0 }, + { 0, 0, 0, 0, 0 } + }; + + struct constant_map *isakmp_cert_encoding_maps[] = { isakmp_certenc_cst,0 }; + + struct field isakmp_certreq_fld[] = { + { "TYPE", 4, 1, cst, isakmp_certreq_type_maps }, + { "AUTHORITY", 5, 0, raw, 0 }, + { 0, 0, 0, 0, 0 } + }; + + struct constant_map *isakmp_certreq_type_maps[] = { isakmp_certenc_cst,0 }; + + struct field isakmp_hash_fld[] = { + { "DATA", 4, 0, raw, 0 }, + { 0, 0, 0, 0, 0 } + }; + + + struct field isakmp_sig_fld[] = { + { "DATA", 4, 0, raw, 0 }, + { 0, 0, 0, 0, 0 } + }; + + + struct field isakmp_nonce_fld[] = { + { "DATA", 4, 0, raw, 0 }, + { 0, 0, 0, 0, 0 } + }; + + + struct field isakmp_notify_fld[] = { + { "DOI", 4, 4, cst, isakmp_notify_doi_maps }, + { "PROTO", 8, 1, cst, isakmp_notify_proto_maps }, + { "SPI_SZ", 9, 1, num, 0 }, + { "MSG_TYPE", 10, 2, cst, isakmp_notify_msg_type_maps }, + { "SPI", 12, 0, raw, 0 }, + { 0, 0, 0, 0, 0 } + }; + + struct constant_map *isakmp_notify_proto_maps[] = { isakmp_proto_cst,0 }; + struct constant_map *isakmp_notify_msg_type_maps[] = { isakmp_notify_cst,ipsec_notify_cst,0 }; + struct constant_map *isakmp_notify_doi_maps[] = { isakmp_doi_cst,ipsec_doi_cst,0 }; + + struct field isakmp_delete_fld[] = { + { "DOI", 4, 4, cst, isakmp_delete_doi_maps }, + { "PROTO", 8, 1, cst, isakmp_delete_proto_maps }, + { "SPI_SZ", 9, 1, num, 0 }, + { "NSPIS", 10, 2, num, 0 }, + { "SPI", 12, 0, raw, 0 }, + { 0, 0, 0, 0, 0 } + }; + + struct constant_map *isakmp_delete_proto_maps[] = { isakmp_proto_cst,0 }; + struct constant_map *isakmp_delete_doi_maps[] = { isakmp_doi_cst,ipsec_doi_cst,0 }; + + struct field isakmp_vendor_fld[] = { + { "ID", 4, 0, raw, 0 }, + { 0, 0, 0, 0, 0 } + }; + diff -ruN isakmp_fld.h isakmp_fld.h *** isakmp_fld.h Wed Dec 31 19:00:00 1969 --- isakmp_fld.h Wed Dec 15 09:58:18 1999 *************** *** 0 **** --- 1,268 ---- + /* DO NOT EDIT-- this file is automatically generated. */ + + #ifndef _ISAKMP_FLD_H_ + #define _ISAKMP_FLD_H_ + + #include "sysdep.h" + + #include "field.h" + + struct constant_map; + + + + + + extern struct field isakmp_hdr_fld[]; + + #define ISAKMP_HDR_ICOOKIE_OFF 0 + #define ISAKMP_HDR_ICOOKIE_LEN 8 + #define GET_ISAKMP_HDR_ICOOKIE(buf, val) field_get_raw (isakmp_hdr_fld + 0, buf, val) + #define SET_ISAKMP_HDR_ICOOKIE(buf, val) field_set_raw (isakmp_hdr_fld + 0, buf, val) + #define ISAKMP_HDR_RCOOKIE_OFF 8 + #define ISAKMP_HDR_RCOOKIE_LEN 8 + #define GET_ISAKMP_HDR_RCOOKIE(buf, val) field_get_raw (isakmp_hdr_fld + 1, buf, val) + #define SET_ISAKMP_HDR_RCOOKIE(buf, val) field_set_raw (isakmp_hdr_fld + 1, buf, val) + #define ISAKMP_HDR_NEXT_PAYLOAD_OFF 16 + #define ISAKMP_HDR_NEXT_PAYLOAD_LEN 1 + extern struct constant_map *isakmp_hdr_next_payload_maps[]; + #define GET_ISAKMP_HDR_NEXT_PAYLOAD(buf) field_get_num (isakmp_hdr_fld + 2, buf) + #define SET_ISAKMP_HDR_NEXT_PAYLOAD(buf, val) field_set_num (isakmp_hdr_fld + 2, buf, val) + #define ISAKMP_HDR_VERSION_OFF 17 + #define ISAKMP_HDR_VERSION_LEN 1 + #define GET_ISAKMP_HDR_VERSION(buf) field_get_num (isakmp_hdr_fld + 3, buf) + #define SET_ISAKMP_HDR_VERSION(buf, val) field_set_num (isakmp_hdr_fld + 3, buf, val) + #define ISAKMP_HDR_EXCH_TYPE_OFF 18 + #define ISAKMP_HDR_EXCH_TYPE_LEN 1 + extern struct constant_map *isakmp_hdr_exch_type_maps[]; + #define GET_ISAKMP_HDR_EXCH_TYPE(buf) field_get_num (isakmp_hdr_fld + 4, buf) + #define SET_ISAKMP_HDR_EXCH_TYPE(buf, val) field_set_num (isakmp_hdr_fld + 4, buf, val) + #define ISAKMP_HDR_FLAGS_OFF 19 + #define ISAKMP_HDR_FLAGS_LEN 1 + extern struct constant_map *isakmp_hdr_flags_maps[]; + #define GET_ISAKMP_HDR_FLAGS(buf) field_get_num (isakmp_hdr_fld + 5, buf) + #define SET_ISAKMP_HDR_FLAGS(buf, val) field_set_num (isakmp_hdr_fld + 5, buf, val) + #define ISAKMP_HDR_MESSAGE_ID_OFF 20 + #define ISAKMP_HDR_MESSAGE_ID_LEN 4 + #define GET_ISAKMP_HDR_MESSAGE_ID(buf, val) field_get_raw (isakmp_hdr_fld + 6, buf, val) + #define SET_ISAKMP_HDR_MESSAGE_ID(buf, val) field_set_raw (isakmp_hdr_fld + 6, buf, val) + #define ISAKMP_HDR_LENGTH_OFF 24 + #define ISAKMP_HDR_LENGTH_LEN 4 + #define GET_ISAKMP_HDR_LENGTH(buf) field_get_num (isakmp_hdr_fld + 7, buf) + #define SET_ISAKMP_HDR_LENGTH(buf, val) field_set_num (isakmp_hdr_fld + 7, buf, val) + #define ISAKMP_HDR_SZ 28 + + extern struct field isakmp_gen_fld[]; + + #define ISAKMP_GEN_NEXT_PAYLOAD_OFF 0 + #define ISAKMP_GEN_NEXT_PAYLOAD_LEN 1 + extern struct constant_map *isakmp_gen_next_payload_maps[]; + #define GET_ISAKMP_GEN_NEXT_PAYLOAD(buf) field_get_num (isakmp_gen_fld + 0, buf) + #define SET_ISAKMP_GEN_NEXT_PAYLOAD(buf, val) field_set_num (isakmp_gen_fld + 0, buf, val) + #define ISAKMP_GEN_RESERVED_OFF 1 + #define ISAKMP_GEN_RESERVED_LEN 1 + #define GET_ISAKMP_GEN_RESERVED(buf) field_get_num (isakmp_gen_fld + 1, buf) + #define SET_ISAKMP_GEN_RESERVED(buf, val) field_set_num (isakmp_gen_fld + 1, buf, val) + #define ISAKMP_GEN_LENGTH_OFF 2 + #define ISAKMP_GEN_LENGTH_LEN 2 + #define GET_ISAKMP_GEN_LENGTH(buf) field_get_num (isakmp_gen_fld + 2, buf) + #define SET_ISAKMP_GEN_LENGTH(buf, val) field_set_num (isakmp_gen_fld + 2, buf, val) + #define ISAKMP_GEN_SZ 4 + + extern struct field isakmp_attr_fld[]; + + #define ISAKMP_ATTR_TYPE_OFF 0 + #define ISAKMP_ATTR_TYPE_LEN 2 + extern struct constant_map *isakmp_attr_type_maps[]; + #define GET_ISAKMP_ATTR_TYPE(buf) field_get_num (isakmp_attr_fld + 0, buf) + #define SET_ISAKMP_ATTR_TYPE(buf, val) field_set_num (isakmp_attr_fld + 0, buf, val) + #define ISAKMP_ATTR_LENGTH_VALUE_OFF 2 + #define ISAKMP_ATTR_LENGTH_VALUE_LEN 2 + #define GET_ISAKMP_ATTR_LENGTH_VALUE(buf) field_get_num (isakmp_attr_fld + 1, buf) + #define SET_ISAKMP_ATTR_LENGTH_VALUE(buf, val) field_set_num (isakmp_attr_fld + 1, buf, val) + #define ISAKMP_ATTR_VALUE_OFF 4 + #define GET_ISAKMP_ATTR_VALUE(buf, val) field_get_raw (isakmp_attr_fld + 2, buf, val) + #define SET_ISAKMP_ATTR_VALUE(buf, val) field_set_raw (isakmp_attr_fld + 2, buf, val) + #define ISAKMP_ATTR_SZ 4 + + extern struct field isakmp_sa_fld[]; + + #define ISAKMP_SA_DOI_OFF 4 + #define ISAKMP_SA_DOI_LEN 4 + extern struct constant_map *isakmp_sa_doi_maps[]; + #define GET_ISAKMP_SA_DOI(buf) field_get_num (isakmp_sa_fld + 0, buf) + #define SET_ISAKMP_SA_DOI(buf, val) field_set_num (isakmp_sa_fld + 0, buf, val) + #define ISAKMP_SA_SIT_OFF 8 + #define GET_ISAKMP_SA_SIT(buf, val) field_get_raw (isakmp_sa_fld + 1, buf, val) + #define SET_ISAKMP_SA_SIT(buf, val) field_set_raw (isakmp_sa_fld + 1, buf, val) + #define ISAKMP_SA_SZ 8 + + extern struct field isakmp_prop_fld[]; + + #define ISAKMP_PROP_NO_OFF 4 + #define ISAKMP_PROP_NO_LEN 1 + #define GET_ISAKMP_PROP_NO(buf) field_get_num (isakmp_prop_fld + 0, buf) + #define SET_ISAKMP_PROP_NO(buf, val) field_set_num (isakmp_prop_fld + 0, buf, val) + #define ISAKMP_PROP_PROTO_OFF 5 + #define ISAKMP_PROP_PROTO_LEN 1 + extern struct constant_map *isakmp_prop_proto_maps[]; + #define GET_ISAKMP_PROP_PROTO(buf) field_get_num (isakmp_prop_fld + 1, buf) + #define SET_ISAKMP_PROP_PROTO(buf, val) field_set_num (isakmp_prop_fld + 1, buf, val) + #define ISAKMP_PROP_SPI_SZ_OFF 6 + #define ISAKMP_PROP_SPI_SZ_LEN 1 + #define GET_ISAKMP_PROP_SPI_SZ(buf) field_get_num (isakmp_prop_fld + 2, buf) + #define SET_ISAKMP_PROP_SPI_SZ(buf, val) field_set_num (isakmp_prop_fld + 2, buf, val) + #define ISAKMP_PROP_NTRANSFORMS_OFF 7 + #define ISAKMP_PROP_NTRANSFORMS_LEN 1 + #define GET_ISAKMP_PROP_NTRANSFORMS(buf) field_get_num (isakmp_prop_fld + 3, buf) + #define SET_ISAKMP_PROP_NTRANSFORMS(buf, val) field_set_num (isakmp_prop_fld + 3, buf, val) + #define ISAKMP_PROP_SPI_OFF 8 + #define GET_ISAKMP_PROP_SPI(buf, val) field_get_raw (isakmp_prop_fld + 4, buf, val) + #define SET_ISAKMP_PROP_SPI(buf, val) field_set_raw (isakmp_prop_fld + 4, buf, val) + #define ISAKMP_PROP_SZ 8 + + extern struct field isakmp_transform_fld[]; + + #define ISAKMP_TRANSFORM_NO_OFF 4 + #define ISAKMP_TRANSFORM_NO_LEN 1 + #define GET_ISAKMP_TRANSFORM_NO(buf) field_get_num (isakmp_transform_fld + 0, buf) + #define SET_ISAKMP_TRANSFORM_NO(buf, val) field_set_num (isakmp_transform_fld + 0, buf, val) + #define ISAKMP_TRANSFORM_ID_OFF 5 + #define ISAKMP_TRANSFORM_ID_LEN 1 + #define GET_ISAKMP_TRANSFORM_ID(buf) field_get_num (isakmp_transform_fld + 1, buf) + #define SET_ISAKMP_TRANSFORM_ID(buf, val) field_set_num (isakmp_transform_fld + 1, buf, val) + #define ISAKMP_TRANSFORM_RESERVED_OFF 6 + #define ISAKMP_TRANSFORM_RESERVED_LEN 2 + #define GET_ISAKMP_TRANSFORM_RESERVED(buf) field_get_num (isakmp_transform_fld + 2, buf) + #define SET_ISAKMP_TRANSFORM_RESERVED(buf, val) field_set_num (isakmp_transform_fld + 2, buf, val) + #define ISAKMP_TRANSFORM_SA_ATTRS_OFF 8 + #define GET_ISAKMP_TRANSFORM_SA_ATTRS(buf, val) field_get_raw (isakmp_transform_fld + 3, buf, val) + #define SET_ISAKMP_TRANSFORM_SA_ATTRS(buf, val) field_set_raw (isakmp_transform_fld + 3, buf, val) + #define ISAKMP_TRANSFORM_SZ 8 + + extern struct field isakmp_ke_fld[]; + + #define ISAKMP_KE_DATA_OFF 4 + #define GET_ISAKMP_KE_DATA(buf, val) field_get_raw (isakmp_ke_fld + 0, buf, val) + #define SET_ISAKMP_KE_DATA(buf, val) field_set_raw (isakmp_ke_fld + 0, buf, val) + #define ISAKMP_KE_SZ 4 + + extern struct field isakmp_id_fld[]; + + #define ISAKMP_ID_TYPE_OFF 4 + #define ISAKMP_ID_TYPE_LEN 1 + #define GET_ISAKMP_ID_TYPE(buf) field_get_num (isakmp_id_fld + 0, buf) + #define SET_ISAKMP_ID_TYPE(buf, val) field_set_num (isakmp_id_fld + 0, buf, val) + #define ISAKMP_ID_DOI_DATA_OFF 5 + #define ISAKMP_ID_DOI_DATA_LEN 3 + #define GET_ISAKMP_ID_DOI_DATA(buf, val) field_get_raw (isakmp_id_fld + 1, buf, val) + #define SET_ISAKMP_ID_DOI_DATA(buf, val) field_set_raw (isakmp_id_fld + 1, buf, val) + #define ISAKMP_ID_DATA_OFF 8 + #define GET_ISAKMP_ID_DATA(buf, val) field_get_raw (isakmp_id_fld + 2, buf, val) + #define SET_ISAKMP_ID_DATA(buf, val) field_set_raw (isakmp_id_fld + 2, buf, val) + #define ISAKMP_ID_SZ 8 + + extern struct field isakmp_cert_fld[]; + + #define ISAKMP_CERT_ENCODING_OFF 4 + #define ISAKMP_CERT_ENCODING_LEN 1 + extern struct constant_map *isakmp_cert_encoding_maps[]; + #define GET_ISAKMP_CERT_ENCODING(buf) field_get_num (isakmp_cert_fld + 0, buf) + #define SET_ISAKMP_CERT_ENCODING(buf, val) field_set_num (isakmp_cert_fld + 0, buf, val) + #define ISAKMP_CERT_DATA_OFF 5 + #define GET_ISAKMP_CERT_DATA(buf, val) field_get_raw (isakmp_cert_fld + 1, buf, val) + #define SET_ISAKMP_CERT_DATA(buf, val) field_set_raw (isakmp_cert_fld + 1, buf, val) + #define ISAKMP_CERT_SZ 5 + + extern struct field isakmp_certreq_fld[]; + + #define ISAKMP_CERTREQ_TYPE_OFF 4 + #define ISAKMP_CERTREQ_TYPE_LEN 1 + extern struct constant_map *isakmp_certreq_type_maps[]; + #define GET_ISAKMP_CERTREQ_TYPE(buf) field_get_num (isakmp_certreq_fld + 0, buf) + #define SET_ISAKMP_CERTREQ_TYPE(buf, val) field_set_num (isakmp_certreq_fld + 0, buf, val) + #define ISAKMP_CERTREQ_AUTHORITY_OFF 5 + #define GET_ISAKMP_CERTREQ_AUTHORITY(buf, val) field_get_raw (isakmp_certreq_fld + 1, buf, val) + #define SET_ISAKMP_CERTREQ_AUTHORITY(buf, val) field_set_raw (isakmp_certreq_fld + 1, buf, val) + #define ISAKMP_CERTREQ_SZ 5 + + extern struct field isakmp_hash_fld[]; + + #define ISAKMP_HASH_DATA_OFF 4 + #define GET_ISAKMP_HASH_DATA(buf, val) field_get_raw (isakmp_hash_fld + 0, buf, val) + #define SET_ISAKMP_HASH_DATA(buf, val) field_set_raw (isakmp_hash_fld + 0, buf, val) + #define ISAKMP_HASH_SZ 4 + + extern struct field isakmp_sig_fld[]; + + #define ISAKMP_SIG_DATA_OFF 4 + #define GET_ISAKMP_SIG_DATA(buf, val) field_get_raw (isakmp_sig_fld + 0, buf, val) + #define SET_ISAKMP_SIG_DATA(buf, val) field_set_raw (isakmp_sig_fld + 0, buf, val) + #define ISAKMP_SIG_SZ 4 + + extern struct field isakmp_nonce_fld[]; + + #define ISAKMP_NONCE_DATA_OFF 4 + #define GET_ISAKMP_NONCE_DATA(buf, val) field_get_raw (isakmp_nonce_fld + 0, buf, val) + #define SET_ISAKMP_NONCE_DATA(buf, val) field_set_raw (isakmp_nonce_fld + 0, buf, val) + #define ISAKMP_NONCE_SZ 4 + + extern struct field isakmp_notify_fld[]; + + #define ISAKMP_NOTIFY_DOI_OFF 4 + #define ISAKMP_NOTIFY_DOI_LEN 4 + extern struct constant_map *isakmp_notify_doi_maps[]; + #define GET_ISAKMP_NOTIFY_DOI(buf) field_get_num (isakmp_notify_fld + 0, buf) + #define SET_ISAKMP_NOTIFY_DOI(buf, val) field_set_num (isakmp_notify_fld + 0, buf, val) + #define ISAKMP_NOTIFY_PROTO_OFF 8 + #define ISAKMP_NOTIFY_PROTO_LEN 1 + extern struct constant_map *isakmp_notify_proto_maps[]; + #define GET_ISAKMP_NOTIFY_PROTO(buf) field_get_num (isakmp_notify_fld + 1, buf) + #define SET_ISAKMP_NOTIFY_PROTO(buf, val) field_set_num (isakmp_notify_fld + 1, buf, val) + #define ISAKMP_NOTIFY_SPI_SZ_OFF 9 + #define ISAKMP_NOTIFY_SPI_SZ_LEN 1 + #define GET_ISAKMP_NOTIFY_SPI_SZ(buf) field_get_num (isakmp_notify_fld + 2, buf) + #define SET_ISAKMP_NOTIFY_SPI_SZ(buf, val) field_set_num (isakmp_notify_fld + 2, buf, val) + #define ISAKMP_NOTIFY_MSG_TYPE_OFF 10 + #define ISAKMP_NOTIFY_MSG_TYPE_LEN 2 + extern struct constant_map *isakmp_notify_msg_type_maps[]; + #define GET_ISAKMP_NOTIFY_MSG_TYPE(buf) field_get_num (isakmp_notify_fld + 3, buf) + #define SET_ISAKMP_NOTIFY_MSG_TYPE(buf, val) field_set_num (isakmp_notify_fld + 3, buf, val) + #define ISAKMP_NOTIFY_SPI_OFF 12 + #define GET_ISAKMP_NOTIFY_SPI(buf, val) field_get_raw (isakmp_notify_fld + 4, buf, val) + #define SET_ISAKMP_NOTIFY_SPI(buf, val) field_set_raw (isakmp_notify_fld + 4, buf, val) + #define ISAKMP_NOTIFY_SZ 12 + + extern struct field isakmp_delete_fld[]; + + #define ISAKMP_DELETE_DOI_OFF 4 + #define ISAKMP_DELETE_DOI_LEN 4 + extern struct constant_map *isakmp_delete_doi_maps[]; + #define GET_ISAKMP_DELETE_DOI(buf) field_get_num (isakmp_delete_fld + 0, buf) + #define SET_ISAKMP_DELETE_DOI(buf, val) field_set_num (isakmp_delete_fld + 0, buf, val) + #define ISAKMP_DELETE_PROTO_OFF 8 + #define ISAKMP_DELETE_PROTO_LEN 1 + extern struct constant_map *isakmp_delete_proto_maps[]; + #define GET_ISAKMP_DELETE_PROTO(buf) field_get_num (isakmp_delete_fld + 1, buf) + #define SET_ISAKMP_DELETE_PROTO(buf, val) field_set_num (isakmp_delete_fld + 1, buf, val) + #define ISAKMP_DELETE_SPI_SZ_OFF 9 + #define ISAKMP_DELETE_SPI_SZ_LEN 1 + #define GET_ISAKMP_DELETE_SPI_SZ(buf) field_get_num (isakmp_delete_fld + 2, buf) + #define SET_ISAKMP_DELETE_SPI_SZ(buf, val) field_set_num (isakmp_delete_fld + 2, buf, val) + #define ISAKMP_DELETE_NSPIS_OFF 10 + #define ISAKMP_DELETE_NSPIS_LEN 2 + #define GET_ISAKMP_DELETE_NSPIS(buf) field_get_num (isakmp_delete_fld + 3, buf) + #define SET_ISAKMP_DELETE_NSPIS(buf, val) field_set_num (isakmp_delete_fld + 3, buf, val) + #define ISAKMP_DELETE_SPI_OFF 12 + #define GET_ISAKMP_DELETE_SPI(buf, val) field_get_raw (isakmp_delete_fld + 4, buf, val) + #define SET_ISAKMP_DELETE_SPI(buf, val) field_set_raw (isakmp_delete_fld + 4, buf, val) + #define ISAKMP_DELETE_SZ 12 + + extern struct field isakmp_vendor_fld[]; + + #define ISAKMP_VENDOR_ID_OFF 4 + #define GET_ISAKMP_VENDOR_ID(buf, val) field_get_raw (isakmp_vendor_fld + 0, buf, val) + #define SET_ISAKMP_VENDOR_ID(buf, val) field_set_raw (isakmp_vendor_fld + 0, buf, val) + #define ISAKMP_VENDOR_SZ 4 + + #endif /* _ISAKMP_FLD_H_ */ diff -ruN isakmp_num.c isakmp_num.c *** isakmp_num.c Wed Dec 31 19:00:00 1969 --- isakmp_num.c Wed Dec 15 09:58:19 1999 *************** *** 0 **** --- 1,134 ---- + /* DO NOT EDIT-- this file is automatically generated. */ + + #include "sysdep.h" + + #include "constants.h" + #include "isakmp_num.h" + + + + + + struct constant_map isakmp_payload_cst[] = { + { ISAKMP_PAYLOAD_NONE, "NONE", 0 }, + { ISAKMP_PAYLOAD_SA, "SA", 0 }, + { ISAKMP_PAYLOAD_PROPOSAL, "PROPOSAL", 0 }, + { ISAKMP_PAYLOAD_TRANSFORM, "TRANSFORM", 0 }, + { ISAKMP_PAYLOAD_KEY_EXCH, "KEY_EXCH", 0 }, + { ISAKMP_PAYLOAD_ID, "ID", 0 }, + { ISAKMP_PAYLOAD_CERT, "CERT", 0 }, + { ISAKMP_PAYLOAD_CERT_REQ, "CERT_REQ", 0 }, + { ISAKMP_PAYLOAD_HASH, "HASH", 0 }, + { ISAKMP_PAYLOAD_SIG, "SIG", 0 }, + { ISAKMP_PAYLOAD_NONCE, "NONCE", 0 }, + { ISAKMP_PAYLOAD_NOTIFY, "NOTIFY", 0 }, + { ISAKMP_PAYLOAD_DELETE, "DELETE", 0 }, + { ISAKMP_PAYLOAD_VENDOR, "VENDOR", 0 }, + { ISAKMP_PAYLOAD_RESERVED_MIN, "RESERVED_MIN", 0 }, + { ISAKMP_PAYLOAD_RESERVED_MAX, "RESERVED_MAX", 0 }, + { ISAKMP_PAYLOAD_PRIVATE_MIN, "PRIVATE_MIN", 0 }, + { ISAKMP_PAYLOAD_PRIVATE_MAX, "PRIVATE_MAX", 0 }, + { 0, 0 } + }; + + + struct constant_map isakmp_exch_cst[] = { + { ISAKMP_EXCH_NONE, "NONE", 0 }, + { ISAKMP_EXCH_BASE, "BASE", 0 }, + { ISAKMP_EXCH_ID_PROT, "ID_PROT", 0 }, + { ISAKMP_EXCH_AUTH_ONLY, "AUTH_ONLY", 0 }, + { ISAKMP_EXCH_AGGRESSIVE, "AGGRESSIVE", 0 }, + { ISAKMP_EXCH_INFO, "INFO", 0 }, + { ISAKMP_EXCH_FUTURE_MIN, "FUTURE_MIN", 0 }, + { ISAKMP_EXCH_FUTURE_MAX, "FUTURE_MAX", 0 }, + { ISAKMP_EXCH_DOI_MIN, "DOI_MIN", 0 }, + { ISAKMP_EXCH_DOI_MAX, "DOI_MAX", 0 }, + { 0, 0 } + }; + + + struct constant_map isakmp_flags_cst[] = { + { ISAKMP_FLAGS_ENC, "ENC", 0 }, + { ISAKMP_FLAGS_COMMIT, "COMMIT", 0 }, + { ISAKMP_FLAGS_AUTH_ONLY, "AUTH_ONLY", 0 }, + { 0, 0 } + }; + + + struct constant_map isakmp_certenc_cst[] = { + { ISAKMP_CERTENC_NONE, "NONE", 0 }, + { ISAKMP_CERTENC_PKCS, "PKCS", 0 }, + { ISAKMP_CERTENC_PGP, "PGP", 0 }, + { ISAKMP_CERTENC_DNS, "DNS", 0 }, + { ISAKMP_CERTENC_X509_SIG, "X509_SIG", 0 }, + { ISAKMP_CERTENC_X509_KE, "X509_KE", 0 }, + { ISAKMP_CERTENC_KERBEROS, "KERBEROS", 0 }, + { ISAKMP_CERTENC_CRL, "CRL", 0 }, + { ISAKMP_CERTENC_ARL, "ARL", 0 }, + { ISAKMP_CERTENC_SPKI, "SPKI", 0 }, + { ISAKMP_CERTENC_X509_ATTR, "X509_ATTR", 0 }, + { ISAKMP_CERTENC_RESERVED_MIN, "RESERVED_MIN", 0 }, + { ISAKMP_CERTENC_RESERVED_MAX, "RESERVED_MAX", 0 }, + { 0, 0 } + }; + + + struct constant_map isakmp_notify_cst[] = { + { ISAKMP_NOTIFY_INVALID_PAYLOAD_TYPE, "INVALID_PAYLOAD_TYPE", 0 }, + { ISAKMP_NOTIFY_DOI_NOT_SUPPORTED, "DOI_NOT_SUPPORTED", 0 }, + { ISAKMP_NOTIFY_SITUATION_NOT_SUPPORTED, "SITUATION_NOT_SUPPORTED", 0 }, + { ISAKMP_NOTIFY_INVALID_COOKIE, "INVALID_COOKIE", 0 }, + { ISAKMP_NOTIFY_INVALID_MAJOR_VERSION, "INVALID_MAJOR_VERSION", 0 }, + { ISAKMP_NOTIFY_INVALID_MINOR_VERSION, "INVALID_MINOR_VERSION", 0 }, + { ISAKMP_NOTIFY_INVALID_EXCHANGE_TYPE, "INVALID_EXCHANGE_TYPE", 0 }, + { ISAKMP_NOTIFY_INVALID_FLAGS, "INVALID_FLAGS", 0 }, + { ISAKMP_NOTIFY_INVALID_MESSAGE_ID, "INVALID_MESSAGE_ID", 0 }, + { ISAKMP_NOTIFY_INVALID_PROTOCOL_ID, "INVALID_PROTOCOL_ID", 0 }, + { ISAKMP_NOTIFY_INVALID_SPI, "INVALID_SPI", 0 }, + { ISAKMP_NOTIFY_INVALID_TRANSFORM_ID, "INVALID_TRANSFORM_ID", 0 }, + { ISAKMP_NOTIFY_ATTRIBUTES_NOT_SUPPORTED, "ATTRIBUTES_NOT_SUPPORTED", 0 }, + { ISAKMP_NOTIFY_NO_PROPOSAL_CHOSEN, "NO_PROPOSAL_CHOSEN", 0 }, + { ISAKMP_NOTIFY_BAD_PROPOSAL_SYNTAX, "BAD_PROPOSAL_SYNTAX", 0 }, + { ISAKMP_NOTIFY_PAYLOAD_MALFORMED, "PAYLOAD_MALFORMED", 0 }, + { ISAKMP_NOTIFY_INVALID_KEY_INFORMATION, "INVALID_KEY_INFORMATION", 0 }, + { ISAKMP_NOTIFY_INVALID_ID_INFORMATION, "INVALID_ID_INFORMATION", 0 }, + { ISAKMP_NOTIFY_INVALID_CERT_ENCODING, "INVALID_CERT_ENCODING", 0 }, + { ISAKMP_NOTIFY_INVALID_CERTIFICATE, "INVALID_CERTIFICATE", 0 }, + { ISAKMP_NOTIFY_CERT_TYPE_UNSUPPORTED, "CERT_TYPE_UNSUPPORTED", 0 }, + { ISAKMP_NOTIFY_INVALID_CERT_AUTHORITY, "INVALID_CERT_AUTHORITY", 0 }, + { ISAKMP_NOTIFY_INVALID_HASH_INFORMATION, "INVALID_HASH_INFORMATION", 0 }, + { ISAKMP_NOTIFY_AUTHENTICATION_FAILED, "AUTHENTICATION_FAILED", 0 }, + { ISAKMP_NOTIFY_INVALID_SIGNATURE, "INVALID_SIGNATURE", 0 }, + { ISAKMP_NOTIFY_ADDRESS_NOTIFICATION, "ADDRESS_NOTIFICATION", 0 }, + { ISAKMP_NOTIFY_NOTIFY_SA_LIFETIME, "NOTIFY_SA_LIFETIME", 0 }, + { ISAKMP_NOTIFY_CERTIFICATE_UNAVAILABLE, "CERTIFICATE_UNAVAILABLE", 0 }, + { ISAKMP_NOTIFY_UNSUPPORTED_EXCHANGE_TYPE, "UNSUPPORTED_EXCHANGE_TYPE", 0 }, + { ISAKMP_NOTIFY_UNEQUAL_PAYLOAD_LENGTHS, "UNEQUAL_PAYLOAD_LENGTHS", 0 }, + { ISAKMP_NOTIFY_RESERVED_MIN, "RESERVED_MIN", 0 }, + { ISAKMP_NOTIFY_RESERVED_MAX, "RESERVED_MAX", 0 }, + { ISAKMP_NOTIFY_PRIVATE_MIN, "PRIVATE_MIN", 0 }, + { ISAKMP_NOTIFY_PRIVATE_MAX, "PRIVATE_MAX", 0 }, + { ISAKMP_NOTIFY_STATUS_CONNECTED, "STATUS_CONNECTED", 0 }, + { ISAKMP_NOTIFY_STATUS_RESERVED1_MIN, "STATUS_RESERVED1_MIN", 0 }, + { ISAKMP_NOTIFY_STATUS_RESERVED1_MAX, "STATUS_RESERVED1_MAX", 0 }, + { ISAKMP_NOTIFY_STATUS_DOI_MIN, "STATUS_DOI_MIN", 0 }, + { ISAKMP_NOTIFY_STATUS_DOI_MAX, "STATUS_DOI_MAX", 0 }, + { ISAKMP_NOTIFY_STATUS_PRIVATE_MIN, "STATUS_PRIVATE_MIN", 0 }, + { ISAKMP_NOTIFY_STATUS_PRIVATE_MAX, "STATUS_PRIVATE_MAX", 0 }, + { ISAKMP_NOTIFY_STATUS_RESERVED2_MIN, "STATUS_RESERVED2_MIN", 0 }, + { ISAKMP_NOTIFY_STATUS_RESERVED2_MAX, "STATUS_RESERVED2_MAX", 0 }, + { 0, 0 } + }; + + + struct constant_map isakmp_doi_cst[] = { + { ISAKMP_DOI_ISAKMP, "ISAKMP", 0 }, + { 0, 0 } + }; + + + struct constant_map isakmp_proto_cst[] = { + { ISAKMP_PROTO_ISAKMP, "ISAKMP", 0 }, + { 0, 0 } + }; + diff -ruN isakmp_num.h isakmp_num.h *** isakmp_num.h Wed Dec 31 19:00:00 1969 --- isakmp_num.h Wed Dec 15 09:58:19 1999 *************** *** 0 **** --- 1,124 ---- + /* DO NOT EDIT-- this file is automatically generated. */ + + #ifndef _ISAKMP_NUM_H_ + #define _ISAKMP_NUM_H_ + + #include "sysdep.h" + + #include "constants.h" + + + + + + extern struct constant_map isakmp_payload_cst[]; + + #define ISAKMP_PAYLOAD_NONE 0 + #define ISAKMP_PAYLOAD_SA 1 + #define ISAKMP_PAYLOAD_PROPOSAL 2 + #define ISAKMP_PAYLOAD_TRANSFORM 3 + #define ISAKMP_PAYLOAD_KEY_EXCH 4 + #define ISAKMP_PAYLOAD_ID 5 + #define ISAKMP_PAYLOAD_CERT 6 + #define ISAKMP_PAYLOAD_CERT_REQ 7 + #define ISAKMP_PAYLOAD_HASH 8 + #define ISAKMP_PAYLOAD_SIG 9 + #define ISAKMP_PAYLOAD_NONCE 10 + #define ISAKMP_PAYLOAD_NOTIFY 11 + #define ISAKMP_PAYLOAD_DELETE 12 + #define ISAKMP_PAYLOAD_VENDOR 13 + #define ISAKMP_PAYLOAD_RESERVED_MIN 14 + #define ISAKMP_PAYLOAD_RESERVED_MAX 127 + #define ISAKMP_PAYLOAD_PRIVATE_MIN 128 + #define ISAKMP_PAYLOAD_PRIVATE_MAX 255 + + extern struct constant_map isakmp_exch_cst[]; + + #define ISAKMP_EXCH_NONE 0 + #define ISAKMP_EXCH_BASE 1 + #define ISAKMP_EXCH_ID_PROT 2 + #define ISAKMP_EXCH_AUTH_ONLY 3 + #define ISAKMP_EXCH_AGGRESSIVE 4 + #define ISAKMP_EXCH_INFO 5 + #define ISAKMP_EXCH_FUTURE_MIN 6 + #define ISAKMP_EXCH_FUTURE_MAX 31 + #define ISAKMP_EXCH_DOI_MIN 32 + #define ISAKMP_EXCH_DOI_MAX 255 + + extern struct constant_map isakmp_flags_cst[]; + + #define ISAKMP_FLAGS_ENC 1 + #define ISAKMP_FLAGS_COMMIT 2 + #define ISAKMP_FLAGS_AUTH_ONLY 4 + + extern struct constant_map isakmp_certenc_cst[]; + + #define ISAKMP_CERTENC_NONE 0 + #define ISAKMP_CERTENC_PKCS 1 + #define ISAKMP_CERTENC_PGP 2 + #define ISAKMP_CERTENC_DNS 3 + #define ISAKMP_CERTENC_X509_SIG 4 + #define ISAKMP_CERTENC_X509_KE 5 + #define ISAKMP_CERTENC_KERBEROS 6 + #define ISAKMP_CERTENC_CRL 7 + #define ISAKMP_CERTENC_ARL 8 + #define ISAKMP_CERTENC_SPKI 9 + #define ISAKMP_CERTENC_X509_ATTR 10 + #define ISAKMP_CERTENC_RESERVED_MIN 11 + #define ISAKMP_CERTENC_RESERVED_MAX 255 + + extern struct constant_map isakmp_notify_cst[]; + + #define ISAKMP_NOTIFY_INVALID_PAYLOAD_TYPE 1 + #define ISAKMP_NOTIFY_DOI_NOT_SUPPORTED 2 + #define ISAKMP_NOTIFY_SITUATION_NOT_SUPPORTED 3 + #define ISAKMP_NOTIFY_INVALID_COOKIE 4 + #define ISAKMP_NOTIFY_INVALID_MAJOR_VERSION 5 + #define ISAKMP_NOTIFY_INVALID_MINOR_VERSION 6 + #define ISAKMP_NOTIFY_INVALID_EXCHANGE_TYPE 7 + #define ISAKMP_NOTIFY_INVALID_FLAGS 8 + #define ISAKMP_NOTIFY_INVALID_MESSAGE_ID 9 + #define ISAKMP_NOTIFY_INVALID_PROTOCOL_ID 10 + #define ISAKMP_NOTIFY_INVALID_SPI 11 + #define ISAKMP_NOTIFY_INVALID_TRANSFORM_ID 12 + #define ISAKMP_NOTIFY_ATTRIBUTES_NOT_SUPPORTED 13 + #define ISAKMP_NOTIFY_NO_PROPOSAL_CHOSEN 14 + #define ISAKMP_NOTIFY_BAD_PROPOSAL_SYNTAX 15 + #define ISAKMP_NOTIFY_PAYLOAD_MALFORMED 16 + #define ISAKMP_NOTIFY_INVALID_KEY_INFORMATION 17 + #define ISAKMP_NOTIFY_INVALID_ID_INFORMATION 18 + #define ISAKMP_NOTIFY_INVALID_CERT_ENCODING 19 + #define ISAKMP_NOTIFY_INVALID_CERTIFICATE 20 + #define ISAKMP_NOTIFY_CERT_TYPE_UNSUPPORTED 21 + #define ISAKMP_NOTIFY_INVALID_CERT_AUTHORITY 22 + #define ISAKMP_NOTIFY_INVALID_HASH_INFORMATION 23 + #define ISAKMP_NOTIFY_AUTHENTICATION_FAILED 24 + #define ISAKMP_NOTIFY_INVALID_SIGNATURE 25 + #define ISAKMP_NOTIFY_ADDRESS_NOTIFICATION 26 + #define ISAKMP_NOTIFY_NOTIFY_SA_LIFETIME 27 + #define ISAKMP_NOTIFY_CERTIFICATE_UNAVAILABLE 28 + #define ISAKMP_NOTIFY_UNSUPPORTED_EXCHANGE_TYPE 29 + #define ISAKMP_NOTIFY_UNEQUAL_PAYLOAD_LENGTHS 30 + #define ISAKMP_NOTIFY_RESERVED_MIN 31 + #define ISAKMP_NOTIFY_RESERVED_MAX 8191 + #define ISAKMP_NOTIFY_PRIVATE_MIN 8192 + #define ISAKMP_NOTIFY_PRIVATE_MAX 16383 + #define ISAKMP_NOTIFY_STATUS_CONNECTED 16384 + #define ISAKMP_NOTIFY_STATUS_RESERVED1_MIN 16385 + #define ISAKMP_NOTIFY_STATUS_RESERVED1_MAX 24575 + #define ISAKMP_NOTIFY_STATUS_DOI_MIN 12576 + #define ISAKMP_NOTIFY_STATUS_DOI_MAX 32767 + #define ISAKMP_NOTIFY_STATUS_PRIVATE_MIN 32768 + #define ISAKMP_NOTIFY_STATUS_PRIVATE_MAX 40959 + #define ISAKMP_NOTIFY_STATUS_RESERVED2_MIN 40960 + #define ISAKMP_NOTIFY_STATUS_RESERVED2_MAX 65535 + + extern struct constant_map isakmp_doi_cst[]; + + #define ISAKMP_DOI_ISAKMP 0 + + extern struct constant_map isakmp_proto_cst[]; + + #define ISAKMP_PROTO_ISAKMP 1 + + #endif /* _ISAKMP_NUM_H_ */ diff -ruN missing missing *** missing Wed Dec 31 19:00:00 1969 --- missing Fri Feb 12 23:07:50 1999 *************** *** 0 **** --- 1,190 ---- + #! /bin/sh + # Common stub for a few missing GNU programs while installing. + # Copyright (C) 1996, 1997 Free Software Foundation, Inc. + # Franc,ois Pinard , 1996. + + # 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. + + if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + fi + + case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ + $0 [OPTION]... PROGRAM [ARGUMENT]... + + Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an + error status if there is no known handling for PROGRAM. + + Options: + -h, --help display this help and exit + -v, --version output version information and exit + + Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing - GNU libit 0.0" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal) + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`configure.in'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified \`configure.in'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`configure.in'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake) + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + bison|yacc) + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + makeinfo) + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + *) + echo 1>&2 "\ + WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequirements for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; + esac + + exit 0 diff -ruN mkinstalldirs mkinstalldirs *** mkinstalldirs Wed Dec 31 19:00:00 1969 --- mkinstalldirs Fri Feb 12 23:07:50 1999 *************** *** 0 **** --- 1,40 ---- + #! /bin/sh + # mkinstalldirs --- make directory hierarchy + # Author: Noah Friedman + # Created: 1993-05-16 + # Public domain + + # $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ + + errstatus=0 + + for file + do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done + done + + exit $errstatus + + # mkinstalldirs ends here diff -ruN pf_key_v2.c pf_key_v2.c *** pf_key_v2.c Tue Aug 31 07:47:22 1999 --- pf_key_v2.c Thu Nov 4 12:24:27 1999 *************** *** 33,44 **** --- 33,48 ---- * This code was written under funding by Ericsson Radio Systems. */ + #ifdef HAVE_CONFIG_H + #include + #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include + #include #include #include #include *************** *** 49,54 **** --- 53,59 ---- #include "sysdep.h" #include "conf.h" + #include "connection.h" #include "exchange.h" #include "ipsec.h" #include "ipsec_num.h" *************** *** 57,62 **** --- 62,68 ---- #include "sa.h" #include "timer.h" #include "transport.h" + #include "if.h" /* * PF_KEY v2 always work with 64-bit entities and aligns on 64-bit boundaries. *************** *** 68,73 **** --- 74,86 ---- /* How many microseconds we will wait for a reply from the PF_KEY socket. */ #define PF_KEY_REPLY_TIMEOUT 1000 + #ifndef SADB_AALG_MD5HMAC96 + #define SADB_AALG_MD5HMAC96 SADB_AALG_MD5HMAC + #endif /* !SADB_AALG_MD5HMAC96 */ + #ifndef SADB_AALG_SHA1HMAC96 + #define SADB_AALG_SHA1HMAC96 SADB_AALG_SHA1HMAC + #endif /* !SADB_AALG_SHA1HMAC96 */ + struct pf_key_v2_node { TAILQ_ENTRY (pf_key_v2_node) link; void *seg; *************** *** 86,92 **** static struct pf_key_v2_node *pf_key_v2_find_ext (struct pf_key_v2_msg *, u_int16_t); static void pf_key_v2_notify (struct pf_key_v2_msg *); ! static struct pf_key_v2_msg *pf_key_v2_read (u_int32_t); static u_int32_t pf_key_v2_seq (void); static u_int32_t pf_key_v2_write (struct pf_key_v2_msg *); --- 99,105 ---- static struct pf_key_v2_node *pf_key_v2_find_ext (struct pf_key_v2_msg *, u_int16_t); static void pf_key_v2_notify (struct pf_key_v2_msg *); ! static struct pf_key_v2_msg *pf_key_v2_read (int, u_int32_t, u_int32_t); static u_int32_t pf_key_v2_seq (void); static u_int32_t pf_key_v2_write (struct pf_key_v2_msg *); *************** *** 169,175 **** * messages up untile both the PID and the sequence number match. */ static struct pf_key_v2_msg * ! pf_key_v2_read (u_int32_t seq) { ssize_t n; u_int8_t *buf = 0; --- 182,188 ---- * messages up untile both the PID and the sequence number match. */ static struct pf_key_v2_msg * ! pf_key_v2_read (int specific, u_int32_t specific_pid, u_int32_t specific_seq) { ssize_t n; u_int8_t *buf = 0; *************** *** 188,194 **** * Currently we do this by setting a short timeout, and if it is not * readable in that time, we fail the read. */ ! if (seq) { fds = calloc (howmany (pf_key_v2_socket + 1, NFDBITS), sizeof (fd_mask)); --- 201,207 ---- * Currently we do this by setting a short timeout, and if it is not * readable in that time, we fail the read. */ ! if (specific) { fds = calloc (howmany (pf_key_v2_socket + 1, NFDBITS), sizeof (fd_mask)); *************** *** 259,268 **** /* We drop all messages that is not what we expect. */ msg = (struct sadb_msg *)buf; ! if (msg->sadb_msg_version != PF_KEY_V2 ! || (msg->sadb_msg_pid != 0 && msg->sadb_msg_pid != getpid ())) { ! if (seq) { free (buf); buf = 0; --- 272,304 ---- /* We drop all messages that is not what we expect. */ msg = (struct sadb_msg *)buf; ! if (msg->sadb_msg_version == PF_KEY_V2 ! && (!specific || msg->sadb_msg_pid != specific_pid || msg->sadb_msg_seq != specific_seq)) ! { ! switch(msg->sadb_msg_type) ! { ! case SADB_RESERVED: ! /* poison msg->sadb_msg_version. */ ! msg->sadb_msg_version = ~PF_KEY_V2; ! break; ! ! /* we do care about these messages. */ ! case SADB_DELETE: ! case SADB_EXPIRE: ! case SADB_FLUSH: ! case SADB_ACQUIRE: ! break; ! ! /* we don't care about all other messages. */ ! default: ! free (buf); ! buf = 0; ! continue; ! } ! } ! if (msg->sadb_msg_version != PF_KEY_V2) { ! if (specific) { free (buf); buf = 0; *************** *** 291,297 **** pf_key_v2_msg_add (ret, ext, 0); /* If the message is not the one we are waiting for, queue it up. */ ! if (seq && (msg->sadb_msg_pid != getpid () || msg->sadb_msg_seq != seq)) { gettimeofday (&tv, 0); timer_add_event ("pf_key_v2_notify", --- 327,333 ---- pf_key_v2_msg_add (ret, ext, 0); /* If the message is not the one we are waiting for, queue it up. */ ! if (specific && (msg->sadb_msg_pid != specific_pid || msg->sadb_msg_seq != specific_seq)) { gettimeofday (&tv, 0); timer_add_event ("pf_key_v2_notify", *************** *** 333,341 **** msg->sadb_msg_version = PF_KEY_V2; msg->sadb_msg_errno = 0; msg->sadb_msg_reserved = 0; - msg->sadb_msg_pid = getpid (); - if (!msg->sadb_msg_seq) - msg->sadb_msg_seq = pf_key_v2_seq (); /* Compute the iovec segments as well as the message length. */ len = 0; --- 369,374 ---- *************** *** 375,381 **** goto cleanup; } free (iov); ! return msg->sadb_msg_seq; cleanup: if (iov) --- 408,414 ---- goto cleanup; } free (iov); ! return 1; cleanup: if (iov) *************** *** 388,401 **** * it to the caller. */ static struct pf_key_v2_msg * ! pf_key_v2_call (struct pf_key_v2_msg *msg) { ! u_int32_t seq; ! seq = pf_key_v2_write (msg); ! if (!seq) return 0; ! return pf_key_v2_read (seq); } /* Find the TYPE extension in MSG. Return zero if none found. */ --- 421,433 ---- * it to the caller. */ static struct pf_key_v2_msg * ! pf_key_v2_call (struct pf_key_v2_msg *pmsg) { ! struct sadb_msg *msg = TAILQ_FIRST (pmsg)->seg; ! if (!pf_key_v2_write (pmsg)) return 0; ! return pf_key_v2_read (1, msg->sadb_msg_pid, msg->sadb_msg_seq); } /* Find the TYPE extension in MSG. Return zero if none found. */ *************** *** 434,440 **** pf_key_v2_socket = fd; /* Register it to get ESP and AH acquires from the kernel. */ ! msg.sadb_msg_seq = 0; msg.sadb_msg_type = SADB_REGISTER; msg.sadb_msg_satype = SADB_SATYPE_ESP; regmsg = pf_key_v2_msg_new (&msg, 0); --- 466,473 ---- pf_key_v2_socket = fd; /* Register it to get ESP and AH acquires from the kernel. */ ! msg.sadb_msg_seq = getpid (); ! msg.sadb_msg_seq = pf_key_v2_seq (); msg.sadb_msg_type = SADB_REGISTER; msg.sadb_msg_satype = SADB_SATYPE_ESP; regmsg = pf_key_v2_msg_new (&msg, 0); *************** *** 456,462 **** pf_key_v2_msg_free (ret); ret = 0; ! msg.sadb_msg_seq = 0; msg.sadb_msg_type = SADB_REGISTER; msg.sadb_msg_satype = SADB_SATYPE_AH; regmsg = pf_key_v2_msg_new (&msg, 0); --- 489,495 ---- pf_key_v2_msg_free (ret); ret = 0; ! msg.sadb_msg_seq = pf_key_v2_seq (); msg.sadb_msg_type = SADB_REGISTER; msg.sadb_msg_satype = SADB_SATYPE_AH; regmsg = pf_key_v2_msg_new (&msg, 0); *************** *** 489,500 **** return -1; } /* * Generate a SPI for protocol PROTO and the source/destination pair given by * SRC, SRCLEN, DST & DSTLEN. Stash the SPI size in SZ. */ u_int8_t * ! pf_key_v2_get_spi (size_t *sz, u_int8_t proto, struct sockaddr *src, int srclen, struct sockaddr *dst, int dstlen) { struct sadb_msg msg; --- 522,552 ---- return -1; } + /* XXX IPv4 specific */ + static void + pf_key_v2_local_if_map (struct ifreq *ifrp, void *arg) + { + struct sockaddr **_sa; + _sa = (struct sockaddr **) arg; + if ((*_sa) != NULL && + (*_sa)->sa_family == ifrp->ifr_addr.sa_family && + ifrp->ifr_addr.sa_family == AF_INET && + ((struct sockaddr_in *) (*_sa))->sin_addr.s_addr == ((struct sockaddr_in *) &ifrp->ifr_addr)->sin_addr.s_addr) + *_sa = NULL; + } + static int + pf_key_v2_local_if(struct sockaddr *addr) + { + if_map (pf_key_v2_local_if_map, &addr); + return (addr == NULL); + } + /* * Generate a SPI for protocol PROTO and the source/destination pair given by * SRC, SRCLEN, DST & DSTLEN. Stash the SPI size in SZ. */ u_int8_t * ! pf_key_v2_get_spi (struct exchange *exchange, size_t *sz, u_int8_t proto, struct sockaddr *src, int srclen, struct sockaddr *dst, int dstlen) { struct sadb_msg msg; *************** *** 518,528 **** log_print ("pf_key_v2_get_spi: invalid proto %d", proto); goto cleanup; } ! /* ! * XXX When we have acquires working, the sequence number have to be set ! * from the acquire message. ! */ ! msg.sadb_msg_seq = 0; getspi = pf_key_v2_msg_new (&msg, 0); if (!getspi) goto cleanup; --- 570,584 ---- log_print ("pf_key_v2_get_spi: invalid proto %d", proto); goto cleanup; } ! /* if we were triggered by an ACQUIRE for an inbound SA, use the pid ! and sequence number from the ACQUIRE. otherwise, use our own pid ! and sequence number: */ ! if (sscanf (exchange->name, "auto-ipsec-I%08x:%08x", &msg.sadb_msg_pid, &msg.sadb_msg_seq) != 2 || ! strcasecmp (conf_get_str (exchange->name, "Inbound-ACQUIRE"), "yes")) ! { ! msg.sadb_msg_pid = getpid (); ! msg.sadb_msg_seq = pf_key_v2_seq (); ! } getspi = pf_key_v2_msg_new (&msg, 0); if (!getspi) goto cleanup; *************** *** 534,543 **** goto cleanup; addr->sadb_address_exttype = SADB_EXT_ADDRESS_SRC; addr->sadb_address_len = len / PF_KEY_V2_CHUNK; - #if 0 addr->sadb_address_proto = 0; addr->sadb_address_prefixlen = 0; - #endif addr->sadb_address_reserved = 0; memcpy (addr + 1, src, srclen); /* XXX IPv4-specific. */ --- 590,597 ---- *************** *** 553,562 **** goto cleanup; addr->sadb_address_exttype = SADB_EXT_ADDRESS_DST; addr->sadb_address_len = len / PF_KEY_V2_CHUNK; - #if 0 addr->sadb_address_proto = 0; addr->sadb_address_prefixlen = 0; - #endif addr->sadb_address_reserved = 0; memcpy (addr + 1, dst, dstlen); /* XXX IPv4-specific. */ --- 607,614 ---- *************** *** 623,629 **** * parameters for the incoming SA, and cleared otherwise. */ int ! pf_key_v2_set_spi (struct sa *sa, struct proto *proto, int incoming) { struct sadb_msg msg; struct sadb_sa ssa; --- 675,681 ---- * parameters for the incoming SA, and cleared otherwise. */ int ! pf_key_v2_set_spi (struct exchange *exchange, struct sa *sa, struct proto *proto, int incoming) { struct sadb_msg msg; struct sadb_sa ssa; *************** *** 636,641 **** --- 688,703 ---- struct ipsec_proto *iproto = proto->data; size_t len; + /* if this is outbound and we were triggered by an ACQUIRE for an + outbound SA, use the pid and sequence number from the ACQUIRE. + otherwise, use our own pid and sequence number: */ + if (incoming || + sscanf(exchange->name, "auto-ipsec-I%08x:%08x", &msg.sadb_msg_pid, &msg.sadb_msg_seq) != 2 || + strcasecmp (conf_get_str (exchange->name, "Inbound-ACQUIRE"), "no")) + { + msg.sadb_msg_pid = getpid (); + msg.sadb_msg_seq = pf_key_v2_seq (); + } msg.sadb_msg_type = incoming ? SADB_UPDATE : SADB_ADD; switch (proto->proto) { *************** *** 719,725 **** log_print ("pf_key_v2_set_spi: invalid proto %d", proto->proto); goto cleanup; } - msg.sadb_msg_seq = 0; update = pf_key_v2_msg_new (&msg, 0); if (!update) goto cleanup; --- 781,786 ---- *************** *** 809,818 **** goto cleanup; addr->sadb_address_exttype = SADB_EXT_ADDRESS_SRC; addr->sadb_address_len = len / PF_KEY_V2_CHUNK; - #if 0 addr->sadb_address_proto = 0; addr->sadb_address_prefixlen = 0; - #endif addr->sadb_address_reserved = 0; memcpy (addr + 1, src, srclen); ((struct sockaddr_in *)(addr + 1))->sin_port = 0; --- 870,877 ---- *************** *** 831,840 **** goto cleanup; addr->sadb_address_exttype = SADB_EXT_ADDRESS_DST; addr->sadb_address_len = len / PF_KEY_V2_CHUNK; - #if 0 addr->sadb_address_proto = 0; addr->sadb_address_prefixlen = 0; - #endif addr->sadb_address_reserved = 0; memcpy (addr + 1, dst, dstlen); ((struct sockaddr_in *)(addr + 1))->sin_port = 0; --- 890,897 ---- *************** *** 853,862 **** goto cleanup; addr->sadb_address_exttype = SADB_EXT_ADDRESS_PROXY; addr->sadb_address_len = len / PF_KEY_V2_CHUNK; - #if 0 addr->sadb_address_proto = 0; addr->sadb_address_prefixlen = 0; - #endif addr->sadb_address_reserved = 0; memcpy (addr + 1, dst, dstlen); ((struct sockaddr_in *)(addr + 1))->sin_port = 0; --- 910,917 ---- *************** *** 994,1000 **** log_print ("pf_key_v2_flow: invalid proto %d", proto); goto cleanup; } ! msg.sadb_msg_seq = 0; flow = pf_key_v2_msg_new (&msg, 0); if (!flow) goto cleanup; --- 1049,1056 ---- log_print ("pf_key_v2_flow: invalid proto %d", proto); goto cleanup; } ! msg.sadb_msg_pid = getpid (); ! msg.sadb_msg_seq = pf_key_v2_seq (); flow = pf_key_v2_msg_new (&msg, 0); if (!flow) goto cleanup; *************** *** 1030,1039 **** goto cleanup; addr->sadb_address_exttype = SADB_EXT_ADDRESS_DST; addr->sadb_address_len = len / PF_KEY_V2_CHUNK; - #if 0 addr->sadb_address_proto = 0; addr->sadb_address_prefixlen = 0; - #endif addr->sadb_address_reserved = 0; memset (addr + 1, '\0', sizeof (struct sockaddr_in)); ((struct sockaddr_in *)(addr + 1))->sin_len --- 1086,1093 ---- *************** *** 1052,1061 **** goto cleanup; addr->sadb_address_exttype = SADB_X_EXT_SRC_FLOW; addr->sadb_address_len = len / PF_KEY_V2_CHUNK; - #if 0 addr->sadb_address_proto = 0; addr->sadb_address_prefixlen = 0; - #endif addr->sadb_address_reserved = 0; memset (addr + 1, '\0', sizeof (struct sockaddr_in)); ((struct sockaddr_in *)(addr + 1))->sin_len = sizeof (struct sockaddr_in); --- 1106,1113 ---- *************** *** 1072,1081 **** goto cleanup; addr->sadb_address_exttype = SADB_X_EXT_SRC_MASK; addr->sadb_address_len = len / PF_KEY_V2_CHUNK; - #if 0 addr->sadb_address_proto = 0; addr->sadb_address_prefixlen = 0; - #endif addr->sadb_address_reserved = 0; memset (addr + 1, '\0', sizeof (struct sockaddr_in)); ((struct sockaddr_in *)(addr + 1))->sin_len = sizeof (struct sockaddr_in); --- 1124,1131 ---- *************** *** 1092,1101 **** goto cleanup; addr->sadb_address_exttype = SADB_X_EXT_DST_FLOW; addr->sadb_address_len = len / PF_KEY_V2_CHUNK; - #if 0 addr->sadb_address_proto = 0; addr->sadb_address_prefixlen = 0; - #endif addr->sadb_address_reserved = 0; memset (addr + 1, '\0', sizeof (struct sockaddr_in)); ((struct sockaddr_in *)(addr + 1))->sin_len = sizeof (struct sockaddr_in); --- 1142,1149 ---- *************** *** 1112,1121 **** goto cleanup; addr->sadb_address_exttype = SADB_X_EXT_DST_MASK; addr->sadb_address_len = len / PF_KEY_V2_CHUNK; - #if 0 addr->sadb_address_proto = 0; addr->sadb_address_prefixlen = 0; - #endif addr->sadb_address_reserved = 0; memset (addr + 1, '\0', sizeof (struct sockaddr_in)); ((struct sockaddr_in *)(addr + 1))->sin_len = sizeof (struct sockaddr_in); --- 1160,1167 ---- *************** *** 1230,1236 **** log_print ("pf_key_v2_delete_spi: invalid proto %d", proto->proto); goto cleanup; } ! msg.sadb_msg_seq = 0; delete = pf_key_v2_msg_new (&msg, 0); if (!delete) goto cleanup; --- 1276,1283 ---- log_print ("pf_key_v2_delete_spi: invalid proto %d", proto->proto); goto cleanup; } ! msg.sadb_msg_pid = getpid (); ! msg.sadb_msg_seq = pf_key_v2_seq (); delete = pf_key_v2_msg_new (&msg, 0); if (!delete) goto cleanup; *************** *** 1262,1271 **** goto cleanup; addr->sadb_address_exttype = SADB_EXT_ADDRESS_SRC; addr->sadb_address_len = len / PF_KEY_V2_CHUNK; - #if 0 addr->sadb_address_proto = 0; addr->sadb_address_prefixlen = 0; - #endif addr->sadb_address_reserved = 0; memcpy (addr + 1, saddr, saddrlen); ((struct sockaddr_in *)(addr + 1))->sin_port = 0; --- 1309,1316 ---- *************** *** 1284,1293 **** goto cleanup; addr->sadb_address_exttype = SADB_EXT_ADDRESS_DST; addr->sadb_address_len = len / PF_KEY_V2_CHUNK; - #if 0 addr->sadb_address_proto = 0; addr->sadb_address_prefixlen = 0; - #endif addr->sadb_address_reserved = 0; memcpy (addr + 1, saddr, saddrlen); ((struct sockaddr_in *)(addr + 1))->sin_port = 0; --- 1329,1336 ---- *************** *** 1422,1427 **** --- 1465,1649 ---- } } + /* handling ACQUIREs by installing fake configuration file data may or + may not be a hack. from a not-overhauling everything perspective, + it's kind of neat, since it allows all of the normal connection + reporting stuff, etc. to work for ACQUIREd connections. */ + static void + pf_key_v2_acquire (struct pf_key_v2_msg *pmsg) + { + #ifndef ENABLE_ANY_ON_DEMAND + log_print ("pf_key_v2_acquire: ACQUIRE not supported"); + #else /* ENABLE_ANY_ON_DEMAND */ + struct sadb_msg *msg; + struct sadb_address *src; + struct sadb_address *dst; + struct sadb_prop *prop; + struct sadb_comb *first_comb, *last_comb, *comb; + struct sockaddr *dstaddr; + struct sockaddr *srcaddr; + struct sockaddr *remoteaddr; + char *conn_name_isakmp; + char *conn_name_ipsec; + char *qm_name; + char *qm_suites; + char *p1; + int inbound; + int i; + + /* ignore this ACQUIRE if we're not supposed to be initiating + on-demand: */ + if ((p1 = conf_get_str ("General", "Initiate-any-on-demand")) == NULL) { + log_print ("pf_key_v2_acquire: " + "no \"Initiate-any-on-demand\" tag in [General] section"); + return; + } + if (strcasecmp(p1, "yes")) { + log_print ("pf_key_v2_acquire: " + "\"Initiate-any-on-demand\" tag in [General] section does not say \"yes\""); + return; + } + + /* find extensions in the ACQUIRE: */ + msg = (struct sadb_msg *)TAILQ_FIRST (pmsg)->seg; + src = pf_key_v2_find_ext (pmsg, SADB_EXT_ADDRESS_SRC)->seg; + srcaddr = (struct sockaddr *)(src + 1); + dst = pf_key_v2_find_ext (pmsg, SADB_EXT_ADDRESS_DST)->seg; + dstaddr = (struct sockaddr *)(dst + 1); + prop = pf_key_v2_find_ext (pmsg, SADB_EXT_PROPOSAL)->seg; + first_comb = (struct sadb_comb *)(prop + 1); + last_comb = first_comb + (((prop->sadb_prop_len << 3) - sizeof(struct sadb_prop)) / sizeof(struct sadb_comb)); + + /* ignore any ACQUIRE involving a multicast destination address: */ + /* XXX IPv4 specific */ + if (IN_MULTICAST(((struct sockaddr_in *) dstaddr)->sin_addr.s_addr)) { + log_print ("pf_key_v2_acquire: " + "ignoring ACQUIRE for a multicast SA"); + return; + } + + /* figure out if this ACQUIRE is for an inbound or outbound SA, and + what the remote (other) endpoint is: */ + if (pf_key_v2_local_if(srcaddr)) { + inbound = 0; + remoteaddr = dstaddr; + } else if (pf_key_v2_local_if(dstaddr)) { + inbound = 1; + remoteaddr = srcaddr; + } else { + log_print ("pf_key_v2_acquire: " + "ACQUIRE for SA of unknown direction"); + return; + } + + /* form the IPsec name for this connection. it includes the pid and + sequence number from the ACQUIRE so it is available when we want + to do a GETSPI or an ADD that references the SA that the kernel + is asking for. */ + /* this is not as hackish as it may seem - different ACQUIREs really + are requests for distinct Phase 2 connection work: */ + /* FIXME - connections associated with ACQUIREs should be deleted + when a new, equivalent ACQUIRE comes in, after SAs expire, etc.: */ + if ((conn_name_ipsec = malloc(strlen("auto-ipsec-IFFFFFFFF:FFFFFFFF") + 1)) == NULL) + log_fatal("pf_key_v2_acquire: out of memory"); + sprintf(conn_name_ipsec, "auto-ipsec-I%08x:%08x", msg->sadb_msg_pid, msg->sadb_msg_seq); + + /* if this connection already exists, the kernel is starving: */ + if (connection_exist(conn_name_ipsec)) { + free(conn_name_ipsec); + log_debug (LOG_SYSDEP, 50, "pf_key_v2_acquire: kernel is starving"); + return; + } + + /* form the ISAKMP name for this connection, and add the ISAKMP + connection if it doesn't exist. */ + /* XXX IPv4 specific */ + if ((conn_name_isakmp = malloc(strlen("auto-isakmp-FFFFFFFF") + 1)) == NULL) + log_fatal("pf_key_v2_acquire: out of memory"); + sprintf(conn_name_isakmp, "auto-isakmp-%08x", ((struct sockaddr_in *) remoteaddr)->sin_addr.s_addr); + if (!connection_exist(conn_name_isakmp)) { + if ((p1 = strdup(inet_ntoa(((struct sockaddr_in *) remoteaddr)->sin_addr))) == NULL) + log_fatal("pf_key_v2_acquire: out of memory"); + conf_set_str(conn_name_isakmp, "Phase", "1"); + conf_set_str(conn_name_isakmp, "Transport", "udp"); + conf_set_str(conn_name_isakmp, "Address", p1); + conf_set_str(conn_name_isakmp, "Configuration", "auto-main-mode"); + conf_set_str(conn_name_isakmp, "Flags", "Stayalive"); + } + + /* form the quick mode description name from the proposed + combinations, and add the quick mode description if it doesn't + exist. */ + /* each combination contributes eight bytes to the description name + (two bytes each for the hex representations of protocol, alg1, + alg2, flags), and a maximum of 20 bytes to the Suites value (four + bytes for protocol, six for each of alg1 and alg2, and four for + flags): */ + i = last_comb - first_comb; + if ((qm_name = malloc(strlen("auto-qm-") + (i * 8) + 1)) == NULL || + (qm_suites = malloc(strlen(",QM-") + (i * 21) + strlen("SUITE"))) == NULL) + log_fatal("pf_key_v2_acquire: out of memory"); + #define _ENDOF(s) ((s) + strlen(s)) + sprintf(qm_name, "auto-qm-"); + for(comb = first_comb; comb < last_comb; comb++) { + sprintf(_ENDOF(qm_name), "%02x%02x%02x%02x", + msg->sadb_msg_satype, + comb->sadb_comb_encrypt, + comb->sadb_comb_auth, + comb->sadb_comb_flags); + sprintf(qm_suites, ",QM-"); + p1 = NULL; + switch(msg->sadb_msg_satype) { + case SADB_SATYPE_AH: p1 = "AH-"; break; + case SADB_SATYPE_ESP: p1 = "ESP-"; break; + default: break; + } + if (p1 != NULL) strcat(qm_suites, p1); else sprintf(_ENDOF(qm_suites), "%02x-", msg->sadb_msg_satype); + p1 = NULL; + switch(comb->sadb_comb_encrypt) { + case SADB_EALG_NONE: p1 = ""; break; + case SADB_EALG_DESCBC: p1 = "DES-"; break; + case SADB_EALG_3DESCBC: p1 = "3DES-"; break; + case SADB_EALG_NULL: p1 = "NULL-"; break; + case SADB_EALG_BLOWFISHCBC: p1 = "BLF-"; break; + case SADB_EALG_CAST128CBC: p1 = "CAST5-"; break; + case SADB_EALG_RC5CBC: p1 = "RC5-"; break; + default: break; + } + if (p1 != NULL) strcat(qm_suites, p1); else sprintf(_ENDOF(qm_suites), "%02x-", comb->sadb_comb_encrypt); + p1 = NULL; + switch(comb->sadb_comb_auth) { + case SADB_AALG_NONE: p1 = ""; break; + case SADB_AALG_MD5HMAC: p1 = "MD5-"; break; + case SADB_AALG_SHA1HMAC: p1 = "SHA-"; break; + case SADB_AALG_MD5: p1 = "KMD5-"; break; + case SADB_AALG_SHA: p1 = "KSHA-"; break; + case SADB_AALG_NULL: p1 = "NULL-"; break; + default: break; + } + if (p1 != NULL) strcat(qm_suites, p1); else sprintf(_ENDOF(qm_suites), "%02x-", comb->sadb_comb_auth); + if (comb->sadb_comb_flags & SADB_SAFLAGS_PFS) sprintf(_ENDOF(qm_suites), "PFS-"); + sprintf(_ENDOF(qm_suites), "SUITE"); + } + #undef _ENDOF + if (conf_get_str(qm_name, "DOI") == NULL) { + conf_set_str(qm_name, "DOI", "IPSEC"); + conf_set_str(qm_name, "EXCHANGE_TYPE", "QUICK_MODE"); + conf_set_str(qm_name, "Suites", qm_suites + 1); /* +1 to skip the leading ',' */ + } else + free(qm_suites); + + /* now add the IPsec connection information and set up the connection: */ + conf_set_str(conn_name_ipsec, "Phase", "2"); + conf_set_str(conn_name_ipsec, "ISAKMP-peer", conn_name_isakmp); + conf_set_str(conn_name_ipsec, "Configuration", qm_name); + conf_set_str(conn_name_ipsec, "Inbound-ACQUIRE", (inbound ? "yes" : "no")); + /* XXX the Local-ID and Remote-ID could also be set from identity + information in the ACQUIRE. */ + connection_setup(conn_name_ipsec); + #endif /* ENABLE_ANY_ON_DEMAND */ + } + static void pf_key_v2_notify (struct pf_key_v2_msg *msg) { *************** *** 1432,1439 **** break; case SADB_ACQUIRE: ! log_print ("pf_key_v2_notify: ACQUIRE not yet implemented"); ! /* XXX To be implemented. */ break; default: --- 1654,1669 ---- break; case SADB_ACQUIRE: ! pf_key_v2_acquire (msg); ! break; ! ! case SADB_DELETE: ! case SADB_FLUSH: ! if (((struct sadb_msg *)TAILQ_FIRST (msg)->seg)->sadb_msg_pid != getpid()) ! { ! log_print ("pf_key_v2_notify: DELETE/FLUSH not yet implemented"); ! /* XXX To be implemented. */ ! } break; default: *************** *** 1463,1469 **** if (!n) return; ! msg = pf_key_v2_read (0); if (msg) pf_key_v2_notify (msg); } --- 1693,1699 ---- if (!n) return; ! msg = pf_key_v2_read (0, 0, 0); if (msg) pf_key_v2_notify (msg); } *************** *** 1500,1506 **** log_print ("pf_key_v2_group_spis: invalid proto %d", proto1->proto); goto cleanup; } ! msg.sadb_msg_seq = 0; grpspis = pf_key_v2_msg_new (&msg, 0); if (!grpspis) goto cleanup; --- 1730,1737 ---- log_print ("pf_key_v2_group_spis: invalid proto %d", proto1->proto); goto cleanup; } ! msg.sadb_msg_pid = getpid (); ! msg.sadb_msg_seq = pf_key_v2_seq (); grpspis = pf_key_v2_msg_new (&msg, 0); if (!grpspis) goto cleanup; *************** *** 1543,1552 **** goto cleanup; addr->sadb_address_exttype = SADB_EXT_ADDRESS_DST; addr->sadb_address_len = len / PF_KEY_V2_CHUNK; - #if 0 addr->sadb_address_proto = 0; addr->sadb_address_prefixlen = 0; - #endif addr->sadb_address_reserved = 0; memcpy (addr + 1, saddr, saddrlen); ((struct sockaddr_in *)(addr + 1))->sin_port = 0; --- 1774,1781 ---- *************** *** 1560,1569 **** goto cleanup; addr->sadb_address_exttype = SADB_X_EXT_DST2; addr->sadb_address_len = len / PF_KEY_V2_CHUNK; - #if 0 addr->sadb_address_proto = 0; addr->sadb_address_prefixlen = 0; - #endif addr->sadb_address_reserved = 0; memcpy (addr + 1, saddr, saddrlen); ((struct sockaddr_in *)(addr + 1))->sin_port = 0; --- 1789,1796 ---- diff -ruN pf_key_v2.h pf_key_v2.h *** pf_key_v2.h Sat May 1 16:21:15 1999 --- pf_key_v2.h Wed Sep 22 15:50:12 1999 *************** *** 42,59 **** struct proto; struct sa; struct sockaddr; extern void pf_key_v2_connection_check (char *); extern int pf_key_v2_delete_spi (struct sa *, struct proto *, int); extern int pf_key_v2_enable_sa (struct sa *); extern int pf_key_v2_enable_spi (in_addr_t, in_addr_t, in_addr_t, in_addr_t, u_int8_t *, u_int8_t, in_addr_t); ! extern u_int8_t *pf_key_v2_get_spi (size_t *, u_int8_t, struct sockaddr *, int, struct sockaddr *, int); extern int pf_key_v2_group_spis (struct sa *, struct proto *, struct proto *, int); extern void pf_key_v2_handler (int); extern int pf_key_v2_open (void); ! extern int pf_key_v2_set_spi (struct sa *, struct proto *, int); #endif /* _PF_KEY_V2_H_ */ --- 42,60 ---- struct proto; struct sa; struct sockaddr; + struct exchange; extern void pf_key_v2_connection_check (char *); extern int pf_key_v2_delete_spi (struct sa *, struct proto *, int); extern int pf_key_v2_enable_sa (struct sa *); extern int pf_key_v2_enable_spi (in_addr_t, in_addr_t, in_addr_t, in_addr_t, u_int8_t *, u_int8_t, in_addr_t); ! extern u_int8_t *pf_key_v2_get_spi (struct exchange *, size_t *, u_int8_t, struct sockaddr *, int, struct sockaddr *, int); extern int pf_key_v2_group_spis (struct sa *, struct proto *, struct proto *, int); extern void pf_key_v2_handler (int); extern int pf_key_v2_open (void); ! extern int pf_key_v2_set_spi (struct exchange *, struct sa *, struct proto *, int); #endif /* _PF_KEY_V2_H_ */ diff -ruN pkcs.c pkcs.c *** pkcs.c Sat Jun 5 19:41:24 1999 --- pkcs.c Fri Sep 24 17:11:26 1999 *************** *** 381,398 **** int pkcs_rsa_decrypt (int art, struct rsa_public_key *pub_key, struct rsa_private_key *priv_key, u_int8_t *in, ! u_int8_t **out, u_int16_t *outlen) { mpz_t c; - u_int32_t inlen = priv_key ? mpz_sizeinoctets (priv_key->n) - : mpz_sizeinoctets (pub_key->n); int bad, i; - #ifdef __GNUC__ - /* XXX Silence GCC. */ - i = 0; - #endif - /* Decrypt the block */ mpz_init (c); mpz_setraw (c, in, inlen); --- 381,391 ---- int pkcs_rsa_decrypt (int art, struct rsa_public_key *pub_key, struct rsa_private_key *priv_key, u_int8_t *in, ! u_int32_t inlen, u_int8_t **out, u_int16_t *outlen) { mpz_t c; int bad, i; /* Decrypt the block */ mpz_init (c); mpz_setraw (c, in, inlen); *************** *** 400,423 **** mpz_powm (c, c, priv_key->d, priv_key->n); else mpz_powm (c, c, pub_key->e, pub_key->n); mpz_getraw (in, c, inlen); mpz_clear (c); /* Verify if the padding is correct */ bad = 0; ! if (in[0] != 0) ! bad = 1; switch (art) { case PKCS_PRIVATE: ! if (in[1] != PKCS_PRIVATE) { bad = 1; break; } ! i = 2; while (in[i] == 0xFF) i++; --- 393,419 ---- mpz_powm (c, c, priv_key->d, priv_key->n); else mpz_powm (c, c, pub_key->e, pub_key->n); + inlen = mpz_sizeinoctets(c); mpz_getraw (in, c, inlen); mpz_clear (c); /* Verify if the padding is correct */ + /* leading zeroes in strings are problematic for cryptosystems that + treat their strings as numbers - strings that are numbers do not + always have leading zeroes. so we are tolerant of that here: */ bad = 0; ! i = (in[0] == 0 ? 1 : 0); switch (art) { case PKCS_PRIVATE: ! if (in[i] != PKCS_PRIVATE) { bad = 1; break; } ! i++; while (in[i] == 0xFF) i++; *************** *** 427,438 **** i++; break; case PKCS_PUBLIC: ! if (in[1] != PKCS_PUBLIC) { bad = 1; break; } ! i = 2; while (i < inlen && in[i] != 0) i++; --- 423,434 ---- i++; break; case PKCS_PUBLIC: ! if (in[i] != PKCS_PUBLIC) { bad = 1; break; } ! i++; while (i < inlen && in[i] != 0) i++; diff -ruN pkcs.h pkcs.h *** pkcs.h Thu Apr 1 19:58:05 1999 --- pkcs.h Fri Sep 24 17:09:57 1999 *************** *** 75,81 **** int pkcs_rsa_encrypt (int, struct rsa_public_key *, struct rsa_private_key *, u_int8_t *, u_int32_t, u_int8_t **, u_int32_t *); int pkcs_rsa_decrypt (int, struct rsa_public_key *, struct rsa_private_key *, ! u_int8_t *, u_int8_t **, u_int16_t *); int pkcs_generate_rsa_keypair (struct rsa_public_key *, struct rsa_private_key *, u_int32_t); --- 75,81 ---- int pkcs_rsa_encrypt (int, struct rsa_public_key *, struct rsa_private_key *, u_int8_t *, u_int32_t, u_int8_t **, u_int32_t *); int pkcs_rsa_decrypt (int, struct rsa_public_key *, struct rsa_private_key *, ! u_int8_t *, u_int32_t, u_int8_t **, u_int16_t *); int pkcs_generate_rsa_keypair (struct rsa_public_key *, struct rsa_private_key *, u_int32_t); diff -ruN policy.c policy.c *** policy.c Wed Jul 21 10:30:27 1999 --- policy.c Thu Sep 23 11:39:36 1999 *************** *** 69,75 **** #include "policy.h" #ifndef POLICY_FILE_DEFAULT ! #define POLICY_FILE_DEFAULT "/etc/isakmpd.policy" #endif /* POLICY_FILE_DEFAULT */ int keynote_sessid = -1; --- 69,75 ---- #include "policy.h" #ifndef POLICY_FILE_DEFAULT ! #define POLICY_FILE_DEFAULT SYSCONFDIR "/isakmpd.policy" #endif /* POLICY_FILE_DEFAULT */ int keynote_sessid = -1; diff -ruN sa.c sa.c *** sa.c Sun Jun 6 13:12:40 1999 --- sa.c Wed Nov 3 17:20:52 1999 *************** *** 683,689 **** seconds = sa->seconds * (850 + sysdep_random () % 100) / 1000; log_debug (LOG_TIMER, 95, "sa_setup_expirations: SA %p soft timeout in %qd seconds", ! seconds); expiration.tv_sec += seconds; sa->soft_death = timer_add_event ("sa_soft_expire", sa_soft_expire, sa, &expiration); --- 683,689 ---- seconds = sa->seconds * (850 + sysdep_random () % 100) / 1000; log_debug (LOG_TIMER, 95, "sa_setup_expirations: SA %p soft timeout in %qd seconds", ! sa, seconds); expiration.tv_sec += seconds; sa->soft_death = timer_add_event ("sa_soft_expire", sa_soft_expire, sa, &expiration); *************** *** 700,706 **** gettimeofday(&expiration, 0); log_debug (LOG_TIMER, 95, "sa_setup_expirations: SA %p hard timeout in %qd seconds", ! sa->seconds); expiration.tv_sec += sa->seconds; sa->death = timer_add_event ("sa_hard_expire", sa_hard_expire, sa, &expiration); --- 700,706 ---- gettimeofday(&expiration, 0); log_debug (LOG_TIMER, 95, "sa_setup_expirations: SA %p hard timeout in %qd seconds", ! sa, sa->seconds); expiration.tv_sec += sa->seconds; sa->death = timer_add_event ("sa_hard_expire", sa_hard_expire, sa, &expiration); diff -ruN stamp-h.in stamp-h.in *** stamp-h.in Wed Dec 31 19:00:00 1969 --- stamp-h.in Mon Dec 20 11:47:02 1999 @@ -0,0 +1 @@ +timestamp diff -ruN sysdep/Makefile.am sysdep/Makefile.am *** sysdep/Makefile.am Wed Dec 31 19:00:00 1969 --- sysdep/Makefile.am Thu Sep 23 11:39:02 1999 *************** *** 0 **** --- 1,26 ---- + ## Process this file with automake to produce Makefile.in + # Copyright (c) 1999 BBN Corporation + # + # Permission to use, copy, modify, and distribute this software + # and its documentation for any purpose is hereby granted without + # fee, provided that the above copyright notice and this permission + # appear in all copies and in supporting documentation, and that the + # name of BBN Corporation not be used in advertising or publicity + # pertaining to distribution of the software without specific, + # written prior permission. BBN makes no representations about the + # suitability of this software for any purposes. It is provided "AS + # IS" without express or implied warranties. + # + # This software and its documentation was written by BBN Corporation + # under sponsorship by the Defense Advanced Research Projects Agency. + + # $Header: /IR-CVS/isakmpd/sysdep/Makefile.am,v 1.1 1999/09/23 15:39:02 fredette Exp $ + # $Author: fredette $ + # $Date: 1999/09/23 15:39:02 $ + # $Id: Makefile.am,v 1.1 1999/09/23 15:39:02 fredette Exp $ + # $Revision: 1.1 $ + + AUTOMAKE_OPTIONS = 1.3 foreign ansi2knr + + SUBDIRS = linux + EXTRA_DIST = freebsd openbsd openbsd-encap diff -ruN sysdep/Makefile.in sysdep/Makefile.in *** sysdep/Makefile.in Wed Dec 31 19:00:00 1969 --- sysdep/Makefile.in Mon Dec 20 14:05:04 1999 *************** *** 0 **** --- 1,321 ---- + # Makefile.in generated automatically by automake 1.4 from Makefile.am + + # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY, to the extent permitted by law; without + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A + # PARTICULAR PURPOSE. + + # Copyright (c) 1999 BBN Corporation + # + # Permission to use, copy, modify, and distribute this software + # and its documentation for any purpose is hereby granted without + # fee, provided that the above copyright notice and this permission + # appear in all copies and in supporting documentation, and that the + # name of BBN Corporation not be used in advertising or publicity + # pertaining to distribution of the software without specific, + # written prior permission. BBN makes no representations about the + # suitability of this software for any purposes. It is provided "AS + # IS" without express or implied warranties. + # + # This software and its documentation was written by BBN Corporation + # under sponsorship by the Defense Advanced Research Projects Agency. + + # $Header: /IR-CVS/isakmpd/sysdep/Makefile.am,v 1.1 1999/09/23 15:39:02 fredette Exp $ + # $Author: fredette $ + # $Date: 1999/09/23 15:39:02 $ + # $Id: Makefile.am,v 1.1 1999/09/23 15:39:02 fredette Exp $ + # $Revision: 1.1 $ + + + SHELL = @SHELL@ + + srcdir = @srcdir@ + top_srcdir = @top_srcdir@ + VPATH = @srcdir@ + prefix = @prefix@ + exec_prefix = @exec_prefix@ + + bindir = @bindir@ + sbindir = @sbindir@ + libexecdir = @libexecdir@ + datadir = @datadir@ + sysconfdir = @sysconfdir@ + sharedstatedir = @sharedstatedir@ + localstatedir = @localstatedir@ + libdir = @libdir@ + infodir = @infodir@ + mandir = @mandir@ + includedir = @includedir@ + oldincludedir = /usr/include + + DESTDIR = + + pkgdatadir = $(datadir)/@PACKAGE@ + pkglibdir = $(libdir)/@PACKAGE@ + pkgincludedir = $(includedir)/@PACKAGE@ + + top_builddir = .. + + ACLOCAL = @ACLOCAL@ + AUTOCONF = @AUTOCONF@ + AUTOMAKE = @AUTOMAKE@ + AUTOHEADER = @AUTOHEADER@ + + INSTALL = @INSTALL@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) + INSTALL_DATA = @INSTALL_DATA@ + INSTALL_SCRIPT = @INSTALL_SCRIPT@ + transform = @program_transform_name@ + + NORMAL_INSTALL = : + PRE_INSTALL = : + POST_INSTALL = : + NORMAL_UNINSTALL = : + PRE_UNINSTALL = : + POST_UNINSTALL = : + build_alias = @build_alias@ + build_triplet = @build@ + host_alias = @host_alias@ + host_triplet = @host@ + target_alias = @target_alias@ + target_triplet = @target@ + BOEHM_GC_LDADD = @BOEHM_GC_LDADD@ + BOEHM_LEAK_INCLUDES = @BOEHM_LEAK_INCLUDES@ + BOEHM_LEAK_LDADD = @BOEHM_LEAK_LDADD@ + CC = @CC@ + CPP = @CPP@ + CXX = @CXX@ + EFENCE_LDADD = @EFENCE_LDADD@ + GLIB_CFLAGS = @GLIB_CFLAGS@ + GLIB_CONFIG = @GLIB_CONFIG@ + GLIB_LIBS = @GLIB_LIBS@ + GTK_CFLAGS = @GTK_CFLAGS@ + GTK_CONFIG = @GTK_CONFIG@ + GTK_LIBS = @GTK_LIBS@ + KAME_CFLAGS = @KAME_CFLAGS@ + KAME_LIBS = @KAME_LIBS@ + LIBMALLOC_LDADD = @LIBMALLOC_LDADD@ + LIBSYSDEP_LDADD = @LIBSYSDEP_LDADD@ + MAKEINFO = @MAKEINFO@ + PACKAGE = @PACKAGE@ + RANLIB = @RANLIB@ + TARGET_INCLUDES = @TARGET_INCLUDES@ + U = @U@ + VERSION = @VERSION@ + isakmpd_DEPENDENCIES = @isakmpd_DEPENDENCIES@ + + AUTOMAKE_OPTIONS = 1.3 foreign ansi2knr + + SUBDIRS = linux + EXTRA_DIST = freebsd openbsd openbsd-encap + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + CONFIG_HEADER = ../config.h + CONFIG_CLEAN_FILES = + DIST_COMMON = README Makefile.am Makefile.in + + + DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + + TAR = tar + GZIP_ENV = --best + all: all-redirect + .SUFFIXES: + $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps sysdep/Makefile + + Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + + # This directory's subdirectories are mostly independent; you can cd + # into them and run `make' without going through this Makefile. + # To change the values of `make' variables: instead of editing Makefiles, + # (1) if the variable is set in `config.status', edit `config.status' + # (which will cause the Makefiles to be regenerated when you run `make'); + # (2) otherwise, pass the desired values on the `make' command line. + + @SET_MAKE@ + + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + + mostlyclean-recursive clean-recursive distclean-recursive \ + maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" + tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + + tags: TAGS + + ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + + TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + + mostlyclean-tags: + + clean-tags: + + distclean-tags: + -rm -f TAGS ID + + maintainer-clean-tags: + + distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + + subdir = sysdep + + distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done + info-am: + info: info-recursive + dvi-am: + dvi: dvi-recursive + check-am: all-am + check: check-recursive + installcheck-am: + installcheck: installcheck-recursive + install-exec-am: + install-exec: install-exec-recursive + + install-data-am: + install-data: install-data-recursive + + install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + install: install-recursive + uninstall-am: + uninstall: uninstall-recursive + all-am: Makefile + all-redirect: all-recursive + install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install + installdirs: installdirs-recursive + installdirs-am: + + + mostlyclean-generic: + + clean-generic: + + distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + + maintainer-clean-generic: + mostlyclean-am: mostlyclean-tags mostlyclean-generic + + mostlyclean: mostlyclean-recursive + + clean-am: clean-tags clean-generic mostlyclean-am + + clean: clean-recursive + + distclean-am: distclean-tags distclean-generic clean-am + + distclean: distclean-recursive + + maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + + maintainer-clean: maintainer-clean-recursive + + .PHONY: install-data-recursive uninstall-data-recursive \ + install-exec-recursive uninstall-exec-recursive installdirs-recursive \ + uninstalldirs-recursive all-recursive check-recursive \ + installcheck-recursive info-recursive dvi-recursive \ + mostlyclean-recursive distclean-recursive clean-recursive \ + maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ + distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ + dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ + install-exec install-data-am install-data install-am install \ + uninstall-am uninstall all-redirect all-am all installdirs-am \ + installdirs mostlyclean-generic distclean-generic clean-generic \ + maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. + .NOEXPORT: diff -ruN sysdep/freebsd/sysdep-os.h sysdep/freebsd/sysdep-os.h *** sysdep/freebsd/sysdep-os.h Wed Dec 31 19:00:00 1969 --- sysdep/freebsd/sysdep-os.h Wed Sep 22 16:05:25 1999 *************** *** 0 **** --- 1,78 ---- + /* $Id: sysdep-os.h,v 1.1 1999/09/22 20:05:25 fredette Exp $ */ + + /* + * Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Ericsson Radio Systems. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + /* + * This code was written under funding by Ericsson Radio Systems. + */ + + #ifndef _SYSDEP_OS_H_ + #define _SYSDEP_OS_H_ + + #ifdef SADB_EXT_X_SRC_MASK + + /* Non-conformant PF_KEYv2 extensions, transform them into being conformant. */ + + #define SADB_X_EXT_SRC_MASK SADB_EXT_X_SRC_MASK + #define SADB_X_EXT_DST_MASK SADB_EXT_X_DST_MASK + #define SADB_X_EXT_PROTOCOL SADB_EXT_X_PROTOCOL + #define SADB_X_EXT_SA2 SADB_EXT_X_SA2 + #define SADB_X_EXT_SRC_FLOW SADB_EXT_X_SRC_FLOW + #define SADB_X_EXT_DST_FLOW SADB_EXT_X_DST_FLOW + #define SADB_X_EXT_DST2 SADB_EXT_X_DST2 + + #define SADB_X_SATYPE_AH_OLD SADB_SATYPE_X_AH_OLD + #define SADB_X_SATYPE_ESP_OLD SADB_SATYPE_X_ESP_OLD + #define SADB_X_SATYPE_IPIP SADB_SATYPE_X_IPIP + + #define SADB_X_AALG_RIPEMD160HMAC96 SADB_AALG_X_RIPEMD160HMAC96 + #define SADB_X_AALG_MD5 SADB_AALG_X_MD5 + #define SADB_X_AALG_SHA1 SADB_AALG_X_SHA1 + + #define SADB_X_EALG_BLF SADB_EALG_X_BLF + #define SADB_X_EALG_CAST SADB_EALG_X_CAST + #define SADB_X_EALG_SKIPJACK SADB_EALG_X_SKIPJACK + + #define SADB_X_SAFLAGS_HALFIV SADB_SAFLAGS_X_HALFIV + #define SADB_X_SAFLAGS_TUNNEL SADB_SAFLAGS_X_TUNNEL + #define SADB_X_SAFLAGS_CHAINDEL SADB_SAFLAGS_X_CHAINDEL + #define SADB_X_SAFLAGS_LOCALFLOW SADB_SAFLAGS_X_LOCALFLOW + #define SADB_X_SAFLAGS_REPLACEFLOW SADB_SAFLAGS_X_REPLACEFLOW + + #endif /* SADB_EXT_X_SRC_MASK */ + + typedef u_int16_t in_port_t; + typedef u_int32_t in_addr_t; + typedef u_int32_t socklen_t; + + #define LIST_FIRST(head) ((head)->lh_first) + #define LIST_NEXT(elm, field) ((elm)->field.le_next) + + #endif /* _SYSDEP_OS_H_ */ diff -ruN sysdep/freebsd/sysdep.c sysdep/freebsd/sysdep.c *** sysdep/freebsd/sysdep.c Wed Dec 31 19:00:00 1969 --- sysdep/freebsd/sysdep.c Thu Nov 4 12:35:43 1999 *************** *** 0 **** --- 1,224 ---- + /* $Id: sysdep.c,v 1.2 1999/11/04 17:35:43 fredette Exp $ */ + + /* + * Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Ericsson Radio Systems. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + /* + * This code was written under funding by Ericsson Radio Systems. + */ + + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #include "sysdep.h" + + #ifdef NEED_SYSDEP_APP + #include "app.h" + #include "conf.h" + #include "ipsec.h" + + #ifdef USE_PF_KEY_V2 + #include "pf_key_v2.h" + #define KEY_API(x) pf_key_v2_##x + #else + #include + #include "pf_encap.h" + #define KEY_API(x) pf_encap_##x + #endif + + #endif NEED_SYSDEP_APP + #include "log.h" + + extern char *__progname; + + /* + * This is set to true in case of regression-test mode, when it will + * cause predictable random numbers be generated. + */ + int regrand = 0; + + /* + * An as strong as possible random number generator, reverting to a + * deterministic pseudo-random one if regrand is set. + */ + u_int32_t + sysdep_random () + { + if (!regrand) + return arc4random (); + else + return random(); + } + + /* Return the basename of the command used to invoke us. */ + char * + sysdep_progname () + { + return __progname; + } + + /* As regress/ use this file I protect the sysdep_app_* stuff like this. */ + #ifdef NEED_SYSDEP_APP + /* + * Prepare the application we negotiate SAs for (i.e. the IPsec stack) + * for communication. We return a file descriptor useable to select(2) on. + */ + int + sysdep_app_open () + { + return KEY_API(open) (); + } + + /* + * When select(2) has noticed our application needs attendance, this is what + * gets called. FD is the file descriptor causing the alarm. + */ + void + sysdep_app_handler (int fd) + { + KEY_API (handler) (fd); + } + + /* Check that the connection named NAME is active, or else make it active. */ + void + sysdep_connection_check (char *name) + { + KEY_API (connection_check) (name); + } + + /* + * Generate a SPI for protocol PROTO and the source/destination pair given by + * SRC, SRCLEN, DST & DSTLEN. Stash the SPI size in SZ. + */ + u_int8_t * + sysdep_ipsec_get_spi (struct exchange *exchange, size_t *sz, u_int8_t proto, struct sockaddr *src, + int srclen, struct sockaddr *dst, int dstlen) + { + if (app_none) + { + *sz = IPSEC_SPI_SIZE; + /* XXX should be random instead I think. */ + return strdup ("\x12\x34\x56\x78"); + } + return KEY_API (get_spi) (exchange, sz, proto, src, srclen, dst, dstlen); + } + + /* Force communication on socket FD to go in the clear. */ + int + sysdep_cleartext (int fd) + { + int protocol, option, i; + struct sadb_x_policy policy; + union { + struct sockaddr san; + struct sockaddr_in sain; + #ifdef ENABLE_IPV6 + struct sockaddr_in6 sain6; + #endif /* ENABLE_IPV6 */ + } sockname; + + if (app_none) + return 0; + + /* + * Need to bypass system security policy, so I can send and + * receive key management datagrams in the clear. + */ + memset((char *) &policy, 0, sizeof(policy)); + policy.sadb_x_policy_len = (sizeof(policy) >> 3); + policy.sadb_x_policy_exttype = SADB_X_EXT_POLICY; + policy.sadb_x_policy_type = IPSEC_POLICY_BYPASS; + + /* get the address family of this socket: */ + i = sizeof(sockname); + if (getsockname(fd, &sockname.san, &i) < 0 || i < sizeof(struct sockaddr)) + sockname.san.sa_family = AF_INET; + switch(sockname.san.sa_family) { + case AF_INET: protocol = IPPROTO_IP; option = IP_IPSEC_POLICY; break; + #ifdef ENABLE_IPV6 + case AF_INET6: protocol = IPPROTO_IPV6; option = IPV6_IPSEC_POLICY; break; + #endif /* ENABLE_IPV6 */ + default: errno = EBADF; return -1; + } + + /* the only error we shield the user from is ENOPROTOOPT, which + we will get when we're running on a system without KAME: */ + if (((policy.sadb_x_policy_dir = IPSEC_DIR_INBOUND, + setsockopt(fd, protocol, option, &policy, sizeof(policy))) == 0 || + errno == ENOPROTOOPT) && + ((policy.sadb_x_policy_dir = IPSEC_DIR_OUTBOUND, + setsockopt(fd, protocol, option, &policy, sizeof(policy))) == 0 || + errno == ENOPROTOOPT)) + return(0); + + log_error ("sysdep_cleartext: " + "setsockopt (%d, %d, %d, ...) failed", fd, protocol, option); + return -1; + } + + int + sysdep_ipsec_delete_spi (struct sa *sa, struct proto *proto, int incoming) + { + if (app_none) + return 0; + return KEY_API (delete_spi) (sa, proto, incoming); + } + + int + sysdep_ipsec_enable_sa (struct sa *sa) + { + if (app_none) + return 0; + return KEY_API (enable_sa) (sa); + } + + int + sysdep_ipsec_group_spis (struct sa *sa, struct proto *proto1, + struct proto *proto2, int incoming) + { + if (app_none) + return 0; + return KEY_API (group_spis) (sa, proto1, proto2, incoming); + } + + int + sysdep_ipsec_set_spi (struct exchange *exchange, struct sa *sa, struct proto *proto, int incoming) + { + if (app_none) + return 0; + return KEY_API (set_spi) (exchange, sa, proto, incoming); + } + #endif diff -ruN sysdep/linux/GNUmakefile.sysdep sysdep/linux/GNUmakefile.sysdep *** sysdep/linux/GNUmakefile.sysdep Sat May 1 20:35:38 1999 --- sysdep/linux/GNUmakefile.sysdep Wed Dec 31 19:00:00 1969 *************** *** 1,70 **** - # $Id: GNUmakefile.sysdep,v 1.4 1999/05/02 00:35:38 ho Exp $ - - # - # Copyright (c) 1999 Niklas Hallqvist. All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions - # are met: - # 1. Redistributions of source code must retain the above copyright - # notice, this list of conditions and the following disclaimer. - # 2. Redistributions in binary form must reproduce the above copyright - # notice, this list of conditions and the following disclaimer in the - # documentation and/or other materials provided with the distribution. - # 3. All advertising materials mentioning features or use of this software - # must display the following acknowledgement: - # This product includes software developed by Ericsson Radio Systems. - # 4. The name of the author may not be used to endorse or promote products - # derived from this software without specific prior written permission. - # - # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # - - # - # This code was written under funding by Ericsson Radio Systems. - # - - # In order for this to work, invocations need to set FREESWAN to the - # directory where FreeS/WAN is installed. - - ifndef FREESWAN - FREESWAN= /usr/src/freeswan - endif - - BINDIR= /usr/local/sbin - # Partly good for RedHat 5.2, but man(1) does not find them so I have it - # disabled for now. - #MANDIR= /var/catman/cat - #MAN5= isakmpd.conf.0 - #MAN8= isakmpd.0 - NOMAN= - - SRCS+= klips.c - - LDADD+= ${.CURDIR}/sysdep/${OS}/libsysdep/libsysdep.a \ - ${FREESWAN}/gmp/libgmp.a ${FREESWAN}/libdes/libdes.a - DPADD+= ${.CURDIR}/sysdep/${OS}/libsysdep/libsysdep.a \ - ${FREESWAN}/gmp/libgmp.a ${FREESWAN}/libdes/libdes.a - - CFLAGS+= ${DEBUG} -I${FREESWAN}/gmp -I${FREESWAN}/libdes \ - -I${FREESWAN}/klips -I${FREESWAN}/lib -DUSE_OLD_SOCKADDR - - ${.CURDIR}/sysdep/${OS}/libsysdep/libsysdep.a: - cd ${.CURDIR}/sysdep/${OS}/libsysdep; \ - ${MAKE} ${MAKEFLAGS} CFLAGS="${CFLAGS}" MKDEP="${MKDEP}" - - - ifneq ($(findstring install,$(MAKECMDGOALS)),install) - SUBDIR+= sysdep/${OS}/libsysdep - # The regress/ subdir is completely broken in the linux environment - SUBDIR:= $(filter-out regress,${SUBDIR}) - endif --- 0 ---- diff -ruN sysdep/linux/Makefile.am sysdep/linux/Makefile.am *** sysdep/linux/Makefile.am Wed Dec 31 19:00:00 1969 --- sysdep/linux/Makefile.am Thu Sep 23 11:39:02 1999 *************** *** 0 **** --- 1,30 ---- + ## Process this file with automake to produce Makefile.in + # Copyright (c) 1999 BBN Corporation + # + # Permission to use, copy, modify, and distribute this software + # and its documentation for any purpose is hereby granted without + # fee, provided that the above copyright notice and this permission + # appear in all copies and in supporting documentation, and that the + # name of BBN Corporation not be used in advertising or publicity + # pertaining to distribution of the software without specific, + # written prior permission. BBN makes no representations about the + # suitability of this software for any purposes. It is provided "AS + # IS" without express or implied warranties. + # + # This software and its documentation was written by BBN Corporation + # under sponsorship by the Defense Advanced Research Projects Agency. + + # $Header: /IR-CVS/isakmpd/sysdep/linux/Makefile.am,v 1.1 1999/09/23 15:39:02 fredette Exp $ + # $Author: fredette $ + # $Date: 1999/09/23 15:39:02 $ + # $Id: Makefile.am,v 1.1 1999/09/23 15:39:02 fredette Exp $ + # $Revision: 1.1 $ + + AUTOMAKE_OPTIONS = 1.3 foreign ansi2knr + + if LIBSYSDEP_LINUX + SUBDIRS = libsysdep + else + SUBDIRS = + endif + EXTRA_DIST = blf.h cast.h klips.c klips.h md5.h sha1.h sys sysdep-os.h sysdep.c diff -ruN sysdep/linux/Makefile.in sysdep/linux/Makefile.in *** sysdep/linux/Makefile.in Wed Dec 31 19:00:00 1969 --- sysdep/linux/Makefile.in Mon Dec 20 14:05:06 1999 *************** *** 0 **** --- 1,322 ---- + # Makefile.in generated automatically by automake 1.4 from Makefile.am + + # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY, to the extent permitted by law; without + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A + # PARTICULAR PURPOSE. + + # Copyright (c) 1999 BBN Corporation + # + # Permission to use, copy, modify, and distribute this software + # and its documentation for any purpose is hereby granted without + # fee, provided that the above copyright notice and this permission + # appear in all copies and in supporting documentation, and that the + # name of BBN Corporation not be used in advertising or publicity + # pertaining to distribution of the software without specific, + # written prior permission. BBN makes no representations about the + # suitability of this software for any purposes. It is provided "AS + # IS" without express or implied warranties. + # + # This software and its documentation was written by BBN Corporation + # under sponsorship by the Defense Advanced Research Projects Agency. + + # $Header: /IR-CVS/isakmpd/sysdep/linux/Makefile.am,v 1.1 1999/09/23 15:39:02 fredette Exp $ + # $Author: fredette $ + # $Date: 1999/09/23 15:39:02 $ + # $Id: Makefile.am,v 1.1 1999/09/23 15:39:02 fredette Exp $ + # $Revision: 1.1 $ + + + SHELL = @SHELL@ + + srcdir = @srcdir@ + top_srcdir = @top_srcdir@ + VPATH = @srcdir@ + prefix = @prefix@ + exec_prefix = @exec_prefix@ + + bindir = @bindir@ + sbindir = @sbindir@ + libexecdir = @libexecdir@ + datadir = @datadir@ + sysconfdir = @sysconfdir@ + sharedstatedir = @sharedstatedir@ + localstatedir = @localstatedir@ + libdir = @libdir@ + infodir = @infodir@ + mandir = @mandir@ + includedir = @includedir@ + oldincludedir = /usr/include + + DESTDIR = + + pkgdatadir = $(datadir)/@PACKAGE@ + pkglibdir = $(libdir)/@PACKAGE@ + pkgincludedir = $(includedir)/@PACKAGE@ + + top_builddir = ../.. + + ACLOCAL = @ACLOCAL@ + AUTOCONF = @AUTOCONF@ + AUTOMAKE = @AUTOMAKE@ + AUTOHEADER = @AUTOHEADER@ + + INSTALL = @INSTALL@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) + INSTALL_DATA = @INSTALL_DATA@ + INSTALL_SCRIPT = @INSTALL_SCRIPT@ + transform = @program_transform_name@ + + NORMAL_INSTALL = : + PRE_INSTALL = : + POST_INSTALL = : + NORMAL_UNINSTALL = : + PRE_UNINSTALL = : + POST_UNINSTALL = : + build_alias = @build_alias@ + build_triplet = @build@ + host_alias = @host_alias@ + host_triplet = @host@ + target_alias = @target_alias@ + target_triplet = @target@ + BOEHM_GC_LDADD = @BOEHM_GC_LDADD@ + BOEHM_LEAK_INCLUDES = @BOEHM_LEAK_INCLUDES@ + BOEHM_LEAK_LDADD = @BOEHM_LEAK_LDADD@ + CC = @CC@ + CPP = @CPP@ + CXX = @CXX@ + EFENCE_LDADD = @EFENCE_LDADD@ + GLIB_CFLAGS = @GLIB_CFLAGS@ + GLIB_CONFIG = @GLIB_CONFIG@ + GLIB_LIBS = @GLIB_LIBS@ + GTK_CFLAGS = @GTK_CFLAGS@ + GTK_CONFIG = @GTK_CONFIG@ + GTK_LIBS = @GTK_LIBS@ + KAME_CFLAGS = @KAME_CFLAGS@ + KAME_LIBS = @KAME_LIBS@ + LIBMALLOC_LDADD = @LIBMALLOC_LDADD@ + LIBSYSDEP_LDADD = @LIBSYSDEP_LDADD@ + MAKEINFO = @MAKEINFO@ + PACKAGE = @PACKAGE@ + RANLIB = @RANLIB@ + TARGET_INCLUDES = @TARGET_INCLUDES@ + U = @U@ + VERSION = @VERSION@ + isakmpd_DEPENDENCIES = @isakmpd_DEPENDENCIES@ + + AUTOMAKE_OPTIONS = 1.3 foreign ansi2knr + @LIBSYSDEP_LINUX_TRUE@SUBDIRS = libsysdep + @LIBSYSDEP_LINUX_FALSE@SUBDIRS = + EXTRA_DIST = blf.h cast.h klips.c klips.h md5.h sha1.h sys sysdep-os.h sysdep.c + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + CONFIG_HEADER = ../../config.h + CONFIG_CLEAN_FILES = + DIST_COMMON = README Makefile.am Makefile.in + + + DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + + TAR = tar + GZIP_ENV = --best + DIST_SUBDIRS = libsysdep + all: all-redirect + .SUFFIXES: + $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps sysdep/linux/Makefile + + Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + + # This directory's subdirectories are mostly independent; you can cd + # into them and run `make' without going through this Makefile. + # To change the values of `make' variables: instead of editing Makefiles, + # (1) if the variable is set in `config.status', edit `config.status' + # (which will cause the Makefiles to be regenerated when you run `make'); + # (2) otherwise, pass the desired values on the `make' command line. + + @SET_MAKE@ + + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + + mostlyclean-recursive clean-recursive distclean-recursive \ + maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" + tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + + tags: TAGS + + ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + + TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + + mostlyclean-tags: + + clean-tags: + + distclean-tags: + -rm -f TAGS ID + + maintainer-clean-tags: + + distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + + subdir = sysdep/linux + + distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(DIST_SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done + info-am: + info: info-recursive + dvi-am: + dvi: dvi-recursive + check-am: all-am + check: check-recursive + installcheck-am: + installcheck: installcheck-recursive + install-exec-am: + install-exec: install-exec-recursive + + install-data-am: + install-data: install-data-recursive + + install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + install: install-recursive + uninstall-am: + uninstall: uninstall-recursive + all-am: Makefile + all-redirect: all-recursive + install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install + installdirs: installdirs-recursive + installdirs-am: + + + mostlyclean-generic: + + clean-generic: + + distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + + maintainer-clean-generic: + mostlyclean-am: mostlyclean-tags mostlyclean-generic + + mostlyclean: mostlyclean-recursive + + clean-am: clean-tags clean-generic mostlyclean-am + + clean: clean-recursive + + distclean-am: distclean-tags distclean-generic clean-am + + distclean: distclean-recursive + + maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + + maintainer-clean: maintainer-clean-recursive + + .PHONY: install-data-recursive uninstall-data-recursive \ + install-exec-recursive uninstall-exec-recursive installdirs-recursive \ + uninstalldirs-recursive all-recursive check-recursive \ + installcheck-recursive info-recursive dvi-recursive \ + mostlyclean-recursive distclean-recursive clean-recursive \ + maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ + distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ + dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ + install-exec install-data-am install-data install-am install \ + uninstall-am uninstall all-redirect all-am all installdirs-am \ + installdirs mostlyclean-generic distclean-generic clean-generic \ + maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. + .NOEXPORT: diff -ruN sysdep/linux/Makefile.sysdep sysdep/linux/Makefile.sysdep *** sysdep/linux/Makefile.sysdep Wed Mar 31 19:46:22 1999 --- sysdep/linux/Makefile.sysdep Wed Dec 31 19:00:00 1969 *************** *** 1,71 **** - # $Id: Makefile.sysdep,v 1.1 1999/04/01 00:46:22 niklas Exp $ - - # - # Copyright (c) 1999 Niklas Hallqvist. All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions - # are met: - # 1. Redistributions of source code must retain the above copyright - # notice, this list of conditions and the following disclaimer. - # 2. Redistributions in binary form must reproduce the above copyright - # notice, this list of conditions and the following disclaimer in the - # documentation and/or other materials provided with the distribution. - # 3. All advertising materials mentioning features or use of this software - # must display the following acknowledgement: - # This product includes software developed by Ericsson Radio Systems. - # 4. The name of the author may not be used to endorse or promote products - # derived from this software without specific prior written permission. - # - # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # - - # - # This code was written under funding by Ericsson Radio Systems. - # - - # In order for this to work, invocations need to set FREESWAN to the - # directory where FreeS/WAN is installed. - - BINDIR= /usr/local/sbin - # Partly good for RedHat 5.2, but man(1) does not find them so I have it - # disabled for now. - #MANDIR= /var/catman/cat - #MAN5= isakmpd.conf.0 - #MAN8= isakmpd.0 - NOMAN= - - SRCS+= klips.c - - LDADD+= ${.CURDIR}/sysdep/${OS}/libsysdep/libsysdep.a \ - ${FREESWAN}/gmp/libgmp.a ${FREESWAN}/libdes/libdes.a - DPADD+= ${.CURDIR}/sysdep/${OS}/libsysdep/libsysdep.a \ - ${FREESWAN}/gmp/libgmp.a ${FREESWAN}/libdes/libdes.a - - CFLAGS+= ${DEBUG} -I${FREESWAN}/gmp -I${FREESWAN}/libdes \ - -I${FREESWAN}/klips -I${FREESWAN}/lib -DUSE_OLD_SOCKADDR - - # This is a hack in order to make sure libsysdep is built before the - # linkstage of isakmpd. As a side effect the link is always done even if - # not necessary. Well, I just don't care. - GENERATED+= sysdep-target - sysdep-target: - cd ${.CURDIR}/sysdep/${OS}/libsysdep; ${MAKE} ${.MAKEFLAGS} - - .if make(clean) - SUBDIR+= sysdep/${OS}/libsysdep - .endif - - # The regress/ subdir is completely broken in the linux environment - .if !make(install) - SUBDIR:= ${SUBDIR:Nregress} - .endif --- 0 ---- diff -ruN sysdep/linux/libsysdep/GNUmakefile sysdep/linux/libsysdep/GNUmakefile *** sysdep/linux/libsysdep/GNUmakefile Sat May 1 19:55:53 1999 --- sysdep/linux/libsysdep/GNUmakefile Wed Dec 31 19:00:00 1969 *************** *** 1,62 **** - # $Id: GNUmakefile,v 1.3 1999/05/01 23:55:53 ho Exp $ - - # - # Copyright (c) 1999 Niklas Hallqvist. All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions - # are met: - # 1. Redistributions of source code must retain the above copyright - # notice, this list of conditions and the following disclaimer. - # 2. Redistributions in binary form must reproduce the above copyright - # notice, this list of conditions and the following disclaimer in the - # documentation and/or other materials provided with the distribution. - # 3. All advertising materials mentioning features or use of this software - # must display the following acknowledgement: - # This product includes software developed by Ericsson Radio Systems. - # 4. The name of the author may not be used to endorse or promote products - # derived from this software without specific prior written permission. - # - # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # - - # - # This code was written under funding by Ericsson Radio Systems. - # - - .CURDIR:= $(shell pwd) - - LIB= sysdep - SRCS= arc4random.c blowfish.c cast.c md5.c sha1.c - NOMAN= - CFLAGS+= -I${.CURDIR}/.. - - lib${LIB}.a: ${SRCS:%.c=%.o} - ar cq $@ ${SRCS:%.c=%.o} - - clean: - rm -f lib${LIB}.a ${SRCS:%.c=%.o} - - cleandir: clean cleandepend - - depend: .depend - - .depend: ${SRCS} - @rm -f .depend - ${MKDEP} ${CFLAGS} ${SRCS} > .depend - - cleandepend: - rm -f .depend - - ifneq ($(findstring clean,$(MAKECMDGOALS)),clean) - -include .depend - endif --- 0 ---- diff -ruN sysdep/linux/libsysdep/Makefile sysdep/linux/libsysdep/Makefile *** sysdep/linux/libsysdep/Makefile Wed Mar 31 19:46:27 1999 --- sysdep/linux/libsysdep/Makefile Wed Dec 31 19:00:00 1969 *************** *** 1,41 **** - # $Id: Makefile,v 1.1 1999/04/01 00:46:27 niklas Exp $ - - # - # Copyright (c) 1999 Niklas Hallqvist. All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions - # are met: - # 1. Redistributions of source code must retain the above copyright - # notice, this list of conditions and the following disclaimer. - # 2. Redistributions in binary form must reproduce the above copyright - # notice, this list of conditions and the following disclaimer in the - # documentation and/or other materials provided with the distribution. - # 3. All advertising materials mentioning features or use of this software - # must display the following acknowledgement: - # This product includes software developed by Ericsson Radio Systems. - # 4. The name of the author may not be used to endorse or promote products - # derived from this software without specific prior written permission. - # - # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # - - # - # This code was written under funding by Ericsson Radio Systems. - # - - LIB= sysdep - SRCS= arc4random.c blowfish.c cast.c md5.c sha1.c - NOMAN= - CFLAGS+= -I${.CURDIR}/.. - - .include --- 0 ---- diff -ruN sysdep/linux/libsysdep/Makefile.am sysdep/linux/libsysdep/Makefile.am *** sysdep/linux/libsysdep/Makefile.am Wed Dec 31 19:00:00 1969 --- sysdep/linux/libsysdep/Makefile.am Wed Sep 22 16:55:45 1999 *************** *** 0 **** --- 1,27 ---- + ## Process this file with automake to produce Makefile.in + # Copyright (c) 1999 BBN Corporation + # + # Permission to use, copy, modify, and distribute this software + # and its documentation for any purpose is hereby granted without + # fee, provided that the above copyright notice and this permission + # appear in all copies and in supporting documentation, and that the + # name of BBN Corporation not be used in advertising or publicity + # pertaining to distribution of the software without specific, + # written prior permission. BBN makes no representations about the + # suitability of this software for any purposes. It is provided "AS + # IS" without express or implied warranties. + # + # This software and its documentation was written by BBN Corporation + # under sponsorship by the Defense Advanced Research Projects Agency. + + # $Header: /IR-CVS/isakmpd/sysdep/linux/libsysdep/Makefile.am,v 1.2 1999/09/22 20:55:45 fredette Exp $ + # $Author: fredette $ + # $Date: 1999/09/22 20:55:45 $ + # $Id: Makefile.am,v 1.2 1999/09/22 20:55:45 fredette Exp $ + # $Revision: 1.2 $ + + AUTOMAKE_OPTIONS = 1.3 foreign + + noinst_LIBRARIES = libsysdep.a + libsysdep_a_SOURCES = arc4random.c blowfish.c cast.c md5.c sha1.c + INCLUDES = -I$(srcdir)/../ -I../ diff -ruN sysdep/linux/libsysdep/Makefile.in sysdep/linux/libsysdep/Makefile.in *** sysdep/linux/libsysdep/Makefile.in Wed Dec 31 19:00:00 1969 --- sysdep/linux/libsysdep/Makefile.in Mon Dec 20 14:05:07 1999 *************** *** 0 **** --- 1,314 ---- + # Makefile.in generated automatically by automake 1.4 from Makefile.am + + # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY, to the extent permitted by law; without + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A + # PARTICULAR PURPOSE. + + # Copyright (c) 1999 BBN Corporation + # + # Permission to use, copy, modify, and distribute this software + # and its documentation for any purpose is hereby granted without + # fee, provided that the above copyright notice and this permission + # appear in all copies and in supporting documentation, and that the + # name of BBN Corporation not be used in advertising or publicity + # pertaining to distribution of the software without specific, + # written prior permission. BBN makes no representations about the + # suitability of this software for any purposes. It is provided "AS + # IS" without express or implied warranties. + # + # This software and its documentation was written by BBN Corporation + # under sponsorship by the Defense Advanced Research Projects Agency. + + # $Header: /IR-CVS/isakmpd/sysdep/linux/libsysdep/Makefile.am,v 1.2 1999/09/22 20:55:45 fredette Exp $ + # $Author: fredette $ + # $Date: 1999/09/22 20:55:45 $ + # $Id: Makefile.am,v 1.2 1999/09/22 20:55:45 fredette Exp $ + # $Revision: 1.2 $ + + + SHELL = @SHELL@ + + srcdir = @srcdir@ + top_srcdir = @top_srcdir@ + VPATH = @srcdir@ + prefix = @prefix@ + exec_prefix = @exec_prefix@ + + bindir = @bindir@ + sbindir = @sbindir@ + libexecdir = @libexecdir@ + datadir = @datadir@ + sysconfdir = @sysconfdir@ + sharedstatedir = @sharedstatedir@ + localstatedir = @localstatedir@ + libdir = @libdir@ + infodir = @infodir@ + mandir = @mandir@ + includedir = @includedir@ + oldincludedir = /usr/include + + DESTDIR = + + pkgdatadir = $(datadir)/@PACKAGE@ + pkglibdir = $(libdir)/@PACKAGE@ + pkgincludedir = $(includedir)/@PACKAGE@ + + top_builddir = ../../.. + + ACLOCAL = @ACLOCAL@ + AUTOCONF = @AUTOCONF@ + AUTOMAKE = @AUTOMAKE@ + AUTOHEADER = @AUTOHEADER@ + + INSTALL = @INSTALL@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) + INSTALL_DATA = @INSTALL_DATA@ + INSTALL_SCRIPT = @INSTALL_SCRIPT@ + transform = @program_transform_name@ + + NORMAL_INSTALL = : + PRE_INSTALL = : + POST_INSTALL = : + NORMAL_UNINSTALL = : + PRE_UNINSTALL = : + POST_UNINSTALL = : + build_alias = @build_alias@ + build_triplet = @build@ + host_alias = @host_alias@ + host_triplet = @host@ + target_alias = @target_alias@ + target_triplet = @target@ + BOEHM_GC_LDADD = @BOEHM_GC_LDADD@ + BOEHM_LEAK_INCLUDES = @BOEHM_LEAK_INCLUDES@ + BOEHM_LEAK_LDADD = @BOEHM_LEAK_LDADD@ + CC = @CC@ + CPP = @CPP@ + CXX = @CXX@ + EFENCE_LDADD = @EFENCE_LDADD@ + GLIB_CFLAGS = @GLIB_CFLAGS@ + GLIB_CONFIG = @GLIB_CONFIG@ + GLIB_LIBS = @GLIB_LIBS@ + GTK_CFLAGS = @GTK_CFLAGS@ + GTK_CONFIG = @GTK_CONFIG@ + GTK_LIBS = @GTK_LIBS@ + KAME_CFLAGS = @KAME_CFLAGS@ + KAME_LIBS = @KAME_LIBS@ + LIBMALLOC_LDADD = @LIBMALLOC_LDADD@ + LIBSYSDEP_LDADD = @LIBSYSDEP_LDADD@ + MAKEINFO = @MAKEINFO@ + PACKAGE = @PACKAGE@ + RANLIB = @RANLIB@ + TARGET_INCLUDES = @TARGET_INCLUDES@ + U = @U@ + VERSION = @VERSION@ + isakmpd_DEPENDENCIES = @isakmpd_DEPENDENCIES@ + + AUTOMAKE_OPTIONS = 1.3 foreign + + noinst_LIBRARIES = libsysdep.a + libsysdep_a_SOURCES = arc4random.c blowfish.c cast.c md5.c sha1.c + INCLUDES = -I$(srcdir)/../ -I../ + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + CONFIG_HEADER = ../../../config.h + CONFIG_CLEAN_FILES = + LIBRARIES = $(noinst_LIBRARIES) + + + DEFS = @DEFS@ -I. -I$(srcdir) -I../../.. + CPPFLAGS = @CPPFLAGS@ + LDFLAGS = @LDFLAGS@ + LIBS = @LIBS@ + X_CFLAGS = @X_CFLAGS@ + X_LIBS = @X_LIBS@ + X_EXTRA_LIBS = @X_EXTRA_LIBS@ + X_PRE_LIBS = @X_PRE_LIBS@ + libsysdep_a_LIBADD = + libsysdep_a_OBJECTS = arc4random.o blowfish.o cast.o md5.o sha1.o + AR = ar + CFLAGS = @CFLAGS@ + COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + CCLD = $(CC) + LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ + DIST_COMMON = Makefile.am Makefile.in + + + DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + + TAR = tar + GZIP_ENV = --best + SOURCES = $(libsysdep_a_SOURCES) + OBJECTS = $(libsysdep_a_OBJECTS) + + all: all-redirect + .SUFFIXES: + .SUFFIXES: .S .c .o .s + $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps sysdep/linux/libsysdep/Makefile + + Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + + mostlyclean-noinstLIBRARIES: + + clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + + distclean-noinstLIBRARIES: + + maintainer-clean-noinstLIBRARIES: + + .c.o: + $(COMPILE) -c $< + + .s.o: + $(COMPILE) -c $< + + .S.o: + $(COMPILE) -c $< + + mostlyclean-compile: + -rm -f *.o core *.core + + clean-compile: + + distclean-compile: + -rm -f *.tab.c + + maintainer-clean-compile: + + libsysdep.a: $(libsysdep_a_OBJECTS) $(libsysdep_a_DEPENDENCIES) + -rm -f libsysdep.a + $(AR) cru libsysdep.a $(libsysdep_a_OBJECTS) $(libsysdep_a_LIBADD) + $(RANLIB) libsysdep.a + + tags: TAGS + + ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + + TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + + mostlyclean-tags: + + clean-tags: + + distclean-tags: + -rm -f TAGS ID + + maintainer-clean-tags: + + distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + + subdir = sysdep/linux/libsysdep + + distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + arc4random.o: arc4random.c + blowfish.o: blowfish.c ../blf.h + cast.o: cast.c ../cast.h + md5.o: md5.c ../../../config.h ../md5.h + sha1.o: sha1.c ../../../config.h ../sha1.h + + info-am: + info: info-am + dvi-am: + dvi: dvi-am + check-am: all-am + check: check-am + installcheck-am: + installcheck: installcheck-am + install-exec-am: + install-exec: install-exec-am + + install-data-am: + install-data: install-data-am + + install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + install: install-am + uninstall-am: + uninstall: uninstall-am + all-am: Makefile $(LIBRARIES) + all-redirect: all-am + install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install + installdirs: + + + mostlyclean-generic: + + clean-generic: + + distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + + maintainer-clean-generic: + mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + + mostlyclean: mostlyclean-am + + clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ + mostlyclean-am + + clean: clean-am + + distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-tags distclean-generic clean-am + + distclean: distclean-am + + maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + + maintainer-clean: maintainer-clean-am + + .PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ + clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ + mostlyclean-compile distclean-compile clean-compile \ + maintainer-clean-compile tags mostlyclean-tags distclean-tags \ + clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ + check-am installcheck-am installcheck install-exec-am install-exec \ + install-data-am install-data install-am install uninstall-am uninstall \ + all-redirect all-am all installdirs mostlyclean-generic \ + distclean-generic clean-generic maintainer-clean-generic clean \ + mostlyclean distclean maintainer-clean + + + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. + .NOEXPORT: diff -ruN sysdep/linux/libsysdep/md5.c sysdep/linux/libsysdep/md5.c *** sysdep/linux/libsysdep/md5.c Wed Mar 31 19:46:28 1999 --- sysdep/linux/libsysdep/md5.c Wed Sep 22 15:56:39 1999 *************** *** 38,51 **** * */ #include #include #include "md5.h" - #ifndef WIN32 - #include "endian.h" /* sets BYTE_ORDER, LITTLE_ENDIAN, and BIG_ENDIAN */ - #endif #define HAVEMEMCOPY 1 /* use ISO C's memcpy and memset */ --- 38,51 ---- * */ + #ifdef HAVE_CONFIG_H + #include + #endif /* HAVE_CONFIG_H */ #include #include #include "md5.h" #define HAVEMEMCOPY 1 /* use ISO C's memcpy and memset */ *************** *** 73,79 **** static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64])); ! #if BYTE_ORDER == LITTLE_ENDIAN #define Encode MD5_memcpy #define Decode MD5_memcpy #else --- 73,79 ---- static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64])); ! #ifndef WORDS_BIGENDIAN #define Encode MD5_memcpy #define Decode MD5_memcpy #else *************** *** 319,325 **** MD5_memset ((POINTER)x, 0, sizeof (x)); } ! #if BYTE_ORDER != LITTLE_ENDIAN /* Encodes input (UINT4) into output (unsigned char). Assumes len is a multiple of 4. --- 319,325 ---- MD5_memset ((POINTER)x, 0, sizeof (x)); } ! #ifdef WORDS_BIGENDIAN /* Encodes input (UINT4) into output (unsigned char). Assumes len is a multiple of 4. diff -ruN sysdep/linux/libsysdep/sha1.c sysdep/linux/libsysdep/sha1.c *** sysdep/linux/libsysdep/sha1.c Wed Mar 31 19:46:29 1999 --- sysdep/linux/libsysdep/sha1.c Wed Sep 22 15:56:39 1999 *************** *** 17,40 **** #define SHA1HANDSOFF #include #include "sha1.h" - #ifndef WIN32 - #include "endian.h" /* sets BYTE_ORDER, LITTLE_ENDIAN, and BIG_ENDIAN */ - #endif #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) /* blk0() and blk() perform the initial expand. */ /* I got the idea of expanding during the round function from SSLeay */ ! #if BYTE_ORDER == LITTLE_ENDIAN #define blk0(i) (block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \ |(rol(block->l[i],8)&0x00FF00FF)) - #elif BYTE_ORDER == BIG_ENDIAN - #define blk0(i) block->l[i] #else ! #error "Endianness not defined!" #endif #define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \ ^block->l[(i+2)&15]^block->l[i&15],1)) --- 17,38 ---- #define SHA1HANDSOFF + #ifdef HAVE_CONFIG_H + #include + #endif /* HAVE_CONFIG_H */ #include #include "sha1.h" #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) /* blk0() and blk() perform the initial expand. */ /* I got the idea of expanding during the round function from SSLeay */ ! #ifndef WORDS_BIGENDIAN #define blk0(i) (block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \ |(rol(block->l[i],8)&0x00FF00FF)) #else ! #define blk0(i) block->l[i] #endif #define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \ ^block->l[(i+2)&15]^block->l[i&15],1)) diff -ruN sysdep/linux/sysdep.c sysdep/linux/sysdep.c *** sysdep/linux/sysdep.c Sat May 1 16:21:22 1999 --- sysdep/linux/sysdep.c Wed Sep 22 15:55:13 1999 *************** *** 88,94 **** * SRC, SRCLEN, DST & DSTLEN. Stash the SPI size in SZ. */ u_int8_t * ! sysdep_ipsec_get_spi (size_t *sz, u_int8_t proto, struct sockaddr *src, int srclen, struct sockaddr *dst, int dstlen) { if (app_none) --- 88,94 ---- * SRC, SRCLEN, DST & DSTLEN. Stash the SPI size in SZ. */ u_int8_t * ! sysdep_ipsec_get_spi (struct exchange *exchange, size_t *sz, u_int8_t proto, struct sockaddr *src, int srclen, struct sockaddr *dst, int dstlen) { if (app_none) *************** *** 127,133 **** } int ! sysdep_ipsec_set_spi (struct sa *sa, struct proto *proto, int incoming) { return klips_set_spi (sa, proto, incoming); } --- 127,133 ---- } int ! sysdep_ipsec_set_spi (struct exchange *exchange, struct sa *sa, struct proto *proto, int incoming) { return klips_set_spi (sa, proto, incoming); } diff -ruN sysdep/openbsd/sysdep.c sysdep/openbsd/sysdep.c *** sysdep/openbsd/sysdep.c Sat May 1 16:21:23 1999 --- sysdep/openbsd/sysdep.c Wed Sep 22 15:54:20 1999 *************** *** 121,127 **** * SRC, SRCLEN, DST & DSTLEN. Stash the SPI size in SZ. */ u_int8_t * ! sysdep_ipsec_get_spi (size_t *sz, u_int8_t proto, struct sockaddr *src, int srclen, struct sockaddr *dst, int dstlen) { if (app_none) --- 121,127 ---- * SRC, SRCLEN, DST & DSTLEN. Stash the SPI size in SZ. */ u_int8_t * ! sysdep_ipsec_get_spi (struct exchange *exchange, size_t *sz, u_int8_t proto, struct sockaddr *src, int srclen, struct sockaddr *dst, int dstlen) { if (app_none) *************** *** 130,136 **** /* XXX should be random instead I think. */ return strdup ("\x12\x34\x56\x78"); } ! return KEY_API (get_spi) (sz, proto, src, srclen, dst, dstlen); } /* Force communication on socket FD to go in the clear. */ --- 130,136 ---- /* XXX should be random instead I think. */ return strdup ("\x12\x34\x56\x78"); } ! return KEY_API (get_spi) (exchange, sz, proto, src, srclen, dst, dstlen); } /* Force communication on socket FD to go in the clear. */ *************** *** 199,208 **** } int ! sysdep_ipsec_set_spi (struct sa *sa, struct proto *proto, int incoming) { if (app_none) return 0; ! return KEY_API (set_spi) (sa, proto, incoming); } #endif --- 199,208 ---- } int ! sysdep_ipsec_set_spi (struct exchange *exchange, struct sa *sa, struct proto *proto, int incoming) { if (app_none) return 0; ! return KEY_API (set_spi) (exchange, sa, proto, incoming); } #endif diff -ruN sysdep/openbsd-encap/sysdep.c sysdep/openbsd-encap/sysdep.c *** sysdep/openbsd-encap/sysdep.c Sat May 1 16:21:25 1999 --- sysdep/openbsd-encap/sysdep.c Wed Sep 22 15:54:21 1999 *************** *** 121,127 **** * SRC, SRCLEN, DST & DSTLEN. Stash the SPI size in SZ. */ u_int8_t * ! sysdep_ipsec_get_spi (size_t *sz, u_int8_t proto, struct sockaddr *src, int srclen, struct sockaddr *dst, int dstlen) { if (app_none) --- 121,127 ---- * SRC, SRCLEN, DST & DSTLEN. Stash the SPI size in SZ. */ u_int8_t * ! sysdep_ipsec_get_spi (struct exchange *exchange, size_t *sz, u_int8_t proto, struct sockaddr *src, int srclen, struct sockaddr *dst, int dstlen) { if (app_none) *************** *** 130,136 **** /* XXX should be random instead I think. */ return strdup ("\x12\x34\x56\x78"); } ! return KEY_API (get_spi) (sz, proto, src, srclen, dst, dstlen); } /* Force communication on socket FD to go in the clear. */ --- 130,136 ---- /* XXX should be random instead I think. */ return strdup ("\x12\x34\x56\x78"); } ! return KEY_API (get_spi) (exchange, sz, proto, src, srclen, dst, dstlen); } /* Force communication on socket FD to go in the clear. */ *************** *** 199,208 **** } int ! sysdep_ipsec_set_spi (struct sa *sa, struct proto *proto, int incoming) { if (app_none) return 0; ! return KEY_API (set_spi) (sa, proto, incoming); } #endif --- 199,208 ---- } int ! sysdep_ipsec_set_spi (struct exchange *exchange, struct sa *sa, struct proto *proto, int incoming) { if (app_none) return 0; ! return KEY_API (set_spi) (exchange, sa, proto, incoming); } #endif diff -ruN sysdep.c sysdep.c *** sysdep.c Wed Dec 31 19:00:00 1969 --- sysdep.c Thu Nov 4 12:35:43 1999 *************** *** 0 **** --- 1,224 ---- + /* $Id: sysdep.c,v 1.2 1999/11/04 17:35:43 fredette Exp $ */ + + /* + * Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Ericsson Radio Systems. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + /* + * This code was written under funding by Ericsson Radio Systems. + */ + + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #include "sysdep.h" + + #ifdef NEED_SYSDEP_APP + #include "app.h" + #include "conf.h" + #include "ipsec.h" + + #ifdef USE_PF_KEY_V2 + #include "pf_key_v2.h" + #define KEY_API(x) pf_key_v2_##x + #else + #include + #include "pf_encap.h" + #define KEY_API(x) pf_encap_##x + #endif + + #endif NEED_SYSDEP_APP + #include "log.h" + + extern char *__progname; + + /* + * This is set to true in case of regression-test mode, when it will + * cause predictable random numbers be generated. + */ + int regrand = 0; + + /* + * An as strong as possible random number generator, reverting to a + * deterministic pseudo-random one if regrand is set. + */ + u_int32_t + sysdep_random () + { + if (!regrand) + return arc4random (); + else + return random(); + } + + /* Return the basename of the command used to invoke us. */ + char * + sysdep_progname () + { + return __progname; + } + + /* As regress/ use this file I protect the sysdep_app_* stuff like this. */ + #ifdef NEED_SYSDEP_APP + /* + * Prepare the application we negotiate SAs for (i.e. the IPsec stack) + * for communication. We return a file descriptor useable to select(2) on. + */ + int + sysdep_app_open () + { + return KEY_API(open) (); + } + + /* + * When select(2) has noticed our application needs attendance, this is what + * gets called. FD is the file descriptor causing the alarm. + */ + void + sysdep_app_handler (int fd) + { + KEY_API (handler) (fd); + } + + /* Check that the connection named NAME is active, or else make it active. */ + void + sysdep_connection_check (char *name) + { + KEY_API (connection_check) (name); + } + + /* + * Generate a SPI for protocol PROTO and the source/destination pair given by + * SRC, SRCLEN, DST & DSTLEN. Stash the SPI size in SZ. + */ + u_int8_t * + sysdep_ipsec_get_spi (struct exchange *exchange, size_t *sz, u_int8_t proto, struct sockaddr *src, + int srclen, struct sockaddr *dst, int dstlen) + { + if (app_none) + { + *sz = IPSEC_SPI_SIZE; + /* XXX should be random instead I think. */ + return strdup ("\x12\x34\x56\x78"); + } + return KEY_API (get_spi) (exchange, sz, proto, src, srclen, dst, dstlen); + } + + /* Force communication on socket FD to go in the clear. */ + int + sysdep_cleartext (int fd) + { + int protocol, option, i; + struct sadb_x_policy policy; + union { + struct sockaddr san; + struct sockaddr_in sain; + #ifdef ENABLE_IPV6 + struct sockaddr_in6 sain6; + #endif /* ENABLE_IPV6 */ + } sockname; + + if (app_none) + return 0; + + /* + * Need to bypass system security policy, so I can send and + * receive key management datagrams in the clear. + */ + memset((char *) &policy, 0, sizeof(policy)); + policy.sadb_x_policy_len = (sizeof(policy) >> 3); + policy.sadb_x_policy_exttype = SADB_X_EXT_POLICY; + policy.sadb_x_policy_type = IPSEC_POLICY_BYPASS; + + /* get the address family of this socket: */ + i = sizeof(sockname); + if (getsockname(fd, &sockname.san, &i) < 0 || i < sizeof(struct sockaddr)) + sockname.san.sa_family = AF_INET; + switch(sockname.san.sa_family) { + case AF_INET: protocol = IPPROTO_IP; option = IP_IPSEC_POLICY; break; + #ifdef ENABLE_IPV6 + case AF_INET6: protocol = IPPROTO_IPV6; option = IPV6_IPSEC_POLICY; break; + #endif /* ENABLE_IPV6 */ + default: errno = EBADF; return -1; + } + + /* the only error we shield the user from is ENOPROTOOPT, which + we will get when we're running on a system without KAME: */ + if (((policy.sadb_x_policy_dir = IPSEC_DIR_INBOUND, + setsockopt(fd, protocol, option, &policy, sizeof(policy))) == 0 || + errno == ENOPROTOOPT) && + ((policy.sadb_x_policy_dir = IPSEC_DIR_OUTBOUND, + setsockopt(fd, protocol, option, &policy, sizeof(policy))) == 0 || + errno == ENOPROTOOPT)) + return(0); + + log_error ("sysdep_cleartext: " + "setsockopt (%d, %d, %d, ...) failed", fd, protocol, option); + return -1; + } + + int + sysdep_ipsec_delete_spi (struct sa *sa, struct proto *proto, int incoming) + { + if (app_none) + return 0; + return KEY_API (delete_spi) (sa, proto, incoming); + } + + int + sysdep_ipsec_enable_sa (struct sa *sa) + { + if (app_none) + return 0; + return KEY_API (enable_sa) (sa); + } + + int + sysdep_ipsec_group_spis (struct sa *sa, struct proto *proto1, + struct proto *proto2, int incoming) + { + if (app_none) + return 0; + return KEY_API (group_spis) (sa, proto1, proto2, incoming); + } + + int + sysdep_ipsec_set_spi (struct exchange *exchange, struct sa *sa, struct proto *proto, int incoming) + { + if (app_none) + return 0; + return KEY_API (set_spi) (exchange, sa, proto, incoming); + } + #endif diff -ruN sysdep.h sysdep.h *** sysdep.h Sat May 1 16:21:16 1999 --- sysdep.h Wed Sep 22 15:49:30 1999 *************** *** 43,48 **** --- 43,49 ---- struct proto; struct sa; struct sockaddr; + struct exchange; extern void sysdep_app_handler (int); extern int sysdep_app_open (void); *************** *** 50,60 **** extern void sysdep_connection_check (char *); extern int sysdep_ipsec_delete_spi (struct sa *, struct proto *, int); extern int sysdep_ipsec_enable_sa (struct sa *); ! extern u_int8_t *sysdep_ipsec_get_spi (size_t *, u_int8_t, struct sockaddr *, int, struct sockaddr *, int); extern int sysdep_ipsec_group_spis (struct sa *, struct proto *, struct proto *, int); ! extern int sysdep_ipsec_set_spi (struct sa *, struct proto *, int); extern char *sysdep_progname (void); extern u_int32_t sysdep_random (void); --- 51,61 ---- extern void sysdep_connection_check (char *); extern int sysdep_ipsec_delete_spi (struct sa *, struct proto *, int); extern int sysdep_ipsec_enable_sa (struct sa *); ! extern u_int8_t *sysdep_ipsec_get_spi (struct exchange *, size_t *, u_int8_t, struct sockaddr *, int, struct sockaddr *, int); extern int sysdep_ipsec_group_spis (struct sa *, struct proto *, struct proto *, int); ! extern int sysdep_ipsec_set_spi (struct exchange *, struct sa *, struct proto *, int); extern char *sysdep_progname (void); extern u_int32_t sysdep_random (void); diff -ruN udp.c udp.c *** udp.c Sat Jun 5 19:08:53 1999 --- udp.c Wed Sep 22 15:47:00 1999 *************** *** 33,38 **** --- 33,41 ---- * This code was written under funding by Ericsson Radio Systems. */ + #ifdef HAVE_CONFIG_H + #include + #endif /* HAVE_CONFIG_H */ #include #include #include *************** *** 103,108 **** --- 106,122 ---- /* A list of UDP transports we listen for messages on. */ static LIST_HEAD (udp_listen_list, udp_transport) udp_listen_list; + #ifdef ENABLE_ASYMMETRIC_LINKS + /* A list of asymmetric link aliases. */ + /* XXX IPv4 specific. */ + struct udp_asymmeric_entry { + struct sockaddr_in peer_address_out; + struct sockaddr_in peer_address_in; + LIST_ENTRY (udp_asymmetric_entry) link; + }; + static LIST_HEAD (udp_asymmetric_list, udp_asymmetric_entry) udp_asymmetric_list; + #endif /* ENABLE_ASYMMETRIC_LINKS */ + in_port_t udp_default_port = 0; in_port_t udp_bind_port = 0; static int udp_proto; *************** *** 226,232 **** struct sockaddr_in src; memset (&src, 0, sizeof src); ! #ifndef USE_OLD_SOCKADDR src.sin_len = sizeof src; #endif src.sin_family = AF_INET; --- 240,246 ---- struct sockaddr_in src; memset (&src, 0, sizeof src); ! #ifdef HAVE_SOCKADDR_SA_LEN src.sin_len = sizeof src; #endif src.sin_family = AF_INET; *************** *** 253,259 **** * Well UDP is an internet protocol after all so drop other ifreqs. * XXX IPv6 support is missing. */ ! #ifdef USE_OLD_SOCKADDR if (ifrp->ifr_addr.sa_family != AF_INET) #else if (ifrp->ifr_addr.sa_family != AF_INET --- 267,273 ---- * Well UDP is an internet protocol after all so drop other ifreqs. * XXX IPv6 support is missing. */ ! #ifndef HAVE_SOCKADDR_SA_LEN if (ifrp->ifr_addr.sa_family != AF_INET) #else if (ifrp->ifr_addr.sa_family != AF_INET *************** *** 339,345 **** } memset (&dst, 0, sizeof dst); ! #ifndef USE_OLD_SOCKADDR dst.sin_len = sizeof dst; #endif dst.sin_family = AF_INET; --- 353,359 ---- } memset (&dst, 0, sizeof dst); ! #ifdef HAVE_SOCKADDR_SA_LEN dst.sin_len = sizeof dst; #endif dst.sin_family = AF_INET; *************** *** 496,501 **** --- 510,544 ---- message_recv (msg); } + #ifdef ENABLE_ASYMMETRIC_LINKS + /* this adds an asymmetric link to the list: */ + extern void + udp_add_asymmetric (in_addr_t peer_address_out, in_addr_t peer_address_in) + { + struct udp_asymmetric_entry *peer; + + for (peer = LIST_FIRST (&udp_asymmetric_list); peer; peer = LIST_NEXT (peer, link)) + if (peer->peer_address_out.sin_addr.s_addr == peer_address_out) break; + if (!peer) + { + peer = malloc (sizeof *peer); + if (!peer) + { + log_error ("udp_add_asymmetric: malloc (%d) failed", sizeof *peer); + return; + } + LIST_INSERT_HEAD (&udp_asymmetric_list, peer, link); + } + memset (peer, 0, sizeof *peer); + peer->peer_address_out.sin_family = peer->peer_address_in.sin_family = AF_INET; + #ifdef HAVE_SOCKADDR_SA_LEN + peer->peer_address_out.sin_len = peer->peer_address_in.sin_len = sizeof peer->peer_address_out; + #endif + peer->peer_address_out.sin_addr.s_addr = peer_address_out; + peer->peer_address_in.sin_addr.s_addr = peer_address_in; + } + #endif /* ENABLE_ASYMMETRIC_LINKS */ + /* Physically send the message MSG over its associated transport. */ static int udp_send_message (struct message *msg) *************** *** 503,508 **** --- 546,563 ---- struct udp_transport *u = (struct udp_transport *)msg->transport; ssize_t n; struct msghdr m; + + #ifdef ENABLE_ASYMMETRIC_LINKS + struct udp_asymmetric_entry *peer; + + for (peer = LIST_FIRST (&udp_asymmetric_list); peer; peer = LIST_NEXT (peer, link)) + if (u->dst.sin_addr.s_addr == peer->peer_address_out.sin_addr.s_addr) + break; + if (peer) { + peer->peer_address_in.sin_port = u->dst.sin_port; + m.msg_name = (caddr_t)&peer->peer_address_in; + } else + #endif /* ENABLE_ASYMMETRIC_LINKS */ /* * Sending on connected sockets requires that no destination address is diff -ruN udp.h udp.h *** udp.h Mon Dec 21 21:23:43 1998 --- udp.h Wed Sep 22 15:43:03 1999 *************** *** 40,45 **** --- 40,48 ---- extern in_port_t udp_bind_port; extern in_port_t udp_decode_port (char *); + #ifdef ENABLE_ASYMMETRIC_LINKS + extern void udp_add_asymmetric (in_addr_t, in_addr_t); + #endif /* ENABLE_ASYMMETRIC_LINKS */ extern void udp_init (void); #endif /* _UDP_H_ */ diff -ruN ui.c ui.c *** ui.c Tue Aug 31 07:48:13 1999 --- ui.c Wed Nov 3 17:18:26 1999 *************** *** 54,59 **** --- 54,60 ---- #include "transport.h" #include "ui.h" #include "util.h" + #include "udp.h" #define BUF_SZ 256 *************** *** 85,91 **** log_fatal ("mkfifo"); /* XXX Is O_RDWR needed on some OSes? Photurisd seems to imply that. */ ! ui_socket = open (ui_fifo, O_RDONLY | O_NONBLOCK, 0); if (ui_socket == -1) log_fatal (ui_fifo); } --- 86,95 ---- log_fatal ("mkfifo"); /* XXX Is O_RDWR needed on some OSes? Photurisd seems to imply that. */ ! /* FreeBSD 3.3, at least, does need O_RDWR. It looks like ! whenever a pipe has zero writers, it's always read-selectable ! but reads return no bytes: */ ! ui_socket = open (ui_fifo, O_RDWR | O_NONBLOCK, 0); if (ui_socket == -1) log_fatal (ui_fifo); } *************** *** 187,192 **** --- 191,215 ---- timer_report (); } + #ifdef ENABLE_ASYMMETRIC_LINKS + void + ui_asymmetric (char *cmd) + { + char *p1; + struct in_addr peer_out_address, peer_in_address; + if ((p1 = strchr(cmd, ':')) != NULL) { + *(p1++) = '\0'; + if (inet_aton(cmd, &peer_out_address) && + inet_aton(p1, &peer_in_address)) { + /* add this entry to the UDP module's asymmetry list: */ + udp_add_asymmetric(peer_out_address.s_addr, peer_in_address.s_addr); + return; + } + } + log_print ("ui_asymmetric: command \"%s\" malformed", cmd); + } + #endif /* ENABLE_ASYMMETRIC_LINKS */ + /* * Call the relevant command handler based on the first character of the * line (the command). *************** *** 216,221 **** --- 239,250 ---- case 't': ui_teardown (line); break; + + #ifdef ENABLE_ASYMMETRIC_LINKS + case 'a': + ui_asymmetric (line); + break; + #endif /* ENABLE_ASYMMETRIC_LINKS */ default: log_print ("ui_handle_messages: unrecognized command: '%c'", line[0]); diff -ruN x509.c x509.c *** x509.c Wed Jul 21 10:30:28 1999 --- x509.c Fri Sep 24 17:17:46 1999 *************** *** 201,206 **** --- 201,207 ---- goto done; } + #if 0 { /* * XXX We assume IPv4 here and a certificate with an extension *************** *** 229,234 **** --- 230,236 ---- memcpy (id_cert, id, 4); } } + #endif res = 1; *************** *** 378,390 **** struct norm_type *tmp; u_int8_t *data; u_int32_t datalen; /* * Get access to the inner Certificate. ! * XXX We don't know how to get at the CA's public key yet. */ ! if (!x509_validate_signed (asn, asnlen, 0, &data, &datalen)) ! return 0; memset (rcert, 0, sizeof *rcert); --- 380,415 ---- struct norm_type *tmp; u_int8_t *data; u_int32_t datalen; + u_int8_t *key_asn; + u_int32_t key_asnlen; + struct rsa_public_key ca_key; + char *keyfile; /* * Get access to the inner Certificate. ! * XXX For now, we have the user configure the acceptable CA key. */ ! /* XXX Do we want to store our files in ASN.1? */ ! keyfile = conf_get_str ("RSA_sig", "ca_key"); ! if (!asn_get_from_file (keyfile, &key_asn, &key_asnlen)) ! { ! /* XXX Log? */ ! return 0; ! } ! ! if (!pkcs_public_key_from_asn (&ca_key, key_asn, key_asnlen)) ! { ! /* XXX Log? */ ! free (key_asn); ! return 0; ! } ! free (key_asn); ! if (!x509_validate_signed (asn, asnlen, &ca_key, &data, &datalen)) ! { ! pkcs_free_public_key(&ca_key); ! return 0; ! } ! pkcs_free_public_key(&ca_key); memset (rcert, 0, sizeof *rcert); *************** *** 722,727 **** --- 747,754 ---- if (strcmp ((char *)tmp->data, ASN_ID_MD5WITHRSAENC) == 0) hash = hash_get (HASH_MD5); + else if (strcmp ((char *)tmp->data, ASN_ID_SHA1WITHRSAENC) == 0) + hash = hash_get (HASH_SHA1); else { id = asn_parse_objectid (asn_ids, tmp->data); *************** *** 757,763 **** * the padding bits at the end. Per definition there are no padding * bits at the end in this case, so just skip it. */ ! if (!pkcs_rsa_decrypt (PKCS_PRIVATE, key, 0, tmp->data + 1, &dec, &declen)) goto fail; if (!asn_template_clone (&digest, 1) --- 784,790 ---- * the padding bits at the end. Per definition there are no padding * bits at the end in this case, so just skip it. */ ! if (!pkcs_rsa_decrypt (PKCS_PRIVATE, key, 0, tmp->data + 1, tmp->len - 1, &dec, &declen)) goto fail; if (!asn_template_clone (&digest, 1) *************** *** 767,775 **** goto fail; } tmp = asn_decompose ("digest.digestAlgorithm.algorithm", &digest); ! if (strcmp (ASN_ID_MD5, (char *)tmp->data)) { ! log_print ("x509_validate_signed: DigestAlgorithm is not MD5"); res = 0; } else --- 794,803 ---- goto fail; } tmp = asn_decompose ("digest.digestAlgorithm.algorithm", &digest); ! if (strcmp (ASN_ID_MD5, (char *)tmp->data) ! && strcmp (ASN_ID_SHA1, (char *)tmp->data)) { ! log_print ("x509_validate_signed: DigestAlgorithm is not MD5 or SHA1"); res = 0; } else