Add axTLS sourcecode
authorSteven Barth <steven@midlink.org>
Sun, 22 Feb 2009 23:19:25 +0000 (23:19 +0000)
committerSteven Barth <steven@midlink.org>
Sun, 22 Feb 2009 23:19:25 +0000 (23:19 +0000)
218 files changed:
NOTICE
libs/nixio/.gitignore
libs/nixio/Makefile
libs/nixio/axTLS/.prepared [new file with mode: 0644]
libs/nixio/axTLS/Makefile [new file with mode: 0644]
libs/nixio/axTLS/README [new file with mode: 0644]
libs/nixio/axTLS/_stage/libaxtls.a [new file with mode: 0644]
libs/nixio/axTLS/_stage/libaxtls.so.1 [new symlink]
libs/nixio/axTLS/_stage/libaxtls.so.1.2 [new file with mode: 0755]
libs/nixio/axTLS/bindings/Config.in [new file with mode: 0644]
libs/nixio/axTLS/bindings/Makefile [new file with mode: 0644]
libs/nixio/axTLS/bindings/README [new file with mode: 0644]
libs/nixio/axTLS/bindings/csharp/Makefile [new file with mode: 0644]
libs/nixio/axTLS/bindings/csharp/axTLS.cs [new file with mode: 0644]
libs/nixio/axTLS/bindings/generate_SWIG_interface.pl [new file with mode: 0755]
libs/nixio/axTLS/bindings/generate_interface.pl [new file with mode: 0755]
libs/nixio/axTLS/bindings/java/Makefile [new file with mode: 0644]
libs/nixio/axTLS/bindings/java/SSL.java [new file with mode: 0644]
libs/nixio/axTLS/bindings/java/SSLCTX.java [new file with mode: 0644]
libs/nixio/axTLS/bindings/java/SSLClient.java [new file with mode: 0644]
libs/nixio/axTLS/bindings/java/SSLReadHolder.java [new file with mode: 0644]
libs/nixio/axTLS/bindings/java/SSLServer.java [new file with mode: 0644]
libs/nixio/axTLS/bindings/java/SSLUtil.java [new file with mode: 0644]
libs/nixio/axTLS/bindings/lua/Makefile [new file with mode: 0644]
libs/nixio/axTLS/bindings/perl/Makefile [new file with mode: 0644]
libs/nixio/axTLS/bindings/vbnet/Makefile [new file with mode: 0644]
libs/nixio/axTLS/bindings/vbnet/axTLSvb.vb [new file with mode: 0644]
libs/nixio/axTLS/config/.config [new file with mode: 0644]
libs/nixio/axTLS/config/Config.in [new file with mode: 0644]
libs/nixio/axTLS/config/JMeter.jmx [new file with mode: 0755]
libs/nixio/axTLS/config/Rules.mak [new file with mode: 0644]
libs/nixio/axTLS/config/axhttpd.aip [new file with mode: 0755]
libs/nixio/axTLS/config/axtls.RES [new file with mode: 0644]
libs/nixio/axTLS/config/axtls.rc [new file with mode: 0644]
libs/nixio/axTLS/config/config.h [new file with mode: 0644]
libs/nixio/axTLS/config/linuxconfig [new file with mode: 0644]
libs/nixio/axTLS/config/makefile.conf [new file with mode: 0644]
libs/nixio/axTLS/config/makefile.dotnet.conf [new file with mode: 0644]
libs/nixio/axTLS/config/makefile.java.conf [new file with mode: 0644]
libs/nixio/axTLS/config/makefile.post [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/Kconfig-language.txt [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/Makefile [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/conf.c [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/confdata.c [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/expr.c [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/expr.h [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/lex.zconf.c_shipped [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/lkc.h [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/lkc_proto.h [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/lxdialog/BIG.FAT.WARNING [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/lxdialog/checklist.c [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/lxdialog/colors.h [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/lxdialog/dialog.h [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/lxdialog/inputbox.c [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/lxdialog/menubox.c [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/lxdialog/msgbox.c [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/lxdialog/textbox.c [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/lxdialog/util.c [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/lxdialog/yesno.c [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/mconf.c [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/menu.c [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/mkconfigs [new file with mode: 0755]
libs/nixio/axTLS/config/scripts/config/symbol.c [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/util.c [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/zconf.l [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/zconf.tab.c_shipped [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/zconf.tab.h_shipped [new file with mode: 0644]
libs/nixio/axTLS/config/scripts/config/zconf.y [new file with mode: 0644]
libs/nixio/axTLS/config/win32config [new file with mode: 0644]
libs/nixio/axTLS/crypto/.depend [new file with mode: 0644]
libs/nixio/axTLS/crypto/Makefile [new file with mode: 0644]
libs/nixio/axTLS/crypto/aes.c [new file with mode: 0644]
libs/nixio/axTLS/crypto/bigint.c [new file with mode: 0644]
libs/nixio/axTLS/crypto/bigint.h [new file with mode: 0644]
libs/nixio/axTLS/crypto/bigint_impl.h [new file with mode: 0644]
libs/nixio/axTLS/crypto/crypto.h [new file with mode: 0644]
libs/nixio/axTLS/crypto/crypto_misc.c [new file with mode: 0644]
libs/nixio/axTLS/crypto/hmac.c [new file with mode: 0644]
libs/nixio/axTLS/crypto/md2.c [new file with mode: 0644]
libs/nixio/axTLS/crypto/md5.c [new file with mode: 0644]
libs/nixio/axTLS/crypto/rc4.c [new file with mode: 0644]
libs/nixio/axTLS/crypto/rsa.c [new file with mode: 0644]
libs/nixio/axTLS/crypto/sha1.c [new file with mode: 0644]
libs/nixio/axTLS/docsrc/Makefile [new file with mode: 0644]
libs/nixio/axTLS/docsrc/axTLS.dox [new file with mode: 0644]
libs/nixio/axTLS/docsrc/doco_footer.html [new file with mode: 0644]
libs/nixio/axTLS/docsrc/images/axolotl.jpg [new file with mode: 0644]
libs/nixio/axTLS/docsrc/images/tsbasbw.gif [new file with mode: 0644]
libs/nixio/axTLS/httpd/Config.in [new file with mode: 0644]
libs/nixio/axTLS/httpd/Makefile [new file with mode: 0644]
libs/nixio/axTLS/httpd/axhttp.h [new file with mode: 0644]
libs/nixio/axTLS/httpd/axhttpd.c [new file with mode: 0644]
libs/nixio/axTLS/httpd/htpasswd.c [new file with mode: 0644]
libs/nixio/axTLS/httpd/kepler-1.1-snapshot-20070521-1825.tar.gz [new file with mode: 0755]
libs/nixio/axTLS/httpd/kepler.patch [new file with mode: 0644]
libs/nixio/axTLS/httpd/proc.c [new file with mode: 0644]
libs/nixio/axTLS/httpd/tdate_parse.c [new file with mode: 0644]
libs/nixio/axTLS/samples/Config.in [new file with mode: 0644]
libs/nixio/axTLS/samples/Makefile [new file with mode: 0644]
libs/nixio/axTLS/samples/c/Makefile [new file with mode: 0644]
libs/nixio/axTLS/samples/c/axssl.c [new file with mode: 0644]
libs/nixio/axTLS/samples/csharp/Makefile [new file with mode: 0644]
libs/nixio/axTLS/samples/csharp/axssl.cs [new file with mode: 0644]
libs/nixio/axTLS/samples/java/Makefile [new file with mode: 0644]
libs/nixio/axTLS/samples/java/axssl.java [new file with mode: 0644]
libs/nixio/axTLS/samples/java/manifest.mf [new file with mode: 0644]
libs/nixio/axTLS/samples/lua/Makefile [new file with mode: 0644]
libs/nixio/axTLS/samples/lua/axssl.lua [new file with mode: 0755]
libs/nixio/axTLS/samples/perl/Makefile [new file with mode: 0644]
libs/nixio/axTLS/samples/perl/axssl.pl [new file with mode: 0755]
libs/nixio/axTLS/samples/vbnet/Makefile [new file with mode: 0644]
libs/nixio/axTLS/samples/vbnet/axssl.vb [new file with mode: 0644]
libs/nixio/axTLS/ssl/.depend [new file with mode: 0644]
libs/nixio/axTLS/ssl/BigIntConfig.in [new file with mode: 0644]
libs/nixio/axTLS/ssl/Config.in [new file with mode: 0644]
libs/nixio/axTLS/ssl/Makefile [new file with mode: 0644]
libs/nixio/axTLS/ssl/asn1.c [new file with mode: 0644]
libs/nixio/axTLS/ssl/cert.h [new file with mode: 0644]
libs/nixio/axTLS/ssl/crypto_misc.h [new file with mode: 0644]
libs/nixio/axTLS/ssl/gen_cert.c [new file with mode: 0644]
libs/nixio/axTLS/ssl/loader.c [new file with mode: 0644]
libs/nixio/axTLS/ssl/openssl.c [new file with mode: 0644]
libs/nixio/axTLS/ssl/os_port.c [new file with mode: 0644]
libs/nixio/axTLS/ssl/os_port.h [new file with mode: 0644]
libs/nixio/axTLS/ssl/p12.c [new file with mode: 0644]
libs/nixio/axTLS/ssl/private_key.h [new file with mode: 0644]
libs/nixio/axTLS/ssl/ssl.h [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/Makefile [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.ca_key.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.ca_x509.cer [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.ca_x509.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.device_key [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.device_key.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.encrypted.p8 [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.encrypted_pem.p8 [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.key_1024 [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.key_1024.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.key_2048 [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.key_2048.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.key_4096 [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.key_4096.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.key_512 [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.key_512.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.key_aes128.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.key_aes256.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.noname.p12 [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.unencrypted.p8 [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.unencrypted_pem.p8 [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.withCA.p12 [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.withoutCA.p12 [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.x509_1024.cer [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.x509_1024.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.x509_2048.cer [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.x509_2048.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.x509_4096.cer [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.x509_4096.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.x509_512.cer [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.x509_512.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.x509_aes128.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.x509_aes256.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.x509_bad_after.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.x509_bad_before.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.x509_device.cer [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/axTLS.x509_device.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/datatest.c [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/datatest.c.old [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/deutsche_telecom.x509_ca [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/equifax.x509_ca [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/gnutls.cer [new file with mode: 0755]
libs/nixio/axTLS/ssl/test/header_issue.dat [new file with mode: 0755]
libs/nixio/axTLS/ssl/test/killopenssl.sh [new file with mode: 0755]
libs/nixio/axTLS/ssl/test/make_certs.sh [new file with mode: 0755]
libs/nixio/axTLS/ssl/test/microsoft.x509_ca [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/microsoft.x509_ca.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/ms_iis.cer [new file with mode: 0755]
libs/nixio/axTLS/ssl/test/perf_bigint.c [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/socgen.cer [new file with mode: 0755]
libs/nixio/axTLS/ssl/test/ssltest.c [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/ssltest.c.bak [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/test_axssl.sh [new file with mode: 0755]
libs/nixio/axTLS/ssl/test/thawte.x509_ca [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/verisign.x509_ca [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/verisign.x509_ca.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/verisign.x509_my_cert [new file with mode: 0644]
libs/nixio/axTLS/ssl/test/verisign.x509_my_cert.pem [new file with mode: 0644]
libs/nixio/axTLS/ssl/tls1.c [new file with mode: 0755]
libs/nixio/axTLS/ssl/tls1.h [new file with mode: 0755]
libs/nixio/axTLS/ssl/tls1_clnt.c [new file with mode: 0644]
libs/nixio/axTLS/ssl/tls1_svr.c [new file with mode: 0644]
libs/nixio/axTLS/ssl/version.h [new file with mode: 0644]
libs/nixio/axTLS/ssl/x509.c [new file with mode: 0644]
libs/nixio/axTLS/www/bin/.htaccess [new file with mode: 0644]
libs/nixio/axTLS/www/favicon.ico [new file with mode: 0644]
libs/nixio/axTLS/www/index.html [new file with mode: 0755]
libs/nixio/axTLS/www/lua/download.lua [new file with mode: 0644]
libs/nixio/axTLS/www/lua/env.lua [new file with mode: 0644]
libs/nixio/axTLS/www/lua/overview.lp [new file with mode: 0644]
libs/nixio/axTLS/www/lua/prepara_sql2.lua [new file with mode: 0644]
libs/nixio/axTLS/www/lua/test_conc.lua [new file with mode: 0644]
libs/nixio/axTLS/www/lua/test_cookies.lp [new file with mode: 0644]
libs/nixio/axTLS/www/lua/test_cookies.lua [new file with mode: 0644]
libs/nixio/axTLS/www/lua/test_err.lua [new file with mode: 0644]
libs/nixio/axTLS/www/lua/test_fs.lua [new file with mode: 0644]
libs/nixio/axTLS/www/lua/test_htk.lua [new file with mode: 0644]
libs/nixio/axTLS/www/lua/test_lib.lua [new file with mode: 0644]
libs/nixio/axTLS/www/lua/test_main.html [new file with mode: 0644]
libs/nixio/axTLS/www/lua/test_main.lp [new file with mode: 0644]
libs/nixio/axTLS/www/lua/test_main.lua [new file with mode: 0644]
libs/nixio/axTLS/www/lua/test_session.lua [new file with mode: 0644]
libs/nixio/axTLS/www/lua/test_sql.lua [new file with mode: 0644]
libs/nixio/axTLS/www/lua/test_sql2.lua [new file with mode: 0644]
libs/nixio/axTLS/www/lua/test_variables.lp [new file with mode: 0644]
libs/nixio/axTLS/www/test_dir/bin/.htaccess [new file with mode: 0644]
libs/nixio/axTLS/www/test_dir/no_http/.htaccess [new file with mode: 0644]
libs/nixio/axTLS/www/test_dir/no_http/.htpasswd [new file with mode: 0644]
libs/nixio/axTLS/www/test_dir/no_http/index.html [new file with mode: 0644]
libs/nixio/axTLS/www/test_dir/no_ssl/.htaccess [new file with mode: 0644]
libs/nixio/axTLS/www/test_dir/no_ssl/index.html [new file with mode: 0644]

diff --git a/NOTICE b/NOTICE
index 1828792..c708e5e 100644 (file)
--- a/NOTICE
+++ b/NOTICE
@@ -6,3 +6,4 @@ Licensed under the Apache License, Version 2.0.
 Contains code from:
 coxpcall       - Copyright 2005 - Kepler Project (www.keplerproject.org)
 ltn12/luasocket - Copyright 2004-2007 Diego Nehab
+axTLS          - Copyright 2008 Cameron Rich
index 30c8853..d9c7ea0 100644 (file)
@@ -1 +1 @@
-axTLS
+src/libaxtls.a
index 61237af..57ff99a 100644 (file)
@@ -40,9 +40,9 @@ compile: $(NIXIO_OBJ)
        mkdir -p dist$(LUA_LIBRARYDIR)
        cp src/nixio.so dist$(LUA_LIBRARYDIR)/nixio.so
 
-$(AXTLS_DIR)/.prepared: $(AXTLS_FILE)
-       rm -rf $(AXTLS_DIR)
-       tar xvfz $(AXTLS_FILE)
+$(AXTLS_DIR)/.prepared:
+       #rm -rf $(AXTLS_DIR)
+       #tar xvfz $(AXTLS_FILE)
        cp axtls-config/{.config,config.h} $(AXTLS_DIR)/config
        touch $@
 
@@ -52,4 +52,4 @@ src/libaxtls.a: $(AXTLS_DIR)/.prepared
 
 clean: luaclean
        rm -f src/*.o src/*.so src/*.a
-       rm -rf $(AXTLS_DIR)
+       rm -f $(AXTLS_DIR)/.prepared
diff --git a/libs/nixio/axTLS/.prepared b/libs/nixio/axTLS/.prepared
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/libs/nixio/axTLS/Makefile b/libs/nixio/axTLS/Makefile
new file mode 100644 (file)
index 0000000..02c33d2
--- /dev/null
@@ -0,0 +1,181 @@
+#
+# Copyright (c) 2007, Cameron Rich
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of the axTLS project nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "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 COPYRIGHT OWNER OR
+# CONTRIBUTORS 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.
+#
+
+-include config/.config
+
+ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
+all: menuconfig
+else
+all: target
+endif
+
+include config/makefile.conf
+
+target : $(STAGE) $(TARGET)
+
+# VERSION has to come from the command line
+RELEASE=axTLS-$(VERSION)
+
+# standard version
+target:
+       $(MAKE) -C crypto
+       $(MAKE) -C ssl
+ifdef CONFIG_AXHTTPD
+       $(MAKE) -C httpd
+endif
+ifdef CONFIG_BINDINGS
+       $(MAKE) -C bindings
+endif
+ifdef CONFIG_SAMPLES
+       $(MAKE) -C samples
+endif
+
+$(STAGE) : ssl/version.h
+       @mkdir -p $(STAGE)
+
+# create a version file with something in it.
+ssl/version.h:
+       @echo "#define AXTLS_VERSION    \"(no version)\"" > ssl/version.h
+
+$(PREFIX) :
+       @mkdir -p $(PREFIX)/lib
+       @mkdir -p $(PREFIX)/bin
+
+release:
+       $(MAKE) -C config/scripts/config clean
+       -$(MAKE) clean
+       -@rm config/*.msi config/*.back.aip config/config.h config/.config*
+       -@rm www/index.20*
+       -@rm -fr $(STAGE)
+       @echo "#define AXTLS_VERSION    \"$(VERSION)\"" > ssl/version.h
+       cd ../; tar cvfz $(RELEASE).tar.gz --wildcards-match-slash --exclude .svn axTLS; cd -;
+
+docs:
+       $(MAKE) -C docsrc doco
+
+# build the Win32 demo release version
+win32_demo:
+       @echo "#define AXTLS_VERSION    \"$(VERSION)\"" > ssl/version.h
+       $(MAKE) win32releaseconf
+
+install: $(PREFIX) all
+       cp --no-dereference $(STAGE)/libax* $(PREFIX)/lib
+       chmod 755 $(PREFIX)/lib/libax* 
+ifdef CONFIG_SAMPLES
+       install -m 755 $(STAGE)/ax* $(PREFIX)/bin 
+endif
+ifdef CONFIG_HTTP_HAS_AUTHORIZATION
+       install -m 755 $(STAGE)/htpasswd $(PREFIX)/bin 
+endif
+ifdef CONFIG_PLATFORM_CYGWIN
+       install -m 755 $(STAGE)/cygaxtls.dll $(PREFIX)/bin 
+endif
+ifdef CONFIG_PERL_BINDINGS 
+       install -m 755 $(STAGE)/axtlsp.pm `perl -e 'use Config; print $$Config{installarchlib};'`
+endif
+       @mkdir -p -m 755 $(PREFIX)/include/axTLS
+       install -m 644 crypto/*.h $(PREFIX)/include/axTLS
+       install -m 644 ssl/*.h $(PREFIX)/include/axTLS
+       -rm $(PREFIX)/include/axTLS/cert.h
+       -rm $(PREFIX)/include/axTLS/private_key.h
+       install -m 644 config/config.h $(PREFIX)/include/axTLS
+
+installclean:
+       -@rm $(PREFIX)/lib/libax* > /dev/null 2>&1
+       -@rm $(PREFIX)/bin/ax* > /dev/null 2>&1
+       -@rm $(PREFIX)/bin/axhttpd* > /dev/null 2>&1
+       -@rm `perl -e 'use Config; print $$Config{installarchlib};'`/axtlsp.pm > /dev/null 2>&1
+
+test:
+       cd $(STAGE); ssltest; ../ssl/test/test_axssl.sh; cd -;
+
+# tidy up things
+clean::
+       @cd crypto; $(MAKE) clean
+       @cd ssl; $(MAKE) clean
+       @cd httpd; $(MAKE) clean
+       @cd samples; $(MAKE) clean
+       @cd docsrc; $(MAKE) clean
+       @cd bindings; $(MAKE) clean
+
+# ---------------------------------------------------------------------------
+# mconf stuff
+# ---------------------------------------------------------------------------
+
+CONFIG_CONFIG_IN = config/Config.in
+CONFIG_DEFCONFIG = config/defconfig
+
+config/scripts/config/conf: config/scripts/config/Makefile
+       $(MAKE) -C config/scripts/config conf
+       -@if [ ! -f config/.config ] ; then \
+               cp $(CONFIG_DEFCONFIG) config/.config; \
+       fi
+
+config/scripts/config/mconf: config/scripts/config/Makefile
+       $(MAKE) -C config/scripts/config ncurses conf mconf
+       -@if [ ! -f config/.config ] ; then \
+               cp $(CONFIG_DEFCONFIG) .config; \
+       fi
+
+cleanconf:
+       $(MAKE) -C config/scripts/config clean
+       @rm -f config/.config
+
+menuconfig: config/scripts/config/mconf
+       @./config/scripts/config/mconf $(CONFIG_CONFIG_IN)
+
+config: config/scripts/config/conf
+       @./config/scripts/config/conf $(CONFIG_CONFIG_IN)
+
+oldconfig: config/scripts/config/conf
+       @./config/scripts/config/conf -o $(CONFIG_CONFIG_IN)
+
+default: config/scripts/config/conf
+       @./config/scripts/config/conf -d $(CONFIG_CONFIG_IN) > /dev/null
+       $(MAKE)
+
+randconfig: config/scripts/config/conf
+       @./config/scripts/config/conf -r $(CONFIG_CONFIG_IN)
+
+allnoconfig: config/scripts/config/conf
+       @./config/scripts/config/conf -n $(CONFIG_CONFIG_IN)
+
+allyesconfig: config/scripts/config/conf
+       @./config/scripts/config/conf -y $(CONFIG_CONFIG_IN)
+
+# The special win32 release configuration
+win32releaseconf: config/scripts/config/conf
+       @./config/scripts/config/conf -D config/win32config $(CONFIG_CONFIG_IN) > /dev/null
+       $(MAKE)
+
+# The special linux release configuration
+linuxconf: config/scripts/config/conf
+       @./config/scripts/config/conf -D config/linuxconfig $(CONFIG_CONFIG_IN) > /dev/null
+       $(MAKE)
diff --git a/libs/nixio/axTLS/README b/libs/nixio/axTLS/README
new file mode 100644 (file)
index 0000000..c8926d9
--- /dev/null
@@ -0,0 +1,3 @@
+
+See www/index.html for the README, CHANGELOG, LICENSE and other notes.
+
diff --git a/libs/nixio/axTLS/_stage/libaxtls.a b/libs/nixio/axTLS/_stage/libaxtls.a
new file mode 100644 (file)
index 0000000..e1ea96e
Binary files /dev/null and b/libs/nixio/axTLS/_stage/libaxtls.a differ
diff --git a/libs/nixio/axTLS/_stage/libaxtls.so.1 b/libs/nixio/axTLS/_stage/libaxtls.so.1
new file mode 120000 (symlink)
index 0000000..587a460
--- /dev/null
@@ -0,0 +1 @@
+libaxtls.so.1.2
\ No newline at end of file
diff --git a/libs/nixio/axTLS/_stage/libaxtls.so.1.2 b/libs/nixio/axTLS/_stage/libaxtls.so.1.2
new file mode 100755 (executable)
index 0000000..440730b
Binary files /dev/null and b/libs/nixio/axTLS/_stage/libaxtls.so.1.2 differ
diff --git a/libs/nixio/axTLS/bindings/Config.in b/libs/nixio/axTLS/bindings/Config.in
new file mode 100644 (file)
index 0000000..12a696b
--- /dev/null
@@ -0,0 +1,105 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/config/Kconfig-language.txt
+#
+menu "Language Bindings"
+
+config CONFIG_BINDINGS
+    bool "Create language bindings"
+    default n
+    help
+        axTLS supports language bindings in C#, VB.NET, Java and Perl.
+
+        Select Y here if you want to build the various language bindings.
+
+config CONFIG_CSHARP_BINDINGS
+    bool "Create C# bindings"
+    default n
+    depends on CONFIG_BINDINGS
+    help
+        Build C# bindings.
+
+        This requires .NET to be installed on Win32 platforms and mono to be
+        installed on all other platforms.
+
+config CONFIG_VBNET_BINDINGS
+    bool "Create VB.NET bindings"
+    default n
+    depends on CONFIG_BINDINGS
+    help
+        Build VB.NET bindings.
+
+        This requires the .NET to be installed and is only built under Win32
+        platforms.
+
+menu ".Net Framework"
+depends on CONFIG_CSHARP_BINDINGS || CONFIG_VBNET_BINDINGS
+config CONFIG_DOT_NET_FRAMEWORK_BASE
+    string "Location of .NET Framework"
+    default "c:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727"
+endmenu
+
+config CONFIG_JAVA_BINDINGS
+    bool "Create Java bindings"
+    default n
+    depends on CONFIG_BINDINGS
+    help
+        Build Java bindings.
+
+        Current Issues (see README): 
+        * Needs Java 1.4 or better.
+        * If building under Win32 it will use the Win32 JDK.
+
+menu "Java Home"
+depends on CONFIG_JAVA_BINDINGS
+config CONFIG_JAVA_HOME
+    string "Location of JDK"
+    default "c:\\Program Files\\Java\\jdk1.5.0_06" if CONFIG_PLATFORM_WIN32 || CONFIG_PLATFORM_CYGWIN
+    default "/usr/local/jdk142" if !CONFIG_PLATFORM_WIN32 && !CONFIG_PLATFORM_CYGWIN
+    depends on CONFIG_JAVA_BINDINGS 
+    help
+        The location of Sun's JDK.
+endmenu
+
+config CONFIG_PERL_BINDINGS
+    bool "Create Perl bindings"
+    default n
+    depends on CONFIG_BINDINGS
+    help
+        Build Perl bindings.
+
+        Current Issues (see README):
+        * 64 bit versions don't work at present.
+        * libperl.so needs to be in the shared library path.
+
+menu "Perl Home"
+depends on CONFIG_PERL_BINDINGS && CONFIG_PLATFORM_WIN32
+config CONFIG_PERL_CORE
+    string "Location of Perl CORE"
+    default "c:\\perl\\lib\\CORE"
+    help:
+        works with ActiveState
+        "http://www.activestate.com/Products/ActivePerl"
+
+config CONFIG_PERL_LIB
+    string "Name of Perl Library"
+    default "perl58.lib"
+endmenu
+
+config CONFIG_LUA_BINDINGS
+    bool "Create Lua bindings"
+    default n
+    depends on CONFIG_BINDINGS && !CONFIG_PLATFORM_WIN32
+    help
+        Build Lua bindings (see www.lua.org).
+
+menu "Lua Home"
+depends on CONFIG_LUA_BINDINGS 
+config CONFIG_LUA_CORE
+    string "Location of Lua CORE"
+    default "/usr/local"
+    help:
+        If the Lua exists on another directory then this needs to be changed
+endmenu
+
+endmenu
diff --git a/libs/nixio/axTLS/bindings/Makefile b/libs/nixio/axTLS/bindings/Makefile
new file mode 100644 (file)
index 0000000..7654fbb
--- /dev/null
@@ -0,0 +1,86 @@
+#
+# Copyright (c) 2007, Cameron Rich
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of the axTLS project nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "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 COPYRIGHT OWNER OR
+# CONTRIBUTORS 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.
+#
+
+all:
+
+include ../config/.config
+include ../config/makefile.conf
+
+ifdef CONFIG_CSHARP_BINDINGS
+all: csharp/axInterface.cs
+endif
+
+ifdef CONFIG_VBNET_BINDINGS
+all: vbnet/axInterface.vb
+endif
+
+ifdef CONFIG_JAVA_BINDINGS
+all: java/axtlsj.java
+endif
+
+ifdef CONFIG_PERL_BINDINGS
+all: perl/axTLSp_wrap.c
+endif
+
+ifdef CONFIG_LUA_BINDINGS
+all: lua/axTLSl_wrap.c
+endif
+
+csharp/axInterface.cs: ../ssl/ssl.h
+       @perl ./generate_interface.pl -csharp
+
+vbnet/axInterface.vb: ../ssl/ssl.h
+       @perl ./generate_interface.pl -vbnet
+
+java/axTLSj.i: ../ssl/ssl.h
+       @perl ./generate_SWIG_interface.pl -java
+
+java/axtlsj.java: java/axTLSj.i $(wildcard java/SSL*.java)
+       @cd java; swig -java -package axTLSj axTLSj.i; $(MAKE)
+
+perl/axTLSp.i: ../ssl/ssl.h
+       @perl ./generate_SWIG_interface.pl -perl
+
+perl/axTLSp_wrap.c: perl/axTLSp.i
+       @cd perl; swig -perl5 axTLSp.i; $(MAKE)
+
+lua/axTLSl.i: ../ssl/ssl.h
+       @perl ./generate_SWIG_interface.pl -lua
+
+lua/axTLSl_wrap.c: lua/axTLSl.i
+       @cd lua; swig -lua axTLSl.i; $(MAKE)
+
+clean::
+       $(MAKE) -C csharp clean
+       $(MAKE) -C vbnet clean
+       $(MAKE) -C java clean
+       $(MAKE) -C perl clean
+       $(MAKE) -C lua clean
+
diff --git a/libs/nixio/axTLS/bindings/README b/libs/nixio/axTLS/bindings/README
new file mode 100644 (file)
index 0000000..8bc3109
--- /dev/null
@@ -0,0 +1,43 @@
+===============================================================================
+=                             Language Bindings                               =
+===============================================================================
+
+The tools to generate the various language bindings are done here.
+SWIG 1.3.24 or better is required for creating the Java and Perl bindings.
+
+Perl scripts are used to parse ssl.h and automagically give the appropriate 
+bindings.
+
+At present, the four languages supported are:
+
+* C#
+* VB.NET
+* Java
+* Perl
+
+To generate each binding run the following:
+
+C#:
+> generate_interface.pl -csharp
+
+VB.NET:
+> generate_interface.pl -vbnet
+
+
+Java:
+> generate_SWIG_interface.pl -java
+> cd java; swig -java -package axTLSj -noextern axTLSj.i
+
+Perl:
+> generate_SWIG_interface.pl -perl
+> cd perl; swig -noextern -perl axTLSp.i
+
+Java and Perl both create a library each called libaxtlsj.so and libaxtlsp.so 
+(or axtlsj.dll and atlsp.dll on Win32 platforms).
+
+Note: the "-noextern" is deprecated in swig 1.3.27 and newer. The "-noextern"
+option was required to get Win32 bindings to work (which is why is has probably
+been deprecated).
+
+Each binding (except for Perl) has an extra helper interface to make life 
+easier.
diff --git a/libs/nixio/axTLS/bindings/csharp/Makefile b/libs/nixio/axTLS/bindings/csharp/Makefile
new file mode 100644 (file)
index 0000000..3414f85
--- /dev/null
@@ -0,0 +1,35 @@
+#
+# Copyright (c) 2007, Cameron Rich
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of the axTLS project nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "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 COPYRIGHT OWNER OR
+# CONTRIBUTORS 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.
+#
+
+include ../../config/.config
+include ../../config/makefile.conf
+
+clean::
+       @rm -f axssl* axInterface.cs
diff --git a/libs/nixio/axTLS/bindings/csharp/axTLS.cs b/libs/nixio/axTLS/bindings/csharp/axTLS.cs
new file mode 100644 (file)
index 0000000..cf64a25
--- /dev/null
@@ -0,0 +1,491 @@
+/*
+ * Copyright (c) 2007, Cameron Rich
+ * 
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice, 
+ *   this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of the axTLS project nor the names of its contributors 
+ *   may be used to endorse or promote products derived from this software 
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 COPYRIGHT OWNER OR
+ * CONTRIBUTORS 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.
+ */
+
+/**
+ * A wrapper around the unmanaged interface to give a semi-decent C# API
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using System.Net.Sockets;
+
+/**
+ * @defgroup csharp_api C# API.
+ *
+ * Ensure that the appropriate Dispose() methods are called when finished with
+ * various objects - otherwise memory leaks will result.
+ * @{
+ */
+namespace axTLS
+{
+    /**
+     * @class SSL
+     * @ingroup csharp_api 
+     * @brief A representation of an SSL connection.
+     */
+    public class SSL
+    {
+        public IntPtr m_ssl;    /**< A pointer to the real SSL type */
+
+        /**
+         * @brief Store the reference to an SSL context.
+         * @param ip [in] A reference to an SSL object.
+         */
+        public SSL(IntPtr ip)
+        {
+            m_ssl = ip;
+        }
+
+        /**
+         * @brief Free any used resources on this connection. 
+         * 
+         * A "Close Notify" message is sent on this connection (if possible). 
+         * It is up to the application to close the socket.
+         */
+        public void Dispose()
+        {
+            axtls.ssl_free(m_ssl);
+        }
+
+        /**
+         * @brief Return the result of a handshake.
+         * @return SSL_OK if the handshake is complete and ok.
+         * @see ssl.h for the error code list.
+         */
+        public int HandshakeStatus()
+        {
+            return axtls.ssl_handshake_status(m_ssl);
+        }
+
+        /**
+         * @brief Return the SSL cipher id.
+         * @return The cipher id which is one of:
+         * - SSL_AES128_SHA (0x2f)
+         * - SSL_AES256_SHA (0x35)
+         * - SSL_RC4_128_SHA (0x05)
+         * - SSL_RC4_128_MD5 (0x04)
+         */
+        public byte GetCipherId()
+        {
+            return axtls.ssl_get_cipher_id(m_ssl);
+        }
+
+        /**
+         * @brief Get the session id for a handshake. 
+         * 
+         * This will be a 32 byte sequence and is available after the first
+         * handshaking messages are sent.
+         * @return The session id as a 32 byte sequence.
+         * @note A SSLv23 handshake may have only 16 valid bytes.
+         */
+        public byte[] GetSessionId()
+        {
+            IntPtr ptr = axtls.ssl_get_session_id(m_ssl);
+            byte sess_id_size = axtls.ssl_get_session_id_size(m_ssl);
+            byte[] result = new byte[sess_id_size];
+            Marshal.Copy(ptr, result, 0, sess_id_size);
+            return result;
+        }
+
+        /**
+         * @brief Retrieve an X.509 distinguished name component.
+         * 
+         * When a handshake is complete and a certificate has been exchanged, 
+         * then the details of the remote certificate can be retrieved.
+         *
+         * This will usually be used by a client to check that the server's 
+         * common name matches the URL.
+         *
+         * A full handshake needs to occur for this call to work.
+         *
+         * @param component [in] one of:
+         * - SSL_X509_CERT_COMMON_NAME
+         * - SSL_X509_CERT_ORGANIZATION
+         * - SSL_X509_CERT_ORGANIZATIONAL_NAME
+         * - SSL_X509_CA_CERT_COMMON_NAME
+         * - SSL_X509_CA_CERT_ORGANIZATION
+         * - SSL_X509_CA_CERT_ORGANIZATIONAL_NAME
+         * @return The appropriate string (or null if not defined)
+         */
+        public string GetCertificateDN(int component)
+        {
+            return axtls.ssl_get_cert_dn(m_ssl, component);
+        }
+    }
+
+    /**
+     * @class SSLUtil
+     * @ingroup csharp_api 
+     * @brief Some global helper functions.
+     */
+    public class SSLUtil
+    {
+
+        /**
+         * @brief Return the build mode of the axTLS project.
+         * @return The build mode is one of:
+         * - SSL_BUILD_SERVER_ONLY
+         * - SSL_BUILD_ENABLE_VERIFICATION
+         * - SSL_BUILD_ENABLE_CLIENT
+         * - SSL_BUILD_FULL_MODE
+         */
+        public static int BuildMode()
+        {
+            return axtls.ssl_get_config(axtls.SSL_BUILD_MODE);
+        }
+
+        /**
+         * @brief Return the number of chained certificates that the 
+         * client/server supports.
+         * @return The number of supported server certificates.
+         */
+        public static int MaxCerts()
+        {
+            return axtls.ssl_get_config(axtls.SSL_MAX_CERT_CFG_OFFSET);
+        }
+
+        /**
+         * @brief Return the number of CA certificates that the client/server
+         * supports.
+         * @return The number of supported CA certificates.
+         */
+        public static int MaxCACerts()
+        {
+            return axtls.ssl_get_config(axtls.SSL_MAX_CA_CERT_CFG_OFFSET);
+        }
+
+        /**
+         * @brief Indicate if PEM is supported.
+         * @return true if PEM supported.
+         */
+        public static bool HasPEM()
+        {
+            return axtls.ssl_get_config(axtls.SSL_HAS_PEM) > 0 ? true : false;
+        }
+
+        /**
+         * @brief Display the text string of the error.
+         * @param error_code [in] The integer error code.
+         */
+        public static void DisplayError(int error_code)
+        {
+            axtls.ssl_display_error(error_code);
+        }
+
+        /**
+         * @brief Return the version of the axTLS project.
+         */
+        public static string Version()
+        {
+            return axtls.ssl_version();
+        }
+    }
+
+    /**
+     * @class SSLCTX
+     * @ingroup csharp_api 
+     * @brief A base object for SSLServer/SSLClient.
+     */
+    public class SSLCTX
+    {
+        /**
+         * @brief A reference to the real client/server context.
+         */
+        protected IntPtr m_ctx;
+
+        /**
+         * @brief Establish a new client/server context.
+         *
+         * This function is called before any client/server SSL connections are 
+         * made.  If multiple threads are used, then each thread will have its 
+         * own SSLCTX context. Any number of connections may be made with a 
+         * single context. 
+         *
+         * Each new connection will use the this context's private key and 
+         * certificate chain. If a different certificate chain is required, 
+         * then a different context needs to be be used.
+         *
+         * @param options [in]  Any particular options. At present the options
+         * supported are:
+         * - SSL_SERVER_VERIFY_LATER (client only): Don't stop a handshake if 
+         * the server authentication fails. The certificate can be 
+         * authenticated later with a call to VerifyCert().
+         * - SSL_CLIENT_AUTHENTICATION (server only): Enforce client 
+         * authentication i.e. each handshake will include a "certificate 
+         * request" message from the server.
+         * - SSL_DISPLAY_BYTES (full mode build only): Display the byte 
+         * sequences during the handshake.
+         * - SSL_DISPLAY_STATES (full mode build only): Display the state 
+         * changes during the handshake.
+         * - SSL_DISPLAY_CERTS (full mode build only): Display the 
+         * certificates that are passed during a handshake.
+         * - SSL_DISPLAY_RSA (full mode build only): Display the RSA key 
+         * details that are passed during a handshake.
+         * @param num_sessions [in] The number of sessions to be used for 
+         * session caching. If this value is 0, then there is no session 
+         * caching.
+         * @return A client/server context.
+         */
+        protected SSLCTX(uint options, int num_sessions)
+        {
+            m_ctx = axtls.ssl_ctx_new(options, num_sessions);
+        }
+
+        /**
+         * @brief Remove a client/server context.
+         *
+         * Frees any used resources used by this context. Each connection will 
+         * be sent a "Close Notify" alert (if possible).
+         */
+        public void Dispose()
+        {
+            axtls.ssl_ctx_free(m_ctx);
+        }
+
+        /**
+         * @brief Read the SSL data stream.
+         * @param ssl [in] An SSL object reference.
+         * @param in_data [out] After a successful read, the decrypted data 
+         * will be here. It will be null otherwise.
+         * @return The number of decrypted bytes:
+         * - if > 0, then the handshaking is complete and we are returning the 
+         * number of decrypted bytes. 
+         * - SSL_OK if the handshaking stage is successful (but not yet 
+         * complete).  
+         * - < 0 if an error.
+         * @see ssl.h for the error code list.
+         * @note Use in_data before doing any successive ssl calls.
+         */
+        public int Read(SSL ssl, out byte[] in_data)
+        {
+            IntPtr ptr = IntPtr.Zero;
+            int ret = axtls.ssl_read(ssl.m_ssl, ref ptr);
+
+            if (ret > axtls.SSL_OK)
+            {
+                in_data = new byte[ret];
+                Marshal.Copy(ptr, in_data, 0, ret);
+            }
+            else
+            {
+                in_data = null;
+            }
+
+            return ret;
+        }
+
+        /**
+         * @brief Write to the SSL data stream.
+         * @param ssl [in] An SSL obect reference.
+         * @param out_data [in] The data to be written
+         * @return The number of bytes sent, or if < 0 if an error.
+         * @see ssl.h for the error code list.
+         */
+        public int Write(SSL ssl, byte[] out_data)
+        {
+            return axtls.ssl_write(ssl.m_ssl, out_data, out_data.Length);
+        }
+
+        /**
+         * @brief Write to the SSL data stream.
+         * @param ssl [in] An SSL obect reference.
+         * @param out_data [in] The data to be written
+         * @param out_len [in] The number of bytes to be written
+         * @return The number of bytes sent, or if < 0 if an error.
+         * @see ssl.h for the error code list.
+         */
+        public int Write(SSL ssl, byte[] out_data, int out_len)
+        {
+            return axtls.ssl_write(ssl.m_ssl, out_data, out_len);
+        }
+
+        /**
+         * @brief Find an ssl object based on a Socket reference.
+         *
+         * Goes through the list of SSL objects maintained in a client/server 
+         * context to look for a socket match.
+         * @param s [in] A reference to a <A HREF="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemnetsocketssocketclasstopic.asp">Socket</A> object.
+         * @return A reference to the SSL object. Returns null if the object 
+         * could not be found.
+         */
+        public SSL Find(Socket s)
+        {
+            int client_fd = s.Handle.ToInt32();
+            return new SSL(axtls.  ssl_find(m_ctx, client_fd));
+        }
+
+        /**
+         * @brief Authenticate a received certificate.
+         * 
+         * This call is usually made by a client after a handshake is complete 
+         * and the context is in SSL_SERVER_VERIFY_LATER mode.
+         * @param ssl [in] An SSL object reference.
+         * @return SSL_OK if the certificate is verified.
+         */
+        public int VerifyCert(SSL ssl)
+        {
+            return axtls.ssl_verify_cert(ssl.m_ssl);
+        }
+
+        /**
+         * @brief Force the client to perform its handshake again.
+         *
+         * For a client this involves sending another "client hello" message.
+         * For the server is means sending a "hello request" message.
+         *
+         * This is a blocking call on the client (until the handshake 
+         * completes).
+         * @param ssl [in] An SSL object reference.
+         * @return SSL_OK if renegotiation instantiation was ok
+         */
+        public int Renegotiate(SSL ssl)
+        {
+            return axtls.ssl_renegotiate(ssl.m_ssl);
+        }
+
+        /**
+         * @brief Load a file into memory that is in binary DER or ASCII PEM 
+         * format.
+         *
+         * These are temporary objects that are used to load private keys,
+         * certificates etc into memory.
+         * @param obj_type [in] The format of the file. Can be one of:
+         * - SSL_OBJ_X509_CERT (no password required)
+         * - SSL_OBJ_X509_CACERT (no password required)
+         * - SSL_OBJ_RSA_KEY (AES128/AES256 PEM encryption supported)
+         * - SSL_OBJ_P8 (RC4-128 encrypted data supported)
+         * - SSL_OBJ_P12 (RC4-128 encrypted data supported)
+         *
+         * PEM files are automatically detected (if supported).
+         * @param filename [in] The location of a file in DER/PEM format.
+         * @param password [in] The password used. Can be null if not required.
+         * @return SSL_OK if all ok
+         */
+        public int ObjLoad(int obj_type, string filename, string password)
+        {
+            return axtls.ssl_obj_load(m_ctx, obj_type, filename, password);
+        }
+
+        /**
+         * @brief Transfer binary data into the object loader.
+         *
+         * These are temporary objects that are used to load private keys,
+         * certificates etc into memory.
+         * @param obj_type [in] The format of the memory data.
+         * @param data [in] The binary data to be loaded.
+         * @param len [in] The amount of data to be loaded.
+         * @param password [in] The password used. Can be null if not required.
+         * @return SSL_OK if all ok
+         */
+        public int ObjLoad(int obj_type, byte[] data, int len, string password)
+        {
+            return axtls.ssl_obj_memory_load(m_ctx, obj_type, 
+                                            data, len, password);
+        }
+    }
+
+    /**
+     * @class SSLServer
+     * @ingroup csharp_api 
+     * @brief The server context.
+     *
+     * All server connections are started within a server context.
+     */
+    public class SSLServer : SSLCTX
+    {
+        /**
+         * @brief Start a new server context.
+         * 
+         * @see SSLCTX for details.
+         */
+        public SSLServer(uint options, int num_sessions) :
+                            base(options, num_sessions) {}
+
+        /**
+         * @brief Establish a new SSL connection to an SSL client.
+         *
+         * It is up to the application to establish the initial socket 
+         * connection.
+         *
+         * Call Dispose() when the connection is to be removed.
+         * @param s [in] A reference to a <A HREF="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemnetsocketssocketclasstopic.asp">Socket</A> object.
+         * @return An SSL object reference.
+         */
+        public SSL Connect(Socket s)
+        {
+            int client_fd = s.Handle.ToInt32();
+            return new SSL(axtls.ssl_server_new(m_ctx, client_fd));
+        }
+    }
+
+    /**
+     * @class SSLClient
+     * @ingroup csharp_api
+     * @brief The client context.
+     *
+     * All client connections are started within a client context.
+     */
+    public class SSLClient : SSLCTX
+    {
+        /**
+         * @brief Start a new client context.
+         * 
+         * @see SSLCTX for details.
+         */
+        public SSLClient(uint options, int num_sessions) :
+                        base(options, num_sessions) {}
+
+        /**
+         * @brief Establish a new SSL connection to an SSL server.
+         *
+         * It is up to the application to establish the initial socket 
+         * connection.
+         *
+         * This is a blocking call - it will finish when the handshake is 
+         * complete (or has failed).
+         *
+         * Call Dispose() when the connection is to be removed.
+         * @param s [in] A reference to a <A HREF="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemnetsocketssocketclasstopic.asp">Socket</A> object.
+         * @param session_id [in] A 32 byte session id for session resumption. 
+         * This can be null if no session resumption is not required.
+         * @return An SSL object reference. Use SSL.handshakeStatus() to check 
+         * if a handshake succeeded.
+         */
+        public SSL Connect(Socket s, byte[] session_id)
+        {
+            int client_fd = s.Handle.ToInt32();
+            byte sess_id_size = (byte)(session_id != null ? 
+                                session_id.Length : 0);
+            return new SSL(axtls.ssl_client_new(m_ctx, client_fd, session_id,
+                        sess_id_size));
+        }
+    }
+}
+/** @} */
diff --git a/libs/nixio/axTLS/bindings/generate_SWIG_interface.pl b/libs/nixio/axTLS/bindings/generate_SWIG_interface.pl
new file mode 100755 (executable)
index 0000000..4b25179
--- /dev/null
@@ -0,0 +1,393 @@
+#!/usr/bin/perl
+
+#
+# Copyright (c) 2007, Cameron Rich
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of the axTLS project nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "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 COPYRIGHT OWNER OR
+# CONTRIBUTORS 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.
+#
+
+#===============================================================
+# Transforms function signature into SWIG format
+sub transformSignature
+{
+    foreach $item (@_)
+    { 
+        $line =~ s/STDCALL //g;
+        $line =~ s/EXP_FUNC/extern/g;
+
+        # make API Java more 'byte' friendly
+        $line =~ s/uint32_t/int/g;
+        $line =~ s/const uint8_t \* /const unsigned char \* /g;
+        $line =~ s/\(void\)/()/g;
+        if ($ARGV[0] eq "-java")
+        {
+            $line =~ s/.*ssl_read.*//g;
+            $line =~ s/const uint8_t \*(\w+)/const signed char $1\[\]/g;
+            $line =~ s/uint8_t/signed char/g;
+        }
+        elsif ($ARGV[0] eq "-perl")
+        {
+            $line =~ s/const uint8_t \*(\w+)/const unsigned char $1\[\]/g;
+            $line =~ s/uint8_t/unsigned char/g;
+        }
+        else # lua
+        {
+            $line =~ s/const uint8_t \*session_id/const unsigned char session_id\[\]/g;
+            $line =~ s/const uint8_t \*\w+/unsigned char *INPUT/g;
+            $line =~ s/uint8_t/unsigned char/g;
+        }
+    }
+
+    return $line;
+}
+
+# Parse input file
+sub parseFile
+{
+    foreach $line (@_)
+    {
+        next if $line =~ /ssl_x509_create/; # ignore for now
+
+        # test for a #define
+        if (!$skip && $line =~ m/^#define/)
+        {
+            $splitDefine = 1 if $line =~ m/\\$/;
+            print DATA_OUT $line;
+
+            # check line is not split
+            next if $splitDefine == 1;
+        }
+
+        # pick up second line of #define statement
+        if ($splitDefine) 
+        {
+            print DATA_OUT $line;
+
+            # check line is not split
+            $splitDefine = ($line =~ m/\\$/);
+            next;
+        } 
+
+        # test for function declaration
+        if (!$skip && $line =~ /EXP_FUNC/ && $line !~/\/\*/)
+        {
+            $line = transformSignature($line);
+            $splitFunctionDeclaration = $line !~ /;/;
+            print DATA_OUT $line;
+            next;
+        }
+
+        if ($splitFunctionDeclaration) 
+        {
+            $line = transformSignature($line);
+            $splitFunctionDeclaration = $line !~ /;/;
+            print DATA_OUT $line;
+            next;
+        }
+    }
+}
+
+#===============================================================
+
+# Determine which module to build from cammand-line options
+use strict;
+use Getopt::Std;
+
+my $module;
+my $interfaceFile;
+my $data_file;
+my $skip;
+my $splitLine;
+my @raw_data;
+
+if (not defined  $ARGV[0])
+{
+    goto ouch;
+}
+
+if ($ARGV[0] eq "-java")
+{
+    print "Generating Java interface file\n";
+    $module = "axtlsj";
+    $interfaceFile = "java/axTLSj.i";
+}
+elsif ($ARGV[0] eq "-perl")
+{
+    print "Generating Perl interface file\n";
+    $module = "axtlsp";
+    $interfaceFile = "perl/axTLSp.i";
+}
+elsif ($ARGV[0] eq "-lua")
+{
+    print "Generating lua interface file\n";
+    $module = "axtlsl";
+    $interfaceFile = "lua/axTLSl.i";
+}
+else
+{
+ouch:
+    die "Usage: $0 [-java | -perl | -lua]\n";
+}
+
+# Input file required to generate SWIG interface file.
+$data_file = "../ssl/ssl.h";
+
+# Open input files
+open(DATA_IN, $data_file) || die("Could not open file ($data_file)!");
+@raw_data = <DATA_IN>;
+
+# Open output file
+open(DATA_OUT, ">$interfaceFile") || die("Cannot Open File");
+
+#
+# I wish I could say it was easy to generate the Perl/Java/Lua bindings, 
+# but each had their own set of challenges... :-(.
+#
+print DATA_OUT << "END";
+%module $module\n
+
+/* include our own header */
+%inline %{
+#include "ssl.h"
+%}
+
+%include "typemaps.i"
+/* Some SWIG magic to make the API a bit more Java friendly */
+#ifdef SWIGJAVA
+
+%apply long { SSL * };
+%apply long { SSL_CTX * };
+%apply long { SSLObjLoader * };
+
+/* allow "unsigned char []" to become "byte[]" */
+%include "arrays_java.i"
+
+/* convert these pointers to use long */
+%apply signed char[] {unsigned char *};
+%apply signed char[] {signed char *};
+
+/* allow ssl_get_session_id() to return "byte[]" */
+%typemap(out) unsigned char * ssl_get_session_id \"if (result) jresult = SWIG_JavaArrayOutSchar(jenv, result, ssl_get_session_id_size((SSL const *)arg1));\"
+
+/* allow ssl_client_new() to have a null session_id input */
+%typemap(in) const signed char session_id[] (jbyte *jarr) {
+    if (jarg3 == NULL)
+    {
+        jresult = (jint)ssl_client_new(arg1,arg2,NULL,0);
+        return jresult;
+    }
+    
+    if (!SWIG_JavaArrayInSchar(jenv, &jarr, &arg3, jarg3)) return 0;
+}   
+
+/* Lot's of work required for an ssl_read() due to its various custom
+ * requirements.
+ */
+%native (ssl_read) int ssl_read(SSL *ssl, jobject in_data);
+%{
+JNIEXPORT jint JNICALL Java_axTLSj_axtlsjJNI_ssl_1read(JNIEnv *jenv, jclass jcls, jint jarg1, jobject jarg2) {
+    jint jresult = 0 ;
+    SSL *arg1;
+    unsigned char *arg2;
+    jbyte *jarr;
+    int result;
+    JNIEnv e = *jenv;
+    jclass holder_class;
+    jfieldID fid;
+
+    arg1 = (SSL *)jarg1;
+    result = (int)ssl_read(arg1, &arg2);
+
+    /* find the "m_buf" entry in the SSLReadHolder class */
+    if (!(holder_class = e->GetObjectClass(jenv,jarg2)) ||
+            !(fid = e->GetFieldID(jenv,holder_class, "m_buf", "[B")))
+        return SSL_NOT_OK;
+
+    if (result > SSL_OK)
+    {
+        int i;
+
+        /* create a new byte array to hold the read data */
+        jbyteArray jarray = e->NewByteArray(jenv, result);
+
+        /* copy the bytes across to the java byte array */
+        jarr = e->GetByteArrayElements(jenv, jarray, 0);
+        for (i = 0; i < result; i++)
+            jarr[i] = (jbyte)arg2[i];
+
+        /* clean up and set the new m_buf object */
+        e->ReleaseByteArrayElements(jenv, jarray, jarr, 0);
+        e->SetObjectField(jenv, jarg2, fid, jarray);
+    }
+    else    /* set to null */
+        e->SetObjectField(jenv, jarg2, fid, NULL);
+
+    jresult = (jint)result;
+    return jresult;
+}
+%}
+
+/* Big hack to get hold of a socket's file descriptor */
+%typemap (jtype) long "Object"
+%typemap (jstype) long "Object"
+%native (getFd) int getFd(long sock);
+%{
+JNIEXPORT jint JNICALL Java_axTLSj_axtlsjJNI_getFd(JNIEnv *env, jclass jcls, jobject sock)
+{
+    JNIEnv e = *env;
+    jfieldID fid;
+    jobject impl;
+    jobject fdesc;
+
+    /* get the SocketImpl from the Socket */
+    if (!(jcls = e->GetObjectClass(env,sock)) ||
+            !(fid = e->GetFieldID(env,jcls,"impl","Ljava/net/SocketImpl;")) ||
+            !(impl = e->GetObjectField(env,sock,fid))) return -1;
+
+    /* get the FileDescriptor from the SocketImpl */
+    if (!(jcls = e->GetObjectClass(env,impl)) ||
+            !(fid = e->GetFieldID(env,jcls,"fd","Ljava/io/FileDescriptor;")) ||
+            !(fdesc = e->GetObjectField(env,impl,fid))) return -1;
+
+    /* get the fd from the FileDescriptor */
+    if (!(jcls = e->GetObjectClass(env,fdesc)) ||
+            !(fid = e->GetFieldID(env,jcls,"fd","I"))) return -1;
+
+    /* return the descriptor */
+    return e->GetIntField(env,fdesc,fid);
+} 
+%}
+
+#endif
+
+/* Some SWIG magic to make the API a bit more Perl friendly */
+#ifdef SWIGPERL
+
+/* for ssl_session_id() */
+%typemap(out) const unsigned char * {
+    SV *svs = newSVpv((unsigned char *)\$1, ssl_get_session_id_size((SSL const *)arg1));
+    \$result = newRV(svs);
+    sv_2mortal(\$result);
+    argvi++;
+}
+
+/* for ssl_write() */
+%typemap(in) const unsigned char out_data[] {
+    SV* tempsv;
+    if (!SvROK(\$input))
+        croak("Argument \$argnum is not a reference.");
+    tempsv = SvRV(\$input);
+    if (SvTYPE(tempsv) != SVt_PV)
+        croak("Argument \$argnum is not an string.");
+    \$1 = (unsigned char *)SvPV(tempsv, PL_na);
+}
+
+/* for ssl_read() */
+%typemap(in) unsigned char **in_data (unsigned char *buf) {
+    \$1 = &buf;
+}
+
+%typemap(argout) unsigned char **in_data { 
+    if (result > SSL_OK) {
+        SV *svs = newSVpv(*\$1, result);
+        \$result = newRV(svs);
+        sv_2mortal(\$result);
+        argvi++;
+    }
+}
+
+/* for ssl_client_new() */
+%typemap(in) const unsigned char session_id[] {
+    /* check for a reference */
+    if (SvOK(\$input) && SvROK(\$input)) {
+        SV* tempsv = SvRV(\$input);
+        if (SvTYPE(tempsv) != SVt_PV)
+            croak("Argument \$argnum is not an string.");
+        \$1 = (unsigned char *)SvPV(tempsv, PL_na); 
+    } 
+    else
+        \$1 = NULL;
+}
+
+#endif
+
+/* Some SWIG magic to make the API a bit more Lua friendly */
+#ifdef SWIGLUA
+SWIG_NUMBER_TYPEMAP(unsigned char);
+SWIG_TYPEMAP_NUM_ARR(uchar,unsigned char);
+
+/* for ssl_session_id() */
+%typemap(out) const unsigned char * {
+    int i;
+    lua_newtable(L);
+    for (i = 0; i < ssl_get_session_id_size((SSL const *)arg1); i++){
+        lua_pushnumber(L,(lua_Number)result[i]);
+        lua_rawseti(L,-2,i+1); /* -1 is the number, -2 is the table */
+    }
+    SWIG_arg++;
+}
+
+/* for ssl_read() */
+%typemap(in) unsigned char **in_data (unsigned char *buf) {
+    \$1 = &buf;
+}
+
+%typemap(argout) unsigned char **in_data { 
+    if (result > SSL_OK) {
+               int i;
+               lua_newtable(L);
+               for (i = 0; i < result; i++){
+                       lua_pushnumber(L,(lua_Number)buf2[i]);
+                       lua_rawseti(L,-2,i+1); /* -1 is the number, -2 is the table */
+               }
+        SWIG_arg++;
+    }
+}
+
+/* for ssl_client_new() */
+%typemap(in) const unsigned char session_id[] {
+    if (lua_isnil(L,\$input))
+        \$1 = NULL;
+    else
+        \$1 = SWIG_get_uchar_num_array_fixed(L,\$input, ssl_get_session_id((SSL const *)\$1));
+}
+
+#endif
+
+END
+
+# Initialise loop variables
+$skip = 1;
+$splitLine = 0;
+
+parseFile(@raw_data);
+
+close(DATA_IN);
+close(DATA_OUT);
+
+#===============================================================
+
diff --git a/libs/nixio/axTLS/bindings/generate_interface.pl b/libs/nixio/axTLS/bindings/generate_interface.pl
new file mode 100755 (executable)
index 0000000..c24bff9
--- /dev/null
@@ -0,0 +1,322 @@
+#!/usr/bin/perl -w
+
+#
+# Copyright (c) 2007, Cameron Rich
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of the axTLS project nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "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 COPYRIGHT OWNER OR
+# CONTRIBUTORS 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 application transforms ssl.h into interfaces that can be used by 
+# other language bindings. It is "SWIG"-like in nature in that various 
+# files are generated based on the axTLS API.
+#
+# The file produced is axInterface.? (depending on the file extension).
+#
+#===============================================================
+
+use strict;
+
+my $CSHARP = 0;
+my $VBNET = 1;
+
+my $binding;
+my $skip = 0;
+my $signature_ret_type;
+
+# Transforms function signature into an Interface format
+sub transformSignature
+{
+    my $item;
+    my ($line) = @_;
+
+    foreach $item ($line)
+    { 
+        # our very basic preprocessor
+        if ($binding == $CSHARP)
+        {
+            $line =~ s/STDCALL //;
+            $line =~ s/EXP_FUNC/        [DllImport ("axtls")]\n        public static extern/;
+            $line =~ s/uint32_t/uint/g;
+            $line =~ s/uint8_t \*\*/ref IntPtr /g;
+            $line =~ s/const uint8_t \* /IntPtr /g;
+            $line =~ s/const uint8_t \*/byte[] /g;    # note: subtle diff 
+            $line =~ s/uint8_t \* ?/byte[] /g;
+            $line =~ s/uint8_t ?/byte /g;
+            $line =~ s/const char \* ?/string /g;
+            $line =~ s/const SSL_CTX \* ?/IntPtr /g;
+            $line =~ s/SSL_CTX \* ?/IntPtr /g;
+            $line =~ s/SSLObjLoader \* ?/IntPtr /g;
+            $line =~ s/const SSL \* ?/IntPtr /g;
+            $line =~ s/SSL \* ?/IntPtr /g;
+            $line =~ s/\(void\)/()/g;
+        }
+        elsif ($binding == $VBNET)
+        {
+            if ($line =~ /EXP_FUNC/)
+            {
+                # Procedure or function?
+                my $invariant = $line =~ /void /;
+
+                my $proc = $invariant ? "Sub" : "Function";
+                ($signature_ret_type) = $line =~ /EXP_FUNC (.*) STDCALL/;
+                $line =~ s/EXP_FUNC .* STDCALL /        <DllImport("axtls")> Public Shared $proc _\n            /;
+
+                $signature_ret_type =~ s/const uint8_t \*/As IntPtr/;
+                $signature_ret_type =~ s/const char \*/As String/;
+                $signature_ret_type =~ s/SSL_CTX \*/As IntPtr/;
+                $signature_ret_type =~ s/SSLObjLoader \*/As IntPtr/;
+                $signature_ret_type =~ s/SSL \*/As IntPtr/;
+                $signature_ret_type =~ s/uint8_t/As Byte/;
+                $signature_ret_type =~ s/int/As Integer/;
+                $signature_ret_type =~ s/void//;
+                $signature_ret_type .= "\n        End $proc\n\n";
+            }
+
+            $line =~ s/uint32_t (\w+)/ByVal $1 As Integer/g;
+            $line =~ s/int (\w+)/ByVal $1 As Integer/g;
+            $line =~ s/uint8_t \*\* ?(\w+)/ByRef $1 As IntPtr/g;
+            $line =~ s/const uint8_t \* ?(\w+)/ByVal $1() As Byte/g;
+            $line =~ s/uint8_t \* ?(\w+)/ByVal $1() As Byte/g;
+            $line =~ s/uint8_t ?(\w+)/ByVal $1 As Byte/g;
+            $line =~ s/const char \* ?(\w+)/ByVal $1 As String/g;
+            $line =~ s/const SSL_CTX \* ?(\w+)/ByVal $1 As IntPtr/g;
+            $line =~ s/SSL_CTX \* ?(\w+)/ByVal $1 As IntPtr/g;
+            $line =~ s/SSLObjLoader \* ?(\w+)/ByVal $1 As IntPtr/g;
+            $line =~ s/const SSL \* ?(\w+)/ByVal $1 As IntPtr/g;
+            $line =~ s/SSL \* ?(\w+)/ByVal $1 As IntPtr/g;
+            $line =~ s/void \* ?(\w+)/Byval $1 As IntPtr/g;
+            $line =~ s/\(void\)/()/g;
+            $line =~ s/void//g;
+            $line =~ s/;\n/ $signature_ret_type;/;
+        }
+    }
+
+    return $line;
+}
+
+# Parse input file
+sub parseFile
+{
+    my (@file) = @_;
+    my $line;
+    my $splitDefine = 0;
+    my $splitFunctionDeclaration;
+    my $vb_hack = " ";
+    my $vb_line_hack = 0;
+
+    $skip = 0;
+
+    foreach $line (@file)
+    {
+        next if $line =~ /sl_x509_create/;  # ignore for now
+
+        # test for a #define
+        if (!$skip && $line =~ m/^#define/)
+        {
+            $splitDefine = 1 if $line =~ m/\\$/;
+
+            if ($binding == $VBNET)
+            {
+                $line =~ s/\|/Or/g;
+                $line =~ s/ 0x/ &H/;
+            }
+
+            my ($name, $value) = $line =~ /#define (\w+) +([^\\]*)[\\]?\n/;
+
+            if (defined $name && defined $value)
+            {
+                # C# constant translation
+                if ($binding == $CSHARP)
+                {
+                    $line = "        public const int $name = $value";
+                }
+                # VB.NET constant translation
+                elsif ($binding == $VBNET)
+                {
+                    $line = "        Public Const $name As Integer = $value";
+                }
+            }
+
+            next if $line =~ /#define/;  # ignore any other defines
+               
+            print DATA_OUT $line;
+
+            # check line is not split
+            next if $splitDefine == 1;
+            print DATA_OUT ";" if $binding == $CSHARP;
+            print DATA_OUT "\n";
+        }
+
+        # pick up second line of #define statement
+        if ($splitDefine) 
+        {
+            if ($line !~ /\\$/)
+            {
+                $line =~ s/$/;/ if $binding == $CSHARP;        # add the ";"
+            }
+
+            $line =~ s/ ?\| ?/ Or /g 
+                                if ($binding == $VBNET);
+
+            # check line is not split
+            $splitDefine = ($line =~ m/\\$/);
+
+            # ignore trailing "\"
+            $line =~ s/\\$// if $binding == $CSHARP;
+            $line =~ s/\\$/_/ if $binding == $VBNET;
+            print DATA_OUT $line;
+            next;
+        } 
+
+        # test for function declaration
+        if (!$skip && $line =~ /EXP_FUNC/ && $line !~ /\/\*/)
+        {
+            $line = transformSignature($line);
+            $splitFunctionDeclaration = $line !~ /;/;
+            $line =~ s/;// if ($binding == $VBNET);
+            $line =~ s/\n$/ _\n/ if ($binding == $VBNET) && 
+                                                $splitFunctionDeclaration;
+            print DATA_OUT $line;
+            next;
+        }
+
+        if ($splitFunctionDeclaration) 
+        {
+            $line = transformSignature($line);
+            $splitFunctionDeclaration = $line !~ /;/;
+            $line =~ s/;// if ($binding == $VBNET);
+            $line =~ s/\n/ _\n/ if ($binding == $VBNET) && 
+                                                $splitFunctionDeclaration == 1;
+            print DATA_OUT $line;
+            next;
+        }
+    }
+}
+
+#===============================================================
+
+# Determine which module to build from command-line options
+use strict;
+use Getopt::Std;
+
+my $binding_prefix;
+my $binding_suffix;
+my $data_file;
+my @raw_data;
+
+if (not defined  $ARGV[0])
+{
+    goto ouch;
+}
+
+if ($ARGV[0] eq "-csharp")
+{
+    print "Generating C# interface file\n";
+    $binding_prefix = "csharp";
+    $binding_suffix = "cs";
+    $binding = $CSHARP;
+}
+elsif ($ARGV[0] eq "-vbnet")
+{
+    print "Generating VB.NET interface file\n";
+    $binding_prefix = "vbnet";
+    $binding_suffix = "vb";
+    $binding = $VBNET;
+}
+else
+{
+ouch:
+    die "Usage: $0 [-csharp | -vbnet]\n";
+}
+
+my $interfaceFile = "$binding_prefix/axInterface.$binding_suffix";
+
+# Input file required to generate interface file.
+$data_file = "../ssl/ssl.h";
+
+# Open input files
+open(DATA_IN, $data_file) || die("Could not open file ($data_file)!");
+@raw_data = <DATA_IN>;
+
+
+# Open output file
+if ($binding == $CSHARP || $binding == $VBNET)
+{
+    open(DATA_OUT, ">$interfaceFile") || die("Cannot Open File");
+}
+
+# SPEC interface file header
+if ($binding == $CSHARP)
+{
+    # generate the C#/C interface file
+    print DATA_OUT << "END";
+// The C# to C interface definition file for the axTLS project
+// Do not modify - this file is generated
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace axTLS
+{
+    public class axtls
+    {
+END
+}
+elsif ($binding == $VBNET)
+{
+    # generate the VB.NET/C interface file
+    print DATA_OUT << "END";
+' The VB.NET to C interface definition file for the axTLS project
+' Do not modify - this file is generated
+
+Imports System
+Imports System.Runtime.InteropServices
+
+Namespace axTLSvb
+    Public Class axtls
+END
+}
+
+parseFile(@raw_data);
+
+# finish up
+if ($binding == $CSHARP)
+{
+    print DATA_OUT "    };\n";
+    print DATA_OUT "};\n";
+}
+elsif ($binding == $VBNET)
+{
+    print DATA_OUT "    End Class\nEnd Namespace\n";
+}
+
+close(DATA_IN);
+close(DATA_OUT);
+
+#===============================================================
+
diff --git a/libs/nixio/axTLS/bindings/java/Makefile b/libs/nixio/axTLS/bindings/java/Makefile
new file mode 100644 (file)
index 0000000..8df1d0a
--- /dev/null
@@ -0,0 +1,94 @@
+#
+# Copyright (c) 2007, Cameron Rich
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of the axTLS project nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "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 COPYRIGHT OWNER OR
+# CONTRIBUTORS 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.
+#
+
+AXTLS_HOME=../..
+
+include $(AXTLS_HOME)/config/.config
+include $(AXTLS_HOME)/config/makefile.conf
+include $(AXTLS_HOME)/config/makefile.java.conf
+
+all: lib jar
+
+JAR=$(AXTLS_HOME)/$(STAGE)/axtls.jar
+
+ifdef CONFIG_PLATFORM_WIN32
+TARGET=$(AXTLS_HOME)/$(STAGE)/axtlsj.dll
+else
+TARGET=$(AXTLS_HOME)/$(STAGE)/libaxtlsj.so
+endif
+
+lib: $(TARGET)
+axTLSj_wrap.o : axTLSj_wrap.c
+
+JAVA_FILES= \
+       axtlsjJNI.java \
+       axtlsjConstants.java \
+       axtlsj.java \
+       SSLReadHolder.java \
+       SSL.java \
+       SSLUtil.java \
+       SSLCTX.java \
+       SSLServer.java \
+       SSLClient.java
+
+OBJ=axTLSj_wrap.o
+
+JAVA_CLASSES:=$(JAVA_FILES:%.java=classes/axTLSj/%.class)
+
+ifdef CONFIG_PLATFORM_WIN32
+LDFLAGS += axtls.lib /libpath:"$(AXTLS_HOME)/$(STAGE)"
+
+include $(AXTLS_HOME)/config/makefile.post
+
+$(TARGET) : $(OBJ)
+       $(LD) $(LDFLAGS) $(LDSHARED) /out:$@ $(OBJ)
+else    # Not Win32
+
+$(TARGET) : $(OBJ)
+       $(LD) $(LDFLAGS) -L $(AXTLS_HOME)/$(STAGE) $(LDSHARED) -o $@ $(OBJ) -laxtls 
+endif
+
+jar: $(OBJ) $(JAR)
+
+# if we are doing the samples then defer creating the jar until then
+$(JAR): $(JAVA_CLASSES)
+ifndef CONFIG_JAVA_SAMPLES
+       jar cvf $@ -C classes axTLSj
+else
+       @if [ ! -f $(JAR) ]; then touch $(JAR); fi
+endif
+
+classes/axTLSj/%.class : %.java
+       javac -d classes -classpath classes $^
+
+clean::
+       @rm -f $(JAR) $(TARGET) SWIG* axtls* *.i *.c 
+       @rm -fr classes/*
+
diff --git a/libs/nixio/axTLS/bindings/java/SSL.java b/libs/nixio/axTLS/bindings/java/SSL.java
new file mode 100644 (file)
index 0000000..b53a6da
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2007, Cameron Rich
+ * 
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice, 
+ *   this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of the axTLS project nor the names of its contributors 
+ *   may be used to endorse or promote products derived from this software 
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 COPYRIGHT OWNER OR
+ * CONTRIBUTORS 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.
+ */
+
+/*
+ * A wrapper around the unmanaged interface to give a semi-decent Java API
+ */
+
+package axTLSj;
+
+import java.io.*;
+import java.util.*;
+
+/**
+ * @defgroup java_api Java API.
+ *
+ * Ensure that the appropriate dispose() methods are called when finished with
+ * various objects - otherwise memory leaks will result.
+ */
+
+/**
+ * @class SSL
+ * @ingroup java_api 
+ * @brief A representation of an SSL connection.
+ *
+ */
+public class SSL
+{
+    public int m_ssl;    /**< A pointer to the real SSL type */
+
+    /**
+     * @brief Store the reference to an SSL context.
+     * @param ip [in] A reference to an SSL object.
+     */
+    public SSL(int ip)
+    {
+        m_ssl = ip;
+    }
+
+    /**
+     * @brief Free any used resources on this connection. 
+     * 
+     * A "Close Notify" message is sent on this connection (if possible). It 
+     * is up to the application to close the socket.
+     */
+    public void dispose()
+    {
+        axtlsj.ssl_free(m_ssl);
+    }
+
+    /**
+     * @brief Return the result of a handshake.
+     * @return SSL_OK if the handshake is complete and ok.
+     * @see ssl.h for the error code list.
+     */
+    public int handshakeStatus()
+    {
+        return axtlsj.ssl_handshake_status(m_ssl);
+    }
+
+    /**
+     * @brief Return the SSL cipher id.
+     * @return The cipher id which is one of:
+     * - SSL_AES128_SHA (0x2f)
+     * - SSL_AES256_SHA (0x35)
+     * - SSL_RC4_128_SHA (0x05)
+     * - SSL_RC4_128_MD5 (0x04)
+     */
+    public byte getCipherId()
+    {
+        return axtlsj.ssl_get_cipher_id(m_ssl);
+    }
+
+    /**
+     * @brief Get the session id for a handshake. 
+     * 
+     * This will be a 32 byte sequence and is available after the first
+     * handshaking messages are sent.
+     * @return The session id as a 32 byte sequence.
+     * @note A SSLv23 handshake may have only 16 valid bytes.
+     */
+    public byte[] getSessionId()
+    {
+        return axtlsj.ssl_get_session_id(m_ssl);
+    }
+
+    /**
+     * @brief Retrieve an X.509 distinguished name component.
+     * 
+     * When a handshake is complete and a certificate has been exchanged, 
+     * then the details of the remote certificate can be retrieved.
+     *
+     * This will usually be used by a client to check that the server's common 
+     * name matches the URL.
+     *
+     * A full handshake needs to occur for this call to work.
+     *
+     * @param component [in] one of:
+     * - SSL_X509_CERT_COMMON_NAME
+     * - SSL_X509_CERT_ORGANIZATION
+     * - SSL_X509_CERT_ORGANIZATIONAL_NAME
+     * - SSL_X509_CA_CERT_COMMON_NAME
+     * - SSL_X509_CA_CERT_ORGANIZATION
+     * - SSL_X509_CA_CERT_ORGANIZATIONAL_NAME
+     * @return The appropriate string (or null if not defined)
+     */
+    public String getCertificateDN(int component)
+    {
+        return axtlsj.ssl_get_cert_dn(m_ssl, component);
+    }
+}
diff --git a/libs/nixio/axTLS/bindings/java/SSLCTX.java b/libs/nixio/axTLS/bindings/java/SSLCTX.java
new file mode 100644 (file)
index 0000000..1cd3e03
--- /dev/null
@@ -0,0 +1,229 @@
+/*
+ * Copyright (c) 2007, Cameron Rich
+ * 
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice, 
+ *   this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of the axTLS project nor the names of its contributors 
+ *   may be used to endorse or promote products derived from this software 
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 COPYRIGHT OWNER OR
+ * CONTRIBUTORS 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.
+ */
+
+/*
+ * A wrapper around the unmanaged interface to give a semi-decent Java API
+ */
+
+package axTLSj;
+
+import java.net.*;
+
+/**
+ * @class SSLCTX
+ * @ingroup java_api 
+ * @brief A base object for SSLServer/SSLClient.
+ */
+public class SSLCTX
+{
+    /**
+     * A reference to the real client/server context.
+     */
+    protected int m_ctx;
+
+    /**
+     * @brief Establish a new client/server context.
+     *
+     * This function is called before any client/server SSL connections are 
+     * made.  If multiple threads are used, then each thread will have its 
+     * own SSLCTX context. Any number of connections may be made with a single 
+     * context. 
+     *
+     * Each new connection will use the this context's private key and 
+     * certificate chain. If a different certificate chain is required, then a 
+     * different context needs to be be used.
+     *
+     * @param options [in]  Any particular options. At present the options
+     * supported are:
+     * - SSL_SERVER_VERIFY_LATER (client only): Don't stop a handshake if the 
+     * server authentication fails. The certificate can be authenticated later 
+     * with a call to verifyCert().
+     * - SSL_CLIENT_AUTHENTICATION (server only): Enforce client authentication
+     * i.e. each handshake will include a "certificate request" message from 
+     * the server.
+     * - SSL_DISPLAY_BYTES (full mode build only): Display the byte sequences
+     * during the handshake.
+     * - SSL_DISPLAY_STATES (full mode build only): Display the state changes
+     * during the handshake.
+     * - SSL_DISPLAY_CERTS (full mode build only): Display the certificates that
+     * are passed during a handshake.
+     * - SSL_DISPLAY_RSA (full mode build only): Display the RSA key details 
+     * that are passed during a handshake.
+     *
+     * @param num_sessions [in] The number of sessions to be used for session
+     * caching. If this value is 0, then there is no session caching.
+     * 
+     * If this option is null, then the default internal private key/
+     * certificate pair is used (if CONFIG_SSL_USE_DEFAULT_KEY is set). 
+     * 
+     * The resources used by this object are automatically freed.  
+     * @return A client/server context.
+     */
+    protected SSLCTX(int options, int num_sessions)
+    {
+        m_ctx = axtlsj.ssl_ctx_new(options, num_sessions);
+    }
+
+    /**
+     * @brief Remove a client/server context.
+     *
+     * Frees any used resources used by this context. Each connection will be 
+     * sent a "Close Notify" alert (if possible).
+     */
+    public void dispose()
+    {
+        axtlsj.ssl_ctx_free(m_ctx);
+    }
+
+    /**
+     * @brief Read the SSL data stream.
+     * @param ssl [in] An SSL object reference.
+     * @param rh [out] After a successful read, the decrypted data can be 
+     * retrieved with rh.getData(). It will be null otherwise.
+     * @return The number of decrypted bytes:
+     * - if > 0, then the handshaking is complete and we are returning the 
+     * number of decrypted bytes. 
+     * - SSL_OK if the handshaking stage is successful (but not yet complete).  
+     * - < 0 if an error.
+     * @see ssl.h for the error code list.
+     * @note Use rh before doing any successive ssl calls.
+     */
+    public int read(SSL ssl, SSLReadHolder rh)
+    {
+        return axtlsj.ssl_read(ssl.m_ssl, rh);
+    }
+
+    /**
+     * @brief Write to the SSL data stream.
+     * @param ssl [in] An SSL obect reference.
+     * @param out_data [in] The data to be written
+     * @return The number of bytes sent, or if < 0 if an error.
+     * @see ssl.h for the error code list.
+     */
+    public int write(SSL ssl, byte[] out_data)
+    {
+        return axtlsj.ssl_write(ssl.m_ssl, out_data, out_data.length);
+    }
+
+    /**
+     * @brief Write to the SSL data stream.
+     * @param ssl [in] An SSL obect reference.
+     * @param out_data [in] The data to be written
+     * @param out_len [in] The number of bytes to be written
+     * @return The number of bytes sent, or if < 0 if an error.
+     * @see ssl.h for the error code list.
+     */
+    public int write(SSL ssl, byte[] out_data, int out_len)
+    {
+        return axtlsj.ssl_write(ssl.m_ssl, out_data, out_len);
+    }
+
+    /**
+     * @brief Find an ssl object based on a Socket reference.
+     *
+     * Goes through the list of SSL objects maintained in a client/server 
+     * context to look for a socket match.
+     * @param s [in] A reference to a <A HREF="http://java.sun.com/j2se/1.4.2/docs/api">Socket</A> object.
+     * @return A reference to the SSL object. Returns null if the object 
+     * could not be found.
+     */
+    public SSL find(Socket s)
+    {
+        int client_fd = axtlsj.getFd(s);
+        return new SSL(axtlsj.ssl_find(m_ctx, client_fd));
+    }
+
+    /**
+     * @brief Authenticate a received certificate.
+     * 
+     * This call is usually made by a client after a handshake is complete 
+     * and the context is in SSL_SERVER_VERIFY_LATER mode.
+     * @param ssl [in] An SSL object reference.
+     * @return SSL_OK if the certificate is verified.
+     */
+    public int verifyCert(SSL ssl)
+    {
+        return axtlsj.ssl_verify_cert(ssl.m_ssl);
+    }
+
+    /**
+     * @brief Force the client to perform its handshake again.
+     *
+     * For a client this involves sending another "client hello" message.
+     * For the server is means sending a "hello request" message.
+     *
+     * This is a blocking call on the client (until the handshake completes).
+     * @param ssl [in] An SSL object reference.
+     * @return SSL_OK if renegotiation instantiation was ok
+     */
+    public int renegotiate(SSL ssl)
+    {
+        return axtlsj.ssl_renegotiate(ssl.m_ssl);
+    }
+
+    /**
+     * @brief Load a file into memory that is in binary DER or ASCII PEM format.
+     *
+     * These are temporary objects that are used to load private keys,
+     * certificates etc into memory.
+     * @param obj_type [in] The format of the file. Can be one of:
+     * - SSL_OBJ_X509_CERT (no password required)
+     * - SSL_OBJ_X509_CACERT (no password required)
+     * - SSL_OBJ_RSA_KEY (AES128/AES256 PEM encryption supported)
+     * - SSL_OBJ_P8 (RC4-128 encrypted data supported)
+     * - SSL_OBJ_P12 (RC4-128 encrypted data supported)
+     *
+     * PEM files are automatically detected (if supported).
+     * @param filename [in] The location of a file in DER/PEM format.
+     * @param password [in] The password used. Can be null if not required.
+     * @return SSL_OK if all ok
+     */
+    public int objLoad(int obj_type, String filename, String password)
+    {
+        return axtlsj.ssl_obj_load(m_ctx, obj_type, filename, password);
+    }
+
+    /**
+     * @brief Transfer binary data into the object loader.
+     *
+     * These are temporary objects that are used to load private keys,
+     * certificates etc into memory.
+     * @param obj_type [in] The format of the memory data.
+     * @param data [in] The binary data to be loaded.
+     * @param len [in] The amount of data to be loaded.
+     * @param password [in] The password used. Can be null if not required.
+     * @return SSL_OK if all ok
+     */
+
+    public int objLoad(int obj_type, byte[] data, int len, String password)
+    {
+        return axtlsj.ssl_obj_memory_load(m_ctx, obj_type, data, len, password);
+    }
+}
diff --git a/libs/nixio/axTLS/bindings/java/SSLClient.java b/libs/nixio/axTLS/bindings/java/SSLClient.java
new file mode 100644 (file)
index 0000000..f65fe9c
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2007, Cameron Rich
+ * 
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice, 
+ *   this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of the axTLS project nor the names of its contributors 
+ *   may be used to endorse or promote products derived from this software 
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 COPYRIGHT OWNER OR
+ * CONTRIBUTORS 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.
+ */
+
+/*
+ * A wrapper around the unmanaged interface to give a semi-decent Java API
+ */
+
+package axTLSj;
+
+import java.net.*;
+
+/**
+ * @class SSLClient
+ * @ingroup java_api 
+ * @brief The client context.
+ *
+ * All client connections are started within a client context.
+ */
+public class SSLClient extends SSLCTX
+{
+    /**
+     * @brief Start a new client context.
+     * 
+     * @see SSLCTX for details.
+     */
+    public SSLClient(int options, int num_sessions)
+    {
+        super(options, num_sessions);
+    }
+
+    /**
+     * @brief Establish a new SSL connection to an SSL server.
+     *
+     * It is up to the application to establish the initial socket connection.
+     *
+     * This is a blocking call - it will finish when the handshake is 
+     * complete (or has failed).
+     *
+     * Call dispose() when the connection is to be removed.
+     * @param s [in] A reference to a <A HREF="http://java.sun.com/j2se/1.4.2/docs/api">Socket</A> object.
+     * @param session_id [in] A 32 byte session id for session resumption. This 
+     * can be null if no session resumption is not required.
+     * @return An SSL object reference. Use SSL.handshakeStatus() to check 
+     * if a handshake succeeded.
+     */
+    public SSL connect(Socket s, byte[] session_id)
+    {
+        int client_fd = axtlsj.getFd(s);
+        byte sess_id_size = (byte)(session_id != null ? 
+                                session_id.length : 0);
+        return new SSL(axtlsj.ssl_client_new(m_ctx, client_fd, session_id,
+                        sess_id_size));
+    }
+}
diff --git a/libs/nixio/axTLS/bindings/java/SSLReadHolder.java b/libs/nixio/axTLS/bindings/java/SSLReadHolder.java
new file mode 100644 (file)
index 0000000..91fd76b
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2007, Cameron Rich
+ * 
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice, 
+ *   this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of the axTLS project nor the names of its contributors 
+ *   may be used to endorse or promote products derived from this software 
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 COPYRIGHT OWNER OR
+ * CONTRIBUTORS 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.
+ */
+
+/*
+ * A wrapper around the unmanaged interface to give a semi-decent Java API
+ */
+
+package axTLSj;
+
+/**
+ * @class SSLReadHolder
+ * @ingroup java_api 
+ * @brief A holder for data read in an SSL read.
+ */
+public class SSLReadHolder
+{
+    /**
+     * @brief Contruct a new read holder object.
+     */
+    public SSLReadHolder()
+    {
+        m_buf = null;
+    }
+
+    /**
+     * @brief Retrieve the reference to the read data.
+     */
+    public byte[] getData()
+    {
+        return m_buf;
+    }
+
+    private byte[] m_buf;
+}
diff --git a/libs/nixio/axTLS/bindings/java/SSLServer.java b/libs/nixio/axTLS/bindings/java/SSLServer.java
new file mode 100644 (file)
index 0000000..514ccb0
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2007, Cameron Rich
+ * 
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice, 
+ *   this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of the axTLS project nor the names of its contributors 
+ *   may be used to endorse or promote products derived from this software 
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 COPYRIGHT OWNER OR
+ * CONTRIBUTORS 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.
+ */
+
+/*
+ * A wrapper around the unmanaged interface to give a semi-decent Java API
+ */
+
+package axTLSj;
+
+import java.net.*;
+
+/**
+ * @class SSLServer
+ * @ingroup java_api 
+ * @brief The server context.
+ *
+ * All server connections are started within a server context.
+ */
+public class SSLServer extends SSLCTX
+{
+    /**
+     * @brief Start a new server context.
+     * 
+     * @see SSLCTX for details.
+     */
+    public SSLServer(int options, int num_sessions)
+    {
+        super(options, num_sessions);
+    }
+
+    /**
+     * @brief Establish a new SSL connection to an SSL client.
+     *
+     * It is up to the application to establish the initial socket connection.
+     *
+     * Call dispose() when the connection is to be removed.
+     * @param s [in] A reference to a <A HREF="http://java.sun.com/j2se/1.4.2/docs/api">Socket</A> object.
+     * @return An SSL object reference.
+     */
+    public SSL connect(Socket s)
+    {
+        int client_fd = axtlsj.getFd(s);
+        return new SSL(axtlsj.ssl_server_new(m_ctx, client_fd));
+    }
+}
diff --git a/libs/nixio/axTLS/bindings/java/SSLUtil.java b/libs/nixio/axTLS/bindings/java/SSLUtil.java
new file mode 100644 (file)
index 0000000..3d53de5
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2007, Cameron Rich
+ * 
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice, 
+ *   this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of the axTLS project nor the names of its contributors 
+ *   may be used to endorse or promote products derived from this software 
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 COPYRIGHT OWNER OR
+ * CONTRIBUTORS 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.
+ */
+
+/*
+ * A wrapper around the unmanaged interface to give a semi-decent Java API
+ */
+
+package axTLSj;
+
+import java.io.*;
+import java.util.*;
+
+/**
+ * @class SSLUtil
+ * @ingroup java_api 
+ * @brief Some global helper functions.
+ *
+ */
+public class SSLUtil
+{
+    /**
+     * @brief Load up the ddl/shared library 
+     */
+    static
+    {
+        System.loadLibrary("axtlsj");
+    }
+
+    /**
+     * @brief Return the build mode of the axTLS project.
+     * @return The build mode is one of:
+     * - SSL_BUILD_SERVER_ONLY
+     * - SSL_BUILD_ENABLE_VERIFICATION
+     * - SSL_BUILD_ENABLE_CLIENT
+     * - SSL_BUILD_FULL_MODE
+     */
+    public static int buildMode()
+    {
+        return axtlsj.ssl_get_config(axtlsj.SSL_BUILD_MODE);
+    }
+
+    /**
+     * @brief Return the number of chained certificates that the client/server 
+     * supports.
+     * @return The number of supported client/server certificates.
+     */
+    public static int maxCerts()
+    {
+        return axtlsj.ssl_get_config(axtlsj.SSL_MAX_CERT_CFG_OFFSET);
+    }
+
+    /**
+     * @brief Return the number of CA certificates that the client/server
+     * supports.
+     * @return The number of supported CA certificates.
+     */
+    public static int maxCACerts()
+    {
+        return axtlsj.ssl_get_config(axtlsj.SSL_MAX_CA_CERT_CFG_OFFSET);
+    }
+
+    /**
+     * @brief Indicate if PEM is supported.
+     * @return true if PEM supported.
+     */
+    public static boolean hasPEM()
+    {
+        return axtlsj.ssl_get_config(axtlsj.SSL_HAS_PEM) > 0 ? true : false;
+    }
+
+    /**
+     * @brief Display the text string of the error.
+     * @param error_code [in] The integer error code.
+     * @see ssl.h for the error code list.
+     */
+    public static void displayError(int error_code)
+    {
+        axtlsj.ssl_display_error(error_code);
+    }
+
+    /**
+     * @brief Return the version of the axTLS project.
+     */
+    public static String version()
+    {
+        return axtlsj.ssl_version();
+    }
+}
+
diff --git a/libs/nixio/axTLS/bindings/lua/Makefile b/libs/nixio/axTLS/bindings/lua/Makefile
new file mode 100644 (file)
index 0000000..daacf92
--- /dev/null
@@ -0,0 +1,67 @@
+#
+# Copyright (c) 2007, Cameron Rich
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of the axTLS project nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "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 COPYRIGHT OWNER OR
+# CONTRIBUTORS 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.
+#
+
+AXTLS_HOME=../..
+
+include $(AXTLS_HOME)/config/.config
+include $(AXTLS_HOME)/config/makefile.conf
+
+all: lib
+
+
+ifdef CONFIG_PLATFORM_WIN32
+TARGET=$(AXTLS_HOME)/$(STAGE)/axtlsl.dll
+else
+TARGET=$(CONFIG_LUA_CORE)/lib/lua/5.1/axtlsl.so
+endif
+
+ifneq ($(MAKECMDGOALS), clean)
+
+lib: $(TARGET)
+OBJ:=axTLSl_wrap.o
+include $(AXTLS_HOME)/config/makefile.post
+
+# there are a few static functions that aren't used
+CFLAGS += -funit-at-a-time
+
+$(TARGET) : $(OBJ)
+       $(LD) $(LDFLAGS) $(LDSHARED) -o $@ $^ -L$(AXTLS_HOME)/$(STAGE) -L$(CONFIG_LUA_CORE)/lib -laxtls -llua
+
+CFLAGS += -I $(CONFIG_LUA_CORE)/include
+else
+CFLAGS += /I"`cygpath -w $(CONFIG_LUA_CORE)/include`"
+LDFLAGS += axtls.lib /libpath:"$(AXTLS_HOME)/$(STAGE)"
+
+$(TARGET) : $(OBJ)
+       $(LD) $(LDFLAGS) $(LDSHARED) /out:$@ $(OBJ)
+endif # WIN32
+
+clean::
+       @rm -f $(TARGET) *.i axTLSl* .depend
diff --git a/libs/nixio/axTLS/bindings/perl/Makefile b/libs/nixio/axTLS/bindings/perl/Makefile
new file mode 100644 (file)
index 0000000..92fd3c5
--- /dev/null
@@ -0,0 +1,91 @@
+#
+# Copyright (c) 2007, Cameron Rich
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of the axTLS project nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "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 COPYRIGHT OWNER OR
+# CONTRIBUTORS 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.
+#
+
+AXTLS_HOME=../..
+
+include $(AXTLS_HOME)/config/.config
+include $(AXTLS_HOME)/config/makefile.conf
+
+all: lib
+
+ifdef CONFIG_PLATFORM_WIN32
+TARGET=$(AXTLS_HOME)/$(STAGE)/axtlsp.dll
+else
+TARGET=$(AXTLS_HOME)/$(STAGE)/libaxtlsp.so
+endif
+
+ifneq ($(MAKECMDGOALS), clean)
+
+ifdef CONFIG_PLATFORM_WIN32
+PERL5_CORE:=$(shell cygpath -w "$(CONFIG_PERL_CORE)")
+else
+PERL5_CORE= $(shell perl -e 'use Config; print $$Config{archlib};')/CORE
+endif
+
+all: test_perl
+
+test_perl:
+       @if ! [ -d "$(PERL5_CORE)" ]; then \
+               echo "*** Error: Perl not installed at $(CONFIG_PERL_CORE) - go to " \
+        "http://www.cpan.org/authors/id/G/GR/GRAHAMC/SiePerl-5.8.0-bin-1.0-Win32.INSTALL.exe" && exit 1; \
+       fi
+
+endif
+
+lib: $(TARGET)
+OBJ:=axTLSp_wrap.o
+include $(AXTLS_HOME)/config/makefile.post
+
+ifndef CONFIG_PLATFORM_WIN32        # Linux/Unix/Cygwin
+
+#
+# Could have used libperl.a, but it increases the library to over 1MB, so just
+# use libperl.so. But this needs to be in the shared library path for things to
+# work.
+#
+$(TARGET) : $(OBJ)
+       $(LD) $(LDFLAGS) -L$(AXTLS_HOME)/$(STAGE) -L$(PERL5_CORE) $(LDSHARED) -o $@ $(OBJ) -laxtls -lperl
+ifdef CONFIG_PLATFORM_CYGWIN
+       cd $(AXTLS_HOME)/$(STAGE); ln -sf $(notdir $@) axtlsp.dll
+endif
+       @install axtlsp.pm $(AXTLS_HOME)/$(STAGE)
+
+CFLAGS += -D_GNU_SOURCE -I$(PERL5_CORE)
+else
+CFLAGS += /I"$(PERL5_CORE)"
+LDFLAGS += $(CONFIG_PERL_LIB) /libpath:"$(PERL5_CORE)" axtls.lib /libpath:"$(AXTLS_HOME)/$(STAGE)"
+
+$(TARGET) : $(OBJ)
+       $(LD) $(LDFLAGS) $(LDSHARED) /out:$@ $(OBJ)
+       install axtlsp.pm $(AXTLS_HOME)/$(STAGE)
+endif # WIN32
+
+clean::
+       @rm -f $(TARGET) axtls* *.i axTLSp* *.c .depend $(AXTLS_HOME)/$(STAGE)/axtlsp.pm
diff --git a/libs/nixio/axTLS/bindings/vbnet/Makefile b/libs/nixio/axTLS/bindings/vbnet/Makefile
new file mode 100644 (file)
index 0000000..7da60d0
--- /dev/null
@@ -0,0 +1,35 @@
+#
+# Copyright (c) 2007, Cameron Rich
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of the axTLS project nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "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 COPYRIGHT OWNER OR
+# CONTRIBUTORS 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.
+#
+
+include ../../config/.config
+include ../../config/makefile.conf
+
+clean::
+       @rm -f axssl* axInterface.vb
diff --git a/libs/nixio/axTLS/bindings/vbnet/axTLSvb.vb b/libs/nixio/axTLS/bindings/vbnet/axTLSvb.vb
new file mode 100644 (file)
index 0000000..9388273
--- /dev/null
@@ -0,0 +1,200 @@
+'
+' Copyright (c) 2007, Cameron Rich
+'
+' All rights reserved.
+'
+' Redistribution and use in source and binary forms, with or without
+' modification, are permitted provided that the following conditions are met:
+'
+' * Redistributions of source code must retain the above copyright notice,
+'   this list of conditions and the following disclaimer.
+' * 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.
+' * Neither the name of the axTLS project nor the names of its
+'   contributors may be used to endorse or promote products derived
+'   from this software without specific prior written permission.
+'
+' THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+' "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 COPYRIGHT OWNER OR
+' CONTRIBUTORS 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.
+'
+
+'
+' A wrapper around the unmanaged Integererface to give a semi-decent VB.NET API
+'
+
+Imports System
+Imports System.Runtime.InteropServices
+Imports System.Net.Sockets
+Imports axTLSvb
+
+Namespace axTLSvb
+    Public Class SSL
+        Public m_ssl As IntPtr
+
+        Public Sub New(ByRef ip As IntPtr)
+            m_ssl = ip
+        End Sub
+
+        Public Sub Dispose()
+            axtls.ssl_free(m_ssl)
+        End Sub
+
+        Public Function HandshakeStatus() As Integer
+            Return axtls.ssl_handshake_status(m_ssl)
+        End Function
+
+        Public Function GetCipherId() As Byte
+            Return axtls.ssl_get_cipher_id(m_ssl)
+        End Function
+
+        Public Function GetSessionId() As Byte()
+            Dim ptr As IntPtr = axtls.ssl_get_session_id(m_ssl)
+            Dim sess_id_size As Integer = axtls.ssl_get_session_id_size(m_ssl)
+            Dim result(sess_id_size-1) As Byte
+            Marshal.Copy(ptr, result, 0, sess_id_size)
+            Return result
+        End Function
+
+        Public Function GetCertificateDN(component As Integer) As String
+            Return axtls.ssl_get_cert_dn(m_ssl, component)
+        End Function
+    End Class
+
+    Public Class SSLUtil
+        Private dummy As Integer    ' need something here
+
+        Public Shared Function BuildMode() As Integer
+            Return axtls.ssl_get_config(axtls.SSL_BUILD_MODE)
+        End Function
+
+        Public Shared Function MaxCerts() As Integer
+            Return axtls.ssl_get_config(axtls.SSL_MAX_CERT_CFG_OFFSET)
+        End Function
+
+        Public Shared Function MaxCACerts() As Integer
+            Return axtls.ssl_get_config(axtls.SSL_MAX_CA_CERT_CFG_OFFSET)
+        End Function
+
+        Public Shared Function HasPEM() As Boolean
+            If axtls.ssl_get_config(axtls.SSL_HAS_PEM) > 0 Then
+                Return True
+            Else
+                Return False
+            End If
+        End Function
+        
+        Public Shared Sub DisplayError(ByVal error_code As Integer)
+            axtls.ssl_display_error(error_code)
+        End Sub
+
+        Public Shared Function Version() As String
+            Return axtls.ssl_version()
+        End Function
+    End Class
+
+    Public Class SSLCTX
+        Protected m_ctx As IntPtr
+
+        Protected Sub New(ByVal options As Integer, _
+                ByVal num_sessions As Integer)
+            m_ctx = axtls.ssl_ctx_new(options, num_sessions)
+        End Sub
+
+        Public Sub Dispose()
+            axtls.ssl_ctx_free(m_ctx)
+        End Sub
+
+        Public Function Read(ByVal ssl As SSL, ByRef in_data As Byte()) As Integer
+            Dim ptr As IntPtr = IntPtr.Zero
+            Dim ret as Integer = axtls.ssl_read(ssl.m_ssl, ptr)
+
+            If ret > axtls.SSL_OK Then
+                ReDim in_data(ret)
+                Marshal.Copy(ptr, in_data, 0, ret)
+            Else
+                in_data = Nothing
+            End If
+
+            Return ret
+        End Function
+
+        Public Function Write(ByVal ssl As SSL, _
+                ByVal data As Byte(), len As Integer) As Integer
+            Return axtls.ssl_write(ssl.m_ssl, data, len)
+        End Function
+
+        Public Function Find(ByVal s As Socket) As SSL
+            Dim client_fd As Integer = s.Handle.ToInt32()
+            Return New SSL(axtls.ssl_find(m_ctx, client_fd))
+        End Function
+
+        Public Function VerifyCert(ByVal ssl As SSL) As Integer
+            Return axtls.ssl_verify_cert(ssl.m_ssl)
+        End Function
+
+        Public Function Renegotiate(ByVal ssl As SSL) As Integer
+            Return axtls.ssl_renegotiate(ssl.m_ssl)
+        End Function
+
+        Public Function ObjLoad(ByVal obj_type As Integer, _
+                ByVal filename As String, _
+                password As String) As Integer
+            Return axtls.ssl_obj_load(m_ctx, obj_type, filename, password)
+        End Function
+
+        Public Function ObjLoad(ByVal obj_type As Integer, _
+                ByVal data As Byte(), ByVal len As Integer, _
+                password As String) As Integer
+            Return axtls.ssl_obj_memory_load( _
+                    m_ctx, obj_type, data, len, password)
+        End Function
+    End Class
+
+    Public Class SSLServer 
+            Inherits SSLCTX
+
+        Public Sub New(ByVal options As Integer, _
+                ByVal num_sessions As Integer)
+            MyBase.New(options, num_sessions)
+        End Sub
+
+        Public Function Connect(ByVal s As Socket) As SSL
+            Dim client_fd As Integer = s.Handle.ToInt32()
+            Return New SSL(axtls.ssl_server_new(m_ctx, client_fd))
+        End Function
+    End Class
+
+    Public Class SSLClient 
+            Inherits SSLCTX
+
+        Public Sub New(ByVal options As Integer, _
+                ByVal num_sessions As Integer)
+            MyBase.New(options, num_sessions)
+        End Sub
+
+        Public Function Connect(ByVal s As Socket, _
+                                ByVal session_id As Byte()) As SSL
+            Dim client_fd As Integer = s.Handle.ToInt32()
+            Dim sess_id_size As Byte
+            If session_id is Nothing Then
+                sess_id_size = 0
+            Else
+                sess_id_size = session_id.Length
+            End If
+
+            Return New SSL(axtls.ssl_client_new(m_ctx, client_fd, session_id, _
+                       sess_id_size))
+        End Function
+
+    End Class
+End Namespace
diff --git a/libs/nixio/axTLS/config/.config b/libs/nixio/axTLS/config/.config
new file mode 100644 (file)
index 0000000..beb0d85
--- /dev/null
@@ -0,0 +1,112 @@
+#
+# Automatically generated make config: don't edit
+#
+HAVE_DOT_CONFIG=y
+CONFIG_PLATFORM_LINUX=y
+# CONFIG_PLATFORM_CYGWIN is not set
+# CONFIG_PLATFORM_WIN32 is not set
+
+#
+# General Configuration
+#
+PREFIX="/usr"
+# CONFIG_DEBUG is not set
+CONFIG_STRIP_UNWANTED_SECTIONS=y
+# CONFIG_VISUAL_STUDIO_7_0 is not set
+# CONFIG_VISUAL_STUDIO_8_0 is not set
+CONFIG_VISUAL_STUDIO_7_0_BASE=""
+CONFIG_VISUAL_STUDIO_8_0_BASE=""
+CONFIG_EXTRA_CFLAGS_OPTIONS="-fpic"
+CONFIG_EXTRA_LDFLAGS_OPTIONS=""
+
+#
+# SSL Library
+#
+# CONFIG_SSL_SERVER_ONLY is not set
+# CONFIG_SSL_CERT_VERIFICATION is not set
+CONFIG_SSL_ENABLE_CLIENT=y
+# CONFIG_SSL_FULL_MODE is not set
+# CONFIG_SSL_SKELETON_MODE is not set
+# CONFIG_SSL_PROT_LOW is not set
+CONFIG_SSL_PROT_MEDIUM=y
+# CONFIG_SSL_PROT_HIGH is not set
+CONFIG_SSL_USE_DEFAULT_KEY=y
+CONFIG_SSL_PRIVATE_KEY_LOCATION=""
+CONFIG_SSL_PRIVATE_KEY_PASSWORD=""
+CONFIG_SSL_X509_CERT_LOCATION=""
+CONFIG_SSL_GENERATE_X509_CERT=y
+CONFIG_SSL_X509_COMMON_NAME=""
+CONFIG_SSL_X509_ORGANIZATION_NAME=""
+CONFIG_SSL_X509_ORGANIZATION_UNIT_NAME=""
+CONFIG_SSL_ENABLE_V23_HANDSHAKE=y
+CONFIG_SSL_HAS_PEM=y
+# CONFIG_SSL_USE_PKCS12 is not set
+CONFIG_SSL_EXPIRY_TIME=24
+CONFIG_X509_MAX_CA_CERTS=4
+CONFIG_SSL_MAX_CERTS=2
+CONFIG_SSL_CTX_MUTEXING=y
+CONFIG_USE_DEV_URANDOM=y
+# CONFIG_WIN32_USE_CRYPTO_LIB is not set
+# CONFIG_OPENSSL_COMPATIBLE is not set
+# CONFIG_PERFORMANCE_TESTING is not set
+# CONFIG_SSL_TEST is not set
+# CONFIG_AXHTTPD is not set
+# CONFIG_HTTP_STATIC_BUILD is not set
+CONFIG_HTTP_PORT=0
+CONFIG_HTTP_HTTPS_PORT=0
+CONFIG_HTTP_SESSION_CACHE_SIZE=0
+CONFIG_HTTP_WEBROOT=""
+CONFIG_HTTP_TIMEOUT=0
+# CONFIG_HTTP_HAS_CGI is not set
+CONFIG_HTTP_CGI_EXTENSIONS=""
+# CONFIG_HTTP_ENABLE_LUA is not set
+CONFIG_HTTP_LUA_PREFIX=""
+CONFIG_HTTP_LUA_CGI_LAUNCHER=""
+# CONFIG_HTTP_BUILD_LUA is not set
+# CONFIG_HTTP_DIRECTORIES is not set
+# CONFIG_HTTP_HAS_AUTHORIZATION is not set
+# CONFIG_HTTP_HAS_IPV6 is not set
+# CONFIG_HTTP_ENABLE_DIFFERENT_USER is not set
+CONFIG_HTTP_USER=""
+# CONFIG_HTTP_VERBOSE is not set
+# CONFIG_HTTP_IS_DAEMON is not set
+
+#
+# Language Bindings
+#
+# CONFIG_BINDINGS is not set
+# CONFIG_CSHARP_BINDINGS is not set
+# CONFIG_VBNET_BINDINGS is not set
+CONFIG_DOT_NET_FRAMEWORK_BASE=""
+# CONFIG_JAVA_BINDINGS is not set
+CONFIG_JAVA_HOME=""
+# CONFIG_PERL_BINDINGS is not set
+CONFIG_PERL_CORE=""
+CONFIG_PERL_LIB=""
+# CONFIG_LUA_BINDINGS is not set
+CONFIG_LUA_CORE=""
+
+#
+# Samples
+#
+# CONFIG_SAMPLES is not set
+# CONFIG_C_SAMPLES is not set
+# CONFIG_CSHARP_SAMPLES is not set
+# CONFIG_VBNET_SAMPLES is not set
+# CONFIG_JAVA_SAMPLES is not set
+# CONFIG_PERL_SAMPLES is not set
+# CONFIG_LUA_SAMPLES is not set
+
+#
+# BigInt Options
+#
+# CONFIG_BIGINT_CLASSICAL is not set
+# CONFIG_BIGINT_MONTGOMERY is not set
+CONFIG_BIGINT_BARRETT=y
+CONFIG_BIGINT_CRT=y
+# CONFIG_BIGINT_KARATSUBA is not set
+MUL_KARATSUBA_THRESH=0
+SQU_KARATSUBA_THRESH=0
+CONFIG_BIGINT_SLIDING_WINDOW=y
+CONFIG_BIGINT_SQUARE=y
+# CONFIG_BIGINT_CHECK_ON is not set
diff --git a/libs/nixio/axTLS/config/Config.in b/libs/nixio/axTLS/config/Config.in
new file mode 100644 (file)
index 0000000..dc40756
--- /dev/null
@@ -0,0 +1,114 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/config/Kconfig-language.txt
+#
+
+mainmenu "axTLS Configuration"
+
+config HAVE_DOT_CONFIG
+    bool
+    default y
+
+choice 
+    prompt "Platform"
+    default CONFIG_PLATFORM_LINUX
+
+config CONFIG_PLATFORM_LINUX
+    bool "Linux"
+
+config CONFIG_PLATFORM_CYGWIN
+    bool "Cygwin"
+
+config CONFIG_PLATFORM_WIN32
+    bool "Win32"
+
+endchoice 
+
+menu "General Configuration"
+
+config PREFIX
+    string "axTLS installation prefix"
+    depends on !CONFIG_PLATFORM_WIN32
+    default "/usr/local"
+    help
+      Define your directory to install axTLS files/subdirs in.
+
+config CONFIG_DEBUG
+    bool "Build axTLS with Debugging symbols"
+    default n
+    help
+      Say Y here if you wish to compile axTLS with debugging symbols.
+      This will allow you to use a debugger to examine axTLS internals.  
+      This increases the size of the binary considerably and should only be 
+      used when doing development.
+      If you are doing development and want to debug axTLS, answer Y.
+
+      Most people should answer N.
+
+config CONFIG_STRIP_UNWANTED_SECTIONS
+    depends on !CONFIG_PLATFORM_WIN32 && !CONFIG_DEBUG
+    bool "Strip unwanted sections from elf binaries"
+    default y
+    help
+        Strip unwanted sections from the resulting binaries
+
+menu "Microsoft Compiler Options"
+depends on CONFIG_PLATFORM_WIN32
+
+choice 
+    prompt "Compiler"
+    depends on CONFIG_PLATFORM_WIN32
+    default CONFIG_VISUAL_STUDIO_7_0
+
+config CONFIG_VISUAL_STUDIO_7_0
+    bool "Visual Studio 7.0 (2003)"
+    help 
+        Use Microsoft's Visual Studio 2003 platform.
+
+config CONFIG_VISUAL_STUDIO_8_0
+    bool "Visual Studio 8.0 (2005)"
+    help 
+        Use Microsoft's Visual Studio 2005 platform.
+
+endchoice
+
+config CONFIG_VISUAL_STUDIO_7_0_BASE
+    string "Base"
+    depends on CONFIG_VISUAL_STUDIO_7_0
+    default "c:\\Program Files\\Microsoft Visual Studio .NET 2003"
+
+config CONFIG_VISUAL_STUDIO_8_0_BASE
+    string "Base"
+    depends on CONFIG_VISUAL_STUDIO_8_0
+    default "c:\\Program Files\\Microsoft Visual Studio 8"
+
+endmenu
+
+config CONFIG_EXTRA_CFLAGS_OPTIONS
+    string "Any extra CFLAGS options for the compiler?"
+    help
+        Do you want to pass any extra CFLAGS options to the compiler as  
+        you build axTLS? If so, this is the option for you...  For
+        example, if you want to add some simple compiler switches (like
+        -march=i686), or check for warnings using -Werror, just those 
+        options here.
+
+config CONFIG_EXTRA_LDFLAGS_OPTIONS
+    string "Any extra LDFLAGS options for the compiler?"
+    help
+        Do you want to pass any extra LDFLAGS options to the compiler?
+
+endmenu
+
+source ssl/Config.in
+config CONFIG_AXHTTPD
+    bool "Enable HTTP/HTTPS Web Server"
+    default y
+    help
+        Build the AXHTTPD web server
+
+source httpd/Config.in
+source bindings/Config.in
+source samples/Config.in
+source ssl/BigIntConfig.in
+
diff --git a/libs/nixio/axTLS/config/JMeter.jmx b/libs/nixio/axTLS/config/JMeter.jmx
new file mode 100755 (executable)
index 0000000..f62c03f
--- /dev/null
@@ -0,0 +1,247 @@
+<jmeterTestPlan version="1.2" properties="1.8">
+  <hashTree>
+    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="axhttpd Test Plan" enabled="true">
+      <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
+        <collectionProp name="Arguments.arguments"/>
+      </elementProp>
+      <stringProp name="TestPlan.user_define_classpath"></stringProp>
+      <boolProp name="TestPlan.serialize_threadgroups">true</boolProp>
+      <boolProp name="TestPlan.functional_mode">false</boolProp>
+      <stringProp name="TestPlan.comments"></stringProp>
+    </TestPlan>
+    <hashTree>
+      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Test 1" enabled="true">
+        <longProp name="ThreadGroup.start_time">1152004173000</longProp>
+        <stringProp name="ThreadGroup.delay"></stringProp>
+        <stringProp name="ThreadGroup.duration"></stringProp>
+        <stringProp name="ThreadGroup.num_threads">16</stringProp>
+        <boolProp name="ThreadGroup.scheduler">false</boolProp>
+        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
+          <stringProp name="LoopController.loops">10</stringProp>
+          <boolProp name="LoopController.continue_forever">false</boolProp>
+        </elementProp>
+        <longProp name="ThreadGroup.end_time">1152004173000</longProp>
+        <stringProp name="ThreadGroup.on_sample_error">stopthread</stringProp>
+        <stringProp name="ThreadGroup.ramp_time">0</stringProp>
+      </ThreadGroup>
+      <hashTree>
+        <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler" testname="Normal" enabled="true">
+          <stringProp name="HTTPSampler.path">/index.html</stringProp>
+          <stringProp name="HTTPSampler.method">GET</stringProp>
+          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
+          <stringProp name="HTTPSampler.protocol"></stringProp>
+          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
+          <stringProp name="HTTPSampler.port">80</stringProp>
+          <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
+            <collectionProp name="Arguments.arguments"/>
+          </elementProp>
+          <stringProp name="HTTPSampler.mimetype"></stringProp>
+          <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
+          <stringProp name="HTTPSampler.monitor">false</stringProp>
+          <stringProp name="HTTPSampler.domain">127.0.0.1</stringProp>
+          <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
+          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
+        </HTTPSampler>
+        <hashTree/>
+      </hashTree>
+      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Test 2" enabled="true">
+        <longProp name="ThreadGroup.start_time">1152004173000</longProp>
+        <stringProp name="ThreadGroup.delay"></stringProp>
+        <stringProp name="ThreadGroup.duration"></stringProp>
+        <stringProp name="ThreadGroup.num_threads">16</stringProp>
+        <boolProp name="ThreadGroup.scheduler">false</boolProp>
+        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
+          <stringProp name="LoopController.loops">10</stringProp>
+          <boolProp name="LoopController.continue_forever">false</boolProp>
+        </elementProp>
+        <longProp name="ThreadGroup.end_time">1152004173000</longProp>
+        <stringProp name="ThreadGroup.on_sample_error">stopthread</stringProp>
+        <stringProp name="ThreadGroup.ramp_time">0</stringProp>
+      </ThreadGroup>
+      <hashTree>
+        <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler" testname="RC4" enabled="true">
+          <stringProp name="HTTPSampler.path">/index.html</stringProp>
+          <stringProp name="HTTPSampler.method">GET</stringProp>
+          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
+          <stringProp name="HTTPSampler.protocol">HTTPS</stringProp>
+          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
+          <stringProp name="HTTPSampler.port">443</stringProp>
+          <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
+            <collectionProp name="Arguments.arguments"/>
+          </elementProp>
+          <stringProp name="HTTPSampler.mimetype"></stringProp>
+          <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
+          <stringProp name="HTTPSampler.monitor">false</stringProp>
+          <stringProp name="HTTPSampler.domain">127.0.0.1</stringProp>
+          <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
+          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
+        </HTTPSampler>
+        <hashTree/>
+      </hashTree>
+      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Test 3" enabled="true">
+        <longProp name="ThreadGroup.start_time">1152004173000</longProp>
+        <stringProp name="ThreadGroup.delay"></stringProp>
+        <stringProp name="ThreadGroup.duration"></stringProp>
+        <stringProp name="ThreadGroup.num_threads">16</stringProp>
+        <boolProp name="ThreadGroup.scheduler">false</boolProp>
+        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
+          <stringProp name="LoopController.loops">10</stringProp>
+          <boolProp name="LoopController.continue_forever">false</boolProp>
+        </elementProp>
+        <longProp name="ThreadGroup.end_time">1152004173000</longProp>
+        <stringProp name="ThreadGroup.on_sample_error">stopthread</stringProp>
+        <stringProp name="ThreadGroup.ramp_time">0</stringProp>
+      </ThreadGroup>
+      <hashTree>
+        <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler" testname="AES128" enabled="true">
+          <stringProp name="HTTPSampler.path">/index.html</stringProp>
+          <stringProp name="HTTPSampler.method">GET</stringProp>
+          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
+          <stringProp name="HTTPSampler.protocol">HTTPS</stringProp>
+          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
+          <stringProp name="HTTPSampler.port">2443</stringProp>
+          <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
+            <collectionProp name="Arguments.arguments"/>
+          </elementProp>
+          <stringProp name="HTTPSampler.mimetype"></stringProp>
+          <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
+          <stringProp name="HTTPSampler.monitor">false</stringProp>
+          <stringProp name="HTTPSampler.domain">127.0.0.1</stringProp>
+          <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
+          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
+        </HTTPSampler>
+        <hashTree/>
+      </hashTree>
+      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Test 4" enabled="true">
+        <longProp name="ThreadGroup.start_time">1152004173000</longProp>
+        <stringProp name="ThreadGroup.delay"></stringProp>
+        <stringProp name="ThreadGroup.duration"></stringProp>
+        <stringProp name="ThreadGroup.num_threads">16</stringProp>
+        <boolProp name="ThreadGroup.scheduler">false</boolProp>
+        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
+          <stringProp name="LoopController.loops">10</stringProp>
+          <boolProp name="LoopController.continue_forever">false</boolProp>
+        </elementProp>
+        <longProp name="ThreadGroup.end_time">1152004173000</longProp>
+        <stringProp name="ThreadGroup.on_sample_error">stopthread</stringProp>
+        <stringProp name="ThreadGroup.ramp_time">0</stringProp>
+      </ThreadGroup>
+      <hashTree>
+        <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler" testname="AES256" enabled="true">
+          <stringProp name="HTTPSampler.path">/index.html</stringProp>
+          <stringProp name="HTTPSampler.method">GET</stringProp>
+          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
+          <stringProp name="HTTPSampler.protocol">HTTPS</stringProp>
+          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
+          <stringProp name="HTTPSampler.port">3443</stringProp>
+          <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
+            <collectionProp name="Arguments.arguments"/>
+          </elementProp>
+          <stringProp name="HTTPSampler.mimetype"></stringProp>
+          <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
+          <stringProp name="HTTPSampler.monitor">false</stringProp>
+          <stringProp name="HTTPSampler.domain">127.0.0.1</stringProp>
+          <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
+          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
+        </HTTPSampler>
+        <hashTree/>
+      </hashTree>
+      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Test 5" enabled="true">
+        <longProp name="ThreadGroup.start_time">1152004173000</longProp>
+        <stringProp name="ThreadGroup.delay"></stringProp>
+        <stringProp name="ThreadGroup.duration"></stringProp>
+        <stringProp name="ThreadGroup.num_threads">16</stringProp>
+        <boolProp name="ThreadGroup.scheduler">false</boolProp>
+        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
+          <stringProp name="LoopController.loops">10</stringProp>
+          <boolProp name="LoopController.continue_forever">false</boolProp>
+        </elementProp>
+        <longProp name="ThreadGroup.end_time">1152004173000</longProp>
+        <stringProp name="ThreadGroup.on_sample_error">stopthread</stringProp>
+        <stringProp name="ThreadGroup.ramp_time">0</stringProp>
+      </ThreadGroup>
+      <hashTree>
+        <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler" testname="Skeleton (RC4)" enabled="true">
+          <stringProp name="HTTPSampler.path">/index.html</stringProp>
+          <stringProp name="HTTPSampler.method">GET</stringProp>
+          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
+          <stringProp name="HTTPSampler.protocol">HTTPS</stringProp>
+          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
+          <stringProp name="HTTPSampler.port">1443</stringProp>
+          <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
+            <collectionProp name="Arguments.arguments"/>
+          </elementProp>
+          <stringProp name="HTTPSampler.mimetype"></stringProp>
+          <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
+          <stringProp name="HTTPSampler.monitor">false</stringProp>
+          <stringProp name="HTTPSampler.domain">127.0.0.1</stringProp>
+          <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
+          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
+        </HTTPSampler>
+        <hashTree/>
+      </hashTree>
+      <ResultCollector guiclass="StatGraphVisualizer" testclass="ResultCollector" testname="Aggregate Graph" enabled="true">
+        <objProp>
+          <value class="SampleSaveConfiguration">
+            <time>true</time>
+            <latency>true</latency>
+            <timestamp>true</timestamp>
+            <success>true</success>
+            <label>true</label>
+            <code>true</code>
+            <message>true</message>
+            <threadName>true</threadName>
+            <dataType>true</dataType>
+            <encoding>false</encoding>
+            <assertions>true</assertions>
+            <subresults>true</subresults>
+            <responseData>false</responseData>
+            <samplerData>false</samplerData>
+            <xml>false</xml>
+            <fieldNames>false</fieldNames>
+            <responseHeaders>false</responseHeaders>
+            <requestHeaders>false</requestHeaders>
+            <responseDataOnError>false</responseDataOnError>
+            <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
+            <assertionsResultsToSave>0</assertionsResultsToSave>
+          </value>
+          <name>saveConfig</name>
+        </objProp>
+        <stringProp name="filename"></stringProp>
+        <boolProp name="ResultCollector.error_logging">false</boolProp>
+      </ResultCollector>
+      <hashTree/>
+      <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="false">
+        <objProp>
+          <value class="SampleSaveConfiguration">
+            <time>true</time>
+            <latency>true</latency>
+            <timestamp>true</timestamp>
+            <success>true</success>
+            <label>true</label>
+            <code>true</code>
+            <message>true</message>
+            <threadName>true</threadName>
+            <dataType>true</dataType>
+            <encoding>false</encoding>
+            <assertions>true</assertions>
+            <subresults>true</subresults>
+            <responseData>false</responseData>
+            <samplerData>false</samplerData>
+            <xml>false</xml>
+            <fieldNames>false</fieldNames>
+            <responseHeaders>false</responseHeaders>
+            <requestHeaders>false</requestHeaders>
+            <responseDataOnError>false</responseDataOnError>
+            <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
+            <assertionsResultsToSave>0</assertionsResultsToSave>
+          </value>
+          <name>saveConfig</name>
+        </objProp>
+        <stringProp name="filename"></stringProp>
+        <boolProp name="ResultCollector.error_logging">false</boolProp>
+      </ResultCollector>
+      <hashTree/>
+    </hashTree>
+  </hashTree>
+</jmeterTestPlan>
diff --git a/libs/nixio/axTLS/config/Rules.mak b/libs/nixio/axTLS/config/Rules.mak
new file mode 100644 (file)
index 0000000..c0308da
--- /dev/null
@@ -0,0 +1,220 @@
+# Rules.make for busybox
+#
+# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
+#
+# Licensed under GPLv2, see the file LICENSE in this tarball for details.
+#
+
+# Pull in the user's busybox configuration
+ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
+-include $(top_builddir)/.config
+endif
+
+#--------------------------------------------------------
+PROG      := busybox
+MAJOR_VERSION   :=1
+MINOR_VERSION   :=1
+SUBLEVEL_VERSION:=0
+EXTRAVERSION    :=
+VERSION   :=$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL_VERSION)$(EXTRAVERSION)
+BUILDTIME := $(shell TZ=UTC date -u "+%Y.%m.%d-%H:%M%z")
+
+
+#--------------------------------------------------------
+# With a modern GNU make(1) (highly recommended, that's what all the
+# developers use), all of the following configuration values can be
+# overridden at the command line.  For example:
+#   make CROSS=powerpc-linux- top_srcdir="$HOME/busybox" PREFIX=/mnt/app
+#--------------------------------------------------------
+
+# If you are running a cross compiler, you will want to set 'CROSS'
+# to something more interesting...  Target architecture is determined
+# by asking the CC compiler what arch it compiles things for, so unless
+# your compiler is broken, you should not need to specify TARGET_ARCH
+CROSS           =$(subst ",, $(strip $(CROSS_COMPILER_PREFIX)))
+CC             = $(CROSS)gcc
+AR             = $(CROSS)ar
+AS             = $(CROSS)as
+LD             = $(CROSS)ld
+NM             = $(CROSS)nm
+STRIP          = $(CROSS)strip
+CPP            = $(CC) -E
+# MAKEFILES      = $(top_builddir)/.config
+RM             = rm
+RM_F           = $(RM) -f
+LN             = ln
+LN_S           = $(LN) -s
+MKDIR          = mkdir
+MKDIR_P        = $(MKDIR) -p
+MV             = mv
+CP             = cp
+
+
+# What OS are you compiling busybox for?  This allows you to include
+# OS specific things, syscall overrides, etc.
+TARGET_OS=linux
+
+# Select the compiler needed to build binaries for your development system
+HOSTCC    = gcc
+HOSTCFLAGS= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
+
+# Ensure consistent sort order, 'gcc -print-search-dirs' behavior, etc.
+LC_ALL:= C
+
+# If you want to add some simple compiler switches (like -march=i686),
+# especially from the command line, use this instead of CFLAGS directly.
+# For optimization overrides, it's better still to set OPTIMIZATION.
+CFLAGS_EXTRA=$(subst ",, $(strip $(EXTRA_CFLAGS_OPTIONS)))
+
+# To compile vs some other alternative libc, you may need to use/adjust
+# the following lines to meet your needs...
+#
+# If you are using Red Hat 6.x with the compatible RPMs (for developing under
+# Red Hat 5.x and glibc 2.0) uncomment the following.  Be sure to read about
+# using the compatible RPMs (compat-*) at http://www.redhat.com !
+#LIBCDIR:=/usr/i386-glibc20-linux
+#
+# For other libraries, you are on your own.  But these may (or may not) help...
+#LDFLAGS+=-nostdlib
+#LIBRARIES:=$(LIBCDIR)/lib/libc.a -lgcc
+#CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR) -funsigned-char
+#GCCINCDIR:=$(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
+
+WARNINGS=-Wall -Wstrict-prototypes -Wshadow
+CFLAGS=-I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)
+ARFLAGS=cru
+
+
+# gcc centric. Perhaps fiddle with findstring gcc,$(CC) for the rest
+# get the CC MAJOR/MINOR version
+CC_MAJOR:=$(shell printf "%02d" $(shell echo __GNUC__ | $(CC) -E -xc - | tail -n 1))
+CC_MINOR:=$(shell printf "%02d" $(shell echo __GNUC_MINOR__ | $(CC) -E -xc - | tail -n 1))
+
+#--------------------------------------------------------
+export VERSION BUILDTIME HOSTCC HOSTCFLAGS CROSS CC AR AS LD NM STRIP CPP
+ifeq ($(strip $(TARGET_ARCH)),)
+TARGET_ARCH:=$(shell $(CC) -dumpmachine | sed -e s'/-.*//' \
+               -e 's/i.86/i386/' \
+               -e 's/sparc.*/sparc/' \
+               -e 's/arm.*/arm/g' \
+               -e 's/m68k.*/m68k/' \
+               -e 's/ppc/powerpc/g' \
+               -e 's/v850.*/v850/g' \
+               -e 's/sh[234]/sh/' \
+               -e 's/mips-.*/mips/' \
+               -e 's/mipsel-.*/mipsel/' \
+               -e 's/cris.*/cris/' \
+               )
+endif
+
+# A nifty macro to make testing gcc features easier
+check_gcc=$(shell \
+       if [ "$(1)" != "" ]; then \
+               if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
+               then echo "$(1)"; else echo "$(2)"; fi \
+       fi)
+
+# Setup some shortcuts so that silent mode is silent like it should be
+ifeq ($(subst s,,$(MAKEFLAGS)),$(MAKEFLAGS))
+export MAKE_IS_SILENT=n
+SECHO=@echo
+else
+export MAKE_IS_SILENT=y
+SECHO=-@false
+endif
+
+CFLAGS+=$(call check_gcc,-funsigned-char,)
+
+#--------------------------------------------------------
+# Arch specific compiler optimization stuff should go here.
+# Unless you want to override the defaults, do not set anything
+# for OPTIMIZATION...
+
+# use '-Os' optimization if available, else use -O2
+OPTIMIZATION:=$(call check_gcc,-Os,-O2)
+
+# Some nice architecture specific optimizations
+ifeq ($(strip $(TARGET_ARCH)),arm)
+       OPTIMIZATION+=-fstrict-aliasing
+endif
+ifeq ($(strip $(TARGET_ARCH)),i386)
+       OPTIMIZATION+=$(call check_gcc,-march=i386,)
+       OPTIMIZATION+=$(call check_gcc,-mpreferred-stack-boundary=2,)
+       OPTIMIZATION+=$(call check_gcc,-falign-functions=0 -falign-jumps=0 -falign-loops=0,\
+               -malign-functions=0 -malign-jumps=0 -malign-loops=0)
+endif
+OPTIMIZATIONS:=$(OPTIMIZATION) -fomit-frame-pointer
+
+#
+#--------------------------------------------------------
+# If you're going to do a lot of builds with a non-vanilla configuration,
+# it makes sense to adjust parameters above, so you can type "make"
+# by itself, instead of following it by the same half-dozen overrides
+# every time.  The stuff below, on the other hand, is probably less
+# prone to casual user adjustment.
+#
+
+ifeq ($(strip $(CONFIG_LFS)),y)
+    # For large file summit support
+    CFLAGS+=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+endif
+ifeq ($(strip $(CONFIG_DMALLOC)),y)
+    # For testing mem leaks with dmalloc
+    CFLAGS+=-DDMALLOC
+    LIBRARIES:=-ldmalloc
+else
+    ifeq ($(strip $(CONFIG_EFENCE)),y)
+       LIBRARIES:=-lefence
+    endif
+endif
+ifeq ($(strip $(CONFIG_DEBUG)),y)
+    CFLAGS  +=$(WARNINGS) -g -D_GNU_SOURCE
+    LDFLAGS +=-Wl,-warn-common
+    STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging
+else
+    CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG
+    LDFLAGS += -Wl,-warn-common
+    STRIPCMD:=$(STRIP) -s --remove-section=.note --remove-section=.comment
+endif
+ifeq ($(strip $(CONFIG_STATIC)),y)
+    LDFLAGS += --static
+endif
+
+ifeq ($(strip $(CONFIG_SELINUX)),y)
+    LIBRARIES += -lselinux
+endif
+
+ifeq ($(strip $(PREFIX)),)
+    PREFIX:=`pwd`/_install
+endif
+
+# Additional complications due to support for pristine source dir.
+# Include files in the build directory should take precedence over
+# the copy in top_srcdir, both during the compilation phase and the
+# shell script that finds the list of object files.
+# Work in progress by <ldoolitt@recycle.lbl.gov>.
+
+
+OBJECTS:=$(APPLET_SOURCES:.c=.o) busybox.o usage.o applets.o
+CFLAGS    += $(CROSS_CFLAGS)
+ifdef BB_INIT_SCRIPT
+    CFLAGS += -DINIT_SCRIPT='"$(BB_INIT_SCRIPT)"'
+endif
+
+# Put user-supplied flags at the end, where they
+# have a chance of winning.
+CFLAGS += $(CFLAGS_EXTRA)
+
+#------------------------------------------------------------
+# Installation options
+ifeq ($(strip $(CONFIG_INSTALL_APPLET_HARDLINKS)),y)
+INSTALL_OPTS=--hardlinks
+endif
+ifeq ($(strip $(CONFIG_INSTALL_APPLET_SYMLINKS)),y)
+INSTALL_OPTS=--symlinks
+endif
+ifeq ($(strip $(CONFIG_INSTALL_APPLET_DONT)),y)
+INSTALL_OPTS=
+endif
+
+.PHONY: dummy
diff --git a/libs/nixio/axTLS/config/axhttpd.aip b/libs/nixio/axTLS/config/axhttpd.aip
new file mode 100755 (executable)
index 0000000..412fe3b
--- /dev/null
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
+<DOCUMENT type="Advanced Installer" CreateVersion="3.9" version="6.0.1" modules="freeware" RootPath="." Language="en">\r
+  <COMPONENT cid="caphyon.advinst.msicomp.MsiPropsComponent">\r
+    <ROW Property="ALLUSERS" Value="2"/>\r
+    <ROW Property="ARPCOMMENTS" Value="This installer database contains the logic and data required to install &lt;product name&gt;." ValueLocId="*"/>\r
+    <ROW Property="ARPPRODUCTICON" Value="controlPanelIcon.exe"/>\r
+    <ROW Property="ARPURLINFOABOUT" Value="http://axtls.cerocclub.com.au"/>\r
+    <ROW Property="BannerBitmap" Value="default_banner.bmp" Type="1"/>\r
+    <ROW Property="DialogBitmap" Value="default_dialog.bmp" Type="1"/>\r
+    <ROW Property="Manufacturer" Value="axTLS" ValueLocId="*"/>\r
+    <ROW Property="ProductCode" Value="1033:{F49FFA19-C243-4627-BE13-7DEDA4E700D0} "/>\r
+    <ROW Property="ProductLanguage" Value="1033"/>\r
+    <ROW Property="ProductName" Value="Axhttpd" ValueLocId="*"/>\r
+    <ROW Property="ProductVersion" Value="1.1.8"/>\r
+    <ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND"/>\r
+    <ROW Property="UpgradeCode" Value="{93E5623E-740C-449C-9770-EDABD392868D}"/>\r
+  </COMPONENT>\r
+  <COMPONENT cid="caphyon.advinst.msicomp.MsiDirsComponent">\r
+    <ROW Directory="APPDIR" Directory_Parent="TARGETDIR" DefaultDir="APPDIR:." IsPseudoRoot="1"/>\r
+    <ROW Directory="New_Folder_DIR" Directory_Parent="APPDIR" DefaultDir="include"/>\r
+    <ROW Directory="SHORTCUTDIR" Directory_Parent="TARGETDIR" DefaultDir="SHORTC~1|SHORTCUTDIR" IsPseudoRoot="1"/>\r
+    <ROW Directory="TARGETDIR" DefaultDir="SourceDir"/>\r
+    <ROW Directory="another_dir_DIR" Directory_Parent="test_dir_DIR" DefaultDir="anothe~1|another_dir"/>\r
+    <ROW Directory="bin_DIR" Directory_Parent="test_dir_DIR" DefaultDir="bin"/>\r
+    <ROW Directory="no_http_DIR" Directory_Parent="test_dir_DIR" DefaultDir="no_http"/>\r
+    <ROW Directory="no_ssl_DIR" Directory_Parent="test_dir_DIR" DefaultDir="no_ssl"/>\r
+    <ROW Directory="test_dir_DIR" Directory_Parent="www_DIR" DefaultDir="test_dir"/>\r
+    <ROW Directory="www_DIR" Directory_Parent="APPDIR" DefaultDir="www"/>\r
+  </COMPONENT>\r
+  <COMPONENT cid="caphyon.advinst.msicomp.MsiCompsComponent">\r
+    <ROW Component="another_dir" ComponentId="{3F073789-DB33-40BC-BF88-922C6DF252EC}" Directory_="another_dir_DIR" Attributes="0"/>\r
+    <ROW Component="axhttpd.exe" ComponentId="{0AEFFA20-29FA-4304-8227-F9ED0E6B8A0A}" Directory_="APPDIR" Attributes="0" KeyPath="axhttpd.exe" FullKeyPath="APPDIR\axhttpd.exe"/>\r
+    <ROW Component="axssl.exe" ComponentId="{E1E96774-7BFC-45B9-BA33-FC0C631921FD}" Directory_="APPDIR" Attributes="0" KeyPath="axssl.exe" FullKeyPath="APPDIR\axssl.exe"/>\r
+    <ROW Component="axtls.dll" ComponentId="{4C741E75-A18A-4FC9-972C-C1EF583713EB}" Directory_="APPDIR" Attributes="0" KeyPath="axtls.dll" FullKeyPath="APPDIR\axtls.dll"/>\r
+    <ROW Component="axtls.jar" ComponentId="{796CB0A9-6214-4531-A330-9B37420B7799}" Directory_="APPDIR" Attributes="0" KeyPath="axtls.static.lib" FullKeyPath="APPDIR"/>\r
+    <ROW Component="bigint.h" ComponentId="{FC3E492B-D4F0-41FB-A977-76F6E9FE9FFE}" Directory_="New_Folder_DIR" Attributes="0" KeyPath="bigint.h" FullKeyPath="APPDIR\include"/>\r
+    <ROW Component="favicon.ico" ComponentId="{9A1AB507-100A-470D-A002-CD8262CA4913}" Directory_="www_DIR" Attributes="0" KeyPath="favicon.ico" FullKeyPath="APPDIR\www"/>\r
+    <ROW Component="htaccess" ComponentId="{F53CB1D5-A3B9-4401-B0BA-B6AB1DA860B7}" Directory_="no_ssl_DIR" Attributes="0" KeyPath="htaccess" FullKeyPath="APPDIR\www\test_dir\no_ssl"/>\r
+    <ROW Component="htaccess_1" ComponentId="{953D1999-CC00-4F85-9B48-2CD83ACAE2F9}" Directory_="no_http_DIR" Attributes="0" KeyPath="htaccess_1" FullKeyPath="APPDIR\www\test_dir\no_http"/>\r
+    <ROW Component="htaccess_2" ComponentId="{6F181A8B-B313-47E2-AF79-AABFDBD353D8}" Directory_="bin_DIR" Attributes="0" KeyPath="htaccess_2" FullKeyPath="APPDIR\www\test_dir\bin"/>\r
+    <ROW Component="htpasswd.exe" ComponentId="{9FE1AAD2-4E35-443A-AAE5-3A7D03A52AAA}" Directory_="APPDIR" Attributes="0" KeyPath="htpasswd.exe" FullKeyPath="APPDIR\htpasswd.exe"/>\r
+    <ROW Component="test_dir" ComponentId="{832C9295-CF2A-402E-BB3C-65BCBCBB5971}" Directory_="test_dir_DIR" Attributes="0"/>\r
+  </COMPONENT>\r
+  <COMPONENT cid="caphyon.advinst.msicomp.MsiFeatsComponent">\r
+    <ROW Feature="MainFeature" Title="MainFeature" Description="Description" Display="1" Level="1" Directory_="APPDIR" Attributes="0" Components="axhttpd.exe axssl.exe axtls.dll axtls.jar favicon.ico bigint.h htpasswd.exe another_dir htaccess htaccess_2 htaccess_1 test_dir"/>\r
+    <ATTRIBUTE name="CurrentFeature" value="MainFeature"/>\r
+  </COMPONENT>\r
+  <COMPONENT cid="caphyon.advinst.msicomp.MsiFilesComponent">\r
+    <ROW File="axhttpd.exe" Component_="axhttpd.exe" FileName="axhttpd.exe" Attributes="0" SourcePath="..\_stage\axhttpd.exe" SelfReg="false" Sequence="1"/>\r
+    <ROW File="axssl.exe" Component_="axssl.exe" FileName="axssl.exe" Attributes="0" SourcePath="..\_stage\axssl.exe" SelfReg="false" Sequence="2"/>\r
+    <ROW File="axtls.dll" Component_="axtls.dll" FileName="axtls.dll" Attributes="0" SourcePath="..\_stage\axtls.dll" SelfReg="false" Sequence="3"/>\r
+    <ROW File="axtls.lib" Component_="axtls.jar" FileName="axtls.lib" Attributes="0" SourcePath="..\_stage\axtls.lib" SelfReg="false" Sequence="4"/>\r
+    <ROW File="axtls.static.lib" Component_="axtls.jar" FileName="axtlss~1.lib|axtls.static.lib" Attributes="0" SourcePath="..\_stage\axtls.static.lib" SelfReg="false" Sequence="5"/>\r
+    <ROW File="bigint.h" Component_="bigint.h" FileName="bigint.h" Attributes="0" SourcePath="..\crypto\bigint.h" SelfReg="false" Sequence="12"/>\r
+    <ROW File="bigint_impl.h" Component_="bigint.h" FileName="bigint~1.h|bigint_impl.h" Attributes="0" SourcePath="..\crypto\bigint_impl.h" SelfReg="false" Sequence="9"/>\r
+    <ROW File="crypto.h" Component_="bigint.h" FileName="crypto.h" Attributes="0" SourcePath="..\crypto\crypto.h" SelfReg="false" Sequence="10"/>\r
+    <ROW File="crypto_misc.h" Component_="bigint.h" FileName="crypto~1.h|crypto_misc.h" Attributes="0" SourcePath="..\ssl\crypto_misc.h" SelfReg="false" Sequence="21"/>\r
+    <ROW File="favicon.ico" Component_="favicon.ico" FileName="favicon.ico" Attributes="0" SourcePath="..\www\favicon.ico" SelfReg="false" Sequence="6"/>\r
+    <ROW File="htaccess" Component_="htaccess" FileName="htacce~1|.htaccess" Attributes="0" SourcePath="..\www\test_dir\no_ssl\.htaccess" SelfReg="false" Sequence="15"/>\r
+    <ROW File="htaccess_1" Component_="htaccess_1" FileName="htacce~1|.htaccess" Attributes="0" SourcePath="..\www\test_dir\no_http\.htaccess" SelfReg="false" Sequence="18"/>\r
+    <ROW File="htaccess_2" Component_="htaccess_2" FileName="htacce~1|.htaccess" Attributes="0" SourcePath="..\www\test_dir\bin\.htaccess" SelfReg="false" Sequence="17"/>\r
+    <ROW File="htpasswd" Component_="htaccess_1" FileName="htpass~1|.htpasswd" Attributes="0" SourcePath="..\www\test_dir\no_http\.htpasswd" SelfReg="false" Sequence="19"/>\r
+    <ROW File="htpasswd.exe" Component_="htpasswd.exe" FileName="htpasswd.exe" Attributes="0" SourcePath="..\_stage\htpasswd.exe" SelfReg="false" Sequence="14"/>\r
+    <ROW File="index.html" Component_="favicon.ico" FileName="index~1.htm|index.html" Attributes="0" SourcePath="..\www\index.html" SelfReg="false" Sequence="7"/>\r
+    <ROW File="index.html_1" Component_="htaccess" FileName="index~1.htm|index.html" Attributes="0" SourcePath="..\www\test_dir\no_ssl\index.html" SelfReg="false" Sequence="16"/>\r
+    <ROW File="index.html_2" Component_="htaccess_1" FileName="index~1.htm|index.html" Attributes="0" SourcePath="..\www\test_dir\no_http\index.html" SelfReg="false" Sequence="20"/>\r
+    <ROW File="os_port.h" Component_="bigint.h" FileName="os_port.h" Attributes="0" SourcePath="..\ssl\os_port.h" SelfReg="false" Sequence="13"/>\r
+    <ROW File="ssl.h" Component_="bigint.h" FileName="ssl.h" Attributes="0" SourcePath="..\ssl\ssl.h" SelfReg="false" Sequence="8"/>\r
+    <ROW File="tls1.h" Component_="bigint.h" FileName="tls1.h" Attributes="0" SourcePath="..\ssl\tls1.h" SelfReg="false" Sequence="11"/>\r
+  </COMPONENT>\r
+  <COMPONENT cid="caphyon.advinst.msicomp.BuildComponent">\r
+    <ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" InstallationType="4"/>\r
+    <ATTRIBUTE name="CurrentBuild" value="DefaultBuild"/>\r
+  </COMPONENT>\r
+  <COMPONENT cid="caphyon.advinst.msicomp.DictionaryComponent">\r
+    <ROW Path="&lt;ui.ail&gt;"/>\r
+    <ROW Path="&lt;ui_en.ail&gt;"/>\r
+  </COMPONENT>\r
+  <COMPONENT cid="caphyon.advinst.msicomp.FragmentComponent">\r
+    <ROW Fragment="FolderDlg.aip" Path="&lt;FolderDlg.aip&gt;"/>\r
+    <ROW Fragment="StaticUIStrings.aip" Path="&lt;StaticUIStrings.aip&gt;"/>\r
+    <ROW Fragment="UI.aip" Path="&lt;UI.aip&gt;"/>\r
+  </COMPONENT>\r
+  <COMPONENT cid="caphyon.advinst.msicomp.MsiBinaryComponent">\r
+    <ROW Name="aicustact.dll" SourcePath="&lt;aicustact.dll&gt;"/>\r
+    <ROW Name="default_banner.bmp" SourcePath="&lt;default-banner.bmp&gt;"/>\r
+    <ROW Name="default_dialog.bmp" SourcePath="&lt;default-dialog.bmp&gt;"/>\r
+  </COMPONENT>\r
+  <COMPONENT cid="caphyon.advinst.msicomp.MsiControlComponent">\r
+    <ATTRIBUTE name="FixedSizeBitmaps" value="0"/>\r
+  </COMPONENT>\r
+  <COMPONENT cid="caphyon.advinst.msicomp.MsiControlEventComponent">\r
+    <ROW Dialog_="FolderDlg" Control_="Back" Event="NewDialog" Argument="WelcomeDlg" Condition="AI_INSTALL" Ordering="1"/>\r
+    <ROW Dialog_="WelcomeDlg" Control_="Next" Event="NewDialog" Argument="FolderDlg" Condition="AI_INSTALL" Ordering="1"/>\r
+    <ROW Dialog_="VerifyReadyDlg" Control_="Back" Event="NewDialog" Argument="FolderDlg" Condition="AI_INSTALL" Ordering="1"/>\r
+    <ROW Dialog_="FolderDlg" Control_="Next" Event="NewDialog" Argument="VerifyReadyDlg" Condition="AI_INSTALL" Ordering="3"/>\r
+    <ROW Dialog_="MaintenanceTypeDlg" Control_="Back" Event="NewDialog" Argument="MaintenanceWelcomeDlg" Condition="AI_MAINT" Ordering="1"/>\r
+    <ROW Dialog_="MaintenanceWelcomeDlg" Control_="Next" Event="NewDialog" Argument="MaintenanceTypeDlg" Condition="AI_MAINT" Ordering="2"/>\r
+    <ROW Dialog_="VerifyReadyDlg" Control_="Back" Event="NewDialog" Argument="PatchWelcomeDlg" Condition="AI_PATCH" Ordering="1"/>\r
+    <ROW Dialog_="PatchWelcomeDlg" Control_="Next" Event="NewDialog" Argument="VerifyReadyDlg" Condition="AI_PATCH" Ordering="2"/>\r
+  </COMPONENT>\r
+  <COMPONENT cid="caphyon.advinst.msicomp.MsiCreateFolderComponent">\r
+    <ROW Directory_="another_dir_DIR" Component_="another_dir"/>\r
+    <ROW Directory_="test_dir_DIR" Component_="test_dir"/>\r
+  </COMPONENT>\r
+  <COMPONENT cid="caphyon.advinst.msicomp.MsiCustActComponent">\r
+    <ROW Action="AI_DOWNGRADE" Type="19" Target="4010"/>\r
+    <ROW Action="AI_PREPARE_UPGRADE" Type="65" Source="aicustact.dll" Target="PrepareUpgrade"/>\r
+    <ROW Action="AI_RESTORE_LOCATION" Type="65" Source="aicustact.dll" Target="RestoreLocation"/>\r
+    <ROW Action="AI_STORE_LOCATION" Type="51" Source="ARPINSTALLLOCATION" Target="[APPDIR]"/>\r
+    <ROW Action="SET_APPDIR" Type="307" Source="APPDIR" Target="[ProgramFilesFolder][Manufacturer]\[ProductName]" MultiBuildTarget="DefaultBuild:[ProgramFilesFolder][ProductName]"/>\r
+    <ROW Action="SET_SHORTCUTDIR" Type="307" Source="SHORTCUTDIR" Target="[ProgramMenuFolder][ProductName]"/>\r
+    <ROW Action="SET_TARGETDIR_TO_APPDIR" Type="51" Source="TARGETDIR" Target="[APPDIR]"/>\r
+  </COMPONENT>\r
+  <COMPONENT cid="caphyon.advinst.msicomp.MsiIconsComponent">\r
+    <ROW Name="controlPanelIcon.exe" SourcePath="..\..\axhttpd\www\favicon.ico" Index="0"/>\r
+  </COMPONENT>\r
+  <COMPONENT cid="caphyon.advinst.msicomp.MsiInstExSeqComponent">\r
+    <ROW Action="AI_DOWNGRADE" Condition="AI_NEWERPRODUCTFOUND AND (UILevel &lt;&gt; 5)" Sequence="210"/>\r
+    <ROW Action="AI_RESTORE_LOCATION" Condition="APPDIR=&quot;&quot;" Sequence="740"/>\r
+    <ROW Action="AI_STORE_LOCATION" Condition="Not Installed" Sequence="1545"/>\r
+    <ROW Action="AI_PREPARE_UPGRADE" Condition="AI_UPGRADE=&quot;No&quot; AND (Not Installed)" Sequence="1300"/>\r
+  </COMPONENT>\r
+  <COMPONENT cid="caphyon.advinst.msicomp.MsiInstallUISequenceComponent">\r
+    <ROW Action="AI_RESTORE_LOCATION" Condition="APPDIR=&quot;&quot;" Sequence="740"/>\r
+  </COMPONENT>\r
+  <COMPONENT cid="caphyon.advinst.msicomp.MsiShortsComponent">\r
+    <ROW Shortcut="axhttpd.exe" Directory_="SHORTCUTDIR" Name="axhttpd" Component_="axhttpd.exe" Target="[#axhttpd.exe]" Description="axhttpd.exe" Hotkey="0" IconIndex="0" ShowCmd="1" WkDir="APPDIR"/>\r
+    <ROW Shortcut="axssl_client" Directory_="SHORTCUTDIR" Name="axsslc~1|axssl client" Component_="axssl.exe" Target="[#axssl.exe]" Arguments="s_client" Hotkey="0" IconIndex="0" ShowCmd="1" WkDir="APPDIR"/>\r
+    <ROW Shortcut="axssl_server" Directory_="SHORTCUTDIR" Name="axssls~1|axssl server" Component_="axssl.exe" Target="[#axssl.exe]" Arguments="s_server" Hotkey="0" IconIndex="0" ShowCmd="1" WkDir="APPDIR"/>\r
+  </COMPONENT>\r
+  <COMPONENT cid="caphyon.advinst.msicomp.MsiUpgradeComponent">\r
+    <ROW UpgradeCode="[|UpgradeCode]" VersionMax="[|ProductVersion]" Attributes="1025" ActionProperty="OLDPRODUCTS"/>\r
+    <ROW UpgradeCode="[|UpgradeCode]" VersionMin="[|ProductVersion]" Attributes="2" ActionProperty="AI_NEWERPRODUCTFOUND"/>\r
+  </COMPONENT>\r
+</DOCUMENT>\r
diff --git a/libs/nixio/axTLS/config/axtls.RES b/libs/nixio/axTLS/config/axtls.RES
new file mode 100644 (file)
index 0000000..2929b3b
Binary files /dev/null and b/libs/nixio/axTLS/config/axtls.RES differ
diff --git a/libs/nixio/axTLS/config/axtls.rc b/libs/nixio/axTLS/config/axtls.rc
new file mode 100644 (file)
index 0000000..0f288aa
--- /dev/null
@@ -0,0 +1,32 @@
+//Microsoft Visual C++ generated resource script.\r
+//\r
+#define APSTUDIO_READONLY_SYMBOLS\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 2 resource.\r
+//\r
+#define APSTUDIO_HIDDEN_SYMBOLS\r
+#undef APSTUDIO_HIDDEN_SYMBOLS\r
+/////////////////////////////////////////////////////////////////////////////\r
+#undef APSTUDIO_READONLY_SYMBOLS\r
+\r
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r
+LANGUAGE 9, 1\r
+#pragma code_page(1252)\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Icon\r
+//\r
+\r
+// Icon with lowest ID value placed first to ensure application icon\r
+// remains consistent on all systems.\r
+\r
+IDI_AXTLS       ICON         "../www/favicon.ico"\r
+\r
+\r
+#endif\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+\r
+\r
diff --git a/libs/nixio/axTLS/config/config.h b/libs/nixio/axTLS/config/config.h
new file mode 100644 (file)
index 0000000..46a53cf
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * Automatically generated header file: don't edit
+ */
+
+#define HAVE_DOT_CONFIG 1
+#define CONFIG_PLATFORM_LINUX 1
+#undef CONFIG_PLATFORM_CYGWIN
+#undef CONFIG_PLATFORM_WIN32
+
+/*
+ * General Configuration
+ */
+#define PREFIX "/usr"
+#undef CONFIG_DEBUG
+#define CONFIG_STRIP_UNWANTED_SECTIONS 1
+#undef CONFIG_VISUAL_STUDIO_7_0
+#undef CONFIG_VISUAL_STUDIO_8_0
+#define CONFIG_VISUAL_STUDIO_7_0_BASE ""
+#define CONFIG_VISUAL_STUDIO_8_0_BASE ""
+#define CONFIG_EXTRA_CFLAGS_OPTIONS "-fpic"
+#define CONFIG_EXTRA_LDFLAGS_OPTIONS ""
+
+/*
+ * SSL Library
+ */
+#undef CONFIG_SSL_SERVER_ONLY
+#undef CONFIG_SSL_CERT_VERIFICATION
+#define CONFIG_SSL_ENABLE_CLIENT 1
+#undef CONFIG_SSL_FULL_MODE
+#undef CONFIG_SSL_SKELETON_MODE
+#undef CONFIG_SSL_PROT_LOW
+#define CONFIG_SSL_PROT_MEDIUM 1
+#undef CONFIG_SSL_PROT_HIGH
+#define CONFIG_SSL_USE_DEFAULT_KEY 1
+#define CONFIG_SSL_PRIVATE_KEY_LOCATION ""
+#define CONFIG_SSL_PRIVATE_KEY_PASSWORD ""
+#define CONFIG_SSL_X509_CERT_LOCATION ""
+#define CONFIG_SSL_GENERATE_X509_CERT 1
+#define CONFIG_SSL_X509_COMMON_NAME ""
+#define CONFIG_SSL_X509_ORGANIZATION_NAME ""
+#define CONFIG_SSL_X509_ORGANIZATION_UNIT_NAME ""
+#define CONFIG_SSL_ENABLE_V23_HANDSHAKE 1
+#define CONFIG_SSL_HAS_PEM 1
+#undef CONFIG_SSL_USE_PKCS12
+#define CONFIG_SSL_EXPIRY_TIME 24
+#define CONFIG_X509_MAX_CA_CERTS 4
+#define CONFIG_SSL_MAX_CERTS 2
+#define CONFIG_SSL_CTX_MUTEXING 1
+#define CONFIG_USE_DEV_URANDOM 1
+#undef CONFIG_WIN32_USE_CRYPTO_LIB
+#undef CONFIG_OPENSSL_COMPATIBLE
+#undef CONFIG_PERFORMANCE_TESTING
+#undef CONFIG_SSL_TEST
+#undef CONFIG_AXHTTPD
+#undef CONFIG_HTTP_STATIC_BUILD
+#define CONFIG_HTTP_PORT 
+#define CONFIG_HTTP_HTTPS_PORT 
+#define CONFIG_HTTP_SESSION_CACHE_SIZE 
+#define CONFIG_HTTP_WEBROOT ""
+#define CONFIG_HTTP_TIMEOUT 
+#undef CONFIG_HTTP_HAS_CGI
+#define CONFIG_HTTP_CGI_EXTENSIONS ""
+#undef CONFIG_HTTP_ENABLE_LUA
+#define CONFIG_HTTP_LUA_PREFIX ""
+#define CONFIG_HTTP_LUA_CGI_LAUNCHER ""
+#undef CONFIG_HTTP_BUILD_LUA
+#undef CONFIG_HTTP_DIRECTORIES
+#undef CONFIG_HTTP_HAS_AUTHORIZATION
+#undef CONFIG_HTTP_HAS_IPV6
+#undef CONFIG_HTTP_ENABLE_DIFFERENT_USER
+#define CONFIG_HTTP_USER ""
+#undef CONFIG_HTTP_VERBOSE
+#undef CONFIG_HTTP_IS_DAEMON
+
+/*
+ * Language Bindings
+ */
+#undef CONFIG_BINDINGS
+#undef CONFIG_CSHARP_BINDINGS
+#undef CONFIG_VBNET_BINDINGS
+#define CONFIG_DOT_NET_FRAMEWORK_BASE ""
+#undef CONFIG_JAVA_BINDINGS
+#define CONFIG_JAVA_HOME ""
+#undef CONFIG_PERL_BINDINGS
+#define CONFIG_PERL_CORE ""
+#define CONFIG_PERL_LIB ""
+#undef CONFIG_LUA_BINDINGS
+#define CONFIG_LUA_CORE ""
+
+/*
+ * Samples
+ */
+#undef CONFIG_SAMPLES
+#undef CONFIG_C_SAMPLES
+#undef CONFIG_CSHARP_SAMPLES
+#undef CONFIG_VBNET_SAMPLES
+#undef CONFIG_JAVA_SAMPLES
+#undef CONFIG_PERL_SAMPLES
+#undef CONFIG_LUA_SAMPLES
+
+/*
+ * BigInt Options
+ */
+#undef CONFIG_BIGINT_CLASSICAL
+#undef CONFIG_BIGINT_MONTGOMERY
+#define CONFIG_BIGINT_BARRETT 1
+#define CONFIG_BIGINT_CRT 1
+#undef CONFIG_BIGINT_KARATSUBA
+#define MUL_KARATSUBA_THRESH 
+#define SQU_KARATSUBA_THRESH 
+#define CONFIG_BIGINT_SLIDING_WINDOW 1
+#define CONFIG_BIGINT_SQUARE 1
+#undef CONFIG_BIGINT_CHECK_ON
diff --git a/libs/nixio/axTLS/config/linuxconfig b/libs/nixio/axTLS/config/linuxconfig
new file mode 100644 (file)
index 0000000..614fdd8
--- /dev/null
@@ -0,0 +1,119 @@
+#
+# Automatically generated make config: don't edit
+#
+HAVE_DOT_CONFIG=y
+CONFIG_PLATFORM_LINUX=y
+# CONFIG_PLATFORM_CYGWIN is not set
+# CONFIG_PLATFORM_SOLARIS is not set
+# CONFIG_PLATFORM_WIN32 is not set
+
+#
+# General Configuration
+#
+PREFIX="/usr/local"
+# CONFIG_DEBUG is not set
+CONFIG_STRIP_UNWANTED_SECTIONS=y
+# CONFIG_VISUAL_STUDIO_7_0 is not set
+# CONFIG_VISUAL_STUDIO_8_0 is not set
+CONFIG_VISUAL_STUDIO_7_0_BASE=""
+CONFIG_VISUAL_STUDIO_8_0_BASE=""
+CONFIG_EXTRA_CFLAGS_OPTIONS=""
+CONFIG_EXTRA_LDFLAGS_OPTIONS=""
+
+#
+# SSL Library
+#
+# CONFIG_SSL_SERVER_ONLY is not set
+# CONFIG_SSL_CERT_VERIFICATION is not set
+# CONFIG_SSL_ENABLE_CLIENT is not set
+CONFIG_SSL_FULL_MODE=y
+# CONFIG_SSL_SKELETON_MODE is not set
+# CONFIG_SSL_PROT_LOW is not set
+CONFIG_SSL_PROT_MEDIUM=y
+# CONFIG_SSL_PROT_HIGH is not set
+CONFIG_SSL_USE_DEFAULT_KEY=y
+CONFIG_SSL_PRIVATE_KEY_LOCATION=""
+CONFIG_SSL_PRIVATE_KEY_PASSWORD=""
+CONFIG_SSL_X509_CERT_LOCATION=""
+CONFIG_SSL_GENERATE_X509_CERT=y
+CONFIG_SSL_X509_COMMON_NAME=""
+CONFIG_SSL_X509_ORGANIZATION_NAME=""
+CONFIG_SSL_X509_ORGANIZATION_UNIT_NAME=""
+CONFIG_SSL_ENABLE_V23_HANDSHAKE=y
+CONFIG_SSL_HAS_PEM=y
+CONFIG_SSL_USE_PKCS12=y
+CONFIG_SSL_EXPIRY_TIME=24
+CONFIG_X509_MAX_CA_CERTS=4
+CONFIG_SSL_MAX_CERTS=2
+# CONFIG_SSL_CTX_MUTEXING is not set
+CONFIG_USE_DEV_URANDOM=y
+# CONFIG_WIN32_USE_CRYPTO_LIB is not set
+CONFIG_OPENSSL_COMPATIBLE=y
+# CONFIG_PERFORMANCE_TESTING is not set
+# CONFIG_SSL_TEST is not set
+CONFIG_AXHTTPD=y
+
+#
+# Axhttpd Configuration
+#
+# CONFIG_HTTP_STATIC_BUILD is not set
+CONFIG_HTTP_PORT=80
+CONFIG_HTTP_HTTPS_PORT=443
+CONFIG_HTTP_SESSION_CACHE_SIZE=5
+CONFIG_HTTP_WEBROOT="../www"
+CONFIG_HTTP_TIMEOUT=300
+
+#
+# CGI
+#
+CONFIG_HTTP_HAS_CGI=y
+CONFIG_HTTP_CGI_EXTENSIONS=".lua,.lp"
+CONFIG_HTTP_ENABLE_LUA=y
+CONFIG_HTTP_LUA_PREFIX="/usr/local"
+CONFIG_HTTP_LUA_CGI_LAUNCHER="/bin/cgi"
+# CONFIG_HTTP_BUILD_LUA is not set
+CONFIG_HTTP_DIRECTORIES=y
+CONFIG_HTTP_HAS_AUTHORIZATION=y
+# CONFIG_HTTP_HAS_IPV6 is not set
+# CONFIG_HTTP_VERBOSE is not set
+# CONFIG_HTTP_IS_DAEMON is not set
+
+#
+# Language Bindings
+#
+CONFIG_BINDINGS=y
+# CONFIG_CSHARP_BINDINGS is not set
+# CONFIG_VBNET_BINDINGS is not set
+CONFIG_DOT_NET_FRAMEWORK_BASE=""
+# CONFIG_JAVA_BINDINGS is not set
+CONFIG_JAVA_HOME=""
+# CONFIG_PERL_BINDINGS is not set
+CONFIG_PERL_CORE=""
+CONFIG_PERL_LIB=""
+# CONFIG_LUA_BINDINGS is not set
+CONFIG_LUA_CORE=""
+
+#
+# Samples
+#
+CONFIG_SAMPLES=y
+CONFIG_C_SAMPLES=y
+# CONFIG_CSHARP_SAMPLES is not set
+# CONFIG_VBNET_SAMPLES is not set
+# CONFIG_JAVA_SAMPLES is not set
+# CONFIG_PERL_SAMPLES is not set
+# CONFIG_LUA_SAMPLES is not set
+
+#
+# BigInt Options
+#
+# CONFIG_BIGINT_CLASSICAL is not set
+# CONFIG_BIGINT_MONTGOMERY is not set
+CONFIG_BIGINT_BARRETT=y
+CONFIG_BIGINT_CRT=y
+# CONFIG_BIGINT_KARATSUBA is not set
+MUL_KARATSUBA_THRESH=0
+SQU_KARATSUBA_THRESH=0
+CONFIG_BIGINT_SLIDING_WINDOW=y
+CONFIG_BIGINT_SQUARE=y
+# CONFIG_BIGINT_CHECK_ON is not set
diff --git a/libs/nixio/axTLS/config/makefile.conf b/libs/nixio/axTLS/config/makefile.conf
new file mode 100644 (file)
index 0000000..9f9db13
--- /dev/null
@@ -0,0 +1,127 @@
+#
+# Copyright (c) 2007, Cameron Rich
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of the axTLS project nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "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 COPYRIGHT OWNER OR
+# CONTRIBUTORS 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.
+#
+
+#
+# A standard makefile for all makefiles
+#
+
+# All executables and libraries go here
+STAGE=./_stage
+
+ifneq ($(MAKECMDGOALS), clean)
+
+# Give an initial rule
+all: 
+
+# Win32 
+ifdef CONFIG_PLATFORM_WIN32
+
+ifdef CONFIG_VISUAL_STUDIO_7_0
+CONFIG_VISUAL_STUDIO_7_0_BASE_UNIX:=$(shell cygpath -u $(CONFIG_VISUAL_STUDIO_7_0_BASE))
+export INCLUDE=$(shell echo "$(CONFIG_VISUAL_STUDIO_7_0_BASE)\vc7\include;$(CONFIG_VISUAL_STUDIO_7_0_BASE)\vc7\platformsdk\include")
+export LIB=$(shell echo "$(CONFIG_VISUAL_STUDIO_7_0_BASE)\vc7\\platformsdk\lib;$(CONFIG_VISUAL_STUDIO_7_0_BASE)\vc7\lib")
+PATH:=$(CONFIG_VISUAL_STUDIO_7_0_BASE_UNIX)/vc7/bin:$(CONFIG_VISUAL_STUDIO_7_0_BASE_UNIX)/common7/ide:$(PATH)
+else 
+ifdef CONFIG_VISUAL_STUDIO_8_0
+CONFIG_VISUAL_STUDIO_8_0_BASE_UNIX:=$(shell cygpath -u $(CONFIG_VISUAL_STUDIO_8_0_BASE))
+export INCLUDE=$(shell echo "$(CONFIG_VISUAL_STUDIO_8_0_BASE)\vc\include;$(CONFIG_VISUAL_STUDIO_8_0_BASE)\vc\platformsdk\include")
+export LIB=$(shell echo "$(CONFIG_VISUAL_STUDIO_8_0_BASE)\vc\platformsdk\lib;$(CONFIG_VISUAL_STUDIO_8_0_BASE)\vc\lib")
+PATH:=$(CONFIG_VISUAL_STUDIO_8_0_BASE_UNIX)/vc/bin:$(CONFIG_VISUAL_STUDIO_8_0_BASE_UNIX)/common7/ide:$(PATH)
+stuff:
+       @echo $(INCLUDE)
+endif
+endif
+
+CC=cl.exe
+LD=link.exe
+AXTLS_INCLUDE=$(shell cygpath -w $(AXTLS_HOME))
+CFLAGS+=/nologo /W3 /D"WIN32" /D"_MBCS" /D"_CONSOLE" /D"_CRT_SECURE_NO_DEPRECATE" /FD /I"$(AXTLS_INCLUDE)crypto" /I"$(AXTLS_INCLUDE)ssl" /I"$(AXTLS_INCLUDE)config" /c 
+LDFLAGS=/nologo /subsystem:console /machine:I386
+LDSHARED = /dll
+AR=lib /nologo
+
+ifdef CONFIG_DEBUG
+       CFLAGS += /Gm /Zi /Od /D "_DEBUG"
+       LDFLAGS += /debug /incremental:yes 
+else
+       CFLAGS += /O2 /D "NDEBUG"
+       LDFLAGS += /incremental:no 
+endif
+
+else    # Not Win32
+
+-include .depend
+
+CFLAGS += -I$(AXTLS_HOME)/config -I$(AXTLS_HOME)/ssl -I$(AXTLS_HOME)/crypto
+LD=$(CC)
+STRIP=strip
+
+# Solaris
+ifdef CONFIG_PLATFORM_SOLARIS
+CFLAGS += -DCONFIG_PLATFORM_SOLARIS
+LDFLAGS += -lsocket -lnsl -lc
+LDSHARED = -G
+# Linux/Cygwin
+else 
+CFLAGS += -Wall -Wstrict-prototypes -Wshadow
+LDSHARED = -shared
+
+# Linux
+ifndef CONFIG_PLATFORM_CYGWIN
+# CFLAGS += -fPIC 
+
+# Cygwin
+else
+CFLAGS += -DCONFIG_PLATFORM_CYGWIN
+LDFLAGS += -enable-auto-import
+endif
+endif
+
+ifdef CONFIG_DEBUG
+CFLAGS += -g
+else
+LDFLAGS += -s
+ifdef CONFIG_PLATFORM_SOLARIS
+CFLAGS += -O 
+else
+CFLAGS += -O3
+endif
+
+endif  # CONFIG_DEBUG
+endif   # WIN32
+
+CFLAGS+=$(subst ",, $(strip $(CONFIG_EXTRA_CFLAGS_OPTIONS)))
+LDFLAGS+=$(subst ",, $(strip $(CONFIG_EXTRA_LDFLAGS_OPTIONS)))
+
+endif   # not 'clean'
+
+clean::
+       -@rm -f *.o *.obj core* *.out *~ \.depend vc*0* 
+
diff --git a/libs/nixio/axTLS/config/makefile.dotnet.conf b/libs/nixio/axTLS/config/makefile.dotnet.conf
new file mode 100644 (file)
index 0000000..9cff4fd
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# Copyright (c) 2007, Cameron Rich
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of the axTLS project nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "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 COPYRIGHT OWNER OR
+# CONTRIBUTORS 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.
+#
+
+ifneq ($(MAKECMDGOALS), clean)
+
+ifdef CONFIG_PLATFORM_WIN32
+GO_DOT_NET=y
+endif
+
+ifdef CONFIG_PLATFORM_CYGWIN
+GO_DOT_NET=y
+endif
+
+ifdef GO_DOT_NET
+all: test_dot_net_location
+
+# find out where the C# compiler is
+CONFIG_DOT_NET_FRAMEWORK_BASE:=$(shell cygpath -u $(CONFIG_DOT_NET_FRAMEWORK_BASE))
+
+test_dot_net_location:
+       @if ! [ -d "$(CONFIG_DOT_NET_FRAMEWORK_BASE)" ]; then \
+               echo "*** Error: .NET path of $(CONFIG_DOT_NET_FRAMEWORK_BASE) doesn't exist" && exit 1; \
+    fi
+
+PATH:=$(CONFIG_DOT_NET_FRAMEWORK_BASE):$(PATH)
+
+else        # Linux?
+all: test_mcs
+
+test_mcs:
+       @if ! mcs --about > /dev/null 2>&1; then \
+        echo "Mono not installed! - go " \
+        "to http://www.mono-project.com/Main_Page" && exit 1; \
+    fi 
+
+endif   # Linux
+
+endif   # not 'clean'
diff --git a/libs/nixio/axTLS/config/makefile.java.conf b/libs/nixio/axTLS/config/makefile.java.conf
new file mode 100644 (file)
index 0000000..9b22462
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# Copyright (c) 2007, Cameron Rich
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of the axTLS project nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "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 COPYRIGHT OWNER OR
+# CONTRIBUTORS 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.
+#
+
+ifneq ($(MAKECMDGOALS), clean)
+
+ifdef CONFIG_PLATFORM_CYGWIN 
+CFLAGS += -I"$(CONFIG_JAVA_HOME)/include"
+CFLAGS += -I"$(CONFIG_JAVA_HOME)/include/win32"
+JAVA_BIN:=$(CONFIG_JAVA_HOME)/bin
+else
+
+ifdef CONFIG_PLATFORM_WIN32
+CFLAGS += /I"$(shell cygpath -w $(CONFIG_JAVA_HOME)/include)"
+CFLAGS += /I"$(shell cygpath -w $(CONFIG_JAVA_HOME)/include/win32)"
+JAVA_BIN:=$(shell cygpath -u $(CONFIG_JAVA_HOME)/bin)
+else # Linux
+CFLAGS += -I$(CONFIG_JAVA_HOME)/include
+
+ifdef CONFIG_PLATFORM_SOLARIS
+CFLAGS += -I$(CONFIG_JAVA_HOME)/include/solaris
+else
+CFLAGS += -I$(CONFIG_JAVA_HOME)/include/linux
+endif
+
+JAVA_BIN:=$(CONFIG_JAVA_HOME)/bin
+endif
+endif
+
+PATH:=$(JAVA_BIN):$(PATH)
+
+endif   # not 'clean'                    
diff --git a/libs/nixio/axTLS/config/makefile.post b/libs/nixio/axTLS/config/makefile.post
new file mode 100644 (file)
index 0000000..033981c
--- /dev/null
@@ -0,0 +1,19 @@
+
+ifneq ($(MAKECMDGOALS), clean)
+ifndef CONFIG_PLATFORM_WIN32
+ifndef CONFIG_PLATFORM_SOLARIS
+# do dependencies
+-include .depend
+all : .depend 
+.depend: $(wildcard *.c)
+       @$(CC) $(CFLAGS) -MM $^ > $@
+endif   # 'not' solaris
+endif   # 'not' win32
+
+ifdef CONFIG_PLATFORM_WIN32
+OBJ:=$(OBJ:.o=.obj)
+%.obj : %.c
+       $(CC) $(CFLAGS) $< 
+endif   # win32
+
+endif   # end of 'not' clean
diff --git a/libs/nixio/axTLS/config/scripts/config/Kconfig-language.txt b/libs/nixio/axTLS/config/scripts/config/Kconfig-language.txt
new file mode 100644 (file)
index 0000000..493749b
--- /dev/null
@@ -0,0 +1,255 @@
+Introduction
+------------
+
+The configuration database is collection of configuration options
+organized in a tree structure:
+
+       +- Code maturity level options
+       |  +- Prompt for development and/or incomplete code/drivers
+       +- General setup
+       |  +- Networking support
+       |  +- System V IPC
+       |  +- BSD Process Accounting
+       |  +- Sysctl support
+       +- Loadable module support
+       |  +- Enable loadable module support
+       |     +- Set version information on all module symbols
+       |     +- Kernel module loader
+       +- ...
+
+Every entry has its own dependencies. These dependencies are used
+to determine the visible of an entry. Any child entry is only
+visible if its parent entry is also visible.
+
+Menu entries
+------------
+
+Most entries define a config option, all other entries help to organize
+them. A single configuration option is defined like this:
+
+config MODVERSIONS
+       bool "Set version information on all module symbols"
+       depends MODULES
+       help
+         Usually, modules have to be recompiled whenever you switch to a new
+         kernel.  ...
+
+Every line starts with a key word and can be followed by multiple
+arguments.  "config" starts a new config entry. The following lines
+define attributes for this config option. Attributes can be the type of
+the config option, input prompt, dependencies, help text and default
+values. A config option can be defined multiple times with the same
+name, but every definition can have only a single input prompt and the
+type must not conflict.
+
+Menu attributes
+---------------
+
+A menu entry can have a number of attributes. Not all of them are
+applicable everywhere (see syntax).
+
+- type definition: "bool"/"tristate"/"string"/"hex"/"integer"
+  Every config option must have a type. There are only two basic types:
+  tristate and string, the other types base on these two. The type
+  definition optionally accepts an input prompt, so these two examples
+  are equivalent:
+
+       bool "Networking support"
+  and
+       bool
+       prompt "Networking support"
+
+- input prompt: "prompt" <prompt> ["if" <expr>]
+  Every menu entry can have at most one prompt, which is used to display
+  to the user. Optionally dependencies only for this prompt can be added
+  with "if".
+
+- default value: "default" <symbol> ["if" <expr>]
+  A config option can have any number of default values. If multiple
+  default values are visible, only the first defined one is active.
+  Default values are not limited to the menu entry, where they are
+  defined, this means the default can be defined somewhere else or be
+  overriden by an earlier definition.
+  The default value is only assigned to the config symbol if no other
+  value was set by the user (via the input prompt above). If an input
+  prompt is visible the default value is presented to the user and can
+  be overridden by him.
+  Optionally dependencies only for this default value can be added with
+  "if".
+
+- dependencies: "depends on"/"requires" <expr>
+  This defines a dependency for this menu entry. If multiple
+  dependencies are defined they are connected with '&&'. Dependencies
+  are applied to all other options within this menu entry (which also
+  accept "if" expression), so these two examples are equivalent:
+
+       bool "foo" if BAR
+       default y if BAR
+  and
+       depends on BAR
+       bool "foo"
+       default y
+
+- help text: "help"
+  This defines a help text. The end of the help text is determined by
+  the level indentation, this means it ends at the first line which has
+  a smaller indentation than the first line of the help text.
+
+
+Menu dependencies
+-----------------
+
+Dependencies define the visibility of a menu entry and can also reduce
+the input range of tristate symbols. The tristate logic used in the
+expressions uses one more state than normal boolean logic to express the
+module state. Dependency expressions have the following syntax:
+
+<expr> ::= <symbol>                             (1)
+           <symbol> '=' <symbol>                (2)
+           <symbol> '!=' <symbol>               (3)
+           '(' <expr> ')'                       (4)
+           '!' <expr>                           (5)
+           <expr> '||' <expr>                   (6)
+           <expr> '&&' <expr>                   (7)
+
+Expressions are listed in decreasing order of precedence.
+
+(1) Convert the symbol into an expression. Boolean and tristate symbols
+    are simply converted into the respective expression values. All
+    other symbol types result in 'n'.
+(2) If the values of both symbols are equal, it returns 'y',
+    otherwise 'n'.
+(3) If the values of both symbols are equal, it returns 'n',
+    otherwise 'y'.
+(4) Returns the value of the expression. Used to override precedence.
+(5) Returns the result of (2-/expr/).
+(6) Returns the result of min(/expr/, /expr/).
+(7) Returns the result of max(/expr/, /expr/).
+
+An expression can have a value of 'n', 'm' or 'y' (or 0, 1, 2
+respectively for calculations). A menu entry becomes visible when it's
+expression evaluates to 'm' or 'y'.
+
+There are two type of symbols: constant and nonconstant symbols.
+Nonconstant symbols are the most common ones and are defined with the
+'config' statement. Nonconstant symbols consist entirely of alphanumeric
+characters or underscores.
+Constant symbols are only part of expressions. Constant symbols are
+always surrounded by single or double quotes. Within the quote any
+other character is allowed and the quotes can be escaped using '\'.
+
+Menu structure
+--------------
+
+The position of a menu entry in the tree is determined in two ways. First
+it can be specified explicitely:
+
+menu "Network device support"
+       depends NET
+
+config NETDEVICES
+       ...
+
+endmenu
+
+All entries within the "menu" ... "endmenu" block become a submenu of
+"Network device support". All subentries inherit the dependencies from
+the menu entry, e.g. this means the dependency "NET" is added to the
+dependency list of the config option NETDEVICES.
+
+The other way to generate the menu structure is done by analyzing the
+dependencies. If a menu entry somehow depends on the previous entry, it
+can be made a submenu of it. First the the previous (parent) symbol must
+be part of the dependency list and then one of these two condititions
+must be true:
+- the child entry must become invisible, if the parent is set to 'n'
+- the child entry must only be visible, if the parent is visible
+
+config MODULES
+       bool "Enable loadable module support"
+
+config MODVERSIONS
+       bool "Set version information on all module symbols"
+       depends MODULES
+
+comment "module support disabled"
+       depends !MODULES
+
+MODVERSIONS directly depends on MODULES, this means it's only visible if
+MODULES is different from 'n'. The comment on the other hand is always
+visible when MODULES it's visible (the (empty) dependency of MODULES is
+also part of the comment dependencies).
+
+
+Kconfig syntax
+--------------
+
+The configuration file describes a series of menu entries, where every
+line starts with a keyword (except help texts). The following keywords
+end a menu entry:
+- config
+- choice/endchoice
+- comment
+- menu/endmenu
+- if/endif
+- source
+The first four also start the definition of a menu entry.
+
+config:
+
+       "config" <symbol>
+       <config options>
+
+This defines a config symbol <symbol> and accepts any of above
+attributes as options.
+
+choices:
+
+       "choice"
+       <choice options>
+       <choice block>
+       "endchoice"
+
+This defines a choice group and accepts any of above attributes as
+options. A choice can only be of type bool or tristate, while a boolean
+choice only allows a single config entry to be selected, a tristate
+choice also allows any number of config entries to be set to 'm'. This
+can be used if multiple drivers for a single hardware exists and only a
+single driver can be compiled/loaded into the kernel, but all drivers
+can be compiled as modules.
+A choice accepts another option "optional", which allows to set the
+choice to 'n' and no entry needs to be selected.
+
+comment:
+
+       "comment" <prompt>
+       <comment options>
+
+This defines a comment which is displayed to the user during the
+configuration process and is also echoed to the output files. The only
+possible options are dependencies.
+
+menu:
+
+       "menu" <prompt>
+       <menu options>
+       <menu block>
+       "endmenu"
+
+This defines a menu block, see "Menu structure" above for more
+information. The only possible options are dependencies.
+
+if:
+
+       "if" <expr>
+       <if block>
+       "endif"
+
+This defines an if block. The dependency expression <expr> is appended
+to all enclosed menu entries.
+
+source:
+
+       "source" <prompt>
+
+This reads the specified configuration file. This file is always parsed.
diff --git a/libs/nixio/axTLS/config/scripts/config/Makefile b/libs/nixio/axTLS/config/scripts/config/Makefile
new file mode 100644 (file)
index 0000000..7399501
--- /dev/null
@@ -0,0 +1,121 @@
+# Makefile for axTLS
+#
+# Copyright (C) 2002 Erik Andersen <andersen@codepoet.org>
+
+top_srcdir=../..
+top_builddir=../..
+srcdir=$(top_srcdir)/scripts/config
+include $(top_srcdir)/Rules.mak
+
+all: ncurses conf mconf
+
+ifeq ($(shell uname),SunOS)
+LIBS = -lcurses
+else
+LIBS = -lncurses
+endif
+ifeq (/usr/include/ncurses/ncurses.h, $(wildcard /usr/include/ncurses/ncurses.h))
+       HOSTNCURSES += -I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"
+else
+ifeq (/usr/include/ncurses/curses.h, $(wildcard /usr/include/ncurses/curses.h))
+       HOSTNCURSES += -I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"
+else
+ifeq (/usr/local/include/ncurses/ncurses.h, $(wildcard /usr/local/include/ncurses/ncurses.h))
+       HOSTCFLAGS += -I/usr/local/include/ncurses -DCURSES_LOC="<ncurses.h>"
+else
+ifeq (/usr/local/include/ncurses/curses.h, $(wildcard /usr/local/include/ncurses/curses.h))
+       HOSTCFLAGS += -I/usr/local/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"
+else
+ifeq (/usr/include/ncurses.h, $(wildcard /usr/include/ncurses.h))
+       HOSTNCURSES += -DCURSES_LOC="<ncurses.h>"
+else
+       HOSTNCURSES += -DCURSES_LOC="<curses.h>"
+endif
+endif
+endif
+endif
+endif
+
+CONF_SRC     = conf.c
+MCONF_SRC    = mconf.c
+LXD_SRC      = lxdialog/checklist.c lxdialog/menubox.c lxdialog/textbox.c \
+               lxdialog/yesno.c lxdialog/inputbox.c lxdialog/util.c \
+               lxdialog/msgbox.c
+
+SHARED_SRC   = zconf.tab.c
+SHARED_DEPS := $(srcdir)/lkc.h $(srcdir)/lkc_proto.h \
+               lkc_defs.h $(srcdir)/expr.h zconf.tab.h
+CONF_OBJS    = $(patsubst %.c,%.o, $(CONF_SRC))
+MCONF_OBJS   = $(patsubst %.c,%.o, $(MCONF_SRC) $(LXD_SRC))
+SHARED_OBJS  = $(patsubst %.c,%.o, $(SHARED_SRC))
+
+conf: $(CONF_OBJS) $(SHARED_OBJS)
+       $(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@
+
+mconf: $(MCONF_OBJS) $(SHARED_OBJS)
+       $(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@ $(LIBS)
+
+$(CONF_OBJS): %.o : $(srcdir)/%.c $(SHARED_DEPS)
+       $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
+
+$(MCONF_OBJS): %.o : $(srcdir)/%.c $(SHARED_DEPS)
+       @[ -d $(@D) ] || mkdir -v $(@D)
+       $(HOSTCC) $(HOSTCFLAGS) $(HOSTNCURSES) -I. -c $< -o $@
+
+lkc_defs.h: $(srcdir)/lkc_proto.h
+       @sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
+
+###
+# The following requires flex/bison
+# By default we use the _shipped versions, uncomment the
+# following line if you are modifying the flex/bison src.
+#LKC_GENPARSER := 1
+
+ifdef LKC_GENPARSER
+
+%.tab.c %.tab.h: $(srcdir)/%.y
+       bison -t -d -v -b $* -p $(notdir $*) $<
+
+lex.%.c: $(srcdir)/%.l
+       flex -P$(notdir $*) -o$@ $<
+else
+
+lex.zconf.o: lex.zconf.c $(SHARED_DEPS)
+       $(HOSTCC) $(HOSTCFLAGS) -I$(srcdir) -c $< -o $@
+
+lex.zconf.c: $(srcdir)/lex.zconf.c_shipped
+       cp $< $@
+
+zconf.tab.c: $(srcdir)/zconf.tab.c_shipped
+       cp $< $@
+
+zconf.tab.h: $(srcdir)/zconf.tab.h_shipped
+       cp $< $@
+endif
+
+zconf.tab.o: zconf.tab.c lex.zconf.c $(srcdir)/confdata.c $(srcdir)/expr.c \
+             $(srcdir)/symbol.c $(srcdir)/menu.c $(SHARED_DEPS)
+       $(HOSTCC) $(HOSTCFLAGS) -I$(srcdir) -I. -c $< -o $@
+
+.PHONY: ncurses
+
+ncurses:
+       @echo "main() {}" > lxtemp.c
+       @if $(HOSTCC) lxtemp.c $(LIBS) ; then \
+               rm -f lxtemp.c a.out; \
+       else \
+               rm -f lxtemp.c; \
+               echo -e "\007" ;\
+               echo ">> Unable to find the Ncurses libraries." ;\
+               echo ">>" ;\
+               echo ">> You must have Ncurses installed in order" ;\
+               echo ">> to use 'make menuconfig'" ;\
+               echo ;\
+               exit 1 ;\
+       fi
+
+clean:
+       rm -f *.o *~ ../../*~ core *.exe $(TARGETS) $(MCONF_OBJS) $(CONF_OBJS)
+       rm -f conf conf.exe mconf mconf.exe zconf.tab.c zconf.tab.h lex.zconf.c lkc_defs.h
+       rm -f ../..config.h
+
diff --git a/libs/nixio/axTLS/config/scripts/config/conf.c b/libs/nixio/axTLS/config/scripts/config/conf.c
new file mode 100644 (file)
index 0000000..1524467
--- /dev/null
@@ -0,0 +1,583 @@
+/*
+ * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ * Released under the terms of the GNU GPL v2.0.
+ */
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <time.h>
+#include <sys/stat.h>
+
+#define LKC_DIRECT_LINK
+#include "lkc.h"
+
+static void conf(struct menu *menu);
+static void check_conf(struct menu *menu);
+
+enum {
+       ask_all,
+       ask_new,
+       ask_silent,
+       set_default,
+       set_yes,
+       set_mod,
+       set_no,
+       set_random
+} input_mode = ask_all;
+char *defconfig_file;
+
+static int indent = 1;
+static int valid_stdin = 1;
+static int conf_cnt;
+static char line[128];
+static struct menu *rootEntry;
+
+static char nohelp_text[] = "Sorry, no help available for this option yet.\n";
+
+static void strip(char *str)
+{
+       char *p = str;
+       int l;
+
+       while ((isspace(*p)))
+               p++;
+       l = strlen(p);
+       if (p != str)
+               memmove(str, p, l + 1);
+       if (!l)
+               return;
+       p = str + l - 1;
+       while ((isspace(*p)))
+               *p-- = 0;
+}
+
+static void check_stdin(void)
+{
+       if (!valid_stdin && input_mode == ask_silent) {
+               printf("aborted!\n\n");
+               printf("Console input/output is redirected. ");
+               printf("Run 'make oldconfig' to update configuration.\n\n");
+               exit(1);
+       }
+}
+
+static void conf_askvalue(struct symbol *sym, const char *def)
+{
+       enum symbol_type type = sym_get_type(sym);
+       tristate val;
+
+       if (!sym_has_value(sym))
+               printf("(NEW) ");
+
+       line[0] = '\n';
+       line[1] = 0;
+
+       if (!sym_is_changable(sym)) {
+               printf("%s\n", def);
+               line[0] = '\n';
+               line[1] = 0;
+               return;
+       }
+
+       switch (input_mode) {
+       case ask_new:
+       case ask_silent:
+               if (sym_has_value(sym)) {
+                       printf("%s\n", def);
+                       return;
+               }
+               check_stdin();
+       case ask_all:
+               fflush(stdout);
+               fgets(line, 128, stdin);
+               return;
+       case set_default:
+               printf("%s\n", def);
+               return;
+       default:
+               break;
+       }
+
+       switch (type) {
+       case S_INT:
+       case S_HEX:
+       case S_STRING:
+               printf("%s\n", def);
+               return;
+       default:
+               ;
+       }
+       switch (input_mode) {
+       case set_yes:
+               if (sym_tristate_within_range(sym, yes)) {
+                       line[0] = 'y';
+                       line[1] = '\n';
+                       line[2] = 0;
+                       break;
+               }
+       case set_mod:
+               if (type == S_TRISTATE) {
+                       if (sym_tristate_within_range(sym, mod)) {
+                               line[0] = 'm';
+                               line[1] = '\n';
+                               line[2] = 0;
+                               break;
+                       }
+               } else {
+                       if (sym_tristate_within_range(sym, yes)) {
+                               line[0] = 'y';
+                               line[1] = '\n';
+                               line[2] = 0;
+                               break;
+                       }
+               }
+       case set_no:
+               if (sym_tristate_within_range(sym, no)) {
+                       line[0] = 'n';
+                       line[1] = '\n';
+                       line[2] = 0;
+                       break;
+               }
+       case set_random:
+               do {
+                       val = (tristate)(random() % 3);
+               } while (!sym_tristate_within_range(sym, val));
+               switch (val) {
+               case no: line[0] = 'n'; break;
+               case mod: line[0] = 'm'; break;
+               case yes: line[0] = 'y'; break;
+               }
+               line[1] = '\n';
+               line[2] = 0;
+               break;
+       default:
+               break;
+       }
+       printf("%s", line);
+}
+
+int conf_string(struct menu *menu)
+{
+       struct symbol *sym = menu->sym;
+       const char *def, *help;
+
+       while (1) {
+               printf("%*s%s ", indent - 1, "", menu->prompt->text);
+               printf("(%s) ", sym->name);
+               def = sym_get_string_value(sym);
+               if (sym_get_string_value(sym))
+                       printf("[%s] ", def);
+               conf_askvalue(sym, def);
+               switch (line[0]) {
+               case '\n':
+                       break;
+               case '?':
+                       /* print help */
+                       if (line[1] == '\n') {
+                               help = nohelp_text;
+                               if (menu->sym->help)
+                                       help = menu->sym->help;
+                               printf("\n%s\n", menu->sym->help);
+                               def = NULL;
+                               break;
+                       }
+               default:
+                       line[strlen(line)-1] = 0;
+                       def = line;
+               }
+               if (def && sym_set_string_value(sym, def))
+                       return 0;
+       }
+}
+
+static int conf_sym(struct menu *menu)
+{
+       struct symbol *sym = menu->sym;
+       int type;
+       tristate oldval, newval;
+       const char *help;
+
+       while (1) {
+               printf("%*s%s ", indent - 1, "", menu->prompt->text);
+               if (sym->name)
+                       printf("(%s) ", sym->name);
+               type = sym_get_type(sym);
+               putchar('[');
+               oldval = sym_get_tristate_value(sym);
+               switch (oldval) {
+               case no:
+                       putchar('N');
+                       break;
+               case mod:
+                       putchar('M');
+                       break;
+               case yes:
+                       putchar('Y');
+                       break;
+               }
+               if (oldval != no && sym_tristate_within_range(sym, no))
+                       printf("/n");
+               if (oldval != mod && sym_tristate_within_range(sym, mod))
+                       printf("/m");
+               if (oldval != yes && sym_tristate_within_range(sym, yes))
+                       printf("/y");
+               if (sym->help)
+                       printf("/?");
+               printf("] ");
+               conf_askvalue(sym, sym_get_string_value(sym));
+               strip(line);
+
+               switch (line[0]) {
+               case 'n':
+               case 'N':
+                       newval = no;
+                       if (!line[1] || !strcmp(&line[1], "o"))
+                               break;
+                       continue;
+               case 'm':
+               case 'M':
+                       newval = mod;
+                       if (!line[1])
+                               break;
+                       continue;
+               case 'y':
+               case 'Y':
+                       newval = yes;
+                       if (!line[1] || !strcmp(&line[1], "es"))
+                               break;
+                       continue;
+               case 0:
+                       newval = oldval;
+                       break;
+               case '?':
+                       goto help;
+               default:
+                       continue;
+               }
+               if (sym_set_tristate_value(sym, newval))
+                       return 0;
+help:
+               help = nohelp_text;
+               if (sym->help)
+                       help = sym->help;
+               printf("\n%s\n", help);
+       }
+}
+
+static int conf_choice(struct menu *menu)
+{
+       struct symbol *sym, *def_sym;
+       struct menu *child;
+       int type;
+       bool is_new;
+
+       sym = menu->sym;
+       type = sym_get_type(sym);
+       is_new = !sym_has_value(sym);
+       if (sym_is_changable(sym)) {
+               conf_sym(menu);
+               sym_calc_value(sym);
+               switch (sym_get_tristate_value(sym)) {
+               case no:
+                       return 1;
+               case mod:
+                       return 0;
+               case yes:
+                       break;
+               }
+       } else {
+               switch (sym_get_tristate_value(sym)) {
+               case no:
+                       return 1;
+               case mod:
+                       printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
+                       return 0;
+               case yes:
+                       break;
+               }
+       }
+
+       while (1) {
+               int cnt, def;
+
+               printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
+               def_sym = sym_get_choice_value(sym);
+               cnt = def = 0;
+               line[0] = '0';
+               line[1] = 0;
+               for (child = menu->list; child; child = child->next) {
+                       if (!menu_is_visible(child))
+                               continue;
+                       if (!child->sym) {
+                               printf("%*c %s\n", indent, '*', menu_get_prompt(child));
+                               continue;
+                       }
+                       cnt++;
+                       if (child->sym == def_sym) {
+                               def = cnt;
+                               printf("%*c", indent, '>');
+                       } else
+                               printf("%*c", indent, ' ');
+                       printf(" %d. %s", cnt, menu_get_prompt(child));
+                       if (child->sym->name)
+                               printf(" (%s)", child->sym->name);
+                       if (!sym_has_value(child->sym))
+                               printf(" (NEW)");
+                       printf("\n");
+               }
+               printf("%*schoice", indent - 1, "");
+               if (cnt == 1) {
+                       printf("[1]: 1\n");
+                       goto conf_childs;
+               }
+               printf("[1-%d", cnt);
+               if (sym->help)
+                       printf("?");
+               printf("]: ");
+               switch (input_mode) {
+               case ask_new:
+               case ask_silent:
+                       if (!is_new) {
+                               cnt = def;
+                               printf("%d\n", cnt);
+                               break;
+                       }
+                       check_stdin();
+               case ask_all:
+                       fflush(stdout);
+                       fgets(line, 128, stdin);
+                       strip(line);
+                       if (line[0] == '?') {
+                               printf("\n%s\n", menu->sym->help ?
+                                       menu->sym->help : nohelp_text);
+                               continue;
+                       }
+                       if (!line[0])
+                               cnt = def;
+                       else if (isdigit(line[0]))
+                               cnt = atoi(line);
+                       else
+                               continue;
+                       break;
+               case set_random:
+                       def = (random() % cnt) + 1;
+               case set_default:
+               case set_yes:
+               case set_mod:
+               case set_no:
+                       cnt = def;
+                       printf("%d\n", cnt);
+                       break;
+               }
+
+       conf_childs:
+               for (child = menu->list; child; child = child->next) {
+                       if (!child->sym || !menu_is_visible(child))
+                               continue;
+                       if (!--cnt)
+                               break;
+               }
+               if (!child)
+                       continue;
+               if (line[strlen(line) - 1] == '?') {
+                       printf("\n%s\n", child->sym->help ?
+                               child->sym->help : nohelp_text);
+                       continue;
+               }
+               sym_set_choice_value(sym, child->sym);
+               if (child->list) {
+                       indent += 2;
+                       conf(child->list);
+                       indent -= 2;
+               }
+               return 1;
+       }
+}
+
+static void conf(struct menu *menu)
+{
+       struct symbol *sym;
+       struct property *prop;
+       struct menu *child;
+
+       if (!menu_is_visible(menu))
+               return;
+
+       sym = menu->sym;
+       prop = menu->prompt;
+       if (prop) {
+               const char *prompt;
+
+               switch (prop->type) {
+               case P_MENU:
+                       if (input_mode == ask_silent && rootEntry != menu) {
+                               check_conf(menu);
+                               return;
+                       }
+               case P_COMMENT:
+                       prompt = menu_get_prompt(menu);
+                       if (prompt)
+                               printf("%*c\n%*c %s\n%*c\n",
+                                       indent, '*',
+                                       indent, '*', prompt,
+                                       indent, '*');
+               default:
+                       ;
+               }
+       }
+
+       if (!sym)
+               goto conf_childs;
+
+       if (sym_is_choice(sym)) {
+               conf_choice(menu);
+               if (sym->curr.tri != mod)
+                       return;
+               goto conf_childs;
+       }
+
+       switch (sym->type) {
+       case S_INT:
+       case S_HEX:
+       case S_STRING:
+               conf_string(menu);
+               break;
+       default:
+               conf_sym(menu);
+               break;
+       }
+
+conf_childs:
+       if (sym)
+               indent += 2;
+       for (child = menu->list; child; child = child->next)
+               conf(child);
+       if (sym)
+               indent -= 2;
+}
+
+static void check_conf(struct menu *menu)
+{
+       struct symbol *sym;
+       struct menu *child;
+
+       if (!menu_is_visible(menu))
+               return;
+
+       sym = menu->sym;
+       if (sym) {
+               if (sym_is_changable(sym) && !sym_has_value(sym)) {
+                       if (!conf_cnt++)
+                               printf("*\n* Restart config...\n*\n");
+                       rootEntry = menu_get_parent_menu(menu);
+                       conf(rootEntry);
+               }
+               if (sym_is_choice(sym) && sym_get_tristate_value(sym) != mod)
+                       return;
+       }
+
+       for (child = menu->list; child; child = child->next)
+               check_conf(child);
+}
+
+int main(int ac, char **av)
+{
+       int i = 1;
+       const char *name;
+       struct stat tmpstat;
+
+       if (ac > i && av[i][0] == '-') {
+               switch (av[i++][1]) {
+               case 'o':
+                       input_mode = ask_new;
+                       break;
+               case 's':
+                       input_mode = ask_silent;
+                       valid_stdin = isatty(0) && isatty(1) && isatty(2);
+                       break;
+               case 'd':
+                       input_mode = set_default;
+                       break;
+               case 'D':
+                       input_mode = set_default;
+                       defconfig_file = av[i++];
+                       if (!defconfig_file) {
+                               printf("%s: No default config file specified\n",
+                                       av[0]);
+                               exit(1);
+                       }
+                       break;
+               case 'n':
+                       input_mode = set_no;
+                       break;
+               case 'm':
+                       input_mode = set_mod;
+                       break;
+               case 'y':
+                       input_mode = set_yes;
+                       break;
+               case 'r':
+                       input_mode = set_random;
+                       srandom(time(NULL));
+                       break;
+               case 'h':
+               case '?':
+                       printf("%s [-o|-s] config\n", av[0]);
+                       exit(0);
+               }
+       }
+       name = av[i];
+       if (!name) {
+               printf("%s: configuration file missing\n", av[0]);
+       }
+       conf_parse(name);
+       //zconfdump(stdout);
+       switch (input_mode) {
+       case set_default:
+               if (!defconfig_file)
+                       defconfig_file = conf_get_default_confname();
+               if (conf_read(defconfig_file)) {
+                       printf("***\n"
+                               "*** Can't find default configuration \"%s\"!\n"
+                               "***\n", defconfig_file);
+                       exit(1);
+               }
+               break;
+       case ask_silent:
+               if (stat(".config", &tmpstat)) {
+                       printf("***\n"
+                               "*** You have not yet configured axTLS!\n"
+                               "***\n"
+                               "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
+                               "*** \"make menuconfig\" or \"make config\").\n"
+                               "***\n");
+                       exit(1);
+               }
+       case ask_all:
+       case ask_new:
+               conf_read(NULL);
+               break;
+       default:
+               break;
+       }
+
+       if (input_mode != ask_silent) {
+               rootEntry = &rootmenu;
+               conf(&rootmenu);
+               if (input_mode == ask_all) {
+                       input_mode = ask_silent;
+                       valid_stdin = 1;
+               }
+       }
+       do {
+               conf_cnt = 0;
+               check_conf(&rootmenu);
+       } while (conf_cnt);
+       if (conf_write(NULL)) {
+               fprintf(stderr, "\n*** Error during writing of the axTLS configuration.\n\n");
+               return 1;
+       }
+       return 0;
+}
diff --git a/libs/nixio/axTLS/config/scripts/config/confdata.c b/libs/nixio/axTLS/config/scripts/config/confdata.c
new file mode 100644 (file)
index 0000000..a59e245
--- /dev/null
@@ -0,0 +1,458 @@
+/*
+ * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ * Released under the terms of the GNU GPL v2.0.
+ */
+
+#include <sys/stat.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#define LKC_DIRECT_LINK
+#include "lkc.h"
+
+const char conf_def_filename[] = "config/.config";
+
+const char conf_defname[] = "config/defconfig";
+
+const char *conf_confnames[] = {
+       "config/.config",
+       conf_defname,
+       NULL,
+};
+
+static char *conf_expand_value(const char *in)
+{
+       struct symbol *sym;
+       const char *src;
+       static char res_value[SYMBOL_MAXLENGTH];
+       char *dst, name[SYMBOL_MAXLENGTH];
+
+       res_value[0] = 0;
+       dst = name;
+       while ((src = strchr(in, '$'))) {
+               strncat(res_value, in, src - in);
+               src++;
+               dst = name;
+               while (isalnum(*src) || *src == '_')
+                       *dst++ = *src++;
+               *dst = 0;
+               sym = sym_lookup(name, 0);
+               sym_calc_value(sym);
+               strcat(res_value, sym_get_string_value(sym));
+               in = src;
+       }
+       strcat(res_value, in);
+
+       return res_value;
+}
+
+char *conf_get_default_confname(void)
+{
+       struct stat buf;
+       static char fullname[PATH_MAX+1];
+       char *env, *name;
+
+       name = conf_expand_value(conf_defname);
+       env = getenv(SRCTREE);
+       if (env) {
+               sprintf(fullname, "%s/%s", env, name);
+               if (!stat(fullname, &buf))
+                       return fullname;
+       }
+       return name;
+}
+
+int conf_read(const char *name)
+{
+       FILE *in = NULL;
+       char line[1024];
+       char *p, *p2;
+       int lineno = 0;
+       struct symbol *sym;
+       struct property *prop;
+       struct expr *e;
+       int i;
+
+       if (name) {
+               in = zconf_fopen(name);
+       } else {
+               const char **names = conf_confnames;
+               while ((name = *names++)) {
+                       name = conf_expand_value(name);
+                       in = zconf_fopen(name);
+                       if (in) {
+                               printf("#\n"
+                                      "# using defaults found in %s\n"
+                                      "#\n", name);
+                               break;
+                       }
+               }
+       }
+
+       if (!in)
+               return 1;
+
+       for_all_symbols(i, sym) {
+               sym->flags |= SYMBOL_NEW | SYMBOL_CHANGED;
+               sym->flags &= ~SYMBOL_VALID;
+               switch (sym->type) {
+               case S_INT:
+               case S_HEX:
+               case S_STRING:
+                       if (sym->user.val)
+                               free(sym->user.val);
+               default:
+                       sym->user.val = NULL;
+                       sym->user.tri = no;
+               }
+       }
+
+       while (fgets(line, sizeof(line), in)) {
+               lineno++;
+               sym = NULL;
+               switch (line[0]) {
+               case '#':
+                       if (line[1]!=' ')
+                               continue;
+                       p = strchr(line + 2, ' ');
+                       if (!p)
+                               continue;
+                       *p++ = 0;
+                       if (strncmp(p, "is not set", 10))
+                               continue;
+                       sym = sym_find(line + 2);
+                       if (!sym) {
+                               fprintf(stderr, "%s:%d: trying to assign nonexistent symbol %s\n", name, lineno, line + 2);
+                               break;
+                       }
+                       switch (sym->type) {
+                       case S_BOOLEAN:
+                       case S_TRISTATE:
+                               sym->user.tri = no;
+                               sym->flags &= ~SYMBOL_NEW;
+                               break;
+                       default:
+                               ;
+                       }
+                       break;
+
+               case 'A' ... 'Z':
+                       p = strchr(line, '=');
+                       if (!p)
+                               continue;
+                       *p++ = 0;
+                       p2 = strchr(p, '\n');
+                       if (p2)
+                               *p2 = 0;
+                       sym = sym_find(line);
+                       if (!sym) {
+                               fprintf(stderr, "%s:%d: trying to assign nonexistent symbol %s\n", name, lineno, line);
+                               break;
+                       }
+                       switch (sym->type) {
+                       case S_TRISTATE:
+                               if (p[0] == 'm') {
+                                       sym->user.tri = mod;
+                                       sym->flags &= ~SYMBOL_NEW;
+                                       break;
+                               }
+                       case S_BOOLEAN:
+                               if (p[0] == 'y') {
+                                       sym->user.tri = yes;
+                                       sym->flags &= ~SYMBOL_NEW;
+                                       break;
+                               }
+                               if (p[0] == 'n') {
+                                       sym->user.tri = no;
+                                       sym->flags &= ~SYMBOL_NEW;
+                                       break;
+                               }
+                               break;
+                       case S_STRING:
+                               if (*p++ != '"')
+                                       break;
+                               for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) {
+                                       if (*p2 == '"') {
+                                               *p2 = 0;
+                                               break;
+                                       }
+                                       memmove(p2, p2 + 1, strlen(p2));
+                               }
+                               if (!p2) {
+                                       fprintf(stderr, "%s:%d: invalid string found\n", name, lineno);
+                                       exit(1);
+                               }
+                       case S_INT:
+                       case S_HEX:
+                               if (sym_string_valid(sym, p)) {
+                                       sym->user.val = strdup(p);
+                                       sym->flags &= ~SYMBOL_NEW;
+                               } else {
+                                       fprintf(stderr, "%s:%d: symbol value '%s' invalid for %s\n", name, lineno, p, sym->name);
+                                       exit(1);
+                               }
+                               break;
+                       default:
+                               ;
+                       }
+                       break;
+               case '\n':
+                       break;
+               default:
+                       continue;
+               }
+               if (sym && sym_is_choice_value(sym)) {
+                       struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym));
+                       switch (sym->user.tri) {
+                       case no:
+                               break;
+                       case mod:
+                               if (cs->user.tri == yes)
+                                       /* warn? */;
+                               break;
+                       case yes:
+                               if (cs->user.tri != no)
+                                       /* warn? */;
+                               cs->user.val = sym;
+                               break;
+                       }
+                       cs->user.tri = E_OR(cs->user.tri, sym->user.tri);
+                       cs->flags &= ~SYMBOL_NEW;
+               }
+       }
+       fclose(in);
+
+       if (modules_sym)
+               sym_calc_value(modules_sym);
+       for_all_symbols(i, sym) {
+               sym_calc_value(sym);
+               if (sym_has_value(sym) && !sym_is_choice_value(sym)) {
+                       if (sym->visible == no)
+                               sym->flags |= SYMBOL_NEW;
+                       switch (sym->type) {
+                       case S_STRING:
+                       case S_INT:
+                       case S_HEX:
+                               if (!sym_string_within_range(sym, sym->user.val))
+                                       sym->flags |= SYMBOL_NEW;
+                       default:
+                               break;
+                       }
+               }
+               if (!sym_is_choice(sym))
+                       continue;
+               prop = sym_get_choice_prop(sym);
+               for (e = prop->expr; e; e = e->left.expr)
+                       if (e->right.sym->visible != no)
+                               sym->flags |= e->right.sym->flags & SYMBOL_NEW;
+       }
+
+       sym_change_count = 1;
+
+       return 0;
+}
+
+struct menu *next_menu(struct menu *menu)
+{
+       if (menu->list) return menu->list;
+       do {
+               if (menu->next) {
+                       menu = menu->next;
+                       break;
+               }
+       } while ((menu = menu->parent));
+       
+       return menu;
+}
+
+#define SYMBOL_FORCEWRITE (1<<31)
+
+int conf_write(const char *name)
+{
+       FILE *out, *out_h;
+       struct symbol *sym;
+       struct menu *menu;
+       const char *basename;
+       char dirname[128], tmpname[128], newname[128];
+       int type, l;
+       const char *str;
+
+       dirname[0] = 0;
+       if (name && name[0]) {
+               struct stat st;
+               char *slash;
+
+               if (!stat(name, &st) && S_ISDIR(st.st_mode)) {
+                       strcpy(dirname, name);
+                       strcat(dirname, "/");
+                       basename = conf_def_filename;
+               } else if ((slash = strrchr(name, '/'))) {
+                       int size = slash - name + 1;
+                       memcpy(dirname, name, size);
+                       dirname[size] = 0;
+                       if (slash[1])
+                               basename = slash + 1;
+                       else
+                               basename = conf_def_filename;
+               } else
+                       basename = name;
+       } else
+               basename = conf_def_filename;
+
+       sprintf(newname, "config/%s.tmpconfig.%d", dirname, (int)getpid());
+       out = fopen(newname, "w");
+       if (!out)
+               return 1;
+       out_h = NULL;
+       if (!name) {
+               out_h = fopen("config/.tmpconfig.h", "w");
+               if (!out_h)
+                       return 1;
+       }
+       fprintf(out, "#\n"
+                    "# Automatically generated make config: don't edit\n"
+                    "#\n");
+       if (out_h) {
+               fprintf(out_h, "/*\n"
+                            " * Automatically generated header file: don't edit\n"
+                            " */\n\n");
+#if 0
+                            "/* Version Number */\n"
+                            "#define BB_VER \"%s\"\n"
+                            "#define BB_BT \"%s\"\n",
+                            getenv("VERSION"),
+                            getenv("BUILDTIME"));
+               if (getenv("EXTRA_VERSION"))
+                       fprintf(out_h, "#define BB_EXTRA_VERSION \"%s\"\n",
+                                    getenv("EXTRA_VERSION"));
+               fprintf(out_h, "\n");
+#endif
+       }
+
+       if (!sym_change_count)
+               sym_clear_all_valid();
+
+       /* Force write of all non-duplicate symbols. */
+
+       /* Write out everything by default. */
+       for(menu = rootmenu.list; menu; menu = next_menu(menu))
+               if (menu->sym) menu->sym->flags |= SYMBOL_FORCEWRITE;
+
+       menu = rootmenu.list;
+       while (menu) {
+               sym = menu->sym;
+               if (!sym) {
+                       if (!menu_is_visible(menu))
+                               goto next;
+                       str = menu_get_prompt(menu);
+                       fprintf(out, "\n"
+                                    "#\n"
+                                    "# %s\n"
+                                    "#\n", str);
+                       if (out_h)
+                               fprintf(out_h, "\n"
+                                              "/*\n"
+                                              " * %s\n"
+                                              " */\n", str);
+               } else if (!(sym->flags & SYMBOL_CHOICE)) {
+                       sym_calc_value(sym);
+                       if (!(sym->flags & SYMBOL_FORCEWRITE))
+                               goto next;
+
+                       sym->flags &= ~SYMBOL_FORCEWRITE;
+                       type = sym->type;
+                       if (type == S_TRISTATE) {
+                               sym_calc_value(modules_sym);
+                               if (modules_sym->curr.tri == no)
+                                       type = S_BOOLEAN;
+                       }
+                       switch (type) {
+                       case S_BOOLEAN:
+                       case S_TRISTATE:
+                               switch (sym_get_tristate_value(sym)) {
+                               case no:
+                                       fprintf(out, "# %s is not set\n", sym->name);
+                                       if (out_h)
+                                               fprintf(out_h, "#undef %s\n", sym->name);
+                                       break;
+                               case mod:
+#if 0
+                                       fprintf(out, "%s=m\n", sym->name);
+                                       if (out_h)
+                                               fprintf(out_h, "#define %s_MODULE 1\n", sym->name);
+#endif
+                                       break;
+                               case yes:
+                                       fprintf(out, "%s=y\n", sym->name);
+                                       if (out_h)
+                                               fprintf(out_h, "#define %s 1\n", sym->name);
+                                       break;
+                               }
+                               break;
+                       case S_STRING:
+                               // fix me
+                               str = sym_get_string_value(sym);
+                               fprintf(out, "%s=\"", sym->name);
+                               if (out_h)
+                                       fprintf(out_h, "#define %s \"", sym->name);
+                               do {
+                                       l = strcspn(str, "\"\\");
+                                       if (l) {
+                                               fwrite(str, l, 1, out);
+                                               if (out_h)
+                                                       fwrite(str, l, 1, out_h);
+                                       }
+                                       str += l;
+                                       while (*str == '\\' || *str == '"') {
+                                               fprintf(out, "\\%c", *str);
+                                               if (out_h)
+                                                       fprintf(out_h, "\\%c", *str);
+                                               str++;
+                                       }
+                               } while (*str);
+                               fputs("\"\n", out);
+                               if (out_h)
+                                       fputs("\"\n", out_h);
+                               break;
+                       case S_HEX:
+                               str = sym_get_string_value(sym);
+                               if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
+                                       fprintf(out, "%s=%s\n", sym->name, *str ? str : "0");
+                                       if (out_h)
+                                               fprintf(out_h, "#define %s 0x%s\n", sym->name, str);
+                                       break;
+                               }
+                       case S_INT:
+                               str = sym_get_string_value(sym);
+                               fprintf(out, "%s=%s\n", sym->name, *str ? str : "0");
+                               if (out_h)
+                                       fprintf(out_h, "#define %s %s\n", sym->name, str);
+                               break;
+                       }
+               }
+next:
+               menu = next_menu(menu);
+       }
+       fclose(out);
+       if (out_h) {
+               fclose(out_h);
+               rename("config/.tmpconfig.h", "config/config.h");
+               file_write_dep(NULL);
+       }
+       if (!name || basename != conf_def_filename) {
+               if (!name)
+                       name = conf_def_filename;
+               sprintf(tmpname, "%s.old", name);
+               rename(name, tmpname);
+       }
+       sprintf(tmpname, "%s%s", dirname, basename);
+       if (rename(newname, tmpname))
+               return 1;
+
+       sym_change_count = 0;
+
+       return 0;
+}
diff --git a/libs/nixio/axTLS/config/scripts/config/expr.c b/libs/nixio/axTLS/config/scripts/config/expr.c
new file mode 100644 (file)
index 0000000..30e4f9d
--- /dev/null
@@ -0,0 +1,1099 @@
+/*
+ * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ * Released under the terms of the GNU GPL v2.0.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define LKC_DIRECT_LINK
+#include "lkc.h"
+
+#define DEBUG_EXPR     0
+
+struct expr *expr_alloc_symbol(struct symbol *sym)
+{
+       struct expr *e = malloc(sizeof(*e));
+       memset(e, 0, sizeof(*e));
+       e->type = E_SYMBOL;
+       e->left.sym = sym;
+       return e;
+}
+
+struct expr *expr_alloc_one(enum expr_type type, struct expr *ce)
+{
+       struct expr *e = malloc(sizeof(*e));
+       memset(e, 0, sizeof(*e));
+       e->type = type;
+       e->left.expr = ce;
+       return e;
+}
+
+struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2)
+{
+       struct expr *e = malloc(sizeof(*e));
+       memset(e, 0, sizeof(*e));
+       e->type = type;
+       e->left.expr = e1;
+       e->right.expr = e2;
+       return e;
+}
+
+struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2)
+{
+       struct expr *e = malloc(sizeof(*e));
+       memset(e, 0, sizeof(*e));
+       e->type = type;
+       e->left.sym = s1;
+       e->right.sym = s2;
+       return e;
+}
+
+struct expr *expr_alloc_and(struct expr *e1, struct expr *e2)
+{
+       if (!e1)
+               return e2;
+       return e2 ? expr_alloc_two(E_AND, e1, e2) : e1;
+}
+
+struct expr *expr_alloc_or(struct expr *e1, struct expr *e2)
+{
+       if (!e1)
+               return e2;
+       return e2 ? expr_alloc_two(E_OR, e1, e2) : e1;
+}
+
+struct expr *expr_copy(struct expr *org)
+{
+       struct expr *e;
+
+       if (!org)
+               return NULL;
+
+       e = malloc(sizeof(*org));
+       memcpy(e, org, sizeof(*org));
+       switch (org->type) {
+       case E_SYMBOL:
+               e->left = org->left;
+               break;
+       case E_NOT:
+               e->left.expr = expr_copy(org->left.expr);
+               break;
+       case E_EQUAL:
+       case E_UNEQUAL:
+               e->left.sym = org->left.sym;
+               e->right.sym = org->right.sym;
+               break;
+       case E_AND:
+       case E_OR:
+       case E_CHOICE:
+               e->left.expr = expr_copy(org->left.expr);
+               e->right.expr = expr_copy(org->right.expr);
+               break;
+       default:
+               printf("can't copy type %d\n", e->type);
+               free(e);
+               e = NULL;
+               break;
+       }
+
+       return e;
+}
+
+void expr_free(struct expr *e)
+{
+       if (!e)
+               return;
+
+       switch (e->type) {
+       case E_SYMBOL:
+               break;
+       case E_NOT:
+               expr_free(e->left.expr);
+               return;
+       case E_EQUAL:
+       case E_UNEQUAL:
+               break;
+       case E_OR:
+       case E_AND:
+               expr_free(e->left.expr);
+               expr_free(e->right.expr);
+               break;
+       default:
+               printf("how to free type %d?\n", e->type);
+               break;
+       }
+       free(e);
+}
+
+static int trans_count;
+
+#define e1 (*ep1)
+#define e2 (*ep2)
+
+static void __expr_eliminate_eq(enum expr_type type, struct expr **ep1, struct expr **ep2)
+{
+       if (e1->type == type) {
+               __expr_eliminate_eq(type, &e1->left.expr, &e2);
+               __expr_eliminate_eq(type, &e1->right.expr, &e2);
+               return;
+       }
+       if (e2->type == type) {
+               __expr_eliminate_eq(type, &e1, &e2->left.expr);
+               __expr_eliminate_eq(type, &e1, &e2->right.expr);
+               return;
+       }
+       if (e1->type == E_SYMBOL && e2->type == E_SYMBOL &&
+           e1->left.sym == e2->left.sym && (e1->left.sym->flags & (SYMBOL_YES|SYMBOL_NO)))
+               return;
+       if (!expr_eq(e1, e2))
+               return;
+       trans_count++;
+       expr_free(e1); expr_free(e2);
+       switch (type) {
+       case E_OR:
+               e1 = expr_alloc_symbol(&symbol_no);
+               e2 = expr_alloc_symbol(&symbol_no);
+               break;
+       case E_AND:
+               e1 = expr_alloc_symbol(&symbol_yes);
+               e2 = expr_alloc_symbol(&symbol_yes);
+               break;
+       default:
+               ;
+       }
+}
+
+void expr_eliminate_eq(struct expr **ep1, struct expr **ep2)
+{
+       if (!e1 || !e2)
+               return;
+       switch (e1->type) {
+       case E_OR:
+       case E_AND:
+               __expr_eliminate_eq(e1->type, ep1, ep2);
+       default:
+               ;
+       }
+       if (e1->type != e2->type) switch (e2->type) {
+       case E_OR:
+       case E_AND:
+               __expr_eliminate_eq(e2->type, ep1, ep2);
+       default:
+               ;
+       }
+       e1 = expr_eliminate_yn(e1);
+       e2 = expr_eliminate_yn(e2);
+}
+
+#undef e1
+#undef e2
+
+int expr_eq(struct expr *e1, struct expr *e2)
+{
+       int res, old_count;
+
+       if (e1->type != e2->type)
+               return 0;
+       switch (e1->type) {
+       case E_EQUAL:
+       case E_UNEQUAL:
+               return e1->left.sym == e2->left.sym && e1->right.sym == e2->right.sym;
+       case E_SYMBOL:
+               return e1->left.sym == e2->left.sym;
+       case E_NOT:
+               return expr_eq(e1->left.expr, e2->left.expr);
+       case E_AND:
+       case E_OR:
+               e1 = expr_copy(e1);
+               e2 = expr_copy(e2);
+               old_count = trans_count;
+               expr_eliminate_eq(&e1, &e2);
+               res = (e1->type == E_SYMBOL && e2->type == E_SYMBOL &&
+                      e1->left.sym == e2->left.sym);
+               expr_free(e1);
+               expr_free(e2);
+               trans_count = old_count;
+               return res;
+       case E_CHOICE:
+       case E_RANGE:
+       case E_NONE:
+               /* panic */;
+       }
+
+       if (DEBUG_EXPR) {
+               expr_fprint(e1, stdout);
+               printf(" = ");
+               expr_fprint(e2, stdout);
+               printf(" ?\n");
+       }
+
+       return 0;
+}
+
+struct expr *expr_eliminate_yn(struct expr *e)
+{
+       struct expr *tmp;
+
+       if (e) switch (e->type) {
+       case E_AND:
+               e->left.expr = expr_eliminate_yn(e->left.expr);
+               e->right.expr = expr_eliminate_yn(e->right.expr);
+               if (e->left.expr->type == E_SYMBOL) {
+                       if (e->left.expr->left.sym == &symbol_no) {
+                               expr_free(e->left.expr);
+                               expr_free(e->right.expr);
+                               e->type = E_SYMBOL;
+                               e->left.sym = &symbol_no;
+                               e->right.expr = NULL;
+                               return e;
+                       } else if (e->left.expr->left.sym == &symbol_yes) {
+                               free(e->left.expr);
+                               tmp = e->right.expr;
+                               *e = *(e->right.expr);
+                               free(tmp);
+                               return e;
+                       }
+               }
+               if (e->right.expr->type == E_SYMBOL) {
+                       if (e->right.expr->left.sym == &symbol_no) {
+                               expr_free(e->left.expr);
+                               expr_free(e->right.expr);
+                               e->type = E_SYMBOL;
+                               e->left.sym = &symbol_no;
+                               e->right.expr = NULL;
+                               return e;
+                       } else if (e->right.expr->left.sym == &symbol_yes) {
+                               free(e->right.expr);
+                               tmp = e->left.expr;
+                               *e = *(e->left.expr);
+                               free(tmp);
+                               return e;
+                       }
+               }
+               break;
+       case E_OR:
+               e->left.expr = expr_eliminate_yn(e->left.expr);
+               e->right.expr = expr_eliminate_yn(e->right.expr);
+               if (e->left.expr->type == E_SYMBOL) {
+                       if (e->left.expr->left.sym == &symbol_no) {
+                               free(e->left.expr);
+                               tmp = e->right.expr;
+                               *e = *(e->right.expr);
+                               free(tmp);
+                               return e;
+                       } else if (e->left.expr->left.sym == &symbol_yes) {
+                               expr_free(e->left.expr);
+                               expr_free(e->right.expr);
+                               e->type = E_SYMBOL;
+                               e->left.sym = &symbol_yes;
+                               e->right.expr = NULL;
+                               return e;
+                       }
+               }
+               if (e->right.expr->type == E_SYMBOL) {
+                       if (e->right.expr->left.sym == &symbol_no) {
+                               free(e->right.expr);
+                               tmp = e->left.expr;
+                               *e = *(e->left.expr);
+                               free(tmp);
+                               return e;
+                       } else if (e->right.expr->left.sym == &symbol_yes) {
+                               expr_free(e->left.expr);
+                               expr_free(e->right.expr);
+                               e->type = E_SYMBOL;
+                               e->left.sym = &symbol_yes;
+                               e->right.expr = NULL;
+                               return e;
+                       }
+               }
+               break;
+       default:
+               ;
+       }
+       return e;
+}
+
+/*
+ * bool FOO!=n => FOO
+ */
+struct expr *expr_trans_bool(struct expr *e)
+{
+       if (!e)
+               return NULL;
+       switch (e->type) {
+       case E_AND:
+       case E_OR:
+       case E_NOT:
+               e->left.expr = expr_trans_bool(e->left.expr);
+               e->right.expr = expr_trans_bool(e->right.expr);
+               break;
+       case E_UNEQUAL:
+               // FOO!=n -> FOO
+               if (e->left.sym->type == S_TRISTATE) {
+                       if (e->right.sym == &symbol_no) {
+                               e->type = E_SYMBOL;
+                               e->right.sym = NULL;
+                       }
+               }
+               break;
+       default:
+               ;
+       }
+       return e;
+}
+
+/*
+ * e1 || e2 -> ?
+ */
+struct expr *expr_join_or(struct expr *e1, struct expr *e2)
+{
+       struct expr *tmp;
+       struct symbol *sym1, *sym2;
+
+       if (expr_eq(e1, e2))
+               return expr_copy(e1);
+       if (e1->type != E_EQUAL && e1->type != E_UNEQUAL && e1->type != E_SYMBOL && e1->type != E_NOT)
+               return NULL;
+       if (e2->type != E_EQUAL && e2->type != E_UNEQUAL && e2->type != E_SYMBOL && e2->type != E_NOT)
+               return NULL;
+       if (e1->type == E_NOT) {
+               tmp = e1->left.expr;
+               if (tmp->type != E_EQUAL && tmp->type != E_UNEQUAL && tmp->type != E_SYMBOL)
+                       return NULL;
+               sym1 = tmp->left.sym;
+       } else
+               sym1 = e1->left.sym;
+       if (e2->type == E_NOT) {
+               if (e2->left.expr->type != E_SYMBOL)
+                       return NULL;
+               sym2 = e2->left.expr->left.sym;
+       } else
+               sym2 = e2->left.sym;
+       if (sym1 != sym2)
+               return NULL;
+       if (sym1->type != S_BOOLEAN && sym1->type != S_TRISTATE)
+               return NULL;
+       if (sym1->type == S_TRISTATE) {
+               if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
+                   ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
+                    (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) {
+                       // (a='y') || (a='m') -> (a!='n')
+                       return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_no);
+               }
+               if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
+                   ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
+                    (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) {
+                       // (a='y') || (a='n') -> (a!='m')
+                       return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_mod);
+               }
+               if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
+                   ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
+                    (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) {
+                       // (a='m') || (a='n') -> (a!='y')
+                       return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_yes);
+               }
+       }
+       if (sym1->type == S_BOOLEAN && sym1 == sym2) {
+               if ((e1->type == E_NOT && e1->left.expr->type == E_SYMBOL && e2->type == E_SYMBOL) ||
+                   (e2->type == E_NOT && e2->left.expr->type == E_SYMBOL && e1->type == E_SYMBOL))
+                       return expr_alloc_symbol(&symbol_yes);
+       }
+
+       if (DEBUG_EXPR) {
+               printf("optimize (");
+               expr_fprint(e1, stdout);
+               printf(") || (");
+               expr_fprint(e2, stdout);
+               printf(")?\n");
+       }
+       return NULL;
+}
+
+struct expr *expr_join_and(struct expr *e1, struct expr *e2)
+{
+       struct expr *tmp;
+       struct symbol *sym1, *sym2;
+
+       if (expr_eq(e1, e2))
+               return expr_copy(e1);
+       if (e1->type != E_EQUAL && e1->type != E_UNEQUAL && e1->type != E_SYMBOL && e1->type != E_NOT)
+               return NULL;
+       if (e2->type != E_EQUAL && e2->type != E_UNEQUAL && e2->type != E_SYMBOL && e2->type != E_NOT)
+               return NULL;
+       if (e1->type == E_NOT) {
+               tmp = e1->left.expr;
+               if (tmp->type != E_EQUAL && tmp->type != E_UNEQUAL && tmp->type != E_SYMBOL)
+                       return NULL;
+               sym1 = tmp->left.sym;
+       } else
+               sym1 = e1->left.sym;
+       if (e2->type == E_NOT) {
+               if (e2->left.expr->type != E_SYMBOL)
+                       return NULL;
+               sym2 = e2->left.expr->left.sym;
+       } else
+               sym2 = e2->left.sym;
+       if (sym1 != sym2)
+               return NULL;
+       if (sym1->type != S_BOOLEAN && sym1->type != S_TRISTATE)
+               return NULL;
+
+       if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) ||
+           (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes))
+               // (a) && (a='y') -> (a='y')
+               return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
+
+       if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) ||
+           (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no))
+               // (a) && (a!='n') -> (a)
+               return expr_alloc_symbol(sym1);
+
+       if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_mod) ||
+           (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_mod))
+               // (a) && (a!='m') -> (a='y')
+               return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
+
+       if (sym1->type == S_TRISTATE) {
+               if (e1->type == E_EQUAL && e2->type == E_UNEQUAL) {
+                       // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
+                       sym2 = e1->right.sym;
+                       if ((e2->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
+                               return sym2 != e2->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
+                                                            : expr_alloc_symbol(&symbol_no);
+               }
+               if (e1->type == E_UNEQUAL && e2->type == E_EQUAL) {
+                       // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
+                       sym2 = e2->right.sym;
+                       if ((e1->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
+                               return sym2 != e1->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
+                                                            : expr_alloc_symbol(&symbol_no);
+               }
+               if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
+                          ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
+                           (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes)))
+                       // (a!='y') && (a!='n') -> (a='m')
+                       return expr_alloc_comp(E_EQUAL, sym1, &symbol_mod);
+
+               if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
+                          ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
+                           (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes)))
+                       // (a!='y') && (a!='m') -> (a='n')
+                       return expr_alloc_comp(E_EQUAL, sym1, &symbol_no);
+
+               if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
+                          ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
+                           (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod)))
+                       // (a!='m') && (a!='n') -> (a='m')
+                       return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
+
+               if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) ||
+                   (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_mod) ||
+                   (e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_yes) ||
+                   (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_yes))
+                       return NULL;
+       }
+
+       if (DEBUG_EXPR) {
+               printf("optimize (");
+               expr_fprint(e1, stdout);
+               printf(") && (");
+               expr_fprint(e2, stdout);
+               printf(")?\n");
+       }
+       return NULL;
+}
+
+static void expr_eliminate_dups1(enum expr_type type, struct expr **ep1, struct expr **ep2)
+{
+#define e1 (*ep1)
+#define e2 (*ep2)
+       struct expr *tmp;
+
+       if (e1->type == type) {
+               expr_eliminate_dups1(type, &e1->left.expr, &e2);
+               expr_eliminate_dups1(type, &e1->right.expr, &e2);
+               return;
+       }
+       if (e2->type == type) {
+               expr_eliminate_dups1(type, &e1, &e2->left.expr);
+               expr_eliminate_dups1(type, &e1, &e2->right.expr);
+               return;
+       }
+       if (e1 == e2)
+               return;
+
+       switch (e1->type) {
+       case E_OR: case E_AND:
+               expr_eliminate_dups1(e1->type, &e1, &e1);
+       default:
+               ;
+       }
+
+       switch (type) {
+       case E_OR:
+               tmp = expr_join_or(e1, e2);
+               if (tmp) {
+                       expr_free(e1); expr_free(e2);
+                       e1 = expr_alloc_symbol(&symbol_no);
+                       e2 = tmp;
+                       trans_count++;
+               }
+               break;
+       case E_AND:
+               tmp = expr_join_and(e1, e2);
+               if (tmp) {
+                       expr_free(e1); expr_free(e2);
+                       e1 = expr_alloc_symbol(&symbol_yes);
+                       e2 = tmp;
+                       trans_count++;
+               }
+               break;
+       default:
+               ;
+       }
+#undef e1
+#undef e2
+}
+
+static void expr_eliminate_dups2(enum expr_type type, struct expr **ep1, struct expr **ep2)
+{
+#define e1 (*ep1)
+#define e2 (*ep2)
+       struct expr *tmp, *tmp1, *tmp2;
+
+       if (e1->type == type) {
+               expr_eliminate_dups2(type, &e1->left.expr, &e2);
+               expr_eliminate_dups2(type, &e1->right.expr, &e2);
+               return;
+       }
+       if (e2->type == type) {
+               expr_eliminate_dups2(type, &e1, &e2->left.expr);
+               expr_eliminate_dups2(type, &e1, &e2->right.expr);
+       }
+       if (e1 == e2)
+               return;
+
+       switch (e1->type) {
+       case E_OR:
+               expr_eliminate_dups2(e1->type, &e1, &e1);
+               // (FOO || BAR) && (!FOO && !BAR) -> n
+               tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
+               tmp2 = expr_copy(e2);
+               tmp = expr_extract_eq_and(&tmp1, &tmp2);
+               if (expr_is_yes(tmp1)) {
+                       expr_free(e1);
+                       e1 = expr_alloc_symbol(&symbol_no);
+                       trans_count++;
+               }
+               expr_free(tmp2);
+               expr_free(tmp1);
+               expr_free(tmp);
+               break;
+       case E_AND:
+               expr_eliminate_dups2(e1->type, &e1, &e1);
+               // (FOO && BAR) || (!FOO || !BAR) -> y
+               tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
+               tmp2 = expr_copy(e2);
+               tmp = expr_extract_eq_or(&tmp1, &tmp2);
+               if (expr_is_no(tmp1)) {
+                       expr_free(e1);
+                       e1 = expr_alloc_symbol(&symbol_yes);
+                       trans_count++;
+               }
+               expr_free(tmp2);
+               expr_free(tmp1);
+               expr_free(tmp);
+               break;
+       default:
+               ;
+       }
+#undef e1
+#undef e2
+}
+
+struct expr *expr_eliminate_dups(struct expr *e)
+{
+       int oldcount;
+       if (!e)
+               return e;
+
+       oldcount = trans_count;
+       while (1) {
+               trans_count = 0;
+               switch (e->type) {
+               case E_OR: case E_AND:
+                       expr_eliminate_dups1(e->type, &e, &e);
+                       expr_eliminate_dups2(e->type, &e, &e);
+               default:
+                       ;
+               }
+               if (!trans_count)
+                       break;
+               e = expr_eliminate_yn(e);
+       }
+       trans_count = oldcount;
+       return e;
+}
+
+struct expr *expr_transform(struct expr *e)
+{
+       struct expr *tmp;
+
+       if (!e)
+               return NULL;
+       switch (e->type) {
+       case E_EQUAL:
+       case E_UNEQUAL:
+       case E_SYMBOL:
+       case E_CHOICE:
+               break;
+       default:
+               e->left.expr = expr_transform(e->left.expr);
+               e->right.expr = expr_transform(e->right.expr);
+       }
+
+       switch (e->type) {
+       case E_EQUAL:
+               if (e->left.sym->type != S_BOOLEAN)
+                       break;
+               if (e->right.sym == &symbol_no) {
+                       e->type = E_NOT;
+                       e->left.expr = expr_alloc_symbol(e->left.sym);
+                       e->right.sym = NULL;
+                       break;
+               }
+               if (e->right.sym == &symbol_mod) {
+                       printf("boolean symbol %s tested for 'm'? test forced to 'n'\n", e->left.sym->name);
+                       e->type = E_SYMBOL;
+                       e->left.sym = &symbol_no;
+                       e->right.sym = NULL;
+                       break;
+               }
+               if (e->right.sym == &symbol_yes) {
+                       e->type = E_SYMBOL;
+                       e->right.sym = NULL;
+                       break;
+               }
+               break;
+       case E_UNEQUAL:
+               if (e->left.sym->type != S_BOOLEAN)
+                       break;
+               if (e->right.sym == &symbol_no) {
+                       e->type = E_SYMBOL;
+                       e->right.sym = NULL;
+                       break;
+               }
+               if (e->right.sym == &symbol_mod) {
+                       printf("boolean symbol %s tested for 'm'? test forced to 'y'\n", e->left.sym->name);
+                       e->type = E_SYMBOL;
+                       e->left.sym = &symbol_yes;
+                       e->right.sym = NULL;
+                       break;
+               }
+               if (e->right.sym == &symbol_yes) {
+                       e->type = E_NOT;
+                       e->left.expr = expr_alloc_symbol(e->left.sym);
+                       e->right.sym = NULL;
+                       break;
+               }
+               break;
+       case E_NOT:
+               switch (e->left.expr->type) {
+               case E_NOT:
+                       // !!a -> a
+                       tmp = e->left.expr->left.expr;
+                       free(e->left.expr);
+                       free(e);
+                       e = tmp;
+                       e = expr_transform(e);
+                       break;
+               case E_EQUAL:
+               case E_UNEQUAL:
+                       // !a='x' -> a!='x'
+                       tmp = e->left.expr;
+                       free(e);
+                       e = tmp;
+                       e->type = e->type == E_EQUAL ? E_UNEQUAL : E_EQUAL;
+                       break;
+               case E_OR:
+                       // !(a || b) -> !a && !b
+                       tmp = e->left.expr;
+                       e->type = E_AND;
+                       e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
+                       tmp->type = E_NOT;
+                       tmp->right.expr = NULL;
+                       e = expr_transform(e);
+                       break;
+               case E_AND:
+                       // !(a && b) -> !a || !b
+                       tmp = e->left.expr;
+                       e->type = E_OR;
+                       e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
+                       tmp->type = E_NOT;
+                       tmp->right.expr = NULL;
+                       e = expr_transform(e);
+                       break;
+               case E_SYMBOL:
+                       if (e->left.expr->left.sym == &symbol_yes) {
+                               // !'y' -> 'n'
+                               tmp = e->left.expr;
+                               free(e);
+                               e = tmp;
+                               e->type = E_SYMBOL;
+                               e->left.sym = &symbol_no;
+                               break;
+                       }
+                       if (e->left.expr->left.sym == &symbol_mod) {
+                               // !'m' -> 'm'
+                               tmp = e->left.expr;
+                               free(e);
+                               e = tmp;
+                               e->type = E_SYMBOL;
+                               e->left.sym = &symbol_mod;
+                               break;
+                       }
+                       if (e->left.expr->left.sym == &symbol_no) {
+                               // !'n' -> 'y'
+                               tmp = e->left.expr;
+                               free(e);
+                               e = tmp;
+                               e->type = E_SYMBOL;
+                               e->left.sym = &symbol_yes;
+                               break;
+                       }
+                       break;
+               default:
+                       ;
+               }
+               break;
+       default:
+               ;
+       }
+       return e;
+}
+
+int expr_contains_symbol(struct expr *dep, struct symbol *sym)
+{
+       if (!dep)
+               return 0;
+
+       switch (dep->type) {
+       case E_AND:
+       case E_OR:
+               return expr_contains_symbol(dep->left.expr, sym) ||
+                      expr_contains_symbol(dep->right.expr, sym);
+       case E_SYMBOL:
+               return dep->left.sym == sym;
+       case E_EQUAL:
+       case E_UNEQUAL:
+               return dep->left.sym == sym ||
+                      dep->right.sym == sym;
+       case E_NOT:
+               return expr_contains_symbol(dep->left.expr, sym);
+       default:
+               ;
+       }
+       return 0;
+}
+
+bool expr_depends_symbol(struct expr *dep, struct symbol *sym)
+{
+       if (!dep)
+               return false;
+
+       switch (dep->type) {
+       case E_AND:
+               return expr_depends_symbol(dep->left.expr, sym) ||
+                      expr_depends_symbol(dep->right.expr, sym);
+       case E_SYMBOL:
+               return dep->left.sym == sym;
+       case E_EQUAL:
+               if (dep->left.sym == sym) {
+                       if (dep->right.sym == &symbol_yes || dep->right.sym == &symbol_mod)
+                               return true;
+               }
+               break;
+       case E_UNEQUAL:
+               if (dep->left.sym == sym) {
+                       if (dep->right.sym == &symbol_no)
+                               return true;
+               }
+               break;
+       default:
+               ;
+       }
+       return false;
+}
+
+struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2)
+{
+       struct expr *tmp = NULL;
+       expr_extract_eq(E_AND, &tmp, ep1, ep2);
+       if (tmp) {
+               *ep1 = expr_eliminate_yn(*ep1);
+               *ep2 = expr_eliminate_yn(*ep2);
+       }
+       return tmp;
+}
+
+struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2)
+{
+       struct expr *tmp = NULL;
+       expr_extract_eq(E_OR, &tmp, ep1, ep2);
+       if (tmp) {
+               *ep1 = expr_eliminate_yn(*ep1);
+               *ep2 = expr_eliminate_yn(*ep2);
+       }
+       return tmp;
+}
+
+void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2)
+{
+#define e1 (*ep1)
+#define e2 (*ep2)
+       if (e1->type == type) {
+               expr_extract_eq(type, ep, &e1->left.expr, &e2);
+               expr_extract_eq(type, ep, &e1->right.expr, &e2);
+               return;
+       }
+       if (e2->type == type) {
+               expr_extract_eq(type, ep, ep1, &e2->left.expr);
+               expr_extract_eq(type, ep, ep1, &e2->right.expr);
+               return;
+       }
+       if (expr_eq(e1, e2)) {
+               *ep = *ep ? expr_alloc_two(type, *ep, e1) : e1;
+               expr_free(e2);
+               if (type == E_AND) {
+                       e1 = expr_alloc_symbol(&symbol_yes);
+                       e2 = expr_alloc_symbol(&symbol_yes);
+               } else if (type == E_OR) {
+                       e1 = expr_alloc_symbol(&symbol_no);
+                       e2 = expr_alloc_symbol(&symbol_no);
+               }
+       }
+#undef e1
+#undef e2
+}
+
+struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym)
+{
+       struct expr *e1, *e2;
+
+       if (!e) {
+               e = expr_alloc_symbol(sym);
+               if (type == E_UNEQUAL)
+                       e = expr_alloc_one(E_NOT, e);
+               return e;
+       }
+       switch (e->type) {
+       case E_AND:
+               e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym);
+               e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym);
+               if (sym == &symbol_yes)
+                       e = expr_alloc_two(E_AND, e1, e2);
+               if (sym == &symbol_no)
+                       e = expr_alloc_two(E_OR, e1, e2);
+               if (type == E_UNEQUAL)
+                       e = expr_alloc_one(E_NOT, e);
+               return e;
+       case E_OR:
+               e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym);
+               e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym);
+               if (sym == &symbol_yes)
+                       e = expr_alloc_two(E_OR, e1, e2);
+               if (sym == &symbol_no)
+                       e = expr_alloc_two(E_AND, e1, e2);
+               if (type == E_UNEQUAL)
+                       e = expr_alloc_one(E_NOT, e);
+               return e;
+       case E_NOT:
+               return expr_trans_compare(e->left.expr, type == E_EQUAL ? E_UNEQUAL : E_EQUAL, sym);
+       case E_UNEQUAL:
+       case E_EQUAL:
+               if (type == E_EQUAL) {
+                       if (sym == &symbol_yes)
+                               return expr_copy(e);
+                       if (sym == &symbol_mod)
+                               return expr_alloc_symbol(&symbol_no);
+                       if (sym == &symbol_no)
+                               return expr_alloc_one(E_NOT, expr_copy(e));
+               } else {
+                       if (sym == &symbol_yes)
+                               return expr_alloc_one(E_NOT, expr_copy(e));
+                       if (sym == &symbol_mod)
+                               return expr_alloc_symbol(&symbol_yes);
+                       if (sym == &symbol_no)
+                               return expr_copy(e);
+               }
+               break;
+       case E_SYMBOL:
+               return expr_alloc_comp(type, e->left.sym, sym);
+       case E_CHOICE:
+       case E_RANGE:
+       case E_NONE:
+               /* panic */;
+       }
+       return NULL;
+}
+
+tristate expr_calc_value(struct expr *e)
+{
+       tristate val1, val2;
+       const char *str1, *str2;
+
+       if (!e)
+               return yes;
+
+       switch (e->type) {
+       case E_SYMBOL:
+               sym_calc_value(e->left.sym);
+               return e->left.sym->curr.tri;
+       case E_AND:
+               val1 = expr_calc_value(e->left.expr);
+               val2 = expr_calc_value(e->right.expr);
+               return E_AND(val1, val2);
+       case E_OR:
+               val1 = expr_calc_value(e->left.expr);
+               val2 = expr_calc_value(e->right.expr);
+               return E_OR(val1, val2);
+       case E_NOT:
+               val1 = expr_calc_value(e->left.expr);
+               return E_NOT(val1);
+       case E_EQUAL:
+               sym_calc_value(e->left.sym);
+               sym_calc_value(e->right.sym);
+               str1 = sym_get_string_value(e->left.sym);
+               str2 = sym_get_string_value(e->right.sym);
+               return !strcmp(str1, str2) ? yes : no;
+       case E_UNEQUAL:
+               sym_calc_value(e->left.sym);
+               sym_calc_value(e->right.sym);
+               str1 = sym_get_string_value(e->left.sym);
+               str2 = sym_get_string_value(e->right.sym);
+               return !strcmp(str1, str2) ? no : yes;
+       default:
+               printf("expr_calc_value: %d?\n", e->type);
+               return no;
+       }
+}
+
+int expr_compare_type(enum expr_type t1, enum expr_type t2)
+{
+#if 0
+       return 1;
+#else
+       if (t1 == t2)
+               return 0;
+       switch (t1) {
+       case E_EQUAL:
+       case E_UNEQUAL:
+               if (t2 == E_NOT)
+                       return 1;
+       case E_NOT:
+               if (t2 == E_AND)
+                       return 1;
+       case E_AND:
+               if (t2 == E_OR)
+                       return 1;
+       case E_OR:
+               if (t2 == E_CHOICE)
+                       return 1;
+       case E_CHOICE:
+               if (t2 == 0)
+                       return 1;
+       default:
+               return -1;
+       }
+       printf("[%dgt%d?]", t1, t2);
+       return 0;
+#endif
+}
+
+void expr_print(struct expr *e, void (*fn)(void *, const char *), void *data, int prevtoken)
+{
+       if (!e) {
+               fn(data, "y");
+               return;
+       }
+
+       if (expr_compare_type(prevtoken, e->type) > 0)
+               fn(data, "(");
+       switch (e->type) {
+       case E_SYMBOL:
+               if (e->left.sym->name)
+                       fn(data, e->left.sym->name);
+               else
+                       fn(data, "<choice>");
+               break;
+       case E_NOT:
+               fn(data, "!");
+               expr_print(e->left.expr, fn, data, E_NOT);
+               break;
+       case E_EQUAL:
+               fn(data, e->left.sym->name);
+               fn(data, "=");
+               fn(data, e->right.sym->name);
+               break;
+       case E_UNEQUAL:
+               fn(data, e->left.sym->name);
+               fn(data, "!=");
+               fn(data, e->right.sym->name);
+               break;
+       case E_OR:
+               expr_print(e->left.expr, fn, data, E_OR);
+               fn(data, " || ");
+               expr_print(e->right.expr, fn, data, E_OR);
+               break;
+       case E_AND:
+               expr_print(e->left.expr, fn, data, E_AND);
+               fn(data, " && ");
+               expr_print(e->right.expr, fn, data, E_AND);
+               break;
+       case E_CHOICE:
+               fn(data, e->right.sym->name);
+               if (e->left.expr) {
+                       fn(data, " ^ ");
+                       expr_print(e->left.expr, fn, data, E_CHOICE);
+               }
+               break;
+       case E_RANGE:
+               fn(data, "[");
+               fn(data, e->left.sym->name);
+               fn(data, " ");
+               fn(data, e->right.sym->name);
+               fn(data, "]");
+               break;
+       default:
+         {
+               char buf[32];
+               sprintf(buf, "<unknown type %d>", e->type);
+               fn(data, buf);
+               break;
+         }
+       }
+       if (expr_compare_type(prevtoken, e->type) > 0)
+               fn(data, ")");
+}
+
+static void expr_print_file_helper(void *data, const char *str)
+{
+       fwrite(str, strlen(str), 1, data);
+}
+
+void expr_fprint(struct expr *e, FILE *out)
+{
+       expr_print(e, expr_print_file_helper, out, E_NONE);
+}
+
+static void expr_print_gstr_helper(void *data, const char *str)
+{
+       str_append((struct gstr*)data, str);
+}
+
+void expr_gstr_print(struct expr *e, struct gstr *gs)
+{
+       expr_print(e, expr_print_gstr_helper, gs, E_NONE);
+}
diff --git a/libs/nixio/axTLS/config/scripts/config/expr.h b/libs/nixio/axTLS/config/scripts/config/expr.h
new file mode 100644 (file)
index 0000000..7d39ff4
--- /dev/null
@@ -0,0 +1,195 @@
+/*
+ * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ * Released under the terms of the GNU GPL v2.0.
+ */
+
+#ifndef EXPR_H
+#define EXPR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
+
+struct file {
+       struct file *next;
+       struct file *parent;
+       char *name;
+       int lineno;
+       int flags;
+};
+
+#define FILE_BUSY              0x0001
+#define FILE_SCANNED           0x0002
+#define FILE_PRINTED           0x0004
+
+typedef enum tristate {
+       no, mod, yes
+} tristate;
+
+enum expr_type {
+       E_NONE, E_OR, E_AND, E_NOT, E_EQUAL, E_UNEQUAL, E_CHOICE, E_SYMBOL, E_RANGE
+};
+
+union expr_data {
+       struct expr *expr;
+       struct symbol *sym;
+};
+
+struct expr {
+       enum expr_type type;
+       union expr_data left, right;
+};
+
+#define E_OR(dep1, dep2)       (((dep1)>(dep2))?(dep1):(dep2))
+#define E_AND(dep1, dep2)      (((dep1)<(dep2))?(dep1):(dep2))
+#define E_NOT(dep)             (2-(dep))
+
+struct expr_value {
+       struct expr *expr;
+       tristate tri;
+};
+
+struct symbol_value {
+       void *val;
+       tristate tri;
+};
+
+enum symbol_type {
+       S_UNKNOWN, S_BOOLEAN, S_TRISTATE, S_INT, S_HEX, S_STRING, S_OTHER
+};
+
+struct symbol {
+       struct symbol *next;
+       char *name;
+       char *help;
+       enum symbol_type type;
+       struct symbol_value curr, user;
+       tristate visible;
+       int flags;
+       struct property *prop;
+       struct expr *dep, *dep2;
+       struct expr_value rev_dep;
+};
+
+#define for_all_symbols(i, sym) for (i = 0; i < 257; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) if (sym->type != S_OTHER)
+
+#define SYMBOL_YES             0x0001
+#define SYMBOL_MOD             0x0002
+#define SYMBOL_NO              0x0004
+#define SYMBOL_CONST           0x0007
+#define SYMBOL_CHECK           0x0008
+#define SYMBOL_CHOICE          0x0010
+#define SYMBOL_CHOICEVAL       0x0020
+#define SYMBOL_PRINTED         0x0040
+#define SYMBOL_VALID           0x0080
+#define SYMBOL_OPTIONAL                0x0100
+#define SYMBOL_WRITE           0x0200
+#define SYMBOL_CHANGED         0x0400
+#define SYMBOL_NEW             0x0800
+#define SYMBOL_AUTO            0x1000
+#define SYMBOL_CHECKED         0x2000
+#define SYMBOL_CHECK_DONE      0x4000
+#define SYMBOL_WARNED          0x8000
+
+#define SYMBOL_MAXLENGTH       256
+#define SYMBOL_HASHSIZE                257
+#define SYMBOL_HASHMASK                0xff
+
+enum prop_type {
+       P_UNKNOWN, P_PROMPT, P_COMMENT, P_MENU, P_DEFAULT, P_CHOICE, P_SELECT, P_RANGE
+};
+
+struct property {
+       struct property *next;
+       struct symbol *sym;
+       enum prop_type type;
+       const char *text;
+       struct expr_value visible;
+       struct expr *expr;
+       struct menu *menu;
+       struct file *file;
+       int lineno;
+};
+
+#define for_all_properties(sym, st, tok) \
+       for (st = sym->prop; st; st = st->next) \
+               if (st->type == (tok))
+#define for_all_defaults(sym, st) for_all_properties(sym, st, P_DEFAULT)
+#define for_all_choices(sym, st) for_all_properties(sym, st, P_CHOICE)
+#define for_all_prompts(sym, st) \
+       for (st = sym->prop; st; st = st->next) \
+               if (st->text)
+
+struct menu {
+       struct menu *next;
+       struct menu *parent;
+       struct menu *list;
+       struct symbol *sym;
+       struct property *prompt;
+       struct expr *dep;
+       unsigned int flags;
+       //char *help;
+       struct file *file;
+       int lineno;
+       void *data;
+};
+
+#define MENU_CHANGED           0x0001
+#define MENU_ROOT              0x0002
+
+#ifndef SWIG
+
+extern struct file *file_list;
+extern struct file *current_file;
+struct file *lookup_file(const char *name);
+
+extern struct symbol symbol_yes, symbol_no, symbol_mod;
+extern struct symbol *modules_sym;
+extern int cdebug;
+struct expr *expr_alloc_symbol(struct symbol *sym);
+struct expr *expr_alloc_one(enum expr_type type, struct expr *ce);
+struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2);
+struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2);
+struct expr *expr_alloc_and(struct expr *e1, struct expr *e2);
+struct expr *expr_alloc_or(struct expr *e1, struct expr *e2);
+struct expr *expr_copy(struct expr *org);
+void expr_free(struct expr *e);
+int expr_eq(struct expr *e1, struct expr *e2);
+void expr_eliminate_eq(struct expr **ep1, struct expr **ep2);
+tristate expr_calc_value(struct expr *e);
+struct expr *expr_eliminate_yn(struct expr *e);
+struct expr *expr_trans_bool(struct expr *e);
+struct expr *expr_eliminate_dups(struct expr *e);
+struct expr *expr_transform(struct expr *e);
+int expr_contains_symbol(struct expr *dep, struct symbol *sym);
+bool expr_depends_symbol(struct expr *dep, struct symbol *sym);
+struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2);
+struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2);
+void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2);
+struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym);
+
+void expr_fprint(struct expr *e, FILE *out);
+struct gstr; /* forward */
+void expr_gstr_print(struct expr *e, struct gstr *gs);
+
+static inline int expr_is_yes(struct expr *e)
+{
+       return !e || (e->type == E_SYMBOL && e->left.sym == &symbol_yes);
+}
+
+static inline int expr_is_no(struct expr *e)
+{
+       return e && (e->type == E_SYMBOL && e->left.sym == &symbol_no);
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EXPR_H */
diff --git a/libs/nixio/axTLS/config/scripts/config/lex.zconf.c_shipped b/libs/nixio/axTLS/config/scripts/config/lex.zconf.c_shipped
new file mode 100644 (file)
index 0000000..b877bb6
--- /dev/null
@@ -0,0 +1,3688 @@
+
+#line 3 "lex.zconf.c"
+
+#define  YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 31
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with  platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t;
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN               (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN              (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN              (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX               (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX              (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX              (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX              (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX             (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX             (4294967295U)
+#endif
+
+#endif /* ! FLEXINT_H */
+
+#ifdef __cplusplus
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else  /* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_CONST
+
+#endif /* __STDC__ */
+#endif /* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index.  If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition.  This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN (yy_start) = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state.  The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START (((yy_start) - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE zconfrestart(zconfin  )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#define YY_BUF_SIZE 16384
+#endif
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+extern int zconfleng;
+
+extern FILE *zconfin, *zconfout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+    #define YY_LESS_LINENO(n)
+
+/* Return all but the first "n" matched characters back to the input stream. */
+#define yyless(n) \
+       do \
+               { \
+               /* Undo effects of setting up zconftext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+               *yy_cp = (yy_hold_char); \
+               YY_RESTORE_YY_MORE_OFFSET \
+               (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+               YY_DO_BEFORE_ACTION; /* set up zconftext again */ \
+               } \
+       while ( 0 )
+
+#define unput(c) yyunput( c, (yytext_ptr)  )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef unsigned int yy_size_t;
+#endif
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+       {
+       FILE *yy_input_file;
+
+       char *yy_ch_buf;                /* input buffer */
+       char *yy_buf_pos;               /* current position in input buffer */
+
+       /* Size of input buffer in bytes, not including room for EOB
+        * characters.
+        */
+       yy_size_t yy_buf_size;
+
+       /* Number of characters read into yy_ch_buf, not including EOB
+        * characters.
+        */
+       int yy_n_chars;
+
+       /* Whether we "own" the buffer - i.e., we know we created it,
+        * and can realloc() it to grow it, and should free() it to
+        * delete it.
+        */
+       int yy_is_our_buffer;
+
+       /* Whether this is an "interactive" input source; if so, and
+        * if we're using stdio for input, then we want to use getc()
+        * instead of fread(), to make sure we stop fetching input after
+        * each newline.
+        */
+       int yy_is_interactive;
+
+       /* Whether we're considered to be at the beginning of a line.
+        * If so, '^' rules will be active on the next match, otherwise
+        * not.
+        */
+       int yy_at_bol;
+
+    int yy_bs_lineno; /**< The line count. */
+    int yy_bs_column; /**< The column count. */
+
+       /* Whether to try to fill the input buffer when we reach the
+        * end of it.
+        */
+       int yy_fill_buffer;
+
+       int yy_buffer_status;
+
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+       /* When an EOF's been seen but there's still some text to process
+        * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+        * shouldn't try reading from the input source any more.  We might
+        * still have a bunch of tokens to match, though, because of
+        * possible backing-up.
+        *
+        * When we actually see the EOF, we change the status to "new"
+        * (via zconfrestart()), so that the user can continue scanning by
+        * just pointing zconfin at a new input file.
+        */
+#define YY_BUFFER_EOF_PENDING 2
+
+       };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* Stack of input buffers. */
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+                          : NULL)
+
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
+
+/* yy_hold_char holds the character lost when zconftext is formed. */
+static char yy_hold_char;
+static int yy_n_chars;         /* number of characters read into yy_ch_buf */
+int zconfleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1;                /* whether we need to initialize */
+static int yy_start = 0;       /* start state number */
+
+/* Flag which is used to allow zconfwrap()'s to do buffer switches
+ * instead of setting up a fresh zconfin.  A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void zconfrestart (FILE *input_file  );
+void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
+YY_BUFFER_STATE zconf_create_buffer (FILE *file,int size  );
+void zconf_delete_buffer (YY_BUFFER_STATE b  );
+void zconf_flush_buffer (YY_BUFFER_STATE b  );
+void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer  );
+void zconfpop_buffer_state (void );
+
+static void zconfensure_buffer_stack (void );
+static void zconf_load_buffer_state (void );
+static void zconf_init_buffer (YY_BUFFER_STATE b,FILE *file  );
+
+#define YY_FLUSH_BUFFER zconf_flush_buffer(YY_CURRENT_BUFFER )
+
+YY_BUFFER_STATE zconf_scan_buffer (char *base,yy_size_t size  );
+YY_BUFFER_STATE zconf_scan_string (yyconst char *yy_str  );
+YY_BUFFER_STATE zconf_scan_bytes (yyconst char *bytes,int len  );
+
+void *zconfalloc (yy_size_t  );
+void *zconfrealloc (void *,yy_size_t  );
+void zconffree (void *  );
+
+#define yy_new_buffer zconf_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+       { \
+       if ( ! YY_CURRENT_BUFFER ){ \
+        zconfensure_buffer_stack (); \
+               YY_CURRENT_BUFFER_LVALUE =    \
+            zconf_create_buffer(zconfin,YY_BUF_SIZE ); \
+       } \
+       YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+       }
+
+#define yy_set_bol(at_bol) \
+       { \
+       if ( ! YY_CURRENT_BUFFER ){\
+        zconfensure_buffer_stack (); \
+               YY_CURRENT_BUFFER_LVALUE =    \
+            zconf_create_buffer(zconfin,YY_BUF_SIZE ); \
+       } \
+       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+       }
+
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+/* Begin user sect3 */
+
+#define zconfwrap(n) 1
+#define YY_SKIP_YYWRAP
+
+typedef unsigned char YY_CHAR;
+
+FILE *zconfin = (FILE *) 0, *zconfout = (FILE *) 0;
+
+typedef int yy_state_type;
+
+extern int zconflineno;
+
+int zconflineno = 1;
+
+extern char *zconftext;
+#define yytext_ptr zconftext
+static yyconst flex_int16_t yy_nxt[][38] =
+    {
+    {
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0
+    },
+
+    {
+       11,   12,   13,   14,   12,   12,   15,   12,   12,   12,
+       12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
+       12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
+       12,   12,   12,   12,   12,   12,   12,   12
+    },
+
+    {
+       11,   12,   13,   14,   12,   12,   15,   12,   12,   12,
+       12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
+
+       12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
+       12,   12,   12,   12,   12,   12,   12,   12
+    },
+
+    {
+       11,   16,   16,   17,   16,   16,   16,   16,   16,   16,
+       16,   16,   16,   18,   16,   16,   18,   18,   19,   20,
+       21,   22,   18,   18,   23,   24,   18,   25,   18,   26,
+       27,   18,   28,   29,   30,   18,   18,   16
+    },
+
+    {
+       11,   16,   16,   17,   16,   16,   16,   16,   16,   16,
+       16,   16,   16,   18,   16,   16,   18,   18,   19,   20,
+       21,   22,   18,   18,   23,   24,   18,   25,   18,   26,
+       27,   18,   28,   29,   30,   18,   18,   16
+
+    },
+
+    {
+       11,   31,   32,   33,   31,   31,   31,   31,   31,   31,
+       31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
+       31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
+       31,   31,   31,   31,   31,   31,   31,   31
+    },
+
+    {
+       11,   31,   32,   33,   31,   31,   31,   31,   31,   31,
+       31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
+       31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
+       31,   31,   31,   31,   31,   31,   31,   31
+    },
+
+    {
+       11,   34,   34,   35,   34,   36,   34,   34,   36,   34,
+       34,   34,   34,   34,   34,   37,   34,   34,   34,   34,
+
+       34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
+       34,   34,   34,   34,   34,   34,   34,   34
+    },
+
+    {
+  &n