diff options
author | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2008-10-29 11:11:01 +0000 |
---|---|---|
committer | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2008-10-29 11:11:01 +0000 |
commit | 8b80ab5a6950ce6515f477624794defd7531642a (patch) | |
tree | aa8303f3806c5615fbeafc4dc82febe3cd7c24dc /scripts | |
parent | db67c87db3c9089ea8d2e14f617bf3d9e2af261f (diff) | |
download | vyos-strongswan-8b80ab5a6950ce6515f477624794defd7531642a.tar.gz vyos-strongswan-8b80ab5a6950ce6515f477624794defd7531642a.zip |
[svn-upgrade] Integrating new upstream version, strongswan (4.2.8)
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.am | 13 | ||||
-rw-r--r-- | scripts/Makefile.in | 511 | ||||
-rw-r--r-- | scripts/bin2array.c | 34 | ||||
-rw-r--r-- | scripts/bin2sql.c | 25 | ||||
-rw-r--r-- | scripts/id2sql.c | 36 | ||||
-rw-r--r-- | scripts/key2keyid.c | 71 | ||||
-rw-r--r-- | scripts/keyid2sql.c | 76 | ||||
-rw-r--r-- | scripts/thread_analysis.c | 273 |
8 files changed, 1039 insertions, 0 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am new file mode 100644 index 000000000..14e460eab --- /dev/null +++ b/scripts/Makefile.am @@ -0,0 +1,13 @@ +INCLUDES = -I$(top_srcdir)/src/libstrongswan +AM_CFLAGS =-DIPSEC_PLUGINDIR=\"${plugindir}\" + +noinst_PROGRAMS = bin2array bin2sql id2sql key2keyid keyid2sql thread_analysis +bin2array_SOURCES = bin2array.c +bin2sql_SOURCES = bin2sql.c +id2sql_SOURCES = id2sql.c +key2keyid_SOURCES = key2keyid.c +keyid2sql_SOURCES = keyid2sql.c +thread_analysis_SOURCES = thread_analysis.c +id2sql_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la +key2keyid_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la +keyid2sql_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la diff --git a/scripts/Makefile.in b/scripts/Makefile.in new file mode 100644 index 000000000..36c547b21 --- /dev/null +++ b/scripts/Makefile.in @@ -0,0 +1,511 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 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. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = bin2array$(EXEEXT) bin2sql$(EXEEXT) id2sql$(EXEEXT) \ + key2keyid$(EXEEXT) keyid2sql$(EXEEXT) thread_analysis$(EXEEXT) +subdir = scripts +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_bin2array_OBJECTS = bin2array.$(OBJEXT) +bin2array_OBJECTS = $(am_bin2array_OBJECTS) +bin2array_LDADD = $(LDADD) +am_bin2sql_OBJECTS = bin2sql.$(OBJEXT) +bin2sql_OBJECTS = $(am_bin2sql_OBJECTS) +bin2sql_LDADD = $(LDADD) +am_id2sql_OBJECTS = id2sql.$(OBJEXT) +id2sql_OBJECTS = $(am_id2sql_OBJECTS) +id2sql_DEPENDENCIES = \ + $(top_builddir)/src/libstrongswan/libstrongswan.la +am_key2keyid_OBJECTS = key2keyid.$(OBJEXT) +key2keyid_OBJECTS = $(am_key2keyid_OBJECTS) +key2keyid_DEPENDENCIES = \ + $(top_builddir)/src/libstrongswan/libstrongswan.la +am_keyid2sql_OBJECTS = keyid2sql.$(OBJEXT) +keyid2sql_OBJECTS = $(am_keyid2sql_OBJECTS) +keyid2sql_DEPENDENCIES = \ + $(top_builddir)/src/libstrongswan/libstrongswan.la +am_thread_analysis_OBJECTS = thread_analysis.$(OBJEXT) +thread_analysis_OBJECTS = $(am_thread_analysis_OBJECTS) +thread_analysis_LDADD = $(LDADD) +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(bin2array_SOURCES) $(bin2sql_SOURCES) $(id2sql_SOURCES) \ + $(key2keyid_SOURCES) $(keyid2sql_SOURCES) \ + $(thread_analysis_SOURCES) +DIST_SOURCES = $(bin2array_SOURCES) $(bin2sql_SOURCES) \ + $(id2sql_SOURCES) $(key2keyid_SOURCES) $(keyid2sql_SOURCES) \ + $(thread_analysis_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GPERF = @GPERF@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +IPSEC_ROUTING_TABLE = @IPSEC_ROUTING_TABLE@ +IPSEC_ROUTING_TABLE_PRIO = @IPSEC_ROUTING_TABLE_PRIO@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LINUX_HEADERS = @LINUX_HEADERS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +confdir = @confdir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gtk_CFLAGS = @gtk_CFLAGS@ +gtk_LIBS = @gtk_LIBS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +ipsecdir = @ipsecdir@ +ipsecgroup = @ipsecgroup@ +ipsecuser = @ipsecuser@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libstrongswan_plugins = @libstrongswan_plugins@ +linuxdir = @linuxdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +nm_CFLAGS = @nm_CFLAGS@ +nm_LIBS = @nm_LIBS@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +piddir = @piddir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +resolv_conf = @resolv_conf@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +simreader = @simreader@ +srcdir = @srcdir@ +strongswan_conf = @strongswan_conf@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +xml_CFLAGS = @xml_CFLAGS@ +xml_LIBS = @xml_LIBS@ +INCLUDES = -I$(top_srcdir)/src/libstrongswan +AM_CFLAGS = -DIPSEC_PLUGINDIR=\"${plugindir}\" +bin2array_SOURCES = bin2array.c +bin2sql_SOURCES = bin2sql.c +id2sql_SOURCES = id2sql.c +key2keyid_SOURCES = key2keyid.c +keyid2sql_SOURCES = keyid2sql.c +thread_analysis_SOURCES = thread_analysis.c +id2sql_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la +key2keyid_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la +keyid2sql_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu scripts/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +bin2array$(EXEEXT): $(bin2array_OBJECTS) $(bin2array_DEPENDENCIES) + @rm -f bin2array$(EXEEXT) + $(LINK) $(bin2array_OBJECTS) $(bin2array_LDADD) $(LIBS) +bin2sql$(EXEEXT): $(bin2sql_OBJECTS) $(bin2sql_DEPENDENCIES) + @rm -f bin2sql$(EXEEXT) + $(LINK) $(bin2sql_OBJECTS) $(bin2sql_LDADD) $(LIBS) +id2sql$(EXEEXT): $(id2sql_OBJECTS) $(id2sql_DEPENDENCIES) + @rm -f id2sql$(EXEEXT) + $(LINK) $(id2sql_OBJECTS) $(id2sql_LDADD) $(LIBS) +key2keyid$(EXEEXT): $(key2keyid_OBJECTS) $(key2keyid_DEPENDENCIES) + @rm -f key2keyid$(EXEEXT) + $(LINK) $(key2keyid_OBJECTS) $(key2keyid_LDADD) $(LIBS) +keyid2sql$(EXEEXT): $(keyid2sql_OBJECTS) $(keyid2sql_DEPENDENCIES) + @rm -f keyid2sql$(EXEEXT) + $(LINK) $(keyid2sql_OBJECTS) $(keyid2sql_LDADD) $(LIBS) +thread_analysis$(EXEEXT): $(thread_analysis_OBJECTS) $(thread_analysis_DEPENDENCIES) + @rm -f thread_analysis$(EXEEXT) + $(LINK) $(thread_analysis_OBJECTS) $(thread_analysis_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bin2array.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bin2sql.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/id2sql.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/key2keyid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyid2sql.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread_analysis.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + +# 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 --git a/scripts/bin2array.c b/scripts/bin2array.c new file mode 100644 index 000000000..4778b446a --- /dev/null +++ b/scripts/bin2array.c @@ -0,0 +1,34 @@ + +#include <stdio.h> + +/** + * convert standard input to binary data to a c array + */ +int main(int argc, char *argv[]) +{ + int i, end = 0; + unsigned char byte; + + printf("char %s[] = {\n", argc > 1 ? argv[1] : "data"); + while (1) + { + printf(" "); + for (i = 0; i < 16; i++) + { + if (fread(&byte, 1, 1, stdin) != 1) + { + end = 1; + break; + } + printf("0x%02x,", (unsigned int)byte); + } + printf("\n"); + if (end) + { + break; + } + } + printf("};\n"); + return 0; +} + diff --git a/scripts/bin2sql.c b/scripts/bin2sql.c new file mode 100644 index 000000000..4f83dd3f2 --- /dev/null +++ b/scripts/bin2sql.c @@ -0,0 +1,25 @@ + +#include <stdio.h> + +/** + * convert standard input to SQL hex binary + */ +int main(int argc, char *argv[]) +{ + int end = 0; + unsigned char byte; + + printf("X'"); + while (1) + { + if (fread(&byte, 1, 1, stdin) != 1) + { + end = 1; + break; + } + printf("%02x", (unsigned int)byte); + } + printf("'\n"); + return 0; +} + diff --git a/scripts/id2sql.c b/scripts/id2sql.c new file mode 100644 index 000000000..3990e88da --- /dev/null +++ b/scripts/id2sql.c @@ -0,0 +1,36 @@ + +#include <stdio.h> +#include <library.h> + +/** + * convert an identity to type and encoding + */ +int main(int argc, char *argv[]) +{ + identification_t *id; + chunk_t enc; + int i; + + if (argc < 2) + { + return -1; + } + + id = identification_create_from_string(argv[1]); + if (!id) + { + return -2; + } + printf("type\tencoding\n"); + printf("%d,\t", id->get_type(id)); + enc = id->get_encoding(id); + + printf("X'"); + for (i = 0; i < enc.len; i++) + { + printf("%02x", (unsigned int)enc.ptr[i]); + } + printf("'\n"); + return 0; +} + diff --git a/scripts/key2keyid.c b/scripts/key2keyid.c new file mode 100644 index 000000000..80c342919 --- /dev/null +++ b/scripts/key2keyid.c @@ -0,0 +1,71 @@ + +#include <stdio.h> +#include <library.h> +#include <debug.h> + +/** + * print the keyids of a private or public key + */ +int main(int argc, char *argv[]) +{ + public_key_t *public; + private_key_t *private; + chunk_t chunk; + char buf[8096]; + int read; + + library_init(NULL); + lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, "gmp pubkey sha1"); + atexit(library_deinit); + + read = fread(buf, 1, sizeof(buf), stdin); + if (read <= 0) + { + fprintf(stderr, "reading key failed.\n"); + return -1; + } + + chunk = chunk_create(buf, read); + + private = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, KEY_RSA, + BUILD_BLOB_ASN1_DER, chunk_clone(chunk), + BUILD_END); + if (private) + { + printf("parsed %d bits %N private key.\n", + private->get_keysize(private)*8, + key_type_names, private->get_type(private)); + printf("%N is:\t %D\n", id_type_names, ID_PUBKEY_INFO_SHA1, + private->get_id(private, ID_PUBKEY_INFO_SHA1)); + printf("%N is:\t %D\n", id_type_names, ID_PUBKEY_SHA1, + private->get_id(private, ID_PUBKEY_SHA1)); + private->destroy(private); + return 0; + } + + public = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_ANY, + BUILD_BLOB_ASN1_DER, chunk_clone(chunk), + BUILD_END); + if (!public) + { + public = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_RSA, + BUILD_BLOB_ASN1_DER, chunk_clone(chunk), + BUILD_END); + } + if (public) + { + printf("parsed %d bits %N public key.\n", + public->get_keysize(public)*8, + key_type_names, public->get_type(public)); + printf("%N is:\t %D\n", id_type_names, ID_PUBKEY_INFO_SHA1, + public->get_id(public, ID_PUBKEY_INFO_SHA1)); + printf("%N is:\t %D\n", id_type_names, ID_PUBKEY_SHA1, + public->get_id(public, ID_PUBKEY_SHA1)); + public->destroy(public); + return 0; + } + + fprintf(stderr, "unable to parse input key.\n"); + return -1; +} + diff --git a/scripts/keyid2sql.c b/scripts/keyid2sql.c new file mode 100644 index 000000000..f7d447a78 --- /dev/null +++ b/scripts/keyid2sql.c @@ -0,0 +1,76 @@ + +#include <stdio.h> +#include <library.h> +#include <debug.h> + +/** + * print the keyids of a private or public key in sql format + */ +int main(int argc, char *argv[]) +{ + public_key_t *public; + private_key_t *private; + identification_t *keyid; + chunk_t chunk; + char buf[8096]; + int read, n; + + library_init(NULL); + lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, "gmp pubkey sha1"); + atexit(library_deinit); + + read = fread(buf, 1, sizeof(buf), stdin); + if (read <= 0) + { + fprintf(stderr, "reading key failed.\n"); + return -1; + } + + chunk = chunk_create(buf, read); + + private = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, KEY_RSA, + BUILD_BLOB_ASN1_DER, chunk_clone(chunk), + BUILD_END); + if (private) + { + keyid = private->get_id(private, ID_PUBKEY_INFO_SHA1); + chunk = keyid->get_encoding(keyid); + + printf("%d, X'", ID_PUBKEY_INFO_SHA1); + for (n = 0; n < chunk.len; n++) + { + printf("%.2x", chunk.ptr[n]); + } + printf("'\n"); + private->destroy(private); + return 0; + } + + public = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_ANY, + BUILD_BLOB_ASN1_DER, chunk_clone(chunk), + BUILD_END); + if (!public) + { + public = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_RSA, + BUILD_BLOB_ASN1_DER, chunk_clone(chunk), + BUILD_END); + } + if (public) + { + keyid = public->get_id(public, ID_PUBKEY_INFO_SHA1); + chunk = keyid->get_encoding(keyid); + + printf("%d, X'", ID_PUBKEY_INFO_SHA1); + for (n = 0; n < chunk.len; n++) + { + printf("%.2x", chunk.ptr[n]); + } + printf("'\n"); + public->destroy(public); + return 0; + } + + fprintf(stderr, "unable to parse input key.\n"); + return -1; +} + diff --git a/scripts/thread_analysis.c b/scripts/thread_analysis.c new file mode 100644 index 000000000..a03e8c994 --- /dev/null +++ b/scripts/thread_analysis.c @@ -0,0 +1,273 @@ +/* Analyzes the concurrent use of charon's threads + * + * Copyright (C) 2008 Andreas Steffen + * Hochschule fuer Technik Rapperswil + * + * 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 of the License, or (at your + * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. + * + * 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. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define LOGFILE "moon.daemon.log" +#define LINE_LEN 2048 +#define THREADS 99 + +typedef enum state_t state_t; + +enum state_t { + STATE_IDLE = 0, + STATE_INIT = 1, + STATE_AUTH = 2, + STATE_BUSY = 3, + STATE_RETRY = 4, + STATE_ERROR = 5 +}; + +typedef enum mode_t mode_t; + +enum print_t { + MODE_ANY = 0, + MODE_ADD = 1, + MODE_DEL = 2 +}; + +static char *state_names[] = { "idle", "init", "auth", "busy", "retry", "error" }; + +static int readline(FILE *fd, char *line) +{ + while (fread(line, 1, 1, fd)) + { + if (*line == '\n') + { + *line = '\0'; + return 1; + } + line++; + } + *line = '\0'; + return 0; +} + +static void printline(state_t *state, char *timestamp) +{ + int states[] = { 0, 0, 0, 0, 0}; + int th, total ; + + printf(" <tr>\n"); + printf(" <td class=\"log\">%.15s</td>", timestamp); + + for (th = 1; th <= THREADS; th++) + { + states[state[th]]++; + printf("<td class=\"%s\"></td>", state_names[state[th]]); + } + total = states[STATE_INIT] + states[STATE_AUTH] + states[STATE_BUSY] + states[STATE_RETRY]; + printf("<td class=\"init\">%d</td><td class=\"auth\">%d</td><td class=\"busy\">%d</td>", + states[STATE_INIT], states[STATE_AUTH], total); + for (th = 10; th <= (THREADS + 2); th += 5) + { + printf("<td class=\"%s\"></td>", (th <= total + 2)? "busy":"idle"); + } + printf("\n"); + printf(" </tr>\n"); +} + +int main(int argc, char *argv[]) +{ + char line[LINE_LEN]; + int section = 0; + int mode = MODE_ANY; + int th; + FILE *fd; + + state_t state[THREADS + 1]; + + /* threads 1..5 and 9 are always busy */ + for (th = 1; th <= THREADS; th++) + { + state[th] = (th <= 5 || th == 9 )? STATE_BUSY : STATE_IDLE; + } + + /* open the log file */ + fd = fopen(LOGFILE, "r"); + if (!fd) + { + printf("could not open log file '%s'\n"); + return 1; + } + + printf("<html>\n"); + printf("<head>\n"); + printf(" <title>Charon Thread Analysis</title>\n"); + printf(" <style>\n"); + printf(" body { font: 11px verdana,arial, helvetica, sans-serif }\n"); + printf(" td { font: 10px verdana,arial, helvetica, sans-serif;\n"); + printf(" text-align: center; padding: 0px 1px 0px 1px; background: #FFFF66 }\n"); + printf(" td.log { text-align: left; background: #FFFF66; white-space: nowrap }\n"); + printf(" td.idle { background: #FFFF66 }\n"); + printf(" td.init { background: #FFA522 }\n"); + printf(" td.auth { background: #90EE90 }\n"); + printf(" td.busy { background: #ADD8E6 }\n"); + printf(" td.retry { background: #7B68EE }\n"); + printf(" td.error { background: #FF6347 }\n"); + printf(" hr { background-color: #000000; border: 0; height: 1px; }\n"); + printf(" a:visited { color: #000000 }\n"); + printf(" a:link { color: #000000 }\n"); + printf(" a:hover { color: #0000FF }\n"); + printf(" </style>\n"); + printf("</head>\n"); + printf("<body>\n"); + printf(" <h1>Charon Thread Analysis</h1>\n"); + printf(" <table>\n"); + + /* print table header */ + printf(" <tr>\n"); + printf(" <td class=\"log\">Timestamp</td>"); + for (th = 1 ; th <= THREADS; th++) + { + printf("<td>%02d</td>", th); + } + printf("<td class=\"init\">I</td><td class=\"auth\">A</td><td class=\"busy\">B</td>"); + for (th = 10; th <= (THREADS + 2); th += 5) + { + printf("<td class=\"busy\">%d</td>", (th == 100)? 99:th); + } + printf("\n"); + printf(" </tr>\n"); + + while (readline(fd, line)) + { + char *p_section, *p_charon, *p_thread, *p_log; + + p_section = strstr(line, "---"); + if (p_section) + { + printline(state, line); + mode = MODE_ANY; + + if (section++ < 1) + { + continue; + } + else + { + break; + } + } + + p_charon = strstr(line, "charon"); + if (!p_charon) + { + continue; + } + + /* determine thread */ + p_thread = p_charon + 8; + th = atol(p_thread); + + /* determine log message */ + p_log = p_charon + 16; + if (strstr(p_log, "received packet")) + { + if (mode == MODE_DEL) + { + printline(state, line); + } + mode = MODE_ADD; + if (state[th] != STATE_IDLE) + { + state[th] = STATE_ERROR; + } + else + { + state[th] = STATE_BUSY; + } + } + if (strstr(p_log, "sending packet")) + { + if (mode == MODE_ADD) + { + printline(state, line); + } + mode = MODE_DEL; + if (state[th] == STATE_IDLE) + { + state[th] = STATE_ERROR; + } + else + { + state[th] = STATE_IDLE; + } + } + if (strstr(p_log, "parsed IKE_SA_INIT request")) + { + if (state[th] != STATE_BUSY) + { + state[th] = STATE_ERROR; + } + else + { + state[th] = STATE_INIT; + } + } + if (strstr(p_log, "parsed IKE_AUTH request")) + { + if (state[th] != STATE_BUSY) + { + state[th] = STATE_ERROR; + } + else + { + state[th] = STATE_AUTH; + } + } + if (strstr(p_log, "already processing")) + { + if (state[th] != STATE_IDLE) + { + state[th] = STATE_ERROR; + } + else + { + state[th] = STATE_RETRY; + } + printline(state, line); + mode = MODE_ANY; + state[th] = STATE_IDLE; + } + } + printf(" </table>\n"); + printf(" <p>\n"); + printf(" <table>\n"); + printf(" <tr>\n"); + printf(" <td class=\"init\"> I </td><td>IKE_SA_INIT Thread </td>\n"); + printf(" <td class=\"auth\"> A </td><td>IKE_AUTH Thread </td>\n"); + printf(" <td class=\"retry\"> R </td><td>Retransmit Thread </td>\n"); + printf(" <td class=\"busy\"> B </td><td>Busy Thread </td>\n"); + printf(" <td class=\"error\"> E </td><td>State Error </td>\n"); + printf(" </tr>\n"); + printf(" </table>\n"); + printf(" <p>\n"); + printf(" <hr/>\n"); + printf(" <em>© 2008\n"); + printf(" <a href=\"http://ita.hsr.ch?&L=1\" target=\"popup\">\n"); + printf(" ITA Institute for Internet Technologies and Applications</a> -\n"); + printf(" <a href=\"http://www.hsr.ch/?&L=1\" target=\"popup\">\n"); + printf(" HSR Hochschule für Technik Rapperswil</a>\n"); + printf(" </em>\n"); + printf("</body>\n"); + printf("</html>\n"); + + fclose(fd); + return 0; +} |