Merge pull request #639 from fededim/master
authorSteven Barth <steven@midlink.org>
Sat, 13 Dec 2014 17:18:49 +0000 (18:18 +0100)
committerSteven Barth <steven@midlink.org>
Sat, 13 Dec 2014 17:18:49 +0000 (18:18 +0100)
net/lftp: upgrade to version 4.6.0

428 files changed:
CONTRIBUTING.md
admin/debootstrap/Makefile
admin/monit/Makefile
admin/zabbix/Makefile
admin/zabbix/patches/001-cross_compile.patch [deleted file]
devel/gcc/patches/020-disable-check-for-sys-sdt-h.patch [new file with mode: 0644]
ipv6/aiccu/Makefile
ipv6/aiccu/files/aiccu.hotplug [new file with mode: 0644]
ipv6/aiccu/files/aiccu.sh
lang/dkjson/Makefile
lang/erlang/Makefile
lang/luasql/Makefile
lang/micropython-lib/Makefile
lang/micropython/Makefile
lang/perl-compress-bzip2/Makefile
lang/perl-dbi/Makefile
lang/perl-test-harness/Makefile
lang/perl-uri/Makefile
lang/perl/Config.in [new file with mode: 0644]
lang/perl/Makefile
lang/perl/files/config.sh-arm.in
lang/perl/files/config.sh-armeb.in
lang/perl/files/config.sh-avr32.in
lang/perl/files/config.sh-i486.in
lang/perl/files/config.sh-mips.in
lang/perl/files/config.sh-mipsel.in
lang/perl/files/config.sh-powerpc.in
lang/perl/files/config.sh-x86_64.in
lang/perl/files/perl-run_tests.sh [new file with mode: 0755]
lang/perl/perlbase.mk
lang/perl/perlmod.mk
lang/php5/Makefile
lang/python-dns/Makefile [new file with mode: 0644]
lang/python-pip/Makefile [new file with mode: 0644]
lang/python-setuptools/Makefile [new file with mode: 0644]
lang/python/Makefile [new file with mode: 0644]
lang/python/files/config.site [new file with mode: 0644]
lang/python/files/python-package.mk [new file with mode: 0644]
lang/python/patches/110-enable-zlib.patch [new file with mode: 0644]
lang/python/patches/120-do-not-add-include-dirs-when-cross-compiling.patch [new file with mode: 0644]
lang/python/patches/130-do-not-run-distutils-tests.patch [new file with mode: 0644]
lang/python/patches/140-do-not-write-bytes-codes.patch [new file with mode: 0644]
lang/python3/Makefile
lang/python3/files/config.site
lang/python3/files/python3-package.mk
lang/python3/patches/120-do-not-add-include-dirs-when-cross-compiling.patch [new file with mode: 0644]
lang/python3/patches/130-do-not-run-distutils-tests.patch [new file with mode: 0644]
lang/python3/patches/140-do-not-write-bytes-codes.patch [new file with mode: 0644]
lang/ruby/Makefile
libs/alsa-lib/Makefile
libs/avahi/Makefile
libs/avahi/files/service-http
libs/avahi/files/service-ssh
libs/cyrus-sasl/Makefile
libs/db47/Makefile
libs/dmx_usb_module/Makefile [new file with mode: 0644]
libs/dmx_usb_module/patches/001-dmx_usb_Makefile.patch [new file with mode: 0644]
libs/file/Makefile
libs/gnutls/Makefile
libs/gperf/Makefile [new file with mode: 0644]
libs/libantlr3c/Makefile [new file with mode: 0644]
libs/libao/Makefile
libs/libartnet/Makefile [new file with mode: 0644]
libs/libartnet/patches/001-bswap_16.patch [new file with mode: 0644]
libs/libavl/Makefile [new file with mode: 0644]
libs/libavl/patches/010-update_GNUmakefile.patch [new file with mode: 0644]
libs/libdbi-drivers/Makefile
libs/libdbi/Makefile
libs/libdmapsharing/Makefile
libs/libftdi1/Makefile
libs/libftdi1/patches/100-fix-x86_64-build.patch
libs/libhttp-parser/Makefile [new file with mode: 0644]
libs/libimobiledevice/Makefile
libs/liblo/Makefile
libs/libmcrypt/Makefile
libs/libmicrohttpd/Makefile [new file with mode: 0644]
libs/libmpdclient/Makefile
libs/libmpdclient/patches/001-WIP_musl_compatibility.patch [new file with mode: 0644]
libs/libnatpmp/Makefile
libs/libnetfilter-acct/Makefile
libs/libnetfilter-log/Makefile
libs/libnetfilter-queue/Makefile
libs/libnfc/Makefile [new file with mode: 0644]
libs/liboil/Makefile
libs/libowfat/Makefile
libs/libplist/Makefile
libs/libsamplerate/Makefile
libs/libsodium/Makefile
libs/libsoup/Makefile
libs/libsoxr/Makefile
libs/libtheora/Makefile
libs/libuecc/Makefile
libs/libunistring/Makefile [new file with mode: 0644]
libs/libupnpp/Makefile [new file with mode: 0644]
libs/libusbmuxd/Makefile
libs/libv4l/Makefile
libs/libxml2/Makefile
libs/mxml/Makefile [new file with mode: 0644]
libs/mxml/patches/001-targets.patch [new file with mode: 0644]
libs/nspr/Makefile
libs/opus/Makefile
libs/protobuf/Makefile
libs/sqlite3/Makefile
libs/tdb/Makefile [new file with mode: 0644]
libs/tdb/patches/001-printf-fix.patch [new file with mode: 0644]
libs/xmlrpc-c/Makefile
mail/bogofilter/Makefile [new file with mode: 0644]
mail/bogofilter/files/postfix-bogofilter [new file with mode: 0755]
mail/dovecot/Makefile
mail/dovecot/patches/001-configure_in.patch
mail/fdm/Config.in [new file with mode: 0644]
mail/fdm/Makefile [new file with mode: 0644]
mail/fdm/files/etc/fdm.conf [new file with mode: 0644]
mail/fdm/patches/001-base64-fix.patch [new file with mode: 0644]
mail/fdm/patches/002-base64-fix.patch [new file with mode: 0644]
mail/fdm/src/compat/b64_ntop.c [new file with mode: 0644]
mail/fdm/src/compat/b64_pton.c [new file with mode: 0644]
mail/mailman/Makefile [new file with mode: 0644]
mail/mailman/files/mailman.init [new file with mode: 0644]
mail/mailman/patches/100-postfix.patch [new file with mode: 0644]
mail/mailman/patches/200-nohostdnspython.patch [new file with mode: 0644]
mail/mailman/patches/300-targetpython.patch [new file with mode: 0644]
mail/mailman/patches/400-modules.patch [new file with mode: 0644]
mail/mailsend/Makefile
mail/nail/Makefile [new file with mode: 0644]
mail/postfix/Makefile [new file with mode: 0644]
mail/postfix/files/main.cf.default [new file with mode: 0644]
mail/postfix/files/postfix.init [new file with mode: 0644]
mail/postfix/patches/100-fsstat.patch [new file with mode: 0644]
mail/postfix/patches/200-manpages.patch [new file with mode: 0644]
mail/postfix/patches/300-bdb_hash_segfault.patch [new file with mode: 0644]
mail/postfix/patches/400-cdb.patch [new file with mode: 0644]
mail/postfix/patches/500-crosscompile.patch [new file with mode: 0644]
mail/postfix/patches/600-nopostconf.patch [new file with mode: 0644]
mail/postfix/patches/700-defaultconfig.patch [new file with mode: 0644]
mail/postfix/patches/800-fmt.patch [new file with mode: 0644]
mail/ssmtp/Makefile [new file with mode: 0644]
mail/ssmtp/patches/002-fix_pointer.patch [new file with mode: 0644]
multimedia/ffmpeg/Makefile
multimedia/fswebcam/Makefile
multimedia/gst1-libav/Makefile
multimedia/gst1-plugins-bad/Makefile
multimedia/gst1-plugins-base/Makefile
multimedia/gst1-plugins-good/Makefile
multimedia/gst1-plugins-ugly/Makefile
multimedia/gstreamer1/Makefile
multimedia/gstreamer1/patches/010-gstplugin_use_lazy_symbol_binding.patch [new file with mode: 0644]
multimedia/icecast/Makefile
multimedia/minidlna/Makefile
multimedia/minidlna/patches/020-makefileam-tweaks.patch [deleted file]
multimedia/minidlna/patches/030-upnphttp-fixPhilips.patch [deleted file]
multimedia/mjpg-streamer/Makefile
multimedia/mjpg-streamer/files/mjpg-streamer.config
multimedia/mjpg-streamer/files/mjpg-streamer.init
multimedia/motion/Makefile
multimedia/motion/patches/002-honor_cppflags.patch [deleted file]
multimedia/shairplay/Makefile [new file with mode: 0644]
multimedia/shairplay/files/shairplay.config [new file with mode: 0644]
multimedia/shairplay/files/shairplay.init [new file with mode: 0644]
multimedia/shairplay/patches/001-key_file_dir.patch [new file with mode: 0644]
multimedia/shairplay/patches/002-libavahi-compat-dnssd.patch [new file with mode: 0644]
multimedia/shairplay/patches/003-fix_big-endian.patch [new file with mode: 0644]
multimedia/shairport/Makefile
multimedia/shairport/files/shairport.config
multimedia/shairport/files/shairport.init
multimedia/upmpdcli/Makefile [new file with mode: 0644]
multimedia/upmpdcli/files/upmpdcli.init [new file with mode: 0644]
net/bcp38/Makefile [new file with mode: 0644]
net/bcp38/files/bcp38.config [new file with mode: 0644]
net/bcp38/files/bcp38.defaults [new file with mode: 0644]
net/bcp38/files/run.sh [new file with mode: 0755]
net/bind/Makefile
net/bind/files/named.init
net/bmon/Makefile [new file with mode: 0644]
net/coova-chilli/Config.in [new file with mode: 0644]
net/coova-chilli/Makefile [new file with mode: 0644]
net/coova-chilli/files/chilli.hotplug [new file with mode: 0644]
net/coova-chilli/patches/100-fix-sysinfo-redeclaration.patch [new file with mode: 0644]
net/ddns-scripts/CHANGELOG [new file with mode: 0644]
net/ddns-scripts/Makefile
net/ddns-scripts/files/etc/config/ddns
net/ddns-scripts/files/etc/config/ddns.sample
net/ddns-scripts/files/etc/hotplug.d/iface/25-ddns [deleted file]
net/ddns-scripts/files/etc/hotplug.d/iface/95-ddns [new file with mode: 0644]
net/ddns-scripts/files/etc/init.d/ddns
net/ddns-scripts/files/usr/lib/ddns/create_cert_hashes.sh [deleted file]
net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh [changed mode: 0644->0755]
net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_lucihelper.sh [new file with mode: 0755]
net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh
net/ddns-scripts/files/usr/lib/ddns/getlocalip_sample.sh [new file with mode: 0755]
net/ddns-scripts/files/usr/lib/ddns/services
net/ddns-scripts/files/usr/lib/ddns/services_ipv6
net/ddns-scripts/files/usr/lib/ddns/update_cloudflare.sh [new file with mode: 0644]
net/ddns-scripts/files/usr/lib/ddns/update_no-ip.sh [new file with mode: 0644]
net/ddns-scripts/files/usr/lib/ddns/update_sample.sh
net/dmapd/Makefile
net/ethtool/Makefile
net/fastd/Config.in
net/fastd/Makefile
net/fastd/files/fastd.config [deleted file]
net/fastd/files/fastd.init [deleted file]
net/freeradius2/Makefile
net/freeradius2/patches/010-disbale-openssl-check.patch
net/fwknop/Makefile
net/fwknop/patches/001-fix_config.patch
net/git/Makefile
net/git/patches/100-convert_builtin.patch
net/haproxy/Makefile
net/haproxy/patches/0001-BUG-MEDIUM-patterns-previous-fix-was-incomplete.patch [new file with mode: 0644]
net/haproxy/patches/0001-BUG-MEDIUM-systemd-set-KillMode-to-mixed.patch [deleted file]
net/haproxy/patches/0002-BUG-MEDIUM-config-avoid-skipping-disabled-proxies.patch [deleted file]
net/haproxy/patches/0002-BUG-MEDIUM-payload-ensure-that-a-request-channel-is-.patch [new file with mode: 0644]
net/horst/Makefile
net/ipsec-tools/Makefile
net/ipsec-tools/files/racoon.conf [new file with mode: 0644]
net/ipsec-tools/files/racoon.init
net/irssi/Makefile
net/kismet/Makefile [new file with mode: 0644]
net/kismet/files/kismet.conf [new file with mode: 0644]
net/kismet/files/kismet_drone.conf [new file with mode: 0644]
net/kismet/files/kismet_drone.config [new file with mode: 0644]
net/kismet/files/kismet_drone.init [new file with mode: 0755]
net/kismet/files/kismet_server.config [new file with mode: 0644]
net/kismet/files/kismet_server.init [new file with mode: 0755]
net/kismet/patches/010-dont-add-host-include-paths.patch [new file with mode: 0644]
net/knot/Makefile
net/krb5/Makefile
net/lftp/Makefile
net/lighttpd/Makefile
net/luci-app-bcp38/Makefile [new file with mode: 0644]
net/luci-app-bcp38/files/bcp38-cbi.lua [new file with mode: 0644]
net/luci-app-bcp38/files/bcp38-controller.lua [new file with mode: 0644]
net/luci-app-bcp38/files/uci-defaults-bcp38 [new file with mode: 0755]
net/luci-app-ocserv/Makefile [deleted file]
net/luci-app-ocserv/files/usr/lib/lua/luci/controller/ocserv.lua [deleted file]
net/luci-app-ocserv/files/usr/lib/lua/luci/model/cbi/ocserv/main.lua [deleted file]
net/luci-app-ocserv/files/usr/lib/lua/luci/model/cbi/ocserv/user-config.lua [deleted file]
net/luci-app-ocserv/files/usr/lib/lua/luci/model/cbi/ocserv/users.lua [deleted file]
net/luci-app-ocserv/files/usr/lib/lua/luci/view/admin_status/index/ocserv.htm [deleted file]
net/luci-app-ocserv/files/usr/lib/lua/luci/view/ocserv_status.htm [deleted file]
net/luci-app-sqm/Makefile [new file with mode: 0644]
net/luci-app-sqm/files/sqm-cbi.lua [new file with mode: 0644]
net/luci-app-sqm/files/sqm-controller.lua [new file with mode: 0644]
net/luci-app-sqm/files/uci-defaults-sqm [new file with mode: 0644]
net/luci-proto-openconnect/Makefile [deleted file]
net/luci-proto-openconnect/files/usr/lib/lua/luci/model/cbi/admin_network/proto_openconnect.lua [deleted file]
net/luci-proto-openconnect/files/usr/lib/lua/luci/model/network/proto_openconnect.lua [deleted file]
net/mdnsresponder/Makefile
net/mosquitto/Makefile
net/net-snmp/files/snmpd.init
net/nfs-kernel-server/Makefile
net/nfs-kernel-server/patches/100-nfs_utils_uclibc.patch [deleted file]
net/nfs-kernel-server/patches/100-no_malloc_h.patch [new file with mode: 0644]
net/nfs-kernel-server/patches/101-no_malloc_h.patch [deleted file]
net/nmap/Makefile
net/ntpd/Makefile
net/nut/Config.in [new file with mode: 0644]
net/nut/Makefile [new file with mode: 0644]
net/nut/files/nut-monitor.init [new file with mode: 0755]
net/nut/files/nut-server.init [new file with mode: 0755]
net/nut/patches/001-fix-missing-libmath-flags.patch [new file with mode: 0644]
net/nut/patches/010-ignore_automake_k_bug.patch [new file with mode: 0644]
net/ocserv/Config.in
net/ocserv/Makefile
net/ocserv/files/ocserv.conf.template
net/ocserv/files/ocserv.init
net/openconnect/Config.in
net/openconnect/Makefile
net/openconnect/README
net/openconnect/files/openconnect-wrapper
net/openconnect/files/openconnect.sh
net/openconnect/patches/001-Added-a-default-timeout-value-in-CSTP-handshake-usin.patch [deleted file]
net/openconnect/patches/001-always-resolve-ips.patch [new file with mode: 0644]
net/openssh/Makefile
net/openssh/files/sftp-ssh.service [new file with mode: 0644]
net/openssh/patches/100-no_cast_fix.patch
net/opentracker/Makefile
net/opentracker/patches/100-makefile.patch
net/openvswitch/Makefile
net/openvswitch/patches/0004-datapath-Use-ccflags-y-instead-of-deprecated-EXTRA_C.patch [new file with mode: 0644]
net/openvswitch/patches/0005-datapath-backport___ip_select_ident_function.patch [new file with mode: 0644]
net/privoxy/Makefile [new file with mode: 0644]
net/privoxy/files/privoxy.config [new file with mode: 0644]
net/privoxy/files/privoxy.init [new file with mode: 0644]
net/privoxy/files/privoxy.oldconfig [new file with mode: 0644]
net/prosody/Makefile
net/rtorrent/Makefile
net/socat/Makefile
net/sqm-scripts/Makefile [new file with mode: 0644]
net/sqm-scripts/files/etc/config/sqm [new file with mode: 0644]
net/sqm-scripts/files/etc/init.d/sqm [new file with mode: 0755]
net/sqm-scripts/files/usr/lib/sqm/functions.sh [new file with mode: 0644]
net/sqm-scripts/files/usr/lib/sqm/run.sh [new file with mode: 0755]
net/sqm-scripts/files/usr/lib/sqm/simple.qos [new file with mode: 0755]
net/sqm-scripts/files/usr/lib/sqm/simple.qos.help [new file with mode: 0644]
net/sqm-scripts/files/usr/lib/sqm/simple_pppoe.qos [new file with mode: 0755]
net/sqm-scripts/files/usr/lib/sqm/simple_pppoe.qos.help [new file with mode: 0644]
net/sqm-scripts/files/usr/lib/sqm/simplest.qos [new file with mode: 0755]
net/sqm-scripts/files/usr/lib/sqm/simplest.qos.help [new file with mode: 0644]
net/sqm-scripts/files/usr/lib/sqm/stop.sh [new file with mode: 0755]
net/strongswan/Makefile
net/tcpproxy/Makefile
net/tgt/Makefile
net/tor/Makefile
net/uanytun/Makefile
net/udpxy/Makefile
net/udpxy/files/udpxy.conf
net/udpxy/files/udpxy.init
net/ulogd/Makefile
net/unbound/Makefile
net/wget/Makefile
net/znc/Makefile
net/znc/patches/002-Uclibcpp_build_fix.patch [deleted file]
net/znc/patches/900-remove_cpp11_usage.patch [deleted file]
sound/espeak/Makefile [new file with mode: 0644]
sound/espeak/patches/101-portaudio.patch [new file with mode: 0644]
sound/forked-daapd/Makefile [new file with mode: 0644]
sound/forked-daapd/files/forked-daapd.conf [new file with mode: 0644]
sound/forked-daapd/files/forked-daapd.init [new file with mode: 0644]
sound/forked-daapd/patches/010-include_pregen.patch [new file with mode: 0644]
sound/mocp/Makefile
sound/mpd/Makefile
sound/mpd/files/mpd.service
sound/portaudio/Makefile [new file with mode: 0644]
sound/sox/Makefile
sound/sox/patches/020-ffmpeg-2.x.patch
utils/bash/Makefile
utils/btrfs-progs/Makefile [new file with mode: 0644]
utils/btrfs-progs/files/btrfs-scan.init [new file with mode: 0644]
utils/btrfs-progs/patches/001-fix-xattr-h-include-location.patch [new file with mode: 0644]
utils/ccid/Makefile
utils/cmdpad/Makefile
utils/collectd/Makefile
utils/coreutils/Makefile
utils/coreutils/patches/001-no_docs_man_tests.patch
utils/coreutils/patches/002-fix_compile_with_uclibc.patch
utils/coreutils/patches/010-fix-gets-removal.patch [deleted file]
utils/cryptsetup/Makefile [new file with mode: 0644]
utils/dbus/Makefile
utils/dump1090/Makefile
utils/dump1090/files/dump1090.config [new file with mode: 0644]
utils/dump1090/files/dump1090.init [new file with mode: 0644]
utils/f2fs-tools/Config.in [new file with mode: 0644]
utils/f2fs-tools/Makefile [new file with mode: 0644]
utils/f2fs-tools/patches/001-compile.patch [new file with mode: 0644]
utils/gammu/Makefile [new file with mode: 0644]
utils/gammu/files/gammurc [new file with mode: 0644]
utils/gammu/patches/001-iconv-disabling-option.patch [new file with mode: 0644]
utils/gammu/patches/002-no-fstack-protector.patch [new file with mode: 0644]
utils/gammu/patches/003-cmake-cross-toolchain.patch [new file with mode: 0644]
utils/gammu/patches/010-utils-shell-fix.patch [new file with mode: 0644]
utils/gnupg/Makefile
utils/haserl/Makefile
utils/hd-idle/Makefile
utils/hdparm/Makefile [new file with mode: 0644]
utils/hdparm/patches/001-fix-includes.patch [new file with mode: 0644]
utils/luci-app-lxc/Makefile [new file with mode: 0644]
utils/luci-app-lxc/files/controller/lxc.lua [new file with mode: 0644]
utils/luci-app-lxc/files/lxc.config [new file with mode: 0644]
utils/luci-app-lxc/files/model/cbi/lxc.lua [new file with mode: 0644]
utils/luci-app-lxc/files/view/lxc.htm [new file with mode: 0644]
utils/luci-app-lxc/files/www/luci-static/resources/cbi/green.gif [new file with mode: 0644]
utils/luci-app-lxc/files/www/luci-static/resources/cbi/purple.gif [new file with mode: 0644]
utils/luci-app-lxc/files/www/luci-static/resources/cbi/red.gif [new file with mode: 0644]
utils/lvm2/Makefile [new file with mode: 0644]
utils/lvm2/files/lvm2.init [new file with mode: 0644]
utils/lvm2/patches/000-compile.patch [new file with mode: 0644]
utils/lvm2/patches/001-include_fix.patch [new file with mode: 0644]
utils/lxc/Config.in
utils/lxc/Makefile
utils/lxc/files/lxc.conf [new file with mode: 0644]
utils/lxc/patches/025-remove-unsupported-option.patch [new file with mode: 0644]
utils/lxc/patches/300-fix-lxc-destroy.patch [new file with mode: 0644]
utils/lxc/patches/301-add-openwrt-common-config.patch [new file with mode: 0644]
utils/mc/Config.in [new file with mode: 0644]
utils/mc/Makefile [new file with mode: 0644]
utils/mpack/Makefile [new file with mode: 0644]
utils/ntfs-3g/Makefile
utils/open-plc-utils/Makefile [new file with mode: 0644]
utils/opensc/Makefile
utils/opensc/patches/0001-OpenPGP-Detect-and-support-Gnuk-Token.patch
utils/opensc/patches/0002-OpenPGP-Add-Gnuk-in-pkcs15-emulation-layer.patch
utils/opensc/patches/0003-OpenPGP-Include-private-DO-to-filesystem-at-driver-i.patch
utils/opensc/patches/0004-PKCS15-OpenPGP-Declare-DATA-objects.patch
utils/opensc/patches/0005-OpenPGP-Support-erasing-reset-card.patch
utils/opensc/patches/0006-openpgp-tool-Support-deleting-key-in-Gnuk.patch
utils/opensc/patches/0007-OpenPGP-Correct-building-Extended-Header-List-when-i.patch
utils/opensc/patches/0008-OpenPGP-Read-some-empty-DOs-from-Gnuk.patch
utils/opensc/patches/0009-PKCS15-OpenPGP-Do-not-show-empty-DO-in-pkcs15-emu_in.patch
utils/opensc/patches/0010-PKCS15-OpenPGP-Allow-to-store-data-to-pkcs15-data-ob.patch
utils/opensc/patches/0011-OpenPGP-Provide-enough-buffer-to-read-pubkey-from-Gn.patch
utils/opensc/patches/0012-OpenPGP-Support-write-certificate-for-Gnuk.patch
utils/opensc/patches/0013-pkcs15-openpgp-Change-to-sc_put_data-instead-of-sc_u.patch
utils/opensc/patches/0014-OpenPGP-Overcome-the-restriction-of-even-data-length.patch
utils/opensc/patches/0015-OpenPGP-Delete-key-as-file-for-Gnuk.patch
utils/opensc/patches/0016-OpenPGP-Correct-parameter-checking.patch
utils/opensc/patches/0017-OpenPGP-Make-code-neater.patch
utils/opensc/patches/0018-Move-declaration-to-top-of-block.patch
utils/opensc/patches/0019-OpenPGP-Make-indentation-consistent-space-tab.patch [new file with mode: 0644]
utils/opensc/patches/0020-OpenPGP-Don-t-use-sc_log-in-openpgp-tool.patch [new file with mode: 0644]
utils/opensc/patches/0021-OpenPGP-Don-t-reimplement-gnuk_delete_key-in-openpgp.patch [new file with mode: 0644]
utils/opensc/patches/0022-OpenPGP-Use-directly-binary-array-of-APDUs-for-ERASE.patch [new file with mode: 0644]
utils/opensc/patches/0023-OpenPGP-Rename-private-blob-type-to-avoid-confusing-.patch [new file with mode: 0644]
utils/opensc/patches/0024-OpenPGP-Fix-crash-after-accessing-inexistent-file.patch [new file with mode: 0644]
utils/opensc/patches/0025-Replace-hardcode.patch [new file with mode: 0644]
utils/opensc/patches/0026-hardcode-defines-for-DO-s.patch [new file with mode: 0644]
utils/opus-tools/Makefile
utils/pciutils/Makefile
utils/pciutils/patches/101-no-strip.patch
utils/pciutils/patches/103-relative-path-ids.patch
utils/pciutils/patches/104-resolv.patch
utils/pcsc-lite/Makefile
utils/rpcd-mod-lxc/Makefile [new file with mode: 0644]
utils/rpcd-mod-lxc/files/CMakeLists.txt [new file with mode: 0644]
utils/rpcd-mod-lxc/files/lxc.c [new file with mode: 0644]
utils/rrdtool1/Makefile
utils/sispmctl/Makefile [new file with mode: 0644]
utils/sispmctl/patches/001-fix-includes.patch [new file with mode: 0644]
utils/stm32flash/Makefile
utils/stoken/Makefile [new file with mode: 0644]
utils/tcsh/Makefile
utils/tracertools/Makefile
utils/triggerhappy/Makefile
utils/unrar/Makefile
utils/unrar/patches/100-makefile_fixes.patch
utils/usbmuxd/Makefile
utils/zile/Makefile
utils/zoneinfo/Makefile [new file with mode: 0644]

index f28aea38f3021a70043954c59f00b9eb24125656..1deef680462dd8c5799ab6d17c208d0f0a69b421 100644 (file)
@@ -16,8 +16,8 @@ Makefile contents should contain:
     (E.g.: PKG_MAINTAINER:= Joe D. Hacker `<jdh@jdhs-email-provider.org`>)
 * A PKG_LICENSE tag declaring the main license of the package.
     (E.g.: PKG_LICENSE:=GPL-2.0+) Please use SPDX identifiers if possible (see list at the bottom).
-* An optional PKG_LICENSE_FILE including the filename of the license-file in the source-package.
-    (E.g.: PKG_LICENSE_FILE:=COPYING)
+* An optional PKG_LICENSE_FILES including the filename of the license-file in the source-package.
+    (E.g.: PKG_LICENSE_FILES:=COPYING)
 
 Commits and pull-requests:
 
index 461e5a4be27890142b404f2c73b33706af3d912e..50d0cbda0693ab14f1132ce95720986218c5850b 100644 (file)
@@ -9,13 +9,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=debootstrap
-PKG_VERSION:=1.0.63
+PKG_VERSION:=1.0.66
 PKG_RELEASE:=1
 PKG_MAINTAINER=Daniel Golle <daniel@makrotopia.org>
 
 PKG_SOURCE:=$(PKG_NAME)-udeb_$(PKG_VERSION)_all.udeb
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/d/debootstrap
-PKG_MD5SUM:=7bd6a1ad6721cc7d8c9ac637ae478df4
+PKG_MD5SUM:=bf6370ea0aa80308dfb03a4a35e33ad1
 PKG_LICENSE:=Unique
 PKG_LICENSE_FILES:=debian/copyright
 
index cc56725581c0236f92f47a04f9f30263bd1b0743..9695b3d7416eeeb936659bbdc7d6606c856d8bca 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=monit
-PKG_VERSION:=5.9
+PKG_VERSION:=5.10
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://mmonit.com/monit/dist
-PKG_MD5SUM:=808473ebbacda0c5085d7399e507bfda
+PKG_MD5SUM:=5b5b5cc7939b975bbbef73bd6426750a
 
 PKG_LICENSE:=AGPL-3.0
 PKG_LICENSE_FILES:=COPYING
index 1b8a97fb4cf90a54345e1aff8a8f1990bf874be9..148ed77a55be6faf92e8c55ee9e911e4b57a137e 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zabbix
-PKG_VERSION:=2.4.0
+PKG_VERSION:=2.4.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/zabbix
-PKG_MD5SUM:=57d9bf72bf0732971e4540a402bfc6c6
+PKG_MD5SUM:=50530e52c08d4a81f9e6e781f1a170ca
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
diff --git a/admin/zabbix/patches/001-cross_compile.patch b/admin/zabbix/patches/001-cross_compile.patch
deleted file mode 100644 (file)
index 77b9fe3..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -824,25 +824,8 @@ dnl ************************************
- dnl Check for %qu format (FreeBSD 4.x)
- dnl FreeBSD 4.x does not support %llu
--AC_MSG_CHECKING(for long long format)
--AC_TRY_RUN(
--[
--#include <sys/types.h>
--int main()
--{
--        uint64_t i;
--
--        sscanf("200000000010020", "%qu", &i);
--
--        if (i == 200000000010020) return 0;
--        else return -1;
--}
--],
--AC_DEFINE(HAVE_LONG_LONG_QU, 1 ,[Define to 1 if format '%qu' exists.])
--AC_MSG_RESULT(yes),
--AC_MSG_RESULT(no))
--
- dnl option -rdynamic is needed for readable backtraces
-+
- AC_MSG_CHECKING(for -rdynamic linking option)
- saved_LDFLAGS="$LDFLAGS"
- LDFLAGS="-rdynamic $LDFLAGS"
diff --git a/devel/gcc/patches/020-disable-check-for-sys-sdt-h.patch b/devel/gcc/patches/020-disable-check-for-sys-sdt-h.patch
new file mode 100644 (file)
index 0000000..afc5cfd
--- /dev/null
@@ -0,0 +1,45 @@
+diff --git a/gcc/configure b/gcc/configure
+index 3793681..bcda752 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -26876,19 +26876,6 @@ $as_echo "#define TARGET_LIBC_PROVIDES_SSP 1" >>confdefs.h
+ fi
+-# Test for <sys/sdt.h> on the target.
+-
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
+-$as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
+-have_sys_sdt_h=no
+-if test -f $target_header_dir/sys/sdt.h; then
+-  have_sys_sdt_h=yes
+-
+-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
+-
+-fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
+-$as_echo "$have_sys_sdt_h" >&6; }
+ # Check if TFmode long double should be used by default or not.
+ # Some glibc targets used DFmode long double, but with glibc 2.4
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 3ee1d67..e321218 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4796,16 +4796,6 @@ if test x$gcc_cv_libc_provides_ssp = xyes; then
+           [Define if your target C library provides stack protector support])
+ fi
+-# Test for <sys/sdt.h> on the target.
+-GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
+-AC_MSG_CHECKING(sys/sdt.h in the target C library)
+-have_sys_sdt_h=no
+-if test -f $target_header_dir/sys/sdt.h; then
+-  have_sys_sdt_h=yes
+-  AC_DEFINE(HAVE_SYS_SDT_H, 1,
+-            [Define if your target C library provides sys/sdt.h])
+-fi
+-AC_MSG_RESULT($have_sys_sdt_h)
+ # Check if TFmode long double should be used by default or not.
+ # Some glibc targets used DFmode long double, but with glibc 2.4
index bfa8a83206c2f09c417ea2889a40ced1715fea54..50839f359a3c2794e7a16ac0c295a4c015f4dc19 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=aiccu
 PKG_VERSION:=20070115
-PKG_RELEASE:=11
+PKG_RELEASE:=12
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.sixxs.net/archive/sixxs/aiccu/unix
@@ -47,9 +47,10 @@ define Package/aiccu/conffiles
 endef
 
 define Package/aiccu/install
-       $(INSTALL_DIR) $(1)/usr/sbin $(1)/lib/netifd/proto
+       $(INSTALL_DIR) $(1)/usr/sbin $(1)/lib/netifd/proto $(1)/etc/hotplug.d/ntp
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/unix-console/$(PKG_NAME) $(1)/usr/sbin/
        $(INSTALL_BIN) ./files/aiccu.sh $(1)/lib/netifd/proto/aiccu.sh
+       $(INSTALL_DATA) ./files/aiccu.hotplug $(1)/etc/hotplug.d/ntp/10-aiccu
 endef
 
 $(eval $(call BuildPackage,aiccu))
diff --git a/ipv6/aiccu/files/aiccu.hotplug b/ipv6/aiccu/files/aiccu.hotplug
new file mode 100644 (file)
index 0000000..b521371
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+NTPSTRATUMFILE="/var/run/aiccu_ntp_stratum"
+echo $stratum > "$NTPSTRATUMFILE"
index 669e0e257fbbc215c7e106d48e82dea481992185..38d8191f502fdc3ab9e3e1508238532081c874c3 100755 (executable)
@@ -14,8 +14,8 @@ proto_aiccu_setup() {
        local iface="$2"
        local link="aiccu-$cfg"
 
-       local username password protocol server ip6prefix tunnelid requiretls defaultroute nat heartbeat verbose sourcerouting ip6addr
-       json_get_vars username password protocol server ip6prefix tunnelid requiretls defaultroute nat heartbeat verbose sourcerouting ip6addr
+       local username password protocol server ip6prefix tunnelid requiretls defaultroute nat heartbeat verbose sourcerouting ip6addr ntpsynctimeout
+       json_get_vars username password protocol server ip6prefix tunnelid requiretls defaultroute nat heartbeat verbose sourcerouting ip6addr ntpsynctimeout
 
        [ -z "$username" -o -z "$password" ] && {
                proto_notify_error "$cfg" "MISSING_USERNAME_OR_PASSWORD"
@@ -27,21 +27,32 @@ proto_aiccu_setup() {
 
        CFGFILE="/var/etc/${link}.conf"
        PIDFILE="/var/run/${link}.pid"
+       NTPSTRATUMFILE="/var/run/aiccu_ntp_stratum"
        mkdir -p /var/run /var/etc
 
        echo "username $username" > "$CFGFILE"
        echo "password $password" >> "$CFGFILE"
-       echo "ipv6_interface $link"   >> "$CFGFILE"
+       echo "ipv6_interface $link" >> "$CFGFILE"
        [ -n "$server" ] && echo "server $server" >> "$CFGFILE"
        [ -n "$protocol" ] && echo "protocol $protocol" >> "$CFGFILE"
-       [ -n "$tunnelid" ] && echo "tunnel_id $tunnelid"          >> "$CFGFILE"
-       [ -n "$requiretls" ] && echo "requiretls $requiretls"      >> "$CFGFILE"
-       [ "$nat" == 1 ] && echo "behindnat true"     >> "$CFGFILE"
-       [ "$heartbeat"  == 1 ] && echo "makebeats true" >> "$CFGFILE"
+       [ -n "$tunnelid" ] && echo "tunnel_id $tunnelid" >> "$CFGFILE"
+       [ -n "$requiretls" ] && echo "requiretls $requiretls" >> "$CFGFILE"
+       [ "$nat" == 1 ] && echo "behindnat true" >> "$CFGFILE"
+       [ "$heartbeat" == 1 ] && echo "makebeats true" >> "$CFGFILE"
        [ "$verbose" == 1 ] && echo "verbose true" >> "$CFGFILE"
        echo "defaultroute false" >> "$CFGFILE"
-       echo "daemonize true"     >> "$CFGFILE"
-       echo "pidfile $PIDFILE"   >> "$CFGFILE"
+       echo "daemonize true" >> "$CFGFILE"
+       echo "pidfile $PIDFILE" >> "$CFGFILE"
+
+       # By default, wait at most 90 seconds for NTP sync
+       [ -z "$ntpsynctimeout" ] && ntpsynctimeout=90
+       for i in $(seq 1 $ntpsynctimeout); do
+               [ -f "$NTPSTRATUMFILE" ] && \
+               [ "$(cat $NTPSTRATUMFILE)" -lt 16 ] && \
+               echo "NTP synced, stratum $(cat $NTPSTRATUMFILE)" && break
+               [ "$(( $i % 10 ))" -eq 0 ] && echo "Waiting ${i} secs for NTP sync..."
+               sleep 1
+       done
 
        aiccu start "$CFGFILE"
 
@@ -78,8 +89,12 @@ proto_aiccu_teardown() {
        local cfg="$1"
        local link="aiccu-$cfg"
        CFGFILE="/var/etc/${link}.conf"
-
-       aiccu stop "$CFGFILE"
+       PIDFILE="/var/run/${link}.pid"
+       [ -f "$CFGFILE" -a -f "$PIDFILE" ] && {
+               local pid="$(cat "$PIDFILE")"
+               [ -d /proc/$pid -a $(cat /proc/$pid/comm) = "aiccu" ] && \
+               aiccu stop "$CFGFILE"
+       }
 }
 
 proto_aiccu_init_config() {
@@ -98,6 +113,7 @@ proto_aiccu_init_config() {
        proto_config_add_boolean "nat"
        proto_config_add_boolean "heartbeat"
        proto_config_add_boolean "verbose"
+       proto_config_add_int "ntpsynctimeout"
 }
 
 [ -n "$INCLUDE_ONLY" ] || {
index c7a7d8729cd848750edf88af2b5ea80b5634cd54..4a6422874bdb2e66db985e15fe707f0fc3f43272 100644 (file)
@@ -13,7 +13,6 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://dkolf.de/src/dkjson-lua.fsl/tarball/
-PKG_BUILD_DIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_MD5SUM:=dbe706722dd64308172cf8e37395e762
 PKG_LICENSE:=MIT
 
index 1bf17f3347c165f08f0a09a4face7e34bf87d78f..b6193af75a76ba9a7dc07e5ca9e44054a889f6b3 100644 (file)
@@ -8,16 +8,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=erlang
-PKG_VERSION:=17.1
+PKG_VERSION:=17.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=otp_src_$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= http://www.erlang.org/download/ \
        http://erlang.mirror.su.se/
-PKG_MD5SUM:=9c90706ce70e01651adde34a2b79bf4c
+PKG_MD5SUM:=1d0bb2d54dfe1bb6844756b99902ba20
 
 PKG_LICENSE:=ErlPL-1.1
-PKG_LICENSE_FILE:=EPLICENCE
+PKG_LICENSE_FILES:=EPLICENCE
 PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
 
 PKG_BUILD_DEPENDS:=erlang/host openssl
index 513fa247d318068c1e4261796a59b9f90dae6fdc..6df105dc73e2fba075a24568ab607319e56ab11f 100644 (file)
@@ -8,15 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=luasql
-PKG_VERSION:=2.1.1
+PKG_VERSION:=2.3.0
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://files.luaforge.net/releases/luasql/luasql
-PKG_MD5SUM:=63bdd57de4b9d1be336ba112d8cb69eb
+PKG_SOURCE:=v$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/keplerproject/luasql/archive/
+PKG_MD5SUM:=af9f0f3a2313a1fcf88c40700092048d
 
 PKG_LICENSE:=MIT
-PKG_LICENSE_FILE:=docs/us/license.html
+PKG_LICENSE_FILES:=docs/us/license.html
 PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
index a737192c7c5e46ce625dca8e3c1d324bda3a8a4d..b74ad0e08d70a22a1fb38d34dbaa2f9b56567159 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=micropython-lib
-PKG_VERSION=0.1-20140822-$(PKG_SOURCE_VERSION)
+PKG_VERSION=0.1-20141028-$(PKG_SOURCE_VERSION)
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
@@ -17,7 +17,7 @@ PKG_LICENSE_FILES:=LICENSE
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/micropython/micropython-lib.git
-PKG_SOURCE_VERSION:=46ede279d8fae081319914d00cb4a9bb22102fa1
+PKG_SOURCE_VERSION:=610aa65ceff9f4b0a60514423f543aa807f49f76
 
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
@@ -27,6 +27,7 @@ PKG_BUILD_PARALLEL:=1
 include $(INCLUDE_DIR)/package.mk
 
 define Package/micropython-lib
+    SUBMENU:=Python
     SECTION:=lang
     CATEGORY:=Languages
     TITLE:=micropython-lib
index e73ca7afc2dd1df38b9a00cdc0e15ffc2a1dbcc4..c1904567c1a1d602a330ad5a5e9124cb2cf4b678 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=micropython
-PKG_VERSION=1.3.3-20141006-$(PKG_SOURCE_VERSION)
+PKG_VERSION=1.3.7-20141209-$(PKG_SOURCE_VERSION)
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
@@ -17,7 +17,7 @@ PKG_LICENSE_FILES:=LICENSE
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/micropython/micropython.git
-PKG_SOURCE_VERSION:=67f25dfe6f4b13a3b8d40746d2b2fd720c63caed
+PKG_SOURCE_VERSION:=e6e8ad8ab238cd596a3eedf8f4dd635e2e84f46e
 
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
@@ -27,6 +27,7 @@ PKG_BUILD_PARALLEL:=1
 include $(INCLUDE_DIR)/package.mk
 
 define Package/micropython
+  SUBMENU:=Python
   SECTION:=lang
   CATEGORY:=Languages
   TITLE:=Micro Python
index 9f9430a6782f3e97746874d409fdc57bb794ff66..fefd3f52c3623c14d0bb73775988789902d1fb3b 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-compress-bzip2
-PKG_VERSION:=2.18
+PKG_VERSION:=2.19
 PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/R/RU/RURBAN/
 PKG_SOURCE:=Compress-Bzip2-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=c4a1995df9443cb97c28593cbbb23304
+PKG_MD5SUM:=dd4ebb4e88a50cc9a85e282618fdf88f
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 53c15066f7f852e922dd77d295856478d59aabcc..7af28ce22bba7e34ad69de540961aa01b957185b 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-dbi
-PKG_VERSION:=1.631
-PKG_RELEASE:=2
+PKG_VERSION:=1.632
+PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/T/TI/TIMB/
 PKG_SOURCE:=DBI-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=444d3c305e86597e11092b517794a840
+PKG_MD5SUM:=285fc34c1ee20125aabbd50bc3e587fb
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index 524bbd751d6cdcf1e7c499319dd281f87b85f2b8..59af42ae8a427c061a8271e5507edc44475803b0 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-test-harness
-PKG_VERSION:=3.33
+PKG_VERSION:=3.34
 PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/L/LE/LEONT/
 PKG_SOURCE:=Test-Harness-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=7a72849ee1e67184db098146cc7c8855
+PKG_MD5SUM:=aa0175e8fef92c19f06128810f1a2921
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
index d298dd98cd40f6aa1b7a8982d4b77543d33e7867..64cc10f1768ae60d252ea9d07590175fdc39949c 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-uri
-PKG_VERSION:=1.64
+PKG_VERSION:=1.65
 PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER/
 PKG_SOURCE:=URI-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=975b2282bc8f0fd72a6dae5cefc33824
+PKG_MD5SUM:=12c5d612a20ddd42041a5aa426f66269
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
diff --git a/lang/perl/Config.in b/lang/perl/Config.in
new file mode 100644 (file)
index 0000000..3cfa71d
--- /dev/null
@@ -0,0 +1,15 @@
+menu "Configuration"
+       depends on PACKAGE_perl
+
+config PERL_TESTS
+       bool "Include perl tests"
+       default n
+       help
+               Include test suites for all perl packages.
+               This will make perl related packages much bigger, so
+               use with care.
+               
+               Note: Test support is still in development. Some tests
+               still fail, others are just missing completely.
+
+endmenu
index edf3e4534564050d6aff86f160b4495f58211302..be4f773ef8315138189d285245d4bd54b3298f0d 100644 (file)
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl
-PKG_VERSION:=5.20.0
-PKG_RELEASE:=5
+PKG_VERSION:=5.20.1
+PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \
                http://www.cpan.org/src/5.0/perl-5.20.0.tar.gz \
@@ -20,7 +20,7 @@ PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \
                ftp://ftp.funet.fi/pub/languages/perl/CPAN/src/5.0 \
                http://ftp.funet.fi/pub/languages/perl/CPAN/src/5.0
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=406ec049ebe3afcc80d9c76ec78ca4f8
+PKG_MD5SUM:=7a195abb7d6769f751e90c7d30dcf2e0
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_LICENSE_FILES:=Copying Artistic README
@@ -44,6 +44,16 @@ endif
 TARGET_CFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CFLAGS))
 TARGET_CPPFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CPPFLAGS))
 
+# A list of disabled testss
+# ExtUtils tests are disabled for now as we don't support building
+# native extensions on the target machine at the moment
+PERL_DISABLEDTESTS:=cpan/ExtUtils-Constant cpan/ExtUtils-MakeMaker
+# We're on Linux, so don't even package those
+PERL_DISABLEDTESTS+=cpan/Win32API-File cpan/Win32 ext/VMS-DCLsym ext/VMS-Filespec ext/VMS-Stdio ext/Win32CORE
+# NDBM and ODBM not supported
+PERL_DISABLEDTESTS+=ext/NDBM_File ext/ODBM_File
+
+
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/host-build.mk
 include perlmod.mk
@@ -63,6 +73,10 @@ define Package/perl/description
   and is widely used to program web applications of all needs.
 endef
 
+define Package/perl/config
+       source "$(SOURCE)/Config.in"
+endef
+
 # Static host perl
 define Host/Configure
        ( cd $(HOST_BUILD_DIR); ./Configure -der -Uusedl -Duserelocatableinc -Dprefix=$(HOST_PERL_PREFIX) )
@@ -128,3 +142,37 @@ $(eval $(call BuildPackage,perl))
 $(eval $(call HostBuild))
 
 -include perlbase.mk
+
+# A helper package that includes all sort of supplementary files for tests
+define Package/perl-tests-common
+$(call Package/perlbase-template)
+TITLE:=Common test support files
+DEPENDS:=@PERL_TESTS
+endef
+
+define Package/perl-tests-common/install
+       $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)
+       $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/Porting
+       $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/regen
+       $(INSTALL_DIR) $(1)/usr/lib/perl5/5.20/XS
+       $(INSTALL_DIR) $(1)/usr/lib/perl5/5.20/auto/XS
+       $(INSTALL_DIR) $(1)/usr/lib/perl5/5.20/unicore
+       
+       $(CP) $(PKG_BUILD_DIR)/t $(1)/$(PERL_TESTSDIR)
+       $(CP) $(PKG_BUILD_DIR)/Porting $(1)/$(PERL_TESTSDIR)
+       $(CP) $(PKG_BUILD_DIR)/regen $(1)/$(PERL_TESTSDIR)
+       $(CP) $(PKG_BUILD_DIR)/MANIFEST $(1)/$(PERL_TESTSDIR)
+       $(CP) $(PKG_BUILD_DIR)/TestInit.pm $(1)/$(PERL_TESTSDIR)
+       $(CP) $(PKG_BUILD_DIR)/vutil.c $(1)/$(PERL_TESTSDIR)
+       $(CP) $(PKG_BUILD_DIR)/vxs.inc $(1)/$(PERL_TESTSDIR)
+       $(CP) $(PKG_BUILD_DIR)/lib/XS $(1)/usr/lib/perl5/5.20/
+       $(CP) $(PKG_BUILD_DIR)/lib/auto/XS $(1)/usr/lib/perl5/5.20/auto
+       $(CP) $(PKG_BUILD_DIR)/lib/vmsish.pm $(1)/usr/lib/perl5/5.20/
+       $(CP) $(PKG_BUILD_DIR)/lib/unicore/TestProp.pl $(1)/usr/lib/perl5/5.20/unicore
+       $(CP) files/perl-run_tests.sh $(1)/$(PERL_TESTSDIR)/run_tests.sh
+       sed -e 's!%%PERL_DISABLEDTESTS%%!$(PERL_DISABLEDTESTS)!' -i $(1)/$(PERL_TESTSDIR)/run_tests.sh
+       $(CP) $(PKG_BUILD_DIR)/config_h.SH $(1)/$(PERL_TESTSDIR)
+       $(CP) $(PKG_BUILD_DIR)/perl.h $(1)/$(PERL_TESTSDIR)
+endef
+
+$(eval $(call BuildPackage,perl-tests-common))
index a23a6fdc6df601b02e68bab7082b034e0ee623d6..df6152edec1fe21e789cce14f7ac6c0c54a5bebf 100644 (file)
@@ -740,12 +740,12 @@ lib_ext='.a'
 libc=''
 libperl='libperl.so'
 libpth='%%LIBDIRS%%'
-libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc'
+libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'
 libsdirs='%%LIBDIRS%%'
-libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so'
-#libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
+libsfiles=' libdl.so libm.so libcrypt.so libutil.so libc.so'
+#libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
 libspath='%%LIBDIRS%%'
-libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD'
+libswanted='sfio socket inet nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD'
 libswanted_uselargefiles=''
 line=''
 lint=''
@@ -829,7 +829,7 @@ perl5=''
 perl=''
 perl_patchlevel=''
 perladmin='root@maia.dev.null'
-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%'
+perllibs='-ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%'
 perlpath='/usr/bin/perl'
 pg='pg'
 phostname='hostname'
@@ -949,7 +949,6 @@ stdio_stream_array=''
 strerror_r_proto='0'
 #strings='/usr/include/string.h'
 submit=''
-subversion='0'
 sysman='/usr/share/man/man1'
 tail=''
 tar=''
@@ -1050,8 +1049,6 @@ config_args='-der'
 config_argc=1
 config_arg1='-der'
 PERL_REVISION=5
-
-PERL_SUBVERSION=0
 PERL_API_REVISION=5
 
 PERL_API_SUBVERSION=0
@@ -1108,8 +1105,8 @@ i_stdbool='define'
 i_syspoll='define'
 #incpth='/usr/lib/gcc/i486-slackware-linux/4.8.2/include /usr/local/include /usr/lib/gcc/i486-slackware-linux/4.8.2/include-fixed /usr/include'
 ld_can_script='define'
-#libsfound=' /usr/lib/libnsl.so /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
-nv_overflows_integers_at='0'
+#libsfound=' /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
 perl_static_inline='static __inline__'
 sGMTIME_max='2147483647'
 sGMTIME_min='-2147483648'
@@ -1150,12 +1147,14 @@ privlib='/usr/lib/perl5/5.20'
 privlibexp='/usr/lib/perl5/5.20'
 archlib='/usr/lib/perl5/5.20'
 archlibexp='/usr/lib/perl5/5.20'
-version='5.20.0'
-version_patchlevel_string='version 20 subversion 0'
+version='5.20.1'
+version_patchlevel_string='version 20 subversion 1'
 PERL_VERSION=20
 PERL_API_VERSION=20
+PERL_SUBVERSION=1
 patchlevel='20'
 ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
+subversion='1'
 
 # Make perl use these tools instead of the target binaries during build.
 hostgenerate='%%HOSTGENERATE%%'
index aee8b2af63dbbce3592e8eaa7c8aed8374fb3b53..6c12a53666c0c8c122ed4ded6f49c6dcbcdae51e 100644 (file)
@@ -32,7 +32,6 @@ alignbytes='4'
 ansi2knr=''
 aphostname='/bin/hostname'
 api_revision='5'
-api_subversion='0'
 
 
 ar='ar'
@@ -740,12 +739,12 @@ lib_ext='.a'
 libc=''
 libperl='libperl.so'
 libpth='%%LIBDIRS%%'
-libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc'
+libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'
 libsdirs='%%LIBDIRS%%'
-libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so'
-#libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
+libsfiles=' libdl.so libm.so libcrypt.so libutil.so libc.so'
+#libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
 libspath='%%LIBDIRS%%'
-libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD'
+libswanted='sfio socket inet nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD'
 libswanted_uselargefiles=''
 line=''
 lint=''
@@ -829,7 +828,7 @@ perl5=''
 perl=''
 perl_patchlevel=''
 perladmin='root@maia.dev.null'
-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%'
+perllibs='-ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%'
 perlpath='/usr/bin/perl'
 pg='pg'
 phostname='hostname'
@@ -1050,8 +1049,6 @@ config_args='-der'
 config_argc=1
 config_arg1='-der'
 PERL_REVISION=5
-
-PERL_SUBVERSION=0
 PERL_API_REVISION=5
 
 PERL_API_SUBVERSION=0
@@ -1108,8 +1105,8 @@ i_stdbool='define'
 i_syspoll='define'
 #incpth='/usr/lib/gcc/i486-slackware-linux/4.8.2/include /usr/local/include /usr/lib/gcc/i486-slackware-linux/4.8.2/include-fixed /usr/include'
 ld_can_script='define'
-#libsfound=' /usr/lib/libnsl.so /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
-nv_overflows_integers_at='0'
+#libsfound=' /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
 perl_static_inline='static __inline__'
 sGMTIME_max='2147483647'
 sGMTIME_min='-2147483648'
@@ -1150,12 +1147,14 @@ privlib='/usr/lib/perl5/5.20'
 privlibexp='/usr/lib/perl5/5.20'
 archlib='/usr/lib/perl5/5.20'
 archlibexp='/usr/lib/perl5/5.20'
-version='5.20.0'
-version_patchlevel_string='version 20 subversion 0'
+version='5.20.1'
+version_patchlevel_string='version 20 subversion 1'
 PERL_VERSION=20
 PERL_API_VERSION=20
+PERL_SUBVERSION=0
 patchlevel='20'
 ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
+api_subversion='1'
 
 # Make perl use these tools instead of the target binaries during build.
 hostgenerate='%%HOSTGENERATE%%'
index 64542e8afda20090f0a8b13682e76cb6eeb58cce..33cfa69db30abde1e456ed8357af64887bf07736 100644 (file)
@@ -742,12 +742,12 @@ lib_ext='.a'
 libc=''
 libperl='libperl.so'
 libpth='%%LIBDIRS%%'
-libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc'
+libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'
 libsdirs='%%LIBDIRS%%'
-libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so'
-#libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
+libsfiles=' libdl.so libm.so libcrypt.so libutil.so libc.so'
+#libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
 libspath='%%LIBDIRS%%'
-libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD'
+libswanted='sfio socket inet nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD'
 libswanted_uselargefiles=''
 line=''
 lint=''
@@ -831,7 +831,7 @@ perl5=''
 perl=''
 perl_patchlevel=''
 perladmin='root@maia.dev.null'
-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%'
+perllibs='-ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%'
 perlpath='/usr/bin/perl'
 pg='pg'
 phostname='hostname'
@@ -951,7 +951,6 @@ stdio_stream_array=''
 strerror_r_proto='0'
 #strings='/usr/include/string.h'
 submit=''
-subversion='0'
 sysman='/usr/share/man/man1'
 tail=''
 tar=''
@@ -1052,8 +1051,6 @@ config_args='-der'
 config_argc=1
 config_arg1='-der'
 PERL_REVISION=5
-
-PERL_SUBVERSION=0
 PERL_API_REVISION=5
 
 PERL_API_SUBVERSION=0
@@ -1110,8 +1107,8 @@ i_stdbool='define'
 i_syspoll='define'
 #incpth='/usr/lib/gcc/i486-slackware-linux/4.8.2/include /usr/local/include /usr/lib/gcc/i486-slackware-linux/4.8.2/include-fixed /usr/include'
 ld_can_script='define'
-#libsfound=' /usr/lib/libnsl.so /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
-nv_overflows_integers_at='0'
+#libsfound=' /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
 perl_static_inline='static __inline__'
 sGMTIME_max='2147483647'
 sGMTIME_min='-2147483648'
@@ -1152,12 +1149,14 @@ privlib='/usr/lib/perl5/5.20'
 privlibexp='/usr/lib/perl5/5.20'
 archlib='/usr/lib/perl5/5.20'
 archlibexp='/usr/lib/perl5/5.20'
-version='5.20.0'
-version_patchlevel_string='version 20 subversion 0'
+version='5.20.1'
+version_patchlevel_string='version 20 subversion 1'
 PERL_VERSION=20
 PERL_API_VERSION=20
+PERL_SUBVERSION=1
 patchlevel='20'
 ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
+subversion='1'
 
 # Make perl use these tools instead of the target binaries during build.
 hostgenerate='%%HOSTGENERATE%%'
index f915fd84c0bfee902ea1779698b52f667ace6d94..b04fa4e7f18f68fe34b5264636502adeb959ad70 100644 (file)
@@ -733,12 +733,12 @@ lib_ext='.a'
 libc=''
 libperl='libperl.so'
 libpth='%%LIBDIRS%%'
-libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc'
+libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'
 libsdirs='%%LIBDIRS%%'
-libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so'
-#libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
+libsfiles=' libdl.so libm.so libcrypt.so libutil.so libc.so'
+#libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
 libspath='%%LIBDIRS%%'
-libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD'
+libswanted='sfio socket inet nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD'
 libswanted_uselargefiles=''
 line=''
 lint=''
@@ -820,7 +820,7 @@ perl5=''
 perl=''
 perl_patchlevel=''
 perladmin='root@maia.dev.null'
-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%'
+perllibs='-ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%'
 perlpath='/usr/bin/perl'
 pg='pg'
 phostname='hostname'
@@ -885,8 +885,8 @@ shortsize='2'
 shrpenv=''
 shsharp='true'
 sig_count='64'
-sig_name='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN NUM33 NUM34 NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 RTMAX IOT CLD POLL UNUSED '
-sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", "KILL", "USR1", "SEGV", "USR2", "PIPE", "ALRM", "TERM", "STKFLT", "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU", "URG", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "IO", "PWR", "SYS", "RTMIN", "NUM33", "NUM34", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "NUM48", "NUM49", "NUM50", "NUM51", "NUM52", "NUM53", "NUM54", "NUM55", "NUM56", "NUM57", "NUM58", "NUM59", "NUM60", "NUM61", "NUM62", "RTMAX", "IOT", "CLD", "POLL", "UNUSED", 0'
+sig_name='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS NUM32 NUM33 RTMIN NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 RTMAX IOT CLD POLL UNUSED '
+sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", "KILL", "USR1", "SEGV", "USR2", "PIPE", "ALRM", "TERM", "STKFLT", "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU", "URG", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "IO", "PWR", "SYS", "NUM32", "NUM33", "RTMIN", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "NUM48", "NUM49", "NUM50", "NUM51", "NUM52", "NUM53", "NUM54", "NUM55", "NUM56", "NUM57", "NUM58", "NUM59", "NUM60", "NUM61", "NUM62", "RTMAX", "IOT", "CLD", "POLL", "UNUSED", 0'
 sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 6 17 29 31 '
 sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 6, 17, 29, 31, 0'
 sig_size='68'
@@ -938,7 +938,6 @@ stdio_stream_array=''
 strerror_r_proto='0'
 #strings='/usr/include/string.h'
 submit=''
-subversion='0'
 sysman='/usr/share/man/man1'
 tail=''
 tar=''
@@ -1037,7 +1036,6 @@ config_args='-der'
 config_argc=1
 config_arg1='-der'
 PERL_REVISION=5
-PERL_SUBVERSION=0
 PERL_API_REVISION=5
 PERL_API_SUBVERSION=0
 PERL_PATCHLEVEL=
@@ -1093,8 +1091,8 @@ i_stdbool='define'
 i_syspoll='define'
 #incpth='/usr/lib/gcc/i486-slackware-linux/4.8.2/include /usr/local/include /usr/lib/gcc/i486-slackware-linux/4.8.2/include-fixed /usr/include'
 ld_can_script='define'
-#libsfound=' /usr/lib/libnsl.so /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
-nv_overflows_integers_at='0'
+#libsfound=' /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
 perl_static_inline='static __inline__'
 sGMTIME_max='2147483647'
 sGMTIME_min='-2147483648'
@@ -1135,12 +1133,14 @@ privlib='/usr/lib/perl5/5.20'
 privlibexp='/usr/lib/perl5/5.20'
 archlib='/usr/lib/perl5/5.20'
 archlibexp='/usr/lib/perl5/5.20'
-version='5.20.0'
-version_patchlevel_string='version 20 subversion 0'
+version='5.20.1'
+version_patchlevel_string='version 20 subversion 1'
 PERL_VERSION=20
 PERL_API_VERSION=20
+PERL_SUBVERSION=1
 patchlevel='20'
 ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
+subversion='1'
 
 # Make perl use these tools instead of the target binaries during build.
 hostgenerate='%%HOSTGENERATE%%'
index b0eb0fe06b5b93a088f1838bbac2c04c587d8994..75ae8c92b0ee9a8d668109d609fcbb6caafbc8f8 100644 (file)
@@ -740,12 +740,12 @@ lib_ext='.a'
 libc=''
 libperl='libperl.so'
 libpth='%%LIBDIRS%%'
-libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc'
+libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'
 libsdirs='%%LIBDIRS%%'
-libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so'
-#libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
+libsfiles=' libdl.so libm.so libcrypt.so libutil.so libc.so'
+#libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
 libspath='%%LIBDIRS%%'
-libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD'
+libswanted='sfio socket inet nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD'
 libswanted_uselargefiles=''
 line=''
 lint=''
@@ -829,7 +829,7 @@ perl5=''
 perl=''
 perl_patchlevel=''
 perladmin='root@merope.dev.null'
-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%'
+perllibs='-ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%'
 perlpath='/usr/bin/perl'
 pg='pg'
 phostname='hostname'
@@ -949,7 +949,6 @@ stdio_stream_array=''
 strerror_r_proto='0'
 #strings='/usr/include/string.h'
 submit=''
-subversion='0'
 sysman='/usr/share/man/man1'
 tail=''
 tar=''
@@ -1050,8 +1049,6 @@ config_args='-der'
 config_argc=1
 config_arg1='-der'
 PERL_REVISION=5
-
-PERL_SUBVERSION=0
 PERL_API_REVISION=5
 
 PERL_API_SUBVERSION=0
@@ -1108,8 +1105,8 @@ i_stdbool='define'
 i_syspoll='define'
 #incpth='/usr/lib/gcc/i486-slackware-linux/4.8.2/include /usr/local/include /usr/lib/gcc/i486-slackware-linux/4.8.2/include-fixed /usr/include'
 ld_can_script='define'
-#libsfound=' /usr/lib/libnsl.so /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
-nv_overflows_integers_at='0'
+#libsfound=' /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
 perl_static_inline='static __inline__'
 sGMTIME_max='2147483647'
 sGMTIME_min='-2147483648'
@@ -1150,12 +1147,14 @@ privlib='/usr/lib/perl5/5.20'
 privlibexp='/usr/lib/perl5/5.20'
 archlib='/usr/lib/perl5/5.20'
 archlibexp='/usr/lib/perl5/5.20'
-version='5.20.0'
-version_patchlevel_string='version 20 subversion 0'
+version='5.20.1'
+version_patchlevel_string='version 20 subversion 1'
 PERL_VERSION=20
 PERL_API_VERSION=20
+PERL_SUBVERSION=1
 patchlevel='20'
 ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
+subversion='1'
 
 # Make perl use these tools instead of the target binaries during build.
 hostgenerate='%%HOSTGENERATE%%'
index 557d9a19993464917f09871382472d0e0c42d312..86b6c64334b21b12c210f474568b8f029b204925 100644 (file)
@@ -733,12 +733,12 @@ lib_ext='.a'
 libc=''
 libperl='libperl.so'
 libpth='%%LIBDIRS%%'
-libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc'
+libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'
 libsdirs='%%LIBDIRS%%'
-libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so'
-#libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
+libsfiles=' libdl.so libm.so libcrypt.so libutil.so libc.so'
+#libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
 libspath='%%LIBDIRS%%'
-libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD'
+libswanted='sfio socket inet nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD'
 libswanted_uselargefiles=''
 line=''
 lint=''
@@ -820,7 +820,7 @@ perl5=''
 perl=''
 perl_patchlevel=''
 perladmin='root@merope.dev.null'
-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%'
+perllibs='-ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%'
 perlpath='/usr/bin/perl'
 pg='pg'
 phostname='hostname'
@@ -938,7 +938,6 @@ stdio_stream_array=''
 strerror_r_proto='0'
 #strings='/usr/include/string.h'
 submit=''
-subversion='0'
 sysman='/usr/share/man/man1'
 tail=''
 tar=''
@@ -1037,7 +1036,6 @@ config_args='-der'
 config_argc=1
 config_arg1='-der'
 PERL_REVISION=5
-PERL_SUBVERSION=0
 PERL_API_REVISION=5
 PERL_API_SUBVERSION=0
 PERL_PATCHLEVEL=
@@ -1093,8 +1091,8 @@ i_stdbool='define'
 i_syspoll='define'
 #incpth='/usr/lib/gcc/i486-slackware-linux/4.8.2/include /usr/local/include /usr/lib/gcc/i486-slackware-linux/4.8.2/include-fixed /usr/include'
 ld_can_script='define'
-#libsfound=' /usr/lib/libnsl.so /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
-nv_overflows_integers_at='0'
+#libsfound=' /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
 perl_static_inline='static __inline__'
 sGMTIME_max='2147483647'
 sGMTIME_min='-2147483648'
@@ -1135,12 +1133,14 @@ privlib='/usr/lib/perl5/5.20'
 privlibexp='/usr/lib/perl5/5.20'
 archlib='/usr/lib/perl5/5.20'
 archlibexp='/usr/lib/perl5/5.20'
-version='5.20.0'
-version_patchlevel_string='version 20 subversion 0'
+version='5.20.1'
+version_patchlevel_string='version 20 subversion 1'
 PERL_VERSION=20
 PERL_API_VERSION=20
+PERL_SUBVERSION=1
 patchlevel='20'
 ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
+subversion='1'
 
 # Make perl use these tools instead of the target binaries during build.
 hostgenerate='%%HOSTGENERATE%%'
index 39b595516a94aa5ff8b18aee33eab5f9f71f2ef1..650f94f0fe9a336193798da6ae2174a502b301ce 100644 (file)
@@ -600,13 +600,13 @@ html1direxp=''
 html3dir=' '
 html3direxp=''
 i16size='2'
-i16type='short'
+i16type='signed short'
 i32size='4'
-i32type='long'
+i32type='signed long'
 i64size='8'
-i64type='long long'
+i64type='signed long long'
 i8size='1'
-i8type='char'
+i8type='signed char'
 i_arpainet='define'
 i_bsdioctl=''
 i_crypt='define'
@@ -740,12 +740,12 @@ lib_ext='.a'
 libc=''
 libperl='libperl.so'
 libpth='%%LIBDIRS%%'
-libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc'
+libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'
 libsdirs='%%LIBDIRS%%'
-libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so'
-#libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
+libsfiles=' libdl.so libm.so libcrypt.so libutil.so libc.so'
+#libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
 libspath='%%LIBDIRS%%'
-libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD'
+libswanted='sfio socket inet nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD'
 libswanted_uselargefiles=''
 line=''
 lint=''
@@ -829,7 +829,7 @@ perl5=''
 perl=''
 perl_patchlevel=''
 perladmin='root@maia.dev.null'
-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%'
+perllibs='-ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%'
 perlpath='/usr/bin/perl'
 pg='pg'
 phostname='hostname'
@@ -949,7 +949,6 @@ stdio_stream_array=''
 strerror_r_proto='0'
 #strings='/usr/include/string.h'
 submit=''
-subversion='0'
 sysman='/usr/share/man/man1'
 tail=''
 tar=''
@@ -1050,8 +1049,6 @@ config_args='-der'
 config_argc=1
 config_arg1='-der'
 PERL_REVISION=5
-
-PERL_SUBVERSION=0
 PERL_API_REVISION=5
 
 PERL_API_SUBVERSION=0
@@ -1108,8 +1105,8 @@ i_stdbool='define'
 i_syspoll='define'
 #incpth='/usr/lib/gcc/i486-slackware-linux/4.8.2/include /usr/local/include /usr/lib/gcc/i486-slackware-linux/4.8.2/include-fixed /usr/include'
 ld_can_script='define'
-#libsfound=' /usr/lib/libnsl.so /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
-nv_overflows_integers_at='0'
+#libsfound=' /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
 perl_static_inline='static __inline__'
 sGMTIME_max='2147483647'
 sGMTIME_min='-2147483648'
@@ -1150,12 +1147,14 @@ privlib='/usr/lib/perl5/5.20'
 privlibexp='/usr/lib/perl5/5.20'
 archlib='/usr/lib/perl5/5.20'
 archlibexp='/usr/lib/perl5/5.20'
-version='5.20.0'
-version_patchlevel_string='version 20 subversion 0'
+version='5.20.1'
+version_patchlevel_string='version 20 subversion 1'
 PERL_VERSION=20
 PERL_API_VERSION=20
+PERL_SUBVERSION=1
 patchlevel='20'
 ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
+subversion='1'
 
 # Make perl use these tools instead of the target binaries during build.
 hostgenerate='%%HOSTGENERATE%%'
index 6ec080f5867076fc4b24a20217bad137b07b520c..6a2bd1bfb2c1806c14eed5fb34a3150a53035efb 100644 (file)
@@ -733,12 +733,12 @@ lib_ext='.a'
 libc=''
 libperl='libperl.so'
 libpth='%%LIBDIRS%%'
-libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc'
+libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'
 libsdirs='%%LIBDIRS%%'
-libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so'
-#libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
+libsfiles=' libdl.so libm.so libcrypt.so libutil.so libc.so'
+#libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
 libspath='%%LIBDIRS%%'
-libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD'
+libswanted='sfio socket inet nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD'
 libswanted_uselargefiles=''
 line=''
 lint=''
@@ -820,7 +820,7 @@ perl5=''
 perl=''
 perl_patchlevel=''
 perladmin='root@maia.dev.null'
-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%'
+perllibs='-ldl -lm -lcrypt -lutil -lc %%EXTRA_PERLLIBS%%'
 perlpath='/usr/bin/perl'
 pg='pg'
 phostname='hostname'
@@ -938,7 +938,6 @@ stdio_stream_array=''
 strerror_r_proto='0'
 #strings='/usr/include/string.h'
 submit=''
-subversion='0'
 sysman='/usr/share/man/man1'
 tail=''
 tar=''
@@ -1037,7 +1036,6 @@ config_args='-der'
 config_argc=1
 config_arg1='-der'
 PERL_REVISION=5
-PERL_SUBVERSION=0
 PERL_API_REVISION=5
 PERL_API_SUBVERSION=0
 PERL_PATCHLEVEL=
@@ -1093,8 +1091,8 @@ i_stdbool='define'
 i_syspoll='define'
 #incpth='/usr/lib/gcc/i486-slackware-linux/4.8.2/include /usr/local/include /usr/lib/gcc/i486-slackware-linux/4.8.2/include-fixed /usr/include'
 ld_can_script='define'
-#libsfound=' /usr/lib/libnsl.so /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
-nv_overflows_integers_at='0'
+#libsfound=' /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
 perl_static_inline='static __inline__'
 sGMTIME_max='67768036191676799'
 sGMTIME_min='-62167219200'
@@ -1135,12 +1133,14 @@ privlib='/usr/lib/perl5/5.20'
 privlibexp='/usr/lib/perl5/5.20'
 archlib='/usr/lib/perl5/5.20'
 archlibexp='/usr/lib/perl5/5.20'
-version='5.20.0'
-version_patchlevel_string='version 20 subversion 0'
+version='5.20.1'
+version_patchlevel_string='version 20 subversion 1'
 PERL_VERSION=20
 PERL_API_VERSION=20
+PERL_SUBVERSION=1
 patchlevel='20'
 ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
+subversion='1'
 
 # Make perl use these tools instead of the target binaries during build.
 hostgenerate='%%HOSTGENERATE%%'
diff --git a/lang/perl/files/perl-run_tests.sh b/lang/perl/files/perl-run_tests.sh
new file mode 100755 (executable)
index 0000000..af6a39c
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+PERL_TESTSDIR="/usr/share/perl/perl-tests"
+PERL_LIBDIR="/usr/lib/perl5/5.20/"
+PERL_DISABLEDTESTS="%%PERL_DISABLEDTESTS%%"
+
+if [ ! -f "$PERL_TESTSDIR/__prepared" ]; then
+       ln -s "$PERL_LIBDIR" "$PERL_TESTSDIR/lib"
+       ln -s /usr/bin/perl "$PERL_TESTSDIR/perl"
+       ln -s /usr/bin/perl "$PERL_TESTSDIR/t/perl"
+       touch "$PERL_TESTSDIR/__prepared"
+       
+       for i in $PERL_DISABLEDTESTS; do
+               echo "Disabling $i tests"
+               sed 's!^'$i'.*$!!' -i $PERL_TESTSDIR/MANIFEST
+       done
+       
+       cat $PERL_TESTSDIR/MANIFEST | grep -v '^$' > $PERL_TESTSDIR/MANIFEST_NEW
+       rm $PERL_TESTSDIR/MANIFEST
+       mv $PERL_TESTSDIR/MANIFEST_NEW $PERL_TESTSDIR/MANIFEST
+fi
+
+cd "$PERL_TESTSDIR/t"
+./perl TEST
index cc9169076ea6fac9bd59cfaa59d0e02303adb597..ab08b386068501a32742af1bb0aa97680f3d796f 100644 (file)
@@ -19,6 +19,19 @@ endef
 $(eval $(call BuildPackage,perlbase-anydbm-file))
 
 
+define Package/perlbase-app
+$(call Package/perlbase-template)
+TITLE:=app perl module
+DEPENDS+=+perlbase-autouse +perlbase-base +perlbase-config +perlbase-cpan +perlbase-essential +perlbase-file +perlbase-getopt +perlbase-if +perlbase-tap +perlbase-text
+endef
+
+define Package/perlbase-app/install
+$(call perlmod/Install,$(1),App,)
+endef
+
+$(eval $(call BuildPackage,perlbase-app))
+
+
 define Package/perlbase-archive
 $(call Package/perlbase-template)
 TITLE:=Archive perl module
@@ -27,11 +40,25 @@ endef
 
 define Package/perlbase-archive/install
 $(call perlmod/Install,$(1),Archive,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Archive-Tar/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-archive))
 
 
+define Package/perlbase-arybase
+$(call Package/perlbase-template)
+TITLE:=arybase perl module
+endef
+
+define Package/perlbase-arybase/install
+$(call perlmod/Install,$(1),arybase.pm auto/arybase,)
+$(call perlmod/InstallBaseTests,$(1),ext/arybase/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-arybase))
+
+
 define Package/perlbase-attribute
 $(call Package/perlbase-template)
 TITLE:=Attribute perl module
@@ -40,6 +67,7 @@ endef
 
 define Package/perlbase-attribute/install
 $(call perlmod/Install,$(1),Attribute,)
+$(call perlmod/InstallBaseTests,$(1),dist/Attribute-Handlers/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-attribute))
@@ -52,12 +80,26 @@ DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-attributes/install
-$(call perlmod/Install,$(1),attributes.pm,)
+$(call perlmod/Install,$(1),attributes.pm auto/attributes,)
 endef
 
 $(eval $(call BuildPackage,perlbase-attributes))
 
 
+define Package/perlbase-autodie
+$(call Package/perlbase-template)
+TITLE:=autodie perl module
+DEPENDS+=+perlbase-base +perlbase-essential +perlbase-fatal +perlbase-if
+endef
+
+define Package/perlbase-autodie/install
+$(call perlmod/Install,$(1),autodie autodie.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/autodie/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-autodie))
+
+
 define Package/perlbase-autoloader
 $(call Package/perlbase-template)
 TITLE:=AutoLoader perl module
@@ -66,6 +108,7 @@ endef
 
 define Package/perlbase-autoloader/install
 $(call perlmod/Install,$(1),AutoLoader.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/AutoLoader/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-autoloader))
@@ -78,7 +121,7 @@ DEPENDS+=+perlbase-config +perlbase-essential +perlbase-file
 endef
 
 define Package/perlbase-autosplit/install
-$(call perlmod/Install,$(1),AutoSplit.pm,)
+$(call perlmod/Install/NoStrip,$(1),AutoSplit.pm,)
 endef
 
 $(eval $(call BuildPackage,perlbase-autosplit))
@@ -91,6 +134,7 @@ endef
 
 define Package/perlbase-autouse/install
 $(call perlmod/Install,$(1),autouse.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/autouse/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-autouse))
@@ -104,6 +148,7 @@ endef
 
 define Package/perlbase-b/install
 $(call perlmod/Install,$(1),B B.pm auto/B,)
+$(call perlmod/InstallBaseTests,$(1),cpan/B-Debug/t ext/B/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-b))
@@ -117,6 +162,7 @@ endef
 
 define Package/perlbase-base/install
 $(call perlmod/Install,$(1),base.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/base/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-base))
@@ -155,7 +201,8 @@ DEPENDS+=+perlbase-bigint +perlbase-essential
 endef
 
 define Package/perlbase-bignum/install
-$(call perlmod/Install,$(1),bignum.pm,)
+$(call perlmod/Install,$(1),bignum.pm bigrat.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/bignum/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-bignum))
@@ -194,6 +241,7 @@ endef
 
 define Package/perlbase-cgi/install
 $(call perlmod/Install,$(1),CGI CGI.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/CGI/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-cgi))
@@ -202,11 +250,11 @@ $(eval $(call BuildPackage,perlbase-cgi))
 define Package/perlbase-charnames
 $(call Package/perlbase-template)
 TITLE:=charnames perl module
-DEPENDS+=+perlbase-bytes +perlbase-essential +perlbase-re +perlbase-unicore
+DEPENDS+=+perlbase-bytes +perlbase-essential +perlbase-file +perlbase-re +perlbase-unicore
 endef
 
 define Package/perlbase-charnames/install
-$(call perlmod/Install,$(1),charnames.pm,)
+$(call perlmod/Install,$(1),_charnames.pm charnames.pm,)
 endef
 
 $(eval $(call BuildPackage,perlbase-charnames))
@@ -233,6 +281,7 @@ endef
 
 define Package/perlbase-compress/install
 $(call perlmod/Install,$(1),Compress auto/Compress,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Compress-Raw-Bzip2/t cpan/Compress-Raw-Zlib/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-compress))
@@ -241,10 +290,12 @@ $(eval $(call BuildPackage,perlbase-compress))
 define Package/perlbase-config
 $(call Package/perlbase-template)
 TITLE:=Config perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-config/install
-$(call perlmod/Install,$(1),Config Config.pm Config_heavy.pl,)
+$(call perlmod/Install,$(1),Config Config.pm Config_git.pl Config_heavy.pl,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Config-Perl-V/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-config))
@@ -253,11 +304,13 @@ $(eval $(call BuildPackage,perlbase-config))
 define Package/perlbase-cpan
 $(call Package/perlbase-template)
 TITLE:=CPAN perl module
-DEPENDS+=+perlbase-b +perlbase-config +perlbase-cwd +perlbase-dirhandle +perlbase-essential +perlbase-extutils +perlbase-fcntl +perlbase-file +perlbase-filehandle +perlbase-list +perlbase-net +perlbase-safe +perlbase-scalar +perlbase-sys +perlbase-text +perlbase-version
+DEPENDS+=+perlbase-b +perlbase-config +perlbase-cwd +perlbase-dirhandle +perlbase-essential +perlbase-extutils +perlbase-fcntl +perlbase-file +perlbase-filehandle +perlbase-http-tiny +perlbase-list +perlbase-net +perlbase-safe +perlbase-scalar +perlbase-sys +perlbase-text +perlbase-version
 endef
 
 define Package/perlbase-cpan/install
-$(call perlmod/Install,$(1),CPAN CPAN.pm,)
+$(call perlmod/Install,$(1),CPAN CPAN.pm Parse/CPAN/Meta.pm,CPAN/FirstTime.pm)
+$(call perlmod/Install/NoStrip,$(1),CPAN/FirstTime.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/CPAN-Meta-Requirements/t cpan/CPAN-Meta-YAML/t cpan/CPAN-Meta/t cpan/CPAN/t cpan/Parse-CPAN-Meta/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-cpan))
@@ -284,6 +337,7 @@ endef
 
 define Package/perlbase-data/install
 $(call perlmod/Install,$(1),Data auto/Data,)
+$(call perlmod/InstallBaseTests,$(1),dist/Data-Dumper/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-data))
@@ -310,6 +364,7 @@ endef
 
 define Package/perlbase-db-file/install
 $(call perlmod/Install,$(1),DB_File.pm auto/DB_File,)
+$(call perlmod/InstallBaseTests,$(1),cpan/DB_File/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-db-file))
@@ -335,7 +390,9 @@ DEPENDS+=+perlbase-essential +perlbase-file
 endef
 
 define Package/perlbase-devel/install
-$(call perlmod/Install,$(1),Devel auto/Devel,)
+$(call perlmod/Install,$(1),Devel auto/Devel,Devel/PPPort.pm)
+$(call perlmod/Install/NoStrip,$(1),Devel/PPPort.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Devel-PPPort/t dist/Devel-SelfStubber/t ext/Devel-Peek/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-devel))
@@ -362,6 +419,8 @@ endef
 
 define Package/perlbase-digest/install
 $(call perlmod/Install,$(1),Digest Digest.pm auto/Digest,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Digest-MD5/MD5.xs cpan/Digest-MD5/t cpan/Digest-SHA/t cpan/Digest/t)
+       $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/cpan/Digest-SHA/src
 endef
 
 $(eval $(call BuildPackage,perlbase-digest))
@@ -388,6 +447,7 @@ endef
 
 define Package/perlbase-dumpvalue/install
 $(call perlmod/Install,$(1),Dumpvalue.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/Dumpvalue/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-dumpvalue))
@@ -413,6 +473,7 @@ endef
 
 define Package/perlbase-dynaloader/install
 $(call perlmod/Install,$(1),DynaLoader.pm,)
+$(call perlmod/InstallBaseTests,$(1),ext/DynaLoader/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-dynaloader))
@@ -426,6 +487,7 @@ endef
 
 define Package/perlbase-encode/install
 $(call perlmod/Install,$(1),Encode Encode.pm auto/Encode,Encode/PerlIO.pod Encode/Supported.pod)
+$(call perlmod/InstallBaseTests,$(1),cpan/Encode/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-encode))
@@ -439,6 +501,7 @@ endef
 
 define Package/perlbase-encoding/install
 $(call perlmod/Install,$(1),encoding encoding.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/encoding-warnings/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-encoding))
@@ -464,6 +527,7 @@ endef
 
 define Package/perlbase-env/install
 $(call perlmod/Install,$(1),Env.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/Env/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-env))
@@ -477,6 +541,7 @@ endef
 
 define Package/perlbase-errno/install
 $(call perlmod/Install,$(1),Errno.pm,)
+$(call perlmod/InstallBaseTests,$(1),ext/Errno/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-errno))
@@ -485,24 +550,40 @@ $(eval $(call BuildPackage,perlbase-errno))
 define Package/perlbase-essential
 $(call Package/perlbase-template)
 TITLE:=essential perl module
-DEPENDS+=+perlbase-config
 endef
 
 define Package/perlbase-essential/install
-$(call perlmod/Install,$(1),Carp Carp.pm Exporter Exporter.pm constant.pm lib.pm locale.pm overload.pm overloading.pm parent.pm strict.pm subs.pm vars.pm warnings warnings.pm,)
+$(call perlmod/Install,$(1),Carp Carp.pm Exporter Exporter.pm constant.pm deprecate.pm lib.pm locale.pm overload.pm overloading.pm parent.pm strict.pm subs.pm vars.pm warnings warnings.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/parent/t dist/Carp/t dist/Exporter/t dist/constant/t dist/lib/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-essential))
 
 
+define Package/perlbase-experimental
+$(call Package/perlbase-template)
+TITLE:=perl module to enable/disable experimental features
+DEPENDS+=+perlbase-essential +perlbase-feature
+endef
+
+define Package/perlbase-experimental/install
+$(call perlmod/Install,$(1),experimental.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/experimental/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-experimental))
+
+
 define Package/perlbase-extutils
 $(call Package/perlbase-template)
 TITLE:=ExtUtils perl module
-DEPENDS+=+perlbase-autosplit +perlbase-config +perlbase-cwd +perlbase-dirhandle +perlbase-essential +perlbase-file +perlbase-io +perlbase-ipc +perlbase-symbol +perlbase-text
+DEPENDS+=+perlbase-autosplit +perlbase-config +perlbase-cwd +perlbase-dirhandle +perlbase-essential +perlbase-file +perlbase-io +perlbase-ipc +perlbase-ostype +perlbase-symbol +perlbase-text
 endef
 
 define Package/perlbase-extutils/install
-$(call perlmod/Install,$(1),ExtUtils,ExtUtils/MakeMaker/FAQ.pod ExtUtils/MakeMaker/Tutorial.pod)
+$(call perlmod/Install,$(1),ExtUtils,ExtUtils/MakeMaker/FAQ.pod ExtUtils/MakeMaker/Tutorial.pod ExtUtils/ParseXS.pm ExtUtils/ParseXS/Utilities.pm)
+$(call perlmod/Install/NoStrip,$(1),ExtUtils/ParseXS.pm ExtUtils/ParseXS/Utilities.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/ExtUtils-Constant/t cpan/ExtUtils-MakeMaker/t dist/ExtUtils-CBuilder/t dist/ExtUtils-Command/t dist/ExtUtils-Install/t dist/ExtUtils-Manifest/t dist/ExtUtils-ParseXS/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-extutils))
@@ -529,6 +610,7 @@ endef
 
 define Package/perlbase-fcntl/install
 $(call perlmod/Install,$(1),Fcntl.pm auto/Fcntl,)
+$(call perlmod/InstallBaseTests,$(1),ext/Fcntl/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-fcntl))
@@ -566,7 +648,9 @@ DEPENDS+=+perlbase-class +perlbase-config +perlbase-cwd +perlbase-errno +perlbas
 endef
 
 define Package/perlbase-file/install
-$(call perlmod/Install,$(1),File auto/File,)
+$(call perlmod/Install,$(1),File auto/File,File/Find.pm)
+$(call perlmod/Install/NoStrip,$(1),File/Find.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/File-Fetch/t cpan/File-Path/t cpan/File-Temp/t dist/PathTools/t ext/File-DosGlob/t ext/File-Find/t ext/File-Glob/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-file))
@@ -580,6 +664,7 @@ endef
 
 define Package/perlbase-filecache/install
 $(call perlmod/Install,$(1),FileCache.pm,)
+$(call perlmod/InstallBaseTests,$(1),ext/FileCache/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-filecache))
@@ -618,6 +703,7 @@ endef
 
 define Package/perlbase-filter/install
 $(call perlmod/Install,$(1),Filter auto/Filter,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Filter-Util-Call/filter-util.pl cpan/Filter-Util-Call/t dist/Filter-Simple/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-filter))
@@ -644,6 +730,7 @@ endef
 
 define Package/perlbase-gdbm-file/install
 $(call perlmod/Install,$(1),GDBM_File.pm auto/GDBM_File,)
+$(call perlmod/InstallBaseTests,$(1),ext/GDBM_File/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-gdbm-file))
@@ -657,6 +744,7 @@ endef
 
 define Package/perlbase-getopt/install
 $(call perlmod/Install,$(1),Getopt,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Getopt-Long/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-getopt))
@@ -670,11 +758,26 @@ endef
 
 define Package/perlbase-hash/install
 $(call perlmod/Install,$(1),Hash auto/Hash,)
+$(call perlmod/InstallBaseTests,$(1),ext/Hash-Util-FieldHash/t ext/Hash-Util/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-hash))
 
 
+define Package/perlbase-http-tiny
+$(call Package/perlbase-template)
+TITLE:=http-tiny perl module
+DEPENDS+=+perlbase-errno +perlbase-essential +perlbase-io
+endef
+
+define Package/perlbase-http-tiny/install
+$(call perlmod/Install,$(1),HTTP/Tiny.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/HTTP-Tiny/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-http-tiny))
+
+
 define Package/perlbase-i18n
 $(call Package/perlbase-template)
 TITLE:=I18N perl module
@@ -682,7 +785,9 @@ DEPENDS+=+perlbase-essential +perlbase-posix
 endef
 
 define Package/perlbase-i18n/install
-$(call perlmod/Install,$(1),I18N auto/I18N,)
+$(call perlmod/Install,$(1),I18N auto/I18N,I18N/LangTags/List.pm)
+$(call perlmod/InstallBaseTests,$(1),dist/I18N-Collate/t dist/I18N-LangTags/t ext/I18N-Langinfo/t)
+$(call perlmod/Install/NoStrip,$(1),I18N/LangTags/List.pm)
 endef
 
 $(eval $(call BuildPackage,perlbase-i18n))
@@ -695,6 +800,7 @@ endef
 
 define Package/perlbase-if/install
 $(call perlmod/Install,$(1),if.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/if/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-if))
@@ -720,6 +826,7 @@ endef
 
 define Package/perlbase-io/install
 $(call perlmod/Install,$(1),IO IO.pm auto/IO,)
+$(call perlmod/InstallBaseTests,$(1),cpan/IO-Compress/t cpan/IO-Socket-IP/t cpan/IO-Zlib/t dist/IO/Makefile.PL dist/IO/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-io))
@@ -733,11 +840,26 @@ endef
 
 define Package/perlbase-ipc/install
 $(call perlmod/Install,$(1),IPC auto/IPC,)
+$(call perlmod/InstallBaseTests,$(1),cpan/IPC-Cmd/t cpan/IPC-SysV/t ext/IPC-Open3/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-ipc))
 
 
+define Package/perlbase-json-pp
+$(call Package/perlbase-template)
+TITLE:=json-pp perl module
+DEPENDS+=+perlbase-b +perlbase-base +perlbase-essential
+endef
+
+define Package/perlbase-json-pp/install
+$(call perlmod/Install,$(1),JSON/PP JSON/PP.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/JSON-PP/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-json-pp))
+
+
 define Package/perlbase-less
 $(call Package/perlbase-template)
 TITLE:=less perl module
@@ -772,6 +894,7 @@ endef
 
 define Package/perlbase-locale/install
 $(call perlmod/Install,$(1),Locale,Locale/Constants.pod Locale/Country.pod Locale/Currency.pod Locale/Language.pod Locale/Maketext.pod Locale/Maketext/TPJ13.pod Locale/Script.pod)
+$(call perlmod/InstallBaseTests,$(1),cpan/Locale-Codes/t cpan/Locale-Maketext-Simple/t dist/Locale-Maketext/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-locale))
@@ -785,6 +908,7 @@ endef
 
 define Package/perlbase-math/install
 $(call perlmod/Install,$(1),Math auto/Math,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Math-Complex/t dist/Math-BigInt-FastCalc/t dist/Math-BigInt/t dist/Math-BigRat/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-math))
@@ -798,6 +922,7 @@ endef
 
 define Package/perlbase-memoize/install
 $(call perlmod/Install,$(1),Memoize Memoize.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Memoize/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-memoize))
@@ -811,6 +936,7 @@ endef
 
 define Package/perlbase-mime/install
 $(call perlmod/Install,$(1),MIME auto/MIME,)
+$(call perlmod/InstallBaseTests,$(1),cpan/MIME-Base64/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-mime))
@@ -819,11 +945,13 @@ $(eval $(call BuildPackage,perlbase-mime))
 define Package/perlbase-module
 $(call Package/perlbase-template)
 TITLE:=Module perl module
-DEPENDS+=+perlbase-config +perlbase-cwd +perlbase-data +perlbase-essential +perlbase-extutils +perlbase-file +perlbase-filehandle +perlbase-if +perlbase-io +perlbase-locale +perlbase-params +perlbase-text +perlbase-version
+DEPENDS+=+perlbase-config +perlbase-cwd +perlbase-data +perlbase-essential +perlbase-extutils +perlbase-file +perlbase-filehandle +perlbase-if +perlbase-io +perlbase-locale +perlbase-ostype +perlbase-params +perlbase-text +perlbase-version
 endef
 
 define Package/perlbase-module/install
-$(call perlmod/Install,$(1),Module,Module/Build/API.pod Module/Build/Authoring.pod)
+$(call perlmod/Install,$(1),Module,Module/Build Module/Build.pm Module/Build/API.pod Module/Build/Authoring.pod)
+$(call perlmod/Install/NoStrip,$(1),Module/Build Module/Build.pm,Module/Build/API.pod Module/Build/Authoring.pod)
+$(call perlmod/InstallBaseTests,$(1),cpan/Module-Build/lib cpan/Module-Build/t cpan/Module-Load-Conditional/t cpan/Module-Load/t cpan/Module-Loaded/t cpan/Module-Metadata/lib cpan/Module-Metadata/t dist/Module-CoreList/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-module))
@@ -836,7 +964,7 @@ DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-mro/install
-$(call perlmod/Install,$(1),mro.pm,)
+$(call perlmod/Install,$(1),auto/mro mro.pm,)
 endef
 
 $(eval $(call BuildPackage,perlbase-mro))
@@ -850,6 +978,7 @@ endef
 
 define Package/perlbase-net/install
 $(call perlmod/Install,$(1),Net,Net/libnetFAQ.pod)
+$(call perlmod/InstallBaseTests,$(1),cpan/libnet/t dist/Net-Ping/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-net))
@@ -863,6 +992,7 @@ endef
 
 define Package/perlbase-next/install
 $(call perlmod/Install,$(1),NEXT.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/NEXT/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-next))
@@ -888,7 +1018,9 @@ DEPENDS+=+perlbase-essential +perlbase-xsloader
 endef
 
 define Package/perlbase-opcode/install
-$(call perlmod/Install,$(1),Opcode.pm auto/Opcode,)
+$(call perlmod/Install,$(1),auto/Opcode,)
+$(call perlmod/Install/NoStrip,$(1),Opcode.pm,)
+$(call perlmod/InstallBaseTests,$(1),ext/Opcode/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-opcode))
@@ -920,6 +1052,20 @@ endef
 $(eval $(call BuildPackage,perlbase-ops))
 
 
+define Package/perlbase-ostype
+$(call Package/perlbase-template)
+TITLE:=OSType perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-ostype/install
+$(call perlmod/Install,$(1),Perl/OSType.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Perl-OSType/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-ostype))
+
+
 define Package/perlbase-package
 $(call Package/perlbase-template)
 TITLE:=Package perl module
@@ -928,6 +1074,7 @@ endef
 
 define Package/perlbase-package/install
 $(call perlmod/Install,$(1),Package,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Package-Constants/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-package))
@@ -941,6 +1088,7 @@ endef
 
 define Package/perlbase-params/install
 $(call perlmod/Install,$(1),Params,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Params-Check/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-params))
@@ -967,6 +1115,7 @@ endef
 
 define Package/perlbase-perlio/install
 $(call perlmod/Install,$(1),PerlIO PerlIO.pm auto/PerlIO,)
+$(call perlmod/InstallBaseTests,$(1),cpan/PerlIO-via-QuotedPrint/t ext/PerlIO-encoding/t ext/PerlIO-scalar/t ext/PerlIO-via/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-perlio))
@@ -979,7 +1128,12 @@ DEPENDS+=+perlbase-config +perlbase-cwd +perlbase-encode +perlbase-essential +pe
 endef
 
 define Package/perlbase-pod/install
-$(call perlmod/Install,$(1),Pod,)
+$(call perlmod/Install,$(1),Pod,Pod/Usage.pm)
+$(call perlmod/Install/NoStrip,$(1),Pod/Usage.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Pod-Checker/t cpan/Pod-Escapes/t cpan/Pod-Parser/lib cpan/Pod-Parser/scripts cpan/Pod-Parser/t cpan/Pod-Perldoc/t cpan/Pod-Simple/t cpan/Pod-Usage/scripts cpan/Pod-Usage/t cpan/podlators/t ext/Pod-Functions/Functions.pm ext/Pod-Functions/t ext/Pod-Html/t)
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/pod2man $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/pod2text $(1)/usr/bin/
 endef
 
 $(eval $(call BuildPackage,perlbase-pod))
@@ -993,6 +1147,7 @@ endef
 
 define Package/perlbase-posix/install
 $(call perlmod/Install,$(1),POSIX.pm auto/POSIX,)
+$(call perlmod/InstallBaseTests,$(1),ext/POSIX/Makefile.PL ext/POSIX/POSIX.xs ext/POSIX/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-posix))
@@ -1006,6 +1161,7 @@ endef
 
 define Package/perlbase-re/install
 $(call perlmod/Install,$(1),auto/re re.pm,)
+$(call perlmod/InstallBaseTests,$(1),ext/re/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-re))
@@ -1019,6 +1175,7 @@ endef
 
 define Package/perlbase-safe/install
 $(call perlmod/Install,$(1),Safe.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/Safe/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-safe))
@@ -1032,6 +1189,8 @@ endef
 
 define Package/perlbase-scalar/install
 $(call perlmod/Install,$(1),Scalar,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Scalar-List-Utils/t)
+       $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/cpan/Scalar-List-Utils/blib
 endef
 
 $(eval $(call BuildPackage,perlbase-scalar))
@@ -1045,6 +1204,7 @@ endef
 
 define Package/perlbase-sdbm-file/install
 $(call perlmod/Install,$(1),SDBM_File.pm auto/SDBM_File,)
+$(call perlmod/InstallBaseTests,$(1),ext/SDBM_File/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-sdbm-file))
@@ -1058,6 +1218,7 @@ endef
 
 define Package/perlbase-search/install
 $(call perlmod/Install,$(1),Search,)
+$(call perlmod/InstallBaseTests,$(1),dist/Search-Dict/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-search))
@@ -1084,6 +1245,7 @@ endef
 
 define Package/perlbase-selfloader/install
 $(call perlmod/Install,$(1),SelfLoader.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/SelfLoader/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-selfloader))
@@ -1110,6 +1272,7 @@ endef
 
 define Package/perlbase-socket/install
 $(call perlmod/Install,$(1),Socket.pm auto/Socket,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Socket/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-socket))
@@ -1136,6 +1299,7 @@ endef
 
 define Package/perlbase-storable/install
 $(call perlmod/Install,$(1),Storable.pm auto/Storable,)
+$(call perlmod/InstallBaseTests,$(1),dist/Storable/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-storable))
@@ -1161,11 +1325,25 @@ endef
 
 define Package/perlbase-sys/install
 $(call perlmod/Install,$(1),Sys auto/Sys,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Sys-Syslog/t ext/Sys-Hostname/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-sys))
 
 
+define Package/perlbase-tap
+$(call Package/perlbase-template)
+TITLE:=TAP perl module
+DEPENDS+=+perlbase-base +perlbase-benchmark +perlbase-config +perlbase-essential +perlbase-file +perlbase-io +perlbase-posix +perlbase-text
+endef
+
+define Package/perlbase-tap/install
+$(call perlmod/Install,$(1),TAP,)
+endef
+
+$(eval $(call BuildPackage,perlbase-tap))
+
+
 define Package/perlbase-term
 $(call Package/perlbase-template)
 TITLE:=Term perl module
@@ -1174,6 +1352,7 @@ endef
 
 define Package/perlbase-term/install
 $(call perlmod/Install,$(1),Term,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Term-ANSIColor/t cpan/Term-Cap/test.pl dist/Term-Complete/t dist/Term-ReadLine/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-term))
@@ -1182,11 +1361,13 @@ $(eval $(call BuildPackage,perlbase-term))
 define Package/perlbase-test
 $(call Package/perlbase-template)
 TITLE:=Test perl module
-DEPENDS+=+perlbase-base +perlbase-config +perlbase-essential +perlbase-symbol +perlbase-text
+DEPENDS+=+perlbase-base +perlbase-config +perlbase-essential +perlbase-symbol +perlbase-tap +perlbase-text
 endef
 
 define Package/perlbase-test/install
-$(call perlmod/Install,$(1),Test Test.pm,Test/Harness/TAP.pod Test/Tutorial.pod)
+$(call perlmod/Install,$(1),Test Test.pm,Test/Builder.pm Test/Harness/TAP.pod Test/More.pm Test/Tutorial.pod)
+$(call perlmod/Install/NoStrip,$(1),Test/Builder.pm Test/More.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Test-Harness/t cpan/Test-Simple/t cpan/Test/t)
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/prove $(1)/usr/bin
 endef
@@ -1197,11 +1378,12 @@ $(eval $(call BuildPackage,perlbase-test))
 define Package/perlbase-text
 $(call Package/perlbase-template)
 TITLE:=Text perl module
-DEPENDS+=+perlbase-essential
+DEPENDS+=+perlbase-essential +perlbase-selfloader
 endef
 
 define Package/perlbase-text/install
 $(call perlmod/Install,$(1),Text,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Text-Balanced/t cpan/Text-ParseWords/t cpan/Text-Tabs/t dist/Text-Abbrev/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-text))
@@ -1215,6 +1397,7 @@ endef
 
 define Package/perlbase-thread/install
 $(call perlmod/Install,$(1),Thread Thread.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/Thread-Queue/t dist/Thread-Semaphore/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-thread))
@@ -1228,6 +1411,7 @@ endef
 
 define Package/perlbase-threads/install
 $(call perlmod/Install,$(1),auto/threads threads threads.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/threads-shared/t dist/threads/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-threads))
@@ -1240,7 +1424,8 @@ DEPENDS+=+perlbase-essential +perlbase-fcntl +perlbase-posix
 endef
 
 define Package/perlbase-tie/install
-$(call perlmod/Install,$(1),Tie,)
+$(call perlmod/Install,$(1),Tie auto/Tie,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Tie-RefHash/t dist/Tie-File/t ext/Tie-Hash-NamedCapture/t ext/Tie-Memoize/lib/Tie/Memoize.pm ext/Tie-Memoize/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-tie))
@@ -1254,6 +1439,7 @@ endef
 
 define Package/perlbase-time/install
 $(call perlmod/Install,$(1),Time auto/Time,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Time-HiRes/t cpan/Time-Local/t cpan/Time-Piece/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-time))
@@ -1267,6 +1453,7 @@ endef
 
 define Package/perlbase-unicode/install
 $(call perlmod/Install,$(1),Unicode auto/Unicode,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Unicode-Collate/t cpan/Unicode-Normalize/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-unicode))
@@ -1325,11 +1512,12 @@ $(eval $(call BuildPackage,perlbase-utf8))
 define Package/perlbase-version
 $(call Package/perlbase-template)
 TITLE:=version perl module
-DEPENDS+=+perlbase-essential
+DEPENDS+=+perlbase-config +perlbase-essential
 endef
 
 define Package/perlbase-version/install
-$(call perlmod/Install,$(1),version.pm,)
+$(call perlmod/Install,$(1),version version.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/version/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-version))
@@ -1342,6 +1530,10 @@ endef
 
 define Package/perlbase-xsloader/install
 $(call perlmod/Install,$(1),XSLoader.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/XSLoader/t ext/XS-APItest/t ext/XS-Typemap/t)
 endef
 
 $(eval $(call BuildPackage,perlbase-xsloader))
+
+
+# Generated Mon Oct 13 10:06:15 2014
index 3c3d56720a63a6c53e7bacbcbd9c3b80432d1f13..e8706dc6a087e81b4f5fd95ecde79c58f4f74caa 100644 (file)
@@ -11,6 +11,9 @@ PERL_CMD:=$(STAGING_DIR_HOST)/usr/bin/perl5.20.0
 
 # Module install prefix
 PERL_SITELIB:=/usr/lib/perl5/5.20
+PERL_TESTSDIR:=/usr/share/perl/perl-tests
+PERLBASE_TESTSDIR:=/usr/share/perl/perlbase-tests
+PERLMOD_TESTSDIR:=/usr/share/perl/perlmod-tests
 
 define perlmod/host/relink
        rm -f $(1)/Makefile.aperl
@@ -105,7 +108,7 @@ define perlmod/Compile
                install
 endef
 
-define perlmod/Install
+define perlmod/Install/NoStrip
        $(INSTALL_DIR) $(strip $(1))$(PERL_SITELIB)
        (cd $(PKG_INSTALL_DIR)$(PERL_SITELIB) && \
        rsync --relative -rlHp --itemize-changes \
@@ -116,12 +119,37 @@ define perlmod/Install
                $(strip $(2)) $(strip $(1))$(PERL_SITELIB))
 
        chmod -R u+w $(strip $(1))$(PERL_SITELIB)
+endef
+
+
+define perlmod/Install
+       $(call perlmod/Install/NoStrip,$(1),$(2),$(3))
 
        @echo "---> Stripping modules in: $(strip $(1))$(PERL_SITELIB)"
        find $(strip $(1))$(PERL_SITELIB) -name \*.pm -or -name \*.pl | \
        xargs -r sed -i \
-               -e '/^=\(head\|pod\|item\|over\|back\|encoding\)/,/^=cut/d' \
-               -e '/^=\(head\|pod\|item\|over\|back\|encoding\)/,$$$$d' \
+               -e '/^=\(head\|pod\|item\|over\|back\|encoding\|begin\|end\|for\)/,/^=cut/d' \
+               -e '/^=\(head\|pod\|item\|over\|back\|encoding\|begin\|end\|for\)/,$$$$d' \
                -e '/^#$$$$/d' \
                -e '/^#[^!"'"'"']/d'
 endef
+
+# You probably don't want to use this directly. Look at perlmod/InstallTests
+define perlmod/_InstallTests
+       $(INSTALL_DIR) $(strip $(1))
+       (cd $(PKG_BUILD_DIR)/$(2) && \
+       rsync --relative -rlHp --itemize-changes \
+               --exclude=.packlist \
+               --prune-empty-dirs \
+               $(strip $(3)) $(strip $(1)))
+
+       chmod -R u+w $(strip $(1))
+endef
+
+define perlmod/InstallBaseTests
+       $(if $(CONFIG_PERL_TESTS),$(call perlmod/_InstallTests,$(1)$(PERL_TESTSDIR),,$(2)))
+endef
+
+define perlmod/InstallTests
+       $(if $(CONFIG_PERL_TESTS),$(call perlmod/_InstallTests,$(1)$(PERL_TESTSDIR),$(2),$(3)))
+endef
index 8216fdf80987d02c84cccc8366c3783d819986e0..d64aad7d87638b168b5f31d4637b7c9ca7f7900f 100644 (file)
@@ -8,17 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=php
-PKG_VERSION:=5.4.33
+PKG_VERSION:=5.4.35
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
 
-PKG_LICENSE=PHPv3.01
-PKG_LICENSE_FILE=LICENSE
+PKG_LICENSE:=PHPv3.01
+PKG_LICENSE_FILES:=LICENSE
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.php.net/distributions/
-PKG_MD5SUM:=c6878bb1cdb46bfc1e1a5cd67a024737
+PKG_MD5SUM:=489cc8336488fb2e722ffa3c08f9c864
 
 PKG_FIXUP:=libtool no-autoreconf
 PKG_BUILD_PARALLEL:=1
diff --git a/lang/python-dns/Makefile b/lang/python-dns/Makefile
new file mode 100644 (file)
index 0000000..aa5d2e2
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-dns
+PKG_RELEASE:=1
+PKG_VERSION:=1.12.0
+PKG_SOURCE_URL:=http://www.dnspython.org/kits/$(PKG_VERSION)
+PKG_MD5SUM:=3f2601ef3c8b77fc6d21a9c77a81efeb
+PKG_SOURCE:=dnspython-$(PKG_VERSION).tar.gz
+PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
+PKG_LICENSE:=ISC
+PKG_LICENSE_FILES:=LICENSE
+PKG_BUILD_DIR:=$(BUILD_DIR)/dnspython-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-dns
+       SECTION:=language-python
+       CATEGORY:=Languages
+       SUBMENU:=Python
+       TITLE:=dnspython
+       URL:=http://www.dnspython.org/
+       DEPENDS:=+python
+endef
+
+define Package/python-dns/description
+ dnspython is a DNS toolkit for Python. It supports almost all record types. It can be used for queries, zone transfers, and dynamic updates. It supports TSIG authenticated messages and EDNS0.
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,\
+               install --prefix="$(PKG_INSTALL_DIR)/usr" \
+       )
+endef
+
+define PyPackage/python-dns/filespec
++|/usr/lib/python$(PYTHON_VERSION)/site-packages
+endef
+
+$(eval $(call PyPackage,python-dns))
+$(eval $(call BuildPackage,python-dns))
diff --git a/lang/python-pip/Makefile b/lang/python-pip/Makefile
new file mode 100644 (file)
index 0000000..d7404ba
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+# 
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-pip
+PKG_VERSION:=1.5.6
+PKG_RELEASE:=1
+
+PKG_SOURCE:=pip-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pip/
+PKG_MD5SUM:=01026f87978932060cc86c1dc527903e
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/pip-$(PKG_VERSION)
+PKG_USE_MIPS16:=0
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-pip
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Tool for installing Python packages.
+  URL:=https://pip.pypa.io
+  DEPENDS:=+python +python-setuptools
+endef
+
+define Package/python-pip/description
+  A tool for installing and managing Python packages.
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,\
+               install --prefix="$(PKG_INSTALL_DIR)/usr" \
+       )
+endef
+
+define PyPackage/python-pip/filespec
++|/usr/lib/python$(PYTHON_VERSION)
+endef
+
+define PyPackage/python-pip/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
+endef
+
+$(eval $(call PyPackage,python-pip))
+$(eval $(call BuildPackage,python-pip))
+
diff --git a/lang/python-setuptools/Makefile b/lang/python-setuptools/Makefile
new file mode 100644 (file)
index 0000000..0511791
--- /dev/null
@@ -0,0 +1,60 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+# 
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-setuptools
+PKG_VERSION:=7.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=setuptools-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/source/s/setuptools/
+PKG_MD5SUM:=6245d6752e2ef803c365f560f7f2f940
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/setuptools-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-setuptools
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Tool for installing Python packages.
+  URL:=https://bitbucket.org/pypa/setuptools
+  DEPENDS:=+python
+endef
+
+define Package/python-setuptools/description
+  Easily download, build, install, upgrade, and uninstall Python packages
+endef
+
+define Build/Compile
+       $(call Build/Compile/PyMod,,\
+               install --prefix="$(PKG_INSTALL_DIR)/usr" \
+       )
+endef
+
+define PyPackage/python-setuptools/filespec
++|/usr/lib/python$(PYTHON_VERSION)/site-packages
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(2)/lib/python$(PYTHON_VERSION)/site-packages
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/site-packages/* \
+               $(HOST_PYTHON_LIB_DIR)/site-packages
+endef
+
+define PyPackage/python-setuptools/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+endef
+
+$(eval $(call PyPackage,python-setuptools))
+$(eval $(call BuildPackage,python-setuptools))
+
diff --git a/lang/python/Makefile b/lang/python/Makefile
new file mode 100644 (file)
index 0000000..92271ba
--- /dev/null
@@ -0,0 +1,189 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+# The file included below defines PYTHON_VERSION
+include ./files/python-package.mk
+
+PKG_NAME:=python
+PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
+PKG_RELEASE:=3
+
+PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://www.python.org/ftp/python/$(PKG_VERSION)
+PKG_MD5SUM:=d235bdfa75b8396942e360a70487ee00
+
+PKG_LICENSE:=PSF
+PKG_LICENSE_FILES:=LICENSE Modules/_ctypes/libffi_msvc/LICENSE Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi/LICENSE Modules/_ctypes/libffi_osx/LICENSE Tools/pybench/LICENSE
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+HOST_BUILD_PARALLEL:=1
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION)
+
+PKG_BUILD_DEPENDS:=libffi/host python/host
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/python/Default
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Python $(PYTHON_VERSION) programming language
+  URL:=http://www.python.org/
+  MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
+endef
+
+define Package/python/Default/description
+ Python is a dynamic object-oriented programming language that can be used
+ for many kinds of software development. It offers strong support for
+ integration with other languages and tools, comes with extensive standard
+ libraries, and can be learned in a few days. Many Python programmers
+ report substantial productivity gains and feel the language encourages
+ the development of higher quality, more maintainable code.
+endef
+
+define Package/python-base
+$(call Package/python/Default)
+  TITLE:=Python $(PYTHON_VERSION) interpreter
+  DEPENDS:=+libpthread +zlib +libffi +libopenssl
+endef
+
+define Package/python-base/description
+  This package contains only the interpreter and the bare minimum
+  for the interpreter to start.
+endef
+
+define Package/python
+$(call Package/python/Default)
+  DEPENDS:=+python-base +libncursesw +libbz2 +libgdbm +libsqlite3 +libexpat +libdb47
+endef
+
+define Package/python/description
+  This package contains the (almost) full Python install.
+endef
+
+MAKE_FLAGS+=\
+       CROSS_COMPILE=yes \
+       LD="$(TARGET_CC)" \
+       PGEN=pgen2
+
+EXTRA_CFLAGS+= \
+       -DNDEBUG -fno-inline
+EXTRA_LDFLAGS+= \
+       -L$(PKG_BUILD_DIR)
+
+ENABLE_IPV6:=
+ifeq ($(CONFIG_IPV6),y)
+       ENABLE_IPV6 += --enable-ipv6
+endif
+
+CONFIGURE_ARGS+= \
+       --sysconfdir=/etc \
+       --enable-shared \
+       --without-cxx-main \
+       --with-threads \
+       --with-system-ffi="$(STAGING_DIR)/usr" \
+       --without-pymalloc \
+       $(ENABLE_IPV6) \
+       CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
+       OPT="$(TARGET_CFLAGS)"
+
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       $(CP) ./files/config.site $(PKG_BUILD_DIR)/config.site
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(STAGING_DIR)/mk/
+       $(INSTALL_DIR) $(1)/usr/include/ $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/
+       $(INSTALL_DATA) ./files/python-package.mk $(STAGING_DIR)/mk/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
+               $(1)/usr/include/
+       $(CP) \
+               $(STAGING_DIR_HOST)/lib/python$(PYTHON_VERSION) \
+               $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* \
+               $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config \
+               $(1)/usr/lib/python$(PYTHON_VERSION)/
+endef
+
+define PyPackage/python-base/filespec
++|/usr/bin/python$(PYTHON_VERSION)
++|/usr/lib/python$(PYTHON_VERSION)/_abcoll.py
++|/usr/lib/python$(PYTHON_VERSION)/_sysconfigdata.py
++|/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py
++|/usr/lib/python$(PYTHON_VERSION)/abc.py
++|/usr/lib/python$(PYTHON_VERSION)/copy_reg.py
++|/usr/lib/python$(PYTHON_VERSION)/genericpath.py
++|/usr/lib/python$(PYTHON_VERSION)/linecache.py
++|/usr/lib/python$(PYTHON_VERSION)/posixpath.py
++|/usr/lib/python$(PYTHON_VERSION)/os.py
++|/usr/lib/python$(PYTHON_VERSION)/re.py
++|/usr/lib/python$(PYTHON_VERSION)/site.py
++|/usr/lib/python$(PYTHON_VERSION)/sre_compile.py
++|/usr/lib/python$(PYTHON_VERSION)/sre_constants.py
++|/usr/lib/python$(PYTHON_VERSION)/sre_parse.py
++|/usr/lib/python$(PYTHON_VERSION)/sysconfig.py
++|/usr/lib/python$(PYTHON_VERSION)/stat.py
++|/usr/lib/python$(PYTHON_VERSION)/traceback.py
++|/usr/lib/python$(PYTHON_VERSION)/types.py
++|/usr/lib/python$(PYTHON_VERSION)/UserDict.py
++|/usr/lib/python$(PYTHON_VERSION)/warnings.py
+endef
+
+define PyPackage/python/filespec
++|/usr/lib/python$(PYTHON_VERSION)
+-|/usr/lib/python$(PYTHON_VERSION)/config
+-|/usr/lib/python$(PYTHON_VERSION)/distutils/cygwinccompiler.py
+-|/usr/lib/python$(PYTHON_VERSION)/distutils/command/wininst*
+-|/usr/lib/python$(PYTHON_VERSION)/idlelib
+-|/usr/lib/python$(PYTHON_VERSION)/lib2to3
+-|/usr/lib/python$(PYTHON_VERSION)/lib-tk
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_testcapi.so
+-|/usr/lib/python$(PYTHON_VERSION)/pdb.doc
+-|/usr/lib/python$(PYTHON_VERSION)/test
+-|/usr/lib/python$(PYTHON_VERSION)/webbrowser.py
+-|/usr/lib/python$(PYTHON_VERSION)/*/test
+-|/usr/lib/python$(PYTHON_VERSION)/*/tests
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline.so
+endef
+
+define PyPackage/python-base/install
+       $(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python
+       $(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python2
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* $(1)/usr/lib/
+endef
+
+HOST_CONFIGURE_ARGS+= \
+       --without-cxx-main \
+       --without-pymalloc \
+       --with-threads \
+       --prefix=$(STAGING_DIR_HOST) \
+       CONFIG_SITE= \
+       OPT="$(HOST_CFLAGS)"
+
+define Host/Install
+       $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/
+       $(MAKE) -C $(HOST_BUILD_DIR) install
+       $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(STAGING_DIR_HOST)/bin/pgen2
+endef
+
+$(eval $(call HostBuild))
+
+$(eval $(call PyPackage,python-base))
+$(eval $(call PyPackage,python))
+
+$(eval $(call BuildPackage,python-base))
+$(eval $(call BuildPackage,python))
diff --git a/lang/python/files/config.site b/lang/python/files/config.site
new file mode 100644 (file)
index 0000000..cfa56b8
--- /dev/null
@@ -0,0 +1,12 @@
+#! /bin/sh
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+ac_cv_file__dev_ptmx=yes
+ac_cv_file__dev_ptc=no
+ac_cv_buggy_getaddrinfo=no
+
diff --git a/lang/python/files/python-package.mk b/lang/python/files/python-package.mk
new file mode 100644 (file)
index 0000000..3a71d09
--- /dev/null
@@ -0,0 +1,100 @@
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+PYTHON_VERSION:=2.7
+PYTHON_VERSION_MICRO:=8
+
+PYTHON_DIR:=$(STAGING_DIR)/usr
+PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin
+PYTHON_INC_DIR:=$(PYTHON_DIR)/include/python$(PYTHON_VERSION)
+PYTHON_LIB_DIR:=$(PYTHON_DIR)/lib/python$(PYTHON_VERSION)
+
+PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages
+
+PYTHON:=python$(PYTHON_VERSION)
+
+HOST_PYTHON_LIB_DIR:=$(STAGING_DIR_HOST)/lib/python$(PYTHON_VERSION)
+HOST_PYTHON_BIN:=$(STAGING_DIR_HOST)/bin/python2
+
+PYTHONPATH:=$(PYTHON_LIB_DIR):$(STAGING_DIR)/$(PYTHON_PKG_DIR)
+PYTHONPATH+=:$(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
+define HostPython
+       (       export PYTHONPATH="$(PYTHONPATH)"; \
+               export PYTHONOPTIMIZE=""; \
+               export PYTHONDONTWRITEBYTECODE=1; \
+               $(1) \
+               $(HOST_PYTHON_BIN) $(2); \
+       )
+endef
+
+PKG_USE_MIPS16:=0
+# This is required in addition to PKG_USE_MIPS16:=0 because otherwise MIPS16
+# flags are inherited from the Python base package (via sysconfig module)
+ifdef CONFIG_USE_MIPS16
+  TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16
+endif
+
+define PyPackage
+  $(call shexport,PyPackage/$(1)/filespec)
+
+  define Package/$(1)/install
+       find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
+       @echo "$$$$$$$$$$(call shvar,PyPackage/$(1)/filespec)" | ( \
+               IFS='|'; \
+               while read fop fspec fperm; do \
+                 if [ "$$$$$$$$fop" = "+" ]; then \
+                       if [ ! -e "$(PKG_INSTALL_DIR)$$$$$$$$fspec" ]; then \
+                         echo "File not found '$(PKG_INSTALL_DIR)$$$$$$$$fspec'"; \
+                         exit 1; \
+                       fi; \
+                       dpath=`dirname "$$$$$$$$fspec"`; \
+                       if [ -n "$$$$$$$$fperm" ]; then \
+                         dperm="-m$$$$$$$$fperm"; \
+                       else \
+                         dperm=`stat -c "%a" $(PKG_INSTALL_DIR)$$$$$$$$dpath`; \
+                       fi; \
+                       mkdir -p $$$$$$$$$dperm $$(1)$$$$$$$$dpath; \
+                       echo "copying: '$$$$$$$$fspec'"; \
+                       cp -fpR $(PKG_INSTALL_DIR)$$$$$$$$fspec $$(1)$$$$$$$$dpath/; \
+                       if [ -n "$$$$$$$$fperm" ]; then \
+                         chmod -R $$$$$$$$fperm $$(1)$$$$$$$$fspec; \
+                       fi; \
+                 elif [ "$$$$$$$$fop" = "-" ]; then \
+                       echo "removing: '$$$$$$$$fspec'"; \
+                       rm -fR $$(1)$$$$$$$$fspec; \
+                 elif [ "$$$$$$$$fop" = "=" ]; then \
+                       echo "setting permissions: '$$$$$$$$fperm' on '$$$$$$$$fspec'"; \
+                       chmod -R $$$$$$$$fperm $$(1)$$$$$$$$fspec; \
+                 fi; \
+               done; \
+       )
+       $(call PyPackage/$(1)/install,$$(1))
+  endef
+endef
+
+# $(1) => build subdir
+# $(2) => additional arguments to setup.py
+# $(3) => additional variables
+define Build/Compile/PyMod
+       $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
+       $(call HostPython, \
+               cd $(PKG_BUILD_DIR)/$(strip $(1)); \
+               CC="$(TARGET_CC)" \
+               CCSHARED="$(TARGET_CC) $(FPIC)" \
+               LD="$(TARGET_CC)" \
+               LDSHARED="$(TARGET_CC) -shared" \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON_INC_DIR)" \
+               LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON_VERSION)" \
+               _PYTHON_HOST_PLATFORM="linux-$(ARCH)" \
+               __PYVENV_LAUNCHER__="/usr/bin/$(PYTHON)" \
+               $(3) \
+               , \
+               ./setup.py $(2) \
+       )
+       find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
+endef
diff --git a/lang/python/patches/110-enable-zlib.patch b/lang/python/patches/110-enable-zlib.patch
new file mode 100644 (file)
index 0000000..780831e
--- /dev/null
@@ -0,0 +1,25 @@
+From 6eeab87bc852481e599325549c854b701bf2e39f Mon Sep 17 00:00:00 2001
+From: Alexandru Ardelean <aa@ocedo.com>
+Date: Thu, 25 Sep 2014 18:18:29 +0300
+Subject: [PATCH] enable zlib
+
+---
+ Modules/Setup.dist | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Modules/Setup.dist b/Modules/Setup.dist
+index 01fb85f..01ac492 100644
+--- a/Modules/Setup.dist
++++ b/Modules/Setup.dist
+@@ -358,7 +358,7 @@ _symtable symtablemodule.c
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See http://www.gzip.org/zlib/
+-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -lz
+ # Interface to the Expat XML parser
+ #
+-- 
+1.8.4.5
+
diff --git a/lang/python/patches/120-do-not-add-include-dirs-when-cross-compiling.patch b/lang/python/patches/120-do-not-add-include-dirs-when-cross-compiling.patch
new file mode 100644 (file)
index 0000000..fb2fe8a
--- /dev/null
@@ -0,0 +1,14 @@
+diff --git a/setup.py b/setup.py
+index cbdeaf3..5154412 100644
+--- a/setup.py
++++ b/setup.py
+@@ -480,7 +480,8 @@ class PyBuildExt(build_ext):
+                         add_dir_to_list(dir_list, directory)
+         if os.path.normpath(sys.prefix) != '/usr' \
+-                and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
++                and not sysconfig.get_config_var('PYTHONFRAMEWORK') \
++                and not cross_compiling:
+             # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+             # (PYTHONFRAMEWORK is set) to avoid # linking problems when
+             # building a framework with different architectures than
diff --git a/lang/python/patches/130-do-not-run-distutils-tests.patch b/lang/python/patches/130-do-not-run-distutils-tests.patch
new file mode 100644 (file)
index 0000000..4fdd2bb
--- /dev/null
@@ -0,0 +1,37 @@
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index bcd83bf..c4dcc6d 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1005,32 +1005,6 @@ libinstall:     build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
+               done; \
+       done
+       $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
+-      if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
+-              $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+-                      $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+-      fi
+-      PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
+-              $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+-              -d $(LIBDEST) -f \
+-              -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+-              $(DESTDIR)$(LIBDEST)
+-      PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+-              $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
+-              -d $(LIBDEST) -f \
+-              -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+-              $(DESTDIR)$(LIBDEST)
+-      -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
+-              $(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
+-              -d $(LIBDEST)/site-packages -f \
+-              -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+-      -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+-              $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
+-              -d $(LIBDEST)/site-packages -f \
+-              -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+-      -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+-              $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+-      -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+-              $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+ # Create the PLATDIR source directory, if one wasn't distributed..
+ $(srcdir)/Lib/$(PLATDIR):
diff --git a/lang/python/patches/140-do-not-write-bytes-codes.patch b/lang/python/patches/140-do-not-write-bytes-codes.patch
new file mode 100644 (file)
index 0000000..f67e7dc
--- /dev/null
@@ -0,0 +1,22 @@
+diff --git a/Python/pythonrun.c b/Python/pythonrun.c
+index 748a63b..cb6e291 100644
+--- a/Python/pythonrun.c
++++ b/Python/pythonrun.c
+@@ -79,7 +79,7 @@ int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */
+ int Py_InspectFlag; /* Needed to determine whether to exit at SystemExit */
+ int Py_NoSiteFlag; /* Suppress 'import site' */
+ int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */
+-int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */
++int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.py[co]) */
+ int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */
+ int Py_FrozenFlag; /* Needed by getpath.c */
+ int Py_UnicodeFlag = 0; /* Needed by compile.c */
+@@ -174,7 +174,7 @@ Py_InitializeEx(int install_sigs)
+     if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0')
+         Py_OptimizeFlag = add_flag(Py_OptimizeFlag, p);
+     if ((p = Py_GETENV("PYTHONDONTWRITEBYTECODE")) && *p != '\0')
+-        Py_DontWriteBytecodeFlag = add_flag(Py_DontWriteBytecodeFlag, p);
++        Py_DontWriteBytecodeFlag = atoi(p);
+     /* The variable is only tested for existence here; _PyRandom_Init will
+        check its value further. */
+     if ((p = Py_GETENV("PYTHONHASHSEED")) && *p != '\0')
index d97611ea8c6189a5143a0902647c8fed8796b4cc..2e9a8715cead6805af7d48725d041d56aa338a07 100644 (file)
@@ -19,7 +19,7 @@ PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
 
 PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.python.org/ftp/python/$(PKG_VERSION)
-PKG_MD5SUM:=6cafc183b4106476dd73d5738d7f616a
+PKG_MD5SUM:=36fc7327c02c6f12fa24fc9ba78039e3
 
 PKG_LICENSE:=PSF
 PKG_LICENSE_FILES:=LICENSE Modules/_ctypes/libffi_msvc/LICENSE Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi/LICENSE Modules/_ctypes/libffi_osx/LICENSE Tools/pybench/LICENSE
@@ -31,7 +31,7 @@ HOST_BUILD_PARALLEL:=1
 PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION)
 
-PKG_BUILD_DEPENDS:=python3/host
+PKG_BUILD_DEPENDS:=libffi/host python3/host
 
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
@@ -54,88 +54,76 @@ define Package/python3/Default/description
  the development of higher quality, more maintainable code.
 endef
 
-define Package/python3
+define Package/python3-base
 $(call Package/python3/Default)
+  TITLE:=Python $(PYTHON_VERSION) interpreter
   DEPENDS:=+libpthread +zlib +libffi
 endef
 
+define Package/python3-base/description
+  This package contains only the interpreter and the bare minimum
+  for the interpreter to start.
+endef
+
+define Package/python3
+$(call Package/python3/Default)
+  DEPENDS:=+python3-base +libncursesw +libbz2 +libgdbm +libsqlite3 +libdb47 +libopenssl
+endef
+
 define Package/python3/description
-$(call Package/python3/Default/description)
-  .
-  This package contains only the interpreter and the bare minimum for the interpreter to start.
+  This package contains the (almost) full Python install.
 endef
 
-MAKE_FLAGS:=\
-       $(TARGET_CONFIGURE_OPTS) \
-       DESTDIR="$(PKG_INSTALL_DIR)" \
+MAKE_FLAGS+=\
        CROSS_COMPILE=yes \
-       CFLAGS="$(TARGET_CFLAGS) -DNDEBUG -fno-inline" \
-       LDFLAGS="$(TARGET_LDFLAGS)" \
-       LD="$(TARGET_CC)"
+       LD="$(TARGET_CC)" \
+       PGEN=pgen3
+
+EXTRA_CFLAGS+= \
+       -DNDEBUG -fno-inline
+EXTRA_LDFLAGS+= \
+       -L$(PKG_BUILD_DIR)
 
 ENABLE_IPV6:=
 ifeq ($(CONFIG_IPV6),y)
        ENABLE_IPV6 += --enable-ipv6
 endif
 
-#=======================================================================
-# Notes: adding these so that I don't forget, and can track why stuff
-#        was did as was did
-# - Arguments below were moved to ./files/config.site file, and disabled
-#          ac_cv_have_chflags=no \
-#          ac_cv_have_lchflags=no \
-#          ac_cv_py_format_size_t=no \
-#          ac_cv_have_long_long_format=yes \
-#          ac_cv_buggy_getaddrinfo=no \
-# - --without-ensurepip added, because the build wants to ensure that
-#   it works; that's a good idea, but for now, it requires special 
-#   setup, and we can do that later
-# - --without-pymalloc added, becase in Python 3, modules are suffixed
-#   with m; e.g. so some paths are python3.4m instead of python3.4 
-#   all this is detailed here:
-#     http://legacy.python.org/dev/peps/pep-3149/
-#=======================================================================
-
-define Build/Configure
-       -$(MAKE) -C $(PKG_BUILD_DIR) distclean
-       (cd $(PKG_BUILD_DIR); autoreconf --force --install || exit 0)
-       $(CP) ./files/config.site $(PKG_BUILD_DIR)
-       $(call Build/Configure/Default, \
-               --sysconfdir=/etc \
-               --disable-shared \
-               --without-cxx-main \
-               --with-threads \
-               --with-system-ffi="$(STAGING_DIR)/usr" \
-               --without-ensurepip \
-               --without-pymalloc \
-               $(ENABLE_IPV6) \
-               CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
-               OPT="$(TARGET_CFLAGS)" \
-       )
+CONFIGURE_ARGS+= \
+       --sysconfdir=/etc \
+       --enable-shared \
+       --without-cxx-main \
+       --with-threads \
+       --with-system-ffi="$(STAGING_DIR)/usr" \
+       --without-pymalloc \
+       --without-ensurepip \
+       $(ENABLE_IPV6) \
+       CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
+       OPT="$(TARGET_CFLAGS)"
+
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       $(CP) ./files/config.site $(PKG_BUILD_DIR)/config.site
 endef
 
 define Build/InstallDev
-       $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib
        $(INSTALL_DIR) $(STAGING_DIR)/mk/
+       $(INSTALL_DIR) $(1)/usr/include/ $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/
        $(INSTALL_DATA) ./files/python3-package.mk $(STAGING_DIR)/mk/
        $(CP) \
                $(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
                $(1)/usr/include/
        $(CP) \
                $(STAGING_DIR_HOST)/lib/python$(PYTHON_VERSION) \
-               $(PKG_BUILD_DIR)/libpython$(PYTHON_VERSION).a \
+               $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* \
                $(1)/usr/lib/
        $(CP) \
                $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION) \
                $(1)/usr/lib/python$(PYTHON_VERSION)/
-
-       $(CP) \
-               $(STAGING_DIR_HOST)/bin/python$(PYTHON_VERSION)-config \
-               $(2)/bin/
-       $(SED) 's,^#!.*,#!/usr/bin/env python$(PYTHON_VERSION),g' $(2)/bin/python$(PYTHON_VERSION)-config
 endef
 
-define Py3Package/python3/filespec
+define Py3Package/python3-base/filespec
 +|/usr/bin/python$(PYTHON_VERSION)
 +|/usr/lib/python$(PYTHON_VERSION)/encodings
 +|/usr/lib/python$(PYTHON_VERSION)/_collections_abc.py
@@ -153,45 +141,56 @@ define Py3Package/python3/filespec
 +|/usr/lib/python$(PYTHON_VERSION)/stat.py
 endef
 
-define Py3Package/python3/install
+define Py3Package/python3/filespec
++|/usr/lib/python$(PYTHON_VERSION)
+-|/usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION)
+-|/usr/lib/python$(PYTHON_VERSION)/distutils/cygwinccompiler.py
+-|/usr/lib/python$(PYTHON_VERSION)/distutils/command/wininst*
+-|/usr/lib/python$(PYTHON_VERSION)/idlelib
+-|/usr/lib/python$(PYTHON_VERSION)/lib2to3
+-|/usr/lib/python$(PYTHON_VERSION)/tkinter
+-|/usr/lib/python$(PYTHON_VERSION)/turtledemo
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_test*.so
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline*.so
+-|/usr/lib/python$(PYTHON_VERSION)/pdb.doc
+-|/usr/lib/python$(PYTHON_VERSION)/test
+-|/usr/lib/python$(PYTHON_VERSION)/webbrowser.py
+-|/usr/lib/python$(PYTHON_VERSION)/*/test
+-|/usr/lib/python$(PYTHON_VERSION)/*/tests
+endef
+
+define Py3Package/python3-base/install
        # Adding the lib-dynload folder (even just empty) suppresses 2 warnings when starting Python
        $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/lib-dynload/
+       $(INSTALL_DIR) $(1)/usr/bin
        $(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python3
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* $(1)/usr/lib/
 endef
 
-define Host/Configure
-       -$(MAKE) -C $(HOST_BUILD_DIR) distclean
-       (cd $(HOST_BUILD_DIR); autoreconf --force --install || exit 0)
-       (cd $(HOST_BUILD_DIR); \
-               rm -rf config.cache; \
-               CONFIG_SITE= \
-               OPT="$(HOST_CFLAGS)" \
-               ./configure \
-                       --without-cxx-main \
-                       --without-ensurepip \
-                       --without-pymalloc \
-                       --with-threads \
-                       --prefix=$(STAGING_DIR_HOST); \
-       )
-endef
+HOST_CONFIGURE_ARGS+= \
+       --without-cxx-main \
+       --without-pymalloc \
+       --without-ensurepip \
+       --with-threads \
+       --prefix=$(STAGING_DIR_HOST) \
+       CONFIG_SITE= \
+       OPT="$(HOST_CFLAGS)"
 
 define Host/Compile
-       +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
-               python Parser/pgen
-       +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
-               sharedmods
+       +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) python Parser/pgen
+       +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) sharedmods
 endef
 
 define Host/Install
        $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/
-       $(MAKE) -C $(HOST_BUILD_DIR) \
-               install
-       $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(STAGING_DIR_HOST)/bin/
+       $(MAKE) -C $(HOST_BUILD_DIR) install
+       $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(STAGING_DIR_HOST)/bin/pgen3
 endef
 
-
 $(eval $(call HostBuild))
 
+$(eval $(call Py3Package,python3-base))
 $(eval $(call Py3Package,python3))
 
+$(eval $(call BuildPackage,python3-base))
 $(eval $(call BuildPackage,python3))
index f4113357a0afb541c77172570ee86f5076e7c4fe..cfa56b89b58e0b7fed9b3bf96288bcc1a1981bc8 100644 (file)
@@ -8,11 +8,5 @@
 
 ac_cv_file__dev_ptmx=yes
 ac_cv_file__dev_ptc=no
-
-# FIXME: moved from Makefile here
-#ac_cv_have_chflags=no \
-#ac_cv_have_lchflags=no \
-#ac_cv_py_format_size_t=no \
-#ac_cv_have_long_long_format=yes \
-#ac_cv_buggy_getaddrinfo=no \
+ac_cv_buggy_getaddrinfo=no
 
index e85b648197e5b31b12082742a842797d5f002bc0..9ab2da9e9406ef5047b557bb37d184855c7f7206 100644 (file)
@@ -6,7 +6,7 @@
 #
 
 PYTHON3_VERSION:=3.4
-PYTHON3_VERSION_MICRO:=1
+PYTHON3_VERSION_MICRO:=2
 
 PYTHON3_DIR:=$(STAGING_DIR)/usr
 PYTHON3_BIN_DIR:=$(PYTHON3_DIR)/bin
@@ -17,10 +17,13 @@ PYTHON3_PKG_DIR:=/usr/lib/python$(PYTHON3_VERSION)/site-packages
 
 PYTHON3:=python$(PYTHON3_VERSION)
 
+HOST_PYTHON3_LIB_DIR:=$(STAGING_DIR_HOST)/lib/python$(PYTHON3_VERSION)
 HOST_PYTHON3_BIN:=$(STAGING_DIR_HOST)/bin/python3
 
+PYTHON3PATH:=$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR)
+PYTHON3PATH+=:$(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
 define HostPython3
-       (       export PYTHONPATH="$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR)"; \
+       (       export PYTHONPATH="$(PYTHON3PATH)"; \
                export PYTHONOPTIMIZE=""; \
                export PYTHONDONTWRITEBYTECODE=1; \
                $(1) \
@@ -28,14 +31,26 @@ define HostPython3
        )
 endef
 
+PKG_USE_MIPS16:=0
+# This is required in addition to PKG_USE_MIPS16:=0 because otherwise MIPS16
+# flags are inherited from the Python base package (via sysconfig module)
+ifdef CONFIG_USE_MIPS16
+  TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16
+endif
+
 define Py3Package
   $(call shexport,Py3Package/$(1)/filespec)
 
   define Package/$(1)/install
-       @$(SH_FUNC) getvar $$(call shvar,Py3Package/$(1)/filespec) | ( \
+       find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
+       @echo "$$$$$$$$$$(call shvar,Py3Package/$(1)/filespec)" | ( \
                IFS='|'; \
                while read fop fspec fperm; do \
                  if [ "$$$$$$$$fop" = "+" ]; then \
+                       if [ ! -e "$(PKG_INSTALL_DIR)$$$$$$$$fspec" ]; then \
+                         echo "File not found '$(PKG_INSTALL_DIR)$$$$$$$$fspec'"; \
+                         exit 1; \
+                       fi; \
                        dpath=`dirname "$$$$$$$$fspec"`; \
                        if [ -n "$$$$$$$$fperm" ]; then \
                          dperm="-m$$$$$$$$fperm"; \
@@ -65,11 +80,18 @@ endef
 # $(2) => additional arguments to setup.py
 # $(3) => additional variables
 define Build/Compile/Py3Mod
+       $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
        $(call HostPython3, \
                cd $(PKG_BUILD_DIR)/$(strip $(1)); \
+               CC="$(TARGET_CC)" \
+               CCSHARED="$(TARGET_CC) $(FPIC)" \
+               LD="$(TARGET_CC)" \
+               LDSHARED="$(TARGET_CC) -shared" \
                CFLAGS="$(TARGET_CFLAGS)" \
-               CPPFLAGS="$(TARGET_CPPFLAGS)" \
-               LDFLAGS="$(TARGET_LDFLAGS)" \
+               CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON3_INC_DIR)" \
+               LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON3_VERSION)" \
+               _PYTHON_HOST_PLATFORM="linux-$(ARCH)" \
+               __PYVENV_LAUNCHER__="/usr/bin/$(PYTHON3)" \
                $(3) \
                , \
                ./setup.py $(2) \
diff --git a/lang/python3/patches/120-do-not-add-include-dirs-when-cross-compiling.patch b/lang/python3/patches/120-do-not-add-include-dirs-when-cross-compiling.patch
new file mode 100644 (file)
index 0000000..44be1c8
--- /dev/null
@@ -0,0 +1,14 @@
+diff --git a/setup.py b/setup.py
+index 93f390f..ace1494 100644
+--- a/setup.py
++++ b/setup.py
+@@ -461,7 +461,8 @@ class PyBuildExt(build_ext):
+                         add_dir_to_list(dir_list, directory)
+         if os.path.normpath(sys.base_prefix) != '/usr' \
+-                and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
++                and not sysconfig.get_config_var('PYTHONFRAMEWORK') \
++                and not cross_compiling:
+             # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+             # (PYTHONFRAMEWORK is set) to avoid # linking problems when
+             # building a framework with different architectures than
diff --git a/lang/python3/patches/130-do-not-run-distutils-tests.patch b/lang/python3/patches/130-do-not-run-distutils-tests.patch
new file mode 100644 (file)
index 0000000..0291eb1
--- /dev/null
@@ -0,0 +1,37 @@
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index f36c11d..f2b6c71 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1217,32 +1217,6 @@ libinstall:     build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
+               done; \
+       done
+       $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
+-      if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
+-              $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+-                      $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+-      fi
+-      -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
+-              $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
+-              -d $(LIBDEST) -f \
+-              -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+-              $(DESTDIR)$(LIBDEST)
+-      -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+-              $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
+-              -d $(LIBDEST) -f \
+-              -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+-              $(DESTDIR)$(LIBDEST)
+-      -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
+-              $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
+-              -d $(LIBDEST)/site-packages -f \
+-              -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+-      -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+-              $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
+-              -d $(LIBDEST)/site-packages -f \
+-              -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+-      -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+-              $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+-      -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+-              $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+ # Create the PLATDIR source directory, if one wasn't distributed..
+ $(srcdir)/Lib/$(PLATDIR):
diff --git a/lang/python3/patches/140-do-not-write-bytes-codes.patch b/lang/python3/patches/140-do-not-write-bytes-codes.patch
new file mode 100644 (file)
index 0000000..f624d58
--- /dev/null
@@ -0,0 +1,22 @@
+diff --git a/Python/pythonrun.c b/Python/pythonrun.c
+index 0327830..df41cda 100644
+--- a/Python/pythonrun.c
++++ b/Python/pythonrun.c
+@@ -124,7 +124,7 @@ int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */
+ int Py_InspectFlag; /* Needed to determine whether to exit at SystemExit */
+ int Py_NoSiteFlag; /* Suppress 'import site' */
+ int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */
+-int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */
++int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.py[co]) */
+ int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */
+ int Py_FrozenFlag; /* Needed by getpath.c */
+ int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */
+@@ -350,7 +350,7 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
+     if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0')
+         Py_OptimizeFlag = add_flag(Py_OptimizeFlag, p);
+     if ((p = Py_GETENV("PYTHONDONTWRITEBYTECODE")) && *p != '\0')
+-        Py_DontWriteBytecodeFlag = add_flag(Py_DontWriteBytecodeFlag, p);
++        Py_DontWriteBytecodeFlag = atoi(p);
+     /* The variable is only tested for existence here; _PyRandom_Init will
+        check its value further. */
+     if ((p = Py_GETENV("PYTHONHASHSEED")) && *p != '\0')
index 8b81daa99e7d1f892f724cdf706494e2f261c86d..4a955a85d1b7ed05768d9109d85850ddb8b19799 100644 (file)
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ruby
-PKG_VERSION:=2.1.3
-PKG_RELEASE:=2
+PKG_VERSION:=2.1.4
+PKG_RELEASE:=1
 
 PKG_LIBVER:=2.1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://cache.ruby-lang.org/pub/ruby/$(PKG_LIBVER)/
-PKG_MD5SUM:=02b7da3bb06037c777ca52e1194efccb
+PKG_MD5SUM:=f4136e781d261e3cc20748005e1740b7
 PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
 PKG_LICENSE:=BSD-2-Clause
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 
 PKG_BUILD_DEPENDS:=ruby/host
 PKG_INSTALL:=1
@@ -86,7 +86,7 @@ endef
 
 define Package/ruby-bigdecimal
 $(call Package/ruby/Default)
-  TITLE:=Arbitrary-precision decimal floating-point library for Ruby
+  TITLE:=Arbitrary-precision decimal floating-point lib for Ruby
   DEPENDS:=ruby
 endef
 
index 09d72eb6897e4460746831c2de5fcdfe4a42f476..a4ccc233172718f26af6573db2a0c3e0664a2533 100644 (file)
@@ -18,7 +18,7 @@ PKG_MD5SUM:=c9e21b88a2b3e6e12ea7ba0f3b271fc3
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=LGPLv2.1 GPLv2
-PKG_LICENSE_FILE:=COPYING aserver/COPYING
+PKG_LICENSE_FILES:=COPYING aserver/COPYING
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index f2d882d32cae8bf32edaa465b6b03c1aa01f3559..9dc3270f5733dbc34afb4610d1156a009ff8583e 100644 (file)
@@ -18,7 +18,7 @@ endif
 
 PKG_NAME:=avahi
 PKG_VERSION:=0.6.31
-PKG_RELEASE:=6
+PKG_RELEASE:=8
 
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
@@ -103,6 +103,7 @@ define Package/avahi-daemon
   DEPENDS:=+libavahi +libexpat +librt +libdaemon
   endif
   TITLE+= (daemon)
+  MENU:=1
 endef
 
 define Package/avahi-daemon/description
@@ -113,7 +114,39 @@ endef
 
 define Package/avahi-daemon/conffiles
 /etc/avahi/avahi-daemon.conf
+endef
+
+define Package/avahi-daemon-service-http
+  $(call Package/avahi/Default)
+  SUBMENU:=IP Addresses and Names
+  DEPENDS:=avahi-daemon
+  TITLE:=Announce HTTP service
+endef
+
+define Package/avahi-daemon-service-http/description
+$(call Package/avahi/Default/description)
+ .
+ This package contains the service definition for announcing HTTP service.
+endef
+
+define Package/avahi-daemon-service-http/conffiles
 /etc/avahi/services/http.service
+endef
+
+define Package/avahi-daemon-service-ssh
+  $(call Package/avahi/Default)
+  SUBMENU:=IP Addresses and Names
+  DEPENDS:=avahi-daemon
+  TITLE:=Announce SSH service
+endef
+
+define Package/avahi-daemon-service-ssh/description
+$(call Package/avahi/Default/description)
+ .
+ This package contains the service definition for announcing SSH service.
+endef
+
+define Package/avahi-daemon-service-ssh/conffiles
 /etc/avahi/services/ssh.service
 endef
 
@@ -172,6 +205,22 @@ $(call Package/avahi/Default/description)
  For more information please see the avahi documentation.
 endef
 
+define Package/libavahi-compat-libdnssd
+  $(call Package/avahi/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libavahi-client
+  TITLE+= (libdnssd)
+endef
+
+define Package/libavahi-compat-libdnssd/description
+$(call Package/avahi/Default/description)
+ .
+ This packages adds the libavahi-compat-libdnssd library.
+ It also automatically adds the required libavahi-client package.
+ For more information please see the avahi documentation.
+endef
+
 define Package/avahi-utils
   $(call Package/avahi/Default)
   SUBMENU:=IP Addresses and Names
@@ -203,6 +252,7 @@ CONFIGURE_ARGS+= \
        --disable-dbm \
        --enable-gdbm \
        --enable-libdaemon \
+       $(if $(CONFIG_PACKAGE_libavahi-compat-libdnssd),--enable-compat-libdns_sd) \
        --disable-python \
        --disable-pygtk \
        --disable-python-dbus \
@@ -247,6 +297,9 @@ define Build/InstallDev
        $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-* $(1)/usr/lib/
+ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd* $(1)/usr/lib/
+endif
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
 endef
@@ -273,6 +326,11 @@ define Package/libavahi-client/install
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-client.so.* $(1)/usr/lib/
 endef
 
+define Package/libavahi-compat-libdnssd/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so.* $(1)/usr/lib/
+endef
+
 define Package/avahi-utils/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
@@ -297,6 +355,16 @@ define Package/avahi-daemon/install
        $(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
 endef
 
+define Package/avahi-daemon-service-http/install
+       $(INSTALL_DIR) $(1)/etc/avahi/services
+       $(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service
+endef
+
+define Package/avahi-daemon-service-ssh/install
+       $(INSTALL_DIR) $(1)/etc/avahi/services
+       $(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service
+endef
+
 define Package/avahi-dnsconfd/install
        $(INSTALL_DIR) $(1)/etc/avahi
        $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
@@ -305,9 +373,12 @@ define Package/avahi-dnsconfd/install
 endef
 
 $(eval $(call BuildPackage,libavahi-client))
+$(eval $(call BuildPackage,libavahi-compat-libdnssd))
 $(eval $(call BuildPackage,avahi-utils))
 $(eval $(call BuildPackage,libavahi-dbus-support))
 $(eval $(call BuildPackage,libavahi))
 $(eval $(call BuildPackage,avahi-autoipd))
 $(eval $(call BuildPackage,avahi-daemon))
+$(eval $(call BuildPackage,avahi-daemon-service-http))
+$(eval $(call BuildPackage,avahi-daemon-service-ssh))
 $(eval $(call BuildPackage,avahi-dnsconfd))
index 7e9be2d424d2697e493efc0272f2e0247d9a3592..326203792eb8f08b9d955b8e742eccd8cf251a0f 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" standalone='no'?><!--*-nxml-*-->
 <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
 <service-group>
- <name replace-wildcards="yes">Web Server on %h</name>
+ <name replace-wildcards="yes">%h</name>
   <service>
    <type>_http._tcp</type>
    <port>80</port>
index b415803784dc817eccd8f4ea3645806ec28bae63..b44585157718eb829e074268d64060f456de0ceb 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" standalone='no'?><!--*-nxml-*-->
 <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
 <service-group>
- <name replace-wildcards="yes">Secure Shell on %h</name>
+ <name replace-wildcards="yes">%h</name>
   <service>
    <type>_ssh._tcp</type>
    <port>22</port>
index ab36e58123f10ef3a39836d8fa6392234fc9c52f..dfc21d2ed04007b7d2a7a4e34552e5f9777e617c 100644 (file)
@@ -32,7 +32,7 @@ define Package/libsasl2
   CATEGORY:=Libraries
   TITLE:=A general purpose authentication library
   URL:=http://asg.web.cmu.edu/sasl/
-  DEPENDS:=libopenssl
+  DEPENDS:=+libopenssl
 endef
 
 TARGET_CFLAGS += $(FPIC)
index 2083fc9dcabf74600bb896abdd99a96f11cd3763..563d47c881ae4d146fb34fb5a0344634e10f1625 100644 (file)
@@ -12,7 +12,7 @@ BASE_VERSION:=4.7.25
 
 PKG_NAME:=db47
 PKG_VERSION:=$(BASE_VERSION).4.NC
-PKG_RELEASE:=1
+PKG_RELEASE:=3
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/db-$(BASE_VERSION).NC
 PKG_SOURCE:=db-$(BASE_VERSION).NC.tar.gz
@@ -35,6 +35,7 @@ define Package/libdb47
   DEPENDS:=+libxml2
   TITLE:=Berkeley DB library (4.7)
   URL:=http://www.oracle.com/us/products/database/berkeley-db
+  PROVIDES:=libdb47-full
 endef
 
 define Package/libdb47/description
@@ -47,6 +48,7 @@ define Package/libdb47xx
   DEPENDS:=+libdb47 $(CXX_DEPENDS)
   TITLE:=Berkeley DB library (4.7) for C++
   URL:=http://www.oracle.com/us/products/database/berkeley-db
+  PROVIDES:=libdb47xx-full
 endef
 
 define Package/libdb47xx/description
@@ -64,9 +66,7 @@ CONFIGURE_ARGS += \
        --disable-tcl \
        --disable-rpc \
        --enable-compat185 \
-       --enable-smallbuild \
        --disable-debug \
-       --enable-cryptography \
        $(if $(CONFIG_PACKAGE_libdb47xx),--enable-cxx,--disable-cxx)
 
 TARGET_CFLAGS += $(FPIC)
diff --git a/libs/dmx_usb_module/Makefile b/libs/dmx_usb_module/Makefile
new file mode 100644 (file)
index 0000000..d9e458f
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=dmx_usb_module
+PKG_VERSION:=0.1.20130818
+PKG_RELEASE:=0.1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=git://github.com/lowlander/dmx_usb_module.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=ee99ca7edbd9e093480ad63341ac007394047bde
+PKG_MAINTAINER:=Martijn Zilverschoon <martijn@friedzombie.com>
+PKG_LICENSE:=GPL-2.0
+
+include $(INCLUDE_DIR)/package.mk
+
+define KernelPackage/usb-serial-dmx_usb_module
+       SECTION:=kernel
+       CATEGORY:=Kernel modules
+       SUBMENU:=USB Support
+       TITLE:=Support for FTDI RS485 based DMX modules
+       URL:=http://www.erwinrol.com/open-dmx-usb-linux-driver/
+       FILES:=$(PKG_BUILD_DIR)/dmx_usb.$(LINUX_KMOD_SUFFIX)
+       AUTOLOAD:=$(call AutoProbe,dmx_usb)
+       DEPENDS+=kmod-usb-serial
+endef
+
+define KernelPackage/usb-serial-dmx_usb_module/description
+       Open DMX USB is an open USB to DMX dongle hardware design developed by Enttec.
+       The Open in Open DMX USB refers to the fact that everybody is free to use the
+       design and produce its own USB DMX Dongle without paying any licenses.
+endef
+
+DMX_MAKE_OPTS:= -C $(PKG_BUILD_DIR) \
+       PATH="$(TARGET_PATH)" \
+       ARCH="$(LINUX_KARCH)" \
+       CROSS_COMPILE="$(TARGET_CROSS)" \
+       TARGET="$(HAL_TARGET)" \
+       TOOLPREFIX="$(KERNEL_CROSS)" \
+       TOOLPATH="$(KERNEL_CROSS)" \
+       KERNELPATH="$(LINUX_DIR)" \
+       LDOPTS=" "
+
+define Build/Compile
+  $(MAKE) $(DMX_MAKE_OPTS) M=$(PKG_BUILD_DIR)
+endef
+
+$(eval $(call KernelPackage,usb-serial-dmx_usb_module))
diff --git a/libs/dmx_usb_module/patches/001-dmx_usb_Makefile.patch b/libs/dmx_usb_module/patches/001-dmx_usb_Makefile.patch
new file mode 100644 (file)
index 0000000..2a03d94
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/Makefile
++++ b/Makefile
+@@ -12,8 +12,7 @@ KDIR := /lib/modules/$(shell uname -r)/build
+ PWD   := $(shell pwd)
+ default:
+-      $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
+-      gcc -O2 -pipe -Wall dmx_usb_test.c -o dmx_usb_test
++      $(MAKE) -C $(KERNELPATH) SUBDIRS=$(PWD) modules
+ endif
+
index 85f01ba62b906bfdb771cb8fd05605f564a974a2..39bf0bdd7dfc8fb46c044ceb9245b18bfd585e01 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=file
-PKG_VERSION:=5.19
+PKG_VERSION:=5.20
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://ftp.astron.com/pub/file/
-PKG_MD5SUM:=e3526f59023f3f7d1ffa4d541335edab
+PKG_MD5SUM:=5d5e13eb3e0e13839da869a31790faf2
 
 PKG_LICENSE:=BSD-2c
 PKG_LICENSE_FILES:=COPYING
index 4c6b238a6d3a697500d6122e603f00801cdb5fa1..2e7cd6eafd7f7ad103e622c019b8501d41e17366 100644 (file)
@@ -8,19 +8,33 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gnutls
-PKG_VERSION:=3.3.9
+PKG_VERSION:=3.3.11
 PKG_RELEASE:=1
 PKG_USE_MIPS16:=0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3
-PKG_MD5SUM:=ff61b77e39d09f1140ab5a9cf52c58b6
+PKG_MD5SUM:=b657e3010c10cae2244e7ce79ee3d446
 PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
 
 PKG_INSTALL:=1
 PKG_LIBTOOL_PATHS:=. lib
 PKG_CHECK_FORMAT_SECURITY:=0
 
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_GNUTLS_ALPN \
+       CONFIG_GNUTLS_ANON \
+       CONFIG_GNUTLS_CRYPTODEV \
+       CONFIG_GNUTLS_DTLS_SRTP \
+       CONFIG_GNUTLS_EXT_LIBTASN1 \
+       CONFIG_GNUTLS_HEARTBEAT \
+       CONFIG_GNUTLS_OCSP \
+       CONFIG_GNUTLS_OPENPGP \
+       CONFIG_GNUTLS_PKCS11 \
+       CONFIG_GNUTLS_PSK \
+       CONFIG_GNUTLS_SRP \
+       CONFIG_LIBNETTLE_MINI \
+
 include $(INCLUDE_DIR)/package.mk
 
 
diff --git a/libs/gperf/Makefile b/libs/gperf/Makefile
new file mode 100644 (file)
index 0000000..4cdd470
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gperf
+PKG_VERSION:=3.0.4
+PKG_RELEASE:=1
+PKG_MD5SUM:=c1f1db32fb6598d6a93e6e88796a8632
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@GNU/gperf
+PKG_HOST_ONLY=1
+
+PKG_MAINTAINER:=Espen Jürgensen <espenjurgensen+openwrt@gmail.com>
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/gperf
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=GNU gperf
+  BUILDONLY:=1
+  URL:=http://www.gnu.org/software/gperf
+endef
+
+define Package/gperf/description
+ GNU gperf is a perfect hash function generator. For a given list of strings, it
+ produces a hash function and hash table, in form of C or C++ code, for looking 
+ up a value depending on the input string. The hash function is perfect, which 
+ means that the hash table has no collisions, and the hash table lookup needs a
+ single string comparison only.
+endef
+
+define Host/Install
+       $(MAKE) -C $(HOST_BUILD_DIR) install
+endef
+
+$(eval $(call HostBuild))
+$(eval $(call BuildPackage,gperf))
diff --git a/libs/libantlr3c/Makefile b/libs/libantlr3c/Makefile
new file mode 100644 (file)
index 0000000..bd1e51e
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libantlr3c
+PKG_VERSION:=3.2
+PKG_RELEASE:=1
+PKG_MD5SUM:=674646e1d1bf5c6015435480cead725a
+
+PKG_SOURCE_URL:=http://www.antlr3.org/download/C
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_INSTALL:=1
+
+PKG_MAINTAINER:=Espen Jürgensen <espenjurgensen+openwrt@gmail.com>
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libantlr3c
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=libantlr3c
+  URL:=http://www.antlr3.org/
+endef
+
+define Package/libantlr3c/description
+  ANother Tool for Language Recognition, is a language tool that provides a framework for constructing recognizers,
+  interpreters, compilers, and translators from grammatical descriptions containing actions in a variety of target languages.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libantlr3c.{a,so} $(1)/usr/lib/
+endef
+
+define Package/libantlr3c/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libantlr3c.so  $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libantlr3c))
index f3a4317ac3d5111342e7ec26b83e6a1c62381a86..690af47ab98a87aabcfc2ec286353b1097e909f7 100644 (file)
@@ -18,7 +18,7 @@ PKG_MD5SUM:=9f5dd20d7e95fd0dd72df5353829f097
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
diff --git a/libs/libartnet/Makefile b/libs/libartnet/Makefile
new file mode 100644 (file)
index 0000000..c5b003e
--- /dev/null
@@ -0,0 +1,60 @@
+#
+# Copyright (C) 2010-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libartnet
+PKG_VERSION:=1.1.2
+PKG_RELEASE:=1.1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/OpenLightingProject/libartnet/releases/download/1.1.2
+PKG_MD5SUM:=dcceab3efe3dae4c18fa549dbd198e71
+
+PKG_MAINTAINER:=Martijn Zilverschoon <martijn@friedzombie.com>
+
+PKG_LICENSE:=GPL-2.1
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libartnet
+       SECTION:=libs
+       CATEGORY:=Libraries
+       TITLE:=Libartnet is an implementation of the ArtNet protocol.
+       URL:=http://www.openlighting.org/libartnet-main/
+endef
+
+define Package/libartnet/description
+       Libartnet is an implementation of the ArtNet protocol. ArtNet allows the
+       transmission of DMX and related data over IP networks.
+endef
+
+define Build/Configure
+       $(call Build/Configure/Default)
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+       DESTDIR="$(PKG_INSTALL_DIR)" \
+       all install
+endef
+
+define Build/InstallDev
+       mkdir -p $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/artnet $(1)/usr/include/
+       mkdir -p $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libartnet.{so,so.1,so.1.0.0} $(1)/usr/lib/
+endef
+
+
+define Package/libartnet/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libartnet.{so,so.1,so.1.0.0} $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libartnet))
diff --git a/libs/libartnet/patches/001-bswap_16.patch b/libs/libartnet/patches/001-bswap_16.patch
new file mode 100644 (file)
index 0000000..9c9be5f
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/artnet/private.h
++++ b/artnet/private.h
+@@ -100,7 +100,9 @@ extern uint16_t HIGH_BYTE;
+ #endif
+ // byte ordering macros
++#ifndef bswap_16
+ #define bswap_16(x)  ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
++#endif
+ // htols : convert short from host to little endian order
+ #ifdef WIN32
diff --git a/libs/libavl/Makefile b/libs/libavl/Makefile
new file mode 100644 (file)
index 0000000..0ff2385
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libavl
+PKG_VERSION:=0.3.5
+PKG_RELEASE:=1
+PKG_MD5SUM:=882c68ea7f71876ca110f3b84d7ab12d
+
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
+PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/liba/libavl
+PKG_BUILD_DIR:=$(BUILD_DIR)/avl-$(PKG_VERSION)
+PKG_INSTALL:=1
+
+PKG_MAINTAINER:=Espen Jürgensen <espenjurgensen+openwrt@gmail.com>
+PKG_LICENSE:=LGPL-2.0+
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libavl
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=AVLTree (this is not GNU libavl)
+  URL:=https://packages.debian.org/wheezy/libavl1
+endef
+
+define Package/libavl/description
+  AVLTree is a small implementation of AVL trees for the C programming language.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/avl.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavl.so* $(1)/usr/lib/
+endef
+
+define Package/libavl/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavl.so.*  $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libavl))
diff --git a/libs/libavl/patches/010-update_GNUmakefile.patch b/libs/libavl/patches/010-update_GNUmakefile.patch
new file mode 100644 (file)
index 0000000..3013949
--- /dev/null
@@ -0,0 +1,45 @@
+--- a/GNUmakefile      2002-11-15 19:57:48.000000000 +0100
++++ a/GNUmakefile      2014-10-02 16:03:02.864803002 +0200
+@@ -6,7 +6,7 @@
+ LDCONFIG ?= /sbin/ldconfig
+ # Some suggestions: (-mcpu= generates i386 compatible code)
+-CFLAGS ?= -O2 -fomit-frame-pointer -pipe -mcpu=i686 -w
++CFLAGS ?= -O2 -pipe -Wall -Werror
+ #CFLAGS = -O2 -fomit-frame-pointer -pipe -march=i586 -Wall -g
+ #CFLAGS = -O6 -fomit-frame-pointer -pipe -march=i586 -Wall -ansi -pedantic
+ #CFLAGS = -O6 -fomit-frame-pointer -pipe -march=i686 -Wall -ansi -pedantic
+@@ -15,10 +15,9 @@
+ #CFLAGS = -g -pg -a -pipe -march=i686 -Wall
+ #LDFLAGS = -s
+-prefix ?= /usr/local
++prefix ?= /usr
+ libdir ?= $(prefix)/lib
+ includedir ?= $(prefix)/include
+-includedir ?= /usr/include
+ PROGRAMS = avlsort setdiff
+ LIBRARY = libavl.so.1.5
+@@ -34,16 +33,17 @@
+       $(CC) $(LDFLAGS) $^ -o $@ $(LIBS)
+ $(LIBRARY): avl.o
+-      $(CC) -nostdlib -shared -Wl,-soname,libavl.so.1 $^ -o $@ -lc
++      $(CC) -shared -Wl,-soname,libavl.so.1 $^ -o $@ -lc
+ clean:
+       $(RM) *.o $(PROGRAMS) libavl.*
+ install: all
+       $(INSTALL) -d $(DESTDIR)$(libdir)
+-      $(INSTALL) avl.h $(DESTDIR)$(includedir)
+-      $(INSTALL) $(LIBRARIES) $(DESTDIR)$(libdir)
+-      for i in $(LIBRARIES); do\
++      $(INSTALL) -d $(DESTDIR)$(includedir)
++      $(INSTALL) -m 644 avl.h $(DESTDIR)$(includedir)
++      $(INSTALL) -m 644 $(LIBRARY) $(DESTDIR)$(libdir)
++      for i in $(LIBRARY); do\
+               $(LN) -sf $$i $(DESTDIR)$(libdir)/$${i%.*};\
+               $(LN) -sf $${i%.*} $(DESTDIR)$(libdir)/$${i%.*.*};\
+       done
index 3ff5bae6775cb981b3ea9f88aa4ab7843fb35423..e5a2da7f3175f51ab3e6bb7c33c694d7aee226de 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=@SF/libdbi-drivers
 PKG_MD5SUM:=9f47b960e225eede2cdeaabf7d22f59f
 
 PKG_LICENSE:=LGPL-2.1
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
 
 PKG_FIXUP:=autoreconf
index aaf15cca47b6811c0d6edb4c381bb472f8e84376..a1079fea462dc8afba134844ec058aa0a00b3b08 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=@SF/libdbi
 PKG_MD5SUM:=05e2ceeac4bc85fbe40de8b4b22d9ab3
 
 PKG_LICENSE:=LGPL-2.1
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
 
 PKG_FIXUP:=autoreconf
index 3fc5096231753d703e69ff4613aec8b14148f7b7..7a7cbaba7d7da85f711b7ac32369b770e1b20be3 100644 (file)
@@ -15,8 +15,8 @@ PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
 
-PKG_LICENSE=LGPLv2.1
-PKG_LICENSE_FILE=COPYING
+PKG_LICENSE:=LGPLv2.1
+PKG_LICENSE_FILES:=COPYING
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/libdmapsharing-$(PKG_VERSION)
 PKG_SOURCE:=libdmapsharing-$(PKG_VERSION).tar.gz
index 5fa7220fbde4fea9241eb6d8c88822390e326160..d0d67e38caa8727e94dd6d3a939a0d381c864cfb 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libftdi1
-PKG_VERSION:=1.1
+PKG_VERSION:=1.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.intra2net.com/en/developer/libftdi/download/
-PKG_MD5SUM:=b79a6356978aa8e69f8eecc3a720ff79
+PKG_MD5SUM:=89dff802d89c4c0d55d8b4665fd52d0b
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=LGPL-2.0
index bf3674eaeaf2c3cd69adf91d109f493ca12c718a..495db1789ada22a977becf4a09cda3e348496ce0 100644 (file)
@@ -1,6 +1,6 @@
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -43,7 +43,7 @@ IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
+@@ -55,7 +55,7 @@ if ( NOT DEFINED LIB_SUFFIX )
        AND NOT EXISTS "/etc/debian_version"
        AND NOT EXISTS "/etc/arch-release" )
      if ( "${CMAKE_SIZEOF_VOID_P}" EQUAL "8" )
diff --git a/libs/libhttp-parser/Makefile b/libs/libhttp-parser/Makefile
new file mode 100644 (file)
index 0000000..fe28b4c
--- /dev/null
@@ -0,0 +1,60 @@
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libhttp-parser
+PKG_VERSION:=2.3.0
+PKG_RELEASE=1
+PKG_MAINTAINER:=Ramanathan Sivagurunathan <ramzthecoder@gmail.com>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE-MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=git://github.com/joyent/http-parser.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=56f7ad0e2e5a80f79d214015c91e1f17d11d109f
+
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libhttp-parser
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=A library to parse http request and response
+  URL:=https://github.com/joyent/http-parser
+endef
+
+define Package/libhttp-parser/description
+  A parser for HTTP messages written in C. It parses both requests and responses. 
+  The parser is designed to be used in performance HTTP applications. 
+  It does not make any syscalls nor allocations, it does not buffer data, 
+  it can be interrupted at anytime. Depending on your architecture, 
+  it only requires about 40 bytes of data per message stream 
+  (in a web server that is per connection).
+endef
+
+define Build/Compile
+       $(call Build/Compile/Default, library) 
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/http_parser.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/libhttp_parser.so.* $(1)/usr/lib/
+       ( cd $(1)/usr/lib ; ln -s libhttp_parser.so.* libhttp_parser.so )
+endef
+
+define Package/libhttp-parser/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/libhttp_parser.so.* $(1)/usr/lib/
+       ( cd $(1)/usr/lib ; ln -s libhttp_parser.so.* libhttp_parser.so )
+endef
+
+$(eval $(call BuildPackage,libhttp-parser))
index 3ec74e652787c272fac17c52f4737e0709dd977c..7cb06224c16eefb27c3217a694c76e25d4023d57 100644 (file)
@@ -8,17 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libimobiledevice
-PKG_VERSION:=1.1.6
+PKG_VERSION:=1.2.0
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Lukasz Baj <l.baj@radytek.com>
 PKG_LICENSE:=LGPL-2.1+
-PKG_LICENSE_FILE:=COPYING.LESSER
+PKG_LICENSE_FILES:=COPYING.LESSER
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/libimobiledevice/libimobiledevice.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=9732d275d00bb1200d2b6180d94814a1a7fb7696
+PKG_SOURCE_VERSION:=53eb963f8e6d607cca6b50381c10820a5e8357f4
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 
 PKG_FIXUP:=autoreconf
index 4ab9ad7ed1706b151db1c54669512645da27d3d5..4e8fa20e238cdccdc4f5f52342253454af44dd78 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=@SF/liblo
 PKG_MD5SUM:=e2a4391a08b49bb316c03e2034e06fa2
 
 PKG_LICENSE:=LGPL-2.1+
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
 
 PKG_INSTALL:=1
index 37aeb8d24b61c6839de7fd6f40dfebd0dde0c1b9..f7f3827d4feb31c081ab8510e0cd76600b785e23 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=2
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
 
 PKG_LICENSE:=LGPLv2.1
-PKG_LICENSE_FILE:=COPYING.LIB
+PKG_LICENSE_FILES:=COPYING.LIB
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/mcrypt
diff --git a/libs/libmicrohttpd/Makefile b/libs/libmicrohttpd/Makefile
new file mode 100644 (file)
index 0000000..3f1608e
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# Copyright (C) 2010-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libmicrohttpd
+PKG_VERSION:=0.9.38
+PKG_RELEASE:=1.1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@GNU/libmicrohttpd
+PKG_MD5SUM:=b72efbfe7f290846015d460aea7091fe
+
+PKG_MAINTAINER:=Martijn Zilverschoon <martijn@friedzombie.com>
+
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libmicrohttpd
+       SECTION:=libs
+       CATEGORY:=Libraries
+       TITLE:=GNU libmicrohttpd is a library that runs an HTTP server.
+       URL:=http://www.gnu.org/software/libmicrohttpd/
+       DEPENDS:=+libpthread +libgcrypt +libgnutls +libgpg-error +libcrypto +libopenssl
+endef
+
+define Package/libmicrohttpd/description
+       GNU libmicrohttpd is a small C library that is supposed to make it easy
+       to run an HTTP server as part of another application.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libmicrohttpd/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libmicrohttpd))
index 0a23422959bc6133c9a1005ac3b5af7c02c306ff..dbf5fe02ca540259ab8e212043ea8d5b01668aed 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libmpdclient
 PKG_VERSION:=2.9
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.musicpd.org/download/libmpdclient/2/
@@ -17,7 +17,7 @@ PGK_MD5SUM:=4b101a36e5c0cf967dc063391260ddbf
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 
 PKG_INSTALL:=1
 
diff --git a/libs/libmpdclient/patches/001-WIP_musl_compatibility.patch b/libs/libmpdclient/patches/001-WIP_musl_compatibility.patch
new file mode 100644 (file)
index 0000000..02ea652
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/src/socket.c
++++ b/src/socket.c
+@@ -43,6 +43,7 @@
+ #else
+ #  include <netinet/in.h>
+ #  include <arpa/inet.h>
++#  include <sys/select.h>
+ #  include <sys/socket.h>
+ #  include <netdb.h>
+ #  include <sys/un.h>
+--- a/src/sync.c
++++ b/src/sync.c
+@@ -33,6 +33,9 @@
+ #include <assert.h>
+ #include <stdlib.h>
+ #include <stdio.h>
++#ifndef WIN32
++#include <sys/select.h>
++#endif
+ #include <fcntl.h>
+ #include <unistd.h>
index b9e49e206595b29292eedd29845bb308c7986888..f90d9bc8f418c98d11437afaf0070c59091a3487 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=http://miniupnp.free.fr/files
 PKG_MD5SUM:=7c9a7c76e200ead4e6447fe4b105f676
 PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
 PKG_LICENSE:=BSD-3c
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
 
 PKG_INSTALL:=1
 
index 028c231562254ff87926b07bcab090fd4028ed51..b54222ac46332a6472fcf9194746702b6e196ab1 100644 (file)
@@ -19,7 +19,7 @@ PKG_SOURCE_URL:= \
 PKG_MD5SUM:=2118d9514c079839ebd9cb3144ad2ad7
 
 PKG_LICENSE:=LGPL-2.1
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
 
 PKG_FIXUP:=autoreconf
index b154988f3192c113c5c5fa331a1704a6b6b13297..97e858c6368bb0dc6bf95f551bfaac218153e3cf 100644 (file)
@@ -19,7 +19,7 @@ PKG_SOURCE_URL:= \
 PKG_MD5SUM:=2a4bb0654ae675a52d2e8d1c06090b94
 
 PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
 
 PKG_FIXUP:=autoreconf
index 029fe079ed2bbbcd40dc5597e8440e1571eeb65b..e150ed0d8432f3370290c64cddefe58741f4eab5 100644 (file)
@@ -19,7 +19,7 @@ PKG_SOURCE_URL:= \
 PKG_MD5SUM:=df09befac35cb215865b39a36c96a3fa
 
 PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
 
 PKG_FIXUP:=autoreconf
diff --git a/libs/libnfc/Makefile b/libs/libnfc/Makefile
new file mode 100644 (file)
index 0000000..9a144d2
--- /dev/null
@@ -0,0 +1,98 @@
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libnfc
+PKG_VERSION:=1.7.1
+PKG_RELEASE:=1
+PKG_INSTALL:=1
+PKG_FIXUP:=autoreconf
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://code.google.com/p/libnfc/
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_LICENSE:=LGPL-2.1
+PKG_MAINTAINER:=Sebastian Wendel <packages@sourceindex.de>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libnfc/Default
+       TITLE:=A open source library for Near Field Communication (NFC)
+       URL:=http://nfc-tools.org/
+endef
+
+define Package/libnfc
+       $(call Package/libnfc/Default)
+       SECTION:=libs
+       CATEGORY:=Libraries
+       DEPENDS:=+libusb-compat +pcscd +ccid
+endef
+
+define Package/libnfc/description
+       libnfc is the first libre, platform-independent, low level NFC SDK and Programmers API
+
+       * manipulate Jewel Topaz tags using libnfc
+       * manipulate MIFARE Classic and Ultralight tags using libnfc
+
+endef
+
+define Package/nfc-utils
+       $(call Package/libnfc/Default)
+       SECTION:=utils
+       CATEGORY:=Utilities
+       DEPENDS:=+libnfc
+endef
+
+define Package/nfc-utils/description
+       Provide some examples shared functions like print, parity calculation, options parsing
+
+       * Emulates a NFC Forum Tag Type 4 v2.0 (or v1.0)
+       * Jewel dump/restore tool
+       * Lists the first target present of each founded device
+       * MIFARE Classic manipulation example
+       * MIFARE Ultralight dump/restore tool
+       * Extract NDEF Message from a NFC Forum Tag Type 3
+       * Relay example using two PN532 devices
+       * Lists each available NFC device
+
+endef
+
+TARGET_CFLAGS+=$(FPIC)
+CONFIGURE_ARGS+=--without-readline
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/nfc $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfc.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnfc.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libnfc/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfc.so.* $(1)/usr/lib/
+endef
+
+define Package/nfc-utils/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-emulate-forum-tag4 $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-jewel $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-list $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-mfclassic $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-mfultralight $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-read-forum-tag3 $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-relay-picc $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-scan-device $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libnfc))
+$(eval $(call BuildPackage,nfc-utils))
index ce844e2d61b940045dac905dba644aa1109015d6..8850c74fdaf7701fdb96c43ce84054e99648cebc 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=http://liboil.freedesktop.org/download/
 PKG_MD5SUM:=47dc734f82faeb2964d97771cfd2e701
 
 PKG_LICENSE:=FREE
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index f7ed2ae4b826240606532cd984278aefab1c4cf9..173e5dca1737b16aa5e6b82aeece5fac4d982f1e 100644 (file)
@@ -7,7 +7,7 @@
 
 include $(TOPDIR)/rules.mk
 
-LOWFAT_VERSION=0.28
+LOWFAT_VERSION=0.29
 
 PKG_NAME:=libowfat
 PKG_VERSION:=$(LOWFAT_VERSION)
@@ -15,7 +15,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://dl.fefe.de
-PKG_MD5SUM:=6bbee9a86506419657d87123b7a6f2c1
+PKG_MD5SUM:=1187c6acf11429e7adb9ebe180f644bb
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
index 3d40835d7b59bbd8024f738d41ea745581a79800..4d7cb9c86ae965a91aa26a585ceac5272a11d21f 100644 (file)
@@ -8,17 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libplist
-PKG_VERSION:=1.11
+PKG_VERSION:=1.13
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Lukasz Baj <l.baj@radytek.com>
 PKG_LICENSE:=LGPL-2.1+
-PKG_LICENSE_FILE:=COPYING.LESSER
+PKG_LICENSE_FILES:=COPYING.LESSER
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/libimobiledevice/libplist.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=063c629baef6028e84838f77fd1401b05e41dc58
+PKG_SOURCE_VERSION:=cc907c0f162ee84e5698b9c27ac6fb0be8bb9bc0
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 
 PKG_FIXUP:=autoreconf
index 1a6af67905683e80a056f6664d8011f7ac678d00..a7619148c67337e52cbc5de81cdddcb6fb61080d 100644 (file)
@@ -18,7 +18,7 @@ PKG_MD5SUM:=1c7fb25191b4e6e3628d198a66a84f47
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 
 PKG_INSTALL:=1
 
index 0082c88b5206692b9e4b32a0f35fb9aa91f15f71..3c80feef16029155c21bf6de8dad0eb0a8654c44 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libsodium
-PKG_VERSION:=0.7.1
+PKG_VERSION:=1.0.1
 PKG_RELEASE:=1
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://download.libsodium.org/libsodium/releases
-PKG_MD5SUM:=c224fe3923d1dcfe418c65c8a7246316
+PKG_MD5SUM:=9a221b49fba7281ceaaf5e278d0f4430
 PKG_CAT:=zcat
 
 PKG_FIXUP:=libtool autoreconf
@@ -62,6 +62,8 @@ define Build/InstallDev
        $(CP) $(PKG_INSTALL_DIR)/usr/include/sodium/*.h $(1)/usr/include/sodium
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsodium.{a,so*} $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsodium.pc $(1)/usr/lib/pkgconfig/
 endef
 
 define Package/libsodium/install
index 85a48286d6ce08c54ef6ab7dae4aff5407016847..a482b5ed4e99d669a48492a830961dfd907961e1 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=@GNOME/$(PKG_NAME)/2.44
 PKG_MD5SUM:=92aa3667357157e8f3489bcca287f2fa
 
 PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index ce203731ff83a5b6224032d7ad0d47832b05d58f..8f69803f8e7ec631016e7bde21033b090fbffa1b 100644 (file)
@@ -19,7 +19,7 @@ PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 
 PKG_LICENSE:=LGPL-2.1
-PKG_LICENSE_FILE:=LICENCE
+PKG_LICENSE_FILES:=LICENCE
 
 PKG_FIXUP:=libtool
 PKG_REMOVE_FILES:=autogen.sh
index ae258868d636a228a6f8ded28d7f34f67910b619..d5db86c70ba7d52db2a2dfdb21fcfc0f26febca9 100644 (file)
@@ -13,8 +13,11 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://downloads.xiph.org/releases/theora/
 PKG_MD5SUM:=292ab65cedd5021d6b7ddd117e07cd8e
-PKG_FIXUP:=autoreconf
 
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=COPYING LICENSE
+
+PKG_FIXUP:=autoreconf
 PKG_BUILD_DEPENDS:=libvorbis
 
 include $(INCLUDE_DIR)/package.mk
index 6147948a1530011b510df6be2f498890ed250165..a0581f277a1d92cf4421bb368212300720f3ee05 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/71
 PKG_MD5SUM:=7f44df5dc69cb8686947562e2a11eea9
 
 PKG_LICENSE:=BSD-2-Clause
-PKG_LICENSE_FILE:=COPYRIGHT
+PKG_LICENSE_FILES:=COPYRIGHT
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
diff --git a/libs/libunistring/Makefile b/libs/libunistring/Makefile
new file mode 100644 (file)
index 0000000..6d69b57
--- /dev/null
@@ -0,0 +1,59 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libunistring
+PKG_VERSION:=0.9.4
+PKG_RELEASE:=1
+PKG_MD5SUM:=c24a6a3838d9ad4a41a62549312c4226
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://ftp.gnu.org/gnu/libunistring
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+PKG_MAINTAINER:=Espen Jürgensen <espenjurgensen+openwrt@gmail.com>
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libunistring
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=libunistring
+  URL:=http://www.gnu.org/software/libunistring/
+endef
+
+define Package/libunistring/description
+  This library provides functions for manipulating Unicode strings and for manipulating C strings according to the Unicode standard.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --without-libiconv-prefix \
+       --without-libpth-prefix
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/include/unistring
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/unistring/*.h $(1)/usr/include/unistring/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunistring.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/libunistring/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunistring.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libunistring))
diff --git a/libs/libupnpp/Makefile b/libs/libupnpp/Makefile
new file mode 100644 (file)
index 0000000..58a3222
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libupnpp
+PKG_VERSION:=0.9.0
+PKG_RELEASE:=1
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.lesbonscomptes.com/upmpdcli/downloads
+PKG_MD5SUM:=ff218bbe2df6cf70b73843d951ef838e
+PKG_MAINTAINER:=Petko Bordjukov <bordjukov@gmail.com>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libupnpp
+  SECTION:=libs
+  CATEGORY:=Libraries
+  URL:=http://www.lesbonscomptes.com/upmpdcli
+  DEPENDS+= +libstdcpp +libexpat +librt +libcurl +libupnp
+  TITLE:=The libupnpp C++ library wraps libupnp for easier use by upmpdcli and upplay
+endef
+
+define Package/libupnpp/description
+libupnpp defines useful objects over libupnp and can be used to create both devices
+and control points. It is shared by upmpdcli and upplay.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libupnpp $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupnpp-$(PKG_VERSION).so* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupnpp.{so,la} $(1)/usr/lib/
+endef
+
+define Package/libupnpp/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupnpp-$(PKG_VERSION).so.* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupnpp.so $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libupnpp))
index 8f48e9266af72a1651948d7f7fd96b5b53200749..ec15bc2d2a37e9169f6b971e835120402e42d9cc 100644 (file)
@@ -8,17 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libusbmuxd
-PKG_VERSION:=1.0.9
+PKG_VERSION:=1.1.0
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Lukasz Baj <l.baj@radytek.com>
 PKG_LICENSE:=LGPL-2.1+
-PKG_LICENSE_FILE:=COPYING.LGPLv2.1
+PKG_LICENSE_FILES:=COPYING.LGPLv2.1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/libimobiledevice/libusbmuxd.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=ca68e3c287a8410fbef5280948a6d1d2255e0a89
+PKG_SOURCE_VERSION:=f347085157006523622b0a7160be68d14f037c00
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 
 PKG_FIXUP:=autoreconf
index 86121dc17f38d8cc0c9fc014f77c7edae40c40ac..4fb41ed1b72867ec422424a77b48e36921803e10 100644 (file)
@@ -11,6 +11,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=v4l-utils
 PKG_VERSION:=1.2.1
 PKG_RELEASE:=2
+PKG_USE_MIPS16:=0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.linuxtv.org/downloads/v4l-utils
@@ -19,7 +20,7 @@ PKG_MD5SUM:=4cc0fb4ded302ea9e89e5e1b56a7252b
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=GPL-2.0 LGPL-2.1
-PKG_LICENSE_FILE:=COPYING COPYING.libv4l
+PKG_LICENSE_FILES:=COPYING COPYING.libv4l
 
 PKG_BUILD_DEPENDS:=argp-standalone
 
index d7accab5fb4505cda9dcb6564c973696721b0e7d..05eb8386986f3fa942760dd68f6fe02a4d0f7a33 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libxml2
-PKG_VERSION:=2.9.1
-PKG_RELEASE:=1
+PKG_VERSION:=2.9.2
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://gd.tuwien.ac.at/languages/libxml/ \
        http://xmlsoft.org/sources/ \
        ftp://fr.rpmfind.net/pub/libxml/
-PKG_MD5SUM:=9c0cfef285d5c4a5c80d00904ddab380
+PKG_MD5SUM:=9e6a9aca9d155737868b3dc5fd82f788
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
@@ -26,6 +26,7 @@ PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 
+include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
 
 define Package/libxml2
@@ -43,6 +44,38 @@ endef
 TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --with-c14n \
+       --without-catalog \
+       --with-debug \
+       --without-docbook \
+       --with-html \
+       --without-ftp \
+       --without-http \
+       --without-iconv \
+       --without-iso8859x \
+       --without-legacy \
+       --with-output \
+       --without-pattern \
+       --without-push \
+       --without-python \
+       --with-reader \
+       --without-readline \
+       --without-regexps \
+       --with-sax1 \
+       --with-schemas \
+       --with-threads \
+       --with-tree \
+       --with-valid \
+       --with-writer \
+       --with-xinclude \
+       --with-xpath \
+       --with-xptr \
+       --with-zlib=$(STAGING_DIR)/usr \
+       --without-lzma
+
+HOST_CONFIGURE_ARGS += \
        --enable-shared \
        --enable-static \
        --with-c14n \
@@ -97,4 +130,5 @@ define Package/libxml2/install
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.so* $(1)/usr/lib/
 endef
 
+$(eval $(call HostBuild))
 $(eval $(call BuildPackage,libxml2))
diff --git a/libs/mxml/Makefile b/libs/mxml/Makefile
new file mode 100644 (file)
index 0000000..74cff41
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mxml
+PKG_VERSION:=2.8
+PKG_RELEASE:=1
+PKG_MD5SUM:=d85ee6d30de053581242c4a86e79a5d2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.msweet.org/files/project3/
+PKG_FIXUP:=autoreconf
+
+PKG_MAINTAINER:=Espen Jürgensen <espenjurgensen+openwrt@gmail.com>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/mxml
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Mini-XML
+  URL:=http://www.minixml.org/
+endef
+
+define Package/mxml/description
+  A small xml library.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static
+
+define Build/InstallDev
+       mkdir -p $(1)/usr/include
+       $(CP) $(PKG_BUILD_DIR)/mxml.h $(1)/usr/include/
+       mkdir -p $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/libmxml.so* $(1)/usr/lib/
+       mkdir -p $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_BUILD_DIR)/mxml.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/mxml/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/libmxml.so.*  $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,mxml))
diff --git a/libs/mxml/patches/001-targets.patch b/libs/mxml/patches/001-targets.patch
new file mode 100644 (file)
index 0000000..86379f0
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -88,7 +88,7 @@ PUBLIBOBJS   =       mxml-attr.o mxml-entity.o m
+                       mxml-index.o mxml-node.o mxml-search.o mxml-set.o
+ LIBOBJS               =       $(PUBLIBOBJS) mxml-private.o mxml-string.o
+ OBJS          =       mxmldoc.o testmxml.o $(LIBOBJS)
+-TARGETS               =       $(LIBMXML) mxmldoc testmxml mxml.xml doc/mxml.man
++TARGETS               =       $(LIBMXML)
+ #
index 7c9fe5037088ec2c494fbbe7cb8445f583e1f487..d14d086078d433da8c9eac370fde6ba4ddbf707e 100644 (file)
@@ -8,12 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nspr
-PKG_VERSION:=3.16.4
+PKG_VERSION:=3.16.6
 PKG_RELEASE:=1
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/nss-$(PKG_VERSION)
 PKG_SOURCE:=nss-$(PKG_VERSION)-with-nspr-4.10.6.tar.gz
-PKG_SOURCE_URL:=ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_16_4_RTM/src/
+PKG_SOURCE_URL:=ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_16_6_RTM/src/
+PKG_MD5SUM:=4722706ea101948712b5ad003629679f
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
index cbc273eeb9e0afd0d87d2c51d3d0f401189e87f2..dbcb4dd95b1f55b50eb2dfaec130c3556f6cdb8e 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=http://downloads.xiph.org/releases/opus/
 PKG_MD5SUM:=c5a8cf7c0b066759542bc4ca46817ac6
 
 PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
 
 PKG_INSTALL:=1
index 1553a7edc529a60b30925d9bb2d60c0d6ecbca0d..e1d99f67a782288c245706348ba8ebf1143f81e4 100644 (file)
@@ -43,6 +43,7 @@ define Host/Compile
 endef
 
 define Host/Install
+       $(MAKE) -C $(HOST_BUILD_DIR) install
 endef
 
 CONFIGURE_ARGS += --with-protoc=$(HOST_BUILD_DIR)/src/protoc
index 8796dc56cb38ae87a2bf11bbabbd50572911e45b..aa3ee28d2439e0fcad26417d80ca603a5906ad7d 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sqlite
-PKG_VERSION:=3080600
+PKG_VERSION:=3080701
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.sqlite.org/2014/
-PKG_MD5SUM:=f7e4a156b583abeba349629e2364224b
+PKG_MD5SUM:=8ee4541ebb3e5739e7ef5e9046e30063
 
 PKG_LICENSE:=PUBLICDOMAIN
 PKG_LICENSE_FILES:=
diff --git a/libs/tdb/Makefile b/libs/tdb/Makefile
new file mode 100644 (file)
index 0000000..2fce3dc
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=tdb
+PKG_VERSION:=1.0.6
+PKG_RELEASE:=1
+PKG_LICENSE:=GPL-2.0
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/tdb
+PKG_MD5SUM:=6b643fdeb48304010dcd5f675e458b58
+
+PKG_INSTALL:=1
+PKG_BUILD_DEPENDS:=+libgdbm
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/tdb
+  SUBMENU:=database
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Trivial Database
+  URL:=http://sourceforge.net/projects/tdb/
+  MAINTAINER:=Dmitry V. Zimin <pfzim@mail.ru>
+#  DEPENDS:=+libgdbm
+endef
+
+define Package/tdb/description
+  TDB is a Trivial Database. In concept, it is very much like GDBM,
+  and BSD's DB except that it allows multiple simultaneous writers
+  and uses locking internally to keep writers from trampling on
+  each other. TDB is also extremely small.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/tdb.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+endef
+
+define Package/tdb/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,tdb))
+
diff --git a/libs/tdb/patches/001-printf-fix.patch b/libs/tdb/patches/001-printf-fix.patch
new file mode 100644 (file)
index 0000000..f88d942
--- /dev/null
@@ -0,0 +1,41 @@
+--- a/tdbtool.c        2001-12-11 06:45:47.000000000 +0300
++++ b/tdbtool.c        2014-11-14 15:14:00.401164300 +0300
+@@ -169,23 +169,21 @@ static void print_data(unsigned char *bu
+ static void help(void)
+ {
+-      printf("
+-tdbtool: 
+-  create    dbname     : create a database
+-  open      dbname     : open an existing database
+-  erase                : erase the database
+-  dump      dumpname   : dump the database as strings
+-  insert    key  data  : insert a record
+-  store     key  data  : store a record (replace)
+-  show      key        : show a record by key
+-  delete    key        : delete a record by key
+-  list                 : print the database hash table and freelist
+-  free                 : print the database freelist
+-  1 | first            : print the first record
+-  n | next             : print the next record
+-  q | quit             : terminate
+-  \\n                   : repeat 'next' command
+-");
++      printf("tdbtool:\n");
++      printf("  create    dbname     : create a database\n");
++      printf("  open      dbname     : open an existing database\n");
++      printf("  erase                : erase the database\n");
++      printf("  dump      dumpname   : dump the database as strings\n");
++      printf("  insert    key  data  : insert a record\n");
++      printf("  store     key  data  : store a record (replace)\n");
++      printf("  show      key        : show a record by key\n");
++      printf("  delete    key        : delete a record by key\n");
++      printf("  list                 : print the database hash table and freelist\n");
++      printf("  free                 : print the database freelist\n");
++      printf("  1 | first            : print the first record\n");
++      printf("  n | next             : print the next record\n");
++      printf("  q | quit             : terminate\n");
++      printf("  \\n                   : repeat 'next' command\n\n");
+ }
+ static void terror(char *why)
index 0e6be0f9b856c395fca7ac5c1e8894d021aee0cf..998219a9fc48ad57092b880c4696ea1db4858090 100644 (file)
@@ -20,7 +20,7 @@ PKG_SOURCE_PROTO:=svn
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 PKG_LICENSE:=VARIOUS
-PKG_LICENSE_FILE:=doc/COPYING
+PKG_LICENSE_FILES:=doc/COPYING
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
diff --git a/mail/bogofilter/Makefile b/mail/bogofilter/Makefile
new file mode 100644 (file)
index 0000000..de3646b
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=bogofilter
+PKG_VERSION:=1.2.4
+PKG_RELEASE:=3
+
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/bogofilter
+PKG_MD5SUM:=d0a5eebb3274b23ceabe766a6443a1c5
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/bogofilter
+  SECTION:=mail
+  CATEGORY:=Mail
+  DEPENDS:=+libdb47
+  TITLE:=bogofilter
+  MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+  URL:=http://bogofilter.sourceforge.net/
+endef
+
+define Package/bogofilter/description
+       Bogofilter is a fast Bayesian spam filter
+endef
+
+CONFIGURE_ARGS += --disable-unicode
+
+define Package/bogofilter/install
+       $(INSTALL_DIR)  $(1)/etc/ \
+                        $(1)/usr/bin \
+                        $(1)/usr/sbin
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/bogofilter.cf.example $(1)/etc/bogofilter.cf
+       $(INSTALL_BIN) ./files/postfix-bogofilter $(1)/usr/sbin/postfix-bogofilter
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/bf_compact $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/bf_copy $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/bf_tar $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/bogofilter $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/bogolexer $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/bogotune $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/bogoutil $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,bogofilter))
diff --git a/mail/bogofilter/files/postfix-bogofilter b/mail/bogofilter/files/postfix-bogofilter
new file mode 100755 (executable)
index 0000000..952d8cd
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+FILTER=/usr/bin/bogofilter
+FILTER_DIR=/mnt/sda1/var/spool/bogofilter
+# WARNING! The -i is crucial, else you may see
+# messages truncated at the first period that is alone on a line
+# (which can happen with several kinds of messages, particularly
+# quoted-printable)
+# -G is ignored before Postfix 2.3 and tells it that the message
+# does not originate on the local system (Gateway submission),
+# so Postfix avoids some of the local expansions that can leave
+# misleading traces in headers, such as local address
+# canonicalizations.
+POSTFIX="/usr/sbin/sendmail -G -i"
+export BOGOFILTER_DIR=/etc/bogofilter
+
+# Exit codes from <sysexits.h>
+EX_TEMPFAIL=75
+EX_UNAVAILABLE=69
+
+cd $FILTER_DIR || \
+    { echo $FILTER_DIR does not exist; exit $EX_TEMPFAIL; }
+
+# Clean up when done or when aborting.
+trap "rm -f msg.$$ ; exit $EX_TEMPFAIL" 0 1 2 3 15
+
+# bogofilter -e returns: 0 for OK, nonzero for error
+rm -f msg.$$ || exit $EX_TEMPFAIL
+$FILTER -p -e > msg.$$ || exit $EX_TEMPFAIL
+
+exec <msg.$$ || exit $EX_TEMPFAIL
+rm -f msg.$$ # safe, we hold the file descriptor
+exec $POSTFIX "$@"
+exit $EX_TEMPFAIL
index 131ae7740bdc68a04ce5c6821ab72cd8338d2bf6..1032d97718d396c33130a34d0c0fb9bd71cd0697 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dovecot
-PKG_VERSION:=2.2.13
-PKG_RELEASE:=2
+PKG_VERSION:=2.2.15
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.dovecot.org/releases/2.2
-PKG_MD5SUM:=a3eb1c0b1822c4f2b0fe9247776baa71
+PKG_MD5SUM:=c6c176943bd832c780fbb5d2f8850952
 PKG_LICENSE:=LGPL-2.1 MIT BSD-3-Clause Unique
 PKG_LICENSE_FILES:=COPYING COPYING.LGPL COPYING.MIT
 
index 69328cb7dc79ae1cab0181bf375ef31cfc3df47f..70642d648f067237713566cf27f5dce5ec774a54 100644 (file)
@@ -12,7 +12,7 @@
        int main()
        {
        return epoll_create(5) < 1;
-@@ -675,7 +675,7 @@ fi
+@@ -639,7 +639,7 @@ fi
  dnl * Old glibcs have broken posix_fallocate(). Make sure not to use it.
  dnl * It may also be broken in AIX.
  AC_CACHE_CHECK([whether posix_fallocate() works],i_cv_posix_fallocate_works,[
@@ -21,7 +21,7 @@
      #define _XOPEN_SOURCE 600
      #include <stdio.h>
      #include <stdlib.h>
-@@ -684,6 +684,7 @@ AC_CACHE_CHECK([whether posix_fallocate(
+@@ -648,6 +648,7 @@ AC_CACHE_CHECK([whether posix_fallocate(
      #if defined(__GLIBC__) && (__GLIBC__ < 2 || __GLIBC_MINOR__ < 7)
        possibly broken posix_fallocate
      #endif
diff --git a/mail/fdm/Config.in b/mail/fdm/Config.in
new file mode 100644 (file)
index 0000000..084695b
--- /dev/null
@@ -0,0 +1,10 @@
+menu "Configuration"
+       depends on PACKAGE_fdm
+
+config FDM_WITH_PCRE
+       bool
+       default y
+       select libpcre
+       prompt "Enable PCRE support (elsewhere POSIX regex)"
+
+endmenu
diff --git a/mail/fdm/Makefile b/mail/fdm/Makefile
new file mode 100644 (file)
index 0000000..49c02f1
--- /dev/null
@@ -0,0 +1,86 @@
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=fdm
+PKG_VERSION:=1.7
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-2-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/fdm
+PKG_MD5SUM:=aea0421571e8f3ec8f747a5d72c84348
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/fdm
+  SECTION:=mail
+  CATEGORY:=Mail
+  TITLE:=fetch mail and deliver
+  URL:=http://fdm.sourceforge.net/
+  MAINTAINER:=Dmitry V. Zimin <pfzim@mail.ru>
+  MENU:=1
+  DEPENDS:=+tdb +zlib +libopenssl +FDM_WITH_PCRE:libpcre
+  USERID:=_fdm=99:_fdm=99
+endef
+
+define Package/fdm/description
+  fdm is a simple, lightweight replacement for mail fetch, filter
+  and delivery programs such as fetchmail and procmail. It can
+  fetch using POP3 or IMAP (with SSL) or from stdin, and deliver
+  to a pipe, file, maildir, mbox or SMTP server, based on $(if $(CONFIG_FDM_WITH_PCRE),PCRE,POSIX regexp)
+endef
+
+MAKE_FLAGS += \
+       PREFIX="/usr"\
+       $(if $(CONFIG_FDM_WITH_PCRE),PCRE=1)
+
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       $(CP) ./src/compat/* $(PKG_BUILD_DIR)/
+endef
+
+define Package/fdm/config
+       source "$(SOURCE)/Config.in"
+endef
+
+define Package/fdm/conffiles
+/etc/fdm.conf
+endef
+
+define Package/fdm/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_DATA) ./files/etc/* $(1)/etc/
+       $(INSTALL_DIR) $(1)/opt/fdm
+       chmod a+rwx $(1)/opt/fdm
+endef
+
+define Package/fdm/postinst
+#!/bin/sh
+if [ -z "$${IPKG_INSTROOT}" ]; then
+       echo "Creating cron job template for user _fdm..."
+       (crontab -l -u _fdm 2>/dev/null; echo "# */13 * * * * fdm -q fetch") | crontab -u _fdm -
+       echo "Please, edit file /etc/fdm.conf and enable cron job!"
+fi
+exit 0
+endef
+
+define Package/fdm/prerm
+#!/bin/sh
+if [ -z "$${IPKG_INSTROOT}" ]; then
+       echo "Don't forget disable cron job!"
+       echo "# crontab -r -u _fdm"
+fi
+exit 0
+endef
+
+$(eval $(call BuildPackage,fdm))
diff --git a/mail/fdm/files/etc/fdm.conf b/mail/fdm/files/etc/fdm.conf
new file mode 100644 (file)
index 0000000..56c9db4
--- /dev/null
@@ -0,0 +1,36 @@
+# /etc/fdm.conf example file
+# 1. Edit this file
+# 2. Test: fdm -vv fetch
+# 3. Enable cron job: crontab -e -u _fdm
+
+set maximum-size      3M
+set delete-oversized
+set queue-high        1
+set queue-low         0
+set purge-after       5
+set unmatched-mail    keep
+
+action "drop" drop
+action "keep" keep
+
+action "wakeup" exec "wol -h 192.168.0.255 -p 9 00:11:22:33:44:55"
+action "my-test-action" exec "echo \"OK\" > /tmp/fdm.ok"
+
+# This action extract *.torrent files from incoming email and put it
+# to watch-dir your torrect client application
+
+action "torrent-add" pipe "munpack -f -q -C /your-path/watch-dir/ ; for i in /your-path/watch-dir/*.torrent ; do chmod a+r \$i ; done"
+
+account "xbmc" disabled
+        pop3s
+        server   "pop.yandex.ru"
+        port     995
+        user     "username-enter-here"
+        pass     "password-enter-here"
+        new-only
+        cache    "/opt/fdm/cache"
+
+match "^Subject:[ \t]+openwrt:[ \t]*wakeup[ \t]*$" in headers actions { "wakeup" "drop" }
+match "^Subject:[ \t]+openwrt:[ \t]*torrent[ \t]+add[ \t]*\$" in headers actions { "torrent-add" "drop" }
+match "^Subject:[ \t]+openwrt:[ \t]*test[ \t]*$" in headers actions { "my-test-action" "drop" }
+match all action "keep"
diff --git a/mail/fdm/patches/001-base64-fix.patch b/mail/fdm/patches/001-base64-fix.patch
new file mode 100644 (file)
index 0000000..ad9239b
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/fdm.h    2011-10-10 17:36:29.000000000 +0400
++++ b/fdm.h    2014-11-13 12:56:59.217083683 +0300
+@@ -719,6 +719,11 @@
+ size_t                 strlcat(char *, const char *, size_t);
+ #endif
++int local_b64_ntop(uint8_t const *src, size_t srclength, char *target,
++    size_t targsize);
++
++int local_b64_pton(char const *src, uint8_t *target, size_t targsize);
++
+ /* shm.c */
+ char                  *shm_path(struct shm *);
+ void          *shm_create(struct shm *, size_t);
diff --git a/mail/fdm/patches/002-base64-fix.patch b/mail/fdm/patches/002-base64-fix.patch
new file mode 100644 (file)
index 0000000..7f798a6
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/imap-common.c    2011-12-20 00:19:03.000000000 +0400
++++ b/imap-common.c    2014-11-13 12:56:06.930418446 +0300
+@@ -206,7 +206,7 @@
+       size = (strlen(in) * 2) + 1;
+       out = xcalloc(1, size);
+-      if (b64_ntop(in, strlen(in), out, size) < 0) {
++      if (local_b64_ntop(in, strlen(in), out, size) < 0) {
+               xfree(out);
+               return (NULL);
+       }
+@@ -222,7 +222,7 @@
+       size = (strlen(in) * 4) + 1;
+       out = xcalloc(1, size);
+-      if (b64_pton(in, out, size) < 0) {
++      if (local_b64_pton(in, out, size) < 0) {
+               xfree(out);
+               return (NULL);
+       }
diff --git a/mail/fdm/src/compat/b64_ntop.c b/mail/fdm/src/compat/b64_ntop.c
new file mode 100644 (file)
index 0000000..0d222cf
--- /dev/null
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 1996, 1998 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * Portions Copyright (c) 1995 by International Business Machines, Inc.
+ *
+ * International Business Machines, Inc. (hereinafter called IBM) grants
+ * permission under its copyrights to use, copy, modify, and distribute this
+ * Software with or without fee, provided that the above copyright notice and
+ * all paragraphs of this notice appear in all copies, and that the name of IBM
+ * not be used in connection with the marketing of any product incorporating
+ * the Software or modifications thereof, without specific, written prior
+ * permission.
+ *
+ * To the extent it has a right to do so, IBM grants an immunity from suit
+ * under its patents, if any, for the use, sale or manufacture of products to
+ * the extent that such products are used for performing Domain Name System
+ * dynamic updates in TCP/IP networks by means of the Software.  No immunity is
+ * granted for any product per se or for any other function of any product.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE.  IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
+ * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
+ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+//#include <config.h>
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "fdm.h"
+
+#define Assert(Cond) if (!(Cond)) abort()
+
+static const char Base64[] =
+       "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+static const char Pad64 = '=';
+
+/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
+   The following encoding technique is taken from RFC 1521 by Borenstein
+   and Freed.  It is reproduced here in a slightly edited form for
+   convenience.
+
+   A 65-character subset of US-ASCII is used, enabling 6 bits to be
+   represented per printable character. (The extra 65th character, "=",
+   is used to signify a special processing function.)
+
+   The encoding process represents 24-bit groups of input bits as output
+   strings of 4 encoded characters. Proceeding from left to right, a
+   24-bit input group is formed by concatenating 3 8-bit input groups.
+   These 24 bits are then treated as 4 concatenated 6-bit groups, each
+   of which is translated into a single digit in the base64 alphabet.
+
+   Each 6-bit group is used as an index into an array of 64 printable
+   characters. The character referenced by the index is placed in the
+   output string.
+
+                         Table 1: The Base64 Alphabet
+
+      Value Encoding  Value Encoding  Value Encoding  Value Encoding
+          0 A            17 R            34 i            51 z
+          1 B            18 S            35 j            52 0
+          2 C            19 T            36 k            53 1
+          3 D            20 U            37 l            54 2
+          4 E            21 V            38 m            55 3
+          5 F            22 W            39 n            56 4
+          6 G            23 X            40 o            57 5
+          7 H            24 Y            41 p            58 6
+          8 I            25 Z            42 q            59 7
+          9 J            26 a            43 r            60 8
+         10 K            27 b            44 s            61 9
+         11 L            28 c            45 t            62 +
+         12 M            29 d            46 u            63 /
+         13 N            30 e            47 v
+         14 O            31 f            48 w         (pad) =
+         15 P            32 g            49 x
+         16 Q            33 h            50 y
+
+   Special processing is performed if fewer than 24 bits are available
+   at the end of the data being encoded.  A full encoding quantum is
+   always completed at the end of a quantity.  When fewer than 24 input
+   bits are available in an input group, zero bits are added (on the
+   right) to form an integral number of 6-bit groups.  Padding at the
+   end of the data is performed using the '=' character.
+
+   Since all base64 input is an integral number of octets, only the
+   following cases can arise:
+
+       (1) the final quantum of encoding input is an integral
+           multiple of 24 bits; here, the final unit of encoded
+          output will be an integral multiple of 4 characters
+          with no "=" padding,
+       (2) the final quantum of encoding input is exactly 8 bits;
+           here, the final unit of encoded output will be two
+          characters followed by two "=" padding characters, or
+       (3) the final quantum of encoding input is exactly 16 bits;
+           here, the final unit of encoded output will be three
+          characters followed by one "=" padding character.
+   */
+
+int
+local_b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize) {
+       size_t datalength = 0;
+       uint8_t input[3];
+       uint8_t output[4];
+       size_t i;
+
+       while (2 < srclength) {
+               input[0] = *src++;
+               input[1] = *src++;
+               input[2] = *src++;
+               srclength -= 3;
+
+               output[0] = input[0] >> 2;
+               output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
+               output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
+               output[3] = input[2] & 0x3f;
+               Assert(output[0] < 64);
+               Assert(output[1] < 64);
+               Assert(output[2] < 64);
+               Assert(output[3] < 64);
+
+               if (datalength + 4 > targsize)
+                       return (-1);
+               target[datalength++] = Base64[output[0]];
+               target[datalength++] = Base64[output[1]];
+               target[datalength++] = Base64[output[2]];
+               target[datalength++] = Base64[output[3]];
+       }
+
+       /* Now we worry about padding. */
+       if (0 != srclength) {
+               /* Get what's left. */
+               input[0] = input[1] = input[2] = '\0';
+               for (i = 0; i < srclength; i++)
+                       input[i] = *src++;
+               output[0] = input[0] >> 2;
+               output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
+               output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
+               Assert(output[0] < 64);
+               Assert(output[1] < 64);
+               Assert(output[2] < 64);
+
+               if (datalength + 4 > targsize)
+                       return (-1);
+               target[datalength++] = Base64[output[0]];
+               target[datalength++] = Base64[output[1]];
+               if (srclength == 1)
+                       target[datalength++] = Pad64;
+               else
+                       target[datalength++] = Base64[output[2]];
+               target[datalength++] = Pad64;
+       }
+       if (datalength >= targsize)
+               return (-1);
+       target[datalength] = '\0'; /* Returned value doesn't count \0. */
+       return (datalength);
+}
diff --git a/mail/fdm/src/compat/b64_pton.c b/mail/fdm/src/compat/b64_pton.c
new file mode 100644 (file)
index 0000000..0e9363a
--- /dev/null
@@ -0,0 +1,393 @@
+/*
+ * Copyright (c) 1996, 1998 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * Portions Copyright (c) 1995 by International Business Machines, Inc.
+ *
+ * International Business Machines, Inc. (hereinafter called IBM) grants
+ * permission under its copyrights to use, copy, modify, and distribute this
+ * Software with or without fee, provided that the above copyright notice and
+ * all paragraphs of this notice appear in all copies, and that the name of IBM
+ * not be used in connection with the marketing of any product incorporating
+ * the Software or modifications thereof, without specific, written prior
+ * permission.
+ *
+ * To the extent it has a right to do so, IBM grants an immunity from suit
+ * under its patents, if any, for the use, sale or manufacture of products to
+ * the extent that such products are used for performing Domain Name System
+ * dynamic updates in TCP/IP networks by means of the Software.  No immunity is
+ * granted for any product per se or for any other function of any product.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE.  IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
+ * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
+ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+//#include <config.h>
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "fdm.h"
+
+#define Assert(Cond) if (!(Cond)) abort()
+
+static const char Base64[] =
+       "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+static const char Pad64 = '=';
+
+/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
+   The following encoding technique is taken from RFC 1521 by Borenstein
+   and Freed.  It is reproduced here in a slightly edited form for
+   convenience.
+
+   A 65-character subset of US-ASCII is used, enabling 6 bits to be
+   represented per printable character. (The extra 65th character, "=",
+   is used to signify a special processing function.)
+
+   The encoding process represents 24-bit groups of input bits as output
+   strings of 4 encoded characters. Proceeding from left to right, a
+   24-bit input group is formed by concatenating 3 8-bit input groups.
+   These 24 bits are then treated as 4 concatenated 6-bit groups, each
+   of which is translated into a single digit in the base64 alphabet.
+
+   Each 6-bit group is used as an index into an array of 64 printable
+   characters. The character referenced by the index is placed in the
+   output string.
+
+                         Table 1: The Base64 Alphabet
+
+      Value Encoding  Value Encoding  Value Encoding  Value Encoding
+          0 A            17 R            34 i            51 z
+          1 B            18 S            35 j            52 0
+          2 C            19 T            36 k            53 1
+          3 D            20 U            37 l            54 2
+          4 E            21 V            38 m            55 3
+          5 F            22 W            39 n            56 4
+          6 G            23 X            40 o            57 5
+          7 H            24 Y            41 p            58 6
+          8 I            25 Z            42 q            59 7
+          9 J            26 a            43 r            60 8
+         10 K            27 b            44 s            61 9
+         11 L            28 c            45 t            62 +
+         12 M            29 d            46 u            63 /
+         13 N            30 e            47 v
+         14 O            31 f            48 w         (pad) =
+         15 P            32 g            49 x
+         16 Q            33 h            50 y
+
+   Special processing is performed if fewer than 24 bits are available
+   at the end of the data being encoded.  A full encoding quantum is
+   always completed at the end of a quantity.  When fewer than 24 input
+   bits are available in an input group, zero bits are added (on the
+   right) to form an integral number of 6-bit groups.  Padding at the
+   end of the data is performed using the '=' character.
+
+   Since all base64 input is an integral number of octets, only the
+   following cases can arise:
+
+       (1) the final quantum of encoding input is an integral
+           multiple of 24 bits; here, the final unit of encoded
+          output will be an integral multiple of 4 characters
+          with no "=" padding,
+       (2) the final quantum of encoding input is exactly 8 bits;
+           here, the final unit of encoded output will be two
+          characters followed by two "=" padding characters, or
+       (3) the final quantum of encoding input is exactly 16 bits;
+           here, the final unit of encoded output will be three
+          characters followed by one "=" padding character.
+   */
+
+/* skips all whitespace anywhere.
+   converts characters, four at a time, starting at (or after)
+   src from base - 64 numbers into three 8 bit bytes in the target area.
+   it returns the number of data bytes stored at the target, or -1 on error.
+ */
+
+static int b64rmap_initialized = 0;
+static uint8_t b64rmap[256];
+
+static const uint8_t b64rmap_special = 0xf0;
+static const uint8_t b64rmap_end = 0xfd;
+static const uint8_t b64rmap_space = 0xfe;
+static const uint8_t b64rmap_invalid = 0xff;
+
+/**
+ * Initializing the reverse map is not thread safe.
+ * Which is fine for NSD. For now...
+ **/
+static void
+b64_initialize_rmap ()
+{
+       int i;
+       char ch;
+
+       /* Null: end of string, stop parsing */
+       b64rmap[0] = b64rmap_end;
+
+       for (i = 1; i < 256; ++i) {
+               ch = (char)i;
+               /* Whitespaces */
+               if (isspace(ch))
+                       b64rmap[i] = b64rmap_space;
+               /* Padding: stop parsing */
+               else if (ch == Pad64)
+                       b64rmap[i] = b64rmap_end;
+               /* Non-base64 char */
+               else
+                       b64rmap[i] = b64rmap_invalid;
+       }
+
+       /* Fill reverse mapping for base64 chars */
+       for (i = 0; Base64[i] != '\0'; ++i)
+               b64rmap[(uint8_t)Base64[i]] = i;
+
+       b64rmap_initialized = 1;
+}
+
+static int
+b64_pton_do(char const *src, uint8_t *target, size_t targsize)
+{
+       int tarindex, state, ch;
+       uint8_t ofs;
+
+       state = 0;
+       tarindex = 0;
+
+       while (1)
+       {
+               ch = *src++;
+               ofs = b64rmap[ch];
+
+               if (ofs >= b64rmap_special) {
+                       /* Ignore whitespaces */
+                       if (ofs == b64rmap_space)
+                               continue;
+                       /* End of base64 characters */
+                       if (ofs == b64rmap_end)
+                               break;
+                       /* A non-base64 character. */
+                       return (-1);
+               }
+
+               switch (state) {
+               case 0:
+                       if ((size_t)tarindex >= targsize)
+                               return (-1);
+                       target[tarindex] = ofs << 2;
+                       state = 1;
+                       break;
+               case 1:
+                       if ((size_t)tarindex + 1 >= targsize)
+                               return (-1);
+                       target[tarindex]   |=  ofs >> 4;
+                       target[tarindex+1]  = (ofs & 0x0f)
+                                               << 4 ;
+                       tarindex++;
+                       state = 2;
+                       break;
+               case 2:
+                       if ((size_t)tarindex + 1 >= targsize)
+                               return (-1);
+                       target[tarindex]   |=  ofs >> 2;
+                       target[tarindex+1]  = (ofs & 0x03)
+                                               << 6;
+                       tarindex++;
+                       state = 3;
+                       break;
+               case 3:
+                       if ((size_t)tarindex >= targsize)
+                               return (-1);
+                       target[tarindex] |= ofs;
+                       tarindex++;
+                       state = 0;
+                       break;
+               default:
+                       abort();
+               }
+       }
+
+       /*
+        * We are done decoding Base-64 chars.  Let's see if we ended
+        * on a byte boundary, and/or with erroneous trailing characters.
+        */
+
+       if (ch == Pad64) {              /* We got a pad char. */
+               ch = *src++;            /* Skip it, get next. */
+               switch (state) {
+               case 0:         /* Invalid = in first position */
+               case 1:         /* Invalid = in second position */
+                       return (-1);
+
+               case 2:         /* Valid, means one byte of info */
+                       /* Skip any number of spaces. */
+                       for ((void)NULL; ch != '\0'; ch = *src++)
+                               if (b64rmap[ch] != b64rmap_space)
+                                       break;
+                       /* Make sure there is another trailing = sign. */
+                       if (ch != Pad64)
+                               return (-1);
+                       ch = *src++;            /* Skip the = */
+                       /* Fall through to "single trailing =" case. */
+                       /* FALLTHROUGH */
+
+               case 3:         /* Valid, means two bytes of info */
+                       /*
+                        * We know this char is an =.  Is there anything but
+                        * whitespace after it?
+                        */
+                       for ((void)NULL; ch != '\0'; ch = *src++)
+                               if (b64rmap[ch] != b64rmap_space)
+                                       return (-1);
+
+                       /*
+                        * Now make sure for cases 2 and 3 that the "extra"
+                        * bits that slopped past the last full byte were
+                        * zeros.  If we don't check them, they become a
+                        * subliminal channel.
+                        */
+                       if (target[tarindex] != 0)
+                               return (-1);
+               }
+       } else {
+               /*
+                * We ended by seeing the end of the string.  Make sure we
+                * have no partial bytes lying around.
+                */
+               if (state != 0)
+                       return (-1);
+       }
+
+       return (tarindex);
+}
+
+
+static int
+b64_pton_len(char const *src)
+{
+       int tarindex, state, ch;
+       uint8_t ofs;
+
+       state = 0;
+       tarindex = 0;
+
+       while (1)
+       {
+               ch = *src++;
+               ofs = b64rmap[ch];
+
+               if (ofs >= b64rmap_special) {
+                       /* Ignore whitespaces */
+                       if (ofs == b64rmap_space)
+                               continue;
+                       /* End of base64 characters */
+                       if (ofs == b64rmap_end)
+                               break;
+                       /* A non-base64 character. */
+                       return (-1);
+               }
+
+               switch (state) {
+               case 0:
+                       state = 1;
+                       break;
+               case 1:
+                       tarindex++;
+                       state = 2;
+                       break;
+               case 2:
+                       tarindex++;
+                       state = 3;
+                       break;
+               case 3:
+                       tarindex++;
+                       state = 0;
+                       break;
+               default:
+                       abort();
+               }
+       }
+
+       /*
+        * We are done decoding Base-64 chars.  Let's see if we ended
+        * on a byte boundary, and/or with erroneous trailing characters.
+        */
+
+       if (ch == Pad64) {              /* We got a pad char. */
+               ch = *src++;            /* Skip it, get next. */
+               switch (state) {
+               case 0:         /* Invalid = in first position */
+               case 1:         /* Invalid = in second position */
+                       return (-1);
+
+               case 2:         /* Valid, means one byte of info */
+                       /* Skip any number of spaces. */
+                       for ((void)NULL; ch != '\0'; ch = *src++)
+                               if (b64rmap[ch] != b64rmap_space)
+                                       break;
+                       /* Make sure there is another trailing = sign. */
+                       if (ch != Pad64)
+                               return (-1);
+                       ch = *src++;            /* Skip the = */
+                       /* Fall through to "single trailing =" case. */
+                       /* FALLTHROUGH */
+
+               case 3:         /* Valid, means two bytes of info */
+                       /*
+                        * We know this char is an =.  Is there anything but
+                        * whitespace after it?
+                        */
+                       for ((void)NULL; ch != '\0'; ch = *src++)
+                               if (b64rmap[ch] != b64rmap_space)
+                                       return (-1);
+
+               }
+       } else {
+               /*
+                * We ended by seeing the end of the string.  Make sure we
+                * have no partial bytes lying around.
+                */
+               if (state != 0)
+                       return (-1);
+       }
+
+       return (tarindex);
+}
+
+
+int
+local_b64_pton(char const *src, uint8_t *target, size_t targsize)
+{
+       if (!b64rmap_initialized)
+               b64_initialize_rmap ();
+
+       if (target)
+               return b64_pton_do (src, target, targsize);
+       else
+               return b64_pton_len (src);
+}
diff --git a/mail/mailman/Makefile b/mail/mailman/Makefile
new file mode 100644 (file)
index 0000000..c18e1e3
--- /dev/null
@@ -0,0 +1,126 @@
+# 
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mailman
+PKG_RELEASE:=1
+PKG_SOURCE_URL:=ftp://ftp.gnu.org/gnu/mailman/
+PKG_VERSION:=2.1.18-1
+PKG_MD5SUM:=dc861ed9698a98499a951eaef7d4db9f
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
+PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=gnu-COPYING-GPL
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/mailman
+  SECTION:=mail
+  CATEGORY:=Mail
+  TITLE:=The GNU Mailing List Manager
+  URL:=http://www.gnu.org/software/mailman/
+  DEPENDS:=+postfix +python-mini +uhttpd +python-dns #+python-dev
+endef
+
+define Package/mailman/description
+ Mailman is free software for managing electronic mail discussion and e-newsletter lists.
+endef
+
+prefix=/usr/local/mailman
+
+define Package/mailman/conffiles
+$(prefix)/Mailman/mm_cfg.py
+endef
+
+CONFIGURE_ARGS += \
+       --prefix="$(prefix)" \
+       --exec-prefix="$(prefix)" \
+       --with-username="root" \
+       --with-groupname="root" \
+       --with-mail-gid="nogroup" \
+       --with-cgi-gid="root" \
+       --without-permcheck \
+
+define Build/Compile
+endef
+
+define Package/mailman/install
+       $(INSTALL_DIR) $(1)$(prefix)
+       cd $(PKG_BUILD_DIR); $(MAKE) DESTDIR=$(1) install
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/mailman.init $(1)/etc/init.d/mailman
+       $(INSTALL_DIR) $(1)/usr/www
+       ln -s $(prefix)/cgi-bin/ $(1)/usr/www/mailman
+       ln -s $(prefix)/archives/public/ $(1)/usr/www/pipermail
+       ln -s $(prefix)/icons $(1)/usr/www/icons
+endef
+
+define Package/mailman/postinst
+#!/bin/sh
+# check if we are on real system
+if [ -z "$${IPKG_INSTROOT}" ]; then
+
+ if [ `postconf alias_maps | grep -ci mailman` -eq 0 ]
+ then
+  postconf -e "`postconf alias_maps`, cdb:$(prefix)/data/aliases"
+ fi
+ cd $(prefix)
+ hostname=`cat /proc/sys/kernel/hostname`
+ if [ ! -f data/aliases ]
+ then
+  ./bin/genaliases
+ fi
+ newaliases
+ if [ `grep -c DEFAULT_URL_HOST Mailman/mm_cfg.py` -eq 0 ]
+ then
+  echo "DEFAULT_EMAIL_HOST = '$$hostname'" >> Mailman/mm_cfg.py
+  echo "DEFAULT_URL_HOST = '$$hostname'" >> Mailman/mm_cfg.py
+  echo "add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)" >> Mailman/mm_cfg.py
+  echo "QRUNNERS.remove(('NewsRunner',1))" >> Mailman/mm_cfg.py
+ fi
+ if [ `./bin/list_lists | grep -ci mailman` -eq 0 ]
+ then
+  ./bin/newlist --urlhost=$$hostname --emailhost=$$hostname --quiet mailman root@$$hostname mailman
+  ./bin/config_list -i data/sitelist.cfg mailman
+  echo "NOTE: A default site-wide mailing list Mailman with password 'mailman' has been created. Please review it and change the password."
+  ./bin/mmsitepass mailman
+  echo "NOTE: The default site password 'mailman' has been created."
+ fi
+ # /etc/init.d/mailman enable
+ if [ `ps | grep "mailman/bin/qrunner" | grep -cv grep` -gt 0 ]
+ then
+  $(prefix)/bin/mailmanctl -q restart
+ fi
+ if [ `grep -c mailman /etc/config/uhttpd` -eq 0 ]
+ then #we assume that the server is not configured yet, thus print out some help for the first time:
+  echo "NOTE: Please set the site password using $(prefix)/bin/mmsitepass <your-site-password>"
+  echo "Please add uhttpd config section to your /etc/config/uhttpd like this:"
+  echo "config uhttpd mailman"
+  echo "       list listen_http        0.0.0.0:80"
+  echo "       option home             /usr/www"
+  echo "       option cgi_prefix       /mailman"
+  echo "       no_symlinks             0"
+  echo "Don't forget to setup firewall for accessing this website!"
+  echo "To add a mailing list go to http://$$hostname/mailman/create."
+ fi
+fi
+endef
+
+define Package/mailman/prerm
+#!/bin/sh
+# check if we are on real system
+if [ -z "$${IPKG_INSTROOT}" ]; then
+
+ if [ `ps | grep "mailman/bin/qrunner" | grep -cv grep` -gt 0 ]
+ then
+  $(prefix)/bin/mailmanctl stop
+ fi
+fi
+endef
+
+$(eval $(call BuildPackage,mailman))
diff --git a/mail/mailman/files/mailman.init b/mail/mailman/files/mailman.init
new file mode 100644 (file)
index 0000000..f68a456
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2014 OpenWrt.org
+
+START=50
+STOP=50
+
+PYTHON=/usr/bin/python
+MAILMANHOME=/usr/local/mailman
+MAILMANCTL=$MAILMANHOME/bin/mailmanctl
+
+start() {
+       #rm -f $MAILMANHOME/locks/*
+       $PYTHON $MAILMANCTL -s -q start
+}
+
+stop() {
+       $PYTHON $MAILMANCTL -q stop
+}
+
+restart() {
+       $PYTHON $MAILMANCTL -q restart
+}
diff --git a/mail/mailman/patches/100-postfix.patch b/mail/mailman/patches/100-postfix.patch
new file mode 100644 (file)
index 0000000..857b99b
--- /dev/null
@@ -0,0 +1,12 @@
+diff -rupN mailman-2.1.14-1/Mailman/Defaults.py.in mailman-2.1.14-1_patched/Mailman/Defaults.py.in
+--- mailman-2.1.14-1/Mailman/Defaults.py.in    2011-03-01 23:35:57.000000000 +0300
++++ mailman-2.1.14-1_patched/Mailman/Defaults.py.in    2011-03-09 12:26:10.000000000 +0300
+@@ -439,7 +439,7 @@ DELIVERY_MODULE = 'SMTPDirect'
+ # standard out (or send an email to the site list owner) for manual twiddling
+ # of an /etc/aliases style file.  Use 'Postfix' if you are using the Postfix
+ # MTA -- but then also see POSTFIX_STYLE_VIRTUAL_DOMAINS.
+-MTA = 'Manual'
++MTA = 'Postfix'
+ # If you set MTA='Postfix', then you also want to set the following variable,
+ # depending on whether you're using virtual domains in Postfix, and which
diff --git a/mail/mailman/patches/200-nohostdnspython.patch b/mail/mailman/patches/200-nohostdnspython.patch
new file mode 100644 (file)
index 0000000..e321106
--- /dev/null
@@ -0,0 +1,68 @@
+diff -Naur mailman-2.1.18-1/configure mailman-2.1.18-1_patched/configure
+--- mailman-2.1.18-1/configure 2014-10-26 12:00:38.090360119 +0300
++++ mailman-2.1.18-1_patched/configure 2014-10-26 12:00:21.323016430 +0300
+@@ -2236,35 +2236,35 @@
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $version" >&5
+ $as_echo "$version" >&6; }
+-# See if dnspython is installed.
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dnspython" >&5
+-$as_echo_n "checking dnspython... " >&6; }
+-
+-cat > conftest.py <<EOF
+-try:
+-    import dns.resolver
+-    res = 'ok'
+-except ImportError:
+-    res = 'no'
+-fp = open("conftest.out", "w")
+-fp.write("%s\n" % res)
+-fp.close()
+-EOF
+-
+-$PYTHON conftest.py
+-havednspython=`cat conftest.out`
+-rm -f conftest.out conftest.py
+-if test "$havednspython" = "no"
+-then
+-    as_fn_error $? "
+-
+-***** dnspython not found. It is required for the new
+-***** dmarc_moderation_action featurer. Get it from
+-***** <http://www.dnspython.org/> or
+-***** <https://pypi.python.org/pypi/dnspython/>" "$LINENO" 5
+-fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $havednspython" >&5
+-$as_echo "$havednspython" >&6; }
++## See if dnspython is installed.
++#{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dnspython" >&5
++#$as_echo_n "checking dnspython... " >&6; }
++#
++#cat > conftest.py <<EOF
++#try:
++#    import dns.resolver
++#    res = 'ok'
++#except ImportError:
++#    res = 'no'
++#fp = open("conftest.out", "w")
++#fp.write("%s\n" % res)
++#fp.close()
++#EOF
++#
++#$PYTHON conftest.py
++#havednspython=`cat conftest.out`
++#rm -f conftest.out conftest.py
++#if test "$havednspython" = "no"
++#then
++#    as_fn_error $? "
++#
++#***** dnspython not found. It is required for the new
++#***** dmarc_moderation_action featurer. Get it from
++#***** <http://www.dnspython.org/> or
++#***** <https://pypi.python.org/pypi/dnspython/>" "$LINENO" 5
++#fi
++#{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $havednspython" >&5
++#$as_echo "$havednspython" >&6; }
+ # Check the email package version.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's email package" >&5
diff --git a/mail/mailman/patches/300-targetpython.patch b/mail/mailman/patches/300-targetpython.patch
new file mode 100644 (file)
index 0000000..1dd2859
--- /dev/null
@@ -0,0 +1,12 @@
+diff -Naur mailman-2.1.18-1/configure mailman-2.1.18-1_patched/configure
+--- mailman-2.1.18-1/configure 2014-05-06 20:43:56.000000000 +0400
++++ mailman-2.1.18-1_patched/configure 2014-11-04 15:02:32.892666331 +0300
+@@ -3927,6 +3927,8 @@
+ $as_echo "$URLHOST" >&6; }
+ rm -f conftest.out conftest.py
++PYTHON=/usr/bin/python
++
+ # Checks for libraries.
+ for ac_func in strerror setregid syslog
diff --git a/mail/mailman/patches/400-modules.patch b/mail/mailman/patches/400-modules.patch
new file mode 100644 (file)
index 0000000..9fa72a2
--- /dev/null
@@ -0,0 +1,35 @@
+diff -Naur mailman-2.1.18-1/Mailman/MailList.py mailman-2.1.18-1_patched/Mailman/MailList.py
+--- mailman-2.1.18-1/Mailman/MailList.py       2014-05-06 20:43:56.000000000 +0400
++++ mailman-2.1.18-1_patched/Mailman/MailList.py       2014-11-04 15:57:06.832636147 +0300
+@@ -30,7 +30,7 @@
+ import shutil
+ import socket
+ import urllib
+-import cPickle
++import pickle as cPickle
+ from cStringIO import StringIO
+ from UserDict import UserDict
+diff -Naur mailman-2.1.18-1/misc/paths.py.in mailman-2.1.18-1_patched/misc/paths.py.in
+--- mailman-2.1.18-1/misc/paths.py.in  2014-05-06 20:43:56.000000000 +0400
++++ mailman-2.1.18-1_patched/misc/paths.py.in  2014-11-04 15:55:49.594941540 +0300
+@@ -66,14 +66,14 @@
+ # In a normal interactive Python environment, the japanese.pth and korean.pth
+ # files would be imported automatically.  But because we inhibit the importing
+ # of the site module, we need to be explicit about importing these codecs.
+-if not jaok:
+-    import japanese
++#if not jaok:
++#    import japanese
+ # As of KoreanCodecs 2.0.5, you had to do the second import to get the Korean
+ # codecs installed, however leave the first import in there in case an upgrade
+ # changes this.
+-if not kook:
+-    import korean
+-    import korean.aliases
++#if not kook:
++#    import korean
++#    import korean.aliases
+ # Arabic and Hebrew (RFC-1556) encoding aliases. (temporary solution)
+ import encodings.aliases
+ encodings.aliases.aliases.update({
index 6274c9a4ef4969cfcb93a7b8fbaf01a36a5d3de6..29010e0828c50d4e3d522a753087fb37e4a5bf9b 100644 (file)
@@ -18,7 +18,7 @@ PKG_MD5SUM:=60103c411a8627e893d35e7836f904e8
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILE:=COPYRIGHT
+PKG_LICENSE_FILES:=COPYRIGHT
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 
diff --git a/mail/nail/Makefile b/mail/nail/Makefile
new file mode 100644 (file)
index 0000000..dba2018
--- /dev/null
@@ -0,0 +1,60 @@
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=nail
+PKG_VERSION:=
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-2-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=:pserver:anonymous@nail.cvs.sourceforge.net:/cvsroot/nail
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)
+PKG_SOURCE_VERSION:=-D"2014-11-24 00:00"
+PKG_SOURCE_PROTO:=cvs
+
+PKG_INSTALL:=0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/nail
+  SECTION:=mail
+  CATEGORY:=Mail
+  TITLE:=Heirloom mailx (nail)
+  URL:=http://heirloom.sourceforge.net/mailx.html
+  MAINTAINER:=Dmitry V. Zimin <pfzim@mail.ru>
+  DEPENDS:=+libopenssl
+endef
+
+define Package/nail/description
+  Heirloom mailx (formerly known as "nail") is intended provide
+  the functionality of the POSIX mailx command with additional
+  support for MIME messages, IMAP (including caching), POP3,
+  SMTP, S/MIME, message threading/sorting, scoring, and filtering
+endef
+
+define Package/nail/conffiles
+/etc/nail.rc
+endef
+
+define Build/Install
+       $(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/bin
+       $(CP) $(PKG_BUILD_DIR)/mailx $(PKG_INSTALL_DIR)/usr/bin/
+       $(INSTALL_DIR) $(PKG_INSTALL_DIR)/etc
+       $(CP) $(PKG_BUILD_DIR)/nail.rc $(PKG_INSTALL_DIR)/etc/
+endef
+
+define Package/nail/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/* $(1)/etc/
+endef
+
+$(eval $(call BuildPackage,nail))
+
diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile
new file mode 100644 (file)
index 0000000..bb75cbb
--- /dev/null
@@ -0,0 +1,227 @@
+# 
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=postfix
+PKG_RELEASE:=2
+PKG_SOURCE_URL:=ftp://ftp.porcupine.org/mirrors/postfix-release/official/
+PKG_VERSION:=2.11.3
+PKG_MD5SUM:=c3f0f51d8865559b40e9350eb3816011
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
+PKG_LICENSE:=IPL-1.0
+PKG_LICENSE_FILES:=LICENSE
+PKG_BUILD_DEPENDS:=+POSTFIX_CDB:tinycdb
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/postfix
+  SECTION:=mail
+  CATEGORY:=Mail
+  TITLE:=Postfix Mail Transmit Agent
+  URL:=http://www.postfix.org/
+  DEPENDS:=+POSTFIX_TLS:libopenssl +POSTFIX_SASL:libsasl2 +POSTFIX_LDAP:libopenldap +POSTFIX_DB:libdb47 +libpcre
+endef
+
+define Package/postfix/description
+ Postfix is Wietse Venema's mailer that started life as an alternative to the widely-used Sendmail program. Postfix attempts to be fast, easy to administer, and secure, while at the same time being sendmail compatible enough to not upset existing users. Thus, the outside has a sendmail-ish flavor, but the inside is completely different.
+endef
+
+define Package/postfix/config
+       menu "Select postfix build options"
+               config POSTFIX_TLS
+                       bool "TLS support"
+                       default y
+                       help
+                         Implements TLS support in postfix (using OpenSSL).
+               config POSTFIX_SASL
+                       bool "SASL support"
+                       default y
+                       help
+                         Implements SASL support in postfix (using Cyrus SASL).
+               config POSTFIX_LDAP
+                       bool "LDAP support"
+                       default y
+                       help
+                         Implements LDAP support in postfix (using OpenLDAP).
+               config POSTFIX_DB
+                       bool "BerkeleyDB support"
+                       default n
+                       help
+                         Implements support for btree files using Berkeley DB. Note that hash files support is not compiled into Berkeley DB OpenWRT distribution
+               config POSTFIX_CDB
+                       bool "CDB support"
+                       default y
+                       help
+                         Implements support for cdb files using tinycdb
+       endmenu
+endef
+
+CCARGS=-DNO_EPOLL -DNO_SIGSETJMP -DNO_NIS
+AUXLIBS=-L$(STAGING_DIR)/usr/lib
+default_database_type=cdb
+
+ifdef CONFIG_POSTFIX_TLS
+  CCARGS+=-DUSE_TLS
+  AUXLIBS+=-lssl -lcrypto
+endif
+
+ifdef CONFIG_POSTFIX_SASL
+  CCARGS+=-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I$(STAGING_DIR)/usr/include/sasl
+  AUXLIBS+=-lsasl2
+endif
+
+ifdef CONFIG_POSTFIX_LDAP
+  CCARGS+=-DHAS_LDAP
+  AUXLIBS+=-lldap -llber
+endif
+
+ifdef CONFIG_POSTFIX_CDB
+  CCARGS+=-DHAS_CDB
+  AUXLIBS+=-lcdb
+endif
+
+ifdef CONFIG_POSTFIX_DB
+  AUXLIBS+=-ldb
+  CCARGS+=-DHAS_DB
+  ifndef CONFIG_POSTFIX_CDB
+    default_database_type=btree
+  endif
+else
+  CCARGS+=-DNO_DB
+endif
+
+CCARGS+=-DDEF_DB_TYPE=\"$(default_database_type)\"
+
+config_directory=/etc/postfix# also add this to postfix init file
+sample_directory=/etc/postfix
+command_directory=/usr/sbin
+daemon_directory=/usr/libexec/postfix
+data_directory=/usr/var/lib/postfix
+queue_directory=/usr/var/spool/postfix
+mail_spool_directory=/usr/var/mail
+html_directory=no
+manpage_directory=no
+readme_directory=no
+sendmail_path=/usr/sbin/sendmail
+newaliases_path=/usr/bin/newaliases
+mailq_path=/usr/bin/mailq
+
+ln_suffix=.postfix
+ln_old_suffix=.old
+
+define Package/postfix/conffiles
+$(config_directory)/main.cf
+$(config_directory)/master.cf
+$(config_directory)/aliases
+endef
+
+define Build/Configure
+       if [ "$(CONFIG_POSTFIX_DB)" = "" -a "$(CONFIG_POSTFIX_CDB)" = "" ]; then\
+         echo "Build error: You must select at least one of the DB types";\
+          exit 1;\
+       fi
+
+       cd $(PKG_BUILD_DIR); $(MAKE) makefiles CCARGS='$(CCARGS)' $(TARGET_CONFIGURE_OPTS) AUXLIBS="$(AUXLIBS)"
+endef
+
+define Build/Compile
+       # Currently postfix has a bug with Makefiles that CCARGS are not passed to the compiler, so we are copying them to CC
+       cd $(PKG_BUILD_DIR); $(MAKE) $(TARGET_CONFIGURE_OPTS) CC='$(TARGET_CC) $(CCARGS)'
+       cp ./files/main.cf.default $(PKG_BUILD_DIR)/conf/main.cf.default
+       echo "default_database_type = $(default_database_type)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+       echo "alias_database = $(default_database_type):$(config_directory)/aliases" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+       echo "alias_maps = $(default_database_type):$(config_directory)/aliases" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+       echo "sendmail_path = $(sendmail_path)$(ln_suffix)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+       echo "newaliases_path = $(newaliases_path)$(ln_suffix)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+       echo "mailq_path = $(mailq_path)$(ln_suffix)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+       echo "html_directory = $(html_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+       echo "manpage_directory = $(manpage_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+       echo "sample_directory = $(sample_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+       echo "readme_directory = $(readme_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+       echo "command_directory = $(command_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+       echo "daemon_directory = $(daemon_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+       echo "data_directory = $(data_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+       echo "queue_directory = $(queue_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+       echo "config_directory = $(config_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+       echo "mail_spool_directory = $(mail_spool_directory)" >> $(PKG_BUILD_DIR)/conf/main.cf.default
+endef
+
+define Package/postfix/install
+       cd $(PKG_BUILD_DIR); $(MAKE) install_root=$(1) command_directory=$(command_directory) daemon_directory=$(daemon_directory) data_directory=$(data_directory) html_directory=$(html_directory) mail_owner=postfix mailq_path=$(mailq_path)$(ln_suffix) manpage_directory=$(manpage_directory) newaliases_path=$(newaliases_path)$(ln_suffix) queue_directory=$(queue_directory) readme_directory=$(readme_directory) sendmail_path=$(sendmail_path)$(ln_suffix) setgid_group=postdrop sample_directory=$(sample_directory) config_directory=$(config_directory) non-interactive-package
+       $(INSTALL_DIR) $(1)$(mail_spool_directory)
+       $(INSTALL_DIR) $(1)/etc/init.d/
+       $(INSTALL_BIN) ./files/postfix.init $(1)/etc/init.d/postfix
+endef
+
+define Package/postfix/postinst
+#!/bin/sh
+
+ if [ -f "$${IPKG_INSTROOT}$(sendmail_path)" -a "$$(readlink "$${IPKG_INSTROOT}$(sendmail_path)")" != "$(sendmail_path)$(ln_suffix)" ]; then
+  mv "$${IPKG_INSTROOT}$(sendmail_path)" "$${IPKG_INSTROOT}$(sendmail_path)$(ln_old_suffix)"
+  echo "Warning: $${IPKG_INSTROOT}$(sendmail_path) saved as $${IPKG_INSTROOT}$(sendmail_path)$(ln_old_suffix)"
+ fi
+ if [ ! -f "$${IPKG_INSTROOT}$(sendmail_path)" ]; then
+  ln -s "$${IPKG_INSTROOT}$(sendmail_path)$(ln_suffix)" "$(sendmail_path)"
+ fi
+
+ if [ -f "$${IPKG_INSTROOT}$(newaliases_path)" -a "$$(readlink "$${IPKG_INSTROOT}$(newaliases_path)")" != "$(newaliases_path)$(ln_suffix)" ]; then
+  mv "$${IPKG_INSTROOT}$(newaliases_path)" "$${IPKG_INSTROOT}$(newaliases_path)$(ln_old_suffix)"
+  echo "Warning: $${IPKG_INSTROOT}$(newaliases_path) saved as $${IPKG_INSTROOT}$(newaliases_path)$(ln_old_suffix)"
+ fi
+ if [ ! -f "$${IPKG_INSTROOT}$(newaliases_path)" ]; then
+  ln -s "$${IPKG_INSTROOT}$(newaliases_path)$(ln_suffix)" "$(newaliases_path)"
+ fi
+
+ if [ -f "$${IPKG_INSTROOT}$(mailq_path)" -a "$$(readlink "$${IPKG_INSTROOT}$(mailq_path)")" != "$(mailq_path)$(ln_suffix)" ]; then
+  mv "$${IPKG_INSTROOT}$(mailq_path)" "$${IPKG_INSTROOT}$(mailq_path)$(ln_old_suffix)"
+  echo "Warning: $${IPKG_INSTROOT}$(mailq_path) saved as $${IPKG_INSTROOT}$(mailq_path)$(ln_old_suffix)"
+ fi
+ if [ ! -f "$(mailq_path)" ]; then
+  ln -s "$${IPKG_INSTROOT}$(mailq_path)$(ln_suffix)" "$(mailq_path)"
+ fi
+
+ grep -qc main\.cf "$${IPKG_INSTROOT}"/etc/sysupgrade.conf >/dev/null || echo "$(config_directory)/main.cf" >> "$${IPKG_INSTROOT}"/etc/sysupgrade.conf
+ grep -qc master\.cf "$${IPKG_INSTROOT}"/etc/sysupgrade.conf >/dev/null || echo "$(config_directory)/master.cf" >> "$${IPKG_INSTROOT}"/etc/sysupgrade.conf
+ grep -qc aliases "$${IPKG_INSTROOT}"/etc/sysupgrade.conf >/dev/null || echo "$(config_directory)/aliases" >> "$${IPKG_INSTROOT}"/etc/sysupgrade.conf
+
+ touch "$${IPKG_INSTROOT}$(config_directory)"/opkg_postinst
+
+ if [ -z "$${IPKG_INSTROOT}" ]; then
+  ps | grep "postfix/master" | grep -cvq grep >/dev/null && /etc/init.d/postfix reload
+ fi
+
+endef
+
+define Package/postfix/prerm
+#!/bin/sh
+ ps | grep "postfix/master" | grep -cvq grep >/dev/null && postfix stop
+ /etc/init.d/postfix disable
+endef
+
+define Package/postfix/postrm
+#!/bin/sh
+ rm -f $${IPKG_INSTROOT}$(config_directory)/aliases.cdb $${IPKG_INSTROOT}$(config_directory)/aliases.db $${IPKG_INSTROOT}$(data_directory)/master.lock
+
+ rm -f "$${IPKG_INSTROOT}$(sendmail_path)" "$${IPKG_INSTROOT}$(newaliases_path)" "$${IPKG_INSTROOT}$(mailq_path)"
+
+ if [ -f "$${IPKG_INSTROOT}$(sendmail_path)$(ln_old_suffix)" ]; then
+  mv "$${IPKG_INSTROOT}$(sendmail_path)$(ln_old_suffix)" "$${IPKG_INSTROOT}$(sendmail_path)"
+  echo "Warning: $${IPKG_INSTROOT}$(sendmail_path) restored from $${IPKG_INSTROOT}$(sendmail_path)$(ln_old_suffix)"
+ fi
+ if [ -f "$${IPKG_INSTROOT}$(newaliases_path)$(ln_old_suffix)" ]; then
+  mv "$${IPKG_INSTROOT}$(newaliases_path)$(ln_old_suffix)" "$${IPKG_INSTROOT}$(newaliases_path)"
+  echo "Warning: $${IPKG_INSTROOT}$(newaliases_path) restored from $${IPKG_INSTROOT}$(newaliases_path)$(ln_old_suffix)"
+ fi
+ if [ -f "$${IPKG_INSTROOT}$(mailq_path)$(ln_old_suffix)" ]; then
+  mv "$${IPKG_INSTROOT}$(mailq_path)$(ln_old_suffix)" "$${IPKG_INSTROOT}$(mailq_path)"
+  echo "Warning: $${IPKG_INSTROOT}$(mailq_path) restored from $${IPKG_INSTROOT}$(mailq_path)$(ln_old_suffix)"
+ fi
+endef
+
+$(eval $(call BuildPackage,postfix))
diff --git a/mail/postfix/files/main.cf.default b/mail/postfix/files/main.cf.default
new file mode 100644 (file)
index 0000000..7947dbc
--- /dev/null
@@ -0,0 +1,816 @@
+# DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE
+# TEXT HERE JUST SHOWS DEFAULT SETTINGS BUILT INTO POSTFIX.
+#
+2bounce_notice_recipient = postmaster
+access_map_defer_code = 450
+access_map_reject_code = 554
+address_verify_cache_cleanup_interval = 12h
+address_verify_default_transport = $default_transport
+address_verify_local_transport = $local_transport
+address_verify_map = btree:$data_directory/verify_cache
+address_verify_negative_cache = yes
+address_verify_negative_expire_time = 3d
+address_verify_negative_refresh_time = 3h
+address_verify_poll_count = ${stress?1}${stress:3}
+address_verify_poll_delay = 3s
+address_verify_positive_expire_time = 31d
+address_verify_positive_refresh_time = 7d
+address_verify_relay_transport = $relay_transport
+address_verify_relayhost = $relayhost
+address_verify_sender = $double_bounce_sender
+address_verify_sender_dependent_default_transport_maps = $sender_dependent_default_transport_maps
+address_verify_sender_dependent_relayhost_maps = $sender_dependent_relayhost_maps
+address_verify_sender_ttl = 0s
+address_verify_service_name = verify
+address_verify_transport_maps = $transport_maps
+address_verify_virtual_transport = $virtual_transport
+allow_mail_to_commands = alias, forward
+allow_mail_to_files = alias, forward
+allow_min_user = no
+allow_percent_hack = yes
+allow_untrusted_routing = no
+alternate_config_directories =
+always_add_missing_headers = no
+always_bcc =
+anvil_rate_time_unit = 60s
+anvil_status_update_time = 600s
+append_at_myorigin = yes
+append_dot_mydomain = yes
+application_event_drain_time = 100s
+authorized_flush_users = static:anyone
+authorized_mailq_users = static:anyone
+authorized_submit_users = static:anyone
+backwards_bounce_logfile_compatibility = yes
+berkeley_db_create_buffer_size = 16777216
+berkeley_db_read_buffer_size = 131072
+best_mx_transport =
+biff = yes
+body_checks =
+body_checks_size_limit = 51200
+bounce_notice_recipient = postmaster
+bounce_queue_lifetime = 5d
+bounce_service_name = bounce
+bounce_size_limit = 50000
+bounce_template_file =
+broken_sasl_auth_clients = no
+canonical_classes = envelope_sender, envelope_recipient, header_sender, header_recipient
+canonical_maps =
+cleanup_service_name = cleanup
+command_execution_directory =
+command_expansion_filter = 1234567890!@%-_=+:,./abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
+command_time_limit = 1000s
+connection_cache_protocol_timeout = 5s
+connection_cache_service_name = scache
+connection_cache_status_update_time = 600s
+connection_cache_ttl_limit = 2s
+content_filter =
+cyrus_sasl_config_path =
+daemon_table_open_error_is_fatal = no
+daemon_timeout = 18000s
+debug_peer_level = 2
+debug_peer_list =
+debugger_command =
+default_delivery_slot_cost = 5
+default_delivery_slot_discount = 50
+default_delivery_slot_loan = 3
+default_destination_concurrency_failed_cohort_limit = 1
+default_destination_concurrency_limit = 20
+default_destination_concurrency_negative_feedback = 1
+default_destination_concurrency_positive_feedback = 1
+default_destination_rate_delay = 0s
+default_destination_recipient_limit = 50
+default_extra_recipient_limit = 1000
+default_filter_nexthop =
+default_minimum_delivery_slots = 3
+default_privs = nobody
+default_process_limit = 100
+default_rbl_reply = $rbl_code Service unavailable; $rbl_class [$rbl_what] blocked using $rbl_domain${rbl_reason?; $rbl_reason}
+default_recipient_limit = 20000
+default_recipient_refill_delay = 5s
+default_recipient_refill_limit = 100
+default_transport = smtp
+default_verp_delimiters = +=
+defer_code = 450
+defer_service_name = defer
+defer_transports =
+delay_logging_resolution_limit = 2
+delay_notice_recipient = postmaster
+delay_warning_time = 0h
+deliver_lock_attempts = 20
+deliver_lock_delay = 1s
+destination_concurrency_feedback_debug = no
+detect_8bit_encoding_header = yes
+disable_dns_lookups = no
+disable_mime_input_processing = no
+disable_mime_output_conversion = no
+disable_verp_bounces = no
+disable_vrfy_command = no
+dnsblog_reply_delay = 0s
+dnsblog_service_name = dnsblog
+dont_remove = 0
+double_bounce_sender = double-bounce
+duplicate_filter_limit = 1000
+empty_address_default_transport_maps_lookup_key = <>
+empty_address_recipient = MAILER-DAEMON
+empty_address_relayhost_maps_lookup_key = <>
+enable_long_queue_ids = no
+enable_original_recipient = yes
+error_delivery_slot_cost = $default_delivery_slot_cost
+error_delivery_slot_discount = $default_delivery_slot_discount
+error_delivery_slot_loan = $default_delivery_slot_loan
+error_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
+error_destination_concurrency_limit = $default_destination_concurrency_limit
+error_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
+error_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
+error_destination_rate_delay = $default_destination_rate_delay
+error_destination_recipient_limit = $default_destination_recipient_limit
+error_extra_recipient_limit = $default_extra_recipient_limit
+error_initial_destination_concurrency = $initial_destination_concurrency
+error_minimum_delivery_slots = $default_minimum_delivery_slots
+error_notice_recipient = postmaster
+error_recipient_limit = $default_recipient_limit
+error_recipient_refill_delay = $default_recipient_refill_delay
+error_recipient_refill_limit = $default_recipient_refill_limit
+error_service_name = error
+execution_directory_expansion_filter = 1234567890!@%-_=+:,./abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
+expand_owner_alias = no
+export_environment = TZ MAIL_CONFIG LANG
+fallback_transport =
+fallback_transport_maps =
+fast_flush_domains = $relay_domains
+fast_flush_purge_time = 7d
+fast_flush_refresh_time = 12h
+fault_injection_code = 0
+flush_service_name = flush
+fork_attempts = 5
+fork_delay = 1s
+forward_expansion_filter = 1234567890!@%-_=+:,./abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
+forward_path = $home/.forward${recipient_delimiter}${extension}, $home/.forward
+frozen_delivered_to = yes
+hash_queue_depth = 1
+hash_queue_names = deferred, defer
+header_address_token_limit = 10240
+header_checks =
+header_size_limit = 102400
+helpful_warnings = yes
+home_mailbox =
+hopcount_limit = 50
+ignore_mx_lookup_error = no
+import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY DISPLAY LANG=C
+in_flow_delay = 1s
+inet_interfaces = all
+inet_protocols = all
+initial_destination_concurrency = 5
+internal_mail_filter_classes =
+invalid_hostname_reject_code = 501
+ipc_idle = 5s
+ipc_timeout = 3600s
+ipc_ttl = 1000s
+line_length_limit = 2048
+lmdb_map_size = 16777216
+lmtp_address_preference = any
+lmtp_assume_final = no
+lmtp_bind_address =
+lmtp_bind_address6 =
+lmtp_body_checks =
+lmtp_cname_overrides_servername = no
+lmtp_connect_timeout = 0s
+lmtp_connection_cache_destinations =
+lmtp_connection_cache_on_demand = yes
+lmtp_connection_cache_time_limit = 2s
+lmtp_connection_reuse_count_limit = 0
+lmtp_connection_reuse_time_limit = 300s
+lmtp_data_done_timeout = 600s
+lmtp_data_init_timeout = 120s
+lmtp_data_xfer_timeout = 180s
+lmtp_defer_if_no_mx_address_found = no
+lmtp_delivery_slot_cost = $default_delivery_slot_cost
+lmtp_delivery_slot_discount = $default_delivery_slot_discount
+lmtp_delivery_slot_loan = $default_delivery_slot_loan
+lmtp_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
+lmtp_destination_concurrency_limit = $default_destination_concurrency_limit
+lmtp_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
+lmtp_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
+lmtp_destination_rate_delay = $default_destination_rate_delay
+lmtp_destination_recipient_limit = $default_destination_recipient_limit
+lmtp_discard_lhlo_keyword_address_maps =
+lmtp_discard_lhlo_keywords =
+lmtp_dns_resolver_options =
+lmtp_dns_support_level =
+lmtp_enforce_tls = no
+lmtp_extra_recipient_limit = $default_extra_recipient_limit
+lmtp_generic_maps =
+lmtp_header_checks =
+lmtp_host_lookup = dns
+lmtp_initial_destination_concurrency = $initial_destination_concurrency
+lmtp_lhlo_name = $myhostname
+lmtp_lhlo_timeout = 300s
+lmtp_line_length_limit = 998
+lmtp_mail_timeout = 300s
+lmtp_mime_header_checks =
+lmtp_minimum_delivery_slots = $default_minimum_delivery_slots
+lmtp_mx_address_limit = 5
+lmtp_mx_session_limit = 2
+lmtp_nested_header_checks =
+lmtp_per_record_deadline = no
+lmtp_pix_workaround_delay_time = 10s
+lmtp_pix_workaround_maps =
+lmtp_pix_workaround_threshold_time = 500s
+lmtp_pix_workarounds = disable_esmtp,delay_dotcrlf
+lmtp_quit_timeout = 300s
+lmtp_quote_rfc821_envelope = yes
+lmtp_randomize_addresses = yes
+lmtp_rcpt_timeout = 300s
+lmtp_recipient_limit = $default_recipient_limit
+lmtp_recipient_refill_delay = $default_recipient_refill_delay
+lmtp_recipient_refill_limit = $default_recipient_refill_limit
+lmtp_reply_filter =
+lmtp_rset_timeout = 20s
+lmtp_sasl_auth_cache_name =
+lmtp_sasl_auth_cache_time = 90d
+lmtp_sasl_auth_enable = no
+lmtp_sasl_auth_soft_bounce = yes
+lmtp_sasl_mechanism_filter =
+lmtp_sasl_password_maps =
+lmtp_sasl_path =
+lmtp_sasl_security_options = noplaintext, noanonymous
+lmtp_sasl_tls_security_options = $lmtp_sasl_security_options
+lmtp_sasl_tls_verified_security_options = $lmtp_sasl_tls_security_options
+lmtp_sasl_type = cyrus
+lmtp_send_dummy_mail_auth = no
+lmtp_send_xforward_command = no
+lmtp_sender_dependent_authentication = no
+lmtp_skip_5xx_greeting = yes
+lmtp_skip_quit_response = no
+lmtp_starttls_timeout = 300s
+lmtp_tcp_port = 24
+lmtp_tls_CAfile =
+lmtp_tls_CApath =
+lmtp_tls_block_early_mail_reply = no
+lmtp_tls_cert_file =
+lmtp_tls_ciphers = export
+lmtp_tls_dcert_file =
+lmtp_tls_dkey_file = $lmtp_tls_dcert_file
+lmtp_tls_eccert_file =
+lmtp_tls_eckey_file = $lmtp_tls_eccert_file
+lmtp_tls_enforce_peername = yes
+lmtp_tls_exclude_ciphers =
+lmtp_tls_fingerprint_cert_match =
+lmtp_tls_fingerprint_digest = md5
+lmtp_tls_force_insecure_host_tlsa_lookup = no
+lmtp_tls_key_file = $lmtp_tls_cert_file
+lmtp_tls_loglevel = 0
+lmtp_tls_mandatory_ciphers = medium
+lmtp_tls_mandatory_exclude_ciphers =
+lmtp_tls_mandatory_protocols = !SSLv2
+lmtp_tls_note_starttls_offer = no
+lmtp_tls_per_site =
+lmtp_tls_policy_maps =
+lmtp_tls_protocols = !SSLv2
+lmtp_tls_scert_verifydepth = 9
+lmtp_tls_secure_cert_match = nexthop
+lmtp_tls_security_level =
+lmtp_tls_session_cache_database =
+lmtp_tls_session_cache_timeout = 3600s
+lmtp_tls_trust_anchor_file =
+lmtp_tls_verify_cert_match = hostname
+lmtp_use_tls = no
+lmtp_xforward_timeout = 300s
+local_command_shell =
+local_delivery_slot_cost = $default_delivery_slot_cost
+local_delivery_slot_discount = $default_delivery_slot_discount
+local_delivery_slot_loan = $default_delivery_slot_loan
+local_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
+local_destination_concurrency_limit = 2
+local_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
+local_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
+local_destination_rate_delay = $default_destination_rate_delay
+local_destination_recipient_limit = 1
+local_extra_recipient_limit = $default_extra_recipient_limit
+local_header_rewrite_clients = permit_inet_interfaces
+local_initial_destination_concurrency = $initial_destination_concurrency
+local_minimum_delivery_slots = $default_minimum_delivery_slots
+local_recipient_limit = $default_recipient_limit
+local_recipient_maps = proxy:unix:passwd.byname $alias_maps
+local_recipient_refill_delay = $default_recipient_refill_delay
+local_recipient_refill_limit = $default_recipient_refill_limit
+local_transport = local:$myhostname
+luser_relay =
+mail_name = Postfix
+mail_owner = postfix
+mail_release_date = 20140507
+mail_version = 2.11.1
+mailbox_command =
+mailbox_command_maps =
+mailbox_delivery_lock = fcntl, dotlock
+mailbox_size_limit = 51200000
+mailbox_transport =
+mailbox_transport_maps =
+maps_rbl_domains =
+maps_rbl_reject_code = 554
+masquerade_classes = envelope_sender, header_sender, header_recipient
+masquerade_domains =
+masquerade_exceptions =
+master_service_disable =
+max_idle = 100s
+max_use = 100
+maximal_backoff_time = 4000s
+maximal_queue_lifetime = 5d
+message_reject_characters =
+message_size_limit = 10240000
+message_strip_characters =
+milter_command_timeout = 30s
+milter_connect_macros = j {daemon_name} v
+milter_connect_timeout = 30s
+milter_content_timeout = 300s
+milter_data_macros = i
+milter_default_action = tempfail
+milter_end_of_data_macros = i
+milter_end_of_header_macros = i
+milter_header_checks =
+milter_helo_macros = {tls_version} {cipher} {cipher_bits} {cert_subject} {cert_issuer}
+milter_macro_daemon_name = $myhostname
+milter_macro_v = $mail_name $mail_version
+milter_mail_macros = i {auth_type} {auth_authen} {auth_author} {mail_addr} {mail_host} {mail_mailer}
+milter_protocol = 6
+milter_rcpt_macros = i {rcpt_addr} {rcpt_host} {rcpt_mailer}
+milter_unknown_command_macros =
+mime_boundary_length_limit = 2048
+mime_header_checks = $header_checks
+mime_nesting_limit = 100
+minimal_backoff_time = 300s
+multi_instance_directories =
+multi_instance_enable = no
+multi_instance_group =
+multi_instance_name =
+multi_instance_wrapper =
+multi_recipient_bounce_reject_code = 550
+mydestination = $myhostname, localhost.$mydomain, localhost
+mynetworks_style = subnet
+myorigin = $myhostname
+nested_header_checks = $header_checks
+non_fqdn_reject_code = 504
+non_smtpd_milters =
+notify_classes = resource, software
+owner_request_special = yes
+parent_domain_matches_subdomains = debug_peer_list,fast_flush_domains,mynetworks,permit_mx_backup_networks,qmqpd_authorized_clients,relay_domains,smtpd_access_maps
+permit_mx_backup_networks =
+pickup_service_name = pickup
+plaintext_reject_code = 450
+postmulti_control_commands = reload flush
+postmulti_start_commands = start
+postmulti_stop_commands = stop abort drain quick-stop
+postscreen_access_list = permit_mynetworks
+postscreen_bare_newline_action = ignore
+postscreen_bare_newline_enable = no
+postscreen_bare_newline_ttl = 30d
+postscreen_blacklist_action = ignore
+postscreen_cache_cleanup_interval = 12h
+postscreen_cache_map = btree:$data_directory/postscreen_cache
+postscreen_cache_retention_time = 7d
+postscreen_client_connection_count_limit = $smtpd_client_connection_count_limit
+postscreen_command_count_limit = 20
+postscreen_command_filter =
+postscreen_command_time_limit = ${stress?10}${stress:300}s
+postscreen_disable_vrfy_command = $disable_vrfy_command
+postscreen_discard_ehlo_keyword_address_maps = $smtpd_discard_ehlo_keyword_address_maps
+postscreen_discard_ehlo_keywords = $smtpd_discard_ehlo_keywords
+postscreen_dnsbl_action = ignore
+postscreen_dnsbl_reply_map =
+postscreen_dnsbl_sites =
+postscreen_dnsbl_threshold = 1
+postscreen_dnsbl_ttl = 1h
+postscreen_dnsbl_whitelist_threshold = 0
+postscreen_enforce_tls = $smtpd_enforce_tls
+postscreen_expansion_filter = $smtpd_expansion_filter
+postscreen_forbidden_commands = $smtpd_forbidden_commands
+postscreen_greet_action = ignore
+postscreen_greet_banner = $smtpd_banner
+postscreen_greet_ttl = 1d
+postscreen_greet_wait = ${stress?2}${stress:6}s
+postscreen_helo_required = $smtpd_helo_required
+postscreen_non_smtp_command_action = drop
+postscreen_non_smtp_command_enable = no
+postscreen_non_smtp_command_ttl = 30d
+postscreen_pipelining_action = enforce
+postscreen_pipelining_enable = no
+postscreen_pipelining_ttl = 30d
+postscreen_post_queue_limit = $default_process_limit
+postscreen_pre_queue_limit = $default_process_limit
+postscreen_reject_footer = $smtpd_reject_footer
+postscreen_tls_security_level = $smtpd_tls_security_level
+postscreen_upstream_proxy_protocol =
+postscreen_upstream_proxy_timeout = 5s
+postscreen_use_tls = $smtpd_use_tls
+postscreen_watchdog_timeout = 10s
+postscreen_whitelist_interfaces = static:all
+prepend_delivered_header = command, file, forward
+process_id = 6537
+process_id_directory = pid
+process_name = postconf
+propagate_unmatched_extensions = canonical, virtual
+proxy_interfaces =
+proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps $sender_bcc_maps $recipient_bcc_maps $smtp_generic_maps $lmtp_generic_maps $alias_maps
+proxy_write_maps = $smtp_sasl_auth_cache_name $lmtp_sasl_auth_cache_name $address_verify_map $postscreen_cache_map
+proxymap_service_name = proxymap
+proxywrite_service_name = proxywrite
+qmgr_clog_warn_time = 300s
+qmgr_daemon_timeout = 1000s
+qmgr_fudge_factor = 100
+qmgr_ipc_timeout = 60s
+qmgr_message_active_limit = 20000
+qmgr_message_recipient_limit = 20000
+qmgr_message_recipient_minimum = 10
+qmqpd_authorized_clients =
+qmqpd_client_port_logging = no
+qmqpd_error_delay = 1s
+qmqpd_timeout = 300s
+queue_file_attribute_count_limit = 100
+queue_minfree = 0
+queue_run_delay = 300s
+queue_service_name = qmgr
+rbl_reply_maps =
+receive_override_options =
+recipient_bcc_maps =
+recipient_canonical_classes = envelope_recipient, header_recipient
+recipient_canonical_maps =
+recipient_delimiter =
+reject_code = 554
+reject_tempfail_action = defer_if_permit
+relay_clientcerts =
+relay_delivery_slot_cost = $default_delivery_slot_cost
+relay_delivery_slot_discount = $default_delivery_slot_discount
+relay_delivery_slot_loan = $default_delivery_slot_loan
+relay_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
+relay_destination_concurrency_limit = $default_destination_concurrency_limit
+relay_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
+relay_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
+relay_destination_rate_delay = $default_destination_rate_delay
+relay_destination_recipient_limit = $default_destination_recipient_limit
+relay_domains = $mydestination
+relay_domains_reject_code = 554
+relay_extra_recipient_limit = $default_extra_recipient_limit
+relay_initial_destination_concurrency = $initial_destination_concurrency
+relay_minimum_delivery_slots = $default_minimum_delivery_slots
+relay_recipient_limit = $default_recipient_limit
+relay_recipient_maps =
+relay_recipient_refill_delay = $default_recipient_refill_delay
+relay_recipient_refill_limit = $default_recipient_refill_limit
+relay_transport = relay
+relayhost =
+relocated_maps =
+remote_header_rewrite_domain =
+require_home_directory = no
+reset_owner_alias = no
+resolve_dequoted_address = yes
+resolve_null_domain = no
+resolve_numeric_domain = no
+retry_delivery_slot_cost = $default_delivery_slot_cost
+retry_delivery_slot_discount = $default_delivery_slot_discount
+retry_delivery_slot_loan = $default_delivery_slot_loan
+retry_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
+retry_destination_concurrency_limit = $default_destination_concurrency_limit
+retry_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
+retry_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
+retry_destination_rate_delay = $default_destination_rate_delay
+retry_destination_recipient_limit = $default_destination_recipient_limit
+retry_extra_recipient_limit = $default_extra_recipient_limit
+retry_initial_destination_concurrency = $initial_destination_concurrency
+retry_minimum_delivery_slots = $default_minimum_delivery_slots
+retry_recipient_limit = $default_recipient_limit
+retry_recipient_refill_delay = $default_recipient_refill_delay
+retry_recipient_refill_limit = $default_recipient_refill_limit
+rewrite_service_name = rewrite
+send_cyrus_sasl_authzid = no
+sender_bcc_maps =
+sender_canonical_classes = envelope_sender, header_sender
+sender_canonical_maps =
+sender_dependent_default_transport_maps =
+sender_dependent_relayhost_maps =
+sendmail_fix_line_endings = always
+service_throttle_time = 60s
+setgid_group = postdrop
+show_user_unknown_table_name = yes
+showq_service_name = showq
+smtp_address_preference = any
+smtp_always_send_ehlo = yes
+smtp_bind_address =
+smtp_bind_address6 =
+smtp_body_checks =
+smtp_cname_overrides_servername = no
+smtp_connect_timeout = 30s
+smtp_connection_cache_destinations =
+smtp_connection_cache_on_demand = yes
+smtp_connection_cache_time_limit = 2s
+smtp_connection_reuse_count_limit = 0
+smtp_connection_reuse_time_limit = 300s
+smtp_data_done_timeout = 600s
+smtp_data_init_timeout = 120s
+smtp_data_xfer_timeout = 180s
+smtp_defer_if_no_mx_address_found = no
+smtp_delivery_slot_cost = $default_delivery_slot_cost
+smtp_delivery_slot_discount = $default_delivery_slot_discount
+smtp_delivery_slot_loan = $default_delivery_slot_loan
+smtp_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
+smtp_destination_concurrency_limit = $default_destination_concurrency_limit
+smtp_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
+smtp_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
+smtp_destination_rate_delay = $default_destination_rate_delay
+smtp_destination_recipient_limit = $default_destination_recipient_limit
+smtp_discard_ehlo_keyword_address_maps =
+smtp_discard_ehlo_keywords =
+smtp_dns_resolver_options =
+smtp_dns_support_level =
+smtp_enforce_tls = no
+smtp_extra_recipient_limit = $default_extra_recipient_limit
+smtp_fallback_relay = $fallback_relay
+smtp_generic_maps =
+smtp_header_checks =
+smtp_helo_name = $myhostname
+smtp_helo_timeout = 300s
+smtp_host_lookup = dns
+smtp_initial_destination_concurrency = $initial_destination_concurrency
+smtp_line_length_limit = 998
+smtp_mail_timeout = 300s
+smtp_mime_header_checks =
+smtp_minimum_delivery_slots = $default_minimum_delivery_slots
+smtp_mx_address_limit = 5
+smtp_mx_session_limit = 2
+smtp_nested_header_checks =
+smtp_never_send_ehlo = no
+smtp_per_record_deadline = no
+smtp_pix_workaround_delay_time = 10s
+smtp_pix_workaround_maps =
+smtp_pix_workaround_threshold_time = 500s
+smtp_pix_workarounds = disable_esmtp,delay_dotcrlf
+smtp_quit_timeout = 300s
+smtp_quote_rfc821_envelope = yes
+smtp_randomize_addresses = yes
+smtp_rcpt_timeout = 300s
+smtp_recipient_limit = $default_recipient_limit
+smtp_recipient_refill_delay = $default_recipient_refill_delay
+smtp_recipient_refill_limit = $default_recipient_refill_limit
+smtp_reply_filter =
+smtp_rset_timeout = 20s
+smtp_sasl_auth_cache_name =
+smtp_sasl_auth_cache_time = 90d
+smtp_sasl_auth_enable = no
+smtp_sasl_auth_soft_bounce = yes
+smtp_sasl_mechanism_filter =
+smtp_sasl_password_maps =
+smtp_sasl_path =
+smtp_sasl_security_options = noplaintext, noanonymous
+smtp_sasl_tls_security_options = $smtp_sasl_security_options
+smtp_sasl_tls_verified_security_options = $smtp_sasl_tls_security_options
+smtp_sasl_type = cyrus
+smtp_send_dummy_mail_auth = no
+smtp_send_xforward_command = no
+smtp_sender_dependent_authentication = no
+smtp_skip_5xx_greeting = yes
+smtp_skip_quit_response = yes
+smtp_starttls_timeout = 300s
+smtp_tls_CAfile =
+smtp_tls_CApath =
+smtp_tls_block_early_mail_reply = no
+smtp_tls_cert_file =
+smtp_tls_ciphers = export
+smtp_tls_dcert_file =
+smtp_tls_dkey_file = $smtp_tls_dcert_file
+smtp_tls_eccert_file =
+smtp_tls_eckey_file = $smtp_tls_eccert_file
+smtp_tls_enforce_peername = yes
+smtp_tls_exclude_ciphers =
+smtp_tls_fingerprint_cert_match =
+smtp_tls_fingerprint_digest = md5
+smtp_tls_force_insecure_host_tlsa_lookup = no
+smtp_tls_key_file = $smtp_tls_cert_file
+smtp_tls_loglevel = 0
+smtp_tls_mandatory_ciphers = medium
+smtp_tls_mandatory_exclude_ciphers =
+smtp_tls_mandatory_protocols = !SSLv2
+smtp_tls_note_starttls_offer = no
+smtp_tls_per_site =
+smtp_tls_policy_maps =
+smtp_tls_protocols = !SSLv2
+smtp_tls_scert_verifydepth = 9
+smtp_tls_secure_cert_match = nexthop, dot-nexthop
+smtp_tls_security_level =
+smtp_tls_session_cache_database =
+smtp_tls_session_cache_timeout = 3600s
+smtp_tls_trust_anchor_file =
+smtp_tls_verify_cert_match = hostname
+smtp_use_tls = no
+smtp_xforward_timeout = 300s
+smtpd_authorized_verp_clients = $authorized_verp_clients
+smtpd_authorized_xclient_hosts =
+smtpd_authorized_xforward_hosts =
+smtpd_banner = $myhostname ESMTP $mail_name
+smtpd_client_connection_count_limit = 50
+smtpd_client_connection_rate_limit = 0
+smtpd_client_event_limit_exceptions = ${smtpd_client_connection_limit_exceptions:$mynetworks}
+smtpd_client_message_rate_limit = 0
+smtpd_client_new_tls_session_rate_limit = 0
+smtpd_client_port_logging = no
+smtpd_client_recipient_rate_limit = 0
+smtpd_client_restrictions =
+smtpd_command_filter =
+smtpd_data_restrictions =
+smtpd_delay_open_until_valid_rcpt = yes
+smtpd_delay_reject = yes
+smtpd_discard_ehlo_keyword_address_maps =
+smtpd_discard_ehlo_keywords =
+smtpd_end_of_data_restrictions =
+smtpd_enforce_tls = no
+smtpd_error_sleep_time = 1s
+smtpd_etrn_restrictions =
+smtpd_expansion_filter = \t\40!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~
+smtpd_forbidden_commands = CONNECT GET POST
+smtpd_hard_error_limit = ${stress?1}${stress:20}
+smtpd_helo_required = no
+smtpd_helo_restrictions =
+smtpd_history_flush_threshold = 100
+smtpd_junk_command_limit = ${stress?1}${stress:100}
+smtpd_log_access_permit_actions =
+smtpd_milters =
+smtpd_noop_commands =
+smtpd_null_access_lookup_key = <>
+smtpd_peername_lookup = yes
+smtpd_per_record_deadline = ${stress?yes}${stress:no}
+smtpd_policy_service_max_idle = 300s
+smtpd_policy_service_max_ttl = 1000s
+smtpd_policy_service_timeout = 100s
+smtpd_proxy_ehlo = $myhostname
+smtpd_proxy_filter =
+smtpd_proxy_options =
+smtpd_proxy_timeout = 100s
+smtpd_recipient_limit = 1000
+smtpd_recipient_overshoot_limit = 1000
+smtpd_recipient_restrictions =
+smtpd_reject_footer =
+smtpd_reject_unlisted_recipient = yes
+smtpd_reject_unlisted_sender = no
+smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination
+smtpd_restriction_classes =
+smtpd_sasl_auth_enable = no
+smtpd_sasl_authenticated_header = no
+smtpd_sasl_exceptions_networks =
+smtpd_sasl_local_domain =
+smtpd_sasl_path = smtpd
+smtpd_sasl_security_options = noanonymous
+smtpd_sasl_service = smtp
+smtpd_sasl_tls_security_options = $smtpd_sasl_security_options
+smtpd_sasl_type = cyrus
+smtpd_sender_login_maps =
+smtpd_sender_restrictions =
+smtpd_service_name = smtpd
+smtpd_soft_error_limit = 10
+smtpd_starttls_timeout = ${stress?10}${stress:300}s
+smtpd_timeout = ${stress?10}${stress:300}s
+smtpd_tls_CAfile =
+smtpd_tls_CApath =
+smtpd_tls_always_issue_session_ids = yes
+smtpd_tls_ask_ccert = no
+smtpd_tls_auth_only = no
+smtpd_tls_ccert_verifydepth = 9
+smtpd_tls_cert_file =
+smtpd_tls_ciphers = export
+smtpd_tls_dcert_file =
+smtpd_tls_dh1024_param_file =
+smtpd_tls_dh512_param_file =
+smtpd_tls_dkey_file = $smtpd_tls_dcert_file
+smtpd_tls_eccert_file =
+smtpd_tls_eckey_file = $smtpd_tls_eccert_file
+smtpd_tls_eecdh_grade = strong
+smtpd_tls_exclude_ciphers =
+smtpd_tls_fingerprint_digest = md5
+smtpd_tls_key_file = $smtpd_tls_cert_file
+smtpd_tls_loglevel = 0
+smtpd_tls_mandatory_ciphers = medium
+smtpd_tls_mandatory_exclude_ciphers =
+smtpd_tls_mandatory_protocols = !SSLv2
+smtpd_tls_protocols =
+smtpd_tls_received_header = no
+smtpd_tls_req_ccert = no
+smtpd_tls_security_level =
+smtpd_tls_session_cache_database =
+smtpd_tls_session_cache_timeout = 3600s
+smtpd_tls_wrappermode = no
+smtpd_upstream_proxy_protocol =
+smtpd_upstream_proxy_timeout = 5s
+smtpd_use_tls = no
+soft_bounce = no
+stale_lock_time = 500s
+stress =
+strict_7bit_headers = no
+strict_8bitmime = no
+strict_8bitmime_body = no
+strict_mailbox_ownership = yes
+strict_mime_encoding_domain = no
+strict_rfc821_envelopes = no
+sun_mailtool_compatibility = no
+swap_bangpath = yes
+syslog_facility = mail
+syslog_name = ${multi_instance_name:postfix}${multi_instance_name?$multi_instance_name}
+tcp_windowsize = 0
+tls_append_default_CA = no
+tls_daemon_random_bytes = 32
+tls_dane_digest_agility = on
+tls_dane_digests = sha512 sha256
+tls_dane_trust_anchor_digest_enable = yes
+tls_disable_workarounds =
+tls_eecdh_strong_curve = prime256v1
+tls_eecdh_ultra_curve = secp384r1
+tls_export_cipherlist = ALL:+RC4:@STRENGTH
+tls_high_cipherlist = ALL:!EXPORT:!LOW:!MEDIUM:+RC4:@STRENGTH
+tls_legacy_public_key_fingerprints = no
+tls_low_cipherlist = ALL:!EXPORT:+RC4:@STRENGTH
+tls_medium_cipherlist = ALL:!EXPORT:!LOW:+RC4:@STRENGTH
+tls_null_cipherlist = eNULL:!aNULL
+tls_preempt_cipherlist = no
+tls_random_bytes = 32
+tls_random_exchange_name = ${data_directory}/prng_exch
+tls_random_prng_update_period = 3600s
+tls_random_reseed_period = 3600s
+tls_random_source = dev:/dev/urandom
+tls_ssl_options =
+tls_wildcard_matches_multiple_labels = yes
+tlsmgr_service_name = tlsmgr
+tlsproxy_enforce_tls = $smtpd_enforce_tls
+tlsproxy_service_name = tlsproxy
+tlsproxy_tls_CAfile = $smtpd_tls_CAfile
+tlsproxy_tls_CApath = $smtpd_tls_CApath
+tlsproxy_tls_always_issue_session_ids = $smtpd_tls_always_issue_session_ids
+tlsproxy_tls_ask_ccert = $smtpd_tls_ask_ccert
+tlsproxy_tls_ccert_verifydepth = $smtpd_tls_ccert_verifydepth
+tlsproxy_tls_cert_file = $smtpd_tls_cert_file
+tlsproxy_tls_ciphers = $smtpd_tls_ciphers
+tlsproxy_tls_dcert_file = $smtpd_tls_dcert_file
+tlsproxy_tls_dh1024_param_file = $smtpd_tls_dh1024_param_file
+tlsproxy_tls_dh512_param_file = $smtpd_tls_dh512_param_file
+tlsproxy_tls_dkey_file = $smtpd_tls_dkey_file
+tlsproxy_tls_eccert_file = $smtpd_tls_eccert_file
+tlsproxy_tls_eckey_file = $smtpd_tls_eckey_file
+tlsproxy_tls_eecdh_grade = $smtpd_tls_eecdh_grade
+tlsproxy_tls_exclude_ciphers = $smtpd_tls_exclude_ciphers
+tlsproxy_tls_fingerprint_digest = $smtpd_tls_fingerprint_digest
+tlsproxy_tls_key_file = $smtpd_tls_key_file
+tlsproxy_tls_loglevel = $smtpd_tls_loglevel
+tlsproxy_tls_mandatory_ciphers = $smtpd_tls_mandatory_ciphers
+tlsproxy_tls_mandatory_exclude_ciphers = $smtpd_tls_mandatory_exclude_ciphers
+tlsproxy_tls_mandatory_protocols = $smtpd_tls_mandatory_protocols
+tlsproxy_tls_protocols = $smtpd_tls_protocols
+tlsproxy_tls_req_ccert = $smtpd_tls_req_ccert
+tlsproxy_tls_security_level = $smtpd_tls_security_level
+tlsproxy_use_tls = $smtpd_use_tls
+tlsproxy_watchdog_timeout = 10s
+trace_service_name = trace
+transport_maps =
+transport_retry_time = 60s
+trigger_timeout = 10s
+undisclosed_recipients_header =
+unknown_address_reject_code = 450
+unknown_address_tempfail_action = $reject_tempfail_action
+unknown_client_reject_code = 450
+unknown_helo_hostname_tempfail_action = $reject_tempfail_action
+unknown_hostname_reject_code = 450
+unknown_local_recipient_reject_code = 550
+unknown_relay_recipient_reject_code = 550
+unknown_virtual_alias_reject_code = 550
+unknown_virtual_mailbox_reject_code = 550
+unverified_recipient_defer_code = 450
+unverified_recipient_reject_code = 450
+unverified_recipient_reject_reason =
+unverified_recipient_tempfail_action = $reject_tempfail_action
+unverified_sender_defer_code = 450
+unverified_sender_reject_code = 450
+unverified_sender_reject_reason =
+unverified_sender_tempfail_action = $reject_tempfail_action
+verp_delimiter_filter = -=+
+virtual_alias_domains = $virtual_alias_maps
+virtual_alias_expansion_limit = 1000
+virtual_alias_maps = $virtual_maps
+virtual_alias_recursion_limit = 1000
+virtual_delivery_slot_cost = $default_delivery_slot_cost
+virtual_delivery_slot_discount = $default_delivery_slot_discount
+virtual_delivery_slot_loan = $default_delivery_slot_loan
+virtual_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
+virtual_destination_concurrency_limit = $default_destination_concurrency_limit
+virtual_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
+virtual_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
+virtual_destination_rate_delay = $default_destination_rate_delay
+virtual_destination_recipient_limit = $default_destination_recipient_limit
+virtual_extra_recipient_limit = $default_extra_recipient_limit
+virtual_gid_maps =
+virtual_initial_destination_concurrency = $initial_destination_concurrency
+virtual_mailbox_base =
+virtual_mailbox_domains = $virtual_mailbox_maps
+virtual_mailbox_limit = 51200000
+virtual_mailbox_lock = fcntl, dotlock
+virtual_mailbox_maps =
+virtual_minimum_delivery_slots = $default_minimum_delivery_slots
+virtual_minimum_uid = 100
+virtual_recipient_limit = $default_recipient_limit
+virtual_recipient_refill_delay = $default_recipient_refill_delay
+virtual_recipient_refill_limit = $default_recipient_refill_limit
+virtual_transport = virtual
+virtual_uid_maps =
diff --git a/mail/postfix/files/postfix.init b/mail/postfix/files/postfix.init
new file mode 100644 (file)
index 0000000..1ed48dc
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2014 OpenWrt.org
+
+START=50
+STOP=50
+
+upgrade() {
+       config_directory="$IPKG_INSTROOT"/etc/postfix
+
+       if [ -f "$config_directory"/opkg_postinst ]; then
+               rm -f "$config_directory"/opkg_postinst
+
+               group_exists postfix || group_add postfix 87
+               user_exists postfix || user_add postfix 87
+               group_exists postdrop || group_add postdrop 88
+
+               echo "myhostname = $(uci get system.@system[0].hostname)" >> "$config_directory"/main.cf.default
+               echo "mydomain = $(uci get system.@system[0].hostname|sed -e "s/[^\.]*\.\(.*\)/\1/")" >> "$config_directory"/main.cf.default
+               ifconfig | grep "inet addr" | sed -e "s/.*inet addr:\([0-9.]*\).*Mask:/\1 /" | while read IP NETMASK; do eval "$(ipcalc.sh $IP $NETMASK)"; echo "$NETWORK/$PREFIX"; done | xargs echo "mynetworks =" >> "$config_directory"/main.cf.default
+
+               grep -qc "^sendmail_path" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^sendmail_path =" "$config_directory"/main.cf.default)"
+               grep -qc "^newaliases_path" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^newaliases_path =" "$config_directory"/main.cf.default)"
+               grep -qc "^mailq_path" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^mailq_path =" "$config_directory"/main.cf.default)"
+               grep -qc "^html_directory" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^html_directory =" "$config_directory"/main.cf.default)"
+               grep -qc "^manpage_directory" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^manpage_directory =" "$config_directory"/main.cf.default)"
+               grep -qc "^sample_directory" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^sample_directory =" "$config_directory"/main.cf.default)"
+               grep -qc "^readme_directory" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^readme_directory =" "$config_directory"/main.cf.default)"
+               grep -qc "^command_directory" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^command_directory =" "$config_directory"/main.cf.default)"
+               grep -qc "^daemon_directory" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^daemon_directory =" "$config_directory"/main.cf.default)"
+               grep -qc "^data_directory" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^data_directory =" "$config_directory"/main.cf.default)"
+               grep -qc "^queue_directory" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^queue_directory =" "$config_directory"/main.cf.default)"
+               grep -qc "^config_directory" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^config_directory =" "$config_directory"/main.cf.default)"
+               grep -qc "^mail_spool_directory" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^mail_spool_directory =" "$config_directory"/main.cf.default)"
+               grep -qc "^mail_owner" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^mail_owner =" "$config_directory"/main.cf.default)"
+               grep -qc "^setgid_group" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^setgid_group =" "$config_directory"/main.cf.default)"
+               grep -qc "^myhostname" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^myhostname =" "$config_directory"/main.cf.default)"
+               grep -qc "^mydomain" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^mydomain =" "$config_directory"/main.cf.default)"
+               grep -qc "^mynetworks" "$config_directory"/main.cf >/dev/null || postconf -e "$(grep "^mynetworks =" "$config_directory"/main.cf.default)"
+
+               postfix set-permissions
+               postfix post-install upgrade-source
+               postfix upgrade-configuration
+               newaliases
+       fi
+}
+
+start() {
+       upgrade
+       postfix start
+}
+
+stop() {
+       postfix stop
+}
+
+reload() {
+       upgrade
+       postfix reload
+}
diff --git a/mail/postfix/patches/100-fsstat.patch b/mail/postfix/patches/100-fsstat.patch
new file mode 100644 (file)
index 0000000..c91acca
--- /dev/null
@@ -0,0 +1,12 @@
+diff -rupN postfix-2.8.1/src/smtpd/smtpd_check.c postfix-2.8.1_patched/src/smtpd/smtpd_check.c
+--- postfix-2.8.1/src/smtpd/smtpd_check.c      2011-01-04 22:03:50.000000000 +0300
++++ postfix-2.8.1_patched/src/smtpd/smtpd_check.c      2011-03-06 19:35:39.000000000 +0300
+@@ -4894,7 +4894,7 @@ char   *smtpd_check_queue(SMTPD_STATE *s
+      */
+ #define BLOCKS(x)     ((x) / fsbuf.block_size)
+-    fsspace(".", &fsbuf);
++    fsspace("/overlay", &fsbuf);
+     if (msg_verbose)
+       msg_info("%s: blocks %lu avail %lu min_free %lu msg_size_limit %lu",
+                myname,
diff --git a/mail/postfix/patches/200-manpages.patch b/mail/postfix/patches/200-manpages.patch
new file mode 100644 (file)
index 0000000..948376c
--- /dev/null
@@ -0,0 +1,80 @@
+diff -Naur postfix-2.10.2/conf/post-install postfix-2.10.2_patched/conf/post-install
+--- postfix-2.10.2/conf/post-install   2013-06-13 18:07:46.000000000 +0400
++++ postfix-2.10.2_patched/conf/post-install   2013-11-19 21:17:49.572820573 +0400
+@@ -350,10 +350,10 @@
+ # Sanity checks
+-case $manpage_directory in
+- no) echo $0: Error: manpage_directory no longer accepts \"no\" values. 1>&2
+-     echo Try again with \"$0 manpage_directory=/pathname ...\". 1>&2; exit 1;;
+-esac
++#case $manpage_directory in
++# no) echo $0: Error: manpage_directory no longer accepts \"no\" values. 1>&2
++#     echo Try again with \"$0 manpage_directory=/pathname ...\". 1>&2; exit 1;;
++#esac
+ case $setgid_group in
+  no) echo $0: Error: setgid_group no longer accepts \"no\" values. 1>&2
+@@ -361,7 +361,7 @@
+ esac
+ for path in "$daemon_directory" "$command_directory" "$queue_directory" \
+-    "$sendmail_path" "$newaliases_path" "$mailq_path" "$manpage_directory"
++    "$sendmail_path" "$newaliases_path" "$mailq_path"
+ do
+    case "$path" in
+    /*) ;;
+@@ -369,7 +369,7 @@
+    esac
+ done
+-for path in "$html_directory" "$readme_directory"
++for path in "$html_directory" "$readme_directory" "$manpage_directory"
+ do
+    case "$path" in
+    /*) ;;
+diff -Naur postfix-2.10.2/postfix-install postfix-2.10.2_patched/postfix-install
+--- postfix-2.10.2/postfix-install     2012-05-22 23:40:29.000000000 +0400
++++ postfix-2.10.2_patched/postfix-install     2013-11-19 21:12:20.694160734 +0400
+@@ -481,13 +481,13 @@
+      exit 1;;
+ esac
+-case "$manpage_directory" in
+- no) (echo $0: Error: the manpage_directory parameter no longer accepts 
+-     echo \"no\" values.  Try again with \"manpage_directory=/path/name\" 
+-     echo on the command line or execute \"make install\" and specify
+-     echo manpage_directory interactively.) | ${FMT} 1>&2
+-     exit 1;;
+-esac
++#case "$manpage_directory" in
++# no) (echo $0: Error: the manpage_directory parameter no longer accepts 
++#     echo \"no\" values.  Try again with \"manpage_directory=/path/name\" 
++#     echo on the command line or execute \"make install\" and specify
++#     echo manpage_directory interactively.) | ${FMT} 1>&2
++#     exit 1;;
++#esac
+ for path in "$html_directory" "$readme_directory"
+ do
+@@ -500,7 +500,7 @@
+ done
+ for path in "$daemon_directory" "$data_directory" "$command_directory" "$queue_directory" \
+-    "$sendmail_path" "$newaliases_path" "$mailq_path" "$manpage_directory"
++    "$sendmail_path" "$newaliases_path" "$mailq_path"
+ do
+    case "$path" in
+    /*) ;;
+@@ -680,8 +680,8 @@
+               compare_or_replace $mode "$owner" "$group" html/$file \
+                   $HTML_DIRECTORY/$file || exit 1;;
+       '$manpage_directory')
+-          check_parent $MANPAGE_DIRECTORY/$file || exit 1
+-          compare_or_replace $mode "$owner" "$group" man/$file \
++          test "$manpage_directory" = "no" || check_parent $MANPAGE_DIRECTORY/$file || exit 1
++          test "$manpage_directory" = "no" || compare_or_replace $mode "$owner" "$group" man/$file \
+               $MANPAGE_DIRECTORY/$file || exit 1;;
+       '$readme_directory')
+           test "$readme_directory" = "no" ||
diff --git a/mail/postfix/patches/300-bdb_hash_segfault.patch b/mail/postfix/patches/300-bdb_hash_segfault.patch
new file mode 100644 (file)
index 0000000..c7f0df0
--- /dev/null
@@ -0,0 +1,14 @@
+diff -Naur postfix-2.11.3/src/util/dict_db.c postfix-2.11.3_patched/src/util/dict_db.c
+--- postfix-2.11.3/src/util/dict_db.c  2012-01-25 04:41:08.000000000 +0400
++++ postfix-2.11.3_patched/src/util/dict_db.c  2014-11-01 12:36:44.287641712 +0300
+@@ -691,8 +691,8 @@
+       msg_panic("db_create null result");
+     if ((errno = db->set_cachesize(db, 0, dict_db_cache_size, 0)) != 0)
+       msg_fatal("set DB cache size %d: %m", dict_db_cache_size);
+-    if (type == DB_HASH && db->set_h_nelem(db, DICT_DB_NELM) != 0)
+-      msg_fatal("set DB hash element count %d: %m", DICT_DB_NELM);
++//    if (type == DB_HASH && db->set_h_nelem(db, DICT_DB_NELM) != 0)
++//    msg_fatal("set DB hash element count %d: %m", DICT_DB_NELM);
+ #if DB_VERSION_MAJOR == 5 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0)
+     if ((errno = db->open(db, 0, db_path, 0, type, db_flags, 0644)) != 0)
+       FREE_RETURN(dict_surrogate(class, path, open_flags, dict_flags,
diff --git a/mail/postfix/patches/400-cdb.patch b/mail/postfix/patches/400-cdb.patch
new file mode 100644 (file)
index 0000000..cc04cd1
--- /dev/null
@@ -0,0 +1,14 @@
+diff -Naur postfix-2.11.1/src/util/sys_defs.h postfix-2.11.1.patched/src/util/sys_defs.h
+--- postfix-2.11.1/src/util/sys_defs.h 2013-09-30 00:51:55.000000000 +0400
++++ postfix-2.11.1.patched/src/util/sys_defs.h 2014-09-29 03:11:48.962277971 +0400
+@@ -767,9 +767,8 @@
+ #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK
+ #define DEF_MAILBOX_LOCK "fcntl, dotlock"     /* RedHat >= 4.x */
+ #define HAS_FSYNC
+-#define HAS_DB
+ #define NATIVE_DB_TYPE        "hash"
+-#define ALIAS_DB_MAP  DEF_DB_TYPE ":/etc/aliases"
++#define ALIAS_DB_MAP  DEF_DB_TYPE ":/etc/postfix/aliases"
+ #ifndef NO_NIS
+ #define HAS_NIS
+ #endif
diff --git a/mail/postfix/patches/500-crosscompile.patch b/mail/postfix/patches/500-crosscompile.patch
new file mode 100644 (file)
index 0000000..abd3f7d
--- /dev/null
@@ -0,0 +1,27 @@
+--- postfix-2.10.2/makedefs    2013-02-04 05:33:13.000000000 +0400
++++ postfix-2.10.2_patched/makedefs    2013-11-19 22:48:50.528560454 +0400
+@@ -107,9 +107,9 @@
+ case $# in
+  # Officially supported usage.
+- 0) SYSTEM=`(uname -s) 2>/dev/null`
+-    RELEASE=`(uname -r) 2>/dev/null`
+-    VERSION=`(uname -v) 2>/dev/null`
++ 0) SYSTEM="Linux"
++    RELEASE="3.10.18"
++    VERSION="OpenWRT"
+     case "$VERSION" in
+      dcosx*) SYSTEM=$VERSION;;
+     esac;;
+@@ -384,9 +384,9 @@
+               esac
+               for name in nsl resolv
+               do
+-                  for lib in /usr/lib64 /lib64 /usr/lib /usr/lib/* /lib /lib/*
++                  for lib in /usr/lib64 /usr/lib64/* /usr/lib /usr/lib/* /lib /lib/*
+                   do
+-                      test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
++                      test -e $PKG_BUILD_DIR/$lib/lib$name.a -o -e $PKG_BUILD_DIR/$lib/lib$name.so && {
+                           SYSLIBS="$SYSLIBS -l$name"
+                           break
+                       }
diff --git a/mail/postfix/patches/600-nopostconf.patch b/mail/postfix/patches/600-nopostconf.patch
new file mode 100644 (file)
index 0000000..78248c7
--- /dev/null
@@ -0,0 +1,40 @@
+diff -Naur postfix-2.11.1/postfix-install postfix-2.11.1.patched/postfix-install
+--- postfix-2.11.1/postfix-install     2014-10-05 20:43:58.598876904 +0400
++++ postfix-2.11.1.patched/postfix-install     2014-10-05 20:47:36.076700082 +0400
+@@ -729,21 +729,21 @@
+ # Postfix releases, and software should not suddenly be installed in
+ # the wrong place when Postfix is being upgraded.
+-bin/postconf -c $CONFIG_DIRECTORY -e \
+-    "daemon_directory = $daemon_directory" \
+-    "data_directory = $data_directory" \
+-    "command_directory = $command_directory" \
+-    "queue_directory = $queue_directory" \
+-    "mail_owner = $mail_owner" \
+-    "setgid_group = $setgid_group" \
+-    "sendmail_path = $sendmail_path" \
+-    "mailq_path = $mailq_path" \
+-    "newaliases_path = $newaliases_path" \
+-    "html_directory = $html_directory" \
+-    "manpage_directory = $manpage_directory" \
+-    "sample_directory = $sample_directory" \
+-    "readme_directory = $readme_directory" \
+-|| exit 1
++#bin/postconf -c $CONFIG_DIRECTORY -e \
++#    "daemon_directory = $daemon_directory" \
++#    "data_directory = $data_directory" \
++#    "command_directory = $command_directory" \
++#    "queue_directory = $queue_directory" \
++#    "mail_owner = $mail_owner" \
++#    "setgid_group = $setgid_group" \
++#    "sendmail_path = $sendmail_path" \
++#    "mailq_path = $mailq_path" \
++#    "newaliases_path = $newaliases_path" \
++#    "html_directory = $html_directory" \
++#    "manpage_directory = $manpage_directory" \
++#    "sample_directory = $sample_directory" \
++#    "readme_directory = $readme_directory" \
++#|| exit 1
+ # If Postfix is being installed locally from source code, do the
+ # post-install processing now.
diff --git a/mail/postfix/patches/700-defaultconfig.patch b/mail/postfix/patches/700-defaultconfig.patch
new file mode 100644 (file)
index 0000000..2f3dc3b
--- /dev/null
@@ -0,0 +1,93 @@
+diff -Naur postfix-2.11.1/conf/main.cf postfix-2.11.1.patched/conf/main.cf
+--- postfix-2.11.1/conf/main.cf        2013-12-24 18:57:25.000000000 +0400
++++ postfix-2.11.1.patched/conf/main.cf        2014-10-05 21:35:53.427534410 +0400
+@@ -21,43 +21,8 @@
+ #
+ #soft_bounce = no
+-# LOCAL PATHNAME INFORMATION
+-#
+-# The queue_directory specifies the location of the Postfix queue.
+-# This is also the root directory of Postfix daemons that run chrooted.
+-# See the files in examples/chroot-setup for setting up Postfix chroot
+-# environments on different UNIX systems.
+-#
+-queue_directory = /var/spool/postfix
+-
+-# The command_directory parameter specifies the location of all
+-# postXXX commands.
+-#
+-command_directory = /usr/sbin
+-
+-# The daemon_directory parameter specifies the location of all Postfix
+-# daemon programs (i.e. programs listed in the master.cf file). This
+-# directory must be owned by root.
+-#
+-daemon_directory = /usr/libexec/postfix
+-
+-# The data_directory parameter specifies the location of Postfix-writable
+-# data files (caches, random numbers). This directory must be owned
+-# by the mail_owner account (see below).
+-#
+-data_directory = /var/lib/postfix
+-
+ # QUEUE AND PROCESS OWNERSHIP
+ #
+-# The mail_owner parameter specifies the owner of the Postfix queue
+-# and of most Postfix daemon processes.  Specify the name of a user
+-# account THAT DOES NOT SHARE ITS USER OR GROUP ID WITH OTHER ACCOUNTS
+-# AND THAT OWNS NO OTHER FILES OR PROCESSES ON THE SYSTEM.  In
+-# particular, don't specify nobody or daemon. PLEASE USE A DEDICATED
+-# USER.
+-#
+-mail_owner = postfix
+-
+ # The default_privs parameter specifies the default rights used by
+ # the local delivery agent for delivery to external file or command.
+ # These rights are used in the absence of a recipient user context.
+@@ -613,45 +578,4 @@
+ #     -dmS $process_name gdb $daemon_directory/$process_name
+ #     $process_id & sleep 1
+-# INSTALL-TIME CONFIGURATION INFORMATION
+-#
+-# The following parameters are used when installing a new Postfix version.
+-# 
+-# sendmail_path: The full pathname of the Postfix sendmail command.
+-# This is the Sendmail-compatible mail posting interface.
+-# 
+-sendmail_path =
+-
+-# newaliases_path: The full pathname of the Postfix newaliases command.
+-# This is the Sendmail-compatible command to build alias databases.
+-#
+-newaliases_path =
+-
+-# mailq_path: The full pathname of the Postfix mailq command.  This
+-# is the Sendmail-compatible mail queue listing command.
+-# 
+-mailq_path =
+-
+-# setgid_group: The group for mail submission and queue management
+-# commands.  This must be a group name with a numerical group ID that
+-# is not shared with other accounts, not even with the Postfix account.
+-#
+-setgid_group =
+-
+-# html_directory: The location of the Postfix HTML documentation.
+-#
+-html_directory =
+-
+-# manpage_directory: The location of the Postfix on-line manual pages.
+-#
+-manpage_directory =
+-
+-# sample_directory: The location of the Postfix sample configuration files.
+-# This parameter is obsolete as of Postfix 2.1.
+-#
+-sample_directory =
+-
+-# readme_directory: The location of the Postfix README files.
+-#
+-readme_directory =
+ inet_protocols = ipv4
diff --git a/mail/postfix/patches/800-fmt.patch b/mail/postfix/patches/800-fmt.patch
new file mode 100644 (file)
index 0000000..7739e24
--- /dev/null
@@ -0,0 +1,12 @@
+diff -Naur postfix-2.11.1/conf/post-install postfix-2.11.1.patched/conf/post-install
+--- postfix-2.11.1/conf/post-install   2014-10-05 20:43:58.597876946 +0400
++++ postfix-2.11.1.patched/conf/post-install   2014-10-11 16:28:01.258874097 +0400
+@@ -310,7 +310,7 @@
+ case `uname -s` in
+ HP-UX*) FMT=cat;;
+ SunOS*) FMT=fake_fmt;;
+-     *) FMT=fmt;;
++     *) FMT="xargs echo";;
+ esac
+ # If a parameter is not set via the command line or environment,
diff --git a/mail/ssmtp/Makefile b/mail/ssmtp/Makefile
new file mode 100644 (file)
index 0000000..3d24394
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ssmtp
+PKG_VERSION:=2.64
+PKG_RELEASE:=1.1
+PKG_MAINTAINER:=Dirk Brenken <dibdot@gmail.com>
+PKG_LICENSE:=GPL-2.0+
+
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.bz2
+PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/s/ssmtp
+PKG_MD5SUM:=65b4e0df4934a6cd08c506cabcbe584f
+
+include $(INCLUDE_DIR)/package.mk
+
+TARGET_CFLAGS += $(TARGET_CPPFLAGS)
+
+define Package/ssmtp
+  SECTION:=mail
+  CATEGORY:=Mail
+  DEPENDS:=+libopenssl
+  TITLE:=A minimal and secure mail sender with ssl support
+  URL:=http://packages.debian.org/ssmtp
+endef
+
+define Package/ssmtp/description
+ A secure, effective and simple way of getting mail off a system to your
+ mail hub. It contains no suid-binaries or other dangerous things - no
+ mail spool to poke around in, and no daemons running in the background.
+ Mail is simply forwarded to the configured mailhost. Extremely easy
+ configuration.
+endef
+
+define Package/ssmtp/conffiles
+/etc/ssmtp/ssmtp.conf
+/etc/ssmtp/revaliases
+endef
+
+CONFIGURE_VARS += \
+       LIBS="$(TARGET_LDFLAGS) -lcrypto -lssl"
+
+CONFIGURE_ARGS += \
+       --enable-ssl
+
+define Package/ssmtp/install
+       $(INSTALL_DIR) $(1)/etc/ssmtp
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/ssmtp.conf $(1)/etc/ssmtp/
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/revaliases $(1)/etc/ssmtp/
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ssmtp $(1)/usr/sbin/
+endef
+
+define Package/ssmtp/postinst
+#!/bin/sh
+ln -sf ssmtp $${IPKG_INSTROOT}/usr/sbin/sendmail
+endef
+
+$(eval $(call BuildPackage,ssmtp))
diff --git a/mail/ssmtp/patches/002-fix_pointer.patch b/mail/ssmtp/patches/002-fix_pointer.patch
new file mode 100644 (file)
index 0000000..f22e3d6
--- /dev/null
@@ -0,0 +1,466 @@
+--- a/ssmtp.c
++++ b/ssmtp.c
+@@ -55,21 +55,21 @@ bool_t use_oldauth = False;                /* use old
+ #define ARPADATE_LENGTH 32            /* Current date in RFC format */
+ char arpadate[ARPADATE_LENGTH];
+-char *auth_user = (char)NULL;
+-char *auth_pass = (char)NULL;
+-char *auth_method = (char)NULL;               /* Mechanism for SMTP authentication */
+-char *mail_domain = (char)NULL;
+-char *from = (char)NULL;              /* Use this as the From: address */
++char *auth_user = NULL;
++char *auth_pass = NULL;
++char *auth_method = NULL;             /* Mechanism for SMTP authentication */
++char *mail_domain = NULL;
++char *from = NULL;            /* Use this as the From: address */
+ char *hostname;
+ char *mailhost = "mailhub";
+-char *minus_f = (char)NULL;
+-char *minus_F = (char)NULL;
++char *minus_f = NULL;
++char *minus_F = NULL;
+ char *gecos;
+-char *prog = (char)NULL;
++char *prog = NULL;
+ char *root = NULL;
+ char *tls_cert = "/etc/ssl/certs/ssmtp.pem";  /* Default Certificate */
+-char *uad = (char)NULL;
+-char *config_file = (char)NULL;               /* alternate configuration file */
++char *uad = NULL;
++char *config_file = NULL;             /* alternate configuration file */
+ headers_t headers, *ht;
+@@ -261,7 +261,7 @@ char *strip_post_ws(char *str)
+       p = (str + strlen(str));
+       while(isspace(*--p)) {
+-              *p = (char)NULL;
++              *p = '\0';
+       }
+       return(p);
+@@ -279,7 +279,7 @@ char *addr_parse(char *str)
+ #endif
+       /* Simple case with email address enclosed in <> */
+-      if((p = strdup(str)) == (char *)NULL) {
++      if((p = strdup(str)) == NULL) {
+               die("addr_parse(): strdup()");
+       }
+@@ -287,7 +287,7 @@ char *addr_parse(char *str)
+               q++;
+               if((p = strchr(q, '>'))) {
+-                      *p = (char)NULL;
++                      *p = '\0';
+               }
+ #if 0
+@@ -310,7 +310,7 @@ char *addr_parse(char *str)
+       q = strip_post_ws(p);
+       if(*q == ')') {
+               while((*--q != '('));
+-              *q = (char)NULL;
++              *q = '\0';
+       }
+       (void)strip_post_ws(p);
+@@ -349,7 +349,6 @@ standardise() -- Trim off '\n's and doub
+ */
+ bool_t standardise(char *str, bool_t *linestart)
+ {
+-      size_t sl;
+       char *p;
+       bool_t leadingdot = False;
+@@ -363,7 +362,7 @@ bool_t standardise(char *str, bool_t *li
+       *linestart = False;
+       if((p = strchr(str, '\n'))) {
+-              *p = (char)NULL;
++              *p = '\0';
+               *linestart = True;
+       }
+       return(leadingdot);
+@@ -384,7 +383,7 @@ void revaliases(struct passwd *pw)
+               while(fgets(buf, sizeof(buf), fp)) {
+                       /* Make comments invisible */
+                       if((p = strchr(buf, '#'))) {
+-                              *p = (char)NULL;
++                              *p = '\0';
+                       }
+                       /* Ignore malformed lines and comments */
+@@ -519,11 +518,11 @@ void rcpt_save(char *str)
+ #endif
+       /* Ignore missing usernames */
+-      if(*str == (char)NULL) {
++      if(*str == '\0') {
+               return;
+       }
+-      if((rt->string = strdup(str)) == (char *)NULL) {
++      if((rt->string = strdup(str)) == NULL) {
+               die("rcpt_save() -- strdup() failed");
+       }
+@@ -548,7 +547,7 @@ void rcpt_parse(char *str)
+       (void)fprintf(stderr, "*** rcpt_parse(): str = [%s]\n", str);
+ #endif
+-      if((p = strdup(str)) == (char *)NULL) {
++      if((p = strdup(str)) == NULL) {
+               die("rcpt_parse(): strdup() failed");
+       }
+       q = p;
+@@ -576,7 +575,7 @@ void rcpt_parse(char *str)
+               }
+               /* End of string? */
+-              if(*(q + 1) == (char)NULL) {
++              if(*(q + 1) == '\0') {
+                       got_addr = True;
+               }
+@@ -584,7 +583,7 @@ void rcpt_parse(char *str)
+               if((*q == ',') && (in_quotes == False)) {
+                       got_addr = True;
+-                      *q = (char)NULL;
++                      *q = '\0';
+               }
+               if(got_addr) {
+@@ -668,7 +667,7 @@ void header_save(char *str)
+       (void)fprintf(stderr, "header_save(): str = [%s]\n", str);
+ #endif
+-      if((p = strdup(str)) == (char *)NULL) {
++      if((p = strdup(str)) == NULL) {
+               die("header_save() -- strdup() failed");
+       }
+       ht->string = p;
+@@ -676,7 +675,7 @@ void header_save(char *str)
+       if(strncasecmp(ht->string, "From:", 5) == 0) {
+ #if 1
+               /* Hack check for NULL From: line */
+-              if(*(p + 6) == (char)NULL) {
++              if(*(p + 6) == '\0') {
+                       return;
+               }
+ #endif
+@@ -739,19 +738,19 @@ header_parse() -- Break headers into sep
+ void header_parse(FILE *stream)
+ {
+       size_t size = BUF_SZ, len = 0;
+-      char *p = (char *)NULL, *q;
++      char *p = NULL, *q;
+       bool_t in_header = True;
+-      char l = (char)NULL;
++      char l = '\0';
+       int c;
+       while(in_header && ((c = fgetc(stream)) != EOF)) {
+               /* Must have space for up to two more characters, since we
+                       may need to insert a '\r' */
+-              if((p == (char *)NULL) || (len >= (size - 1))) {
++              if((p == NULL) || (len >= (size - 1))) {
+                       size += BUF_SZ;
+                       p = (char *)realloc(p, (size * sizeof(char)));
+-                      if(p == (char *)NULL) {
++                      if(p == NULL) {
+                               die("header_parse() -- realloc() failed");
+                       }
+                       q = (p + len);
+@@ -776,9 +775,9 @@ void header_parse(FILE *stream)
+                                               in_header = False;
+                               default:
+-                                              *q = (char)NULL;
++                                              *q = '\0';
+                                               if((q = strrchr(p, '\n'))) {
+-                                                      *q = (char)NULL;
++                                                      *q = '\0';
+                                               }
+                                               header_save(p);
+@@ -809,9 +808,9 @@ void header_parse(FILE *stream)
+                                               in_header = False;
+                               default:
+-                                              *q = (char)NULL;
++                                              *q = '\0';
+                                               if((q = strrchr(p, '\n'))) {
+-                                                      *q = (char)NULL;
++                                                      *q = '\0';
+                                               }
+                                               header_save(p);
+@@ -876,11 +875,11 @@ bool_t read_config()
+               char *rightside;
+               /* Make comments invisible */
+               if((p = strchr(buf, '#'))) {
+-                      *p = (char)NULL;
++                      *p = '\0';
+               }
+               /* Ignore malformed lines and comments */
+-              if(strchr(buf, '=') == (char *)NULL) continue;
++              if(strchr(buf, '=') == NULL) continue;
+               /* Parse out keywords */
+               p=firsttok(&begin, "= \t\n");
+@@ -890,7 +889,7 @@ bool_t read_config()
+               }
+               if(p && q) {
+                       if(strcasecmp(p, "Root") == 0) {
+-                              if((root = strdup(q)) == (char *)NULL) {
++                              if((root = strdup(q)) == NULL) {
+                                       die("parse_config() -- strdup() failed");
+                               }
+@@ -904,7 +903,7 @@ bool_t read_config()
+                                       port = atoi(r);
+                               }
+-                              if((mailhost = strdup(q)) == (char *)NULL) {
++                              if((mailhost = strdup(q)) == NULL) {
+                                       die("parse_config() -- strdup() failed");
+                               }
+@@ -949,7 +948,7 @@ bool_t read_config()
+                                       mail_domain = strdup(q);
+                               }
+-                              if(mail_domain == (char *)NULL) {
++                              if(mail_domain == NULL) {
+                                       die("parse_config() -- strdup() failed");
+                               }
+                               rewrite_domain = True;
+@@ -1025,7 +1024,7 @@ bool_t read_config()
+                               }
+                       }
+                       else if(strcasecmp(p, "TLSCert") == 0) {
+-                              if((tls_cert = strdup(q)) == (char *)NULL) {
++                              if((tls_cert = strdup(q)) == NULL) {
+                                       die("parse_config() -- strdup() failed");
+                               }
+@@ -1036,7 +1035,7 @@ bool_t read_config()
+ #endif
+                       /* Command-line overrides these */
+                       else if(strcasecmp(p, "AuthUser") == 0 && !auth_user) {
+-                              if((auth_user = strdup(q)) == (char *)NULL) {
++                              if((auth_user = strdup(q)) == NULL) {
+                                       die("parse_config() -- strdup() failed");
+                               }
+@@ -1045,7 +1044,7 @@ bool_t read_config()
+                               }
+                       }
+                       else if(strcasecmp(p, "AuthPass") == 0 && !auth_pass) {
+-                              if((auth_pass = strdup(q)) == (char *)NULL) {
++                              if((auth_pass = strdup(q)) == NULL) {
+                                       die("parse_config() -- strdup() failed");
+                               }
+@@ -1054,7 +1053,7 @@ bool_t read_config()
+                               }
+                       }
+                       else if(strcasecmp(p, "AuthMethod") == 0 && !auth_method) {
+-                              if((auth_method = strdup(q)) == (char *)NULL) {
++                              if((auth_method = strdup(q)) == NULL) {
+                                       die("parse_config() -- strdup() failed");
+                               }
+@@ -1119,14 +1118,11 @@ int smtp_open(char *host, int port)
+       char buf[(BUF_SZ + 1)];
+       /* Init SSL stuff */
+-      SSL_CTX *ctx;
+-      SSL_METHOD *meth;
++      SSL_CTX *ctx = NULL;
+       X509 *server_cert;
+-
+       SSL_load_error_strings();
+       SSLeay_add_ssl_algorithms();
+-      meth=SSLv23_client_method();
+-      ctx = SSL_CTX_new(meth);
++      ctx = SSL_CTX_new(SSLv23_client_method());
+       if(!ctx) {
+               log_event(LOG_ERR, "No SSL support initiated\n");
+               return(-1);
+@@ -1310,7 +1306,7 @@ char *fd_gets(char *buf, int size, int f
+                       buf[i++] = c;
+               }
+       }
+-      buf[i] = (char)NULL;
++      buf[i] = '\0';
+       return(buf);
+ }
+@@ -1434,14 +1430,14 @@ int ssmtp(char *argv[])
+       }
+       if((p = strtok(pw->pw_gecos, ";,"))) {
+-              if((gecos = strdup(p)) == (char *)NULL) {
++              if((gecos = strdup(p)) == NULL) {
+                       die("ssmtp() -- strdup() failed");
+               }
+       }
+       revaliases(pw);
+       /* revaliases() may have defined this */
+-      if(uad == (char *)NULL) {
++      if(uad == NULL) {
+               uad = append_domain(pw->pw_name);
+       }
+@@ -1489,7 +1485,7 @@ int ssmtp(char *argv[])
+       /* Try to log in if username was supplied */
+       if(auth_user) {
+ #ifdef MD5AUTH
+-              if(auth_pass == (char *)NULL) {
++              if(auth_pass == NULL) {
+                       auth_pass = strdup("");
+               }
+@@ -1508,7 +1504,7 @@ int ssmtp(char *argv[])
+               else {
+ #endif
+               memset(buf, 0, bufsize);
+-              to64frombits(buf, auth_user, strlen(auth_user));
++              to64frombits(buf, (unsigned char *)auth_user, strlen(auth_user));
+               if (use_oldauth) {
+                       outbytes += smtp_write(sock, "AUTH LOGIN %s", buf);
+               }
+@@ -1520,7 +1516,7 @@ int ssmtp(char *argv[])
+                       }
+                       /* we assume server asked us for Username */
+                       memset(buf, 0, bufsize);
+-                      to64frombits(buf, auth_user, strlen(auth_user));
++                      to64frombits(buf, (unsigned char *)auth_user, strlen(auth_user));
+                       outbytes += smtp_write(sock, buf);
+               }
+@@ -1530,7 +1526,7 @@ int ssmtp(char *argv[])
+               }
+               memset(buf, 0, bufsize);
+-              to64frombits(buf, auth_pass, strlen(auth_pass));
++              to64frombits(buf, (unsigned char *)auth_pass, strlen(auth_pass));
+ #ifdef MD5AUTH
+               }
+ #endif
+@@ -1737,7 +1733,7 @@ char **parse_options(int argc, char *arg
+               j = 0;
+               add = 1;
+-              while(argv[i][++j] != (char)NULL) {
++              while(argv[i][++j] != '\0') {
+                       switch(argv[i][j]) {
+ #ifdef INET6
+                       case '6':
+@@ -1755,14 +1751,14 @@ char **parse_options(int argc, char *arg
+                                       if((!argv[i][(j + 1)])
+                                               && argv[(i + 1)]) {
+                                               auth_user = strdup(argv[i+1]);
+-                                              if(auth_user == (char *)NULL) {
++                                              if(auth_user == NULL) {
+                                                       die("parse_options() -- strdup() failed");
+                                               }
+                                               add++;
+                                       }
+                                       else {
+                                               auth_user = strdup(argv[i]+j+1);
+-                                              if(auth_user == (char *)NULL) {
++                                              if(auth_user == NULL) {
+                                                       die("parse_options() -- strdup() failed");
+                                               }
+                                       }
+@@ -1772,14 +1768,14 @@ char **parse_options(int argc, char *arg
+                                       if((!argv[i][(j + 1)])
+                                               && argv[(i + 1)]) {
+                                               auth_pass = strdup(argv[i+1]);
+-                                              if(auth_pass == (char *)NULL) {
++                                              if(auth_pass == NULL) {
+                                                       die("parse_options() -- strdup() failed");
+                                               }
+                                               add++;
+                                       }
+                                       else {
+                                               auth_pass = strdup(argv[i]+j+1);
+-                                              if(auth_pass == (char *)NULL) {
++                                              if(auth_pass == NULL) {
+                                                       die("parse_options() -- strdup() failed");
+                                               }
+                                       }
+@@ -1870,14 +1866,14 @@ char **parse_options(int argc, char *arg
+                       case 'F':
+                               if((!argv[i][(j + 1)]) && argv[(i + 1)]) {
+                                       minus_F = strdup(argv[(i + 1)]);
+-                                      if(minus_F == (char *)NULL) {
++                                      if(minus_F == NULL) {
+                                               die("parse_options() -- strdup() failed");
+                                       }
+                                       add++;
+                               }
+                               else {
+                                       minus_F = strdup(argv[i]+j+1);
+-                                      if(minus_F == (char *)NULL) {
++                                      if(minus_F == NULL) {
+                                               die("parse_options() -- strdup() failed");
+                                       }
+                               }
+@@ -1889,14 +1885,14 @@ char **parse_options(int argc, char *arg
+                       case 'r':
+                               if((!argv[i][(j + 1)]) && argv[(i + 1)]) {
+                                       minus_f = strdup(argv[(i + 1)]);
+-                                      if(minus_f == (char *)NULL) {
++                                      if(minus_f == NULL) {
+                                               die("parse_options() -- strdup() failed");
+                                       }
+                                       add++;
+                               }
+                               else {
+                                       minus_f = strdup(argv[i]+j+1);
+-                                      if(minus_f == (char *)NULL) {
++                                      if(minus_f == NULL) {
+                                               die("parse_options() -- strdup() failed");
+                                       }
+                               }
+--- a/base64.c
++++ b/base64.c
+@@ -31,7 +31,7 @@ static const char base64val[] = {
+ };
+ #define DECODE64(c)  (isascii(c) ? base64val[c] : BAD)
+-void to64frombits(unsigned char *out, const unsigned char *in, int inlen)
++void to64frombits(char *out, const unsigned char *in, int inlen)
+ /* raw bytes in quasi-big-endian order to base 64 string (NUL-terminated) */
+ {
+     for (; inlen >= 3; inlen -= 3)
+@@ -57,7 +57,7 @@ void to64frombits(unsigned char *out, co
+     *out = '\0';
+ }
+-int from64tobits(char *out, const char *in)
++int from64tobits(unsigned char *out, const char *in)
+ /* base 64 to raw bytes in quasi-big-endian order, returning count of bytes */
+ {
+     int len = 0;
+--- a/ssmtp.h
++++ b/ssmtp.h
+@@ -41,5 +41,5 @@ typedef struct string_list rcpt_t;
+ void get_arpadate(char *);
+ /* base64.c */
+-void to64frombits(unsigned char *, const unsigned char *, int);
+-int from64tobits(char *, const char *);
++void to64frombits(char *, const unsigned char *, int);
++int from64tobits(unsigned char *, const char *);
index 2470ad25668b36cda6251b73ae0dbd964f1e7d7c..4316aae49352c2ea2a83bba7b144e01a1e5aaaea 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ffmpeg
-PKG_VERSION:=2.3.4
+PKG_VERSION:=2.4.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://ffmpeg.org/releases/
-PKG_MD5SUM:=d6a0c7f0827a2446ca2bed11ac9bf608
+PKG_MD5SUM:=9e6163b09b7b9331b834d80874c2c0ff
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=LGPL-2.1+ GPL-2+ LGPL-3
@@ -289,7 +289,7 @@ endef
 define Package/libffmpeg-custom
 $(call Package/libffmpeg/Default)
  TITLE+= (custom)
- DEPENDS+= @DEVEL +libopus +libspeex
+ DEPENDS+= @DEVEL @!ALL +libopus +libspeex
  VARIANT:=custom
  MENU:=1
 endef
index edb46be6806c40dc74fc569bd0f970071dcb4caa..5a5f3b52cb0080b1c1a04f30f473e012079f7833 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=http://www.firestorm.cx/fswebcam/files \
 PKG_MD5SUM:=1bfdb21904e816f100370ec8f4df986b
 
 PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=LICENCE
+PKG_LICENSE_FILES:=LICENCE
 PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
 
 PKG_INSTALL:=1
index a4721ef9c47807ad73527c1dfdf1c892d3259f32..81ce237b34ac3f8176e669b0aa42f135eec52382 100644 (file)
@@ -8,17 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gst1-libav
-PKG_VERSION:=1.2.3
+PKG_VERSION:=1.4.4
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
 
 PKG_SOURCE:=gst-libav-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-libav
-PKG_MD5SUM:=58c7998a054d8d8ca041fa35738f72b6
+PKG_MD5SUM:=64a3e2cda2687132cadca4efdc63f3b4
 
 PKG_LICENSE:=GPL-2.0 LGPL-2.0
-PKG_LICENSE_FILE:=COPYING COPYING.LIB
+PKG_LICENSE_FILES:=COPYING COPYING.LIB
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/gst-libav-$(PKG_VERSION)
 
@@ -109,7 +109,7 @@ PKG_CONFIG_DEPENDS:= \
        $(patsubst %,CONFIG_GST1_LIBAV_PARSER_%,$(LIBAV_PARSERS)) \
        $(patsubst %,CONFIG_GST1_LIBAV_PROTOCOL_%,$(LIBAV_PROTOCOLS))
 
-PKG_BUILD_DEPENDS:= libstreamer1 gstreamer1-plugins-base
+PKG_BUILD_DEPENDS:= libgstreamer1 gstreamer1-plugins-base
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
@@ -148,6 +148,7 @@ CONFIGURE_ARGS += \
        --without-system-libav \
        --with-libav-extra-configure="--target-os=linux \
        --disable-bsfs \
+       --disable-programs \
        --disable-devices \
        --disable-encoders \
        $(LIBAV_CONFIGURE_ENCODERS) \
@@ -161,6 +162,26 @@ CONFIGURE_ARGS += \
        $(LIBAV_CONFIGURE_PARSERS) \
        --disable-protocols \
        $(LIBAV_CONFIGURE_PROTOCOLS) \
+       --disable-asm \
+       --disable-altivec \
+       --disable-amd3dnow \
+       --disable-amd3dnowext \
+       --disable-mmx \
+       --disable-mmxext \
+       --disable-sse \
+       --disable-sse2 \
+       --disable-sse3 \
+       --disable-ssse3 \
+       --disable-sse4 \
+       --disable-sse42 \
+       --disable-avx \
+       --disable-xop \
+       --disable-fma3 \
+       --disable-fma4 \
+       --disable-avx2 \
+       --disable-vfp \
+       --disable-neon \
+       --disable-inline-asm \
        --disable-yasm"
 
 # XXX: trick to force use of embedded Libav headers
index c3b88aa720c97d9bb6a5afd46f99311080731650..105f127e953453441d81b2c509ac23e29c39a409 100644 (file)
@@ -8,18 +8,18 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gst1-plugins-bad
-PKG_VERSION:=1.2.3
-PKG_RELEASE:=3
+PKG_VERSION:=1.4.4
+PKG_RELEASE:=4
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
 
 PKG_LICENSE:=LGPLv2 GPLv2
-PKG_LICENSE_FILE:=COPYING.LIB COPYING
+PKG_LICENSE_FILES:=COPYING.LIB COPYING
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-bad-$(PKG_VERSION)
 PKG_SOURCE:=gst-plugins-bad-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-bad/
-PKG_MD5SUM:=cfd6f303c8df2740b27cc63b945decef
+PKG_MD5SUM:=972c6e22dd2e44fcf0b04b9d810a56be
 
 PKG_BUILD_DEPENDS:= libgstreamer1 gstreamer1-plugins-base liboil
 
@@ -161,6 +161,7 @@ CONFIGURE_ARGS += \
        --disable-schro \
        --disable-zbar \
        --disable-vp8 \
+       --disable-srtp \
        \
        --without-libiconv-prefix \
        --without-libintl-prefix \
@@ -277,6 +278,7 @@ $(eval $(call GstBuildPlugin,segmentclip,segmentclip support,audio,,))
 $(eval $(call GstBuildPlugin,siren,siren support,audio rtp,,))
 $(eval $(call GstBuildPlugin,speed,speed support,audio,,))
 $(eval $(call GstBuildPlugin,subenc,subenc support,controller,,))
+#$(eval $(call GstBuildPlugin,srtp,srtp support,rtp,,+libsrtp))
 
 $(eval $(call BuildPackage,gstreamer1-plugins-bad))
 $(eval $(call BuildPackage,gst1-plugins-bad))
index 0ca6a8bf81019281f27c5548dad7c698d607bd46..9998514e01bede541ba2f922d78bbace2b8089fe 100644 (file)
@@ -8,18 +8,18 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gst1-plugins-base
-PKG_VERSION:=1.2.3
-PKG_RELEASE:=2
+PKG_VERSION:=1.4.4
+PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
 
 PKG_LICENSE:=LGPLv2 GPLv2
-PKG_LICENSE_FILE:=COPYING.LIB COPYING
+PKG_LICENSE_FILES:=COPYING.LIB COPYING
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-base-$(PKG_VERSION)
 PKG_SOURCE:=gst-plugins-base-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-base/
-PKG_MD5SUM:=17aeabfbcd232526f50c9bee375f1b97
+PKG_MD5SUM:=0c42eca8f9e4efd56d2ce8e9249ce4a1
 
 PKG_BUILD_DEPENDS:= libgstreamer1 liboil
 PKG_CONFIG_DEPENDS:= \
@@ -157,7 +157,6 @@ EXTRA_LDFLAGS+= \
        -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
        $(if $(ICONV_FULL),-liconv) \
 
-
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include/gstreamer-$(GST_VERSION)
        ( cd $(PKG_INSTALL_DIR); $(CP) \
@@ -183,9 +182,12 @@ endef
 
 
 define Package/gst1-plugins-base/install
-       /bin/true
+  true
 endef
 
+define Package/gstreamer1-plugins-base/install
+  true
+endef
 
 # 1: short name
 # 2: description
index 082e736efb06b24dfbec80bac30001008e4b0883..f368eeafddd30dd972f95020de089f556d58efee 100644 (file)
@@ -8,18 +8,18 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gst1-plugins-good
-PKG_VERSION:=1.2.3
-PKG_RELEASE:=2
+PKG_VERSION:=1.4.4
+PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
 
 PKG_LICENSE:=LGPLv2
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-good-$(PKG_VERSION)
 PKG_SOURCE:=gst-plugins-good-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-good/
-PKG_MD5SUM:=1a1f96bc27ad446e559474299160a9a8
+PKG_MD5SUM:=673cf9276952bd3937dafd817c9ead2b
 
 PKG_BUILD_DEPENDS:= libgstreamer1 gstreamer1-plugins-base liboil
 
index da574e0b464d474613bb612a788692ed40009cde..b8ed67080fe6eff3fb5d959ae4ec4abd7e799177 100644 (file)
@@ -8,18 +8,18 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gst1-plugins-ugly
-PKG_VERSION:=1.2.3
-PKG_RELEASE:=2
+PKG_VERSION:=1.4.4
+PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
 
 PKG_LICENSE:=LGPLv2
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-ugly-$(PKG_VERSION)
 PKG_SOURCE:=gst-plugins-ugly-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-ugly/
-PKG_MD5SUM:=7ae60e2f759f58f32af5fcdc3c9193c4
+PKG_MD5SUM:=abd832c5cab1a37fb1d9d15fb08e6e59
 
 PKG_BUILD_DEPENDS:= libgstreamer1 gstreamer1-plugins-base liboil
 PKG_CONFIG_DEPENDS:= \
index 7beec17480eb613854d1f7b1a971476602d346cf..a73cc1d85f944fff0c817647c3b41df293088454 100644 (file)
@@ -8,18 +8,18 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gstreamer1
-PKG_VERSION:=1.2.3
+PKG_VERSION:=1.4.4
 PKG_RELEASE:=2
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
 
 PKG_LICENSE:=LGPLv2
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/gstreamer-$(PKG_VERSION)
 PKG_SOURCE:=gstreamer-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gstreamer/
-PKG_MD5SUM:=8155b9c7574ccaa361cc504e8e0e72dc
+PKG_MD5SUM:=98f4a6d45a28dd195144baef0244ba38
 
 PKG_FIXUP:=autoreconf
 PKG_REMOVE_FILES:=autogen.sh aclocal.m4
@@ -161,6 +161,7 @@ define Package/gstreamer1/install
 endef
 
 define Package/gstreamer1-libs/install
+  true
 endef
 
 define Package/gstreamer1-utils/install
@@ -185,6 +186,8 @@ define Package/libgstreamer1/install
                ./usr/lib/gstreamer-$(GST_VERSION)/libgst*.so \
                $(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
        )
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gstreamer-$(GST_VERSION)/gst-plugin-scanner \
+                      $(1)/usr/lib/gstreamer-$(GST_VERSION)
 endef
 
 
diff --git a/multimedia/gstreamer1/patches/010-gstplugin_use_lazy_symbol_binding.patch b/multimedia/gstreamer1/patches/010-gstplugin_use_lazy_symbol_binding.patch
new file mode 100644 (file)
index 0000000..603e57c
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/gst/gstplugin.c
++++ b/gst/gstplugin.c
+@@ -723,15 +723,8 @@ gst_plugin_load_file (const gchar * file
+     goto return_error;
+   }
+-  flags = G_MODULE_BIND_LOCAL;
+-  /* libgstpython.so is the gst-python plugin loader. It needs to be loaded with
+-   * G_MODULE_BIND_LAZY.
+-   *
+-   * Ideally there should be a generic way for plugins to specify that they
+-   * need to be loaded with _LAZY.
+-   * */
+-  if (strstr (filename, "libgstpython"))
+-    flags |= G_MODULE_BIND_LAZY;
++  // No need to resolve all bindings until referenced
++  flags = G_MODULE_BIND_LOCAL | G_MODULE_BIND_LAZY;
+   module = g_module_open (filename, flags);
+   if (module == NULL) {
index f883eeefb5ae2ba2c47088026014e9014a668fa5..7df8b74fb8ffe409a4f1d7628814aa6b98278cdf 100644 (file)
@@ -10,6 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=icecast
 PKG_VERSION:=2.4.0
 PKG_RELEASE:=1
+PKG_LICENSE:=GPL-2.0
 PKG_MAINTAINER:=André Gaul <gaul@web-yard.de>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
index 2b30ba83965696970abe79c44783383eef68c025..093c2efc6753991bcccecfa7aa00f8def1d56822 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=minidlna
-PKG_VERSION:=1.1.3
+PKG_VERSION:=1.1.4
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/minidlna
-PKG_MD5SUM:=879027192c89e5376cdd2ae2d1aa33b4
+PKG_MD5SUM:=67c9e91285bc3801fd91a5d26ea775d7
 PKG_LICENSE:=GPL-2.0 BSD-3-Clause
 PKG_LICENSE_FILES:=COPYING LICENCE.miniupnpd
 
@@ -75,7 +75,7 @@ CONFIGURE_ARGS +=\
 
 define Package/minidlna/install
        $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/minidlna $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/minidlnad $(1)/usr/bin/minidlna
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/minidlna.init $(1)/etc/init.d/minidlna
        $(INSTALL_DIR) $(1)/etc/config
diff --git a/multimedia/minidlna/patches/020-makefileam-tweaks.patch b/multimedia/minidlna/patches/020-makefileam-tweaks.patch
deleted file mode 100644 (file)
index 93d3f3c..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -19,9 +19,9 @@
- SUBDIRS=po
--sbin_PROGRAMS = minidlnad
-+sbin_PROGRAMS = minidlna
- check_PROGRAMS = testupnpdescgen
--minidlnad_SOURCES = minidlna.c upnphttp.c upnpdescgen.c upnpsoap.c \
-+minidlna_SOURCES = minidlna.c upnphttp.c upnpdescgen.c upnpsoap.c \
-                       upnpreplyparse.c minixml.c clients.c \
-                       getifaddr.c process.c upnpglobalvars.c \
-                       options.c minissdp.c uuid.c upnpevents.c \
-@@ -38,7 +38,7 @@
- flacoggflag = -logg
- #endif
--minidlnad_LDADD = \
-+minidlna_LDADD = \
-       @LIBJPEG_LIBS@ \
-       @LIBID3TAG_LIBS@ \
-       @LIBSQLITE3_LIBS@ \
-@@ -49,7 +49,7 @@
-       @LIBICONV@ \
-       -lFLAC  $(flacoggflag) $(vorbisflag)
--minidlnad_LDFLAGS = @STATIC_LDFLAGS@
-+minidlna_LDFLAGS = @STATIC_LDFLAGS@
- testupnpdescgen_SOURCES = testupnpdescgen.c upnpdescgen.c
- testupnpdescgen_LDADD = \
diff --git a/multimedia/minidlna/patches/030-upnphttp-fixPhilips.patch b/multimedia/minidlna/patches/030-upnphttp-fixPhilips.patch
deleted file mode 100644 (file)
index 8829bdc..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/upnphttp.c
-+++ b/upnphttp.c
-@@ -1259,7 +1259,7 @@
-       int try_sendfile = 1;
- #endif
--      while( offset < end_offset )
-+      while( offset <= end_offset )
-       {
- #if HAVE_SENDFILE
-               if( try_sendfile )
-
index d8df190b5301abcbc9f35fcf978c17c6532caf99..24e569df8e101a711227bcf4c6d0a970c1bcff29 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=mjpg-streamer
 PKG_REV:=182
 PKG_VERSION:=r$(PKG_REV)
-PKG_RELEASE:=2
+PKG_RELEASE:=4
 PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).1.tar.bz2
@@ -20,18 +20,17 @@ PKG_SOURCE_VERSION:=$(PKG_REV)
 PKG_SOURCE_PROTO:=svn
 
 PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
 
 include $(INCLUDE_DIR)/package.mk
 
+PKG_BUILD_DEPENDS:=MJPG_STREAMER_V4L2:libv4l
+
 define Package/mjpg-streamer
   SECTION:=multimedia
   CATEGORY:=Multimedia
   TITLE:=MJPG-streamer
-  DEPENDS:=+libpthread +libjpeg 
-  ifeq ($(CONFIG_MJPG_STREAMER_V4L2),y)
-       DEPENDS+=+libv4l
-  endif
+  DEPENDS:=+libpthread +libjpeg +MJPG_STREAMER_V4L2:libv4l
   URL:=http://mjpg-streamer.wiki.sourceforge.net/
   MENU:=1
 endef
index 36bfdbb60d99acf30bb05e42e60043f2c9d6da6e..7d6bfa454d965714324d4dadde091ba6935a90a5 100644 (file)
@@ -1,3 +1,4 @@
+
 config mjpg-streamer 'core'
        option enabled '0'
        option input 'uvc'
@@ -5,6 +6,7 @@ config mjpg-streamer 'core'
        option device '/dev/video0'
        option resolution '640x480'
        option fps '5'
+       option led 'auto'
        option www '/www/webcam'
        option port '8080'
        option username 'openwrt'
index eebd4f84a7bf90d82ea678f817186e7aaba612a3..1ce5ce1dbd1be4ab6ae590a1cffde8beaf896179 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh /etc/rc.common
-# Copyright (C) 2009-2013 OpenWrt.org
+# Copyright (C) 2009-2014 OpenWrt.org
 
 START=90
 STOP=10
@@ -45,6 +45,9 @@ start_instance() {
 
                config_get resolution "$s" 'resolution'
                [ -n "$resolution" ] && input_arg="${input_arg} --resolution $resolution"
+
+               config_get led "$s" 'led'
+               [ -n "$led" ] && input_arg="${input_arg} --led $led"
        fi
 
        if [ -z "$input_arg" ]; then
index 6f49a5df44dc221b121ffbfc7d394e8cc0700f80..412b5f90bc5b5a72e94360d7a61f63f3b501909d 100644 (file)
@@ -8,16 +8,21 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=motion
-PKG_VERSION:=20110826-051001
-PKG_RELEASE:=2
+PKG_VERSION=3.4.0-20141018-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=1
+
 PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=COPYING
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.lavrsen.dk/sources/motion-daily \
-               @SF/motion
-PKG_MD5SUM:=e703fce57ae2215cb05f25e3027f5818
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/Mr-Dave/motion.git
+PKG_SOURCE_VERSION:=9479d910f2149b5558788bb86f97f26522794212
 
-PKG_INSTALL:=1
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_PARALLEL:=1
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -30,7 +35,7 @@ define Package/motion
 endef
 
 define Package/motion/conffiles
-/etc/motion.conf
+  /etc/motion.conf
 endef
 
 CONFIGURE_ARGS+= \
@@ -44,9 +49,9 @@ CONFIGURE_ARGS+= \
 
 define Package/motion/install
        $(INSTALL_DIR) $(1)/etc
-       $(CP) $(PKG_INSTALL_DIR)/etc/motion-dist.conf $(1)/etc/motion.conf
+       $(CP) $(PKG_BUILD_DIR)/motion-dist.conf $(1)/etc/motion.conf
        $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/motion $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/motion $(1)/usr/bin/
 
 endef
 
diff --git a/multimedia/motion/patches/002-honor_cppflags.patch b/multimedia/motion/patches/002-honor_cppflags.patch
deleted file mode 100644 (file)
index ac10f1e..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -31,6 +31,7 @@ examplesdir = $(datadir)/@PACKAGE_NAME@-
- # install.                                                                     #
- ################################################################################
- CFLAGS       = @CFLAGS@ -Wall -DVERSION=\"@PACKAGE_VERSION@\" -Dsysconfdir=\"$(sysconfdir)\" 
-+CPPFLAGS     = @CPPFLAGS@
- LDFLAGS      = @LDFLAGS@
- LIBS         = @LIBS@ 
- VIDEO_OBJ    = @VIDEO@
-@@ -118,7 +119,7 @@ endif
- ################################################################################
- $(DEPEND_FILE): *.h $(SRC)
-       @echo "Generating dependencies, please wait..."
--      @$(CC) $(CFLAGS) -M $(SRC) > .tmp
-+      @$(CC) $(CFLAGS) $(CPPFLAGS) -M $(SRC) > .tmp
-       @mv -f .tmp $(DEPEND_FILE)
-       @echo
diff --git a/multimedia/shairplay/Makefile b/multimedia/shairplay/Makefile
new file mode 100644 (file)
index 0000000..1c1b0af
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=shairplay
+PKG_VERSION:=2014-10-27
+PKG_RELEASE:=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://github.com/juhovh/shairplay.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=64d59e3087f829006d091fa0d114efb50972a2bf
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+
+PKG_FIXUP:=libtool
+
+define Package/shairplay
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  DEPENDS:=+avahi-daemon +libao +libavahi-compat-libdnssd +libltdl +libpthread
+  TITLE:=Shairplay
+endef
+
+define Build/Configure
+       (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH); \
+       ./autogen.sh;)
+       $(call Build/Configure/Default)
+endef
+
+define Package/shairplay/description
+  Free portable AirPlay server implementation similar to ShairPort.
+endef
+
+define Package/shairplay/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/shairplay $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/share/shairplay
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/airport.key $(1)/usr/share/shairplay/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) files/shairplay.init $(1)/etc/init.d/shairplay
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) files/shairplay.config $(1)/etc/config/shairplay
+endef
+
+$(eval $(call BuildPackage,shairplay))
diff --git a/multimedia/shairplay/files/shairplay.config b/multimedia/shairplay/files/shairplay.config
new file mode 100644 (file)
index 0000000..6e1f939
--- /dev/null
@@ -0,0 +1,10 @@
+config shairplay main
+       option disabled '1'
+       option respawn '1'
+       option apname 'AirPlay'
+       option port '5000'
+       option password ''
+       option hwaddr ''
+       option ao_driver 'oss'
+       option ao_devicename ''
+       option ao_deviceid ''
diff --git a/multimedia/shairplay/files/shairplay.init b/multimedia/shairplay/files/shairplay.init
new file mode 100644 (file)
index 0000000..093a168
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2014 OpenWrt.org
+
+START=90
+USE_PROCD=1
+
+append_arg() {
+       local cfg="$1"
+       local var="$2"
+       local opt="$3"
+       local def="$4"
+       local val
+
+       config_get val "$cfg" "$var"
+       [ -n "$val" -o -n "$def" ] && procd_append_param command $opt="${val:-$def}"
+}
+
+start_instance() {
+       local cfg="$1"
+       local aux
+
+       config_get_bool aux "$cfg" 'disabled' '0'
+       [ "$aux" = 1 ] && return 1
+
+       procd_open_instance
+
+       procd_set_param command /usr/bin/shairplay
+
+       append_arg "$cfg" apname "--apname" "AirPlay"
+       append_arg "$cfg" port "--server_port"
+       append_arg "$cfg" password "--password"
+       append_arg "$cfg" hwaddr "--hwaddr"
+
+       append_arg "$cfg" ao_driver "--ao_driver"
+       append_arg "$cfg" ao_devicename "--ao_devicename"
+       append_arg "$cfg" ao_deviceid "--ao_deviceid"
+
+       config_get_bool aux "$cfg" 'respawn' '0'
+       [ "$aux" = 1 ] && procd_set_param respawn
+
+       procd_close_instance
+}
+
+service_triggers() { 
+       procd_add_reload_trigger "shairplay" 
+}
+
+start_service() {
+       config_load shairplay
+       config_foreach start_instance shairplay
+}
diff --git a/multimedia/shairplay/patches/001-key_file_dir.patch b/multimedia/shairplay/patches/001-key_file_dir.patch
new file mode 100644 (file)
index 0000000..3c5e3a5
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/shairplay.c
++++ b/src/shairplay.c
+@@ -346,7 +346,7 @@ main(int argc, char *argv[])
+       raop_cbs.audio_destroy = audio_destroy;
+       raop_cbs.audio_set_volume = audio_set_volume;
+-      raop = raop_init_from_keyfile(10, &raop_cbs, "airport.key", NULL);
++      raop = raop_init_from_keyfile(10, &raop_cbs, "/usr/share/shairplay/airport.key", NULL);
+       if (raop == NULL) {
+               fprintf(stderr, "Could not initialize the RAOP service\n");
+               fprintf(stderr, "Please make sure the airport.key file is in the current directory.\n");
diff --git a/multimedia/shairplay/patches/002-libavahi-compat-dnssd.patch b/multimedia/shairplay/patches/002-libavahi-compat-dnssd.patch
new file mode 100644 (file)
index 0000000..ff70e24
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/lib/dnssd.c
++++ b/src/lib/dnssd.c
+@@ -167,7 +167,7 @@ dnssd_init(int *error)
+               return NULL;
+       }
+ #elif USE_LIBDL
+-      dnssd->module = dlopen("libdns_sd.so", RTLD_LAZY);
++      dnssd->module = dlopen("libdns_sd.so.1", RTLD_LAZY);
+       if (!dnssd->module) {
+               if (error) *error = DNSSD_ERROR_LIBNOTFOUND;
+               free(dnssd);
diff --git a/multimedia/shairplay/patches/003-fix_big-endian.patch b/multimedia/shairplay/patches/003-fix_big-endian.patch
new file mode 100644 (file)
index 0000000..7764aab
--- /dev/null
@@ -0,0 +1,24 @@
+--- a/src/lib/alac/alac.c
++++ b/src/lib/alac/alac.c
+@@ -29,11 +29,7 @@
+  *
+  */
+-#ifdef __BIG_ENDIAN__
+-static const int host_bigendian = 1;
+-#else
+-static const int host_bigendian = 0;
+-#endif
++static int host_bigendian = 0;
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -1181,6 +1177,8 @@ alac_file *create_alac(int samplesize, i
+ {
+     alac_file *newfile = malloc(sizeof(alac_file));
++    host_bigendian = (htonl(42) == 42);
++
+     newfile->samplesize = samplesize;
+     newfile->numchannels = numchannels;
+     newfile->bytespersample = (samplesize / 8) * numchannels;
index 35678c7cc9f32c184d66a923ca5bfb5498098080..0b7170766fdf8e542937d6d1fc14ca17ec15c1d7 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=shairport
-PKG_VERSION:=2014-08-22
+PKG_VERSION:=2014-10-28
 PKG_RELEASE:=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
index 851c927e49a2489db8e20be4967231c6678138d8..9b2165a9a75162e081da12ac427a222280ab6956 100644 (file)
@@ -1,12 +1,16 @@
 config shairport main
+       option disabled '1'
+       option respawn '1'
        option bname 'AirPort'
        option password ''
        option port '5002'
-       option buffer '256'
-       option log ''
+       option buffer ''
+       option log_file ''
+       option err_file ''
+       option meta_dir ''
        option cmd_start ''
        option cmd_stop ''
-       option cmd_wait ''
+       option cmd_wait '0'
        option audio_output 'alsa'
        option mdns 'avahi'
 
@@ -16,3 +20,17 @@ config shairport main
        option mixer_type ''
        option mixer_control ''
        option mixer_index ''
+
+       # options for ao output
+       option ao_driver ''
+       option ao_name ''
+       option ao_id ''
+       option ao_options ''
+
+       # options for pipe output
+       option output_fifo ''
+
+       # options for pulse output
+       option pulse_server ''
+       option pulse_sink ''
+       option pulse_appname ''
index 0e649d68422dbccfad225abe1cef15b183bd5315..341ff6fee9ce198b0182d2db96df9df3676597cd 100644 (file)
@@ -28,16 +28,21 @@ append_bool() {
 
 start_instance() {
        local cfg="$1"
-       local ao dev
+       local ao dev aux
+
+       config_get_bool aux "$cfg" 'disabled' '0'
+       [ "$aux" = 1 ] && return 1
 
        procd_open_instance
 
        procd_set_param command /usr/bin/shairport
 
        append_arg "$cfg" bname "-a" "AirPort"
-       append_arg "$cfg" log "-l"
-       append_arg "$cfg" buffer "-b" "256"
-       append_arg "$cfg" port "-p" "5002"
+       append_arg "$cfg" log_file "-l"
+       append_arg "$cfg" err_file "-e"
+       append_arg "$cfg" meta_dir "-M"
+       append_arg "$cfg" buffer "-b"
+       append_arg "$cfg" port "-p"
        append_arg "$cfg" password "-k"
        append_arg "$cfg" mdns "-m"
 
@@ -58,8 +63,34 @@ start_instance() {
                        append_arg "$cfg" mixer_control "-c"
                        append_arg "$cfg" mixer_index "-i"
                fi
+       elif [ "$ao" = "ao" ]; then
+               config_get dev "$cfg" ao_driver ""
+               if [ -n "$dev" ]; then
+                       procd_append_param command "--"
+                       append_arg "$cfg" ao_driver "-d"
+                       append_arg "$cfg" ao_id "-i"
+                       append_arg "$cfg" ao_name "-n"
+                       append_arg "$cfg" ao_options "-o"
+               fi
+       elif [ "$ao" = "pipe" ]; then
+               config_get dev "$cfg" output_fifo ""
+               if [ -n "$dev" ]; then
+                       procd_append_param command "--"
+                       append_arg "$cfg" output_fifo ""
+               fi
+       elif [ "$ao" = "pulse" ]; then
+               config_get dev "$cfg" pulse_server ""
+               if [ -n "$dev" ]; then
+                       procd_append_param command "--"
+                       append_arg "$cfg" pulse_server "-a"
+                       append_arg "$cfg" pulse_sink "-s"
+                       append_arg "$cfg" pulse_appname "-n"
+               fi
        fi
 
+       config_get_bool aux "$cfg" 'respawn' '0'
+       [ "$aux" = 1 ] && procd_set_param respawn
+
        procd_close_instance
 }
 
diff --git a/multimedia/upmpdcli/Makefile b/multimedia/upmpdcli/Makefile
new file mode 100644 (file)
index 0000000..62448d1
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=upmpdcli
+PKG_VERSION:=0.9.0
+PKG_RELEASE:=1
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.lesbonscomptes.com/upmpdcli/downloads
+PKG_MD5SUM:=0e7b86037f19ea3a08067409af6f6902
+PKG_MAINTAINER:=Petko Bordjukov <bordjukov@gmail.com>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/upmpdcli
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  URL:=http://www.lesbonscomptes.com/upmpdcli
+  DEPENDS+= +libupnpp +libmpdclient
+  TITLE:=A UPnP front-end to MPD, the Music Player Daemon
+  USERID:=upmpdcli=89:upmpdcli=89
+endef
+
+define Package/upmpdcli/description
+upmpdcli implements an UPnP Media Renderer, using MPD to perform the real work.
+endef
+
+define Package/upmpdcli/install
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/upmpdcli.conf $(1)/etc/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/upmpdcli $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/share
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/upmpdcli $(1)/usr/share/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/upmpdcli.init $(1)/etc/init.d/upmpdcli
+endef
+
+$(eval $(call BuildPackage,upmpdcli))
diff --git a/multimedia/upmpdcli/files/upmpdcli.init b/multimedia/upmpdcli/files/upmpdcli.init
new file mode 100644 (file)
index 0000000..b91e6f9
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2014 OpenWrt.org
+
+START=95
+
+create_user() {
+       group_exists upmpdcli || group_add upmpdcli 89
+       user_exists upmpdcli || user_add upmpdcli 89
+}
+
+start() {
+       create_user
+       service_start /usr/bin/upmpdcli -D
+}
+
+stop() {
+       service_stop /usr/bin/upmpdcli
+}
diff --git a/net/bcp38/Makefile b/net/bcp38/Makefile
new file mode 100644 (file)
index 0000000..280bcc5
--- /dev/null
@@ -0,0 +1,62 @@
+#
+# Copyright (C) 2014 Openwrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=bcp38
+PKG_VERSION:=4
+PKG_RELEASE:=1
+PKG_LICENCE:=GPL-3.0+
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/bcp38
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=Routing and Redirection
+  TITLE:=BCP38 compliance
+  URL:=https://github.com/dtaht/ceropackages-3.10
+  MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
+  DEPENDS:=+ipset
+endef
+
+define Package/bcp38/description
+ bcp38 implements IETF BCP38 for home routers. See https://tools.ietf.org/html/bcp38.
+endef
+
+define Package/bcp38/conffiles
+/etc/config/bcp38
+endef
+
+define Build/Prepare
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/bcp38/install
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/bcp38.config $(1)/etc/config/bcp38
+       $(INSTALL_DIR) $(1)/usr/lib/bcp38
+       $(INSTALL_BIN) ./files/run.sh $(1)/usr/lib/bcp38/run.sh
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_BIN) ./files/bcp38.defaults $(1)/etc/uci-defaults/bcp38
+endef
+
+define Package/bcp38/postinst
+#!/bin/sh
+[ -x /etc/uci-defaults/bcp38 ] && /etc/uci-defaults/bcp38 || exit 0
+endef
+
+define Package/bcp38/postrm
+#!/bin/sh
+uci delete firewall.bcp38
+uci commit
+endef
+
+$(eval $(call BuildPackage,bcp38))
diff --git a/net/bcp38/files/bcp38.config b/net/bcp38/files/bcp38.config
new file mode 100644 (file)
index 0000000..08e8e20
--- /dev/null
@@ -0,0 +1,22 @@
+config bcp38
+       option enabled 0
+       option interface 'eth1'
+       option detect_upstream 1
+       list match '127.0.0.0/8'
+       list match '0.0.0.0/8'       # RFC 1700
+       list match '240.0.0.0/4'     # RFC 5745
+       list match '192.0.2.0/24'    # RFC 5737
+       list match '198.51.100.0/24' # RFC 5737
+       list match '203.0.113.0/24'  # RFC 5737
+       list match '192.168.0.0/16'  # RFC 1918
+       list match '10.0.0.0/8'      # RFC 1918
+       list match '172.16.0.0/12'   # RFC 1918
+       list match '169.254.0.0/16'  # RFC 3927
+
+#      list nomatch '172.26.0.0/21' # Example of something not to match
+#      There is a dhcp trigger to do this for the netmask of a 
+#      double natted connection needed
+
+#      I will argue that this level of indirection doesn't scale
+#      very well - see how to block china as an example
+#      http://www.okean.com/china.txt
diff --git a/net/bcp38/files/bcp38.defaults b/net/bcp38/files/bcp38.defaults
new file mode 100644 (file)
index 0000000..d7e0d80
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+uci -q batch <<-EOT
+       delete firewall.bcp38
+       set firewall.bcp38=include
+       set firewall.bcp38.type=script
+       set firewall.bcp38.path=/usr/lib/bcp38/run.sh
+       set firewall.bcp38.family=IPv4
+       set firewall.bcp38.reload=1
+       commit firewall
+EOT
+
+exit 0
diff --git a/net/bcp38/files/run.sh b/net/bcp38/files/run.sh
new file mode 100755 (executable)
index 0000000..bafdf3b
--- /dev/null
@@ -0,0 +1,104 @@
+#!/bin/sh
+# BCP38 filtering implementation for CeroWrt.
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# Author: Toke Høiland-Jørgensen <toke@toke.dk>
+
+STOP=$1
+IPSET_NAME=bcp38-ipv4
+IPTABLES_CHAIN=BCP38
+
+. /lib/functions.sh
+
+config_load bcp38
+
+add_bcp38_rule()
+{
+       local subnet="$1"
+       local action="$2"
+
+       if [ "$action" == "nomatch" ]; then
+               ipset add "$IPSET_NAME" "$subnet" nomatch
+       else
+               ipset add "$IPSET_NAME" "$subnet"
+       fi
+}
+
+detect_upstream()
+{
+       local interface="$1"
+
+       subnets=$(ip route show dev "$interface"  | grep 'scope link' | awk '{print $1}')
+       for subnet in $subnets; do
+               # ipset test doesn't work for subnets, so strip out the subnet part
+               # and test for that; add as exception if there's a match
+               addr=$(echo $subnet | sed 's|/[0-9]\+$||')
+               ipset test "$IPSET_NAME" $addr 2>/dev/null && add_bcp38_rule $subnet nomatch
+       done
+}
+
+run() {
+       local section="$1"
+       local enabled
+       local interface
+       local detect_upstream
+       config_get_bool enabled "$section" enabled 0
+       config_get interface "$section" interface
+       config_get detect_upstream "$section" detect_upstream
+
+       if [ "$enabled" -eq "1" -a -n "$interface" -a -z "$STOP" ] ; then
+               setup_ipset
+               setup_iptables "$interface"
+               config_list_foreach "$section" match add_bcp38_rule match
+               config_list_foreach "$section" nomatch add_bcp38_rule nomatch
+               [ "$detect_upstream" -eq "1" ] && detect_upstream "$interface"
+       fi
+       exit 0
+}
+
+setup_ipset()
+{
+       ipset create "$IPSET_NAME" hash:net family ipv4
+       ipset flush "$IPSET_NAME"
+}
+
+setup_iptables()
+{
+       local interface="$1"
+       iptables -N "$IPTABLES_CHAIN" 2>/dev/null
+       iptables -F "$IPTABLES_CHAIN" 2>/dev/null
+
+       iptables -I output_rule -j "$IPTABLES_CHAIN"
+       iptables -I input_rule -j "$IPTABLES_CHAIN"
+       iptables -I forwarding_rule -j "$IPTABLES_CHAIN"
+
+       # always accept DHCP traffic
+       iptables -A "$IPTABLES_CHAIN" -p udp --dport 67:68 --sport 67:68 -j RETURN
+       iptables -A "$IPTABLES_CHAIN" -o "$interface" -m set --match-set "$IPSET_NAME" dst -j REJECT --reject-with icmp-net-unreachable
+       iptables -A "$IPTABLES_CHAIN" -i "$interface" -m set --match-set "$IPSET_NAME" src -j DROP
+}
+
+destroy_ipset()
+{
+       ipset flush "$IPSET_NAME" 2>/dev/null
+       ipset destroy "$IPSET_NAME" 2>/dev/null
+}
+
+destroy_iptables()
+{
+       iptables -D output_rule -j "$IPTABLES_CHAIN" 2>/dev/null
+       iptables -D input_rule -j "$IPTABLES_CHAIN" 2>/dev/null
+       iptables -D forwarding_rule -j "$IPTABLES_CHAIN" 2>/dev/null
+       iptables -F "$IPTABLES_CHAIN" 2>/dev/null
+       iptables -X "$IPTABLES_CHAIN" 2>/dev/null
+}
+
+destroy_iptables
+destroy_ipset
+config_foreach run bcp38
+
+exit 0
index 99ac1c996f8dfff5535bf5ac55d94987e7e7f204..7aade35e4d626e66518c6f9a70f35b9decad5876 100644 (file)
@@ -9,7 +9,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bind
-PKG_VERSION:=9.9.5-P1
+PKG_VERSION:=9.9.6-P1
 PKG_RELEASE:=1
 
 PKG_MAINTAINER := Noah Meyerhans <frodo@morgul.net>
@@ -19,7 +19,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= \
        ftp://ftp.isc.org/isc/bind9/$(PKG_VERSION) \
        http://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION)
-PKG_MD5SUM:=3408af8c6d27d6cb8a05287f2ee32ad0
+PKG_MD5SUM:=ca9d8f4d26e740668d361bfc50d90fc7
 
 PKG_FIXUP:=autoreconf
 PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
index 986e5fe087bf1be3e8bae2d00920b2521d2e8af7..1441dbd4704bca9e31dbfbdff8e22b7c2c853fd1 100644 (file)
@@ -1,40 +1,34 @@
 #!/bin/sh /etc/rc.common
+# Copyright (C) 2014 Noah Meyerhans <frodo@morgul.net>
+# Licensed under the terms of the GNU General Public License version 2
+# or (at your discretion) any later later version
+
+USE_PROCD=1
+
 START=50
 
 config_file=/etc/bind/named.conf
 pid_file=/var/run/named/named.pid
 
-start() {
-  if [ -e $pid_file ]
-  then
-     echo "  named already running with PID `cat $pid_file`"
-     return 1
-  fi
-  echo Starting isc-bind
-
-  /usr/sbin/named -c $config_file
+logdir=/var/log/named/
+cachedir=/var/cache/bind
+libdir=/var/lib/bind
+config_file=/etc/bind/named.conf
 
-  if [ $? -ne 0 ]
-  then
-    echo "  isc-bind failed to start"
-  fi
+fix_perms() {
+    for dir in $libdir $logdir $cachedir; do
+       test -e "$dir" || {
+            mkdir -p "$dir"
+            chgrp bind "$dir"
+            chmod g+w "$dir"
+       }
+    done
 }
 
-stop() {
-  echo "Stopping isc-bind"
-  if [ -e $pid_file ]
-  then
-    kill `cat $pid_file`
-
-    if [ $? -ne 0 ]
-    then
-      echo "  PID " `cat $pid_file` not found
-      echo "  Is the named server running?"
-    fi
-
-    rm -f $pid_file
-
-    else
-    echo "  $pid_file not found"
-  fi
+start_service() {
+    fix_perms
+    procd_open_instance
+    procd_set_param command /usr/sbin/named -u bind -f -c $config_file
+    procd_set_param respawn
+    procd_close_instance
 }
diff --git a/net/bmon/Makefile b/net/bmon/Makefile
new file mode 100644 (file)
index 0000000..44da26c
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=bmon
+PKG_VERSION:=3.5
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/tgraf/bmon/releases/download/v$(PKG_VERSION)/
+PKG_MD5SUM:=b7d0d055727f2cf1e452f26dfbf6a825
+PKG_MAINTAINER:=Baptiste Jonglez <openwrt-pkg@bitsofnetworks.org>
+PKG_LICENSE:=MIT
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/bmon
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+PACKAGE_libncursesw:libncursesw +!PACKAGE_libncursesw:libncurses +libnl +confuse
+  TITLE:=bmon is a portable bandwidth monitor
+  URL:=https://github.com/tgraf/bmon/
+endef
+
+define Package/bmon/description
+       bmon is a portable bandwidth monitor
+       and rate estimator running on various
+       operating systems. It supports various
+       input methods for different architectures.
+endef
+
+CONFIGURE_ARGS += \
+       --disable-cnt-workaround \
+
+CONFIGURE_VARS += \
+       ac_cv_lib_nl_nl_connect=no \
+
+define Package/bmon/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/bmon $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,bmon))
diff --git a/net/coova-chilli/Config.in b/net/coova-chilli/Config.in
new file mode 100644 (file)
index 0000000..74877c2
--- /dev/null
@@ -0,0 +1,52 @@
+# CoovaChilli avanced configuration
+
+menu "Configuration"
+       depends on PACKAGE_coova-chilli
+
+config COOVACHILLI_PROXY
+        bool "Enable support for chilli proxy. Required for AAA Proxy through http"
+        default n
+
+config COOVACHILLI_REDIR
+       bool "Enable support for redir server. Required for uamregex"
+       default n
+
+config COOVACHILLI_MINIPORTAL
+       bool "Enable support Coova miniportal"
+       default n
+
+config COOVACHILLI_USERAGENT
+       bool "Enable recording user-agent"
+       default n
+
+config COOVACHILLI_DNSLOG
+       bool "Enable support to log DNS name queries"
+       default n
+
+config COOVACHILLI_UAMDOMAINFILE
+       bool "Enable loading of mass uamdomains from file"
+       default n
+
+config COOVACHILLI_LARGELIMITS
+       bool "Enable larger limits for use with non-embedded systems"
+       default n
+
+choice
+       prompt "SSL library"
+       default COOVACHILLI_NOSSL
+
+config COOVACHILLI_NOSSL
+       bool "No SSL support"
+
+config COOVACHILLI_MATRIXSSL
+       bool "MatrixSSL"
+
+config COOVACHILLI_CYASSL
+       bool "CyaSSL"
+
+config COOVACHILLI_OPENSSL
+       bool "OpenSSL"
+
+endchoice
+
+endmenu
diff --git a/net/coova-chilli/Makefile b/net/coova-chilli/Makefile
new file mode 100644 (file)
index 0000000..2ff8729
--- /dev/null
@@ -0,0 +1,105 @@
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=coova-chilli
+PKG_VERSION:=1.3.0+20141128
+PKG_MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://github.com/coova/coova-chilli
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=b93de20a288c01c2ba28e96e31ad6da01627f45f
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=2adb27ec56172b18c5beee359dd7898d
+
+PKG_INSTALL:=1
+
+PKG_CONFIG_DEPENDS := \
+  COOVACHILLI_MINIPORTAL \
+  COOVACHILLI_REDIR \
+  COOVACHILLI_USERAGENT \
+  COOVACHILLI_DNSLOG \
+  COOVACHILLI_UAMDOMAINFILE \
+  COOVACHILLI_LARGELIMITS \
+  COOVACHILLI_NOSSL \
+  COOVACHILLI_MATRIXSSL \
+  COOVACHILLI_CYASSL \
+  COOVACHILLI_OPENSSL
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/coova-chilli
+  SUBMENU:=Captive Portals
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+kmod-tun +librt +COOVACHILLI_MATRIXSSL:libmatrixssl +COOVACHILLI_CYASSL:libcyassl +COOVACHILLI_OPENSSL:libopenssl
+  TITLE:=Wireless LAN HotSpot controller (Coova Chilli Version)
+  URL:=http://www.coova.org/CoovaChilli
+  MENU:=1
+endef
+
+define Package/coova-chilli/description
+       CoovaChilli is an open source access controller for wireless LAN
+       access points and is based on ChilliSpot. It is used for authenticating
+       users of a wireless (or wired) LAN. It supports web based login (UAM)
+       which is today's standard for public HotSpots and it supports Wireless
+       Protected Access (WPA) which is the standard of the future.
+       Authentication, authorization and accounting (AAA) is handled by your
+       favorite radius server.
+endef
+
+define Package/coova-chilli/config
+  source "$(SOURCE)/Config.in"
+endef
+
+define Build/Prepare
+$(call Build/Prepare/Default)
+       ( cd $(PKG_BUILD_DIR) ; \
+               [ -f ./configure ] || { \
+                       ./bootstrap ; \
+               } \
+       )
+endef
+
+define Build/Configure
+       $(call Build/Configure/Default, \
+       $(if $(CONFIG_COOVACHILLI_PROXY),--enable,--disable)-chilliproxy \
+       $(if $(CONFIG_COOVACHILLI_REDIR),--enable,--disable)-chilliredir \
+       $(if $(CONFIG_COOVACHILLI_DNSLOG),--enable,--disable)-dnslog \
+       $(if $(CONFIG_COOVACHILLI_MINIPORTAL),--enable,--disable)-miniportal \
+       $(if $(CONFIG_COOVACHILLI_USERAGENT),--enable,--disable)-useragent \
+       $(if $(CONFIG_COOVACHILLI_LARGELIMITS),--enable,--disable)-largelimits \
+       $(if $(CONFIG_COOVACHILLI_UAMDOMAINFILE),--enable,--disable)-uamdomainfile \
+       $(if $(CONFIG_COOVACHILLI_MATRIXSSL),--with,--without)-matrixssl \
+       $(if $(CONFIG_COOVACHILLI_CYASSL),--with,--without)-cyaxssl \
+       $(if $(CONFIG_COOVACHILLI_OPENSSL),--with,--without)-openssl \
+       )
+endef
+
+define Package/coova-chilli/conffiles
+/etc/chilli.conf
+endef
+
+define Package/coova-chilli/install
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/chilli.conf $(1)/etc/
+       $(INSTALL_DIR) $(1)/etc/chilli
+       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/* $(1)/etc/chilli/
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
+       $(INSTALL_DATA) ./files/chilli.hotplug $(1)/etc/hotplug.d/iface/30-chilli
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/chilli* $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,coova-chilli))
diff --git a/net/coova-chilli/files/chilli.hotplug b/net/coova-chilli/files/chilli.hotplug
new file mode 100644 (file)
index 0000000..e12812b
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+[ "$ACTION" == "ifup" ] || exit 0
+
+[ "$INTERFACE" = "wan" ] && {
+       /etc/init.d/chilli restart
+}
diff --git a/net/coova-chilli/patches/100-fix-sysinfo-redeclaration.patch b/net/coova-chilli/patches/100-fix-sysinfo-redeclaration.patch
new file mode 100644 (file)
index 0000000..2efecbe
--- /dev/null
@@ -0,0 +1,24 @@
+--- a/src/system.h
++++ b/src/system.h
+@@ -83,10 +83,6 @@
+ #include <linux/sysinfo.h>
+ #endif
+-#ifdef HAVE_SYS_SYSINFO_H
+-#include <sys/sysinfo.h>
+-#endif
+-
+ #ifdef HAVE_TIME_H
+ #include <time.h>
+ #endif
+@@ -139,6 +135,10 @@
+ #include <linux/un.h>
+ #endif
++#ifdef HAVE_SYS_SYSINFO_H
++#include <sys/sysinfo.h>
++#endif
++
+ #elif defined (__FreeBSD__)  || defined (__APPLE__) || defined (__OpenBSD__) || defined (__NetBSD__) 
+ #include <net/if.h>
+ #include <net/bpf.h>
diff --git a/net/ddns-scripts/CHANGELOG b/net/ddns-scripts/CHANGELOG
new file mode 100644 (file)
index 0000000..4268c4b
--- /dev/null
@@ -0,0 +1,128 @@
+Version 2.1.0-3
+Date   2014-12-07
+
+- removed special handling for dynamic_dns_helper.sh and url_escape.sed in Makefile/postinst
+- minor fixes in logging
+- allow retry_count of "0" to run infinite retrys on error
+       -- https://dev.openwrt.org/ticket/18382
+- changed naming of .dat and .err file to have one per section, not one per process
+- defer hotplug helper from 25-ddns to 95-ddns (according initscript START=95) 
+       -- https://github.com/openwrt/packages/issues/568 (#568)
+- fix commandline for busybox wget
+       -- https://dev.openwrt.org/ticket/18411
+       -- https://dev.openwrt.org/ticket/18437
+       -- https://github.com/openwrt/packages/issues/605 (#605)
+- remove checking answer from ddns provider because there are to many different. 
+Many providers did not follow API from dyndns.com 
+
+--------------------------------------------------------------------------------
+Version 2.1.0-2
+Date   2014-11-15
+
+- moved /usr/lib/ddns/dynamic_dns_lucihelper.sh from luci-app-ddns into this package
+       -- https://github.com/openwrt/luci/issue/251
+       -- https://dev.openwrt.org/ticket/18326
+       -- https://dev.openwrt.org/ticket/18347
+- fix: dynamic_dns_update.sh did not loop
+       -- https://dev.openwrt.org/ticket/18336
+- add provider cloudflare.com IPv4 and IPv6 (Thanks to Paul for support and testing)
+       -- https://dev.openwrt.org/ticket/12500
+- modified detection, if dynamic_dns_fuctions are used by dynamic_dns_lucihelper.sh
+- redirect stdout of wget,curl,host,nslookup,nc etc to /tmp/ddns_$$.dat and *.err instead of variables
+- extended error detection in get_local_ip function
+- modified verify of option ip_script to allow parameters, when calling
+- add provider selfhost.de IPv4
+- add provider no-ip.pl (nothing to do with no-ip.com)
+       -- https://github.com/openwrt/packages/issues/542 (#542)
+       IPv4 (tested) and also added for
+       IPv6 (NOT tested) because client IP is autodetected be provider
+- add getlocalip_sample.sh as sample script for usage of
+       option ip_source 'script'  together with
+       option ip_script '/usr/lib/ddns/getlocalip.sh -4'
+- cleanup whitespaces at line ends
+
+--------------------------------------------------------------------------------
+Version 2.1.0-1
+Date   2014-11-09
+
+- fixed postinst and prerm in Makefile
+- implementation of provider specific update scripts into services and services_ipv6 file.
+       first Provider "no-ip.com"      - Thanks to DarkStarXxX for request and testing
+- finished uci/ddns wiki at http://wiki.openwrt.org/doc/uci/ddns
+- rewritten retry management
+- rewritten logging including following Issue 469
+       https://github.com/openwrt/packages/issues/469
+- stop running sections on hotplug ifdown event (like start on ifup)
+- implement trap detection
+       also kill "sleep" child processes
+       SIGHUP to reload configuration (not really reloading, simply starting a new process)
+       /etc/init.d/ddns reload implemented
+- code optimization
+- new provider LoopiaDNS.se    Issue 494
+       https://github.com/openwrt/packages/issues/494
+
+--------------------------------------------------------------------------------
+Version 2.0.1-9
+Date   2014-10-11
+
+- add retry loop to verify dns and proxy when script starts
+
+--------------------------------------------------------------------------------
+Version 2.0.1-8
+Date   2014-10-06
+
+- fixes problem CRITICAL ERROR - custom update_script not found
+
+--------------------------------------------------------------------------------
+Version 2.0.1-7
+Date   2014-10-05
+
+- Added support for custom update scripts with new option update_script
+
+--------------------------------------------------------------------------------
+Version 2.0.1-6
+Date   2014-10-01
+
+- url encode USERNAME and PASSWORD in update url
+
+--------------------------------------------------------------------------------
+Version 2.0.1-5
+Date   2014-09-30
+
+- fix send_update() detection of private IPv4
+
+--------------------------------------------------------------------------------
+Version 2.0.1-4
+Date   2014-09-29
+
+- fix ticket #17998: wrongly detect ipv4 start with 10x.x.x.x
+
+--------------------------------------------------------------------------------
+Version 2.0.1-3
+Date   2014-09-28
+
+- add service two-dns.de
+
+--------------------------------------------------------------------------------
+Version 2.0.1-2
+Date   2014-09-22
+
+- fix issue (#337) current/registered ip
+       https://github.com/openwrt/packages/issues/337
+
+--------------------------------------------------------------------------------
+Version 2.0.1-1
+Date   2014-09-20
+
+- 1st published version via github
+
+--------------------------------------------------------------------------------
+Version 2.0.0
+Date   2014-07-16
+
+- published via OpenWrt TRAC system as zip-file for testing
+       - IPv6 address support
+       - log file support
+       - syslog support for various error levels
+       - verify all given parameters before starting main loop
+       - retry max retry_counter times before terminating scripts
index 71c57866e638ed721a3d6874c1ee302c862f3f1f..29d513c1ea53c8e3df7341054bf34fe7f952d526 100644 (file)
@@ -1,8 +1,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ddns-scripts
-PKG_VERSION:=2.0.1
-PKG_RELEASE:=9
+PKG_VERSION:=2.1.0
+PKG_RELEASE:=3
 PKG_LICENSE:=GPL-2.0
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
@@ -19,8 +19,7 @@ define Package/ddns-scripts
 endef
 
 define Package/ddns-scripts/description
-       A highly configurable set of scripts for doing dynamic dns updates. 
-       NEW in this version:
+A highly configurable set of scripts for doing dynamic dns updates.
        - IPv6 support
        - force communication to IPv4 or IPv6 only
        - DNS server support
@@ -29,6 +28,7 @@ define Package/ddns-scripts/description
        - Proxy server support
        - log file support
        - support to run once
+Version: $(PKG_VERSION)-$(PKG_RELEASE)
 endef
 
 define Build/Prepare
@@ -62,7 +62,7 @@ endef
 define Package/ddns-scripts/postinst
        #!/bin/sh
        # if run within buildroot exit
-       [ -n "${IPKG_INSTROOT}" ] && exit 0
+       [ -n "$${IPKG_INSTROOT}" ] && exit 0
 
        # add new section "ddns" "global" if not exists
        uci -q get ddns.global > /dev/null || uci -q set ddns.global='ddns'
@@ -70,7 +70,7 @@ define Package/ddns-scripts/postinst
        uci -q get ddns.global.log_lines > /dev/null || uci -q set ddns.global.log_lines='250'
        uci -q commit ddns
 
-       # clear LuCI indexcache 
+       # clear LuCI indexcache
        rm -f /tmp/luci-indexcache >/dev/null 2>&1
 
        exit 0
@@ -79,13 +79,13 @@ endef
 define Package/ddns-scripts/prerm
        #!/bin/sh
        # if run within buildroot exit
-       [ -n "${IPKG_INSTROOT}" ] && exit 0
+       [ -n "$${IPKG_INSTROOT}" ] && exit 0
 
        # stop running scripts
        /etc/init.d/ddns disable
        /etc/init.d/ddns stop
 
-       # clear LuCI indexcache 
+       # clear LuCI indexcache
        rm -f /tmp/luci-indexcache >/dev/null 2>&1
 
        exit 0
index 54ec42c125d7e380bafeab5c83a588932b299833..ce2c57302b6c43677d39051fac0f9ff047ca3f01 100644 (file)
@@ -1,5 +1,6 @@
 #
 # Please read ddns.sample
+# or http://wiki.openwrt.org/doc/uci/ddns
 #
 config ddns "global"
        option date_format "%F %R"
@@ -9,8 +10,8 @@ config ddns "global"
 
 
 config service "myddns_ipv4"
-       option service_name     "dyndns.org"
-       option domain           "yourhost.dyndns.org"
+       option service_name     "example.org"
+       option domain           "yourhost.example.org"
        option username         "your_username"
        option password         "your_password"
        option interface        "wan"
@@ -26,4 +27,4 @@ config service "myddns_ipv6"
        option interface        "wan6"
        option ip_source        "network"
        option ip_network       "wan6"
-       
+
index 8625b3899850ce81fb4ec1e033237235828859bd..23ed9f1713ae9a06b6578bf9980db82e585abfbb 100644 (file)
@@ -4,18 +4,18 @@
 # and used by ddns-scripts and corresponding LuCI application
 #
 # Inside your ddns configuration file (/etc/config/ddns)
-# you might not find some of below described options. 
+# you might not find some of below described options.
 # This is because you don't need to define options
 # if using there defaults. The LuCI application will delete
 # options that configured to there default values.
 #
 # If you have a working ddns configuration from old ddns-scripts (Version 1.x)
-# everything will function the same with new scripts 
+# everything will function the same with new scripts
 # without any changes to the configuration.
 #
 # If you like to use this file for your configuration then
-# use a copy, because the used software to modify the 
-# configuration files will throw away all empty lines 
+# use a copy, because the used software to modify the
+# configuration files will throw away all empty lines
 # and those starting with # (comments).
 #
 
@@ -55,10 +55,10 @@ config ddns "global"
 # for each service you want to serve you need a separate configuration
 # if you need IPv4 and IPv6 you need to setup 2 separate configurations
 # with different names. (i.e. "myddns_ipv4" and "myddns_ipv6")
-# do not use white-spaces or dashes "-" or "@" ":" "!" or 
+# do not use white-spaces or dashes "-" or "@" ":" "!" or
 # other special characters inside name.
 config service "myddns"
-       
+
        ########### Basic settings ########################
 
        ###########
@@ -74,22 +74,22 @@ config service "myddns"
 
        ###########
        # defines the network as defined in /etc/config/network
-       # to be monitored for up/down events to start via hotplug 
+       # to be monitored for up/down events to start via hotplug
        default: "wan"  for IPv4
        default: "wan6" for IPv6
        option interface "wan"
 
        ###########
-       # Next you need to specify the name of the service you are 
+       # Next you need to specify the name of the service you are
        # connecting to "eg. dyndns.org".  The format of the update
        # urls for several different dynamic dns services is specified
-       # in the "/usr/lib/ddns/services" file for IPv4 and in 
+       # in the "/usr/lib/ddns/services" file for IPv4 and in
        # "/usr/lib/ddns/service_ipv6" file. This list is hardly complete
        # as there are many, many different dynamic dns services.
-       # If your service is on the list you can merely specify it with the 
+       # If your service is on the list you can merely specify it with the
        # "service_name" option.  Otherwise you will need to determine
        # the format of the url to update with.  You can either add an
-       # entry to the "/usr/lib/ddns/services" or "services_ipv6" file 
+       # entry to the "/usr/lib/ddns/services" or "services_ipv6" file
        # or specify this with the "update_url" option.
        # If your ddns provider doesn't work with ddns-scripts because
        # there are additional parameters or other special thinks to be done,
@@ -100,18 +100,18 @@ config service "myddns"
        # default: none
        option service_name "dyndns.org"
 
-       # sample: 
+       # sample:
        # "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]"
 #      option update_url   ""
 
-       # sample: 
+       # sample:
        # "/usr/lib/ddns/update_sample.sh"
 #      option update_script   ""
 
        ###########
        # You must specify your domain/host name, your username and your password
        # as you get from you DDNS provider. Keep an eye on providers help pages.
-       #       
+       #
        # Your DNS name / replace [DOMAIN] in update_url
        # default: none
        option domain ""
@@ -126,21 +126,21 @@ config service "myddns"
 
        ###########
        # use HTTPS for secure communication with you DDNS provider
-       # personally found some providers having problems when not sending 
-       # updates via HTTPS. Yyou must not specify "https://" in update_url. 
+       # personally found some providers having problems when not sending
+       # updates via HTTPS. You must not specify "https://" in update_url.
        # It's modified by the scripts themselves
        # Needs GNU Wget (with SSL support) or cURL to be installed.
        # default: "0"  do not use HTTPS
        option use_https "0"
 
-       # if using HTTPS (see above) the transfer program tries to verify 
+       # if using HTTPS (see above) the transfer program tries to verify
        # the providers server certificate. For verification there needs to be
        # the counterpart on this machine. Specify the path or path/file where
        # the transfer program can find them. (might need package CA-certificates)
        # if you don't want to verify servers certificate (insecure) you should
        # this parameter to "IGNORE" (in capital letters)
-       # default: "/etc/cacert"        path where CA-certificate package is installed
-       option cacert "/etc/cacert"
+       # default: (none)       path where CA-certificate package is installed
+       option cacert "/etc/ssl/certs"
 
        ###########
        # for logging and control if everything work fine you can get information inside
@@ -176,7 +176,7 @@ config service "myddns"
        option ip_source  "network"
        option ip_network "wan"
 
-       # ip_source "web" additional uses option ip_url and detects the current 
+       # ip_source "web" additional uses option ip_url and detects the current
        # local ip from special web sides that response with the ip address of
        # calling host. If you are behind a firewall/NAT this is the best option
        # since none of the local networks or interfaces will have the external ip.
@@ -201,8 +201,8 @@ config service "myddns"
 #      option ip_script ""
 
        ###########
-       # force_ipversion option will set the "-4" respectively "-6" parameter 
-       # on command line of transfer and DNS lookup program. 
+       # force_ipversion option will set the "-4" respectively "-6" parameter
+       # on command line of transfer and DNS lookup program.
        # So the whole communication uses the selected IP version between both ends.
        # needs GNU Wget or cURL installed for transfer and
        # BIND's host for DNS lookup.
@@ -210,11 +210,10 @@ config service "myddns"
        option force_ipversion "0"
 
        ###########
-       # normally the current (in the internet) registered ip is detected using the
+       # Normally the current (in the internet) registered ip is detected using the
        # local defined name lookup policies (i.e. /etc/resolve.conf etc.)
        # Specify here a DNS server to use instead of the defaults.
        # you can use hostname or ip address
-       # IPv6 address must be in squared brackets "[...]"
        # i.e. "google-public-dns-a.google.com"
        # default: none
 #      option dns_server "google-public-dns-a.google.com"
@@ -231,11 +230,12 @@ config service "myddns"
        # If a Proxy is need to access HTTP/HTTPS pages on the WEB
        # it can be configured here also for sending updates to the
        # DDNS provider. If you configured use_https='1' above, you
-       # need to setup your HTTPS proxy here, otherwise your 
+       # need to setup your HTTPS proxy here, otherwise your
        # HTTP proxy. !!! You should not detect your current IP
-       # ip_source='web' (see above) because this request is also 
+       # ip_source='web' (see above) because this request is also
        # send via the configured proxy !!!
        # Syntax: [user:password@]proxy:port !port is required !
+       # IPv6 address must be in squared brackets "[...]"
        # default: none
 #      option proxy ''
 
@@ -245,9 +245,9 @@ config service "myddns"
        # defines the time interval to check if local IP has changed
        # After the first start and first update send, the system will
        # wait this time before verify if update was successful send.
-       # !!! checks below 5 minutes make no sense because the Internet 
+       # !!! checks below 5 minutes make no sense because the Internet
        # needs about 5-10 minutes to sync an IP-change to all DNS servers !!!
-       # accepted unit entry’s: 'seconds' 'minutes' 'hours' 'days'
+       # accepted unit entry’s: 'seconds' 'minutes' 'hours'
        # minimum 5 minutes == 300 seconds
        # default 10 minutes
        option check_interval   '10'
@@ -256,11 +256,11 @@ config service "myddns"
        ###########
        # force to send an update to service provider, if no change was detected.
        # consult DDNS providers documentation if your DDNS entry might timeout.
-       # accepted unit entry’s: 'seconds' 'minutes' 'hours' 'days'
+       # accepted unit entry’s: 'minutes' 'hours' 'days'
        # minimum needs to be greater or equal check interval (see above)
        # A special setting of '0' is allowed, which forces the script to run once.
-       # It sends an update, verify if update was accepted by DNS 
-       # (retry if not) and finish. Useful if you want to start by your own (i.e. cron) 
+       # It sends an update, verify if update was accepted by DNS
+       # (retry if not) and finish. Useful if you want to start by your own (i.e. cron)
        # default 3 days == 72 hours
        option force_interval   '72'
        option force_unit       'hours'
@@ -276,7 +276,7 @@ config service "myddns"
        # if error happen on detecting, sending or updating the
        # script will retry the relevant action.
        # here you define the time to wait before retry is started
-       # accepted unit entry’s: 'seconds' 'minutes' 'hours' 'days'
+       # accepted unit entry’s: 'seconds' 'minutes'
        # default: 60 seconds
        option retry_interval   '60'
        option retry_unit       'seconds'
diff --git a/net/ddns-scripts/files/etc/hotplug.d/iface/25-ddns b/net/ddns-scripts/files/etc/hotplug.d/iface/25-ddns
deleted file mode 100644 (file)
index dab2385..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ "$ACTION" = "ifup" ]; then
-       . /usr/lib/ddns/dynamic_dns_functions.sh
-       /etc/init.d/ddns enabled && start_daemon_for_all_ddns_sections "$INTERFACE"
-fi
-
-
diff --git a/net/ddns-scripts/files/etc/hotplug.d/iface/95-ddns b/net/ddns-scripts/files/etc/hotplug.d/iface/95-ddns
new file mode 100644 (file)
index 0000000..dfb35f6
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# there are other ACTIONs like ifupdate we don't need
+# so parse dynamic_dns_functions.sh only when needed
+case "$ACTION" in
+       ifup)
+               . /usr/lib/ddns/dynamic_dns_functions.sh
+               /etc/init.d/ddns enabled && start_daemon_for_all_ddns_sections "$INTERFACE"
+               ;;
+       ifdown)
+               . /usr/lib/ddns/dynamic_dns_functions.sh
+               stop_daemon_for_all_ddns_sections "$INTERFACE"
+               ;;
+esac
index 1194543cbac3f3d3c15e6bf9c263835ab96234e7..3618621160e7314afb5fc5313c6a48ae11c2ec99 100644 (file)
@@ -1,16 +1,26 @@
 #!/bin/sh /etc/rc.common
 START=95
+STOP=10
 
 boot() {
        return 0
 }
 
+reload() {
+       killall -1 dynamic_dns_updater.sh 2>/dev/null   # send SIGHUP
+}
+
+restart() {
+       stop
+       sleep 1 # give time to shutdown
+       start
+}
+
 start() {
        . /usr/lib/ddns/dynamic_dns_functions.sh
        start_daemon_for_all_ddns_sections
 }
 
 stop() {
-       killall -9 dynamic_dns_updater.sh
+       killall dynamic_dns_updater.sh 2>/dev/null
 }
-
diff --git a/net/ddns-scripts/files/usr/lib/ddns/create_cert_hashes.sh b/net/ddns-scripts/files/usr/lib/ddns/create_cert_hashes.sh
deleted file mode 100644 (file)
index ff788c3..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-#
-#set -vx
-
-[ -d /etc/ssl/certs ] || {
-        echo "CA-Certificates not istalled - please install first"
-        exit 1
-}
-
-NUMCERT=$(find /etc/ssl/certs -name *.crt 2>/dev/null | wc -l)
-NUMLINK=$(find /etc/ssl/certs -type l 2>/dev/null | wc -l)
-
-[ $NUMLINK -gt 0 ] && {
-       echo "File-Links already exist. Exiting"
-       exit 0
-}
-
-[ -f /usr/bin/openssl ] && OPENSSL="EXIST"
-[ -z "$OPENSSL" ] && {
-       opkg update || exit 1
-       opkg install openssl-util 2>/dev/null
-}
-
-for CERTFILE in `ls -1 $(1)/etc/ssl/certs`; do \
-       HASH=`openssl x509 -hash -noout -in /etc/ssl/certs/$CERTFILE`
-       SUFFIX=0
-       while [ -h "/etc/ssl/certs/$HASH.$SUFFIX" ]; do
-               let "SUFFIX += 1"
-       done
-       ln -s "$CERTFILE" "/etc/ssl/certs/$HASH.$SUFFIX"
-       echo "link $HASH.$SUFFIX created for $CERTFILE"
-done
-
-[ -z "$OPENSSL" ] && opkg remove --force-remove --autoremove openssl-util 2>/dev/null
old mode 100644 (file)
new mode 100755 (executable)
index aeabe52..8b3d1ae
@@ -6,7 +6,7 @@
 # (Loosely) based on the script on the one posted by exobyte in the forums here:
 # http://forum.openwrt.org/viewtopic.php?id=14040
 #
-# extended and partial rewritten in August 2014 
+# extended and partial rewritten in August 2014
 # by Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
 # to support:
 # - IPv6 DDNS services
@@ -14,9 +14,9 @@
 # - Proxy Server to send out updates or retrieving WEB based IP detection
 # - force_interval=0 to run once (usefull for cron jobs etc.)
 # - the usage of BIND's host instead of BusyBox's nslookup if installed (DNS via TCP)
-# - extended Verbose Mode and log file support for better error detection 
+# - extended Verbose Mode and log file support for better error detection
 #
-# function __timeout
+# function timeout
 # copied from http://www.ict.griffith.edu.au/anthony/software/timeout.sh
 # @author Anthony Thyssen  6 April 2011
 #
 # GLOBAL VARIABLES #
 SECTION_ID=""          # hold config's section name
 VERBOSE_MODE=1         # default mode is log to console, but easily changed with parameter
-LUCI_HELPER=""         # set by dynamic_dns_lucihelper.sh, if filled supress all error logging
 
-PIDFILE=""             # pid file
-UPDFILE=""             # store UPTIME of last update
-
-# directory to store run information to. 
+# directory to store run information to.
 RUNDIR=$(uci -q get ddns.global.run_dir) || RUNDIR="/var/run/ddns"
+[ -d $RUNDIR ] || mkdir -p -m755 $RUNDIR
 # NEW # directory to store log files
 LOGDIR=$(uci -q get ddns.global.log_dir) || LOGDIR="/var/log/ddns"
+[ -d $LOGDIR ] || mkdir -p -m755 $LOGDIR
 LOGFILE=""             # NEW # logfile can be enabled as new option
+PIDFILE=""             # pid file
+UPDFILE=""             # store UPTIME of last update
+DATFILE=""             # save stdout data of WGet and other extern programs called
+ERRFILE=""             # save stderr output of WGet and other extern programs called
+
 # number of lines to before rotate logfile
 LOGLINES=$(uci -q get ddns.global.log_lines) || LOGLINES=250
+LOGLINES=$((LOGLINES + 1))     # correct sed handling
 
 CHECK_SECONDS=0                # calculated seconds out of given
 FORCE_SECONDS=0                # interval and unit
 RETRY_SECONDS=0                # in configuration
 
-OLD_PID=0              # Holds the PID of already running process for the same config section
-
 LAST_TIME=0            # holds the uptime of last successful update
 CURR_TIME=0            # holds the current uptime
 NEXT_TIME=0            # calculated time for next FORCED update
@@ -58,12 +60,13 @@ EPOCH_TIME=0                # seconds since 1.1.1970 00:00:00
 REGISTERED_IP=""       # holds the IP read from DNS
 LOCAL_IP=""            # holds the local IP read from the box
 
+URL_USER=""            # url encoded $username from config file
+URL_PASS=""            # url encoded $password from config file
+
 ERR_LAST=0             # used to save $? return code of program and function calls
-ERR_LOCAL_IP=0         # error counter on getting local ip
-ERR_REG_IP=0           # error counter on getting DNS registered ip
-ERR_SEND=0             # error counter on sending update to DNS provider
 ERR_UPDATE=0           # error counter on different local and registered ip
-ERR_VERIFY=0           # error counter verifying proxy- and dns-servers
+
+PID_SLEEP=0            # ProcessID of current background "sleep"
 
 # format to show date information in log and luci-app-ddns default ISO 8601 format
 DATE_FORMAT=$(uci -q get ddns.global.date_format) || DATE_FORMAT="%F %R"
@@ -75,6 +78,9 @@ IPV4_REGEX="[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}"
 # IPv6       ( ( 0-9a-f  1-4char ":") min 1x) ( ( 0-9a-f  1-4char   )optional) ( (":" 0-9a-f 1-4char  ) min 1x)
 IPV6_REGEX="\(\([0-9A-Fa-f]\{1,4\}:\)\{1,\}\)\(\([0-9A-Fa-f]\{1,4\}\)\{0,1\}\)\(\(:[0-9A-Fa-f]\{1,4\}\)\{1,\}\)"
 
+# detect if called by dynamic_dns_lucihelper.sh script, disable retrys (empty variable == false)
+[ "$(basename $0)" = "dynamic_dns_lucihelper.sh" ] && LUCI_HELPER="TRUE" || LUCI_HELPER=""
+
 # loads all options for a given package and section
 # also, sets all_option_variables to a list of the variable names
 # $1 = ddns, $2 = SECTION_ID
@@ -102,7 +108,7 @@ load_all_config_options()
        }
 
        config_load "$__PKGNAME"
-       
+
        # Given SECTION_ID not found so no data, so return 1
        [ -z "$__ALL_OPTION_VARIABLES" ] && return 1
 
@@ -113,9 +119,26 @@ load_all_config_options()
        return 0
 }
 
+# read's all service sections from ddns config
+# $1 = Name of variable to store
+load_all_service_sections() {
+       local __DATA=""
+       config_cb()
+       {
+               # only look for section type "service", ignore everything else
+               [ "$1" = "service" ] && __DATA="$__DATA $2"
+       }
+       config_load "ddns"
+
+       eval "$1=\"$__DATA\""
+       return
+}
+
 # starts updater script for all given sections or only for the one given
 # $1 = interface (Optional: when given only scripts are started
 # configured for that interface)
+# used by /etc/hotplug.d/iface/25-ddns on IFUP
+# and by /etc/init.d/ddns start
 start_daemon_for_all_ddns_sections()
 {
        local __EVENTIF="$1"
@@ -123,59 +146,101 @@ start_daemon_for_all_ddns_sections()
        local __SECTIONID=""
        local __IFACE=""
 
-       config_cb()
-       {
-               # only look for section type "service", ignore everything else
-               [ "$1" = "service" ] && __SECTIONS="$__SECTIONS $2"
+       load_all_service_sections __SECTIONS
+       for __SECTIONID in $__SECTIONS; do
+               config_get __IFACE "$__SECTIONID" interface "wan"
+               [ -z "$__EVENTIF" -o "$__IFACE" = "$__EVENTIF" ] || continue
+               /usr/lib/ddns/dynamic_dns_updater.sh $__SECTIONID 0 >/dev/null 2>&1 &
+       done
+}
+
+# stop sections process incl. childs (sleeps)
+# $1 = section
+stop_section_processes() {
+       local __PID=0
+       local __PIDFILE="$RUNDIR/$1.pid"
+       [ $# -ne 1 ] && write_log 12 "Error calling 'stop_section_processes()' - wrong number of parameters"
+
+       [ -e "$__PIDFILE" ] && {
+               __PID=$(cat $__PIDFILE)
+               ps | grep "^[\t ]*$__PID" >/dev/null 2>&1 && kill $__PID || __PID=0     # terminate it
        }
-       config_load "ddns"
+       [ $__PID -eq 0 ] # report if process was running
+}
 
-       for __SECTIONID in $__SECTIONS
-       do
+# stop updater script for all defines sections or only for one given
+# $1 = interface (optional)
+# used by /etc/hotplug.d/iface/25-ddns on 'ifdown'
+# and by /etc/init.d/ddns stop
+# needed because we also need to kill "sleep" child processes
+stop_daemon_for_all_ddns_sections() {
+       local __EVENTIF="$1"
+       local __SECTIONS=""
+       local __SECTIONID=""
+       local __IFACE=""
+
+       load_all_service_sections __SECTIONS
+       for __SECTIONID in $__SECTIONS; do
                config_get __IFACE "$__SECTIONID" interface "wan"
                [ -z "$__EVENTIF" -o "$__IFACE" = "$__EVENTIF" ] || continue
-               /usr/lib/ddns/dynamic_dns_updater.sh $__SECTIONID 0 > /dev/null 2>&1 &
+               stop_section_processes "$__SECTIONID"
        done
 }
 
-verbose_echo()
-{
-       [ -n "$LUCI_HELPER" ] && return # nothing to report when used by LuCI helper script
-       [ $VERBOSE_MODE -gt 0 ] && echo -e " $*"
-       if [ ${use_logfile:-0} -eq 1 -o $VERBOSE_MODE -gt 1 ]; then
-               [ -d $LOGDIR ] || mkdir -p -m 755 $LOGDIR
-               echo -e " $*" >> $LOGFILE
+# reports to console, logfile, syslog
+# $1   loglevel 7 == Debug to 0 == EMERG
+#      value +10 will exit the scripts
+# $2..n        text to report
+write_log() {
+       local __LEVEL __EXIT __CMD __MSG
+       local __TIME=$(date +%H%M%S)
+       [ $1 -ge 10 ] && {
+               __LEVEL=$(($1-10))
+               __EXIT=1
+       } || {
+               __LEVEL=$1
+               __EXIT=0
+       }
+       shift   # remove loglevel
+       [ $__EXIT -eq 0 ] && __MSG="$*" || __MSG="$* - TERMINATE"
+       case $__LEVEL in                # create log message and command depending on loglevel
+               0)      __CMD="logger -p user.emerg -t ddns-scripts[$$] $SECTION_ID: $__MSG"
+                       __MSG=" $__TIME EMERG : $__MSG" ;;
+               1)      __CMD="logger -p user.alert -t ddns-scripts[$$] $SECTION_ID: $__MSG"
+                       __MSG=" $__TIME ALERT : $__MSG" ;;
+               2)      __CMD="logger -p user.crit -t ddns-scripts[$$] $SECTION_ID: $__MSG"
+                       __MSG=" $__TIME  CRIT : $__MSG" ;;
+               3)      __CMD="logger -p user.err -t ddns-scripts[$$] $SECTION_ID: $__MSG"
+                       __MSG=" $__TIME ERROR : $__MSG" ;;
+               4)      __CMD="logger -p user.warn -t ddns-scripts[$$] $SECTION_ID: $__MSG"
+                       __MSG=" $__TIME  WARN : $__MSG" ;;
+               5)      __CMD="logger -p user.notice -t ddns-scripts[$$] $SECTION_ID: $__MSG"
+                       __MSG=" $__TIME  note : $__MSG" ;;
+               6)      __CMD="logger -p user.info -t ddns-scripts[$$] $SECTION_ID: $__MSG"
+                       __MSG=" $__TIME  info : $__MSG" ;;
+               7)      __MSG=" $__TIME       : $__MSG";;
+               *)      return;;
+       esac
+
+       # verbose echo
+       [ $VERBOSE_MODE -gt 0 -o $__EXIT -gt 0 ] && echo -e "$__MSG"
+       # write to logfile
+       if [ ${use_logfile:-1} -eq 1 -o $VERBOSE_MODE -gt 1 ]; then
+               echo -e "$__MSG" >> $LOGFILE
                # VERBOSE_MODE > 1 then NO loop so NO truncate log to $LOGLINES lines
                [ $VERBOSE_MODE -gt 1 ] || sed -i -e :a -e '$q;N;'$LOGLINES',$D;ba' $LOGFILE
        fi
+       [ $LUCI_HELPER ]   && return    # nothing else todo when running LuCI helper script
+       [ $__LEVEL -eq 7 ] && return    # no syslog for debug messages
+       [ $__EXIT  -eq 1 ] && {
+               $__CMD          # force syslog before exit
+               exit 1
+       }
+       [ $use_syslog -eq 0 ] && return
+       [ $((use_syslog + __LEVEL)) -le 7 ] && $__CMD
        return
 }
 
-syslog_info(){
-       [ $use_syslog -eq 1 ] && logger -p user.info -t ddns-scripts[$$] "$SECTION_ID: $*"
-       return
-}
-syslog_notice(){
-       [ $use_syslog -ge 1 -a $use_syslog -le 2 ] && logger -p user.notice -t ddns-scripts[$$] "$SECTION_ID: $*"
-       return
-}
-syslog_warn(){
-       [ $use_syslog -ge 1 -a $use_syslog -le 3 ] && logger -p user.warn -t ddns-scripts[$$] "$SECTION_ID: $*"
-       return
-}
-syslog_err(){
-       [ $use_syslog -ge 1 ] && logger -p user.err -t ddns-scripts[$$] "$SECTION_ID: $*"
-       return
-}
-
-critical_error() {
-       [ -n "$LUCI_HELPER" ] && return # nothing to report when used by LuCI helper script
-       verbose_echo "\n CRITICAL ERROR =: $* - EXITING\n"
-       [ $VERBOSE_MODE -eq 0 ] && echo -e "\n$SECTION_ID: CRITICAL ERROR - $* - EXITING\n"
-       logger -t ddns-scripts[$$] -p user.crit "$SECTION_ID: CRITICAL ERROR - $* - EXITING"
-       exit 1          # critical error -> leave here
-}
-
 # replace all special chars to their %hex value
 # used for USERNAME and PASSWORD in update_url
 # unchanged: "-"(minus) "_"(underscore) "."(dot) "~"(tilde)
@@ -183,13 +248,15 @@ critical_error() {
 #            "$"(Dollar)                               # because used as variable output
 # tested with the following string stored via Luci Application as password / username
 # A B!"#AA$1BB%&'()*+,-./:;<=>?@[\]^_`{|}~     without problems at Dollar or quotes
-__urlencode() {
+urlencode() {
        # $1    Name of Variable to store encoded string to
        # $2    string to encode
        local __STR __LEN __CHAR __OUT
        local __ENC=""
        local __POS=1
 
+       [ $# -ne 2 ] && write_log 12 "Error calling 'urlencode()' - wrong number of parameters"
+
        __STR="$2"              # read string to encode
        __LEN=${#__STR}         # get string length
 
@@ -211,21 +278,22 @@ __urlencode() {
                __POS=$(( $__POS + 1 ))         # increment position
        done
 
-       eval "$1='$__ENC'"      # transfer back to variable
+       eval "$1=\"$__ENC\""    # transfer back to variable
        return 0
 }
 
 # extract url or script for given DDNS Provider from
 # file /usr/lib/ddns/services for IPv4 or from
 # file /usr/lib/ddns/services_ipv6 for IPv6
+# $1   Name of Variable to store url to
+# $2   Name of Variable to store script to
 get_service_data() {
-       # $1    Name of Variable to store url to
-       # $2    Name of Variable to store script to
        local __LINE __FILE __NAME __URL __SERVICES __DATA
        local __SCRIPT=""
        local __OLD_IFS=$IFS
        local __NEWLINE_IFS='
 ' #__NEWLINE_IFS
+       [ $# -ne 2 ] && write_log 12 "Error calling 'get_service_data()' - wrong number of parameters"
 
        __FILE="/usr/lib/ddns/services"                                 # IPv4
        [ $use_ipv6 -ne 0 ] && __FILE="/usr/lib/ddns/services_ipv6"     # IPv6
@@ -235,8 +303,7 @@ get_service_data() {
                awk ' gsub("\x27", "\"") { if ($1~/^[^\"]*$/) $1="\""$1"\"" }; { if ( $NF~/^[^\"]*$/) $NF="\""$NF"\""  }; { print $0 }')
 
        IFS=$__NEWLINE_IFS
-       for __LINE in $__SERVICES
-       do
+       for __LINE in $__SERVICES; do
                #grep out proper parts of data and use echo to remove quotes
                __NAME=$(echo $__LINE | grep -o "^[\t ]*\"[^\"]*\"" | xargs -r -n1 echo)
                __DATA=$(echo $__LINE | grep -o "\"[^\"]*\"[\t ]*$" | xargs -r -n1 echo)
@@ -250,16 +317,18 @@ get_service_data() {
        # check is URL or SCRIPT is given
        __URL=$(echo "$__DATA" | grep "^http:")
        [ -z "$__URL" ] && __SCRIPT="/usr/lib/ddns/$__DATA"
-       
-       eval "$1='$__URL'"
-       eval "$2='$__SCRIPT'"
+
+       eval "$1=\"$__URL\""
+       eval "$2=\"$__SCRIPT\""
        return 0
 }
 
+# Calculate seconds from interval and unit
+# $1   Name of Variable to store result in
+# $2   Number and
+# $3   Unit of time interval
 get_seconds() {
-       # $1    Name of Variable to store result in
-       # $2    Number and
-       # $3    Unit of time interval
+       [ $# -ne 3 ] && write_log 12 "Error calling 'get_seconds()' - wrong number of parameters"
        case "$3" in
                "days" )        eval "$1=$(( $2 * 86400 ))";;
                "hours" )       eval "$1=$(( $2 * 3600 ))";;
@@ -269,7 +338,7 @@ get_seconds() {
        return 0
 }
 
-__timeout() {
+timeout() {
        # copied from http://www.ict.griffith.edu.au/anthony/software/timeout.sh
        # only did the folloing changes
        #       - commented out "#!/bin/bash" and usage section
@@ -314,7 +383,7 @@ __timeout() {
 
        SIG=-TERM
 
-       while [  $# -gt 0 ]; do
+       while [ $# -gt 0 ]; do
                case "$1" in
                        --)
                                # forced end of user options
@@ -368,104 +437,130 @@ __timeout() {
        return $status
 }
 
-__verify_host_port() {
-       # $1    Host/IP to verify
-       # $2    Port to verify
+#verify given host and port is connectable
+# $1   Host/IP to verify
+# $2   Port to verify
+verify_host_port() {
        local __HOST=$1
        local __PORT=$2
-       local __TMP __IP __IPV4 __IPV6 __RUNPROG __ERRPROG __ERR
+       local __IP __IPV4 __IPV6 __RUNPROG __ERR
        # return codes
        # 1     system specific error
        # 2     nslookup error
        # 3     nc (netcat) error
        # 4     unmatched IP version
 
-       __RUNPROG="nslookup $__HOST 2>/dev/null"
-       __ERRPROG="nslookup $__HOST 2>&1"
-       verbose_echo " resolver prog =: '$__RUNPROG'"
-       __TMP=$(eval $__RUNPROG)        # test if nslookup runs without errors
+       [ $# -ne 2 ] && write_log 12 "Error calling 'verify_host_port()' - wrong number of parameters"
+
+       __RUNPROG="/usr/bin/nslookup $__HOST >$DATFILE 2>$ERRFILE"
+       write_log 7 "#> $__RUNPROG"
+       eval $__RUNPROG
        __ERR=$?
        # command error
        [ $__ERR -gt 0 ] && {
-               verbose_echo "\n!!!!!!!!! ERROR =: BusyBox nslookup Error '$__ERR'\n$(eval $__ERRPROG)\n"
-               syslog_err "DNS Resolver Error - BusyBox nslookup Error '$__ERR'"
+               write_log 3 "DNS Resolver Error - BusyBox nslookup Error '$__ERR'"
+               write_log 7 "$(cat $ERRFILE)"
                return 2
-       } || {
-               # we need to run twice because multi-line output needs to be directly piped to grep because
-               # pipe returns return code of last prog in pipe but we need errors from nslookup command
-               __IPV4=$(eval $__RUNPROG | sed -ne "3,\$ { s/^Address [0-9]*: \($IPV4_REGEX\).*$/\\1/p }")
-               __IPV6=$(eval $__RUNPROG | sed -ne "3,\$ { s/^Address [0-9]*: \($IPv6_REGEX\).*$/\\1/p }")
        }
+       # extract IP address
+       __IPV4=$(cat $DATFILE | sed -ne "3,\$ { s/^Address [0-9]*: \($IPV4_REGEX\).*$/\\1/p }")
+       __IPV6=$(cat $DATFILE | sed -ne "3,\$ { s/^Address [0-9]*: \($IPV6_REGEX\).*$/\\1/p }")
 
        # check IP version if forced
        if [ $force_ipversion -ne 0 ]; then
                __ERR=0
                [ $use_ipv6 -eq 0 -a -z "$__IPV4" ] && __ERR=4
                [ $use_ipv6 -eq 1 -a -z "$__IPV6" ] && __ERR=6
-               [ $__ERR -gt 0 ] && critical_error "Invalid host: Error '4' - Force IP Version IPv$__ERR not supported"
+               [ $__ERR -gt 0 ] && {
+                       [ $LUCI_HELPER ] && return 4
+                       write_log 14 "Verify host Error '4' - Forced IP Version IPv$__ERR don't match"
+               }
        fi
 
        # verify nc command
        # busybox nc compiled without -l option "NO OPT l!" -> critical error
-       nc --help 2>&1 | grep -iq "NO OPT l!" && \
-               critical_error "Busybox nc: netcat compiled without -l option, error 'NO OPT l!'"
+       /usr/bin/nc --help 2>&1 | grep -i "NO OPT l!" >/dev/null 2>&1 && \
+               write_log 12 "Busybox nc (netcat) compiled without '-l' option, error 'NO OPT l!'"
        # busybox nc compiled with extensions
-       nc --help 2>&1 | grep -q "\-w" && __NCEXT="TRUE"
+       /usr/bin/nc --help 2>&1 | grep "\-w" >/dev/null 2>&1 && __NCEXT="TRUE"
 
        # connectivity test
        # run busybox nc to HOST PORT
        # busybox might be compiled with "FEATURE_PREFER_IPV4_ADDRESS=n"
-       # then nc will try to connect via IPv6 if there is an IPv6 availible for host
-       # not worring if there is an IPv6 wan address
-       # so if not "forced_ipversion" to use ipv6 then connect test via ipv4 if availible
-       [ $force_ipversion -ne 0 -a $use_ipv6 -ne 0 -o -z "$__IPV4" ] && {
-               # force IPv6
-               __IP=$__IPV6
-       } || __IP=$__IPV4
-
-       if [ -n "$__NCEXT" ]; then      # nc compiled with extensions (timeout support)
-               __RUNPROG="nc -w 1 $__IP $__PORT </dev/null >/dev/null 2>&1"
-               __ERRPROG="nc -vw 1 $__IP $__PORT </dev/null 2>&1"
-               verbose_echo "  connect prog =: '$__RUNPROG'"
+       # then nc will try to connect via IPv6 if there is any IPv6 availible on any host interface
+       # not worring, if there is an IPv6 wan address
+       # so if not "force_ipversion" to use_ipv6 then connect test via ipv4, if availible
+       [ $force_ipversion -ne 0 -a $use_ipv6 -ne 0 -o -z "$__IPV4" ] && __IP=$__IPV6 || __IP=$__IPV4
+
+       if [ -n "$__NCEXT" ]; then      # BusyBox nc compiled with extensions (timeout support)
+               __RUNPROG="/usr/bin/nc -vw 1 $__IP $__PORT </dev/null >$DATFILE 2>$ERRFILE"
+               write_log 7 "#> $__RUNPROG"
                eval $__RUNPROG
                __ERR=$?
                [ $__ERR -eq 0 ] && return 0
-               verbose_echo "\n!!!!!!!!! ERROR =: BusyBox nc Error '$__ERR'\n$(eval $__ERRPROG)\n"
-               syslog_err "host verify Error - BusyBox nc Error '$__ERR'"
+               write_log 3 "Connect error - BusyBox nc (netcat) Error '$__ERR'"
+               write_log 7 "$(cat $ERRFILE)"
                return 3
        else            # nc compiled without extensions (no timeout support)
-               __RUNPROG="__timeout 2 -- nc $__IP $__PORT </dev/null >/dev/null 2>&1"
-               verbose_echo "  connect prog =: '$__RUNPROG'"
+               __RUNPROG="timeout 2 -- /usr/bin/nc $__IP $__PORT </dev/null >$DATFILE 2>$ERRFILE"
+               write_log 7 "#> $__RUNPROG"
                eval $__RUNPROG
                __ERR=$?
                [ $__ERR -eq 0 ] && return 0
-               verbose_echo "\n!!!!!!!!! ERROR =: BusyBox nc Error '$__ERR' (timeout)"
-               syslog_err "host verify Error - BusyBox nc Error '$__ERR' (timeout)"
+               write_log 3 "Connect error - BusyBox nc (netcat) timeout Error '$__ERR'"
                return 3
        fi
 }
 
+# verfiy given DNS server if connectable
+# $1   DNS server to verify
 verify_dns() {
-       # $1    DNS server to verify
-       # we need DNS server to verify otherwise exit with ERROR 1
-       [ -z "$1" ] && return 1
+       local __ERR=255 # last error buffer
+       local __CNT=0   # error counter
+
+       [ $# -ne 1 ] && write_log 12 "Error calling 'verify_dns()' - wrong number of parameters"
+       write_log 7 "Verify DNS server '$1'"
 
-       # DNS uses port 53
-       __verify_host_port "$1" "53"
+       while [ $__ERR -ne 0 ]; do
+               # DNS uses port 53
+               verify_host_port "$1" "53"
+               __ERR=$?
+               if [ $LUCI_HELPER ]; then       # no retry if called by LuCI helper script
+                       return $__ERR
+               elif [ $__ERR -ne 0 -a $VERBOSE_MODE -gt 1 ]; then      # VERBOSE_MODE > 1 then NO retry
+                       write_log 4 "Verify DNS server '$1' failed - Verbose Mode: $VERBOSE_MODE - NO retry on error"
+                       return $__ERR
+               elif [ $__ERR -ne 0 ]; then
+                       __CNT=$(( $__CNT + 1 )) # increment error counter
+                       # if error count > retry_count leave here
+                       [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \
+                               write_log 14 "Verify DNS server '$1' failed after $retry_count retries"
+
+                       write_log 4 "Verify DNS server '$1' failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds"
+                       sleep $RETRY_SECONDS &
+                       PID_SLEEP=$!
+                       wait $PID_SLEEP # enable trap-handler
+                       PID_SLEEP=0
+               fi
+       done
+       return 0
 }
 
+# analyse and verfiy given proxy string
+# $1   Proxy-String to verify
 verify_proxy() {
-       # $1    Proxy-String to verify
-       #               complete entry          user:password@host:port
-       #                                       inside user and password NO '@' of ":" allowed 
-       #               host and port only      host:port
-       #               host only               host            ERROR unsupported
-       #               IPv4 address instead of host    123.234.234.123
-       #               IPv6 address instead of host    [xxxx:....:xxxx]        in square bracket
+       #       complete entry          user:password@host:port
+       #                               inside user and password NO '@' of ":" allowed
+       #       host and port only      host:port
+       #       host only               host            ERROR unsupported
+       #       IPv4 address instead of host    123.234.234.123
+       #       IPv6 address instead of host    [xxxx:....:xxxx]        in square bracket
        local __TMP __HOST __PORT
+       local __ERR=255 # last error buffer
+       local __CNT=0   # error counter
 
-       # we need Proxy-Sting to verify otherwise exit with ERROR 1
-       [ -z "$1" ] && return 1
+       [ $# -ne 1 ] && write_log 12 "Error calling 'verify_proxy()' - wrong number of parameters"
+       write_log 7 "Verify Proxy server 'http://$1'"
 
        # try to split user:password "@" host:port
        __TMP=$(echo $1 | awk -F "@" '{print $2}')
@@ -481,24 +576,50 @@ verify_proxy() {
                __HOST=$(echo $__TMP | awk -F ":" '{print $1}')
                __PORT=$(echo $__TMP | awk -F ":" '{print $2}')
        fi
-       # No Port detected
-       [ -z "$__PORT" ] && critical_error "Invalid Proxy server Error '5' - proxy port missing"
+       # No Port detected - EXITING
+       [ -z "$__PORT" ] && {
+               [ $LUCI_HELPER ] && return 5
+               write_log 14 "Invalid Proxy server Error '5' - proxy port missing"
+       }
 
-       __verify_host_port "$__HOST" "$__PORT"
+       while [ $__ERR -gt 0 ]; do
+               verify_host_port "$__HOST" "$__PORT"
+               __ERR=$?
+               if [ $LUCI_HELPER ]; then       # no retry if called by LuCI helper script
+                       return $__ERR
+               elif [ $__ERR -gt 0 -a $VERBOSE_MODE -gt 1 ]; then      # VERBOSE_MODE > 1 then NO retry
+                       write_log 4 "Verify Proxy server '$1' failed - Verbose Mode: $VERBOSE_MODE - NO retry on error"
+                       return $__ERR
+               elif [ $__ERR -gt 0 ]; then
+                       __CNT=$(( $__CNT + 1 )) # increment error counter
+                       # if error count > retry_count leave here
+                       [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \
+                               write_log 14 "Verify Proxy server '$1' failed after $retry_count retries"
+
+                       write_log 4 "Verify Proxy server '$1' failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds"
+                       sleep $RETRY_SECONDS &
+                       PID_SLEEP=$!
+                       wait $PID_SLEEP # enable trap-handler
+                       PID_SLEEP=0
+               fi
+       done
+       return 0
 }
 
-__do_transfer() {
-       # $1    # Variable to store Answer of transfer
-       # $2    # URL to use
-       local __URL="$2"
+do_transfer() {
+       # $1    # URL to use
+       local __URL="$1"
        local __ERR=0
-       local __PROG  __RUNPROG  __ERRPROG  __DATA
+       local __CNT=0   # error counter
+       local __PROG  __RUNPROG
+
+       [ $# -ne 1 ] && write_log 12 "Error in 'do_transfer()' - wrong number of parameters"
 
        # lets prefer GNU Wget because it does all for us - IPv4/IPv6/HTTPS/PROXY/force IP version
-       if /usr/bin/wget --version 2>&1 | grep -q "\+ssl"; then
-               __PROG="/usr/bin/wget -t 2 -O -"        # standard output only 2 retrys on error
+       if /usr/bin/wget --version 2>&1 | grep "\+ssl" >/dev/null 2>&1 ; then
+               __PROG="/usr/bin/wget -nv -t 1 -O $DATFILE -o $ERRFILE" # non_verbose no_retry outfile errfile
                # force ip version to use
-               if [ $force_ipversion -eq 1 ]; then     
+               if [ $force_ipversion -eq 1 ]; then
                        [ $use_ipv6 -eq 0 ] && __PROG="$__PROG -4" || __PROG="$__PROG -6"       # force IPv4/IPv6
                fi
                # set certificate parameters
@@ -510,29 +631,21 @@ __do_transfer() {
                        elif [ -d "$cacert" ]; then
                                __PROG="$__PROG --ca-directory=${cacert}"
                        else    # exit here because it makes no sense to start loop
-                               critical_error "Wget: No valid certificate(s) found for running HTTPS"
+                               write_log 14 "No valid certificate(s) found at '$cacert' for HTTPS communication"
                        fi
                fi
                # disable proxy if no set (there might be .wgetrc or .curlrc or wrong environment set)
                [ -z "$proxy" ] && __PROG="$__PROG --no-proxy"
 
-               __RUNPROG="$__PROG -q '$__URL' 2>/dev/null"     # do transfer with "-q" to suppress not needed output
-               __ERRPROG="$__PROG -d '$__URL' 2>&1"            # do transfer with "-d" for debug mode
-               verbose_echo " transfer prog =: $__RUNPROG"
-               __DATA=$(eval $__RUNPROG)
-               __ERR=$?
-               [ $__ERR -gt 0 ] && {
-                       verbose_echo "\n!!!!!!!!! ERROR =: GNU Wget Error '$__ERR'\n$(eval $__ERRPROG)\n"
-                       syslog_err "Communication Error - GNU Wget Error: '$__ERR'"
-                       return 1
-               }
+               __RUNPROG="$__PROG '$__URL'"    # build final command
+               __PROG="GNU Wget"               # reuse for error logging
 
        # 2nd choice is cURL IPv4/IPv6/HTTPS
        # libcurl might be compiled without Proxy Support (default in trunk)
        elif [ -x /usr/bin/curl ]; then
-               __PROG="/usr/bin/curl"
+               __PROG="/usr/bin/curl -sS -o $DATFILE --stderr $ERRFILE"
                # force ip version to use
-               if [ $force_ipversion -eq 1 ]; then     
+               if [ $force_ipversion -eq 1 ]; then
                        [ $use_ipv6 -eq 0 ] && __PROG="$__PROG -4" || __PROG="$__PROG -6"       # force IPv4/IPv6
                fi
                # set certificate parameters
@@ -544,7 +657,7 @@ __do_transfer() {
                        elif [ -d "$cacert" ]; then
                                __PROG="$__PROG --capath $cacert"
                        else    # exit here because it makes no sense to start loop
-                               critical_error "cURL: No valid certificate(s) found for running HTTPS"
+                               write_log 14 "No valid certificate(s) found at '$cacert' for HTTPS communication"
                        fi
                fi
                # disable proxy if no set (there might be .wgetrc or .curlrc or wrong environment set)
@@ -554,221 +667,335 @@ __do_transfer() {
                else
                        # if libcurl has no proxy support and proxy should be used then force ERROR
                        # libcurl currently no proxy support by default
-                       grep -iq all_proxy /usr/lib/libcurl.so* || \
-                               critical_error "cURL: libcurl compiled without Proxy support"
+                       grep -i "all_proxy" /usr/lib/libcurl.so* >/dev/null 2>&1 || \
+                               write_log 13 "cURL: libcurl compiled without Proxy support"
                fi
 
-               __RUNPROG="$__PROG -q '$__URL' 2>/dev/null"     # do transfer with "-s" to suppress not needed output
-               __ERRPROG="$__PROG -v '$__URL' 2>&1"            # do transfer with "-v" for verbose mode
-               verbose_echo " transfer prog =: $__RUNPROG"
-               __DATA=$(eval $__RUNPROG)
-               __ERR=$?
-               [ $__ERR -gt 0 ] && {
-                       verbose_echo "\n!!!!!!!!! ERROR =: cURL Error '$__ERR'\n$(eval $__ERRPROG)\n"
-                       syslog_err "Communication Error - cURL Error: '$__ERR'"
-                       return 1
-               }
+               __RUNPROG="$__PROG '$__URL'"    # build final command
+               __PROG="cURL"                   # reuse for error logging
 
        # busybox Wget (did not support neither IPv6 nor HTTPS)
        elif [ -x /usr/bin/wget ]; then
-               __PROG="/usr/bin/wget -O -"
+               __PROG="/usr/bin/wget -q -O $DATFILE"
                # force ip version not supported
                [ $force_ipversion -eq 1 ] && \
-                       critical_error "BusyBox Wget: can not force IP version to use"
+                       write_log 14 "BusyBox Wget: can not force IP version to use"
                # https not supported
                [ $use_https -eq 1 ] && \
-                       critical_error "BusyBox Wget: no HTTPS support"
+                       write_log 14 "BusyBox Wget: no HTTPS support"
                # disable proxy if no set (there might be .wgetrc or .curlrc or wrong environment set)
                [ -z "$proxy" ] && __PROG="$__PROG -Y off"
-               
-               __RUNPROG="$__PROG -q '$__URL' 2>/dev/null"     # do transfer with "-q" to suppress not needed output
-               __ERRPROG="$__PROG '$__URL' 2>&1"
-               verbose_echo " transfer prog =: $__RUNPROG"
-               __DATA=$(eval $__RUNPROG)
-               __ERR=$?
-               [ $__ERR -gt 0 ] && {
-                       verbose_echo "\n!!!!!!!!! ERROR =: BusyBox Wget Error '$__ERR'\n$(eval $__ERRPROG)\n"
-                       syslog_err "Communication Error - BusyBox Wget Error: '$__ERR'"
-                       return 1
-               }
+
+               __RUNPROG="$__PROG '$__URL' 2>$ERRFILE"         # build final command
+               __PROG="Busybox Wget"                           # reuse for error logging
 
        else
-               critical_error "Program not found - Neither 'Wget' nor 'cURL' installed or executable"
+               write_log 13 "Neither 'Wget' nor 'cURL' installed or executable"
        fi
 
-       eval "$1='$__DATA'"
-       return 0
+       while : ; do
+               write_log 7 "#> $__RUNPROG"
+               eval $__RUNPROG                 # DO transfer
+               __ERR=$?                        # save error code
+               [ $__ERR -eq 0 ] && return 0    # no error leave
+               [ $LUCI_HELPER ] && return 1    # no retry if called by LuCI helper script
+
+               write_log 3 "$__PROG Error: '$__ERR'"
+               write_log 7 "$(cat $ERRFILE)"           # report error
+
+               [ $VERBOSE_MODE -gt 1 ] && {
+                       # VERBOSE_MODE > 1 then NO retry
+                       write_log 4 "Transfer failed - Verbose Mode: $VERBOSE_MODE - NO retry on error"
+                       return 1
+               }
+
+               __CNT=$(( $__CNT + 1 )) # increment error counter
+               # if error count > retry_count leave here
+               [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \
+                       write_log 14 "Transfer failed after $retry_count retries"
+
+               write_log 4 "Transfer failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds"
+               sleep $RETRY_SECONDS &
+               PID_SLEEP=$!
+               wait $PID_SLEEP # enable trap-handler
+               PID_SLEEP=0
+       done
+       # we should never come here there must be a programming error
+       write_log 12 "Error in 'do_transfer()' - program coding error"
 }
 
 send_update() {
        # $1    # IP to set at DDNS service provider
        local __IP
 
+       [ $# -ne 1 ] && write_log 12 "Error calling 'send_update()' - wrong number of parameters"
+
        # verify given IP / no private IPv4's / no IPv6 addr starting with fxxx of with ":"
        [ $use_ipv6 -eq 0 ] && __IP=$(echo $1 | grep -v -E "(^0|^10\.|^127|^172\.1[6-9]\.|^172\.2[0-9]\.|^172\.3[0-1]\.|^192\.168)")
        [ $use_ipv6 -eq 1 ] && __IP=$(echo $1 | grep "^[0-9a-eA-E]")
-       [ -z "$__IP" ] && critical_error "Private or invalid or no IP '$1' given"
+       [ -z "$__IP" ] && write_log 4 "Private or invalid or no IP '$1' given"
 
        if [ -n "$update_script" ]; then
-               verbose_echo "        update =: parsing script '$update_script'"
+               write_log 7 "parsing script '$update_script'"
                . $update_script
        else
-               local __URL __ANSWER __ERR __USER __PASS
+               local __URL __ERR
 
                # do replaces in URL
-               __urlencode __USER "$username"  # encode username, might be email or something like this
-               __urlencode __PASS "$password"  # encode password, might have special chars for security reason
-               __URL=$(echo $update_url | sed -e "s#\[USERNAME\]#$__USER#g" -e "s#\[PASSWORD\]#$__PASS#g" \
+               __URL=$(echo $update_url | sed -e "s#\[USERNAME\]#$URL_USER#g" -e "s#\[PASSWORD\]#$URL_PASS#g" \
                                               -e "s#\[DOMAIN\]#$domain#g" -e "s#\[IP\]#$__IP#g")
                [ $use_https -ne 0 ] && __URL=$(echo $__URL | sed -e 's#^http:#https:#')
 
-               __do_transfer __ANSWER "$__URL"
-               __ERR=$?
-               [ $__ERR -gt 0 ] && {
-                       verbose_echo "\n!!!!!!!!! ERROR =: Error sending update to DDNS Provider\n"
-                       return 1
-               }
-               verbose_echo "   update send =: DDNS Provider answered\n$__ANSWER"
+               do_transfer "$__URL" || return 1
+
+               write_log 7 "DDNS Provider answered:\n$(cat $DATFILE)"
+
                return 0
+               # TODO analyse providers answer
+               # "good" or "nochg"             = dyndns.com compatible API
+               # grep -i -E "good|nochg" $DATFILE >/dev/null 2>&1
+               # return $?     # "0" if found
        fi
 }
 
 get_local_ip () {
        # $1    Name of Variable to store local IP (LOCAL_IP)
-       local __RUNPROG __IP __URL __ANSWER
-
-       case $ip_source in
-               network )
-                       # set correct program
-                       [ $use_ipv6 -eq 0 ] && __RUNPROG="network_get_ipaddr" \
-                                           || __RUNPROG="network_get_ipaddr6"
-                       $__RUNPROG __IP "$ip_network"
-                       verbose_echo "      local ip =: '$__IP' detected on network '$ip_network'"
-                       ;;
-               interface )
-                       if [ $use_ipv6 -eq 0 ]; then
-                               __IP=$(ifconfig $ip_interface | awk '
-                                       /inet addr:/ {  # Filter IPv4
-                                       #   inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
-                                       $1="";          # remove inet
-                                       $3="";          # remove Bcast: ...
-                                       $4="";          # remove Mask: ...
-                                       FS=":";         # separator ":"
-                                       $0=$0;          # reread to activate separator
-                                       $1="";          # remove addr
-                                       FS=" ";         # set back separator to default " "
-                                       $0=$0;          # reread to activate separator (remove whitespaces)
-                                       print $1;       # print IPv4 addr
-                                       }'
-                               )
-                       else
-                               __IP=$(ifconfig $ip_interface | awk '
-                                       /inet6/ && /: [0-9a-eA-E]/ && !/\/128/ {        # Filter IPv6 exclude fxxx and /128 prefix
-                                       #   inet6 addr: 2001:db8::xxxx:xxxx/32 Scope:Global
-                                       FS="/";         # separator "/"
-                                       $0=$0;          # reread to activate separator
-                                       $2="";          # remove everything behind "/"
-                                       FS=" ";         # set back separator to default " "
-                                       $0=$0;          # reread to activate separator
-                                       print $3;       # print IPv6 addr
-                                       }'
-                               )
-                       fi
-                       verbose_echo "      local ip =: '$__IP' detected on interface '$ip_interface'"
-                       ;;
-               script )
-                       # get ip from script
-                       __IP=$($ip_script)
-                       verbose_echo "      local ip =: '$__IP' detected via script '$ip_script'"
-                       ;;
-               * )
-                       for __URL in $ip_url; do
-                               __do_transfer __ANSWER "$__URL"
-                               [ -n "$__IP" ] && break # Answer detected, leave for loop
-                       done
-                       # use correct regular expression
-                       [ $use_ipv6 -eq 0 ] \
-                               && __IP=$(echo "$__ANSWER" | grep -m 1 -o "$IPV4_REGEX") \
-                               || __IP=$(echo "$__ANSWER" | grep -m 1 -o "$IPV6_REGEX")
-                       verbose_echo "      local ip =: '$__IP' detected via web at '$__URL'"
-                       ;;
-       esac
+       local __CNT=0   # error counter
+       local __RUNPROG __DATA __URL __ERR
+
+       [ $# -ne 1 ] && write_log 12 "Error calling 'get_local_ip()' - wrong number of parameters"
+       write_log 7 "Detect local IP"
+
+       while : ; do
+               case $ip_source in
+                       network)
+                               # set correct program
+                               [ $use_ipv6 -eq 0 ] && __RUNPROG="network_get_ipaddr" \
+                                                   || __RUNPROG="network_get_ipaddr6"
+                               write_log 7 "#> $__RUNPROG __DATA '$ip_network'"
+                               eval "$__RUNPROG __DATA $ip_network" || write_log 3 "$__RUNPROG Error: '$?'"
+                               [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected on network '$ip_network'"
+                               ;;
+                       interface)
+                               write_log 7 "#> ifconfig $ip_interface >$DATFILE 2>$ERRFILE"
+                               ifconfig $ip_interface >$DATFILE 2>$ERRFILE
+                               __ERR=$?
+                               if [ $__ERR -eq 0 ]; then
+                                       if [ $use_ipv6 -eq 0 ]; then
+                                               __DATA=$(awk '
+                                                       /inet addr:/ {  # Filter IPv4
+                                                       #   inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
+                                                       $1="";          # remove inet
+                                                       $3="";          # remove Bcast: ...
+                                                       $4="";          # remove Mask: ...
+                                                       FS=":";         # separator ":"
+                                                       $0=$0;          # reread to activate separator
+                                                       $1="";          # remove addr
+                                                       FS=" ";         # set back separator to default " "
+                                                       $0=$0;          # reread to activate separator (remove whitespaces)
+                                                       print $1;       # print IPv4 addr
+                                                       }' $DATFILE
+                                               )
+                                       else
+                                               __DATA=$(awk '
+                                                       /inet6/ && /: [0-9a-eA-E]/ && !/\/128/ {        # Filter IPv6 exclude fxxx and /128 prefix
+                                                       #   inet6 addr: 2001:db8::xxxx:xxxx/32 Scope:Global
+                                                       FS="/";         # separator "/"
+                                                       $0=$0;          # reread to activate separator
+                                                       $2="";          # remove everything behind "/"
+                                                       FS=" ";         # set back separator to default " "
+                                                       $0=$0;          # reread to activate separator
+                                                       print $3;       # print IPv6 addr
+                                                       }' $DATFILE
+                                               )
+                                       fi
+                                       [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected on interface '$ip_interface'"
+                               else
+                                       write_log 3 "ifconfig Error: '$__ERR'"
+                                       write_log 7 "$(cat $ERRFILE)"           # report error
+                               fi
+                               ;;
+                       script)
+                               write_log 7 "#> $ip_script >$DATFILE 2>$ERRFILE"
+                               eval $ip_script >$DATFILE 2>$ERRFILE
+                               __ERR=$?
+                               if [ $__ERR -eq 0 ]; then
+                                       __DATA=$(cat $DATFILE)
+                                       [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected via script '$ip_script'"
+                               else
+                                       write_log 3 "$ip_script Error: '$__ERR'"
+                                       write_log 7 "$(cat $ERRFILE)"           # report error
+                               fi
+                               ;;
+                       web)
+                               do_transfer "$ip_url"
+                               # use correct regular expression
+                               [ $use_ipv6 -eq 0 ] \
+                                       && __DATA=$(grep -m 1 -o "$IPV4_REGEX" $DATFILE) \
+                                       || __DATA=$(grep -m 1 -o "$IPV6_REGEX" $DATFILE)
+                               [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected on web at '$__URL'"
+                               ;;
+                       *)
+                               write_log 12 "Error in 'get_local_ip()' - unhandled ip_source '$ip_source'"
+                               ;;
+               esac
+               # valid data found return here
+               [ -n "$__DATA" ] && {
+                       eval "$1=\"$__DATA\""
+                       return 0
+               }
 
-       # if NO IP was found
-       [ -z "$__IP" ] && return 1
+               [ $LUCI_HELPER ] && return 1    # no retry if called by LuCI helper script
 
-       eval "$1='$__IP'"
-       return 0
+               write_log 7 "Data detected:\n$(cat $DATFILE)"
+
+               [ $VERBOSE_MODE -gt 1 ] && {
+                       # VERBOSE_MODE > 1 then NO retry
+                       write_log 4 "Get local IP via '$ip_source' failed - Verbose Mode: $VERBOSE_MODE - NO retry on error"
+                       return 1
+               }
+
+               __CNT=$(( $__CNT + 1 )) # increment error counter
+               # if error count > retry_count leave here
+               [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \
+                       write_log 14 "Get local IP via '$ip_source' failed after $retry_count retries"
+               write_log 4 "Get local IP via '$ip_source' failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds"
+               sleep $RETRY_SECONDS &
+               PID_SLEEP=$!
+               wait $PID_SLEEP # enable trap-handler
+               PID_SLEEP=0
+       done
+       # we should never come here there must be a programming error
+       write_log 12 "Error in 'get_local_ip()' - program coding error"
 }
 
 get_registered_ip() {
        # $1    Name of Variable to store public IP (REGISTERED_IP)
-       local __IP  __REGEX  __PROG  __RUNPROG  __ERRPROG  __ERR
+       # $2    (optional) if set, do not retry on error
+       local __CNT=0   # error counter
+       local __ERR=255
+       local __REGEX  __PROG  __RUNPROG  __DATA
        # return codes
        # 1     no IP detected
 
+       [ $# -lt 1 -o $# -gt 2 ] && write_log 12 "Error calling 'get_registered_ip()' - wrong number of parameters"
+       write_log 7 "Detect registered/public IP"
+
        # set correct regular expression
        [ $use_ipv6 -eq 0 ] && __REGEX="$IPV4_REGEX" || __REGEX="$IPV6_REGEX"
 
-       if [ -x /usr/bin/host ]; then           # otherwise try to use BIND host
+       if [ -x /usr/bin/host ]; then
                __PROG="/usr/bin/host"
                [ $use_ipv6 -eq 0 ] && __PROG="$__PROG -t A"  || __PROG="$__PROG -t AAAA"
                if [ $force_ipversion -eq 1 ]; then                     # force IP version
                        [ $use_ipv6 -eq 0 ] && __PROG="$__PROG -4"  || __PROG="$__PROG -6"
-               fi                      
+               fi
                [ $force_dnstcp -eq 1 ] && __PROG="$__PROG -T"  # force TCP
 
-               __RUNPROG="$__PROG $domain $dns_server 2>/dev/null"
-               __ERRPROG="$__PROG -v $domain $dns_server 2>&1"
-               verbose_echo " resolver prog =: $__RUNPROG"
-               __IP=$(eval $__RUNPROG)
-               __ERR=$?
-               # command error
-               [ $__ERR -gt 0 ] && {
-                       verbose_echo "\n!!!!!!!!! ERROR =: BIND host Error '$__ERR'\n$(eval $__ERRPROG)\n"
-                       syslog_err "DNS Resolver Error - BIND host Error: '$__ERR'"
-                       return 1
-               } || {
-                       # we need to run twice because multi-line output needs to be directly piped to grep because
-                       # pipe returns return code of last prog in pipe but we need errors from host command
-                       __IP=$(eval $__RUNPROG | awk -F "address " '/has/ {print $2; exit}' )
-               }
-
+               __RUNPROG="$__PROG $domain $dns_server >$DATFILE 2>$ERRFILE"
+               __PROG="BIND host"
        elif [ -x /usr/bin/nslookup ]; then     # last use BusyBox nslookup
                [ $force_ipversion -ne 0 -o $force_dnstcp -ne 0 ] && \
-                       critical_error "nslookup - no support to 'force IP Version' or 'DNS over TCP'"
+                       write_log 14 "Busybox nslookup - no support to 'force IP Version' or 'DNS over TCP'"
 
-               __RUNPROG="nslookup $domain $dns_server 2>/dev/null"
-               __ERRPROG="nslookup $domain $dns_server 2>&1"
-               verbose_echo " resolver prog =: $__RUNPROG"
-               __IP=$(eval $__RUNPROG)
-               __ERR=$?
-               # command error
-               [ $__ERR -gt 0 ] && {
-                       verbose_echo "\n!!!!!!!!! ERROR =: BusyBox nslookup Error '$__ERR'\n$(eval $__ERRPROG)\n"
-                       syslog_err "DNS Resolver Error - BusyBox nslookup Error: '$__ERR'"
-                       return 1
-               } || {
-                       # we need to run twice because multi-line output needs to be directly piped to grep because
-                       # pipe returns return code of last prog in pipe but we need errors from nslookup command
-                       __IP=$(eval $__RUNPROG | sed -ne "3,\$ { s/^Address [0-9]*: \($__REGEX\).*$/\\1/p }" )
-               }
-
-       else                                    # there must be an error
-               critical_error "No program found to request public registered IP"
+               __RUNPROG="/usr/bin/nslookup $domain $dns_server >$DATFILE 2>$ERRFILE"
+               __PROG="BusyBox nslookup"
+       else    # there must be an error
+               write_log 12 "Error in 'get_registered_ip()' - no supported Name Server lookup software accessible"
        fi
 
-       verbose_echo "   resolved ip =: '$__IP'"
+       while : ; do
+               write_log 7 "#> $__RUNPROG"
+               eval $__RUNPROG
+               __ERR=$?
+               if [ $__ERR -ne 0 ]; then
+                       write_log 3 "$__PROG error: '$__ERR'"
+                       write_log 7 "$(cat $ERRFILE)"
+               else
+                       if [ "$__PROG" = "BIND host" ]; then
+                               __DATA=$(cat $DATFILE | awk -F "address " '/has/ {print $2; exit}' )
+                       else
+                               __DATA=$(cat $DATFILE | sed -ne "3,\$ { s/^Address [0-9]*: \($__REGEX\).*$/\\1/p }" )
+                       fi
+                       [ -n "$__DATA" ] && {
+                               write_log 7 "Registered IP '$__DATA' detected"
+                               eval "$1=\"$__DATA\""   # valid data found
+                               return 0                # leave here
+                       }
+                       write_log 4 "NO valid IP found"
+                       __ERR=127
+               fi
+
+               [ $LUCI_HELPER ] && return $__ERR       # no retry if called by LuCI helper script
+               [ -n "$2" ] && return $__ERR            # $2 is given -> no retry
+               [ $VERBOSE_MODE -gt 1 ] && {
+                       # VERBOSE_MODE > 1 then NO retry
+                       write_log 4 "Get registered/public IP for '$domain' failed - Verbose Mode: $VERBOSE_MODE - NO retry on error"
+                       return $__ERR
+               }
 
-       # if NO IP was found
-       [ -z "$__IP" ] && return 1
+               __CNT=$(( $__CNT + 1 )) # increment error counter
+               # if error count > retry_count leave here
+               [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \
+                       write_log 14 "Get registered/public IP for '$domain' failed after $retry_count retries"
 
-       eval "$1='$__IP'"
-       return 0
+               write_log 4 "Get registered/public IP for '$domain' failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds"
+               sleep $RETRY_SECONDS &
+               PID_SLEEP=$!
+               wait $PID_SLEEP # enable trap-handler
+               PID_SLEEP=0
+       done
+       # we should never come here there must be a programming error
+       write_log 12 "Error in 'get_registered_ip()' - program coding error"
 }
 
 get_uptime() {
        # $1    Variable to store result in
+       [ $# -ne 1 ] && write_log 12 "Error calling 'verify_host_port()' - wrong number of parameters"
        local __UPTIME=$(cat /proc/uptime)
-       eval "$1='${__UPTIME%%.*}'"
+       eval "$1=\"${__UPTIME%%.*}\""
+}
+
+trap_handler() {
+       # $1    trap signal
+       # $2    optional (exit status)
+       local __PIDS __PID
+       local __ERR=${2:-0}
+       local __OLD_IFS=$IFS
+       local __NEWLINE_IFS='
+' #__NEWLINE_IFS
+
+       [ $PID_SLEEP -ne 0 ] && kill -$1 $PID_SLEEP 2>/dev/null # kill pending sleep if exist
+
+       case $1 in
+                0)     if [ $__ERR -eq 0 ]; then
+                               write_log 5 "PID '$$' exit normal at $(eval $DATE_PROG)\n"
+                       else
+                               write_log 4 "PID '$$' exit WITH ERROR '$__ERR' at $(eval $DATE_PROG)\n"
+                       fi ;;
+                1)     write_log 6 "PID '$$' received 'SIGHUP' at $(eval $DATE_PROG)"
+                       # reload config via starting the script again 
+                       eval "/usr/lib/ddns/dynamic_dns_updater.sh $SECTION_ID $VERBOSE_MODE &"
+                       exit 0 ;;       # and leave this one
+                2)     write_log 5 "PID '$$' terminated by 'SIGINT' at $(eval $DATE_PROG)\n";;
+                3)     write_log 5 "PID '$$' terminated by 'SIGQUIT' at $(eval $DATE_PROG)\n";;
+               15)     write_log 5 "PID '$$' terminated by 'SIGTERM' at $(eval $DATE_PROG)\n";;
+                *)     write_log 13 "Unhandled signal '$1' in 'trap_handler()'";;
+       esac
+
+       __PIDS=$(pgrep -P $$)   # get my childs (pgrep prints with "newline")
+       IFS=$__NEWLINE_IFS
+       for __PID in $__PIDS; do
+               kill -$1 $__PID # terminate it
+       done
+       IFS=$__OLD_IFS
+
+       # remove out and err file
+       [ -f $DATFILE ] && rm -f $DATFILE
+       [ -f $ERRFILE ] && rm -f $ERRFILE
+
+       # exit with correct handling:
+       # remove trap handling settings and send kill to myself
+       trap - 0 1 2 3 15
+       [ $1 -gt 0 ] && kill -$1 $$
 }
diff --git a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_lucihelper.sh b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_lucihelper.sh
new file mode 100755 (executable)
index 0000000..c2abecd
--- /dev/null
@@ -0,0 +1,102 @@
+#!/bin/sh
+# /usr/lib/ddns/luci_dns_helper.sh
+#
+# Written in August 2014
+# by Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+# This script is used by luci-app-ddns
+# - getting registered IP
+# - check if possible to get local IP
+# - verifing given DNS- or Proxy-Server
+#
+# variables in small chars are read from /etc/config/ddns as parameter given here
+# variables in big chars are defined inside these scripts as gloval vars
+# variables in big chars beginning with "__" are local defined inside functions only
+# set -vx      #script debugger
+
+[ $# -lt 2 ] && exit 1
+
+. /usr/lib/ddns/dynamic_dns_functions.sh       # global vars are also defined here
+
+# set -vx      #script debugger
+
+# preset some variables, wrong or not set in dynamic_dns_functions.sh
+SECTION_ID="lucihelper"
+LOGFILE="$LOGDIR/$SECTION_ID.log"
+DATFILE="$RUNDIR/$SECTION_ID.dat"      # save stdout data of WGet and other extern programs called
+ERRFILE="$RUNDIR/$SECTION_ID.err"      # save stderr output of WGet and other extern programs called
+VERBOSE_MODE=0         # no console logging
+# global variables normally set by reading DDNS UCI configuration
+use_syslog=0           # no syslog
+use_logfile=0          # by default no logfile, can be changed here
+
+__RET=0
+case "$1" in
+       get_registered_ip)
+               local IP
+               domain=$2                       # Hostname/Domain
+               use_ipv6=${3:-"0"}              # Use IPv6 - default IPv4
+               force_ipversion=${4:-"0"}       # Force IP Version - default 0 - No
+               force_dnstcp=${5:-"0"}          # Force TCP on DNS - default 0 - No
+               dns_server=${6:-""}             # DNS server - default No DNS
+               write_log 7 "-----> get_registered_ip IP"
+               get_registered_ip IP
+               __RET=$?
+               [ $__RET -ne 0 ] && IP=""
+               echo -n "$IP"                   # suppress LF
+               ;;
+       verify_dns)
+               # $2 : dns-server to verify     # no need for force_dnstcp because
+                                               # verify with nc (netcat) uses tcp anyway
+               use_ipv6=${3:-"0"}              # Use IPv6 - default IPv4
+               force_ipversion=${4:-"0"}       # Force IP Version - default 0 - No
+               write_log 7 "-----> verify_dns '$2'"
+               verify_dns "$2"
+               __RET=$?
+               ;;
+       verify_proxy)
+               # $2 : proxy string to verify
+               use_ipv6=${3:-"0"}              # Use IPv6 - default IPv4
+               force_ipversion=${4:-"0"}       # Force IP Version - default 0 - No
+               write_log 7 "-----> verify_proxy '$2'"
+               verify_proxy "$2"
+               __RET=$?
+               ;;
+       get_local_ip)
+               local IP
+               use_ipv6="$2"                   # Use IPv6
+               ip_source="$3"                  # IP source
+               ip_network="$4"                 # set if source = "network" otherwise "-"
+               ip_url="$5"                     # set if source = "web" otherwise "-"
+               ip_interface="$6"               # set if source = "interface" itherwiase "-"
+               ip_script="$7"                  # set if source = "script" otherwise "-"
+               proxy="$8"                      # proxy if set
+               force_ipversion="0"             # not needed but must be set
+               use_https="0"                   # not needed but must be set
+               [ -n "$proxy" -a "$ip_source" = "web" ] && {
+                       # proxy defined, used for ip_source=web
+                       export HTTP_PROXY="http://$proxy"
+                       export HTTPS_PROXY="http://$proxy"
+                       export http_proxy="http://$proxy"
+                       export https_proxy="http://$proxy"
+               }
+               # don't need IP only the return code
+               [ "$ip_source" = "web" -o  "$ip_source" = "script" ] && {
+                       # we wait only 3 seconds for an
+                       # answer from "web" or "script"
+                       write_log 7 "-----> timeout 3 -- get_local_ip IP"
+                       timeout 3 -- get_local_ip IP
+               } || {
+                       write_log 7 "-----> get_local_ip IP"
+                       get_local_ip IP
+               }
+               __RET=$?
+               ;;
+       *)
+               __RET=255
+               ;;
+esac
+
+# remove out and err file
+[ -f $DATFILE ] && rm -f $DATFILE
+[ -f $ERRFILE ] && rm -f $ERRFILE
+return $__RET
\ No newline at end of file
index 6c715cb49c747a2049e5678212049f56cf8a01dc..495c5969456597a069f6baa9ca19b3d00d66359a 100755 (executable)
@@ -6,15 +6,16 @@
 # (Loosely) based on the script on the one posted by exobyte in the forums here:
 # http://forum.openwrt.org/viewtopic.php?id=14040
 #
-# extended and partial rewritten in August 2014 
+# extended and partial rewritten in August 2014
 # by Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
 # to support:
 # - IPv6 DDNS services
-# - DNS Server to retrieve registered IP including TCP transport
+# - DNS Server to retrieve registered IP including TCP transport (Ticket 7820)
 # - Proxy Server to send out updates
-# - force_interval=0 to run once
+# - force_interval=0 to run once (Luci Ticket 538)
 # - the usage of BIND's host command instead of BusyBox's nslookup if installed
-# - extended Verbose Mode and log file support for better error detection 
+# - extended Verbose Mode and log file support for better error detection
+# - wait for interface to fully come up, before the first update is done
 #
 # variables in small chars are read from /etc/config/ddns
 # variables in big chars are defined inside these scripts as global vars
 . /usr/lib/ddns/dynamic_dns_functions.sh       # global vars are also defined here
 
 SECTION_ID="$1"
-VERBOSE_MODE=${2:-1}   #default mode is log to console
+VERBOSE_MODE=${2:-1}   # default mode is log to console
 
 # set file names
 PIDFILE="$RUNDIR/$SECTION_ID.pid"      # Process ID file
 UPDFILE="$RUNDIR/$SECTION_ID.update"   # last update successful send (system uptime)
+DATFILE="$RUNDIR/$SECTION_ID.dat"      # save stdout data of WGet and other extern programs called
+ERRFILE="$RUNDIR/$SECTION_ID.err"      # save stderr output of WGet and other extern programs called
 LOGFILE="$LOGDIR/$SECTION_ID.log"      # log file
 
 # VERBOSE_MODE > 1 delete logfile if exist to create an empty one
 # only with this data of this run for easier diagnostic
-# new one created by verbose_echo function
+# new one created by write_log function
 [ $VERBOSE_MODE -gt 1 -a -f $LOGFILE ] && rm -f $LOGFILE
 
+# TRAP handler
+trap "trap_handler 0 \$?" 0    # handle script exit with exit status
+trap "trap_handler 1"  1       # SIGHUP        Hangup / reload config
+trap "trap_handler 2"  2       # SIGINT        Terminal interrupt
+trap "trap_handler 3"  3       # SIGQUIT       Terminal quit
+#trap "trap_handler 9"  9      # SIGKILL       no chance to trap
+trap "trap_handler 15" 15      # SIGTERM       Termination
+
 ################################################################################
 # Leave this comment here, to clearly document variable names that are expected/possible
 # Use load_all_config_options to load config options, which is a much more flexible solution.
 #
 # config_load "ddns"
-# config_get <variable> $SECTION_ID <option]>
+# config_get <variable> $SECTION_ID <option>
 #
 # defined options (also used as variable):
-# 
+#
 # enable       self-explanatory
 # interface    network interface used by hotplug.d i.e. 'wan' or 'wan6'
 #
@@ -79,9 +90,9 @@ LOGFILE="$LOGDIR/$SECTION_ID.log"     # log file
 # ip_network   local defined network to read IP from i.e. 'wan' or 'wan6'
 # ip_url       URL to read local address from i.e. http://checkip.dyndns.com/ or http://checkipv6.dyndns.com/
 # ip_script    full path and name of your script to detect local IP
-# ip_interface physical interface to use for detecting 
+# ip_interface physical interface to use for detecting
 #
-# check_interval       check for changes every  !!! checks below 10 minutes make no sense because the Internet 
+# check_interval       check for changes every  !!! checks below 10 minutes make no sense because the Internet
 # check_unit           'days' 'hours' 'minutes' !!! needs about 5-10 minutes to sync an IP-change for an DNS entry
 #
 # force_interval       force to send an update to your service if no change was detected
@@ -89,16 +100,16 @@ LOGFILE="$LOGDIR/$SECTION_ID.log"  # log file
 #
 # retry_interval       if error was detected retry in
 # retry_unit           'days' 'hours' 'minutes' 'seconds'
-# retry_count          #NEW# number of retries before scripts stops
+# retry_count          number of retries before scripts stops
 #
-# use_ipv6             #NEW# detecting/sending IPv6 address
-# force_ipversion      #NEW# force usage of IPv4 or IPv6 for the whole detection and update communication
-# dns_server           #NEW# using a non default dns server to get Registered IP from Internet
-# force_dnstcp         #NEW# force communication with DNS server via TCP instead of default UDP
-# proxy                        #NEW# using a proxy for communication !!! ALSO used to detect local IP via web => return proxy's IP !!!
-# use_logfile          #NEW# self-explanatory "/var/log/ddns/$SECTION_ID.log"
+# use_ipv6             detecting/sending IPv6 address
+# force_ipversion      force usage of IPv4 or IPv6 for the whole detection and update communication
+# dns_server           using a non default dns server to get Registered IP from Internet
+# force_dnstcp         force communication with DNS server via TCP instead of default UDP
+# proxy                        using a proxy for communication !!! ALSO used to detect local IP via web => return proxy's IP !!!
+# use_logfile          self-explanatory "/var/log/ddns/$SECTION_ID.log"
 #
-# some functionality needs 
+# some functionality needs
 # - GNU Wget or cURL installed for sending updates to DDNS service
 # - BIND host installed to detect Registered IP
 #
@@ -108,33 +119,33 @@ LOGFILE="$LOGDIR/$SECTION_ID.log" # log file
 [ "$(uci_get ddns $SECTION_ID)" != "service" ] && {
        [ $VERBOSE_MODE -le 1 ] && VERBOSE_MODE=2       # force console out and logfile output
        [ -f $LOGFILE ] && rm -f $LOGFILE               # clear logfile before first entry
-       verbose_echo "\n ************** =: ************** ************** **************"
-       verbose_echo "       STARTED =: PID '$$' at $(eval $DATE_PROG)"
-       verbose_echo "    UCI CONFIG =:\n$(uci -q show ddns | grep '=service' | sort)"
-       critical_error "Service '$SECTION_ID' not defined"
+       write_log  7 "************ ************** ************** **************"
+       write_log  5 "PID '$$' started at $(eval $DATE_PROG)"
+       write_log  7 "uci configuration:\n$(uci -q show ddns | grep '=service' | sort)"
+       write_log 14 "Service section '$SECTION_ID' not defined"
 }
 load_all_config_options "ddns" "$SECTION_ID"
 
-verbose_echo "\n ************** =: ************** ************** **************"
-verbose_echo "       STARTED =: PID '$$' at $(eval $DATE_PROG)"
+write_log 7 "************ ************** ************** **************"
+write_log 5 "PID '$$' started at $(eval $DATE_PROG)"
+write_log 7 "uci configuraion:\n$(uci -q show ddns.$SECTION_ID | sort)"
 case $VERBOSE_MODE in
-       0) verbose_echo "  verbose mode =: '0' - run normal, NO console output";;
-       1) verbose_echo "  verbose mode =: '1' - run normal, console mode";;
-       2) verbose_echo "  verbose mode =: '2' - run once, NO retry on error";;
-       3) verbose_echo "  verbose mode =: '3' - run once, NO retry on error, NOT sending update";;
-       *) critical_error "ERROR detecting VERBOSE_MODE '$VERBOSE_MODE'"
+       0) write_log  7 "verbose mode  : 0 - run normal, NO console output";;
+       1) write_log  7 "verbose mode  : 1 - run normal, console mode";;
+       2) write_log  7 "verbose mode  : 2 - run once, NO retry on error";;
+       3) write_log  7 "verbose mode  : 3 - run once, NO retry on error, NOT sending update";;
+       *) write_log 14 "error detecting VERBOSE_MODE '$VERBOSE_MODE'";;
 esac
-verbose_echo "    UCI CONFIG =:\n$(uci -q show ddns.$SECTION_ID | sort)"
 
 # set defaults if not defined
 [ -z "$enabled" ]        && enabled=0
 [ -z "$retry_count" ]    && retry_count=5
-[ -z "$use_syslog" ]      && use_syslog=0      # not use syslog
+[ -z "$use_syslog" ]      && use_syslog=2      # syslog "Notice"
 [ -z "$use_https" ]       && use_https=0       # not use https
-[ -z "$use_logfile" ]     && use_logfile=1     # NEW - use logfile by default
-[ -z "$use_ipv6" ]       && use_ipv6=0         # NEW - use IPv4 by default
-[ -z "$force_ipversion" ] && force_ipversion=0 # NEW - default let system decide
-[ -z "$force_dnstcp" ]   && force_dnstcp=0     # NEW - default UDP
+[ -z "$use_logfile" ]     && use_logfile=1     # use logfile by default
+[ -z "$use_ipv6" ]       && use_ipv6=0         # use IPv4 by default
+[ -z "$force_ipversion" ] && force_ipversion=0 # default let system decide
+[ -z "$force_dnstcp" ]   && force_dnstcp=0     # default UDP
 [ -z "$ip_source" ]      && ip_source="network"
 [ "$ip_source" = "network" -a -z "$ip_network" -a $use_ipv6 -eq 0 ] && ip_network="wan"  # IPv4: default wan
 [ "$ip_source" = "network" -a -z "$ip_network" -a $use_ipv6 -eq 1 ] && ip_network="wan6" # IPv6: default wan6
@@ -142,56 +153,49 @@ verbose_echo "    UCI CONFIG =:\n$(uci -q show ddns.$SECTION_ID | sort)"
 [ "$ip_source" = "web" -a -z "$ip_url" -a $use_ipv6 -eq 1 ] && ip_url="http://checkipv6.dyndns.com"
 [ "$ip_source" = "interface" -a -z "$ip_interface" ] && ip_interface="eth1"
 
-# check configuration and enabled state
-[ -z "$domain" -o -z "$username" -o -z "$password" ] && critical_error "Service Configuration not correctly configured"
-[ $enabled -eq 0 ] && critical_error "Service Configuration is disabled"
+# check enabled state otherwise we don't need to continue
+[ $enabled -eq 0 ] && write_log 14 "Service section disabled!"
 
-# verify script if configured and executable
+# without domain or username or password we can do nothing for you
+[ -z "$domain" -o -z "$username" -o -z "$password" ] && write_log 14 "Service section not correctly configured!"
+urlencode URL_USER "$username" # encode username, might be email or something like this
+urlencode URL_PASS "$password" # encode password, might have special chars for security reason
+
+# verify ip_source script if configured and executable
 if [ "$ip_source" = "script" ]; then
-       [ -z "$ip_script" ] && critical_error "No script defined to detect local IP"
-       [ -x "$ip_script" ] || critical_error "Script to detect local IP not found or not executable"
+       set -- $ip_script       #handling script with parameters, we need a trick
+       [ -z "$1" ] && write_log 14 "No script defined to detect local IP!"
+       [ -x "$1" ] || write_log 14 "Script to detect local IP not executable!"
 fi
 
 # compute update interval in seconds
 get_seconds CHECK_SECONDS ${check_interval:-10} ${check_unit:-"minutes"} # default 10 min
 get_seconds FORCE_SECONDS ${force_interval:-72} ${force_unit:-"hours"}  # default 3 days
 get_seconds RETRY_SECONDS ${retry_interval:-60} ${retry_unit:-"seconds"} # default 60 sec
-verbose_echo "check interval =: $CHECK_SECONDS seconds"
-verbose_echo "force interval =: $FORCE_SECONDS seconds"
-verbose_echo "retry interval =: $RETRY_SECONDS seconds"
-verbose_echo " retry counter =: $retry_count times"
+[ $CHECK_SECONDS -lt 300 ] && CHECK_SECONDS=300                # minimum 5 minutes
+[ $FORCE_SECONDS -gt 0 -a $FORCE_SECONDS -lt $CHECK_SECONDS ] && FORCE_SECONDS=$CHECK_SECONDS  # FORCE_SECONDS >= CHECK_SECONDS or 0
+write_log 7 "check interval: $CHECK_SECONDS seconds"
+write_log 7 "force interval: $FORCE_SECONDS seconds"
+write_log 7 "retry interval: $RETRY_SECONDS seconds"
+write_log 7 "retry counter : $retry_count times"
 
 # determine what update url we're using if a service_name is supplied
-# otherwise update_url is set inside configuration (custom service)
+# otherwise update_url is set inside configuration (custom update url)
 # or update_script is set inside configuration (custom update script)
 [ -n "$service_name" ] && get_service_data update_url update_script
-[ -z "$update_url" -a -z "$update_script" ] && critical_error "no update_url found/defined or no update_script found/defined"
-[ -n "$update_script" -a ! -f "$update_script" ] && critical_error "custom update_script not found"
+[ -z "$update_url" -a -z "$update_script" ] && write_log 14 "No update_url found/defined or no update_script found/defined!"
+[ -n "$update_script" -a ! -f "$update_script" ] && write_log 14 "Custom update_script not found!"
 
 #kill old process if it exists & set new pid file
-if [ -d $RUNDIR ]; then
-       #if process is already running, stop it
-       if [ -e "$PIDFILE" ]; then
-               OLD_PID=$(cat $PIDFILE)
-               ps | grep -q "^[\t ]*$OLD_PID" && {
-                       verbose_echo "   old process =: PID '$OLD_PID'"
-                       kill $OLD_PID
-               } || verbose_echo "old process id =: PID 'none'"
-       else
-               verbose_echo "old process id =: PID 'none'"
-       fi
-else
-       #make dir since it doesn't exist
-       mkdir -p $RUNDIR
-       verbose_echo "old process id =: PID 'none'"
-fi
+stop_section_processes "$SECTION_ID"
+[ $? -gt 0 ] && write_log 7 "Send 'SIGTERM' to old process" || write_log 7 "No old process"
 echo $$ > $PIDFILE
 
 # determine when the last update was
-# the following lines should prevent multiple updates if hotplug fires multiple startups 
+# the following lines should prevent multiple updates if hotplug fires multiple startups
 # as described in Ticket #7820, but did not function if never an update take place
 # i.e. after a reboot (/var is linked to /tmp)
-# using uptime as reference because date might not be updated via NTP client 
+# using uptime as reference because date might not be updated via NTP client
 get_uptime CURR_TIME
 [ -e "$UPDFILE" ] && {
        LAST_TIME=$(cat $UPDFILE)
@@ -201,242 +205,122 @@ get_uptime CURR_TIME
        [ $LAST_TIME -gt $CURR_TIME ] && LAST_TIME=0
 }
 if [ $LAST_TIME -eq 0 ]; then
-       verbose_echo "   last update =: never"
+       write_log 7 "last update: never"
 else
        EPOCH_TIME=$(( $(date +%s) - CURR_TIME + LAST_TIME ))
        EPOCH_TIME="date -d @$EPOCH_TIME +'$DATE_FORMAT'"
-       verbose_echo "   last update =: $(eval $EPOCH_TIME)"
+       write_log 7 "last update: $(eval $EPOCH_TIME)"
 fi
 
 # we need time here because hotplug.d is fired by netifd
 # but IP addresses are not set by DHCP/DHCPv6 etc.
-verbose_echo "       waiting =: 10 seconds for interfaces to fully come up"
-sleep 10
-
-# verify DNS server: 
-# do with retry's because there might be configurations
-# not directly could connect to outside dns when interface is already up
-ERR_VERIFY=0   # reset err counter
-while [ -n "$dns_server" ]; do
-       [ $ERR_VERIFY -eq 0 ] && verbose_echo "******* VERIFY =: DNS server '$dns_server'"
-       verify_dns "$dns_server"
-       ERR_LAST=$?                     # save return value
-       [ $ERR_LAST -eq 0 ] && break    # everything ok leave while loop
-       ERR_VERIFY=$(( $ERR_VERIFY + 1 ))
-       # if error count > retry_count leave here with critical error
-       [ $ERR_VERIFY -gt $retry_count ] && {
-               case $ERR_LAST in
-                       2)      critical_error "Invalid DNS server Error: '2' - nslookup can not resolve host";;
-                       3)      critical_error "Invalid DNS server Error: '3' - nc (netcat) can not connect";;
-                       *)      critical_error "Invalid DNS server Error: '$ERR_LAST' - unspecific error";;
-               esac
-       }
-       case $ERR_LAST in
-               2)      syslog_err "Invalid DNS server Error: '2' - nslookup can not resolve host - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds\n";;
-               3)      syslog_err "Invalid DNS server Error: '3' - nc (netcat) can not connect - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds\n";;
-               *)      syslog_err "Invalid DNS server Error: '$ERR_LAST' - unspecific error - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds\n";;
-       esac
-       [ $VERBOSE_MODE -gt 1 ] && {
-               # VERBOSE_MODE > 1 then NO retry
-               verbose_echo "\n!!!!!!!!! ERROR =: Verbose Mode - NO retry\n"
-               break
-       }
-       verbose_echo "******** RETRY =: DNS server '$dns_server' - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds"
-       sleep $RETRY_SECONDS
-done
+write_log 7 "Waiting 10 seconds for interfaces to fully come up"
+sleep 10 &
+PID_SLEEP=$!
+wait $PID_SLEEP        # enable trap-handler
+PID_SLEEP=0
+
+# verify DNS server
+[ -n "$dns_server" ] && verify_dns "$dns_server"
 
 # verify Proxy server and set environment
-# do with retry's because there might be configurations
-# not directly could connect to outside dns when interface is already up
-ERR_VERIFY=0   # reset err counter
 [ -n "$proxy" ] && {
-       [ $ERR_VERIFY -eq 0 ] && verbose_echo "******* VERIFY =: Proxy server 'http://$proxy'"
-       verify_proxy "$proxy"
-       ERR_LAST=$?                     # save return value
-       [ $ERR_LAST -eq 0 ] && {
-               # everything ok set proxy and leave while loop
+       verify_proxy "$proxy" && {
+               # everything ok set proxy
                export HTTP_PROXY="http://$proxy"
                export HTTPS_PROXY="http://$proxy"
                export http_proxy="http://$proxy"
                export https_proxy="http://$proxy"
-               break
-       }
-       ERR_VERIFY=$(( $ERR_VERIFY + 1 ))
-       # if error count > retry_count leave here with critical error
-       [ $ERR_VERIFY -gt $retry_count ] && {
-               case $ERR_LAST in
-                       2)      critical_error "Invalid Proxy server Error '2' - nslookup can not resolve host";;
-                       3)      critical_error "Invalid Proxy server Error '3' - nc (netcat) can not connect";;
-                       *)      critical_error "Invalid Proxy server Error '$ERR_LAST' - unspecific error";;
-               esac
        }
-       case $ERR_LAST in
-               2)      syslog_err "Invalid Proxy server Error '2' - nslookup can not resolve host - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds\n";;
-               3)      syslog_err "Invalid Proxy server Error '3' - nc (netcat) can not connect - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds\n";;
-               *)      syslog_err "Invalid Proxy server Error '$ERR_LAST' - unspecific error - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds\n";;
-       esac
-       [ $VERBOSE_MODE -gt 1 ] && {
-               # VERBOSE_MODE > 1 then NO retry
-               verbose_echo "\n!!!!!!!!! ERROR =: Verbose Mode - NO retry\n"
-               break
-       }
-       verbose_echo "******** RETRY =: Proxy server 'http://$proxy' - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds"
-       sleep $RETRY_SECONDS
 }
 
 # let's check if there is already an IP registered at the web
 # but ignore errors if not
-verbose_echo "******* DETECT =: Registered IP"
-get_registered_ip REGISTERED_IP
+get_registered_ip REGISTERED_IP "NO_RETRY"
 
 # loop endlessly, checking ip every check_interval and forcing an updating once every force_interval
-# NEW: ### Luci Ticket 538
-# a "force_interval" of "0" will run this script only once
-# the update is only done once when an interface goes up
-# or you run /etc/init.d/ddns start or you can use a cron job
-# it will force an update without check when lastupdate happen
-# but it will verify after "check_interval" if update is seen in the web 
-# and retries on error retry_count times
-# CHANGES: ### Ticket 16363
-# modified nslookup / sed / grep to detect registered ip
-# NEW: ### Ticket 7820
-# modified nslookup to support non standard dns_server (needs to be defined in /etc/config/ddns)
-# support for BIND host command.
-# Wait for interface to fully come up, before the first update is done
-verbose_echo "*** START LOOP =: $(eval $DATE_PROG)"
-# we run NOT once
-[ $FORCE_SECONDS -gt 0 -o $VERBOSE_MODE -le 1 ] && syslog_info "Starting main loop"
-
+write_log 6 "Starting main loop at $(eval $DATE_PROG)"
 while : ; do
 
-       # read local IP
-       verbose_echo "******* DETECT =: Local IP"
-       get_local_ip LOCAL_IP
-       ERR_LAST=$?     # save return value
-       # Error in function
-       [ $ERR_LAST -gt 0 ] && {
-               if [ $VERBOSE_MODE -le 1 ]; then        # VERBOSE_MODE <= 1 then retry
-                       # we can't read local IP
-                       ERR_LOCAL_IP=$(( $ERR_LOCAL_IP + 1 ))
-                       [ $ERR_LOCAL_IP -gt $retry_count ] && critical_error "Can not detect local IP"
-                       verbose_echo "\n!!!!!!!!! ERROR =: detecting local IP - retry $ERR_LOCAL_IP/$retry_count in $RETRY_SECONDS seconds\n"
-                       syslog_err "Error detecting local IP - retry $ERR_LOCAL_IP/$retry_count in $RETRY_SECONDS seconds"
-                       sleep $RETRY_SECONDS
-                       continue        # jump back to the beginning of while loop
-               else
-                       verbose_echo "\n!!!!!!!!! ERROR =: detecting local IP - NO retry\n"
-               fi
-       }
-       ERR_LOCAL_IP=0  # reset err counter
+       get_local_ip LOCAL_IP           # read local IP
 
        # prepare update
-       # never updated or forced immediate then NEXT_TIME = 0 
+       # never updated or forced immediate then NEXT_TIME = 0
        [ $FORCE_SECONDS -eq 0 -o $LAST_TIME -eq 0 ] \
                && NEXT_TIME=0 \
                || NEXT_TIME=$(( $LAST_TIME + $FORCE_SECONDS ))
-       # get current uptime
-       get_uptime CURR_TIME
-       
-       # send update when current time > next time or local ip different from registered ip (as loop on error)
-       ERR_SEND=0
-       while [ $CURR_TIME -ge $NEXT_TIME -o "$LOCAL_IP" != "$REGISTERED_IP" ]; do
+
+       get_uptime CURR_TIME            # get current uptime
+
+       # send update when current time > next time or local ip different from registered ip
+       if [ $CURR_TIME -ge $NEXT_TIME -o "$LOCAL_IP" != "$REGISTERED_IP" ]; then
                if [ $VERBOSE_MODE -gt 2 ]; then
-                       verbose_echo "  VERBOSE MODE =: NO UPDATE send to DDNS provider"
+                       write_log 7 "Verbose Mode: $VERBOSE_MODE - NO UPDATE send"
                elif [ "$LOCAL_IP" != "$REGISTERED_IP" ]; then
-                       verbose_echo "******* UPDATE =: LOCAL: '$LOCAL_IP' <> REGISTERED: '$REGISTERED_IP'"
+                       write_log 7 "Update needed - L: '$LOCAL_IP' <> R: '$REGISTERED_IP'"
                else
-                       verbose_echo "******* FORCED =: LOCAL: '$LOCAL_IP' == REGISTERED: '$REGISTERED_IP'"
+                       write_log 7 "Forced Update - L: '$LOCAL_IP' == R: '$REGISTERED_IP'"
                fi
-               # only send if VERBOSE_MODE < 3
+
                ERR_LAST=0
                [ $VERBOSE_MODE -lt 3 ] && {
-                       send_update "$LOCAL_IP" 
+                       # only send if VERBOSE_MODE < 3
+                       send_update "$LOCAL_IP"
                        ERR_LAST=$?     # save return value
                }
 
-               # Error in function 
-               if [ $ERR_LAST -gt 0 ]; then
-                       if [ $VERBOSE_MODE -le 1 ]; then        # VERBOSE_MODE <=1 then retry
-                               # error sending local IP
-                               ERR_SEND=$(( $ERR_SEND + 1 ))
-                               [ $ERR_SEND -gt $retry_count ] && critical_error "can not send update to DDNS Provider"
-                               verbose_echo "\n!!!!!!!!! ERROR =: sending update - retry $ERR_SEND/$retry_count in $RETRY_SECONDS seconds\n"
-                               syslog_err "Error sending update - retry $ERR_SEND/$retry_count in $RETRY_SECONDS seconds"
-                               sleep $RETRY_SECONDS
-                               continue # re-loop
-                       else
-                               verbose_echo "\n!!!!!!!!! ERROR =: sending update to DDNS service - NO retry\n"
-                               break
-                       fi
-               else
-                       # we send data so save "last time"
-                       get_uptime LAST_TIME
+               # error sending local IP to provider
+               # we have no communication error (handled inside send_update/do_transfer)
+               # but update was not recognized
+               # do NOT retry after RETRY_SECONDS, do retry after CHECK_SECONDS
+               # to early retrys will block most DDNS provider
+               # providers answer is checked inside send_update() function
+               if [ $ERR_LAST -eq 0 ]; then
+                       get_uptime LAST_TIME            # we send update, so
                        echo $LAST_TIME > $UPDFILE      # save LASTTIME to file
-                       [ "$LOCAL_IP" != "$REGISTERED_IP" ] \
-                               && syslog_notice "Changed IP: '$LOCAL_IP' successfully send" \
-                               || syslog_notice "Forced Update: IP: '$LOCAL_IP' successfully send"
-                       break # leave while
+                       [ "$LOCAL_IP" != "$REGISTERED_IP" ] && write_log 6 "Update successful - IP '$LOCAL_IP' send"
+                       [ "$LOCAL_IP" = "$REGISTERED_IP" ]  || write_log 6 "Forced update successful - IP: '$LOCAL_IP' send"
+               else
+                       write_log 3 "Can not update IP at DDNS Provider"
                fi
-       done
+       fi
 
        # now we wait for check interval before testing if update was recognized
-       # only sleep if VERBOSE_MODE <= 2 because nothing send so do not wait
+       # only sleep if VERBOSE_MODE <= 2 because otherwise nothing was send
        [ $VERBOSE_MODE -le 2 ] && {
-               verbose_echo "****** WAITING =: $CHECK_SECONDS seconds (Check Interval) before continue"
-               sleep $CHECK_SECONDS
-       } || verbose_echo "  VERBOSE MODE =: NO WAITING for Check Interval\n"
-
-       # read at DDNS service registered IP (in loop on error)
-       REGISTERED_IP=""
-       ERR_REG_IP=0
-       while : ; do
-               verbose_echo "******* DETECT =: Registered IP"
-               get_registered_ip REGISTERED_IP
-               ERR_LAST=$?     # save return value
-
-               # No Error in function we leave while loop
-               [ $ERR_LAST -eq 0  ] && break
-
-               # we can't read Registered IP
-               if [ $VERBOSE_MODE -le 1 ]; then        # VERBOSE_MODE <=1 then retry
-                       ERR_REG_IP=$(( $ERR_REG_IP + 1 ))
-                       [ $ERR_REG_IP -gt $retry_count ] && critical_error "can not detect registered local IP"
-                       verbose_echo "\n!!!!!!!!! ERROR =: detecting Registered IP - retry $ERR_REG_IP/$retry_count in $RETRY_SECONDS seconds\n"
-                       syslog_err "Error detecting Registered IP - retry $ERR_REG_IP/$retry_count in $RETRY_SECONDS seconds"
-                       sleep $RETRY_SECONDS
-               else
-                       verbose_echo "\n!!!!!!!!! ERROR =: detecting Registered IP - NO retry\n"
-                       break   # leave while loop
-               fi
-       done
+               write_log 7 "Waiting $CHECK_SECONDS seconds (Check Interval)"
+               sleep $CHECK_SECONDS &
+               PID_SLEEP=$!
+               wait $PID_SLEEP # enable trap-handler
+               PID_SLEEP=0
+       } || write_log 7 "Verbose Mode: $VERBOSE_MODE - NO Check Interval waiting"
+
+       REGISTERED_IP=""                # clear variable
+       get_registered_ip REGISTERED_IP # get registered/public IP
 
        # IP's are still different
        if [ "$LOCAL_IP" != "$REGISTERED_IP" ]; then
                if [ $VERBOSE_MODE -le 1 ]; then        # VERBOSE_MODE <=1 then retry
                        ERR_UPDATE=$(( $ERR_UPDATE + 1 ))
-                       [ $ERR_UPDATE -gt $retry_count ] && critical_error "Registered IP <> Local IP - LocalIP: '$LOCAL_IP' - RegisteredIP: '$REGISTERED_IP'"
-                       verbose_echo "\n!!!!!!!!! ERROR =: Registered IP <> Local IP - starting retry $ERR_UPDATE/$retry_count\n"
-                       syslog_warn "Warning: Registered IP <> Local IP - starting retry $ERR_UPDATE/$retry_count"
+                       [ $retry_count -gt 0 -a $ERR_UPDATE -gt $retry_count ] && \
+                               write_log 14 "Updating IP at DDNS provider failed after $retry_count retries"
+                       write_log 4 "Updating IP at DDNS provider failed - starting retry $ERR_UPDATE/$retry_count"
                        continue # loop to beginning
                else
-                       verbose_echo "\n!!!!!!!!! ERROR =: Registered IP <> Local IP - LocalIP: '$LOCAL_IP' - RegisteredIP: '$REGISTERED_IP' - NO retry\n"
+                       write_log 4 "Updating IP at DDNS provider failed"
+                       write_log 7 "Verbose Mode: $VERBOSE_MODE - NO retry"; exit 1
                fi
-       fi              
+       else
+               # we checked successful the last update
+               ERR_UPDATE=0                    # reset error counter
+       fi
 
-       # we checked successful the last update
-       ERR_UPDATE=0                    # reset error counter
+       # force_update=0 or VERBOSE_MODE > 1 - leave here
+       [ $VERBOSE_MODE -gt 1 ]  && write_log 7 "Verbose Mode: $VERBOSE_MODE - NO reloop"
+       [ $FORCE_SECONDS -eq 0 ] && write_log 6 "Configured to run once"
+       [ $VERBOSE_MODE -gt 1 -o $FORCE_SECONDS -eq 0 ] && exit 0
 
-       # force_update=0 or VERBOSE_MODE > 1 - leave the main loop
-       [ $FORCE_SECONDS -eq 0 -o $VERBOSE_MODE -gt 1 ] && {
-               verbose_echo "****** LEAVING =: $(eval $DATE_PROG)"
-               syslog_info "Leaving"
-               break
-       }
-       verbose_echo "********* LOOP =: $(eval $DATE_PROG)"
-       syslog_info "Rerun IP check"
+       write_log 6 "Rerun IP check at $(eval $DATE_PROG)"
 done
-
-verbose_echo "****** STOPPED =: PID '$$' at $(eval $DATE_PROG)\n"
-syslog_info "Done"
-
-exit 0
+# we should never come here there must be a programming error
+write_log 12 "Error in 'dynamic_dns_updater.sh - program coding error"
diff --git a/net/ddns-scripts/files/usr/lib/ddns/getlocalip_sample.sh b/net/ddns-scripts/files/usr/lib/ddns/getlocalip_sample.sh
new file mode 100755 (executable)
index 0000000..9561f33
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# sample script for detecting local IP
+# 2014 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+#
+# activated inside /etc/config/ddns by setting
+#
+# option ip_source     'script'
+# option ip_script     '/usr/lib/ddns/getlocalip_sample.sh -6' !!! parameters ALLOWED
+#
+# the script is executed (not parsed) inside get_local_ip() function
+# of /usr/lib/ddns/dynamic_dns_functions.sh
+# 
+# useful when this box is the only DDNS client in the network
+# IP adresses of "internal" boxes could be detected with this script
+# so no need to install ddns client on every "internal" box
+# On IPv6 every internal box normally has it's own external IP
+#
+# This script should
+#      - return the IP address via stdout      echo -n "...."  !!! without line feed
+#      - report errors via stderr              echo "...." >&2
+#      - return an error code ('0' for success)        exit 123
+
+case $1 in
+       -4)     echo -n "8.8.8.8"               # never append linefeed or simular
+               exit 0
+               ;;                              # IP's of Googles public DNS
+       -6)     echo -n "2001:4860:4860::8888"
+               exit 0
+               ;;
+       *)      echo "$0 - Invalid or missing parameter" >&2
+               exit 1
+esac
+echo "Should never come here" >&2
+exit 2
index bb447fb41202b3e99fce1d8b5c04475aa9a80b8e..477caebe3e07985d6da1b4cc2b7026461338b30e 100644 (file)
@@ -1,45 +1,54 @@
-# This file contains the update urls for various dynamic dns services.
-# Column one contains the service name, column two contains the update url.
-# within the update url there are 4 variables you can use: [USERNAME], 
-# [PASSWORD], [DOMAIN] and [IP].  These are substituted for the username, 
-# password, and domain name specified in the /etc/config/ddns file when an 
-# update is performed.  The IP is substituted for the current ip address of the
-# router.  These variables are case sensitive, while urls generally are not, so 
-# if you need to enter the same text in the url (which seems very unlikely) put 
-# that text in lowercase, while the variables should remain in uppercase
+#444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444
+#4
+#4 This file contains the update urls for various dynamic dns services.
+#4 Column one contains the service name, column two contains the update url.
+#4 within the update url there are 4 variables you can use: [USERNAME],
+#4 [PASSWORD], [DOMAIN] and [IP].  These are substituted for the username,
+#4 password, and domain name specified in the /etc/config/ddns file when an
+#4 update is performed.  The IP is substituted for the current ip address of the
+#4 router.  These variables are case sensitive, while urls generally are not, so
+#4 if you need to enter the same text in the url (which seems very unlikely) put
+#4 that text in lowercase, while the variables should remain in uppercase
+#4
+#4 There are TONS of dynamic dns services out there. There's a huge list of them at:
+#4 http://www.dmoz.org/Computers/Software/Internet/Servers/Address_Management/Dynamic_DNS_Services/
+#4 If anyone has time they could update this file to be compatible with a bunch of them
+#4
+#4 !!! Since ddns-scripts Version 2.x the update of IPv6 addresses is also supported
+#4 !!! This file is used for update of IPv4 adresses only. For IPv6 use services_ipv6
+#4
+#4 !!! Since ddns-scripts Version 2.x the update via provider specific update scripts is supported.
+#4 !!! This scripts must be located at /usr/lib/ddns directory if defined inside this file.
+#4 !!! Use only the script name (without path). Sample:
+#4 !!! "example.com"   "update_sample.sh"
+#4
+#444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444
 
 "dyndns.org"           "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]"
 "changeip.com"         "http://[USERNAME]:[PASSWORD]@nic.changeip.com/nic/update?u=[USERNAME]&p=[PASSWORD]&cmd=update&hostname=[DOMAIN]&ip=[IP]"
 "zoneedit.com"         "http://[USERNAME]:[PASSWORD]@dynamic.zoneedit.com/auth/dynamic.html?host=[DOMAIN]&dnsto=[IP]"
 "free.editdns.net"     "http://dyndns-free.editdns.net/api/dynLinux.php?p=[PASSWORD]&r=[DOMAIN]"
 
-#noip is an alias of no-ip, so allow both names for the same service
-"no-ip.com"            "http://[USERNAME]:[PASSWORD]@dynupdate.no-ip.com/nic/update?hostname=[DOMAIN]&myip=[IP]"
-"noip.com"             "http://[USERNAME]:[PASSWORD]@dynupdate.no-ip.com/nic/update?hostname=[DOMAIN]&myip=[IP]"
+# noip is an alias of no-ip, so allow both names for the same service
+# use provider specific update script
+"no-ip.com"    "update_no-ip.sh"
+"noip.com"     "update_no-ip.sh"
 
 #freedns.afraid.org is weird, you just need an update code, for which we use the password variable
 "freedns.afraid.org"   "http://freedns.afraid.org/dynamic/update.php?[PASSWORD]&address=[IP]"
 
-#### ADD YOURS HERE! ######################################################################################
-#                                                                                                         #
-# There are TONS of dynamic dns services out there. There's a huge list of them at:                       #
-# http://www.dmoz.org/Computers/Software/Internet/Servers/Address_Management/Dynamic_DNS_Services/        #
-# If anyone has time they could update this file to be compatible with a bunch of them                    #
-#                                                                                                         #
-###########################################################################################################
-
 # DNS Max and resellers' update urls
 "dnsmax.com"   "http://update.dnsmax.com/update/?username=[USERNAME]&password=[PASSWORD]&resellerid=1&clientname=openwrt&clientversion=8.09&protocolversion=2.0&updatehostname=[DOMAIN]&ip=[IP]"
 "thatip.com"   "http://update.dnsmax.com/update/?username=[USERNAME]&password=[PASSWORD]&resellerid=2&clientname=openwrt&clientversion=8.09&protocolversion=2.0&updatehostname=[DOMAIN]&ip=[IP]"
 
 # Hurricane Electric Dynamic DNS
-"he.net"               "http://[DOMAIN]:[PASSWORD]@dyn.dns.he.net/nic/update?hostname=[DOMAIN]&myip=[IP]" 
+"he.net"       "http://[DOMAIN]:[PASSWORD]@dyn.dns.he.net/nic/update?hostname=[DOMAIN]&myip=[IP]"
 
 # DNSdynamic.org
 "dnsdynamic.org"       "http://[USERNAME]:[PASSWORD]@www.dnsdynamic.org/api/?hostname=[DOMAIN]&myip=[IP]"
 
 # dnsExit.com free dynamic DNS update url
-"dnsexit.com"          "http://www.dnsexit.com/RemoteUpdate.sv?login=[USERNAME]&password=[PASSWORD]&host=[DOMAIN]&myip=[IP]"
+"dnsexit.com"  "http://www.dnsexit.com/RemoteUpdate.sv?login=[USERNAME]&password=[PASSWORD]&host=[DOMAIN]&myip=[IP]"
 
 # OVH
 "ovh.com" "http://[USERNAME]:[PASSWORD]@www.ovh.com/nic/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]"
@@ -56,7 +65,7 @@
 "namecheap.com" "http://dynamicdns.park-your-domain.com/update?host=[USERNAME]&domain=[DOMAIN]&password=[PASSWORD]&ip=[IP]"
 
 # easydns.com dynamic DNS
-"easydns.com"          "http://[USERNAME]:[PASSWORD]@api.cp.easydns.com/dyn/tomato.php?hostname=[DOMAIN]&myip=[IP]"
+"easydns.com"  "http://[USERNAME]:[PASSWORD]@api.cp.easydns.com/dyn/tomato.php?hostname=[DOMAIN]&myip=[IP]"
 
 # Winco DDNS
 "ddns.com.br"  "http://[DOMAIN]:[PASSWORD]@members.ddns.com.br/nic/update?hostname=[DOMAIN]&myip=[IP]"
 
 # MyDNS.JP
 "mydns.jp"     "http://www.mydns.jp/directip.html?MID=[USERNAME]&PWD=[PASSWORD]&IPV4ADDR=[IP]"
+
+# LoopiaDNS
+"loopia.se" "http://[USERNAME]:[PASSWORD]@dns.loopia.se/XDynDNSServer/XDynDNS.php?system=custom&hostname=[DOMAIN]&myip=[IP]"
+
+# Cloudflare
+"cloudflare.com"       "update_cloudflare.sh"
+
+# SelfHost.de
+"selfhost.de"  "http://carol.selfhost.de/update?username=[USERNAME]&password=[PASSWORD]&myip=[IP]&hostname=1"
+
+# no-ip.pl nothing to do with no-ip.com (domain registered to www.domeny.tv) (IP autodetected by provider)
+"no-ip.pl"     "http://[USERNAME]:[PASSWORD]@update.no-ip.pl/?hostname=[DOMAIN]"
index b0faf4d478b17d2ff38222c02bbd3e4e06656f06..ff17568a31b2339e6b51c2e5cd6a1b28ae64e6fc 100644 (file)
@@ -1,32 +1,40 @@
-# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-# !!!!! IPv6 Version of original services file                 !!!!!
-# !!!!! funtionally and syntax is the same                     !!!!!
-# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-# This file contains the update urls for various dynamic dns services.
-# Column one contains the service name, column two contains the update url.
-# within the update url there are 4 variables you can use: [USERNAME], 
-# [PASSWORD], [DOMAIN] and [IP].  These are substituted for the username, 
-# password, and domain name specified in the /etc/config/ddns file when an 
-# update is performed.  The IP is substituted for the current ip address of the
-# router.  These variables are case sensitive, while urls generally are not, so 
-# if you need to enter the same text in the url (which seems very unlikely) put 
-# that text in lowercase, while the variables should remain in uppercase
+#666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666
+#6
+#6 This file contains the update urls for various dynamic dns services.
+#6 Column one contains the service name, column two contains the update url.
+#6 within the update url there are 4 variables you can use: [USERNAME],
+#6 [PASSWORD], [DOMAIN] and [IP].  These are substituted for the username,
+#6 password, and domain name specified in the /etc/config/ddns file when an
+#6 update is performed.  The IP is substituted for the current ip address of the
+#6 router.  These variables are case sensitive, while urls generally are not, so
+#6 if you need to enter the same text in the url (which seems very unlikely) put
+#6 that text in lowercase, while the variables should remain in uppercase
+#6
+#6 There are TONS of dynamic dns services out there. There's a huge list of them at:
+#6 http://www.dmoz.org/Computers/Software/Internet/Servers/Address_Management/Dynamic_DNS_Services/
+#6 If anyone has time they could update this file to be compatible with a bunch of them
+#6
+#6 !!! Since ddns-scripts Version 2.x the update of IPv6 addresses is also supported
+#6 !!! This file is used for update of IPv6 adresses only. For IPv4 use services
+#6
+#6 !!! Since ddns-scripts Version 2.x the update via provider specific update scripts is supported.
+#6 !!! This scripts must be located at /usr/lib/ddns directory if defined inside this file.
+#6 !!! Use only the script name (without path). Sample:
+#6 !!! "example.com"   "update_sample.sh"
+#6
+#666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666
 
-# tested with
-
-# Securepoint Dynamic-DNS-Service
+#IPv6 @ Securepoint Dynamic-DNS-Service
 "spdns.de"     "http://[USERNAME]:[PASSWORD]@update.spdns.de/nic/update?hostname=[DOMAIN]&myip=[IP]"
 
-# Hurricane Electric Dynamic DNS
-"he.net"       "http://[DOMAIN]:[PASSWORD]@dyn.dns.he.net/nic/update?hostname=[DOMAIN]&myip=[IP]" 
-
-#### ADD YOURS HERE! ######################################################################################
-#                                                                                                         #
-# There are TONS of dynamic dns services out there. There's a huge list of them at:                       #
-# http://www.dmoz.org/Computers/Software/Internet/Servers/Address_Management/Dynamic_DNS_Services/        #
-# If anyone has time they could update this file to be compatible with a bunch of them                    #
-#                                                                                                         #
-###########################################################################################################
+#IPv6 @ Hurricane Electric Dynamic DNS
+"he.net"       "http://[DOMAIN]:[PASSWORD]@dyn.dns.he.net/nic/update?hostname=[DOMAIN]&myip=[IP]"
 
-# MyDNS.JP
+#IPv6 @ MyDNS.JP
 "mydns.jp"     "http://www.mydns.jp/directip.html?MID=[USERNAME]&PWD=[PASSWORD]&IPV6ADDR=[IP]"
+
+#IPv6 @ Cloudflare
+"cloudflare.com"       "update_cloudflare.sh"
+
+#IPv6 @ no-ip.pl nothing to do with no-ip.com (domain registered to www.domeny.tv) (IP autodetected by provider)
+"no-ip.pl"     "http://[USERNAME]:[PASSWORD]@update.no-ip.pl/?hostname=[DOMAIN]"
diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_cloudflare.sh b/net/ddns-scripts/files/usr/lib/ddns/update_cloudflare.sh
new file mode 100644 (file)
index 0000000..a86e8d7
--- /dev/null
@@ -0,0 +1,138 @@
+#
+# script for sending updates to cloudflare.com
+# 2014 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+# many thanks to Paul for testing and feedback during development
+#
+# This script is parsed by dynamic_dns_functions.sh inside send_update() function
+#
+# using following options from /etc/config/ddns
+# option username - your cloudflare e-mail
+# option password - cloudflare api key, you can get it from cloudflare.com/my-account/
+# option domain   - your full hostname to update, in cloudflare its subdomain.domain
+#                      i.e. myhost.example.com where myhost is the subdomain and example.com is your domain
+#
+# Attention !!! script will only work if there is only one subdomain-level at your domain
+# subdomain2.subdomain1.domain i.e. mail.host.example.com will not work
+#
+# variable __IP already defined with the ip-address to use for update
+#
+[ $use_https -eq 0 ] && write_log 14 "Cloudflare only support updates via Secure HTTP (HTTPS). Please correct configuration!"
+
+local __RECID __URL __KEY __KEYS __FOUND __DOMREC
+local __SUBDOM=$(echo $domain | awk -F "." '{print $1}')
+local __DOMAIN=$(echo $domain | awk -F "${__SUBDOM}." '{print $2}')
+local __TMP="/tmp/$$.json"
+
+# parse OpenWrt script with
+# functions for parsing and generating json
+. /usr/share/libubox/jshn.sh
+
+# function copied from /usr/share/libubox/jshn.sh
+# from BB14.09 for backward compatibility to AA12.09
+json_get_keys() {
+       local __dest="$1"
+       local _tbl_cur
+
+       if [ -n "$2" ]; then
+               json_get_var _tbl_cur "$2"
+       else
+               _json_get_var _tbl_cur JSON_CUR
+       fi
+       local __var="${JSON_PREFIX}KEYS_${_tbl_cur}"
+       eval "export -- \"$__dest=\${$__var}\"; [ -n \"\${$__var+x}\" ]"
+}
+
+# function to "sed" unwanted string parts from DATFILE
+cleanup() {
+       #based on the sample output on cloudflare.com homepage we need to do some cleanup
+       sed -i 's/^[ \t]*//;s/[ \t]*$//' $DATFILE       # remove invisible chars at beginning and end of lines
+       sed -i '/^-$/d' $DATFILE                        # remove lines with "-" (dash)
+       sed -i '/^$/d' $DATFILE                         # remove empty lines
+       sed -i "#'##g" $DATFILE                         # remove "'" (single quote)
+}
+
+# build url according to cloudflare client api at https://www.cloudflare.com/docs/client-api.html
+# to "rec_load_all" to detect rec_id needed for update
+__URL="https://www.cloudflare.com/api_json.html"       # https://www.cloudflare.com/api_json.html
+__URL="${__URL}?a=rec_load_all"                                #  -d 'a=rec_load_all'
+__URL="${__URL}&tkn=$password"                         #  -d 'tkn=8afbe6dea02407989af4dd4c97bb6e25'
+__URL="${__URL}&email=$username"                       #  -d 'email=sample@example.com'
+__URL="${__URL}&z=$__DOMAIN"                           #  -d 'z=example.com'
+
+# lets request the data
+do_transfer "$__URL" || return 1
+
+cleanup                                # cleanup dat file
+json_load "$(cat $DATFILE)"    # lets extract data
+__FOUND=0                      # found record indicator
+json_get_var __RES "result"    # cloudflare result of last request
+json_get_var __MSG "msg"       # cloudflare error message
+[ "$__RES" != "success" ] && {
+       write_log 4 "'rec_load_all' failed with error: \n$__MSG"
+       return 1
+}
+
+json_select "response"
+json_select "recs"
+json_select "objs"
+json_get_keys __KEYS
+for __KEY in $__KEYS; do
+       local __ZONE __NAME __DISPLAY __TYPE
+       json_select "$__KEY"
+       json_get_var __ZONE "zone_name"
+       json_get_var __NAME "name"
+       json_get_var __DISPLAY "display_name"
+       json_get_var __TYPE "type"
+       # if "zone_name" == "name" == "display_name" == $domain, then we found a valid domain record
+       if [ "$__NAME" = "$domain" ]; then
+               [ "$__DISPLAY" = "$__ZONE" ] && __DOMREC=1 || __DOMREC=0
+               # we must verify IPv4 and IPv6 because there might be both for the same host
+               [ \( $use_ipv6 -eq 0 -a "$__TYPE" = "A" \) -o \( $use_ipv6 -eq 1 -a "$__TYPE" = "AAAA" \) ] && {
+                       __FOUND=1       # mark found
+                       break           # found leave for loop
+               }
+       fi
+       json_select ..
+done
+[ $__FOUND -eq 0 ] && {
+       # we don't need to continue trying to update cloudflare because record to update does not exist
+       # user has to setup record first outside ddns-scripts
+       write_log 14 "No valid record found at Cloudflare setup. Please create first!"
+}
+json_get_var __RECID "rec_id"  # last thing to do get rec_id
+json_cleanup                   # cleanup
+write_log 7 "rec_id '$__RECID' detected for host/domain '$domain'"
+
+# build url according to cloudflare client api at https://www.cloudflare.com/docs/client-api.html
+# for "rec_edit" to update IP address
+__URL="https://www.cloudflare.com/api_json.html"       # https://www.cloudflare.com/api_json.html
+__URL="${__URL}?a=rec_edit"                            #  -d 'a=rec_edit'
+__URL="${__URL}&tkn=$password"                         #  -d 'tkn=8afbe6dea02407989af4dd4c97bb6e25'
+__URL="${__URL}&id=$__RECID"                           #  -d 'id=9001'
+__URL="${__URL}&email=$username"                       #  -d 'email=sample@example.com'
+[ $__DOMREC -eq 0 ] && __URL="${__URL}&z=$__DOMAIN"    #  -d 'z=example.com'
+[ $__DOMREC -eq 1 ] && __URL="${__URL}&z=$domain"      #  -d 'z=example.com'
+
+[ $use_ipv6 -eq 0 ] && __URL="${__URL}&type=A"         #  -d 'type=A'          (IPv4)
+[ $use_ipv6 -eq 1 ] && __URL="${__URL}&type=AAAA"      #  -d 'type=AAAA'       (IPv6)
+
+[ $__DOMREC -eq 0 ] && __URL="${__URL}&name=$__SUBDOM" #  -d 'name=sub'        (HOST/SUBDOMAIN)
+[ $__DOMREC -eq 1 ] && __URL="${__URL}&name=$domain"   #  -d 'name=example.com'(DOMAIN)
+
+__URL="${__URL}&content=$__IP"                         #  -d 'content=1.2.3.4'
+__URL="${__URL}&service_mode=0"                                #  -d 'service_mode=0'
+__URL="${__URL}&ttl=1"                                 #  -d 'ttl=1'
+
+# lets do the update
+do_transfer "$__URL" || return 1
+
+cleanup                                # cleanup tmp file
+json_load "$(cat $DATFILE)"    # lets extract data
+json_get_var __RES "result"    # cloudflare result of last request
+json_get_var __MSG "msg"       # cloudflare error message
+[ "$__RES" != "success" ] && {
+       write_log 4 "'rec_edit' failed with error:\n$__MSG"
+       return 1
+}
+write_log 7 "Update of rec_id '$__RECID' successful"
+return 0
diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_no-ip.sh b/net/ddns-scripts/files/usr/lib/ddns/update_no-ip.sh
new file mode 100644 (file)
index 0000000..0d4315e
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# script for sending updates to no-ip.com / noip.com
+# 2014 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+#
+# This script is parsed by dynamic_dns_functions.sh inside send_update() function
+#
+# provider did not reactivate records, if no IP change was recognized
+# so we send a dummy (localhost) and a seconds later we send the correct IP addr
+#
+local __DUMMY
+local __UPDURL="http://[USERNAME]:[PASSWORD]@dynupdate.no-ip.com/nic/update?hostname=[DOMAIN]&myip=[IP]"
+
+# set IP version dependend dummy (localhost)
+[ $use_ipv6 -eq 0 ] && __DUMMY="127.0.0.1" || __DUMMY="::1"
+
+# lets do DUMMY transfer
+write_log 7 "sending dummy IP to 'no-ip.com'"
+__URL=$(echo $__UPDURL | sed -e "s#\[USERNAME\]#$URL_USER#g" -e "s#\[PASSWORD\]#$URL_PASS#g" \
+                              -e "s#\[DOMAIN\]#$domain#g" -e "s#\[IP\]#$__DUMMY#g")
+[ $use_https -ne 0 ] && __URL=$(echo $__URL | sed -e 's#^http:#https:#')
+
+do_transfer "$__URL" || return 1
+
+write_log 7 "'no-ip.com' answered:\n$(cat $DATFILE)"
+# analyse provider answers
+# "good [IP_ADR]"      = successful
+# "nochg [IP_ADR]"     = no change but OK
+grep -E "good|nochg" $DATFILE >/dev/null 2>&1 || return 1
+
+# lets wait a seconds
+sleep 1
+
+# now send the correct data
+write_log 7 "sending real IP to 'no-ip.com'"
+__URL=$(echo $__UPDURL | sed -e "s#\[USERNAME\]#$URL_USER#g" -e "s#\[PASSWORD\]#$URL_PASS#g" \
+                              -e "s#\[DOMAIN\]#$domain#g" -e "s#\[IP\]#$__IP#g")
+[ $use_https -ne 0 ] && __URL=$(echo $__URL | sed -e 's#^http:#https:#')
+
+do_transfer "$__URL" || return 1
+
+write_log 7 "'no-ip.com' answered:\n$(cat $DATFILE)"
+# analyse provider answers
+# "good [IP_ADR]"      = successful
+# "nochg [IP_ADR]"     = no change but OK
+grep -E "good|nochg" $DATFILE >/dev/null 2>&1
+return $?      # "0" if "good" or "nochg" found
+
index fb69081ac557b1eb35f5be15306a9120edc56c06..6d1cf0da84e39fd3c60c250fb7aa2ea55901626d 100644 (file)
@@ -1,37 +1,36 @@
-# sample script for sending user defined updates 
+# sample script for sending user defined updates
 # 2014 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
 #
 # activated inside /etc/config/ddns by setting
 #
-# option update_script '/usr/lib/ddns/update_sample.sh' 
+# option update_script '/usr/lib/ddns/update_sample.sh'
 #
 # the script is parsed (not executed) inside send_update() function
 # of /usr/lib/ddns/dynamic_dns_functions.sh
 # so you can use all available functions and global variables inside this script
 # already defined in dynamic_dns_updater.sh and dynamic_dns_functions.sh
 #
-# It make sence to define the update url ONLY inside this script 
+# It make sence to define the update url ONLY inside this script
 # because it's anyway unique to the update script
 # otherwise it should work with the default scripts
 #
 # the code here is the copy of the default used inside send_update()
 #
-local __USER __PASS __ANSWER
 # tested with spdns.de
 local __URL="http://[USERNAME]:[PASSWORD]@update.spdns.de/nic/update?hostname=[DOMAIN]&myip=[IP]"
 
 # do replaces in URL
-__urlencode __USER "$username" # encode username, might be email or something like this
-__urlencode __PASS "$password" # encode password, might have special chars for security reason
-__URL=$(echo $__URL | sed -e "s#\[USERNAME\]#$__USER#g" -e "s#\[PASSWORD\]#$__PASS#g" \
+__URL=$(echo $__URL | sed -e "s#\[USERNAME\]#$URL_USER#g" -e "s#\[PASSWORD\]#$URL_PASS#g" \
                               -e "s#\[DOMAIN\]#$domain#g" -e "s#\[IP\]#$__IP#g")
 [ $use_https -ne 0 ] && __URL=$(echo $__URL | sed -e 's#^http:#https:#')
 
-__do_transfer __ANSWER "$__URL"
-__ERR=$?
-[ $__ERR -gt 0 ] && {
-       verbose_echo "\n!!!!!!!!! ERROR =: Error sending update to DDNS Provider\n"
-       return 1
-}
-verbose_echo "   update send =: DDNS Provider answered\n$__ANSWER"
-return 0
+do_transfer "$__URL" || return 1
+
+write_log 7 "DDNS Provider answered:\n$(cat $DATFILE)"
+
+# analyse provider answers
+# "good [IP_ADR]"      = successful
+# "nochg [IP_ADR]"     = no change but OK
+grep -E "good|nochg" $DATFILE >/dev/null 2>&1
+return $?      # "0" if "good" or "nochg" found
+
index 2c97879ac9d07b9dfd9a02b70171e97cebd4292e..f69622e9c9c06ffdaa656f482b1bc83fd4047881 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=1
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
 
 PKG_LICENSE:=GPLv2
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.flyn.org/projects/dmapd
index 7fa772aeda982a5afaec80b86f88f6aef371cd44..e8f9f033ea1346d4ee11b1fa3adf908493d6dfb7 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=@KERNEL/software/network/ethtool
 PKG_MD5SUM:=e7bf0c355d2bf6ee281ebc713c5fb987
 
 PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index ca4045c5c572f4e5a76be05f14de4c561f7cc318..8292245e6c00ef6bde077c85446d55f5c85f9893 100644 (file)
@@ -80,8 +80,14 @@ config FASTD_WITH_CMDLINE_COMMANDS
        default n
 
 config FASTD_WITH_VERIFY
-        bool "Include support for on-verify handlers"
-        depends on PACKAGE_fastd
-        default n
+       bool "Include support for on-verify handlers"
+       depends on PACKAGE_fastd
+       default n
+
+config FASTD_WITH_STATUS_SOCKET
+       bool "Include support for status sockets"
+       depends on PACKAGE_fastd
+       default y
+
 
 endmenu
index ee6b2b5796136ecf21ecfb3b53c7d98f329cf660..e6a87283464cb228a93aaa3a279548f1f846a475 100644 (file)
@@ -8,16 +8,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fastd
-PKG_VERSION:=14
-PKG_RELEASE:=2
+PKG_VERSION:=16
+PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/75
-PKG_MD5SUM:=34f6bdebd0410a1fba7c8fd06fff7a05
+PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/78
+PKG_MD5SUM:=135b3083d2743e335738de3bd4bb0c3c
 
 PKG_LICENSE:=BSD-2-Clause
-PKG_LICENSE_FILE:=COPYRIGHT
+PKG_LICENSE_FILES:=COPYRIGHT
 
 PKG_CONFIG_DEPENDS:=\
        CONFIG_FASTD_ENABLE_METHOD_CIPHER_TEST \
@@ -35,7 +35,8 @@ PKG_CONFIG_DEPENDS:=\
        CONFIG_FASTD_WITH_CMDLINE_LOGGING \
        CONFIG_FASTD_WITH_CMDLINE_OPERATION \
        CONFIG_FASTD_WITH_CMDLINE_COMMANDS \
-       CONFIG_FASTD_WITH_VERIFY
+       CONFIG_FASTD_WITH_VERIFY \
+       CONFIG_FASTD_WITH_STATUS_SOCKET
 
 
 PKG_BUILD_DEPENDS:=nacl libuecc
@@ -46,7 +47,7 @@ include $(INCLUDE_DIR)/cmake.mk
 define Package/fastd
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+kmod-tun +librt +libpthread
+  DEPENDS:=+kmod-tun +librt +libpthread +FASTD_WITH_STATUS_SOCKET:libjson-c
   TITLE:=Fast and Secure Tunneling Daemon
   URL:=https://projects.universe-factory.net/projects/fastd
   SUBMENU:=VPN
@@ -77,9 +78,11 @@ CMAKE_OPTIONS += \
        -DWITH_CMDLINE_OPERATION:BOOL=FALSE \
        -DWITH_CMDLINE_COMMANDS:BOOL=FALSE \
        -DWITH_VERIFY:BOOL=FALSE \
+       -DWITH_STATUS_SOCKET:BOOL=FALSE \
        -DWITH_CAPABILITIES:BOOL=FALSE \
        -DENABLE_SYSTEMD:BOOL=FALSE \
-       -DENABLE_LIBSODIUM:BOOL=FALSE
+       -DENABLE_LIBSODIUM:BOOL=FALSE \
+       -DENABLE_LTO:BOOL=TRUE
 
 
 ifeq ($(CONFIG_FASTD_ENABLE_METHOD_CIPHER_TEST),y)
@@ -149,6 +152,10 @@ ifeq ($(CONFIG_FASTD_WITH_VERIFY),y)
 CMAKE_OPTIONS += -DWITH_VERIFY:BOOL=TRUE
 endif
 
+ifeq ($(CONFIG_FASTD_WITH_STATUS_SOCKET),y)
+CMAKE_OPTIONS += -DWITH_STATUS_SOCKET:BOOL=TRUE
+endif
+
 
 define Package/fastd/description
  Fast and secure tunneling daemon, which is optimized on small code size and few dependencies
@@ -163,9 +170,9 @@ define Package/fastd/install
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fastd $(1)/usr/bin/
 
        $(INSTALL_DIR) $(1)/etc/init.d/
-       $(INSTALL_BIN) files/fastd.init $(1)/etc/init.d/fastd
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/openwrt/fastd.init $(1)/etc/init.d/fastd
        $(INSTALL_DIR) $(1)/etc/config
-       $(INSTALL_CONF) files/fastd.config $(1)/etc/config/fastd
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/examples/openwrt/fastd.config $(1)/etc/config/fastd
        $(INSTALL_DIR) $(1)/etc/fastd
        $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
        $(INSTALL_DATA) files/fastd.upgrade $(1)/lib/upgrade/keep.d/fastd
diff --git a/net/fastd/files/fastd.config b/net/fastd/files/fastd.config
deleted file mode 100644 (file)
index b47cc65..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-package fastd
-
-config fastd sample_config
-
-       # Set to 1 to enable this instance:
-       option enabled 0
-
-       # Sets a static config file, optional
-       # Options set via UCI have higher priority that statically configured ones
-#      list config '/etc/fastd/sample_config/fastd.conf'
-
-       # Configures a single static peer from a configuration file
-#      list config_peer '/etc/fastd/sample_config/sample_peer.conf'
-
-       # Sets an additional directory from which peers configurations are read
-       # The peer list can be reloaded without restarting fastd
-       # Peer can either be configured via UCI (see examples below) or via peer dirs
-       # Can't be used in tun mode
-#      list config_peer_dir '/etc/fastd/sample_config/peers'
-
-       # Sets the log level
-       # Possible values: error, warn, info, verbose, debug
-       # Default: info
-       option syslog_level 'info'
-
-       # IP address and port of the local end, optional
-       # 'any' can be used to bind to both IPv4 and IPv6
-       # If no port is given fastd will bind to a random port
-#      list bind 'any:1337'
-#      list bind '0.0.0.0:1337'
-#      list bind '[::]:1337'
-
-       # "method null" uses no encryption or MAC
-       # "method xsalsa20-poly1305" uses the XSalsa20 encryption ad the Poly1305 MAC
-       list method 'xsalsa20-poly1305'
-
-       # "mode tap" will create an ethernet tunnel (tap device),
-       # "mode tun" will create an IP tunnel (tun device).
-       option mode 'tap'
-
-       # Set the name of the tunnel interface to use
-       option interface 'tap0'
-#      option interface 'tun0'
-#      option interface 'fastd0'
-
-       # Sets the MTU of the tunnel interface, default is 1500
-       # 1426 is a good value that avoids fragmentation for the xsalsa20-poly1305 method
-       # when the tunnel uses an IPv4 connection on a line with an MTU of 1492 or higher
-       option mtu 1426
-
-       # Enables direct forwaring of packets between peers
-       # WARNING: Only enable this if you know what you are doing, as this can lead to forwarding loops!
-       option forward 0
-
-       # Disable for compatiblity with fastd v10 and older
-       option secure_handshakes 1
-
-       # Set a packet mark to filter for with iptables or ip rules
-#      option packet_mark 42
-
-       # Limits the maximum number of connections, optional
-#      option peer_limit 5
-
-       # The secret key
-       # A keypair can be generated with `fastd --generate-key`
-       # When the corresponding public key is lost it can be recovered with `/etc/init.d/fastd show-key <config name>`
-#      option secret '0000000000000000000000000000000000000000000000000000000000000000'
-
-       # Sets the user to run fastd as. Defaults to root
-#      option user 'daemon'
-
-       # Sets the group to run fastd as. Defaults to the user's primary group
-#      option group 'daemon'
-
-       # If set to 1, the logs won't contain peers' IP addresses
-#      option hide_ip_addresses '0'
-
-       # If set to 1, the logs won't contain peers' MAC addresses
-#      option hide_mac_addresses '0'
-
-       # Read the documentation about this one. Only ever useful in severly broken networks.
-#      option pmtu ''
-
-       # command to configure IP addresses etc. after the tunnel interface is up; $1 will be the interface name (optional)
-#      option up ''
-
-       # command to execute before the tunnel interface is set down; $1 will be the interface name (optional)
-#      option down ''
-
-
-config peer sample_peer
-
-       # Set to 1 to enable this peer
-       # In tap mode peers can be reloaded dynamically
-       option enabled 0
-
-       # Controls which instance this peer is associated with
-       option net 'sample_config'
-
-       # Controls which peer group this peer belongs to, optional
-       # For most use cases peer groups aren't necessary
-#      option group 'sample_group'
-
-       # The peer's public key
-       option key '0000000000000000000000000000000000000000000000000000000000000000'
-
-       # A remote specification consists of an address or a hostname, and a port
-       # When a hostname is given, it is recommended to specify the address family to use
-       # It is possible to specify no, one or multiple remotes
-       # (but all entries must designate the same host as the public key must be unique)
-#      list remote '192.0.2.1:1337'
-#      list remote '[2001:db8::1]:1337'
-#      list remote '"example.com" port 1337'
-#      list remote 'ipv4 "example.com" port 1337'
-#      list remote 'ipv6 "example.com" port 1337'
-
-       # Setting float to 1 allow incoming connections with this key from other addresses/hostnames/ports than the specified remotes
-#      option float 0
-
-
-config peer_group sample_group
-
-       # Set to 1 to enable this peer group
-       option enabled 0
-
-       # Controls which instance this peer group is associated with
-       # Peer groups can't be used in tun mode
-       option net 'sample_config'
-
-       # Allows configuring nested groups
-#      option parent 'other_group'
-
-       # Includes another config file inside the peer group definition
-#      list config '/etc/fastd/sample_config/sample_group.conf'
-
-       # Configures a single static peer from a configuration file
-#      list config_peer '/etc/fastd/sample_config/sample_peer.conf'
-
-       # Configures an additional peer directory for this group
-#      list config_peer_dir '/etc/fastd/sample_config/peers2'
-
-       # Limits the maximum number of connections to peers in this group (optional)
-#      option peer_limit 5
diff --git a/net/fastd/files/fastd.init b/net/fastd/files/fastd.init
deleted file mode 100644 (file)
index 3a20922..0000000
+++ /dev/null
@@ -1,425 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2012-2013 OpenWrt.org
-
-START=95
-
-SERVICE_USE_PID=1
-
-EXTRA_COMMANDS="up down show_key generate_key"
-
-LIST_SEP="
-"
-TMP_FASTD=/tmp/fastd
-FASTD_COMMAND=/usr/bin/fastd
-
-
-section_enabled() {
-       config_get_bool enabled "$1" 'enabled' 0
-       [ $enabled -gt 0 ]
-}
-
-error() {
-       echo "${initscript}:" "$@" 1>&2
-}
-
-get_key_instance() {
-       local s="$1"
-
-       config_get secret "$s" secret
-       if [ "$secret" = 'generate' ]; then
-               secret=`"$FASTD_COMMAND" --generate-key --machine-readable`
-               uci -q set fastd."$s".secret="$secret" && uci -q commit fastd
-       fi
-
-       echo "$secret"
-}
-
-
-escape_string() {
-       local t=${1//\\/\\\\}
-       echo -n "\"${t//\"/\\\"}\""
-}
-
-guard_value() {
-       local t=${1//[^-a-z0-9\[\].:]/}
-       echo -n "$t"
-}
-
-guard_remote() {
-       local t=${1//[^-a-zA-Z0-9\[\].:\"% ]/}
-       local quotes=${t//[^\"]/}
-       if [ "${#quotes}" = 0 -o "${#quotes}" = 2 ]; then
-               echo -n "$t"
-       fi
-}
-
-yes_no() {
-       case "$1" in
-               0|no|off|false|disabled) echo -n no;;
-               *) echo -n yes;;
-       esac
-}
-
-config_string_config='include $(escape_string "$value");'
-config_string_config_peer='include peer $(escape_string "$value");'
-config_string_config_peer_dir='include peers from $(escape_string "$value");'
-config_string_bind='bind $(guard_value "$value");'
-config_string_method='method $(escape_string "$value");'
-config_string_syslog_level='log to syslog level $(guard_value "$value");'
-config_string_mode='mode $(guard_value "$value");'
-config_string_interface='interface $(escape_string "$value");'
-config_string_mtu='mtu $(guard_value "$value");'
-config_string_peer_limit='peer limit $(guard_value "$value");'
-config_string_user='user $(escape_string "$value");'
-config_string_group='group $(escape_string "$value");'
-config_string_pmtu='pmtu $(yes_no "$value");'
-config_string_forward='forward $(yes_no "$value");'
-config_string_hide_ip_addresses='hide ip addresses $(yes_no "$value");'
-config_string_hide_mac_addresses='hide mac addresses $(yes_no "$value");'
-config_string_secure_handshakes='secure handshakes $(yes_no "$value");'
-config_string_packet_mark='packet mark $(guard_value "$value");'
-
-config_string_peer='peer $(escape_string "$value") {'
-config_string_peer_group='peer group $(escape_string "$value") {'
-
-peer_string_key='key $(escape_string "$value");'
-peer_string_float='float $(yes_no "$value");'
-peer_string_remote='remote $(guard_remote "$value");'
-
-generate_option() {
-       local __string=$(eval echo \"\$$2\")
-       local value="$1";
-       eval echo "\"$__string\""
-}
-
-append_option() {
-       local v; local len; local s="$1"; local prefix="$2"; local p="$3"
-
-       config_get len "$s" "${p}_LENGTH"
-
-       if [ -z "$len" ]; then
-               config_get v "$s" "$p"
-               [ -n "$v" ] && generate_option "$v" "${prefix}_string_${p}"
-       else
-               config_list_foreach "$s" "$p" generate_option "${prefix}_string_${p}"
-       fi
-}
-
-append_options() {
-       local p; local s="$1"; local prefix="$2"; shift; shift
-       for p in $*; do
-               append_option "$s" "$prefix" "$p"
-       done
-}
-
-
-generate_config_secret() {
-       echo "secret $(escape_string "$1");"
-}
-
-
-generate_peer_config() {
-       local peer="$1"
-
-       # These options are deprecated
-       config_get address "$peer" address
-       config_get hostname "$peer" hostname
-       config_get address_family "$peer" address_family
-       config_get port "$peer" port
-
-       if [ "$address" -o "$hostname" ]; then
-               if [ -z "$port" ]; then
-                       error "peer $peer: address or hostname, but no port given"
-                       return 1
-               fi
-
-               if [ "$hostname" ]; then
-                       generate_option peer_string_remote "$address_family \"$hostname\" port $port"
-               fi
-
-               if [ "$address" ]; then
-                       generate_option peer_string_remote "$address port $port"
-               fi
-       fi
-
-       append_options "$peer" peer \
-               key float remote
-}
-
-generate_single_peer_config() {
-       local peer="$1"; local net="$2"
-
-       config_get peer_net "$peer" net
-       config_get peer_group "$peer" group
-       [ "$net" = "$peer_net" -a "$peer_group" = '' ] || return 0
-
-       section_enabled "$peer" || return 0
-
-       generate_option "$peer" config_string_peer
-       generate_peer_config "$peer"
-       echo '}'
-}
-
-create_peer_config() {
-       local peer="$1"; local net="$2"; local group="$3"; local path="$4"
-
-       config_get peer_net "$peer" net
-       config_get peer_group "$peer" group
-       [ "$group" = "$peer_group" ] || return 0
-
-       if [ "$net" != "$peer_net" ]; then
-               [ -z "$group" ] || error "warning: the peer group of peer '$peer' doesn't match its net, the peer will be ignored"
-               return 0
-       fi
-
-       section_enabled "$peer" || return 0
-
-       generate_peer_config "$peer" >"$path/$peer"
-}
-
-update_peer_group() {
-       local net="$1"; local group_dir="$2"; local group="$3"; local update_only="$4"
-       local path="$TMP_FASTD/fastd.$net/$group_dir"
-
-       rm -rf "$path"
-       mkdir -p "$path"
-
-       config_foreach create_peer_config 'peer' "$net" "$group" "$path"
-
-       if [ -z "$update_only" ]; then
-               generate_option "$path" config_string_config_peer_dir
-       fi
-
-       config_foreach generate_peer_group_config 'peer_group' "$net" "$group_dir" "$update_only" "$group"
-}
-
-generate_peer_group_config() {
-       local group="$1"; local net="$2"; local group_dir="$3%$group"; local update_only="$4"; local parent="$5"
-
-       config_get group_net "$group" net
-       config_get group_parent "$group" parent
-       [ "$parent" = "$group_parent" ] || return 0
-
-       if [ "$net" != "$peer_net" ]; then
-               [ -z "$parent" ] || error "warning: the parent of peer group '$group' doesn't match its net, the peer group will be ignored"
-               return 0
-       fi
-
-       section_enabled "$group" || return 0
-
-       if [ -z "$update_only" ]; then
-               generate_option "$group" config_string_peer_group
-               append_options "$group" config \
-                       config config_peer config_peer_dir peer_limit
-       fi
-
-       update_peer_group "$net" "$group_dir" "$group" "$update_only"
-
-       if [ -z "$update_only" ]; then
-               echo '}'
-       fi
-}
-
-update_peer_groups() {
-       local net="$1"; local update_only="$2"
-
-       update_peer_group "$net" 'peers' '' "$update_only"
-}
-
-generate_config() {
-       local s="$1"
-
-       generate_option 'info' config_string_syslog_level
-
-       append_options "$s" config \
-               config config_peer config_peer_dir bind method syslog_level mode interface mtu peer_limit \
-               user group pmtu forward hide_ip_addresses hide_mac_addresses secure_handshakes packet_mark
-
-       config_get mode "$s" mode
-
-       if [ "$mode" = "tun" ]; then
-               config_foreach generate_single_peer_config 'peer' "$s"
-       else
-               update_peer_groups "$s"
-       fi
-}
-
-
-generate_key_instance() {
-       local s="$1"
-
-       config_get secret "$s" secret
-       if [ -z "$secret" -o "$secret" = 'generate' ]; then
-               secret=`fastd --generate-key --machine-readable`
-               uci -q set fastd."$s".secret="$secret" && uci -q commit fastd
-       fi
-
-       generate_config_secret "$secret" | "$FASTD_COMMAND" --config - --show-key --machine-readable
-}
-
-show_key_instance() {
-       local s="$1"
-
-       local secret=`get_key_instance "$s"`
-       if [ -z "$secret" ]; then
-               error "$s: secret is not set"
-               return 1
-       fi
-
-       generate_config_secret "$secret" | "$FASTD_COMMAND" --config - --show-key --machine-readable
-}
-
-start_instance() {
-       local s="$1"
-
-       section_enabled "$s" || return 1
-
-       SERVICE_PID_FILE="/var/run/fastd.$s.pid"
-
-       config_get interface "$s" interface
-       if [ -z "$interface" ]; then
-               error "$s: interface is not set"
-               return 1
-       fi
-
-       if ifconfig "$interface" &>/dev/null; then
-               error "$s: interface '$interface' is already in use"
-               return 1
-       fi
-
-       config_get mode "$s" mode
-       if [ -z "$mode" ]; then
-               error "$s: mode is not set"
-               return 1
-       fi
-
-       local secret=`get_key_instance "$s"`
-       if [ -z "$secret" ]; then
-               error "$s: secret is not set"
-               return 1
-       fi
-
-       rm -f "$SERVICE_PID_FILE"
-       touch "$SERVICE_PID_FILE"
-
-       config_get user "$s" user
-       if [ "$user" ]; then
-               chown "$user" "$SERVICE_PID_FILE"
-       fi
-
-       (generate_config_secret "$secret"; generate_config "$s") | service_start "$FASTD_COMMAND" --config - --daemon --pid-file "$SERVICE_PID_FILE"
-
-       if ! ifconfig "$interface" >/dev/null 2>&1; then
-               error "$s: startup failed"
-               return 1
-       fi
-
-       config_get up "$s" up
-       [ -n "$up" ] && sh -c "$up" - "$interface"
-}
-
-stop_instance() {
-       local s="$1"
-
-       section_enabled "$s" || return 1
-
-       SERVICE_PID_FILE="/var/run/fastd.$s.pid"
-
-       config_get interface "$s" interface
-       if [ -z "$interface" ]; then
-               error "$s: interface is not set"
-               return 1
-       fi
-
-       if ! ifconfig "$interface" &>/dev/null; then
-               error "$s: interface '$interface' does not exist"
-               return 1
-       fi
-
-       config_get down "$s" down
-       [ -n "$down" ] && sh -c "$down" - "$interface"
-
-       service_stop "$FASTD_COMMAND"
-
-       rm -rf "$TMP_FASTD/fastd.$s"
-}
-
-reload_instance() {
-       local s="$1"
-
-       section_enabled "$s" || return 1
-
-       config_get mode "$s" mode
-       [ "$mode" = "tun" ] && return 1
-
-       update_peer_groups "$s" true
-
-       SERVICE_PID_FILE="/var/run/fastd.$s.pid"
-       service_reload "$FASTD_COMMAND"
-}
-
-start() {
-       config_load 'fastd'
-       config_foreach start_instance 'fastd'
-       return 0
-}
-
-stop() {
-       config_load 'fastd'
-       config_foreach stop_instance 'fastd'
-       return 0
-}
-
-reload() {
-       config_load 'fastd'
-       config_foreach reload_instance 'fastd'
-       return 0
-}
-
-up() {
-       local exists
-       local instance
-       config_load 'fastd'
-       for instance in "$@"; do
-               config_get exists "$instance" 'TYPE'
-               if [ "$exists" = 'fastd' ]; then
-                       start_instance "$instance"
-               fi
-       done
-}
-
-down() {
-       local exists
-       local instance
-       config_load 'fastd'
-       for instance in "$@"; do
-               config_get exists "$instance" 'TYPE'
-               if [ "$exists" = 'fastd' ]; then
-                       stop_instance "$instance"
-               fi
-       done
-}
-
-show_key() {
-       local exists
-       local instance
-       config_load 'fastd'
-       for instance in "$@"; do
-               config_get exists "$instance" 'TYPE'
-               if [ "$exists" = 'fastd' ]; then
-                       show_key_instance "$instance"
-               fi
-       done
-}
-
-generate_key() {
-       local exists
-       local instance
-       config_load 'fastd'
-       for instance in "$@"; do
-               config_get exists "$instance" 'TYPE'
-               if [ "$exists" = 'fastd' ]; then
-                       generate_key_instance "$instance"
-               fi
-       done
-}
index f2d821efee91b2bbf98f6ffbaa1bfc8ed684f67e..1f1d86dce6320128de503892fc467e261d8aa4d1 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=freeradius2
-PKG_VERSION:=2.2.5
+PKG_VERSION:=2.2.6
 PKG_RELEASE:=1
 
 PKG_SOURCE:=freeradius-server-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=ftp://ftp.freeradius.org/pub/freeradius/
-PKG_MD5SUM:=40535bace507d7a3134c3d858f3cbc5a
+PKG_MD5SUM:=e9a6f9bbee9706b008b924061ab3f915
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYRIGHT LICENSE
@@ -26,6 +26,7 @@ PKG_CONFIG_DEPENDS := \
   FREERADIUS_OPENSSL \
   FREERADIUS_NOSSL
 
+PKG_CHECK_FORMAT_SECURITY:=0
 include $(INCLUDE_DIR)/package.mk
 
 define Package/freeradius2/config
index 4bf225276ef4a5f781e4f8c04e3c22dc93b57e18..c254912d46a9313d32070166825148f5b4c79cda 100644 (file)
@@ -1,6 +1,6 @@
 --- a/configure.in
 +++ b/configure.in
-@@ -832,35 +832,6 @@ if test "x$WITH_OPENSSL" = xyes; then
+@@ -796,35 +796,6 @@ if test "x$WITH_OPENSSL" = xyes; then
      OPENSSL_INCLUDE="-DOPENSSL_NO_KRB5"
    fi
  
index bf60dcbdf95900152edf7879b40c4bf6eae9ebd7..ccf57a5cb8aa53de2e923247780162658c38d2de 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fwknop
-PKG_VERSION:=2.6.3
+PKG_VERSION:=2.6.4
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.cipherdyne.org/fwknop/download
-PKG_MD5SUM:=79e8a2feff54b429503bc7cade3bc32e
+PKG_MD5SUM:=259ae562a8fd845b67662fc8e504467e
 PKG_MAINTAINER:=Jonathan Bennett <JBennett@incomsystems.biz>
 PKG_INSTALL:=1
 
index 9362df99a98b77e9a17165baf4ecc78e13e1bc5a..bc0c258c4133670bb25ed97a3f87306a719e4b4e 100644 (file)
@@ -1,6 +1,6 @@
 --- a/server/fwknopd.conf.inst
 +++ b/server/fwknopd.conf.inst
-@@ -284,8 +284,13 @@
+@@ -392,8 +392,13 @@
  # The IPT_FORWARD_ACCESS variable is only used if ENABLE_IPT_FORWARDING is
  # enabled.
  #
index e36790ece207fa1dc29d11c524fb70b0ce3d6989..a909e77fa489da034cfebd36dec7011c90537ea8 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=git
-PKG_VERSION:=2.1.0
-PKG_RELEASE:=2
+PKG_VERSION:=2.2.0
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/software/scm/git/
-PKG_MD5SUM:=47b1f55d9a16be112f7ae2c778a9b30c
+PKG_MD5SUM:=5c9d20582297f8f24606fe49f515b584
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
index e883921e54a0b6597c6a00216dd543d058d191b2..e7ded54dac3b54c1b1307363e1e478f216c6c5f8 100644 (file)
@@ -1,6 +1,6 @@
 --- a/Makefile
 +++ b/Makefile
-@@ -533,16 +533,7 @@ EXTRA_PROGRAMS =
+@@ -529,16 +529,7 @@ EXTRA_PROGRAMS =
  # ... and all the rest that could be moved out of bindir to gitexecdir
  PROGRAMS += $(EXTRA_PROGRAMS)
  
@@ -18,7 +18,7 @@
  
  # Binary suffix, set to .exe for Windows builds
  X =
-@@ -1007,6 +998,12 @@ BUILTIN_OBJS += builtin/verify-commit.o
+@@ -887,6 +878,12 @@ BUILTIN_OBJS += builtin/verify-commit.o
  BUILTIN_OBJS += builtin/verify-pack.o
  BUILTIN_OBJS += builtin/verify-tag.o
  BUILTIN_OBJS += builtin/write-tree.o
@@ -31,7 +31,7 @@
  
  GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
  EXTLIBS =
-@@ -1174,7 +1171,7 @@ endif
+@@ -1049,7 +1046,7 @@ endif
  EXTLIBS += -lz
  
  ifndef NO_OPENSSL
@@ -40,7 +40,7 @@
        ifdef OPENSSLDIR
                BASIC_CFLAGS += -I$(OPENSSLDIR)/include
                OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
-@@ -2067,10 +2064,6 @@ endif
+@@ -1895,10 +1892,6 @@ endif
  git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
  
@@ -51,7 +51,7 @@
  git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
                $(LIBS) $(CURL_LIBCURL)
-@@ -2388,24 +2381,22 @@ endif
+@@ -2216,24 +2209,22 @@ endif
        bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
        execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
        { test "$$bindir/" = "$$execdir/" || \
@@ -80,7 +80,7 @@
        done && \
 --- a/builtin.h
 +++ b/builtin.h
-@@ -137,5 +137,11 @@ extern int cmd_verify_pack(int argc, con
+@@ -138,5 +138,11 @@ extern int cmd_verify_pack(int argc, con
  extern int cmd_show_ref(int argc, const char **argv, const char *prefix);
  extern int cmd_pack_refs(int argc, const char **argv, const char *prefix);
  extern int cmd_replace(int argc, const char **argv, const char *prefix);
 +#include "../upload-pack.c"
 --- a/daemon.c
 +++ b/daemon.c
-@@ -1119,7 +1119,7 @@ static int serve(struct string_list *lis
+@@ -1096,7 +1096,7 @@ static int serve(struct string_list *lis
        return service_loop(&socklist);
  }
  
  {
        int listen_port = 0;
        struct string_list listen_addr = STRING_LIST_INIT_NODUP;
-@@ -1315,12 +1315,13 @@
+@@ -1292,12 +1292,13 @@ int main(int argc, char **argv)
                store_pid(pid_file);
  
        /* prepare argv for serving-processes */
  }
 --- a/fast-import.c
 +++ b/fast-import.c
-@@ -3343,7 +3343,7 @@ static void parse_argv(void)
+@@ -3350,7 +3350,7 @@ static void parse_argv(void)
                read_marks();
  }
  
        { "index-pack", cmd_index_pack, RUN_SETUP_GENTLY },
        { "init", cmd_init_db, NO_SETUP },
        { "init-db", cmd_init_db, NO_SETUP },
-@@ -461,6 +464,7 @@ static struct cmd_struct commands[] = {
+@@ -462,6 +465,7 @@ static struct cmd_struct commands[] = {
        { "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE },
        { "rm", cmd_rm, RUN_SETUP },
        { "send-pack", cmd_send_pack, RUN_SETUP },
        { "shortlog", cmd_shortlog, RUN_SETUP_GENTLY | USE_PAGER },
        { "show", cmd_show, RUN_SETUP },
        { "show-branch", cmd_show_branch, RUN_SETUP },
-@@ -477,6 +481,7 @@ static struct cmd_struct commands[] = {
+@@ -478,6 +482,7 @@ static struct cmd_struct commands[] = {
        { "update-server-info", cmd_update_server_info, RUN_SETUP },
        { "upload-archive", cmd_upload_archive },
        { "upload-archive--writer", cmd_upload_archive_writer },
        { "verify-pack", cmd_verify_pack },
 --- a/http-backend.c
 +++ b/http-backend.c
-@@ -566,7 +566,7 @@ static struct service_cmd {
+@@ -557,7 +557,7 @@ static struct service_cmd {
        {"POST", "/git-receive-pack$", service_rpc}
  };
  
        char *dir;
 --- a/imap-send.c
 +++ b/imap-send.c
-@@ -1365,7 +1365,7 @@ static int git_imap_config(const char *k
-       return 0;
+@@ -1338,7 +1338,7 @@ static void git_imap_config(void)
+       git_config_get_string("imap.authmethod", &server.auth_method);
  }
  
 -int main(int argc, char **argv)
        const char **user_argv;
 --- a/upload-pack.c
 +++ b/upload-pack.c
-@@ -790,7 +790,7 @@ static int upload_pack_config(const char
+@@ -791,7 +791,7 @@ static int upload_pack_config(const char
        return parse_hide_refs_config(var, value, "uploadpack");
  }
  
index 05f7f80481f1d4cae01cbe8c3065d89a7b7e1b35..52ce9f052c83c109e52bc18f0f63e37fe43f76b4 100644 (file)
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=haproxy
-PKG_VERSION:=1.5.5
+PKG_VERSION:=1.5.9
 PKG_RELEASE:=02
 PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://haproxy.1wt.eu/download/1.5/src/
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_MD5SUM:=952e4c2057d763a3fb74173a81028be5
+PKG_MD5SUM:=b7672bb6a8aa188a655b418f3c96f65c
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 PKG_LICENSE:=GPL-2.0
 
diff --git a/net/haproxy/patches/0001-BUG-MEDIUM-patterns-previous-fix-was-incomplete.patch b/net/haproxy/patches/0001-BUG-MEDIUM-patterns-previous-fix-was-incomplete.patch
new file mode 100644 (file)
index 0000000..c21234f
--- /dev/null
@@ -0,0 +1,34 @@
+From bad3c6f1b6d776e5d9951a3b3054b4dce8922c54 Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Wed, 26 Nov 2014 13:17:03 +0100
+Subject: [PATCH 1/2] BUG/MEDIUM: patterns: previous fix was incomplete
+
+Dmitry Sivachenko <trtrmitya@gmail.com> reported that commit 315ec42
+("BUG/MEDIUM: pattern: don't load more than once a pattern list.")
+relies on an uninitialised variable in the stack. While it used to
+work fine during the tests, if the uninitialized variable is non-null,
+some patterns may be aggregated if loaded multiple times, resulting in
+slower processing, which was the original issue it tried to address.
+
+The fix needs to be backported to 1.5.
+(cherry picked from commit 4deaf39243c4d941998b1b0175bad05b8a287c0b)
+---
+ src/pattern.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/pattern.c b/src/pattern.c
+index 20547f9..208e33a 100644
+--- a/src/pattern.c
++++ b/src/pattern.c
+@@ -2096,7 +2096,7 @@ int pattern_read_from_file(struct pattern_head *head, unsigned int refflags,
+       struct pat_ref *ref;
+       struct pattern_expr *expr;
+       struct pat_ref_elt *elt;
+-      int reuse;
++      int reuse = 0;
+       /* Lookup for the existing reference. */
+       ref = pat_ref_lookup(filename);
+-- 
+2.0.4
+
diff --git a/net/haproxy/patches/0001-BUG-MEDIUM-systemd-set-KillMode-to-mixed.patch b/net/haproxy/patches/0001-BUG-MEDIUM-systemd-set-KillMode-to-mixed.patch
deleted file mode 100644 (file)
index aa94fd0..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-From 1f24e3fee3aba83fb3338d17589d0ad0f34f6c73 Mon Sep 17 00:00:00 2001
-From: Apollon Oikonomopoulos <apoikos@debian.org>
-Date: Wed, 8 Oct 2014 15:14:41 +0300
-Subject: [PATCH 1/2] BUG/MEDIUM: systemd: set KillMode to 'mixed'
-
-By default systemd will send SIGTERM to all processes in the service's
-control group. In our case, this includes the wrapper, the master
-process and all worker processes.
-
-Since commit c54bdd2a the wrapper actually catches SIGTERM and survives
-to see the master process getting killed by systemd and regard this as
-an error, placing the unit in a failed state during "systemctl stop".
-
-Since the wrapper now handles SIGTERM by itself, we switch the kill mode
-to 'mixed', which means that systemd will deliver the initial SIGTERM to
-the wrapper only, and if the actual haproxy processes don't exit after a
-given amount of time (default: 90s), a SIGKILL is sent to all remaining
-processes in the control group. See systemd.kill(5) for more
-information.
-
-This should also be backported to 1.5.
-(cherry picked from commit 74f016985ab1fa7a6a5afa301d982e77eba9c96a)
----
- contrib/systemd/haproxy.service.in | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/contrib/systemd/haproxy.service.in b/contrib/systemd/haproxy.service.in
-index 1a3d2c0..0bc5420 100644
---- a/contrib/systemd/haproxy.service.in
-+++ b/contrib/systemd/haproxy.service.in
-@@ -5,6 +5,7 @@ After=network.target
- [Service]
- ExecStart=@SBINDIR@/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid
- ExecReload=/bin/kill -USR2 $MAINPID
-+KillMode=mixed
- Restart=always
- [Install]
--- 
-1.8.5.5
-
diff --git a/net/haproxy/patches/0002-BUG-MEDIUM-config-avoid-skipping-disabled-proxies.patch b/net/haproxy/patches/0002-BUG-MEDIUM-config-avoid-skipping-disabled-proxies.patch
deleted file mode 100644 (file)
index 71a437c..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-From 4ab232ce2fbdaf9b871c411fc7284096219bb854 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Fri, 10 Oct 2014 14:54:25 +0200
-Subject: [PATCH 2/2] BUG/MEDIUM: config: avoid skipping disabled proxies
-
-Paul Taylor and Bryan Talbot found that after commit 419ead8 ("MEDIUM:
-config: compute the exact bind-process before listener's maxaccept"),
-a backend marked "disabled" would cause the next backend to be skipped
-and if it was the last one it would cause a segfault.
-
-The reason is that the commit above changed the "while" loop for a "for"
-loop but a "continue" statement still incrementing the current proxy was
-left in the code for disabled proxies, causing the next one to be skipped
-as well and the last one to try to dereference NULL when seeking ->next.
-
-The quick workaround consists in not disabling backends, or adding an
-empty dummy one after a disabled section.
-
-This fix must be backported to 1.5.
-(cherry picked from commit 06cc905813f1858c0606b44d1e271bd0b6a25224)
----
- src/cfgparse.c | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/src/cfgparse.c b/src/cfgparse.c
-index ec6d923..392a692 100644
---- a/src/cfgparse.c
-+++ b/src/cfgparse.c
-@@ -6104,7 +6104,6 @@ int check_config_validity()
-               if (curproxy->state == PR_STSTOPPED) {
-                       /* ensure we don't keep listeners uselessly bound */
-                       stop_proxy(curproxy);
--                      curproxy = curproxy->next;
-                       continue;
-               }
--- 
-1.8.5.5
-
diff --git a/net/haproxy/patches/0002-BUG-MEDIUM-payload-ensure-that-a-request-channel-is-.patch b/net/haproxy/patches/0002-BUG-MEDIUM-payload-ensure-that-a-request-channel-is-.patch
new file mode 100644 (file)
index 0000000..d2161ef
--- /dev/null
@@ -0,0 +1,49 @@
+From 1e89acb6be9ba6400fe4defd3b6b2cc94c6667d9 Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Wed, 26 Nov 2014 13:24:24 +0100
+Subject: [PATCH 2/2] BUG/MEDIUM: payload: ensure that a request channel is
+ available
+
+Denys Fedoryshchenko reported a segfault when using certain
+sample fetch functions in the "tcp-request connection" rulesets
+despite the warnings. This is because some tests for the existence
+of the channel were missing.
+
+The fetches which were fixed are :
+  - req.ssl_hello_type
+  - rep.ssl_hello_type
+  - req.ssl_sni
+
+This fix must be backported to 1.5.
+(cherry picked from commit 83f2592bcd2e186beeabcba16be16faaab82bd39)
+---
+ src/payload.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/payload.c b/src/payload.c
+index 4057f6f..f62163c 100644
+--- a/src/payload.c
++++ b/src/payload.c
+@@ -72,6 +72,9 @@ smp_fetch_ssl_hello_type(struct proxy *px, struct session *s, void *l7, unsigned
+       chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? s->rep : s->req;
++      if (!chn)
++              goto not_ssl_hello;
++
+       bleft = chn->buf->i;
+       data = (const unsigned char *)chn->buf->p;
+@@ -276,6 +279,9 @@ smp_fetch_ssl_hello_sni(struct proxy *px, struct session *s, void *l7, unsigned
+       chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? s->rep : s->req;
++      if (!chn)
++              goto not_ssl_hello;
++
+       bleft = chn->buf->i;
+       data = (unsigned char *)chn->buf->p;
+-- 
+2.0.4
+
index 29e279a2d05ca0a86a922bdb1384c70dfb063d69..607e2705ec23d75c7f267af3be8113f9e02964b7 100644 (file)
@@ -19,7 +19,7 @@ PKG_SOURCE_VERSION:=version-$(PKG_VERSION)
 
 PKG_MAINTAINER:=Bruno Randolf <br1@einfach.org>
 PKG_LICENSE:=GPL-2.0+
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
 
 PKG_BUILD_PARALLEL:=1
 
index a1ba11761539602eff834f2732f77d1facdf1a85..ae9c83c00d75abea47ef2e1995e0df9aa3c2e663 100644 (file)
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ipsec-tools
 PKG_VERSION:=0.8.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MAINTAINER := "Noah Meyerhans <frodo@morgul.net>"
 PKG_LICENSE := BSD-3-Clause
 
@@ -77,8 +77,7 @@ endef
 
 define Package/ipsec-tools/install
        $(INSTALL_DIR) $(1)/etc
-       $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/racoon/samples/racoon.conf $(1)/etc/
-       $(SED) 's|@sysconfdir_x@|/etc|g' $(1)/etc/racoon.conf
+       $(INSTALL_CONF) ./files/racoon.conf $(1)/etc/racoon.conf
        $(INSTALL_DIR) $(1)/etc/racoon
        $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/racoon/samples/psk.txt $(1)/etc/racoon/
        $(INSTALL_DIR) $(1)/etc/init.d
diff --git a/net/ipsec-tools/files/racoon.conf b/net/ipsec-tools/files/racoon.conf
new file mode 100644 (file)
index 0000000..5c05bcd
--- /dev/null
@@ -0,0 +1,36 @@
+# Simple racoon.conf
+# 
+# Refer to http://wiki.openwrt.org/doc/howto/vpn.ipsec.basics.racoon for
+# details about configuring racoon in OpenWRT.
+#
+# Also read the Linux IPSEC Howto up at 
+# http://www.ipsec-howto.org/t1.html 
+#
+# Manual pages for ipsec-tools are not included with OpenWRT. Refer to
+# the following locations to view them online:
+# http://linux.die.net/man/8/racoon
+# http://linux.die.net/man/5/racoon.conf
+# http://linux.die.net/man/8/setkey
+#
+
+log notify;
+path pre_shared_key "/etc/racoon/psk.txt";
+path certificate "/etc/racoon/certs";
+
+#remote 172.31.1.1 {
+#        exchange_mode main,aggressive;
+#        proposal {
+#                encryption_algorithm 3des;
+#                hash_algorithm sha1;
+#                authentication_method pre_shared_key;
+#                dh_group modp1024;
+#        }
+#        generate_policy off;
+#}
+# 
+#sainfo address 192.168.203.10[any] any address 192.168.22.0/24[any] any {
+#        pfs_group modp768;
+#        encryption_algorithm 3des;
+#        authentication_algorithm hmac_md5;
+#        compression_algorithm deflate;
+#}
index d539b363ffce66cb818418cdb0c5a9fd9bdd6e2a..68053c91ee39187533a2806b26d09ebcf37bb2c2 100644 (file)
@@ -1,17 +1,17 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2009-2011 OpenWrt.org
 # Copyright (C) 2011 Artem Makhutov
+# Copyright (C) 2014 Noah Meyerhans <frodo@morgul.net>
 
-START=49
-
-SERVICE_USE_PID=1
+USE_PROCD=1
 
-start() {
-       mkdir -m 0700 -p /var/racoon
-       [ -f /etc/ipsec.conf ] && /usr/sbin/setkey -f /etc/ipsec.conf
-       service_start /usr/sbin/racoon -f /etc/racoon.conf
-}
+START=49
 
-stop() {
-       service_stop /usr/sbin/racoon
+start_service() {
+    mkdir -m 0700 -p /var/racoon
+    [ -f /etc/ipsec.conf ] && /usr/sbin/setkey -f /etc/ipsec.conf
+    procd_open_instance
+    procd_set_param command /usr/sbin/racoon -F -f /etc/racoon.conf
+    procd_set_param respawn
+    procd_close_instance
 }
index 2f920498da119f9efdc04cb8b71fd87db47d0ed6..3fbfef115f3d55089394ec0c80ec41755b0dae6e 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=irssi
-PKG_VERSION:=0.8.16
+PKG_VERSION:=0.8.17
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://irssi.org/files/
-PKG_MD5SUM:=4346119c4c000d0198cda17666ff1f06
+PKG_MD5SUM:=ecf64be47978d89a742b435a81cb47db
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
diff --git a/net/kismet/Makefile b/net/kismet/Makefile
new file mode 100644 (file)
index 0000000..de60949
--- /dev/null
@@ -0,0 +1,142 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=kismet
+PKG_VERSION:=2013-03-R1b
+PKG_RELEASE:=1
+
+PKG_LICENSE:=LGPLv2.1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.kismetwireless.net/code
+PKG_MD5SUM:=6cdcd78baf2e15edbe8a9de3c5493f02
+
+PKG_BUILD_DEPENDS:=libpcap libncurses libpcre
+
+include $(INCLUDE_DIR)/uclibc++.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/kismet/Default
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Kismet
+  MAINTAINER:=Sebastian Wendel <packages@sourceindex.de>
+  DEPENDS:= $(CXX_DEPENDS) +libnl
+  URL:=http://www.kismetwireless.net/
+  SUBMENU:=wireless
+endef
+
+define Package/kismet/Default/description
+ An 802.11 layer2 wireless network detector, sniffer, and intrusion
+ detection system.
+endef
+
+define Package/kismet-client/conffiles
+/etc/kismet/kismet.conf
+endef
+
+define Package/kismet-drone/conffiles
+/etc/kismet/kismet_drone.conf
+endef
+
+define Package/kismet-server/conffiles
+/etc/kismet/kismet.conf
+endef
+
+define Package/kismet-client
+$(call Package/kismet/Default)
+  TITLE+= client
+  DEPENDS+= +libncurses
+endef
+
+define Package/kismet-client/description
+$(call Package/kismet/Default/description)
+ This package contains the kismet text interface client.
+endef
+
+define Package/kismet-drone
+$(call Package/kismet/Default)
+  DEPENDS+= +libpcap +libpcre +libcap +wireless-tools 
+  TITLE+= drone
+endef
+
+define Package/kismet-drone/description
+$(call Package/kismet/Default/description)
+ This package contains the kismet remote sniffing.and monitoring drone.
+endef
+
+define Package/kismet-server
+$(call Package/kismet/Default)
+  DEPENDS+= +libpcap +libpcre +libcap +wireless-tools
+  TITLE+= server
+endef
+
+define Package/kismet-server/description
+$(call Package/kismet/Default/description)
+ This package contains the kismet server.
+endef
+
+CONFIGURE_ARGS += \
+       --sysconfdir=/etc/kismet \
+
+CONFIGURE_VARS += \
+       CXXFLAGS="$$$$CXXFLAGS -fno-rtti"  \
+       LIBS="-lm" \
+       CLIENTCLIBS="-lm"
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               LD="$(TARGET_CXX)" \
+               all
+endef
+
+define Package/kismet/install
+       $(INSTALL_DIR) $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/kismet $(1)/usr/bin/kismet
+endef
+
+define Package/kismet-client/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/kismet_client $(1)/usr/bin/
+
+       $(INSTALL_DIR) $(1)/etc/kismet/
+       $(INSTALL_CONF) ./files/kismet.conf $(1)/etc/kismet/
+endef
+
+define Package/kismet-drone/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/kismet_drone $(1)/usr/bin/
+
+       $(INSTALL_DIR) $(1)/etc/kismet/
+       $(INSTALL_CONF) ./files/kismet_drone.conf $(1)/etc/kismet/
+
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/kismet_drone.config $(1)/etc/config/kismet_drone
+
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/kismet_drone.init $(1)/etc/init.d/kismet_drone
+endef
+
+define Package/kismet-server/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/kismet_server $(1)/usr/bin/
+
+       $(INSTALL_DIR) $(1)/etc/kismet/
+       $(INSTALL_CONF) ./files/kismet.conf $(1)/etc/kismet/
+
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/kismet_server.config $(1)/etc/config/kismet_server
+
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/kismet_server.init $(1)/etc/init.d/kismet_server
+endef
+
+$(eval $(call BuildPackage,kismet-client))
+$(eval $(call BuildPackage,kismet-drone))
+$(eval $(call BuildPackage,kismet-server))
diff --git a/net/kismet/files/kismet.conf b/net/kismet/files/kismet.conf
new file mode 100644 (file)
index 0000000..971f2e2
--- /dev/null
@@ -0,0 +1,304 @@
+# Kismet config file
+# Most of the "static" configs have been moved to here -- the command line
+# config was getting way too crowded and cryptic.  We want functionality,
+# not continually reading --help!
+
+# Version of Kismet config
+version=2009-newcore
+
+# Name of server (Purely for organizational purposes)
+# If commented out, defaults to host name of system
+# servername=Kismet Server
+
+# Prefix of where we log (as used in the logtemplate later)
+logprefix=/tmp
+
+# Do we process the contents of data frames?  If this is enabled, data
+# frames will be truncated to the headers only immediately after frame type
+# detection.  This will disable IP detection, etc, however it is likely
+# safer (and definitely more polite) if monitoring networks you do not own.
+# hidedata=true
+
+# Do we allow plugins to be used?  This will load plugins from the system
+# and user plugin directiories when set to true (See the README for the default
+# plugin locations).
+allowplugins=false
+
+# See the README for full information on the new source format
+# ncsource=interface:options
+# for example:
+# ncsource=wifi0:type=madwifi
+# ncsource=wlan0:name=intel,hop=false,channel=11
+ncsource=wlan0
+
+# Comma-separated list of sources to enable.  This is only needed if you defined
+# multiple sources and only want to enable some of them.  By default, all defined
+# sources are enabled.
+# For example, if sources with name=prismsource and name=ciscosource are defined,
+# and you only want to enable those two:
+# enablesources=prismsource,ciscosource
+
+# Control which channels we like to spend more time on.  By default, the list
+# of channels is pulled from the driver automatically.  By setting preferred channels,
+# if they are present in the channel list, they'll be set with a timing delay so that
+# more time is spent on them.  Since 1, 6, 11 are the common default channels, it makes
+# sense to spend more time monitoring them.
+# For finer control, see further down in the config for the channellist= directives.
+preferredchannels=1,6,11
+
+# How many channels per second do we hop?  (1-10)
+channelvelocity=3
+
+# By setting the dwell time for channel hopping we override the channelvelocity
+# setting above and dwell on each channel for the given number of seconds.
+#channeldwell=10
+
+# Channels are defined as:
+# channellist=name:ch1,ch2,ch3
+# or
+# channellist=name:range-start-end-width-offset,ch,range,ch,...
+#
+# Channels may be a numeric channel or a frequency
+#
+# Channels may specify an additional wait period.  For common default channels,
+# an additional wait period can be useful.  Wait periods delay for that number 
+# of times per second - so a configuration hopping 10 times per second with a
+# channel of 6:3 would delay 3/10ths of a second on channel 6.
+#
+# Channel lists may have up to 256 channels and ranges (combined).  For power 
+# users scanning more than 256 channels with a single card, ranges must be used.
+#
+# Ranges are meant for "power users" who wish to define a very large number of
+# channels.  A range may specify channels or frequencies, and will automatically
+# sort themselves to cover channels in a non-overlapping fashion.  An example
+# range for the normal 802.11b/g spectrum would be:
+#
+# range-1-11-3-1
+#
+# which indicates starting at 1, ending at 11, a channel width of 3 channels,
+# incrementing by one.  A frequency based definition would be:
+#
+# range-2412-2462-22-5
+#
+# since 11g channels are 22 mhz wide and 5 mhz apart.
+#
+# Ranges have the flaw that they cannot be shared between sources in a non-overlapping
+# way, so multiple sources using the same range may hop in lockstep with each other
+# and duplicate the coverage.
+#
+# channellist=demo:1:3,6:3,11:3,range-5000-6000-20-10
+
+# Default channel lists
+# These channel lists MUST BE PRESENT for Kismet to work properly.  While it is
+# possible to change these, it is not recommended.  These are used when the supported
+# channel list can not be found for the source; to force using these instead of
+# the detected supported channels, override with channellist= in the source defintion
+#
+# IN GENERAL, if you think you want to modify these, what you REALLY want to do is
+# copy them and use channellist= in the packet source.
+channellist=IEEE80211b:1:3,6:3,11:3,2,7,3,8,4,9,5,10
+channellist=IEEE80211a:36,40,44,48,52,56,60,64,149,153,157,161,165
+channellist=IEEE80211ab:1:3,6:3,11:3,2,7,3,8,4,9,5,10,36,40,44,48,52,56,60,64,149,153,157,161,165
+
+# Client/server listen config
+listen=tcp://127.0.0.1:2501
+#listen=tcp://0.0.0.0:2501
+
+# People allowed to connect, comma seperated IP addresses or network/mask
+# blocks.  Netmasks can be expressed as dotted quad (/255.255.255.0) or as
+# numbers (/24)
+allowedhosts=127.0.0.1
+# Maximum number of concurrent GUI's
+maxclients=5
+# Maximum backlog before we start throwing out or killing clients.  The
+# bigger this number, the more memory and the more power it will use.
+maxbacklog=5000
+
+# Server + Drone config options.  To have a Kismet server export live packets
+# as if it were a drone, uncomment these.
+# dronelisten=tcp://127.0.0.1:3501
+# droneallowedhosts=127.0.0.1
+# dronemaxclients=5
+# droneringlen=65535
+
+# OUI file, expected format 00:11:22<tab>manufname
+# IEEE OUI file used to look up manufacturer info.  We default to the
+# wireshark one since most people have that.
+#ouifile=/usr/share/manuf
+
+# Do we have a GPS?
+gps=false
+# Do we use a locally serial attached GPS, or use a gpsd server, or
+# use a fixed virtual gps?
+# (Pick only one)
+gpstype=gpsd
+# Host:port that GPSD is running on.  This can be localhost OR remote!
+gpshost=localhost:2947
+
+
+# gpstype=serial
+# What serial device do we look for the GPS on?
+# gpsdevice=/dev/rfcomm0
+
+# gpstype=virtual
+# gpsposition=100,-50
+# gpsaltitude=1234
+
+# Do we lock the mode?  This overrides coordinates of lock "0", which will
+# generate some bad information until you get a GPS lock, but it will 
+# fix problems with GPS units with broken NMEA that report lock 0
+gpsmodelock=false
+# Do we try to reconnect if we lose our link to the GPS, or do we just
+# let it die and be disabled?
+gpsreconnect=true
+
+# Do we export packets over tun/tap virtual interfaces?
+tuntap_export=false
+# What virtual interface do we use
+tuntap_device=kistap0
+
+# Packet filtering options:
+# filter_tracker - Packets filtered from the tracker are not processed or
+#                  recorded in any way.
+# filter_export  - Controls what packets influence the exported CSV, network,
+#                  xml, gps, etc files.
+# All filtering options take arguments containing the type of address and
+# addresses to be filtered.  Valid address types are 'ANY', 'BSSID',
+# 'SOURCE', and 'DEST'.  Filtering can be inverted by the use of '!' before
+# the address.  For example,
+# filter_tracker=ANY(!"00:00:DE:AD:BE:EF")
+# has the same effect as the previous mac_filter config file option.
+# filter_tracker=...
+# filter_dump=...
+# filter_export=...
+# filter_netclient=...
+
+# Alerts to be reported and the throttling rates.
+# alert=name,throttle/unit,burst
+# The throttle/unit describes the number of alerts of this type that are
+# sent per time unit.  Valid time units are second, minute, hour, and day.
+# Burst describes the number of alerts sent before throttling takes place.
+# For example:
+# alert=FOO,10/min,5
+# Would allow 5 alerts through before throttling is enabled, and will then
+# limit the number of alerts to 10 per minute.
+# A throttle rate of 0 disables throttling of the alert.
+# See the README for a list of alert types.
+alert=ADHOCCONFLICT,5/min,1/sec
+alert=AIRJACKSSID,5/min,1/sec
+alert=APSPOOF,10/min,1/sec
+alert=BCASTDISCON,5/min,2/sec
+alert=BSSTIMESTAMP,5/min,1/sec
+alert=CHANCHANGE,5/min,1/sec
+alert=CRYPTODROP,5/min,1/sec
+alert=DISASSOCTRAFFIC,10/min,1/sec
+alert=DEAUTHFLOOD,5/min,2/sec
+alert=DEAUTHCODEINVALID,5/min,1/sec
+alert=DISCONCODEINVALID,5/min,1/sec
+alert=DHCPNAMECHANGE,5/min,1/sec
+alert=DHCPOSCHANGE,5/min,1/sec
+alert=DHCPCLIENTID,5/min,1/sec
+alert=DHCPCONFLICT,10/min,1/sec
+alert=NETSTUMBLER,5/min,1/sec
+alert=LUCENTTEST,5/min,1/sec
+alert=LONGSSID,5/min,1/sec
+alert=MSFBCOMSSID,5/min,1/sec
+alert=MSFDLINKRATE,5/min,1/sec
+alert=MSFNETGEARBEACON,5/min,1/sec
+alert=NULLPROBERESP,5/min,1/sec
+alert=PROBENOJOIN,5/min,1/sec
+
+# Controls behavior of the APSPOOF alert.  SSID may be a literal match (ssid=) or
+# a regex (ssidregex=) if PCRE was available when kismet was built.  The allowed 
+# MAC list must be comma-separated and enclosed in quotes if there are multiple 
+# MAC addresses allowed.  MAC address masks are allowed.
+#apspoof=Foo1:ssidregex="(?i:foobar)",validmacs=00:11:22:33:44:55
+#apspoof=Foo2:ssid="Foobar",validmacs="00:11:22:33:44:55,aa:bb:cc:dd:ee:ff"
+
+# Known WEP keys to decrypt, bssid,hexkey.  This is only for networks where
+# the keys are already known, and it may impact throughput on slower hardware.
+# Multiple wepkey lines may be used for multiple BSSIDs.
+# wepkey=00:DE:AD:C0:DE:00,FEEDFACEDEADBEEF01020304050607080900
+
+# Is transmission of the keys to the client allowed?  This may be a security
+# risk for some.  If you disable this, you will not be able to query keys from
+# a client.
+allowkeytransmit=true
+
+# How often (in seconds) do we write all our data files (0 to disable)
+writeinterval=10
+
+# Do we use sound?
+# Not to be confused with GUI sound parameter, this controls wether or not the
+# server itself will play sound.  Primarily for headless or automated systems.
+enablesound=false
+# Path to sound player
+soundbin=play
+
+sound=newnet,true
+sound=newcryptnet,true
+sound=packet,true
+sound=gpslock,true
+sound=gpslost,true
+sound=alert,true
+
+# Does the server have speech? (Again, not to be confused with the GUI's speech)
+enablespeech=false
+# Binary used for speech (if not in path, full path must be specified)
+speechbin=flite
+# Specify raw or festival; Flite (and anything else that doesn't need formatting
+# around the string to speak) is 'raw', festival requires the string be wrapped in
+# SayText("...")
+speechtype=raw
+
+# How do we speak?  Valid options:
+# speech    Normal speech
+# nato      NATO spellings (alpha, bravo, charlie)
+# spell     Spell the letters out (aye, bee, sea)
+speechencoding=nato
+
+speech=new,"New network detected s.s.i.d. %1 channel %2"
+speech=alert,"Alert %1"
+speech=gpslost,"G.P.S. signal lost"
+speech=gpslock,"G.P.S. signal O.K."
+
+# How many alerts do we backlog for new clients?  Only change this if you have
+# a -very- low memory system and need those extra bytes, or if you have a high
+# memory system and a huge number of alert conditions.
+alertbacklog=50
+
+# File types to log, comma seperated.  Built-in log file types:
+# alert                                Text file of alerts
+# gpsxml                       XML per-packet GPS log
+# nettxt                       Networks in text format
+# netxml                       Networks in XML format
+# pcapdump                     tcpdump/wireshark compatible pcap log file
+# string                       All strings seen (increases CPU load)
+logtypes=pcapdump,gpsxml,netxml,alert
+
+# Format of the pcap dump (PPI or 80211)
+pcapdumpformat=ppi
+# pcapdumpformat=80211
+
+# Default log title
+logdefault=Kismet
+
+# logtemplate - Filename logging template.
+# This is, at first glance, really nasty and ugly, but you'll hardly ever
+# have to touch it so don't complain too much.
+#
+# %p is replaced by the logging prefix + '/'
+# %n is replaced by the logging instance name
+# %d is replaced by the starting date as Mon-DD-YYYY
+# %D is replaced by the current date as YYYYMMDD
+# %t is replaced by the starting time as HH-MM-SS
+# %i is replaced by the increment log in the case of multiple logs
+# %l is replaced by the log type (pcapdump, strings, etc)
+# %h is replaced by the home directory
+
+logtemplate=%p%n-%D-%t-%i.%l
+
+# Where state info, etc, is stored.  You shouldnt ever need to change this.
+# This is a directory.
+configdir=%h/.kismet/
+
diff --git a/net/kismet/files/kismet_drone.conf b/net/kismet/files/kismet_drone.conf
new file mode 100644 (file)
index 0000000..bd16540
--- /dev/null
@@ -0,0 +1,69 @@
+# Kismet drone config file
+
+version=newcore.1
+
+# Name of drone server (informational)
+servername=Kismet-Drone
+
+# Drone configuration
+# Protocol, interface, and port to listen on
+dronelisten=tcp://127.0.0.1:2502
+# Hosts allowed to connect, comma separated.  May include netmasks.
+# allowedhosts=127.0.0.1,10.10.10.0/255.255.255.0
+droneallowedhosts=127.0.0.1
+# Maximum number of drone clients
+dronemaxclients=10
+droneringlen=65535
+
+# Do we have a GPS?
+gps=true
+# Do we use a locally serial attached GPS, or use a gpsd server?
+# (Pick only one)
+gpstype=gpsd
+# gpstype=serial
+# What serial device do we look for the GPS on?
+gpsdevice=/dev/rfcomm0
+# Host:port that GPSD is running on.  This can be localhost OR remote!
+gpshost=localhost:2947
+# Do we lock the mode?  This overrides coordinates of lock "0", which will
+# generate some bad information until you get a GPS lock, but it will 
+# fix problems with GPS units with broken NMEA that report lock 0
+gpsmodelock=false
+# Do we try to reconnect if we lose our link to the GPS, or do we just
+# let it die and be disabled?
+gpsreconnect=true
+
+# See the README for full information on the new source format
+# ncsource=interface:options
+ncsource=null
+# for example:
+# ncsource=wlan0
+# ncsource=wifi0:type=madwifi
+# ncsource=wlan0:name=intel,hop=false,channel=11
+
+# Special per-source options
+# sourceopts=[sourcename|*]:opt1,opt2
+# sourceopts=*:fuzzycrypt,weakvalidate
+
+# Comma-separated list of sources to enable, if you don't want to enable all
+# the sources you defined.
+# enablesource=source1,source2
+
+# How many channels per second do we hop?  (1-10)
+channelvelocity=5
+
+# By setting the dwell time for channel hopping we override the channelvelocity
+# setting above and dwell on each channel for the given number of seconds.
+#channeldwell=10
+
+# Users outside the US might want to use this list:
+# channellist=IEEE80211b:1,7,13,2,8,3,14,9,4,10,5,11,6,12
+channellist=IEEE80211b:1:3,6:3,11:3,2,7,3,8,4,9,5,10
+
+# US IEEE 80211a
+channellist=IEEE80211a:36,40,44,48,52,56,60,64,149,153,157,161,165
+
+# Combo
+channellist=IEEE80211ab:1:3,6:3,11:3,2,7,3,8,4,9,5,10,36,40,44,48,52,56,60,64,149,153,157,161,165
+
+
diff --git a/net/kismet/files/kismet_drone.config b/net/kismet/files/kismet_drone.config
new file mode 100644 (file)
index 0000000..749505d
--- /dev/null
@@ -0,0 +1,2 @@
+config kismet_drone
+    option enabled 0
diff --git a/net/kismet/files/kismet_drone.init b/net/kismet/files/kismet_drone.init
new file mode 100755 (executable)
index 0000000..2cbbe7e
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2013-2014 OpenWrt.org
+
+START=99
+STOP=99
+
+USE_PROCD=1
+PROG=/usr/bin/kismet_drone
+NAME=kismet_drone
+
+kismet_drone_instance() {
+        procd_open_instance
+        procd_set_param command "${PROG}"
+        procd_append_param command -f /etc/kismet/kismet_drone.conf -s
+        procd_set_param respawn
+        procd_close_instance
+}
+
+start_service() {
+        config_load "${NAME}"
+        config_foreach kismet_drone_instance
+}
+
+stop_service() {
+        service_stop "${PROG}"
+}
diff --git a/net/kismet/files/kismet_server.config b/net/kismet/files/kismet_server.config
new file mode 100644 (file)
index 0000000..ad39f3e
--- /dev/null
@@ -0,0 +1,2 @@
+config kismet_server
+    option enabled 0
diff --git a/net/kismet/files/kismet_server.init b/net/kismet/files/kismet_server.init
new file mode 100755 (executable)
index 0000000..7d731e7
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2013-2014 OpenWrt.org
+
+START=99
+STOP=99
+
+USE_PROCD=1
+PROG=/usr/bin/kismet_server
+NAME=kismet_server
+
+kismet_server_instance() {
+        procd_open_instance
+        procd_set_param command "${PROG}"
+        procd_append_param command -f /etc/kismet/kismet.conf -s
+        procd_set_param respawn
+        procd_close_instance
+}
+
+start_service() {
+        config_load "${NAME}"
+        config_foreach kismet_server_instance
+}
+
+stop_service() {
+        service_stop "${PROG}"
+}
diff --git a/net/kismet/patches/010-dont-add-host-include-paths.patch b/net/kismet/patches/010-dont-add-host-include-paths.patch
new file mode 100644 (file)
index 0000000..23a87bd
--- /dev/null
@@ -0,0 +1,14 @@
+diff --git a/configure b/configure
+index 6936a47..9a85269 100755
+--- a/configure
++++ b/configure
+@@ -6980,9 +6980,6 @@ else
+ fi
+-# Add additional cflags since some distros bury panel.h
+-CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"
+-
+ termcontrol="none";
+ if test "$wantclient" = "yes"; then
index 23740b229fc4615e51c8f37bf8d625f27d6efe8c..2b6c8f335c662c5394a21e584b3e55ab47886ede 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=knot
 PKG_VERSION:=1.5.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
@@ -46,9 +46,27 @@ define Package/knot
        DEPENDS+=+knot-libknot
 endef
 
-define Package/knot-utils
+define Package/knot-dig
        $(call Package/knot/Default)
-       TITLE+= (utils)
+       TITLE+= lookup utility
+       DEPENDS+=+knot-libknot
+endef
+
+define Package/knot-host
+       $(call Package/knot/Default)
+       TITLE+= simple DNS lookup utility
+       DEPENDS+=+knot-libknot
+endef
+
+define Package/knot-nsec3hash
+       $(call Package/knot/Default)
+       TITLE+= simple NSEC3 hash utility
+       DEPENDS+=+knot-libknot
+endef
+
+define Package/knot-nsupdate
+       $(call Package/knot/Default)
+       TITLE+= dynamic DNS update utility
        DEPENDS+=+knot-libknot
 endef
 
@@ -66,8 +84,20 @@ define Package/knot/description
        High-performance authoritative-only DNS server.
 endef
 
-define Package/knot-utils/description
-       DNS utilities: kdig, khost, knsupdate and knsec3hash.
+define Package/knot-dig/description
+       Knot DNS lookup utility.
+endef
+
+define Package/knot-host/description
+       Knot DNS simple DNS lookup utility.
+endef
+
+define Package/knot-nsec3hash/description
+       Knot DNS simple utility to compute NSEC3 hash.
+endef
+
+define Package/knot-nsupdate/description
+       Knot DNS dynamic DNS update utility.
 endef
 
 define Package/knot-tests/description
@@ -114,14 +144,26 @@ define Package/knot/install
        $(INSTALL_BIN) ./files/knotd.init       $(1)/etc/init.d/knotd
 endef
 
-define Package/knot-utils/install
+define Package/knot-dig/install
        $(INSTALL_DIR)                                          $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kdig          $(1)/usr/bin/
+endef
+
+define Package/knot-host/install
+       $(INSTALL_DIR)                                          $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/khost         $(1)/usr/bin/
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsupdate     $(1)/usr/bin/
+endef
+
+define Package/knot-nsec3hash/install
+       $(INSTALL_DIR)                                          $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsec3hash    $(1)/usr/bin/
 endef
 
+define Package/knot-nsupdate/install
+       $(INSTALL_DIR)                                          $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsupdate     $(1)/usr/bin/
+endef
+
 define Package/knot-tests/install
        $(INSTALL_DIR)                                          $(1)/usr/share/knot
        $(INSTALL_BIN) ./files/runtests.sh                      $(1)/usr/share/knot/
@@ -146,5 +188,8 @@ endef
 
 $(eval $(call BuildPackage,knot-libknot))
 $(eval $(call BuildPackage,knot))
-$(eval $(call BuildPackage,knot-utils))
+$(eval $(call BuildPackage,knot-dig))
+$(eval $(call BuildPackage,knot-host))
+$(eval $(call BuildPackage,knot-nsec3hash))
+$(eval $(call BuildPackage,knot-nsupdate))
 $(eval $(call BuildPackage,knot-tests))
index adaac8ac1c638ccf5d7e9a24a78ac6ca815e087b..6eb2e6be6d2a4fa18549026ff3ebae326660674f 100644 (file)
@@ -12,6 +12,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
+PKG_CHECK_FORMAT_SECURITY:=0
 
 include $(INCLUDE_DIR)/package.mk
 
index ea0aef1ee13abfc64b1deee6d70022ee38a9b298..8a4819cc0291dce80313db46ee0ccc3e448e1c01 100644 (file)
@@ -14,6 +14,9 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://lftp.yar.ru/ftp \ http://lftp.cybermirror.org \ http://lftp.cybermirror.org/old
 PKG_MD5SUM:=fc5f4e3b45c9011a193eb8c0c12eb2eb
 
+PKG_LICENSE:=GPL-3.0+
+PKG_LICENSE_FILES:=COPYING
+
 include $(INCLUDE_DIR)/uclibc++.mk
 include $(INCLUDE_DIR)/package.mk
 
@@ -50,6 +53,7 @@ CONFIGURE_ARGS += \
        --without-libiconv-prefix \
        --without-libintl-prefix \
        --without-gnutls \
+       --without-libidn \
        --without-libresolv \
        --with-openssl="$(STAGING_DIR)/usr" \
        --disable-static
index 6bf91441c412c28da973f2f7acbc21234c9797a1..9fab80abb5674e8c29d306b234e0f81ad388aea0 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=http://download.lighttpd.net/lighttpd/releases-1.4.x
 PKG_MD5SUM:=c7ae774eab4cb7ac85e41b712f4ee9ba
 
 PKG_LICENSE:=BSD-3c
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
diff --git a/net/luci-app-bcp38/Makefile b/net/luci-app-bcp38/Makefile
new file mode 100644 (file)
index 0000000..d42916c
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# Copyright (C) 2010 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luci-app-bcp38
+PKG_VERSION:=2
+PKG_RELEASE:=1
+PKG_LICENSE:=Apache-2.0
+LUCI_DIR:=/usr/lib/lua/luci
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luci-app-bcp38
+  SECTION:=luci
+  CATEGORY:=LuCI
+  TITLE:=BCP38 LuCI interface
+  MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
+  PKGARCH:=all
+  DEPENDS:= lua luci-base +bcp38
+  SUBMENU:=3. Applications
+endef
+
+define Package/luci-app-bcp38/description
+       Control BCP38 subnet blocking
+endef
+
+define Build/Compile
+endef
+
+define Build/Configure
+endef
+
+define Package/luci-app-bcp38/install
+       $(INSTALL_DIR) $(1)$(LUCI_DIR)/controller $(1)$(LUCI_DIR)/model/cbi
+       $(INSTALL_DATA) ./files/bcp38-controller.lua $(1)$(LUCI_DIR)/controller/bcp38.lua
+       $(INSTALL_DATA) ./files/bcp38-cbi.lua $(1)$(LUCI_DIR)/model/cbi/bcp38.lua
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_BIN) ./files/uci-defaults-bcp38 $(1)/etc/uci-defaults/luci-bcp38
+endef
+
+define Package/luci-app-bcp38/postinst
+#!/bin/sh
+[ -x /etc/uci-defaults/luci-bcp38 ] && /etc/uci-defaults/luci-bcp38 || exit 0
+endef
+
+define Package/luci-app-bcp38/postrm
+#!/bin/sh
+uci delete ucitrack.@bcp38[0]
+uci commit
+endef
+
+$(eval $(call BuildPackage,luci-app-bcp38))
diff --git a/net/luci-app-bcp38/files/bcp38-cbi.lua b/net/luci-app-bcp38/files/bcp38-cbi.lua
new file mode 100644 (file)
index 0000000..b0b8f38
--- /dev/null
@@ -0,0 +1,58 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2014 Toke Høiland-Jørgensen <toke@toke.dk>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
+
+local wa = require "luci.tools.webadmin"
+local net = require "luci.model.network".init()
+local ifaces = net:get_interfaces()
+
+m = Map("bcp38", translate("BCP38"),
+       translate("This function blocks packets with private address destinations " ..
+               "from going out onto the internet as per " ..
+               "<a href=\"http://tools.ietf.org/html/bcp38\">BCP 38</a>."))
+
+s = m:section(TypedSection, "bcp38", translate("BCP38 config"))
+s.anonymous = true
+-- BASIC
+e = s:option(Flag, "enabled", translate("Enable"))
+e.rmempty = false
+
+a = s:option(Flag, "detect_upstream", translate("Auto-detect upstream IP"),
+                               translate("Attempt to automatically detect if the upstream IP " ..
+                                       "will be blocked by the configuration, and add an exception if it will. " ..
+                                       "If this does not work correctly, you can add exceptions manually below."))
+a.rmempty = false
+
+n = s:option(ListValue, "interface", translate("Interface name"), translate("Interface to apply the blocking to " ..
+                                                       "(should be the upstream WAN interface)."))
+for _, iface in ipairs(ifaces) do
+     if iface:is_up() then
+       n:value(iface:name())
+     end
+end
+n.rmempty = false
+
+ma = s:option(DynamicList, "match",
+       translate("Blocked IP ranges"))
+
+ma.datatype = "ip4addr"
+
+nm = s:option(DynamicList, "nomatch",
+       translate("Allowed IP ranges"), translate("Takes precedence over blocked ranges. "..
+                                                 "Use to whitelist your upstream network if you're behind a double NAT " ..
+                                                 "and the auto-detection doesn't work."))
+
+nm.datatype = "ip4addr"
+
+
+return m
diff --git a/net/luci-app-bcp38/files/bcp38-controller.lua b/net/luci-app-bcp38/files/bcp38-controller.lua
new file mode 100644 (file)
index 0000000..7ea2283
--- /dev/null
@@ -0,0 +1,7 @@
+module("luci.controller.bcp38", package.seeall)
+
+function index()
+       entry({"admin", "network", "firewall", "bcp38"},
+               cbi("bcp38"),
+               _("BCP38"), 50).dependent = false
+end
diff --git a/net/luci-app-bcp38/files/uci-defaults-bcp38 b/net/luci-app-bcp38/files/uci-defaults-bcp38
new file mode 100755 (executable)
index 0000000..c204236
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+uci -q batch <<-EOF >/dev/null
+       delete ucitrack.@bcp38[-1]
+       add ucitrack bcp38
+        add_list ucitrack.@bcp38[0].affects=firewall
+       commit ucitrack
+EOF
+
+rm -f /tmp/luci-indexcache
+exit 0
diff --git a/net/luci-app-ocserv/Makefile b/net/luci-app-ocserv/Makefile
deleted file mode 100644 (file)
index 18ff019..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#    Copyright (C) 2014 Nikos Mavrogiannopoulos
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-#    The full GNU General Public License is included in this distribution in
-#    the file called "COPYING".
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luci-app-ocserv
-PKG_RELEASE:=1
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luci-app-ocserv
-  SECTION:=luci
-  CATEGORY:=LuCI
-  SUBMENU:=3. Applications
-  TITLE:= OpenConnect VPN server configuration and status module
-  DEPENDS:=+luci-lib-json +luci-lib-nixio +luci-mod-admin-full +ocserv
-  MAINTAINER:= Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
-endef
-
-define Package/luci-app-ocserv/description
-       ocserv web module for LuCi web interface
-endef
-
-define Build/Prepare
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-# Fixme: How can we add <%+ocserv_status%> in view/admin_status/index.htm?
-define Package/luci-app-ocserv/install
-       $(CP) ./files/* $(1)/
-endef
-
-$(eval $(call BuildPackage,luci-app-ocserv))
-
diff --git a/net/luci-app-ocserv/files/usr/lib/lua/luci/controller/ocserv.lua b/net/luci-app-ocserv/files/usr/lib/lua/luci/controller/ocserv.lua
deleted file mode 100644 (file)
index 5cb0fb9..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2014 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-module("luci.controller.ocserv", package.seeall)
-
-function index()
-       if not nixio.fs.access("/etc/config/ocserv") then
-               return
-       end
-
-       local page
-
-       page = entry({"admin", "services", "ocserv"}, alias("admin", "services", "ocserv", "main"),
-               _("OpenConnect VPN"))
-       page.dependent = true
-       
-       page = entry({"admin", "services", "ocserv", "main"},
-               cbi("ocserv/main"),
-               _("Server Settings"), 200)
-       page.dependent = true
-
-       page = entry({"admin", "services", "ocserv", "users"},
-               cbi("ocserv/users"),
-               _("User Settings"), 300)
-       page.dependent = true
-
-       entry({"admin", "services", "ocserv", "status"},
-               call("ocserv_status")).leaf = true
-
-       entry({"admin", "services", "ocserv", "disconnect"},
-               call("ocserv_disconnect")).leaf = true
-
-end
-
-function ocserv_status()
-       local ipt = io.popen("/usr/bin/occtl show users");
-
-       if ipt then
-
-               local fwd = { }
-               while true do
-
-                       local ln = ipt:read("*l")
-                       if not ln then break end
-               
-                       local id, user, group, vpn_ip, ip, device, time, cipher, status = 
-                               ln:match("^%s*(%d+)%s+([-_%w]+)%s+([%.%*-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+).*")
-                       if id then
-                               fwd[#fwd+1] = {
-                                       id = id,
-                                       user = user,
-                                       group = group,
-                                       vpn_ip = vpn_ip,
-                                       ip = ip,
-                                       device = device,
-                                       time = time,
-                                       cipher = cipher,
-                                       status = status
-                               }
-                       end
-               end
-               ipt:close()
-               luci.http.prepare_content("application/json")
-               luci.http.write_json(fwd)
-       end
-end
-
-function ocserv_disconnect(num)
-       local idx = tonumber(num)
-       local uci = luci.model.uci.cursor()
-
-       if idx and idx > 0 then
-               luci.sys.call("/usr/bin/occtl disconnect id %d" % idx)
-               luci.http.status(200, "OK")
-
-               return
-       end
-       luci.http.status(400, "Bad request")
-end
diff --git a/net/luci-app-ocserv/files/usr/lib/lua/luci/model/cbi/ocserv/main.lua b/net/luci-app-ocserv/files/usr/lib/lua/luci/model/cbi/ocserv/main.lua
deleted file mode 100644 (file)
index 65f8878..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2014 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-local niulib = require "luci.niulib"
-]]--
-
-local fs = require "nixio.fs"
-local has_ipv6 = fs.access("/proc/net/ipv6_route")
-
-m = Map("ocserv", translate("OpenConnect VPN"))
-
-s = m:section(TypedSection, "ocserv", "OpenConnect")
-s.anonymous = true
-
-s:tab("general",  translate("General Settings"))
-s:tab("ca", translate("CA certificate"))
-s:tab("template", translate("Edit Template"))
-
-local e = s:taboption("general", Flag, "enable", translate("Enable server"))
-e.rmempty = false
-e.default = "1"
-
-function m.on_commit(map)
-       luci.sys.call("/usr/bin/occtl reload  >/dev/null 2>&1")
-end
-
-function e.write(self, section, value)
-       if value == "0" then
-               luci.sys.call("/etc/init.d/ocserv stop >/dev/null 2>&1")
-               luci.sys.call("/etc/init.d/ocserv disable  >/dev/null 2>&1")
-       else
-               luci.sys.call("/etc/init.d/ocserv enable  >/dev/null 2>&1")
-               luci.sys.call("/etc/init.d/ocserv restart  >/dev/null 2>&1")
-       end
-       Flag.write(self, section, value)
-end
-
-local o
-
-o = s:taboption("general", ListValue, "auth", translate("User Authentication"),
-       translate("The authentication method for the users. The simplest is plain with a single username-password pair. Use PAM modules to authenticate using another server (e.g., LDAP, Radius)."))
-o.rmempty = false
-o.default = "plain"
-o:value("plain")
-o:value("PAM")
-
-o = s:taboption("general", Value, "zone", translate("Firewall Zone"),
-       translate("The firewall zone that the VPN clients will be set to"))
-o.nocreate = true
-o.default = "lan"
-o.template = "cbi/firewall_zonelist"
-
-s:taboption("general", Value, "port", translate("Port"),
-       translate("The same UDP and TCP ports will be used"))
-s:taboption("general", Value, "max_clients", translate("Max clients"))
-s:taboption("general", Value, "max_same", translate("Max same clients"))
-s:taboption("general", Value, "dpd", translate("Dead peer detection time (secs)"))
-
-local pip = s:taboption("general", Flag, "predictable_ips", translate("Predictable IPs"),
-       translate("The assigned IPs will be selected deterministically"))
-pip.default = "1"
-
-local udp = s:taboption("general", Flag, "udp", translate("Enable UDP"),
-       translate("Enable UDP channel support; this must be enabled unless you know what you are doing"))
-udp.default = "1"
-
-local cisco = s:taboption("general", Flag, "cisco_compat", translate("AnyConnect client compatibility"),
-       translate("Enable support for CISCO AnyConnect clients"))
-cisco.default = "1"
-
-ipaddr = s:taboption("general", Value, "ipaddr", translate("VPN <abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-Network-Address"))
-ipaddr.default = "192.168.100.1"
-
-nm = s:taboption("general", Value, "netmask", translate("VPN <abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-Netmask"))
-nm.default = "255.255.255.0"
-nm:value("255.255.255.0")
-nm:value("255.255.0.0")
-nm:value("255.0.0.0")
-
-if has_ipv6 then
-       ip6addr = s:taboption("general", Value, "ip6addr", translate("VPN <abbr title=\"Internet Protocol Version 6\">IPv6</abbr>-Network-Address"), translate("<abbr title=\"Classless Inter-Domain Routing\">CIDR</abbr>-Notation: address/prefix"))
-end
-
-
-tmpl = s:taboption("template", Value, "_tmpl",
-       translate("Edit the template that is used for generating the ocserv configuration."))
-
-tmpl.template = "cbi/tvalue"
-tmpl.rows = 20
-
-function tmpl.cfgvalue(self, section)
-       return nixio.fs.readfile("/etc/ocserv/ocserv.conf.template")
-end
-
-function tmpl.write(self, section, value)
-       value = value:gsub("\r\n?", "\n")
-       nixio.fs.writefile("/etc/ocserv/ocserv.conf.template", value)
-end
-
-ca = s:taboption("ca", Value, "_ca",
-       translate("View the CA certificate used by this server. You will need to save it as 'ca.pem' and import it into the clients."))
-
-ca.template = "cbi/tvalue"
-ca.rows = 20
-
-function ca.cfgvalue(self, section)
-       return nixio.fs.readfile("/etc/ocserv/ca.pem")
-end
-
---[[DNS]]--
-
-s = m:section(TypedSection, "dns", translate("DNS servers"),
-       translate("The DNS servers to be provided to clients; can be either IPv6 or IPv4"))
-s.anonymous = true
-s.addremove = true
-s.template = "cbi/tblsection"
-
-s:option(Value, "ip", translate("IP Address")).rmempty = true
-
---[[Routes]]--
-
-s = m:section(TypedSection, "routes", translate("Routing table"),
-       translate("The routing table to be provided to clients; you can mix IPv4 and IPv6 routes, the server will send only the appropriate. Leave empty to set a default route"))
-s.anonymous = true
-s.addremove = true
-s.template = "cbi/tblsection"
-
-s:option(Value, "ip", translate("IP Address")).rmempty = true
-
-o = s:option(Value, "netmask", translate("Netmask (or IPv6-prefix)"))
-o.default = "255.255.255.0"
-o:value("255.255.255.0")
-o:value("255.255.0.0")
-o:value("255.0.0.0")
-
-
-return m
diff --git a/net/luci-app-ocserv/files/usr/lib/lua/luci/model/cbi/ocserv/user-config.lua b/net/luci-app-ocserv/files/usr/lib/lua/luci/model/cbi/ocserv/user-config.lua
deleted file mode 100644 (file)
index 65f8878..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2014 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-local niulib = require "luci.niulib"
-]]--
-
-local fs = require "nixio.fs"
-local has_ipv6 = fs.access("/proc/net/ipv6_route")
-
-m = Map("ocserv", translate("OpenConnect VPN"))
-
-s = m:section(TypedSection, "ocserv", "OpenConnect")
-s.anonymous = true
-
-s:tab("general",  translate("General Settings"))
-s:tab("ca", translate("CA certificate"))
-s:tab("template", translate("Edit Template"))
-
-local e = s:taboption("general", Flag, "enable", translate("Enable server"))
-e.rmempty = false
-e.default = "1"
-
-function m.on_commit(map)
-       luci.sys.call("/usr/bin/occtl reload  >/dev/null 2>&1")
-end
-
-function e.write(self, section, value)
-       if value == "0" then
-               luci.sys.call("/etc/init.d/ocserv stop >/dev/null 2>&1")
-               luci.sys.call("/etc/init.d/ocserv disable  >/dev/null 2>&1")
-       else
-               luci.sys.call("/etc/init.d/ocserv enable  >/dev/null 2>&1")
-               luci.sys.call("/etc/init.d/ocserv restart  >/dev/null 2>&1")
-       end
-       Flag.write(self, section, value)
-end
-
-local o
-
-o = s:taboption("general", ListValue, "auth", translate("User Authentication"),
-       translate("The authentication method for the users. The simplest is plain with a single username-password pair. Use PAM modules to authenticate using another server (e.g., LDAP, Radius)."))
-o.rmempty = false
-o.default = "plain"
-o:value("plain")
-o:value("PAM")
-
-o = s:taboption("general", Value, "zone", translate("Firewall Zone"),
-       translate("The firewall zone that the VPN clients will be set to"))
-o.nocreate = true
-o.default = "lan"
-o.template = "cbi/firewall_zonelist"
-
-s:taboption("general", Value, "port", translate("Port"),
-       translate("The same UDP and TCP ports will be used"))
-s:taboption("general", Value, "max_clients", translate("Max clients"))
-s:taboption("general", Value, "max_same", translate("Max same clients"))
-s:taboption("general", Value, "dpd", translate("Dead peer detection time (secs)"))
-
-local pip = s:taboption("general", Flag, "predictable_ips", translate("Predictable IPs"),
-       translate("The assigned IPs will be selected deterministically"))
-pip.default = "1"
-
-local udp = s:taboption("general", Flag, "udp", translate("Enable UDP"),
-       translate("Enable UDP channel support; this must be enabled unless you know what you are doing"))
-udp.default = "1"
-
-local cisco = s:taboption("general", Flag, "cisco_compat", translate("AnyConnect client compatibility"),
-       translate("Enable support for CISCO AnyConnect clients"))
-cisco.default = "1"
-
-ipaddr = s:taboption("general", Value, "ipaddr", translate("VPN <abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-Network-Address"))
-ipaddr.default = "192.168.100.1"
-
-nm = s:taboption("general", Value, "netmask", translate("VPN <abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-Netmask"))
-nm.default = "255.255.255.0"
-nm:value("255.255.255.0")
-nm:value("255.255.0.0")
-nm:value("255.0.0.0")
-
-if has_ipv6 then
-       ip6addr = s:taboption("general", Value, "ip6addr", translate("VPN <abbr title=\"Internet Protocol Version 6\">IPv6</abbr>-Network-Address"), translate("<abbr title=\"Classless Inter-Domain Routing\">CIDR</abbr>-Notation: address/prefix"))
-end
-
-
-tmpl = s:taboption("template", Value, "_tmpl",
-       translate("Edit the template that is used for generating the ocserv configuration."))
-
-tmpl.template = "cbi/tvalue"
-tmpl.rows = 20
-
-function tmpl.cfgvalue(self, section)
-       return nixio.fs.readfile("/etc/ocserv/ocserv.conf.template")
-end
-
-function tmpl.write(self, section, value)
-       value = value:gsub("\r\n?", "\n")
-       nixio.fs.writefile("/etc/ocserv/ocserv.conf.template", value)
-end
-
-ca = s:taboption("ca", Value, "_ca",
-       translate("View the CA certificate used by this server. You will need to save it as 'ca.pem' and import it into the clients."))
-
-ca.template = "cbi/tvalue"
-ca.rows = 20
-
-function ca.cfgvalue(self, section)
-       return nixio.fs.readfile("/etc/ocserv/ca.pem")
-end
-
---[[DNS]]--
-
-s = m:section(TypedSection, "dns", translate("DNS servers"),
-       translate("The DNS servers to be provided to clients; can be either IPv6 or IPv4"))
-s.anonymous = true
-s.addremove = true
-s.template = "cbi/tblsection"
-
-s:option(Value, "ip", translate("IP Address")).rmempty = true
-
---[[Routes]]--
-
-s = m:section(TypedSection, "routes", translate("Routing table"),
-       translate("The routing table to be provided to clients; you can mix IPv4 and IPv6 routes, the server will send only the appropriate. Leave empty to set a default route"))
-s.anonymous = true
-s.addremove = true
-s.template = "cbi/tblsection"
-
-s:option(Value, "ip", translate("IP Address")).rmempty = true
-
-o = s:option(Value, "netmask", translate("Netmask (or IPv6-prefix)"))
-o.default = "255.255.255.0"
-o:value("255.255.255.0")
-o:value("255.255.0.0")
-o:value("255.0.0.0")
-
-
-return m
diff --git a/net/luci-app-ocserv/files/usr/lib/lua/luci/model/cbi/ocserv/users.lua b/net/luci-app-ocserv/files/usr/lib/lua/luci/model/cbi/ocserv/users.lua
deleted file mode 100644 (file)
index 35c20fc..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2014 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-local dsp = require "luci.dispatcher"
-local nixio  = require "nixio"
-
-m = Map("ocserv", translate("OpenConnect VPN"))
-
-if m.uci:get("ocserv", "config", "auth") == "plain" then
-
---[[Users]]--
-
-function m.on_commit(map)
-       luci.sys.call("/etc/init.d/ocserv restart >/dev/null 2>&1")
-end
-
-s = m:section(TypedSection, "ocservusers", translate("Available users"))
-s.anonymous = true
-s.addremove = true
-s.template = "cbi/tblsection"
-
-s:option(Value, "name", translate("Name")).rmempty = true
-s:option(DummyValue, "group", translate("Group")).rmempty = true
-pwd = s:option(Value, "password", translate("Password"))
-pwd.password = false
-
-function pwd.write(self, section, value)
-       local pass
-       if string.match(value, "^\$%d\$.*") then
-               pass = value
-       else
-               local t = tonumber(nixio.getpid()*os.time())
-               local salt = "$5$" .. t .. "$"
-               pass = nixio.crypt(value, salt)
-       end
-       Value.write(self, section, pass)
-end    
-
---[[if plain]]--
-end
-
-local lusers = { }
-local fd = io.popen("/usr/bin/occtl show users", "r")
-if fd then local ln
-       repeat
-               ln = fd:read("*l")
-               if not ln then break end
-
-               local id, user, group, vpn_ip, ip, device, time, cipher, status = 
-                       ln:match("^%s*(%d+)%s+([-_%w]+)%s+([%.%*-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+).*")
-               if id then
-                       table.insert(lusers, {id, user, group, vpn_ip, ip, device, time, cipher, status})
-               end
-       until not ln
-       fd:close()
-end
-
-
---[[Active Users]]--
-
-local s = m:section(Table, lusers, translate("Active users"))
-s.anonymous = true
-s.rmempty = true
-s.template = "cbi/tblsection"
-
-s:option(DummyValue, 1, translate("ID"))
-s:option(DummyValue, 2, translate("Username"))
-s:option(DummyValue, 3, translate("Group"))
-s:option(DummyValue, 4, translate("IP"))
-s:option(DummyValue, 5, translate("VPN IP"))
-s:option(DummyValue, 6, translate("Device"))
-s:option(DummyValue, 7, translate("Time"))
-s:option(DummyValue, 8, translate("Cipher"))
-s:option(DummyValue, 9, translate("Status"))
-
-return m
diff --git a/net/luci-app-ocserv/files/usr/lib/lua/luci/view/admin_status/index/ocserv.htm b/net/luci-app-ocserv/files/usr/lib/lua/luci/view/admin_status/index/ocserv.htm
deleted file mode 100644 (file)
index 4575806..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<%+ocserv_status%>
diff --git a/net/luci-app-ocserv/files/usr/lib/lua/luci/view/ocserv_status.htm b/net/luci-app-ocserv/files/usr/lib/lua/luci/view/ocserv_status.htm
deleted file mode 100644 (file)
index fabc1bc..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-<script type="text/javascript">//<![CDATA[
-
-       function ocserv_disconnect(idx) {
-               XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ocserv", "disconnect")%>/' + idx, null,
-                       function(x)
-                       {
-                               var tb = document.getElementById('ocserv_status_table');
-                               if (tb && (idx < tb.rows.length))
-                                       tb.rows[0].parentNode.removeChild(tb.rows[idx]);
-                       }
-               );
-       }
-
-       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "ocserv", "status")%>', null,
-               function(x, st)
-               {
-                       var tb = document.getElementById('ocserv_status_table');
-                       if (st && tb)
-                       {
-                               /* clear all rows */
-                               while( tb.rows.length > 1 )
-                                       tb.deleteRow(1);
-
-                               for( var i = 0; i < st.length; i++ )
-                               {
-                                       var tr = tb.insertRow(-1);
-                                               tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
-
-                                       tr.insertCell(-1).innerHTML = st[i].user;
-                                       tr.insertCell(-1).innerHTML = st[i].group;
-                                       tr.insertCell(-1).innerHTML = st[i].vpn_ip;
-                                       tr.insertCell(-1).innerHTML = st[i].ip;
-                                       tr.insertCell(-1).innerHTML = st[i].device;
-                                       tr.insertCell(-1).innerHTML = st[i].time;
-                                       tr.insertCell(-1).innerHTML = st[i].cipher;
-                                       tr.insertCell(-1).innerHTML = st[i].status;
-
-                                       tr.insertCell(-1).innerHTML = String.format(
-                                               '<input class="cbi-button cbi-input-remove" type="button" value="<%:Disconnect%>" onclick="ocserv_disconnect(%d)" />',
-                                                       st[i].id
-                                       );
-                               }
-
-                               if( tb.rows.length == 1 )
-                               {
-                                       var tr = tb.insertRow(-1);
-                                               tr.className = 'cbi-section-table-row';
-
-                                       var td = tr.insertCell(-1);
-                                               td.colSpan = 5;
-                                               td.innerHTML = '<em><br /><%:There are no active users.%></em>';
-                               }
-                       }
-               }
-       );
-//]]></script>
-
-<fieldset class="cbi-section">
-       <legend><%:Active OpenConnect Users%></legend>
-       <table class="cbi-section-table" id="ocserv_status_table">
-               <tr class="cbi-section-table-titles">
-                       <th class="cbi-section-table-cell"><%:User%></th>
-                       <th class="cbi-section-table-cell"><%:Group%></th>
-                       <th class="cbi-section-table-cell"><%:IP Address%></th>
-                       <th class="cbi-section-table-cell"><%:VPN IP Address%></th>
-                       <th class="cbi-section-table-cell"><%:Device%></th>
-                       <th class="cbi-section-table-cell"><%:Time%></th>
-                       <th class="cbi-section-table-cell"><%:Cipher%></th>
-                       <th class="cbi-section-table-cell"><%:Status%></th>
-                       <th class="cbi-section-table-cell">&#160;</th>
-               </tr>
-               <tr class="cbi-section-table-row">
-                       <td colspan="5"><em><br /><%:Collecting data...%></em></td>
-               </tr>
-       </table>
-</fieldset>
diff --git a/net/luci-app-sqm/Makefile b/net/luci-app-sqm/Makefile
new file mode 100644 (file)
index 0000000..f0bb2a0
--- /dev/null
@@ -0,0 +1,67 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luci-app-sqm
+PKG_VERSION:=3
+PKG_RELEASE:=1
+PKG_LICENSE:=GPLv2
+LUCI_DIR:=/usr/lib/lua/luci
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luci-app-sqm
+  SECTION:=luci
+  CATEGORY:=LuCI
+  TITLE:=SQM Scripts - LuCI interface
+  MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
+  PKGARCH:=all
+  DEPENDS:= lua luci-base +sqm-scripts
+  SUBMENU:=3. Applications
+endef
+
+define Package/luci-app-sqm/description
+       Control the simple_qos SQM script
+endef
+
+define Build/Compile
+endef
+
+define Build/Configure
+endef
+
+define Package/luci-app-sqm/install
+       $(INSTALL_DIR) $(1)$(LUCI_DIR)/controller $(1)$(LUCI_DIR)/model/cbi
+       $(INSTALL_DATA) ./files/sqm-controller.lua $(1)$(LUCI_DIR)/controller/sqm.lua
+       $(INSTALL_DATA) ./files/sqm-cbi.lua $(1)$(LUCI_DIR)/model/cbi/sqm.lua
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_BIN) ./files/uci-defaults-sqm $(1)/etc/uci-defaults/luci-sqm
+endef
+
+define Package/luci-app-sqm/postinst
+#!/bin/sh
+which uci > /dev/null || exit 0
+uci -q get ucitrack.@sqm[0] > /dev/null || {
+  uci add ucitrack sqm > /dev/null
+  uci set ucitrack.@sqm[0].init=sqm
+  uci add_list ucitrack.@firewall[0].affects=sqm
+  uci commit
+}
+endef
+
+define Package/luci-app-sqm/postrm
+#!/bin/sh
+which uci > /dev/null || exit 0
+uci -q get ucitrack.@sqm[0] > /dev/null && {
+  uci delete ucitrack.@sqm[0]
+  uci del_list ucitrack.@firewall[0].affects=sqm
+  uci commit
+}
+endef
+
+$(eval $(call BuildPackage,luci-app-sqm))
diff --git a/net/luci-app-sqm/files/sqm-cbi.lua b/net/luci-app-sqm/files/sqm-cbi.lua
new file mode 100644 (file)
index 0000000..e7d79df
--- /dev/null
@@ -0,0 +1,217 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2014 Steven Barth <steven@midlink.org>
+Copyright 2014 Dave Taht <dave.taht@bufferbloat.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
+
+local wa = require "luci.tools.webadmin"
+local fs = require "nixio.fs"
+local net = require "luci.model.network".init()
+local sys = require "luci.sys"
+--local ifaces = net:get_interfaces()
+local ifaces = sys.net:devices()
+local path = "/usr/lib/sqm"
+
+m = Map("sqm", translate("Smart Queue Management"),
+       translate("With <abbr title=\"Smart Queue Management\">SQM</abbr> you " ..
+               "can enable traffic shaping, better mixing (Fair Queueing)," ..
+               " active queue length management (AQM) " ..
+               " and prioritisation on one " ..
+               "network interface."))
+
+s = m:section(TypedSection, "queue", translate("Queues"))
+s:tab("tab_basic", translate("Basic Settings"))
+s:tab("tab_qdisc", translate("Queue Discipline"))
+s:tab("tab_linklayer", translate("Link Layer Adaptation"))
+s.addremove = true -- set to true to allow adding SQM instances in the GUI
+s.anonymous = true
+
+-- BASIC
+e = s:taboption("tab_basic", Flag, "enabled", translate("Enable"))
+e.rmempty = false
+
+n = s:taboption("tab_basic", ListValue, "interface", translate("Interface name"))
+-- sm lifted from luci-app-wol, the original implementation failed to show pppoe-ge00 type interface names
+for _, iface in ipairs(ifaces) do
+--     if iface:is_up() then
+--     n:value(iface:name())
+--     end
+       if iface ~= "lo" then 
+               n:value(iface) 
+       end
+end
+n.rmempty = false
+
+
+dl = s:taboption("tab_basic", Value, "download", translate("Download speed (kbit/s) (ingress):"))
+dl.datatype = "and(uinteger,min(0))"
+dl.rmempty = false
+
+ul = s:taboption("tab_basic", Value, "upload", translate("Upload speed (kbit/s) (egress):"))
+ul.datatype = "and(uinteger,min(0))"
+ul.rmempty = false
+
+-- QDISC
+
+c = s:taboption("tab_qdisc", ListValue, "qdisc", translate("Queueing discipline"))
+c:value("fq_codel", "fq_codel ("..translate("default")..")")
+c:value("efq_codel")
+c:value("nfq_codel")
+c:value("sfq")
+c:value("codel")
+c:value("ns2_codel")
+c:value("pie")
+c:value("sfq")
+c.default = "fq_codel"
+c.rmempty = false
+
+local qos_desc = ""
+sc = s:taboption("tab_qdisc", ListValue, "script", translate("Queue setup script"))
+for file in fs.dir(path) do
+  if string.find(file, ".qos$") then
+    sc:value(file)
+  end
+  if string.find(file, ".qos.help$") then
+    fh = io.open(path .. "/" .. file, "r")
+    qos_desc = qos_desc .. "<p><b>" .. file:gsub(".help$", "") .. ":</b><br />" .. fh:read("*a") .. "</p>"
+  end
+end
+sc.default = "simple.qos"
+sc.rmempty = false
+sc.description = qos_desc
+
+ad = s:taboption("tab_qdisc", Flag, "qdisc_advanced", translate("Show Advanced Configuration"))
+ad.default = false
+ad.rmempty = true
+
+squash_dscp  = s:taboption("tab_qdisc", ListValue, "squash_dscp", translate("Squash DSCP on inbound packets (ingress):"))
+squash_dscp:value("1", "SQUASH")
+squash_dscp:value("0", "DO NOT SQUASH")
+squash_dscp.default = "1"
+squash_dscp.rmempty = true
+squash_dscp:depends("qdisc_advanced", "1")
+
+squash_ingress = s:taboption("tab_qdisc", ListValue, "squash_ingress", translate("Ignore DSCP on ingress:"))
+squash_ingress:value("1", "Ignore")
+squash_ingress:value("0", "Allow")
+squash_ingress.default = "1"
+squash_ingress.rmempty = true
+squash_ingress:depends("qdisc_advanced", "1")
+
+iecn = s:taboption("tab_qdisc", ListValue, "ingress_ecn", translate("Explicit congestion notification (ECN) status on inbound packets (ingress):"))
+iecn:value("ECN", "ECN ("..translate("default")..")")
+iecn:value("NOECN")
+iecn.default = "ECN"
+iecn.rmempty = true
+iecn:depends("qdisc_advanced", "1")
+
+eecn = s:taboption("tab_qdisc", ListValue, "egress_ecn", translate("Explicit congestion notification (ECN) status on outbound packets (egress)."))
+eecn:value("NOECN", "NOECN ("..translate("default")..")")
+eecn:value("ECN")
+eecn.default = "NOECN"
+eecn.rmempty = true
+eecn:depends("qdisc_advanced", "1")
+
+ad2 = s:taboption("tab_qdisc", Flag, "qdisc_really_really_advanced", translate("Show Dangerous Configuration"))
+ad2.default = false
+ad2.rmempty = true
+ad2:depends("qdisc_advanced", "1")
+
+ilim = s:taboption("tab_qdisc", Value, "ilimit", translate("Hard limit on ingress queues; leave empty for default."))
+-- ilim.default = 1000
+ilim.isnumber = true
+ilim.datatype = "and(uinteger,min(0))"
+ilim.rmempty = true
+ilim:depends("qdisc_really_really_advanced", "1")
+
+elim = s:taboption("tab_qdisc", Value, "elimit", translate("Hard limit on egress queues; leave empty for default."))
+-- elim.default = 1000
+elim.datatype = "and(uinteger,min(0))"
+elim.rmempty = true
+elim:depends("qdisc_really_really_advanced", "1")
+
+
+itarg = s:taboption("tab_qdisc", Value, "itarget", translate("Latency target for ingress, e.g 5ms [units: s, ms, or  us]; leave empty for default, or auto for automatic selection."))
+itarg.datatype = "string"
+itarg.rmempty = true
+itarg:depends("qdisc_really_really_advanced", "1")
+
+etarg = s:taboption("tab_qdisc", Value, "etarget", translate("Latency target for egress, e.g. 5ms [units: s, ms, or  us]; leave empty for default, or auto for automatic selection."))
+etarg.datatype = "string"
+etarg.rmempty = true
+etarg:depends("qdisc_really_really_advanced", "1")
+
+
+
+iqdisc_opts = s:taboption("tab_qdisc", Value, "iqdisc_opts", translate("Advanced option string to pass to the ingress queueing disciplines; no error checking, use very carefully."))
+iqdisc_opts.rmempty = true
+iqdisc_opts:depends("qdisc_really_really_advanced", "1")
+
+eqdisc_opts = s:taboption("tab_qdisc", Value, "eqdisc_opts", translate("Advanced option string to pass to the egress queueing disciplines; no error checking, use very carefully."))
+eqdisc_opts.rmempty = true
+eqdisc_opts:depends("qdisc_really_really_advanced", "1")
+
+-- LINKLAYER
+ll = s:taboption("tab_linklayer", ListValue, "linklayer", translate("Which link layer to account for:"))
+ll:value("none", "none ("..translate("default")..")")
+ll:value("ethernet", "Ethernet with overhead: select for e.g. VDSL2.")
+ll:value("atm", "ATM: select for e.g. ADSL1, ADSL2, ADSL2+.")
+-- ll:value("adsl")    -- reduce the options
+ll.default = "none"
+
+po = s:taboption("tab_linklayer", Value, "overhead", translate("Per Packet Overhead (byte):"))
+po.datatype = "and(integer,min(-1500))"
+po.default = 0
+po.isnumber = true
+po.rmempty = true
+po:depends("linklayer", "ethernet")
+-- po:depends("linklayer", "adsl")
+po:depends("linklayer", "atm")
+
+
+adll = s:taboption("tab_linklayer", Flag, "linklayer_advanced", translate("Show Advanced Linklayer Options, (only needed if MTU > 1500)"))
+adll.rmempty = true
+adll:depends("linklayer", "ethernet")
+-- adll:depends("linklayer", "adsl")
+adll:depends("linklayer", "atm")
+
+smtu = s:taboption("tab_linklayer", Value, "tcMTU", translate("Maximal Size for size and rate calculations, tcMTU (byte); needs to be >= interface MTU + overhead:"))
+smtu.datatype = "and(uinteger,min(0))"
+smtu.default = 2047
+smtu.isnumber = true
+smtu.rmempty = true
+smtu:depends("linklayer_advanced", "1")
+
+stsize = s:taboption("tab_linklayer", Value, "tcTSIZE", translate("Number of entries in size/rate tables, TSIZE; for ATM choose TSIZE = (tcMTU + 1) / 16:"))
+stsize.datatype = "and(uinteger,min(0))"
+stsize.default = 128
+stsize.isnumber = true
+stsize.rmempty = true
+stsize:depends("linklayer_advanced", "1")
+
+smpu = s:taboption("tab_linklayer", Value, "tcMPU", translate("Minimal packet size, MPU (byte); needs to be > 0 for ethernet size tables:"))
+smpu.datatype = "and(uinteger,min(0))"
+smpu.default = 0
+smpu.isnumber = true
+smpu.rmempty = true
+smpu:depends("linklayer_advanced", "1")
+
+lla = s:taboption("tab_linklayer", ListValue, "linklayer_adaptation_mechanism", translate("Which linklayer adaptation mechanism to use; for testing only"))
+lla:value("htb_private")
+lla:value("tc_stab", "tc_stab ("..translate("default")..")")
+lla.default = "tc_stab"
+lla.rmempty = true
+lla:depends("linklayer_advanced", "1")
+
+-- PRORITIES?
+
+return m
diff --git a/net/luci-app-sqm/files/sqm-controller.lua b/net/luci-app-sqm/files/sqm-controller.lua
new file mode 100644 (file)
index 0000000..d36f5fd
--- /dev/null
@@ -0,0 +1,26 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2008 Steven Barth <steven@midlink.org>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
+
+module("luci.controller.sqm", package.seeall)
+
+function index()
+       if not nixio.fs.access("/etc/config/sqm") then
+               return
+       end
+       
+       local page
+
+       page = entry({"admin", "network", "sqm"}, cbi("sqm"), _("SQM QoS"))
+       page.dependent = true
+end
diff --git a/net/luci-app-sqm/files/uci-defaults-sqm b/net/luci-app-sqm/files/uci-defaults-sqm
new file mode 100644 (file)
index 0000000..cd9e7b2
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+uci -q batch <<-EOF >/dev/null
+       delete ucitrack.@sqm[-1]
+       add ucitrack sqm
+       set ucitrack.@sqm[-1].init=sqm
+        add_list ucitrack.@firewall[0].affects=sqm
+       commit ucitrack
+EOF
+
+rm -f /tmp/luci-indexcache
+exit 0
diff --git a/net/luci-proto-openconnect/Makefile b/net/luci-proto-openconnect/Makefile
deleted file mode 100644 (file)
index a7b0d35..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#    Copyright (C) 2014 Nikos Mavrogiannopoulos
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-#    The full GNU General Public License is included in this distribution in
-#    the file called "COPYING".
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luci-proto-openconnect
-PKG_RELEASE:=1
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luci-proto-openconnect
-  SECTION:=luci
-  CATEGORY:=LuCI
-  SUBMENU:=6. Protocols
-  TITLE:= OpenConnect VPN protocol configuration
-  DEPENDS:=+luci-mod-admin-full +luci-lib-nixio +openconnect
-  MAINTAINER:= Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
-endef
-
-define Package/luci-proto-openconnect/description
-       openconnect web module for LuCi web interface
-endef
-
-define Build/Prepare
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-# Fixme: How can we add <%+openconnect_status%> in view/admin_status/index.htm?
-define Package/luci-proto-openconnect/install
-       $(CP) ./files/* $(1)/
-endef
-
-$(eval $(call BuildPackage,luci-proto-openconnect))
-
diff --git a/net/luci-proto-openconnect/files/usr/lib/lua/luci/model/cbi/admin_network/proto_openconnect.lua b/net/luci-proto-openconnect/files/usr/lib/lua/luci/model/cbi/admin_network/proto_openconnect.lua
deleted file mode 100644 (file)
index 2e2eace..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2014 Nikos Mavrogiannopoulos <nmav@gnutls.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-]]--
-
-local map, section, net = ...
-
-local server, username, password, cert, ca
-local oc_cert_file, oc_key_file, oc_ca_file
-
-local ifc = net:get_interface():name()
-
-oc_cert_file = "/etc/openconnect/user-cert-" .. ifc .. ".pem"
-oc_key_file = "/etc/openconnect/user-key-" .. ifc .. ".pem"
-oc_ca_file = "/etc/openconnect/ca-" .. ifc .. ".pem"
-
-server = section:taboption("general", Value, "server", translate("VPN Server"))
-server.datatype = "host"
-
-port = section:taboption("general", Value, "port", translate("VPN Server port"))
-port.placeholder = "443"
-port.datatype    = "port"
-
-section:taboption("general", Value, "serverhash", translate("VPN Server's certificate SHA1 hash"))
-
-section:taboption("general", Value, "authgroup", translate("AuthGroup"))
-
-username = section:taboption("general", Value, "username", translate("Username"))
-password = section:taboption("general", Value, "password", translate("Password"))
-password.password = true
-
-
-cert = section:taboption("advanced", Value, "usercert", translate("User certificate (PEM encoded)"))
-cert.template = "cbi/tvalue"
-cert.rows = 10
-
-function cert.cfgvalue(self, section)
-       return nixio.fs.readfile(oc_cert_file)
-end
-
-function cert.write(self, section, value)
-       value = value:gsub("\r\n?", "\n")
-       nixio.fs.writefile(oc_cert_file, value)
-end
-
-cert = section:taboption("advanced", Value, "userkey", translate("User key (PEM encoded)"))
-cert.template = "cbi/tvalue"
-cert.rows = 10
-
-function cert.cfgvalue(self, section)
-       return nixio.fs.readfile(oc_key_file)
-end
-
-function cert.write(self, section, value)
-       value = value:gsub("\r\n?", "\n")
-       nixio.fs.writefile(oc_key_file, value)
-end
-
-
-ca = section:taboption("advanced", Value, "ca", translate("CA certificate; if empty it will be saved after the first connection."))
-ca.template = "cbi/tvalue"
-ca.rows = 10
-
-function ca.cfgvalue(self, section)
-       return nixio.fs.readfile(oc_ca_file)
-end
-
-function ca.write(self, section, value)
-       value = value:gsub("\r\n?", "\n")
-       nixio.fs.writefile(oc_ca_file, value)
-end
diff --git a/net/luci-proto-openconnect/files/usr/lib/lua/luci/model/network/proto_openconnect.lua b/net/luci-proto-openconnect/files/usr/lib/lua/luci/model/network/proto_openconnect.lua
deleted file mode 100644 (file)
index f5c16c7..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
---[[
-LuCI - Network model - dhcpv6 protocol extension
-
-Copyright 2012 David Woodhouse
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-]]--
-
-local netmod = luci.model.network
-local interface = luci.model.network.interface
-local proto = netmod:register_protocol("openconnect")
-
-function proto.get_i18n(self)
-       return luci.i18n.translate("OpenConnect (CISCO AnyConnect)")
-end
-
-function proto.ifname(self)
-       return "vpn-" .. self.sid
-end
-
-function proto.get_interface(self)
-       return interface(self:ifname(), self)
-end
-
-function proto.opkg_package(self)
-       return "openconnect"
-end
-
-function proto.is_installed(self)
-       return nixio.fs.access("/lib/netifd/proto/openconnect.sh")
-end
-
-function proto.is_floating(self)
-       return true
-end
-
-function proto.is_virtual(self)
-       return true
-end
-
-function proto.get_interfaces(self)
-       return nil
-end
-
-function proto.contains_interface(self, ifc)
-        return (netmod:ifnameof(ifc) == self:ifname())
-
-end
-
-netmod:register_pattern_virtual("^vpn-%w")
index 7e36ceb5e3a7cfda0d64b687ee4013d9bff00a26..50a3c4280e5b74e4792c0732795da9b2560c6278 100644 (file)
@@ -15,6 +15,7 @@ PKG_SOURCE:=mDNSResponder-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://opensource.apple.com/tarballs/mDNSResponder/
 PKG_MD5SUM:=39142ab70bd82a096801ce346f86cbab
 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
+PKG_LICENSE:=Apache-2.0
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/mDNSResponder-$(PKG_VERSION)
 
index 8e300ccd3e5be91011d5fe3d6b50b6be24c5f577..a8e92f204df1913e41ca5f5937face353653109a 100644 (file)
@@ -12,7 +12,7 @@ PKG_NAME:=mosquitto
 PKG_VERSION:=1.3.5
 PKG_RELEASE:=1
 PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILE:=LICENSE.txt
+PKG_LICENSE_FILES:=LICENSE.txt
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://mosquitto.org/files/source/
index a89d0826b7ec1a997e86ca1562a7cb6e1b403a5d..2668b7b3e5dd457b7e3527e7347adbf3b4f53d68 100644 (file)
@@ -119,6 +119,16 @@ snmpd_exec_add() {
        config_get miboid "$cfg" miboid
        echo "exec $miboid $name $prog $args" >> $RUN_C
 }
+snmpd_disk_add() {
+        local cfg="$1"
+        local disk='disk'
+
+        config_get partition "$cfg" partition
+        [ -n "$partition" ] || return 0
+        config_get size "$cfg" size
+        [ -n "$size" ] || return 0
+        echo "$disk $partition $size" >> $RUN_C
+}
 start() {
        [ -d $LIB_D ] || mkdir -p $LIB_D
        [ -d $LOG_D ] || mkdir -p $LOG_D
@@ -136,7 +146,8 @@ start() {
        config_foreach snmpd_access_add access
        config_foreach snmpd_pass_add pass
        config_foreach snmpd_exec_add exec
-
+       config_foreach snmpd_disk_add disk
+       
        [ -f $DEFAULT ] && . $DEFAULT
        $DEBUG /usr/sbin/snmpd $OPTIONS
 }
index b5cfcd757b226a2fac98030cb9404a223343e9ad..1a3468f4a59ad68aaff94bf05b0b8bf0121b3a18 100644 (file)
@@ -7,9 +7,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nfs-kernel-server
-PKG_VERSION:=1.3.0
+PKG_VERSION:=1.3.1
 PKG_RELEASE:=1
-PKG_MD5SUM:=3ac3726eda563946d1f44ac3e5b61d56
+PKG_MD5SUM:=97f157f954edb6d4d4385a0c5986f36f
 
 PKG_SOURCE_URL:=@SF/nfs
 PKG_SOURCE:=nfs-utils-$(PKG_VERSION).tar.bz2
diff --git a/net/nfs-kernel-server/patches/100-nfs_utils_uclibc.patch b/net/nfs-kernel-server/patches/100-nfs_utils_uclibc.patch
deleted file mode 100644 (file)
index 5e4877e..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
---- a/support/nfs/svc_socket.c
-+++ b/support/nfs/svc_socket.c
-@@ -40,10 +40,13 @@ int getservport(u_long number, const cha
-       char rpcdata[1024], servdata[1024];
-       struct rpcent rpcbuf, *rpcp;
-       struct servent servbuf, *servp = NULL;
--      int ret;
--
-+      int ret=0;
-+#ifndef __UCLIBC__
-       ret = getrpcbynumber_r(number, &rpcbuf, rpcdata, sizeof rpcdata,
-                               &rpcp);
-+#else
-+      rpcp = getrpcbynumber (number);
-+#endif
-       if (ret == 0 && rpcp != NULL) {
-               /* First try name.  */
-               ret = getservbyname_r(rpcp->r_name, proto, &servbuf, servdata,
---- a/utils/mountd/cache.c
-+++ b/utils/mountd/cache.c
-@@ -166,6 +166,7 @@ static void auth_unix_gid(FILE *f)
-       pw = getpwuid(uid);
-       if (!pw)
-               rv = -1;
-+#ifndef __UCLIBC__
-       else {
-               rv = getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups);
-               if (rv == -1 && ngroups >= groups_len) {
-@@ -180,6 +181,7 @@ static void auth_unix_gid(FILE *f)
-                       }
-               }
-       }
-+#endif
-       qword_printuint(f, uid);
-       qword_printtimefrom(f, DEFAULT_TTL);
-       if (rv >= 0) {
diff --git a/net/nfs-kernel-server/patches/100-no_malloc_h.patch b/net/nfs-kernel-server/patches/100-no_malloc_h.patch
new file mode 100644 (file)
index 0000000..afe4c98
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/tools/rpcgen/rpc_cout.c
++++ b/tools/rpcgen/rpc_cout.c
+@@ -36,7 +36,6 @@ static char sccsid[] = "@(#)rpc_cout.c 1
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdlib.h>
+-#include <malloc.h>
+ #include <ctype.h>
+ #include "rpc_parse.h"
+ #include "rpc_util.h"
diff --git a/net/nfs-kernel-server/patches/101-no_malloc_h.patch b/net/nfs-kernel-server/patches/101-no_malloc_h.patch
deleted file mode 100644 (file)
index afe4c98..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/tools/rpcgen/rpc_cout.c
-+++ b/tools/rpcgen/rpc_cout.c
-@@ -36,7 +36,6 @@ static char sccsid[] = "@(#)rpc_cout.c 1
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
--#include <malloc.h>
- #include <ctype.h>
- #include "rpc_parse.h"
- #include "rpc_util.h"
index e84b3cc355da24b895e669a94ab484809507950d..251b91e2dbe512b13127ae25a259f0fd749da4f1 100644 (file)
@@ -14,14 +14,14 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nmap
 PKG_VERSION:=6.47
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MAINTAINER=Nuno Goncalves <nunojpg@gmail.com>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://nmap.org/dist/
 PKG_MD5SUM:=edfe81f6763223c0a29bfa15a8526e2a
 PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 
 PKG_INSTALL:=1
 
@@ -87,7 +87,8 @@ CONFIGURE_ARGS += \
        --with-libdnet=included \
        --with-libpcre=included \
        --with-libpcap="$(STAGING_DIR)/usr" \
-       --without-liblua
+       --without-liblua \
+       --without-zenmap
 
 CONFIGURE_VARS += CXXFLAGS="$$$$CXXFLAGS -fno-builtin"
 
index c785635099dd4e16a1a950f2ae49b0abc08f0de8..f1bfd4f44cfb34da42b16eb8ce6981bc9da93173 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2011 OpenWrt.org
+# Copyright (C) 2006-2014 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -15,6 +15,9 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/
 PKG_MD5SUM:=00df80a84ec9528fcfb09498075525bc
 
+PKG_LICENSE:=Unique
+PKG_LICENSE_FILES:=COPYRIGHT html/copyright.html
+
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 
 PKG_FIXUP:=autoreconf
@@ -35,7 +38,7 @@ endef
 
 define Package/ntpd/Default/description
  The ISC ntp suite is a collection of tools used to synchronize the
- system clock with remote NTP time servers and run/montior local NTP
+ system clock with remote NTP time servers and run/monitor local NTP
  servers.
 endef
 
diff --git a/net/nut/Config.in b/net/nut/Config.in
new file mode 100644 (file)
index 0000000..b37dbca
--- /dev/null
@@ -0,0 +1,107 @@
+       config NUT_SERVER
+               depends on PACKAGE_nut
+               bool "Include server components (upsd)"
+               help
+                       upsd is responsible for serving the data from the drivers to the
+                       clients. It connects to each driver and maintains a local cache of the
+                       current state. Queries from the clients are served from this cache, so
+                       delays are minimal. This program is essential, and must be running at
+                       all times to actually make any use out of the drivers and clients.
+               default y
+               
+       config NUT_CLIENTS_UPSC
+               depends on PACKAGE_nut
+               bool "Include command line client (upsc)"
+               help
+                       upsc is provided as a quick way to poll the status of a UPS server. It
+                       can be used inside shell scripts and other programs that need UPS data
+                       but don't want to include the full interface.
+               default y
+               
+       config NUT_CLIENTS_UPSLOG
+               depends on PACKAGE_nut
+               bool "Include logging client (upslog)"
+               help
+                       upslog is a daemon that will poll a UPS at periodic intervals, fetch the
+                       variables that interest you, format them, and write them to a file.
+               default n
+               
+       config NUT_CLIENTS_UPSCMD
+               depends on PACKAGE_nut
+               bool "Include UPS controller (upscmd)"
+               help
+                       upscmd allows you to invoke "instant commands" in your UPS hardware. Not
+                       all hardware supports this, so check the list with -l to see if anything
+                       will work on your equipment. On hardware that supports it, you can use
+                       this program to start and stop battery tests, invoke a front panel test
+                       (beep!), turn the load on or off, and more.
+               default n
+               
+       config NUT_CLIENTS_UPSRW
+               depends on PACKAGE_nut
+               bool "Include UPS variable editor (upsrw)"
+               help
+                       upsrw allows you to view and change the read/write variables inside your
+                       UPS. It sends commands via the upsd to your driver, which configures the
+                       hardware for you. The list of variables that allow you to change their
+                       values is based on the capabilities of your UPS equipment. Not all
+                       models support this feature. Typically, cheaper hardware does not
+                       support any of them.
+               default n
+               
+       config NUT_CLIENTS_UPSMON
+               depends on PACKAGE_nut
+               bool "Include monitor and shutdown controller (upsmon)"
+               help
+                       upsmon is the client process that is responsible for the most important
+                       part of UPS monitoring--shutting down the system when the power goes
+                       out. It can call out to other helper programs for notification purposes
+                       during power events. upsmon can monitor multiple systems using a single
+                       process. Every UPS that is defined in the upsmon.conf configuration file
+                       is assigned a power value and a type (slave or master).
+               default y
+               
+       config NUT_CLIENTS_UPSSCHED
+               depends on NUT_CLIENTS_UPSMON
+               bool "Include helper for triggering events from upsmon (upssched)"
+               help
+                       upssched was created to allow users to execute programs at times relative
+                       to events being monitored by upsmon. The original purpose was to allow
+                       for a shutdown to occur after some fixed period on battery, but there are
+                       other uses that are possible.
+                       You can alternatively write your own script and save some space.
+               default n
+       
+       config NUT_SSL
+               depends on PACKAGE_nut
+               bool "Build with support for OpenSSL"
+               help
+                       SSL allows sessions between upsd and clients to be encrypted and can
+                       also be used to authenticate servers. This means that stealing port
+                       3493 from upsd will no longer net you interesting passwords. SSL is
+                       available via OpenSSL on OpenWRT (NSS doesn't seem to work). If you
+                       are happy with using passwords to authenticate clients, you can save
+                       some space and build NUT without SSL support.
+               default n
+       
+       config NUT_DRIVER_SERIAL
+               depends on PACKAGE_nut
+               bool "Build with support for serial drivers"
+               help
+                       If you have a UPS connected via serial, select this.
+               default n
+       
+       config NUT_DRIVER_USB
+               depends on PACKAGE_nut
+               bool "Build with support for USB drivers"
+               help
+                       If you have a UPS connected via USB, select this.
+               default y
+       
+       config NUT_DRIVER_SNMP
+               depends on PACKAGE_nut
+               bool "Build with support for SNMP drivers"
+               help
+                       If you have a UPS you can connect to via SNMP, select this.
+               default n
+               
diff --git a/net/nut/Makefile b/net/nut/Makefile
new file mode 100644 (file)
index 0000000..d23b7cb
--- /dev/null
@@ -0,0 +1,292 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=nut
+PKG_VERSION:=2.7.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.networkupstools.org/source/2.7/
+PKG_MD5SUM:=c3568b42e058cfc385b46d25140dced4
+PKG_MAINTAINER:=Martin Rowe <martin.p.rowe@gmail.com>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=LICENSE-GPL2
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/nut-$(PKG_VERSION)
+PKG_INSTALL:=1
+
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_NUT_CLIENTS_UPSC \
+       CONFIG_NUT_CLIENTS_UPSCMD \
+       CONFIG_NUT_CLIENTS_UPSLOG \
+       CONFIG_NUT_CLIENTS_UPSMON \
+       CONFIG_NUT_CLIENTS_UPSRW \
+       CONFIG_NUT_CLIENTS_UPSSCHED \
+       CONFIG_NUT_DRIVER_SERIAL \
+       CONFIG_NUT_DRIVER_SNMP \
+       CONFIG_NUT_DRIVER_USB \
+       CONFIG_NUT_SERVER \
+       CONFIG_NUT_SSL \
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/nut/Default
+       SECTION:=net
+       CATEGORY:=Network
+       URL:=http://www.networkupstools.org/
+       DEPENDS:=nut
+endef
+
+define Package/nut/description
+Network UPS Tools (NUT) is a client/server monitoring system that
+allows computers to share uninterruptible power supply (UPS) and
+power distribution unit (PDU) hardware. Clients access the hardware
+through the server, and are notified whenever the power status
+changes.
+endef
+
+define Package/nut
+       $(call Package/nut/Default)
+       TITLE:=Network UPS Tools
+       DEPENDS:= \
+               +NUT_DRIVER_SNMP:libnetsnmp \
+               +NUT_DRIVER_USB:libusb-compat \
+               +NUT_SSL:libopenssl
+       MENU:=1
+endef
+
+define Package/nut/config
+       source "$(SOURCE)/Config.in"
+endef
+
+define Package/nut/conffiles
+       /etc/nut/nut.conf
+       $(if $(CONFIG_NUT_CLIENTS_UPSMON),/etc/nut/upsmon.conf)
+       $(if $(CONFIG_NUT_CLIENTS_UPSSCHED),/etc/nut/upssched.conf)
+       $(if $(CONFIG_NUT_SERVER),/etc/nut/ups.conf)
+       $(if $(CONFIG_NUT_SERVER),/etc/nut/upsd.conf)
+       $(if $(CONFIG_NUT_SERVER),/etc/nut/upsd.users)
+endef
+
+define Package/nut/install
+       $(INSTALL_DIR) $(1)/etc/nut
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/nut.conf.sample $(1)/etc/nut/nut.conf
+       $(if $(or $(CONFIG_NUT_CLIENTS_UPSC),\
+               $(CONFIG_NUT_CLIENTS_UPSCMD),\
+               $(CONFIG_NUT_CLIENTS_LOG),\
+               $(CONFIG_NUT_CLIENTS_UPSRW),\
+               $(CONFIG_NUT_CLIENTS_UPSMON),\
+               $(CONFIG_NUT_CLIENTS_UPSSCHED)),$(CP) $(PKG_INSTALL_DIR)/usr/lib/libupsclient.so* $(1)/usr/lib/)
+       $(if $(or $(CONFIG_NUT_SERVER),\
+               $(CONFIG_NUT_CLIENTS_UPSMON)),$(INSTALL_DIR) $(1)/etc/init.d)
+       $(if $(CONFIG_NUT_SERVER),$(INSTALL_DIR) $(1)/lib/nut)
+       $(if $(CONFIG_NUT_SERVER),$(INSTALL_DIR) $(1)/usr/share/nut)
+       $(if $(CONFIG_NUT_SERVER),$(CP) ./files/nut-server.init $(1)/etc/init.d/)
+       $(if $(CONFIG_NUT_SERVER),$(CP) $(PKG_INSTALL_DIR)/usr/sbin/upsd $(1)/usr/sbin)
+       $(if $(CONFIG_NUT_SERVER),$(CP) $(PKG_INSTALL_DIR)/usr/sbin/upsdrvctl $(1)/usr/sbin)
+       $(if $(CONFIG_NUT_SERVER),$(CP) $(PKG_INSTALL_DIR)/usr/share/nut/cmdvartab $(1)/usr/share/nut/)
+       $(if $(CONFIG_NUT_SERVER),$(CP) $(PKG_INSTALL_DIR)/usr/share/nut/driver.list $(1)/usr/share/nut/)
+       $(if $(CONFIG_NUT_SERVER),$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/ups.conf.sample $(1)/etc/nut/ups.conf)
+       $(if $(CONFIG_NUT_SERVER),$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsd.conf.sample $(1)/etc/nut/upsd.conf)
+       $(if $(CONFIG_NUT_SERVER),$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsd.users.sample $(1)/etc/nut/upsd.users)
+       $(if $(CONFIG_NUT_CLIENTS_UPSC),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upsc $(1)/usr/bin/)
+       $(if $(CONFIG_NUT_CLIENTS_UPSCMD),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upscmd $(1)/usr/bin/)
+       $(if $(CONFIG_NUT_CLIENTS_LOG),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upslog $(1)/usr/bin/)
+       $(if $(CONFIG_NUT_CLIENTS_UPSRW),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upsrw $(1)/usr/bin/)
+       $(if $(CONFIG_NUT_CLIENTS_UPSMON),$(CP) ./files/nut-monitor.init $(1)/etc/init.d/)
+       $(if $(CONFIG_NUT_CLIENTS_UPSMON),$(CP) $(PKG_INSTALL_DIR)/usr/sbin/upsmon $(1)/usr/sbin/)
+       $(if $(CONFIG_NUT_CLIENTS_UPSMON),$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsmon.conf.sample $(1)/etc/nut/upsmon.conf)
+       $(if $(CONFIG_NUT_CLIENTS_UPSSCHED),$(CP) $(PKG_INSTALL_DIR)/usr/bin/upssched-cmd $(1)/usr/bin/)
+       $(if $(CONFIG_NUT_CLIENTS_UPSSCHED),$(CP) $(PKG_INSTALL_DIR)/usr/sbin/upssched $(1)/usr/sbin/)
+       $(if $(CONFIG_NUT_CLIENTS_UPSSCHED),$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upssched.conf.sample $(1)/etc/nut/upssched.conf)
+endef
+
+# Dealing with all of the drivers is very repetitive, but the previous
+# maintainer had a neat solution which just needed some tweaking.
+define DriverPackage
+        define Package/nut-driver-$(2)
+               $(call Package/nut/Default)
+               TITLE:=$(2) (NUT $(1) driver)
+               $(if $(filter $(1),serial),DEPENDS+= @NUT_DRIVER_SERIAL)
+               $(if $(filter $(1),snmp),DEPENDS+= @NUT_DRIVER_SNMP)
+               $(if $(filter $(1),usb),DEPENDS+= @NUT_DRIVER_USB)
+        endef
+       # Deliberately empty description in order to trigger a build failure.
+       # It should be overridden by the list below, and when updating to a
+       # new version of nut we will need to provide descriptions for any new
+       # drivers.
+        define Package/nut-driver-$(2)/description
+               
+        endef
+        define Package/nut-driver-$(2)/install
+               $(INSTALL_DIR) $$(1)/lib/nut
+               $(CP) $$(PKG_INSTALL_DIR)/lib/nut/$(2) $$(1)/lib/nut/
+               $(if $(filter $(2),clone),$(CP) $$(PKG_INSTALL_DIR)/lib/nut/$(2)-outlet $$(1)/lib/nut/)
+        endef
+endef
+define DriverDescription
+        define Package/nut-driver-$(2)/description
+               $(3)
+        endef
+endef
+# These lists are lifted *directly* from drivers/Makefile.am in the nut
+# source tree. This it to make it simpler to keep in sync when updating
+# to a newer version of nut. Do not edit this manually.
+#
+# DO NOT EDIT (except to update with a fresh cut/paste)!
+SERIAL_DRIVERLIST = al175 bcmxcp belkin belkinunv bestfcom     \
+ bestfortress bestuferrups bestups dummy-ups etapro everups     \
+ gamatronic genericups isbmex liebert liebert-esp2 masterguard metasys \
+ oldmge-shut mge-utalk microdowell mge-shut oneac optiups powercom rhino        \
+ safenet skel solis tripplite tripplitesu upscode2 victronups powerpanel \
+ blazer_ser clone clone-outlet ivtscd apcsmart apcsmart-old apcupsd-ups riello_ser     \
+ nutdrv_qx
+SNMP_DRIVERLIST = snmp-ups
+USB_LIBUSB_DRIVERLIST = usbhid-ups bcmxcp_usb tripplite_usb \
+ blazer_usb richcomm_usb riello_usb \
+ nutdrv_atcl_usb \
+ nutdrv_qx
+# END: DO NOT EDIT!
+SERIAL_DRIVERLIST_IGNORE:=skel clone-outlet nutdrv_qx
+# nutdrv_qx can be either USB or serial. Given most routers have USB
+# instead of serial ports, and not wanting two identical packages with
+# different names that conflict with each other, only the option for the
+# driver with USB bindings is provided. If you really want to save that
+# tiny bit of space and build it without USB support, remove nutdrv_qx
+# from the previous line.
+
+$(foreach d,$(filter-out $(SERIAL_DRIVERLIST_IGNORE),$(SERIAL_DRIVERLIST)),$(eval $(call DriverPackage,serial,$(d))))
+$(foreach d,$(SNMP_DRIVERLIST),$(eval $(call DriverPackage,snmp,$(d))))
+$(foreach d,$(USB_LIBUSB_DRIVERLIST),$(eval $(call DriverPackage,usb,$(d))))
+
+$(eval $(call DriverDescription,serial,al175,\
+       Driver for Eltek UPS models with AL175 alarm module))
+$(eval $(call DriverDescription,serial,bcmxcp,\
+       Driver for UPSes supporting the serial BCM/XCP protocol))
+$(eval $(call DriverDescription,serial,belkin,\
+       Driver for Belkin serial UPS equipment))
+$(eval $(call DriverDescription,serial,belkinunv,\
+       Driver for Belkin "Universal UPS" and compatible))
+$(eval $(call DriverDescription,serial,bestfcom,\
+       Driver for Best Power Fortress/Ferrups))
+$(eval $(call DriverDescription,serial,bestfortress,\
+       Driver for old Best Fortress UPS equipment))
+$(eval $(call DriverDescription,serial,bestuferrups,\
+       Driver for Best Power Micro-Ferrups))
+$(eval $(call DriverDescription,serial,bestups,\
+       Driver for Best Power / SOLA (Phoenixtec protocol) UPS equipment))
+$(eval $(call DriverDescription,serial,dummy-ups,\
+       Driver for multi-purpose UPS emulation))
+$(eval $(call DriverDescription,serial,etapro,\
+       Driver for ETA UPS equipment))
+$(eval $(call DriverDescription,serial,everups,\
+       Driver for Ever UPS models))
+$(eval $(call DriverDescription,serial,gamatronic,\
+       Driver for Gamatronic UPS equipment))
+$(eval $(call DriverDescription,serial,genericups,\
+       Driver for contact-closure UPS equipment))
+$(eval $(call DriverDescription,serial,isbmex,\
+       Driver for ISBMEX UPS equipment))
+$(eval $(call DriverDescription,serial,liebert,\
+       Driver for Liebert contact-closure UPS equipment))
+$(eval $(call DriverDescription,serial,liebert-esp2,\
+       Driver for Liebert UPS, using the ESP-II serial protocol))
+$(eval $(call DriverDescription,serial,masterguard,\
+       Driver for Masterguard UPS equipment))
+$(eval $(call DriverDescription,serial,metasys,\
+       Driver for Meta System UPS equipment))
+$(eval $(call DriverDescription,serial,oldmge-shut,\
+       Driver for SHUT Protocol UPS equipment, deprecated, use mge-shut))
+$(eval $(call DriverDescription,serial,mge-utalk,\
+       Driver for MGE UPS SYSTEMS UTalk protocol equipment))
+$(eval $(call DriverDescription,serial,microdowell,\
+       Driver for Microdowell Enterprise UPS series))
+$(eval $(call DriverDescription,serial,mge-shut,\
+       Driver for SHUT Protocol UPS equipment))
+$(eval $(call DriverDescription,serial,oneac,\
+       Driver for Oneac UPS equipment))
+$(eval $(call DriverDescription,serial,optiups,\
+       Driver for Opti-UPS (Viewsonic) UPS and Zinto D (ONLINE-USV) equipment))
+$(eval $(call DriverDescription,serial,powercom,\
+       Driver for serial Powercom/Trust/Advice UPS equipment))
+$(eval $(call DriverDescription,serial,rhino,\
+       Driver for Brazilian Microsol RHINO UPS equipment))
+$(eval $(call DriverDescription,serial,safenet,\
+       Driver for SafeNet compatible UPS equipment))
+$(eval $(call DriverDescription,serial,solis,\
+       Driver for Brazilian Microsol SOLIS UPS equipment))
+$(eval $(call DriverDescription,serial,tripplite,\
+       Driver for Tripp-Lite SmartPro UPS equipment))
+$(eval $(call DriverDescription,serial,tripplitesu,\
+       Driver for Tripp-Lite SmartOnline (SU) UPS equipment))
+$(eval $(call DriverDescription,serial,upscode2,\
+       Driver for UPScode II compatible UPS equipment))
+$(eval $(call DriverDescription,serial,victronups,\
+       Driver for IMV/Victron UPS unit Match, Match Lite, NetUps))
+$(eval $(call DriverDescription,serial,powerpanel,\
+       Driver for PowerPanel Plus compatible UPS equipment))
+$(eval $(call DriverDescription,serial,blazer_ser,\
+       Driver for Megatec/Q1 protocol serial based UPS equipment))
+$(eval $(call DriverDescription,serial,clone,\
+       UPS driver clone))
+$(eval $(call DriverDescription,serial,ivtscd,\
+       Driver for the IVT Solar Controller Device))
+$(eval $(call DriverDescription,serial,apcsmart,\
+       Driver for American Power Conversion Smart Protocol UPS equipment))
+$(eval $(call DriverDescription,serial,apcsmart-old,\
+       Driver for American Power Conversion Smart Protocol UPS equipment))
+$(eval $(call DriverDescription,serial,apcupsd-ups,\
+       Driver for apcupsd client access))
+$(eval $(call DriverDescription,serial,riello_ser,\
+       Driver for Riello UPS Protocol UPS equipment))
+$(eval $(call DriverDescription,snmp,snmp-ups,\
+       Multi-MIB Driver for SNMP UPS equipment))
+$(eval $(call DriverDescription,usb,usbhid-ups,\
+       Driver for USB/HID UPS equipment))
+$(eval $(call DriverDescription,usb,bcmxcp_usb,\
+       Experimental driver for UPSes supporting the BCM/XCP protocol over USB))
+$(eval $(call DriverDescription,usb,tripplite_usb,\
+       Driver for older Tripp Lite USB UPSes (not PDC HID)))
+$(eval $(call DriverDescription,usb,blazer_usb,\
+       Driver for Megatec/Q1 protocol USB based UPS equipment))
+$(eval $(call DriverDescription,usb,richcomm_usb,\
+       Driver for UPS equipment using Richcomm dry-contact to USB solution))
+$(eval $(call DriverDescription,usb,riello_usb,\
+       Driver for Riello UPS Protocol UPS equipment via USB))
+$(eval $(call DriverDescription,usb,nutdrv_atcl_usb,\
+       Driver for ATCL FOR UPS equipment))
+$(eval $(call DriverDescription,usb,nutdrv_qx,\
+       Driver for Q* protocol serial and USB based UPS equipment))
+
+CONFIGURE_ARGS += \
+       --$(if $(CONFIG_NUT_DRIVER_SERIAL),with,without)-serial \
+       --$(if $(CONFIG_NUT_DRIVER_USB),with,without)-usb \
+       --$(if $(CONFIG_NUT_DRIVER_SNMP),with,without)-snmp \
+       --without-neon \
+       --without-powerman \
+       --without-ipmi \
+       --without-freeipmi \
+       --$(if $(CONFIG_NUT_SSL),with,without)-ssl $(if $(CONFIG_NUT_SSL),--with-openssl) \
+       --without-avahi \
+       --without-libltdl \
+       --with-user=root \
+       --with-group=root \
+       --sysconfdir=/etc/nut \
+       --with-drvpath=/lib/nut \
+       --with-statepath=/var/run \
+       --datadir=/usr/share/nut
+
+$(eval $(call BuildPackage,nut))
+$(foreach d,$(filter-out $(SERIAL_DRIVERLIST_IGNORE),$(SERIAL_DRIVERLIST)),$(eval $(call BuildPackage,nut-driver-$(d))))
+$(foreach d,$(SNMP_DRIVERLIST),$(eval $(call BuildPackage,nut-driver-$(d))))
+$(foreach d,$(USB_LIBUSB_DRIVERLIST),$(eval $(call BuildPackage,nut-driver-$(d))))
diff --git a/net/nut/files/nut-monitor.init b/net/nut/files/nut-monitor.init
new file mode 100755 (executable)
index 0000000..e9fdb33
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh /etc/rc.common
+
+START=60
+USE_PROCD=1
+
+restart() {
+       stop_service
+       start_service
+}
+
+start_service() {
+       upsmon -p
+}
+
+stop_service() {
+       upsmon -c stop
+}
+
+reload_service() {
+       upsmon -c reload
+}
diff --git a/net/nut/files/nut-server.init b/net/nut/files/nut-server.init
new file mode 100755 (executable)
index 0000000..f9971be
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh /etc/rc.common
+
+START=50
+USE_PROCD=1
+
+restart() {
+       stop_service
+       start_service
+}
+
+start_service() {
+       upsdrvctl start
+       upsd
+}
+
+stop_service() {
+       upsd -c stop
+       upsdrvctl stop
+}
+
+reload_service() {
+       upsd -c reload
+}
diff --git a/net/nut/patches/001-fix-missing-libmath-flags.patch b/net/nut/patches/001-fix-missing-libmath-flags.patch
new file mode 100644 (file)
index 0000000..88996be
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/drivers/Makefile.am
++++ b/drivers/Makefile.am
+@@ -171,7 +171,7 @@ tripplite_usb_SOURCES = tripplite_usb.c
+ tripplite_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
+ bcmxcp_usb_SOURCES = bcmxcp_usb.c bcmxcp.c usb-common.c
+-bcmxcp_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS)
++bcmxcp_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
+ blazer_usb_SOURCES = blazer.c blazer_usb.c libusb.c usb-common.c
+ blazer_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
+--- a/drivers/Makefile.in
++++ b/drivers/Makefile.in
+@@ -785,7 +785,7 @@ usbhid_ups_LDADD = $(LDADD_DRIVERS) $(LI
+ tripplite_usb_SOURCES = tripplite_usb.c libusb.c usb-common.c
+ tripplite_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
+ bcmxcp_usb_SOURCES = bcmxcp_usb.c bcmxcp.c usb-common.c
+-bcmxcp_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS)
++bcmxcp_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
+ blazer_usb_SOURCES = blazer.c blazer_usb.c libusb.c usb-common.c
+ blazer_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
+ nutdrv_atcl_usb_SOURCES = nutdrv_atcl_usb.c usb-common.c
diff --git a/net/nut/patches/010-ignore_automake_k_bug.patch b/net/nut/patches/010-ignore_automake_k_bug.patch
new file mode 100644 (file)
index 0000000..8d3645d
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -431,12 +431,6 @@ distclean-libtool:
+ # (2) otherwise, pass the desired values on the `make' command line.
+ $(RECURSIVE_TARGETS):
+       @fail= failcom='exit 1'; \
+-      for f in x $$MAKEFLAGS; do \
+-        case $$f in \
+-          *=* | --[!k]*);; \
+-          *k*) failcom='fail=yes';; \
+-        esac; \
+-      done; \
+       dot_seen=no; \
+       target=`echo $@ | sed s/-recursive//`; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+@@ -456,12 +450,6 @@ $(RECURSIVE_TARGETS):
+ $(RECURSIVE_CLEAN_TARGETS):
+       @fail= failcom='exit 1'; \
+-      for f in x $$MAKEFLAGS; do \
+-        case $$f in \
+-          *=* | --[!k]*);; \
+-          *k*) failcom='fail=yes';; \
+-        esac; \
+-      done; \
+       dot_seen=no; \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
index beace7bb26e184aec19b109f69f72e0a822bbe33..81075fd81329d489f9838b5a379b26ed5b0af1f5 100644 (file)
@@ -11,4 +11,8 @@ config OCSERV_PROTOBUF
        bool "use external libprotobuf"
        default y
 
+config OCSERV_HTTP_PARSER
+       bool "use external libhttp-parser"
+       default y
+
 endmenu
index 9a5bf2e4601628c14fab9462e6515d6fa82fdb14..9c26b4605559c2053f06a34a9d375ba5b575b28a 100644 (file)
@@ -8,18 +8,22 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ocserv
-PKG_VERSION:=0.8.6
+PKG_VERSION:=0.8.9
 PKG_RELEASE:=1
 
 PKG_BUILD_DIR :=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL :=ftp://ftp.infradead.org/pub/ocserv/
-PKG_MD5SUM:=78301874643ae658d43a8c7f4aaabadb
+PKG_MD5SUM:=cd935cc89bffac75c825e66ef71f6a73
 
 PKG_LICENSE:=GPLv2
 PKG_LICENSE_FILES:=COPYING
 PKG_FIXUP:=autoreconf
 
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_OCSERV_PAM \
+       CONFIG_OCSERV_PROTOBUF \
+
 include $(INCLUDE_DIR)/package.mk
 
 define Package/ocserv/config
@@ -33,7 +37,7 @@ define Package/ocserv
   TITLE:=OpenConnect VPN server
   URL:=http://www.infradead.org/ocserv/
   MAINTAINER:=Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
-  DEPENDS:= +libgnutls +certtool +libncurses +libreadline +OCSERV_PAM:libpam +OCSERV_PROTOBUF:libprotobuf-c
+  DEPENDS:= +OCSERV_HTTP_PARSER:libhttp-parser +libgnutls +certtool +libncurses +libreadline +OCSERV_PAM:libpam +OCSERV_PROTOBUF:libprotobuf-c
   USERID:=ocserv=72:ocserv=72
 endef
 
@@ -62,6 +66,10 @@ ifneq ($(CONFIG_OCSERV_PROTOBUF),y)
 CONFIGURE_ARGS += --without-protobuf
 endif
 
+ifneq ($(CONFIG_OCSERV_HTTP_PARSER),y)
+CONFIGURE_ARGS += --without-http-parser
+endif
+
 define Package/ocserv/conffiles
 /etc/config/ocserv
 endef
index c26774f7a296cc811248412545b216f2c8a8aae2..494b1e7b94e06757783fe90a70b46be54da26aa7 100644 (file)
@@ -18,6 +18,11 @@ auth = "|AUTH|"
 # A banner to be displayed on clients
 banner = "Welcome to OpenWRT"
 
+# When the server has a dynamic DNS address (that may change),
+# should set that to true to ask the client to resolve again on
+# reconnects.
+listen-host-is-dyndns = |DYNDNS|
+
 # Use listen-host to limit to specific IPs or to the IPs of a provided 
 # hostname.
 #listen-host = [IP|HOSTNAME]
index 9fb9f1c458cb5226ac70dffd34a31a06a81a391a..3df6d241347c7140bc4647b76302c63a2b55d5e9 100644 (file)
@@ -30,12 +30,17 @@ setup_config() {
 
        test $auth = "plain" && authsuffix="\[/var/etc/ocpasswd\]"
 
+       dyndns="false"
+       hostname=`uci show ddns|grep domain|head -1|cut -d '=' -f 1`
+       [ -n "$hostname" ] && dyndns="true"
+
        mkdir -p /var/etc
        sed -e "s/|PORT|/$port/g" \
            -e "s/|MAX_CLIENTS|/$max_clients/g" \
            -e "s/|MAX_SAME|/$max_same/g" \
            -e "s/|DPD|/$dpd/g" \
            -e "s#|AUTH|#$auth$authsuffix#g" \
+           -e "s#|DYNDNS|#$dyndns#g" \
            -e "s/|PREDICTABLE_IPS|/$predictable_ips/g" \
            -e "s/|CISCO_COMPAT|/$cisco_compat/g" \
            -e "s/|UDP|/$udp/g" \
@@ -86,7 +91,7 @@ setup_dns() {
 start() {
        local hostname iface
 
-       hostname=`uci get ddns.myddns.domain`
+       hostname=`uci show ddns|grep domain|head -1|cut -d '=' -f 1`
        [ -z "$hostname" ] && hostname=`uci get system.@system[0].hostname`
 
        [ ! -f /etc/ocserv/ca-key.pem ] && [ -x /usr/bin/certtool ] && {
index 1daaeaa6a09724cf9cce2e113b43df5bd37e297b..d73bd3a88d08dec7084487a63da4f8445e5c4cf9 100644 (file)
@@ -15,4 +15,7 @@ config OPENCONNECT_OPENSSL
 
 endchoice
 
+config OPENCONNECT_STOKEN
+       bool "stoken support"
+
 endmenu
index 00fbf8b6127f9443a659c77bf8e1ae45f072f6e6..6bd402f34a5756b940ca70f5e24f945425138655 100644 (file)
@@ -8,12 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openconnect
-PKG_VERSION:=6.00
-PKG_RELEASE:=3
+PKG_VERSION:=7.00
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/openconnect/
-PKG_MD5SUM:=7e28e23c6e281be31446e6c365f5d273
+PKG_MD5SUM:=208b03fb66cd8e26633a19b9e12f35af
+
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_OPENCONNECT_GNUTLS \
+       CONFIG_OPENCONNECT_OPENSSL \
+
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -24,7 +29,7 @@ endef
 define Package/openconnect
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+libxml2 +kmod-tun +resolveip +OPENCONNECT_OPENSSL:libopenssl +OPENCONNECT_GNUTLS:libgnutls
+  DEPENDS:=+libxml2 +kmod-tun +resolveip +OPENCONNECT_OPENSSL:libopenssl +OPENCONNECT_GNUTLS:libgnutls +OPENCONNECT_STOKEN:libstoken
   TITLE:=OpenConnect VPN client (Cisco AnyConnect compatible)
   MAINTAINER:=Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
   URL:=http://www.infradead.org/openconnect/
@@ -42,13 +47,20 @@ endef
 
 CONFIGURE_ARGS += \
        --disable-shared \
-       --with-vpnc-script=/lib/netifd/vpnc-script
+       --with-vpnc-script=/lib/netifd/vpnc-script \
+       --without-libpcsclite \
+       --without-stoken
 
 ifeq ($(CONFIG_OPENCONNECT_OPENSSL),y)
 CONFIGURE_ARGS += \
        --without-gnutls
 endif
 
+ifeq ($(CONFIG_OPENCONNECT_STOKEN),y)
+CONFIGURE_ARGS += \
+       --with-stoken
+endif
+
 define Package/openconnect/install
        $(INSTALL_DIR) $(1)/etc/openconnect/
        $(INSTALL_DIR) $(1)/lib/netifd/proto
index 53c6e701d220b0a668f44765bba6ae6c5098e74d..57bde8d48c83a1ecb293a847fb742a0fb1678f19 100644 (file)
@@ -11,6 +11,8 @@ config interface 'MYVPN'
         option username 'test'
         option password 'secret'
         option serverhash 'AE7FF6A0426F0A0CD0A02EB9EC3C5066FAEB0B25'
+        option token_mode 'rsa' # when built with stoken support
+        option token_secret 'secret' # when built with stoken support
 
 The additional files are also used:
 /etc/openconnect/user-cert-vpn-MYVPN.pem: The user certificate
index 744e5a5cd00ee22a24ea10623a07757abbd15f86..082dfba73ae551ca9fdf36b9ebe2fc06f10de2d7 100755 (executable)
@@ -22,7 +22,17 @@ cleanup()
        exit 0
 }
 
-trap cleanup 1 2 3 6 15
+cleanup2()
+{
+       if ! test -z "$pid";then
+               kill -2 $pid
+               wait $pid
+       fi
+       exit 0
+}
+
+trap cleanup2 2
+trap cleanup 1 3 6 15
 
 rm -f "$pidfile"
 /usr/sbin/openconnect $* <$pwfile &
index ad708073a39048fa5734d942d90ea66713e9c184..cdeac4061c9a85d7c33f6b1dcae6972be7d7baa8 100755 (executable)
@@ -17,7 +17,7 @@ proto_openconnect_init_config() {
 proto_openconnect_setup() {
        local config="$1"
 
-       json_get_vars server port username serverhash authgroup password vgroup
+       json_get_vars server port username serverhash authgroup password vgroup token_mode token_secret
 
        grep -q tun /proc/modules || insmod tun
 
@@ -38,10 +38,16 @@ proto_openconnect_setup() {
 
        cmdline="$server$port -i vpn-$config --non-inter --syslog --script /lib/netifd/vpnc-script"
 
-       [ -f /etc/openconnect/ca-vpn-$config.pem ] && append cmdline "--cafile /etc/openconnect/ca-vpn-$config.pem"
        [ -f /etc/openconnect/user-cert-vpn-$config.pem ] && append cmdline "-c /etc/openconnect/user-cert-vpn-$config.pem"
        [ -f /etc/openconnect/user-key-vpn-$config.pem ] && append cmdline "--sslkey /etc/openconnect/user-key-vpn-$config.pem"
-       [ -n "$serverhash" ] && append cmdline "--servercert=$serverhash"
+       if test -f /etc/openconnect/ca-vpn-$config.pem;then
+               append cmdline "--cafile /etc/openconnect/ca-vpn-$config.pem"
+               append cmdline "--no-system-trust"
+       fi
+       if test -n "$serverhash";then
+               append cmdline " --servercert=$serverhash"
+               append cmdline "--no-system-trust"
+       fi
        [ -n "$authgroup" ] && append cmdline "--authgroup $authgroup"
        [ -n "$username" ] && append cmdline "-u $username"
        [ -n "$password" ] && {
@@ -51,6 +57,9 @@ proto_openconnect_setup() {
                append cmdline "--passwd-on-stdin"
        }
 
+       [ -n "$token_mode" ] && append cmdline "--token-mode=$token_mode"
+       [ -n "$token_secret" ] && append cmdline "--token-secret=$token_secret"
+
        proto_export INTERFACE="$config"
        logger -t openconnect "executing 'openconnect $cmdline'"
 
@@ -68,7 +77,7 @@ proto_openconnect_teardown() {
 
        rm -f $pwfile
        logger -t openconnect "bringing down openconnect"
-       proto_kill_command "$config"
+       proto_kill_command "$config" 2
 }
 
 add_protocol openconnect
diff --git a/net/openconnect/patches/001-Added-a-default-timeout-value-in-CSTP-handshake-usin.patch b/net/openconnect/patches/001-Added-a-default-timeout-value-in-CSTP-handshake-usin.patch
deleted file mode 100644 (file)
index 8981805..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-From 826ad45a86f1556910c2f00dfa6477879deb978f Mon Sep 17 00:00:00 2001
-From: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-Date: Thu, 24 Jul 2014 21:59:01 +0200
-Subject: [PATCH] Added a default timeout value in CSTP handshake using gnutls
-
-[dwmw2: move it to openconnect_open_https() so it's done only once]
-
-Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
----
- gnutls.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/gnutls.c b/gnutls.c
-index 3e3204a..2ef836c 100644
---- a/gnutls.c
-+++ b/gnutls.c
-@@ -2017,6 +2017,10 @@ int openconnect_open_https(struct openconnect_info *vpninfo)
-       vpn_progress(vpninfo, PRG_INFO, _("SSL negotiation with %s\n"),
-                    vpninfo->hostname);
-+#ifdef GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT
-+      gnutls_handshake_set_timeout(vpninfo->https_sess,
-+                                   GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT);
-+#endif
-       err = cstp_handshake(vpninfo, 1);
-       if (err)
--- 
-2.0.0
-
diff --git a/net/openconnect/patches/001-always-resolve-ips.patch b/net/openconnect/patches/001-always-resolve-ips.patch
new file mode 100644 (file)
index 0000000..809dd23
--- /dev/null
@@ -0,0 +1,143 @@
+From 2f55fec323730a94ed49d401d93b913d85e43b65 Mon Sep 17 00:00:00 2001
+From: Nikos Mavrogiannopoulos <nmav@gnutls.org>
+Date: Mon, 1 Dec 2014 20:10:06 +0100
+Subject: [PATCH 1/2] Re-resolve when reconnecting CSTP and the X-CSTP-DynDNS
+ is set by the server
+
+That is, when reconnecting CSTP due to peer tearing the connection
+down attempt to re-resolve its IP. That handles the case where
+the server is using dynamic DNS and is advertising it.
+
+[dwmw2: refactored to simplify it somewhat]
+
+Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
+Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
+---
+ cstp.c                 |  3 +++
+ openconnect-internal.h |  1 +
+ ssl.c                  | 48 +++++++++++++++++++++++++++++++++++++++++++++++-
+ 4 files changed, 52 insertions(+), 2 deletions(-)
+
+diff --git a/cstp.c b/cstp.c
+index 3b93538..55225f4 100644
+--- a/cstp.c
++++ b/cstp.c
+@@ -378,6 +378,9 @@ static int start_cstp_connection(struct openconnect_info *vpninfo)
+                       int cstpmtu = atol(colon);
+                       if (cstpmtu > mtu)
+                               mtu = cstpmtu;
++              } else if (!strcmp(buf + 7, "DynDNS")) {
++                      if (!strcmp(colon, "true"))
++                              vpninfo->is_dyndns = 1;
+               } else if (!strcmp(buf + 7, "Address-IP6")) {
+                       vpninfo->ip_info.netmask6 = new_option->value;
+               } else if (!strcmp(buf + 7, "Address")) {
+diff --git a/openconnect-internal.h b/openconnect-internal.h
+index 1bc79e5..db6c2ba 100644
+--- a/openconnect-internal.h
++++ b/openconnect-internal.h
+@@ -427,6 +427,7 @@ struct openconnect_info {
+       int dtls_local_port;
+       int deflate;
++      int is_dyndns; /* Attempt to redo DNS lookup on each CSTP reconnect */
+       char *useragent;
+       const char *quit_reason;
+diff --git a/ssl.c b/ssl.c
+index b50652d..d47a819 100644
+--- a/ssl.c
++++ b/ssl.c
+@@ -106,6 +106,23 @@ unsigned string_is_hostname(const char *str)
+       return 1;
+ }
++static int match_sockaddr(struct sockaddr *a, struct sockaddr *b)
++{
++      if (a->sa_family == AF_INET) {
++              struct sockaddr_in *a4 = (void *)a;
++              struct sockaddr_in *b4 = (void *)b;
++
++              return (a4->sin_addr.s_addr == b4->sin_addr.s_addr) &&
++                      (a4->sin_port == b4->sin_port);
++      } else if (a->sa_family == AF_INET6) {
++              struct sockaddr_in6 *a6 = (void *)a;
++              struct sockaddr_in6 *b6 = (void *)b;
++              return !memcmp(&a6->sin6_addr, &b6->sin6_addr, sizeof(a6->sin6_addr) &&
++                             a6->sin6_port == b6->sin6_port);
++      } else
++              return 0;
++}
++
+ int connect_https_socket(struct openconnect_info *vpninfo)
+ {
+       int ssl_sock = -1;
+@@ -114,7 +131,11 @@ int connect_https_socket(struct openconnect_info *vpninfo)
+       if (!vpninfo->port)
+               vpninfo->port = 443;
+-      if (vpninfo->peer_addr) {
++      /* If we're talking to a server which told us it has dynamic DNS, don't
++         just re-use its previous IP address. If we're talking to a proxy, we
++         can use *its* previous IP address. We expect it'll re-do the DNS
++         lookup for the server anyway. */
++      if (vpninfo->peer_addr && (!vpninfo->is_dyndns || vpninfo->proxy)) {
+       reconnect:
+ #ifdef SOCK_CLOEXEC
+               ssl_sock = socket(vpninfo->peer_addr->sa_family, SOCK_STREAM | SOCK_CLOEXEC, IPPROTO_IP);
+@@ -230,6 +251,13 @@ int connect_https_socket(struct openconnect_info *vpninfo)
+                       if (hints.ai_flags & AI_NUMERICHOST)
+                               free(hostname);
+                       ssl_sock = -EINVAL;
++                      /* If we were just retrying for dynamic DNS, reconnct using
++                         the previously-known IP address */
++                      if (vpninfo->peer_addr) {
++                              vpn_progress(vpninfo, PRG_ERR,
++                                           _("Reconnecting to DynDNS server using previously cached IP address\n"));
++                              goto reconnect;
++                      }
+                       goto out;
+               }
+               if (hints.ai_flags & AI_NUMERICHOST)
+@@ -257,6 +285,8 @@ int connect_https_socket(struct openconnect_info *vpninfo)
+                       if (cancellable_connect(vpninfo, ssl_sock, rp->ai_addr, rp->ai_addrlen) >= 0) {
+                               /* Store the peer address we actually used, so that DTLS can
+                                  use it again later */
++                              free(vpninfo->peer_addr);
++                              vpninfo->peer_addrlen = 0;
+                               vpninfo->peer_addr = malloc(rp->ai_addrlen);
+                               if (!vpninfo->peer_addr) {
+                                       vpn_progress(vpninfo, PRG_ERR,
+@@ -288,6 +318,17 @@ int connect_https_socket(struct openconnect_info *vpninfo)
+                       }
+                       closesocket(ssl_sock);
+                       ssl_sock = -1;
++
++                      /* If we're in DynDNS mode but this *was* the cached IP address,
++                       * don't bother falling back to it if it didn't work. */
++                      if (vpninfo->peer_addr && vpninfo->peer_addrlen == rp->ai_addrlen &&
++                          match_sockaddr(vpninfo->peer_addr, rp->ai_addr)) {
++                              vpn_progress(vpninfo, PRG_TRACE,
++                                           _("Forgetting non-functional previous peer address\n"));
++                              free(vpninfo->peer_addr);
++                              vpninfo->peer_addr = 0;
++                              vpninfo->peer_addrlen = 0;
++                      }
+               }
+               freeaddrinfo(result);
+@@ -296,6 +337,11 @@ int connect_https_socket(struct openconnect_info *vpninfo)
+                                    _("Failed to connect to host %s\n"),
+                                    vpninfo->proxy?:vpninfo->hostname);
+                       ssl_sock = -EINVAL;
++                      if (vpninfo->peer_addr) {
++                              vpn_progress(vpninfo, PRG_ERR,
++                                           _("Reconnecting to DynDNS server using previously cached IP address\n"));
++                              goto reconnect;
++                      }
+                       goto out;
+               }
+       }
+-- 
+2.1.3
+
index ba4cb38c1d0235cbab241f671d5b514b79cd3e08..055b0030e01b33161d384f3394fb421989a611ef 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2011 OpenWrt.org
+# Copyright (C) 2006-2014 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,16 +8,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssh
-PKG_VERSION:=6.6p1
-PKG_RELEASE:=2
+PKG_VERSION:=6.7p1
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
                http://ftp.belnet.be/pub/OpenBSD/OpenSSH/portable/
-PKG_MD5SUM:=3e9800e6bca1fbac0eea4d41baa7f239
+PKG_MD5SUM:=3246aa79317b1d23cae783a3bf8275d6
 
 PKG_LICENSE:=BSD ISC
-PKG_LICENSE_FILE:=LICENCE
+PKG_LICENSE_FILES:=LICENCE
 
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
@@ -131,6 +131,21 @@ define Package/openssh-sftp-server/description
 OpenSSH SFTP server.
 endef
 
+define Package/openssh-sftp-avahi-service
+       $(call Package/openssh/Default)
+       TITLE+= (SFTP Avahi service)
+       DEPENDS:=+openssh-sftp-server +avahi-daemon
+endef
+
+define Package/openssh-sftp-avahi-service/description
+ This package contains the service definition for announcing
+ SFTP support via mDNS/DNS-SD.
+endef
+
+define Package/openssh-sftp-avahi-service/conffiles
+/etc/avahi/services/sftp-ssh.service
+endef
+
 CONFIGURE_ARGS+= \
        $(DISABLE_NLS) \
        --sysconfdir=/etc/ssh \
@@ -259,6 +274,11 @@ define Package/openssh-sftp-server/install
        ln -sf ../lib/sftp-server $(1)/usr/libexec/sftp-server
 endef
 
+define Package/openssh-sftp-avahi-service/install
+       $(INSTALL_DIR) $(1)/etc/avahi/services
+       $(INSTALL_DATA) ./files/sftp-ssh.service $(1)/etc/avahi/services/
+endef
+
 $(eval $(call BuildPackage,openssh-client))
 $(eval $(call BuildPackage,openssh-moduli))
 $(eval $(call BuildPackage,openssh-client-utils))
@@ -267,3 +287,4 @@ $(eval $(call BuildPackage,openssh-server))
 $(eval $(call BuildPackage,openssh-server-pam))
 $(eval $(call BuildPackage,openssh-sftp-client))
 $(eval $(call BuildPackage,openssh-sftp-server))
+$(eval $(call BuildPackage,openssh-sftp-avahi-service))
diff --git a/net/openssh/files/sftp-ssh.service b/net/openssh/files/sftp-ssh.service
new file mode 100644 (file)
index 0000000..17e0927
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
+<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
+<service-group>
+ <name replace-wildcards="yes">%h</name>
+  <service>
+   <type>_sftp-ssh._tcp</type>
+   <port>22</port>
+  </service>
+</service-group>
index 751e5896fe48d7047591b6b44717228ee007fafb..5a4ecb1223e62b83d838df15d18575912bf196ef 100644 (file)
@@ -1,6 +1,6 @@
 --- a/cipher.c
 +++ b/cipher.c
-@@ -80,8 +80,10 @@ static const struct Cipher ciphers[] = {
+@@ -88,8 +88,10 @@ static const struct sshcipher ciphers[]
        { "3des-cbc",   SSH_CIPHER_SSH2, 8, 24, 0, 0, 0, 1, EVP_des_ede3_cbc },
        { "blowfish-cbc",
                        SSH_CIPHER_SSH2, 8, 16, 0, 0, 0, 1, EVP_bf_cbc },
index bfcf65cba88c04a77784eda840646e1b3d70d984..9fafaf2e384fb72d97175827fbad304d5098c1e3 100644 (file)
@@ -8,9 +8,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=opentracker
-PKG_VERSION:=20130804
+PKG_VERSION:=20141007
 PKG_RELEASE:=1
-PKG_REV:=954f5029dfa17734dc408336ef710c192268e8a4
+PKG_REV:=6c60309745ced3c121a2c5c7d80ed85a573b848e
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=Beerware
 
index f3f9038028cebcc509c471a4e1522186a8bdfb46..bbaf8d99e60451ef4631cc89e2dae7630c6aea2f 100644 (file)
@@ -1,7 +1,5 @@
-Index: opentracker-20130804/Makefile
-===================================================================
---- opentracker-20130804.orig/Makefile
-+++ opentracker-20130804/Makefile
+--- a/Makefile
++++ b/Makefile
 @@ -9,13 +9,13 @@ CC?=gcc
  
  # BSD flavour
index 710e89845a573599604fd852063f9784240cd704..c0c3e8e15a7b4f408724115c8b8e3ad62b27eef5 100644 (file)
@@ -15,7 +15,7 @@ PKG_RELEASE:=1
 PKG_VERSION:=2.3.0
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 PKG_LICENSE:=Apache-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 PKG_USE_MIPS16:=0
 
 PKG_SOURCE_PROTO:=git
@@ -26,6 +26,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/kernel.mk
+$(call include_mk, python-package.mk)
 
 PKG_FIXUP=libtool
 
@@ -56,6 +57,27 @@ define Package/openvswitch/description
   Provides the main userspace components required for Open vSwitch to function.
 endef
 
+define Package/openvswitch-python
+  $(call Package/openvswitch/Default)
+  TITLE:=Open vSwitch Python Support
+  DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch +python
+endef
+
+define Package/openvswitch-python/description
+  Provides bindings and libraries for using Python to manipulate/work with Open vSwitch.
+endef
+
+define Package/openvswitch-ipsec
+  $(call Package/openvswitch/Default)
+  TITLE:=Open vSwitch Userspace Package
+  DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch-python
+endef
+
+define Package/openvswitch-ipsec/description
+  The ovs-monitor-ipsec script provides support for encrypting GRE tunnels with 
+  IPsec.
+endef
+
 define Package/openvswitch-benchmark
   $(call Package/openvswitch/Default)
   TITLE:=Open vSwitch Userspace Package
@@ -72,7 +94,7 @@ define KernelPackage/openvswitch
   SUBMENU:=Network Support
   TITLE:=Open vSwitch Kernel Package
   KCONFIG:=CONFIG_BRIDGE
-  DEPENDS:=+kmod-stp +kmod-ipv6 +kmod-gre +kmod-lib-crc32c
+  DEPENDS:=+kmod-stp +kmod-ipv6 +kmod-gre +kmod-lib-crc32c +kmod-vxlan
   FILES:= \
        $(PKG_BUILD_DIR)/datapath/linux/openvswitch.$(LINUX_KMOD_SUFFIX)
   AUTOLOAD:=$(call AutoLoad,21,openvswitch)
@@ -97,6 +119,11 @@ define Build/Configure
        $(call Build/Configure/Default,$(CONFIGURE_ARGS))
 endef
 
+KCFLAGS=
+ifeq ($(CONFIG_GCC_VERSION_4_9),y)
+KCFLAGS:=-Wno-error=date-time
+endif
+
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
                $(TARGET_CONFIGURE_OPTS) \
@@ -109,6 +136,7 @@ define Build/Compile
                ARCH="$(LINUX_KARCH)" \
                SUBDIRS="$(PKG_BUILD_DIR)/datapath/linux" \
                PATH="$(TARGET_PATH)" \
+               EXTRA_CFLAGS="$(KCFLAGS)" \
                KCC="$(KERNEL_CC)"
 endef
 
@@ -141,6 +169,16 @@ define Package/openvswitch/install
        $(INSTALL_CONF) $(PKG_BUILD_DIR)/vswitchd/vswitch.ovsschema $(1)/usr/share/openvswitch/
 endef
 
+define Package/openvswitch-python/install
+       $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/
+       $(CP) $(PKG_BUILD_DIR)/python/ovs/ $(1)/usr/lib/python$(PYTHON_VERSION)/
+endef
+
+define Package/openvswitch-ipsec/install
+       $(INSTALL_DIR) $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/debian/ovs-monitor-ipsec $(1)/usr/sbin/
+endef
+
 define Package/openvswitch-benchmark/install
        $(INSTALL_DIR) $(1)/usr/bin/
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/.libs/ovs-benchmark $(1)/usr/bin/
@@ -152,6 +190,8 @@ define Package/openvswitch/postinst
 endef
 
 $(eval $(call BuildPackage,openvswitch))
+$(eval $(call BuildPackage,openvswitch-python))
+$(eval $(call BuildPackage,openvswitch-ipsec))
 $(eval $(call BuildPackage,openvswitch-benchmark))
 $(eval $(call KernelPackage,openvswitch))
 
diff --git a/net/openvswitch/patches/0004-datapath-Use-ccflags-y-instead-of-deprecated-EXTRA_C.patch b/net/openvswitch/patches/0004-datapath-Use-ccflags-y-instead-of-deprecated-EXTRA_C.patch
new file mode 100644 (file)
index 0000000..95891a1
--- /dev/null
@@ -0,0 +1,41 @@
+From 36fd4f214f9ba74aaf0e5fb3e4ba271b946a1550 Mon Sep 17 00:00:00 2001
+From: Thomas Graf <tgraf@noironetworks.com>
+Date: Wed, 26 Nov 2014 15:52:31 +0100
+Subject: [PATCH] datapath: Use ccflags-y instead of deprecated EXTRA_CFLAGS
+
+This allows users to pass in additional compiler flags through the
+environment variable EXTRA_CFLAGS, e.g.
+
+   make EXTRA_CFLAGS=-Wno-error=foo V=1
+
+Reported-by: Alexandru Ardelean <ardeleanalex@gmail.com>
+Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
+Acked-by: Pravin B Shelar <pshelar@nicira.com>
+---
+ datapath/linux/Kbuild.in | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/datapath/linux/Kbuild.in b/datapath/linux/Kbuild.in
+index 6f6f65f..cb98c11 100644
+--- a/datapath/linux/Kbuild.in
++++ b/datapath/linux/Kbuild.in
+@@ -7,11 +7,11 @@ export VERSION = @VERSION@
+ include $(srcdir)/../Modules.mk
+ include $(srcdir)/Modules.mk
+-EXTRA_CFLAGS := -DVERSION=\"$(VERSION)\"
+-EXTRA_CFLAGS += -I$(srcdir)/..
+-EXTRA_CFLAGS += -I$(builddir)/..
+-EXTRA_CFLAGS += -g
+-EXTRA_CFLAGS += -include $(builddir)/kcompat.h
++ccflags-y := -DVERSION=\"$(VERSION)\"
++ccflags-y += -I$(srcdir)/..
++ccflags-y += -I$(builddir)/..
++ccflags-y += -g
++ccflags-y += -include $(builddir)/kcompat.h
+ # These include directories have to go before -I$(KSRC)/include.
+ # NOSTDINC_FLAGS just happens to be a variable that goes in the
+-- 
+2.1.2
+
diff --git a/net/openvswitch/patches/0005-datapath-backport___ip_select_ident_function.patch b/net/openvswitch/patches/0005-datapath-backport___ip_select_ident_function.patch
new file mode 100644 (file)
index 0000000..0ea48c6
--- /dev/null
@@ -0,0 +1,43 @@
+commit 2ea824143172e38b4387ef23b8685cebaee21c69
+Author: Pravin B Shelar <pshelar@nicira.com>
+Date:   Tue Sep 24 18:42:43 2013 -0700
+
+    datapath: Backport __ip_select_ident() function
+    
+    definition of __ip_select_ident() changed in newer kernel and
+    it is backported to stable kernel, Therefore adding configure
+    check to detect the new function.
+    
+    Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
+    Acked-by: Andy Zhou <azhou@nicira.com>
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 7e036e5..b0794d2 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -284,6 +284,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
+   OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [vlan_set_encap_proto])
+   OVS_GREP_IFELSE([$KSRC/include/linux/in.h], [ipv4_is_multicast])
++  OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [__ip_select_ident.*dst_entry],
++                  [OVS_DEFINE([HAVE_IP_SELECT_IDENT_USING_DST_ENTRY])])
+   OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_disable_lro])
+   OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_get_stats])
+diff --git a/datapath/linux/compat/ip_tunnels_core.c b/datapath/linux/compat/ip_tunnels_core.c
+index d650be2..a70aefc 100644
+--- a/datapath/linux/compat/ip_tunnels_core.c
++++ b/datapath/linux/compat/ip_tunnels_core.c
+@@ -70,7 +70,12 @@ int iptunnel_xmit(struct rtable *rt,
+       iph->daddr      =       dst;
+       iph->saddr      =       src;
+       iph->ttl        =       ttl;
++
++#ifdef HAVE_IP_SELECT_IDENT_USING_DST_ENTRY
+       __ip_select_ident(iph, &rt_dst(rt), (skb_shinfo(skb)->gso_segs ?: 1) - 1);
++#else
++      __ip_select_ident(iph, skb_shinfo(skb)->gso_segs ?: 1);
++#endif
+       err = ip_local_out(skb);
+       if (unlikely(net_xmit_eval(err)))
diff --git a/net/privoxy/Makefile b/net/privoxy/Makefile
new file mode 100644 (file)
index 0000000..80083d2
--- /dev/null
@@ -0,0 +1,168 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=privoxy
+PKG_VERSION:=3.0.22
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-stable-src.tar.gz
+PKG_SOURCE_URL:=@SF/ijbswa
+PKG_MD5SUM:=aa121751d332a51d37d3c6e4b7594daa
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-stable
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+PKG_MAINTAINER:=christian.schoenebeck@gmail.com
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/privoxy
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=Web Servers/Proxies
+  DEPENDS:=+libpcre +libpthread +zlib
+  TITLE:=web proxy with advanced filtering capabilities
+  URL:=http://www.privoxy.org/
+  USERID:=privoxy=8118:privoxy=8118
+endef
+
+define Package/privoxy/description
+Privoxy is a web proxy with advanced filtering capabilities for
+ protecting privacy, modifying web page content, managing cookies,
+ controlling access, and removing ads, banners, pop-ups and other
+ obnoxious Internet junk. Privoxy has a very flexible configuration
+ and can be customized to suit individual needs and tastes. Privoxy
+ has application for both stand-alone systems and multi-user networks.
+Version: $(PKG_VERSION)-$(PKG_RELEASE)
+endef
+
+CONFIGURE_ARGS += \
+       --sysconfdir=/etc/privoxy \
+
+# needed otherwise errors during compile
+MAKE_FLAGS:=
+
+define Build/Install
+       $(call Build/Install/Default,)
+       # rename original sample config from pkg_source to save existing one during install
+       mv $(PKG_INSTALL_DIR)/etc/privoxy/config $(PKG_INSTALL_DIR)/etc/privoxy/config.privoxy
+endef
+
+define Package/privoxy/conffiles
+/etc/config/privoxy
+/etc/privoxy/config    # temporary needed if updating from old version
+endef
+
+define Package/privoxy/preinst
+       #!/bin/sh
+       # if run within buildroot exit
+       [ -n "$${IPKG_INSTROOT}" ] && exit 0
+       # stop service # if PKG_UPGRADE NOT WORKING
+       # [ "$${PKG_UPGRADE}" = "1" ] && /etc/init.d/privoxy stop
+       /etc/init.d/privoxy stop >/dev/null 2>&1
+       exit 0  # supress errors from stop command
+endef
+
+define Package/privoxy/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(CP) $(PKG_INSTALL_DIR)/usr/sbin/privoxy $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/privoxy.init $(1)/etc/init.d/privoxy
+       # no longer needed because running with procd
+       # $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
+       # $(INSTALL_BIN) ./files/privoxy.hotplug $(1)/etc/hotplug.d/iface/80-privoxy
+
+       $(INSTALL_DIR) $(1)/etc/privoxy
+       $(CP) $(PKG_INSTALL_DIR)/etc/privoxy/* $(1)/etc/privoxy/
+       # temporary needed if updating from old version
+       # otherwise old config file will be delete by opkg
+       $(INSTALL_CONF) ./files/privoxy.oldconfig $(1)/etc/privoxy/config
+       # create .old file to be removed with next pacakge builds during update
+       $(INSTALL_CONF) ./files/privoxy.oldconfig $(1)/etc/privoxy/config.old
+
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/privoxy.config $(1)/etc/config/privoxy
+endef
+
+define Package/privoxy/postinst
+       #!/bin/sh
+
+       # if fresh install we don't need old config file in privoxy directory
+       [ "$${PKG_UPGRADE}" = "0" ] && rm -f /etc/privoxy/config
+
+       # if run within buildroot exit here
+       [ -n "$${IPKG_INSTROOT}" ] && exit 0
+
+       # if PKG_UPGRADE then build uci configuration
+       # from existing(?) old /etc/privoxy/config file
+       if [ "$${PKG_UPGRADE}" = "1" -a -f /etc/privoxy/config ]; then
+
+               echo "converting OLD config to NEW uci configuration"
+
+               SECTION="privoxy.privoxy"
+               CFGFILE=/etc/privoxy/config
+
+               echo -n > /etc/config/privoxy           # clear/create uci configuration file
+               cp -f $${CFGFILE} $${CFGFILE}.old       # save old configuration
+
+               # cleanup
+               sed -i 's/^[ \t]*//;s/[ \t]*$$//' $${CFGFILE}   # remove invisible chars at beginning and end of lines
+               sed -i '/^#/d' $${CFGFILE}                      # remove lines with "#"
+               sed -i '/^$$/d' $${CFGFILE}                     # remove empty lines
+
+               uci -q set $${SECTION}="privoxy"                # create section
+
+               cat $${CFGFILE} | while read LINE; do
+                       # option is first parameter; uci did not like "-" in option names
+                       OPT=$$(echo $${LINE} | awk '{print $$1}' | sed 's/-/_/g')
+                       VAL=$$(echo $${LINE} | awk '{print $$2}')
+                       case $${OPT} in
+                               # debug 1024 => debug_1024 '1'
+                               debug)
+                                       uci -q set $${SECTION}.debug_$${VAL}="1"
+                                       ;;
+                               # handle list values; splitted case for better reading
+                               actionsfile|filterfile|listen_address)
+                                       uci -q add_list $${SECTION}.$${OPT}="$${VAL}"
+                                       ;;
+                               permit_access|deny_access)
+                                       uci -q add_list $${SECTION}.$${OPT}="$${VAL}"
+                                       ;;
+                               trust_info_url|forward)
+                                       uci -q add_list $${SECTION}.$${OPT}="$${VAL}"
+                                       ;;
+                               forward_socks4|forward_socks4a)
+                                       uci -q add_list $${SECTION}.$${OPT}="$${VAL}"
+                                       ;;
+                               forward_socks5|forward_socks5t)
+                                       uci -q add_list $${SECTION}.$${OPT}="$${VAL}"
+                                       ;;
+                               # all others are normal options
+                               *)
+                                       uci -q set $${SECTION}.$${OPT}="$${VAL}"
+                                       ;;
+                       esac
+               done
+               uci -q commit privoxy   # commit changes
+               rm -f $${CFGFILE}       # remove old configuration file
+       fi
+
+       # set permissions to privoxy group
+       echo "setting permissions"
+       chgrp -R privoxy /etc/privoxy/*
+       chmod 664 /etc/privoxy/*
+       chmod 755 /etc/privoxy/templates
+       chmod 644 /etc/privoxy/templates/*
+endef
+
+$(eval $(call BuildPackage,privoxy))
diff --git a/net/privoxy/files/privoxy.config b/net/privoxy/files/privoxy.config
new file mode 100644 (file)
index 0000000..50e401f
--- /dev/null
@@ -0,0 +1,43 @@
+# this file support all available configuration options of
+# Privoxy web-proxy
+# the scripts move all options to the final privoxy readable configuration file
+#
+# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+# !!! privoxy uses "-" in option names but uci only support "_"         !!!
+# !!! privoxy "listen-address" must be uci "listen_address"             !!!
+# !!!                                                                   !!!
+# !!! if you add entries please use                                      !!!
+# !!! option for options with one parameter (option confdir)             !!!
+# !!! list   for options with multiple parameters (list listen_address) !!!
+# !!!                                                                   !!!
+# !!! special handling for debug option                                 !!!
+# !!! privoxy option "debug 1024" must be uci option debug_1024 '1'     !!!
+# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+#
+config privoxy 'privoxy'
+       option  confdir         '/etc/privoxy'
+       option  logdir          '/var/log'
+       option  logfile         'privoxy.log'
+       list    filterfile      'default.filter'
+       list    actionsfile     'match-all.action'
+       list    actionsfile     'default.action'
+#      list    actionsfile     'user.action'
+       list    listen_address  '127.0.0.1:8118'
+       list    listen_address  '192.168.1.1:8118'
+       option  toggle          '1'
+       option  enable_remote_toggle    '1'
+       option  enable_remote_http_toggle       '0'
+       option  enable_edit_actions     '1'
+       option  enforce_blocks          '0'
+       option  buffer_limit            '4096'
+       option  forwarded_connect_retries       '0'
+       option  accept_intercepted_requests     '0'
+       option  allow_cgi_request_crunching     '0'
+       option  split_large_forms       '0'
+       option  keep_alive_timeout      '300'
+       option  socket_timeout          '300'
+       list    permit_access           '192.168.1.0/24'
+       option  debug_1         '0'
+       option  debug_1024      '0'
+       option  debug_4096      '1'
+       option  debug_8192      '1'
diff --git a/net/privoxy/files/privoxy.init b/net/privoxy/files/privoxy.init
new file mode 100644 (file)
index 0000000..8ea6d6f
--- /dev/null
@@ -0,0 +1,124 @@
+#!/bin/sh /etc/rc.common
+
+START=80
+USE_PROCD=1
+
+PIDFILE=/var/run/privoxy.pid
+CFGFILE=/var/etc/privoxy.conf
+CFGTEMP=/var/etc/privoxy.conf.tmp
+
+_uci2conf() {
+       local _LOGDIR="/var/log"        # set default
+       local _LOGFILE="privoxy.log"    # set default
+
+       # redefined callback for options when calling config_load
+       option_cb()
+       {
+               # $1    name of variable
+               # $2    value
+               local __OPT="$1"
+               local __VAL="$2"
+               case $__OPT in
+                       logdir)         # logdir handled later
+                               _LOGDIR="$__VAL"  ;;
+                       logfile)        # logfile handled later
+                               _LOGFILE="$__VAL" ;;
+                       *)
+                               # detect list options (LENGTH) and ignore
+                               echo $__OPT | grep -i "_LENGTH" >/dev/null 2>&1 && return
+                               # detect list options (ITEM) and ignore
+                               echo $__OPT | grep -i "_ITEM" >/dev/null 2>&1 && __OPT=$(echo $__OPT | sed -e "s#_ITEM.##g")
+                               # filter debug_*
+                               echo $__OPT | grep -i "debug_" >/dev/null 2>&1 && {
+                                       [ $__VAL -eq 0 ] && return      # not set ignore
+                                       __VAL=$(echo $__OPT | sed -e "s#debug_##g")
+                                       __OPT="debug"
+                               }
+                               # uci only accept "_" but we need "-"
+                               local __OPT=$(echo $__OPT | sed -e "s#_#-#g")
+                               # write to config
+                               echo -e "$__OPT\t$__VAL" >> $CFGTEMP
+                               ;;
+               esac
+       }
+
+       mkdir -m0755 -p /var/etc
+       echo "" > $CFGTEMP      # create tmp config file
+       chmod 644 $CFGTEMP      # garantee that privoxy can read
+       chgrp privoxy $CFGTEMP
+
+       echo '### AUTO-GENERATED CONFIGURATION'    >> $CFGTEMP
+       echo '### USED BY PRIVOXY'                 >> $CFGTEMP
+       echo '### DO NOT EDIT'                     >> $CFGTEMP
+       echo '### SEE /etc/config/privoxy INSTEAD' >> $CFGTEMP
+       echo ''                                    >> $CFGTEMP
+
+       config_load privoxy     # calling above option_cb()
+
+       # write logdir/logfile to config
+       echo -e "logdir\t$_LOGDIR" >> $CFGTEMP
+       echo -e "logfile\t$_LOGFILE" >> $CFGTEMP
+
+       # create logfile and set permissions
+       touch $_LOGDIR/$_LOGFILE
+       chmod 664 $_LOGDIR/$_LOGFILE
+       chown privoxy:privoxy $_LOGDIR/$_LOGFILE
+
+       # move temp to final privoxy readable configuration
+       mv -f $CFGTEMP $CFGFILE
+}
+
+# privoxy should auto-reload it's configuration
+# but it only reload on next connect to one of the listen_address
+# if we create a new listen_address privoxy never reload
+reload_service() {
+       # so we restart here because rc.common reload_service only start without stopping
+       restart "$@"
+
+       # the following should normally work but see above
+#      _uci2conf       # convert uci config
+}
+
+service_triggers() {
+       procd_add_reload_trigger "privoxy"
+}
+
+start_service() {
+       # redefined callback for sections when calling config_load
+       config_cb() {
+               # $1    type of config section
+               # $2    name of section
+               [ "$1" = "interface" ] && \
+                       procd_add_interface_trigger interface.* $2 /etc/init.d/privoxy restart
+       }
+
+       _uci2conf       # convert uci config
+
+       procd_open_instance
+
+       procd_set_param command /usr/sbin/privoxy
+       procd_append_param command --no-daemon                  # for procd run in foreground
+       procd_append_param command --pidfile $PIDFILE           # set pid file
+       procd_append_param command --user privoxy.privoxy       # set user
+       procd_append_param command $CFGFILE                     # config file
+
+       procd_set_param file $CFGFILE   # set configration file
+
+        procd_open_trigger     # we need a restart on interface events not a reload
+       config_load network     # load network configuration and set trigger(s) in config_cb() above
+        procd_close_trigger
+
+       procd_close_instance
+}
+
+service_running() {
+       logger_trick() {
+               sleep 1         # give privoxy time to completely come up
+               logger -p daemon.notice -t "privoxy[$(cat $PIDFILE)]" "Service started successfully"
+       }
+       logger_trick &
+}
+
+stop_service() {
+       logger -p daemon.notice -t "privoxy[$(cat $PIDFILE)]" "Service shutdown"
+}
diff --git a/net/privoxy/files/privoxy.oldconfig b/net/privoxy/files/privoxy.oldconfig
new file mode 100644 (file)
index 0000000..9496356
--- /dev/null
@@ -0,0 +1,33 @@
+#
+# original configuration file used by privoxy
+# this is no longer supported by this package
+# it's converted and moved to uci configuration
+# please look at /etc/config/privoxy
+#
+confdir /etc/privoxy
+logdir /var/log
+logfile privoxy.log
+filterfile default.filter
+actionsfile match-all.action # Actions that are applied to all sites and maybe overruled later on.
+actionsfile default.action   # Main actions file
+#actionsfile user.action      # User customizations
+listen-address  127.0.0.1:8118
+toggle  1
+enable-remote-toggle  1
+enable-remote-http-toggle  0
+enable-edit-actions 1
+enforce-blocks 0
+buffer-limit 4096
+forwarded-connect-retries  0
+accept-intercepted-requests 0
+allow-cgi-request-crunching 0
+split-large-forms 0
+keep-alive-timeout 300
+socket-timeout 300
+permit-access  192.168.1.0/24
+debug   1    # show each GET/POST/CONNECT request
+debug   4096 # Startup banner and warnings
+debug   8192 # Errors - *we highly recommended enabling this*
+#admin-address privoxy-admin@example.com
+#proxy-info-url http://www.example.com/proxy-service.html
+
index 985eb4c9916e23912dbc13a1bfa39e0234d26571..af437bbe5c2a0a5adc696dd958aa832b0a1a3e62 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=prosody
-PKG_VERSION:=0.9.4
-PKG_RELEASE:=2
+PKG_VERSION:=0.9.7
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://prosody.im/downloads/source
-PKG_MD5SUM:=94f9a613c834c276352ac5b142fb72e0
+PKG_MD5SUM:=47de7f593279e327792df78cfa93e8a7
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 PKG_LICENSE:=MIT/X11
 
index 482d612674944b52e1c39d08415d99ffc1be69dc..6336717b0981725acb0254842caf6aba4b2e81f9 100644 (file)
@@ -18,7 +18,7 @@ PKG_SOURCE_VERSION:=6a3234eaa79f15857260df31f98711ef24266191
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 
 PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 
 PKG_FIXUP:=autoreconf
 PKG_BUILD_PARALLEL:=1
index 91a86a32aabe09af218689c8daa242bd1cf3103d..bb3fc7d64b4e7c983d558ed0d83ba545192cdebf 100644 (file)
@@ -18,7 +18,7 @@ PKG_MD5SUM:=69b8155dd442a6f24e28ef5407d868eb
 PKG_MAINTAINER:= Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=GPL-2.0 OpenSSL
-PKG_LICENSE_FILE:=COPYING COPYING.OpenSSL
+PKG_LICENSE_FILES:=COPYING COPYING.OpenSSL
 
 PKG_INSTALL:=1
 
diff --git a/net/sqm-scripts/Makefile b/net/sqm-scripts/Makefile
new file mode 100644 (file)
index 0000000..298220d
--- /dev/null
@@ -0,0 +1,57 @@
+# 
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=sqm-scripts
+PKG_VERSION:=7
+PKG_RELEASE:=3
+PKG_LICENSE:=GPLv2
+
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/sqm-scripts
+  SECTION:=net
+  CATEGORY:=Base system
+  DEPENDS:=+tc +kmod-sched +kmod-ifb iptables +ip \
+       +iptables-mod-filter +iptables-mod-ipopt +iptables-mod-conntrack-extra
+  TITLE:=SQM Scripts (QoS)
+  PKGARCH:=all
+  MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
+endef
+
+define Package/sqm-scripts/description
+ A set of scripts that does simple SQM configuration.
+endef
+
+define Package/sqm-scripts/conffiles
+/etc/config/sqm
+endef
+
+define Build/Prepare
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/sqm-scripts/install
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/etc/init.d/sqm $(1)/etc/init.d/sqm
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_DATA) ./files/etc/config/sqm $(1)/etc/config/sqm
+       $(INSTALL_DIR) $(1)/usr/lib/sqm
+       $(INSTALL_BIN) ./files/usr/lib/sqm/*.sh $(1)/usr/lib/sqm/
+       $(INSTALL_BIN) ./files/usr/lib/sqm/*.qos $(1)/usr/lib/sqm/
+       $(INSTALL_DATA) ./files/usr/lib/sqm/*.help $(1)/usr/lib/sqm/
+endef
+
+$(eval $(call BuildPackage,sqm-scripts))
diff --git a/net/sqm-scripts/files/etc/config/sqm b/net/sqm-scripts/files/etc/config/sqm
new file mode 100644 (file)
index 0000000..d039808
--- /dev/null
@@ -0,0 +1,16 @@
+
+config queue 'eth1'
+        option enabled '0'
+        option interface 'eth1'
+        option download '85000'
+        option upload '10000'
+        option qdisc 'fq_codel'
+        option script 'simple.qos'
+        option qdisc_advanced '0'
+        option ingress_ecn 'ECN'
+        option egress_ecn 'NOECN'
+        option qdisc_really_really_advanced '0'
+        option itarget 'auto'
+        option etarget 'auto'
+        option linklayer 'none'
+
diff --git a/net/sqm-scripts/files/etc/init.d/sqm b/net/sqm-scripts/files/etc/init.d/sqm
new file mode 100755 (executable)
index 0000000..70307a6
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh /etc/rc.common
+
+START=50
+
+reload()
+{
+/usr/lib/sqm/run.sh
+}
+
+restart()
+{
+reload
+}
+
+start()
+{
+reload
+}
+
+stop()
+{
+/usr/lib/sqm/run.sh stop
+}
\ No newline at end of file
diff --git a/net/sqm-scripts/files/usr/lib/sqm/functions.sh b/net/sqm-scripts/files/usr/lib/sqm/functions.sh
new file mode 100644 (file)
index 0000000..3411b8f
--- /dev/null
@@ -0,0 +1,458 @@
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+#       Copyright (C) 2012-4 Michael D. Taht, Toke Høiland-Jørgensen, Sebastian Moeller
+
+#improve the logread output
+sqm_logger() {
+    logger -t SQM -s ${1}
+}
+
+insmod() {
+  lsmod | grep -q ^$1 || $INSMOD $1
+}
+
+ipt() {
+  d=`echo $* | sed s/-A/-D/g`
+  [ "$d" != "$*" ] && {
+       iptables $d > /dev/null 2>&1
+       ip6tables $d > /dev/null 2>&1
+  }
+  d=`echo $* | sed s/-I/-D/g`
+  [ "$d" != "$*" ] && {
+       iptables $d > /dev/null 2>&1
+       ip6tables $d > /dev/null 2>&1
+  }
+  iptables $* > /dev/null 2>&1
+  ip6tables $* > /dev/null 2>&1
+}
+
+do_modules() {
+#sm TODO: check first whether the modules exist and only load then
+       insmod act_ipt
+       insmod sch_$QDISC
+       insmod sch_ingress
+       insmod act_mirred
+       insmod cls_fw
+       insmod sch_htb
+}
+
+
+# You need to jiggle these parameters. Note limits are tuned towards a <10Mbit uplink <60Mbup down
+
+[ -z "$UPLINK" ] && UPLINK=2302
+[ -z "$DOWNLINK" ] && DOWNLINK=14698
+[ -z "$IFACE" ] && IFACE=ge00
+[ -z "$QDISC" ] && QDISC=fq_codel
+[ -z "$LLAM" ] && LLAM="tc_stab"
+[ -z "$LINKLAYER" ] && LINKLAYER="none"
+[ -z "$OVERHEAD" ] && OVERHEAD=0
+[ -z "$STAB_MTU" ] && STAB_MTU=2047
+[ -z "$STAB_MPU" ] && STAB_MPU=0
+[ -z "$STAB_TSIZE" ] && STAB_TSIZE=512
+[ -z "$AUTOFLOW" ] && AUTOFLOW=0
+[ -z "$LIMIT" ] && LIMIT=1001  # sane global default for *LIMIT for fq_codel on a small memory device
+[ -z "$ILIMIT" ] && ILIMIT=
+[ -z "$ELIMIT" ] && ELIMIT=
+[ -z "$ITARGET" ] && ITARGET=
+[ -z "$ETARGET" ] && ETARGET=
+[ -z "$IECN" ] && IECN="ECN"
+[ -z "$EECN" ] && EECN="NOECN"
+[ -z "$SQUASH_DSCP" ] && SQUASH_DSCP="1"
+[ -z "$SQUASH_INGRESS" ] && SQUASH_INGRESS="1"
+[ -z "$IQDISC_OPTS" ] && IQDISC_OPTS=""
+[ -z "$EQDISC_OPTS" ] && EQDISC_OPTS=""
+[ -z "$TC" ] && TC=`which tc`
+#[ -z "$TC" ] && TC="sqm_logger tc"# this redirects all tc calls into the log
+[ -z "$IP" ] && IP=$( which ip )
+[ -z "$INSMOD" ] && INSMOD=`which insmod`
+[ -z "$TARGET" ] && TARGET="5ms"
+[ -z "$IPT_MASK" ] && IPT_MASK="0xff"
+[ -z "$IPT_MASK_STRING" ] && IPT_MASK_STRING="/${IPT_MASK}"    # for set-mark
+
+#sqm_logger "${0} IPT_MASK: ${IPT_MASK_STRING}"
+
+
+
+# find the ifb device associated with a specific interface, return nothing of no ifb is associated with IF
+get_ifb_associated_with_if() {
+    CUR_IF=$1
+    # CUR_IFB=$( tc -p filter show parent ffff: dev ${CUR_IF} | grep -o -e ifb'[[:digit:]]\+' )
+    CUR_IFB=$( tc -p filter show parent ffff: dev ${CUR_IF} | grep -o -e ifb'[^)]\+' ) # my editor's syntax coloration is limitied so I need a single quote in this line (between eiditor and s)
+    sqm_logger "ifb associated with interface ${CUR_IF}: ${CUR_IFB}"
+    echo ${CUR_IFB}
+}
+
+# ATTENTION, IFB names can only be 15 chararcters, so we chop of excessive characters at the start of the interface name 
+# if required
+create_new_ifb_for_if() {
+    CUR_IF=$1
+    MAX_IF_NAME_LENGTH=15
+    IFB_PREFIX="ifb4"
+    NEW_IFB="${IFB_PREFIX}${CUR_IF}"
+    IFB_NAME_LENGTH=${#NEW_IFB}
+    if [ ${IFB_NAME_LENGTH} -gt ${MAX_IF_NAME_LENGTH} ]; 
+    then
+       sqm_logger "The requsted IFB name ${NEW_IFB} is longer than the allowed 15 characters, trying to make it shorter"
+       OVERLIMIT=$(( ${#NEW_IFB} - ${MAX_IF_NAME_LENGTH} ))
+       NEW_IFB=${IFB_PREFIX}${CUR_IF:${OVERLIMIT}:$(( ${MAX_IF_NAME_LENGTH} - ${#IFB_PREFIX} ))}
+    fi
+    sqm_logger "trying to create new IFB: ${NEW_IFB}"
+    $IP link add name ${NEW_IFB} type ifb #>/dev/null 2>&1     # better be verbose
+    echo ${NEW_IFB}
+}
+
+# the best match is either the IFB already associated with the current interface or a new named IFB
+get_ifb_for_if() {
+    CUR_IF=$1
+    # if an ifb is already associated return that
+    CUR_IFB=$( get_ifb_associated_with_if ${CUR_IF} )
+    [ -z "$CUR_IFB" ] && CUR_IFB=$( create_new_ifb_for_if ${CUR_IF} )
+    [ -z "$CUR_IFB" ] && sqm_logger "Could not find existing IFB for ${CUR_IF}, nor create a new IFB instead..."
+    echo ${CUR_IFB}
+}
+
+#sm: we need the functions above before trying to set the ingress IFB device
+[ -z "$DEV" ] && DEV=$( get_ifb_for_if ${IFACE} )      # automagically get the right IFB device for the IFACE"
+
+
+get_htb_adsll_string() {
+       ADSLL=""
+       if [ "$LLAM" = "htb_private" -a "$LINKLAYER" != "none" ]; 
+       then
+               # HTB defaults to MTU 1600 and an implicit fixed TSIZE of 256, but HTB as of around 3.10.0
+               # does not actually use a table in the kernel
+               ADSLL="mpu ${STAB_MPU} linklayer ${LINKLAYER} overhead ${OVERHEAD} mtu ${STAB_MTU}"
+               sqm_logger "ADSLL: ${ADSLL}"
+       fi
+       echo ${ADSLL}
+}
+
+get_stab_string() {
+       STABSTRING=""
+       if [ "${LLAM}" = "tc_stab" -a "$LINKLAYER" != "none" ]; 
+       then
+               STABSTRING="stab mtu ${STAB_MTU} tsize ${STAB_TSIZE} mpu ${STAB_MPU} overhead ${OVERHEAD} linklayer ${LINKLAYER}"
+               sqm_logger "STAB: ${STABSTRING}"
+       fi
+       echo ${STABSTRING}
+}
+
+sqm_stop() {
+       $TC qdisc del dev $IFACE ingress
+       $TC qdisc del dev $IFACE root
+       $TC qdisc del dev $DEV root
+}
+
+# Note this has side effects on the prio variable
+# and depends on the interface global too
+
+fc() {
+       $TC filter add dev $interface protocol ip parent $1 prio $prio u32 match ip tos $2 0xfc classid $3
+       prio=$(($prio + 1))
+       $TC filter add dev $interface protocol ipv6 parent $1 prio $prio u32 match ip6 priority $2 0xfc classid $3
+       prio=$(($prio + 1))
+}
+
+fc_pppoe() {
+       PPPOE_SESSION_ETHERTYPE="0x8864"
+       PPPOE_DISCOVERY_ETHERTYPE="0x8863"
+       PPP_PROTO_IP4="0x0021"
+       PPP_PROTO_IP6="0x0057"
+       ARP_PROTO_IP4="0x0806"
+       $TC filter add dev $interface protocol ip parent $1 prio $prio u32 match ip tos $2 0xfc classid $3
+       $TC filter add dev $interface parent $1 protocol ${PPPOE_SESSION_ETHERTYPE} prio $(( 400 + ${prio}  )) u32 \
+           match u16 ${PPP_PROTO_IP4} 0xffff at 6 \
+           match u8 $2 0xfc at 9 \
+           flowid $3
+
+       prio=$(($prio + 1))
+       $TC filter add dev $interface protocol ipv6 parent $1 prio $prio u32 match ip6 priority $2 0xfc classid $3
+       $TC filter add dev $interface parent $1 protocol ${PPPOE_SESSION_ETHERTYPE} prio $(( 600 + ${prio} )) u32 \
+           match u16 ${PPP_PROTO_IP6} 0xffff at 6 \
+           match u16 0x0${2:2:2}0 0x0fc0 at 8 \
+           flowid $3
+       
+
+
+
+       prio=$(($prio + 1))
+
+
+}
+# FIXME: actually you need to get the underlying MTU on PPOE thing
+
+get_mtu() {
+       BW=$2
+       F=`cat /sys/class/net/$1/mtu`
+       if [ -z "$F" ]
+       then
+       F=1500
+       fi
+       if [ $BW -gt 20000 ]
+       then
+               F=$(($F * 2))
+       fi
+       if [ $BW -gt 30000 ]
+       then
+               F=$(($F * 2))
+       fi
+       if [ $BW -gt 40000 ]
+       then
+               F=$(($F * 2))
+       fi
+       if [ $BW -gt 50000 ]
+       then
+               F=$(($F * 2))
+       fi
+       if [ $BW -gt 60000 ]
+       then
+               F=$(($F * 2))
+       fi
+       if [ $BW -gt 80000 ]
+       then
+               F=$(($F * 2))
+       fi
+       echo $F
+}
+
+# FIXME should also calculate the limit
+# Frankly I think Xfq_codel can pretty much always run with high numbers of flows
+# now that it does fate sharing
+# But right now I'm trying to match the ns2 model behavior better
+# So SET the autoflow variable to 1 if you want the cablelabs behavior
+
+get_flows() {
+       if [ "$AUTOFLOW" -eq "1" ] 
+       then
+               FLOWS=8
+               [ $1 -gt 999 ] && FLOWS=16
+               [ $1 -gt 2999 ] && FLOWS=32
+               [ $1 -gt 7999 ] && FLOWS=48
+               [ $1 -gt 9999 ] && FLOWS=64
+               [ $1 -gt 19999 ] && FLOWS=128
+               [ $1 -gt 39999 ] && FLOWS=256
+               [ $1 -gt 69999 ] && FLOWS=512
+               [ $1 -gt 99999 ] && FLOWS=1024
+               case $QDISC in
+                       codel|ns2_codel|pie|*fifo|pfifo_fast) ;;
+                       fq_codel|*fq_codel|sfq) echo flows $FLOWS ;;
+               esac
+       fi
+}      
+
+# set the target parameter, also try to only take well formed inputs
+# Note, the link bandwidth in the current direction (ingress or egress) 
+# is required to adjust the target for slow links
+get_target() {
+       local CUR_TARGET=${1}
+       local CUR_LINK_KBPS=${2}
+       [ ! -z "$CUR_TARGET" ] && sqm_logger "cur_target: ${CUR_TARGET} cur_bandwidth: ${CUR_LINK_KBPS}"
+       CUR_TARGET_STRING=
+       # either e.g. 100ms or auto
+       CUR_TARGET_VALUE=$( echo ${CUR_TARGET} | grep -o -e \^'[[:digit:]]\+' )
+       CUR_TARGET_UNIT=$( echo ${CUR_TARGET} | grep -o -e '[[:alpha:]]\+'\$ )
+#      [ ! -z "$CUR_TARGET" ] && sqm_logger "CUR_TARGET_VALUE: $CUR_TARGET_VALUE"
+#      [ ! -z "$CUR_TARGET" ] && sqm_logger "CUR_TARGET_UNIT: $CUR_TARGET_UNIT"
+       
+       AUTO_TARGET=
+       UNIT_VALID=
+       
+       case $QDISC in
+               *codel|*pie) 
+                       if [ ! -z "${CUR_TARGET_VALUE}" -a ! -z "${CUR_TARGET_UNIT}" ];
+                       then
+                           case ${CUR_TARGET_UNIT} in
+                                   # permissible units taken from: tc_util.c get_time()
+                                   s|sec|secs|ms|msec|msecs|us|usec|usecs) 
+                                       CUR_TARGET_STRING="target ${CUR_TARGET_VALUE}${CUR_TARGET_UNIT}" 
+                                       UNIT_VALID="1"
+                                       ;;
+                           esac
+                       fi
+                       case ${CUR_TARGET_UNIT} in
+                           auto|Auto|AUTO) 
+                               if [ ! -z "${CUR_LINK_KBPS}" ];
+                               then
+                                   TMP_TARGET_US=$( adapt_target_to_slow_link $CUR_LINK_KBPS )
+                                   TMP_INTERVAL_STRING=$( adapt_interval_to_slow_link $TMP_TARGET_US )
+                                   CUR_TARGET_STRING="target ${TMP_TARGET_US}us ${TMP_INTERVAL_STRING}"
+                                   AUTO_TARGET="1"
+                               else
+                                   sqm_logger "required link bandwidth in kbps not passed to get_target()." 
+                               fi
+                           ;;
+                       esac
+                       if [ ! -z "${CUR_TARGET}" ];
+                           then
+                           if [ -z "${CUR_TARGET_VALUE}" -o -z "${UNIT_VALID}" ];
+                           then 
+                               [ -z "$AUTO_TARGET" ] && sqm_logger "${CUR_TARGET} is not a well formed tc target specifier; e.g.: 5ms (or s, us), or the string auto."
+                           fi
+                       fi
+                   ;;
+       esac
+#      sqm_logger "target: ${CUR_TARGET_STRING}"
+       echo $CUR_TARGET_STRING
+}      
+
+# for low bandwidth links fq_codels default target of 5ms does not work too well
+# so increase target for slow links (note below roughly 2500kbps a single packet will \
+# take more than 5 ms to be tansfered over the wire)
+adapt_target_to_slow_link() {
+    CUR_LINK_KBPS=$1
+    CUR_EXTENDED_TARGET_US=
+    MAX_PAKET_DELAY_IN_US_AT_1KBPS=$(( 1000 * 1000 *1540 * 8 / 1000 ))
+    CUR_EXTENDED_TARGET_US=$(( ${MAX_PAKET_DELAY_IN_US_AT_1KBPS} / ${CUR_LINK_KBPS} )) # note this truncates the decimals
+    # do not change anything for fast links
+    [ "$CUR_EXTENDED_TARGET_US" -lt 5000 ] && CUR_EXTENDED_TARGET_US=5000
+    case ${QDISC} in
+        *codel|pie)
+           echo "${CUR_EXTENDED_TARGET_US}"
+           ;;
+    esac
+}
+
+# codel looks at a whole interval to figure out wether observed latency stayed below target
+# if target >= interval that will not work well, so increase interval by the same amonut that target got increased
+adapt_interval_to_slow_link() {
+    CUR_TARGET_US=$1
+    case ${QDISC} in
+        *codel)
+            CUR_EXTENDED_INTERVAL_US=$(( (100 - 5) * 1000 + ${CUR_TARGET_US} ))
+           echo "interval ${CUR_EXTENDED_INTERVAL_US}us"
+           ;;
+       pie)
+           ## not sure if pie needs this, probably not
+           #CUR_EXTENDED_TUPDATE_US=$(( (30 - 20) * 1000 + ${CUR_TARGET_US} ))
+           #echo "tupdate ${CUR_EXTENDED_TUPDATE_US}us"
+           ;;
+    esac
+}
+
+
+# set quantum parameter if available for this qdisc
+get_quantum() {
+    case $QDISC in
+       *fq_codel|fq_pie|drr) echo quantum $1 ;;
+       *) ;;
+    esac
+}
+
+# only show limits to qdiscs that can handle them...
+# Note that $LIMIT contains the default limit
+get_limit() {
+    CURLIMIT=$1
+    case $QDISC in
+    *codel|*pie|pfifo_fast|sfq|pfifo) [ -z ${CURLIMIT} ] && CURLIMIT=${LIMIT}  # use the global default limit
+        ;;
+    bfifo) [ -z "$CURLIMIT" ] && [ ! -z "$LIMIT" ] && CURLIMIT=$(( ${LIMIT} * $( cat /sys/class/net/${IFACE}/mtu ) ))  # bfifo defaults to txquelength * MTU, 
+        ;;
+    *) sqm_logger "${QDISC} does not support a limit"
+        ;;
+    esac
+    sqm_logger "get_limit: $1 CURLIMIT: ${CURLIMIT}"
+    
+    if [ ! -z "$CURLIMIT" ]
+    then
+    echo "limit ${CURLIMIT}"
+    fi
+}
+
+get_ecn() {
+    CURECN=$1
+    #sqm_logger CURECN: $CURECN
+       case ${CURECN} in
+               ECN)
+                       case $QDISC in
+                               *codel|*pie|*red)
+                                   CURECN=ecn 
+                                   ;;
+                               *) 
+                                   CURECN="" 
+                                   ;;
+                       esac
+                       ;;
+               NOECN)
+                       case $QDISC in
+                               *codel|*pie|*red) 
+                                   CURECN=noecn 
+                                   ;;
+                               *) 
+                                   CURECN="" 
+                                   ;;
+                       esac
+                       ;;
+               *)
+                   sqm_logger "ecn value $1 not handled"
+                   ;;
+       esac
+       #sqm_logger "get_ECN: $1 CURECN: ${CURECN} IECN: ${IECN} EECN: ${EECN}"
+       echo ${CURECN}
+
+}
+
+# This could be a complete diffserv implementation
+
+diffserv() {
+
+interface=$1
+prio=1
+
+# Catchall
+
+$TC filter add dev $interface parent 1:0 protocol all prio 999 u32 \
+        match ip protocol 0 0x00 flowid 1:12
+
+# Find the most common matches fast
+#fc_pppoe() instead of fc() with effectice ingress classification for pppoe is very expensive and destroys LUL
+
+fc 1:0 0x00 1:12 # BE
+fc 1:0 0x20 1:13 # CS1
+fc 1:0 0x10 1:11 # IMM
+fc 1:0 0xb8 1:11 # EF
+fc 1:0 0xc0 1:11 # CS3
+fc 1:0 0xe0 1:11 # CS6
+fc 1:0 0x90 1:11 # AF42 (mosh)
+
+# Arp traffic
+$TC filter add dev $interface protocol arp parent 1:0 prio $prio handle 500 fw flowid 1:11
+
+
+prio=$(($prio + 1))
+
+
+}
+
+diffserv_pppoe() {
+
+interface=$1
+prio=1
+
+# Catchall
+
+$TC filter add dev $interface parent 1:0 protocol all prio 999 u32 \
+        match ip protocol 0 0x00 flowid 1:12
+
+# Find the most common matches fast
+#fc_pppoe() instead of fc() with effectice ingress classification for pppoe is very expensive and destroys LUL
+
+fc_pppoe 1:0 0x00 1:12 # BE
+fc_pppoe 1:0 0x20 1:13 # CS1
+fc_pppoe 1:0 0x10 1:11 # IMM
+fc_pppoe 1:0 0xb8 1:11 # EF
+fc_pppoe 1:0 0xc0 1:11 # CS3
+fc_pppoe 1:0 0xe0 1:11 # CS6
+fc_pppoe 1:0 0x90 1:11 # AF42 (mosh)
+
+# Arp traffic
+$TC filter add dev $interface protocol arp parent 1:0 prio $prio handle 500 fw flowid 1:11
+
+
+prio=$(($prio + 1))
+
+
+}
+
+
diff --git a/net/sqm-scripts/files/usr/lib/sqm/run.sh b/net/sqm-scripts/files/usr/lib/sqm/run.sh
new file mode 100755 (executable)
index 0000000..d7b86a2
--- /dev/null
@@ -0,0 +1,89 @@
+#!/bin/sh
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+#       Copyright (C) 2012-4 Michael D. Taht, Toke Høiland-Jørgensen, Sebastian Moeller
+
+
+. /lib/functions.sh
+
+STOP=$1
+ACTIVE_STATE_PREFIX="SQM_active_on_"
+ACTIVE_STATE_FILE_DIR="/var/run/SQM"
+mkdir -p ${ACTIVE_STATE_FILE_DIR}
+
+# the current uci config file does not necessarily contain sections for all interfaces with active
+# SQM instances, so use the ACTIVE_STATE_FILES to detect the interfaces on which to stop SQM.
+# Currently the .qos scripts start with stopping any existing traffic shaping so this should not
+# effectively change anything...
+PROTO_STATE_FILE_LIST=$( ls ${ACTIVE_STATE_FILE_DIR}/${ACTIVE_STATE_PREFIX}* 2> /dev/null )
+for STATE_FILE in ${PROTO_STATE_FILE_LIST} ; do
+    if [ -f ${STATE_FILE} ] ;
+    then
+       STATE_FILE_BASE_NAME=$( basename ${STATE_FILE} )
+       CURRENT_INTERFACE=${STATE_FILE_BASE_NAME:${#ACTIVE_STATE_PREFIX}:$(( ${#STATE_FILE_BASE_NAME} - ${#ACTIVE_STATE_PREFIX} ))}        
+       logger -t SQM -s "${0} Stopping SQM on interface: ${CURRENT_INTERFACE}"
+       /usr/lib/sqm/stop.sh ${CURRENT_INTERFACE}
+       rm ${STATE_FILE}        # well, we stop it so it is not running anymore and hence no active state file needed...
+    fi
+done
+
+config_load sqm
+
+run_simple_qos() {
+       local section="$1"
+       export IFACE=$(config_get "$section" interface)
+       ACTIVE_STATE_FILE_FQN="${ACTIVE_STATE_FILE_DIR}/${ACTIVE_STATE_PREFIX}${IFACE}" # this marks interfaces as active with SQM
+       [ -f "${ACTIVE_STATE_FILE_FQN}" ] && logger -t SQM -s "Uh, oh, ${ACTIVE_STATE_FILE_FQN} should already be stopped."     # Not supposed to happen
+
+       if [ $(config_get "$section" enabled) -ne 1 ];
+       then
+           if [ -f "${ACTIVE_STATE_FILE_FQN}" ];
+           then
+               # this should not be possible, delete after testing
+               local SECTION_STOP="stop"       # it seems the user just de-selected enable, so stop the active SQM
+           else
+               logger -t SQM -s "${0} SQM for interface ${IFACE} is not enabled, skipping over..."
+               return 0        # since SQM is not active on the current interface nothing to do here
+           fi
+       fi
+
+       export UPLINK=$(config_get "$section" upload)
+       export DOWNLINK=$(config_get "$section" download)
+       export LLAM=$(config_get "$section" linklayer_adaptation_mechanism)
+       export LINKLAYER=$(config_get "$section" linklayer)
+       export OVERHEAD=$(config_get "$section" overhead)
+       export STAB_MTU=$(config_get "$section" tcMTU)
+       export STAB_TSIZE=$(config_get "$section" tcTSIZE)
+       export STAB_MPU=$(config_get "$section" tcMPU)
+       export ILIMIT=$(config_get "$section" ilimit)
+       export ELIMIT=$(config_get "$section" elimit)
+       export ITARGET=$(config_get "$section" itarget)
+       export ETARGET=$(config_get "$section" etarget)
+       export IECN=$(config_get "$section" ingress_ecn)
+       export EECN=$(config_get "$section" egress_ecn)
+       export IQDISC_OPTS=$(config_get "$section" iqdisc_opts)
+       export EQDISC_OPTS=$(config_get "$section" eqdisc_opts)
+       export TARGET=$(config_get "$section" target)
+       export SQUASH_DSCP=$(config_get "$section" squash_dscp)
+       export SQUASH_INGRESS=$(config_get "$section" squash_ingress)
+
+       export QDISC=$(config_get "$section" qdisc)
+       export SCRIPT=/usr/lib/sqm/$(config_get "$section" script)
+
+#      # there should be nothing left to stop, so just avoid calling the script
+       if [ "$STOP" == "stop" -o "$SECTION_STOP" == "stop" ];
+       then 
+#           /usr/lib/sqm/stop.sh
+#           [ -f ${ACTIVE_STATE_FILE_FQN} ] && rm ${ACTIVE_STATE_FILE_FQN}     # conditional to avoid errors ACTIVE_STATE_FILE_FQN does not exist anymore
+#           $(config_set "$section" enabled 0) # this does not save to the config file only to the loaded memory representation
+            logger -t SQM -s "${0} SQM qdiscs on ${IFACE} removed"
+            return 0
+       fi
+       logger -t SQM -s "${0} Queue Setup Script: ${SCRIPT}"
+       [ -x "$SCRIPT" ] && { $SCRIPT ; touch ${ACTIVE_STATE_FILE_FQN}; }
+}
+
+config_foreach run_simple_qos
diff --git a/net/sqm-scripts/files/usr/lib/sqm/simple.qos b/net/sqm-scripts/files/usr/lib/sqm/simple.qos
new file mode 100755 (executable)
index 0000000..5df6aa7
--- /dev/null
@@ -0,0 +1,215 @@
+#!/bin/sh
+# Cero3 Shaper
+# A 3 bin tc_codel and ipv6 enabled shaping script for
+# ethernet gateways
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+#       Copyright (C) 2012-4 Michael D. Taht, Toke Høiland-Jørgensen, Sebastian Moeller
+
+# Compared to the complexity that debloat had become
+# this cleanly shows a means of going from diffserv marking
+# to prioritization using the current tools (ip(6)tables
+# and tc. I note that the complexity of debloat exists for
+# a reason, and it is expected that script is run first
+# to setup various other parameters such as BQL and ethtool.
+# (And that the debloat script has setup the other interfaces)
+
+# You need to jiggle these parameters. Note limits are tuned towards a <10Mbit uplink <60Mbup down
+
+. /usr/lib/sqm/functions.sh
+
+ipt_setup() {
+
+ipt -t mangle -N QOS_MARK_${IFACE}
+
+ipt -t mangle -A QOS_MARK_${IFACE} -j MARK --set-mark 0x2${IPT_MASK_STRING}
+# You can go further with classification but...
+ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS1 -j MARK --set-mark 0x3${IPT_MASK_STRING}
+ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS6 -j MARK --set-mark 0x1${IPT_MASK_STRING}
+ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class EF -j MARK --set-mark 0x1${IPT_MASK_STRING}
+ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class AF42 -j MARK --set-mark 0x1${IPT_MASK_STRING}
+ipt -t mangle -A QOS_MARK_${IFACE} -m tos  --tos Minimize-Delay -j MARK --set-mark 0x1${IPT_MASK_STRING}
+
+# and it might be a good idea to do it for udp tunnels too
+
+# Turn it on. Preserve classification if already performed
+
+if [ "$SQUASH_DSCP" = "1" ]
+then
+sqm_logger "Squashing differentiated services code points (DSCP) from ingress."
+ipt -t mangle -I PREROUTING -i $IFACE -m dscp ! --dscp 0 -j DSCP --set-dscp-class be
+else
+sqm_logger "Keeping differentiated services code points (DSCP) from ingress."
+ipt -t mangle -A PREROUTING -i $IFACE -m mark --mark 0x00${IPT_MASK_STRING} -g QOS_MARK_${IFACE} 
+fi
+
+ipt -t mangle -A POSTROUTING -o $IFACE -m mark --mark 0x00${IPT_MASK_STRING} -g QOS_MARK_${IFACE} 
+
+# The Syn optimization was nice but fq_codel does it for us
+# ipt -t mangle -A PREROUTING -i s+ -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j MARK --set-mark 0x01
+# Not sure if this will work. Encapsulation is a problem period
+
+ipt -t mangle -I PREROUTING -i vtun+ -p tcp -j MARK --set-mark 0x2${IPT_MASK_STRING} # tcp tunnels need ordering
+
+# Emanating from router, do a little more optimization
+# but don't bother with it too much. 
+
+ipt -t mangle -A OUTPUT -p udp -m multiport --ports 123,53 -j DSCP --set-dscp-class AF42
+
+#Not clear if the second line is needed
+#ipt -t mangle -A OUTPUT -o $IFACE -g QOS_MARK_${IFACE}
+
+}
+
+
+# TC rules
+
+egress() {
+
+CEIL=${UPLINK}
+PRIO_RATE=`expr $CEIL / 3` # Ceiling for prioirty
+BE_RATE=`expr $CEIL / 6`   # Min for best effort
+BK_RATE=`expr $CEIL / 6`   # Min for background
+BE_CEIL=`expr $CEIL - 16`  # A little slop at the top
+
+LQ="quantum `get_mtu $IFACE $CEIL`"
+
+$TC qdisc del dev $IFACE root 2> /dev/null
+$TC qdisc add dev $IFACE root handle 1: `get_stab_string` htb default 12
+$TC class add dev $IFACE parent 1: classid 1:1 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit `get_htb_adsll_string`
+$TC class add dev $IFACE parent 1:1 classid 1:10 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit prio 0 `get_htb_adsll_string`
+$TC class add dev $IFACE parent 1:1 classid 1:11 htb $LQ rate 128kbit ceil ${PRIO_RATE}kbit prio 1 `get_htb_adsll_string`
+$TC class add dev $IFACE parent 1:1 classid 1:12 htb $LQ rate ${BE_RATE}kbit ceil ${BE_CEIL}kbit prio 2 `get_htb_adsll_string`
+$TC class add dev $IFACE parent 1:1 classid 1:13 htb $LQ rate ${BK_RATE}kbit ceil ${BE_CEIL}kbit prio 3 `get_htb_adsll_string`
+
+$TC qdisc add dev $IFACE parent 1:11 handle 110: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${PRIO_RATE}` ${EQDISC_OPTS}
+$TC qdisc add dev $IFACE parent 1:12 handle 120: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${BE_RATE}` ${EQDISC_OPTS}
+$TC qdisc add dev $IFACE parent 1:13 handle 130: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${BK_RATE}` ${EQDISC_OPTS}
+
+
+# Need a catchall rule
+
+$TC filter add dev $IFACE parent 1:0 protocol all prio 999 u32 \
+        match ip protocol 0 0x00 flowid 1:12  
+
+# FIXME should probably change the filter here to do pre-nat
+        
+$TC filter add dev $IFACE parent 1:0 protocol ip prio 1 handle 1 fw classid 1:11
+$TC filter add dev $IFACE parent 1:0 protocol ip prio 2 handle 2 fw classid 1:12
+$TC filter add dev $IFACE parent 1:0 protocol ip prio 3 handle 3 fw classid 1:13
+
+# ipv6 support. Note that the handle indicates the fw mark bucket that is looked for
+
+$TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 4 handle 1 fw classid 1:11
+$TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 5 handle 2 fw classid 1:12
+$TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 6 handle 3 fw classid 1:13
+
+# Arp traffic
+
+$TC filter add dev $IFACE parent 1:0 protocol arp prio 7 handle 1 fw classid 1:11
+
+# ICMP traffic - Don't impress your friends. Deoptimize to manage ping floods
+# better instead
+
+$TC filter add dev $IFACE parent 1:0 protocol ip prio 8 \
+        u32 match ip protocol 1 0xff flowid 1:13
+
+$TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 9 \
+        u32 match ip protocol 1 0xff flowid 1:13
+
+#diffserv $IFACE
+
+}
+
+ingress() {
+
+CEIL=$DOWNLINK
+PRIO_RATE=`expr $CEIL / 3` # Ceiling for prioirty
+BE_RATE=`expr $CEIL / 6`   # Min for best effort
+BK_RATE=`expr $CEIL / 6`   # Min for background
+BE_CEIL=`expr $CEIL - 16`  # A little slop at the top
+
+LQ="quantum `get_mtu $IFACE $CEIL`"
+
+$TC qdisc del dev $IFACE handle ffff: ingress 2> /dev/null
+$TC qdisc add dev $IFACE handle ffff: ingress
+
+$TC qdisc del dev $DEV root  2> /dev/null
+
+if [ "$SQUASH_INGRESS" = "1" ]
+then
+sqm_logger "Do not perform DSCP based filtering on ingress. (1-tier classification)"
+# Revert to no dscp based filtering
+$TC qdisc del dev $DEV root 2>/dev/null
+$TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 10
+$TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit `get_htb_adsll_string`
+$TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit prio 0 `get_htb_adsll_string`
+$TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_flows ${DOWNLINK}` ${IQDISC_OPTS}
+
+else
+sqm_logger "Perform DSCP based filtering on ingress. (3-tier classification)"
+$TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 12
+$TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit `get_htb_adsll_string`
+$TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit prio 0 `get_htb_adsll_string`
+$TC class add dev $DEV parent 1:1 classid 1:11 htb $LQ rate 32kbit ceil ${PRIO_RATE}kbit prio 1 `get_htb_adsll_string`
+$TC class add dev $DEV parent 1:1 classid 1:12 htb $LQ rate ${BE_RATE}kbit ceil ${BE_CEIL}kbit prio 2 `get_htb_adsll_string`
+$TC class add dev $DEV parent 1:1 classid 1:13 htb $LQ rate ${BK_RATE}kbit ceil ${BE_CEIL}kbit prio 3 `get_htb_adsll_string`
+
+# I'd prefer to use a pre-nat filter but that causes permutation...
+
+$TC qdisc add dev $DEV parent 1:11 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 500` `get_flows ${PRIO_RATE}` ${IQDISC_OPTS}
+$TC qdisc add dev $DEV parent 1:12 handle 120: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 1500` `get_flows ${BE_RATE}` ${IQDISC_OPTS}
+$TC qdisc add dev $DEV parent 1:13 handle 130: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 300` `get_flows ${BK_RATE}` ${IQDISC_OPTS}
+
+diffserv $DEV
+
+fi
+
+ifconfig $DEV up
+
+# redirect all IP packets arriving in $IFACE to ifb0 
+
+$TC filter add dev $IFACE parent ffff: protocol all prio 10 u32 \
+  match u32 0 0 flowid 1:1 action mirred egress redirect dev $DEV
+
+}
+
+do_modules
+ipt_setup
+
+if [ "$UPLINK" -ne 0 ];
+then
+       egress
+       sqm_logger "egress shaping activated"
+else
+       sqm_logger "egress shaping deactivated"
+       tc qdisc del dev $IFACE root 2> /dev/null
+fi
+if [ "$DOWNLINK" -ne 0 ];
+then
+       ingress
+       sqm_logger "ingress shaping activated"
+else
+       sqm_logger "ingress shaping deactivated"
+       tc qdisc del dev $DEV root 2> /dev/null
+       tc qdisc del dev $IFACE ingress 2> /dev/null
+fi
+
+
+
+# References:
+# This alternate shaper attempts to go for 1/u performance in a clever way
+# http://git.coverfire.com/?p=linux-qos-scripts.git;a=blob;f=src-3tos.sh;hb=HEAD
+
+# Comments
+# This does the right thing with ipv6 traffic.
+# It also tries to leverage diffserv to some sane extent. In particular,
+# the 'priority' queue is limited to 33% of the total, so EF, and IMM traffic
+# cannot starve other types. The rfc suggested 30%. 30% is probably
+# a lot in today's world.
+
+# Flaws
+# Many!
diff --git a/net/sqm-scripts/files/usr/lib/sqm/simple.qos.help b/net/sqm-scripts/files/usr/lib/sqm/simple.qos.help
new file mode 100644 (file)
index 0000000..b059601
--- /dev/null
@@ -0,0 +1 @@
+BW-limited three-tier prioritisation scheme with fq_codel on each queue. (default)
diff --git a/net/sqm-scripts/files/usr/lib/sqm/simple_pppoe.qos b/net/sqm-scripts/files/usr/lib/sqm/simple_pppoe.qos
new file mode 100755 (executable)
index 0000000..d40d1bb
--- /dev/null
@@ -0,0 +1,398 @@
+#!/bin/sh
+# Cero3 Shaper
+# A 3 bin tc_codel and ipv6 enabled shaping script for
+# ethernet gateways
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+#       Copyright (C) 2012-4 Michael D. Taht, Toke Høiland-Jørgensen, Sebastian Moeller
+
+# Compared to the complexity that debloat had become
+# this cleanly shows a means of going from diffserv marking
+# to prioritization using the current tools (ip(6)tables
+# and tc. I note that the complexity of debloat exists for
+# a reason, and it is expected that script is run first
+# to setup various other parameters such as BQL and ethtool.
+# (And that the debloat script has setup the other interfaces)
+
+# You need to jiggle these parameters. Note limits are tuned towards a <10Mbit uplink <60Mbup down
+
+#sm: Goal to create a set of tc filters that also apply on pppoe encapsulated packets
+#      but having multiple filters run in succession is slow, so look at tc filter hashing 
+#      (this should help cut down the number of OPs per packet considerably)
+
+
+. /usr/lib/sqm/functions.sh
+#sqm_logger IPT_MASK: ${IPT_MASK_STRING}
+ipt_setup() {
+
+ipt -t mangle -N QOS_MARK_${IFACE}
+
+ipt -t mangle -A QOS_MARK_${IFACE} -j MARK --set-mark 0x2${IPT_MASK_STRING}
+# You can go further with classification but...
+ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS1 -j MARK --set-mark 0x3${IPT_MASK_STRING}
+ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS6 -j MARK --set-mark 0x1${IPT_MASK_STRING}
+ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class EF -j MARK --set-mark 0x1${IPT_MASK_STRING}
+ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class AF42 -j MARK --set-mark 0x1${IPT_MASK_STRING}
+ipt -t mangle -A QOS_MARK_${IFACE} -m tos  --tos Minimize-Delay -j MARK --set-mark 0x1${IPT_MASK_STRING}
+
+# and it might be a good idea to do it for udp tunnels too
+
+# Turn it on. Preserve classification if already performed
+
+if [ "$SQUASH_DSCP" = "1" ]
+then
+sqm_logger "Squashing differentiated services code points (DSCP) from ingress."
+ipt -t mangle -I PREROUTING -i $IFACE -m dscp ! --dscp 0 -j DSCP --set-dscp-class be
+else
+sqm_logger "Keeping differentiad services code points (DSCP) from ingress."
+ipt -t mangle -A PREROUTING -i $IFACE -m mark --mark 0x00${IPT_MASK_STRING} -g QOS_MARK_${IFACE} 
+fi
+
+ipt -t mangle -A POSTROUTING -o $IFACE -m mark --mark 0x00${IPT_MASK_STRING} -g QOS_MARK_${IFACE} 
+
+# The Syn optimization was nice but fq_codel does it for us
+# ipt -t mangle -A PREROUTING -i s+ -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j MARK --set-mark 0x01
+# Not sure if this will work. Encapsulation is a problem period
+
+ipt -t mangle -I PREROUTING -i vtun+ -p tcp -j MARK --set-mark 0x2${IPT_MASK_STRING} # tcp tunnels need ordering
+
+# Emanating from router, do a little more optimization
+# but don't bother with it too much. 
+
+ipt -t mangle -A OUTPUT -p udp -m multiport --ports 123,53 -j DSCP --set-dscp-class AF42
+
+#Not clear if the second line is needed
+#ipt -t mangle -A OUTPUT -o $IFACE -g QOS_MARK_${IFACE}
+
+}
+
+
+MYBURST=1600   #sm: make burst and cburst as well as quantum configurable for ingress and egress in the GUI
+# TC rules
+
+egress() {
+
+CEIL=${UPLINK}
+PRIO_RATE=`expr $CEIL / 3` # Ceiling for priority
+BE_RATE=`expr $CEIL / 6`   # Min for best effort
+BK_RATE=`expr $CEIL / 6`   # Min for background
+BE_CEIL=`expr $CEIL - 16`  # A little slop at the top
+
+LQ="quantum `get_mtu $IFACE $CEIL`"
+HTB_BURSTS="burst ${MYBURST} cburst ${MYBURST}"
+
+$TC qdisc del dev $IFACE root 2> /dev/null
+$TC qdisc add dev $IFACE root handle 1: `get_stab_string` htb default 12
+$TC class add dev $IFACE parent 1: classid 1:1 htb $LQ ${HTB_BURSTS} rate ${CEIL}kbit ceil ${CEIL}kbit `get_htb_adsll_string`
+$TC class add dev $IFACE parent 1:1 classid 1:10 htb $LQ ${HTB_BURSTS} rate ${CEIL}kbit ceil ${CEIL}kbit prio 0 `get_htb_adsll_string`
+$TC class add dev $IFACE parent 1:1 classid 1:11 htb $LQ ${HTB_BURSTS} rate 128kbit ceil ${PRIO_RATE}kbit prio 1 `get_htb_adsll_string`
+$TC class add dev $IFACE parent 1:1 classid 1:12 htb $LQ ${HTB_BURSTS} rate ${BE_RATE}kbit ceil ${BE_CEIL}kbit prio 2 `get_htb_adsll_string`
+$TC class add dev $IFACE parent 1:1 classid 1:13 htb $LQ ${HTB_BURSTS} rate ${BK_RATE}kbit ceil ${BE_CEIL}kbit prio 3 `get_htb_adsll_string`
+
+$TC qdisc add dev $IFACE parent 1:11 handle 110: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${PRIO_RATE}` ${EQDISC_OPTS}
+$TC qdisc add dev $IFACE parent 1:12 handle 120: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${BE_RATE}` ${EQDISC_OPTS}
+$TC qdisc add dev $IFACE parent 1:13 handle 130: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${BK_RATE}` ${EQDISC_OPTS}
+
+
+#sm: for testing we need a band to collect PPPOEd packets
+$TC class add dev $IFACE parent 1:1 classid 1:14 htb $LQ rate ${BE_RATE}kbit ceil ${BE_CEIL}kbit prio 2 `get_htb_adsll_string`
+$TC qdisc add dev $IFACE parent 1:14 handle 140: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${BK_RATE}` ${EQDISC_OPTS}
+
+
+# Need a catchall rule (should also match VLANs and PPPoE packets)
+
+$TC filter add dev $IFACE parent 1:0 protocol all prio 999 u32 \
+        match ip protocol 0 0x00 flowid 1:12  
+
+# FIXME should probably change the filter here to do pre-nat
+        
+$TC filter add dev $IFACE parent 1:0 protocol ip prio 1 handle 1 fw classid 1:11
+$TC filter add dev $IFACE parent 1:0 protocol ip prio 2 handle 2 fw classid 1:12
+$TC filter add dev $IFACE parent 1:0 protocol ip prio 3 handle 3 fw classid 1:13
+
+# ipv6 support. Note that the handle indicates the fw mark bucket that is looked for
+
+$TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 4 handle 1 fw classid 1:11
+$TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 5 handle 2 fw classid 1:12
+$TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 6 handle 3 fw classid 1:13
+
+# Arp traffic
+
+$TC filter add dev $IFACE parent 1:0 protocol arp prio 7 handle 1 fw classid 1:11
+
+# ICMP traffic - Don't impress your friends. Deoptimize to manage ping floods
+# better instead
+
+$TC filter add dev $IFACE parent 1:0 protocol ip prio 8 \
+        u32 match ip protocol 1 0xff flowid 1:13
+
+$TC filter add dev $IFACE parent 1:0 protocol ipv6 prio 9 \
+        u32 match ip protocol 1 0xff flowid 1:13
+
+
+
+
+# PPPoE encapsulated packets traversing the router (e.g.: the router does PPPoE termination but we shape 
+# on the underlaying ethernet interface instead of the pppoe device)
+
+PPPOE_SESSION_ETHERTYPE="0x8864"
+PPPOE_DISCOVERY_ETHERTYPE="0x8863"
+PPP_PROTO_IP4="0x0021"
+PPP_PROTO_IP6="0x0057"
+ARP_PROTO_IP4="0x0806"
+
+# NOTE it seems prio can not be reused?
+#$TC filter add dev $IFACE protocol 0x8863 parent 1:0 prio 1 u32 flowid 1:14
+# PPPoE can be selected for by ether_type, the encapsulated IP version from the PPP (0x0021 IPv4, 0x0057 IPv6)
+#U32_PREFIX="$TC filter add dev $IFACE" parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE}"
+
+#BE: 1:12 is the default anyway, but this will catch all non marked packets
+#$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 400 u32 \
+#      match u16 ${PPP_PROTO_IP4} 0xffff at 6 \
+#      match u8 0x00 0xfb at 9 \
+#      flowid 1:12
+
+#AF42
+$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 401 u32 \
+       match u16 ${PPP_PROTO_IP4} 0xffff at 6 \
+       match u8 0x90 0xfc at 9 \
+       flowid 1:11
+#EF
+$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 402 u32 \
+       match u16 ${PPP_PROTO_IP4} 0xffff at 6 \
+       match u8 0xb8 0xfc at 9 \
+       flowid 1:11
+#CS1
+$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 403 u32 \
+       match u16 ${PPP_PROTO_IP4} 0xffff at 6 \
+       match u8 0x20 0xf0 at 9 \
+       flowid 1:13
+#IMM
+$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 404 u32 \
+       match u16 ${PPP_PROTO_IP4} 0xffff at 6 \
+       match u8 0x10 0xf0 at 9 \
+       flowid 1:11
+#CS3
+$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 405 u32 \
+       match u16 ${PPP_PROTO_IP4} 0xffff at 6 \
+       match u8 0xc0 0xf0 at 9 \
+       flowid 1:11
+#CS6
+$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 406 u32 \
+       match u16 ${PPP_PROTO_IP4} 0xffff at 6 \
+       match u8 0xe0 0xf0 at 9 \
+       flowid 1:11
+
+
+## Arp traffic
+#$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 409 u32 \
+#      match u16 ${ARP_PROTO_IP4} 0xffff at 6 \
+#      flowid 1:14
+
+# ICMP traffic - Don't impress your friends. Deoptimize to manage ping floods
+# better instead; sm: really only deprio echo requestst and echo replies instead?
+# ECHO request, the rest stays in best effort
+$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 410 u32 \
+       match u16 ${PPP_PROTO_IP4} 0xffff at 6 \
+       match u8 0x01 0xff at 17 \
+       match u8 0x08 0xff at 28 \
+       flowid 1:13
+# ECHO reply
+$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 410 u32 \
+       match u16 ${PPP_PROTO_IP4} 0xffff at 6 \
+       match u8 0x01 0xff at 17 \
+       match u8 0x00 0xff at 28 \
+       flowid 1:13
+
+## ICMPv6 133-137 (NDP) is equivalent to IPv4 ARP, so only push echo request and reply into the bulk class
+## 133
+#$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 610 u32 \
+#      match u16 ${PPP_PROTO_IP6} 0xffff at 6 \
+#      match u8 0x85 0xff at 48 \
+#      match u8 0x3a 0xff at 14 \
+#      flowid 1:14
+## 134
+#$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 610 u32 \
+#      match u16 ${PPP_PROTO_IP6} 0xffff at 6 \
+#      match u8 0x86 0xff at 48 \
+#      match u8 0x3a 0xff at 14 \
+#      flowid 1:14
+## 135
+#$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 610 u32 \
+#      match u16 ${PPP_PROTO_IP6} 0xffff at 6 \
+#      match u8 0x87 0xff at 48 \
+#      match u8 0x3a 0xff at 14 \
+#      flowid 1:14
+## 136
+#$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 610 u32 \
+#      match u16 ${PPP_PROTO_IP6} 0xffff at 6 \
+#      match u8 0x88 0xff at 48 \
+#      match u8 0x3a 0xff at 14 \
+#      flowid 1:14
+## 137
+#$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 610 u32 \
+#      match u16 ${PPP_PROTO_IP6} 0xffff at 6 \
+#      match u8 0x89 0xff at 48 \
+#      match u8 0x3a 0xff at 14 \
+#      flowid 1:14
+
+# ICMPv6 echo request
+$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 610 u32 \
+       match u16 ${PPP_PROTO_IP6} 0xffff at 6 \
+       match u8 0x3a 0xff at 14 \
+       match u8 0x80 0xff at 48 \
+       flowid 1:13
+# ICMPv6 echo reply
+$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 610 u32 \
+       match u16 ${PPP_PROTO_IP6} 0xffff at 6 \
+       match u8 0x3a 0xff at 14 \
+       match u8 0x81 0xff at 48 \
+       flowid 1:13
+
+
+
+
+#IPV6
+#BE: careful, will override ICMP
+#$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 600 u32 \
+#      match u16 ${PPP_PROTO_IP6} 0xffff at 6 \
+#      match u16 0x0000 0x0fb0 at 8 \
+#      flowid 1:12
+#AF42
+$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 601 u32 \
+       match u16 ${PPP_PROTO_IP6} 0xffff at 6 \
+       match u16 0x0900 0x0fc0 at 8 \
+       flowid 1:11
+#EF
+$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 602 u32 \
+       match u16 ${PPP_PROTO_IP6} 0xffff at 6 \
+       match u16 0x0b80 0x0fc0 at 8 \
+       flowid 1:11
+#CS1
+$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 603 u32 \
+       match u16 ${PPP_PROTO_IP6} 0xffff at 6 \
+       match u16 0x0200 0x0fc0 at 8 \
+       flowid 1:13
+#IMM
+$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 604 u32 \
+       match u16 ${PPP_PROTO_IP6} 0xffff at 6 \
+       match u16 0x0100 0x0fc0 at 8 \
+       flowid 1:11
+#CS3
+$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 605 u32 \
+       match u16 ${PPP_PROTO_IP6} 0xffff at 6 \
+       match u16 0x0c00 0x0fc0 at 8 \
+       flowid 1:11
+#CS6
+$TC filter add dev $IFACE parent 1:0 protocol ${PPPOE_SESSION_ETHERTYPE} prio 606 u32 \
+       match u16 ${PPP_PROTO_IP6} 0xffff at 6 \
+       match u16 0x0e00 0x0fc0 at 8 \
+       flowid 1:11
+
+
+
+
+#diffserv $IFACE
+
+}
+
+ingress() {
+
+CEIL=$DOWNLINK
+PRIO_RATE=`expr $CEIL / 3` # Ceiling for prioirty
+BE_RATE=`expr $CEIL / 6`   # Min for best effort
+BK_RATE=`expr $CEIL / 6`   # Min for background
+BE_CEIL=`expr $CEIL - 16`  # A little slop at the top
+
+LQ="quantum `get_mtu $IFACE $CEIL`"
+HTB_BURSTS="burst ${MYBURST} cburst ${MYBURST}"
+
+$TC qdisc del dev $IFACE handle ffff: ingress 2> /dev/null
+$TC qdisc add dev $IFACE handle ffff: ingress
+
+$TC qdisc del dev $DEV root  2> /dev/null
+
+if [ "$SQUASH_INGRESS" = "1" ]
+then
+sqm_logger "Do not perform DSCP based filtering on ingress. (1-tier classification)"
+# Revert to no dscp based filtering
+$TC qdisc del dev $DEV root 2>/dev/null
+$TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 10
+$TC class add dev $DEV parent 1: classid 1:1 htb $LQ ${HTB_BURSTS} rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit `get_htb_adsll_string`
+$TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ ${HTB_BURSTS} rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit prio 0 `get_htb_adsll_string`
+$TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_flows ${DOWNLINK}` ${IQDISC_OPTS}
+
+else
+sqm_logger "Perform DSCP based filtering on ingress. (3-tier classification)"
+$TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 12
+$TC class add dev $DEV parent 1: classid 1:1 htb $LQ ${HTB_BURSTS} rate ${CEIL}kbit ceil ${CEIL}kbit `get_htb_adsll_string`
+$TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ ${HTB_BURSTS} rate ${CEIL}kbit ceil ${CEIL}kbit prio 0 `get_htb_adsll_string`
+$TC class add dev $DEV parent 1:1 classid 1:11 htb $LQ ${HTB_BURSTS} rate 32kbit ceil ${PRIO_RATE}kbit prio 1 `get_htb_adsll_string`
+$TC class add dev $DEV parent 1:1 classid 1:12 htb $LQ ${HTB_BURSTS} rate ${BE_RATE}kbit ceil ${BE_CEIL}kbit prio 2 `get_htb_adsll_string`
+$TC class add dev $DEV parent 1:1 classid 1:13 htb $LQ ${HTB_BURSTS} rate ${BK_RATE}kbit ceil ${BE_CEIL}kbit prio 3 `get_htb_adsll_string`
+
+# I'd prefer to use a pre-nat filter but that causes permutation...
+
+$TC qdisc add dev $DEV parent 1:11 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 500` `get_flows ${PRIO_RATE}` ${IQDISC_OPTS}
+$TC qdisc add dev $DEV parent 1:12 handle 120: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 1500` `get_flows ${BE_RATE}` ${IQDISC_OPTS}
+$TC qdisc add dev $DEV parent 1:13 handle 130: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 300` `get_flows ${BK_RATE}` ${IQDISC_OPTS}
+
+#sm: for PPPoE packet testing
+$TC class add dev $DEV parent 1:1 classid 1:14 htb $LQ rate ${BK_RATE}kbit ceil ${BE_CEIL}kbit prio 3 `get_htb_adsll_string`
+$TC qdisc add dev $DEV parent 1:14 handle 140: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_quantum 300` `get_flows ${BK_RATE}` ${IQDISC_OPTS}
+
+
+
+#diffserv $DEV
+diffserv_pppoe $DEV
+
+fi
+
+ifconfig $DEV up
+
+# redirect all IP packets arriving in $IFACE to ifb0 
+
+$TC filter add dev $IFACE parent ffff: protocol all prio 10 u32 \
+  match u32 0 0 flowid 1:1 action mirred egress redirect dev $DEV
+
+}
+
+do_modules
+ipt_setup
+
+if [ "$UPLINK" -ne 0 ];
+then
+       egress
+       sqm_logger "egress shaping activated"
+else
+       sqm_logger "egress shaping deactivated"
+       tc qdisc del dev $IFACE root 2> /dev/null
+fi
+if [ "$DOWNLINK" -ne 0 ];
+then
+       ingress
+       sqm_logger "ingress shaping activated"
+else
+       sqm_logger "ingress shaping deactivated"
+       tc qdisc del dev $DEV root 2> /dev/null
+       tc qdisc del dev $IFACE ingress 2> /dev/null
+fi
+
+
+
+# References:
+# This alternate shaper attempts to go for 1/u performance in a clever way
+# http://git.coverfire.com/?p=linux-qos-scripts.git;a=blob;f=src-3tos.sh;hb=HEAD
+
+# Comments
+# This does the right thing with ipv6 traffic.
+# It also tries to leverage diffserv to some sane extent. In particular,
+# the 'priority' queue is limited to 33% of the total, so EF, and IMM traffic
+# cannot starve other types. The rfc suggested 30%. 30% is probably
+# a lot in today's world.
+
+# Flaws
+# Many!
diff --git a/net/sqm-scripts/files/usr/lib/sqm/simple_pppoe.qos.help b/net/sqm-scripts/files/usr/lib/sqm/simple_pppoe.qos.help
new file mode 100644 (file)
index 0000000..cc9af9d
--- /dev/null
@@ -0,0 +1,2 @@
+BW-limited three-tier prioritisation scheme with fq_codel on each queue. Temporary version to implement shaping
+of pass through PPPOE encapsulated packets.
diff --git a/net/sqm-scripts/files/usr/lib/sqm/simplest.qos b/net/sqm-scripts/files/usr/lib/sqm/simplest.qos
new file mode 100755 (executable)
index 0000000..f06c252
--- /dev/null
@@ -0,0 +1,84 @@
+#!/bin/sh
+# Cero3 Simple Shaper
+# A 1 bin tc_codel and ipv6 enabled shaping script for
+# ethernet gateways. This is nearly the simplest possible
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+#       Copyright (C) 2012-4 Michael D. Taht, Toke Høiland-Jørgensen, Sebastian Moeller
+
+. /usr/lib/sqm/functions.sh
+sqm_logger "Starting simplest.qos"
+
+egress() {
+
+LQ="quantum `get_mtu $IFACE ${UPLINK}`"
+
+$TC qdisc del dev $IFACE root 2>/dev/null
+$TC qdisc add dev $IFACE root handle 1: `get_stab_string` htb default 10
+$TC class add dev $IFACE parent 1: classid 1:1 htb $LQ rate ${UPLINK}kbit ceil ${UPLINK}kbit `get_htb_adsll_string`
+$TC class add dev $IFACE parent 1:1 classid 1:10 htb $LQ rate ${UPLINK}kbit ceil ${UPLINK}kbit prio 0 `get_htb_adsll_string`
+$TC qdisc add dev $IFACE parent 1:10 handle 110: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_flows ${UPLINK}` ${EQDISC_OPTS}
+
+}
+
+
+ingress() {
+sqm_logger "ingress"
+$TC qdisc del dev $IFACE handle ffff: ingress 2>/dev/null
+$TC qdisc add dev $IFACE handle ffff: ingress
+
+LQ="quantum `get_mtu $IFACE ${DOWNLINK}`"
+$TC qdisc del dev $DEV root 2>/dev/null
+$TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 10
+$TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit `get_htb_adsll_string`
+$TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit prio 0 `get_htb_adsll_string`
+
+# FIXME: I'd prefer to use a pre-nat filter but we need to detect if nat is on this interface
+# AND we need to permute by a random number which we can't do from userspace filters
+
+# Most high rate flows are REALLY close. This stomps on those harder, but hurts on high rate long distance
+#$TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC limit $LIMIT $ECN interval 20ms target 3ms `get_flows ${DOWNLINK}`
+$TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_flows ${DOWNLINK}` ${IQDISC_OPTS}
+
+ifconfig $DEV up
+
+# redirect all IP packets arriving in $IFACE to ifb0 
+
+$TC filter add dev $IFACE parent ffff: protocol all prio 10 u32 \
+  match u32 0 0 flowid 1:1 action mirred egress redirect dev $DEV
+
+}
+
+do_modules
+
+if [ "$UPLINK" -ne 0 ];
+then
+       egress
+       sqm_logger "egress shaping activated"
+else
+       sqm_logger "egress shaping deactivated"
+       tc qdisc del dev $IFACE root 2> /dev/null
+fi
+if [ "$DOWNLINK" -ne 0 ];
+then
+       ingress
+       sqm_logger "ingress shaping activated"
+else
+       sqm_logger "ingress shaping deactivated"
+       tc qdisc del dev $DEV root 2> /dev/null
+       tc qdisc del dev $IFACE ingress 2> /dev/null
+fi
+
+
+# References:
+# This alternate shaper attempts to go for 1/u performance in a clever way
+# http://git.coverfire.com/?p=linux-qos-scripts.git;a=blob;f=src-3tos.sh;hb=HEAD
+
+# Comments
+# This does the right thing with ipv6 traffic.
+# Flaws
+# Many!
diff --git a/net/sqm-scripts/files/usr/lib/sqm/simplest.qos.help b/net/sqm-scripts/files/usr/lib/sqm/simplest.qos.help
new file mode 100644 (file)
index 0000000..c359256
--- /dev/null
@@ -0,0 +1 @@
+Simplest possible configuration: HTB rate limiter with your qdisc attached.
diff --git a/net/sqm-scripts/files/usr/lib/sqm/stop.sh b/net/sqm-scripts/files/usr/lib/sqm/stop.sh
new file mode 100755 (executable)
index 0000000..29e213b
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+#       Copyright (C) 2012-4 Michael D. Taht, Toke Høiland-Jørgensen, Sebastian Moeller
+
+# allow passing in the IFACE as first command line argument
+[ ! -z ${1} ] && IFACE=${1}
+# now IFACE is defined so we can source functions.sh without creating a spurious ifb4ge00
+. /usr/lib/sqm/functions.sh
+# sqm_logger is defined in functions.sh...
+sqm_logger "${0}: Stopping ${IFACE}"
+
+# make sure to only delete the ifb associated with the current interface
+CUR_IFB=$( get_ifb_associated_with_if ${IFACE} )
+
+sqm_stop() {
+       tc qdisc del dev $IFACE ingress 2> /dev/null
+       tc qdisc del dev $IFACE root 2> /dev/null
+       [ ! -z "$CUR_IFB" ] && tc qdisc del dev $CUR_IFB root 2> /dev/null
+        [ ! -z "$CUR_IFB" ] && sqm_logger "${0}: ${CUR_IFB} shaper deleted"
+}
+
+ipt_stop() {
+       [ ! -z "$CUR_IFB" ] && ipt -t mangle -D POSTROUTING -o $CUR_IFB -m mark --mark 0x00 -g QOS_MARK_${IFACE} 
+       ipt -t mangle -D POSTROUTING -o $IFACE -m mark --mark 0x00 -g QOS_MARK_${IFACE} 
+       ipt -t mangle -D PREROUTING -i vtun+ -p tcp -j MARK --set-mark 0x2
+       ipt -t mangle -D OUTPUT -p udp -m multiport --ports 123,53 -j DSCP --set-dscp-class AF42
+       ipt -t mangle -F QOS_MARK_${IFACE}
+       ipt -t mangle -X QOS_MARK_${IFACE}
+}
+
+
+sqm_stop
+ipt_stop
+[ ! -z "$CUR_IFB" ] && ifconfig ${CUR_IFB} down
+[ ! -z "$CUR_IFB" ] && ip link delete ${CUR_IFB} type ifb
+[ ! -z "$CUR_IFB" ] && sqm_logger "${0}: ${CUR_IFB} interface deleted"
+
+exit 0
\ No newline at end of file
index 8039951221c3bf04c43cc45fb0b3131d8e55b2f5..d0e67e458418dbf101afc0e3da28e98ddb24d985 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=strongswan
-PKG_VERSION:=5.2.0
-PKG_RELEASE:=1
+PKG_VERSION:=5.2.1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://download.strongswan.org/ http://download2.strongswan.org/
-PKG_MD5SUM:=5cee4ee1a6ccb74400758b3ace54d46e
+PKG_MD5SUM:=dd3717c0aa59ab4591ca1812941ebb82
 PKG_LICENSE:=GPL-2.0+
 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
 
@@ -298,22 +298,16 @@ define BuildPlugin
     DEPENDS:= +strongswan $(3)
   endef
 
-  strongswan_mod_conf=$(wildcard $(PKG_INSTALL_DIR)/etc/strongswan.d/charon/$(1).conf)
   define Package/strongswan-mod-$(1)/install
        $(INSTALL_DIR) $$(1)/etc/strongswan.d/charon
-       $(if $(call strongswan_mod_conf,$(1)), \
-               $(INSTALL_DATA) \
-                       $(call strongswan_mod_conf,$(1)) \
-                       $$(1)/etc/strongswan.d/charon/ \
-       )
+       if [ -f $(PKG_INSTALL_DIR)/etc/strongswan.d/charon/$(1).conf ]; then \
+               $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/strongswan.d/charon/$(1).conf $$(1)/etc/strongswan.d/charon/; fi
        $(INSTALL_DIR) $$(1)/usr/lib/ipsec/plugins
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-$(1).so \
                $$(1)/usr/lib/ipsec/plugins/
        $(call Plugin/$(1)/install,$$(1))
   endef
 
-  Package/strongswan-mod-$(1)/conffiles=$(patsubst $(PKG_INSTALL_DIR)%,%,$(call strongswan_mod_conf,$(1)))
-
   $$(eval $$(call BuildPackage,strongswan-mod-$(1)))
 endef
 
index ae0407203bf192a61fde966e09135803c95a4aec..1f120a908fc168f04eae02596d27bad1f7d2ca78 100644 (file)
@@ -21,7 +21,7 @@ PKG_SOURCE_URL:=http://www.spreadspace.org/tcpproxy/releases/
 PKG_MD5SUM:=55126473bcde635f9ee019c6caf19bb7
 PKG_MAINTAINER:=Christian Pointner <equinox@spreadspace.org>
 PKG_LICENSE:=GPL-3.0+
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
 include $(INCLUDE_DIR)/package.mk
 
 
index 8efa9e72aa5e4aa6e1ca42ef8a6e54dde8da31db..d1fb251ee70200840059b9526760d3c86ce2f614 100644 (file)
@@ -10,6 +10,7 @@ PKG_NAME:=tgt
 PKG_VERSION:=1.0.48
 PKG_REV:=22d9567f39e5eb8a794ce2cb5a2190abdbecaa1f
 PKG_RELEASE:=1
+PKG_USE_MIPS16:=0
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/fujita/tgt.git
index 98fda865bfeb01e2e99071eaa50734d6279804a3..3b88ac4584280b0a18dcc75bfc0e056abb10e5f0 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=https://www.torproject.org/dist \
        https://archive.torproject.org/tor-package-archive
 PKG_MD5SUM:=9acb86b529f0f48cc495da3801f85d1f
 PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
 
 PKG_BUILD_DEPENDS:=libminiupnpc libnatpmp
 PKG_INSTALL:=1
index 5e98197d14d9d12a83d08ecf7a804019934ee908..5091920e430b8edc6661584c0b6cb53a566fd0b7 100644 (file)
@@ -21,7 +21,7 @@ PKG_MD5SUM:=ce47ad45003ff1d84eaf5276941b9ddf
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_MAINTAINER:=Christian Pointner <equinox@spreadspace.org>
 PKG_LICENSE:=GPL-3.0+
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
 include $(INCLUDE_DIR)/package.mk
 
 
index b8df5b817ab07bae4e684c0ddc25fb124e743340..8fc927645c92f999c8d12b6a81f037a375ea9728 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=udpxy
-PKG_VERSION:=2014-08-24
+PKG_VERSION:=2014-10-27
 PKG_RELEASE:=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
index 8ef2a1e0507b9043435f7b22e360108bd3981652..9117a53e37ff8745138d5e219346de003cbc3010 100644 (file)
@@ -1,4 +1,6 @@
 config udpxy
+       option disabled '1'
+       option respawn '1'
        option verbose '0'
        option status '1'
        # option bind '0.0.0.0'
index a08f4a1348ca06981a3d7d13c7e55b3ac560f617..6f911a6fb713403bcc4cd87b68da0f3a09f33e19 100644 (file)
@@ -4,57 +4,64 @@
 START=50
 USE_PROCD=1
 
-udpxy_parse() {
+append_arg() {
        local cfg="$1"
+       local var="$2"
+       local opt="$3"
+       local def="$4"
+       local val
 
-       local cfg_verbose
-       local cfg_status
-       local cfg_mcsub_renew
-       local cfg_bind
-       local cfg_port
-       local cfg_source
-       local cfg_max_clients
-       local cfg_log_file
-       local cfg_buffer_size
-       local cfg_buffer_messages
-       local cfg_buffer_time
-       local cfg_nice_increment
-       local cfg_mcsub_renew
-
-       config_get_bool cfg_verbose $cfg 'verbose' 0
-       config_get_bool cfg_status $cfg 'status' 1
-       config_get cfg_bind $cfg 'bind'
-       config_get cfg_port $cfg 'port' '4022'
-       config_get cfg_source $cfg 'source'
-       config_get cfg_max_clients $cfg 'max_clients'
-       config_get cfg_log_file $cfg 'log_file'
-       config_get cfg_buffer_size $cfg 'buffer_size'
-       config_get cfg_buffer_messages $cfg 'buffer_messages'
-       config_get cfg_buffer_time $cfg 'buffer_time'
-       config_get cfg_nice_increment $cfg 'nice_increment'
-       config_get cfg_mcsub_renew $cfg 'mcsub_renew'
+       config_get val "$cfg" "$var"
+       [ -n "$val" -o -n "$def" ] && procd_append_param command $opt "${val:-$def}"
+}
+
+append_bool() {
+       local cfg="$1"
+       local var="$2"
+       local opt="$3"
+       local def="$4"
+       local val
+
+       config_get_bool val "$cfg" "$var" "$def"
+       [ "$val" = 1 ] && procd_append_param command "$opt"
+}
+
+start_instance() {
+       local cfg="$1"
+       local aux
+
+       config_get_bool aux "$cfg" 'disabled' '0'
+       [ "$aux" = 1 ] && return 1
 
        procd_open_instance
 
        procd_set_param command /usr/bin/udpxy
-       procd_append_param command -T -p $cfg_port
-       [ "$cfg_verbose" -eq 1 ] && procd_append_param command -v
-       [ "$cfg_status" -eq 1 ] && procd_append_param command -S
-       [ ! -z "$cfg_bind" ] && procd_append_param command -a $cfg_bind
-       [ ! -z "$cfg_source" ] && procd_append_param command -m $cfg_source
-       [ ! -z "$cfg_max_clients" ] && procd_append_param command -c $cfg_max_clients
-       [ ! -z "$cfg_log_file" ] && procd_append_param command -l $cfg_log_file
-       [ ! -z "$cfg_buffer_size" ] && procd_append_param command -B $cfg_buffer_size
-       [ ! -z "$cfg_buffer_messages" ] && procd_append_param command -R $cfg_buffer_messages
-       [ ! -z "$cfg_buffer_time" ] && procd_append_param command -H $cfg_buffer_time
-       [ ! -z "$cfg_nice_increment" ] && procd_append_param command -n $cfg_nice_increment
-       [ ! -z "$cfg_mcsub_renew" ] && procd_append_param command -M $cfg_mcsub_renew
-
-       procd_set_param respawn
+       procd_append_param command "-T"
+
+       append_bool "$cfg" verbose "-V"
+       append_bool "$cfg" status "-S"
+       append_arg "$cfg" bind "-a"
+       append_arg "$cfg" port "-p"
+       append_arg "$cfg" source "-m"
+       append_arg "$cfg" max_clients "-c"
+       append_arg "$cfg" log_file "-l"
+       append_arg "$cfg" buffer_size "-B"
+       append_arg "$cfg" buffer_messages "-R"
+       append_arg "$cfg" buffer_time "-H"
+       append_arg "$cfg" nice_increment "-n"
+       append_arg "$cfg" mcsub_renew "-M"
+
+       config_get_bool aux "$cfg" 'respawn' '0'
+       [ "$aux" = 1 ] && procd_set_param respawn
+
        procd_close_instance
 }
 
+service_triggers() { 
+       procd_add_reload_trigger "udpxy" 
+}
+
 start_service() {
        config_load udpxy
-       config_foreach udpxy_parse udpxy
+       config_foreach start_instance udpxy
 }
index 375712b7ea0bd7cd7749e2a58d5e4a874fe2092d..0cca3e4d9d725e600b6916a05e27ce459cfbe17f 100644 (file)
@@ -19,7 +19,7 @@ PKG_SOURCE_URL:=ftp://ftp.netfilter.org/pub/ulogd/ \
 PKG_MD5SUM:=7c71ec460dfea5287eba27472c521ebc
 
 PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
 
 PKG_FIXUP:=autoreconf
index 55867ee55a35e7d1811e5a3b4b1596a9bded0529..5567dca6ddaf469fe4dbe58c8a24e4878f84e3f2 100644 (file)
@@ -12,7 +12,7 @@ PKG_VERSION:=1.4.22
 PKG_RELEASE:=1
 
 PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
 PKG_MAINTAINER:=Michael Hanselmann <public@hansmi.ch>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
index c03dffcb36de728ed32b4ba86cba41cbbc5d3fda..9a84498f512058ea52b1c5433cb05506b3988e7b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2007-2011 OpenWrt.org
+# Copyright (C) 2007-2014 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wget
-PKG_VERSION:=1.15
+PKG_VERSION:=1.16.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_MD5SUM:=7a279d5ac5594919124d5526e7143e28
+PKG_MD5SUM:=78942cc0cce0a23e18114d982789e360
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
 PKG_LICENSE:=GPL-3.0+
 
@@ -65,7 +65,8 @@ endef
 
 CONFIGURE_ARGS+= \
        --disable-rpath \
-       --disable-iri
+       --disable-iri \
+       --without-libuuid
 
 CONFIGURE_VARS += \
        ac_cv_header_uuid_uuid_h=no
index 1d73922f4ef820435f866db741c8eb7afdfb576b..9681c47333ee7237a270f3ddcd9d3f6104ab5f28 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=znc
 PKG_VERSION:=1.4
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://znc.in/releases \
@@ -33,7 +33,7 @@ endef
 
 define Package/znc
   $(Package/znc/default)
-  DEPENDS:=+libopenssl +libpthread $(CXX_DEPENDS)
+  DEPENDS:=+libopenssl +libpthread +libstdcpp
   MENU:=1
 endef
 
@@ -261,14 +261,13 @@ $(eval $(call webskin,ice))
 
 PKG_CONFIG_DEPENDS := $(patsubst %,CONFIG_PACKAGE_%,$(ZNC_MODULES))
 
-include $(INCLUDE_DIR)/uclibc++.mk
 include $(INCLUDE_DIR)/package.mk
 
 CONFIGURE_VARS += \
-       CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti -nostdinc++" \
+       CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti" \
        CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
        LDFLAGS="-nodefaultlibs -lc -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
-       LIBS="-luClibc++ -lm -lssl -lcrypto $(LIBGCC_S) -lc"
+       LIBS="-lstdc++ -lm -lssl -lcrypto $(LIBGCC_S) -lc"
 
 CONFIGURE_ARGS += \
        --disable-c-ares \
diff --git a/net/znc/patches/002-Uclibcpp_build_fix.patch b/net/znc/patches/002-Uclibcpp_build_fix.patch
deleted file mode 100644 (file)
index df27c80..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-From fa14938321eda39f16bee6068296e6abc9df7b85 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski+openwrt@gmail.com>
-Date: Wed, 6 Apr 2011 04:11:48 +0200
-Subject: [PATCH] Add a uClibc++ build workaround
-
----
- modules/webadmin.cpp |    4 +++-
- 1 files changed, 3 insertions(+), 1 deletions(-)
-
---- a/modules/webadmin.cpp
-+++ b/modules/webadmin.cpp
-@@ -20,6 +20,7 @@
- #include <znc/IRCNetwork.h>
- #include <znc/IRCSock.h>
-+using std::string;
- using std::stringstream;
- using std::make_pair;
- using std::set;
-@@ -75,7 +76,7 @@ class CWebAdminMod : public CModule {
- public:
-       MODCONSTRUCTOR(CWebAdminMod) {
-               VPair vParams;
--              vParams.push_back(make_pair("user", ""));
-+              vParams.push_back(make_pair((string)"user", (string)""));
-               AddSubPage(new CWebSubPage("settings", "Global Settings", CWebSubPage::F_ADMIN));
-               AddSubPage(new CWebSubPage("edituser", "Your Settings", vParams));
-               AddSubPage(new CWebSubPage("traffic", "Traffic Info", CWebSubPage::F_ADMIN));
diff --git a/net/znc/patches/900-remove_cpp11_usage.patch b/net/znc/patches/900-remove_cpp11_usage.patch
deleted file mode 100644 (file)
index e87730b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/modules/certauth.cpp b/modules/certauth.cpp
-index 61e5687..4857d59 100644
---- a/modules/certauth.cpp
-+++ b/modules/certauth.cpp
-@@ -204,7 +204,7 @@ public:
-                       return;
-               }
--              SCString::const_iterator it2 = it->second.begin();
-+              SCString::iterator it2 = it->second.begin();
-               while (id > 1) {
-                       ++it2;
-                       id--;
diff --git a/sound/espeak/Makefile b/sound/espeak/Makefile
new file mode 100644 (file)
index 0000000..fd06c6e
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=espeak
+PKG_VERSION:=1.48.04
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-source.zip
+PKG_SOURCE_URL:=@SF/espeak
+PKG_MD5SUM:=cadd7482eaafe9239546bdc09fa244c3
+
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=License.txt
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-source
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/espeak
+  SECTION:=sound
+  CATEGORY:=Sound
+  DEPENDS:=+libpthread +libstdcpp +portaudio
+  TITLE:=Speech synthesizer
+  URL:=http://espeak.sourceforge.net/
+endef
+
+define Package/espeak/description
+ eSpeak is a compact open source software speech synthesizer for English and
+ other languages.
+endef
+
+MAKE_FLAGS+= \
+       AUDIO="portaudio" \
+       DATADIR="/usr/share/espeak" \
+       CXXFLAGS="$(TARGET_CFLAGS)" \
+       LDFLAGS="$(TARGET_LDFLAGS)" \
+
+MAKE_PATH:=./src
+
+define Package/espeak/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/espeak $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libespeak.so.* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/share
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/espeak $(1)/usr/share/
+endef
+
+$(eval $(call BuildPackage,espeak))
diff --git a/sound/espeak/patches/101-portaudio.patch b/sound/espeak/patches/101-portaudio.patch
new file mode 100644 (file)
index 0000000..ff396b3
--- /dev/null
@@ -0,0 +1,2093 @@
+--- a/src/portaudio.h
++++ /dev/null
+@@ -1,466 +0,0 @@
+-// NOTE: Copy this file to  portaudio.h  in order to compile with V18 portaudio
+-
+-
+-#ifndef PORT_AUDIO_H
+-#define PORT_AUDIO_H
+-
+-#ifdef __cplusplus
+-extern "C"
+-{
+-#endif /* __cplusplus */
+-
+-/*
+- * $Id: portaudio.h,v 1.5 2002/03/26 18:04:22 philburk Exp $
+- * PortAudio Portable Real-Time Audio Library
+- * PortAudio API Header File
+- * Latest version available at: http://www.audiomulch.com/portaudio/
+- *
+- * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
+- *
+- * Permission is hereby granted, free of charge, to any person obtaining
+- * a copy of this software and associated documentation files
+- * (the "Software"), to deal in the Software without restriction,
+- * including without limitation the rights to use, copy, modify, merge,
+- * publish, distribute, sublicense, and/or sell copies of the Software,
+- * and to permit persons to whom the Software is furnished to do so,
+- * subject to the following conditions:
+- *
+- * The above copyright notice and this permission notice shall be
+- * included in all copies or substantial portions of the Software.
+- *
+- * Any person wishing to distribute modifications to the Software is
+- * requested to send the modifications to the original developer so that
+- * they can be incorporated into the canonical version.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+- *
+- */
+-
+-typedef int PaError;
+-typedef enum {
+-    paNoError = 0,
+-
+-    paHostError = -10000,
+-    paInvalidChannelCount,
+-    paInvalidSampleRate,
+-    paInvalidDeviceId,
+-    paInvalidFlag,
+-    paSampleFormatNotSupported,
+-    paBadIODeviceCombination,
+-    paInsufficientMemory,
+-    paBufferTooBig,
+-    paBufferTooSmall,
+-    paNullCallback,
+-    paBadStreamPtr,
+-    paTimedOut,
+-    paInternalError,
+-    paDeviceUnavailable
+-} PaErrorNum;
+-
+-/*
+- Pa_Initialize() is the library initialisation function - call this before
+- using the library.
+-
+-*/
+-
+-PaError Pa_Initialize( void );
+-
+-/*
+- Pa_Terminate() is the library termination function - call this after
+- using the library.
+-
+-*/
+-
+-PaError Pa_Terminate( void );
+-
+-/*
+- Pa_GetHostError() returns a host specific error code.
+- This can be called after receiving a PortAudio error code of paHostError.
+-
+-*/
+-
+-long Pa_GetHostError( void );
+-
+-/*
+- Pa_GetErrorText() translates the supplied PortAudio error number
+- into a human readable message.
+- 
+-*/
+-
+-const char *Pa_GetErrorText( PaError errnum );
+-
+-/*
+- Sample formats
+- 
+- These are formats used to pass sound data between the callback and the
+- stream. Each device has a "native" format which may be used when optimum
+- efficiency or control over conversion is required.
+- 
+- Formats marked "always available" are supported (emulated) by all 
+- PortAudio implementations.
+- 
+- The floating point representation (paFloat32) uses +1.0 and -1.0 as the 
+- maximum and minimum respectively.
+-
+- paUInt8 is an unsigned 8 bit format where 128 is considered "ground"
+-
+-*/
+-
+-typedef unsigned long PaSampleFormat;
+-#define paFloat32      ((PaSampleFormat) (1<<0)) /*always available*/
+-#define paInt16        ((PaSampleFormat) (1<<1)) /*always available*/
+-#define paInt32        ((PaSampleFormat) (1<<2)) /*always available*/
+-#define paInt24        ((PaSampleFormat) (1<<3))
+-#define paPackedInt24  ((PaSampleFormat) (1<<4))
+-#define paInt8         ((PaSampleFormat) (1<<5))
+-#define paUInt8        ((PaSampleFormat) (1<<6))
+-#define paCustomFormat ((PaSampleFormat) (1<<16))
+-
+-/*
+- Device enumeration mechanism.
+- 
+- Device ids range from 0 to Pa_CountDevices()-1.
+- 
+- Devices may support input, output or both.
+-
+-*/
+-
+-typedef int PaDeviceID;
+-#define paNoDevice -1
+-
+-int Pa_CountDevices( void );
+-
+-typedef struct
+-{
+-    int structVersion;
+-    const char *name;
+-    int maxInputChannels;
+-    int maxOutputChannels;
+-    /* Number of discrete rates, or -1 if range supported. */
+-    int numSampleRates;
+-    /* Array of supported sample rates, or {min,max} if range supported. */
+-    const double *sampleRates;
+-    PaSampleFormat nativeSampleFormats;
+-}
+-PaDeviceInfo;
+-
+-/*
+- Pa_GetDefaultInputDeviceID(), Pa_GetDefaultOutputDeviceID() return the
+- default device ids for input and output respectively, or paNoDevice if
+- no device is available.
+- The result can be passed to Pa_OpenStream().
+- 
+- On the PC, the user can specify a default device by
+- setting an environment variable. For example, to use device #1.
+- 
+-  set PA_RECOMMENDED_OUTPUT_DEVICE=1
+- 
+- The user should first determine the available device ids by using
+- the supplied application "pa_devs".
+-
+-*/
+-
+-PaDeviceID Pa_GetDefaultInputDeviceID( void );
+-PaDeviceID Pa_GetDefaultOutputDeviceID( void );
+-
+-
+-
+-/*
+- Pa_GetDeviceInfo() returns a pointer to an immutable PaDeviceInfo structure
+- for the device specified.
+- If the device parameter is out of range the function returns NULL.
+-
+- PortAudio manages the memory referenced by the returned pointer, the client
+- must not manipulate or free the memory. The pointer is only guaranteed to be
+- valid between calls to Pa_Initialize() and Pa_Terminate().
+-
+-*/
+-
+-const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceID device );
+-
+-/*
+- PaTimestamp is used to represent a continuous sample clock with arbitrary
+- start time that can be used for syncronization. The type is used for the
+- outTime argument to the PortAudioCallback and as the result of Pa_StreamTime()
+-
+-*/
+-
+-typedef double PaTimestamp;
+-
+-/*
+- PortAudioCallback is implemented by PortAudio clients.
+- 
+- inputBuffer and outputBuffer are arrays of interleaved samples,
+- the format, packing and number of channels used by the buffers are
+- determined by parameters to Pa_OpenStream() (see below).
+- 
+- framesPerBuffer is the number of sample frames to be processed by the callback.
+- 
+- outTime is the time in samples when the buffer(s) processed by
+- this callback will begin being played at the audio output.
+- See also Pa_StreamTime()
+- 
+- userData is the value of a user supplied pointer passed to Pa_OpenStream()
+- intended for storing synthesis data etc.
+- 
+- return value:
+- The callback can return a non-zero value to stop the stream. This may be
+- useful in applications such as soundfile players where a specific duration
+- of output is required. However, it is not necessary to utilise this mechanism
+- as StopStream() will also terminate the stream. A callback returning a
+- non-zero value must fill the entire outputBuffer.
+- 
+- NOTE: None of the other stream functions may be called from within the
+- callback function except for Pa_GetCPULoad().
+-
+-*/
+-
+-typedef int (PortAudioCallback)(
+-    void *inputBuffer, void *outputBuffer,
+-    unsigned long framesPerBuffer,
+-    PaTimestamp outTime, void *userData );
+-
+-
+-/*
+- Stream flags
+- 
+- These flags may be supplied (ored together) in the streamFlags argument to
+- the Pa_OpenStream() function.
+-
+-*/
+-
+-#define   paNoFlag      (0)
+-#define   paClipOff     (1<<0)   /* disable default clipping of out of range samples */
+-#define   paDitherOff   (1<<1)   /* disable default dithering */
+-#define   paPlatformSpecificFlags (0x00010000)
+-typedef   unsigned long PaStreamFlags;
+-
+-/*
+- A single PortAudioStream provides multiple channels of real-time
+- input and output audio streaming to a client application.
+- Pointers to PortAudioStream objects are passed between PortAudio functions.
+-*/
+-
+-typedef void PortAudioStream;
+-#define PaStream PortAudioStream
+-
+-/*
+- Pa_OpenStream() opens a stream for either input, output or both.
+- 
+- stream is the address of a PortAudioStream pointer which will receive
+- a pointer to the newly opened stream.
+- 
+- inputDevice is the id of the device used for input (see PaDeviceID above.)
+- inputDevice may be paNoDevice to indicate that an input device is not required.
+- 
+- numInputChannels is the number of channels of sound to be delivered to the
+- callback. It can range from 1 to the value of maxInputChannels in the
+- PaDeviceInfo record for the device specified by the inputDevice parameter.
+- If inputDevice is paNoDevice numInputChannels is ignored.
+- 
+- inputSampleFormat is the sample format of inputBuffer provided to the callback
+- function. inputSampleFormat may be any of the formats described by the
+- PaSampleFormat enumeration (see above). PortAudio guarantees support for
+- the device's native formats (nativeSampleFormats in the device info record)
+- and additionally 16 and 32 bit integer and 32 bit floating point formats.
+- Support for other formats is implementation defined.
+- 
+- inputDriverInfo is a pointer to an optional driver specific data structure
+- containing additional information for device setup or stream processing.
+- inputDriverInfo is never required for correct operation. If not used
+- inputDriverInfo should be NULL.
+- 
+- outputDevice is the id of the device used for output (see PaDeviceID above.)
+- outputDevice may be paNoDevice to indicate that an output device is not required.
+- 
+- numOutputChannels is the number of channels of sound to be supplied by the
+- callback. See the definition of numInputChannels above for more details.
+- 
+- outputSampleFormat is the sample format of the outputBuffer filled by the
+- callback function. See the definition of inputSampleFormat above for more
+- details.
+- 
+- outputDriverInfo is a pointer to an optional driver specific data structure
+- containing additional information for device setup or stream processing.
+- outputDriverInfo is never required for correct operation. If not used
+- outputDriverInfo should be NULL.
+- 
+- sampleRate is the desired sampleRate. For full-duplex streams it is the
+- sample rate for both input and output
+- 
+- framesPerBuffer is the length in sample frames of all internal sample buffers
+- used for communication with platform specific audio routines. Wherever
+- possible this corresponds to the framesPerBuffer parameter passed to the
+- callback function.
+- 
+- numberOfBuffers is the number of buffers used for multibuffered communication
+- with the platform specific audio routines. If you pass zero, then an optimum
+- value will be chosen for you internally. This parameter is provided only
+- as a guide - and does not imply that an implementation must use multibuffered
+- i/o when reliable double buffering is available (such as SndPlayDoubleBuffer()
+- on the Macintosh.)
+- 
+- streamFlags may contain a combination of flags ORed together.
+- These flags modify the behaviour of the streaming process. Some flags may only
+- be relevant to certain buffer formats.
+- 
+- callback is a pointer to a client supplied function that is responsible
+- for processing and filling input and output buffers (see above for details.)
+- 
+- userData is a client supplied pointer which is passed to the callback
+- function. It could for example, contain a pointer to instance data necessary
+- for processing the audio buffers.
+- 
+- return value:
+- Upon success Pa_OpenStream() returns PaNoError and places a pointer to a
+- valid PortAudioStream in the stream argument. The stream is inactive (stopped).
+- If a call to Pa_OpenStream() fails a non-zero error code is returned (see
+- PaError above) and the value of stream is invalid.
+- 
+-*/
+-
+-PaError Pa_OpenStream( PortAudioStream** stream,
+-                       PaDeviceID inputDevice,
+-                       int numInputChannels,
+-                       PaSampleFormat inputSampleFormat,
+-                       void *inputDriverInfo,
+-                       PaDeviceID outputDevice,
+-                       int numOutputChannels,
+-                       PaSampleFormat outputSampleFormat,
+-                       void *outputDriverInfo,
+-                       double sampleRate,
+-                       unsigned long framesPerBuffer,
+-                       unsigned long numberOfBuffers,
+-                       PaStreamFlags streamFlags,
+-                       PortAudioCallback *callback,
+-                       void *userData );
+-
+-
+-/*
+- Pa_OpenDefaultStream() is a simplified version of Pa_OpenStream() that opens
+- the default input and/or output devices. Most parameters have identical meaning
+- to their Pa_OpenStream() counterparts, with the following exceptions:
+- 
+- If either numInputChannels or numOutputChannels is 0 the respective device
+- is not opened. This has the same effect as passing paNoDevice in the device
+- arguments to Pa_OpenStream().
+- 
+- sampleFormat applies to both the input and output buffers.
+-
+-*/
+-
+-PaError Pa_OpenDefaultStream( PortAudioStream** stream,
+-                              int numInputChannels,
+-                              int numOutputChannels,
+-                              PaSampleFormat sampleFormat,
+-                              double sampleRate,
+-                              unsigned long framesPerBuffer,
+-                              unsigned long numberOfBuffers,
+-                              PortAudioCallback *callback,
+-                              void *userData );
+-
+-/*
+- Pa_CloseStream() closes an audio stream, flushing any pending buffers.
+-
+-*/
+-
+-PaError Pa_CloseStream( PortAudioStream* );
+-
+-/*
+- Pa_StartStream() and Pa_StopStream() begin and terminate audio processing.
+- Pa_StopStream() waits until all pending audio buffers have been played.
+- Pa_AbortStream() stops playing immediately without waiting for pending
+- buffers to complete.
+-    
+-*/
+-
+-PaError Pa_StartStream( PortAudioStream *stream );
+-
+-PaError Pa_StopStream( PortAudioStream *stream );
+-
+-PaError Pa_AbortStream( PortAudioStream *stream );
+-
+-/*
+- Pa_StreamActive() returns one (1) when the stream is active (ie playing
+- or recording audio), zero (0) when not playing, or a negative error number
+- if the stream is invalid.
+- The stream is active between calls to Pa_StartStream() and Pa_StopStream(),
+- but may also become inactive if the callback returns a non-zero value.
+- In the latter case, the stream is considered inactive after the last
+- buffer has finished playing.
+- 
+-*/
+-
+-PaError Pa_StreamActive( PortAudioStream *stream );
+-
+-/*
+- Pa_StreamTime() returns the current output time in samples for the stream.
+- This time may be used as a time reference (for example synchronizing audio to
+- MIDI).
+- 
+-*/
+-
+-PaTimestamp Pa_StreamTime( PortAudioStream *stream );
+-
+-/*
+- Pa_GetCPULoad() returns the CPU Load for the stream.
+- The "CPU Load" is a fraction of total CPU time consumed by the stream's
+- audio processing routines including, but not limited to the client supplied
+- callback.
+- A value of 0.5 would imply that PortAudio and the sound generating
+- callback was consuming roughly 50% of the available CPU time.
+- This function may be called from the callback function or the application.
+- 
+-*/
+-
+-double Pa_GetCPULoad( PortAudioStream* stream );
+-
+-/*
+- Pa_GetMinNumBuffers() returns the minimum number of buffers required by
+- the current host based on minimum latency.
+- On the PC, for the DirectSound implementation, latency can be optionally set
+- by user by setting an environment variable.
+- For example, to set latency to 200 msec, put:
+- 
+-    set PA_MIN_LATENCY_MSEC=200
+- 
+- in the AUTOEXEC.BAT file and reboot.
+- If the environment variable is not set, then the latency will be determined
+- based on the OS. Windows NT has higher latency than Win95.
+- 
+-*/
+-
+-int Pa_GetMinNumBuffers( int framesPerBuffer, double sampleRate );
+-
+-/*
+- Pa_Sleep() puts the caller to sleep for at least 'msec' milliseconds.
+- You may sleep longer than the requested time so don't rely on this for
+- accurate musical timing.
+- 
+- Pa_Sleep() is provided as a convenience for authors of portable code (such as
+- the tests and examples in the PortAudio distribution.)
+- 
+-*/
+-
+-void Pa_Sleep( long msec );
+-
+-/*
+- Pa_GetSampleSize() returns the size in bytes of a single sample in the
+- supplied PaSampleFormat, or paSampleFormatNotSupported if the format is
+- no supported.
+-  
+-*/
+-
+-PaError Pa_GetSampleSize( PaSampleFormat format );
+-
+-
+-#ifdef __cplusplus
+-}
+-#endif /* __cplusplus */
+-#endif /* PORT_AUDIO_H */
+--- a/src/portaudio18.h
++++ /dev/null
+@@ -1,466 +0,0 @@
+-// NOTE: Copy this file to  portaudio.h  in order to compile with V18 portaudio
+-
+-
+-#ifndef PORT_AUDIO_H
+-#define PORT_AUDIO_H
+-
+-#ifdef __cplusplus
+-extern "C"
+-{
+-#endif /* __cplusplus */
+-
+-/*
+- * $Id: portaudio.h,v 1.5 2002/03/26 18:04:22 philburk Exp $
+- * PortAudio Portable Real-Time Audio Library
+- * PortAudio API Header File
+- * Latest version available at: http://www.audiomulch.com/portaudio/
+- *
+- * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
+- *
+- * Permission is hereby granted, free of charge, to any person obtaining
+- * a copy of this software and associated documentation files
+- * (the "Software"), to deal in the Software without restriction,
+- * including without limitation the rights to use, copy, modify, merge,
+- * publish, distribute, sublicense, and/or sell copies of the Software,
+- * and to permit persons to whom the Software is furnished to do so,
+- * subject to the following conditions:
+- *
+- * The above copyright notice and this permission notice shall be
+- * included in all copies or substantial portions of the Software.
+- *
+- * Any person wishing to distribute modifications to the Software is
+- * requested to send the modifications to the original developer so that
+- * they can be incorporated into the canonical version.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+- *
+- */
+-
+-typedef int PaError;
+-typedef enum {
+-    paNoError = 0,
+-
+-    paHostError = -10000,
+-    paInvalidChannelCount,
+-    paInvalidSampleRate,
+-    paInvalidDeviceId,
+-    paInvalidFlag,
+-    paSampleFormatNotSupported,
+-    paBadIODeviceCombination,
+-    paInsufficientMemory,
+-    paBufferTooBig,
+-    paBufferTooSmall,
+-    paNullCallback,
+-    paBadStreamPtr,
+-    paTimedOut,
+-    paInternalError,
+-    paDeviceUnavailable
+-} PaErrorNum;
+-
+-/*
+- Pa_Initialize() is the library initialisation function - call this before
+- using the library.
+-
+-*/
+-
+-PaError Pa_Initialize( void );
+-
+-/*
+- Pa_Terminate() is the library termination function - call this after
+- using the library.
+-
+-*/
+-
+-PaError Pa_Terminate( void );
+-
+-/*
+- Pa_GetHostError() returns a host specific error code.
+- This can be called after receiving a PortAudio error code of paHostError.
+-
+-*/
+-
+-long Pa_GetHostError( void );
+-
+-/*
+- Pa_GetErrorText() translates the supplied PortAudio error number
+- into a human readable message.
+- 
+-*/
+-
+-const char *Pa_GetErrorText( PaError errnum );
+-
+-/*
+- Sample formats
+- 
+- These are formats used to pass sound data between the callback and the
+- stream. Each device has a "native" format which may be used when optimum
+- efficiency or control over conversion is required.
+- 
+- Formats marked "always available" are supported (emulated) by all 
+- PortAudio implementations.
+- 
+- The floating point representation (paFloat32) uses +1.0 and -1.0 as the 
+- maximum and minimum respectively.
+-
+- paUInt8 is an unsigned 8 bit format where 128 is considered "ground"
+-
+-*/
+-
+-typedef unsigned long PaSampleFormat;
+-#define paFloat32      ((PaSampleFormat) (1<<0)) /*always available*/
+-#define paInt16        ((PaSampleFormat) (1<<1)) /*always available*/
+-#define paInt32        ((PaSampleFormat) (1<<2)) /*always available*/
+-#define paInt24        ((PaSampleFormat) (1<<3))
+-#define paPackedInt24  ((PaSampleFormat) (1<<4))
+-#define paInt8         ((PaSampleFormat) (1<<5))
+-#define paUInt8        ((PaSampleFormat) (1<<6))
+-#define paCustomFormat ((PaSampleFormat) (1<<16))
+-
+-/*
+- Device enumeration mechanism.
+- 
+- Device ids range from 0 to Pa_CountDevices()-1.
+- 
+- Devices may support input, output or both.
+-
+-*/
+-
+-typedef int PaDeviceID;
+-#define paNoDevice -1
+-
+-int Pa_CountDevices( void );
+-
+-typedef struct
+-{
+-    int structVersion;
+-    const char *name;
+-    int maxInputChannels;
+-    int maxOutputChannels;
+-    /* Number of discrete rates, or -1 if range supported. */
+-    int numSampleRates;
+-    /* Array of supported sample rates, or {min,max} if range supported. */
+-    const double *sampleRates;
+-    PaSampleFormat nativeSampleFormats;
+-}
+-PaDeviceInfo;
+-
+-/*
+- Pa_GetDefaultInputDeviceID(), Pa_GetDefaultOutputDeviceID() return the
+- default device ids for input and output respectively, or paNoDevice if
+- no device is available.
+- The result can be passed to Pa_OpenStream().
+- 
+- On the PC, the user can specify a default device by
+- setting an environment variable. For example, to use device #1.
+- 
+-  set PA_RECOMMENDED_OUTPUT_DEVICE=1
+- 
+- The user should first determine the available device ids by using
+- the supplied application "pa_devs".
+-
+-*/
+-
+-PaDeviceID Pa_GetDefaultInputDeviceID( void );
+-PaDeviceID Pa_GetDefaultOutputDeviceID( void );
+-
+-
+-
+-/*
+- Pa_GetDeviceInfo() returns a pointer to an immutable PaDeviceInfo structure
+- for the device specified.
+- If the device parameter is out of range the function returns NULL.
+-
+- PortAudio manages the memory referenced by the returned pointer, the client
+- must not manipulate or free the memory. The pointer is only guaranteed to be
+- valid between calls to Pa_Initialize() and Pa_Terminate().
+-
+-*/
+-
+-const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceID device );
+-
+-/*
+- PaTimestamp is used to represent a continuous sample clock with arbitrary
+- start time that can be used for syncronization. The type is used for the
+- outTime argument to the PortAudioCallback and as the result of Pa_StreamTime()
+-
+-*/
+-
+-typedef double PaTimestamp;
+-
+-/*
+- PortAudioCallback is implemented by PortAudio clients.
+- 
+- inputBuffer and outputBuffer are arrays of interleaved samples,
+- the format, packing and number of channels used by the buffers are
+- determined by parameters to Pa_OpenStream() (see below).
+- 
+- framesPerBuffer is the number of sample frames to be processed by the callback.
+- 
+- outTime is the time in samples when the buffer(s) processed by
+- this callback will begin being played at the audio output.
+- See also Pa_StreamTime()
+- 
+- userData is the value of a user supplied pointer passed to Pa_OpenStream()
+- intended for storing synthesis data etc.
+- 
+- return value:
+- The callback can return a non-zero value to stop the stream. This may be
+- useful in applications such as soundfile players where a specific duration
+- of output is required. However, it is not necessary to utilise this mechanism
+- as StopStream() will also terminate the stream. A callback returning a
+- non-zero value must fill the entire outputBuffer.
+- 
+- NOTE: None of the other stream functions may be called from within the
+- callback function except for Pa_GetCPULoad().
+-
+-*/
+-
+-typedef int (PortAudioCallback)(
+-    void *inputBuffer, void *outputBuffer,
+-    unsigned long framesPerBuffer,
+-    PaTimestamp outTime, void *userData );
+-
+-
+-/*
+- Stream flags
+- 
+- These flags may be supplied (ored together) in the streamFlags argument to
+- the Pa_OpenStream() function.
+-
+-*/
+-
+-#define   paNoFlag      (0)
+-#define   paClipOff     (1<<0)   /* disable default clipping of out of range samples */
+-#define   paDitherOff   (1<<1)   /* disable default dithering */
+-#define   paPlatformSpecificFlags (0x00010000)
+-typedef   unsigned long PaStreamFlags;
+-
+-/*
+- A single PortAudioStream provides multiple channels of real-time
+- input and output audio streaming to a client application.
+- Pointers to PortAudioStream objects are passed between PortAudio functions.
+-*/
+-
+-typedef void PortAudioStream;
+-#define PaStream PortAudioStream
+-
+-/*
+- Pa_OpenStream() opens a stream for either input, output or both.
+- 
+- stream is the address of a PortAudioStream pointer which will receive
+- a pointer to the newly opened stream.
+- 
+- inputDevice is the id of the device used for input (see PaDeviceID above.)
+- inputDevice may be paNoDevice to indicate that an input device is not required.
+- 
+- numInputChannels is the number of channels of sound to be delivered to the
+- callback. It can range from 1 to the value of maxInputChannels in the
+- PaDeviceInfo record for the device specified by the inputDevice parameter.
+- If inputDevice is paNoDevice numInputChannels is ignored.
+- 
+- inputSampleFormat is the sample format of inputBuffer provided to the callback
+- function. inputSampleFormat may be any of the formats described by the
+- PaSampleFormat enumeration (see above). PortAudio guarantees support for
+- the device's native formats (nativeSampleFormats in the device info record)
+- and additionally 16 and 32 bit integer and 32 bit floating point formats.
+- Support for other formats is implementation defined.
+- 
+- inputDriverInfo is a pointer to an optional driver specific data structure
+- containing additional information for device setup or stream processing.
+- inputDriverInfo is never required for correct operation. If not used
+- inputDriverInfo should be NULL.
+- 
+- outputDevice is the id of the device used for output (see PaDeviceID above.)
+- outputDevice may be paNoDevice to indicate that an output device is not required.
+- 
+- numOutputChannels is the number of channels of sound to be supplied by the
+- callback. See the definition of numInputChannels above for more details.
+- 
+- outputSampleFormat is the sample format of the outputBuffer filled by the
+- callback function. See the definition of inputSampleFormat above for more
+- details.
+- 
+- outputDriverInfo is a pointer to an optional driver specific data structure
+- containing additional information for device setup or stream processing.
+- outputDriverInfo is never required for correct operation. If not used
+- outputDriverInfo should be NULL.
+- 
+- sampleRate is the desired sampleRate. For full-duplex streams it is the
+- sample rate for both input and output
+- 
+- framesPerBuffer is the length in sample frames of all internal sample buffers
+- used for communication with platform specific audio routines. Wherever
+- possible this corresponds to the framesPerBuffer parameter passed to the
+- callback function.
+- 
+- numberOfBuffers is the number of buffers used for multibuffered communication
+- with the platform specific audio routines. If you pass zero, then an optimum
+- value will be chosen for you internally. This parameter is provided only
+- as a guide - and does not imply that an implementation must use multibuffered
+- i/o when reliable double buffering is available (such as SndPlayDoubleBuffer()
+- on the Macintosh.)
+- 
+- streamFlags may contain a combination of flags ORed together.
+- These flags modify the behaviour of the streaming process. Some flags may only
+- be relevant to certain buffer formats.
+- 
+- callback is a pointer to a client supplied function that is responsible
+- for processing and filling input and output buffers (see above for details.)
+- 
+- userData is a client supplied pointer which is passed to the callback
+- function. It could for example, contain a pointer to instance data necessary
+- for processing the audio buffers.
+- 
+- return value:
+- Upon success Pa_OpenStream() returns PaNoError and places a pointer to a
+- valid PortAudioStream in the stream argument. The stream is inactive (stopped).
+- If a call to Pa_OpenStream() fails a non-zero error code is returned (see
+- PaError above) and the value of stream is invalid.
+- 
+-*/
+-
+-PaError Pa_OpenStream( PortAudioStream** stream,
+-                       PaDeviceID inputDevice,
+-                       int numInputChannels,
+-                       PaSampleFormat inputSampleFormat,
+-                       void *inputDriverInfo,
+-                       PaDeviceID outputDevice,
+-                       int numOutputChannels,
+-                       PaSampleFormat outputSampleFormat,
+-                       void *outputDriverInfo,
+-                       double sampleRate,
+-                       unsigned long framesPerBuffer,
+-                       unsigned long numberOfBuffers,
+-                       PaStreamFlags streamFlags,
+-                       PortAudioCallback *callback,
+-                       void *userData );
+-
+-
+-/*
+- Pa_OpenDefaultStream() is a simplified version of Pa_OpenStream() that opens
+- the default input and/or output devices. Most parameters have identical meaning
+- to their Pa_OpenStream() counterparts, with the following exceptions:
+- 
+- If either numInputChannels or numOutputChannels is 0 the respective device
+- is not opened. This has the same effect as passing paNoDevice in the device
+- arguments to Pa_OpenStream().
+- 
+- sampleFormat applies to both the input and output buffers.
+-
+-*/
+-
+-PaError Pa_OpenDefaultStream( PortAudioStream** stream,
+-                              int numInputChannels,
+-                              int numOutputChannels,
+-                              PaSampleFormat sampleFormat,
+-                              double sampleRate,
+-                              unsigned long framesPerBuffer,
+-                              unsigned long numberOfBuffers,
+-                              PortAudioCallback *callback,
+-                              void *userData );
+-
+-/*
+- Pa_CloseStream() closes an audio stream, flushing any pending buffers.
+-
+-*/
+-
+-PaError Pa_CloseStream( PortAudioStream* );
+-
+-/*
+- Pa_StartStream() and Pa_StopStream() begin and terminate audio processing.
+- Pa_StopStream() waits until all pending audio buffers have been played.
+- Pa_AbortStream() stops playing immediately without waiting for pending
+- buffers to complete.
+-    
+-*/
+-
+-PaError Pa_StartStream( PortAudioStream *stream );
+-
+-PaError Pa_StopStream( PortAudioStream *stream );
+-
+-PaError Pa_AbortStream( PortAudioStream *stream );
+-
+-/*
+- Pa_StreamActive() returns one (1) when the stream is active (ie playing
+- or recording audio), zero (0) when not playing, or a negative error number
+- if the stream is invalid.
+- The stream is active between calls to Pa_StartStream() and Pa_StopStream(),
+- but may also become inactive if the callback returns a non-zero value.
+- In the latter case, the stream is considered inactive after the last
+- buffer has finished playing.
+- 
+-*/
+-
+-PaError Pa_StreamActive( PortAudioStream *stream );
+-
+-/*
+- Pa_StreamTime() returns the current output time in samples for the stream.
+- This time may be used as a time reference (for example synchronizing audio to
+- MIDI).
+- 
+-*/
+-
+-PaTimestamp Pa_StreamTime( PortAudioStream *stream );
+-
+-/*
+- Pa_GetCPULoad() returns the CPU Load for the stream.
+- The "CPU Load" is a fraction of total CPU time consumed by the stream's
+- audio processing routines including, but not limited to the client supplied
+- callback.
+- A value of 0.5 would imply that PortAudio and the sound generating
+- callback was consuming roughly 50% of the available CPU time.
+- This function may be called from the callback function or the application.
+- 
+-*/
+-
+-double Pa_GetCPULoad( PortAudioStream* stream );
+-
+-/*
+- Pa_GetMinNumBuffers() returns the minimum number of buffers required by
+- the current host based on minimum latency.
+- On the PC, for the DirectSound implementation, latency can be optionally set
+- by user by setting an environment variable.
+- For example, to set latency to 200 msec, put:
+- 
+-    set PA_MIN_LATENCY_MSEC=200
+- 
+- in the AUTOEXEC.BAT file and reboot.
+- If the environment variable is not set, then the latency will be determined
+- based on the OS. Windows NT has higher latency than Win95.
+- 
+-*/
+-
+-int Pa_GetMinNumBuffers( int framesPerBuffer, double sampleRate );
+-
+-/*
+- Pa_Sleep() puts the caller to sleep for at least 'msec' milliseconds.
+- You may sleep longer than the requested time so don't rely on this for
+- accurate musical timing.
+- 
+- Pa_Sleep() is provided as a convenience for authors of portable code (such as
+- the tests and examples in the PortAudio distribution.)
+- 
+-*/
+-
+-void Pa_Sleep( long msec );
+-
+-/*
+- Pa_GetSampleSize() returns the size in bytes of a single sample in the
+- supplied PaSampleFormat, or paSampleFormatNotSupported if the format is
+- no supported.
+-  
+-*/
+-
+-PaError Pa_GetSampleSize( PaSampleFormat format );
+-
+-
+-#ifdef __cplusplus
+-}
+-#endif /* __cplusplus */
+-#endif /* PORT_AUDIO_H */
+--- a/src/portaudio19.h
++++ /dev/null
+@@ -1,1127 +0,0 @@
+-// NOTE: Copy this file to  portaudio.h  in order to compile with V19 portaudio
+-
+-#ifndef PORTAUDIO_H
+-#define PORTAUDIO_H
+-/*
+- * $Id: portaudio.h 1061 2006-06-19 22:46:41Z lschwardt $
+- * PortAudio Portable Real-Time Audio Library
+- * PortAudio API Header File
+- * Latest version available at: http://www.portaudio.com/
+- *
+- * Copyright (c) 1999-2002 Ross Bencina and Phil Burk
+- *
+- * Permission is hereby granted, free of charge, to any person obtaining
+- * a copy of this software and associated documentation files
+- * (the "Software"), to deal in the Software without restriction,
+- * including without limitation the rights to use, copy, modify, merge,
+- * publish, distribute, sublicense, and/or sell copies of the Software,
+- * and to permit persons to whom the Software is furnished to do so,
+- * subject to the following conditions:
+- *
+- * The above copyright notice and this permission notice shall be
+- * included in all copies or substantial portions of the Software.
+- *
+- * Any person wishing to distribute modifications to the Software is
+- * requested to send the modifications to the original developer so that
+- * they can be incorporated into the canonical version.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+- */
+-
+-/** @file
+- @brief The PortAudio API.
+-*/
+-
+-
+-#ifdef __cplusplus
+-extern "C"
+-{
+-#endif /* __cplusplus */
+-
+- 
+-/** Retrieve the release number of the currently running PortAudio build,
+- eg 1900.
+-*/
+-int Pa_GetVersion( void );
+-
+-
+-/** Retrieve a textual description of the current PortAudio build,
+- eg "PortAudio V19-devel 13 October 2002".
+-*/
+-const char* Pa_GetVersionText( void );
+-
+-
+-/** Error codes returned by PortAudio functions.
+- Note that with the exception of paNoError, all PaErrorCodes are negative.
+-*/
+-
+-typedef int PaError;
+-typedef enum PaErrorCode
+-{
+-    paNoError = 0,
+-
+-    paNotInitialized = -10000,
+-    paUnanticipatedHostError,
+-    paInvalidChannelCount,
+-    paInvalidSampleRate,
+-    paInvalidDevice,
+-    paInvalidFlag,
+-    paSampleFormatNotSupported,
+-    paBadIODeviceCombination,
+-    paInsufficientMemory,
+-    paBufferTooBig,
+-    paBufferTooSmall,
+-    paNullCallback,
+-    paBadStreamPtr,
+-    paTimedOut,
+-    paInternalError,
+-    paDeviceUnavailable,
+-    paIncompatibleHostApiSpecificStreamInfo,
+-    paStreamIsStopped,
+-    paStreamIsNotStopped,
+-    paInputOverflowed,
+-    paOutputUnderflowed,
+-    paHostApiNotFound,
+-    paInvalidHostApi,
+-    paCanNotReadFromACallbackStream,      /**< @todo review error code name */
+-    paCanNotWriteToACallbackStream,       /**< @todo review error code name */
+-    paCanNotReadFromAnOutputOnlyStream,   /**< @todo review error code name */
+-    paCanNotWriteToAnInputOnlyStream,     /**< @todo review error code name */
+-    paIncompatibleStreamHostApi,
+-    paBadBufferPtr
+-} PaErrorCode;
+-
+-
+-/** Translate the supplied PortAudio error code into a human readable
+- message.
+-*/
+-const char *Pa_GetErrorText( PaError errorCode );
+-
+-
+-/** Library initialization function - call this before using PortAudio.
+- This function initialises internal data structures and prepares underlying
+- host APIs for use. This function MUST be called before using any other
+- PortAudio API functions.
+-
+- If Pa_Initialize() is called multiple times, each successful 
+- call must be matched with a corresponding call to Pa_Terminate(). 
+- Pairs of calls to Pa_Initialize()/Pa_Terminate() may overlap, and are not 
+- required to be fully nested.
+-
+- Note that if Pa_Initialize() returns an error code, Pa_Terminate() should
+- NOT be called.
+-
+- @return paNoError if successful, otherwise an error code indicating the cause
+- of failure.
+-
+- @see Pa_Terminate
+-*/
+-PaError Pa_Initialize( void );
+-
+-
+-/** Library termination function - call this when finished using PortAudio.
+- This function deallocates all resources allocated by PortAudio since it was
+- initializied by a call to Pa_Initialize(). In cases where Pa_Initialise() has
+- been called multiple times, each call must be matched with a corresponding call
+- to Pa_Terminate(). The final matching call to Pa_Terminate() will automatically
+- close any PortAudio streams that are still open.
+-
+- Pa_Terminate() MUST be called before exiting a program which uses PortAudio.
+- Failure to do so may result in serious resource leaks, such as audio devices
+- not being available until the next reboot.
+-
+- @return paNoError if successful, otherwise an error code indicating the cause
+- of failure.
+- 
+- @see Pa_Initialize
+-*/
+-PaError Pa_Terminate( void );
+-
+-
+-
+-/** The type used to refer to audio devices. Values of this type usually
+- range from 0 to (Pa_DeviceCount-1), and may also take on the PaNoDevice
+- and paUseHostApiSpecificDeviceSpecification values.
+-
+- @see Pa_DeviceCount, paNoDevice, paUseHostApiSpecificDeviceSpecification
+-*/
+-typedef int PaDeviceIndex;
+-
+-
+-/** A special PaDeviceIndex value indicating that no device is available,
+- or should be used.
+-
+- @see PaDeviceIndex
+-*/
+-#define paNoDevice ((PaDeviceIndex)-1)
+-
+-
+-/** A special PaDeviceIndex value indicating that the device(s) to be used
+- are specified in the host api specific stream info structure.
+-
+- @see PaDeviceIndex
+-*/
+-#define paUseHostApiSpecificDeviceSpecification ((PaDeviceIndex)-2)
+-
+-
+-/* Host API enumeration mechanism */
+-
+-/** The type used to enumerate to host APIs at runtime. Values of this type
+- range from 0 to (Pa_GetHostApiCount()-1).
+-
+- @see Pa_GetHostApiCount
+-*/
+-typedef int PaHostApiIndex;
+-
+-
+-/** Retrieve the number of available host APIs. Even if a host API is
+- available it may have no devices available.
+-
+- @return A non-negative value indicating the number of available host APIs
+- or, a PaErrorCode (which are always negative) if PortAudio is not initialized
+- or an error is encountered.
+-
+- @see PaHostApiIndex
+-*/
+-PaHostApiIndex Pa_GetHostApiCount( void );
+-
+-
+-/** Retrieve the index of the default host API. The default host API will be
+- the lowest common denominator host API on the current platform and is
+- unlikely to provide the best performance.
+-
+- @return A non-negative value ranging from 0 to (Pa_GetHostApiCount()-1)
+- indicating the default host API index or, a PaErrorCode (which are always
+- negative) if PortAudio is not initialized or an error is encountered.
+-*/
+-PaHostApiIndex Pa_GetDefaultHostApi( void );
+-
+-
+-/** Unchanging unique identifiers for each supported host API. This type
+- is used in the PaHostApiInfo structure. The values are guaranteed to be
+- unique and to never change, thus allowing code to be written that
+- conditionally uses host API specific extensions.
+-
+- New type ids will be allocated when support for a host API reaches
+- "public alpha" status, prior to that developers should use the
+- paInDevelopment type id.
+-
+- @see PaHostApiInfo
+-*/
+-typedef enum PaHostApiTypeId
+-{
+-    paInDevelopment=0, /* use while developing support for a new host API */
+-    paDirectSound=1,
+-    paMME=2,
+-    paASIO=3,
+-    paSoundManager=4,
+-    paCoreAudio=5,
+-    paOSS=7,
+-    paALSA=8,
+-    paAL=9,
+-    paBeOS=10,
+-    paWDMKS=11,
+-    paJACK=12,
+-    paWASAPI=13,
+-    paAudioScienceHPI=14
+-} PaHostApiTypeId;
+-
+-
+-/** A structure containing information about a particular host API. */
+-
+-typedef struct PaHostApiInfo
+-{
+-    /** this is struct version 1 */
+-    int structVersion;
+-    /** The well known unique identifier of this host API @see PaHostApiTypeId */
+-    PaHostApiTypeId type;
+-    /** A textual description of the host API for display on user interfaces. */
+-    const char *name;
+-
+-    /**  The number of devices belonging to this host API. This field may be
+-     used in conjunction with Pa_HostApiDeviceIndexToDeviceIndex() to enumerate
+-     all devices for this host API.
+-     @see Pa_HostApiDeviceIndexToDeviceIndex
+-    */
+-    int deviceCount;
+-
+-    /** The default input device for this host API. The value will be a
+-     device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice
+-     if no default input device is available.
+-    */
+-    PaDeviceIndex defaultInputDevice;
+-
+-    /** The default output device for this host API. The value will be a
+-     device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice
+-     if no default output device is available.
+-    */
+-    PaDeviceIndex defaultOutputDevice;
+-    
+-} PaHostApiInfo;
+-
+-
+-/** Retrieve a pointer to a structure containing information about a specific
+- host Api.
+-
+- @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1)
+-
+- @return A pointer to an immutable PaHostApiInfo structure describing
+- a specific host API. If the hostApi parameter is out of range or an error
+- is encountered, the function returns NULL.
+-
+- The returned structure is owned by the PortAudio implementation and must not
+- be manipulated or freed. The pointer is only guaranteed to be valid between
+- calls to Pa_Initialize() and Pa_Terminate().
+-*/
+-const PaHostApiInfo * Pa_GetHostApiInfo( PaHostApiIndex hostApi );
+-
+-
+-/** Convert a static host API unique identifier, into a runtime
+- host API index.
+-
+- @param type A unique host API identifier belonging to the PaHostApiTypeId
+- enumeration.
+-
+- @return A valid PaHostApiIndex ranging from 0 to (Pa_GetHostApiCount()-1) or,
+- a PaErrorCode (which are always negative) if PortAudio is not initialized
+- or an error is encountered.
+- 
+- The paHostApiNotFound error code indicates that the host API specified by the
+- type parameter is not available.
+-
+- @see PaHostApiTypeId
+-*/
+-PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type );
+-
+-
+-/** Convert a host-API-specific device index to standard PortAudio device index.
+- This function may be used in conjunction with the deviceCount field of
+- PaHostApiInfo to enumerate all devices for the specified host API.
+-
+- @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1)
+-
+- @param hostApiDeviceIndex A valid per-host device index in the range
+- 0 to (Pa_GetHostApiInfo(hostApi)->deviceCount-1)
+-
+- @return A non-negative PaDeviceIndex ranging from 0 to (Pa_GetDeviceCount()-1)
+- or, a PaErrorCode (which are always negative) if PortAudio is not initialized
+- or an error is encountered.
+-
+- A paInvalidHostApi error code indicates that the host API index specified by
+- the hostApi parameter is out of range.
+-
+- A paInvalidDevice error code indicates that the hostApiDeviceIndex parameter
+- is out of range.
+- 
+- @see PaHostApiInfo
+-*/
+-PaDeviceIndex Pa_HostApiDeviceIndexToDeviceIndex( PaHostApiIndex hostApi,
+-        int hostApiDeviceIndex );
+-
+-
+-
+-/** Structure used to return information about a host error condition.
+-*/
+-typedef struct PaHostErrorInfo{
+-    PaHostApiTypeId hostApiType;    /**< the host API which returned the error code */
+-    long errorCode;                 /**< the error code returned */
+-    const char *errorText;          /**< a textual description of the error if available, otherwise a zero-length string */
+-}PaHostErrorInfo;
+-
+-
+-/** Return information about the last host error encountered. The error
+- information returned by Pa_GetLastHostErrorInfo() will never be modified
+- asyncronously by errors occurring in other PortAudio owned threads
+- (such as the thread that manages the stream callback.)
+-
+- This function is provided as a last resort, primarily to enhance debugging
+- by providing clients with access to all available error information.
+-
+- @return A pointer to an immutable structure constaining information about
+- the host error. The values in this structure will only be valid if a
+- PortAudio function has previously returned the paUnanticipatedHostError
+- error code.
+-*/
+-const PaHostErrorInfo* Pa_GetLastHostErrorInfo( void );
+-
+-
+-
+-/* Device enumeration and capabilities */
+-
+-/** Retrieve the number of available devices. The number of available devices
+- may be zero.
+-
+- @return A non-negative value indicating the number of available devices or,
+- a PaErrorCode (which are always negative) if PortAudio is not initialized
+- or an error is encountered.
+-*/
+-PaDeviceIndex Pa_GetDeviceCount( void );
+-
+-
+-/** Retrieve the index of the default input device. The result can be
+- used in the inputDevice parameter to Pa_OpenStream().
+-
+- @return The default input device index for the default host API, or paNoDevice
+- if no default input device is available or an error was encountered.
+-*/
+-PaDeviceIndex Pa_GetDefaultInputDevice( void );
+-
+-
+-/** Retrieve the index of the default output device. The result can be
+- used in the outputDevice parameter to Pa_OpenStream().
+-
+- @return The default output device index for the defualt host API, or paNoDevice
+- if no default output device is available or an error was encountered.
+-
+- @note
+- On the PC, the user can specify a default device by
+- setting an environment variable. For example, to use device #1.
+-<pre>
+- set PA_RECOMMENDED_OUTPUT_DEVICE=1
+-</pre>
+- The user should first determine the available device ids by using
+- the supplied application "pa_devs".
+-*/
+-PaDeviceIndex Pa_GetDefaultOutputDevice( void );
+-
+-
+-/** The type used to represent monotonic time in seconds that can be used
+- for syncronisation. The type is used for the outTime argument to the
+- PaStreamCallback and as the result of Pa_GetStreamTime().
+-     
+- @see PaStreamCallback, Pa_GetStreamTime
+-*/
+-typedef double PaTime;
+-
+-
+-/** A type used to specify one or more sample formats. Each value indicates
+- a possible format for sound data passed to and from the stream callback,
+- Pa_ReadStream and Pa_WriteStream.
+-
+- The standard formats paFloat32, paInt16, paInt32, paInt24, paInt8
+- and aUInt8 are usually implemented by all implementations.
+-
+- The floating point representation (paFloat32) uses +1.0 and -1.0 as the
+- maximum and minimum respectively.
+-
+- paUInt8 is an unsigned 8 bit format where 128 is considered "ground"
+-
+- The paNonInterleaved flag indicates that a multichannel buffer is passed
+- as a set of non-interleaved pointers.
+-
+- @see Pa_OpenStream, Pa_OpenDefaultStream, PaDeviceInfo
+- @see paFloat32, paInt16, paInt32, paInt24, paInt8
+- @see paUInt8, paCustomFormat, paNonInterleaved
+-*/
+-typedef unsigned long PaSampleFormat;
+-
+-
+-#define paFloat32        ((PaSampleFormat) 0x00000001) /**< @see PaSampleFormat */
+-#define paInt32          ((PaSampleFormat) 0x00000002) /**< @see PaSampleFormat */
+-#define paInt24          ((PaSampleFormat) 0x00000004) /**< Packed 24 bit format. @see PaSampleFormat */
+-#define paInt16          ((PaSampleFormat) 0x00000008) /**< @see PaSampleFormat */
+-#define paInt8           ((PaSampleFormat) 0x00000010) /**< @see PaSampleFormat */
+-#define paUInt8          ((PaSampleFormat) 0x00000020) /**< @see PaSampleFormat */
+-#define paCustomFormat   ((PaSampleFormat) 0x00010000)/**< @see PaSampleFormat */
+-
+-#define paNonInterleaved ((PaSampleFormat) 0x80000000)
+-
+-/** A structure providing information and capabilities of PortAudio devices.
+- Devices may support input, output or both input and output.
+-*/
+-typedef struct PaDeviceInfo
+-{
+-    int structVersion;  /* this is struct version 2 */
+-    const char *name;
+-    PaHostApiIndex hostApi; /* note this is a host API index, not a type id*/
+-    
+-    int maxInputChannels;
+-    int maxOutputChannels;
+-
+-    /* Default latency values for interactive performance. */
+-    PaTime defaultLowInputLatency;
+-    PaTime defaultLowOutputLatency;
+-    /* Default latency values for robust non-interactive applications (eg. playing sound files). */
+-    PaTime defaultHighInputLatency;
+-    PaTime defaultHighOutputLatency;
+-
+-    double defaultSampleRate;
+-} PaDeviceInfo;
+-
+-
+-/** Retrieve a pointer to a PaDeviceInfo structure containing information
+- about the specified device.
+- @return A pointer to an immutable PaDeviceInfo structure. If the device
+- parameter is out of range the function returns NULL.
+-
+- @param device A valid device index in the range 0 to (Pa_GetDeviceCount()-1)
+-
+- @note PortAudio manages the memory referenced by the returned pointer,
+- the client must not manipulate or free the memory. The pointer is only
+- guaranteed to be valid between calls to Pa_Initialize() and Pa_Terminate().
+-
+- @see PaDeviceInfo, PaDeviceIndex
+-*/
+-const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceIndex device );
+-
+-
+-/** Parameters for one direction (input or output) of a stream.
+-*/
+-typedef struct PaStreamParameters
+-{
+-    /** A valid device index in the range 0 to (Pa_GetDeviceCount()-1)
+-     specifying the device to be used or the special constant
+-     paUseHostApiSpecificDeviceSpecification which indicates that the actual
+-     device(s) to use are specified in hostApiSpecificStreamInfo.
+-     This field must not be set to paNoDevice.
+-    */
+-    PaDeviceIndex device;
+-    
+-    /** The number of channels of sound to be delivered to the
+-     stream callback or accessed by Pa_ReadStream() or Pa_WriteStream().
+-     It can range from 1 to the value of maxInputChannels in the
+-     PaDeviceInfo record for the device specified by the device parameter.
+-    */
+-    int channelCount;
+-
+-    /** The sample format of the buffer provided to the stream callback,
+-     a_ReadStream() or Pa_WriteStream(). It may be any of the formats described
+-     by the PaSampleFormat enumeration.
+-    */
+-    PaSampleFormat sampleFormat;
+-
+-    /** The desired latency in seconds. Where practical, implementations should
+-     configure their latency based on these parameters, otherwise they may
+-     choose the closest viable latency instead. Unless the suggested latency
+-     is greater than the absolute upper limit for the device implementations
+-     should round the suggestedLatency up to the next practial value - ie to
+-     provide an equal or higher latency than suggestedLatency wherever possibe.
+-     Actual latency values for an open stream may be retrieved using the
+-     inputLatency and outputLatency fields of the PaStreamInfo structure
+-     returned by Pa_GetStreamInfo().
+-     @see default*Latency in PaDeviceInfo, *Latency in PaStreamInfo
+-    */
+-    PaTime suggestedLatency;
+-
+-    /** An optional pointer to a host api specific data structure
+-     containing additional information for device setup and/or stream processing.
+-     hostApiSpecificStreamInfo is never required for correct operation,
+-     if not used it should be set to NULL.
+-    */
+-    void *hostApiSpecificStreamInfo;
+-
+-} PaStreamParameters;
+-
+-
+-/** Return code for Pa_IsFormatSupported indicating success. */
+-#define paFormatIsSupported (0)
+-
+-/** Determine whether it would be possible to open a stream with the specified
+- parameters.
+-
+- @param inputParameters A structure that describes the input parameters used to
+- open a stream. The suggestedLatency field is ignored. See PaStreamParameters
+- for a description of these parameters. inputParameters must be NULL for
+- output-only streams.
+-
+- @param outputParameters A structure that describes the output parameters used
+- to open a stream. The suggestedLatency field is ignored. See PaStreamParameters
+- for a description of these parameters. outputParameters must be NULL for
+- input-only streams.
+-
+- @param sampleRate The required sampleRate. For full-duplex streams it is the
+- sample rate for both input and output
+-
+- @return Returns 0 if the format is supported, and an error code indicating why
+- the format is not supported otherwise. The constant paFormatIsSupported is
+- provided to compare with the return value for success.
+-
+- @see paFormatIsSupported, PaStreamParameters
+-*/
+-PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters,
+-                              const PaStreamParameters *outputParameters,
+-                              double sampleRate );
+-
+-
+-
+-/* Streaming types and functions */
+-
+-
+-/**
+- A single PaStream can provide multiple channels of real-time
+- streaming audio input and output to a client application. A stream
+- provides access to audio hardware represented by one or more
+- PaDevices. Depending on the underlying Host API, it may be possible 
+- to open multiple streams using the same device, however this behavior 
+- is implementation defined. Portable applications should assume that 
+- a PaDevice may be simultaneously used by at most one PaStream.
+-
+- Pointers to PaStream objects are passed between PortAudio functions that
+- operate on streams.
+-
+- @see Pa_OpenStream, Pa_OpenDefaultStream, Pa_OpenDefaultStream, Pa_CloseStream,
+- Pa_StartStream, Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive,
+- Pa_GetStreamTime, Pa_GetStreamCpuLoad
+-
+-*/
+-typedef void PaStream;
+-
+-
+-/** Can be passed as the framesPerBuffer parameter to Pa_OpenStream()
+- or Pa_OpenDefaultStream() to indicate that the stream callback will
+- accept buffers of any size.
+-*/
+-#define paFramesPerBufferUnspecified  (0)
+-
+-
+-/** Flags used to control the behavior of a stream. They are passed as
+- parameters to Pa_OpenStream or Pa_OpenDefaultStream. Multiple flags may be
+- ORed together.
+-
+- @see Pa_OpenStream, Pa_OpenDefaultStream
+- @see paNoFlag, paClipOff, paDitherOff, paNeverDropInput,
+-  paPrimeOutputBuffersUsingStreamCallback, paPlatformSpecificFlags
+-*/
+-typedef unsigned long PaStreamFlags;
+-
+-/** @see PaStreamFlags */
+-#define   paNoFlag          ((PaStreamFlags) 0)
+-
+-/** Disable default clipping of out of range samples.
+- @see PaStreamFlags
+-*/
+-#define   paClipOff         ((PaStreamFlags) 0x00000001)
+-
+-/** Disable default dithering.
+- @see PaStreamFlags
+-*/
+-#define   paDitherOff       ((PaStreamFlags) 0x00000002)
+-
+-/** Flag requests that where possible a full duplex stream will not discard
+- overflowed input samples without calling the stream callback. This flag is
+- only valid for full duplex callback streams and only when used in combination
+- with the paFramesPerBufferUnspecified (0) framesPerBuffer parameter. Using
+- this flag incorrectly results in a paInvalidFlag error being returned from
+- Pa_OpenStream and Pa_OpenDefaultStream.
+-
+- @see PaStreamFlags, paFramesPerBufferUnspecified
+-*/
+-#define   paNeverDropInput  ((PaStreamFlags) 0x00000004)
+-
+-/** Call the stream callback to fill initial output buffers, rather than the
+- default behavior of priming the buffers with zeros (silence). This flag has
+- no effect for input-only and blocking read/write streams.
+- 
+- @see PaStreamFlags
+-*/
+-#define   paPrimeOutputBuffersUsingStreamCallback ((PaStreamFlags) 0x00000008)
+-
+-/** A mask specifying the platform specific bits.
+- @see PaStreamFlags
+-*/
+-#define   paPlatformSpecificFlags ((PaStreamFlags)0xFFFF0000)
+-
+-/**
+- Timing information for the buffers passed to the stream callback.
+-*/
+-typedef struct PaStreamCallbackTimeInfo{
+-    PaTime inputBufferAdcTime;
+-    PaTime currentTime;
+-    PaTime outputBufferDacTime;
+-} PaStreamCallbackTimeInfo;
+-
+-
+-/**
+- Flag bit constants for the statusFlags to PaStreamCallback.
+-
+- @see paInputUnderflow, paInputOverflow, paOutputUnderflow, paOutputOverflow,
+- paPrimingOutput
+-*/
+-typedef unsigned long PaStreamCallbackFlags;
+-
+-/** In a stream opened with paFramesPerBufferUnspecified, indicates that
+- input data is all silence (zeros) because no real data is available. In a
+- stream opened without paFramesPerBufferUnspecified, it indicates that one or
+- more zero samples have been inserted into the input buffer to compensate
+- for an input underflow.
+- @see PaStreamCallbackFlags
+-*/
+-#define paInputUnderflow   ((PaStreamCallbackFlags) 0x00000001)
+-
+-/** In a stream opened with paFramesPerBufferUnspecified, indicates that data
+- prior to the first sample of the input buffer was discarded due to an
+- overflow, possibly because the stream callback is using too much CPU time.
+- Otherwise indicates that data prior to one or more samples in the
+- input buffer was discarded.
+- @see PaStreamCallbackFlags
+-*/
+-#define paInputOverflow    ((PaStreamCallbackFlags) 0x00000002)
+-
+-/** Indicates that output data (or a gap) was inserted, possibly because the
+- stream callback is using too much CPU time.
+- @see PaStreamCallbackFlags
+-*/
+-#define paOutputUnderflow  ((PaStreamCallbackFlags) 0x00000004)
+-
+-/** Indicates that output data will be discarded because no room is available.
+- @see PaStreamCallbackFlags
+-*/
+-#define paOutputOverflow   ((PaStreamCallbackFlags) 0x00000008)
+-
+-/** Some of all of the output data will be used to prime the stream, input
+- data may be zero.
+- @see PaStreamCallbackFlags
+-*/
+-#define paPrimingOutput    ((PaStreamCallbackFlags) 0x00000010)
+-
+-/**
+- Allowable return values for the PaStreamCallback.
+- @see PaStreamCallback
+-*/
+-typedef enum PaStreamCallbackResult
+-{
+-    paContinue=0,
+-    paComplete=1,
+-    paAbort=2
+-} PaStreamCallbackResult;
+-
+-
+-/**
+- Functions of type PaStreamCallback are implemented by PortAudio clients.
+- They consume, process or generate audio in response to requests from an
+- active PortAudio stream.
+-     
+- @param input and @param output are arrays of interleaved samples,
+- the format, packing and number of channels used by the buffers are
+- determined by parameters to Pa_OpenStream().
+-     
+- @param frameCount The number of sample frames to be processed by
+- the stream callback.
+-
+- @param timeInfo The time in seconds when the first sample of the input
+- buffer was received at the audio input, the time in seconds when the first
+- sample of the output buffer will begin being played at the audio output, and
+- the time in seconds when the stream callback was called.
+- See also Pa_GetStreamTime()
+-
+- @param statusFlags Flags indicating whether input and/or output buffers
+- have been inserted or will be dropped to overcome underflow or overflow
+- conditions.
+-
+- @param userData The value of a user supplied pointer passed to
+- Pa_OpenStream() intended for storing synthesis data etc.
+-
+- @return
+- The stream callback should return one of the values in the
+- PaStreamCallbackResult enumeration. To ensure that the callback continues
+- to be called, it should return paContinue (0). Either paComplete or paAbort
+- can be returned to finish stream processing, after either of these values is
+- returned the callback will not be called again. If paAbort is returned the
+- stream will finish as soon as possible. If paComplete is returned, the stream
+- will continue until all buffers generated by the callback have been played.
+- This may be useful in applications such as soundfile players where a specific
+- duration of output is required. However, it is not necessary to utilise this
+- mechanism as Pa_StopStream(), Pa_AbortStream() or Pa_CloseStream() can also
+- be used to stop the stream. The callback must always fill the entire output
+- buffer irrespective of its return value.
+-
+- @see Pa_OpenStream, Pa_OpenDefaultStream
+-
+- @note With the exception of Pa_GetStreamCpuLoad() it is not permissable to call
+- PortAudio API functions from within the stream callback.
+-*/
+-typedef int PaStreamCallback(
+-    const void *input, void *output,
+-    unsigned long frameCount,
+-    const PaStreamCallbackTimeInfo* timeInfo,
+-    PaStreamCallbackFlags statusFlags,
+-    void *userData );
+-
+-
+-/** Opens a stream for either input, output or both.
+-     
+- @param stream The address of a PaStream pointer which will receive
+- a pointer to the newly opened stream.
+-     
+- @param inputParameters A structure that describes the input parameters used by
+- the opened stream. See PaStreamParameters for a description of these parameters.
+- inputParameters must be NULL for output-only streams.
+-
+- @param outputParameters A structure that describes the output parameters used by
+- the opened stream. See PaStreamParameters for a description of these parameters.
+- outputParameters must be NULL for input-only streams.
+- 
+- @param sampleRate The desired sampleRate. For full-duplex streams it is the
+- sample rate for both input and output
+-     
+- @param framesPerBuffer The number of frames passed to the stream callback
+- function, or the preferred block granularity for a blocking read/write stream.
+- The special value paFramesPerBufferUnspecified (0) may be used to request that
+- the stream callback will recieve an optimal (and possibly varying) number of
+- frames based on host requirements and the requested latency settings.
+- Note: With some host APIs, the use of non-zero framesPerBuffer for a callback
+- stream may introduce an additional layer of buffering which could introduce
+- additional latency. PortAudio guarantees that the additional latency
+- will be kept to the theoretical minimum however, it is strongly recommended
+- that a non-zero framesPerBuffer value only be used when your algorithm
+- requires a fixed number of frames per stream callback.
+- 
+- @param streamFlags Flags which modify the behaviour of the streaming process.
+- This parameter may contain a combination of flags ORed together. Some flags may
+- only be relevant to certain buffer formats.
+-     
+- @param streamCallback A pointer to a client supplied function that is responsible
+- for processing and filling input and output buffers. If this parameter is NULL
+- the stream will be opened in 'blocking read/write' mode. In blocking mode,
+- the client can receive sample data using Pa_ReadStream and write sample data
+- using Pa_WriteStream, the number of samples that may be read or written
+- without blocking is returned by Pa_GetStreamReadAvailable and
+- Pa_GetStreamWriteAvailable respectively.
+-
+- @param userData A client supplied pointer which is passed to the stream callback
+- function. It could for example, contain a pointer to instance data necessary
+- for processing the audio buffers. This parameter is ignored if streamCallback
+- is NULL.
+-     
+- @return
+- Upon success Pa_OpenStream() returns paNoError and places a pointer to a
+- valid PaStream in the stream argument. The stream is inactive (stopped).
+- If a call to Pa_OpenStream() fails, a non-zero error code is returned (see
+- PaError for possible error codes) and the value of stream is invalid.
+-
+- @see PaStreamParameters, PaStreamCallback, Pa_ReadStream, Pa_WriteStream,
+- Pa_GetStreamReadAvailable, Pa_GetStreamWriteAvailable
+-*/
+-PaError Pa_OpenStream( PaStream** stream,
+-                       const PaStreamParameters *inputParameters,
+-                       const PaStreamParameters *outputParameters,
+-                       double sampleRate,
+-                       unsigned long framesPerBuffer,
+-                       PaStreamFlags streamFlags,
+-                       PaStreamCallback *streamCallback,
+-                       void *userData );
+-
+-
+-/** A simplified version of Pa_OpenStream() that opens the default input
+- and/or output devices.
+-
+- @param stream The address of a PaStream pointer which will receive
+- a pointer to the newly opened stream.
+- 
+- @param numInputChannels  The number of channels of sound that will be supplied
+- to the stream callback or returned by Pa_ReadStream. It can range from 1 to
+- the value of maxInputChannels in the PaDeviceInfo record for the default input
+- device. If 0 the stream is opened as an output-only stream.
+-
+- @param numOutputChannels The number of channels of sound to be delivered to the
+- stream callback or passed to Pa_WriteStream. It can range from 1 to the value
+- of maxOutputChannels in the PaDeviceInfo record for the default output dvice.
+- If 0 the stream is opened as an output-only stream.
+-
+- @param sampleFormat The sample format of both the input and output buffers
+- provided to the callback or passed to and from Pa_ReadStream and Pa_WriteStream.
+- sampleFormat may be any of the formats described by the PaSampleFormat
+- enumeration.
+- 
+- @param sampleRate Same as Pa_OpenStream parameter of the same name.
+- @param framesPerBuffer Same as Pa_OpenStream parameter of the same name.
+- @param streamCallback Same as Pa_OpenStream parameter of the same name.
+- @param userData Same as Pa_OpenStream parameter of the same name.
+-
+- @return As for Pa_OpenStream
+-
+- @see Pa_OpenStream, PaStreamCallback
+-*/
+-PaError Pa_OpenDefaultStream( PaStream** stream,
+-                              int numInputChannels,
+-                              int numOutputChannels,
+-                              PaSampleFormat sampleFormat,
+-                              double sampleRate,
+-                              unsigned long framesPerBuffer,
+-                              PaStreamCallback *streamCallback,
+-                              void *userData );
+-
+-
+-/** Closes an audio stream. If the audio stream is active it
+- discards any pending buffers as if Pa_AbortStream() had been called.
+-*/
+-PaError Pa_CloseStream( PaStream *stream );
+-
+-
+-/** Functions of type PaStreamFinishedCallback are implemented by PortAudio 
+- clients. They can be registered with a stream using the Pa_SetStreamFinishedCallback
+- function. Once registered they are called when the stream becomes inactive
+- (ie once a call to Pa_StopStream() will not block).
+- A stream will become inactive after the stream callback returns non-zero,
+- or when Pa_StopStream or Pa_AbortStream is called. For a stream providing audio
+- output, if the stream callback returns paComplete, or Pa_StopStream is called,
+- the stream finished callback will not be called until all generated sample data
+- has been played.
+- 
+- @param userData The userData parameter supplied to Pa_OpenStream()
+-
+- @see Pa_SetStreamFinishedCallback
+-*/
+-typedef void PaStreamFinishedCallback( void *userData );
+-
+-
+-/** Register a stream finished callback function which will be called when the 
+- stream becomes inactive. See the description of PaStreamFinishedCallback for 
+- further details about when the callback will be called.
+-
+- @param stream a pointer to a PaStream that is in the stopped state - if the
+- stream is not stopped, the stream's finished callback will remain unchanged 
+- and an error code will be returned.
+-
+- @param streamFinishedCallback a pointer to a function with the same signature
+- as PaStreamFinishedCallback, that will be called when the stream becomes
+- inactive. Passing NULL for this parameter will un-register a previously
+- registered stream finished callback function.
+-
+- @return on success returns paNoError, otherwise an error code indicating the cause
+- of the error.
+-
+- @see PaStreamFinishedCallback
+-*/
+-PaError Pa_SetStreamFinishedCallback( PaStream *stream, PaStreamFinishedCallback* streamFinishedCallback ); 
+-
+-
+-/** Commences audio processing.
+-*/
+-PaError Pa_StartStream( PaStream *stream );
+-
+-
+-/** Terminates audio processing. It waits until all pending
+- audio buffers have been played before it returns.
+-*/
+-PaError Pa_StopStream( PaStream *stream );
+-
+-
+-/** Terminates audio processing immediately without waiting for pending
+- buffers to complete.
+-*/
+-PaError Pa_AbortStream( PaStream *stream );
+-
+-
+-/** Determine whether the stream is stopped.
+- A stream is considered to be stopped prior to a successful call to
+- Pa_StartStream and after a successful call to Pa_StopStream or Pa_AbortStream.
+- If a stream callback returns a value other than paContinue the stream is NOT
+- considered to be stopped.
+-
+- @return Returns one (1) when the stream is stopped, zero (0) when
+- the stream is running or, a PaErrorCode (which are always negative) if
+- PortAudio is not initialized or an error is encountered.
+-
+- @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive
+-*/
+-PaError Pa_IsStreamStopped( PaStream *stream );
+-
+-
+-/** Determine whether the stream is active.
+- A stream is active after a successful call to Pa_StartStream(), until it
+- becomes inactive either as a result of a call to Pa_StopStream() or
+- Pa_AbortStream(), or as a result of a return value other than paContinue from
+- the stream callback. In the latter case, the stream is considered inactive
+- after the last buffer has finished playing.
+-
+- @return Returns one (1) when the stream is active (ie playing or recording
+- audio), zero (0) when not playing or, a PaErrorCode (which are always negative)
+- if PortAudio is not initialized or an error is encountered.
+-
+- @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamStopped
+-*/
+-PaError Pa_IsStreamActive( PaStream *stream );
+-
+-
+-
+-/** A structure containing unchanging information about an open stream.
+- @see Pa_GetStreamInfo
+-*/
+-
+-typedef struct PaStreamInfo
+-{
+-    /** this is struct version 1 */
+-    int structVersion;
+-
+-    /** The input latency of the stream in seconds. This value provides the most
+-     accurate estimate of input latency available to the implementation. It may
+-     differ significantly from the suggestedLatency value passed to Pa_OpenStream().
+-     The value of this field will be zero (0.) for output-only streams.
+-     @see PaTime
+-    */
+-    PaTime inputLatency;
+-
+-    /** The output latency of the stream in seconds. This value provides the most
+-     accurate estimate of output latency available to the implementation. It may
+-     differ significantly from the suggestedLatency value passed to Pa_OpenStream().
+-     The value of this field will be zero (0.) for input-only streams.
+-     @see PaTime
+-    */
+-    PaTime outputLatency;
+-
+-    /** The sample rate of the stream in Hertz (samples per second). In cases
+-     where the hardware sample rate is inaccurate and PortAudio is aware of it,
+-     the value of this field may be different from the sampleRate parameter
+-     passed to Pa_OpenStream(). If information about the actual hardware sample
+-     rate is not available, this field will have the same value as the sampleRate
+-     parameter passed to Pa_OpenStream().
+-    */
+-    double sampleRate;
+-    
+-} PaStreamInfo;
+-
+-
+-/** Retrieve a pointer to a PaStreamInfo structure containing information
+- about the specified stream.
+- @return A pointer to an immutable PaStreamInfo structure. If the stream
+- parameter invalid, or an error is encountered, the function returns NULL.
+-
+- @param stream A pointer to an open stream previously created with Pa_OpenStream.
+-
+- @note PortAudio manages the memory referenced by the returned pointer,
+- the client must not manipulate or free the memory. The pointer is only
+- guaranteed to be valid until the specified stream is closed.
+-
+- @see PaStreamInfo
+-*/
+-const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream );
+-
+-
+-/** Determine the current time for the stream according to the same clock used
+- to generate buffer timestamps. This time may be used for syncronising other
+- events to the audio stream, for example synchronizing audio to MIDI.
+-                                        
+- @return The stream's current time in seconds, or 0 if an error occurred.
+-
+- @see PaTime, PaStreamCallback
+-*/
+-PaTime Pa_GetStreamTime( PaStream *stream );
+-
+-
+-/** Retrieve CPU usage information for the specified stream.
+- The "CPU Load" is a fraction of total CPU time consumed by a callback stream's
+- audio processing routines including, but not limited to the client supplied
+- stream callback. This function does not work with blocking read/write streams.
+-
+- This function may be called from the stream callback function or the
+- application.
+-     
+- @return
+- A floating point value, typically between 0.0 and 1.0, where 1.0 indicates
+- that the stream callback is consuming the maximum number of CPU cycles possible
+- to maintain real-time operation. A value of 0.5 would imply that PortAudio and
+- the stream callback was consuming roughly 50% of the available CPU time. The
+- return value may exceed 1.0. A value of 0.0 will always be returned for a
+- blocking read/write stream, or if an error occurrs.
+-*/
+-double Pa_GetStreamCpuLoad( PaStream* stream );
+-
+-
+-/** Read samples from an input stream. The function doesn't return until
+- the entire buffer has been filled - this may involve waiting for the operating
+- system to supply the data.
+-
+- @param stream A pointer to an open stream previously created with Pa_OpenStream.
+- 
+- @param buffer A pointer to a buffer of sample frames. The buffer contains
+- samples in the format specified by the inputParameters->sampleFormat field
+- used to open the stream, and the number of channels specified by
+- inputParameters->numChannels. If non-interleaved samples were requested,
+- buffer is a pointer to the first element of an array of non-interleaved
+- buffer pointers, one for each channel.
+-
+- @param frames The number of frames to be read into buffer. This parameter
+- is not constrained to a specific range, however high performance applications
+- will want to match this parameter to the framesPerBuffer parameter used
+- when opening the stream.
+-
+- @return On success PaNoError will be returned, or PaInputOverflowed if input
+- data was discarded by PortAudio after the previous call and before this call.
+-*/
+-PaError Pa_ReadStream( PaStream* stream,
+-                       void *buffer,
+-                       unsigned long frames );
+-
+-
+-/** Write samples to an output stream. This function doesn't return until the
+- entire buffer has been consumed - this may involve waiting for the operating
+- system to consume the data.
+-
+- @param stream A pointer to an open stream previously created with Pa_OpenStream.
+-
+- @param buffer A pointer to a buffer of sample frames. The buffer contains
+- samples in the format specified by the outputParameters->sampleFormat field
+- used to open the stream, and the number of channels specified by
+- outputParameters->numChannels. If non-interleaved samples were requested,
+- buffer is a pointer to the first element of an array of non-interleaved
+- buffer pointers, one for each channel.
+-
+- @param frames The number of frames to be written from buffer. This parameter
+- is not constrained to a specific range, however high performance applications
+- will want to match this parameter to the framesPerBuffer parameter used
+- when opening the stream.
+-
+- @return On success PaNoError will be returned, or paOutputUnderflowed if
+- additional output data was inserted after the previous call and before this
+- call.
+-*/
+-PaError Pa_WriteStream( PaStream* stream,
+-                        const void *buffer,
+-                        unsigned long frames );
+-
+-
+-/** Retrieve the number of frames that can be read from the stream without
+- waiting.
+-
+- @return Returns a non-negative value representing the maximum number of frames
+- that can be read from the stream without blocking or busy waiting or, a
+- PaErrorCode (which are always negative) if PortAudio is not initialized or an
+- error is encountered.
+-*/
+-signed long Pa_GetStreamReadAvailable( PaStream* stream );
+-
+-
+-/** Retrieve the number of frames that can be written to the stream without
+- waiting.
+-
+- @return Returns a non-negative value representing the maximum number of frames
+- that can be written to the stream without blocking or busy waiting or, a
+- PaErrorCode (which are always negative) if PortAudio is not initialized or an
+- error is encountered.
+-*/
+-signed long Pa_GetStreamWriteAvailable( PaStream* stream );
+-
+-
+-/* Miscellaneous utilities */
+-
+-
+-/** Retrieve the size of a given sample format in bytes.
+-
+- @return The size in bytes of a single sample in the specified format,
+- or paSampleFormatNotSupported if the format is not supported.
+-*/
+-PaError Pa_GetSampleSize( PaSampleFormat format );
+-
+-
+-/** Put the caller to sleep for at least 'msec' milliseconds. This function is
+- provided only as a convenience for authors of portable code (such as the tests
+- and examples in the PortAudio distribution.)
+-
+- The function may sleep longer than requested so don't rely on this for accurate
+- musical timing.
+-*/
+-void Pa_Sleep( long msec );
+-
+-
+-
+-#ifdef __cplusplus
+-}
+-#endif /* __cplusplus */
+-#endif /* PORTAUDIO_H */
+--- a/src/wave.cpp
++++ b/src/wave.cpp
+@@ -31,7 +31,10 @@
+ #include <sys/time.h>
+ #include <time.h>
+-#include "portaudio.h"
++#ifdef USE_PORTAUDIO
++#include <portaudio.h>
++#endif
++
+ #ifdef PLATFORM_WINDOWS
+ #include <windows.h>
+ #else
+--- a/src/wavegen.cpp
++++ b/src/wavegen.cpp
+@@ -40,7 +40,7 @@
+ #endif
+ #ifdef USE_PORTAUDIO
+-#include "portaudio.h"
++#include <portaudio.h>
+ #undef USE_PORTAUDIO
+ // determine portaudio version by looking for a #define which is not in V18
+ #ifdef paNeverDropInput
diff --git a/sound/forked-daapd/Makefile b/sound/forked-daapd/Makefile
new file mode 100644 (file)
index 0000000..2be205d
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=forked-daapd
+PKG_VERSION:=22.0
+PKG_RELEASE:=20141022
+PKG_REV:=61a4da215c05b621951aa3903d7d390fd1839537
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://github.com/ejurgensen/forked-daapd.git
+PKG_SOURCE_VERSION:=$(PKG_REV)
+
+PKG_BUILD_DEPENDS:=gperf/host
+PKG_FIXUP:=autoreconf
+PKG_USE_MIPS16:=0
+PKG_INSTALL:=1
+
+PKG_MAINTAINER:=Espen Jürgensen <espenjurgensen+openwrt@gmail.com>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/forked-daapd
+SECTION:=sound
+CATEGORY:=Sound
+TITLE:=iTunes (DAAP) server for Apple Remote and AirPlay
+URL:=https://github.com/ejurgensen/forked-daapd
+DEPENDS:=+libgpg-error +libgcrypt +libgdbm +zlib +libexpat +libunistring \
+       +libevent2 +libdaemon +libantlr3c +confuse +glib2 +alsa-lib +libffmpeg-full \
+       +mxml +libavl +avahi-daemon +libavahi-client +sqlite3-cli +libplist +libcurl
+endef
+
+define Package/forked-daapd/conffiles
+/etc/forked-daapd.conf
+endef
+
+CONFIGURE_ARGS += \
+       --enable-itunes \
+       --enable-lastfm
+
+TARGET_CFLAGS += $(FPIC)
+TARGET_LDFLAGS += -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
+
+define Package/forked-daapd/install
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_DATA) ./files/forked-daapd.conf $(1)/etc/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib/forked-daapd
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/forked-daapd/* $(1)/usr/lib/forked-daapd/
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/forked-daapd $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/forked-daapd.init $(1)/etc/init.d/forked-daapd
+endef
+
+$(eval $(call BuildPackage,forked-daapd))
diff --git a/sound/forked-daapd/files/forked-daapd.conf b/sound/forked-daapd/files/forked-daapd.conf
new file mode 100644 (file)
index 0000000..e0b3c0c
--- /dev/null
@@ -0,0 +1,139 @@
+# A quick guide to configuring forked-daapd:
+#
+# For regular use, the most important setting to configure is "directories",
+# which should be the location of your media. Whatever user you have set as
+# "uid" must have read access to this location. Also make sure to add the user.
+# If the location is a network mount, please see the README.
+#
+# In all likelihood, that's all you need to do!
+
+general {
+       # Username
+       uid = "daapd"
+       logfile = "/var/log/forked-daapd.log"
+       # Database location
+       db_path = "/var/run/forked-daapd.db"
+       # Available levels: fatal, log, warning, info, debug, spam
+       loglevel = log
+       # Admin password for the non-existent web interface
+       admin_password = "unused"
+       # Enable/disable IPv6
+       ipv6 = no
+       # Location of DAAP cache
+       daapcache_path = "/var/run/daapcache.db"
+       # DAAP requests that take longer than this threshold (in msec) get their
+       # replies cached for next time. Set to 0 to disable caching.
+#      daapcache_threshold = 1000
+}
+
+# Library configuration
+library {
+       # Name of the library as displayed by the clients
+       # %h: hostname, %v: version
+       name = "My Music on %h"
+       # TCP port to listen on. Default port is 3689 (daap)
+       port = 3689
+       # Password for the library. Optional.
+#      password = ""
+
+       # Directories to index
+       directories = { "/srv/music" }
+
+       # Directories containing podcasts
+       # For each directory that is indexed the path is matched against these
+       # names. If there is a match all items in the directory are marked as 
+       # podcasts. Eg. if you index /srv/music, and your podcasts are in
+       # /srv/music/Podcasts, you can set this to "/Podcasts".
+       # (changing this setting only takes effect after rescan, see the README)
+       podcasts = { "/Podcasts" }
+
+       # Directories containing audiobooks
+       # For each directory that is indexed the path is matched against these
+       # names. If there is a match all items in the directory are marked as 
+       # audiobooks.
+       # (changing this setting only takes effect after rescan, see the README)
+       audiobooks = { "/Audiobooks" }
+
+       # Directories containing compilations (eg soundtracks)
+       # For each directory that is indexed the path is matched against these
+       # names. If there is a match all items in the directory are marked as 
+       # compilations.
+       # (changing this setting only takes effect after rescan, see the README)
+       compilations = { "/Compilations" }
+
+       # Compilations usually have many artists, and if you don't want every
+       # artist to be listed when artist browsing in Remote, you can set
+       # a single name which will be used for all music in the compilation dir
+       # (changing this setting only takes effect after rescan, see the README)
+       compilation_artist = "Various artists"
+
+       # There are 5 default playlists: "Library", "Music", "Movies", "TV Shows"
+       # and "Podcasts". Here you can change the names of these playlists.
+#      name_library    = "Library"
+#      name_music      = "Music"
+#      name_movies     = "Movies"
+#      name_tvshows    = "TV Shows"
+#      name_podcasts   = "Podcasts"
+#      name_audiobooks = "Audiobooks"
+
+       # Artwork file names (without file type extension)
+       # forked-daapd will look for jpg and png files with these base names
+#      artwork_basenames = { "artwork", "cover", "Folder" }
+
+       # File types the scanner should ignore
+       # Non-audio files will never be added to the database, but here you
+       # can prevent the scanner from even probing them. This might improve
+       # scan time. By default .db and .ini are ignored.
+#      filetypes_ignore = { ".db", ".ini" }
+
+       # Disable startup file scanning
+       # When forked-daapd starts it will do an initial file scan of your
+       # library (and then watch it for changes). If you are sure your library
+       # never changes while forked-daapd is not running, you can disable the
+       # initial file scan and save some system ressources. Disabling this scan
+       # may lead to forked-daapd's database coming out of sync with the
+       # library. If that happens read the instructions in the README on how
+       # to trigger a full rescan.
+#      filescan_disable = false
+
+       # Should iTunes metadata override ours?
+#      itunes_overrides = false
+
+       # Formats: mp4a, mp4v, mpeg, alac, flac, mpc, ogg, wma, wmal, wmav, aif, wav
+       # Formats that should never be transcoded
+#      no_transcode = { "alac", "mp4a" }
+       # Formats that should always be transcoded
+#      force_transcode = { "ogg", "flac" }
+}
+
+# Local audio output
+audio {
+       # Name - used in the speaker list in Remote
+       nickname = "OpenWrt"
+       # Audio device name for local audio output
+#      card = "default"
+       # Mixer channel to use for volume control - ALSA/Linux only
+       # If not set, PCM will be used if available, otherwise Master.
+#      mixer = ""
+}
+
+# AirPlay/Airport Express device settings
+# (make sure you get the capitalization of the device name right)
+#airplay "My AirPlay device" {
+       # forked-daapd's volume goes to 11! If that's more than you can handle
+       # you can set a lower value here
+#      max_volume = 11
+       # AirPlay password
+#      password = "s1kr3t"
+#}
+
+# Spotify settings (only have effect if Spotify enabled - see README/INSTALL)
+spotify {
+       # Directory where user settings should be stored (credentials)
+#      settings_dir = "/var/cache/forked-daapd/libspotify"
+       # Cache directory
+#      cache_dir = "/tmp"
+       # Set preferred bitrate for music streaming
+       # 0: No preference (default), 1: 96kbps, 2: 160kbps, 3: 320kbps
+#      bitrate = 0
+}
diff --git a/sound/forked-daapd/files/forked-daapd.init b/sound/forked-daapd/files/forked-daapd.init
new file mode 100644 (file)
index 0000000..3ae38f9
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2014 OpenWrt.org
+
+START=99
+BIN=/usr/sbin/forked-daapd
+PID=/var/run/forked-daapd.pid
+SSD=start-stop-daemon
+
+start() {
+        $SSD -p $PID -S -x $BIN -- -P $PID
+}
+       
+stop() {
+        $SSD -p $PID -K -s SIGINT
+}
diff --git a/sound/forked-daapd/patches/010-include_pregen.patch b/sound/forked-daapd/patches/010-include_pregen.patch
new file mode 100644 (file)
index 0000000..2518dda
--- /dev/null
@@ -0,0 +1,14782 @@
+diff --git a/src/pregen/DAAP.u b/src/pregen/DAAP.u
+new file mode 100644
+index 0000000..3de527b
+--- /dev/null
++++ b/src/pregen/DAAP.u
+@@ -0,0 +1,6 @@
++DAAPParser.c : DAAP.g
++./DAAP.tokens : DAAP.g
++DAAPParser.h : DAAP.g
++DAAPLexer.c : DAAP.g
++DAAPLexer.h : DAAP.g
++ANTLR_PRODUCTS += DAAPParser.c ./DAAP.tokens DAAPParser.h DAAPLexer.c DAAPLexer.h 
+\ No newline at end of file
+diff --git a/src/pregen/DAAP2SQL.c b/src/pregen/DAAP2SQL.c
+new file mode 100644
+index 0000000..3f94589
+--- /dev/null
++++ b/src/pregen/DAAP2SQL.c
+@@ -0,0 +1,929 @@
++/** \file
++ *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
++ *
++ *     -  From the grammar source file : DAAP2SQL.g
++ *     -                            On : 2014-09-30 21:42:43
++ *     -           for the tree parser : DAAP2SQLTreeParser *
++ * Editing it, at least manually, is not wise. 
++ *
++ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
++ *
++ *
++*/
++// [The "BSD licence"]
++// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
++// http://www.temporal-wave.com
++// http://www.linkedin.com/in/jimidle
++//
++// All rights reserved.
++//
++// Redistribution and use in source and binary forms, with or without
++// modification, are permitted provided that the following conditions
++// are met:
++// 1. Redistributions of source code must retain the above copyright
++//    notice, this list of conditions and the following disclaimer.
++// 2. Redistributions in binary form must reproduce the above copyright
++//    notice, this list of conditions and the following disclaimer in the
++//    documentation and/or other materials provided with the distribution.
++// 3. The name of the author may not be used to endorse or promote products
++//    derived from this software without specific prior written permission.
++//
++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++
++/* =============================================================================
++ * This is what the grammar programmer asked us to put at the top of every file.
++ */
++
++      #include <stdio.h>
++      #include <stdlib.h>
++      #include <string.h>
++      #include <limits.h>
++      #include <errno.h>
++
++      #include "logger.h"
++      #include "db.h"
++      #include "daap_query.h"
++
++/* End of Header action.
++ * =============================================================================
++ */
++/* -----------------------------------------
++ * Include the ANTLR3 generated header file.
++ */
++#include    "DAAP2SQL.h"
++/* ----------------------------------------- */
++
++
++
++
++
++/* MACROS that hide the C interface implementations from the
++ * generated code, which makes it a little more understandable to the human eye.
++ * I am very much against using C pre-processor macros for function calls and bits
++ * of code as you cannot see what is happening when single stepping in debuggers
++ * and so on. The exception (in my book at least) is for generated code, where you are
++ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
++ * hides some indirect calls, but is always referring to the input stream. This is
++ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
++ * the runtime interfaces without changing the generated code too often, without
++ * confusing the reader of the generated output, who may not wish to know the gory
++ * details of the interface inheritance.
++ */
++ 
++#define               CTX     ctx
++
++/* Aids in accessing scopes for grammar programmers
++ */
++#undef        SCOPE_TYPE
++#undef        SCOPE_STACK
++#undef        SCOPE_TOP
++#define       SCOPE_TYPE(scope)   pDAAP2SQL_##scope##_SCOPE
++#define SCOPE_STACK(scope)  pDAAP2SQL_##scope##Stack
++#define       SCOPE_TOP(scope)    ctx->pDAAP2SQL_##scope##Top
++#define       SCOPE_SIZE(scope)               ctx->pDAAP2SQL_##scope##Stack_limit
++#define SCOPE_INSTANCE(scope, i)      (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
++
++/* Macros for accessing things in the parser
++ */
++ 
++#undef            PARSER
++#undef            RECOGNIZER              
++#undef            HAVEPARSEDRULE
++#undef            INPUT
++#undef            STRSTREAM
++#undef            HASEXCEPTION
++#undef            EXCEPTION
++#undef            MATCHT
++#undef            MATCHANYT
++#undef            FOLLOWSTACK
++#undef            FOLLOWPUSH
++#undef            FOLLOWPOP
++#undef            PRECOVER
++#undef            PREPORTERROR
++#undef            LA
++#undef            LT
++#undef            CONSTRUCTEX
++#undef            CONSUME
++#undef            MARK
++#undef            REWIND
++#undef            REWINDLAST
++#undef            PERRORRECOVERY
++#undef            HASFAILED
++#undef            FAILEDFLAG
++#undef            RECOVERFROMMISMATCHEDSET
++#undef            RECOVERFROMMISMATCHEDELEMENT
++#undef            BACKTRACKING
++#undef      ADAPTOR
++#undef            RULEMEMO            
++#undef                SEEK    
++#undef                INDEX
++#undef                DBG
++
++#define           PARSER                                                      ctx->pTreeParser  
++#define           RECOGNIZER                                          PARSER->rec
++#define               PSRSTATE                                                RECOGNIZER->state
++#define           HAVEPARSEDRULE(r)                           RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
++#define           INPUT                                                       PARSER->ctnstream
++#define               ISTREAM                                                 INPUT->tnstream->istream
++#define           STRSTREAM                                           INPUT->tnstream
++#define           HASEXCEPTION()                                      (PSRSTATE->error == ANTLR3_TRUE)
++#define           EXCEPTION                                           PSRSTATE->exception
++#define           MATCHT(t, fs)                                       RECOGNIZER->match(RECOGNIZER, t, fs)
++#define           MATCHANYT()                                         RECOGNIZER->matchAny(RECOGNIZER)
++#define           FOLLOWSTACK                                     PSRSTATE->following
++#define           FOLLOWPUSH(x)                                       FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
++#define           FOLLOWPOP()                                         FOLLOWSTACK->pop(FOLLOWSTACK)
++#define           PRECOVER()                                          RECOGNIZER->recover(RECOGNIZER)
++#define           PREPORTERROR()                                      RECOGNIZER->reportError(RECOGNIZER)
++#define           LA(n)                                                       ISTREAM->_LA(ISTREAM, n)
++#define           LT(n)                                                       INPUT->tnstream->_LT(INPUT->tnstream, n)
++#define           CONSTRUCTEX()                                       RECOGNIZER->exConstruct(RECOGNIZER)
++#define           CONSUME()                                           ISTREAM->consume(ISTREAM)
++#define           MARK()                                                      ISTREAM->mark(ISTREAM)
++#define           REWIND(m)                                           ISTREAM->rewind(ISTREAM, m)
++#define           REWINDLAST()                                        ISTREAM->rewindLast(ISTREAM)
++#define           PERRORRECOVERY                                      PSRSTATE->errorRecovery
++#define           FAILEDFLAG                                          PSRSTATE->failed
++#define           HASFAILED()                                         (FAILEDFLAG == ANTLR3_TRUE)
++#define           BACKTRACKING                                        PSRSTATE->backtracking
++#define           RECOVERFROMMISMATCHEDSET(s)         RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
++#define           RECOVERFROMMISMATCHEDELEMENT(e)     RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
++#define     ADAPTOR                         INPUT->adaptor
++#define               RULEMEMO                                                PSRSTATE->ruleMemo
++#define               SEEK(n)                                                 ISTREAM->seek(ISTREAM, n)
++#define               INDEX()                                                 ISTREAM->index(ISTREAM)
++#define               DBG                                                             RECOGNIZER->debugger
++
++
++#define               TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
++
++/* The 4 tokens defined below may well clash with your own #defines or token types. If so
++ * then for the present you must use different names for your defines as these are hard coded
++ * in the code generator. It would be better not to use such names internally, and maybe
++ * we can change this in a forthcoming release. I deliberately do not #undef these
++ * here as this will at least give you a redefined error somewhere if they clash.
++ */
++#define           UP      ANTLR3_TOKEN_UP
++#define           DOWN    ANTLR3_TOKEN_DOWN
++#define           EOR     ANTLR3_TOKEN_EOR
++#define           INVALID ANTLR3_TOKEN_INVALID
++
++
++/* =============================================================================
++ * Functions to create and destroy scopes. First come the rule scopes, followed
++ * by the global declared scopes.
++ */
++
++
++
++/* ============================================================================= */
++
++/* =============================================================================
++ * Start of recognizer
++ */
++
++
++
++/** \brief Table of all token names in symbolic order, mainly used for
++ *         error reporting.
++ */
++pANTLR3_UINT8   DAAP2SQLTokenNames[8+4]
++     = {
++        (pANTLR3_UINT8) "<invalid>",       /* String to print to indicate an invalid token */
++        (pANTLR3_UINT8) "<EOR>",
++        (pANTLR3_UINT8) "<DOWN>", 
++        (pANTLR3_UINT8) "<UP>", 
++        (pANTLR3_UINT8) "NEWLINE",
++        (pANTLR3_UINT8) "OPOR",
++        (pANTLR3_UINT8) "OPAND",
++        (pANTLR3_UINT8) "LPAR",
++        (pANTLR3_UINT8) "RPAR",
++        (pANTLR3_UINT8) "STR",
++        (pANTLR3_UINT8) "QUOTE",
++        (pANTLR3_UINT8) "ESCAPED"
++       };
++
++        
++
++// Forward declare the locally static matching functions we have generated.
++//
++static pANTLR3_STRING query    (pDAAP2SQL ctx);
++static DAAP2SQL_expr_return   expr    (pDAAP2SQL ctx);
++static void   DAAP2SQLFree(pDAAP2SQL ctx);
++/* For use in tree output where we are accumulating rule labels via label += ruleRef
++ * we need a function that knows how to free a return scope when the list is destroyed. 
++ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
++ */
++static        void ANTLR3_CDECL freeScope(void * scope)
++{
++    ANTLR3_FREE(scope);
++}
++
++/** \brief Name of the grammar file that generated this code
++ */
++static const char fileName[] = "DAAP2SQL.g";
++
++/** \brief Return the name of the grammar file that generated this code.
++ */
++static const char * getGrammarFileName()
++{
++      return fileName;
++}
++/** \brief Create a new DAAP2SQL parser and return a context for it.
++ *
++ * \param[in] instream Pointer to an input stream interface.
++ *
++ * \return Pointer to new parser context upon success.
++ */
++ANTLR3_API pDAAP2SQL
++DAAP2SQLNew   (pANTLR3_COMMON_TREE_NODE_STREAM instream)
++{
++      // See if we can create a new parser with the standard constructor
++      //
++      return DAAP2SQLNewSSD(instream, NULL);
++}
++
++/** \brief Create a new DAAP2SQL parser and return a context for it.
++ *
++ * \param[in] instream Pointer to an input stream interface.
++ *
++ * \return Pointer to new parser context upon success.
++ */
++ANTLR3_API pDAAP2SQL
++DAAP2SQLNewSSD   (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
++{
++    pDAAP2SQL ctx;        /* Context structure we will build and return   */
++    
++    ctx       = (pDAAP2SQL) ANTLR3_CALLOC(1, sizeof(DAAP2SQL));
++    
++    if        (ctx == NULL)
++    {
++              // Failed to allocate memory for parser context
++              //
++        return  NULL;
++    }
++    
++    /* -------------------------------------------------------------------
++     * Memory for basic structure is allocated, now to fill in
++     * the base ANTLR3 structures. We initialize the function pointers
++     * for the standard ANTLR3 parser function set, but upon return
++     * from here, the programmer may set the pointers to provide custom
++     * implementations of each function. 
++     *
++     * We don't use the macros defined in DAAP2SQL.h here, in order that you can get a sense
++     * of what goes where.
++     */
++
++    /* Create a base Tree parser/recognizer, using the supplied tree node stream
++     */
++    ctx->pTreeParser          = antlr3TreeParserNewStream(ANTLR3_SIZE_HINT, instream, state);
++    /* Install the implementation of our DAAP2SQL interface
++     */
++    ctx->query        = query;
++    ctx->expr = expr;
++    ctx->free                 = DAAP2SQLFree;
++    ctx->getGrammarFileName   = getGrammarFileName;
++    
++    /* Install the scope pushing methods.
++     */
++
++        
++    
++
++      
++    /* Install the token table
++     */
++    PSRSTATE->tokenNames   = DAAP2SQLTokenNames;
++    
++    
++    /* Return the newly built parser to the caller
++     */
++    return  ctx;
++}
++
++/** Free the parser resources
++ */
++ static void
++ DAAP2SQLFree(pDAAP2SQL ctx)
++ {
++    /* Free any scope memory
++     */
++    
++        
++      // Free this parser
++      //
++    ctx->pTreeParser->free(ctx->pTreeParser);
++    ANTLR3_FREE(ctx);
++
++    /* Everything is released, so we can return
++     */
++    return;
++ }
++ 
++/** Return token names used by this tree parser
++ *
++ * The returned pointer is used as an index into the token names table (using the token 
++ * number as the index).
++ * 
++ * \return Pointer to first char * in the table.
++ */
++static pANTLR3_UINT8    *getTokenNames() 
++{
++        return DAAP2SQLTokenNames; 
++}
++
++
++      struct dmap_query_field_map {
++        char *dmap_field;
++        char *db_col;
++        int as_int;
++      };
++
++      /* gperf static hash, daap_query.gperf */
++      #include "daap_query_hash.c"
++
++    
++/* Declare the bitsets
++ */
++
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_query70  */
++static        ANTLR3_BITWORD FOLLOW_expr_in_query70_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_expr_in_query70     = { FOLLOW_expr_in_query70_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_OPAND_in_expr95  */
++static        ANTLR3_BITWORD FOLLOW_OPAND_in_expr95_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000004) };
++static  ANTLR3_BITSET_LIST FOLLOW_OPAND_in_expr95     = { FOLLOW_OPAND_in_expr95_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr101  */
++static        ANTLR3_BITWORD FOLLOW_expr_in_expr101_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000260) };
++static  ANTLR3_BITSET_LIST FOLLOW_expr_in_expr101     = { FOLLOW_expr_in_expr101_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr107  */
++static        ANTLR3_BITWORD FOLLOW_expr_in_expr107_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000008) };
++static  ANTLR3_BITSET_LIST FOLLOW_expr_in_expr107     = { FOLLOW_expr_in_expr107_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_OPOR_in_expr118  */
++static        ANTLR3_BITWORD FOLLOW_OPOR_in_expr118_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000004) };
++static  ANTLR3_BITSET_LIST FOLLOW_OPOR_in_expr118     = { FOLLOW_OPOR_in_expr118_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr124  */
++static        ANTLR3_BITWORD FOLLOW_expr_in_expr124_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000260) };
++static  ANTLR3_BITSET_LIST FOLLOW_expr_in_expr124     = { FOLLOW_expr_in_expr124_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr130  */
++static        ANTLR3_BITWORD FOLLOW_expr_in_expr130_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000008) };
++static  ANTLR3_BITSET_LIST FOLLOW_expr_in_expr130     = { FOLLOW_expr_in_expr130_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_expr140  */
++static        ANTLR3_BITWORD FOLLOW_STR_in_expr140_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_STR_in_expr140      = { FOLLOW_STR_in_expr140_bits, 1       };
++     
++
++ 
++ 
++/* ==============================================
++ * Parsing rules
++ */
++/** 
++ * $ANTLR start query
++ * DAAP2SQL.g:50:1: query returns [ pANTLR3_STRING result ] : e= expr ;
++ */
++static pANTLR3_STRING
++query(pDAAP2SQL ctx)
++{   
++    pANTLR3_STRING result = NULL;
++
++    DAAP2SQL_expr_return e;
++    #undef    RETURN_TYPE_e
++    #define   RETURN_TYPE_e DAAP2SQL_expr_return
++
++    /* Initialize rule variables
++     */
++
++
++     result= NULL; 
++    {
++        // DAAP2SQL.g:52:2: (e= expr )
++        // DAAP2SQL.g:52:4: e= expr
++        {
++            FOLLOWPUSH(FOLLOW_expr_in_query70);
++            e=expr(ctx);
++
++            FOLLOWPOP();
++            if  (HASEXCEPTION())
++            {
++                goto rulequeryEx;
++            }
++
++            {
++
++                                      if (!e.valid)
++                                      {
++                                              result= NULL;
++                                      }
++                                      else
++                                      {
++                                              result= e.result->factory->newRaw(e.result->factory);
++                                              result->append8(result, "(");
++                                              result->appendS(result, e.result);
++                                              result->append8(result, ")");
++                                      }
++                              
++            }
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto rulequeryEx; /* Prevent compiler warnings */
++    rulequeryEx: ;
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++            }
++
++
++    return result;
++}
++/* $ANTLR end query */
++
++/** 
++ * $ANTLR start expr
++ * DAAP2SQL.g:68:1: expr returns [ pANTLR3_STRING result, int valid ] : ( ^( OPAND a= expr b= expr ) | ^( OPOR a= expr b= expr ) | STR );
++ */
++static DAAP2SQL_expr_return
++expr(pDAAP2SQL ctx)
++{   
++    DAAP2SQL_expr_return retval;
++
++    pANTLR3_BASE_TREE    STR1;
++    DAAP2SQL_expr_return a;
++    #undef    RETURN_TYPE_a
++    #define   RETURN_TYPE_a DAAP2SQL_expr_return
++
++    DAAP2SQL_expr_return b;
++    #undef    RETURN_TYPE_b
++    #define   RETURN_TYPE_b DAAP2SQL_expr_return
++
++    /* Initialize rule variables
++     */
++
++
++     retval.result= NULL; retval.valid= 1; 
++    STR1       = NULL;
++    retval.start = LT(1); retval.stop = retval.start;
++
++    {
++        {
++            //  DAAP2SQL.g:70:2: ( ^( OPAND a= expr b= expr ) | ^( OPOR a= expr b= expr ) | STR )
++            
++            ANTLR3_UINT32 alt1;
++
++            alt1=3;
++
++            switch ( LA(1) ) 
++            {
++            case OPAND:
++              {
++                      alt1=1;
++              }
++                break;
++            case OPOR:
++              {
++                      alt1=2;
++              }
++                break;
++            case STR:
++              {
++                      alt1=3;
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 1;
++                EXCEPTION->state        = 0;
++
++
++                goto ruleexprEx;
++            }
++
++            switch (alt1) 
++            {
++              case 1:
++                  // DAAP2SQL.g:70:4: ^( OPAND a= expr b= expr )
++                  {
++                       MATCHT(OPAND, &FOLLOW_OPAND_in_expr95); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_expr_in_expr101);
++                      a=expr(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_expr_in_expr107);
++                      b=expr(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      {
++
++                                              if (!a.valid || !b.valid)
++                                              {
++                                                      retval.valid= 0;
++                                              }
++                                              else
++                                              {
++                                                      retval.result= a.result->factory->newRaw(a.result->factory);
++                                                      retval.result->append8(retval.result, "(");
++                                                      retval.result->appendS(retval.result, a.result);
++                                                      retval.result->append8(retval.result, " AND ");
++                                                      retval.result->appendS(retval.result, b.result);
++                                                      retval.result->append8(retval.result, ")");
++                                              }
++                                      
++                      }
++
++                  }
++                  break;
++              case 2:
++                  // DAAP2SQL.g:86:4: ^( OPOR a= expr b= expr )
++                  {
++                       MATCHT(OPOR, &FOLLOW_OPOR_in_expr118); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_expr_in_expr124);
++                      a=expr(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_expr_in_expr130);
++                      b=expr(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      {
++
++                                              if (!a.valid || !b.valid)
++                                              {
++                                                      retval.valid= 0;
++                                              }
++                                              else
++                                              {
++                                                      retval.result= a.result->factory->newRaw(a.result->factory);
++                                                      retval.result->append8(retval.result, "(");
++                                                      retval.result->appendS(retval.result, a.result);
++                                                      retval.result->append8(retval.result, " OR ");
++                                                      retval.result->appendS(retval.result, b.result);
++                                                      retval.result->append8(retval.result, ")");
++                                              }
++                                      
++                      }
++
++                  }
++                  break;
++              case 3:
++                  // DAAP2SQL.g:102:4: STR
++                  {
++                      STR1 = (pANTLR3_BASE_TREE) MATCHT(STR, &FOLLOW_STR_in_expr140); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      {
++
++                                              pANTLR3_STRING str;
++                                              pANTLR3_UINT8 field;
++                                              pANTLR3_UINT8 val;
++                                              pANTLR3_UINT8 escaped;
++                                              ANTLR3_UINT8 op;
++                                              int neg_op;
++                                              const struct dmap_query_field_map *dqfm;
++                                              char *end;
++                                              long long llval;
++
++                                              escaped = NULL;
++
++                                              retval.result= (STR1->getText(STR1))->factory->newRaw((STR1->getText(STR1))->factory);
++
++                                              str = (STR1->getText(STR1))->toUTF8((STR1->getText(STR1)));
++
++                                              /* NOTE: the lexer delivers the string without quotes
++                                              which may not be obvious from the grammar due to embedded code
++                                              */
++
++                                              /* Make daap.songalbumid:0 a no-op */
++                                              if (strcmp((char *)str->chars, "daap.songalbumid:0") == 0)
++                                              {
++                                                      retval.result->append8(retval.result, "1 = 1");
++
++                                                      goto STR_out;
++                                              }
++
++                                              field = str->chars;
++
++                                              val = field;
++                                              while ((*val != '\0') && ((*val == '.')
++                                                      || (*val == '-')
++                                                      || ((*val >= 'a') && (*val <= 'z'))
++                                                      || ((*val >= 'A') && (*val <= 'Z'))
++                                                      || ((*val >= '0') && (*val <= '9'))))
++                                              {
++                                                      val++;
++                                              }
++
++                                              if (*field == '\0')
++                                              {
++                                                      DPRINTF(E_LOG, L_DAAP, "No field name found in clause '%s'\n", field);
++                                                      retval.valid= 0;
++                                                      goto STR_result_valid_0; /* ABORT */
++                                              }
++
++                                              if (*val == '\0')
++                                              {
++                                                      DPRINTF(E_LOG, L_DAAP, "No operator found in clause '%s'\n", field);
++                                                      retval.valid= 0;
++                                                      goto STR_result_valid_0; /* ABORT */
++                                              }
++
++                                              op = *val;
++                                              *val = '\0';
++                                              val++;
++
++                                              if (op == '!')
++                                              {
++                                                      if (*val == '\0')
++                                                      {
++                                                              DPRINTF(E_LOG, L_DAAP, "Negation found but operator missing in clause '%s%c'\n", field, op);
++                                                              retval.valid= 0;
++                                                              goto STR_result_valid_0; /* ABORT */
++                                                      }
++
++                                                      neg_op = 1;
++                                                      op = *val;
++                                                      val++;
++                                              }
++                                              else
++                                                      neg_op = 0;
++
++                                              /* Lookup DMAP field in the query field map */
++                                              dqfm = daap_query_field_lookup((char *)field, strlen((char *)field));
++                                              if (!dqfm)
++                                              {
++                                                      DPRINTF(E_LOG, L_DAAP, "DMAP field '%s' is not a valid field in queries\n", field);
++                                                      retval.valid= 0;
++                                                      goto STR_result_valid_0; /* ABORT */
++                                              }
++
++                                              /* Empty values OK for string fields, NOK for integer */
++                                              if (*val == '\0')
++                                              {
++                                                      if (dqfm->as_int)
++                                                      {
++                                                              DPRINTF(E_LOG, L_DAAP, "No value given in clause '%s%s%c'\n", field, (neg_op) ? "!" : "", op);
++                                                              retval.valid= 0;
++                                                              goto STR_result_valid_0; /* ABORT */
++                                                      }
++
++                                                      /* Need to check against NULL too */
++                                                      if (op == ':')
++                                                              retval.result->append8(retval.result, "(");
++                                              }
++
++                                              retval.result->append8(retval.result, dqfm->db_col);
++
++                                              /* Int field: check integer conversion */
++                                              if (dqfm->as_int)
++                                              {
++                                                      errno = 0;
++                                                      llval = strtoll((const char *)val, &end, 10);
++
++                                                      if (((errno == ERANGE) && ((llval == LLONG_MAX) || (llval == LLONG_MIN)))
++                                                              || ((errno != 0) && (llval == 0)))
++                                                      {
++                                                              DPRINTF(E_LOG, L_DAAP, "Value '%s' in clause '%s%s%c%s' does not convert to an integer type\n",
++                                                              val, field, (neg_op) ? "!" : "", op, val);
++                                                              retval.valid= 0;
++                                                              goto STR_result_valid_0; /* ABORT */
++                                                      }
++
++                                                      if (end == (char *)val)
++                                                      {
++                                                              DPRINTF(E_LOG, L_DAAP, "Value '%s' in clause '%s%s%c%s' does not represent an integer value\n",
++                                                              val, field, (neg_op) ? "!" : "", op, val);
++                                                              retval.valid= 0;
++                                                              goto STR_result_valid_0; /* ABORT */
++                                                      }
++
++                                                      *end = '\0'; /* Cut out potential garbage - we're being kind */
++                                              }
++                                              /* String field: escape string, check for '*' */
++                                              else
++                                              {
++                                                      if (op != ':')
++                                                      {
++                                                              DPRINTF(E_LOG, L_DAAP, "Operation '%c' not valid for string values\n", op);
++                                                              retval.valid= 0;
++                                                              goto STR_result_valid_0; /* ABORT */
++                                                      }
++
++                                                      escaped = (pANTLR3_UINT8)db_escape_string((char *)val);
++                                                      if (!escaped)
++                                                      {
++                                                              DPRINTF(E_LOG, L_DAAP, "Could not escape value\n");
++                                                              retval.valid= 0;
++                                                              goto STR_result_valid_0; /* ABORT */
++                                                      }
++
++                                                      val = escaped;
++
++                                                      if (val[0] == '*')
++                                                      {
++                                                              op = '%';
++                                                              val[0] = '%';
++                                                      }
++
++                                                      if (val[strlen((char *)val) - 1] == '*')
++                                                      {
++                                                              op = '%';
++                                                              val[strlen((char *)val) - 1] = '%';
++                                                      }
++                                              }
++
++                                              switch(op)
++                                              {
++                                                      case ':':
++                                                              if (neg_op)
++                                                                      retval.result->append8(retval.result, " <> ");
++                                                              else
++                                                                      retval.result->append8(retval.result, " = ");
++                                                              break;
++
++                                                      case '+':
++                                                              if (neg_op)
++                                                                      retval.result->append8(retval.result, " <= ");
++                                                              else
++                                                                      retval.result->append8(retval.result, " > ");
++                                                              break;
++
++                                                      case '-':
++                                                              if (neg_op)
++                                                                      retval.result->append8(retval.result, " >= ");
++                                                              else
++                                                                      retval.result->append8(retval.result, " < ");
++                                                              break;
++
++                                                      case '%':
++                                                              retval.result->append8(retval.result, " LIKE ");
++                                                              break;
++
++                                                      default:
++                                                              if (neg_op)
++                                                                      DPRINTF(E_LOG, L_DAAP, "Missing or unknown operator '%c' in clause '%s!%c%s'\n", op, field, op, val);
++                                                              else
++                                                                      DPRINTF(E_LOG, L_DAAP, "Unknown operator '%c' in clause '%s%c%s'\n", op, field, op, val);
++                                                              retval.valid= 0;
++                                                              goto STR_result_valid_0; /* ABORT */
++                                                              break;
++                                              }
++
++                                              if (!dqfm->as_int)
++                                                      retval.result->append8(retval.result, "'");
++                              
++                                              retval.result->append8(retval.result, (const char *)val);
++                              
++                                              if (!dqfm->as_int)
++                                                      retval.result->append8(retval.result, "'");
++
++                                              /* For empty string value, we need to check against NULL too */
++                                              if ((*val == '\0') && (op == ':'))
++                                              {
++                                                      if (neg_op)
++                                                              retval.result->append8(retval.result, " AND ");
++                                                      else
++                                                              retval.result->append8(retval.result, " OR ");
++
++                                                      retval.result->append8(retval.result, dqfm->db_col);
++
++                                                      if (neg_op)
++                                                              retval.result->append8(retval.result, " IS NOT NULL");
++                                                      else
++                                                              retval.result->append8(retval.result, " IS NULL");
++
++                                                      retval.result->append8(retval.result, ")");
++                                              }
++
++                                              STR_result_valid_0: /* bail out label */
++                                                      ;
++
++                                              if (escaped)
++                                                      free(escaped);
++
++                                              STR_out: /* get out of here */
++                                                      ;
++                                      
++                      }
++
++                  }
++                  break;
++
++            }
++        }
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruleexprEx; /* Prevent compiler warnings */
++    ruleexprEx: ;
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++            }
++
++
++    return retval;
++}
++/* $ANTLR end expr */
++/* End of parsing rules
++ * ==============================================
++ */
++
++/* ==============================================
++ * Syntactic predicates
++ */
++/* End of syntactic predicates
++ * ==============================================
++ */
++
++ 
++ 
++
++
++
++/* End of code
++ * =============================================================================
++ */
+diff --git a/src/pregen/DAAP2SQL.h b/src/pregen/DAAP2SQL.h
+new file mode 100644
+index 0000000..e170f6c
+--- /dev/null
++++ b/src/pregen/DAAP2SQL.h
+@@ -0,0 +1,195 @@
++/** \file
++ *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
++ *
++ *     -  From the grammar source file : DAAP2SQL.g
++ *     -                            On : 2014-09-30 21:42:43
++ *     -           for the tree parser : DAAP2SQLTreeParser *
++ * Editing it, at least manually, is not wise. 
++ *
++ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
++ *
++ *
++ * The tree parser DAAP2SQL has the callable functions (rules) shown below,
++ * which will invoke the code for the associated rule in the source grammar
++ * assuming that the input stream is pointing to a token/text stream that could begin
++ * this rule.
++ * 
++ * For instance if you call the first (topmost) rule in a parser grammar, you will
++ * get the results of a full parse, but calling a rule half way through the grammar will
++ * allow you to pass part of a full token stream to the parser, such as for syntax checking
++ * in editors and so on.
++ *
++ * The parser entry points are called indirectly (by function pointer to function) via
++ * a parser context typedef pDAAP2SQL, which is returned from a call to DAAP2SQLNew().
++ *
++ * The methods in pDAAP2SQL are  as follows:
++ *
++ *  - pANTLR3_STRING      pDAAP2SQL->query(pDAAP2SQL)
++ *  - DAAP2SQL_expr_return      pDAAP2SQL->expr(pDAAP2SQL)
++ *
++ * The return type for any particular rule is of course determined by the source
++ * grammar file.
++ */
++// [The "BSD licence"]
++// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
++// http://www.temporal-wave.com
++// http://www.linkedin.com/in/jimidle
++//
++// All rights reserved.
++//
++// Redistribution and use in source and binary forms, with or without
++// modification, are permitted provided that the following conditions
++// are met:
++// 1. Redistributions of source code must retain the above copyright
++//    notice, this list of conditions and the following disclaimer.
++// 2. Redistributions in binary form must reproduce the above copyright
++//    notice, this list of conditions and the following disclaimer in the
++//    documentation and/or other materials provided with the distribution.
++// 3. The name of the author may not be used to endorse or promote products
++//    derived from this software without specific prior written permission.
++//
++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++#ifndef       _DAAP2SQL_H
++#define _DAAP2SQL_H
++/* =============================================================================
++ * Standard antlr3 C runtime definitions
++ */
++#include    <antlr3.h>
++
++/* End of standard antlr 3 runtime definitions
++ * =============================================================================
++ */
++ 
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++// Forward declare the context typedef so that we can use it before it is
++// properly defined. Delegators and delegates (from import statements) are
++// interdependent and their context structures contain pointers to each other
++// C only allows such things to be declared if you pre-declare the typedef.
++//
++typedef struct DAAP2SQL_Ctx_struct DAAP2SQL, * pDAAP2SQL;
++
++
++
++      #include <stdio.h>
++      #include <stdlib.h>
++      #include <string.h>
++      #include <limits.h>
++      #include <errno.h>
++
++      #include "logger.h"
++      #include "db.h"
++      #include "daap_query.h"
++
++
++#ifdef        ANTLR3_WINDOWS
++// Disable: Unreferenced parameter,                                                   - Rules with parameters that are not used
++//          constant conditional,                                                     - ANTLR realizes that a prediction is always true (synpred usually)
++//          initialized but unused variable                                   - tree rewrite variables declared but not needed
++//          Unreferenced local variable                                               - lexer rule declares but does not always use _type
++//          potentially unitialized variable used                     - retval always returned from a rule 
++//                    unreferenced local function has been removed    - susually getTokenNames or freeScope, they can go without warnigns
++//
++// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
++// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
++// usually generated when a parser rule is given a parameter that it does not use. Mostly though
++// this is a matter of orthogonality hence I disable that one.
++//
++#pragma warning( disable : 4100 )
++#pragma warning( disable : 4101 )
++#pragma warning( disable : 4127 )
++#pragma warning( disable : 4189 )
++#pragma warning( disable : 4505 )
++#pragma warning( disable : 4701 )
++#endif
++typedef struct DAAP2SQL_expr_return_struct
++{
++    pANTLR3_BASE_TREE       start;
++    pANTLR3_BASE_TREE       stop;   
++    pANTLR3_STRING result;
++    int valid;
++}
++    DAAP2SQL_expr_return;
++
++
++
++/** Context tracking structure for DAAP2SQL
++ */
++struct DAAP2SQL_Ctx_struct
++{
++    /** Built in ANTLR3 context tracker contains all the generic elements
++     *  required for context tracking.
++     */
++    pANTLR3_TREE_PARSER           pTreeParser;
++
++
++     pANTLR3_STRING (*query)  (struct DAAP2SQL_Ctx_struct * ctx);
++     DAAP2SQL_expr_return (*expr)     (struct DAAP2SQL_Ctx_struct * ctx);
++    // Delegated rules
++    const char * (*getGrammarFileName)();
++    void          (*free)   (struct DAAP2SQL_Ctx_struct * ctx);
++        
++};
++
++// Function protoypes for the constructor functions that external translation units
++// such as delegators and delegates may wish to call.
++//
++ANTLR3_API pDAAP2SQL DAAP2SQLNew         (pANTLR3_COMMON_TREE_NODE_STREAM instream);
++ANTLR3_API pDAAP2SQL DAAP2SQLNewSSD      (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
++
++/** Symbolic definitions of all the tokens that the tree parser will work with.
++ * \{
++ *
++ * Antlr will define EOF, but we can't use that as it it is too common in
++ * in C header files and that would be confusing. There is no way to filter this out at the moment
++ * so we just undef it here for now. That isn't the value we get back from C recognizers
++ * anyway. We are looking for ANTLR3_TOKEN_EOF.
++ */
++#ifdef        EOF
++#undef        EOF
++#endif
++#ifdef        Tokens
++#undef        Tokens
++#endif 
++#define STR      9
++#define QUOTE      10
++#define NEWLINE      4
++#define LPAR      7
++#define OPOR      5
++#define RPAR      8
++#define ESCAPED      11
++#define OPAND      6
++#define EOF      -1
++#ifdef        EOF
++#undef        EOF
++#define       EOF     ANTLR3_TOKEN_EOF
++#endif
++
++#ifndef TOKENSOURCE
++#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
++#endif
++
++/* End of token definitions for DAAP2SQL
++ * =============================================================================
++ */
++/** \} */
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
++
++/* END - Note:Keep extra line feed to satisfy UNIX systems */
+diff --git a/src/pregen/DAAP2SQL.u b/src/pregen/DAAP2SQL.u
+new file mode 100644
+index 0000000..385d80b
+--- /dev/null
++++ b/src/pregen/DAAP2SQL.u
+@@ -0,0 +1,5 @@
++DAAP2SQL.g: DAAP.tokens
++DAAP2SQL.c : DAAP2SQL.g
++./DAAP2SQL.tokens : DAAP2SQL.g
++DAAP2SQL.h : DAAP2SQL.g
++ANTLR_PRODUCTS += DAAP2SQL.c ./DAAP2SQL.tokens DAAP2SQL.h 
+\ No newline at end of file
+diff --git a/src/pregen/DAAPLexer.c b/src/pregen/DAAPLexer.c
+new file mode 100644
+index 0000000..12e7ef3
+--- /dev/null
++++ b/src/pregen/DAAPLexer.c
+@@ -0,0 +1,1101 @@
++/** \file
++ *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
++ *
++ *     -  From the grammar source file : DAAP.g
++ *     -                            On : 2014-09-30 21:42:40
++ *     -                 for the lexer : DAAPLexerLexer *
++ * Editing it, at least manually, is not wise. 
++ *
++ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
++ *
++ *
++*/
++// [The "BSD licence"]
++// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
++// http://www.temporal-wave.com
++// http://www.linkedin.com/in/jimidle
++//
++// All rights reserved.
++//
++// Redistribution and use in source and binary forms, with or without
++// modification, are permitted provided that the following conditions
++// are met:
++// 1. Redistributions of source code must retain the above copyright
++//    notice, this list of conditions and the following disclaimer.
++// 2. Redistributions in binary form must reproduce the above copyright
++//    notice, this list of conditions and the following disclaimer in the
++//    documentation and/or other materials provided with the distribution.
++// 3. The name of the author may not be used to endorse or promote products
++//    derived from this software without specific prior written permission.
++//
++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++/* -----------------------------------------
++ * Include the ANTLR3 generated header file.
++ */
++#include    "DAAPLexer.h"
++/* ----------------------------------------- */
++
++
++
++
++
++/* MACROS that hide the C interface implementations from the
++ * generated code, which makes it a little more understandable to the human eye.
++ * I am very much against using C pre-processor macros for function calls and bits
++ * of code as you cannot see what is happening when single stepping in debuggers
++ * and so on. The exception (in my book at least) is for generated code, where you are
++ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
++ * hides some indirect calls, but is always referring to the input stream. This is
++ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
++ * the runtime interfaces without changing the generated code too often, without
++ * confusing the reader of the generated output, who may not wish to know the gory
++ * details of the interface inheritance.
++ */
++ 
++#define               CTX     ctx
++
++/* Aids in accessing scopes for grammar programmers
++ */
++#undef        SCOPE_TYPE
++#undef        SCOPE_STACK
++#undef        SCOPE_TOP
++#define       SCOPE_TYPE(scope)   pDAAPLexer_##scope##_SCOPE
++#define SCOPE_STACK(scope)  pDAAPLexer_##scope##Stack
++#define       SCOPE_TOP(scope)    ctx->pDAAPLexer_##scope##Top
++#define       SCOPE_SIZE(scope)               ctx->pDAAPLexer_##scope##Stack_limit
++#define SCOPE_INSTANCE(scope, i)      (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
++
++ 
++/* Macros for accessing things in a lexer
++ */
++#undef            LEXER
++#undef            RECOGNIZER              
++#undef            RULEMEMO                
++#undef            GETCHARINDEX
++#undef            GETLINE
++#undef            GETCHARPOSITIONINLINE
++#undef            EMIT
++#undef            EMITNEW
++#undef            MATCHC
++#undef            MATCHS
++#undef            MATCHRANGE
++#undef            LTOKEN
++#undef            HASFAILED
++#undef            FAILEDFLAG
++#undef            INPUT
++#undef            STRSTREAM
++#undef            LA
++#undef            HASEXCEPTION
++#undef            EXCEPTION
++#undef            CONSTRUCTEX
++#undef            CONSUME
++#undef            LRECOVER
++#undef            MARK
++#undef            REWIND
++#undef            REWINDLAST
++#undef            BACKTRACKING
++#undef                MATCHANY
++#undef                MEMOIZE
++#undef                HAVEPARSEDRULE
++#undef                GETTEXT
++#undef                INDEX
++#undef                SEEK
++#undef                PUSHSTREAM
++#undef                POPSTREAM
++#undef                SETTEXT
++#undef                SETTEXT8
++
++#define           LEXER                                       ctx->pLexer
++#define           RECOGNIZER                      LEXER->rec
++#define               LEXSTATE                                RECOGNIZER->state
++#define               TOKSOURCE                               LEXSTATE->tokSource
++#define           GETCHARINDEX()                      LEXER->getCharIndex(LEXER)
++#define           GETLINE()                           LEXER->getLine(LEXER)
++#define           GETTEXT()                           LEXER->getText(LEXER)
++#define           GETCHARPOSITIONINLINE() LEXER->getCharPositionInLine(LEXER)
++#define           EMIT()                                      LEXSTATE->type = _type; LEXER->emit(LEXER)
++#define           EMITNEW(t)                          LEXER->emitNew(LEXER, t)
++#define           MATCHC(c)                           LEXER->matchc(LEXER, c)
++#define           MATCHS(s)                           LEXER->matchs(LEXER, s)
++#define           MATCHRANGE(c1,c2)       LEXER->matchRange(LEXER, c1, c2)
++#define           MATCHANY()                          LEXER->matchAny(LEXER)
++#define           LTOKEN                              LEXSTATE->token
++#define           HASFAILED()                         (LEXSTATE->failed == ANTLR3_TRUE)
++#define           BACKTRACKING                        LEXSTATE->backtracking
++#define           FAILEDFLAG                          LEXSTATE->failed
++#define           INPUT                                       LEXER->input
++#define           STRSTREAM                           INPUT
++#define               ISTREAM                                 INPUT->istream
++#define               INDEX()                                 ISTREAM->index(ISTREAM)
++#define               SEEK(n)                                 ISTREAM->seek(ISTREAM, n)
++#define           EOF_TOKEN                           &(LEXSTATE->tokSource->eofToken)
++#define           HASEXCEPTION()                      (LEXSTATE->error == ANTLR3_TRUE)
++#define           EXCEPTION                           LEXSTATE->exception
++#define           CONSTRUCTEX()                       RECOGNIZER->exConstruct(RECOGNIZER)
++#define           LRECOVER()                          LEXER->recover(LEXER)
++#define           MARK()                                      ISTREAM->mark(ISTREAM)
++#define           REWIND(m)                           ISTREAM->rewind(ISTREAM, m)
++#define           REWINDLAST()                        ISTREAM->rewindLast(ISTREAM)
++#define               MEMOIZE(ri,si)                  RECOGNIZER->memoize(RECOGNIZER, ri, si)
++#define               HAVEPARSEDRULE(r)               RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
++#define               PUSHSTREAM(str)                 LEXER->pushCharStream(LEXER, str)
++#define               POPSTREAM()                             LEXER->popCharStream(LEXER)
++#define               SETTEXT(str)                    LEXSTATE->text = str
++#define               SKIP()                                  LEXSTATE->token = &(TOKSOURCE->skipToken)
++#define               USER1                                   LEXSTATE->user1
++#define               USER2                                   LEXSTATE->user2
++#define               USER3                                   LEXSTATE->user3
++#define               CUSTOM                                  LEXSTATE->custom
++#define               RULEMEMO                                LEXSTATE->ruleMemo
++#define               DBG                                             RECOGNIZER->debugger
++
++/* If we have been told we can rely on the standard 8 bit or 16 bit input
++ * stream, then we can define our macros to use the direct pointers
++ * in the input object, which is much faster than indirect calls. This
++ * is really only significant to lexers with a lot of fragment rules (which
++ * do not place LA(1) in a temporary at the moment) and even then
++ * only if there is a lot of input (order of say 1M or so).
++ */
++#if   defined(ANTLR3_INLINE_INPUT_ASCII) || defined(ANTLR3_INLINE_INPUT_UTF16)
++
++# ifdef       ANTLR3_INLINE_INPUT_ASCII
++
++/* 8 bit "ASCII" (actually any 8 bit character set) */
++
++#  define         NEXTCHAR                    ((pANTLR3_UINT8)(INPUT->nextChar))
++#  define         DATAP                               ((pANTLR3_UINT8)(INPUT->data))
++
++# else
++
++#  define         NEXTCHAR                    ((pANTLR3_UINT16)(INPUT->nextChar)) 
++#  define         DATAP                               ((pANTLR3_UINT16)(INPUT->data))
++
++# endif
++
++# define          LA(n) ((NEXTCHAR + n) > (DATAP + INPUT->sizeBuf) ? ANTLR3_CHARSTREAM_EOF : (ANTLR3_UCHAR)(*(NEXTCHAR + n - 1)))
++# define          CONSUME()                                                                                   \
++{                                                                                                                                     \
++    if        (NEXTCHAR < (DATAP + INPUT->sizeBuf))                                           \
++    {                                                                                                                         \
++              INPUT->charPositionInLine++;                                                            \
++              if  ((ANTLR3_UCHAR)(*NEXTCHAR) == INPUT->newlineChar)           \
++              {                                                                                                                       \
++                      INPUT->line++;                                                                                  \
++                      INPUT->charPositionInLine       = 0;                                            \
++                      INPUT->currentLine              = (void *)(NEXTCHAR + 1);               \
++              }                                                                                                                       \
++              INPUT->nextChar = (void *)(NEXTCHAR + 1);                                       \
++    }                                                                                                                         \
++}
++
++#else
++
++// Pick up the input character by calling the input stream implementation.
++//
++#define           CONSUME()                           INPUT->istream->consume(INPUT->istream)
++#define           LA(n)                                       INPUT->istream->_LA(INPUT->istream, n)
++
++#endif
++#define               TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
++
++/* The 4 tokens defined below may well clash with your own #defines or token types. If so
++ * then for the present you must use different names for your defines as these are hard coded
++ * in the code generator. It would be better not to use such names internally, and maybe
++ * we can change this in a forthcoming release. I deliberately do not #undef these
++ * here as this will at least give you a redefined error somewhere if they clash.
++ */
++#define           UP      ANTLR3_TOKEN_UP
++#define           DOWN    ANTLR3_TOKEN_DOWN
++#define           EOR     ANTLR3_TOKEN_EOR
++#define           INVALID ANTLR3_TOKEN_INVALID
++
++
++/* =============================================================================
++ * Functions to create and destroy scopes. First come the rule scopes, followed
++ * by the global declared scopes.
++ */
++
++
++
++/* ============================================================================= */
++
++/* =============================================================================
++ * Start of recognizer
++ */
++
++
++/* Forward declare the locally static matching functions we have generated and any predicate functions.
++ */
++static ANTLR3_INLINE  void    mQUOTE    (pDAAPLexer ctx);
++static ANTLR3_INLINE  void    mLPAR    (pDAAPLexer ctx);
++static ANTLR3_INLINE  void    mRPAR    (pDAAPLexer ctx);
++static ANTLR3_INLINE  void    mOPAND    (pDAAPLexer ctx);
++static ANTLR3_INLINE  void    mOPOR    (pDAAPLexer ctx);
++static ANTLR3_INLINE  void    mNEWLINE    (pDAAPLexer ctx);
++static ANTLR3_INLINE  void    mSTR    (pDAAPLexer ctx);
++static ANTLR3_INLINE  void    mESCAPED    (pDAAPLexer ctx);
++static ANTLR3_INLINE  void    mTokens    (pDAAPLexer ctx);
++static void   DAAPLexerFree(pDAAPLexer ctx);
++
++/* =========================================================================
++ * Lexer matching rules end.
++ * =========================================================================
++ */
++
++
++
++static void
++DAAPLexerFree  (pDAAPLexer ctx)
++{
++    LEXER->free(LEXER);
++    
++    ANTLR3_FREE(ctx);
++}
++
++/** \brief Name of the grammar file that generated this code
++ */
++static const char fileName[] = "DAAP.g";
++
++/** \brief Return the name of the grammar file that generated this code.
++ */
++static const char * getGrammarFileName()
++{
++      return fileName;
++}
++
++/** \brief Create a new lexer called DAAPLexer
++ *
++ * \param[in]    instream Pointer to an initialized input stream
++ * \return 
++ *     - Success pDAAPLexer initialized for the lex start
++ *     - Fail NULL
++ */
++ANTLR3_API pDAAPLexer DAAPLexerNew         
++(pANTLR3_INPUT_STREAM instream)
++{
++      // See if we can create a new lexer with the standard constructor
++      //
++      return DAAPLexerNewSSD(instream, NULL);
++}
++
++/** \brief Create a new lexer called DAAPLexer
++ *
++ * \param[in]    instream Pointer to an initialized input stream
++ * \param[state] state Previously created shared recognizer stat
++ * \return 
++ *     - Success pDAAPLexer initialized for the lex start
++ *     - Fail NULL
++ */
++ANTLR3_API pDAAPLexer DAAPLexerNewSSD         
++(pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
++{
++    pDAAPLexer ctx; // Context structure we will build and return
++
++    ctx = (pDAAPLexer) ANTLR3_CALLOC(1, sizeof(DAAPLexer));
++
++    if  (ctx == NULL)
++    {
++        // Failed to allocate memory for lexer context
++        return  NULL;
++    }
++
++    /* -------------------------------------------------------------------
++     * Memory for basic structure is allocated, now to fill in
++     * in base ANTLR3 structures. We initialize the function pointers
++     * for the standard ANTLR3 lexer function set, but upon return
++     * from here, the programmer may set the pointers to provide custom
++     * implementations of each function. 
++     *
++     * We don't use the macros defined in DAAPLexer.h here so you can get a sense
++     * of what goes where.
++     */
++    
++    /* Create a base lexer, using the supplied input stream
++     */
++    ctx->pLexer       = antlr3LexerNewStream(ANTLR3_SIZE_HINT, instream, state);
++    
++    /* Check that we allocated the memory correctly
++     */
++    if        (ctx->pLexer == NULL)
++    {
++              ANTLR3_FREE(ctx);
++              return  NULL;
++    }
++    /* Install the implementation of our DAAPLexer interface
++     */
++    ctx->mQUOTE       = mQUOTE;
++    ctx->mLPAR        = mLPAR;
++    ctx->mRPAR        = mRPAR;
++    ctx->mOPAND       = mOPAND;
++    ctx->mOPOR        = mOPOR;
++    ctx->mNEWLINE     = mNEWLINE;
++    ctx->mSTR = mSTR;
++    ctx->mESCAPED     = mESCAPED;
++    ctx->mTokens      = mTokens;
++    
++    /** When the nextToken() call is made to this lexer's pANTLR3_TOKEN_SOURCE
++     *  it will call mTokens() in this generated code, and will pass it the ctx
++     * pointer of this lexer, not the context of the base lexer, so store that now.
++     */
++    ctx->pLexer->ctx      = ctx;
++    
++    /**Install the token matching function
++     */
++    ctx->pLexer->mTokens = (void (*) (void *))(mTokens);
++    
++    ctx->getGrammarFileName   = getGrammarFileName;
++    ctx->free         = DAAPLexerFree;
++
++    
++    
++
++
++    /* Return the newly built lexer to the caller
++     */
++    return  ctx;
++}
++ 
++
++/* =========================================================================
++ * Functions to match the lexer grammar defined tokens from the input stream
++ */
++
++//   Comes from: 40:7: ( '\\'' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start QUOTE
++ *
++ * Looks to match the characters the constitute the token QUOTE
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mQUOTE(pDAAPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = QUOTE;
++       
++    
++    // DAAP.g:40:7: ( '\\'' )
++    // DAAP.g:40:9: '\\''
++    {
++        MATCHC('\''); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleQUOTEEx;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleQUOTEEx; /* Prevent compiler warnings */
++    ruleQUOTEEx: ;
++
++}
++// $ANTLR end QUOTE
++
++//   Comes from: 41:6: ( '(' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start LPAR
++ *
++ * Looks to match the characters the constitute the token LPAR
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mLPAR(pDAAPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = LPAR;
++       
++    
++    // DAAP.g:41:6: ( '(' )
++    // DAAP.g:41:8: '('
++    {
++        MATCHC('('); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleLPAREx;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleLPAREx; /* Prevent compiler warnings */
++    ruleLPAREx: ;
++
++}
++// $ANTLR end LPAR
++
++//   Comes from: 42:6: ( ')' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start RPAR
++ *
++ * Looks to match the characters the constitute the token RPAR
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mRPAR(pDAAPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = RPAR;
++       
++    
++    // DAAP.g:42:6: ( ')' )
++    // DAAP.g:42:8: ')'
++    {
++        MATCHC(')'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleRPAREx;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleRPAREx; /* Prevent compiler warnings */
++    ruleRPAREx: ;
++
++}
++// $ANTLR end RPAR
++
++//   Comes from: 44:7: ( '+' | ' ' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start OPAND
++ *
++ * Looks to match the characters the constitute the token OPAND
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mOPAND(pDAAPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = OPAND;
++       
++    
++    // DAAP.g:44:7: ( '+' | ' ' )
++    // DAAP.g:
++    {
++        if ( LA(1) == ' ' || LA(1) == '+' )
++        {
++            CONSUME();
++
++        }
++        else 
++        {
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
++            EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
++
++            LRECOVER();    goto ruleOPANDEx;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleOPANDEx; /* Prevent compiler warnings */
++    ruleOPANDEx: ;
++
++}
++// $ANTLR end OPAND
++
++//   Comes from: 45:6: ( ',' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start OPOR
++ *
++ * Looks to match the characters the constitute the token OPOR
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mOPOR(pDAAPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = OPOR;
++       
++    
++    // DAAP.g:45:6: ( ',' )
++    // DAAP.g:45:8: ','
++    {
++        MATCHC(','); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleOPOREx;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleOPOREx; /* Prevent compiler warnings */
++    ruleOPOREx: ;
++
++}
++// $ANTLR end OPOR
++
++//   Comes from: 47:9: ( ( '\\r' )? '\\n' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start NEWLINE
++ *
++ * Looks to match the characters the constitute the token NEWLINE
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mNEWLINE(pDAAPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = NEWLINE;
++       
++    
++    // DAAP.g:47:9: ( ( '\\r' )? '\\n' )
++    // DAAP.g:47:11: ( '\\r' )? '\\n'
++    {
++
++        // DAAP.g:47:11: ( '\\r' )?
++        {
++            int alt1=2;
++            switch ( LA(1) ) 
++            {
++                case '\r':
++                      {
++                              alt1=1;
++                      }
++                    break;
++            }
++
++            switch (alt1) 
++            {
++              case 1:
++                  // DAAP.g:47:11: '\\r'
++                  {
++                      MATCHC('\r'); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleNEWLINEEx;
++                      }
++
++
++                  }
++                  break;
++
++            }
++        }
++        MATCHC('\n'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleNEWLINEEx;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleNEWLINEEx; /* Prevent compiler warnings */
++    ruleNEWLINEEx: ;
++
++}
++// $ANTLR end NEWLINE
++
++//   Comes from: 55:2: ( QUOTE (reg=~ ( '\\\\' | '\\'' ) | esc= ESCAPED )+ QUOTE )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start STR
++ *
++ * Looks to match the characters the constitute the token STR
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mSTR(pDAAPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++    pANTLR3_COMMON_TOKEN esc;
++    ANTLR3_UINT32 reg;
++
++
++    esc = NULL;
++
++    _type         = STR;
++       
++     pANTLR3_STRING unesc = GETTEXT()->factory->newRaw(GETTEXT()->factory); 
++    
++    // DAAP.g:55:2: ( QUOTE (reg=~ ( '\\\\' | '\\'' ) | esc= ESCAPED )+ QUOTE )
++    // DAAP.g:55:4: QUOTE (reg=~ ( '\\\\' | '\\'' ) | esc= ESCAPED )+ QUOTE
++    {
++        /* 55:4: QUOTE (reg=~ ( '\\\\' | '\\'' ) | esc= ESCAPED )+ QUOTE */
++        mQUOTE(ctx ); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleSTREx;
++        }
++
++        // DAAP.g:55:10: (reg=~ ( '\\\\' | '\\'' ) | esc= ESCAPED )+
++        {
++            int cnt2=0;
++
++            for (;;)
++            {
++                int alt2=3;
++              {
++                 /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
++                  */
++                  int LA2_0 = LA(1);
++                  if ( (((LA2_0 >= 0x0000) && (LA2_0 <= '&')) || ((LA2_0 >= '(') && (LA2_0 <= '[')) || ((LA2_0 >= ']') && (LA2_0 <= 0xFFFF))) ) 
++                  {
++                      alt2=1;
++                  }
++                  else if ( (LA2_0 == '\\') ) 
++                  {
++                      alt2=2;
++                  }
++
++              }
++              switch (alt2) 
++              {
++                  case 1:
++                      // DAAP.g:55:12: reg=~ ( '\\\\' | '\\'' )
++                      {
++                          reg= LA(1);
++                          if ( ((LA(1) >= 0x0000) && (LA(1) <= '&')) || ((LA(1) >= '(') && (LA(1) <= '[')) || ((LA(1) >= ']') && (LA(1) <= 0xFFFF)) )
++                          {
++                              CONSUME();
++
++                          }
++                          else 
++                          {
++                              CONSTRUCTEX();
++                              EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
++                              EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
++
++                              LRECOVER();    goto ruleSTREx;
++                          }
++
++                          {
++                               unesc->addc(unesc, reg); 
++                          }
++
++                      }
++                      break;
++                  case 2:
++                      // DAAP.g:56:6: esc= ESCAPED
++                      {
++                          /* 56:6: esc= ESCAPED */
++                          {
++                              ANTLR3_MARKER escStart118 = GETCHARINDEX();
++                          mESCAPED(ctx ); 
++                              if  (HASEXCEPTION())
++                              {
++                                  goto ruleSTREx;
++                              }
++
++                              esc = LEXSTATE->tokFactory->newToken(LEXSTATE->tokFactory);
++                              esc->setType(esc, ANTLR3_TOKEN_INVALID);
++                              esc->setStartIndex(esc, escStart118);
++                              esc->setStopIndex(esc, GETCHARINDEX()-1);
++                              esc->input = INPUT;
++                          }
++                          {
++                               unesc->appendS(unesc, GETTEXT()); 
++                          }
++
++                      }
++                      break;
++
++                  default:
++                  
++                      if ( cnt2 >= 1 )
++                      {
++                          goto loop2;
++                      }
++                      /* mismatchedSetEx()
++                       */
++                      CONSTRUCTEX();
++                      EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
++                      EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
++
++
++                      goto ruleSTREx;
++              }
++              cnt2++;
++            }
++            loop2: ;  /* Jump to here if this rule does not match */
++        }
++        /* 55:4: QUOTE (reg=~ ( '\\\\' | '\\'' ) | esc= ESCAPED )+ QUOTE */
++        mQUOTE(ctx ); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleSTREx;
++        }
++
++        {
++             SETTEXT(unesc); 
++        }
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleSTREx; /* Prevent compiler warnings */
++    ruleSTREx: ;
++
++    esc = NULL;
++
++}
++// $ANTLR end STR
++
++//   Comes from: 59:9: ( '\\\\' ( '\\\\' | '\\'' ) )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start ESCAPED
++ *
++ * Looks to match the characters the constitute the token ESCAPED
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mESCAPED(pDAAPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++        
++    // DAAP.g:59:9: ( '\\\\' ( '\\\\' | '\\'' ) )
++    // DAAP.g:59:11: '\\\\' ( '\\\\' | '\\'' )
++    {
++        MATCHC('\\'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleESCAPEDEx;
++        }
++
++
++        // DAAP.g:60:3: ( '\\\\' | '\\'' )
++        {
++            int alt3=2;
++            switch ( LA(1) ) 
++            {
++            case '\\':
++              {
++                      alt3=1;
++              }
++                break;
++            case '\'':
++              {
++                      alt3=2;
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 3;
++                EXCEPTION->state        = 0;
++
++
++                goto ruleESCAPEDEx;
++            }
++
++            switch (alt3) 
++            {
++              case 1:
++                  // DAAP.g:60:5: '\\\\'
++                  {
++                      MATCHC('\\'); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleESCAPEDEx;
++                      }
++
++                      {
++                           SETTEXT(GETTEXT()->factory->newStr8(GETTEXT()->factory, (pANTLR3_UINT8)"\\")); 
++                      }
++
++                  }
++                  break;
++              case 2:
++                  // DAAP.g:61:5: '\\''
++                  {
++                      MATCHC('\''); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleESCAPEDEx;
++                      }
++
++                      {
++                           SETTEXT(GETTEXT()->factory->newStr8(GETTEXT()->factory, (pANTLR3_UINT8)"\'")); 
++                      }
++
++                  }
++                  break;
++
++            }
++        }
++
++    }
++
++
++
++    // This is where rules clean up and exit
++    //
++    goto ruleESCAPEDEx; /* Prevent compiler warnings */
++    ruleESCAPEDEx: ;
++
++}
++// $ANTLR end ESCAPED
++
++/** This is the entry point in to the lexer from an object that
++ *  wants to generate the next token, such as a pCOMMON_TOKEN_STREAM
++ */
++static void 
++mTokens(pDAAPLexer ctx)
++{
++    {
++        //  DAAP.g:1:8: ( QUOTE | LPAR | RPAR | OPAND | OPOR | NEWLINE | STR )
++        
++        ANTLR3_UINT32 alt4;
++
++        alt4=7;
++
++        switch ( LA(1) ) 
++        {
++        case '\'':
++              {
++
++                      {
++                          int LA4_1 = LA(2);
++                          if ( (((LA4_1 >= 0x0000) && (LA4_1 <= '&')) || ((LA4_1 >= '(') && (LA4_1 <= 0xFFFF))) ) 
++                          {
++                              alt4=7;
++                          }
++                          else 
++                          {
++                              alt4=1;    }
++                      }
++              }
++            break;
++        case '(':
++              {
++                      alt4=2;
++              }
++            break;
++        case ')':
++              {
++                      alt4=3;
++              }
++            break;
++        case ' ':
++        case '+':
++              {
++                      alt4=4;
++              }
++            break;
++        case ',':
++              {
++                      alt4=5;
++              }
++            break;
++        case '\n':
++        case '\r':
++              {
++                      alt4=6;
++              }
++            break;
++
++        default:
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++            EXCEPTION->message      = (void *)"";
++            EXCEPTION->decisionNum  = 4;
++            EXCEPTION->state        = 0;
++
++
++            goto ruleTokensEx;
++        }
++
++        switch (alt4) 
++        {
++      case 1:
++          // DAAP.g:1:10: QUOTE
++          {
++              /* 1:10: QUOTE */
++              mQUOTE(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 2:
++          // DAAP.g:1:16: LPAR
++          {
++              /* 1:16: LPAR */
++              mLPAR(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 3:
++          // DAAP.g:1:21: RPAR
++          {
++              /* 1:21: RPAR */
++              mRPAR(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 4:
++          // DAAP.g:1:26: OPAND
++          {
++              /* 1:26: OPAND */
++              mOPAND(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 5:
++          // DAAP.g:1:32: OPOR
++          {
++              /* 1:32: OPOR */
++              mOPOR(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 6:
++          // DAAP.g:1:37: NEWLINE
++          {
++              /* 1:37: NEWLINE */
++              mNEWLINE(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 7:
++          // DAAP.g:1:45: STR
++          {
++              /* 1:45: STR */
++              mSTR(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++
++        }
++    }
++
++    
++    goto ruleTokensEx; /* Prevent compiler warnings */
++ruleTokensEx: ;
++}
++
++/* =========================================================================
++ * Lexer matching rules end.
++ * =========================================================================
++ */
++/* End of Lexer code
++ * ================================================
++ * ================================================
++ */ 
++
++
++/* End of code
++ * =============================================================================
++ */
+diff --git a/src/pregen/DAAPLexer.h b/src/pregen/DAAPLexer.h
+new file mode 100644
+index 0000000..ba8f58b
+--- /dev/null
++++ b/src/pregen/DAAPLexer.h
+@@ -0,0 +1,188 @@
++/** \file
++ *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
++ *
++ *     -  From the grammar source file : DAAP.g
++ *     -                            On : 2014-09-30 21:42:40
++ *     -                 for the lexer : DAAPLexerLexer *
++ * Editing it, at least manually, is not wise. 
++ *
++ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
++ *
++ *
++ * The lexer DAAPLexer has the callable functions (rules) shown below,
++ * which will invoke the code for the associated rule in the source grammar
++ * assuming that the input stream is pointing to a token/text stream that could begin
++ * this rule.
++ * 
++ * For instance if you call the first (topmost) rule in a parser grammar, you will
++ * get the results of a full parse, but calling a rule half way through the grammar will
++ * allow you to pass part of a full token stream to the parser, such as for syntax checking
++ * in editors and so on.
++ *
++ * The parser entry points are called indirectly (by function pointer to function) via
++ * a parser context typedef pDAAPLexer, which is returned from a call to DAAPLexerNew().
++ *
++ * As this is a generated lexer, it is unlikely you will call it 'manually'. However
++ * the methods are provided anyway.
++ * * The methods in pDAAPLexer are  as follows:
++ *
++ *  -  void      pDAAPLexer->QUOTE(pDAAPLexer)
++ *  -  void      pDAAPLexer->LPAR(pDAAPLexer)
++ *  -  void      pDAAPLexer->RPAR(pDAAPLexer)
++ *  -  void      pDAAPLexer->OPAND(pDAAPLexer)
++ *  -  void      pDAAPLexer->OPOR(pDAAPLexer)
++ *  -  void      pDAAPLexer->NEWLINE(pDAAPLexer)
++ *  -  void      pDAAPLexer->STR(pDAAPLexer)
++ *  -  void      pDAAPLexer->ESCAPED(pDAAPLexer)
++ *  -  void      pDAAPLexer->Tokens(pDAAPLexer)
++ *
++ * The return type for any particular rule is of course determined by the source
++ * grammar file.
++ */
++// [The "BSD licence"]
++// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
++// http://www.temporal-wave.com
++// http://www.linkedin.com/in/jimidle
++//
++// All rights reserved.
++//
++// Redistribution and use in source and binary forms, with or without
++// modification, are permitted provided that the following conditions
++// are met:
++// 1. Redistributions of source code must retain the above copyright
++//    notice, this list of conditions and the following disclaimer.
++// 2. Redistributions in binary form must reproduce the above copyright
++//    notice, this list of conditions and the following disclaimer in the
++//    documentation and/or other materials provided with the distribution.
++// 3. The name of the author may not be used to endorse or promote products
++//    derived from this software without specific prior written permission.
++//
++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++#ifndef       _DAAPLexer_H
++#define _DAAPLexer_H
++/* =============================================================================
++ * Standard antlr3 C runtime definitions
++ */
++#include    <antlr3.h>
++
++/* End of standard antlr 3 runtime definitions
++ * =============================================================================
++ */
++ 
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++// Forward declare the context typedef so that we can use it before it is
++// properly defined. Delegators and delegates (from import statements) are
++// interdependent and their context structures contain pointers to each other
++// C only allows such things to be declared if you pre-declare the typedef.
++//
++typedef struct DAAPLexer_Ctx_struct DAAPLexer, * pDAAPLexer;
++
++
++
++#ifdef        ANTLR3_WINDOWS
++// Disable: Unreferenced parameter,                                                   - Rules with parameters that are not used
++//          constant conditional,                                                     - ANTLR realizes that a prediction is always true (synpred usually)
++//          initialized but unused variable                                   - tree rewrite variables declared but not needed
++//          Unreferenced local variable                                               - lexer rule declares but does not always use _type
++//          potentially unitialized variable used                     - retval always returned from a rule 
++//                    unreferenced local function has been removed    - susually getTokenNames or freeScope, they can go without warnigns
++//
++// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
++// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
++// usually generated when a parser rule is given a parameter that it does not use. Mostly though
++// this is a matter of orthogonality hence I disable that one.
++//
++#pragma warning( disable : 4100 )
++#pragma warning( disable : 4101 )
++#pragma warning( disable : 4127 )
++#pragma warning( disable : 4189 )
++#pragma warning( disable : 4505 )
++#pragma warning( disable : 4701 )
++#endif
++
++/** Context tracking structure for DAAPLexer
++ */
++struct DAAPLexer_Ctx_struct
++{
++    /** Built in ANTLR3 context tracker contains all the generic elements
++     *  required for context tracking.
++     */
++    pANTLR3_LEXER    pLexer;
++
++
++     void (*mQUOTE)   (struct DAAPLexer_Ctx_struct * ctx);
++     void (*mLPAR)    (struct DAAPLexer_Ctx_struct * ctx);
++     void (*mRPAR)    (struct DAAPLexer_Ctx_struct * ctx);
++     void (*mOPAND)   (struct DAAPLexer_Ctx_struct * ctx);
++     void (*mOPOR)    (struct DAAPLexer_Ctx_struct * ctx);
++     void (*mNEWLINE) (struct DAAPLexer_Ctx_struct * ctx);
++     void (*mSTR)     (struct DAAPLexer_Ctx_struct * ctx);
++     void (*mESCAPED) (struct DAAPLexer_Ctx_struct * ctx);
++     void (*mTokens)  (struct DAAPLexer_Ctx_struct * ctx);    const char * (*getGrammarFileName)();
++    void          (*free)   (struct DAAPLexer_Ctx_struct * ctx);
++        
++};
++
++// Function protoypes for the constructor functions that external translation units
++// such as delegators and delegates may wish to call.
++//
++ANTLR3_API pDAAPLexer DAAPLexerNew         (pANTLR3_INPUT_STREAM instream);
++ANTLR3_API pDAAPLexer DAAPLexerNewSSD      (pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
++
++/** Symbolic definitions of all the tokens that the lexer will work with.
++ * \{
++ *
++ * Antlr will define EOF, but we can't use that as it it is too common in
++ * in C header files and that would be confusing. There is no way to filter this out at the moment
++ * so we just undef it here for now. That isn't the value we get back from C recognizers
++ * anyway. We are looking for ANTLR3_TOKEN_EOF.
++ */
++#ifdef        EOF
++#undef        EOF
++#endif
++#ifdef        Tokens
++#undef        Tokens
++#endif 
++#define STR      9
++#define QUOTE      10
++#define NEWLINE      4
++#define LPAR      7
++#define OPOR      5
++#define RPAR      8
++#define ESCAPED      11
++#define OPAND      6
++#define EOF      -1
++#ifdef        EOF
++#undef        EOF
++#define       EOF     ANTLR3_TOKEN_EOF
++#endif
++
++#ifndef TOKENSOURCE
++#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
++#endif
++
++/* End of token definitions for DAAPLexer
++ * =============================================================================
++ */
++/** \} */
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
++
++/* END - Note:Keep extra line feed to satisfy UNIX systems */
+diff --git a/src/pregen/DAAPParser.c b/src/pregen/DAAPParser.c
+new file mode 100644
+index 0000000..6d0239d
+--- /dev/null
++++ b/src/pregen/DAAPParser.c
+@@ -0,0 +1,1014 @@
++/** \file
++ *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
++ *
++ *     -  From the grammar source file : DAAP.g
++ *     -                            On : 2014-09-30 21:42:39
++ *     -                for the parser : DAAPParserParser *
++ * Editing it, at least manually, is not wise. 
++ *
++ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
++ *
++ *
++*/
++// [The "BSD licence"]
++// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
++// http://www.temporal-wave.com
++// http://www.linkedin.com/in/jimidle
++//
++// All rights reserved.
++//
++// Redistribution and use in source and binary forms, with or without
++// modification, are permitted provided that the following conditions
++// are met:
++// 1. Redistributions of source code must retain the above copyright
++//    notice, this list of conditions and the following disclaimer.
++// 2. Redistributions in binary form must reproduce the above copyright
++//    notice, this list of conditions and the following disclaimer in the
++//    documentation and/or other materials provided with the distribution.
++// 3. The name of the author may not be used to endorse or promote products
++//    derived from this software without specific prior written permission.
++//
++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++/* -----------------------------------------
++ * Include the ANTLR3 generated header file.
++ */
++#include    "DAAPParser.h"
++/* ----------------------------------------- */
++
++
++
++
++
++/* MACROS that hide the C interface implementations from the
++ * generated code, which makes it a little more understandable to the human eye.
++ * I am very much against using C pre-processor macros for function calls and bits
++ * of code as you cannot see what is happening when single stepping in debuggers
++ * and so on. The exception (in my book at least) is for generated code, where you are
++ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
++ * hides some indirect calls, but is always referring to the input stream. This is
++ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
++ * the runtime interfaces without changing the generated code too often, without
++ * confusing the reader of the generated output, who may not wish to know the gory
++ * details of the interface inheritance.
++ */
++ 
++#define               CTX     ctx
++
++/* Aids in accessing scopes for grammar programmers
++ */
++#undef        SCOPE_TYPE
++#undef        SCOPE_STACK
++#undef        SCOPE_TOP
++#define       SCOPE_TYPE(scope)   pDAAPParser_##scope##_SCOPE
++#define SCOPE_STACK(scope)  pDAAPParser_##scope##Stack
++#define       SCOPE_TOP(scope)    ctx->pDAAPParser_##scope##Top
++#define       SCOPE_SIZE(scope)               ctx->pDAAPParser_##scope##Stack_limit
++#define SCOPE_INSTANCE(scope, i)      (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
++
++/* Macros for accessing things in the parser
++ */
++ 
++#undef            PARSER                  
++#undef            RECOGNIZER              
++#undef            HAVEPARSEDRULE
++#undef                MEMOIZE
++#undef            INPUT
++#undef            STRSTREAM
++#undef            HASEXCEPTION
++#undef            EXCEPTION
++#undef            MATCHT
++#undef            MATCHANYT
++#undef            FOLLOWSTACK
++#undef            FOLLOWPUSH
++#undef            FOLLOWPOP
++#undef            PRECOVER
++#undef            PREPORTERROR
++#undef            LA
++#undef            LT
++#undef            CONSTRUCTEX
++#undef            CONSUME
++#undef            MARK
++#undef            REWIND
++#undef            REWINDLAST
++#undef            PERRORRECOVERY
++#undef            HASFAILED
++#undef            FAILEDFLAG
++#undef            RECOVERFROMMISMATCHEDSET
++#undef            RECOVERFROMMISMATCHEDELEMENT
++#undef                INDEX
++#undef      ADAPTOR
++#undef                SEEK
++#undef            RULEMEMO                
++#undef                DBG
++
++#define           PARSER                                                      ctx->pParser  
++#define           RECOGNIZER                                          PARSER->rec
++#define               PSRSTATE                                                RECOGNIZER->state
++#define           HAVEPARSEDRULE(r)                           RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
++#define               MEMOIZE(ri,si)                                  RECOGNIZER->memoize(RECOGNIZER, ri, si)
++#define           INPUT                                                       PARSER->tstream
++#define           STRSTREAM                                           INPUT
++#define               ISTREAM                                                 INPUT->istream
++#define               INDEX()                                                 ISTREAM->index(INPUT->istream)
++#define           HASEXCEPTION()                                      (PSRSTATE->error == ANTLR3_TRUE)
++#define           EXCEPTION                                           PSRSTATE->exception
++#define           MATCHT(t, fs)                                       RECOGNIZER->match(RECOGNIZER, t, fs)
++#define           MATCHANYT()                                         RECOGNIZER->matchAny(RECOGNIZER)
++#define           FOLLOWSTACK                                     PSRSTATE->following
++#define           FOLLOWPUSH(x)                                       FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
++#define           FOLLOWPOP()                                         FOLLOWSTACK->pop(FOLLOWSTACK)
++#define           PRECOVER()                                          RECOGNIZER->recover(RECOGNIZER)
++#define           PREPORTERROR()                                      RECOGNIZER->reportError(RECOGNIZER)
++#define           LA(n)                                                       INPUT->istream->_LA(ISTREAM, n)
++#define           LT(n)                                                       INPUT->_LT(INPUT, n)
++#define           CONSTRUCTEX()                                       RECOGNIZER->exConstruct(RECOGNIZER)
++#define           CONSUME()                                           ISTREAM->consume(ISTREAM)
++#define           MARK()                                                      ISTREAM->mark(ISTREAM)
++#define           REWIND(m)                                           ISTREAM->rewind(ISTREAM, m)
++#define           REWINDLAST()                                        ISTREAM->rewindLast(ISTREAM)
++#define               SEEK(n)                                                 ISTREAM->seek(ISTREAM, n)
++#define           PERRORRECOVERY                                      PSRSTATE->errorRecovery
++#define           FAILEDFLAG                                          PSRSTATE->failed
++#define           HASFAILED()                                         (FAILEDFLAG == ANTLR3_TRUE)
++#define           BACKTRACKING                                        PSRSTATE->backtracking
++#define           RECOVERFROMMISMATCHEDSET(s)         RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
++#define           RECOVERFROMMISMATCHEDELEMENT(e)     RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
++#define     ADAPTOR                         ctx->adaptor
++#define               RULEMEMO                                                PSRSTATE->ruleMemo
++#define               DBG                                                             RECOGNIZER->debugger
++
++#define               TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
++
++/* The 4 tokens defined below may well clash with your own #defines or token types. If so
++ * then for the present you must use different names for your defines as these are hard coded
++ * in the code generator. It would be better not to use such names internally, and maybe
++ * we can change this in a forthcoming release. I deliberately do not #undef these
++ * here as this will at least give you a redefined error somewhere if they clash.
++ */
++#define           UP      ANTLR3_TOKEN_UP
++#define           DOWN    ANTLR3_TOKEN_DOWN
++#define           EOR     ANTLR3_TOKEN_EOR
++#define           INVALID ANTLR3_TOKEN_INVALID
++
++
++/* =============================================================================
++ * Functions to create and destroy scopes. First come the rule scopes, followed
++ * by the global declared scopes.
++ */
++
++
++
++/* ============================================================================= */
++
++/* =============================================================================
++ * Start of recognizer
++ */
++
++
++
++/** \brief Table of all token names in symbolic order, mainly used for
++ *         error reporting.
++ */
++pANTLR3_UINT8   DAAPParserTokenNames[8+4]
++     = {
++        (pANTLR3_UINT8) "<invalid>",       /* String to print to indicate an invalid token */
++        (pANTLR3_UINT8) "<EOR>",
++        (pANTLR3_UINT8) "<DOWN>", 
++        (pANTLR3_UINT8) "<UP>", 
++        (pANTLR3_UINT8) "NEWLINE",
++        (pANTLR3_UINT8) "OPOR",
++        (pANTLR3_UINT8) "OPAND",
++        (pANTLR3_UINT8) "LPAR",
++        (pANTLR3_UINT8) "RPAR",
++        (pANTLR3_UINT8) "STR",
++        (pANTLR3_UINT8) "QUOTE",
++        (pANTLR3_UINT8) "ESCAPED"
++       };
++
++        
++
++// Forward declare the locally static matching functions we have generated.
++//
++static DAAPParser_query_return        query    (pDAAPParser ctx);
++static DAAPParser_expr_return expr    (pDAAPParser ctx);
++static DAAPParser_aexpr_return        aexpr    (pDAAPParser ctx);
++static DAAPParser_crit_return crit    (pDAAPParser ctx);
++static void   DAAPParserFree(pDAAPParser ctx);
++/* For use in tree output where we are accumulating rule labels via label += ruleRef
++ * we need a function that knows how to free a return scope when the list is destroyed. 
++ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
++ */
++static        void ANTLR3_CDECL freeScope(void * scope)
++{
++    ANTLR3_FREE(scope);
++}
++
++/** \brief Name of the grammar file that generated this code
++ */
++static const char fileName[] = "DAAP.g";
++
++/** \brief Return the name of the grammar file that generated this code.
++ */
++static const char * getGrammarFileName()
++{
++      return fileName;
++}
++/** \brief Create a new DAAPParser parser and return a context for it.
++ *
++ * \param[in] instream Pointer to an input stream interface.
++ *
++ * \return Pointer to new parser context upon success.
++ */
++ANTLR3_API pDAAPParser
++DAAPParserNew   (pANTLR3_COMMON_TOKEN_STREAM instream)
++{
++      // See if we can create a new parser with the standard constructor
++      //
++      return DAAPParserNewSSD(instream, NULL);
++}
++
++/** \brief Create a new DAAPParser parser and return a context for it.
++ *
++ * \param[in] instream Pointer to an input stream interface.
++ *
++ * \return Pointer to new parser context upon success.
++ */
++ANTLR3_API pDAAPParser
++DAAPParserNewSSD   (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
++{
++    pDAAPParser ctx;      /* Context structure we will build and return   */
++    
++    ctx       = (pDAAPParser) ANTLR3_CALLOC(1, sizeof(DAAPParser));
++    
++    if        (ctx == NULL)
++    {
++              // Failed to allocate memory for parser context
++              //
++        return  NULL;
++    }
++    
++    /* -------------------------------------------------------------------
++     * Memory for basic structure is allocated, now to fill in
++     * the base ANTLR3 structures. We initialize the function pointers
++     * for the standard ANTLR3 parser function set, but upon return
++     * from here, the programmer may set the pointers to provide custom
++     * implementations of each function. 
++     *
++     * We don't use the macros defined in DAAPParser.h here, in order that you can get a sense
++     * of what goes where.
++     */
++
++    /* Create a base parser/recognizer, using the supplied token stream
++     */
++    ctx->pParser          = antlr3ParserNewStream(ANTLR3_SIZE_HINT, instream->tstream, state);
++    /* Install the implementation of our DAAPParser interface
++     */
++    ctx->query        = query;
++    ctx->expr = expr;
++    ctx->aexpr        = aexpr;
++    ctx->crit = crit;
++    ctx->free                 = DAAPParserFree;
++    ctx->getGrammarFileName   = getGrammarFileName;
++    
++    /* Install the scope pushing methods.
++     */
++    ADAPTOR   = ANTLR3_TREE_ADAPTORNew(instream->tstream->tokenSource->strFactory);
++    ctx->vectors      = antlr3VectorFactoryNew(0);
++    
++
++      
++    /* Install the token table
++     */
++    PSRSTATE->tokenNames   = DAAPParserTokenNames;
++    
++    
++    /* Return the newly built parser to the caller
++     */
++    return  ctx;
++}
++
++/** Free the parser resources
++ */
++ static void
++ DAAPParserFree(pDAAPParser ctx)
++ {
++    /* Free any scope memory
++     */
++    
++    ctx->vectors->close(ctx->vectors);
++    /* We created the adaptor so we must free it
++     */
++    ADAPTOR->free(ADAPTOR);
++      // Free this parser
++      //
++    ctx->pParser->free(ctx->pParser);
++    ANTLR3_FREE(ctx);
++
++    /* Everything is released, so we can return
++     */
++    return;
++ }
++ 
++/** Return token names used by this parser
++ *
++ * The returned pointer is used as an index into the token names table (using the token 
++ * number as the index).
++ * 
++ * \return Pointer to first char * in the table.
++ */
++static pANTLR3_UINT8    *getTokenNames() 
++{
++        return DAAPParserTokenNames; 
++}
++
++    
++/* Declare the bitsets
++ */
++
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_query42  */
++static        ANTLR3_BITWORD FOLLOW_expr_in_query42_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000010) };
++static  ANTLR3_BITSET_LIST FOLLOW_expr_in_query42     = { FOLLOW_expr_in_query42_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_NEWLINE_in_query44  */
++static        ANTLR3_BITWORD FOLLOW_NEWLINE_in_query44_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000) };
++static  ANTLR3_BITSET_LIST FOLLOW_NEWLINE_in_query44  = { FOLLOW_NEWLINE_in_query44_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_EOF_in_query47  */
++static        ANTLR3_BITWORD FOLLOW_EOF_in_query47_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_EOF_in_query47      = { FOLLOW_EOF_in_query47_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_aexpr_in_expr62  */
++static        ANTLR3_BITWORD FOLLOW_aexpr_in_expr62_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000022) };
++static  ANTLR3_BITSET_LIST FOLLOW_aexpr_in_expr62     = { FOLLOW_aexpr_in_expr62_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_OPOR_in_expr65  */
++static        ANTLR3_BITWORD FOLLOW_OPOR_in_expr65_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000280) };
++static  ANTLR3_BITSET_LIST FOLLOW_OPOR_in_expr65      = { FOLLOW_OPOR_in_expr65_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_aexpr_in_expr68  */
++static        ANTLR3_BITWORD FOLLOW_aexpr_in_expr68_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000022) };
++static  ANTLR3_BITSET_LIST FOLLOW_aexpr_in_expr68     = { FOLLOW_aexpr_in_expr68_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_crit_in_aexpr80  */
++static        ANTLR3_BITWORD FOLLOW_crit_in_aexpr80_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000042) };
++static  ANTLR3_BITSET_LIST FOLLOW_crit_in_aexpr80     = { FOLLOW_crit_in_aexpr80_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_OPAND_in_aexpr83  */
++static        ANTLR3_BITWORD FOLLOW_OPAND_in_aexpr83_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000280) };
++static  ANTLR3_BITSET_LIST FOLLOW_OPAND_in_aexpr83    = { FOLLOW_OPAND_in_aexpr83_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_crit_in_aexpr86  */
++static        ANTLR3_BITWORD FOLLOW_crit_in_aexpr86_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000042) };
++static  ANTLR3_BITSET_LIST FOLLOW_crit_in_aexpr86     = { FOLLOW_crit_in_aexpr86_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAR_in_crit98  */
++static        ANTLR3_BITWORD FOLLOW_LPAR_in_crit98_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000280) };
++static  ANTLR3_BITSET_LIST FOLLOW_LPAR_in_crit98      = { FOLLOW_LPAR_in_crit98_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_crit100  */
++static        ANTLR3_BITWORD FOLLOW_expr_in_crit100_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000100) };
++static  ANTLR3_BITSET_LIST FOLLOW_expr_in_crit100     = { FOLLOW_expr_in_crit100_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAR_in_crit102  */
++static        ANTLR3_BITWORD FOLLOW_RPAR_in_crit102_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_RPAR_in_crit102     = { FOLLOW_RPAR_in_crit102_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_crit112  */
++static        ANTLR3_BITWORD FOLLOW_STR_in_crit112_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_STR_in_crit112      = { FOLLOW_STR_in_crit112_bits, 1       };
++     
++
++ 
++ 
++/* ==============================================
++ * Parsing rules
++ */
++/** 
++ * $ANTLR start query
++ * DAAP.g:27:1: query : expr ( NEWLINE )? EOF -> expr ;
++ */
++static DAAPParser_query_return
++query(pDAAPParser ctx)
++{   
++    DAAPParser_query_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    NEWLINE2;
++    pANTLR3_COMMON_TOKEN    EOF3;
++    DAAPParser_expr_return expr1;
++    #undef    RETURN_TYPE_expr1
++    #define   RETURN_TYPE_expr1 DAAPParser_expr_return
++
++    pANTLR3_BASE_TREE NEWLINE2_tree;
++    pANTLR3_BASE_TREE EOF3_tree;
++    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_NEWLINE;
++    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_EOF;
++    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_expr;
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    NEWLINE2       = NULL;
++    EOF3       = NULL;
++    expr1.tree = NULL;
++
++    retval.start = LT(1); retval.stop = retval.start;
++
++    NEWLINE2_tree   = NULL;
++    EOF3_tree   = NULL;
++
++    stream_NEWLINE   = NULL;
++    #define CREATE_stream_NEWLINE  if (stream_NEWLINE == NULL) {stream_NEWLINE = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token NEWLINE"); } 
++    stream_EOF   = NULL;
++    #define CREATE_stream_EOF  if (stream_EOF == NULL) {stream_EOF = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token EOF"); } 
++    stream_expr   = NULL;
++    #define CREATE_stream_expr  if (stream_expr == NULL) {stream_expr = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule expr"); }
++
++    retval.tree  = NULL;
++    {
++        // DAAP.g:27:7: ( expr ( NEWLINE )? EOF -> expr )
++        // DAAP.g:27:9: expr ( NEWLINE )? EOF
++        {
++            FOLLOWPUSH(FOLLOW_expr_in_query42);
++            expr1=expr(ctx);
++
++            FOLLOWPOP();
++            if  (HASEXCEPTION())
++            {
++                goto rulequeryEx;
++            }
++
++            CREATE_stream_expr; stream_expr->add(stream_expr, expr1.tree, NULL);
++
++            // DAAP.g:27:14: ( NEWLINE )?
++            {
++                int alt1=2;
++                switch ( LA(1) ) 
++                {
++                    case NEWLINE:
++                      {
++                              alt1=1;
++                      }
++                        break;
++                }
++
++                switch (alt1) 
++                {
++              case 1:
++                  // DAAP.g:27:14: NEWLINE
++                  {
++                      NEWLINE2 = (pANTLR3_COMMON_TOKEN) MATCHT(NEWLINE, &FOLLOW_NEWLINE_in_query44); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulequeryEx;
++                      }
++                       
++                      CREATE_stream_NEWLINE; stream_NEWLINE->add(stream_NEWLINE, NEWLINE2, NULL);
++
++
++                  }
++                  break;
++
++                }
++            }
++            EOF3 = (pANTLR3_COMMON_TOKEN) MATCHT(EOF, &FOLLOW_EOF_in_query47); 
++            if  (HASEXCEPTION())
++            {
++                goto rulequeryEx;
++            }
++             
++            CREATE_stream_EOF; stream_EOF->add(stream_EOF, EOF3, NULL);
++
++
++             
++            /* AST REWRITE
++             * elements          : expr
++             * token labels      : 
++             * rule labels       : retval
++             * token list labels : 
++             * rule list labels  : 
++             */
++            {
++              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
++
++              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
++
++              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++              retval.tree    = root_0;
++              // 27:27: -> expr
++              {
++                  ADAPTOR->addChild(ADAPTOR, root_0, stream_expr == NULL ? NULL : stream_expr->nextTree(stream_expr));
++
++              }
++
++              retval.tree = root_0; // set result root
++              if (stream_retval != NULL) stream_retval->free(stream_retval);
++
++
++            }
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto rulequeryEx; /* Prevent compiler warnings */
++    rulequeryEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++        if (stream_NEWLINE != NULL) stream_NEWLINE->free(stream_NEWLINE);
++        if (stream_EOF != NULL) stream_EOF->free(stream_EOF);
++        if (stream_expr != NULL) stream_expr->free(stream_expr);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end query */
++
++/** 
++ * $ANTLR start expr
++ * DAAP.g:30:1: expr : aexpr ( OPOR aexpr )* ;
++ */
++static DAAPParser_expr_return
++expr(pDAAPParser ctx)
++{   
++    DAAPParser_expr_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    OPOR5;
++    DAAPParser_aexpr_return aexpr4;
++    #undef    RETURN_TYPE_aexpr4
++    #define   RETURN_TYPE_aexpr4 DAAPParser_aexpr_return
++
++    DAAPParser_aexpr_return aexpr6;
++    #undef    RETURN_TYPE_aexpr6
++    #define   RETURN_TYPE_aexpr6 DAAPParser_aexpr_return
++
++    pANTLR3_BASE_TREE OPOR5_tree;
++
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    OPOR5       = NULL;
++    aexpr4.tree = NULL;
++
++    aexpr6.tree = NULL;
++
++    retval.start = LT(1); retval.stop = retval.start;
++
++    OPOR5_tree   = NULL;
++
++
++    retval.tree  = NULL;
++    {
++        // DAAP.g:30:6: ( aexpr ( OPOR aexpr )* )
++        // DAAP.g:30:8: aexpr ( OPOR aexpr )*
++        {
++            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++            FOLLOWPUSH(FOLLOW_aexpr_in_expr62);
++            aexpr4=aexpr(ctx);
++
++            FOLLOWPOP();
++            if  (HASEXCEPTION())
++            {
++                goto ruleexprEx;
++            }
++
++            ADAPTOR->addChild(ADAPTOR, root_0, aexpr4.tree);
++
++            // DAAP.g:30:14: ( OPOR aexpr )*
++
++            for (;;)
++            {
++                int alt2=2;
++                switch ( LA(1) ) 
++                {
++                case OPOR:
++                      {
++                              alt2=1;
++                      }
++                    break;
++
++                }
++
++                switch (alt2) 
++                {
++              case 1:
++                  // DAAP.g:30:15: OPOR aexpr
++                  {
++                      OPOR5 = (pANTLR3_COMMON_TOKEN) MATCHT(OPOR, &FOLLOW_OPOR_in_expr65); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      OPOR5_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, OPOR5));
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, OPOR5_tree, root_0));
++
++                      FOLLOWPUSH(FOLLOW_aexpr_in_expr68);
++                      aexpr6=aexpr(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      ADAPTOR->addChild(ADAPTOR, root_0, aexpr6.tree);
++
++                  }
++                  break;
++
++              default:
++                  goto loop2; /* break out of the loop */
++                  break;
++                }
++            }
++            loop2: ; /* Jump out to here if this rule does not match */
++
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruleexprEx; /* Prevent compiler warnings */
++    ruleexprEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end expr */
++
++/** 
++ * $ANTLR start aexpr
++ * DAAP.g:33:1: aexpr : crit ( OPAND crit )* ;
++ */
++static DAAPParser_aexpr_return
++aexpr(pDAAPParser ctx)
++{   
++    DAAPParser_aexpr_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    OPAND8;
++    DAAPParser_crit_return crit7;
++    #undef    RETURN_TYPE_crit7
++    #define   RETURN_TYPE_crit7 DAAPParser_crit_return
++
++    DAAPParser_crit_return crit9;
++    #undef    RETURN_TYPE_crit9
++    #define   RETURN_TYPE_crit9 DAAPParser_crit_return
++
++    pANTLR3_BASE_TREE OPAND8_tree;
++
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    OPAND8       = NULL;
++    crit7.tree = NULL;
++
++    crit9.tree = NULL;
++
++    retval.start = LT(1); retval.stop = retval.start;
++
++    OPAND8_tree   = NULL;
++
++
++    retval.tree  = NULL;
++    {
++        // DAAP.g:33:7: ( crit ( OPAND crit )* )
++        // DAAP.g:33:9: crit ( OPAND crit )*
++        {
++            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++            FOLLOWPUSH(FOLLOW_crit_in_aexpr80);
++            crit7=crit(ctx);
++
++            FOLLOWPOP();
++            if  (HASEXCEPTION())
++            {
++                goto ruleaexprEx;
++            }
++
++            ADAPTOR->addChild(ADAPTOR, root_0, crit7.tree);
++
++            // DAAP.g:33:14: ( OPAND crit )*
++
++            for (;;)
++            {
++                int alt3=2;
++                switch ( LA(1) ) 
++                {
++                case OPAND:
++                      {
++                              alt3=1;
++                      }
++                    break;
++
++                }
++
++                switch (alt3) 
++                {
++              case 1:
++                  // DAAP.g:33:15: OPAND crit
++                  {
++                      OPAND8 = (pANTLR3_COMMON_TOKEN) MATCHT(OPAND, &FOLLOW_OPAND_in_aexpr83); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleaexprEx;
++                      }
++
++                      OPAND8_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, OPAND8));
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, OPAND8_tree, root_0));
++
++                      FOLLOWPUSH(FOLLOW_crit_in_aexpr86);
++                      crit9=crit(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleaexprEx;
++                      }
++
++                      ADAPTOR->addChild(ADAPTOR, root_0, crit9.tree);
++
++                  }
++                  break;
++
++              default:
++                  goto loop3; /* break out of the loop */
++                  break;
++                }
++            }
++            loop3: ; /* Jump out to here if this rule does not match */
++
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruleaexprEx; /* Prevent compiler warnings */
++    ruleaexprEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end aexpr */
++
++/** 
++ * $ANTLR start crit
++ * DAAP.g:36:1: crit : ( LPAR expr RPAR -> expr | STR );
++ */
++static DAAPParser_crit_return
++crit(pDAAPParser ctx)
++{   
++    DAAPParser_crit_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    LPAR10;
++    pANTLR3_COMMON_TOKEN    RPAR12;
++    pANTLR3_COMMON_TOKEN    STR13;
++    DAAPParser_expr_return expr11;
++    #undef    RETURN_TYPE_expr11
++    #define   RETURN_TYPE_expr11 DAAPParser_expr_return
++
++    pANTLR3_BASE_TREE LPAR10_tree;
++    pANTLR3_BASE_TREE RPAR12_tree;
++    pANTLR3_BASE_TREE STR13_tree;
++    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_RPAR;
++    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_LPAR;
++    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_expr;
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    LPAR10       = NULL;
++    RPAR12       = NULL;
++    STR13       = NULL;
++    expr11.tree = NULL;
++
++    retval.start = LT(1); retval.stop = retval.start;
++
++    LPAR10_tree   = NULL;
++    RPAR12_tree   = NULL;
++    STR13_tree   = NULL;
++
++    stream_RPAR   = NULL;
++    #define CREATE_stream_RPAR  if (stream_RPAR == NULL) {stream_RPAR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token RPAR"); } 
++    stream_LPAR   = NULL;
++    #define CREATE_stream_LPAR  if (stream_LPAR == NULL) {stream_LPAR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token LPAR"); } 
++    stream_expr   = NULL;
++    #define CREATE_stream_expr  if (stream_expr == NULL) {stream_expr = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule expr"); }
++
++    retval.tree  = NULL;
++    {
++        {
++            //  DAAP.g:36:6: ( LPAR expr RPAR -> expr | STR )
++            
++            ANTLR3_UINT32 alt4;
++
++            alt4=2;
++
++            switch ( LA(1) ) 
++            {
++            case LPAR:
++              {
++                      alt4=1;
++              }
++                break;
++            case STR:
++              {
++                      alt4=2;
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 4;
++                EXCEPTION->state        = 0;
++
++
++                goto rulecritEx;
++            }
++
++            switch (alt4) 
++            {
++              case 1:
++                  // DAAP.g:36:8: LPAR expr RPAR
++                  {
++                      LPAR10 = (pANTLR3_COMMON_TOKEN) MATCHT(LPAR, &FOLLOW_LPAR_in_crit98); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++                       
++                      CREATE_stream_LPAR; stream_LPAR->add(stream_LPAR, LPAR10, NULL);
++
++                      FOLLOWPUSH(FOLLOW_expr_in_crit100);
++                      expr11=expr(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++
++                      CREATE_stream_expr; stream_expr->add(stream_expr, expr11.tree, NULL);
++                      RPAR12 = (pANTLR3_COMMON_TOKEN) MATCHT(RPAR, &FOLLOW_RPAR_in_crit102); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++                       
++                      CREATE_stream_RPAR; stream_RPAR->add(stream_RPAR, RPAR12, NULL);
++
++
++                       
++                      /* AST REWRITE
++                       * elements          : expr
++                       * token labels      : 
++                       * rule labels       : retval
++                       * token list labels : 
++                       * rule list labels  : 
++                       */
++                      {
++                              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
++
++                              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
++
++                              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++                              retval.tree    = root_0;
++                              // 36:24: -> expr
++                              {
++                                  ADAPTOR->addChild(ADAPTOR, root_0, stream_expr == NULL ? NULL : stream_expr->nextTree(stream_expr));
++
++                              }
++
++                              retval.tree = root_0; // set result root
++                              if (stream_retval != NULL) stream_retval->free(stream_retval);
++
++
++                      }
++                  }
++                  break;
++              case 2:
++                  // DAAP.g:37:4: STR
++                  {
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++                      STR13 = (pANTLR3_COMMON_TOKEN) MATCHT(STR, &FOLLOW_STR_in_crit112); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++
++                      STR13_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, STR13));
++                      ADAPTOR->addChild(ADAPTOR, root_0, STR13_tree);
++
++
++                  }
++                  break;
++
++            }
++        }
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto rulecritEx; /* Prevent compiler warnings */
++    rulecritEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++        if (stream_RPAR != NULL) stream_RPAR->free(stream_RPAR);
++        if (stream_LPAR != NULL) stream_LPAR->free(stream_LPAR);
++        if (stream_expr != NULL) stream_expr->free(stream_expr);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end crit */
++/* End of parsing rules
++ * ==============================================
++ */
++
++/* ==============================================
++ * Syntactic predicates
++ */
++/* End of syntactic predicates
++ * ==============================================
++ */
++
++ 
++ 
++
++
++
++/* End of code
++ * =============================================================================
++ */
+diff --git a/src/pregen/DAAPParser.h b/src/pregen/DAAPParser.h
+new file mode 100644
+index 0000000..dcc664f
+--- /dev/null
++++ b/src/pregen/DAAPParser.h
+@@ -0,0 +1,226 @@
++/** \file
++ *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
++ *
++ *     -  From the grammar source file : DAAP.g
++ *     -                            On : 2014-09-30 21:42:39
++ *     -                for the parser : DAAPParserParser *
++ * Editing it, at least manually, is not wise. 
++ *
++ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
++ *
++ *
++ * The parser DAAPParser has the callable functions (rules) shown below,
++ * which will invoke the code for the associated rule in the source grammar
++ * assuming that the input stream is pointing to a token/text stream that could begin
++ * this rule.
++ * 
++ * For instance if you call the first (topmost) rule in a parser grammar, you will
++ * get the results of a full parse, but calling a rule half way through the grammar will
++ * allow you to pass part of a full token stream to the parser, such as for syntax checking
++ * in editors and so on.
++ *
++ * The parser entry points are called indirectly (by function pointer to function) via
++ * a parser context typedef pDAAPParser, which is returned from a call to DAAPParserNew().
++ *
++ * The methods in pDAAPParser are  as follows:
++ *
++ *  - DAAPParser_query_return      pDAAPParser->query(pDAAPParser)
++ *  - DAAPParser_expr_return      pDAAPParser->expr(pDAAPParser)
++ *  - DAAPParser_aexpr_return      pDAAPParser->aexpr(pDAAPParser)
++ *  - DAAPParser_crit_return      pDAAPParser->crit(pDAAPParser)
++ *
++ * The return type for any particular rule is of course determined by the source
++ * grammar file.
++ */
++// [The "BSD licence"]
++// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
++// http://www.temporal-wave.com
++// http://www.linkedin.com/in/jimidle
++//
++// All rights reserved.
++//
++// Redistribution and use in source and binary forms, with or without
++// modification, are permitted provided that the following conditions
++// are met:
++// 1. Redistributions of source code must retain the above copyright
++//    notice, this list of conditions and the following disclaimer.
++// 2. Redistributions in binary form must reproduce the above copyright
++//    notice, this list of conditions and the following disclaimer in the
++//    documentation and/or other materials provided with the distribution.
++// 3. The name of the author may not be used to endorse or promote products
++//    derived from this software without specific prior written permission.
++//
++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++#ifndef       _DAAPParser_H
++#define _DAAPParser_H
++/* =============================================================================
++ * Standard antlr3 C runtime definitions
++ */
++#include    <antlr3.h>
++
++/* End of standard antlr 3 runtime definitions
++ * =============================================================================
++ */
++ 
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++// Forward declare the context typedef so that we can use it before it is
++// properly defined. Delegators and delegates (from import statements) are
++// interdependent and their context structures contain pointers to each other
++// C only allows such things to be declared if you pre-declare the typedef.
++//
++typedef struct DAAPParser_Ctx_struct DAAPParser, * pDAAPParser;
++
++
++
++#ifdef        ANTLR3_WINDOWS
++// Disable: Unreferenced parameter,                                                   - Rules with parameters that are not used
++//          constant conditional,                                                     - ANTLR realizes that a prediction is always true (synpred usually)
++//          initialized but unused variable                                   - tree rewrite variables declared but not needed
++//          Unreferenced local variable                                               - lexer rule declares but does not always use _type
++//          potentially unitialized variable used                     - retval always returned from a rule 
++//                    unreferenced local function has been removed    - susually getTokenNames or freeScope, they can go without warnigns
++//
++// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
++// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
++// usually generated when a parser rule is given a parameter that it does not use. Mostly though
++// this is a matter of orthogonality hence I disable that one.
++//
++#pragma warning( disable : 4100 )
++#pragma warning( disable : 4101 )
++#pragma warning( disable : 4127 )
++#pragma warning( disable : 4189 )
++#pragma warning( disable : 4505 )
++#pragma warning( disable : 4701 )
++#endif
++typedef struct DAAPParser_query_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    DAAPParser_query_return;
++
++typedef struct DAAPParser_expr_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    DAAPParser_expr_return;
++
++typedef struct DAAPParser_aexpr_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    DAAPParser_aexpr_return;
++
++typedef struct DAAPParser_crit_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    DAAPParser_crit_return;
++
++
++
++/** Context tracking structure for DAAPParser
++ */
++struct DAAPParser_Ctx_struct
++{
++    /** Built in ANTLR3 context tracker contains all the generic elements
++     *  required for context tracking.
++     */
++    pANTLR3_PARSER   pParser;
++
++
++     DAAPParser_query_return (*query) (struct DAAPParser_Ctx_struct * ctx);
++     DAAPParser_expr_return (*expr)   (struct DAAPParser_Ctx_struct * ctx);
++     DAAPParser_aexpr_return (*aexpr) (struct DAAPParser_Ctx_struct * ctx);
++     DAAPParser_crit_return (*crit)   (struct DAAPParser_Ctx_struct * ctx);
++    // Delegated rules
++    const char * (*getGrammarFileName)();
++    void          (*free)   (struct DAAPParser_Ctx_struct * ctx);
++    /* @headerFile.members() */
++    pANTLR3_BASE_TREE_ADAPTOR adaptor;
++    pANTLR3_VECTOR_FACTORY            vectors;
++    /* End @headerFile.members() */
++};
++
++// Function protoypes for the constructor functions that external translation units
++// such as delegators and delegates may wish to call.
++//
++ANTLR3_API pDAAPParser DAAPParserNew         (pANTLR3_COMMON_TOKEN_STREAM instream);
++ANTLR3_API pDAAPParser DAAPParserNewSSD      (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
++
++/** Symbolic definitions of all the tokens that the parser will work with.
++ * \{
++ *
++ * Antlr will define EOF, but we can't use that as it it is too common in
++ * in C header files and that would be confusing. There is no way to filter this out at the moment
++ * so we just undef it here for now. That isn't the value we get back from C recognizers
++ * anyway. We are looking for ANTLR3_TOKEN_EOF.
++ */
++#ifdef        EOF
++#undef        EOF
++#endif
++#ifdef        Tokens
++#undef        Tokens
++#endif 
++#define STR      9
++#define QUOTE      10
++#define LPAR      7
++#define NEWLINE      4
++#define OPOR      5
++#define RPAR      8
++#define ESCAPED      11
++#define OPAND      6
++#define EOF      -1
++#ifdef        EOF
++#undef        EOF
++#define       EOF     ANTLR3_TOKEN_EOF
++#endif
++
++#ifndef TOKENSOURCE
++#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
++#endif
++
++/* End of token definitions for DAAPParser
++ * =============================================================================
++ */
++/** \} */
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
++
++/* END - Note:Keep extra line feed to satisfy UNIX systems */
+diff --git a/src/pregen/RSP.u b/src/pregen/RSP.u
+new file mode 100644
+index 0000000..89256ff
+--- /dev/null
++++ b/src/pregen/RSP.u
+@@ -0,0 +1,6 @@
++RSPParser.c : RSP.g
++./RSP.tokens : RSP.g
++RSPParser.h : RSP.g
++RSPLexer.c : RSP.g
++RSPLexer.h : RSP.g
++ANTLR_PRODUCTS += RSPParser.c ./RSP.tokens RSPParser.h RSPLexer.c RSPLexer.h 
+\ No newline at end of file
+diff --git a/src/pregen/RSP2SQL.c b/src/pregen/RSP2SQL.c
+new file mode 100644
+index 0000000..b5c9550
+--- /dev/null
++++ b/src/pregen/RSP2SQL.c
+@@ -0,0 +1,2546 @@
++/** \file
++ *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
++ *
++ *     -  From the grammar source file : RSP2SQL.g
++ *     -                            On : 2014-09-30 21:42:42
++ *     -           for the tree parser : RSP2SQLTreeParser *
++ * Editing it, at least manually, is not wise. 
++ *
++ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
++ *
++ *
++*/
++// [The "BSD licence"]
++// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
++// http://www.temporal-wave.com
++// http://www.linkedin.com/in/jimidle
++//
++// All rights reserved.
++//
++// Redistribution and use in source and binary forms, with or without
++// modification, are permitted provided that the following conditions
++// are met:
++// 1. Redistributions of source code must retain the above copyright
++//    notice, this list of conditions and the following disclaimer.
++// 2. Redistributions in binary form must reproduce the above copyright
++//    notice, this list of conditions and the following disclaimer in the
++//    documentation and/or other materials provided with the distribution.
++// 3. The name of the author may not be used to endorse or promote products
++//    derived from this software without specific prior written permission.
++//
++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++
++/* =============================================================================
++ * This is what the grammar programmer asked us to put at the top of every file.
++ */
++
++      /* Needs #define _GNU_SOURCE for strptime() */
++
++      #include <stdio.h>
++      #include <string.h>
++      #include <time.h>
++      #include <stdint.h>
++
++      #include "logger.h"
++      #include "db.h"
++      #include "misc.h"
++      #include "rsp_query.h"
++
++/* End of Header action.
++ * =============================================================================
++ */
++/* -----------------------------------------
++ * Include the ANTLR3 generated header file.
++ */
++#include    "RSP2SQL.h"
++/* ----------------------------------------- */
++
++
++
++
++
++/* MACROS that hide the C interface implementations from the
++ * generated code, which makes it a little more understandable to the human eye.
++ * I am very much against using C pre-processor macros for function calls and bits
++ * of code as you cannot see what is happening when single stepping in debuggers
++ * and so on. The exception (in my book at least) is for generated code, where you are
++ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
++ * hides some indirect calls, but is always referring to the input stream. This is
++ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
++ * the runtime interfaces without changing the generated code too often, without
++ * confusing the reader of the generated output, who may not wish to know the gory
++ * details of the interface inheritance.
++ */
++ 
++#define               CTX     ctx
++
++/* Aids in accessing scopes for grammar programmers
++ */
++#undef        SCOPE_TYPE
++#undef        SCOPE_STACK
++#undef        SCOPE_TOP
++#define       SCOPE_TYPE(scope)   pRSP2SQL_##scope##_SCOPE
++#define SCOPE_STACK(scope)  pRSP2SQL_##scope##Stack
++#define       SCOPE_TOP(scope)    ctx->pRSP2SQL_##scope##Top
++#define       SCOPE_SIZE(scope)               ctx->pRSP2SQL_##scope##Stack_limit
++#define SCOPE_INSTANCE(scope, i)      (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
++
++/* Macros for accessing things in the parser
++ */
++ 
++#undef            PARSER
++#undef            RECOGNIZER              
++#undef            HAVEPARSEDRULE
++#undef            INPUT
++#undef            STRSTREAM
++#undef            HASEXCEPTION
++#undef            EXCEPTION
++#undef            MATCHT
++#undef            MATCHANYT
++#undef            FOLLOWSTACK
++#undef            FOLLOWPUSH
++#undef            FOLLOWPOP
++#undef            PRECOVER
++#undef            PREPORTERROR
++#undef            LA
++#undef            LT
++#undef            CONSTRUCTEX
++#undef            CONSUME
++#undef            MARK
++#undef            REWIND
++#undef            REWINDLAST
++#undef            PERRORRECOVERY
++#undef            HASFAILED
++#undef            FAILEDFLAG
++#undef            RECOVERFROMMISMATCHEDSET
++#undef            RECOVERFROMMISMATCHEDELEMENT
++#undef            BACKTRACKING
++#undef      ADAPTOR
++#undef            RULEMEMO            
++#undef                SEEK    
++#undef                INDEX
++#undef                DBG
++
++#define           PARSER                                                      ctx->pTreeParser  
++#define           RECOGNIZER                                          PARSER->rec
++#define               PSRSTATE                                                RECOGNIZER->state
++#define           HAVEPARSEDRULE(r)                           RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
++#define           INPUT                                                       PARSER->ctnstream
++#define               ISTREAM                                                 INPUT->tnstream->istream
++#define           STRSTREAM                                           INPUT->tnstream
++#define           HASEXCEPTION()                                      (PSRSTATE->error == ANTLR3_TRUE)
++#define           EXCEPTION                                           PSRSTATE->exception
++#define           MATCHT(t, fs)                                       RECOGNIZER->match(RECOGNIZER, t, fs)
++#define           MATCHANYT()                                         RECOGNIZER->matchAny(RECOGNIZER)
++#define           FOLLOWSTACK                                     PSRSTATE->following
++#define           FOLLOWPUSH(x)                                       FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
++#define           FOLLOWPOP()                                         FOLLOWSTACK->pop(FOLLOWSTACK)
++#define           PRECOVER()                                          RECOGNIZER->recover(RECOGNIZER)
++#define           PREPORTERROR()                                      RECOGNIZER->reportError(RECOGNIZER)
++#define           LA(n)                                                       ISTREAM->_LA(ISTREAM, n)
++#define           LT(n)                                                       INPUT->tnstream->_LT(INPUT->tnstream, n)
++#define           CONSTRUCTEX()                                       RECOGNIZER->exConstruct(RECOGNIZER)
++#define           CONSUME()                                           ISTREAM->consume(ISTREAM)
++#define           MARK()                                                      ISTREAM->mark(ISTREAM)
++#define           REWIND(m)                                           ISTREAM->rewind(ISTREAM, m)
++#define           REWINDLAST()                                        ISTREAM->rewindLast(ISTREAM)
++#define           PERRORRECOVERY                                      PSRSTATE->errorRecovery
++#define           FAILEDFLAG                                          PSRSTATE->failed
++#define           HASFAILED()                                         (FAILEDFLAG == ANTLR3_TRUE)
++#define           BACKTRACKING                                        PSRSTATE->backtracking
++#define           RECOVERFROMMISMATCHEDSET(s)         RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
++#define           RECOVERFROMMISMATCHEDELEMENT(e)     RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
++#define     ADAPTOR                         INPUT->adaptor
++#define               RULEMEMO                                                PSRSTATE->ruleMemo
++#define               SEEK(n)                                                 ISTREAM->seek(ISTREAM, n)
++#define               INDEX()                                                 ISTREAM->index(ISTREAM)
++#define               DBG                                                             RECOGNIZER->debugger
++
++
++#define               TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
++
++/* The 4 tokens defined below may well clash with your own #defines or token types. If so
++ * then for the present you must use different names for your defines as these are hard coded
++ * in the code generator. It would be better not to use such names internally, and maybe
++ * we can change this in a forthcoming release. I deliberately do not #undef these
++ * here as this will at least give you a redefined error somewhere if they clash.
++ */
++#define           UP      ANTLR3_TOKEN_UP
++#define           DOWN    ANTLR3_TOKEN_DOWN
++#define           EOR     ANTLR3_TOKEN_EOR
++#define           INVALID ANTLR3_TOKEN_INVALID
++
++
++/* =============================================================================
++ * Functions to create and destroy scopes. First come the rule scopes, followed
++ * by the global declared scopes.
++ */
++
++
++
++/* ============================================================================= */
++
++/* =============================================================================
++ * Start of recognizer
++ */
++
++
++
++/** \brief Table of all token names in symbolic order, mainly used for
++ *         error reporting.
++ */
++pANTLR3_UINT8   RSP2SQLTokenNames[30+4]
++     = {
++        (pANTLR3_UINT8) "<invalid>",       /* String to print to indicate an invalid token */
++        (pANTLR3_UINT8) "<EOR>",
++        (pANTLR3_UINT8) "<DOWN>", 
++        (pANTLR3_UINT8) "<UP>", 
++        (pANTLR3_UINT8) "NEWLINE",
++        (pANTLR3_UINT8) "OR",
++        (pANTLR3_UINT8) "AND",
++        (pANTLR3_UINT8) "LPAR",
++        (pANTLR3_UINT8) "RPAR",
++        (pANTLR3_UINT8) "FIELD",
++        (pANTLR3_UINT8) "STR",
++        (pANTLR3_UINT8) "NOT",
++        (pANTLR3_UINT8) "EQUAL",
++        (pANTLR3_UINT8) "INCLUDES",
++        (pANTLR3_UINT8) "STARTSW",
++        (pANTLR3_UINT8) "ENDSW",
++        (pANTLR3_UINT8) "INT",
++        (pANTLR3_UINT8) "LESS",
++        (pANTLR3_UINT8) "GREATER",
++        (pANTLR3_UINT8) "LTE",
++        (pANTLR3_UINT8) "GTE",
++        (pANTLR3_UINT8) "BEFORE",
++        (pANTLR3_UINT8) "AFTER",
++        (pANTLR3_UINT8) "DATE",
++        (pANTLR3_UINT8) "TODAY",
++        (pANTLR3_UINT8) "DAY",
++        (pANTLR3_UINT8) "WEEK",
++        (pANTLR3_UINT8) "MONTH",
++        (pANTLR3_UINT8) "YEAR",
++        (pANTLR3_UINT8) "QUOTE",
++        (pANTLR3_UINT8) "WS",
++        (pANTLR3_UINT8) "DIGIT19",
++        (pANTLR3_UINT8) "DIGIT09",
++        (pANTLR3_UINT8) "ESCAPED"
++       };
++
++        
++
++// Forward declare the locally static matching functions we have generated.
++//
++static pANTLR3_STRING query    (pRSP2SQL ctx);
++static RSP2SQL_expr_return    expr    (pRSP2SQL ctx);
++static RSP2SQL_strcrit_return strcrit    (pRSP2SQL ctx);
++static pANTLR3_COMMON_TOKEN   strop    (pRSP2SQL ctx);
++static RSP2SQL_intcrit_return intcrit    (pRSP2SQL ctx);
++static pANTLR3_COMMON_TOKEN   intop    (pRSP2SQL ctx);
++static RSP2SQL_datecrit_return        datecrit    (pRSP2SQL ctx);
++static pANTLR3_COMMON_TOKEN   dateop    (pRSP2SQL ctx);
++static RSP2SQL_datespec_return        datespec    (pRSP2SQL ctx);
++static RSP2SQL_dateref_return dateref    (pRSP2SQL ctx);
++static RSP2SQL_dateintval_return      dateintval    (pRSP2SQL ctx);
++static void   RSP2SQLFree(pRSP2SQL ctx);
++/* For use in tree output where we are accumulating rule labels via label += ruleRef
++ * we need a function that knows how to free a return scope when the list is destroyed. 
++ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
++ */
++static        void ANTLR3_CDECL freeScope(void * scope)
++{
++    ANTLR3_FREE(scope);
++}
++
++/** \brief Name of the grammar file that generated this code
++ */
++static const char fileName[] = "RSP2SQL.g";
++
++/** \brief Return the name of the grammar file that generated this code.
++ */
++static const char * getGrammarFileName()
++{
++      return fileName;
++}
++/** \brief Create a new RSP2SQL parser and return a context for it.
++ *
++ * \param[in] instream Pointer to an input stream interface.
++ *
++ * \return Pointer to new parser context upon success.
++ */
++ANTLR3_API pRSP2SQL
++RSP2SQLNew   (pANTLR3_COMMON_TREE_NODE_STREAM instream)
++{
++      // See if we can create a new parser with the standard constructor
++      //
++      return RSP2SQLNewSSD(instream, NULL);
++}
++
++/** \brief Create a new RSP2SQL parser and return a context for it.
++ *
++ * \param[in] instream Pointer to an input stream interface.
++ *
++ * \return Pointer to new parser context upon success.
++ */
++ANTLR3_API pRSP2SQL
++RSP2SQLNewSSD   (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
++{
++    pRSP2SQL ctx;         /* Context structure we will build and return   */
++    
++    ctx       = (pRSP2SQL) ANTLR3_CALLOC(1, sizeof(RSP2SQL));
++    
++    if        (ctx == NULL)
++    {
++              // Failed to allocate memory for parser context
++              //
++        return  NULL;
++    }
++    
++    /* -------------------------------------------------------------------
++     * Memory for basic structure is allocated, now to fill in
++     * the base ANTLR3 structures. We initialize the function pointers
++     * for the standard ANTLR3 parser function set, but upon return
++     * from here, the programmer may set the pointers to provide custom
++     * implementations of each function. 
++     *
++     * We don't use the macros defined in RSP2SQL.h here, in order that you can get a sense
++     * of what goes where.
++     */
++
++    /* Create a base Tree parser/recognizer, using the supplied tree node stream
++     */
++    ctx->pTreeParser          = antlr3TreeParserNewStream(ANTLR3_SIZE_HINT, instream, state);
++    /* Install the implementation of our RSP2SQL interface
++     */
++    ctx->query        = query;
++    ctx->expr = expr;
++    ctx->strcrit      = strcrit;
++    ctx->strop        = strop;
++    ctx->intcrit      = intcrit;
++    ctx->intop        = intop;
++    ctx->datecrit     = datecrit;
++    ctx->dateop       = dateop;
++    ctx->datespec     = datespec;
++    ctx->dateref      = dateref;
++    ctx->dateintval   = dateintval;
++    ctx->free                 = RSP2SQLFree;
++    ctx->getGrammarFileName   = getGrammarFileName;
++    
++    /* Install the scope pushing methods.
++     */
++
++        
++    
++
++      
++    /* Install the token table
++     */
++    PSRSTATE->tokenNames   = RSP2SQLTokenNames;
++    
++    
++    /* Return the newly built parser to the caller
++     */
++    return  ctx;
++}
++
++/** Free the parser resources
++ */
++ static void
++ RSP2SQLFree(pRSP2SQL ctx)
++ {
++    /* Free any scope memory
++     */
++    
++        
++      // Free this parser
++      //
++    ctx->pTreeParser->free(ctx->pTreeParser);
++    ANTLR3_FREE(ctx);
++
++    /* Everything is released, so we can return
++     */
++    return;
++ }
++ 
++/** Return token names used by this tree parser
++ *
++ * The returned pointer is used as an index into the token names table (using the token 
++ * number as the index).
++ * 
++ * \return Pointer to first char * in the table.
++ */
++static pANTLR3_UINT8    *getTokenNames() 
++{
++        return RSP2SQLTokenNames; 
++}
++
++
++      #define RSP_TYPE_STRING 0
++      #define RSP_TYPE_INT    1
++      #define RSP_TYPE_DATE   2
++
++      struct rsp_query_field_map {
++        char *rsp_field;
++        int field_type;
++        /* RSP fields are named after the DB columns - or vice versa */
++      };
++
++      /* gperf static hash, rsp_query.gperf */
++      #include "rsp_query_hash.c"
++
++    
++/* Declare the bitsets
++ */
++
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_query70  */
++static        ANTLR3_BITWORD FOLLOW_expr_in_query70_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_expr_in_query70     = { FOLLOW_expr_in_query70_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_AND_in_expr95  */
++static        ANTLR3_BITWORD FOLLOW_AND_in_expr95_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000004) };
++static  ANTLR3_BITSET_LIST FOLLOW_AND_in_expr95       = { FOLLOW_AND_in_expr95_bits, 1        };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr101  */
++static        ANTLR3_BITWORD FOLLOW_expr_in_expr101_bits[]    = { ANTLR3_UINT64_LIT(0x00000000007EF860) };
++static  ANTLR3_BITSET_LIST FOLLOW_expr_in_expr101     = { FOLLOW_expr_in_expr101_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr107  */
++static        ANTLR3_BITWORD FOLLOW_expr_in_expr107_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000008) };
++static  ANTLR3_BITSET_LIST FOLLOW_expr_in_expr107     = { FOLLOW_expr_in_expr107_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_OR_in_expr118  */
++static        ANTLR3_BITWORD FOLLOW_OR_in_expr118_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000004) };
++static  ANTLR3_BITSET_LIST FOLLOW_OR_in_expr118       = { FOLLOW_OR_in_expr118_bits, 1        };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr124  */
++static        ANTLR3_BITWORD FOLLOW_expr_in_expr124_bits[]    = { ANTLR3_UINT64_LIT(0x00000000007EF860) };
++static  ANTLR3_BITSET_LIST FOLLOW_expr_in_expr124     = { FOLLOW_expr_in_expr124_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr130  */
++static        ANTLR3_BITWORD FOLLOW_expr_in_expr130_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000008) };
++static  ANTLR3_BITSET_LIST FOLLOW_expr_in_expr130     = { FOLLOW_expr_in_expr130_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_strcrit_in_expr144  */
++static        ANTLR3_BITWORD FOLLOW_strcrit_in_expr144_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_strcrit_in_expr144  = { FOLLOW_strcrit_in_expr144_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_NOT_in_expr154  */
++static        ANTLR3_BITWORD FOLLOW_NOT_in_expr154_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000004) };
++static  ANTLR3_BITSET_LIST FOLLOW_NOT_in_expr154      = { FOLLOW_NOT_in_expr154_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_strcrit_in_expr160  */
++static        ANTLR3_BITWORD FOLLOW_strcrit_in_expr160_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) };
++static  ANTLR3_BITSET_LIST FOLLOW_strcrit_in_expr160  = { FOLLOW_strcrit_in_expr160_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_intcrit_in_expr174  */
++static        ANTLR3_BITWORD FOLLOW_intcrit_in_expr174_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_intcrit_in_expr174  = { FOLLOW_intcrit_in_expr174_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_NOT_in_expr184  */
++static        ANTLR3_BITWORD FOLLOW_NOT_in_expr184_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000004) };
++static  ANTLR3_BITSET_LIST FOLLOW_NOT_in_expr184      = { FOLLOW_NOT_in_expr184_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_intcrit_in_expr190  */
++static        ANTLR3_BITWORD FOLLOW_intcrit_in_expr190_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) };
++static  ANTLR3_BITSET_LIST FOLLOW_intcrit_in_expr190  = { FOLLOW_intcrit_in_expr190_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_datecrit_in_expr204  */
++static        ANTLR3_BITWORD FOLLOW_datecrit_in_expr204_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_datecrit_in_expr204 = { FOLLOW_datecrit_in_expr204_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_strop_in_strcrit233  */
++static        ANTLR3_BITWORD FOLLOW_strop_in_strcrit233_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000004) };
++static  ANTLR3_BITSET_LIST FOLLOW_strop_in_strcrit233 = { FOLLOW_strop_in_strcrit233_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_strcrit239  */
++static        ANTLR3_BITWORD FOLLOW_FIELD_in_strcrit239_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000400) };
++static  ANTLR3_BITSET_LIST FOLLOW_FIELD_in_strcrit239 = { FOLLOW_FIELD_in_strcrit239_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_strcrit245  */
++static        ANTLR3_BITWORD FOLLOW_STR_in_strcrit245_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000008) };
++static  ANTLR3_BITSET_LIST FOLLOW_STR_in_strcrit245   = { FOLLOW_STR_in_strcrit245_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_EQUAL_in_strop274  */
++static        ANTLR3_BITWORD FOLLOW_EQUAL_in_strop274_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_EQUAL_in_strop274   = { FOLLOW_EQUAL_in_strop274_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_INCLUDES_in_strop287  */
++static        ANTLR3_BITWORD FOLLOW_INCLUDES_in_strop287_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_INCLUDES_in_strop287        = { FOLLOW_INCLUDES_in_strop287_bits, 1 };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_STARTSW_in_strop300  */
++static        ANTLR3_BITWORD FOLLOW_STARTSW_in_strop300_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_STARTSW_in_strop300 = { FOLLOW_STARTSW_in_strop300_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_ENDSW_in_strop313  */
++static        ANTLR3_BITWORD FOLLOW_ENDSW_in_strop313_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_ENDSW_in_strop313   = { FOLLOW_ENDSW_in_strop313_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_intop_in_intcrit342  */
++static        ANTLR3_BITWORD FOLLOW_intop_in_intcrit342_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000004) };
++static  ANTLR3_BITSET_LIST FOLLOW_intop_in_intcrit342 = { FOLLOW_intop_in_intcrit342_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_intcrit348  */
++static        ANTLR3_BITWORD FOLLOW_FIELD_in_intcrit348_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000010000) };
++static  ANTLR3_BITSET_LIST FOLLOW_FIELD_in_intcrit348 = { FOLLOW_FIELD_in_intcrit348_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_intcrit354  */
++static        ANTLR3_BITWORD FOLLOW_INT_in_intcrit354_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000008) };
++static  ANTLR3_BITSET_LIST FOLLOW_INT_in_intcrit354   = { FOLLOW_INT_in_intcrit354_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_EQUAL_in_intop383  */
++static        ANTLR3_BITWORD FOLLOW_EQUAL_in_intop383_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_EQUAL_in_intop383   = { FOLLOW_EQUAL_in_intop383_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_LESS_in_intop396  */
++static        ANTLR3_BITWORD FOLLOW_LESS_in_intop396_bits[]   = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_LESS_in_intop396    = { FOLLOW_LESS_in_intop396_bits, 1     };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_GREATER_in_intop409  */
++static        ANTLR3_BITWORD FOLLOW_GREATER_in_intop409_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_GREATER_in_intop409 = { FOLLOW_GREATER_in_intop409_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_LTE_in_intop422  */
++static        ANTLR3_BITWORD FOLLOW_LTE_in_intop422_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_LTE_in_intop422     = { FOLLOW_LTE_in_intop422_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_GTE_in_intop435  */
++static        ANTLR3_BITWORD FOLLOW_GTE_in_intop435_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_GTE_in_intop435     = { FOLLOW_GTE_in_intop435_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateop_in_datecrit464  */
++static        ANTLR3_BITWORD FOLLOW_dateop_in_datecrit464_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000004) };
++static  ANTLR3_BITSET_LIST FOLLOW_dateop_in_datecrit464       = { FOLLOW_dateop_in_datecrit464_bits, 1        };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_datecrit470  */
++static        ANTLR3_BITWORD FOLLOW_FIELD_in_datecrit470_bits[]       = { ANTLR3_UINT64_LIT(0x0000000001FEF860) };
++static  ANTLR3_BITSET_LIST FOLLOW_FIELD_in_datecrit470        = { FOLLOW_FIELD_in_datecrit470_bits, 1 };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_datespec_in_datecrit476  */
++static        ANTLR3_BITWORD FOLLOW_datespec_in_datecrit476_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000008) };
++static  ANTLR3_BITSET_LIST FOLLOW_datespec_in_datecrit476     = { FOLLOW_datespec_in_datecrit476_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_BEFORE_in_dateop505  */
++static        ANTLR3_BITWORD FOLLOW_BEFORE_in_dateop505_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_BEFORE_in_dateop505 = { FOLLOW_BEFORE_in_dateop505_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_AFTER_in_dateop518  */
++static        ANTLR3_BITWORD FOLLOW_AFTER_in_dateop518_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_AFTER_in_dateop518  = { FOLLOW_AFTER_in_dateop518_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateref_in_datespec546  */
++static        ANTLR3_BITWORD FOLLOW_dateref_in_datespec546_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_dateref_in_datespec546      = { FOLLOW_dateref_in_datespec546_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateop_in_datespec560  */
++static        ANTLR3_BITWORD FOLLOW_dateop_in_datespec560_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000004) };
++static  ANTLR3_BITSET_LIST FOLLOW_dateop_in_datespec560       = { FOLLOW_dateop_in_datespec560_bits, 1        };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateref_in_datespec566  */
++static        ANTLR3_BITWORD FOLLOW_dateref_in_datespec566_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000010000) };
++static  ANTLR3_BITSET_LIST FOLLOW_dateref_in_datespec566      = { FOLLOW_dateref_in_datespec566_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_datespec572  */
++static        ANTLR3_BITWORD FOLLOW_INT_in_datespec572_bits[] = { ANTLR3_UINT64_LIT(0x000000001E000000) };
++static  ANTLR3_BITSET_LIST FOLLOW_INT_in_datespec572  = { FOLLOW_INT_in_datespec572_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateintval_in_datespec578  */
++static        ANTLR3_BITWORD FOLLOW_dateintval_in_datespec578_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000008) };
++static  ANTLR3_BITSET_LIST FOLLOW_dateintval_in_datespec578   = { FOLLOW_dateintval_in_datespec578_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateref607  */
++static        ANTLR3_BITWORD FOLLOW_DATE_in_dateref607_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateref607  = { FOLLOW_DATE_in_dateref607_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_TODAY_in_dateref616  */
++static        ANTLR3_BITWORD FOLLOW_TODAY_in_dateref616_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_TODAY_in_dateref616 = { FOLLOW_TODAY_in_dateref616_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_DAY_in_dateintval640  */
++static        ANTLR3_BITWORD FOLLOW_DAY_in_dateintval640_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_DAY_in_dateintval640        = { FOLLOW_DAY_in_dateintval640_bits, 1 };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_WEEK_in_dateintval649  */
++static        ANTLR3_BITWORD FOLLOW_WEEK_in_dateintval649_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_WEEK_in_dateintval649       = { FOLLOW_WEEK_in_dateintval649_bits, 1        };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_MONTH_in_dateintval658  */
++static        ANTLR3_BITWORD FOLLOW_MONTH_in_dateintval658_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_MONTH_in_dateintval658      = { FOLLOW_MONTH_in_dateintval658_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_YEAR_in_dateintval667  */
++static        ANTLR3_BITWORD FOLLOW_YEAR_in_dateintval667_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_YEAR_in_dateintval667       = { FOLLOW_YEAR_in_dateintval667_bits, 1        };
++     
++
++ 
++ 
++/* ==============================================
++ * Parsing rules
++ */
++/** 
++ * $ANTLR start query
++ * RSP2SQL.g:56:1: query returns [ pANTLR3_STRING result ] : e= expr ;
++ */
++static pANTLR3_STRING
++query(pRSP2SQL ctx)
++{   
++    pANTLR3_STRING result = NULL;
++
++    RSP2SQL_expr_return e;
++    #undef    RETURN_TYPE_e
++    #define   RETURN_TYPE_e RSP2SQL_expr_return
++
++    /* Initialize rule variables
++     */
++
++
++     result= NULL; 
++    {
++        // RSP2SQL.g:58:2: (e= expr )
++        // RSP2SQL.g:58:4: e= expr
++        {
++            FOLLOWPUSH(FOLLOW_expr_in_query70);
++            e=expr(ctx);
++
++            FOLLOWPOP();
++            if  (HASEXCEPTION())
++            {
++                goto rulequeryEx;
++            }
++
++            {
++
++                                      if (!e.valid)
++                                      {
++                                              result= NULL;
++                                      }
++                                      else
++                                      {
++                                              result= e.result->factory->newRaw(e.result->factory);
++                                              result->append8(result, "(");
++                                              result->appendS(result, e.result);
++                                              result->append8(result, ")");
++                                      }
++                              
++            }
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto rulequeryEx; /* Prevent compiler warnings */
++    rulequeryEx: ;
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++            }
++
++
++    return result;
++}
++/* $ANTLR end query */
++
++/** 
++ * $ANTLR start expr
++ * RSP2SQL.g:74:1: expr returns [ pANTLR3_STRING result, int valid ] : ( ^( AND a= expr b= expr ) | ^( OR a= expr b= expr ) | c= strcrit | ^( NOT c= strcrit ) | i= intcrit | ^( NOT i= intcrit ) | d= datecrit );
++ */
++static RSP2SQL_expr_return
++expr(pRSP2SQL ctx)
++{   
++    RSP2SQL_expr_return retval;
++
++    RSP2SQL_expr_return a;
++    #undef    RETURN_TYPE_a
++    #define   RETURN_TYPE_a RSP2SQL_expr_return
++
++    RSP2SQL_expr_return b;
++    #undef    RETURN_TYPE_b
++    #define   RETURN_TYPE_b RSP2SQL_expr_return
++
++    RSP2SQL_strcrit_return c;
++    #undef    RETURN_TYPE_c
++    #define   RETURN_TYPE_c RSP2SQL_strcrit_return
++
++    RSP2SQL_intcrit_return i;
++    #undef    RETURN_TYPE_i
++    #define   RETURN_TYPE_i RSP2SQL_intcrit_return
++
++    RSP2SQL_datecrit_return d;
++    #undef    RETURN_TYPE_d
++    #define   RETURN_TYPE_d RSP2SQL_datecrit_return
++
++    /* Initialize rule variables
++     */
++
++
++     retval.result= NULL; retval.valid= 1; 
++    retval.start = LT(1); retval.stop = retval.start;
++
++    {
++        {
++            //  RSP2SQL.g:76:2: ( ^( AND a= expr b= expr ) | ^( OR a= expr b= expr ) | c= strcrit | ^( NOT c= strcrit ) | i= intcrit | ^( NOT i= intcrit ) | d= datecrit )
++            
++            ANTLR3_UINT32 alt1;
++
++            alt1=7;
++
++            switch ( LA(1) ) 
++            {
++            case AND:
++              {
++                      alt1=1;
++              }
++                break;
++            case OR:
++              {
++                      alt1=2;
++              }
++                break;
++            case EQUAL:
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case DOWN:
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case FIELD:
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case INT:
++                                                              {
++                                                                      alt1=5;
++                                                              }
++                                                          break;
++                                                      case STR:
++                                                              {
++                                                                      alt1=3;
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          CONSTRUCTEX();
++                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                          EXCEPTION->message      = (void *)"";
++                                                          EXCEPTION->decisionNum  = 1;
++                                                          EXCEPTION->state        = 10;
++
++
++                                                          goto ruleexprEx;
++                                                      }
++
++                                              }
++                                          break;
++
++                                      default:
++                                          CONSTRUCTEX();
++                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                          EXCEPTION->message      = (void *)"";
++                                          EXCEPTION->decisionNum  = 1;
++                                          EXCEPTION->state        = 8;
++
++
++                                          goto ruleexprEx;
++                                      }
++
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 1;
++                          EXCEPTION->state        = 3;
++
++
++                          goto ruleexprEx;
++                      }
++
++              }
++                break;
++            case INCLUDES:
++            case STARTSW:
++            case ENDSW:
++              {
++                      alt1=3;
++              }
++                break;
++            case NOT:
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case DOWN:
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case EQUAL:
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case DOWN:
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case FIELD:
++                                                                              {
++                                                                                      switch ( LA(6) ) 
++                                                                                      {
++                                                                                      case STR:
++                                                                                              {
++                                                                                                      alt1=4;
++                                                                                              }
++                                                                                          break;
++                                                                                      case INT:
++                                                                                              {
++                                                                                                      alt1=6;
++                                                                                              }
++                                                                                          break;
++
++                                                                                      default:
++                                                                                          CONSTRUCTEX();
++                                                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                                                          EXCEPTION->message      = (void *)"";
++                                                                                          EXCEPTION->decisionNum  = 1;
++                                                                                          EXCEPTION->state        = 15;
++
++
++                                                                                          goto ruleexprEx;
++                                                                                      }
++
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          CONSTRUCTEX();
++                                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                                          EXCEPTION->message      = (void *)"";
++                                                                          EXCEPTION->decisionNum  = 1;
++                                                                          EXCEPTION->state        = 14;
++
++
++                                                                          goto ruleexprEx;
++                                                                      }
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          CONSTRUCTEX();
++                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                          EXCEPTION->message      = (void *)"";
++                                                          EXCEPTION->decisionNum  = 1;
++                                                          EXCEPTION->state        = 11;
++
++
++                                                          goto ruleexprEx;
++                                                      }
++
++                                              }
++                                          break;
++                                      case LESS:
++                                      case GREATER:
++                                      case LTE:
++                                      case GTE:
++                                              {
++                                                      alt1=6;
++                                              }
++                                          break;
++                                      case INCLUDES:
++                                      case STARTSW:
++                                      case ENDSW:
++                                              {
++                                                      alt1=4;
++                                              }
++                                          break;
++
++                                      default:
++                                          CONSTRUCTEX();
++                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                          EXCEPTION->message      = (void *)"";
++                                          EXCEPTION->decisionNum  = 1;
++                                          EXCEPTION->state        = 9;
++
++
++                                          goto ruleexprEx;
++                                      }
++
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 1;
++                          EXCEPTION->state        = 5;
++
++
++                          goto ruleexprEx;
++                      }
++
++              }
++                break;
++            case LESS:
++            case GREATER:
++            case LTE:
++            case GTE:
++              {
++                      alt1=5;
++              }
++                break;
++            case BEFORE:
++            case AFTER:
++              {
++                      alt1=7;
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 1;
++                EXCEPTION->state        = 0;
++
++
++                goto ruleexprEx;
++            }
++
++            switch (alt1) 
++            {
++              case 1:
++                  // RSP2SQL.g:76:4: ^( AND a= expr b= expr )
++                  {
++                       MATCHT(AND, &FOLLOW_AND_in_expr95); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_expr_in_expr101);
++                      a=expr(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_expr_in_expr107);
++                      b=expr(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      {
++
++                                              if (!a.valid || !b.valid)
++                                              {
++                                                      retval.valid= 0;
++                                              }
++                                              else
++                                              {
++                                                      retval.result= a.result->factory->newRaw(a.result->factory);
++                                                      retval.result->append8(retval.result, "(");
++                                                      retval.result->appendS(retval.result, a.result);
++                                                      retval.result->append8(retval.result, " AND ");
++                                                      retval.result->appendS(retval.result, b.result);
++                                                      retval.result->append8(retval.result, ")");
++                                              }
++                                      
++                      }
++
++                  }
++                  break;
++              case 2:
++                  // RSP2SQL.g:92:4: ^( OR a= expr b= expr )
++                  {
++                       MATCHT(OR, &FOLLOW_OR_in_expr118); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_expr_in_expr124);
++                      a=expr(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_expr_in_expr130);
++                      b=expr(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      {
++
++                                              if (!a.valid || !b.valid)
++                                              {
++                                                      retval.valid= 0;
++                                              }
++                                              else
++                                              {
++                                                      retval.result= a.result->factory->newRaw(a.result->factory);
++                                                      retval.result->append8(retval.result, "(");
++                                                      retval.result->appendS(retval.result, a.result);
++                                                      retval.result->append8(retval.result, " OR ");
++                                                      retval.result->appendS(retval.result, b.result);
++                                                      retval.result->append8(retval.result, ")");
++                                              }
++                                      
++                      }
++
++                  }
++                  break;
++              case 3:
++                  // RSP2SQL.g:108:4: c= strcrit
++                  {
++                      FOLLOWPUSH(FOLLOW_strcrit_in_expr144);
++                      c=strcrit(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      {
++
++                                              retval.valid= c.valid;
++                                              retval.result= c.result;
++                                      
++                      }
++
++                  }
++                  break;
++              case 4:
++                  // RSP2SQL.g:113:4: ^( NOT c= strcrit )
++                  {
++                       MATCHT(NOT, &FOLLOW_NOT_in_expr154); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_strcrit_in_expr160);
++                      c=strcrit(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      {
++
++                                              if (!c.valid)
++                                              {
++                                                      retval.valid= 0;
++                                              }
++                                              else
++                                              {
++                                                      retval.result= c.result->factory->newRaw(c.result->factory);
++                                                      retval.result->append8(retval.result, "(NOT ");
++                                                      retval.result->appendS(retval.result, c.result);
++                                                      retval.result->append8(retval.result, ")");
++                                              }
++                                      
++                      }
++
++                  }
++                  break;
++              case 5:
++                  // RSP2SQL.g:127:4: i= intcrit
++                  {
++                      FOLLOWPUSH(FOLLOW_intcrit_in_expr174);
++                      i=intcrit(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      {
++
++                                              retval.valid= i.valid;
++                                              retval.result= i.result;
++                                      
++                      }
++
++                  }
++                  break;
++              case 6:
++                  // RSP2SQL.g:132:4: ^( NOT i= intcrit )
++                  {
++                       MATCHT(NOT, &FOLLOW_NOT_in_expr184); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_intcrit_in_expr190);
++                      i=intcrit(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      {
++
++                                              if (!i.valid)
++                                              {
++                                                      retval.valid= 0;
++                                              }
++                                              else
++                                              {
++                                                      retval.result= i.result->factory->newRaw(i.result->factory);
++                                                      retval.result->append8(retval.result, "(NOT ");
++                                                      retval.result->appendS(retval.result, i.result);
++                                                      retval.result->append8(retval.result, ")");
++                                              }
++                                      
++                      }
++
++                  }
++                  break;
++              case 7:
++                  // RSP2SQL.g:146:4: d= datecrit
++                  {
++                      FOLLOWPUSH(FOLLOW_datecrit_in_expr204);
++                      d=datecrit(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      {
++
++                                              retval.valid= d.valid;
++                                              retval.result= d.result;
++                                      
++                      }
++
++                  }
++                  break;
++
++            }
++        }
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruleexprEx; /* Prevent compiler warnings */
++    ruleexprEx: ;
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++            }
++
++
++    return retval;
++}
++/* $ANTLR end expr */
++
++/** 
++ * $ANTLR start strcrit
++ * RSP2SQL.g:153:1: strcrit returns [ pANTLR3_STRING result, int valid ] : ^(o= strop f= FIELD s= STR ) ;
++ */
++static RSP2SQL_strcrit_return
++strcrit(pRSP2SQL ctx)
++{   
++    RSP2SQL_strcrit_return retval;
++
++    pANTLR3_BASE_TREE    f;
++    pANTLR3_BASE_TREE    s;
++    pANTLR3_COMMON_TOKEN o;
++    #undef    RETURN_TYPE_o
++    #define   RETURN_TYPE_o pANTLR3_COMMON_TOKEN
++
++    /* Initialize rule variables
++     */
++
++
++     retval.result= NULL; retval.valid= 1; 
++    f       = NULL;
++    s       = NULL;
++    o = NULL;
++    retval.start = LT(1); retval.stop = retval.start;
++
++    {
++        // RSP2SQL.g:155:2: ( ^(o= strop f= FIELD s= STR ) )
++        // RSP2SQL.g:155:4: ^(o= strop f= FIELD s= STR )
++        {
++            FOLLOWPUSH(FOLLOW_strop_in_strcrit233);
++            o=strop(ctx);
++
++            FOLLOWPOP();
++            if  (HASEXCEPTION())
++            {
++                goto rulestrcritEx;
++            }
++
++
++            MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
++            if  (HASEXCEPTION())
++            {
++                goto rulestrcritEx;
++            }
++
++            f = (pANTLR3_BASE_TREE) MATCHT(FIELD, &FOLLOW_FIELD_in_strcrit239); 
++            if  (HASEXCEPTION())
++            {
++                goto rulestrcritEx;
++            }
++
++            s = (pANTLR3_BASE_TREE) MATCHT(STR, &FOLLOW_STR_in_strcrit245); 
++            if  (HASEXCEPTION())
++            {
++                goto rulestrcritEx;
++            }
++
++
++            MATCHT(ANTLR3_TOKEN_UP, NULL); 
++            if  (HASEXCEPTION())
++            {
++                goto rulestrcritEx;
++            }
++
++            {
++
++                                      char *op;
++                                      const struct rsp_query_field_map *rqfp;
++                                      pANTLR3_STRING field;
++                                      char *escaped;
++                                      ANTLR3_UINT32 optok;
++
++                                      escaped = NULL;
++
++                                      op = NULL;
++                                      optok = o->getType(o);
++                                      switch (optok)
++                                      {
++                                              case EQUAL:
++                                                      op = " = ";
++                                                      break;
++
++                                              case INCLUDES:
++                                              case STARTSW:
++                                              case ENDSW:
++                                                      op = " LIKE ";
++                                                      break;
++                                      }
++
++                                      field = f->getText(f);
++
++                                      /* Field lookup */
++                                      rqfp = rsp_query_field_lookup((char *)field->chars, strlen((char *)field->chars));
++                                      if (!rqfp)
++                                      {
++                                              DPRINTF(E_LOG, L_RSP, "Field '%s' is not a valid field in queries\n", field->chars);
++                                              retval.valid= 0;
++                                              goto strcrit_valid_0; /* ABORT */
++                                      }
++
++                                      /* Check field type */
++                                      if (rqfp->field_type != RSP_TYPE_STRING)
++                                      {
++                                              DPRINTF(E_LOG, L_RSP, "Field '%s' is not a string field\n", field->chars);
++                                              retval.valid= 0;
++                                              goto strcrit_valid_0; /* ABORT */
++                                      }
++
++                                      escaped = db_escape_string((char *)s->getText(s)->chars);
++                                      if (!escaped)
++                                      {
++                                              DPRINTF(E_LOG, L_RSP, "Could not escape value\n");
++                                              retval.valid= 0;
++                                              goto strcrit_valid_0; /* ABORT */
++                                      }
++
++                                      retval.result= field->factory->newRaw(field->factory);
++                                      retval.result->append8(retval.result, "f.");
++                                      retval.result->appendS(retval.result, field);
++                                      retval.result->append8(retval.result, op);
++                                      retval.result->append8(retval.result, "'");
++                                      if ((optok == INCLUDES) || (optok == STARTSW))
++                                              retval.result->append8(retval.result, "%");
++
++                                      retval.result->append8(retval.result, escaped);
++
++                                      if ((optok == INCLUDES) || (optok == ENDSW))
++                                              retval.result->append8(retval.result, "%");
++                                      retval.result->append8(retval.result, "'");
++
++                                      strcrit_valid_0:
++                                              ;
++
++                                      if (escaped)
++                                              free(escaped);
++                              
++            }
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto rulestrcritEx; /* Prevent compiler warnings */
++    rulestrcritEx: ;
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++            }
++
++
++    return retval;
++}
++/* $ANTLR end strcrit */
++
++/** 
++ * $ANTLR start strop
++ * RSP2SQL.g:229:1: strop returns [ pANTLR3_COMMON_TOKEN op ] : (n= EQUAL | n= INCLUDES | n= STARTSW | n= ENDSW );
++ */
++static pANTLR3_COMMON_TOKEN
++strop(pRSP2SQL ctx)
++{   
++    pANTLR3_COMMON_TOKEN op = NULL;
++
++    pANTLR3_BASE_TREE    n;
++
++    /* Initialize rule variables
++     */
++
++
++     op= NULL; 
++    n       = NULL;
++
++    {
++        {
++            //  RSP2SQL.g:231:2: (n= EQUAL | n= INCLUDES | n= STARTSW | n= ENDSW )
++            
++            ANTLR3_UINT32 alt2;
++
++            alt2=4;
++
++            switch ( LA(1) ) 
++            {
++            case EQUAL:
++              {
++                      alt2=1;
++              }
++                break;
++            case INCLUDES:
++              {
++                      alt2=2;
++              }
++                break;
++            case STARTSW:
++              {
++                      alt2=3;
++              }
++                break;
++            case ENDSW:
++              {
++                      alt2=4;
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 2;
++                EXCEPTION->state        = 0;
++
++
++                goto rulestropEx;
++            }
++
++            switch (alt2) 
++            {
++              case 1:
++                  // RSP2SQL.g:231:4: n= EQUAL
++                  {
++                      n = (pANTLR3_BASE_TREE) MATCHT(EQUAL, &FOLLOW_EQUAL_in_strop274); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulestropEx;
++                      }
++
++                      {
++                           op= n->getToken(n); 
++                      }
++
++                  }
++                  break;
++              case 2:
++                  // RSP2SQL.g:233:4: n= INCLUDES
++                  {
++                      n = (pANTLR3_BASE_TREE) MATCHT(INCLUDES, &FOLLOW_INCLUDES_in_strop287); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulestropEx;
++                      }
++
++                      {
++                           op= n->getToken(n); 
++                      }
++
++                  }
++                  break;
++              case 3:
++                  // RSP2SQL.g:235:4: n= STARTSW
++                  {
++                      n = (pANTLR3_BASE_TREE) MATCHT(STARTSW, &FOLLOW_STARTSW_in_strop300); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulestropEx;
++                      }
++
++                      {
++                           op= n->getToken(n); 
++                      }
++
++                  }
++                  break;
++              case 4:
++                  // RSP2SQL.g:237:4: n= ENDSW
++                  {
++                      n = (pANTLR3_BASE_TREE) MATCHT(ENDSW, &FOLLOW_ENDSW_in_strop313); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulestropEx;
++                      }
++
++                      {
++                           op= n->getToken(n); 
++                      }
++
++                  }
++                  break;
++
++            }
++        }
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto rulestropEx; /* Prevent compiler warnings */
++    rulestropEx: ;
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++            }
++
++
++    return op;
++}
++/* $ANTLR end strop */
++
++/** 
++ * $ANTLR start intcrit
++ * RSP2SQL.g:241:1: intcrit returns [ pANTLR3_STRING result, int valid ] : ^(o= intop f= FIELD i= INT ) ;
++ */
++static RSP2SQL_intcrit_return
++intcrit(pRSP2SQL ctx)
++{   
++    RSP2SQL_intcrit_return retval;
++
++    pANTLR3_BASE_TREE    f;
++    pANTLR3_BASE_TREE    i;
++    pANTLR3_COMMON_TOKEN o;
++    #undef    RETURN_TYPE_o
++    #define   RETURN_TYPE_o pANTLR3_COMMON_TOKEN
++
++    /* Initialize rule variables
++     */
++
++
++     retval.result= NULL; retval.valid= 1; 
++    f       = NULL;
++    i       = NULL;
++    o = NULL;
++    retval.start = LT(1); retval.stop = retval.start;
++
++    {
++        // RSP2SQL.g:243:2: ( ^(o= intop f= FIELD i= INT ) )
++        // RSP2SQL.g:243:4: ^(o= intop f= FIELD i= INT )
++        {
++            FOLLOWPUSH(FOLLOW_intop_in_intcrit342);
++            o=intop(ctx);
++
++            FOLLOWPOP();
++            if  (HASEXCEPTION())
++            {
++                goto ruleintcritEx;
++            }
++
++
++            MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
++            if  (HASEXCEPTION())
++            {
++                goto ruleintcritEx;
++            }
++
++            f = (pANTLR3_BASE_TREE) MATCHT(FIELD, &FOLLOW_FIELD_in_intcrit348); 
++            if  (HASEXCEPTION())
++            {
++                goto ruleintcritEx;
++            }
++
++            i = (pANTLR3_BASE_TREE) MATCHT(INT, &FOLLOW_INT_in_intcrit354); 
++            if  (HASEXCEPTION())
++            {
++                goto ruleintcritEx;
++            }
++
++
++            MATCHT(ANTLR3_TOKEN_UP, NULL); 
++            if  (HASEXCEPTION())
++            {
++                goto ruleintcritEx;
++            }
++
++            {
++
++                                      char *op;
++                                      const struct rsp_query_field_map *rqfp;
++                                      pANTLR3_STRING field;
++
++                                      op = NULL;
++                                      switch (o->getType(o))
++                                      {
++                                              case EQUAL:
++                                                      op = " = ";
++                                                      break;
++
++                                              case LESS:
++                                                      op = " < ";
++                                                      break;
++
++                                              case GREATER:
++                                                      op = " > ";
++                                                      break;
++
++                                              case LTE:
++                                                      op = " <= ";
++                                                      break;
++
++                                              case GTE:
++                                                      op = " >= ";
++                                                      break;
++                                      }
++
++                                      field = f->getText(f);
++
++                                      /* Field lookup */
++                                      rqfp = rsp_query_field_lookup((char *)field->chars, strlen((char *)field->chars));
++                                      if (!rqfp)
++                                      {
++                                              DPRINTF(E_LOG, L_RSP, "Field '%s' is not a valid field in queries\n", field->chars);
++                                              retval.valid= 0;
++                                              goto intcrit_valid_0; /* ABORT */
++                                      }
++
++                                      /* Check field type */
++                                      if (rqfp->field_type != RSP_TYPE_INT)
++                                      {
++                                              DPRINTF(E_LOG, L_RSP, "Field '%s' is not an integer field\n", field->chars);
++                                              retval.valid= 0;
++                                              goto intcrit_valid_0; /* ABORT */
++                                      }
++
++                                      retval.result= field->factory->newRaw(field->factory);
++                                      retval.result->append8(retval.result, "f.");
++                                      retval.result->appendS(retval.result, field);
++                                      retval.result->append8(retval.result, op);
++                                      retval.result->appendS(retval.result, i->getText(i));
++
++                                      intcrit_valid_0:
++                                              ;
++                              
++            }
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruleintcritEx; /* Prevent compiler warnings */
++    ruleintcritEx: ;
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++            }
++
++
++    return retval;
++}
++/* $ANTLR end intcrit */
++
++/** 
++ * $ANTLR start intop
++ * RSP2SQL.g:303:1: intop returns [ pANTLR3_COMMON_TOKEN op ] : (n= EQUAL | n= LESS | n= GREATER | n= LTE | n= GTE );
++ */
++static pANTLR3_COMMON_TOKEN
++intop(pRSP2SQL ctx)
++{   
++    pANTLR3_COMMON_TOKEN op = NULL;
++
++    pANTLR3_BASE_TREE    n;
++
++    /* Initialize rule variables
++     */
++
++
++     op= NULL; 
++    n       = NULL;
++
++    {
++        {
++            //  RSP2SQL.g:305:2: (n= EQUAL | n= LESS | n= GREATER | n= LTE | n= GTE )
++            
++            ANTLR3_UINT32 alt3;
++
++            alt3=5;
++
++            switch ( LA(1) ) 
++            {
++            case EQUAL:
++              {
++                      alt3=1;
++              }
++                break;
++            case LESS:
++              {
++                      alt3=2;
++              }
++                break;
++            case GREATER:
++              {
++                      alt3=3;
++              }
++                break;
++            case LTE:
++              {
++                      alt3=4;
++              }
++                break;
++            case GTE:
++              {
++                      alt3=5;
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 3;
++                EXCEPTION->state        = 0;
++
++
++                goto ruleintopEx;
++            }
++
++            switch (alt3) 
++            {
++              case 1:
++                  // RSP2SQL.g:305:4: n= EQUAL
++                  {
++                      n = (pANTLR3_BASE_TREE) MATCHT(EQUAL, &FOLLOW_EQUAL_in_intop383); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleintopEx;
++                      }
++
++                      {
++                           op= n->getToken(n); 
++                      }
++
++                  }
++                  break;
++              case 2:
++                  // RSP2SQL.g:307:4: n= LESS
++                  {
++                      n = (pANTLR3_BASE_TREE) MATCHT(LESS, &FOLLOW_LESS_in_intop396); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleintopEx;
++                      }
++
++                      {
++                           op= n->getToken(n); 
++                      }
++
++                  }
++                  break;
++              case 3:
++                  // RSP2SQL.g:309:4: n= GREATER
++                  {
++                      n = (pANTLR3_BASE_TREE) MATCHT(GREATER, &FOLLOW_GREATER_in_intop409); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleintopEx;
++                      }
++
++                      {
++                           op= n->getToken(n); 
++                      }
++
++                  }
++                  break;
++              case 4:
++                  // RSP2SQL.g:311:4: n= LTE
++                  {
++                      n = (pANTLR3_BASE_TREE) MATCHT(LTE, &FOLLOW_LTE_in_intop422); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleintopEx;
++                      }
++
++                      {
++                           op= n->getToken(n); 
++                      }
++
++                  }
++                  break;
++              case 5:
++                  // RSP2SQL.g:313:4: n= GTE
++                  {
++                      n = (pANTLR3_BASE_TREE) MATCHT(GTE, &FOLLOW_GTE_in_intop435); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleintopEx;
++                      }
++
++                      {
++                           op= n->getToken(n); 
++                      }
++
++                  }
++                  break;
++
++            }
++        }
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruleintopEx; /* Prevent compiler warnings */
++    ruleintopEx: ;
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++            }
++
++
++    return op;
++}
++/* $ANTLR end intop */
++
++/** 
++ * $ANTLR start datecrit
++ * RSP2SQL.g:317:1: datecrit returns [ pANTLR3_STRING result, int valid ] : ^(o= dateop f= FIELD d= datespec ) ;
++ */
++static RSP2SQL_datecrit_return
++datecrit(pRSP2SQL ctx)
++{   
++    RSP2SQL_datecrit_return retval;
++
++    pANTLR3_BASE_TREE    f;
++    pANTLR3_COMMON_TOKEN o;
++    #undef    RETURN_TYPE_o
++    #define   RETURN_TYPE_o pANTLR3_COMMON_TOKEN
++
++    RSP2SQL_datespec_return d;
++    #undef    RETURN_TYPE_d
++    #define   RETURN_TYPE_d RSP2SQL_datespec_return
++
++    /* Initialize rule variables
++     */
++
++
++     retval.result= NULL; retval.valid= 1; 
++    f       = NULL;
++    o = NULL;
++    retval.start = LT(1); retval.stop = retval.start;
++
++    {
++        // RSP2SQL.g:319:2: ( ^(o= dateop f= FIELD d= datespec ) )
++        // RSP2SQL.g:319:4: ^(o= dateop f= FIELD d= datespec )
++        {
++            FOLLOWPUSH(FOLLOW_dateop_in_datecrit464);
++            o=dateop(ctx);
++
++            FOLLOWPOP();
++            if  (HASEXCEPTION())
++            {
++                goto ruledatecritEx;
++            }
++
++
++            MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
++            if  (HASEXCEPTION())
++            {
++                goto ruledatecritEx;
++            }
++
++            f = (pANTLR3_BASE_TREE) MATCHT(FIELD, &FOLLOW_FIELD_in_datecrit470); 
++            if  (HASEXCEPTION())
++            {
++                goto ruledatecritEx;
++            }
++
++            FOLLOWPUSH(FOLLOW_datespec_in_datecrit476);
++            d=datespec(ctx);
++
++            FOLLOWPOP();
++            if  (HASEXCEPTION())
++            {
++                goto ruledatecritEx;
++            }
++
++
++            MATCHT(ANTLR3_TOKEN_UP, NULL); 
++            if  (HASEXCEPTION())
++            {
++                goto ruledatecritEx;
++            }
++
++            {
++
++                                      char *op;
++                                      const struct rsp_query_field_map *rqfp;
++                                      pANTLR3_STRING field;
++                                      char buf[32];
++                                      int ret;
++
++                                      op = NULL;
++                                      switch (o->getType(o))
++                                      {
++                                              case BEFORE:
++                                                      op = " < ";
++                                                      break;
++
++                                              case AFTER:
++                                                      op = " > ";
++                                                      break;
++                                      }
++
++                                      field = f->getText(f);
++
++                                      /* Field lookup */
++                                      rqfp = rsp_query_field_lookup((char *)field->chars, strlen((char *)field->chars));
++                                      if (!rqfp)
++                                      {
++                                              DPRINTF(E_LOG, L_RSP, "Field '%s' is not a valid field in queries\n", field->chars);
++                                              retval.valid= 0;
++                                              goto datecrit_valid_0; /* ABORT */
++                                      }
++
++                                      /* Check field type */
++                                      if (rqfp->field_type != RSP_TYPE_DATE)
++                                      {
++                                              DPRINTF(E_LOG, L_RSP, "Field '%s' is not a date field\n", field->chars);
++                                              retval.valid= 0;
++                                              goto datecrit_valid_0; /* ABORT */
++                                      }
++
++                                      ret = snprintf(buf, sizeof(buf), "%ld", d.date);
++                                      if ((ret < 0) || (ret >= sizeof(buf)))
++                                      {
++                                              DPRINTF(E_LOG, L_RSP, "Date %ld too large for buffer, oops!\n", d.date);
++                                              retval.valid= 0;
++                                              goto datecrit_valid_0; /* ABORT */
++                                      }
++
++                                      retval.result= field->factory->newRaw(field->factory);
++                                      retval.result->append8(retval.result, "f.");
++                                      retval.result->appendS(retval.result, field);
++                                      retval.result->append8(retval.result, op);
++                                      retval.result->append8(retval.result, buf);
++
++                                      datecrit_valid_0:
++                                              ;
++                              
++            }
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruledatecritEx; /* Prevent compiler warnings */
++    ruledatecritEx: ;
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++            }
++
++
++    return retval;
++}
++/* $ANTLR end datecrit */
++
++/** 
++ * $ANTLR start dateop
++ * RSP2SQL.g:377:1: dateop returns [ pANTLR3_COMMON_TOKEN op ] : (n= BEFORE | n= AFTER );
++ */
++static pANTLR3_COMMON_TOKEN
++dateop(pRSP2SQL ctx)
++{   
++    pANTLR3_COMMON_TOKEN op = NULL;
++
++    pANTLR3_BASE_TREE    n;
++
++    /* Initialize rule variables
++     */
++
++
++     op= NULL; 
++    n       = NULL;
++
++    {
++        {
++            //  RSP2SQL.g:379:2: (n= BEFORE | n= AFTER )
++            
++            ANTLR3_UINT32 alt4;
++
++            alt4=2;
++
++            switch ( LA(1) ) 
++            {
++            case BEFORE:
++              {
++                      alt4=1;
++              }
++                break;
++            case AFTER:
++              {
++                      alt4=2;
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 4;
++                EXCEPTION->state        = 0;
++
++
++                goto ruledateopEx;
++            }
++
++            switch (alt4) 
++            {
++              case 1:
++                  // RSP2SQL.g:379:4: n= BEFORE
++                  {
++                      n = (pANTLR3_BASE_TREE) MATCHT(BEFORE, &FOLLOW_BEFORE_in_dateop505); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledateopEx;
++                      }
++
++                      {
++                           op= n->getToken(n); 
++                      }
++
++                  }
++                  break;
++              case 2:
++                  // RSP2SQL.g:381:4: n= AFTER
++                  {
++                      n = (pANTLR3_BASE_TREE) MATCHT(AFTER, &FOLLOW_AFTER_in_dateop518); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledateopEx;
++                      }
++
++                      {
++                           op= n->getToken(n); 
++                      }
++
++                  }
++                  break;
++
++            }
++        }
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruledateopEx; /* Prevent compiler warnings */
++    ruledateopEx: ;
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++            }
++
++
++    return op;
++}
++/* $ANTLR end dateop */
++
++/** 
++ * $ANTLR start datespec
++ * RSP2SQL.g:385:1: datespec returns [ time_t date, int valid ] : (r= dateref | ^(o= dateop r= dateref m= INT i= dateintval ) );
++ */
++static RSP2SQL_datespec_return
++datespec(pRSP2SQL ctx)
++{   
++    RSP2SQL_datespec_return retval;
++
++    pANTLR3_BASE_TREE    m;
++    RSP2SQL_dateref_return r;
++    #undef    RETURN_TYPE_r
++    #define   RETURN_TYPE_r RSP2SQL_dateref_return
++
++    pANTLR3_COMMON_TOKEN o;
++    #undef    RETURN_TYPE_o
++    #define   RETURN_TYPE_o pANTLR3_COMMON_TOKEN
++
++    RSP2SQL_dateintval_return i;
++    #undef    RETURN_TYPE_i
++    #define   RETURN_TYPE_i RSP2SQL_dateintval_return
++
++    /* Initialize rule variables
++     */
++
++
++     retval.date= 0; retval.valid= 1; 
++    m       = NULL;
++    o = NULL;
++    retval.start = LT(1); retval.stop = retval.start;
++
++    {
++        {
++            //  RSP2SQL.g:387:2: (r= dateref | ^(o= dateop r= dateref m= INT i= dateintval ) )
++            
++            ANTLR3_UINT32 alt5;
++
++            alt5=2;
++
++            switch ( LA(1) ) 
++            {
++            case DATE:
++            case TODAY:
++              {
++                      alt5=1;
++              }
++                break;
++            case BEFORE:
++            case AFTER:
++              {
++                      alt5=2;
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 5;
++                EXCEPTION->state        = 0;
++
++
++                goto ruledatespecEx;
++            }
++
++            switch (alt5) 
++            {
++              case 1:
++                  // RSP2SQL.g:387:4: r= dateref
++                  {
++                      FOLLOWPUSH(FOLLOW_dateref_in_datespec546);
++                      r=dateref(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatespecEx;
++                      }
++
++                      {
++
++                                              if (!r.valid)
++                                                      retval.valid= 0;
++                                              else
++                                                      retval.date= r.date;
++                                      
++                      }
++
++                  }
++                  break;
++              case 2:
++                  // RSP2SQL.g:394:4: ^(o= dateop r= dateref m= INT i= dateintval )
++                  {
++                      FOLLOWPUSH(FOLLOW_dateop_in_datespec560);
++                      o=dateop(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatespecEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_DOWN, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatespecEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_dateref_in_datespec566);
++                      r=dateref(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatespecEx;
++                      }
++
++                      m = (pANTLR3_BASE_TREE) MATCHT(INT, &FOLLOW_INT_in_datespec572); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatespecEx;
++                      }
++
++                      FOLLOWPUSH(FOLLOW_dateintval_in_datespec578);
++                      i=dateintval(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatespecEx;
++                      }
++
++
++                      MATCHT(ANTLR3_TOKEN_UP, NULL); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatespecEx;
++                      }
++
++                      {
++
++                                              int32_t val;
++                                              int ret;
++
++                                              if (!r.valid || !i.valid)
++                                              {
++                                                      retval.valid= 0;
++                                                      goto datespec_valid_0; /* ABORT */
++                                              }
++
++                                              ret = safe_atoi32((char *)m->getText(m)->chars, &val);
++                                              if (ret < 0)
++                                              {
++                                                      DPRINTF(E_LOG, L_RSP, "Could not convert '%s' to integer\n", (char *)m->getText(m));
++                                                      retval.valid= 0;
++                                                      goto datespec_valid_0; /* ABORT */
++                                              }
++
++                                              switch (o->getType(o))
++                                              {
++                                                      case BEFORE:
++                                                              retval.date= r.date - (val * i.period);
++                                                              break;
++
++                                                      case AFTER:
++                                                              retval.date= r.date + (val * i.period);
++                                                              break;
++                                              }
++
++                                              datespec_valid_0:
++                                                      ;
++                                      
++                      }
++
++                  }
++                  break;
++
++            }
++        }
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruledatespecEx; /* Prevent compiler warnings */
++    ruledatespecEx: ;
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++            }
++
++
++    return retval;
++}
++/* $ANTLR end datespec */
++
++/** 
++ * $ANTLR start dateref
++ * RSP2SQL.g:429:1: dateref returns [ time_t date, int valid ] : (n= DATE | TODAY );
++ */
++static RSP2SQL_dateref_return
++dateref(pRSP2SQL ctx)
++{   
++    RSP2SQL_dateref_return retval;
++
++    pANTLR3_BASE_TREE    n;
++
++    /* Initialize rule variables
++     */
++
++
++     retval.date= 0; retval.valid= 1; 
++    n       = NULL;
++    retval.start = LT(1); retval.stop = retval.start;
++
++    {
++        {
++            //  RSP2SQL.g:431:2: (n= DATE | TODAY )
++            
++            ANTLR3_UINT32 alt6;
++
++            alt6=2;
++
++            switch ( LA(1) ) 
++            {
++            case DATE:
++              {
++                      alt6=1;
++              }
++                break;
++            case TODAY:
++              {
++                      alt6=2;
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 6;
++                EXCEPTION->state        = 0;
++
++
++                goto ruledaterefEx;
++            }
++
++            switch (alt6) 
++            {
++              case 1:
++                  // RSP2SQL.g:431:4: n= DATE
++                  {
++                      n = (pANTLR3_BASE_TREE) MATCHT(DATE, &FOLLOW_DATE_in_dateref607); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledaterefEx;
++                      }
++
++                      {
++
++                                              struct tm tm;
++                                              char *ret;
++
++                                              ret = strptime((char *)n->getText(n), "%Y-%m-%d", &tm);
++                                              if (!ret)
++                                              {
++                                                      DPRINTF(E_LOG, L_RSP, "Date '%s' could not be interpreted\n", (char *)n->getText(n));
++                                                      retval.valid= 0;
++                                                      goto dateref_valid_0; /* ABORT */
++                                              }
++                                              else
++                                              {
++                                                      if (*ret != '\0')
++                                                              DPRINTF(E_LOG, L_RSP, "Garbage at end of date '%s' ?!\n", (char *)n->getText(n));
++
++                                                      retval.date= mktime(&tm);
++                                                      if (retval.date == (time_t) -1)
++                                                      {
++                                                              DPRINTF(E_LOG, L_RSP, "Date '%s' could not be converted to an epoch\n", (char *)n->getText(n));
++                                                              retval.valid= 0;
++                                                              goto dateref_valid_0; /* ABORT */
++                                                      }
++                                              }
++
++                                              dateref_valid_0:
++                                                      ;
++                                      
++                      }
++
++                  }
++                  break;
++              case 2:
++                  // RSP2SQL.g:460:4: TODAY
++                  {
++                       MATCHT(TODAY, &FOLLOW_TODAY_in_dateref616); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledaterefEx;
++                      }
++
++                      {
++                           retval.date= time(NULL); 
++                      }
++
++                  }
++                  break;
++
++            }
++        }
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruledaterefEx; /* Prevent compiler warnings */
++    ruledaterefEx: ;
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++            }
++
++
++    return retval;
++}
++/* $ANTLR end dateref */
++
++/** 
++ * $ANTLR start dateintval
++ * RSP2SQL.g:464:1: dateintval returns [ time_t period, int valid ] : ( DAY | WEEK | MONTH | YEAR );
++ */
++static RSP2SQL_dateintval_return
++dateintval(pRSP2SQL ctx)
++{   
++    RSP2SQL_dateintval_return retval;
++
++    /* Initialize rule variables
++     */
++
++
++     retval.period= 0; retval.valid= 1; 
++    retval.start = LT(1); retval.stop = retval.start;
++
++    {
++        {
++            //  RSP2SQL.g:466:2: ( DAY | WEEK | MONTH | YEAR )
++            
++            ANTLR3_UINT32 alt7;
++
++            alt7=4;
++
++            switch ( LA(1) ) 
++            {
++            case DAY:
++              {
++                      alt7=1;
++              }
++                break;
++            case WEEK:
++              {
++                      alt7=2;
++              }
++                break;
++            case MONTH:
++              {
++                      alt7=3;
++              }
++                break;
++            case YEAR:
++              {
++                      alt7=4;
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 7;
++                EXCEPTION->state        = 0;
++
++
++                goto ruledateintvalEx;
++            }
++
++            switch (alt7) 
++            {
++              case 1:
++                  // RSP2SQL.g:466:4: DAY
++                  {
++                       MATCHT(DAY, &FOLLOW_DAY_in_dateintval640); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledateintvalEx;
++                      }
++
++                      {
++                           retval.period= 24 * 60 * 60; 
++                      }
++
++                  }
++                  break;
++              case 2:
++                  // RSP2SQL.g:468:4: WEEK
++                  {
++                       MATCHT(WEEK, &FOLLOW_WEEK_in_dateintval649); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledateintvalEx;
++                      }
++
++                      {
++                           retval.period= 7 * 24 * 60 * 60; 
++                      }
++
++                  }
++                  break;
++              case 3:
++                  // RSP2SQL.g:470:4: MONTH
++                  {
++                       MATCHT(MONTH, &FOLLOW_MONTH_in_dateintval658); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledateintvalEx;
++                      }
++
++                      {
++                           retval.period= 30 * 24 * 60 * 60; 
++                      }
++
++                  }
++                  break;
++              case 4:
++                  // RSP2SQL.g:472:4: YEAR
++                  {
++                       MATCHT(YEAR, &FOLLOW_YEAR_in_dateintval667); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledateintvalEx;
++                      }
++
++                      {
++                           retval.period= 365 * 24 * 60 * 60; 
++                      }
++
++                  }
++                  break;
++
++            }
++        }
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruledateintvalEx; /* Prevent compiler warnings */
++    ruledateintvalEx: ;
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++            }
++
++
++    return retval;
++}
++/* $ANTLR end dateintval */
++/* End of parsing rules
++ * ==============================================
++ */
++
++/* ==============================================
++ * Syntactic predicates
++ */
++/* End of syntactic predicates
++ * ==============================================
++ */
++
++ 
++ 
++
++
++
++/* End of code
++ * =============================================================================
++ */
+diff --git a/src/pregen/RSP2SQL.h b/src/pregen/RSP2SQL.h
+new file mode 100644
+index 0000000..2789fc7
+--- /dev/null
++++ b/src/pregen/RSP2SQL.h
+@@ -0,0 +1,291 @@
++/** \file
++ *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
++ *
++ *     -  From the grammar source file : RSP2SQL.g
++ *     -                            On : 2014-09-30 21:42:42
++ *     -           for the tree parser : RSP2SQLTreeParser *
++ * Editing it, at least manually, is not wise. 
++ *
++ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
++ *
++ *
++ * The tree parser RSP2SQL has the callable functions (rules) shown below,
++ * which will invoke the code for the associated rule in the source grammar
++ * assuming that the input stream is pointing to a token/text stream that could begin
++ * this rule.
++ * 
++ * For instance if you call the first (topmost) rule in a parser grammar, you will
++ * get the results of a full parse, but calling a rule half way through the grammar will
++ * allow you to pass part of a full token stream to the parser, such as for syntax checking
++ * in editors and so on.
++ *
++ * The parser entry points are called indirectly (by function pointer to function) via
++ * a parser context typedef pRSP2SQL, which is returned from a call to RSP2SQLNew().
++ *
++ * The methods in pRSP2SQL are  as follows:
++ *
++ *  - pANTLR3_STRING      pRSP2SQL->query(pRSP2SQL)
++ *  - RSP2SQL_expr_return      pRSP2SQL->expr(pRSP2SQL)
++ *  - RSP2SQL_strcrit_return      pRSP2SQL->strcrit(pRSP2SQL)
++ *  - pANTLR3_COMMON_TOKEN      pRSP2SQL->strop(pRSP2SQL)
++ *  - RSP2SQL_intcrit_return      pRSP2SQL->intcrit(pRSP2SQL)
++ *  - pANTLR3_COMMON_TOKEN      pRSP2SQL->intop(pRSP2SQL)
++ *  - RSP2SQL_datecrit_return      pRSP2SQL->datecrit(pRSP2SQL)
++ *  - pANTLR3_COMMON_TOKEN      pRSP2SQL->dateop(pRSP2SQL)
++ *  - RSP2SQL_datespec_return      pRSP2SQL->datespec(pRSP2SQL)
++ *  - RSP2SQL_dateref_return      pRSP2SQL->dateref(pRSP2SQL)
++ *  - RSP2SQL_dateintval_return      pRSP2SQL->dateintval(pRSP2SQL)
++ *
++ * The return type for any particular rule is of course determined by the source
++ * grammar file.
++ */
++// [The "BSD licence"]
++// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
++// http://www.temporal-wave.com
++// http://www.linkedin.com/in/jimidle
++//
++// All rights reserved.
++//
++// Redistribution and use in source and binary forms, with or without
++// modification, are permitted provided that the following conditions
++// are met:
++// 1. Redistributions of source code must retain the above copyright
++//    notice, this list of conditions and the following disclaimer.
++// 2. Redistributions in binary form must reproduce the above copyright
++//    notice, this list of conditions and the following disclaimer in the
++//    documentation and/or other materials provided with the distribution.
++// 3. The name of the author may not be used to endorse or promote products
++//    derived from this software without specific prior written permission.
++//
++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++#ifndef       _RSP2SQL_H
++#define _RSP2SQL_H
++/* =============================================================================
++ * Standard antlr3 C runtime definitions
++ */
++#include    <antlr3.h>
++
++/* End of standard antlr 3 runtime definitions
++ * =============================================================================
++ */
++ 
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++// Forward declare the context typedef so that we can use it before it is
++// properly defined. Delegators and delegates (from import statements) are
++// interdependent and their context structures contain pointers to each other
++// C only allows such things to be declared if you pre-declare the typedef.
++//
++typedef struct RSP2SQL_Ctx_struct RSP2SQL, * pRSP2SQL;
++
++
++
++      /* Needs #define _GNU_SOURCE for strptime() */
++
++      #include <stdio.h>
++      #include <string.h>
++      #include <time.h>
++      #include <stdint.h>
++
++      #include "logger.h"
++      #include "db.h"
++      #include "misc.h"
++      #include "rsp_query.h"
++
++
++#ifdef        ANTLR3_WINDOWS
++// Disable: Unreferenced parameter,                                                   - Rules with parameters that are not used
++//          constant conditional,                                                     - ANTLR realizes that a prediction is always true (synpred usually)
++//          initialized but unused variable                                   - tree rewrite variables declared but not needed
++//          Unreferenced local variable                                               - lexer rule declares but does not always use _type
++//          potentially unitialized variable used                     - retval always returned from a rule 
++//                    unreferenced local function has been removed    - susually getTokenNames or freeScope, they can go without warnigns
++//
++// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
++// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
++// usually generated when a parser rule is given a parameter that it does not use. Mostly though
++// this is a matter of orthogonality hence I disable that one.
++//
++#pragma warning( disable : 4100 )
++#pragma warning( disable : 4101 )
++#pragma warning( disable : 4127 )
++#pragma warning( disable : 4189 )
++#pragma warning( disable : 4505 )
++#pragma warning( disable : 4701 )
++#endif
++typedef struct RSP2SQL_expr_return_struct
++{
++    pANTLR3_BASE_TREE       start;
++    pANTLR3_BASE_TREE       stop;   
++    pANTLR3_STRING result;
++    int valid;
++}
++    RSP2SQL_expr_return;
++
++typedef struct RSP2SQL_strcrit_return_struct
++{
++    pANTLR3_BASE_TREE       start;
++    pANTLR3_BASE_TREE       stop;   
++    pANTLR3_STRING result;
++    int valid;
++}
++    RSP2SQL_strcrit_return;
++
++typedef struct RSP2SQL_intcrit_return_struct
++{
++    pANTLR3_BASE_TREE       start;
++    pANTLR3_BASE_TREE       stop;   
++    pANTLR3_STRING result;
++    int valid;
++}
++    RSP2SQL_intcrit_return;
++
++typedef struct RSP2SQL_datecrit_return_struct
++{
++    pANTLR3_BASE_TREE       start;
++    pANTLR3_BASE_TREE       stop;   
++    pANTLR3_STRING result;
++    int valid;
++}
++    RSP2SQL_datecrit_return;
++
++typedef struct RSP2SQL_datespec_return_struct
++{
++    pANTLR3_BASE_TREE       start;
++    pANTLR3_BASE_TREE       stop;   
++    time_t date;
++    int valid;
++}
++    RSP2SQL_datespec_return;
++
++typedef struct RSP2SQL_dateref_return_struct
++{
++    pANTLR3_BASE_TREE       start;
++    pANTLR3_BASE_TREE       stop;   
++    time_t date;
++    int valid;
++}
++    RSP2SQL_dateref_return;
++
++typedef struct RSP2SQL_dateintval_return_struct
++{
++    pANTLR3_BASE_TREE       start;
++    pANTLR3_BASE_TREE       stop;   
++    time_t period;
++    int valid;
++}
++    RSP2SQL_dateintval_return;
++
++
++
++/** Context tracking structure for RSP2SQL
++ */
++struct RSP2SQL_Ctx_struct
++{
++    /** Built in ANTLR3 context tracker contains all the generic elements
++     *  required for context tracking.
++     */
++    pANTLR3_TREE_PARSER           pTreeParser;
++
++
++     pANTLR3_STRING (*query)  (struct RSP2SQL_Ctx_struct * ctx);
++     RSP2SQL_expr_return (*expr)      (struct RSP2SQL_Ctx_struct * ctx);
++     RSP2SQL_strcrit_return (*strcrit)        (struct RSP2SQL_Ctx_struct * ctx);
++     pANTLR3_COMMON_TOKEN (*strop)    (struct RSP2SQL_Ctx_struct * ctx);
++     RSP2SQL_intcrit_return (*intcrit)        (struct RSP2SQL_Ctx_struct * ctx);
++     pANTLR3_COMMON_TOKEN (*intop)    (struct RSP2SQL_Ctx_struct * ctx);
++     RSP2SQL_datecrit_return (*datecrit)      (struct RSP2SQL_Ctx_struct * ctx);
++     pANTLR3_COMMON_TOKEN (*dateop)   (struct RSP2SQL_Ctx_struct * ctx);
++     RSP2SQL_datespec_return (*datespec)      (struct RSP2SQL_Ctx_struct * ctx);
++     RSP2SQL_dateref_return (*dateref)        (struct RSP2SQL_Ctx_struct * ctx);
++     RSP2SQL_dateintval_return (*dateintval)  (struct RSP2SQL_Ctx_struct * ctx);
++    // Delegated rules
++    const char * (*getGrammarFileName)();
++    void          (*free)   (struct RSP2SQL_Ctx_struct * ctx);
++        
++};
++
++// Function protoypes for the constructor functions that external translation units
++// such as delegators and delegates may wish to call.
++//
++ANTLR3_API pRSP2SQL RSP2SQLNew         (pANTLR3_COMMON_TREE_NODE_STREAM instream);
++ANTLR3_API pRSP2SQL RSP2SQLNewSSD      (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
++
++/** Symbolic definitions of all the tokens that the tree parser will work with.
++ * \{
++ *
++ * Antlr will define EOF, but we can't use that as it it is too common in
++ * in C header files and that would be confusing. There is no way to filter this out at the moment
++ * so we just undef it here for now. That isn't the value we get back from C recognizers
++ * anyway. We are looking for ANTLR3_TOKEN_EOF.
++ */
++#ifdef        EOF
++#undef        EOF
++#endif
++#ifdef        Tokens
++#undef        Tokens
++#endif 
++#define STARTSW      14
++#define WEEK      26
++#define TODAY      24
++#define YEAR      28
++#define ENDSW      15
++#define GTE      20
++#define BEFORE      21
++#define DAY      25
++#define INT      16
++#define NOT      11
++#define AFTER      22
++#define AND      6
++#define EOF      -1
++#define LTE      19
++#define MONTH      27
++#define DIGIT19      31
++#define INCLUDES      13
++#define STR      10
++#define QUOTE      29
++#define GREATER      18
++#define WS      30
++#define LPAR      7
++#define NEWLINE      4
++#define EQUAL      12
++#define OR      5
++#define LESS      17
++#define FIELD      9
++#define RPAR      8
++#define ESCAPED      33
++#define DATE      23
++#define DIGIT09      32
++#ifdef        EOF
++#undef        EOF
++#define       EOF     ANTLR3_TOKEN_EOF
++#endif
++
++#ifndef TOKENSOURCE
++#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
++#endif
++
++/* End of token definitions for RSP2SQL
++ * =============================================================================
++ */
++/** \} */
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
++
++/* END - Note:Keep extra line feed to satisfy UNIX systems */
+diff --git a/src/pregen/RSP2SQL.u b/src/pregen/RSP2SQL.u
+new file mode 100644
+index 0000000..53d8cda
+--- /dev/null
++++ b/src/pregen/RSP2SQL.u
+@@ -0,0 +1,5 @@
++RSP2SQL.g: RSP.tokens
++RSP2SQL.c : RSP2SQL.g
++./RSP2SQL.tokens : RSP2SQL.g
++RSP2SQL.h : RSP2SQL.g
++ANTLR_PRODUCTS += RSP2SQL.c ./RSP2SQL.tokens RSP2SQL.h 
+\ No newline at end of file
+diff --git a/src/pregen/RSPLexer.c b/src/pregen/RSPLexer.c
+new file mode 100644
+index 0000000..ee23c08
+--- /dev/null
++++ b/src/pregen/RSPLexer.c
+@@ -0,0 +1,4867 @@
++/** \file
++ *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
++ *
++ *     -  From the grammar source file : RSP.g
++ *     -                            On : 2014-09-30 21:42:41
++ *     -                 for the lexer : RSPLexerLexer *
++ * Editing it, at least manually, is not wise. 
++ *
++ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
++ *
++ *
++*/
++// [The "BSD licence"]
++// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
++// http://www.temporal-wave.com
++// http://www.linkedin.com/in/jimidle
++//
++// All rights reserved.
++//
++// Redistribution and use in source and binary forms, with or without
++// modification, are permitted provided that the following conditions
++// are met:
++// 1. Redistributions of source code must retain the above copyright
++//    notice, this list of conditions and the following disclaimer.
++// 2. Redistributions in binary form must reproduce the above copyright
++//    notice, this list of conditions and the following disclaimer in the
++//    documentation and/or other materials provided with the distribution.
++// 3. The name of the author may not be used to endorse or promote products
++//    derived from this software without specific prior written permission.
++//
++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++/* -----------------------------------------
++ * Include the ANTLR3 generated header file.
++ */
++#include    "RSPLexer.h"
++/* ----------------------------------------- */
++
++
++/** String literals used by RSPLexer that we must do things like MATCHS() with.
++ *  C will normally just lay down 8 bit characters, and you can use L"xxx" to
++ *  get wchar_t, but wchar_t is 16 bits on Windows, which is not UTF32 and so
++ *  we perform this little trick of defining the literals as arrays of UINT32
++ *  and passing in the address of these.
++ */
++static ANTLR3_UCHAR   lit_1[]  = { 0x61, 0x6E, 0x64,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_2[]  = { 0x6F, 0x72,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_3[]  = { 0x69, 0x6E, 0x63, 0x6C, 0x75, 0x64, 0x65, 0x73,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_4[]  = { 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x77, 0x69, 0x74, 0x68,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_5[]  = { 0x65, 0x6E, 0x64, 0x73, 0x77, 0x69, 0x74, 0x68,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_6[]  = { 0x3E, 0x3D,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_7[]  = { 0x3C, 0x3D,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_8[]  = { 0x62, 0x65, 0x66, 0x6F, 0x72, 0x65,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_9[]  = { 0x61, 0x66, 0x74, 0x65, 0x72,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_10[]  = { 0x64, 0x61, 0x79,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_11[]  = { 0x64, 0x61, 0x79, 0x73,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_12[]  = { 0x77, 0x65, 0x65, 0x6B,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_13[]  = { 0x77, 0x65, 0x65, 0x6B, 0x73,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_14[]  = { 0x6D, 0x6F, 0x6E, 0x74, 0x68,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_15[]  = { 0x6D, 0x6F, 0x6E, 0x74, 0x68, 0x73,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_16[]  = { 0x79, 0x65, 0x61, 0x72,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_17[]  = { 0x79, 0x65, 0x61, 0x72, 0x73,  ANTLR3_STRING_TERMINATOR};
++static ANTLR3_UCHAR   lit_18[]  = { 0x74, 0x6F, 0x64, 0x61, 0x79,  ANTLR3_STRING_TERMINATOR};
++
++
++
++
++/* MACROS that hide the C interface implementations from the
++ * generated code, which makes it a little more understandable to the human eye.
++ * I am very much against using C pre-processor macros for function calls and bits
++ * of code as you cannot see what is happening when single stepping in debuggers
++ * and so on. The exception (in my book at least) is for generated code, where you are
++ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
++ * hides some indirect calls, but is always referring to the input stream. This is
++ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
++ * the runtime interfaces without changing the generated code too often, without
++ * confusing the reader of the generated output, who may not wish to know the gory
++ * details of the interface inheritance.
++ */
++ 
++#define               CTX     ctx
++
++/* Aids in accessing scopes for grammar programmers
++ */
++#undef        SCOPE_TYPE
++#undef        SCOPE_STACK
++#undef        SCOPE_TOP
++#define       SCOPE_TYPE(scope)   pRSPLexer_##scope##_SCOPE
++#define SCOPE_STACK(scope)  pRSPLexer_##scope##Stack
++#define       SCOPE_TOP(scope)    ctx->pRSPLexer_##scope##Top
++#define       SCOPE_SIZE(scope)               ctx->pRSPLexer_##scope##Stack_limit
++#define SCOPE_INSTANCE(scope, i)      (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
++
++ 
++/* Macros for accessing things in a lexer
++ */
++#undef            LEXER
++#undef            RECOGNIZER              
++#undef            RULEMEMO                
++#undef            GETCHARINDEX
++#undef            GETLINE
++#undef            GETCHARPOSITIONINLINE
++#undef            EMIT
++#undef            EMITNEW
++#undef            MATCHC
++#undef            MATCHS
++#undef            MATCHRANGE
++#undef            LTOKEN
++#undef            HASFAILED
++#undef            FAILEDFLAG
++#undef            INPUT
++#undef            STRSTREAM
++#undef            LA
++#undef            HASEXCEPTION
++#undef            EXCEPTION
++#undef            CONSTRUCTEX
++#undef            CONSUME
++#undef            LRECOVER
++#undef            MARK
++#undef            REWIND
++#undef            REWINDLAST
++#undef            BACKTRACKING
++#undef                MATCHANY
++#undef                MEMOIZE
++#undef                HAVEPARSEDRULE
++#undef                GETTEXT
++#undef                INDEX
++#undef                SEEK
++#undef                PUSHSTREAM
++#undef                POPSTREAM
++#undef                SETTEXT
++#undef                SETTEXT8
++
++#define           LEXER                                       ctx->pLexer
++#define           RECOGNIZER                      LEXER->rec
++#define               LEXSTATE                                RECOGNIZER->state
++#define               TOKSOURCE                               LEXSTATE->tokSource
++#define           GETCHARINDEX()                      LEXER->getCharIndex(LEXER)
++#define           GETLINE()                           LEXER->getLine(LEXER)
++#define           GETTEXT()                           LEXER->getText(LEXER)
++#define           GETCHARPOSITIONINLINE() LEXER->getCharPositionInLine(LEXER)
++#define           EMIT()                                      LEXSTATE->type = _type; LEXER->emit(LEXER)
++#define           EMITNEW(t)                          LEXER->emitNew(LEXER, t)
++#define           MATCHC(c)                           LEXER->matchc(LEXER, c)
++#define           MATCHS(s)                           LEXER->matchs(LEXER, s)
++#define           MATCHRANGE(c1,c2)       LEXER->matchRange(LEXER, c1, c2)
++#define           MATCHANY()                          LEXER->matchAny(LEXER)
++#define           LTOKEN                              LEXSTATE->token
++#define           HASFAILED()                         (LEXSTATE->failed == ANTLR3_TRUE)
++#define           BACKTRACKING                        LEXSTATE->backtracking
++#define           FAILEDFLAG                          LEXSTATE->failed
++#define           INPUT                                       LEXER->input
++#define           STRSTREAM                           INPUT
++#define               ISTREAM                                 INPUT->istream
++#define               INDEX()                                 ISTREAM->index(ISTREAM)
++#define               SEEK(n)                                 ISTREAM->seek(ISTREAM, n)
++#define           EOF_TOKEN                           &(LEXSTATE->tokSource->eofToken)
++#define           HASEXCEPTION()                      (LEXSTATE->error == ANTLR3_TRUE)
++#define           EXCEPTION                           LEXSTATE->exception
++#define           CONSTRUCTEX()                       RECOGNIZER->exConstruct(RECOGNIZER)
++#define           LRECOVER()                          LEXER->recover(LEXER)
++#define           MARK()                                      ISTREAM->mark(ISTREAM)
++#define           REWIND(m)                           ISTREAM->rewind(ISTREAM, m)
++#define           REWINDLAST()                        ISTREAM->rewindLast(ISTREAM)
++#define               MEMOIZE(ri,si)                  RECOGNIZER->memoize(RECOGNIZER, ri, si)
++#define               HAVEPARSEDRULE(r)               RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
++#define               PUSHSTREAM(str)                 LEXER->pushCharStream(LEXER, str)
++#define               POPSTREAM()                             LEXER->popCharStream(LEXER)
++#define               SETTEXT(str)                    LEXSTATE->text = str
++#define               SKIP()                                  LEXSTATE->token = &(TOKSOURCE->skipToken)
++#define               USER1                                   LEXSTATE->user1
++#define               USER2                                   LEXSTATE->user2
++#define               USER3                                   LEXSTATE->user3
++#define               CUSTOM                                  LEXSTATE->custom
++#define               RULEMEMO                                LEXSTATE->ruleMemo
++#define               DBG                                             RECOGNIZER->debugger
++
++/* If we have been told we can rely on the standard 8 bit or 16 bit input
++ * stream, then we can define our macros to use the direct pointers
++ * in the input object, which is much faster than indirect calls. This
++ * is really only significant to lexers with a lot of fragment rules (which
++ * do not place LA(1) in a temporary at the moment) and even then
++ * only if there is a lot of input (order of say 1M or so).
++ */
++#if   defined(ANTLR3_INLINE_INPUT_ASCII) || defined(ANTLR3_INLINE_INPUT_UTF16)
++
++# ifdef       ANTLR3_INLINE_INPUT_ASCII
++
++/* 8 bit "ASCII" (actually any 8 bit character set) */
++
++#  define         NEXTCHAR                    ((pANTLR3_UINT8)(INPUT->nextChar))
++#  define         DATAP                               ((pANTLR3_UINT8)(INPUT->data))
++
++# else
++
++#  define         NEXTCHAR                    ((pANTLR3_UINT16)(INPUT->nextChar)) 
++#  define         DATAP                               ((pANTLR3_UINT16)(INPUT->data))
++
++# endif
++
++# define          LA(n) ((NEXTCHAR + n) > (DATAP + INPUT->sizeBuf) ? ANTLR3_CHARSTREAM_EOF : (ANTLR3_UCHAR)(*(NEXTCHAR + n - 1)))
++# define          CONSUME()                                                                                   \
++{                                                                                                                                     \
++    if        (NEXTCHAR < (DATAP + INPUT->sizeBuf))                                           \
++    {                                                                                                                         \
++              INPUT->charPositionInLine++;                                                            \
++              if  ((ANTLR3_UCHAR)(*NEXTCHAR) == INPUT->newlineChar)           \
++              {                                                                                                                       \
++                      INPUT->line++;                                                                                  \
++                      INPUT->charPositionInLine       = 0;                                            \
++                      INPUT->currentLine              = (void *)(NEXTCHAR + 1);               \
++              }                                                                                                                       \
++              INPUT->nextChar = (void *)(NEXTCHAR + 1);                                       \
++    }                                                                                                                         \
++}
++
++#else
++
++// Pick up the input character by calling the input stream implementation.
++//
++#define           CONSUME()                           INPUT->istream->consume(INPUT->istream)
++#define           LA(n)                                       INPUT->istream->_LA(INPUT->istream, n)
++
++#endif
++#define               TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
++
++/* The 4 tokens defined below may well clash with your own #defines or token types. If so
++ * then for the present you must use different names for your defines as these are hard coded
++ * in the code generator. It would be better not to use such names internally, and maybe
++ * we can change this in a forthcoming release. I deliberately do not #undef these
++ * here as this will at least give you a redefined error somewhere if they clash.
++ */
++#define           UP      ANTLR3_TOKEN_UP
++#define           DOWN    ANTLR3_TOKEN_DOWN
++#define           EOR     ANTLR3_TOKEN_EOR
++#define           INVALID ANTLR3_TOKEN_INVALID
++
++
++/* =============================================================================
++ * Functions to create and destroy scopes. First come the rule scopes, followed
++ * by the global declared scopes.
++ */
++
++
++
++/* ============================================================================= */
++
++/* =============================================================================
++ * Start of recognizer
++ */
++
++
++/* Forward declare the locally static matching functions we have generated and any predicate functions.
++ */
++static ANTLR3_INLINE  void    mQUOTE    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mLPAR    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mRPAR    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mAND    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mOR    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mNOT    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mEQUAL    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mINCLUDES    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mSTARTSW    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mENDSW    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mGREATER    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mLESS    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mGTE    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mLTE    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mBEFORE    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mAFTER    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mDAY    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mWEEK    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mMONTH    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mYEAR    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mTODAY    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mNEWLINE    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mWS    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mFIELD    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mINT    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mDATE    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mSTR    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mESCAPED    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mDIGIT09    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mDIGIT19    (pRSPLexer ctx);
++static ANTLR3_INLINE  void    mTokens    (pRSPLexer ctx);
++static void   RSPLexerFree(pRSPLexer ctx);
++
++/* =========================================================================
++ * Lexer matching rules end.
++ * =========================================================================
++ */
++
++
++
++static void
++RSPLexerFree  (pRSPLexer ctx)
++{
++    LEXER->free(LEXER);
++    
++    ANTLR3_FREE(ctx);
++}
++
++/** \brief Name of the grammar file that generated this code
++ */
++static const char fileName[] = "RSP.g";
++
++/** \brief Return the name of the grammar file that generated this code.
++ */
++static const char * getGrammarFileName()
++{
++      return fileName;
++}
++
++/** \brief Create a new lexer called RSPLexer
++ *
++ * \param[in]    instream Pointer to an initialized input stream
++ * \return 
++ *     - Success pRSPLexer initialized for the lex start
++ *     - Fail NULL
++ */
++ANTLR3_API pRSPLexer RSPLexerNew         
++(pANTLR3_INPUT_STREAM instream)
++{
++      // See if we can create a new lexer with the standard constructor
++      //
++      return RSPLexerNewSSD(instream, NULL);
++}
++
++/** \brief Create a new lexer called RSPLexer
++ *
++ * \param[in]    instream Pointer to an initialized input stream
++ * \param[state] state Previously created shared recognizer stat
++ * \return 
++ *     - Success pRSPLexer initialized for the lex start
++ *     - Fail NULL
++ */
++ANTLR3_API pRSPLexer RSPLexerNewSSD         
++(pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
++{
++    pRSPLexer ctx; // Context structure we will build and return
++
++    ctx = (pRSPLexer) ANTLR3_CALLOC(1, sizeof(RSPLexer));
++
++    if  (ctx == NULL)
++    {
++        // Failed to allocate memory for lexer context
++        return  NULL;
++    }
++
++    /* -------------------------------------------------------------------
++     * Memory for basic structure is allocated, now to fill in
++     * in base ANTLR3 structures. We initialize the function pointers
++     * for the standard ANTLR3 lexer function set, but upon return
++     * from here, the programmer may set the pointers to provide custom
++     * implementations of each function. 
++     *
++     * We don't use the macros defined in RSPLexer.h here so you can get a sense
++     * of what goes where.
++     */
++    
++    /* Create a base lexer, using the supplied input stream
++     */
++    ctx->pLexer       = antlr3LexerNewStream(ANTLR3_SIZE_HINT, instream, state);
++    
++    /* Check that we allocated the memory correctly
++     */
++    if        (ctx->pLexer == NULL)
++    {
++              ANTLR3_FREE(ctx);
++              return  NULL;
++    }
++    /* Install the implementation of our RSPLexer interface
++     */
++    ctx->mQUOTE       = mQUOTE;
++    ctx->mLPAR        = mLPAR;
++    ctx->mRPAR        = mRPAR;
++    ctx->mAND = mAND;
++    ctx->mOR  = mOR;
++    ctx->mNOT = mNOT;
++    ctx->mEQUAL       = mEQUAL;
++    ctx->mINCLUDES    = mINCLUDES;
++    ctx->mSTARTSW     = mSTARTSW;
++    ctx->mENDSW       = mENDSW;
++    ctx->mGREATER     = mGREATER;
++    ctx->mLESS        = mLESS;
++    ctx->mGTE = mGTE;
++    ctx->mLTE = mLTE;
++    ctx->mBEFORE      = mBEFORE;
++    ctx->mAFTER       = mAFTER;
++    ctx->mDAY = mDAY;
++    ctx->mWEEK        = mWEEK;
++    ctx->mMONTH       = mMONTH;
++    ctx->mYEAR        = mYEAR;
++    ctx->mTODAY       = mTODAY;
++    ctx->mNEWLINE     = mNEWLINE;
++    ctx->mWS  = mWS;
++    ctx->mFIELD       = mFIELD;
++    ctx->mINT = mINT;
++    ctx->mDATE        = mDATE;
++    ctx->mSTR = mSTR;
++    ctx->mESCAPED     = mESCAPED;
++    ctx->mDIGIT09     = mDIGIT09;
++    ctx->mDIGIT19     = mDIGIT19;
++    ctx->mTokens      = mTokens;
++    
++    /** When the nextToken() call is made to this lexer's pANTLR3_TOKEN_SOURCE
++     *  it will call mTokens() in this generated code, and will pass it the ctx
++     * pointer of this lexer, not the context of the base lexer, so store that now.
++     */
++    ctx->pLexer->ctx      = ctx;
++    
++    /**Install the token matching function
++     */
++    ctx->pLexer->mTokens = (void (*) (void *))(mTokens);
++    
++    ctx->getGrammarFileName   = getGrammarFileName;
++    ctx->free         = RSPLexerFree;
++
++    
++    
++
++
++    /* Return the newly built lexer to the caller
++     */
++    return  ctx;
++}
++ 
++
++/* =========================================================================
++ * Functions to match the lexer grammar defined tokens from the input stream
++ */
++
++//   Comes from: 85:7: ( '\"' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start QUOTE
++ *
++ * Looks to match the characters the constitute the token QUOTE
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mQUOTE(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = QUOTE;
++       
++    
++    // RSP.g:85:7: ( '\"' )
++    // RSP.g:85:9: '\"'
++    {
++        MATCHC('"'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleQUOTEEx;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleQUOTEEx; /* Prevent compiler warnings */
++    ruleQUOTEEx: ;
++
++}
++// $ANTLR end QUOTE
++
++//   Comes from: 86:6: ( '(' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start LPAR
++ *
++ * Looks to match the characters the constitute the token LPAR
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mLPAR(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = LPAR;
++       
++    
++    // RSP.g:86:6: ( '(' )
++    // RSP.g:86:8: '('
++    {
++        MATCHC('('); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleLPAREx;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleLPAREx; /* Prevent compiler warnings */
++    ruleLPAREx: ;
++
++}
++// $ANTLR end LPAR
++
++//   Comes from: 87:6: ( ')' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start RPAR
++ *
++ * Looks to match the characters the constitute the token RPAR
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mRPAR(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = RPAR;
++       
++    
++    // RSP.g:87:6: ( ')' )
++    // RSP.g:87:8: ')'
++    {
++        MATCHC(')'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleRPAREx;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleRPAREx; /* Prevent compiler warnings */
++    ruleRPAREx: ;
++
++}
++// $ANTLR end RPAR
++
++//   Comes from: 89:5: ( 'and' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start AND
++ *
++ * Looks to match the characters the constitute the token AND
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mAND(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = AND;
++       
++    
++    // RSP.g:89:5: ( 'and' )
++    // RSP.g:89:7: 'and'
++    {
++        MATCHS(lit_1); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleANDEx;
++        }
++
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleANDEx; /* Prevent compiler warnings */
++    ruleANDEx: ;
++
++}
++// $ANTLR end AND
++
++//   Comes from: 90:4: ( 'or' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start OR
++ *
++ * Looks to match the characters the constitute the token OR
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mOR(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = OR;
++       
++    
++    // RSP.g:90:4: ( 'or' )
++    // RSP.g:90:6: 'or'
++    {
++        MATCHS(lit_2); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleOREx;
++        }
++
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleOREx; /* Prevent compiler warnings */
++    ruleOREx: ;
++
++}
++// $ANTLR end OR
++
++//   Comes from: 91:5: ( '!' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start NOT
++ *
++ * Looks to match the characters the constitute the token NOT
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mNOT(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = NOT;
++       
++    
++    // RSP.g:91:5: ( '!' )
++    // RSP.g:91:7: '!'
++    {
++        MATCHC('!'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleNOTEx;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleNOTEx; /* Prevent compiler warnings */
++    ruleNOTEx: ;
++
++}
++// $ANTLR end NOT
++
++//   Comes from: 94:7: ( '=' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start EQUAL
++ *
++ * Looks to match the characters the constitute the token EQUAL
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mEQUAL(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = EQUAL;
++       
++    
++    // RSP.g:94:7: ( '=' )
++    // RSP.g:94:9: '='
++    {
++        MATCHC('='); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleEQUALEx;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleEQUALEx; /* Prevent compiler warnings */
++    ruleEQUALEx: ;
++
++}
++// $ANTLR end EQUAL
++
++//   Comes from: 97:9: ( 'includes' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start INCLUDES
++ *
++ * Looks to match the characters the constitute the token INCLUDES
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mINCLUDES(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = INCLUDES;
++       
++    
++    // RSP.g:97:9: ( 'includes' )
++    // RSP.g:97:11: 'includes'
++    {
++        MATCHS(lit_3); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleINCLUDESEx;
++        }
++
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleINCLUDESEx; /* Prevent compiler warnings */
++    ruleINCLUDESEx: ;
++
++}
++// $ANTLR end INCLUDES
++
++//   Comes from: 98:9: ( 'startswith' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start STARTSW
++ *
++ * Looks to match the characters the constitute the token STARTSW
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mSTARTSW(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = STARTSW;
++       
++    
++    // RSP.g:98:9: ( 'startswith' )
++    // RSP.g:98:11: 'startswith'
++    {
++        MATCHS(lit_4); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleSTARTSWEx;
++        }
++
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleSTARTSWEx; /* Prevent compiler warnings */
++    ruleSTARTSWEx: ;
++
++}
++// $ANTLR end STARTSW
++
++//   Comes from: 99:7: ( 'endswith' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start ENDSW
++ *
++ * Looks to match the characters the constitute the token ENDSW
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mENDSW(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = ENDSW;
++       
++    
++    // RSP.g:99:7: ( 'endswith' )
++    // RSP.g:99:9: 'endswith'
++    {
++        MATCHS(lit_5); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleENDSWEx;
++        }
++
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleENDSWEx; /* Prevent compiler warnings */
++    ruleENDSWEx: ;
++
++}
++// $ANTLR end ENDSW
++
++//   Comes from: 102:9: ( '>' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start GREATER
++ *
++ * Looks to match the characters the constitute the token GREATER
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mGREATER(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = GREATER;
++       
++    
++    // RSP.g:102:9: ( '>' )
++    // RSP.g:102:11: '>'
++    {
++        MATCHC('>'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleGREATEREx;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleGREATEREx; /* Prevent compiler warnings */
++    ruleGREATEREx: ;
++
++}
++// $ANTLR end GREATER
++
++//   Comes from: 103:6: ( '<' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start LESS
++ *
++ * Looks to match the characters the constitute the token LESS
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mLESS(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = LESS;
++       
++    
++    // RSP.g:103:6: ( '<' )
++    // RSP.g:103:8: '<'
++    {
++        MATCHC('<'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleLESSEx;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleLESSEx; /* Prevent compiler warnings */
++    ruleLESSEx: ;
++
++}
++// $ANTLR end LESS
++
++//   Comes from: 104:5: ( '>=' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start GTE
++ *
++ * Looks to match the characters the constitute the token GTE
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mGTE(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = GTE;
++       
++    
++    // RSP.g:104:5: ( '>=' )
++    // RSP.g:104:7: '>='
++    {
++        MATCHS(lit_6); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleGTEEx;
++        }
++
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleGTEEx; /* Prevent compiler warnings */
++    ruleGTEEx: ;
++
++}
++// $ANTLR end GTE
++
++//   Comes from: 105:5: ( '<=' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start LTE
++ *
++ * Looks to match the characters the constitute the token LTE
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mLTE(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = LTE;
++       
++    
++    // RSP.g:105:5: ( '<=' )
++    // RSP.g:105:7: '<='
++    {
++        MATCHS(lit_7); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleLTEEx;
++        }
++
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleLTEEx; /* Prevent compiler warnings */
++    ruleLTEEx: ;
++
++}
++// $ANTLR end LTE
++
++//   Comes from: 108:8: ( 'before' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start BEFORE
++ *
++ * Looks to match the characters the constitute the token BEFORE
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mBEFORE(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = BEFORE;
++       
++    
++    // RSP.g:108:8: ( 'before' )
++    // RSP.g:108:10: 'before'
++    {
++        MATCHS(lit_8); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleBEFOREEx;
++        }
++
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleBEFOREEx; /* Prevent compiler warnings */
++    ruleBEFOREEx: ;
++
++}
++// $ANTLR end BEFORE
++
++//   Comes from: 109:7: ( 'after' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start AFTER
++ *
++ * Looks to match the characters the constitute the token AFTER
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mAFTER(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = AFTER;
++       
++    
++    // RSP.g:109:7: ( 'after' )
++    // RSP.g:109:9: 'after'
++    {
++        MATCHS(lit_9); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleAFTEREx;
++        }
++
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleAFTEREx; /* Prevent compiler warnings */
++    ruleAFTEREx: ;
++
++}
++// $ANTLR end AFTER
++
++//   Comes from: 110:5: ( 'day' | 'days' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start DAY
++ *
++ * Looks to match the characters the constitute the token DAY
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mDAY(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = DAY;
++       
++    
++    {
++        //  RSP.g:110:5: ( 'day' | 'days' )
++        
++        ANTLR3_UINT32 alt1;
++
++        alt1=2;
++
++        switch ( LA(1) ) 
++        {
++        case 'd':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'a':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'y':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 's':
++                                                              {
++                                                                      alt1=2;
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          alt1=1;}
++
++                                              }
++                                          break;
++
++                                      default:
++                                          CONSTRUCTEX();
++                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                          EXCEPTION->message      = (void *)"";
++                                          EXCEPTION->decisionNum  = 1;
++                                          EXCEPTION->state        = 2;
++
++
++                                          goto ruleDAYEx;
++                                      }
++
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 1;
++                          EXCEPTION->state        = 1;
++
++
++                          goto ruleDAYEx;
++                      }
++
++              }
++            break;
++
++        default:
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++            EXCEPTION->message      = (void *)"";
++            EXCEPTION->decisionNum  = 1;
++            EXCEPTION->state        = 0;
++
++
++            goto ruleDAYEx;
++        }
++
++        switch (alt1) 
++        {
++      case 1:
++          // RSP.g:110:7: 'day'
++          {
++              MATCHS(lit_10); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleDAYEx;
++              }
++
++
++
++          }
++          break;
++      case 2:
++          // RSP.g:110:15: 'days'
++          {
++              MATCHS(lit_11); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleDAYEx;
++              }
++
++
++
++          }
++          break;
++
++        }
++    }
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleDAYEx; /* Prevent compiler warnings */
++    ruleDAYEx: ;
++
++}
++// $ANTLR end DAY
++
++//   Comes from: 111:6: ( 'week' | 'weeks' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start WEEK
++ *
++ * Looks to match the characters the constitute the token WEEK
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mWEEK(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = WEEK;
++       
++    
++    {
++        //  RSP.g:111:6: ( 'week' | 'weeks' )
++        
++        ANTLR3_UINT32 alt2;
++
++        alt2=2;
++
++        switch ( LA(1) ) 
++        {
++        case 'w':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'e':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'e':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 'k':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case 's':
++                                                                              {
++                                                                                      alt2=2;
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          alt2=1;}
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          CONSTRUCTEX();
++                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                          EXCEPTION->message      = (void *)"";
++                                                          EXCEPTION->decisionNum  = 2;
++                                                          EXCEPTION->state        = 3;
++
++
++                                                          goto ruleWEEKEx;
++                                                      }
++
++                                              }
++                                          break;
++
++                                      default:
++                                          CONSTRUCTEX();
++                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                          EXCEPTION->message      = (void *)"";
++                                          EXCEPTION->decisionNum  = 2;
++                                          EXCEPTION->state        = 2;
++
++
++                                          goto ruleWEEKEx;
++                                      }
++
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 2;
++                          EXCEPTION->state        = 1;
++
++
++                          goto ruleWEEKEx;
++                      }
++
++              }
++            break;
++
++        default:
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++            EXCEPTION->message      = (void *)"";
++            EXCEPTION->decisionNum  = 2;
++            EXCEPTION->state        = 0;
++
++
++            goto ruleWEEKEx;
++        }
++
++        switch (alt2) 
++        {
++      case 1:
++          // RSP.g:111:8: 'week'
++          {
++              MATCHS(lit_12); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleWEEKEx;
++              }
++
++
++
++          }
++          break;
++      case 2:
++          // RSP.g:111:17: 'weeks'
++          {
++              MATCHS(lit_13); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleWEEKEx;
++              }
++
++
++
++          }
++          break;
++
++        }
++    }
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleWEEKEx; /* Prevent compiler warnings */
++    ruleWEEKEx: ;
++
++}
++// $ANTLR end WEEK
++
++//   Comes from: 112:7: ( 'month' | 'months' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start MONTH
++ *
++ * Looks to match the characters the constitute the token MONTH
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mMONTH(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = MONTH;
++       
++    
++    {
++        //  RSP.g:112:7: ( 'month' | 'months' )
++        
++        ANTLR3_UINT32 alt3;
++
++        alt3=2;
++
++        switch ( LA(1) ) 
++        {
++        case 'm':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'o':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'n':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 't':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case 'h':
++                                                                              {
++                                                                                      switch ( LA(6) ) 
++                                                                                      {
++                                                                                      case 's':
++                                                                                              {
++                                                                                                      alt3=2;
++                                                                                              }
++                                                                                          break;
++
++                                                                                      default:
++                                                                                          alt3=1;}
++
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          CONSTRUCTEX();
++                                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                                          EXCEPTION->message      = (void *)"";
++                                                                          EXCEPTION->decisionNum  = 3;
++                                                                          EXCEPTION->state        = 4;
++
++
++                                                                          goto ruleMONTHEx;
++                                                                      }
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          CONSTRUCTEX();
++                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                          EXCEPTION->message      = (void *)"";
++                                                          EXCEPTION->decisionNum  = 3;
++                                                          EXCEPTION->state        = 3;
++
++
++                                                          goto ruleMONTHEx;
++                                                      }
++
++                                              }
++                                          break;
++
++                                      default:
++                                          CONSTRUCTEX();
++                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                          EXCEPTION->message      = (void *)"";
++                                          EXCEPTION->decisionNum  = 3;
++                                          EXCEPTION->state        = 2;
++
++
++                                          goto ruleMONTHEx;
++                                      }
++
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 3;
++                          EXCEPTION->state        = 1;
++
++
++                          goto ruleMONTHEx;
++                      }
++
++              }
++            break;
++
++        default:
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++            EXCEPTION->message      = (void *)"";
++            EXCEPTION->decisionNum  = 3;
++            EXCEPTION->state        = 0;
++
++
++            goto ruleMONTHEx;
++        }
++
++        switch (alt3) 
++        {
++      case 1:
++          // RSP.g:112:9: 'month'
++          {
++              MATCHS(lit_14); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleMONTHEx;
++              }
++
++
++
++          }
++          break;
++      case 2:
++          // RSP.g:112:19: 'months'
++          {
++              MATCHS(lit_15); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleMONTHEx;
++              }
++
++
++
++          }
++          break;
++
++        }
++    }
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleMONTHEx; /* Prevent compiler warnings */
++    ruleMONTHEx: ;
++
++}
++// $ANTLR end MONTH
++
++//   Comes from: 113:6: ( 'year' | 'years' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start YEAR
++ *
++ * Looks to match the characters the constitute the token YEAR
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mYEAR(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = YEAR;
++       
++    
++    {
++        //  RSP.g:113:6: ( 'year' | 'years' )
++        
++        ANTLR3_UINT32 alt4;
++
++        alt4=2;
++
++        switch ( LA(1) ) 
++        {
++        case 'y':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'e':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'a':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 'r':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case 's':
++                                                                              {
++                                                                                      alt4=2;
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          alt4=1;}
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          CONSTRUCTEX();
++                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                          EXCEPTION->message      = (void *)"";
++                                                          EXCEPTION->decisionNum  = 4;
++                                                          EXCEPTION->state        = 3;
++
++
++                                                          goto ruleYEAREx;
++                                                      }
++
++                                              }
++                                          break;
++
++                                      default:
++                                          CONSTRUCTEX();
++                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                          EXCEPTION->message      = (void *)"";
++                                          EXCEPTION->decisionNum  = 4;
++                                          EXCEPTION->state        = 2;
++
++
++                                          goto ruleYEAREx;
++                                      }
++
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 4;
++                          EXCEPTION->state        = 1;
++
++
++                          goto ruleYEAREx;
++                      }
++
++              }
++            break;
++
++        default:
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++            EXCEPTION->message      = (void *)"";
++            EXCEPTION->decisionNum  = 4;
++            EXCEPTION->state        = 0;
++
++
++            goto ruleYEAREx;
++        }
++
++        switch (alt4) 
++        {
++      case 1:
++          // RSP.g:113:8: 'year'
++          {
++              MATCHS(lit_16); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleYEAREx;
++              }
++
++
++
++          }
++          break;
++      case 2:
++          // RSP.g:113:17: 'years'
++          {
++              MATCHS(lit_17); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleYEAREx;
++              }
++
++
++
++          }
++          break;
++
++        }
++    }
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleYEAREx; /* Prevent compiler warnings */
++    ruleYEAREx: ;
++
++}
++// $ANTLR end YEAR
++
++//   Comes from: 114:7: ( 'today' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start TODAY
++ *
++ * Looks to match the characters the constitute the token TODAY
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mTODAY(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = TODAY;
++       
++    
++    // RSP.g:114:7: ( 'today' )
++    // RSP.g:114:9: 'today'
++    {
++        MATCHS(lit_18); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleTODAYEx;
++        }
++
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleTODAYEx; /* Prevent compiler warnings */
++    ruleTODAYEx: ;
++
++}
++// $ANTLR end TODAY
++
++//   Comes from: 116:9: ( ( '\\r' )? '\\n' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start NEWLINE
++ *
++ * Looks to match the characters the constitute the token NEWLINE
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mNEWLINE(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = NEWLINE;
++       
++    
++    // RSP.g:116:9: ( ( '\\r' )? '\\n' )
++    // RSP.g:116:11: ( '\\r' )? '\\n'
++    {
++
++        // RSP.g:116:11: ( '\\r' )?
++        {
++            int alt5=2;
++            switch ( LA(1) ) 
++            {
++                case '\r':
++                      {
++                              alt5=1;
++                      }
++                    break;
++            }
++
++            switch (alt5) 
++            {
++              case 1:
++                  // RSP.g:116:11: '\\r'
++                  {
++                      MATCHC('\r'); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleNEWLINEEx;
++                      }
++
++
++                  }
++                  break;
++
++            }
++        }
++        MATCHC('\n'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleNEWLINEEx;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleNEWLINEEx; /* Prevent compiler warnings */
++    ruleNEWLINEEx: ;
++
++}
++// $ANTLR end NEWLINE
++
++//   Comes from: 118:4: ( ( ' ' | '\\t' ) )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start WS
++ *
++ * Looks to match the characters the constitute the token WS
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mWS(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = WS;
++       
++    
++    // RSP.g:118:4: ( ( ' ' | '\\t' ) )
++    // RSP.g:118:6: ( ' ' | '\\t' )
++    {
++        if ( LA(1) == '\t' || LA(1) == ' ' )
++        {
++            CONSUME();
++
++        }
++        else 
++        {
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
++            EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
++
++            LRECOVER();    goto ruleWSEx;
++        }
++
++        {
++             LEXSTATE->channel = HIDDEN; 
++        }
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleWSEx; /* Prevent compiler warnings */
++    ruleWSEx: ;
++
++}
++// $ANTLR end WS
++
++//   Comes from: 120:7: ( 'a' .. 'z' ( 'a' .. 'z' | '_' )* 'a' .. 'z' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start FIELD
++ *
++ * Looks to match the characters the constitute the token FIELD
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mFIELD(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = FIELD;
++       
++    
++    // RSP.g:120:7: ( 'a' .. 'z' ( 'a' .. 'z' | '_' )* 'a' .. 'z' )
++    // RSP.g:120:9: 'a' .. 'z' ( 'a' .. 'z' | '_' )* 'a' .. 'z'
++    {
++        MATCHRANGE('a', 'z'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleFIELDEx;
++        }
++
++
++        // RSP.g:120:18: ( 'a' .. 'z' | '_' )*
++
++        for (;;)
++        {
++            int alt6=2;
++            switch ( LA(1) ) 
++            {
++            case 'a':
++            case 'b':
++            case 'c':
++            case 'd':
++            case 'e':
++            case 'f':
++            case 'g':
++            case 'h':
++            case 'i':
++            case 'j':
++            case 'k':
++            case 'l':
++            case 'm':
++            case 'n':
++            case 'o':
++            case 'p':
++            case 'q':
++            case 'r':
++            case 's':
++            case 't':
++            case 'u':
++            case 'v':
++            case 'w':
++            case 'x':
++            case 'y':
++            case 'z':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case '_':
++                      case 'a':
++                      case 'b':
++                      case 'c':
++                      case 'd':
++                      case 'e':
++                      case 'f':
++                      case 'g':
++                      case 'h':
++                      case 'i':
++                      case 'j':
++                      case 'k':
++                      case 'l':
++                      case 'm':
++                      case 'n':
++                      case 'o':
++                      case 'p':
++                      case 'q':
++                      case 'r':
++                      case 's':
++                      case 't':
++                      case 'u':
++                      case 'v':
++                      case 'w':
++                      case 'x':
++                      case 'y':
++                      case 'z':
++                              {
++                                      alt6=1;
++                              }
++                          break;
++
++                      }
++
++              }
++                break;
++            case '_':
++              {
++                      alt6=1;
++              }
++                break;
++
++            }
++
++            switch (alt6) 
++            {
++              case 1:
++                  // RSP.g:
++                  {
++                      if ( LA(1) == '_' || ((LA(1) >= 'a') && (LA(1) <= 'z')) )
++                      {
++                          CONSUME();
++
++                      }
++                      else 
++                      {
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
++                          EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
++
++                          LRECOVER();    goto ruleFIELDEx;
++                      }
++
++
++                  }
++                  break;
++
++              default:
++                  goto loop6; /* break out of the loop */
++                  break;
++            }
++        }
++        loop6: ; /* Jump out to here if this rule does not match */
++
++        MATCHRANGE('a', 'z'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleFIELDEx;
++        }
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleFIELDEx; /* Prevent compiler warnings */
++    ruleFIELDEx: ;
++
++}
++// $ANTLR end FIELD
++
++//   Comes from: 122:5: ( DIGIT19 ( DIGIT09 )* )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start INT
++ *
++ * Looks to match the characters the constitute the token INT
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mINT(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = INT;
++       
++    
++    // RSP.g:122:5: ( DIGIT19 ( DIGIT09 )* )
++    // RSP.g:122:7: DIGIT19 ( DIGIT09 )*
++    {
++        /* 122:7: DIGIT19 ( DIGIT09 )* */
++        mDIGIT19(ctx ); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleINTEx;
++        }
++
++
++        // RSP.g:122:15: ( DIGIT09 )*
++
++        for (;;)
++        {
++            int alt7=2;
++            switch ( LA(1) ) 
++            {
++            case '0':
++            case '1':
++            case '2':
++            case '3':
++            case '4':
++            case '5':
++            case '6':
++            case '7':
++            case '8':
++            case '9':
++              {
++                      alt7=1;
++              }
++                break;
++
++            }
++
++            switch (alt7) 
++            {
++              case 1:
++                  // RSP.g:122:15: DIGIT09
++                  {
++                      /* 122:15: DIGIT09 */
++                      mDIGIT09(ctx ); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleINTEx;
++                      }
++
++
++                  }
++                  break;
++
++              default:
++                  goto loop7; /* break out of the loop */
++                  break;
++            }
++        }
++        loop7: ; /* Jump out to here if this rule does not match */
++
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleINTEx; /* Prevent compiler warnings */
++    ruleINTEx: ;
++
++}
++// $ANTLR end INT
++
++//   Comes from: 125:6: ( DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' ) )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start DATE
++ *
++ * Looks to match the characters the constitute the token DATE
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mDATE(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++    _type         = DATE;
++       
++    
++    // RSP.g:125:6: ( DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' ) )
++    // RSP.g:125:8: DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' )
++    {
++        /* 125:8: DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' ) */
++        mDIGIT19(ctx ); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleDATEEx;
++        }
++
++        /* 125:8: DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' ) */
++        mDIGIT09(ctx ); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleDATEEx;
++        }
++
++        /* 125:8: DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' ) */
++        mDIGIT09(ctx ); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleDATEEx;
++        }
++
++        /* 125:8: DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' ) */
++        mDIGIT09(ctx ); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleDATEEx;
++        }
++
++        MATCHC('-'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleDATEEx;
++        }
++
++
++        // RSP.g:125:44: ( '0' DIGIT19 | '1' '0' .. '2' )
++        {
++            int alt8=2;
++            switch ( LA(1) ) 
++            {
++            case '0':
++              {
++                      alt8=1;
++              }
++                break;
++            case '1':
++              {
++                      alt8=2;
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 8;
++                EXCEPTION->state        = 0;
++
++
++                goto ruleDATEEx;
++            }
++
++            switch (alt8) 
++            {
++              case 1:
++                  // RSP.g:125:45: '0' DIGIT19
++                  {
++                      MATCHC('0'); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleDATEEx;
++                      }
++
++                      /* 125:45: '0' DIGIT19 */
++                      mDIGIT19(ctx ); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleDATEEx;
++                      }
++
++
++                  }
++                  break;
++              case 2:
++                  // RSP.g:125:59: '1' '0' .. '2'
++                  {
++                      MATCHC('1'); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleDATEEx;
++                      }
++
++                      MATCHRANGE('0', '2'); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleDATEEx;
++                      }
++
++
++                  }
++                  break;
++
++            }
++        }
++        MATCHC('-'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleDATEEx;
++        }
++
++
++        // RSP.g:125:77: ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' )
++        {
++            int alt9=3;
++            switch ( LA(1) ) 
++            {
++            case '0':
++              {
++                      alt9=1;
++              }
++                break;
++            case '1':
++            case '2':
++              {
++                      alt9=2;
++              }
++                break;
++            case '3':
++              {
++                      alt9=3;
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 9;
++                EXCEPTION->state        = 0;
++
++
++                goto ruleDATEEx;
++            }
++
++            switch (alt9) 
++            {
++              case 1:
++                  // RSP.g:125:78: '0' DIGIT19
++                  {
++                      MATCHC('0'); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleDATEEx;
++                      }
++
++                      /* 125:78: '0' DIGIT19 */
++                      mDIGIT19(ctx ); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleDATEEx;
++                      }
++
++
++                  }
++                  break;
++              case 2:
++                  // RSP.g:125:92: '1' .. '2' DIGIT09
++                  {
++                      MATCHRANGE('1', '2'); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleDATEEx;
++                      }
++
++                      /* 125:92: '1' .. '2' DIGIT09 */
++                      mDIGIT09(ctx ); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleDATEEx;
++                      }
++
++
++                  }
++                  break;
++              case 3:
++                  // RSP.g:125:111: '3' '0' .. '1'
++                  {
++                      MATCHC('3'); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleDATEEx;
++                      }
++
++                      MATCHRANGE('0', '1'); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleDATEEx;
++                      }
++
++
++                  }
++                  break;
++
++            }
++        }
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleDATEEx; /* Prevent compiler warnings */
++    ruleDATEEx: ;
++
++}
++// $ANTLR end DATE
++
++//   Comes from: 133:2: ( QUOTE (reg=~ ( '\\\\' | '\"' ) | esc= ESCAPED )+ QUOTE )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start STR
++ *
++ * Looks to match the characters the constitute the token STR
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mSTR(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++    pANTLR3_COMMON_TOKEN esc;
++    ANTLR3_UINT32 reg;
++
++
++    esc = NULL;
++
++    _type         = STR;
++       
++     pANTLR3_STRING unesc = GETTEXT()->factory->newRaw(GETTEXT()->factory); 
++    
++    // RSP.g:133:2: ( QUOTE (reg=~ ( '\\\\' | '\"' ) | esc= ESCAPED )+ QUOTE )
++    // RSP.g:133:4: QUOTE (reg=~ ( '\\\\' | '\"' ) | esc= ESCAPED )+ QUOTE
++    {
++        /* 133:4: QUOTE (reg=~ ( '\\\\' | '\"' ) | esc= ESCAPED )+ QUOTE */
++        mQUOTE(ctx ); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleSTREx;
++        }
++
++        // RSP.g:133:10: (reg=~ ( '\\\\' | '\"' ) | esc= ESCAPED )+
++        {
++            int cnt10=0;
++
++            for (;;)
++            {
++                int alt10=3;
++              {
++                 /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
++                  */
++                  int LA10_0 = LA(1);
++                  if ( (((LA10_0 >= 0x0000) && (LA10_0 <= '!')) || ((LA10_0 >= '#') && (LA10_0 <= '[')) || ((LA10_0 >= ']') && (LA10_0 <= 0xFFFF))) ) 
++                  {
++                      alt10=1;
++                  }
++                  else if ( (LA10_0 == '\\') ) 
++                  {
++                      alt10=2;
++                  }
++
++              }
++              switch (alt10) 
++              {
++                  case 1:
++                      // RSP.g:133:12: reg=~ ( '\\\\' | '\"' )
++                      {
++                          reg= LA(1);
++                          if ( ((LA(1) >= 0x0000) && (LA(1) <= '!')) || ((LA(1) >= '#') && (LA(1) <= '[')) || ((LA(1) >= ']') && (LA(1) <= 0xFFFF)) )
++                          {
++                              CONSUME();
++
++                          }
++                          else 
++                          {
++                              CONSTRUCTEX();
++                              EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
++                              EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
++
++                              LRECOVER();    goto ruleSTREx;
++                          }
++
++                          {
++                               unesc->addc(unesc, reg); 
++                          }
++
++                      }
++                      break;
++                  case 2:
++                      // RSP.g:134:6: esc= ESCAPED
++                      {
++                          /* 134:6: esc= ESCAPED */
++                          {
++                              ANTLR3_MARKER escStart381 = GETCHARINDEX();
++                          mESCAPED(ctx ); 
++                              if  (HASEXCEPTION())
++                              {
++                                  goto ruleSTREx;
++                              }
++
++                              esc = LEXSTATE->tokFactory->newToken(LEXSTATE->tokFactory);
++                              esc->setType(esc, ANTLR3_TOKEN_INVALID);
++                              esc->setStartIndex(esc, escStart381);
++                              esc->setStopIndex(esc, GETCHARINDEX()-1);
++                              esc->input = INPUT;
++                          }
++                          {
++                               unesc->appendS(unesc, GETTEXT()); 
++                          }
++
++                      }
++                      break;
++
++                  default:
++                  
++                      if ( cnt10 >= 1 )
++                      {
++                          goto loop10;
++                      }
++                      /* mismatchedSetEx()
++                       */
++                      CONSTRUCTEX();
++                      EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
++                      EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
++
++
++                      goto ruleSTREx;
++              }
++              cnt10++;
++            }
++            loop10: ; /* Jump to here if this rule does not match */
++        }
++        /* 133:4: QUOTE (reg=~ ( '\\\\' | '\"' ) | esc= ESCAPED )+ QUOTE */
++        mQUOTE(ctx ); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleSTREx;
++        }
++
++        {
++             SETTEXT(unesc); 
++        }
++
++    }
++
++      LEXSTATE->type = _type;
++
++    // This is where rules clean up and exit
++    //
++    goto ruleSTREx; /* Prevent compiler warnings */
++    ruleSTREx: ;
++
++    esc = NULL;
++
++}
++// $ANTLR end STR
++
++//   Comes from: 138:9: ( '\\\\' ( '\\\\' | '\"' ) )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start ESCAPED
++ *
++ * Looks to match the characters the constitute the token ESCAPED
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mESCAPED(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++        
++    // RSP.g:138:9: ( '\\\\' ( '\\\\' | '\"' ) )
++    // RSP.g:138:11: '\\\\' ( '\\\\' | '\"' )
++    {
++        MATCHC('\\'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleESCAPEDEx;
++        }
++
++
++        // RSP.g:139:3: ( '\\\\' | '\"' )
++        {
++            int alt11=2;
++            switch ( LA(1) ) 
++            {
++            case '\\':
++              {
++                      alt11=1;
++              }
++                break;
++            case '"':
++              {
++                      alt11=2;
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 11;
++                EXCEPTION->state        = 0;
++
++
++                goto ruleESCAPEDEx;
++            }
++
++            switch (alt11) 
++            {
++              case 1:
++                  // RSP.g:139:5: '\\\\'
++                  {
++                      MATCHC('\\'); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleESCAPEDEx;
++                      }
++
++                      {
++                           SETTEXT(GETTEXT()->factory->newStr8(GETTEXT()->factory, (pANTLR3_UINT8)"\\")); 
++                      }
++
++                  }
++                  break;
++              case 2:
++                  // RSP.g:140:5: '\"'
++                  {
++                      MATCHC('"'); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleESCAPEDEx;
++                      }
++
++                      {
++                           SETTEXT(GETTEXT()->factory->newStr8(GETTEXT()->factory, (pANTLR3_UINT8)"\"")); 
++                      }
++
++                  }
++                  break;
++
++            }
++        }
++
++    }
++
++
++
++    // This is where rules clean up and exit
++    //
++    goto ruleESCAPEDEx; /* Prevent compiler warnings */
++    ruleESCAPEDEx: ;
++
++}
++// $ANTLR end ESCAPED
++
++//   Comes from: 145:9: ( '0' .. '9' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start DIGIT09
++ *
++ * Looks to match the characters the constitute the token DIGIT09
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mDIGIT09(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++        
++    // RSP.g:145:9: ( '0' .. '9' )
++    // RSP.g:145:11: '0' .. '9'
++    {
++        MATCHRANGE('0', '9'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleDIGIT09Ex;
++        }
++
++
++    }
++
++
++
++    // This is where rules clean up and exit
++    //
++    goto ruleDIGIT09Ex; /* Prevent compiler warnings */
++    ruleDIGIT09Ex: ;
++
++}
++// $ANTLR end DIGIT09
++
++//   Comes from: 148:9: ( '1' .. '9' )
++/** \brief Lexer rule generated by ANTLR3
++ *
++ * $ANTLR start DIGIT19
++ *
++ * Looks to match the characters the constitute the token DIGIT19
++ * from the attached input stream.
++ *
++ *
++ * \remark
++ *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
++ */
++static ANTLR3_INLINE
++void mDIGIT19(pRSPLexer ctx)
++{
++      ANTLR3_UINT32   _type;
++
++        
++    // RSP.g:148:9: ( '1' .. '9' )
++    // RSP.g:148:11: '1' .. '9'
++    {
++        MATCHRANGE('1', '9'); 
++        if  (HASEXCEPTION())
++        {
++            goto ruleDIGIT19Ex;
++        }
++
++
++    }
++
++
++
++    // This is where rules clean up and exit
++    //
++    goto ruleDIGIT19Ex; /* Prevent compiler warnings */
++    ruleDIGIT19Ex: ;
++
++}
++// $ANTLR end DIGIT19
++
++/** This is the entry point in to the lexer from an object that
++ *  wants to generate the next token, such as a pCOMMON_TOKEN_STREAM
++ */
++static void 
++mTokens(pRSPLexer ctx)
++{
++    {
++        //  RSP.g:1:8: ( QUOTE | LPAR | RPAR | AND | OR | NOT | EQUAL | INCLUDES | STARTSW | ENDSW | GREATER | LESS | GTE | LTE | BEFORE | AFTER | DAY | WEEK | MONTH | YEAR | TODAY | NEWLINE | WS | FIELD | INT | DATE | STR )
++        
++        ANTLR3_UINT32 alt12;
++
++        alt12=27;
++
++        switch ( LA(1) ) 
++        {
++        case '"':
++              {
++
++                      {
++                          int LA12_1 = LA(2);
++                          if ( (((LA12_1 >= 0x0000) && (LA12_1 <= '!')) || ((LA12_1 >= '#') && (LA12_1 <= 0xFFFF))) ) 
++                          {
++                              alt12=27;
++                          }
++                          else 
++                          {
++                              alt12=1;    }
++                      }
++              }
++            break;
++        case '(':
++              {
++                      alt12=2;
++              }
++            break;
++        case ')':
++              {
++                      alt12=3;
++              }
++            break;
++        case 'a':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'n':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'd':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case '_':
++                                                      case 'a':
++                                                      case 'b':
++                                                      case 'c':
++                                                      case 'd':
++                                                      case 'e':
++                                                      case 'f':
++                                                      case 'g':
++                                                      case 'h':
++                                                      case 'i':
++                                                      case 'j':
++                                                      case 'k':
++                                                      case 'l':
++                                                      case 'm':
++                                                      case 'n':
++                                                      case 'o':
++                                                      case 'p':
++                                                      case 'q':
++                                                      case 'r':
++                                                      case 's':
++                                                      case 't':
++                                                      case 'u':
++                                                      case 'v':
++                                                      case 'w':
++                                                      case 'x':
++                                                      case 'y':
++                                                      case 'z':
++                                                              {
++                                                                      alt12=24;
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          alt12=4;}
++
++                                              }
++                                          break;
++
++                                      default:
++                                          alt12=24;}
++
++                              }
++                          break;
++                      case 'f':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 't':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 'e':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case 'r':
++                                                                              {
++                                                                                      switch ( LA(6) ) 
++                                                                                      {
++                                                                                      case '_':
++                                                                                      case 'a':
++                                                                                      case 'b':
++                                                                                      case 'c':
++                                                                                      case 'd':
++                                                                                      case 'e':
++                                                                                      case 'f':
++                                                                                      case 'g':
++                                                                                      case 'h':
++                                                                                      case 'i':
++                                                                                      case 'j':
++                                                                                      case 'k':
++                                                                                      case 'l':
++                                                                                      case 'm':
++                                                                                      case 'n':
++                                                                                      case 'o':
++                                                                                      case 'p':
++                                                                                      case 'q':
++                                                                                      case 'r':
++                                                                                      case 's':
++                                                                                      case 't':
++                                                                                      case 'u':
++                                                                                      case 'v':
++                                                                                      case 'w':
++                                                                                      case 'x':
++                                                                                      case 'y':
++                                                                                      case 'z':
++                                                                                              {
++                                                                                                      alt12=24;
++                                                                                              }
++                                                                                          break;
++
++                                                                                      default:
++                                                                                          alt12=16;}
++
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          alt12=24;}
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          alt12=24;}
++
++                                              }
++                                          break;
++
++                                      default:
++                                          alt12=24;}
++
++                              }
++                          break;
++                      case '_':
++                      case 'a':
++                      case 'b':
++                      case 'c':
++                      case 'd':
++                      case 'e':
++                      case 'g':
++                      case 'h':
++                      case 'i':
++                      case 'j':
++                      case 'k':
++                      case 'l':
++                      case 'm':
++                      case 'o':
++                      case 'p':
++                      case 'q':
++                      case 'r':
++                      case 's':
++                      case 't':
++                      case 'u':
++                      case 'v':
++                      case 'w':
++                      case 'x':
++                      case 'y':
++                      case 'z':
++                              {
++                                      alt12=24;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 12;
++                          EXCEPTION->state        = 4;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case 'o':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'r':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case '_':
++                                      case 'a':
++                                      case 'b':
++                                      case 'c':
++                                      case 'd':
++                                      case 'e':
++                                      case 'f':
++                                      case 'g':
++                                      case 'h':
++                                      case 'i':
++                                      case 'j':
++                                      case 'k':
++                                      case 'l':
++                                      case 'm':
++                                      case 'n':
++                                      case 'o':
++                                      case 'p':
++                                      case 'q':
++                                      case 'r':
++                                      case 's':
++                                      case 't':
++                                      case 'u':
++                                      case 'v':
++                                      case 'w':
++                                      case 'x':
++                                      case 'y':
++                                      case 'z':
++                                              {
++                                                      alt12=24;
++                                              }
++                                          break;
++
++                                      default:
++                                          alt12=5;}
++
++                              }
++                          break;
++                      case '_':
++                      case 'a':
++                      case 'b':
++                      case 'c':
++                      case 'd':
++                      case 'e':
++                      case 'f':
++                      case 'g':
++                      case 'h':
++                      case 'i':
++                      case 'j':
++                      case 'k':
++                      case 'l':
++                      case 'm':
++                      case 'n':
++                      case 'o':
++                      case 'p':
++                      case 'q':
++                      case 's':
++                      case 't':
++                      case 'u':
++                      case 'v':
++                      case 'w':
++                      case 'x':
++                      case 'y':
++                      case 'z':
++                              {
++                                      alt12=24;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 12;
++                          EXCEPTION->state        = 5;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case '!':
++              {
++                      alt12=6;
++              }
++            break;
++        case '=':
++              {
++                      alt12=7;
++              }
++            break;
++        case 'i':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'n':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'c':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 'l':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case 'u':
++                                                                              {
++                                                                                      switch ( LA(6) ) 
++                                                                                      {
++                                                                                      case 'd':
++                                                                                              {
++                                                                                                      switch ( LA(7) ) 
++                                                                                                      {
++                                                                                                      case 'e':
++                                                                                                              {
++                                                                                                                      switch ( LA(8) ) 
++                                                                                                                      {
++                                                                                                                      case 's':
++                                                                                                                              {
++                                                                                                                                      switch ( LA(9) ) 
++                                                                                                                                      {
++                                                                                                                                      case '_':
++                                                                                                                                      case 'a':
++                                                                                                                                      case 'b':
++                                                                                                                                      case 'c':
++                                                                                                                                      case 'd':
++                                                                                                                                      case 'e':
++                                                                                                                                      case 'f':
++                                                                                                                                      case 'g':
++                                                                                                                                      case 'h':
++                                                                                                                                      case 'i':
++                                                                                                                                      case 'j':
++                                                                                                                                      case 'k':
++                                                                                                                                      case 'l':
++                                                                                                                                      case 'm':
++                                                                                                                                      case 'n':
++                                                                                                                                      case 'o':
++                                                                                                                                      case 'p':
++                                                                                                                                      case 'q':
++                                                                                                                                      case 'r':
++                                                                                                                                      case 's':
++                                                                                                                                      case 't':
++                                                                                                                                      case 'u':
++                                                                                                                                      case 'v':
++                                                                                                                                      case 'w':
++                                                                                                                                      case 'x':
++                                                                                                                                      case 'y':
++                                                                                                                                      case 'z':
++                                                                                                                                              {
++                                                                                                                                                      alt12=24;
++                                                                                                                                              }
++                                                                                                                                          break;
++
++                                                                                                                                      default:
++                                                                                                                                          alt12=8;}
++
++                                                                                                                              }
++                                                                                                                          break;
++
++                                                                                                                      default:
++                                                                                                                          alt12=24;}
++
++                                                                                                              }
++                                                                                                          break;
++
++                                                                                                      default:
++                                                                                                          alt12=24;}
++
++                                                                                              }
++                                                                                          break;
++
++                                                                                      default:
++                                                                                          alt12=24;}
++
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          alt12=24;}
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          alt12=24;}
++
++                                              }
++                                          break;
++
++                                      default:
++                                          alt12=24;}
++
++                              }
++                          break;
++                      case '_':
++                      case 'a':
++                      case 'b':
++                      case 'c':
++                      case 'd':
++                      case 'e':
++                      case 'f':
++                      case 'g':
++                      case 'h':
++                      case 'i':
++                      case 'j':
++                      case 'k':
++                      case 'l':
++                      case 'm':
++                      case 'o':
++                      case 'p':
++                      case 'q':
++                      case 'r':
++                      case 's':
++                      case 't':
++                      case 'u':
++                      case 'v':
++                      case 'w':
++                      case 'x':
++                      case 'y':
++                      case 'z':
++                              {
++                                      alt12=24;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 12;
++                          EXCEPTION->state        = 8;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case 's':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 't':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'a':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 'r':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case 't':
++                                                                              {
++                                                                                      switch ( LA(6) ) 
++                                                                                      {
++                                                                                      case 's':
++                                                                                              {
++                                                                                                      switch ( LA(7) ) 
++                                                                                                      {
++                                                                                                      case 'w':
++                                                                                                              {
++                                                                                                                      switch ( LA(8) ) 
++                                                                                                                      {
++                                                                                                                      case 'i':
++                                                                                                                              {
++                                                                                                                                      switch ( LA(9) ) 
++                                                                                                                                      {
++                                                                                                                                      case 't':
++                                                                                                                                              {
++                                                                                                                                                      switch ( LA(10) ) 
++                                                                                                                                                      {
++                                                                                                                                                      case 'h':
++                                                                                                                                                              {
++                                                                                                                                                                      switch ( LA(11) ) 
++                                                                                                                                                                      {
++                                                                                                                                                                      case '_':
++                                                                                                                                                                      case 'a':
++                                                                                                                                                                      case 'b':
++                                                                                                                                                                      case 'c':
++                                                                                                                                                                      case 'd':
++                                                                                                                                                                      case 'e':
++                                                                                                                                                                      case 'f':
++                                                                                                                                                                      case 'g':
++                                                                                                                                                                      case 'h':
++                                                                                                                                                                      case 'i':
++                                                                                                                                                                      case 'j':
++                                                                                                                                                                      case 'k':
++                                                                                                                                                                      case 'l':
++                                                                                                                                                                      case 'm':
++                                                                                                                                                                      case 'n':
++                                                                                                                                                                      case 'o':
++                                                                                                                                                                      case 'p':
++                                                                                                                                                                      case 'q':
++                                                                                                                                                                      case 'r':
++                                                                                                                                                                      case 's':
++                                                                                                                                                                      case 't':
++                                                                                                                                                                      case 'u':
++                                                                                                                                                                      case 'v':
++                                                                                                                                                                      case 'w':
++                                                                                                                                                                      case 'x':
++                                                                                                                                                                      case 'y':
++                                                                                                                                                                      case 'z':
++                                                                                                                                                                              {
++                                                                                                                                                                                      alt12=24;
++                                                                                                                                                                              }
++                                                                                                                                                                          break;
++
++                                                                                                                                                                      default:
++                                                                                                                                                                          alt12=9;}
++
++                                                                                                                                                              }
++                                                                                                                                                          break;
++
++                                                                                                                                                      default:
++                                                                                                                                                          alt12=24;}
++
++                                                                                                                                              }
++                                                                                                                                          break;
++
++                                                                                                                                      default:
++                                                                                                                                          alt12=24;}
++
++                                                                                                                              }
++                                                                                                                          break;
++
++                                                                                                                      default:
++                                                                                                                          alt12=24;}
++
++                                                                                                              }
++                                                                                                          break;
++
++                                                                                                      default:
++                                                                                                          alt12=24;}
++
++                                                                                              }
++                                                                                          break;
++
++                                                                                      default:
++                                                                                          alt12=24;}
++
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          alt12=24;}
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          alt12=24;}
++
++                                              }
++                                          break;
++
++                                      default:
++                                          alt12=24;}
++
++                              }
++                          break;
++                      case '_':
++                      case 'a':
++                      case 'b':
++                      case 'c':
++                      case 'd':
++                      case 'e':
++                      case 'f':
++                      case 'g':
++                      case 'h':
++                      case 'i':
++                      case 'j':
++                      case 'k':
++                      case 'l':
++                      case 'm':
++                      case 'n':
++                      case 'o':
++                      case 'p':
++                      case 'q':
++                      case 'r':
++                      case 's':
++                      case 'u':
++                      case 'v':
++                      case 'w':
++                      case 'x':
++                      case 'y':
++                      case 'z':
++                              {
++                                      alt12=24;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 12;
++                          EXCEPTION->state        = 9;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case 'e':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'n':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'd':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 's':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case 'w':
++                                                                              {
++                                                                                      switch ( LA(6) ) 
++                                                                                      {
++                                                                                      case 'i':
++                                                                                              {
++                                                                                                      switch ( LA(7) ) 
++                                                                                                      {
++                                                                                                      case 't':
++                                                                                                              {
++                                                                                                                      switch ( LA(8) ) 
++                                                                                                                      {
++                                                                                                                      case 'h':
++                                                                                                                              {
++                                                                                                                                      switch ( LA(9) ) 
++                                                                                                                                      {
++                                                                                                                                      case '_':
++                                                                                                                                      case 'a':
++                                                                                                                                      case 'b':
++                                                                                                                                      case 'c':
++                                                                                                                                      case 'd':
++                                                                                                                                      case 'e':
++                                                                                                                                      case 'f':
++                                                                                                                                      case 'g':
++                                                                                                                                      case 'h':
++                                                                                                                                      case 'i':
++                                                                                                                                      case 'j':
++                                                                                                                                      case 'k':
++                                                                                                                                      case 'l':
++                                                                                                                                      case 'm':
++                                                                                                                                      case 'n':
++                                                                                                                                      case 'o':
++                                                                                                                                      case 'p':
++                                                                                                                                      case 'q':
++                                                                                                                                      case 'r':
++                                                                                                                                      case 's':
++                                                                                                                                      case 't':
++                                                                                                                                      case 'u':
++                                                                                                                                      case 'v':
++                                                                                                                                      case 'w':
++                                                                                                                                      case 'x':
++                                                                                                                                      case 'y':
++                                                                                                                                      case 'z':
++                                                                                                                                              {
++                                                                                                                                                      alt12=24;
++                                                                                                                                              }
++                                                                                                                                          break;
++
++                                                                                                                                      default:
++                                                                                                                                          alt12=10;}
++
++                                                                                                                              }
++                                                                                                                          break;
++
++                                                                                                                      default:
++                                                                                                                          alt12=24;}
++
++                                                                                                              }
++                                                                                                          break;
++
++                                                                                                      default:
++                                                                                                          alt12=24;}
++
++                                                                                              }
++                                                                                          break;
++
++                                                                                      default:
++                                                                                          alt12=24;}
++
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          alt12=24;}
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          alt12=24;}
++
++                                              }
++                                          break;
++
++                                      default:
++                                          alt12=24;}
++
++                              }
++                          break;
++                      case '_':
++                      case 'a':
++                      case 'b':
++                      case 'c':
++                      case 'd':
++                      case 'e':
++                      case 'f':
++                      case 'g':
++                      case 'h':
++                      case 'i':
++                      case 'j':
++                      case 'k':
++                      case 'l':
++                      case 'm':
++                      case 'o':
++                      case 'p':
++                      case 'q':
++                      case 'r':
++                      case 's':
++                      case 't':
++                      case 'u':
++                      case 'v':
++                      case 'w':
++                      case 'x':
++                      case 'y':
++                      case 'z':
++                              {
++                                      alt12=24;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 12;
++                          EXCEPTION->state        = 10;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case '>':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case '=':
++                              {
++                                      alt12=13;
++                              }
++                          break;
++
++                      default:
++                          alt12=11;}
++
++              }
++            break;
++        case '<':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case '=':
++                              {
++                                      alt12=14;
++                              }
++                          break;
++
++                      default:
++                          alt12=12;}
++
++              }
++            break;
++        case 'b':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'e':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'f':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 'o':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case 'r':
++                                                                              {
++                                                                                      switch ( LA(6) ) 
++                                                                                      {
++                                                                                      case 'e':
++                                                                                              {
++                                                                                                      switch ( LA(7) ) 
++                                                                                                      {
++                                                                                                      case '_':
++                                                                                                      case 'a':
++                                                                                                      case 'b':
++                                                                                                      case 'c':
++                                                                                                      case 'd':
++                                                                                                      case 'e':
++                                                                                                      case 'f':
++                                                                                                      case 'g':
++                                                                                                      case 'h':
++                                                                                                      case 'i':
++                                                                                                      case 'j':
++                                                                                                      case 'k':
++                                                                                                      case 'l':
++                                                                                                      case 'm':
++                                                                                                      case 'n':
++                                                                                                      case 'o':
++                                                                                                      case 'p':
++                                                                                                      case 'q':
++                                                                                                      case 'r':
++                                                                                                      case 's':
++                                                                                                      case 't':
++                                                                                                      case 'u':
++                                                                                                      case 'v':
++                                                                                                      case 'w':
++                                                                                                      case 'x':
++                                                                                                      case 'y':
++                                                                                                      case 'z':
++                                                                                                              {
++                                                                                                                      alt12=24;
++                                                                                                              }
++                                                                                                          break;
++
++                                                                                                      default:
++                                                                                                          alt12=15;}
++
++                                                                                              }
++                                                                                          break;
++
++                                                                                      default:
++                                                                                          alt12=24;}
++
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          alt12=24;}
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          alt12=24;}
++
++                                              }
++                                          break;
++
++                                      default:
++                                          alt12=24;}
++
++                              }
++                          break;
++                      case '_':
++                      case 'a':
++                      case 'b':
++                      case 'c':
++                      case 'd':
++                      case 'f':
++                      case 'g':
++                      case 'h':
++                      case 'i':
++                      case 'j':
++                      case 'k':
++                      case 'l':
++                      case 'm':
++                      case 'n':
++                      case 'o':
++                      case 'p':
++                      case 'q':
++                      case 'r':
++                      case 's':
++                      case 't':
++                      case 'u':
++                      case 'v':
++                      case 'w':
++                      case 'x':
++                      case 'y':
++                      case 'z':
++                              {
++                                      alt12=24;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 12;
++                          EXCEPTION->state        = 13;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case 'd':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'a':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'y':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 's':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case '_':
++                                                                      case 'a':
++                                                                      case 'b':
++                                                                      case 'c':
++                                                                      case 'd':
++                                                                      case 'e':
++                                                                      case 'f':
++                                                                      case 'g':
++                                                                      case 'h':
++                                                                      case 'i':
++                                                                      case 'j':
++                                                                      case 'k':
++                                                                      case 'l':
++                                                                      case 'm':
++                                                                      case 'n':
++                                                                      case 'o':
++                                                                      case 'p':
++                                                                      case 'q':
++                                                                      case 'r':
++                                                                      case 's':
++                                                                      case 't':
++                                                                      case 'u':
++                                                                      case 'v':
++                                                                      case 'w':
++                                                                      case 'x':
++                                                                      case 'y':
++                                                                      case 'z':
++                                                                              {
++                                                                                      alt12=24;
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          alt12=17;}
++
++                                                              }
++                                                          break;
++                                                      case '_':
++                                                      case 'a':
++                                                      case 'b':
++                                                      case 'c':
++                                                      case 'd':
++                                                      case 'e':
++                                                      case 'f':
++                                                      case 'g':
++                                                      case 'h':
++                                                      case 'i':
++                                                      case 'j':
++                                                      case 'k':
++                                                      case 'l':
++                                                      case 'm':
++                                                      case 'n':
++                                                      case 'o':
++                                                      case 'p':
++                                                      case 'q':
++                                                      case 'r':
++                                                      case 't':
++                                                      case 'u':
++                                                      case 'v':
++                                                      case 'w':
++                                                      case 'x':
++                                                      case 'y':
++                                                      case 'z':
++                                                              {
++                                                                      alt12=24;
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          alt12=17;}
++
++                                              }
++                                          break;
++
++                                      default:
++                                          alt12=24;}
++
++                              }
++                          break;
++                      case '_':
++                      case 'b':
++                      case 'c':
++                      case 'd':
++                      case 'e':
++                      case 'f':
++                      case 'g':
++                      case 'h':
++                      case 'i':
++                      case 'j':
++                      case 'k':
++                      case 'l':
++                      case 'm':
++                      case 'n':
++                      case 'o':
++                      case 'p':
++                      case 'q':
++                      case 'r':
++                      case 's':
++                      case 't':
++                      case 'u':
++                      case 'v':
++                      case 'w':
++                      case 'x':
++                      case 'y':
++                      case 'z':
++                              {
++                                      alt12=24;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 12;
++                          EXCEPTION->state        = 14;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case 'w':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'e':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'e':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 'k':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case 's':
++                                                                              {
++                                                                                      switch ( LA(6) ) 
++                                                                                      {
++                                                                                      case '_':
++                                                                                      case 'a':
++                                                                                      case 'b':
++                                                                                      case 'c':
++                                                                                      case 'd':
++                                                                                      case 'e':
++                                                                                      case 'f':
++                                                                                      case 'g':
++                                                                                      case 'h':
++                                                                                      case 'i':
++                                                                                      case 'j':
++                                                                                      case 'k':
++                                                                                      case 'l':
++                                                                                      case 'm':
++                                                                                      case 'n':
++                                                                                      case 'o':
++                                                                                      case 'p':
++                                                                                      case 'q':
++                                                                                      case 'r':
++                                                                                      case 's':
++                                                                                      case 't':
++                                                                                      case 'u':
++                                                                                      case 'v':
++                                                                                      case 'w':
++                                                                                      case 'x':
++                                                                                      case 'y':
++                                                                                      case 'z':
++                                                                                              {
++                                                                                                      alt12=24;
++                                                                                              }
++                                                                                          break;
++
++                                                                                      default:
++                                                                                          alt12=18;}
++
++                                                                              }
++                                                                          break;
++                                                                      case '_':
++                                                                      case 'a':
++                                                                      case 'b':
++                                                                      case 'c':
++                                                                      case 'd':
++                                                                      case 'e':
++                                                                      case 'f':
++                                                                      case 'g':
++                                                                      case 'h':
++                                                                      case 'i':
++                                                                      case 'j':
++                                                                      case 'k':
++                                                                      case 'l':
++                                                                      case 'm':
++                                                                      case 'n':
++                                                                      case 'o':
++                                                                      case 'p':
++                                                                      case 'q':
++                                                                      case 'r':
++                                                                      case 't':
++                                                                      case 'u':
++                                                                      case 'v':
++                                                                      case 'w':
++                                                                      case 'x':
++                                                                      case 'y':
++                                                                      case 'z':
++                                                                              {
++                                                                                      alt12=24;
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          alt12=18;}
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          alt12=24;}
++
++                                              }
++                                          break;
++
++                                      default:
++                                          alt12=24;}
++
++                              }
++                          break;
++                      case '_':
++                      case 'a':
++                      case 'b':
++                      case 'c':
++                      case 'd':
++                      case 'f':
++                      case 'g':
++                      case 'h':
++                      case 'i':
++                      case 'j':
++                      case 'k':
++                      case 'l':
++                      case 'm':
++                      case 'n':
++                      case 'o':
++                      case 'p':
++                      case 'q':
++                      case 'r':
++                      case 's':
++                      case 't':
++                      case 'u':
++                      case 'v':
++                      case 'w':
++                      case 'x':
++                      case 'y':
++                      case 'z':
++                              {
++                                      alt12=24;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 12;
++                          EXCEPTION->state        = 15;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case 'm':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'o':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'n':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 't':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case 'h':
++                                                                              {
++                                                                                      switch ( LA(6) ) 
++                                                                                      {
++                                                                                      case 's':
++                                                                                              {
++                                                                                                      switch ( LA(7) ) 
++                                                                                                      {
++                                                                                                      case '_':
++                                                                                                      case 'a':
++                                                                                                      case 'b':
++                                                                                                      case 'c':
++                                                                                                      case 'd':
++                                                                                                      case 'e':
++                                                                                                      case 'f':
++                                                                                                      case 'g':
++                                                                                                      case 'h':
++                                                                                                      case 'i':
++                                                                                                      case 'j':
++                                                                                                      case 'k':
++                                                                                                      case 'l':
++                                                                                                      case 'm':
++                                                                                                      case 'n':
++                                                                                                      case 'o':
++                                                                                                      case 'p':
++                                                                                                      case 'q':
++                                                                                                      case 'r':
++                                                                                                      case 's':
++                                                                                                      case 't':
++                                                                                                      case 'u':
++                                                                                                      case 'v':
++                                                                                                      case 'w':
++                                                                                                      case 'x':
++                                                                                                      case 'y':
++                                                                                                      case 'z':
++                                                                                                              {
++                                                                                                                      alt12=24;
++                                                                                                              }
++                                                                                                          break;
++
++                                                                                                      default:
++                                                                                                          alt12=19;}
++
++                                                                                              }
++                                                                                          break;
++                                                                                      case '_':
++                                                                                      case 'a':
++                                                                                      case 'b':
++                                                                                      case 'c':
++                                                                                      case 'd':
++                                                                                      case 'e':
++                                                                                      case 'f':
++                                                                                      case 'g':
++                                                                                      case 'h':
++                                                                                      case 'i':
++                                                                                      case 'j':
++                                                                                      case 'k':
++                                                                                      case 'l':
++                                                                                      case 'm':
++                                                                                      case 'n':
++                                                                                      case 'o':
++                                                                                      case 'p':
++                                                                                      case 'q':
++                                                                                      case 'r':
++                                                                                      case 't':
++                                                                                      case 'u':
++                                                                                      case 'v':
++                                                                                      case 'w':
++                                                                                      case 'x':
++                                                                                      case 'y':
++                                                                                      case 'z':
++                                                                                              {
++                                                                                                      alt12=24;
++                                                                                              }
++                                                                                          break;
++
++                                                                                      default:
++                                                                                          alt12=19;}
++
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          alt12=24;}
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          alt12=24;}
++
++                                              }
++                                          break;
++
++                                      default:
++                                          alt12=24;}
++
++                              }
++                          break;
++                      case '_':
++                      case 'a':
++                      case 'b':
++                      case 'c':
++                      case 'd':
++                      case 'e':
++                      case 'f':
++                      case 'g':
++                      case 'h':
++                      case 'i':
++                      case 'j':
++                      case 'k':
++                      case 'l':
++                      case 'm':
++                      case 'n':
++                      case 'p':
++                      case 'q':
++                      case 'r':
++                      case 's':
++                      case 't':
++                      case 'u':
++                      case 'v':
++                      case 'w':
++                      case 'x':
++                      case 'y':
++                      case 'z':
++                              {
++                                      alt12=24;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 12;
++                          EXCEPTION->state        = 16;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case 'y':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'e':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'a':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 'r':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case 's':
++                                                                              {
++                                                                                      switch ( LA(6) ) 
++                                                                                      {
++                                                                                      case '_':
++                                                                                      case 'a':
++                                                                                      case 'b':
++                                                                                      case 'c':
++                                                                                      case 'd':
++                                                                                      case 'e':
++                                                                                      case 'f':
++                                                                                      case 'g':
++                                                                                      case 'h':
++                                                                                      case 'i':
++                                                                                      case 'j':
++                                                                                      case 'k':
++                                                                                      case 'l':
++                                                                                      case 'm':
++                                                                                      case 'n':
++                                                                                      case 'o':
++                                                                                      case 'p':
++                                                                                      case 'q':
++                                                                                      case 'r':
++                                                                                      case 's':
++                                                                                      case 't':
++                                                                                      case 'u':
++                                                                                      case 'v':
++                                                                                      case 'w':
++                                                                                      case 'x':
++                                                                                      case 'y':
++                                                                                      case 'z':
++                                                                                              {
++                                                                                                      alt12=24;
++                                                                                              }
++                                                                                          break;
++
++                                                                                      default:
++                                                                                          alt12=20;}
++
++                                                                              }
++                                                                          break;
++                                                                      case '_':
++                                                                      case 'a':
++                                                                      case 'b':
++                                                                      case 'c':
++                                                                      case 'd':
++                                                                      case 'e':
++                                                                      case 'f':
++                                                                      case 'g':
++                                                                      case 'h':
++                                                                      case 'i':
++                                                                      case 'j':
++                                                                      case 'k':
++                                                                      case 'l':
++                                                                      case 'm':
++                                                                      case 'n':
++                                                                      case 'o':
++                                                                      case 'p':
++                                                                      case 'q':
++                                                                      case 'r':
++                                                                      case 't':
++                                                                      case 'u':
++                                                                      case 'v':
++                                                                      case 'w':
++                                                                      case 'x':
++                                                                      case 'y':
++                                                                      case 'z':
++                                                                              {
++                                                                                      alt12=24;
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          alt12=20;}
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          alt12=24;}
++
++                                              }
++                                          break;
++
++                                      default:
++                                          alt12=24;}
++
++                              }
++                          break;
++                      case '_':
++                      case 'a':
++                      case 'b':
++                      case 'c':
++                      case 'd':
++                      case 'f':
++                      case 'g':
++                      case 'h':
++                      case 'i':
++                      case 'j':
++                      case 'k':
++                      case 'l':
++                      case 'm':
++                      case 'n':
++                      case 'o':
++                      case 'p':
++                      case 'q':
++                      case 'r':
++                      case 's':
++                      case 't':
++                      case 'u':
++                      case 'v':
++                      case 'w':
++                      case 'x':
++                      case 'y':
++                      case 'z':
++                              {
++                                      alt12=24;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 12;
++                          EXCEPTION->state        = 17;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case 't':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case 'o':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case 'd':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case 'a':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case 'y':
++                                                                              {
++                                                                                      switch ( LA(6) ) 
++                                                                                      {
++                                                                                      case '_':
++                                                                                      case 'a':
++                                                                                      case 'b':
++                                                                                      case 'c':
++                                                                                      case 'd':
++                                                                                      case 'e':
++                                                                                      case 'f':
++                                                                                      case 'g':
++                                                                                      case 'h':
++                                                                                      case 'i':
++                                                                                      case 'j':
++                                                                                      case 'k':
++                                                                                      case 'l':
++                                                                                      case 'm':
++                                                                                      case 'n':
++                                                                                      case 'o':
++                                                                                      case 'p':
++                                                                                      case 'q':
++                                                                                      case 'r':
++                                                                                      case 's':
++                                                                                      case 't':
++                                                                                      case 'u':
++                                                                                      case 'v':
++                                                                                      case 'w':
++                                                                                      case 'x':
++                                                                                      case 'y':
++                                                                                      case 'z':
++                                                                                              {
++                                                                                                      alt12=24;
++                                                                                              }
++                                                                                          break;
++
++                                                                                      default:
++                                                                                          alt12=21;}
++
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          alt12=24;}
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          alt12=24;}
++
++                                              }
++                                          break;
++
++                                      default:
++                                          alt12=24;}
++
++                              }
++                          break;
++                      case '_':
++                      case 'a':
++                      case 'b':
++                      case 'c':
++                      case 'd':
++                      case 'e':
++                      case 'f':
++                      case 'g':
++                      case 'h':
++                      case 'i':
++                      case 'j':
++                      case 'k':
++                      case 'l':
++                      case 'm':
++                      case 'n':
++                      case 'p':
++                      case 'q':
++                      case 'r':
++                      case 's':
++                      case 't':
++                      case 'u':
++                      case 'v':
++                      case 'w':
++                      case 'x':
++                      case 'y':
++                      case 'z':
++                              {
++                                      alt12=24;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 12;
++                          EXCEPTION->state        = 18;
++
++
++                          goto ruleTokensEx;
++                      }
++
++              }
++            break;
++        case '\n':
++        case '\r':
++              {
++                      alt12=22;
++              }
++            break;
++        case '\t':
++        case ' ':
++              {
++                      alt12=23;
++              }
++            break;
++        case 'c':
++        case 'f':
++        case 'g':
++        case 'h':
++        case 'j':
++        case 'k':
++        case 'l':
++        case 'n':
++        case 'p':
++        case 'q':
++        case 'r':
++        case 'u':
++        case 'v':
++        case 'x':
++        case 'z':
++              {
++                      alt12=24;
++              }
++            break;
++        case '1':
++        case '2':
++        case '3':
++        case '4':
++        case '5':
++        case '6':
++        case '7':
++        case '8':
++        case '9':
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case '0':
++                      case '1':
++                      case '2':
++                      case '3':
++                      case '4':
++                      case '5':
++                      case '6':
++                      case '7':
++                      case '8':
++                      case '9':
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case '0':
++                                      case '1':
++                                      case '2':
++                                      case '3':
++                                      case '4':
++                                      case '5':
++                                      case '6':
++                                      case '7':
++                                      case '8':
++                                      case '9':
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case '0':
++                                                      case '1':
++                                                      case '2':
++                                                      case '3':
++                                                      case '4':
++                                                      case '5':
++                                                      case '6':
++                                                      case '7':
++                                                      case '8':
++                                                      case '9':
++                                                              {
++                                                                      switch ( LA(5) ) 
++                                                                      {
++                                                                      case '-':
++                                                                              {
++                                                                                      alt12=26;
++                                                                              }
++                                                                          break;
++
++                                                                      default:
++                                                                          alt12=25;}
++
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          alt12=25;}
++
++                                              }
++                                          break;
++
++                                      default:
++                                          alt12=25;}
++
++                              }
++                          break;
++
++                      default:
++                          alt12=25;}
++
++              }
++            break;
++
++        default:
++            CONSTRUCTEX();
++            EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++            EXCEPTION->message      = (void *)"";
++            EXCEPTION->decisionNum  = 12;
++            EXCEPTION->state        = 0;
++
++
++            goto ruleTokensEx;
++        }
++
++        switch (alt12) 
++        {
++      case 1:
++          // RSP.g:1:10: QUOTE
++          {
++              /* 1:10: QUOTE */
++              mQUOTE(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 2:
++          // RSP.g:1:16: LPAR
++          {
++              /* 1:16: LPAR */
++              mLPAR(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 3:
++          // RSP.g:1:21: RPAR
++          {
++              /* 1:21: RPAR */
++              mRPAR(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 4:
++          // RSP.g:1:26: AND
++          {
++              /* 1:26: AND */
++              mAND(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 5:
++          // RSP.g:1:30: OR
++          {
++              /* 1:30: OR */
++              mOR(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 6:
++          // RSP.g:1:33: NOT
++          {
++              /* 1:33: NOT */
++              mNOT(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 7:
++          // RSP.g:1:37: EQUAL
++          {
++              /* 1:37: EQUAL */
++              mEQUAL(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 8:
++          // RSP.g:1:43: INCLUDES
++          {
++              /* 1:43: INCLUDES */
++              mINCLUDES(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 9:
++          // RSP.g:1:52: STARTSW
++          {
++              /* 1:52: STARTSW */
++              mSTARTSW(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 10:
++          // RSP.g:1:60: ENDSW
++          {
++              /* 1:60: ENDSW */
++              mENDSW(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 11:
++          // RSP.g:1:66: GREATER
++          {
++              /* 1:66: GREATER */
++              mGREATER(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 12:
++          // RSP.g:1:74: LESS
++          {
++              /* 1:74: LESS */
++              mLESS(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 13:
++          // RSP.g:1:79: GTE
++          {
++              /* 1:79: GTE */
++              mGTE(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 14:
++          // RSP.g:1:83: LTE
++          {
++              /* 1:83: LTE */
++              mLTE(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 15:
++          // RSP.g:1:87: BEFORE
++          {
++              /* 1:87: BEFORE */
++              mBEFORE(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 16:
++          // RSP.g:1:94: AFTER
++          {
++              /* 1:94: AFTER */
++              mAFTER(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 17:
++          // RSP.g:1:100: DAY
++          {
++              /* 1:100: DAY */
++              mDAY(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 18:
++          // RSP.g:1:104: WEEK
++          {
++              /* 1:104: WEEK */
++              mWEEK(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 19:
++          // RSP.g:1:109: MONTH
++          {
++              /* 1:109: MONTH */
++              mMONTH(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 20:
++          // RSP.g:1:115: YEAR
++          {
++              /* 1:115: YEAR */
++              mYEAR(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 21:
++          // RSP.g:1:120: TODAY
++          {
++              /* 1:120: TODAY */
++              mTODAY(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 22:
++          // RSP.g:1:126: NEWLINE
++          {
++              /* 1:126: NEWLINE */
++              mNEWLINE(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 23:
++          // RSP.g:1:134: WS
++          {
++              /* 1:134: WS */
++              mWS(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 24:
++          // RSP.g:1:137: FIELD
++          {
++              /* 1:137: FIELD */
++              mFIELD(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 25:
++          // RSP.g:1:143: INT
++          {
++              /* 1:143: INT */
++              mINT(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 26:
++          // RSP.g:1:147: DATE
++          {
++              /* 1:147: DATE */
++              mDATE(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++      case 27:
++          // RSP.g:1:152: STR
++          {
++              /* 1:152: STR */
++              mSTR(ctx ); 
++              if  (HASEXCEPTION())
++              {
++                  goto ruleTokensEx;
++              }
++
++
++          }
++          break;
++
++        }
++    }
++
++    
++    goto ruleTokensEx; /* Prevent compiler warnings */
++ruleTokensEx: ;
++}
++
++/* =========================================================================
++ * Lexer matching rules end.
++ * =========================================================================
++ */
++/* End of Lexer code
++ * ================================================
++ * ================================================
++ */ 
++
++
++/* End of code
++ * =============================================================================
++ */
+diff --git a/src/pregen/RSPLexer.h b/src/pregen/RSPLexer.h
+new file mode 100644
+index 0000000..4f4d06b
+--- /dev/null
++++ b/src/pregen/RSPLexer.h
+@@ -0,0 +1,254 @@
++/** \file
++ *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
++ *
++ *     -  From the grammar source file : RSP.g
++ *     -                            On : 2014-09-30 21:42:41
++ *     -                 for the lexer : RSPLexerLexer *
++ * Editing it, at least manually, is not wise. 
++ *
++ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
++ *
++ *
++ * The lexer RSPLexer has the callable functions (rules) shown below,
++ * which will invoke the code for the associated rule in the source grammar
++ * assuming that the input stream is pointing to a token/text stream that could begin
++ * this rule.
++ * 
++ * For instance if you call the first (topmost) rule in a parser grammar, you will
++ * get the results of a full parse, but calling a rule half way through the grammar will
++ * allow you to pass part of a full token stream to the parser, such as for syntax checking
++ * in editors and so on.
++ *
++ * The parser entry points are called indirectly (by function pointer to function) via
++ * a parser context typedef pRSPLexer, which is returned from a call to RSPLexerNew().
++ *
++ * As this is a generated lexer, it is unlikely you will call it 'manually'. However
++ * the methods are provided anyway.
++ * * The methods in pRSPLexer are  as follows:
++ *
++ *  -  void      pRSPLexer->QUOTE(pRSPLexer)
++ *  -  void      pRSPLexer->LPAR(pRSPLexer)
++ *  -  void      pRSPLexer->RPAR(pRSPLexer)
++ *  -  void      pRSPLexer->AND(pRSPLexer)
++ *  -  void      pRSPLexer->OR(pRSPLexer)
++ *  -  void      pRSPLexer->NOT(pRSPLexer)
++ *  -  void      pRSPLexer->EQUAL(pRSPLexer)
++ *  -  void      pRSPLexer->INCLUDES(pRSPLexer)
++ *  -  void      pRSPLexer->STARTSW(pRSPLexer)
++ *  -  void      pRSPLexer->ENDSW(pRSPLexer)
++ *  -  void      pRSPLexer->GREATER(pRSPLexer)
++ *  -  void      pRSPLexer->LESS(pRSPLexer)
++ *  -  void      pRSPLexer->GTE(pRSPLexer)
++ *  -  void      pRSPLexer->LTE(pRSPLexer)
++ *  -  void      pRSPLexer->BEFORE(pRSPLexer)
++ *  -  void      pRSPLexer->AFTER(pRSPLexer)
++ *  -  void      pRSPLexer->DAY(pRSPLexer)
++ *  -  void      pRSPLexer->WEEK(pRSPLexer)
++ *  -  void      pRSPLexer->MONTH(pRSPLexer)
++ *  -  void      pRSPLexer->YEAR(pRSPLexer)
++ *  -  void      pRSPLexer->TODAY(pRSPLexer)
++ *  -  void      pRSPLexer->NEWLINE(pRSPLexer)
++ *  -  void      pRSPLexer->WS(pRSPLexer)
++ *  -  void      pRSPLexer->FIELD(pRSPLexer)
++ *  -  void      pRSPLexer->INT(pRSPLexer)
++ *  -  void      pRSPLexer->DATE(pRSPLexer)
++ *  -  void      pRSPLexer->STR(pRSPLexer)
++ *  -  void      pRSPLexer->ESCAPED(pRSPLexer)
++ *  -  void      pRSPLexer->DIGIT09(pRSPLexer)
++ *  -  void      pRSPLexer->DIGIT19(pRSPLexer)
++ *  -  void      pRSPLexer->Tokens(pRSPLexer)
++ *
++ * The return type for any particular rule is of course determined by the source
++ * grammar file.
++ */
++// [The "BSD licence"]
++// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
++// http://www.temporal-wave.com
++// http://www.linkedin.com/in/jimidle
++//
++// All rights reserved.
++//
++// Redistribution and use in source and binary forms, with or without
++// modification, are permitted provided that the following conditions
++// are met:
++// 1. Redistributions of source code must retain the above copyright
++//    notice, this list of conditions and the following disclaimer.
++// 2. Redistributions in binary form must reproduce the above copyright
++//    notice, this list of conditions and the following disclaimer in the
++//    documentation and/or other materials provided with the distribution.
++// 3. The name of the author may not be used to endorse or promote products
++//    derived from this software without specific prior written permission.
++//
++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++#ifndef       _RSPLexer_H
++#define _RSPLexer_H
++/* =============================================================================
++ * Standard antlr3 C runtime definitions
++ */
++#include    <antlr3.h>
++
++/* End of standard antlr 3 runtime definitions
++ * =============================================================================
++ */
++ 
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++// Forward declare the context typedef so that we can use it before it is
++// properly defined. Delegators and delegates (from import statements) are
++// interdependent and their context structures contain pointers to each other
++// C only allows such things to be declared if you pre-declare the typedef.
++//
++typedef struct RSPLexer_Ctx_struct RSPLexer, * pRSPLexer;
++
++
++
++#ifdef        ANTLR3_WINDOWS
++// Disable: Unreferenced parameter,                                                   - Rules with parameters that are not used
++//          constant conditional,                                                     - ANTLR realizes that a prediction is always true (synpred usually)
++//          initialized but unused variable                                   - tree rewrite variables declared but not needed
++//          Unreferenced local variable                                               - lexer rule declares but does not always use _type
++//          potentially unitialized variable used                     - retval always returned from a rule 
++//                    unreferenced local function has been removed    - susually getTokenNames or freeScope, they can go without warnigns
++//
++// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
++// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
++// usually generated when a parser rule is given a parameter that it does not use. Mostly though
++// this is a matter of orthogonality hence I disable that one.
++//
++#pragma warning( disable : 4100 )
++#pragma warning( disable : 4101 )
++#pragma warning( disable : 4127 )
++#pragma warning( disable : 4189 )
++#pragma warning( disable : 4505 )
++#pragma warning( disable : 4701 )
++#endif
++
++/** Context tracking structure for RSPLexer
++ */
++struct RSPLexer_Ctx_struct
++{
++    /** Built in ANTLR3 context tracker contains all the generic elements
++     *  required for context tracking.
++     */
++    pANTLR3_LEXER    pLexer;
++
++
++     void (*mQUOTE)   (struct RSPLexer_Ctx_struct * ctx);
++     void (*mLPAR)    (struct RSPLexer_Ctx_struct * ctx);
++     void (*mRPAR)    (struct RSPLexer_Ctx_struct * ctx);
++     void (*mAND)     (struct RSPLexer_Ctx_struct * ctx);
++     void (*mOR)      (struct RSPLexer_Ctx_struct * ctx);
++     void (*mNOT)     (struct RSPLexer_Ctx_struct * ctx);
++     void (*mEQUAL)   (struct RSPLexer_Ctx_struct * ctx);
++     void (*mINCLUDES)        (struct RSPLexer_Ctx_struct * ctx);
++     void (*mSTARTSW) (struct RSPLexer_Ctx_struct * ctx);
++     void (*mENDSW)   (struct RSPLexer_Ctx_struct * ctx);
++     void (*mGREATER) (struct RSPLexer_Ctx_struct * ctx);
++     void (*mLESS)    (struct RSPLexer_Ctx_struct * ctx);
++     void (*mGTE)     (struct RSPLexer_Ctx_struct * ctx);
++     void (*mLTE)     (struct RSPLexer_Ctx_struct * ctx);
++     void (*mBEFORE)  (struct RSPLexer_Ctx_struct * ctx);
++     void (*mAFTER)   (struct RSPLexer_Ctx_struct * ctx);
++     void (*mDAY)     (struct RSPLexer_Ctx_struct * ctx);
++     void (*mWEEK)    (struct RSPLexer_Ctx_struct * ctx);
++     void (*mMONTH)   (struct RSPLexer_Ctx_struct * ctx);
++     void (*mYEAR)    (struct RSPLexer_Ctx_struct * ctx);
++     void (*mTODAY)   (struct RSPLexer_Ctx_struct * ctx);
++     void (*mNEWLINE) (struct RSPLexer_Ctx_struct * ctx);
++     void (*mWS)      (struct RSPLexer_Ctx_struct * ctx);
++     void (*mFIELD)   (struct RSPLexer_Ctx_struct * ctx);
++     void (*mINT)     (struct RSPLexer_Ctx_struct * ctx);
++     void (*mDATE)    (struct RSPLexer_Ctx_struct * ctx);
++     void (*mSTR)     (struct RSPLexer_Ctx_struct * ctx);
++     void (*mESCAPED) (struct RSPLexer_Ctx_struct * ctx);
++     void (*mDIGIT09) (struct RSPLexer_Ctx_struct * ctx);
++     void (*mDIGIT19) (struct RSPLexer_Ctx_struct * ctx);
++     void (*mTokens)  (struct RSPLexer_Ctx_struct * ctx);    const char * (*getGrammarFileName)();
++    void          (*free)   (struct RSPLexer_Ctx_struct * ctx);
++        
++};
++
++// Function protoypes for the constructor functions that external translation units
++// such as delegators and delegates may wish to call.
++//
++ANTLR3_API pRSPLexer RSPLexerNew         (pANTLR3_INPUT_STREAM instream);
++ANTLR3_API pRSPLexer RSPLexerNewSSD      (pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
++
++/** Symbolic definitions of all the tokens that the lexer will work with.
++ * \{
++ *
++ * Antlr will define EOF, but we can't use that as it it is too common in
++ * in C header files and that would be confusing. There is no way to filter this out at the moment
++ * so we just undef it here for now. That isn't the value we get back from C recognizers
++ * anyway. We are looking for ANTLR3_TOKEN_EOF.
++ */
++#ifdef        EOF
++#undef        EOF
++#endif
++#ifdef        Tokens
++#undef        Tokens
++#endif 
++#define STARTSW      14
++#define WEEK      26
++#define TODAY      24
++#define YEAR      28
++#define ENDSW      15
++#define GTE      20
++#define BEFORE      21
++#define DAY      25
++#define INT      16
++#define NOT      11
++#define AFTER      22
++#define AND      6
++#define EOF      -1
++#define LTE      19
++#define MONTH      27
++#define DIGIT19      31
++#define INCLUDES      13
++#define STR      10
++#define QUOTE      29
++#define GREATER      18
++#define WS      30
++#define LPAR      7
++#define NEWLINE      4
++#define EQUAL      12
++#define OR      5
++#define LESS      17
++#define FIELD      9
++#define RPAR      8
++#define ESCAPED      33
++#define DATE      23
++#define DIGIT09      32
++#ifdef        EOF
++#undef        EOF
++#define       EOF     ANTLR3_TOKEN_EOF
++#endif
++
++#ifndef TOKENSOURCE
++#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
++#endif
++
++/* End of token definitions for RSPLexer
++ * =============================================================================
++ */
++/** \} */
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
++
++/* END - Note:Keep extra line feed to satisfy UNIX systems */
+diff --git a/src/pregen/RSPParser.c b/src/pregen/RSPParser.c
+new file mode 100644
+index 0000000..c538e49
+--- /dev/null
++++ b/src/pregen/RSPParser.c
+@@ -0,0 +1,2684 @@
++/** \file
++ *  This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
++ *
++ *     -  From the grammar source file : RSP.g
++ *     -                            On : 2014-09-30 21:42:40
++ *     -                for the parser : RSPParserParser *
++ * Editing it, at least manually, is not wise. 
++ *
++ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
++ *
++ *
++*/
++// [The "BSD licence"]
++// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
++// http://www.temporal-wave.com
++// http://www.linkedin.com/in/jimidle
++//
++// All rights reserved.
++//
++// Redistribution and use in source and binary forms, with or without
++// modification, are permitted provided that the following conditions
++// are met:
++// 1. Redistributions of source code must retain the above copyright
++//    notice, this list of conditions and the following disclaimer.
++// 2. Redistributions in binary form must reproduce the above copyright
++//    notice, this list of conditions and the following disclaimer in the
++//    documentation and/or other materials provided with the distribution.
++// 3. The name of the author may not be used to endorse or promote products
++//    derived from this software without specific prior written permission.
++//
++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++/* -----------------------------------------
++ * Include the ANTLR3 generated header file.
++ */
++#include    "RSPParser.h"
++/* ----------------------------------------- */
++
++
++
++
++
++/* MACROS that hide the C interface implementations from the
++ * generated code, which makes it a little more understandable to the human eye.
++ * I am very much against using C pre-processor macros for function calls and bits
++ * of code as you cannot see what is happening when single stepping in debuggers
++ * and so on. The exception (in my book at least) is for generated code, where you are
++ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
++ * hides some indirect calls, but is always referring to the input stream. This is
++ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
++ * the runtime interfaces without changing the generated code too often, without
++ * confusing the reader of the generated output, who may not wish to know the gory
++ * details of the interface inheritance.
++ */
++ 
++#define               CTX     ctx
++
++/* Aids in accessing scopes for grammar programmers
++ */
++#undef        SCOPE_TYPE
++#undef        SCOPE_STACK
++#undef        SCOPE_TOP
++#define       SCOPE_TYPE(scope)   pRSPParser_##scope##_SCOPE
++#define SCOPE_STACK(scope)  pRSPParser_##scope##Stack
++#define       SCOPE_TOP(scope)    ctx->pRSPParser_##scope##Top
++#define       SCOPE_SIZE(scope)               ctx->pRSPParser_##scope##Stack_limit
++#define SCOPE_INSTANCE(scope, i)      (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
++
++/* Macros for accessing things in the parser
++ */
++ 
++#undef            PARSER                  
++#undef            RECOGNIZER              
++#undef            HAVEPARSEDRULE
++#undef                MEMOIZE
++#undef            INPUT
++#undef            STRSTREAM
++#undef            HASEXCEPTION
++#undef            EXCEPTION
++#undef            MATCHT
++#undef            MATCHANYT
++#undef            FOLLOWSTACK
++#undef            FOLLOWPUSH
++#undef            FOLLOWPOP
++#undef            PRECOVER
++#undef            PREPORTERROR
++#undef            LA
++#undef            LT
++#undef            CONSTRUCTEX
++#undef            CONSUME
++#undef            MARK
++#undef            REWIND
++#undef            REWINDLAST
++#undef            PERRORRECOVERY
++#undef            HASFAILED
++#undef            FAILEDFLAG
++#undef            RECOVERFROMMISMATCHEDSET
++#undef            RECOVERFROMMISMATCHEDELEMENT
++#undef                INDEX
++#undef      ADAPTOR
++#undef                SEEK
++#undef            RULEMEMO                
++#undef                DBG
++
++#define           PARSER                                                      ctx->pParser  
++#define           RECOGNIZER                                          PARSER->rec
++#define               PSRSTATE                                                RECOGNIZER->state
++#define           HAVEPARSEDRULE(r)                           RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
++#define               MEMOIZE(ri,si)                                  RECOGNIZER->memoize(RECOGNIZER, ri, si)
++#define           INPUT                                                       PARSER->tstream
++#define           STRSTREAM                                           INPUT
++#define               ISTREAM                                                 INPUT->istream
++#define               INDEX()                                                 ISTREAM->index(INPUT->istream)
++#define           HASEXCEPTION()                                      (PSRSTATE->error == ANTLR3_TRUE)
++#define           EXCEPTION                                           PSRSTATE->exception
++#define           MATCHT(t, fs)                                       RECOGNIZER->match(RECOGNIZER, t, fs)
++#define           MATCHANYT()                                         RECOGNIZER->matchAny(RECOGNIZER)
++#define           FOLLOWSTACK                                     PSRSTATE->following
++#define           FOLLOWPUSH(x)                                       FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
++#define           FOLLOWPOP()                                         FOLLOWSTACK->pop(FOLLOWSTACK)
++#define           PRECOVER()                                          RECOGNIZER->recover(RECOGNIZER)
++#define           PREPORTERROR()                                      RECOGNIZER->reportError(RECOGNIZER)
++#define           LA(n)                                                       INPUT->istream->_LA(ISTREAM, n)
++#define           LT(n)                                                       INPUT->_LT(INPUT, n)
++#define           CONSTRUCTEX()                                       RECOGNIZER->exConstruct(RECOGNIZER)
++#define           CONSUME()                                           ISTREAM->consume(ISTREAM)
++#define           MARK()                                                      ISTREAM->mark(ISTREAM)
++#define           REWIND(m)                                           ISTREAM->rewind(ISTREAM, m)
++#define           REWINDLAST()                                        ISTREAM->rewindLast(ISTREAM)
++#define               SEEK(n)                                                 ISTREAM->seek(ISTREAM, n)
++#define           PERRORRECOVERY                                      PSRSTATE->errorRecovery
++#define           FAILEDFLAG                                          PSRSTATE->failed
++#define           HASFAILED()                                         (FAILEDFLAG == ANTLR3_TRUE)
++#define           BACKTRACKING                                        PSRSTATE->backtracking
++#define           RECOVERFROMMISMATCHEDSET(s)         RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
++#define           RECOVERFROMMISMATCHEDELEMENT(e)     RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
++#define     ADAPTOR                         ctx->adaptor
++#define               RULEMEMO                                                PSRSTATE->ruleMemo
++#define               DBG                                                             RECOGNIZER->debugger
++
++#define               TOKTEXT(tok, txt)                               tok, (pANTLR3_UINT8)txt
++
++/* The 4 tokens defined below may well clash with your own #defines or token types. If so
++ * then for the present you must use different names for your defines as these are hard coded
++ * in the code generator. It would be better not to use such names internally, and maybe
++ * we can change this in a forthcoming release. I deliberately do not #undef these
++ * here as this will at least give you a redefined error somewhere if they clash.
++ */
++#define           UP      ANTLR3_TOKEN_UP
++#define           DOWN    ANTLR3_TOKEN_DOWN
++#define           EOR     ANTLR3_TOKEN_EOR
++#define           INVALID ANTLR3_TOKEN_INVALID
++
++
++/* =============================================================================
++ * Functions to create and destroy scopes. First come the rule scopes, followed
++ * by the global declared scopes.
++ */
++
++
++
++/* ============================================================================= */
++
++/* =============================================================================
++ * Start of recognizer
++ */
++
++
++
++/** \brief Table of all token names in symbolic order, mainly used for
++ *         error reporting.
++ */
++pANTLR3_UINT8   RSPParserTokenNames[30+4]
++     = {
++        (pANTLR3_UINT8) "<invalid>",       /* String to print to indicate an invalid token */
++        (pANTLR3_UINT8) "<EOR>",
++        (pANTLR3_UINT8) "<DOWN>", 
++        (pANTLR3_UINT8) "<UP>", 
++        (pANTLR3_UINT8) "NEWLINE",
++        (pANTLR3_UINT8) "OR",
++        (pANTLR3_UINT8) "AND",
++        (pANTLR3_UINT8) "LPAR",
++        (pANTLR3_UINT8) "RPAR",
++        (pANTLR3_UINT8) "FIELD",
++        (pANTLR3_UINT8) "STR",
++        (pANTLR3_UINT8) "NOT",
++        (pANTLR3_UINT8) "EQUAL",
++        (pANTLR3_UINT8) "INCLUDES",
++        (pANTLR3_UINT8) "STARTSW",
++        (pANTLR3_UINT8) "ENDSW",
++        (pANTLR3_UINT8) "INT",
++        (pANTLR3_UINT8) "LESS",
++        (pANTLR3_UINT8) "GREATER",
++        (pANTLR3_UINT8) "LTE",
++        (pANTLR3_UINT8) "GTE",
++        (pANTLR3_UINT8) "BEFORE",
++        (pANTLR3_UINT8) "AFTER",
++        (pANTLR3_UINT8) "DATE",
++        (pANTLR3_UINT8) "TODAY",
++        (pANTLR3_UINT8) "DAY",
++        (pANTLR3_UINT8) "WEEK",
++        (pANTLR3_UINT8) "MONTH",
++        (pANTLR3_UINT8) "YEAR",
++        (pANTLR3_UINT8) "QUOTE",
++        (pANTLR3_UINT8) "WS",
++        (pANTLR3_UINT8) "DIGIT19",
++        (pANTLR3_UINT8) "DIGIT09",
++        (pANTLR3_UINT8) "ESCAPED"
++       };
++
++        
++
++// Forward declare the locally static matching functions we have generated.
++//
++static RSPParser_query_return query    (pRSPParser ctx);
++static RSPParser_expr_return  expr    (pRSPParser ctx);
++static RSPParser_aexpr_return aexpr    (pRSPParser ctx);
++static RSPParser_crit_return  crit    (pRSPParser ctx);
++static RSPParser_strcrit_return       strcrit    (pRSPParser ctx);
++static RSPParser_strop_return strop    (pRSPParser ctx);
++static RSPParser_intcrit_return       intcrit    (pRSPParser ctx);
++static RSPParser_intop_return intop    (pRSPParser ctx);
++static RSPParser_datecrit_return      datecrit    (pRSPParser ctx);
++static RSPParser_dateop_return        dateop    (pRSPParser ctx);
++static RSPParser_datespec_return      datespec    (pRSPParser ctx);
++static RSPParser_dateref_return       dateref    (pRSPParser ctx);
++static RSPParser_dateintval_return    dateintval    (pRSPParser ctx);
++static void   RSPParserFree(pRSPParser ctx);
++/* For use in tree output where we are accumulating rule labels via label += ruleRef
++ * we need a function that knows how to free a return scope when the list is destroyed. 
++ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
++ */
++static        void ANTLR3_CDECL freeScope(void * scope)
++{
++    ANTLR3_FREE(scope);
++}
++
++/** \brief Name of the grammar file that generated this code
++ */
++static const char fileName[] = "RSP.g";
++
++/** \brief Return the name of the grammar file that generated this code.
++ */
++static const char * getGrammarFileName()
++{
++      return fileName;
++}
++/** \brief Create a new RSPParser parser and return a context for it.
++ *
++ * \param[in] instream Pointer to an input stream interface.
++ *
++ * \return Pointer to new parser context upon success.
++ */
++ANTLR3_API pRSPParser
++RSPParserNew   (pANTLR3_COMMON_TOKEN_STREAM instream)
++{
++      // See if we can create a new parser with the standard constructor
++      //
++      return RSPParserNewSSD(instream, NULL);
++}
++
++/** \brief Create a new RSPParser parser and return a context for it.
++ *
++ * \param[in] instream Pointer to an input stream interface.
++ *
++ * \return Pointer to new parser context upon success.
++ */
++ANTLR3_API pRSPParser
++RSPParserNewSSD   (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
++{
++    pRSPParser ctx;       /* Context structure we will build and return   */
++    
++    ctx       = (pRSPParser) ANTLR3_CALLOC(1, sizeof(RSPParser));
++    
++    if        (ctx == NULL)
++    {
++              // Failed to allocate memory for parser context
++              //
++        return  NULL;
++    }
++    
++    /* -------------------------------------------------------------------
++     * Memory for basic structure is allocated, now to fill in
++     * the base ANTLR3 structures. We initialize the function pointers
++     * for the standard ANTLR3 parser function set, but upon return
++     * from here, the programmer may set the pointers to provide custom
++     * implementations of each function. 
++     *
++     * We don't use the macros defined in RSPParser.h here, in order that you can get a sense
++     * of what goes where.
++     */
++
++    /* Create a base parser/recognizer, using the supplied token stream
++     */
++    ctx->pParser          = antlr3ParserNewStream(ANTLR3_SIZE_HINT, instream->tstream, state);
++    /* Install the implementation of our RSPParser interface
++     */
++    ctx->query        = query;
++    ctx->expr = expr;
++    ctx->aexpr        = aexpr;
++    ctx->crit = crit;
++    ctx->strcrit      = strcrit;
++    ctx->strop        = strop;
++    ctx->intcrit      = intcrit;
++    ctx->intop        = intop;
++    ctx->datecrit     = datecrit;
++    ctx->dateop       = dateop;
++    ctx->datespec     = datespec;
++    ctx->dateref      = dateref;
++    ctx->dateintval   = dateintval;
++    ctx->free                 = RSPParserFree;
++    ctx->getGrammarFileName   = getGrammarFileName;
++    
++    /* Install the scope pushing methods.
++     */
++    ADAPTOR   = ANTLR3_TREE_ADAPTORNew(instream->tstream->tokenSource->strFactory);
++    ctx->vectors      = antlr3VectorFactoryNew(0);
++    
++
++      
++    /* Install the token table
++     */
++    PSRSTATE->tokenNames   = RSPParserTokenNames;
++    
++    
++    /* Return the newly built parser to the caller
++     */
++    return  ctx;
++}
++
++/** Free the parser resources
++ */
++ static void
++ RSPParserFree(pRSPParser ctx)
++ {
++    /* Free any scope memory
++     */
++    
++    ctx->vectors->close(ctx->vectors);
++    /* We created the adaptor so we must free it
++     */
++    ADAPTOR->free(ADAPTOR);
++      // Free this parser
++      //
++    ctx->pParser->free(ctx->pParser);
++    ANTLR3_FREE(ctx);
++
++    /* Everything is released, so we can return
++     */
++    return;
++ }
++ 
++/** Return token names used by this parser
++ *
++ * The returned pointer is used as an index into the token names table (using the token 
++ * number as the index).
++ * 
++ * \return Pointer to first char * in the table.
++ */
++static pANTLR3_UINT8    *getTokenNames() 
++{
++        return RSPParserTokenNames; 
++}
++
++    
++/* Declare the bitsets
++ */
++
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_query42  */
++static        ANTLR3_BITWORD FOLLOW_expr_in_query42_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000010) };
++static  ANTLR3_BITSET_LIST FOLLOW_expr_in_query42     = { FOLLOW_expr_in_query42_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_NEWLINE_in_query44  */
++static        ANTLR3_BITWORD FOLLOW_NEWLINE_in_query44_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000) };
++static  ANTLR3_BITSET_LIST FOLLOW_NEWLINE_in_query44  = { FOLLOW_NEWLINE_in_query44_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_EOF_in_query47  */
++static        ANTLR3_BITWORD FOLLOW_EOF_in_query47_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_EOF_in_query47      = { FOLLOW_EOF_in_query47_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_aexpr_in_expr63  */
++static        ANTLR3_BITWORD FOLLOW_aexpr_in_expr63_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000022) };
++static  ANTLR3_BITSET_LIST FOLLOW_aexpr_in_expr63     = { FOLLOW_aexpr_in_expr63_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_OR_in_expr66  */
++static        ANTLR3_BITWORD FOLLOW_OR_in_expr66_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000000280) };
++static  ANTLR3_BITSET_LIST FOLLOW_OR_in_expr66        = { FOLLOW_OR_in_expr66_bits, 1 };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_aexpr_in_expr69  */
++static        ANTLR3_BITWORD FOLLOW_aexpr_in_expr69_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000022) };
++static  ANTLR3_BITSET_LIST FOLLOW_aexpr_in_expr69     = { FOLLOW_aexpr_in_expr69_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_crit_in_aexpr81  */
++static        ANTLR3_BITWORD FOLLOW_crit_in_aexpr81_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000042) };
++static  ANTLR3_BITSET_LIST FOLLOW_crit_in_aexpr81     = { FOLLOW_crit_in_aexpr81_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_AND_in_aexpr84  */
++static        ANTLR3_BITWORD FOLLOW_AND_in_aexpr84_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000280) };
++static  ANTLR3_BITSET_LIST FOLLOW_AND_in_aexpr84      = { FOLLOW_AND_in_aexpr84_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_crit_in_aexpr87  */
++static        ANTLR3_BITWORD FOLLOW_crit_in_aexpr87_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000042) };
++static  ANTLR3_BITSET_LIST FOLLOW_crit_in_aexpr87     = { FOLLOW_crit_in_aexpr87_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAR_in_crit99  */
++static        ANTLR3_BITWORD FOLLOW_LPAR_in_crit99_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000280) };
++static  ANTLR3_BITSET_LIST FOLLOW_LPAR_in_crit99      = { FOLLOW_LPAR_in_crit99_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_crit101  */
++static        ANTLR3_BITWORD FOLLOW_expr_in_crit101_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000100) };
++static  ANTLR3_BITSET_LIST FOLLOW_expr_in_crit101     = { FOLLOW_expr_in_crit101_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAR_in_crit103  */
++static        ANTLR3_BITWORD FOLLOW_RPAR_in_crit103_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_RPAR_in_crit103     = { FOLLOW_RPAR_in_crit103_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_strcrit_in_crit114  */
++static        ANTLR3_BITWORD FOLLOW_strcrit_in_crit114_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_strcrit_in_crit114  = { FOLLOW_strcrit_in_crit114_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_intcrit_in_crit119  */
++static        ANTLR3_BITWORD FOLLOW_intcrit_in_crit119_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_intcrit_in_crit119  = { FOLLOW_intcrit_in_crit119_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_datecrit_in_crit124  */
++static        ANTLR3_BITWORD FOLLOW_datecrit_in_crit124_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_datecrit_in_crit124 = { FOLLOW_datecrit_in_crit124_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_strcrit134  */
++static        ANTLR3_BITWORD FOLLOW_FIELD_in_strcrit134_bits[]        = { ANTLR3_UINT64_LIT(0x000000000000F000) };
++static  ANTLR3_BITSET_LIST FOLLOW_FIELD_in_strcrit134 = { FOLLOW_FIELD_in_strcrit134_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_strop_in_strcrit136  */
++static        ANTLR3_BITWORD FOLLOW_strop_in_strcrit136_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000400) };
++static  ANTLR3_BITSET_LIST FOLLOW_strop_in_strcrit136 = { FOLLOW_strop_in_strcrit136_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_strcrit138  */
++static        ANTLR3_BITWORD FOLLOW_STR_in_strcrit138_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_STR_in_strcrit138   = { FOLLOW_STR_in_strcrit138_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_strcrit155  */
++static        ANTLR3_BITWORD FOLLOW_FIELD_in_strcrit155_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000800) };
++static  ANTLR3_BITSET_LIST FOLLOW_FIELD_in_strcrit155 = { FOLLOW_FIELD_in_strcrit155_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_NOT_in_strcrit157  */
++static        ANTLR3_BITWORD FOLLOW_NOT_in_strcrit157_bits[]  = { ANTLR3_UINT64_LIT(0x000000000000F000) };
++static  ANTLR3_BITSET_LIST FOLLOW_NOT_in_strcrit157   = { FOLLOW_NOT_in_strcrit157_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_strop_in_strcrit159  */
++static        ANTLR3_BITWORD FOLLOW_strop_in_strcrit159_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000400) };
++static  ANTLR3_BITSET_LIST FOLLOW_strop_in_strcrit159 = { FOLLOW_strop_in_strcrit159_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_strcrit161  */
++static        ANTLR3_BITWORD FOLLOW_STR_in_strcrit161_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_STR_in_strcrit161   = { FOLLOW_STR_in_strcrit161_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_strop0  */
++static        ANTLR3_BITWORD FOLLOW_set_in_strop0_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_set_in_strop0       = { FOLLOW_set_in_strop0_bits, 1        };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_intcrit211  */
++static        ANTLR3_BITWORD FOLLOW_FIELD_in_intcrit211_bits[]        = { ANTLR3_UINT64_LIT(0x00000000001E1000) };
++static  ANTLR3_BITSET_LIST FOLLOW_FIELD_in_intcrit211 = { FOLLOW_FIELD_in_intcrit211_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_intop_in_intcrit213  */
++static        ANTLR3_BITWORD FOLLOW_intop_in_intcrit213_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000010000) };
++static  ANTLR3_BITSET_LIST FOLLOW_intop_in_intcrit213 = { FOLLOW_intop_in_intcrit213_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_intcrit215  */
++static        ANTLR3_BITWORD FOLLOW_INT_in_intcrit215_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_INT_in_intcrit215   = { FOLLOW_INT_in_intcrit215_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_intcrit232  */
++static        ANTLR3_BITWORD FOLLOW_FIELD_in_intcrit232_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000000800) };
++static  ANTLR3_BITSET_LIST FOLLOW_FIELD_in_intcrit232 = { FOLLOW_FIELD_in_intcrit232_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_NOT_in_intcrit234  */
++static        ANTLR3_BITWORD FOLLOW_NOT_in_intcrit234_bits[]  = { ANTLR3_UINT64_LIT(0x00000000001E1000) };
++static  ANTLR3_BITSET_LIST FOLLOW_NOT_in_intcrit234   = { FOLLOW_NOT_in_intcrit234_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_intop_in_intcrit236  */
++static        ANTLR3_BITWORD FOLLOW_intop_in_intcrit236_bits[]        = { ANTLR3_UINT64_LIT(0x0000000000010000) };
++static  ANTLR3_BITSET_LIST FOLLOW_intop_in_intcrit236 = { FOLLOW_intop_in_intcrit236_bits, 1  };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_intcrit238  */
++static        ANTLR3_BITWORD FOLLOW_INT_in_intcrit238_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_INT_in_intcrit238   = { FOLLOW_INT_in_intcrit238_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_intop0  */
++static        ANTLR3_BITWORD FOLLOW_set_in_intop0_bits[]      = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_set_in_intop0       = { FOLLOW_set_in_intop0_bits, 1        };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_datecrit292  */
++static        ANTLR3_BITWORD FOLLOW_FIELD_in_datecrit292_bits[]       = { ANTLR3_UINT64_LIT(0x0000000000600000) };
++static  ANTLR3_BITSET_LIST FOLLOW_FIELD_in_datecrit292        = { FOLLOW_FIELD_in_datecrit292_bits, 1 };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateop_in_datecrit294  */
++static        ANTLR3_BITWORD FOLLOW_dateop_in_datecrit294_bits[]      = { ANTLR3_UINT64_LIT(0x0000000001810000) };
++static  ANTLR3_BITSET_LIST FOLLOW_dateop_in_datecrit294       = { FOLLOW_dateop_in_datecrit294_bits, 1        };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_datespec_in_datecrit296  */
++static        ANTLR3_BITWORD FOLLOW_datespec_in_datecrit296_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_datespec_in_datecrit296     = { FOLLOW_datespec_in_datecrit296_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_dateop0  */
++static        ANTLR3_BITWORD FOLLOW_set_in_dateop0_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_set_in_dateop0      = { FOLLOW_set_in_dateop0_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateref_in_datespec331  */
++static        ANTLR3_BITWORD FOLLOW_dateref_in_datespec331_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_dateref_in_datespec331      = { FOLLOW_dateref_in_datespec331_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_datespec336  */
++static        ANTLR3_BITWORD FOLLOW_INT_in_datespec336_bits[] = { ANTLR3_UINT64_LIT(0x000000001E000000) };
++static  ANTLR3_BITSET_LIST FOLLOW_INT_in_datespec336  = { FOLLOW_INT_in_datespec336_bits, 1   };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateintval_in_datespec338  */
++static        ANTLR3_BITWORD FOLLOW_dateintval_in_datespec338_bits[]  = { ANTLR3_UINT64_LIT(0x0000000000600000) };
++static  ANTLR3_BITSET_LIST FOLLOW_dateintval_in_datespec338   = { FOLLOW_dateintval_in_datespec338_bits, 1    };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateop_in_datespec340  */
++static        ANTLR3_BITWORD FOLLOW_dateop_in_datespec340_bits[]      = { ANTLR3_UINT64_LIT(0x0000000001800000) };
++static  ANTLR3_BITSET_LIST FOLLOW_dateop_in_datespec340       = { FOLLOW_dateop_in_datespec340_bits, 1        };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateref_in_datespec342  */
++static        ANTLR3_BITWORD FOLLOW_dateref_in_datespec342_bits[]     = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_dateref_in_datespec342      = { FOLLOW_dateref_in_datespec342_bits, 1       };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_dateref0  */
++static        ANTLR3_BITWORD FOLLOW_set_in_dateref0_bits[]    = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_set_in_dateref0     = { FOLLOW_set_in_dateref0_bits, 1      };
++/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_dateintval0  */
++static        ANTLR3_BITWORD FOLLOW_set_in_dateintval0_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
++static  ANTLR3_BITSET_LIST FOLLOW_set_in_dateintval0  = { FOLLOW_set_in_dateintval0_bits, 1   };
++     
++
++ 
++ 
++/* ==============================================
++ * Parsing rules
++ */
++/** 
++ * $ANTLR start query
++ * RSP.g:27:1: query : expr ( NEWLINE )? EOF -> expr ;
++ */
++static RSPParser_query_return
++query(pRSPParser ctx)
++{   
++    RSPParser_query_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    NEWLINE2;
++    pANTLR3_COMMON_TOKEN    EOF3;
++    RSPParser_expr_return expr1;
++    #undef    RETURN_TYPE_expr1
++    #define   RETURN_TYPE_expr1 RSPParser_expr_return
++
++    pANTLR3_BASE_TREE NEWLINE2_tree;
++    pANTLR3_BASE_TREE EOF3_tree;
++    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_NEWLINE;
++    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_EOF;
++    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_expr;
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    NEWLINE2       = NULL;
++    EOF3       = NULL;
++    expr1.tree = NULL;
++
++    retval.start = LT(1); retval.stop = retval.start;
++
++    NEWLINE2_tree   = NULL;
++    EOF3_tree   = NULL;
++
++    stream_NEWLINE   = NULL;
++    #define CREATE_stream_NEWLINE  if (stream_NEWLINE == NULL) {stream_NEWLINE = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token NEWLINE"); } 
++    stream_EOF   = NULL;
++    #define CREATE_stream_EOF  if (stream_EOF == NULL) {stream_EOF = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token EOF"); } 
++    stream_expr   = NULL;
++    #define CREATE_stream_expr  if (stream_expr == NULL) {stream_expr = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule expr"); }
++
++    retval.tree  = NULL;
++    {
++        // RSP.g:27:7: ( expr ( NEWLINE )? EOF -> expr )
++        // RSP.g:27:9: expr ( NEWLINE )? EOF
++        {
++            FOLLOWPUSH(FOLLOW_expr_in_query42);
++            expr1=expr(ctx);
++
++            FOLLOWPOP();
++            if  (HASEXCEPTION())
++            {
++                goto rulequeryEx;
++            }
++
++            CREATE_stream_expr; stream_expr->add(stream_expr, expr1.tree, NULL);
++
++            // RSP.g:27:14: ( NEWLINE )?
++            {
++                int alt1=2;
++                switch ( LA(1) ) 
++                {
++                    case NEWLINE:
++                      {
++                              alt1=1;
++                      }
++                        break;
++                }
++
++                switch (alt1) 
++                {
++              case 1:
++                  // RSP.g:27:14: NEWLINE
++                  {
++                      NEWLINE2 = (pANTLR3_COMMON_TOKEN) MATCHT(NEWLINE, &FOLLOW_NEWLINE_in_query44); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulequeryEx;
++                      }
++                       
++                      CREATE_stream_NEWLINE; stream_NEWLINE->add(stream_NEWLINE, NEWLINE2, NULL);
++
++
++                  }
++                  break;
++
++                }
++            }
++            EOF3 = (pANTLR3_COMMON_TOKEN) MATCHT(EOF, &FOLLOW_EOF_in_query47); 
++            if  (HASEXCEPTION())
++            {
++                goto rulequeryEx;
++            }
++             
++            CREATE_stream_EOF; stream_EOF->add(stream_EOF, EOF3, NULL);
++
++
++             
++            /* AST REWRITE
++             * elements          : expr
++             * token labels      : 
++             * rule labels       : retval
++             * token list labels : 
++             * rule list labels  : 
++             */
++            {
++              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
++
++              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
++
++              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++              retval.tree    = root_0;
++              // 27:28: -> expr
++              {
++                  ADAPTOR->addChild(ADAPTOR, root_0, stream_expr == NULL ? NULL : stream_expr->nextTree(stream_expr));
++
++              }
++
++              retval.tree = root_0; // set result root
++              if (stream_retval != NULL) stream_retval->free(stream_retval);
++
++
++            }
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto rulequeryEx; /* Prevent compiler warnings */
++    rulequeryEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++        if (stream_NEWLINE != NULL) stream_NEWLINE->free(stream_NEWLINE);
++        if (stream_EOF != NULL) stream_EOF->free(stream_EOF);
++        if (stream_expr != NULL) stream_expr->free(stream_expr);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end query */
++
++/** 
++ * $ANTLR start expr
++ * RSP.g:30:1: expr : aexpr ( OR aexpr )* ;
++ */
++static RSPParser_expr_return
++expr(pRSPParser ctx)
++{   
++    RSPParser_expr_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    OR5;
++    RSPParser_aexpr_return aexpr4;
++    #undef    RETURN_TYPE_aexpr4
++    #define   RETURN_TYPE_aexpr4 RSPParser_aexpr_return
++
++    RSPParser_aexpr_return aexpr6;
++    #undef    RETURN_TYPE_aexpr6
++    #define   RETURN_TYPE_aexpr6 RSPParser_aexpr_return
++
++    pANTLR3_BASE_TREE OR5_tree;
++
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    OR5       = NULL;
++    aexpr4.tree = NULL;
++
++    aexpr6.tree = NULL;
++
++    retval.start = LT(1); retval.stop = retval.start;
++
++    OR5_tree   = NULL;
++
++
++    retval.tree  = NULL;
++    {
++        // RSP.g:30:6: ( aexpr ( OR aexpr )* )
++        // RSP.g:30:8: aexpr ( OR aexpr )*
++        {
++            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++            FOLLOWPUSH(FOLLOW_aexpr_in_expr63);
++            aexpr4=aexpr(ctx);
++
++            FOLLOWPOP();
++            if  (HASEXCEPTION())
++            {
++                goto ruleexprEx;
++            }
++
++            ADAPTOR->addChild(ADAPTOR, root_0, aexpr4.tree);
++
++            // RSP.g:30:14: ( OR aexpr )*
++
++            for (;;)
++            {
++                int alt2=2;
++                switch ( LA(1) ) 
++                {
++                case OR:
++                      {
++                              alt2=1;
++                      }
++                    break;
++
++                }
++
++                switch (alt2) 
++                {
++              case 1:
++                  // RSP.g:30:15: OR aexpr
++                  {
++                      OR5 = (pANTLR3_COMMON_TOKEN) MATCHT(OR, &FOLLOW_OR_in_expr66); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      OR5_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, OR5));
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, OR5_tree, root_0));
++
++                      FOLLOWPUSH(FOLLOW_aexpr_in_expr69);
++                      aexpr6=aexpr(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleexprEx;
++                      }
++
++                      ADAPTOR->addChild(ADAPTOR, root_0, aexpr6.tree);
++
++                  }
++                  break;
++
++              default:
++                  goto loop2; /* break out of the loop */
++                  break;
++                }
++            }
++            loop2: ; /* Jump out to here if this rule does not match */
++
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruleexprEx; /* Prevent compiler warnings */
++    ruleexprEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end expr */
++
++/** 
++ * $ANTLR start aexpr
++ * RSP.g:33:1: aexpr : crit ( AND crit )* ;
++ */
++static RSPParser_aexpr_return
++aexpr(pRSPParser ctx)
++{   
++    RSPParser_aexpr_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    AND8;
++    RSPParser_crit_return crit7;
++    #undef    RETURN_TYPE_crit7
++    #define   RETURN_TYPE_crit7 RSPParser_crit_return
++
++    RSPParser_crit_return crit9;
++    #undef    RETURN_TYPE_crit9
++    #define   RETURN_TYPE_crit9 RSPParser_crit_return
++
++    pANTLR3_BASE_TREE AND8_tree;
++
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    AND8       = NULL;
++    crit7.tree = NULL;
++
++    crit9.tree = NULL;
++
++    retval.start = LT(1); retval.stop = retval.start;
++
++    AND8_tree   = NULL;
++
++
++    retval.tree  = NULL;
++    {
++        // RSP.g:33:7: ( crit ( AND crit )* )
++        // RSP.g:33:9: crit ( AND crit )*
++        {
++            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++            FOLLOWPUSH(FOLLOW_crit_in_aexpr81);
++            crit7=crit(ctx);
++
++            FOLLOWPOP();
++            if  (HASEXCEPTION())
++            {
++                goto ruleaexprEx;
++            }
++
++            ADAPTOR->addChild(ADAPTOR, root_0, crit7.tree);
++
++            // RSP.g:33:14: ( AND crit )*
++
++            for (;;)
++            {
++                int alt3=2;
++                switch ( LA(1) ) 
++                {
++                case AND:
++                      {
++                              alt3=1;
++                      }
++                    break;
++
++                }
++
++                switch (alt3) 
++                {
++              case 1:
++                  // RSP.g:33:15: AND crit
++                  {
++                      AND8 = (pANTLR3_COMMON_TOKEN) MATCHT(AND, &FOLLOW_AND_in_aexpr84); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleaexprEx;
++                      }
++
++                      AND8_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, AND8));
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, AND8_tree, root_0));
++
++                      FOLLOWPUSH(FOLLOW_crit_in_aexpr87);
++                      crit9=crit(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleaexprEx;
++                      }
++
++                      ADAPTOR->addChild(ADAPTOR, root_0, crit9.tree);
++
++                  }
++                  break;
++
++              default:
++                  goto loop3; /* break out of the loop */
++                  break;
++                }
++            }
++            loop3: ; /* Jump out to here if this rule does not match */
++
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruleaexprEx; /* Prevent compiler warnings */
++    ruleaexprEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end aexpr */
++
++/** 
++ * $ANTLR start crit
++ * RSP.g:36:1: crit : ( LPAR expr RPAR -> expr | strcrit | intcrit | datecrit );
++ */
++static RSPParser_crit_return
++crit(pRSPParser ctx)
++{   
++    RSPParser_crit_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    LPAR10;
++    pANTLR3_COMMON_TOKEN    RPAR12;
++    RSPParser_expr_return expr11;
++    #undef    RETURN_TYPE_expr11
++    #define   RETURN_TYPE_expr11 RSPParser_expr_return
++
++    RSPParser_strcrit_return strcrit13;
++    #undef    RETURN_TYPE_strcrit13
++    #define   RETURN_TYPE_strcrit13 RSPParser_strcrit_return
++
++    RSPParser_intcrit_return intcrit14;
++    #undef    RETURN_TYPE_intcrit14
++    #define   RETURN_TYPE_intcrit14 RSPParser_intcrit_return
++
++    RSPParser_datecrit_return datecrit15;
++    #undef    RETURN_TYPE_datecrit15
++    #define   RETURN_TYPE_datecrit15 RSPParser_datecrit_return
++
++    pANTLR3_BASE_TREE LPAR10_tree;
++    pANTLR3_BASE_TREE RPAR12_tree;
++    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_RPAR;
++    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_LPAR;
++    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_expr;
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    LPAR10       = NULL;
++    RPAR12       = NULL;
++    expr11.tree = NULL;
++
++    strcrit13.tree = NULL;
++
++    intcrit14.tree = NULL;
++
++    datecrit15.tree = NULL;
++
++    retval.start = LT(1); retval.stop = retval.start;
++
++    LPAR10_tree   = NULL;
++    RPAR12_tree   = NULL;
++
++    stream_RPAR   = NULL;
++    #define CREATE_stream_RPAR  if (stream_RPAR == NULL) {stream_RPAR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token RPAR"); } 
++    stream_LPAR   = NULL;
++    #define CREATE_stream_LPAR  if (stream_LPAR == NULL) {stream_LPAR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token LPAR"); } 
++    stream_expr   = NULL;
++    #define CREATE_stream_expr  if (stream_expr == NULL) {stream_expr = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule expr"); }
++
++    retval.tree  = NULL;
++    {
++        {
++            //  RSP.g:36:6: ( LPAR expr RPAR -> expr | strcrit | intcrit | datecrit )
++            
++            ANTLR3_UINT32 alt4;
++
++            alt4=4;
++
++            switch ( LA(1) ) 
++            {
++            case LPAR:
++              {
++                      alt4=1;
++              }
++                break;
++            case FIELD:
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case NOT:
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case EQUAL:
++                                              {
++                                                      switch ( LA(4) ) 
++                                                      {
++                                                      case STR:
++                                                              {
++                                                                      alt4=2;
++                                                              }
++                                                          break;
++                                                      case INT:
++                                                              {
++                                                                      alt4=3;
++                                                              }
++                                                          break;
++
++                                                      default:
++                                                          CONSTRUCTEX();
++                                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                                          EXCEPTION->message      = (void *)"";
++                                                          EXCEPTION->decisionNum  = 4;
++                                                          EXCEPTION->state        = 8;
++
++
++                                                          goto rulecritEx;
++                                                      }
++
++                                              }
++                                          break;
++                                      case INCLUDES:
++                                      case STARTSW:
++                                      case ENDSW:
++                                              {
++                                                      alt4=2;
++                                              }
++                                          break;
++                                      case LESS:
++                                      case GREATER:
++                                      case LTE:
++                                      case GTE:
++                                              {
++                                                      alt4=3;
++                                              }
++                                          break;
++
++                                      default:
++                                          CONSTRUCTEX();
++                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                          EXCEPTION->message      = (void *)"";
++                                          EXCEPTION->decisionNum  = 4;
++                                          EXCEPTION->state        = 3;
++
++
++                                          goto rulecritEx;
++                                      }
++
++                              }
++                          break;
++                      case EQUAL:
++                              {
++                                      switch ( LA(3) ) 
++                                      {
++                                      case INT:
++                                              {
++                                                      alt4=3;
++                                              }
++                                          break;
++                                      case STR:
++                                              {
++                                                      alt4=2;
++                                              }
++                                          break;
++
++                                      default:
++                                          CONSTRUCTEX();
++                                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                                          EXCEPTION->message      = (void *)"";
++                                          EXCEPTION->decisionNum  = 4;
++                                          EXCEPTION->state        = 4;
++
++
++                                          goto rulecritEx;
++                                      }
++
++                              }
++                          break;
++                      case BEFORE:
++                      case AFTER:
++                              {
++                                      alt4=4;
++                              }
++                          break;
++                      case LESS:
++                      case GREATER:
++                      case LTE:
++                      case GTE:
++                              {
++                                      alt4=3;
++                              }
++                          break;
++                      case INCLUDES:
++                      case STARTSW:
++                      case ENDSW:
++                              {
++                                      alt4=2;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 4;
++                          EXCEPTION->state        = 2;
++
++
++                          goto rulecritEx;
++                      }
++
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 4;
++                EXCEPTION->state        = 0;
++
++
++                goto rulecritEx;
++            }
++
++            switch (alt4) 
++            {
++              case 1:
++                  // RSP.g:36:8: LPAR expr RPAR
++                  {
++                      LPAR10 = (pANTLR3_COMMON_TOKEN) MATCHT(LPAR, &FOLLOW_LPAR_in_crit99); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++                       
++                      CREATE_stream_LPAR; stream_LPAR->add(stream_LPAR, LPAR10, NULL);
++
++                      FOLLOWPUSH(FOLLOW_expr_in_crit101);
++                      expr11=expr(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++
++                      CREATE_stream_expr; stream_expr->add(stream_expr, expr11.tree, NULL);
++                      RPAR12 = (pANTLR3_COMMON_TOKEN) MATCHT(RPAR, &FOLLOW_RPAR_in_crit103); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++                       
++                      CREATE_stream_RPAR; stream_RPAR->add(stream_RPAR, RPAR12, NULL);
++
++
++                       
++                      /* AST REWRITE
++                       * elements          : expr
++                       * token labels      : 
++                       * rule labels       : retval
++                       * token list labels : 
++                       * rule list labels  : 
++                       */
++                      {
++                              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
++
++                              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
++
++                              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++                              retval.tree    = root_0;
++                              // 36:25: -> expr
++                              {
++                                  ADAPTOR->addChild(ADAPTOR, root_0, stream_expr == NULL ? NULL : stream_expr->nextTree(stream_expr));
++
++                              }
++
++                              retval.tree = root_0; // set result root
++                              if (stream_retval != NULL) stream_retval->free(stream_retval);
++
++
++                      }
++                  }
++                  break;
++              case 2:
++                  // RSP.g:37:4: strcrit
++                  {
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++                      FOLLOWPUSH(FOLLOW_strcrit_in_crit114);
++                      strcrit13=strcrit(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++
++                      ADAPTOR->addChild(ADAPTOR, root_0, strcrit13.tree);
++
++                  }
++                  break;
++              case 3:
++                  // RSP.g:38:4: intcrit
++                  {
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++                      FOLLOWPUSH(FOLLOW_intcrit_in_crit119);
++                      intcrit14=intcrit(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++
++                      ADAPTOR->addChild(ADAPTOR, root_0, intcrit14.tree);
++
++                  }
++                  break;
++              case 4:
++                  // RSP.g:39:4: datecrit
++                  {
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++                      FOLLOWPUSH(FOLLOW_datecrit_in_crit124);
++                      datecrit15=datecrit(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulecritEx;
++                      }
++
++                      ADAPTOR->addChild(ADAPTOR, root_0, datecrit15.tree);
++
++                  }
++                  break;
++
++            }
++        }
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto rulecritEx; /* Prevent compiler warnings */
++    rulecritEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++        if (stream_RPAR != NULL) stream_RPAR->free(stream_RPAR);
++        if (stream_LPAR != NULL) stream_LPAR->free(stream_LPAR);
++        if (stream_expr != NULL) stream_expr->free(stream_expr);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end crit */
++
++/** 
++ * $ANTLR start strcrit
++ * RSP.g:42:1: strcrit : ( FIELD strop STR -> ^( strop FIELD STR ) | FIELD NOT strop STR -> ^( NOT ^( strop FIELD STR ) ) );
++ */
++static RSPParser_strcrit_return
++strcrit(pRSPParser ctx)
++{   
++    RSPParser_strcrit_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    FIELD16;
++    pANTLR3_COMMON_TOKEN    STR18;
++    pANTLR3_COMMON_TOKEN    FIELD19;
++    pANTLR3_COMMON_TOKEN    NOT20;
++    pANTLR3_COMMON_TOKEN    STR22;
++    RSPParser_strop_return strop17;
++    #undef    RETURN_TYPE_strop17
++    #define   RETURN_TYPE_strop17 RSPParser_strop_return
++
++    RSPParser_strop_return strop21;
++    #undef    RETURN_TYPE_strop21
++    #define   RETURN_TYPE_strop21 RSPParser_strop_return
++
++    pANTLR3_BASE_TREE FIELD16_tree;
++    pANTLR3_BASE_TREE STR18_tree;
++    pANTLR3_BASE_TREE FIELD19_tree;
++    pANTLR3_BASE_TREE NOT20_tree;
++    pANTLR3_BASE_TREE STR22_tree;
++    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_STR;
++    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_FIELD;
++    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_NOT;
++    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_strop;
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    FIELD16       = NULL;
++    STR18       = NULL;
++    FIELD19       = NULL;
++    NOT20       = NULL;
++    STR22       = NULL;
++    strop17.tree = NULL;
++
++    strop21.tree = NULL;
++
++    retval.start = LT(1); retval.stop = retval.start;
++
++    FIELD16_tree   = NULL;
++    STR18_tree   = NULL;
++    FIELD19_tree   = NULL;
++    NOT20_tree   = NULL;
++    STR22_tree   = NULL;
++
++    stream_STR   = NULL;
++    #define CREATE_stream_STR  if (stream_STR == NULL) {stream_STR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token STR"); } 
++    stream_FIELD   = NULL;
++    #define CREATE_stream_FIELD  if (stream_FIELD == NULL) {stream_FIELD = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token FIELD"); } 
++    stream_NOT   = NULL;
++    #define CREATE_stream_NOT  if (stream_NOT == NULL) {stream_NOT = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token NOT"); } 
++    stream_strop   = NULL;
++    #define CREATE_stream_strop  if (stream_strop == NULL) {stream_strop = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule strop"); }
++
++    retval.tree  = NULL;
++    {
++        {
++            //  RSP.g:42:9: ( FIELD strop STR -> ^( strop FIELD STR ) | FIELD NOT strop STR -> ^( NOT ^( strop FIELD STR ) ) )
++            
++            ANTLR3_UINT32 alt5;
++
++            alt5=2;
++
++            switch ( LA(1) ) 
++            {
++            case FIELD:
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case NOT:
++                              {
++                                      alt5=2;
++                              }
++                          break;
++                      case EQUAL:
++                      case INCLUDES:
++                      case STARTSW:
++                      case ENDSW:
++                              {
++                                      alt5=1;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 5;
++                          EXCEPTION->state        = 1;
++
++
++                          goto rulestrcritEx;
++                      }
++
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 5;
++                EXCEPTION->state        = 0;
++
++
++                goto rulestrcritEx;
++            }
++
++            switch (alt5) 
++            {
++              case 1:
++                  // RSP.g:42:11: FIELD strop STR
++                  {
++                      FIELD16 = (pANTLR3_COMMON_TOKEN) MATCHT(FIELD, &FOLLOW_FIELD_in_strcrit134); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulestrcritEx;
++                      }
++                       
++                      CREATE_stream_FIELD; stream_FIELD->add(stream_FIELD, FIELD16, NULL);
++
++                      FOLLOWPUSH(FOLLOW_strop_in_strcrit136);
++                      strop17=strop(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulestrcritEx;
++                      }
++
++                      CREATE_stream_strop; stream_strop->add(stream_strop, strop17.tree, NULL);
++                      STR18 = (pANTLR3_COMMON_TOKEN) MATCHT(STR, &FOLLOW_STR_in_strcrit138); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulestrcritEx;
++                      }
++                       
++                      CREATE_stream_STR; stream_STR->add(stream_STR, STR18, NULL);
++
++
++                       
++                      /* AST REWRITE
++                       * elements          : strop, STR, FIELD
++                       * token labels      : 
++                       * rule labels       : retval
++                       * token list labels : 
++                       * rule list labels  : 
++                       */
++                      {
++                              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
++
++                              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
++
++                              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++                              retval.tree    = root_0;
++                              // 42:29: -> ^( strop FIELD STR )
++                              {
++                                  // RSP.g:42:32: ^( strop FIELD STR )
++                                  {
++                                      pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++                                      root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_strop == NULL ? NULL : stream_strop->nextNode(stream_strop), root_1));
++
++                                      ADAPTOR->addChild(ADAPTOR, root_1, stream_FIELD == NULL ? NULL : stream_FIELD->nextNode(stream_FIELD));
++                                      ADAPTOR->addChild(ADAPTOR, root_1, stream_STR == NULL ? NULL : stream_STR->nextNode(stream_STR));
++
++                                      ADAPTOR->addChild(ADAPTOR, root_0, root_1);
++                                  }
++
++                              }
++
++                              retval.tree = root_0; // set result root
++                              if (stream_retval != NULL) stream_retval->free(stream_retval);
++
++
++                      }
++                  }
++                  break;
++              case 2:
++                  // RSP.g:43:4: FIELD NOT strop STR
++                  {
++                      FIELD19 = (pANTLR3_COMMON_TOKEN) MATCHT(FIELD, &FOLLOW_FIELD_in_strcrit155); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulestrcritEx;
++                      }
++                       
++                      CREATE_stream_FIELD; stream_FIELD->add(stream_FIELD, FIELD19, NULL);
++
++                      NOT20 = (pANTLR3_COMMON_TOKEN) MATCHT(NOT, &FOLLOW_NOT_in_strcrit157); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulestrcritEx;
++                      }
++                       
++                      CREATE_stream_NOT; stream_NOT->add(stream_NOT, NOT20, NULL);
++
++                      FOLLOWPUSH(FOLLOW_strop_in_strcrit159);
++                      strop21=strop(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulestrcritEx;
++                      }
++
++                      CREATE_stream_strop; stream_strop->add(stream_strop, strop21.tree, NULL);
++                      STR22 = (pANTLR3_COMMON_TOKEN) MATCHT(STR, &FOLLOW_STR_in_strcrit161); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto rulestrcritEx;
++                      }
++                       
++                      CREATE_stream_STR; stream_STR->add(stream_STR, STR22, NULL);
++
++
++                       
++                      /* AST REWRITE
++                       * elements          : NOT, FIELD, strop, STR
++                       * token labels      : 
++                       * rule labels       : retval
++                       * token list labels : 
++                       * rule list labels  : 
++                       */
++                      {
++                              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
++
++                              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
++
++                              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++                              retval.tree    = root_0;
++                              // 43:25: -> ^( NOT ^( strop FIELD STR ) )
++                              {
++                                  // RSP.g:43:28: ^( NOT ^( strop FIELD STR ) )
++                                  {
++                                      pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++                                      root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_NOT == NULL ? NULL : stream_NOT->nextNode(stream_NOT), root_1));
++
++                                      // RSP.g:43:34: ^( strop FIELD STR )
++                                      {
++                                          pANTLR3_BASE_TREE root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++                                          root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_strop == NULL ? NULL : stream_strop->nextNode(stream_strop), root_2));
++
++                                          ADAPTOR->addChild(ADAPTOR, root_2, stream_FIELD == NULL ? NULL : stream_FIELD->nextNode(stream_FIELD));
++                                          ADAPTOR->addChild(ADAPTOR, root_2, stream_STR == NULL ? NULL : stream_STR->nextNode(stream_STR));
++
++                                          ADAPTOR->addChild(ADAPTOR, root_1, root_2);
++                                      }
++
++                                      ADAPTOR->addChild(ADAPTOR, root_0, root_1);
++                                  }
++
++                              }
++
++                              retval.tree = root_0; // set result root
++                              if (stream_retval != NULL) stream_retval->free(stream_retval);
++
++
++                      }
++                  }
++                  break;
++
++            }
++        }
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto rulestrcritEx; /* Prevent compiler warnings */
++    rulestrcritEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++        if (stream_STR != NULL) stream_STR->free(stream_STR);
++        if (stream_FIELD != NULL) stream_FIELD->free(stream_FIELD);
++        if (stream_NOT != NULL) stream_NOT->free(stream_NOT);
++        if (stream_strop != NULL) stream_strop->free(stream_strop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end strcrit */
++
++/** 
++ * $ANTLR start strop
++ * RSP.g:46:1: strop : ( EQUAL | INCLUDES | STARTSW | ENDSW );
++ */
++static RSPParser_strop_return
++strop(pRSPParser ctx)
++{   
++    RSPParser_strop_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    set23;
++
++    pANTLR3_BASE_TREE set23_tree;
++
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    set23       = NULL;
++    retval.start = LT(1); retval.stop = retval.start;
++
++    set23_tree   = NULL;
++
++
++    retval.tree  = NULL;
++    {
++        // RSP.g:46:7: ( EQUAL | INCLUDES | STARTSW | ENDSW )
++        // RSP.g:
++        {
++            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++            set23=(pANTLR3_COMMON_TOKEN)LT(1);
++            if ( ((LA(1) >= EQUAL) && (LA(1) <= ENDSW)) )
++            {
++                CONSUME();
++                ADAPTOR->addChild(ADAPTOR, root_0, (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, set23)));
++                PERRORRECOVERY=ANTLR3_FALSE;
++            }
++            else 
++            {
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
++                EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
++                EXCEPTION->expectingSet = &FOLLOW_set_in_strop0;
++                RECOVERFROMMISMATCHEDSET(&FOLLOW_set_in_strop0);    goto rulestropEx;
++            }
++
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto rulestropEx; /* Prevent compiler warnings */
++    rulestropEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end strop */
++
++/** 
++ * $ANTLR start intcrit
++ * RSP.g:52:1: intcrit : ( FIELD intop INT -> ^( intop FIELD INT ) | FIELD NOT intop INT -> ^( NOT ^( intop FIELD INT ) ) );
++ */
++static RSPParser_intcrit_return
++intcrit(pRSPParser ctx)
++{   
++    RSPParser_intcrit_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    FIELD24;
++    pANTLR3_COMMON_TOKEN    INT26;
++    pANTLR3_COMMON_TOKEN    FIELD27;
++    pANTLR3_COMMON_TOKEN    NOT28;
++    pANTLR3_COMMON_TOKEN    INT30;
++    RSPParser_intop_return intop25;
++    #undef    RETURN_TYPE_intop25
++    #define   RETURN_TYPE_intop25 RSPParser_intop_return
++
++    RSPParser_intop_return intop29;
++    #undef    RETURN_TYPE_intop29
++    #define   RETURN_TYPE_intop29 RSPParser_intop_return
++
++    pANTLR3_BASE_TREE FIELD24_tree;
++    pANTLR3_BASE_TREE INT26_tree;
++    pANTLR3_BASE_TREE FIELD27_tree;
++    pANTLR3_BASE_TREE NOT28_tree;
++    pANTLR3_BASE_TREE INT30_tree;
++    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_FIELD;
++    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_INT;
++    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_NOT;
++    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_intop;
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    FIELD24       = NULL;
++    INT26       = NULL;
++    FIELD27       = NULL;
++    NOT28       = NULL;
++    INT30       = NULL;
++    intop25.tree = NULL;
++
++    intop29.tree = NULL;
++
++    retval.start = LT(1); retval.stop = retval.start;
++
++    FIELD24_tree   = NULL;
++    INT26_tree   = NULL;
++    FIELD27_tree   = NULL;
++    NOT28_tree   = NULL;
++    INT30_tree   = NULL;
++
++    stream_FIELD   = NULL;
++    #define CREATE_stream_FIELD  if (stream_FIELD == NULL) {stream_FIELD = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token FIELD"); } 
++    stream_INT   = NULL;
++    #define CREATE_stream_INT  if (stream_INT == NULL) {stream_INT = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token INT"); } 
++    stream_NOT   = NULL;
++    #define CREATE_stream_NOT  if (stream_NOT == NULL) {stream_NOT = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token NOT"); } 
++    stream_intop   = NULL;
++    #define CREATE_stream_intop  if (stream_intop == NULL) {stream_intop = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule intop"); }
++
++    retval.tree  = NULL;
++    {
++        {
++            //  RSP.g:52:9: ( FIELD intop INT -> ^( intop FIELD INT ) | FIELD NOT intop INT -> ^( NOT ^( intop FIELD INT ) ) )
++            
++            ANTLR3_UINT32 alt6;
++
++            alt6=2;
++
++            switch ( LA(1) ) 
++            {
++            case FIELD:
++              {
++                      switch ( LA(2) ) 
++                      {
++                      case NOT:
++                              {
++                                      alt6=2;
++                              }
++                          break;
++                      case EQUAL:
++                      case LESS:
++                      case GREATER:
++                      case LTE:
++                      case GTE:
++                              {
++                                      alt6=1;
++                              }
++                          break;
++
++                      default:
++                          CONSTRUCTEX();
++                          EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                          EXCEPTION->message      = (void *)"";
++                          EXCEPTION->decisionNum  = 6;
++                          EXCEPTION->state        = 1;
++
++
++                          goto ruleintcritEx;
++                      }
++
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 6;
++                EXCEPTION->state        = 0;
++
++
++                goto ruleintcritEx;
++            }
++
++            switch (alt6) 
++            {
++              case 1:
++                  // RSP.g:52:11: FIELD intop INT
++                  {
++                      FIELD24 = (pANTLR3_COMMON_TOKEN) MATCHT(FIELD, &FOLLOW_FIELD_in_intcrit211); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleintcritEx;
++                      }
++                       
++                      CREATE_stream_FIELD; stream_FIELD->add(stream_FIELD, FIELD24, NULL);
++
++                      FOLLOWPUSH(FOLLOW_intop_in_intcrit213);
++                      intop25=intop(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleintcritEx;
++                      }
++
++                      CREATE_stream_intop; stream_intop->add(stream_intop, intop25.tree, NULL);
++                      INT26 = (pANTLR3_COMMON_TOKEN) MATCHT(INT, &FOLLOW_INT_in_intcrit215); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleintcritEx;
++                      }
++                       
++                      CREATE_stream_INT; stream_INT->add(stream_INT, INT26, NULL);
++
++
++                       
++                      /* AST REWRITE
++                       * elements          : FIELD, intop, INT
++                       * token labels      : 
++                       * rule labels       : retval
++                       * token list labels : 
++                       * rule list labels  : 
++                       */
++                      {
++                              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
++
++                              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
++
++                              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++                              retval.tree    = root_0;
++                              // 52:29: -> ^( intop FIELD INT )
++                              {
++                                  // RSP.g:52:32: ^( intop FIELD INT )
++                                  {
++                                      pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++                                      root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_intop == NULL ? NULL : stream_intop->nextNode(stream_intop), root_1));
++
++                                      ADAPTOR->addChild(ADAPTOR, root_1, stream_FIELD == NULL ? NULL : stream_FIELD->nextNode(stream_FIELD));
++                                      ADAPTOR->addChild(ADAPTOR, root_1, stream_INT == NULL ? NULL : stream_INT->nextNode(stream_INT));
++
++                                      ADAPTOR->addChild(ADAPTOR, root_0, root_1);
++                                  }
++
++                              }
++
++                              retval.tree = root_0; // set result root
++                              if (stream_retval != NULL) stream_retval->free(stream_retval);
++
++
++                      }
++                  }
++                  break;
++              case 2:
++                  // RSP.g:53:4: FIELD NOT intop INT
++                  {
++                      FIELD27 = (pANTLR3_COMMON_TOKEN) MATCHT(FIELD, &FOLLOW_FIELD_in_intcrit232); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleintcritEx;
++                      }
++                       
++                      CREATE_stream_FIELD; stream_FIELD->add(stream_FIELD, FIELD27, NULL);
++
++                      NOT28 = (pANTLR3_COMMON_TOKEN) MATCHT(NOT, &FOLLOW_NOT_in_intcrit234); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleintcritEx;
++                      }
++                       
++                      CREATE_stream_NOT; stream_NOT->add(stream_NOT, NOT28, NULL);
++
++                      FOLLOWPUSH(FOLLOW_intop_in_intcrit236);
++                      intop29=intop(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleintcritEx;
++                      }
++
++                      CREATE_stream_intop; stream_intop->add(stream_intop, intop29.tree, NULL);
++                      INT30 = (pANTLR3_COMMON_TOKEN) MATCHT(INT, &FOLLOW_INT_in_intcrit238); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruleintcritEx;
++                      }
++                       
++                      CREATE_stream_INT; stream_INT->add(stream_INT, INT30, NULL);
++
++
++                       
++                      /* AST REWRITE
++                       * elements          : NOT, INT, FIELD, intop
++                       * token labels      : 
++                       * rule labels       : retval
++                       * token list labels : 
++                       * rule list labels  : 
++                       */
++                      {
++                              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
++
++                              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
++
++                              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++                              retval.tree    = root_0;
++                              // 53:25: -> ^( NOT ^( intop FIELD INT ) )
++                              {
++                                  // RSP.g:53:28: ^( NOT ^( intop FIELD INT ) )
++                                  {
++                                      pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++                                      root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_NOT == NULL ? NULL : stream_NOT->nextNode(stream_NOT), root_1));
++
++                                      // RSP.g:53:34: ^( intop FIELD INT )
++                                      {
++                                          pANTLR3_BASE_TREE root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++                                          root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_intop == NULL ? NULL : stream_intop->nextNode(stream_intop), root_2));
++
++                                          ADAPTOR->addChild(ADAPTOR, root_2, stream_FIELD == NULL ? NULL : stream_FIELD->nextNode(stream_FIELD));
++                                          ADAPTOR->addChild(ADAPTOR, root_2, stream_INT == NULL ? NULL : stream_INT->nextNode(stream_INT));
++
++                                          ADAPTOR->addChild(ADAPTOR, root_1, root_2);
++                                      }
++
++                                      ADAPTOR->addChild(ADAPTOR, root_0, root_1);
++                                  }
++
++                              }
++
++                              retval.tree = root_0; // set result root
++                              if (stream_retval != NULL) stream_retval->free(stream_retval);
++
++
++                      }
++                  }
++                  break;
++
++            }
++        }
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruleintcritEx; /* Prevent compiler warnings */
++    ruleintcritEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++        if (stream_FIELD != NULL) stream_FIELD->free(stream_FIELD);
++        if (stream_INT != NULL) stream_INT->free(stream_INT);
++        if (stream_NOT != NULL) stream_NOT->free(stream_NOT);
++        if (stream_intop != NULL) stream_intop->free(stream_intop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end intcrit */
++
++/** 
++ * $ANTLR start intop
++ * RSP.g:56:1: intop : ( EQUAL | LESS | GREATER | LTE | GTE );
++ */
++static RSPParser_intop_return
++intop(pRSPParser ctx)
++{   
++    RSPParser_intop_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    set31;
++
++    pANTLR3_BASE_TREE set31_tree;
++
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    set31       = NULL;
++    retval.start = LT(1); retval.stop = retval.start;
++
++    set31_tree   = NULL;
++
++
++    retval.tree  = NULL;
++    {
++        // RSP.g:56:7: ( EQUAL | LESS | GREATER | LTE | GTE )
++        // RSP.g:
++        {
++            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++            set31=(pANTLR3_COMMON_TOKEN)LT(1);
++            if ( LA(1) == EQUAL || ((LA(1) >= LESS) && (LA(1) <= GTE)) )
++            {
++                CONSUME();
++                ADAPTOR->addChild(ADAPTOR, root_0, (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, set31)));
++                PERRORRECOVERY=ANTLR3_FALSE;
++            }
++            else 
++            {
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
++                EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
++                EXCEPTION->expectingSet = &FOLLOW_set_in_intop0;
++                RECOVERFROMMISMATCHEDSET(&FOLLOW_set_in_intop0);    goto ruleintopEx;
++            }
++
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruleintopEx; /* Prevent compiler warnings */
++    ruleintopEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end intop */
++
++/** 
++ * $ANTLR start datecrit
++ * RSP.g:63:1: datecrit : FIELD dateop datespec -> ^( dateop FIELD datespec ) ;
++ */
++static RSPParser_datecrit_return
++datecrit(pRSPParser ctx)
++{   
++    RSPParser_datecrit_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    FIELD32;
++    RSPParser_dateop_return dateop33;
++    #undef    RETURN_TYPE_dateop33
++    #define   RETURN_TYPE_dateop33 RSPParser_dateop_return
++
++    RSPParser_datespec_return datespec34;
++    #undef    RETURN_TYPE_datespec34
++    #define   RETURN_TYPE_datespec34 RSPParser_datespec_return
++
++    pANTLR3_BASE_TREE FIELD32_tree;
++    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_FIELD;
++    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_datespec;
++    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_dateop;
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    FIELD32       = NULL;
++    dateop33.tree = NULL;
++
++    datespec34.tree = NULL;
++
++    retval.start = LT(1); retval.stop = retval.start;
++
++    FIELD32_tree   = NULL;
++
++    stream_FIELD   = NULL;
++    #define CREATE_stream_FIELD  if (stream_FIELD == NULL) {stream_FIELD = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token FIELD"); } 
++    stream_datespec   = NULL;
++    #define CREATE_stream_datespec  if (stream_datespec == NULL) {stream_datespec = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule datespec"); }
++    stream_dateop   = NULL;
++    #define CREATE_stream_dateop  if (stream_dateop == NULL) {stream_dateop = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule dateop"); }
++
++    retval.tree  = NULL;
++    {
++        // RSP.g:63:9: ( FIELD dateop datespec -> ^( dateop FIELD datespec ) )
++        // RSP.g:63:11: FIELD dateop datespec
++        {
++            FIELD32 = (pANTLR3_COMMON_TOKEN) MATCHT(FIELD, &FOLLOW_FIELD_in_datecrit292); 
++            if  (HASEXCEPTION())
++            {
++                goto ruledatecritEx;
++            }
++             
++            CREATE_stream_FIELD; stream_FIELD->add(stream_FIELD, FIELD32, NULL);
++
++            FOLLOWPUSH(FOLLOW_dateop_in_datecrit294);
++            dateop33=dateop(ctx);
++
++            FOLLOWPOP();
++            if  (HASEXCEPTION())
++            {
++                goto ruledatecritEx;
++            }
++
++            CREATE_stream_dateop; stream_dateop->add(stream_dateop, dateop33.tree, NULL);
++            FOLLOWPUSH(FOLLOW_datespec_in_datecrit296);
++            datespec34=datespec(ctx);
++
++            FOLLOWPOP();
++            if  (HASEXCEPTION())
++            {
++                goto ruledatecritEx;
++            }
++
++            CREATE_stream_datespec; stream_datespec->add(stream_datespec, datespec34.tree, NULL);
++
++             
++            /* AST REWRITE
++             * elements          : FIELD, datespec, dateop
++             * token labels      : 
++             * rule labels       : retval
++             * token list labels : 
++             * rule list labels  : 
++             */
++            {
++              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
++
++              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
++
++              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++              retval.tree    = root_0;
++              // 63:34: -> ^( dateop FIELD datespec )
++              {
++                  // RSP.g:63:37: ^( dateop FIELD datespec )
++                  {
++                      pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++                      root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_dateop == NULL ? NULL : stream_dateop->nextNode(stream_dateop), root_1));
++
++                      ADAPTOR->addChild(ADAPTOR, root_1, stream_FIELD == NULL ? NULL : stream_FIELD->nextNode(stream_FIELD));
++                      ADAPTOR->addChild(ADAPTOR, root_1, stream_datespec == NULL ? NULL : stream_datespec->nextTree(stream_datespec));
++
++                      ADAPTOR->addChild(ADAPTOR, root_0, root_1);
++                  }
++
++              }
++
++              retval.tree = root_0; // set result root
++              if (stream_retval != NULL) stream_retval->free(stream_retval);
++
++
++            }
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruledatecritEx; /* Prevent compiler warnings */
++    ruledatecritEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++        if (stream_FIELD != NULL) stream_FIELD->free(stream_FIELD);
++        if (stream_datespec != NULL) stream_datespec->free(stream_datespec);
++        if (stream_dateop != NULL) stream_dateop->free(stream_dateop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end datecrit */
++
++/** 
++ * $ANTLR start dateop
++ * RSP.g:66:1: dateop : ( BEFORE | AFTER );
++ */
++static RSPParser_dateop_return
++dateop(pRSPParser ctx)
++{   
++    RSPParser_dateop_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    set35;
++
++    pANTLR3_BASE_TREE set35_tree;
++
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    set35       = NULL;
++    retval.start = LT(1); retval.stop = retval.start;
++
++    set35_tree   = NULL;
++
++
++    retval.tree  = NULL;
++    {
++        // RSP.g:66:8: ( BEFORE | AFTER )
++        // RSP.g:
++        {
++            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++            set35=(pANTLR3_COMMON_TOKEN)LT(1);
++            if ( ((LA(1) >= BEFORE) && (LA(1) <= AFTER)) )
++            {
++                CONSUME();
++                ADAPTOR->addChild(ADAPTOR, root_0, (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, set35)));
++                PERRORRECOVERY=ANTLR3_FALSE;
++            }
++            else 
++            {
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
++                EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
++                EXCEPTION->expectingSet = &FOLLOW_set_in_dateop0;
++                RECOVERFROMMISMATCHEDSET(&FOLLOW_set_in_dateop0);    goto ruledateopEx;
++            }
++
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruledateopEx; /* Prevent compiler warnings */
++    ruledateopEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end dateop */
++
++/** 
++ * $ANTLR start datespec
++ * RSP.g:70:1: datespec : ( dateref | INT dateintval dateop dateref -> ^( dateop dateref INT dateintval ) );
++ */
++static RSPParser_datespec_return
++datespec(pRSPParser ctx)
++{   
++    RSPParser_datespec_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    INT37;
++    RSPParser_dateref_return dateref36;
++    #undef    RETURN_TYPE_dateref36
++    #define   RETURN_TYPE_dateref36 RSPParser_dateref_return
++
++    RSPParser_dateintval_return dateintval38;
++    #undef    RETURN_TYPE_dateintval38
++    #define   RETURN_TYPE_dateintval38 RSPParser_dateintval_return
++
++    RSPParser_dateop_return dateop39;
++    #undef    RETURN_TYPE_dateop39
++    #define   RETURN_TYPE_dateop39 RSPParser_dateop_return
++
++    RSPParser_dateref_return dateref40;
++    #undef    RETURN_TYPE_dateref40
++    #define   RETURN_TYPE_dateref40 RSPParser_dateref_return
++
++    pANTLR3_BASE_TREE INT37_tree;
++    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_INT;
++    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_dateintval;
++    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_dateref;
++    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_dateop;
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    INT37       = NULL;
++    dateref36.tree = NULL;
++
++    dateintval38.tree = NULL;
++
++    dateop39.tree = NULL;
++
++    dateref40.tree = NULL;
++
++    retval.start = LT(1); retval.stop = retval.start;
++
++    INT37_tree   = NULL;
++
++    stream_INT   = NULL;
++    #define CREATE_stream_INT  if (stream_INT == NULL) {stream_INT = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token INT"); } 
++    stream_dateintval   = NULL;
++    #define CREATE_stream_dateintval  if (stream_dateintval == NULL) {stream_dateintval = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule dateintval"); }
++    stream_dateref   = NULL;
++    #define CREATE_stream_dateref  if (stream_dateref == NULL) {stream_dateref = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule dateref"); }
++    stream_dateop   = NULL;
++    #define CREATE_stream_dateop  if (stream_dateop == NULL) {stream_dateop = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule dateop"); }
++
++    retval.tree  = NULL;
++    {
++        {
++            //  RSP.g:70:9: ( dateref | INT dateintval dateop dateref -> ^( dateop dateref INT dateintval ) )
++            
++            ANTLR3_UINT32 alt7;
++
++            alt7=2;
++
++            switch ( LA(1) ) 
++            {
++            case DATE:
++            case TODAY:
++              {
++                      alt7=1;
++              }
++                break;
++            case INT:
++              {
++                      alt7=2;
++              }
++                break;
++
++            default:
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
++                EXCEPTION->message      = (void *)"";
++                EXCEPTION->decisionNum  = 7;
++                EXCEPTION->state        = 0;
++
++
++                goto ruledatespecEx;
++            }
++
++            switch (alt7) 
++            {
++              case 1:
++                  // RSP.g:70:11: dateref
++                  {
++                      root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++                      FOLLOWPUSH(FOLLOW_dateref_in_datespec331);
++                      dateref36=dateref(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatespecEx;
++                      }
++
++                      ADAPTOR->addChild(ADAPTOR, root_0, dateref36.tree);
++
++                  }
++                  break;
++              case 2:
++                  // RSP.g:71:4: INT dateintval dateop dateref
++                  {
++                      INT37 = (pANTLR3_COMMON_TOKEN) MATCHT(INT, &FOLLOW_INT_in_datespec336); 
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatespecEx;
++                      }
++                       
++                      CREATE_stream_INT; stream_INT->add(stream_INT, INT37, NULL);
++
++                      FOLLOWPUSH(FOLLOW_dateintval_in_datespec338);
++                      dateintval38=dateintval(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatespecEx;
++                      }
++
++                      CREATE_stream_dateintval; stream_dateintval->add(stream_dateintval, dateintval38.tree, NULL);
++                      FOLLOWPUSH(FOLLOW_dateop_in_datespec340);
++                      dateop39=dateop(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatespecEx;
++                      }
++
++                      CREATE_stream_dateop; stream_dateop->add(stream_dateop, dateop39.tree, NULL);
++                      FOLLOWPUSH(FOLLOW_dateref_in_datespec342);
++                      dateref40=dateref(ctx);
++
++                      FOLLOWPOP();
++                      if  (HASEXCEPTION())
++                      {
++                          goto ruledatespecEx;
++                      }
++
++                      CREATE_stream_dateref; stream_dateref->add(stream_dateref, dateref40.tree, NULL);
++
++                       
++                      /* AST REWRITE
++                       * elements          : dateintval, INT, dateref, dateop
++                       * token labels      : 
++                       * rule labels       : retval
++                       * token list labels : 
++                       * rule list labels  : 
++                       */
++                      {
++                              pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
++
++                              stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
++
++                              root_0                      = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++                              retval.tree    = root_0;
++                              // 71:34: -> ^( dateop dateref INT dateintval )
++                              {
++                                  // RSP.g:71:37: ^( dateop dateref INT dateintval )
++                                  {
++                                      pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++                                      root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_dateop == NULL ? NULL : stream_dateop->nextNode(stream_dateop), root_1));
++
++                                      ADAPTOR->addChild(ADAPTOR, root_1, stream_dateref == NULL ? NULL : stream_dateref->nextTree(stream_dateref));
++                                      ADAPTOR->addChild(ADAPTOR, root_1, stream_INT == NULL ? NULL : stream_INT->nextNode(stream_INT));
++                                      ADAPTOR->addChild(ADAPTOR, root_1, stream_dateintval == NULL ? NULL : stream_dateintval->nextTree(stream_dateintval));
++
++                                      ADAPTOR->addChild(ADAPTOR, root_0, root_1);
++                                  }
++
++                              }
++
++                              retval.tree = root_0; // set result root
++                              if (stream_retval != NULL) stream_retval->free(stream_retval);
++
++
++                      }
++                  }
++                  break;
++
++            }
++        }
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruledatespecEx; /* Prevent compiler warnings */
++    ruledatespecEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++        if (stream_INT != NULL) stream_INT->free(stream_INT);
++        if (stream_dateintval != NULL) stream_dateintval->free(stream_dateintval);
++        if (stream_dateref != NULL) stream_dateref->free(stream_dateref);
++        if (stream_dateop != NULL) stream_dateop->free(stream_dateop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end datespec */
++
++/** 
++ * $ANTLR start dateref
++ * RSP.g:74:1: dateref : ( DATE | TODAY );
++ */
++static RSPParser_dateref_return
++dateref(pRSPParser ctx)
++{   
++    RSPParser_dateref_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    set41;
++
++    pANTLR3_BASE_TREE set41_tree;
++
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    set41       = NULL;
++    retval.start = LT(1); retval.stop = retval.start;
++
++    set41_tree   = NULL;
++
++
++    retval.tree  = NULL;
++    {
++        // RSP.g:74:9: ( DATE | TODAY )
++        // RSP.g:
++        {
++            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++            set41=(pANTLR3_COMMON_TOKEN)LT(1);
++            if ( ((LA(1) >= DATE) && (LA(1) <= TODAY)) )
++            {
++                CONSUME();
++                ADAPTOR->addChild(ADAPTOR, root_0, (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, set41)));
++                PERRORRECOVERY=ANTLR3_FALSE;
++            }
++            else 
++            {
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
++                EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
++                EXCEPTION->expectingSet = &FOLLOW_set_in_dateref0;
++                RECOVERFROMMISMATCHEDSET(&FOLLOW_set_in_dateref0);    goto ruledaterefEx;
++            }
++
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruledaterefEx; /* Prevent compiler warnings */
++    ruledaterefEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end dateref */
++
++/** 
++ * $ANTLR start dateintval
++ * RSP.g:78:1: dateintval : ( DAY | WEEK | MONTH | YEAR );
++ */
++static RSPParser_dateintval_return
++dateintval(pRSPParser ctx)
++{   
++    RSPParser_dateintval_return retval;
++
++    pANTLR3_BASE_TREE root_0;
++
++    pANTLR3_COMMON_TOKEN    set42;
++
++    pANTLR3_BASE_TREE set42_tree;
++
++    /* Initialize rule variables
++     */
++
++
++    root_0 = NULL;
++
++    set42       = NULL;
++    retval.start = LT(1); retval.stop = retval.start;
++
++    set42_tree   = NULL;
++
++
++    retval.tree  = NULL;
++    {
++        // RSP.g:79:2: ( DAY | WEEK | MONTH | YEAR )
++        // RSP.g:
++        {
++            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
++
++            set42=(pANTLR3_COMMON_TOKEN)LT(1);
++            if ( ((LA(1) >= DAY) && (LA(1) <= YEAR)) )
++            {
++                CONSUME();
++                ADAPTOR->addChild(ADAPTOR, root_0, (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, set42)));
++                PERRORRECOVERY=ANTLR3_FALSE;
++            }
++            else 
++            {
++                CONSTRUCTEX();
++                EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
++                EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
++                EXCEPTION->expectingSet = &FOLLOW_set_in_dateintval0;
++                RECOVERFROMMISMATCHEDSET(&FOLLOW_set_in_dateintval0);    goto ruledateintvalEx;
++            }
++
++
++        }
++
++    }
++    
++
++    // This is where rules clean up and exit
++    //
++    goto ruledateintvalEx; /* Prevent compiler warnings */
++    ruledateintvalEx: ;
++    retval.stop = LT(-1);
++
++      retval.stop = LT(-1);
++      retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
++      ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
++
++            if (HASEXCEPTION())
++            {
++                PREPORTERROR();
++                PRECOVER();
++                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
++            }
++
++
++    return retval;
++}
++/* $ANTLR end dateintval */
++/* End of parsing rules
++ * ==============================================
++ */
++
++/* ==============================================
++ * Syntactic predicates
++ */
++/* End of syntactic predicates
++ * ==============================================
++ */
++
++ 
++ 
++
++
++
++/* End of code
++ * =============================================================================
++ */
+diff --git a/src/pregen/RSPParser.h b/src/pregen/RSPParser.h
+new file mode 100644
+index 0000000..d0744a2
+--- /dev/null
++++ b/src/pregen/RSPParser.h
+@@ -0,0 +1,365 @@
++/** \file
++ *  This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
++ *
++ *     -  From the grammar source file : RSP.g
++ *     -                            On : 2014-09-30 21:42:40
++ *     -                for the parser : RSPParserParser *
++ * Editing it, at least manually, is not wise. 
++ *
++ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
++ *
++ *
++ * The parser RSPParser has the callable functions (rules) shown below,
++ * which will invoke the code for the associated rule in the source grammar
++ * assuming that the input stream is pointing to a token/text stream that could begin
++ * this rule.
++ * 
++ * For instance if you call the first (topmost) rule in a parser grammar, you will
++ * get the results of a full parse, but calling a rule half way through the grammar will
++ * allow you to pass part of a full token stream to the parser, such as for syntax checking
++ * in editors and so on.
++ *
++ * The parser entry points are called indirectly (by function pointer to function) via
++ * a parser context typedef pRSPParser, which is returned from a call to RSPParserNew().
++ *
++ * The methods in pRSPParser are  as follows:
++ *
++ *  - RSPParser_query_return      pRSPParser->query(pRSPParser)
++ *  - RSPParser_expr_return      pRSPParser->expr(pRSPParser)
++ *  - RSPParser_aexpr_return      pRSPParser->aexpr(pRSPParser)
++ *  - RSPParser_crit_return      pRSPParser->crit(pRSPParser)
++ *  - RSPParser_strcrit_return      pRSPParser->strcrit(pRSPParser)
++ *  - RSPParser_strop_return      pRSPParser->strop(pRSPParser)
++ *  - RSPParser_intcrit_return      pRSPParser->intcrit(pRSPParser)
++ *  - RSPParser_intop_return      pRSPParser->intop(pRSPParser)
++ *  - RSPParser_datecrit_return      pRSPParser->datecrit(pRSPParser)
++ *  - RSPParser_dateop_return      pRSPParser->dateop(pRSPParser)
++ *  - RSPParser_datespec_return      pRSPParser->datespec(pRSPParser)
++ *  - RSPParser_dateref_return      pRSPParser->dateref(pRSPParser)
++ *  - RSPParser_dateintval_return      pRSPParser->dateintval(pRSPParser)
++ *
++ * The return type for any particular rule is of course determined by the source
++ * grammar file.
++ */
++// [The "BSD licence"]
++// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
++// http://www.temporal-wave.com
++// http://www.linkedin.com/in/jimidle
++//
++// All rights reserved.
++//
++// Redistribution and use in source and binary forms, with or without
++// modification, are permitted provided that the following conditions
++// are met:
++// 1. Redistributions of source code must retain the above copyright
++//    notice, this list of conditions and the following disclaimer.
++// 2. Redistributions in binary form must reproduce the above copyright
++//    notice, this list of conditions and the following disclaimer in the
++//    documentation and/or other materials provided with the distribution.
++// 3. The name of the author may not be used to endorse or promote products
++//    derived from this software without specific prior written permission.
++//
++// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++#ifndef       _RSPParser_H
++#define _RSPParser_H
++/* =============================================================================
++ * Standard antlr3 C runtime definitions
++ */
++#include    <antlr3.h>
++
++/* End of standard antlr 3 runtime definitions
++ * =============================================================================
++ */
++ 
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++// Forward declare the context typedef so that we can use it before it is
++// properly defined. Delegators and delegates (from import statements) are
++// interdependent and their context structures contain pointers to each other
++// C only allows such things to be declared if you pre-declare the typedef.
++//
++typedef struct RSPParser_Ctx_struct RSPParser, * pRSPParser;
++
++
++
++#ifdef        ANTLR3_WINDOWS
++// Disable: Unreferenced parameter,                                                   - Rules with parameters that are not used
++//          constant conditional,                                                     - ANTLR realizes that a prediction is always true (synpred usually)
++//          initialized but unused variable                                   - tree rewrite variables declared but not needed
++//          Unreferenced local variable                                               - lexer rule declares but does not always use _type
++//          potentially unitialized variable used                     - retval always returned from a rule 
++//                    unreferenced local function has been removed    - susually getTokenNames or freeScope, they can go without warnigns
++//
++// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
++// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
++// usually generated when a parser rule is given a parameter that it does not use. Mostly though
++// this is a matter of orthogonality hence I disable that one.
++//
++#pragma warning( disable : 4100 )
++#pragma warning( disable : 4101 )
++#pragma warning( disable : 4127 )
++#pragma warning( disable : 4189 )
++#pragma warning( disable : 4505 )
++#pragma warning( disable : 4701 )
++#endif
++typedef struct RSPParser_query_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    RSPParser_query_return;
++
++typedef struct RSPParser_expr_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    RSPParser_expr_return;
++
++typedef struct RSPParser_aexpr_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    RSPParser_aexpr_return;
++
++typedef struct RSPParser_crit_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    RSPParser_crit_return;
++
++typedef struct RSPParser_strcrit_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    RSPParser_strcrit_return;
++
++typedef struct RSPParser_strop_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    RSPParser_strop_return;
++
++typedef struct RSPParser_intcrit_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    RSPParser_intcrit_return;
++
++typedef struct RSPParser_intop_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    RSPParser_intop_return;
++
++typedef struct RSPParser_datecrit_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    RSPParser_datecrit_return;
++
++typedef struct RSPParser_dateop_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    RSPParser_dateop_return;
++
++typedef struct RSPParser_datespec_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    RSPParser_datespec_return;
++
++typedef struct RSPParser_dateref_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    RSPParser_dateref_return;
++
++typedef struct RSPParser_dateintval_return_struct
++{
++    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
++     */
++    pANTLR3_COMMON_TOKEN    start;
++    pANTLR3_COMMON_TOKEN    stop;
++    pANTLR3_BASE_TREE tree;
++   
++}
++    RSPParser_dateintval_return;
++
++
++
++/** Context tracking structure for RSPParser
++ */
++struct RSPParser_Ctx_struct
++{
++    /** Built in ANTLR3 context tracker contains all the generic elements
++     *  required for context tracking.
++     */
++    pANTLR3_PARSER   pParser;
++
++
++     RSPParser_query_return (*query)  (struct RSPParser_Ctx_struct * ctx);
++     RSPParser_expr_return (*expr)    (struct RSPParser_Ctx_struct * ctx);
++     RSPParser_aexpr_return (*aexpr)  (struct RSPParser_Ctx_struct * ctx);
++     RSPParser_crit_return (*crit)    (struct RSPParser_Ctx_struct * ctx);
++     RSPParser_strcrit_return (*strcrit)      (struct RSPParser_Ctx_struct * ctx);
++     RSPParser_strop_return (*strop)  (struct RSPParser_Ctx_struct * ctx);
++     RSPParser_intcrit_return (*intcrit)      (struct RSPParser_Ctx_struct * ctx);
++     RSPParser_intop_return (*intop)  (struct RSPParser_Ctx_struct * ctx);
++     RSPParser_datecrit_return (*datecrit)    (struct RSPParser_Ctx_struct * ctx);
++     RSPParser_dateop_return (*dateop)        (struct RSPParser_Ctx_struct * ctx);
++     RSPParser_datespec_return (*datespec)    (struct RSPParser_Ctx_struct * ctx);
++     RSPParser_dateref_return (*dateref)      (struct RSPParser_Ctx_struct * ctx);
++     RSPParser_dateintval_return (*dateintval)        (struct RSPParser_Ctx_struct * ctx);
++    // Delegated rules
++    const char * (*getGrammarFileName)();
++    void          (*free)   (struct RSPParser_Ctx_struct * ctx);
++    /* @headerFile.members() */
++    pANTLR3_BASE_TREE_ADAPTOR adaptor;
++    pANTLR3_VECTOR_FACTORY            vectors;
++    /* End @headerFile.members() */
++};
++
++// Function protoypes for the constructor functions that external translation units
++// such as delegators and delegates may wish to call.
++//
++ANTLR3_API pRSPParser RSPParserNew         (pANTLR3_COMMON_TOKEN_STREAM instream);
++ANTLR3_API pRSPParser RSPParserNewSSD      (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
++
++/** Symbolic definitions of all the tokens that the parser will work with.
++ * \{
++ *
++ * Antlr will define EOF, but we can't use that as it it is too common in
++ * in C header files and that would be confusing. There is no way to filter this out at the moment
++ * so we just undef it here for now. That isn't the value we get back from C recognizers
++ * anyway. We are looking for ANTLR3_TOKEN_EOF.
++ */
++#ifdef        EOF
++#undef        EOF
++#endif
++#ifdef        Tokens
++#undef        Tokens
++#endif 
++#define STARTSW      14
++#define WEEK      26
++#define TODAY      24
++#define YEAR      28
++#define ENDSW      15
++#define GTE      20
++#define BEFORE      21
++#define DAY      25
++#define INT      16
++#define NOT      11
++#define AFTER      22
++#define AND      6
++#define EOF      -1
++#define LTE      19
++#define MONTH      27
++#define DIGIT19      31
++#define INCLUDES      13
++#define STR      10
++#define QUOTE      29
++#define WS      30
++#define GREATER      18
++#define NEWLINE      4
++#define LPAR      7
++#define EQUAL      12
++#define OR      5
++#define LESS      17
++#define RPAR      8
++#define FIELD      9
++#define ESCAPED      33
++#define DATE      23
++#define DIGIT09      32
++#ifdef        EOF
++#undef        EOF
++#define       EOF     ANTLR3_TOKEN_EOF
++#endif
++
++#ifndef TOKENSOURCE
++#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
++#endif
++
++/* End of token definitions for RSPParser
++ * =============================================================================
++ */
++/** \} */
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
++
++/* END - Note:Keep extra line feed to satisfy UNIX systems */
index 0bdd231fa80e35d4f7ffab9a7a92b2248b2aa26a..75925d57f7f48d46144f8420066ddf9cc13b7cab 100644 (file)
@@ -18,7 +18,7 @@ PKG_MD5SUM:=da87b90b57934234589b63e347921458
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index 1d2ce22dca538db8e6bad21aaf667357574c575f..8b36a4701b88231e703e5be699a89038f1fb5ae8 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mpd
 PKG_VERSION:=0.18.16
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.musicpd.org/download/mpd/0.18/
@@ -17,7 +17,7 @@ PKG_MD5SUM:=900657ff55726f4cc09a27eb7df57015
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_BUILD_PARALLEL:=1
@@ -63,7 +63,6 @@ $(call Package/mpd/Default/description)
 endef
 
 define Package/mpd-full/conffiles
-/etc/avahi/services/mpd.service
 /etc/mpd.conf
 endef
 
@@ -85,6 +84,23 @@ define Package/mpd-mini/conffiles
 /etc/mpd.conf
 endef
 
+define Package/mpd-avahi-service
+$(call Package/mpd/Default)
+  TITLE+= (Avahi service)
+  DEPENDS+=+avahi-daemon
+endef
+
+define Package/mpd-avahi-service/description
+$(call Package/mpd/Default/description)
+ .
+ This package contains the service definition for announcing the
+ Music Player Daemon service via mDNS/DNS-SD.
+endef
+
+define Package/mpd-avahi-service/conffiles
+/etc/avahi/services/mpd.service
+endef
+
 CONFIGURE_ARGS += \
        $(call autoconf_bool,CONFIG_IPV6,ipv6) \
        --disable-debug \
@@ -198,13 +214,17 @@ endef
 
 define Package/mpd-full/install
 $(call Package/mpd/install,$1)
-       $(INSTALL_DIR) $(1)/etc/avahi/services
-       $(INSTALL_DATA) ./files/mpd.service $(1)/etc/avahi/services/
 endef
 
 define Package/mpd-mini/install
 $(call Package/mpd/install,$1)
 endef
 
+define Package/mpd-avahi-service/install
+       $(INSTALL_DIR) $(1)/etc/avahi/services
+       $(INSTALL_DATA) ./files/mpd.service $(1)/etc/avahi/services/
+endef
+
 $(eval $(call BuildPackage,mpd-full))
 $(eval $(call BuildPackage,mpd-mini))
+$(eval $(call BuildPackage,mpd-avahi-service))
index 086a2bb3fc53ebe2d9e203652ab7f3d672e64578..a545f240f37f7a412720928ed662cdeb0e110086 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" standalone='no'?><!--*-nxml-*-->
 <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
 <service-group>
- <name replace-wildcards="yes">Music Player Daemon on %h</name>
+ <name replace-wildcards="yes">%h</name>
   <service>
    <type>_mpd._tcp</type>
    <port>6600</port>
diff --git a/sound/portaudio/Makefile b/sound/portaudio/Makefile
new file mode 100644 (file)
index 0000000..ffa5cfb
--- /dev/null
@@ -0,0 +1,70 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=portaudio
+PKG_VERSION:=19_20140130
+PKG_RELEASE:=1
+
+PKG_SOURCE:=pa_stable_v$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://www.portaudio.com/archives/
+PKG_MD5SUM:=7f220406902af9dca009668e198cbd23
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE.txt
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/portaudio
+  SECTION:=sound
+  CATEGORY:=Sound
+  DEPENDS:=+alsa-lib +libpthread +librt
+  TITLE:=Portable cross-platform audio I/O
+  URL:=http://www.portaudio.com/
+endef
+
+define Package/portaudio/description
+ PortAudio is a free, cross-platform, open-source, audio I/O library.  It lets
+ you write simple audio programs in 'C' or C++ that will compile and run on many
+ platforms including Windows, Macintosh OS X, and Unix (OSS/ALSA). It is
+ intended to promote the exchange of audio software between developers on
+ different platforms. Many applications use PortAudio for Audio I/O.
+endef
+
+CONFIGURE_ARGS+= \
+       --with-alsa \
+       --without-asihpi \
+       --without-jack \
+       --with-oss \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/portaudio.h \
+               $(PKG_INSTALL_DIR)/usr/include/pa_linux_alsa.h \
+               $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libportaudio.{a,so*} \
+               $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/portaudio-*.pc \
+               $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/portaudio/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libportaudio.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,portaudio))
index 8fa571325773145de12215ff0be3b175e584d747..eda080fa8b928cb106d6667b2b87ff3608a4e22f 100644 (file)
@@ -10,15 +10,17 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sox
 PKG_VERSION:=14.4.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/sox
 PKG_MD5SUM:=ff9ca6aca972549de0e80e8e30ed379c
 
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 PKG_LICENSE:=LGPL-2.1 GPL-2.0
 PKG_LICENSE_FILES:=COPYING LICENSE.LGPL LICENSE.GPL
 
+
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
@@ -34,7 +36,6 @@ define Package/sox
                +libmagic +libpng +libffmpeg
   TITLE:=Sox is a general purpose sound converter/player/recorder
   URL:=http://sox.sourceforge.net/
-  MAINTAINER:=Hamish Guthrie <hcg@openwrt.org>
 endef
 
 define Package/sox/description
index 5770145649d526ca6fdfc696e024ab70d9b2d1fb..44e7ebbe984f1588b3d1397a3da167e4d4783dba 100644 (file)
      return -1;
    if (enc->codec_type != AVMEDIA_TYPE_AUDIO) {
      lsx_fail("ffmpeg CODEC %x is not an audio CODEC", enc->codec_type);
-@@ -267,7 +271,11 @@ static int stopread(sox_format_t * ft)
+@@ -178,7 +182,7 @@ static int startread(sox_format_t * ft)
+   }
+   /* Get CODEC parameters */
+-  if ((ret = av_find_stream_info(ffmpeg->ctxt)) < 0) {
++  if ((ret = avformat_find_stream_info(ffmpeg->ctxt, NULL)) < 0) {
+     lsx_fail("ffmpeg could not find CODEC parameters for %s", ft->filename);
+     return SOX_EOF;
+   }
+@@ -256,7 +260,7 @@ static int stopread(sox_format_t * ft)
+   if (ffmpeg->audio_stream >= 0)
+     stream_component_close(ffmpeg, ffmpeg->audio_stream);
+   if (ffmpeg->ctxt) {
+-    av_close_input_file(ffmpeg->ctxt);
++    avformat_close_input(&ffmpeg->ctxt);
+     ffmpeg->ctxt = NULL; /* safety */
+   }
+@@ -267,16 +271,21 @@ static int stopread(sox_format_t * ft)
  /*
   * add an audio output stream
   */
  {
    AVCodecContext *c;
    AVStream *st;
-@@ -306,7 +314,7 @@ static int open_audio(priv_t * ffmpeg, A
+-  st = av_new_stream(oc, 1);
++  st = avformat_new_stream(oc, NULL);
+   if (!st) {
+     lsx_fail("ffmpeg could not alloc stream");
+     return NULL;
+   }
++  st->id = 1;
+   c = st->codec;
+   c->codec_id = codec_id;
+@@ -306,7 +315,7 @@ static int open_audio(priv_t * ffmpeg, A
    }
  
    /* open it */
index b85ded75679a41eb4a53c6a2a1a941aa173c40de..ca0911f903147734b23fe4c4affd5f94abd517b8 100644 (file)
@@ -22,6 +22,7 @@ PKG_LICENSE:=GPL-3.0+
 PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
 
+PKG_CHECK_FORMAT_SECURITY:=0
 include $(INCLUDE_DIR)/package.mk
 
 define Package/bash
diff --git a/utils/btrfs-progs/Makefile b/utils/btrfs-progs/Makefile
new file mode 100644 (file)
index 0000000..2802c1a
--- /dev/null
@@ -0,0 +1,68 @@
+#
+# Copyright (C) 2009-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=btrfs-progs
+PKG_VERSION:=3.17.3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/kdave/btrfs-progs/
+PKG_MD5SUM:=6716b4b109dd909af63ab3becbad67a6
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+PKG_BUILD_DEPENDS:=libacl
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/btrfs-progs
+  SECTION:=utils
+  CATEGORY:=Utilities
+  SUBMENU:=Filesystem
+  DEPENDS:=+libattr +libuuid +zlib +libext2fs +libblkid +liblzo +libpthread
+  TITLE:=Btrfs filesystems utilities
+  URL:=http://btrfs.wiki.kernel.org/
+endef
+
+define Package/btrfs-progs/description
+ Btrfs is a new copy on write filesystem for Linux aimed at implementing
+ advanced features while focusing on fault tolerance, repair and easy
+ administration. Initially developed by Oracle, Btrfs is licensed under the
+ GPL and open for contribution from anyone.
+endef
+
+progs = btrfs btrfsck btrfs-convert btrfs-debug-tree btrfs-find-root \
+       btrfs-image btrfs-map-logical btrfs-show-super btrfstune \
+       btrfs-zero-log fsck.btrfs mkfs.btrfs
+
+
+MAKE_FLAGS+=\
+       CC="$(TARGET_CC)" \
+       CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
+       LDFLAGS="$(TARGET_LDFLAGS)" \
+       prefix=/usr \
+       DESTDIR=$(PKG_INSTALL_DIR) \
+       DISABLE_BACKTRACE=1 \
+       DISABLE_DOCUMENTATION=1
+
+define Package/btrfs-progs/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libbtrfs.so* $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(addprefix $(PKG_INSTALL_DIR)/usr/bin/, $(progs)) $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/btrfs-scan.init $(1)/etc/init.d/btrfs-scan
+endef
+
+$(eval $(call BuildPackage,btrfs-progs))
diff --git a/utils/btrfs-progs/files/btrfs-scan.init b/utils/btrfs-progs/files/btrfs-scan.init
new file mode 100644 (file)
index 0000000..559fdda
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2009 OpenWrt.org
+
+START=19
+
+start() {
+       grep -q btrfs /proc/modules && /usr/bin/btrfs device scan
+}
+
diff --git a/utils/btrfs-progs/patches/001-fix-xattr-h-include-location.patch b/utils/btrfs-progs/patches/001-fix-xattr-h-include-location.patch
new file mode 100644 (file)
index 0000000..0e32169
--- /dev/null
@@ -0,0 +1,55 @@
+--- a/mkfs.c
++++ b/mkfs.c
+@@ -34,7 +34,7 @@
+ #include <getopt.h>
+ #include <uuid/uuid.h>
+ #include <ctype.h>
+-#include <sys/xattr.h>
++#include <attr/xattr.h>
+ #include <blkid/blkid.h>
+ #include <ftw.h>
+ #include "ctree.h"
+--- a/props.c
++++ b/props.c
+@@ -17,7 +17,7 @@
+ #include <sys/stat.h>
+ #include <sys/ioctl.h>
+ #include <sys/types.h>
+-#include <sys/xattr.h>
++#include <attr/xattr.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+--- a/cmds-receive.c
++++ b/cmds-receive.c
+@@ -39,7 +39,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/time.h>
+ #include <sys/types.h>
+-#include <sys/xattr.h>
++#include <attr/xattr.h>
+ #include <uuid/uuid.h>
+ #include "ctree.h"
+--- a/cmds-restore.c
++++ b/cmds-restore.c
+@@ -34,7 +34,7 @@
+ #include <regex.h>
+ #include <getopt.h>
+ #include <sys/types.h>
+-#include <sys/xattr.h>
++#include <attr/xattr.h>
+ #include "ctree.h"
+ #include "disk-io.h"
+--- a/Makefile
++++ b/Makefile
+@@ -26,7 +26,7 @@ TESTS = fsck-tests.sh convert-tests.sh
+ INSTALL = install
+ prefix ?= /usr/local
+ bindir = $(prefix)/bin
+-lib_LIBS = -luuid -lblkid -lm -lz -llzo2 -L.
++lib_LIBS = -lattr -luuid -lblkid -lm -lz -llzo2 -L.
+ libdir ?= $(prefix)/lib
+ incdir = $(prefix)/include/btrfs
+ LIBS = $(lib_LIBS) $(libs_static)
index 1d8c1739a45d7ba3de70b647cf0cdbfe78dd6d9a..ce059cbb4d1cd627c477c12eee41edaeedeecd1e 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ccid
-PKG_VERSION:=1.4.17
+PKG_VERSION:=1.4.18
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4091
-PKG_MD5SUM:=a227a20a0dd034cd4bb7400806a0a2d0
+PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4111
+PKG_MD5SUM:=8d57342bda53aaee706ef2d02409c4f4
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=LGPL-2.1+
 PKG_LICENSE_FILES:=COPYING
index a85c12417672377cc013556d2f2a449e6a1d6395..5b9f52d1c25f6b90ef5b7544677474609aa6aff5 100644 (file)
@@ -17,7 +17,7 @@ PKG_MD5SUM:=6633b2354b7f23f9cd8e2bfb6e735965
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 PKG_LICENSE:=MIT
-PKG_LICENSE_FILE:=doc/COPYING
+PKG_LICENSE_FILES:=doc/COPYING
 
 include $(INCLUDE_DIR)/package.mk
 
index d191615113e0e02a7fd8245a5ad0f301a4d995fb..33af152a79937fc15b6158ac55186b67d97b408f 100644 (file)
@@ -313,7 +313,7 @@ $(eval $(call BuildPlugin,powerdns,PowerDNS server status input,powerdns,))
 $(eval $(call BuildPlugin,processes,process status input,processes,))
 $(eval $(call BuildPlugin,protocols,network protocols input,protocols,))
 $(eval $(call BuildPlugin,rrdtool,RRDtool output,rrdtool,+PACKAGE_collectd-mod-rrdtool:librrd1))
-$(eval $(call BuildPlugin,sensors,lm_sensors input,sensors,+PACKAGE_collectd-mod-sensors:libsensors @BROKEN))
+$(eval $(call BuildPlugin,sensors,lm_sensors input,sensors,+PACKAGE_collectd-mod-sensors:libsensors))
 $(eval $(call BuildPlugin,snmp,SNMP input,snmp,+PACKAGE_collectd-mod-snmp:libnetsnmp))
 $(eval $(call BuildPlugin,syslog,syslog output,syslog,))
 $(eval $(call BuildPlugin,tail,tail input,tail,))
index 4500e88e478e0078007cf7119cc7e36664067d1d..3b9f17d37f7ff30dc5eab054ffb14ab9f384474b 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=coreutils
-PKG_VERSION:=8.16
+PKG_VERSION:=8.23
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/coreutils
-PKG_MD5SUM:=89b06f91634208dceba7b36ad1f9e8b9
+PKG_MD5SUM:=abed135279f87ad6762ce57ff6d89c41
 PKG_BUILD_DEPENDS:=libpthread
 PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
 
@@ -36,6 +36,12 @@ DEPENDS_sort = +libpthread
 DEPENDS_timeout = +librt
 DEPENDS_expr = +libgmp
 DEPENDS_factor = +libgmp
+DEPENDS_cp = +libacl
+DEPENDS_dir = +libacl
+DEPENDS_install = +libacl
+DEPENDS_ls = +libacl
+DEPENDS_mv = +libacl
+DEPENDS_vdir = +libacl
 
 define Package/coreutils/Default
   SECTION:=utils
@@ -89,7 +95,7 @@ define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                SHELL="/bin/bash" \
-               all install install-root
+               all install
 endef
 
 define Package/coreutils/install
index 2c04117509f5124ec9ea1d0a8da4a75374f6c48d..60f2df2b8061975dac81453d7c6058a7d859515b 100644 (file)
@@ -4,19 +4,86 @@
  
  ALL_RECURSIVE_TARGETS =
  
--SUBDIRS = lib src doc man po tests gnulib-tests
-+SUBDIRS = lib src po
+-SUBDIRS = po . gnulib-tests
++SUBDIRS = po
  
  changelog_etc =                               \
    ChangeLog-2005                      \
+@@ -213,6 +213,4 @@ AM_CPPFLAGS = -Ilib -I$(top_srcdir)/lib
+ include $(top_srcdir)/lib/local.mk
+ include $(top_srcdir)/src/local.mk
+-include $(top_srcdir)/doc/local.mk
+-include $(top_srcdir)/man/local.mk
+-include $(top_srcdir)/tests/local.mk
++
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -1639,7 +1639,7 @@ top_srcdir = @top_srcdir@
- # Some tests always need root privileges, others need them only sometimes.
- ALL_RECURSIVE_TARGETS = install-root check-root distcheck-hook
--SUBDIRS = lib src doc man po tests gnulib-tests
-+SUBDIRS = lib src po
+@@ -159,8 +159,7 @@ build_triplet = @build@
+ host_triplet = @host@
+ DIST_COMMON = $(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk \
+       $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk \
+-      $(top_srcdir)/src/single-binary.mk $(top_srcdir)/doc/local.mk \
+-      $(top_srcdir)/man/local.mk $(top_srcdir)/tests/local.mk \
++      $(top_srcdir)/src/single-binary.mk \
+       INSTALL NEWS README AUTHORS ChangeLog $(srcdir)/Makefile.in \
+       $(srcdir)/Makefile.am $(top_srcdir)/configure \
+       $(am__configure_deps) $(top_srcdir)/lib/config.hin ABOUT-NLS \
+@@ -2276,11 +2275,7 @@ RECURSIVE_TARGETS = all-recursive check-
+       install-ps-recursive install-recursive installcheck-recursive \
+       installdirs-recursive pdf-recursive ps-recursive \
+       tags-recursive uninstall-recursive
+-am__can_run_installinfo = \
+-  case $$AM_UPDATE_INFO_DIR in \
+-    n|no|NO) false;; \
+-    *) (install-info --version) >/dev/null 2>&1;; \
+-  esac
++am__can_run_installinfo = false
+ am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+ am__vpath_adj = case $$p in \
+     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+@@ -2606,7 +2601,7 @@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
+ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+ ERRNO_H = @ERRNO_H@
+ EXEEXT = @EXEEXT@
+-EXTRA_MANS = @EXTRA_MANS@
++EXTRA_MANS = 
+ FLOAT_H = @FLOAT_H@
+ FNMATCH_H = @FNMATCH_H@
+ GETADDRINFO_LIB = @GETADDRINFO_LIB@
+@@ -3820,7 +3815,7 @@ libexecdir = @libexecdir@
+ lispdir = @lispdir@
+ localedir = @localedir@
+ localstatedir = @localstatedir@
+-man1_MANS = @man1_MANS@
++man1_MANS = 
+ mandir = @mandir@
+ mkdir_p = @mkdir_p@
+ oldincludedir = @oldincludedir@
+@@ -3843,7 +3838,7 @@ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ ALL_RECURSIVE_TARGETS = distcheck-hook check-root
+-SUBDIRS = po . gnulib-tests
++SUBDIRS = po
  changelog_etc = \
    ChangeLog-2005                      \
    ChangeLog-2006                      \
+@@ -5767,7 +5762,7 @@ all: $(BUILT_SOURCES)
+ .SUFFIXES: .1 .c .dvi .log .o .obj .pl .pl$(EXEEXT) .ps .sed .sh .sh$(EXEEXT) .sin .trs .x .xpl .xpl$(EXEEXT) .y
+ am--refresh: Makefile
+       @:
+-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk $(top_srcdir)/doc/local.mk $(top_srcdir)/man/local.mk $(top_srcdir)/tests/local.mk $(am__configure_deps)
++$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+@@ -5790,7 +5785,7 @@ Makefile: $(srcdir)/Makefile.in $(top_bu
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+       esac;
+-$(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk $(top_srcdir)/doc/local.mk $(top_srcdir)/man/local.mk $(top_srcdir)/tests/local.mk:
++$(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk:
+ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       $(SHELL) ./config.status --recheck
index bee8a5656a7ecaec423f789ddb5689e5b71c20df..94187e4b6a30eb1db38a46933d397bb2a0d1a598 100644 (file)
@@ -1,6 +1,6 @@
 --- a/lib/pthread.in.h
 +++ b/lib/pthread.in.h
-@@ -232,6 +232,9 @@ pthread_mutex_unlock (pthread_mutex_t *m
+@@ -252,6 +252,9 @@ pthread_mutex_unlock (pthread_mutex_t *m
  
  /* Approximate spinlocks with mutexes.  */
  
@@ -9,4 +9,4 @@
 +#endif
  typedef pthread_mutex_t pthread_spinlock_t;
  
static inline int
_GL_PTHREAD_INLINE int
diff --git a/utils/coreutils/patches/010-fix-gets-removal.patch b/utils/coreutils/patches/010-fix-gets-removal.patch
deleted file mode 100644 (file)
index 2be5fc4..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/lib/stdio.in.h b/lib/stdio.in.h
-index 9dc7c4a..9fdac77 100644
---- a/lib/stdio.in.h
-+++ b/lib/stdio.in.h
-@@ -711,10 +711,6 @@ _GL_CXXALIAS_SYS (gets, char *, (char *s));
- #  undef gets
- # endif
- _GL_CXXALIASWARN (gets);
--/* It is very rare that the developer ever has full control of stdin,
--   so any use of gets warrants an unconditional warning.  Assume it is
--   always declared, since it is required by C89.  */
--_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
- #endif
diff --git a/utils/cryptsetup/Makefile b/utils/cryptsetup/Makefile
new file mode 100644 (file)
index 0000000..330c4ec
--- /dev/null
@@ -0,0 +1,78 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=cryptsetup
+PKG_VERSION:=1.6.6
+PKG_RELEASE:=1
+PKG_LICENSE:=GPL-2.0+ LGPL-2.1+
+PKG_LICENSE_FILES:=COPYING COPYING.LGPL
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@KERNEL/linux/utils/cryptsetup/v1.6
+PKG_MD5SUM:=179c0781de59838a4e39f61b2df5ea48
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+TARGET_LDFLAGS+=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib
+
+define Package/cryptsetup/Default
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Cryptsetup
+  DEPENDS:=+libblkid +libuuid +libpopt +lvm2 +libdevmapper +@KERNEL_DIRECT_IO
+  URL:=http://code.google.com/p/cryptsetup/
+endef
+
+define Package/cryptsetup
+$(call Package/cryptsetup/Default)
+  DEPENDS+=+libgcrypt
+  VARIANT:=gcrypt
+endef
+
+define Package/cryptsetup-openssl
+$(call Package/cryptsetup/Default)
+  TITLE+= (with openssl support)
+  DEPENDS+=+libopenssl
+  VARIANT:=openssl
+endef
+
+define Package/cryptsetup/Default/description
+       Cryptsetup-luks
+endef
+
+define Package/cryptsetup/description
+$(call Package/cryptsetup/Default/description)
+linked against libgcrypt
+endef
+
+
+define Package/cryptsetup-openssl/description
+$(call Package/cryptsetup/Default/description)
+linked against openssl
+endef
+
+ifeq ($(BUILD_VARIANT),openssl)
+CONFIGURE_ARGS+= \
+        --with-crypto_backend=openssl
+endif
+
+define Package/cryptsetup/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(CP) $(PKG_BUILD_DIR)/src/.libs/cryptsetup $(1)/usr/sbin
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/lib/.libs/libcryptsetup.so* $(1)/usr/lib
+endef
+
+Package/cryptsetup-openssl/install = $(Package/cryptsetup/install)
+
+$(eval $(call BuildPackage,cryptsetup))
+$(eval $(call BuildPackage,cryptsetup-openssl))
index 240e100e76bce3dfaa287b874615393db7e69f82..996369512ca9cbc6bda4f22c98d7be29e23f8c1d 100644 (file)
@@ -21,6 +21,7 @@ PKG_LICENSE:=AFL-2.1
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 
+include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
 
 TARGET_LDFLAGS+= \
@@ -107,6 +108,29 @@ CONFIGURE_VARS+= \
        ac_cv_have_abstract_sockets="yes" \
        ac_cv_lib_expat_XML_ParserCreate_MM="yes" \
 
+HOST_CONFIGURE_ARGS+= \
+       --enable-shared \
+       --enable-static \
+       --disable-abstract-sockets \
+       --disable-ansi \
+       --disable-asserts \
+       --disable-console-owner-file \
+       --disable-docygen-docs \
+       --disable-compiler_coverage \
+       --disable-selinux \
+       --disable-tests \
+       --disable-verbose-mode \
+       --disable-xml-docs \
+       --with-dbus-user=root \
+       --with-dbus-daemondir="$(STAGIND_DIR_HOST)/bin" \
+       --with-system-socket="$(STAGING_DIR_HOST)/var/run/dbus/system_bus_socket" \
+       --with-system-pid-file="$(STAGING_DIR_HOST)/var/run/dbus.pid" \
+       --without-x \
+       --libexecdir="$(STAGING_DIR_HOST)/lib/dbus-1"
+
+HOST_CONFIGURE_VARS+= \
+       ac_cv_have_abstract_sockets="yes" \
+       ac_cv_lib_expat_XML_ParserCreate_MM="yes" \
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
@@ -184,6 +208,7 @@ define Package/dbus-utils/install
                $(1)/usr/bin/
 endef
 
+$(eval $(call HostBuild))
 $(eval $(call BuildPackage,libdbus))
 $(eval $(call BuildPackage,dbus))
 $(eval $(call BuildPackage,dbus-utils))
index 12978ed4099c77f18694277563b94fb183b4fa2b..82ce06a67ada4831b584a4f711eba7e5b931e6f9 100644 (file)
@@ -8,18 +8,23 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dump1090
-PKG_VERSION:=2014-08-22
+PKG_VERSION:=2014-11-09
 PKG_RELEASE:=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=git://github.com/MalcolmRobb/dump1090.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=a82df07c0c0a750d58610bf3c3ece77482f3a58c
+PKG_SOURCE_VERSION:=bff92c4ad772a0a8d433f788d39dae97e00e4dbe
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=BSD-3c
 
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_DUMP1090_DUMP \
+       CONFIG_DUMP1090_WWW \
+       CONFIG_DUMP1090_VIEW
+
 include $(INCLUDE_DIR)/package.mk
 
 define Package/dump1090
@@ -47,14 +52,18 @@ define Package/dump1090/install
        $(INSTALL_DIR) $(1)/usr/bin
 
 ifneq ($(CONFIG_DUMP1090_DUMP),)
-       $(CP) $(PKG_BUILD_DIR)/dump1090 $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) files/dump1090.init $(1)/etc/init.d/dump1090
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) files/dump1090.config $(1)/etc/config/dump1090
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/dump1090 $(1)/usr/bin
 ifneq ($(CONFIG_DUMP1090_WWW),)
        $(INSTALL_DIR) $(1)/usr/share/dump1090
        $(CP) $(PKG_BUILD_DIR)/public_html/* $(1)/usr/share/dump1090
 endif
 endif
 ifneq ($(CONFIG_DUMP1090_VIEW),)
-       $(CP) $(PKG_BUILD_DIR)/view1090 $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/view1090 $(1)/usr/bin
 endif
 endef
 
diff --git a/utils/dump1090/files/dump1090.config b/utils/dump1090/files/dump1090.config
new file mode 100644 (file)
index 0000000..53d40ef
--- /dev/null
@@ -0,0 +1,39 @@
+config dump1090 main
+       option disabled '1'
+       option respawn '1'
+       option device_index ''
+       option gain ''
+       option enable_agc '0'
+       option freq ''
+       option ifile ''
+       option raw '0'
+       option net '1'
+       option modeac '0'
+       option net_beast '0'
+       option net_only '0'
+       option net_bind_address ''
+       option net_http_port '8080'
+       option net_ri_port ''
+       option net_ro_port ''
+       option net_sbs_port ''
+       option net_bi_port ''
+       option net_bo_port ''
+       option net_ro_size ''
+       option net_ro_rate ''
+       option net_heartbeat ''
+       option net_buffer ''
+       option lat ''
+       option lon ''
+       option fix '0'
+       option no_fix '0'
+       option no_crc_check '0'
+       option phase_enhance '0'
+       option agressive '0'
+       option mlat '0'
+       option stats '0'
+       option stats_every ''
+       option onlyaddr '0'
+       option metric '0'
+       option snip ''
+       option debug ''
+       option ppm ''
diff --git a/utils/dump1090/files/dump1090.init b/utils/dump1090/files/dump1090.init
new file mode 100644 (file)
index 0000000..bc0755f
--- /dev/null
@@ -0,0 +1,92 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2014 OpenWrt.org
+
+START=90
+STOP=10
+USE_PROCD=1
+
+append_arg() {
+       local cfg="$1"
+       local var="$2"
+       local opt="$3"
+       local def="$4"
+       local val
+
+       config_get val "$cfg" "$var"
+       [ -n "$val" -o -n "$def" ] && procd_append_param command $opt "${val:-$def}"
+}
+
+append_bool() {
+       local cfg="$1"
+       local var="$2"
+       local opt="$3"
+       local def="$4"
+       local val
+
+       config_get_bool val "$cfg" "$var" "$def"
+       [ "$val" = 1 ] && procd_append_param command "$opt"
+}
+
+start_instance() {
+       local cfg="$1"
+       local aux
+
+       config_get_bool aux "$cfg" 'disabled' '0'
+       [ "$aux" = 1 ] && return 1
+
+       procd_open_instance
+
+       procd_set_param command /usr/bin/dump1090
+       procd_append_param command "--quiet"
+
+       append_arg "$cfg" device_index "--device-index"
+       append_arg "$cfg" gain "--gain"
+       append_bool "$cfg" enable_agc "--enable-agc"
+       append_arg "$cfg" freq "--freq"
+       append_arg "$cfg" ifile "--ifile"
+       append_bool "$cfg" raw "--raw"
+       append_bool "$cfg" net "--net"
+       append_bool "$cfg" modeac "--modeac"
+       append_bool "$cfg" net_beast "--net-beast"
+       append_bool "$cfg" net_only "--net-only"
+       append_arg "$cfg" net_bind_address "--net-bind-address"
+       append_arg "$cfg" net_http_port "--net-http-port"
+       append_arg "$cfg" net_ri_port "--net-ri-port"
+       append_arg "$cfg" net_ro_port "--net-ro-port"
+       append_arg "$cfg" net_sbs_port "--net-sbs-port"
+       append_arg "$cfg" net_bi_port "--net-bi-port"
+       append_arg "$cfg" net_bo_port "--net-bo-port"
+       append_arg "$cfg" net_ro_size "--net-ro-size"
+       append_arg "$cfg" net_ro_rate "--net-ro-rate"
+       append_arg "$cfg" net_heartbeat "--net-heartbeat"
+       append_arg "$cfg" net_buffer "--net-buffer"
+       append_arg "$cfg" lat "--lat"
+       append_arg "$cfg" lon "--lon"
+       append_bool "$cfg" fix "--fix"
+       append_bool "$cfg" no_fix "--no-fix"
+       append_bool "$cfg" no_crc_check "--no-crc-check"
+       append_bool "$cfg" phase_enhance "--phase-enhance"
+       append_bool "$cfg" agressive "--agressive"
+       append_bool "$cfg" mlat "--mlat"
+       append_bool "$cfg" stats "--stats"
+       append_arg "$cfg" stats_every "--stats-every"
+       append_bool "$cfg" onlyaddr "--onlyaddr"
+       append_bool "$cfg" metric "--metric"
+       append_arg "$cfg" snip "--snip"
+       append_arg "$cfg" debug "--debug"
+       append_arg "$cfg" ppm "--ppm"
+
+       config_get_bool aux "$cfg" 'respawn' '0'
+       [ "$aux" = 1 ] && procd_set_param respawn
+
+       procd_close_instance
+}
+
+service_triggers() { 
+       procd_add_reload_trigger "dump1090" 
+} 
+
+start_service() {
+       config_load dump1090
+       config_foreach start_instance dump1090
+}
diff --git a/utils/f2fs-tools/Config.in b/utils/f2fs-tools/Config.in
new file mode 100644 (file)
index 0000000..0c7ecab
--- /dev/null
@@ -0,0 +1,25 @@
+menu "Configuration"
+        depends on PACKAGE_f2fs-tools
+
+config F2FS_UTILS_f2fstat
+       bool "Install f2fstat utility"
+       default y
+
+config F2FS_UTILS_fibmap_f2fs
+       bool "Install fibmap.f2fs utility"
+       default y
+
+config F2FS_UTILS_fsck_f2fs
+       bool "Install fsck.f2fs utility"
+       default y
+
+config F2FS_UTILS_dump_f2fs
+       bool "Install dump.f2fs utility"
+       select F2FS_UTILS_fsck_f2fs
+       default y
+
+config F2FS_UTILS_mkfs_f2fs
+       bool "Install mkfs.f2fs utility"
+       default y
+
+endmenu
diff --git a/utils/f2fs-tools/Makefile b/utils/f2fs-tools/Makefile
new file mode 100644 (file)
index 0000000..62d5155
--- /dev/null
@@ -0,0 +1,89 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=f2fs-tools
+PKG_VERSION:=1.4.0
+PKG_RELEASE:=1
+
+PKG_LICENSE:=GPLv2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/
+PKG_MD5SUM:=be9bfdddf3e5fd5e701a88d0b388dc26
+
+PKG_FIXUP:=autoreconf
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/f2fs-tools
+  SECTION:=utils
+  CATEGORY:=Utilities
+  SUBMENU:=Filesystem
+  TITLE:=Tools for Flash-Friendly File System (F2FS)
+  DEPENDS:=+libuuid +libf2fs
+  URL:=http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git
+  MENU:=1
+endef
+
+define Package/libf2fs
+  $(call Package/lxc/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Library for Flash-Friendly File System (F2FS) tools
+  DEPENDS:=
+endef
+
+define Package/f2fs-tools/config
+  source "$(SOURCE)/Config.in"
+endef
+
+define Package/libf2fs/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libf2fs.so* $(1)/usr/lib/
+endef
+
+define Package/f2fs-tools/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+
+ifeq ($(CONFIG_F2FS_UTILS_f2fstat),y)
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/f2fstat $(1)/usr/sbin
+endif
+
+ifeq ($(CONFIG_F2FS_UTILS_fibmap_f2fs),y)
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/fibmap.f2fs $(1)/usr/sbin
+endif
+
+ifeq ($(CONFIG_F2FS_UTILS_fsck_f2fs),y)
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/fsck.f2fs $(1)/usr/sbin
+endif
+
+ifeq ($(CONFIG_F2FS_UTILS_dump_f2fs),y)
+       ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/dump.f2fs
+endif
+
+ifeq ($(CONFIG_F2FS_UTILS_mkfs_f2fs),y)
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/mkfs.f2fs $(1)/usr/sbin
+endif
+
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libf2fs.so* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libf2fs.a $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libf2fs))
+$(eval $(call BuildPackage,f2fs-tools))
diff --git a/utils/f2fs-tools/patches/001-compile.patch b/utils/f2fs-tools/patches/001-compile.patch
new file mode 100644 (file)
index 0000000..2ff6ee8
--- /dev/null
@@ -0,0 +1,19 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -20,14 +20,9 @@ AC_DEFINE([F2FS_MINOR_VERSION], m4_bpats
+                               [\([0-9]*\).\([0-9]*\)\(\w\|\W\)*], [\2]),
+                               [Minor version for f2fs-tools])
+-AC_CHECK_FILE(.git,
+-      AC_DEFINE([F2FS_TOOLS_DATE],
+-              "m4_bpatsubst(f2fs_tools_gitdate,
+-              [\([0-9-]*\)\(\w\|\W\)*], [\1])",
+-              [f2fs-tools date based on Git commits]),
+-      AC_DEFINE([F2FS_TOOLS_DATE],
++AC_DEFINE([F2FS_TOOLS_DATE],
+               "f2fs_tools_date",
+-              [f2fs-tools date based on Source releases]))
++              [f2fs-tools date based on Source releases])
+ AC_CONFIG_SRCDIR([config.h.in])
+ AC_CONFIG_HEADER([config.h])
diff --git a/utils/gammu/Makefile b/utils/gammu/Makefile
new file mode 100644 (file)
index 0000000..9748d2e
--- /dev/null
@@ -0,0 +1,73 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gammu
+PKG_VERSION:=1.33.0
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://dl.cihar.com/gammu/releases/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MD5SUM:=66b95afbde3085168c4a20266e8cb5c0
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_MAINTAINER:=Vitaly Protsko <villy@sft.ru>
+PKG_LICENCE:=GPL-2.0
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/gammu
+       SECTION:=utils
+       CATEGORY:=Utilities
+       TITLE:=Cell phone/modem SMS and control tool
+       URL:=http://dl.cihar.com/gammu/releases/
+       DEPENDS:=@BUILD_NLS +libpthread +libcurl +glib2 $(ICONV_DEPENDS) $(INTL_DEPENDS)
+       DEPENDS+=+PACKAGE_python:python +PACKAGE_bluez-libs:bluez-libs
+       DEPENDS+=+PACKAGE_libmysqlclient:libmysqlclient +PACKAGE_unixodbc:unixodbc
+endef
+
+CONFIGURE_ARGS:= \
+       --prefix=/usr \
+       --cross-root="$(STAGING_DIR) $(TOOLCHAIN_DIR)" \
+       --enable-shared
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               $(TARGET_CONFIGURE_OPTS) \
+               LDSHARED="$(TARGET_CROSS)ld -shared" \
+               CFLAGS="$(TARGET_CFLAGS) $(FPIC)"
+endef
+
+define Build/Install
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               install
+endef
+
+define Build/InstallDev
+       mkdir -p $(1)/usr/include
+       $(CP) -r $(PKG_INSTALL_DIR)/usr/include/gammu $(1)/usr/include/
+       mkdir -p $(1)/usr/lib
+       $(CP)    $(PKG_INSTALL_DIR)/usr/lib/lib{Gammu*,gsmsd*} $(1)/usr/lib/
+endef
+
+define Package/gammu/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gammu $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gammu-{smsd,smsd-inject,smsd-monitor} $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/lib{Gammu*,gsmsd*} $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_CONF) ./files/gammurc $(1)/etc/gammurc
+endef
+
+define Package/gammu/conffiles
+/etc/gammurc
+endef
+
+$(eval $(call BuildPackage,gammu))
diff --git a/utils/gammu/files/gammurc b/utils/gammu/files/gammurc
new file mode 100644 (file)
index 0000000..d547c04
--- /dev/null
@@ -0,0 +1,37 @@
+# Port         : "/dev/ttyS%" or "/dev/ircomm%" ("irda" connection), "/dev/ttyUSB%"
+#                (instead of "%" please put "0", "1", "2", etc.)
+# Model                : use only, when Gammu doesn't recognize your phone model.
+#                Put it here. Example values: "6110", "6150", "6210", "8210"
+# Connection   : type of connection. Use "fbus" or "mbus" or "dlr3" or
+#                "irda" (Infrared over sockets) or "infrared" (DirectIR)
+#                or "at19200" (AT commands on 19200, 8 bits, None parity,
+#                1 stop bit, no flow control) or "at115200" (AT commands on
+#                115200, 8 bits, None parity, 1 stop bit, no flow control)
+#                or "atblue" (AT over BlueTooth) or "dlr3blue" (FBUS
+#                over BlueTooth)
+# SynchronizeTime: If you want to set time from computer to phone during
+#                starting connection. Do not rather use this option when want
+#                to reset phone during connection (in some phones need to
+#                set time again after restart)
+# Logfile      : Use, when want to have logfile from communication.
+# Logformat    : What debug info and format should be used:
+#                "nothing" - no debug level, "text" - transmission dump in
+#                text format, "textall" - all possible info in text format,
+#                "errors"  - errors in text format, "binary" - transmission
+#                dump in binary format
+# Use_Locking  : under Unix/Linux use "yes", if want to lock used device
+#                to prevent using it by other applications
+# GammuLoc     : name of localisation file
+
+[gammu]
+
+port = /dev/ttyUSB0
+#model =
+connection = at
+#synchronizetime = yes
+#logfile =
+#logformat = errors
+use_locking = yes
+#gammuloc =
+
+# EOF /etc/gammurc
diff --git a/utils/gammu/patches/001-iconv-disabling-option.patch b/utils/gammu/patches/001-iconv-disabling-option.patch
new file mode 100644 (file)
index 0000000..91abfe7
--- /dev/null
@@ -0,0 +1,51 @@
+--- a/cmake/FindIconv.cmake
++++ b/cmake/FindIconv.cmake
+@@ -34,9 +34,9 @@ string(REGEX REPLACE "(.*)/include/?" "\
+ FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv c HINTS "${ICONV_INCLUDE_BASE_DIR}/lib" PATHS /opt/local/lib)
+  
+-IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) 
++IF(NOT DISABLE_ICONV AND ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) 
+    SET(ICONV_FOUND TRUE) 
+-ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) 
++ENDIF(NOT DISABLE_ICONV AND ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) 
+ set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
+ set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
+--- a/configure
++++ b/configure
+@@ -31,6 +31,7 @@ Usage: ./configure [options]
+ --enable-backup     enable backup support
+ --enable-win32      enable mingw crosscomilation
+ --enable-protection enable compile time protections
++--disable-iconv     disable iconv support
+ --with-python=<path> path to Python interpreter
+ --without-gnapplet  disable installation of gnapplet
+ --without-completion disable installation of bash completion script
+@@ -57,6 +58,7 @@ CMAKE_PROTECTION=
+ CMAKE_PYTHON=
+ CMAKE_GNAP=
+ CMAKE_COMPLETE=
++CMAKE_ICONV=
+ # process command line
+ while [ "$#" -gt 0 ] ; do
+@@ -94,6 +96,12 @@ while [ "$#" -gt 0 ] ; do
+         --disable-protection)
+             CMAKE_PROTECTION="-DENABLE_PROTECTION=OFF"
+             ;;
++        --enable-iconv)
++            CMAKE_ICONV="-DDISABLE_ICONV=OFF"
++            ;;
++        --disable-iconv)
++            CMAKE_ICONV="-DDISABLE_ICONV=ON"
++            ;;
+         --enable-debug)
+             CMAKE_DEBUG="-DCMAKE_BUILD_TYPE=Debug"
+             ;;
+@@ -142,4 +150,4 @@ fi
+ cd "$BUILD_DIR"
+ # invoke cmake to do configuration
+-cmake $SOURCE_DIR $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_PYTHON $CMAKE_GNAP $CMAKE_COMPLETE
++cmake $SOURCE_DIR $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_PYTHON $CMAKE_GNAP $CMAKE_COMPLETE $CMAKE_ICONV
diff --git a/utils/gammu/patches/002-no-fstack-protector.patch b/utils/gammu/patches/002-no-fstack-protector.patch
new file mode 100644 (file)
index 0000000..ec0badf
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -537,8 +537,6 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMP
+         #    MACRO_TUNE_LINKER("-pie")
+         # These do not work on Windows right now
+         if (NOT WIN32)
+-            # Stack protector
+-            MACRO_TUNE_COMPILER("-fstack-protector")
+             # Mark code read only
+             MACRO_TUNE_LINKER("-Wl,-zrelro")
+         endif (NOT WIN32)
diff --git a/utils/gammu/patches/003-cmake-cross-toolchain.patch b/utils/gammu/patches/003-cmake-cross-toolchain.patch
new file mode 100644 (file)
index 0000000..cfacf11
--- /dev/null
@@ -0,0 +1,43 @@
+--- /dev/null
++++ b/cmake/Toolchain-cross.cmake
+@@ -0,0 +1,5 @@
++# search for programs in the build host directories
++SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
++# for libraries and headers in the target directories
++SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
++SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+--- a/configure
++++ b/configure
+@@ -25,6 +25,7 @@ Usage: ./configure [options]
+ --help|-h           shows this help
+ --prefix=<path>     installation prefix
++--cross-root=<path> cross-compilation prefix
+ --enable-shared     enables shared build
+ --enable-debug      enables debug build
+ --enable-tiger      enables Mac OS X 10.4 (Tiger) build
+@@ -50,6 +51,7 @@ SOURCE_DIR=`pwd`
+ # cmake parameters
+ CMAKE_PREFIX=
++CMAKE_ROOT=
+ CMAKE_SHARED=
+ CMAKE_DEBUG=
+ CMAKE_BACKUP=
+@@ -69,6 +71,10 @@ while [ "$#" -gt 0 ] ; do
+         --prefix=*)
+             CMAKE_PREFIX="-DCMAKE_INSTALL_PREFIX=${1##--prefix=}"
+             ;;
++        --cross-root=*)
++            CMAKE_ROOT="-DCMAKE_TOOLCHAIN_FILE=$SOURCE_DIR/cmake/Toolchain-cross.cmake"
++            echo "SET(CMAKE_FIND_ROOT_PATH ${1##--cross-root=})" >> $SOURCE_DIR/cmake/Toolchain-cross.cmake
++            ;;
+         --with-python=*)
+             CMAKE_PYTHON="-DBUILD_PYTHON=${1##--with-python=}"
+             ;;
+@@ -150,4 +156,4 @@ fi
+ cd "$BUILD_DIR"
+ # invoke cmake to do configuration
+-cmake $SOURCE_DIR $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_PYTHON $CMAKE_GNAP $CMAKE_COMPLETE $CMAKE_ICONV
++cmake $SOURCE_DIR $CMAKE_ROOT $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_PYTHON $CMAKE_GNAP $CMAKE_COMPLETE $CMAKE_ICONV
diff --git a/utils/gammu/patches/010-utils-shell-fix.patch b/utils/gammu/patches/010-utils-shell-fix.patch
new file mode 100644 (file)
index 0000000..d1b3ec3
--- /dev/null
@@ -0,0 +1,16 @@
+--- a/utils/gammu-config
++++ b/utils/gammu-config
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ # Gammu configuration generator
+ # Copyright (C) 2003 - 2009 Michal Cihar <michal@cihar.com>
+ # vim: expandtab sw=4 ts=4 sts=4:
+--- a/utils/jadmaker
++++ b/utils/jadmaker
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ # JAD file generator
+ # Copyright © 2008 - 2009 Michal Čihař <michal@cihar.com>
+ # vim: expandtab sw=4 ts=4 sts=4:
index f1e5f84f706a5e72f7ff1ab8b1ca2d6c58fd314b..0bec41d8b793131f7aa212ed18234220e8985386 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=ftp://ftp.franken.de/pub/crypt/mirror/ftp.gnupg.org/gcrypt/gnupg
 PKG_MD5SUM:=54db1be9588b11afbbdd8b82d4ea883a
 
 PKG_LICENSE:=GPL-3.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
 
 PKG_INSTALL:=1
index 5f6ca650f0c0e3657cf00a40dba5d692018dc71d..44a8f41e4fa7be48fcdc591b7b6e6eaad7c37738 100644 (file)
@@ -17,6 +17,11 @@ PKG_MD5SUM:=a9decddb508944d56f71dd2f821e2ec5
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
 PKG_LICENSE:=GPL-2.0
 
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_HASERL_with_lua \
+       CONFIG_HASERL_shell_luac \
+       CONFIG_HASERL_shell_lua \
+
 include $(INCLUDE_DIR)/package.mk
 
 define Package/haserl
index cf1493ab568c946d04583656d094dd640478c42e..aa222846630b6d69c3c9ae344adbcd2eab980ac5 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Lim Guo Wei <limguowei@gmail.com>
 PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=
+PKG_LICENSE_FILES:=
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
diff --git a/utils/hdparm/Makefile b/utils/hdparm/Makefile
new file mode 100644 (file)
index 0000000..8841213
--- /dev/null
@@ -0,0 +1,42 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=hdparm
+PKG_VERSION:=9.45
+PKG_RELEASE:=1
+PKG_USE_MIPS16:=0
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/$(PKG_NAME)
+PKG_MD5SUM:=1c75d0751a44928b6c4bc81fb16d7fe8
+PKG_MAINTAINER:=Richard Kunze <richard.kunze@web.de>
+PKG_LICENSE:=BSD-Style Open Source License
+
+include $(INCLUDE_DIR)/package.mk
+
+TARGET_CFLAGS+=-D_GNU_SOURCE
+
+define Package/hdparm
+  SECTION:=utils
+  CATEGORY:=Utilities
+  SUBMENU:=disc
+  TITLE:=Hard disk drive configuration utilitity
+  URL:=http://sourceforge.net/projects/hdparm/
+endef
+
+define Package/hdparm/description
+ get/set SATA/IDE device parameters
+endef
+
+define Package/hdparm/install
+       $(INSTALL_DIR) $(1)/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/sbin
+endef
+
+$(eval $(call BuildPackage,hdparm))
diff --git a/utils/hdparm/patches/001-fix-includes.patch b/utils/hdparm/patches/001-fix-includes.patch
new file mode 100644 (file)
index 0000000..44343fb
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/hdparm.h
++++ b/hdparm.h
+@@ -2,6 +2,7 @@
+ //#undef __KERNEL_STRICT_NAMES
+ #include <linux/types.h>
++#include <sys/types.h>
+ #if !defined(__GNUC__) && !defined(__attribute__)
+ #define __attribute__(x)
+--- a/sysfs.c
++++ b/sysfs.c
+@@ -12,6 +12,7 @@
+ #include <stdio.h>
+ #include <fcntl.h>
+ #include <errno.h>
++#include <limits.h>
+ #include <dirent.h>
+ #include <sys/stat.h>
+ #include <linux/types.h>
diff --git a/utils/luci-app-lxc/Makefile b/utils/luci-app-lxc/Makefile
new file mode 100644 (file)
index 0000000..f08d81e
--- /dev/null
@@ -0,0 +1,68 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luci-app-lxc
+PKG_RELEASE:=20141012
+
+PKG_LICENSE:=Apache-2.0
+
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luci-app-lxc
+  SECTION:=luci
+  CATEGORY:=LuCI
+  SUBMENU:=3. Applications
+  TITLE:=LXC management Web UI
+  DEPENDS:=+luci-mod-admin-full +lxc +lxc-create +liblxc +rpcd-mod-lxc
+  MAINTAINER:=Petar Koretic <petar.koretic@sartura.hr>
+endef
+
+define Package/luci-app-lxc/description
+ This package will install LXC management Web UI.
+endef
+
+define Build/Prepare
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/luci-app-lxc/install
+       $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller/
+       $(INSTALL_BIN) \
+               ./files/controller/lxc.lua \
+               $(1)/usr/lib/lua/luci/controller/
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/
+       $(INSTALL_DATA) \
+               ./files/view/lxc.htm \
+               $(1)/usr/lib/lua/luci/view/
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/
+       $(INSTALL_BIN) \
+               ./files/model/cbi/lxc.lua \
+               $(1)/usr/lib/lua/luci/model/cbi/
+
+       $(INSTALL_DIR) $(1)/etc/config/
+       $(INSTALL_DATA) \
+               ./files/lxc.config \
+               $(1)/etc/config/lxc
+
+       $(INSTALL_DIR) $(1)/www
+       $(CP) -R \
+               ./files/www/* \
+               $(1)/www
+endef
+
+$(eval $(call BuildPackage,luci-app-lxc))
diff --git a/utils/luci-app-lxc/files/controller/lxc.lua b/utils/luci-app-lxc/files/controller/lxc.lua
new file mode 100644 (file)
index 0000000..f3f5d07
--- /dev/null
@@ -0,0 +1,125 @@
+--[[
+
+LuCI LXC module
+
+Copyright (C) 2014, Cisco Systems, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+Author: Petar Koretic <petar.koretic@sartura.hr>
+
+]]--
+
+module("luci.controller.lxc", package.seeall)
+
+require "ubus"
+local conn = ubus.connect()
+if not conn then
+    error("Failed to connect to ubus")
+end
+
+
+function fork_exec(command)
+       local pid = nixio.fork()
+       if pid > 0 then
+               return
+       elseif pid == 0 then
+               -- change to root dir
+               nixio.chdir("/")
+
+               -- patch stdin, out, err to /dev/null
+               local null = nixio.open("/dev/null", "w+")
+               if null then
+                       nixio.dup(null, nixio.stderr)
+                       nixio.dup(null, nixio.stdout)
+                       nixio.dup(null, nixio.stdin)
+                       if null:fileno() > 2 then
+                               null:close()
+                       end
+               end
+
+               -- replace with target command
+               nixio.exec("/bin/sh", "-c", command)
+       end
+end
+
+function index()
+       page = node("admin", "services", "lxc")
+       page.target = cbi("lxc")
+       page.title = _("LXC Containers")
+       page.order = 70
+
+       page = entry({"admin", "services", "lxc_create"}, call("lxc_create"), nil)
+       page.leaf = true
+
+       page = entry({"admin", "services", "lxc_action"}, call("lxc_action"), nil)
+       page.leaf = true
+
+       page = entry({"admin", "services", "lxc_configuration_get"}, call("lxc_configuration_get"), nil)
+       page.leaf = true
+
+       page = entry({"admin", "services", "lxc_configuration_set"}, call("lxc_configuration_set"), nil)
+       page.leaf = true
+
+end
+
+function lxc_create(lxc_name, lxc_template)
+       luci.http.prepare_content("text/plain")
+
+       local uci = require("uci").cursor()
+
+       local url = uci:get("lxc", "lxc", "url")
+
+       if not pcall(dofile, "/etc/openwrt_release") then
+               return luci.http.write("1")
+       end
+
+       local target = _G.DISTRIB_TARGET:match('([^/]+)')
+
+       local data = conn:call("lxc", "create", { name = lxc_name, template = "download", args = { "--server", url,  "--no-validate", "--dist", lxc_template, "--release", "bb", "--arch", target } } )
+
+       luci.http.write(data)
+end
+
+function lxc_action(lxc_action, lxc_name)
+       luci.http.prepare_content("application/json")
+
+       local data, ec = conn:call("lxc", lxc_action, lxc_name and { name = lxc_name} or {} )
+
+       luci.http.write_json(ec and {} or data)
+end
+
+function lxc_configuration_get(lxc_name)
+       luci.http.prepare_content("text/plain")
+
+       local f = io.open("/lxc/" .. lxc_name .. "/config", "r")
+       local content = f:read("*all")
+       f:close()
+
+       luci.http.write(content)
+end
+
+function lxc_configuration_set(lxc_name)
+       luci.http.prepare_content("text/plain")
+
+       local lxc_configuration = luci.http.formvalue("lxc_configuration")
+
+       if lxc_configuration == nil then
+               return luci.http.write("1")
+       end
+
+       local f, err = io.open("/lxc/" .. lxc_name .. "/config","w+")
+       if not f then
+               return luci.http.write("2")
+       end
+
+       f:write(lxc_configuration)
+       f:close()
+
+       luci.http.write("0")
+end
+
diff --git a/utils/luci-app-lxc/files/lxc.config b/utils/luci-app-lxc/files/lxc.config
new file mode 100644 (file)
index 0000000..5572c73
--- /dev/null
@@ -0,0 +1,6 @@
+#
+# lxc uci configuration
+#
+
+config lxc 'lxc'
+       option url 'virtualwrt.org/containers/'
diff --git a/utils/luci-app-lxc/files/model/cbi/lxc.lua b/utils/luci-app-lxc/files/model/cbi/lxc.lua
new file mode 100644 (file)
index 0000000..ac0fdff
--- /dev/null
@@ -0,0 +1,31 @@
+--[[
+
+LuCI LXC module
+
+Copyright (C) 2014, Cisco Systems, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+Author: Petar Koretic <petar.koretic@sartura.hr>
+
+]]--
+
+local fs = require "nixio.fs"
+
+m = Map("lxc", translate("LXC Containers"))
+
+if fs.access("/etc/config/lxc") then
+       m:section(SimpleSection).template = "lxc"
+
+       s = m:section(TypedSection, "lxc", translate("Options"))
+       s.anonymous = true
+       s.addremove = false
+
+       s:option(Value, "url", translate("Containers URL"))
+end
+
+return m
diff --git a/utils/luci-app-lxc/files/view/lxc.htm b/utils/luci-app-lxc/files/view/lxc.htm
new file mode 100644 (file)
index 0000000..1376968
--- /dev/null
@@ -0,0 +1,441 @@
+<%#
+
+LuCI LXC module
+
+Copyright (C) 2014, Cisco Systems, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+Author: Petar Koretic <petar.koretic@sartura.hr>
+
+-%>
+
+<fieldset class="cbi-section">
+       <legend><%:Available Containers%></legend>
+       <div class="cbi-section-node">
+               <table id="t_lxc_list" class="cbi-section-table">
+                       <tr class="cbi-section-table-titles">
+                               <th class="cbi-section-table-cell"><%:Name%></th>
+                               <th class="cbi-section-table-cell"><%:Status%></th>
+                               <th class="cbi-section-table-cell"><%:Actions%></th>
+                       </tr>
+               </table>
+       </div>
+</fieldset>
+
+<fieldset class="cbi-section">
+       <span id="lxc-list-output"></span>
+</fieldset>
+
+<hr/>
+<fieldset class="cbi-section">
+       <legend><%:Create New Container%></legend>
+       <div class="cbi-section-node">
+               <table id="t_lxc_create" class="cbi-section-table">
+                       <tr class="cbi-section-table-titles">
+                               <th class="cbi-section-table-cell"><%:Name%></th>
+                               <th class="cbi-section-table-cell"><%:Template%></th>
+                               <th class="cbi-section-table-cell"><%:Actions%></th>
+                       </tr>
+                       <tr id="tr_holder">
+                               <td>
+                                       <input type="text" id="tx_name" placeholder="<%:Enter new name%>" value='' />
+                               </td>
+                               <td>
+                                       <select id="s_template" class="cbi-input-select cbi-button">
+                                               <option value="openwrt">OpenWrt</option>
+                                       </select>
+                               </td>
+                               <td>
+                                       <input type="button" id="bt_create" value="<%:Create%>" onclick="lxc_create(tr_holder)" class="cbi-button cbi-button-add" />
+                                       <span id="lxc-add-loader" style="display:inline-block; width:16px; height:16px; margin:0 5px"></span>
+                               </td>
+                       </tr>
+               </table>
+       </div>
+</fieldset>
+
+<fieldset class="cbi-section">
+       <span id="lxc-add-output"></span>
+</fieldset>
+
+<hr/>
+
+<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
+<script type="text/javascript">//<![CDATA[
+
+       window.img = { "red" : "<%=resource%>/cbi/red.gif", "green" : "<%=resource%>/cbi/green.gif", "purple" : "<%=resource%>/cbi/purple.gif" }
+       window.states = {  "STOPPED" : "red", "RUNNING" : "green", "FROZEN" : "purple"}
+
+       var t_lxc_list = document.getElementById('t_lxc_list');
+       var loader_html = '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" width="16" height="16" style="vertical-align:middle" /> ';
+       var timeout_msg = 0
+       var output_list = document.getElementById("lxc-list-output")
+       var output_add = document.getElementById("lxc-add-output")
+       var loader_add = document.getElementById("lxc-add-loader")
+
+       function lxc_create(tr)
+       {
+               var lxc_name = tr.querySelector("#tx_name").value.trim()
+               var lxc_template = tr.querySelector("#s_template").value
+               var bt_create = tr.querySelector("#bt_create")
+
+               if (t_lxc_list.querySelector("[data-id='" + lxc_name + "']") != null)
+                       return info_message(output_add, "Container with that name already exists!", 4000)
+
+               bt_create.disabled = true
+               output_add.innerHTML = ''
+
+               if (!lxc_name || !lxc_name.length)
+               {
+                       bt_create.disabled = false
+                       return info_message(output_add, "Name cannot be empty!", 4000)
+               }
+
+               loading(loader_add)
+
+               new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_create/' + '%h/%h'.format(lxc_name, lxc_template) , null,
+               function(x)
+               {
+                       bt_create.disabled = false
+                       loading(loader_add, 0)
+
+                       if (!x)
+                               info_message(output_add, "Container creation failed!")
+               })
+       }
+
+       function lxc_create_template(lxc_name, lxc_state)
+       {
+               var info_row = t_lxc_list.querySelector("#empty")
+               if (info_row)
+                       t_lxc_list.deleteRow(1)
+
+               var actions = ''
+               actions += '<input type="button" onclick="action_handler(this)" data-action="start" value="<%:Start%>" class="cbi-button cbi-button-apply" />'
+               actions+= '<input type="button" onclick="action_handler(this)" data-action="stop" value="<%:Stop%>" class="cbi-button cbi-button-reset" />'
+               actions+= '<input type="button" onclick="action_handler(this)" data-action="destroy" value="<%:Delete%>" class="cbi-button cbi-button-remove" />'
+               actions+= ' <select class="cbi-input-select cbi-button" onchange="action_more_handler(this)">\
+                                               <option selected disabled>more</option>\
+                                               <option>configure</option>\
+                                               <option>freeze</option>\
+                                               <option>unfreeze</option>\
+                                               <option>reboot</option>\
+                                       </select>'
+               actions+= '<span data-loader style="display:inline-block; width:16px; height:16px; margin:0 5px"></span>'
+
+               var row = t_lxc_list.insertRow(-1)
+               var cell = row.insertCell(-1)
+               cell.innerHTML = '%q%h%q'.format("<strong>", lxc_name, "</strong>")
+               cell.width = "30%"
+               cell.setAttribute("data-id", lxc_name)
+
+               cell = row.insertCell(-1)
+               cell.width = "20%"
+               cell.innerHTML = "<img src='"+window.img[lxc_state]+"'/>"
+
+               cell = row.insertCell(-1)
+               cell.width = "50%"
+               cell.innerHTML = actions
+       }
+
+       function action_handler(self)
+       {
+               var action = self.getAttribute("data-action");
+
+               var bt_action = self
+               var lxc_name = self.parentNode.parentNode.children[0].getAttribute('data-id')
+               var status_img = self.parentNode.parentNode.querySelector('img')
+               var loader = self.parentNode.querySelector('[data-loader]')
+
+               bt_action.disabled = true
+
+               if (action == "stop")
+               {
+                       loading(loader)
+
+                       new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(action, lxc_name), null,
+                       function(x, ec)
+                       {
+                               loading(loader, 0)
+                               bt_action.disabled = false
+
+                               if (!x || ec)
+                                       return info_message(output_list,"Action failed!")
+
+                               set_status(status_img, "red")
+
+                       });
+               }
+
+               else if (action == "start")
+               {
+                       loading(loader)
+
+                       new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(action, lxc_name), null,
+                       function(x, data)
+                       {
+                               loading(loader, 0)
+                               bt_action.disabled = false
+
+                               //FIXME: uncomment after fixing 'lxc-start'
+                               if (!x /*|| ec */)
+                                       return info_message(output_list,"Action failed!")
+
+                               //FIXME: uncomment after fixing 'lxc-start'
+                               //set_status(status_img, "green")
+                       });
+               }
+
+               else if (action == "destroy")
+               {
+                       if (!confirm("This will completely remove LXC container from the disk. Are you sure? (container will be stopped if running)"))
+                               return
+
+                       loading(loader)
+
+                       new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(action, lxc_name), null,
+                       function(x, ec)
+                       {
+                               loading(loader, 0)
+                               bt_action.disabled = false
+
+                               if (!x || ec)
+                                       return info_message(output_list,"Action failed!")
+
+                               var row = self.parentNode.parentNode
+                               row.parentNode.removeChild(row)
+
+                       });
+               }
+       }
+
+       function lxc_configure_handler(self)
+       {
+               var td = self.parentNode
+               var textarea = td.querySelector('[data-id]')
+               var lxc_name = textarea.getAttribute('data-id')
+               var lxc_configuration = textarea.value
+
+               new XHR().post('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_configuration_set/' + lxc_name, "lxc_configuration=" + encodeURIComponent(lxc_configuration) ,
+               function(x)
+               {
+                       if (!x || x.responseText != "0")
+                               return info_message(output_list,"Action failed!")
+
+                       info_message(output_list,"LXC configuration updated")
+                       var row = td.parentNode
+                       row.parentNode.removeChild(row)
+               })
+       }
+
+       function lxc_rename_template(lxc_name)
+       {
+               var h = '\
+                       <input data-id="'+ lxc_name + '" type="text" placeholder="Enter new name" /> \
+                       <input data-id="bt_confirm" onclick="lxc_rename_handler(this)" type="button" class="cbi-button" value="Confirm" />'
+
+               return h
+       }
+
+       function lxc_configure_template(lxc_name, lxc_configuration)
+       {
+               var h = '\
+                       <textarea data-id="'+ lxc_name + '" rows="20" style="width:100%">'+ lxc_configuration +'</textarea> \
+                       <input data-id="bt_confirm" onclick="lxc_configure_handler(this)" type="button" class="cbi-button" value="Confirm" />'
+
+               return h
+       }
+
+       function action_more_handler(self)
+       {
+               var lxc_name = self.parentNode.parentNode.querySelector('[data-id]').getAttribute('data-id')
+               var loader = self.parentNode.parentNode.querySelector('[data-loader]')
+
+               var option = self.options[self.selectedIndex].text
+
+               self.value = "more"
+
+               switch (option)
+               {
+                       case "configure":
+                               var tr = document.createElement('tr')
+                               var row = self.parentNode.parentNode
+                               var next_row = row.nextSibling
+                               if (next_row && next_row.getAttribute('data-action') !== null)
+                                       row.parentNode.removeChild(next_row)
+
+                               new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_configuration_get/' + lxc_name, null,
+                               function(x)
+                               {
+                                       tr.innerHTML="<td colspan='" + row.cells.length + "'>" + lxc_configure_template(lxc_name, x.responseText) + "</td>"
+                                       tr.setAttribute('data-action','')
+                                       row.parentNode.insertBefore(tr, row.nextSibling)
+                               })
+
+                       break
+
+                       case "freeze":
+                               var tr = self.parentNode.parentNode
+                               var img = tr.querySelector('img')
+                               if(img.getAttribute('src') != window.img["green"])
+                                       return info_message(output_list,"Container is not running!")
+
+                               loading(loader)
+                               new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(option, lxc_name), null,
+                               function(x, ec)
+                               {
+                                       loading(loader, 0)
+                                       if (!x || ec)
+                                               return info_message(output_list,"Action failed!")
+
+                                       set_status(img, "purple")
+                               })
+
+                       break
+
+                       case "unfreeze":
+                               var tr = self.parentNode.parentNode
+                               var img = tr.querySelector('img')
+
+                               if(img.getAttribute('src') != window.img["purple"])
+                                       return info_message(output_list,"Container is not frozen!")
+
+                               loading(loader)
+                               new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(option, lxc_name), null,
+                               function(x, ec)
+                               {
+                                       loading(loader, 0)
+                                       if (!x || ec)
+                                               return info_message(output_list,"Action failed!")
+
+                                       set_status(img, "green")
+                               })
+
+                       break
+
+                       case "reboot":
+                               var tr = self.parentNode.parentNode
+                               var img = tr.querySelector('img')
+                               if(img.getAttribute('src') != window.img["green"])
+                                       return info_message(output_list,"Container is not running!")
+
+                               if (!confirm("Are you sure?"))
+                                       return
+
+                               loading(loader)
+                               new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(option, lxc_name), null,
+                               function(x, ec)
+                               {
+                                       loading(loader, 0)
+                                       if (!x || ec)
+                                               return info_message(output_list,"Action failed!")
+
+                                       info_message(output_list,"LXC rebooted")
+                               })
+                       break
+               }
+
+       }
+
+       function set_empty(t_lxc_list)
+       {
+               if (document.getElementById('empty') !== null)
+                       return
+
+               var row_count = t_lxc_list.rows.length;
+               while(--row_count) t_lxc_list.deleteRow(row_count);
+
+               var row = t_lxc_list.insertRow(-1);
+               row.id = 'empty'
+               var cell = row.insertCell(0);
+               cell.colSpan = 4;
+               cell.innerHTML = '<em><br />There are no containers available yet.</em>';
+       }
+
+       function lxc_list_update()
+       {
+               XHR.poll(4, '<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/list', null,
+               function(x, data)
+               {
+                       if (!x) return;
+
+                       var lxc_count = Object.keys(data).length
+                       if (!data || !lxc_count)
+                               return set_empty(t_lxc_list)
+
+                       if (document.getElementById('empty') !== null)
+                               t_lxc_list.deleteRow(1);
+
+                       var lxcs = t_lxc_list.querySelectorAll('td[data-id]')
+                       var lxc_name_table = {}
+                       for (var i = 0, len = lxcs.length; i < len; i++)
+                       {
+                               var lxc_name = lxcs[i].getAttribute('data-id')
+                               if (!(lxc_name in data))
+                               {
+                                       var row = t_lxc_list.querySelector("[data-id='" + lxc_name + "']").parentNode
+                                       row.parentNode.removeChild(row)
+                                       continue
+                               }
+
+                               lxc_name_table[lxc_name] = lxcs[i].parentNode.querySelector('img')
+                       }
+
+                       for(var key in data)
+                       {
+                               var lxc_name = key
+                               var state = window.states[data[key]]
+
+                               if (!(lxc_name in lxc_name_table))
+                                       lxc_create_template(lxc_name, state)
+
+                               else if (state != get_status(lxc_name_table[lxc_name]))
+                                       set_status(lxc_name_table[lxc_name], state)
+                       }
+
+               })
+       }
+
+       function loading(elem, state)
+       {
+               state = (typeof state === 'undefined') ? 1 : state
+
+               if (state === 1)
+                       elem.innerHTML = loader_html
+               else
+                       setTimeout(function() { elem.innerHTML = ''}, 1000)
+       }
+
+       function set_status(elem, state)
+       {
+               state = (typeof state === 'undefined') ? 1 : state
+
+               setTimeout(function() { elem.setAttribute('src', window.img[state])}, 300)
+       }
+
+       function get_status(elem)
+       {
+               var src = elem.getAttribute('src')
+
+               for (var i in img)
+               {
+                       if (img[i] == src)
+                               return i
+               }
+       }
+
+       function info_message(output, msg, timeout)
+       {
+               timeout = timeout || 3000
+               output.innerHTML = msg
+               clearTimeout(timeout_msg)
+               timeout_msg = setTimeout(function(){ output.innerHTML=""}, timeout);
+       }
+
+       lxc_list_update()
+//]]></script>
diff --git a/utils/luci-app-lxc/files/www/luci-static/resources/cbi/green.gif b/utils/luci-app-lxc/files/www/luci-static/resources/cbi/green.gif
new file mode 100644 (file)
index 0000000..d09febf
Binary files /dev/null and b/utils/luci-app-lxc/files/www/luci-static/resources/cbi/green.gif differ
diff --git a/utils/luci-app-lxc/files/www/luci-static/resources/cbi/purple.gif b/utils/luci-app-lxc/files/www/luci-static/resources/cbi/purple.gif
new file mode 100644 (file)
index 0000000..f0d68cc
Binary files /dev/null and b/utils/luci-app-lxc/files/www/luci-static/resources/cbi/purple.gif differ
diff --git a/utils/luci-app-lxc/files/www/luci-static/resources/cbi/red.gif b/utils/luci-app-lxc/files/www/luci-static/resources/cbi/red.gif
new file mode 100644 (file)
index 0000000..c1b39bb
Binary files /dev/null and b/utils/luci-app-lxc/files/www/luci-static/resources/cbi/red.gif differ
diff --git a/utils/lvm2/Makefile b/utils/lvm2/Makefile
new file mode 100644 (file)
index 0000000..c853b9c
--- /dev/null
@@ -0,0 +1,89 @@
+#
+# Copyright (C) 2009-2010 Stefan Monnier
+# Copyright (C) 2011-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v3+.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=LVM2
+PKG_VERSION:=2.02.114
+PKG_RELEASE:=1
+PKG_LICENSE:=GPL-2.0 LGPL-2.1
+
+PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=ftp://sources.redhat.com/pub/lvm2
+PKG_MD5SUM:=de826e0736070aed70148ea5ec0ecff9
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libdevmapper
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=The Linux Kernel Device Mapper userspace library
+  URL:=http://sourceware.org/dm/
+  DEPENDS:=+kmod-dm +libpthread
+endef
+
+define Package/libdevmapper/description
+ The device-mapper is a component of the 2.6 linux kernel that supports logical
+ volume management. It is required by LVM2 and EVMS.
+endef
+
+define Package/lvm2
+  SECTION:=utils
+  CATEGORY:=Utilities
+  SUBMENU:=disc
+  TITLE:=The Linux Logical Volume Manager
+  URL:=http://sourceware.org/lvm2/
+  DEPENDS:=+libdevmapper +libblkid +libreadline +libncurses
+endef
+
+define Package/lvm2/description
+ LVM2 refers to a new userspace toolset that provide logical volume management
+ facilities on linux. It is reasonably backwards-compatible with the original
+ LVM toolset.
+endef
+
+CONFIGURE_ARGS += --disable-o_direct
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               install
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/libdevmapper.h $(1)/usr/include
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdevmapper.so* $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_BUILD_DIR)/libdm/libdevmapper.pc $(1)/usr/lib/pkgconfig
+endef
+
+define Package/libdevmapper/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libdevmapper.so.* $(1)/usr/lib
+endef
+
+define Package/lvm2/install
+       $(INSTALL_DIR) $(1)/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/lvm $(1)/sbin
+       $(INSTALL_DIR) $(1)/etc/lvm
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/example.conf $(1)/etc/lvm/lvm.conf
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/lvm2.init $(1)/etc/init.d/lvm2
+endef
+
+define Package/lvm2/conffiles
+/etc/lvm/lvm.conf
+endef
+
+$(eval $(call BuildPackage,libdevmapper))
+$(eval $(call BuildPackage,lvm2))
diff --git a/utils/lvm2/files/lvm2.init b/utils/lvm2/files/lvm2.init
new file mode 100644 (file)
index 0000000..3b542d0
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2009 Stefan Monnier
+START=15
+
+start () {
+   /sbin/lvm vgscan --ignorelockingfailure --mknodes || :
+   /sbin/lvm vgchange -aly --ignorelockingfailure || return 2
+}
+
+stop () {
+    /sbin/lvm vgchange -aln --ignorelockingfailure || return 2
+}
diff --git a/utils/lvm2/patches/000-compile.patch b/utils/lvm2/patches/000-compile.patch
new file mode 100644 (file)
index 0000000..9fa1c1d
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/make.tmpl.in
++++ b/make.tmpl.in
+@@ -19,7 +19,7 @@ SHELL = /bin/sh
+ # Allow environment to override any built-in default value for CC.
+ # If there is a built-in default, CC is NOT set to @CC@ here.
+-CC ?= @CC@
++CC = @CC@
+ # If $(CC) holds the usual built-in default value of 'cc' then replace it with
+ # the configured value.
diff --git a/utils/lvm2/patches/001-include_fix.patch b/utils/lvm2/patches/001-include_fix.patch
new file mode 100644 (file)
index 0000000..dc159c5
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/lib/device/dev-type.c
++++ b/lib/device/dev-type.c
+@@ -22,7 +22,7 @@
+ #include <ctype.h>
+ #ifdef BLKID_WIPING_SUPPORT
+-#include <blkid.h>
++#include <blkid/blkid.h>
+ #endif
+ #include "device-types.h"
index c52ba532ed9a9b53f2e001c9a15f2a7c1dc0fa16..37286bfab4f30f54829c0208620bfb5d135c05c7 100644 (file)
@@ -12,4 +12,19 @@ config LXC_KERNEL_OPTIONS
          include cgroups, namespaces and other miscellaneous options. These
          options unfortunately can not be installed as a module.
 
+config LXC_BUSYBOX_OPTIONS
+       bool "Enable busybox support for lxc-create tool"
+       default n
+       select BUSYBOX_CUSTOM
+       select BUSYBOX_CONFIG_HAVE_DOT_CONFIG
+       select BUSYBOX_CONFIG_FEATURE_SEAMLESS_XZ
+       select BUSYBOX_CONFIG_FEATURE_TAR_LONG_OPTIONS
+       select BUSYBOX_CONFIG_UNXZ
+       select BUSYBOX_CONFIG_XZ
+       select BUSYBOX_CONFIG_GETOPT
+       select BUSYBOX_CONFIG_FEATURE_GETOPT_LONG
+       help
+         Select needed busybox options for lxc-create utility. This include XZ tar
+         compression, long option support for tar and built-in getopt support.
+
 endmenu
index 97d79835ead49967de3d0ebcee44a766e86edd00..3adfd5de952e6aea6caaf4a460fadfb31b202e4e 100644 (file)
@@ -8,12 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lxc
-PKG_VERSION:=1.0.5
-PKG_RELEASE:=2
+PKG_VERSION:=1.0.6
+PKG_RELEASE:=1
+
+PKG_LICENSE:=LGPL-2.1+ BSD-2-Clause GPL-2.0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://linuxcontainers.org/downloads/
-PKG_MD5SUM:=9d9af9e9e69a831cd50b58d91c786013
+PKG_MD5SUM:=4aad3aee84b42faa194e44091d723a3b
 
 PKG_BUILD_DEPENDS:=lua
 PKG_BUILD_PARALLEL:=1
@@ -33,6 +35,8 @@ LXC_SCRIPTS += \
 
 DEPENDS_APPLETS = +libpthread +libcap +liblxc
 
+DEPENDS_create = +lxc-configs +lxc-hooks +lxc-templates
+DEPENDS_ls = +lxc-config
 DEPENDS_top = +lxc-lua +luafilesystem @BROKEN
 
 
@@ -73,7 +77,13 @@ endef
 define Package/lxc-templates
   $(call Package/lxc/Default)
   TITLE:=LXC virtual machine templates
-  DEPENDS:= lxc @BROKEN
+  DEPENDS:= lxc
+endef
+
+define Package/lxc-configs
+  $(call Package/lxc/Default)
+  TITLE:=LXC virtual machine common config files
+  DEPENDS:= lxc
 endef
 
 define Package/liblxc
@@ -155,16 +165,20 @@ define Package/lxc-common/install
        $(INSTALL_DIR) $(1)/etc/lxc/
        $(CP) \
                $(PKG_INSTALL_DIR)/etc/lxc/default.conf \
-               $(1)/etc/lxc/
+               $(1)/etc/lxc/default.conf
+
+       $(INSTALL_DIR) $(1)/etc/lxc/
+       $(CP) \
+               ./files/lxc.conf \
+               $(1)/etc/lxc/lxc.conf
+
+       $(INSTALL_DIR) $(1)/lxc/
 endef
 
 define Package/lxc-hooks/install
        $(INSTALL_DIR) $(1)/usr/share/lxc/hooks
        $(CP) \
-               $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/mountcgroups \
-               $(1)/usr/share/lxc/hooks/
-       $(CP) \
-               $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/mountecryptfsroot \
+               $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/* \
                $(1)/usr/share/lxc/hooks/
 endef
 
@@ -175,6 +189,13 @@ define Package/lxc-templates/install
                $(1)/usr/share/lxc/templates/
 endef
 
+define Package/lxc-configs/install
+       $(INSTALL_DIR) $(1)/usr/share/lxc/config/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/share/lxc/config/* \
+               $(1)/usr/share/lxc/config/
+endef
+
 define Package/liblxc/install
        $(INSTALL_DIR) $(1)/usr/lib/
        $(CP) \
@@ -221,9 +242,11 @@ endef
 $(eval $(call BuildPackage,lxc))
 $(eval $(call BuildPackage,lxc-common))
 $(eval $(call BuildPackage,lxc-hooks))
+$(eval $(call BuildPackage,lxc-configs))
 $(eval $(call BuildPackage,lxc-templates))
 $(eval $(call BuildPackage,liblxc))
 $(eval $(call BuildPackage,lxc-lua))
+$(eval $(call BuildPackage,lxc-init))
 $(foreach u,$(LXC_APPLETS_BIN),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/bin")))
 $(foreach u,$(LXC_APPLETS_LIB),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/lib/lxc")))
 $(foreach u,$(LXC_SCRIPTS),$(eval $(call GenPlugin,$(u),,"/usr/bin")))
diff --git a/utils/lxc/files/lxc.conf b/utils/lxc/files/lxc.conf
new file mode 100644 (file)
index 0000000..3b77baa
--- /dev/null
@@ -0,0 +1 @@
+lxc.lxcpath = /lxc
diff --git a/utils/lxc/patches/025-remove-unsupported-option.patch b/utils/lxc/patches/025-remove-unsupported-option.patch
new file mode 100644 (file)
index 0000000..f70d49d
--- /dev/null
@@ -0,0 +1,19 @@
+--- a/templates/lxc-download.in
++++ b/templates/lxc-download.in
+@@ -479,15 +479,7 @@ fi
+ # Unpack the rootfs
+ echo "Unpacking the rootfs"
+-EXCLUDES=""
+-excludelist=$(relevant_file excludes)
+-if [ -f "${excludelist}" ]; then
+-    while read line; do
+-        EXCLUDES="$EXCLUDES --exclude=$line"
+-    done < $excludelist
+-fi
+-
+-tar  --anchored ${EXCLUDES} --numeric-owner -xpJf \
++tar --numeric-owner -xpJf \
+     ${LXC_CACHE_PATH}/rootfs.tar.xz -C ${LXC_ROOTFS}
+ mkdir -p ${LXC_ROOTFS}/dev/pts/
diff --git a/utils/lxc/patches/300-fix-lxc-destroy.patch b/utils/lxc/patches/300-fix-lxc-destroy.patch
new file mode 100644 (file)
index 0000000..2192c5f
--- /dev/null
@@ -0,0 +1,48 @@
+From bdeafb7bc4857e80dbca5192a751eedcf7b69abd Mon Sep 17 00:00:00 2001
+From: Luka Perkov <luka@openwrt.org>
+Date: Mon, 27 Oct 2014 21:49:46 +0100
+Subject: [PATCH] utils: remove unnecessary check of mystat.st_dev
+
+The check is not needed and it breaks lxc-destroy when container is installed
+on top of overlayfs. More information why this is a problem on overlayfs can be
+found here:
+
+https://kernel.googlesource.com/pub/scm/linux/kernel/git/mszeredi/vfs/+/overlayfs.current/Documentation/filesystems/overlayfs.txt
+
+Signed-off-by: Luka Perkov <luka@openwrt.org>
+---
+ src/lxc/utils.c | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+--- a/src/lxc/utils.c
++++ b/src/lxc/utils.c
+@@ -46,7 +46,7 @@
+ lxc_log_define(lxc_utils, lxc);
+-static int _recursive_rmdir_onedev(char *dirname, dev_t pdev)
++static int _recursive_rmdir_onedev(char *dirname)
+ {
+       struct dirent dirent, *direntp;
+       DIR *dir;
+@@ -82,10 +82,8 @@ static int _recursive_rmdir_onedev(char
+                       failed=1;
+                       continue;
+               }
+-              if (mystat.st_dev != pdev)
+-                      continue;
+               if (S_ISDIR(mystat.st_mode)) {
+-                      if (_recursive_rmdir_onedev(pathname, pdev) < 0)
++                      if (_recursive_rmdir_onedev(pathname) < 0)
+                               failed=1;
+               } else {
+                       if (unlink(pathname) < 0) {
+@@ -119,7 +117,7 @@ extern int lxc_rmdir_onedev(char *path)
+               return -1;
+       }
+-      return _recursive_rmdir_onedev(path, mystat.st_dev);
++      return _recursive_rmdir_onedev(path);
+ }
+ static int mount_fs(const char *source, const char *target, const char *type)
diff --git a/utils/lxc/patches/301-add-openwrt-common-config.patch b/utils/lxc/patches/301-add-openwrt-common-config.patch
new file mode 100644 (file)
index 0000000..6736d9b
--- /dev/null
@@ -0,0 +1,78 @@
+--- /dev/null
++++ b/config/templates/openwrt.common.conf.in
+@@ -0,0 +1,56 @@
++# Default mount entries
++lxc.mount.entry = proc proc proc nodev,noexec,nosuid 0 0
++lxc.mount.entry = sysfs sys sysfs defaults 0 0
++
++# Default console settings
++lxc.devttydir = lxc
++lxc.tty = 4
++lxc.pts = 1024
++
++# Default capabilities
++lxc.cap.drop = mac_admin
++lxc.cap.drop = mac_override
++lxc.cap.drop = sys_admin
++lxc.cap.drop = sys_module
++lxc.cap.drop = sys_nice
++lxc.cap.drop = sys_pacct
++lxc.cap.drop = sys_ptrace
++lxc.cap.drop = sys_rawio
++lxc.cap.drop = sys_resource
++lxc.cap.drop = sys_time
++lxc.cap.drop = sys_tty_config
++lxc.cap.drop = syslog
++lxc.cap.drop = wake_alarm
++
++# Default cgroups - all denied except those whitelisted
++lxc.cgroup.devices.deny = a
++## /dev/null and zero
++lxc.cgroup.devices.allow = c 1:3 rwm
++lxc.cgroup.devices.allow = c 1:5 rwm
++## consoles
++lxc.cgroup.devices.allow = c 5:0 rwm
++lxc.cgroup.devices.allow = c 5:1 rwm
++## /dev/{,u}random
++lxc.cgroup.devices.allow = c 1:8 rwm
++lxc.cgroup.devices.allow = c 1:9 rwm
++## /dev/pts/*
++lxc.cgroup.devices.allow = c 5:2 rwm
++lxc.cgroup.devices.allow = c 136:* rwm
++## rtc
++lxc.cgroup.devices.allow = c 254:0 rm
++## fuse
++lxc.cgroup.devices.allow = c 10:229 rwm
++## tun
++lxc.cgroup.devices.allow = c 10:200 rwm
++## dev/tty0
++lxc.cgroup.devices.allow = c 4:0 rwm
++## dev/tty1
++lxc.cgroup.devices.allow = c 4:1 rwm
++
++## To use loop devices, copy the following line to the container's
++## configuration file (uncommented).
++#lxc.cgroup.devices.allow = b 7:* rwm
++
++# Blacklist some syscalls which are not safe in privileged
++# containers
++lxc.seccomp = /usr/share/lxc/config/common.seccomp
+--- a/configure.ac
++++ b/configure.ac
+@@ -579,6 +579,7 @@ AC_CONFIG_FILES([
+       config/templates/ubuntu.common.conf
+       config/templates/ubuntu.lucid.conf
+       config/templates/ubuntu.userns.conf
++      config/templates/openwrt.common.conf
+       config/yum/Makefile
+       doc/Makefile
+--- a/config/templates/Makefile.am
++++ b/config/templates/Makefile.am
+@@ -22,4 +22,5 @@ templatesconfig_DATA = \
+       ubuntu-cloud.userns.conf \
+       ubuntu.common.conf \
+       ubuntu.lucid.conf \
+-      ubuntu.userns.conf
++      ubuntu.userns.conf \
++      openwrt.common.conf
diff --git a/utils/mc/Config.in b/utils/mc/Config.in
new file mode 100644 (file)
index 0000000..1445aa1
--- /dev/null
@@ -0,0 +1,60 @@
+menu "Configuration"
+       depends on PACKAGE_mc
+
+config MC_DIFFVIEWER
+       bool "Enable internal diff viewer"
+       default n
+       help
+           This option enables the built-in diff viewer.
+           Disabled by default.
+
+config MC_EDITOR
+       bool "Enable internal editor"
+       default n
+       help
+           This option enables the built-in file editor.
+           Disabled by default.
+
+config MC_SUBSHELL
+       bool "Enable concurrent subshell"
+       default n
+       help
+           This option enables concurrent subshell support.
+           Disabled by default.
+
+config MC_LARGEFILE
+       bool "Enable largefile support"
+       default n
+       help
+           This option enables support for large files (> 2 GB).
+           Disabled by default.
+
+config MC_BACKGROUND
+       bool "Enable background operations"
+       default n
+       help
+           This option enables support for background operations which
+           allow to perform some tasks such as copying files in a
+           separate background process. Background code is known
+           to be less stable than the rest of the code.
+           Disabled by default.
+
+config MC_CHARSET
+       bool "Enable charset support"
+       default n
+       help
+           This option adds support for selecting character set of the text in
+           the internal viewer and editor and converting it on the fly.
+           The implementation is currently incomplete.
+           Disabled by default.
+
+config MC_VFS
+       bool "Enable virtual filesystem support"
+       default n
+       help
+           This option enables the Virtual File System switch code to get
+           transparent access to the following file systems:
+           cpio, tar, fish, sfs, ftp, sftp, extfs, smb.
+           Disabled by default.
+
+endmenu
diff --git a/utils/mc/Makefile b/utils/mc/Makefile
new file mode 100644 (file)
index 0000000..1fb7bec
--- /dev/null
@@ -0,0 +1,122 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mc
+PKG_VERSION:=4.8.13
+PKG_RELEASE:=1.2
+PKG_MAINTAINER:=Dirk Brenken <dibdot@gmail.com>
+PKG_LICENSE:=GPL-3.0+
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://ftp.midnight-commander.org/
+PKG_MD5SUM:=d967caa12765eb86e52a6a63ca202500
+
+PKG_BUILD_PARALLEL:=1
+PKG_FIXUP:=autoreconf
+
+PKG_CONFIG_DEPENDS := \
+       CONFIG_PACKAGE_MC \
+       CONFIG_MC_DIFFVIEWER \
+       CONFIG_MC_EDITOR \
+       CONFIG_MC_SUBSHELL \
+       CONFIG_MC_LARGEFILE \
+       CONFIG_MC_BACKGROUND \
+       CONFIG_MC_CHARSET \
+       CONFIG_MC_VFS
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/mc
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+glib2 +libncurses +MC_VFS:libssh2 $(LIBRPC_DEPENDS) $(ICONV_DEPENDS)
+  TITLE:=Midnight Commander - a powerful visual file manager
+  URL:=http://www.midnight-commander.org/
+  MENU:=1
+endef
+
+define Package/mc/config
+       source "$(SOURCE)/Config.in"
+endef
+
+define Package/mc/description
+ GNU Midnight Commander is a visual file manager,
+ licensed under GNU General Public License and therefore qualifies as Free Software.
+ It's a feature rich full-screen text mode application that allows you to copy,
+ move and delete files and whole directory trees, search for files
+ and run commands in the subshell. Internal viewer and editor are included.
+endef
+
+CONFIGURE_ARGS += \
+       --disable-doxygen-doc \
+       --with-screen=ncurses \
+       --without-gpm-mouse \
+       --without-x \
+
+CONFIGURE_VARS += \
+       ac_cv_search_addwstr=no \
+
+ifeq ($(CONFIG_MC_DIFFVIEWER),)
+CONFIGURE_ARGS += \
+       --without-diff-viewer
+endif
+
+ifeq ($(CONFIG_MC_EDITOR),)
+CONFIGURE_ARGS += \
+       --without-internal-edit
+endif
+
+ifeq ($(CONFIG_MC_SUBSHELL),)
+CONFIGURE_ARGS += \
+       --without-subshell
+endif
+
+ifeq ($(CONFIG_MC_LARGEFILE),)
+CONFIGURE_ARGS += \
+       --disable-largefile
+endif
+
+ifeq ($(CONFIG_MC_BACKGROUND),)
+CONFIGURE_ARGS += \
+       --disable-background
+endif
+
+ifeq ($(CONFIG_MC_CHARSET),)
+CONFIGURE_ARGS += \
+       --disable-charset
+endif
+
+ifeq ($(CONFIG_MC_VFS),)
+CONFIGURE_ARGS += \
+       --disable-vfs
+endif
+
+define Package/mc/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mc $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/etc/mc
+ifeq ($(CONFIG_MC_DIFFVIEWER),y)
+       ln -sf mc $(1)/usr/bin/mcdiff
+endif
+ifeq ($(CONFIG_MC_EDITOR),y)
+       ln -sf mc $(1)/usr/bin/mcedit
+endif
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/misc/mc.menu $(1)/etc/mc
+       $(INSTALL_DIR) $(1)/etc/mc/skins
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/misc/skins/default.ini $(1)/etc/mc/skins
+       $(INSTALL_DIR) $(1)/root/.mc/cedit/Syntax
+endef
+
+define Package/mc/conffiles
+/etc/mc/mc.menu
+/etc/mc/skins/default.ini
+endef
+
+$(eval $(call BuildPackage,mc))
diff --git a/utils/mpack/Makefile b/utils/mpack/Makefile
new file mode 100644 (file)
index 0000000..c2b77eb
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mpack
+PKG_VERSION:=1.6
+PKG_RELEASE:=1
+PKG_LICENSE:=NLPL
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://ftp.andrew.cmu.edu/pub/mpack/
+PKG_MD5SUM:=a70fa5afa76539a9afb70b9d81568fe8
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/mpack
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=mpack/munpack MIME format mail messages
+  URL:=http://ftp.andrew.cmu.edu/pub/mpack/
+  MAINTAINER:=Dmitry V. Zimin <pfzim@mail.ru>
+endef
+
+define Package/mpack/description
+  Mpack and munpack are utilities for encoding and decoding
+  (respectively) binary files in MIME (Multipurpose Internet Mail
+  Extensions) format mail messages.  For compatibility with older forms
+  of transferring binary files, the munpack program can also decode
+  messages in split-uuencoded format.
+endef
+
+define Package/mpack/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,mpack))
+
index c1fddff16e47bc9496ad7a1f91c099ca0ea5f170..3d87b7d0a748c5d49b43c8e39b841fd1e6289a9b 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=http://www.tuxera.com/opensource/
 PKG_MD5SUM:=f11d563816249d730a00498983485f3a
 
 PKG_LICENSE:=GPL-2.0 LGPL-2.0
-PKG_LICENSE_FILE:=COPYING COPYING.LIB
+PKG_LICENSE_FILES:=COPYING COPYING.LIB
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
diff --git a/utils/open-plc-utils/Makefile b/utils/open-plc-utils/Makefile
new file mode 100644 (file)
index 0000000..c7e19f1
--- /dev/null
@@ -0,0 +1,103 @@
+#
+# Copyright (C) 2013-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=open-plc-utils
+PKG_VERSION:=2013-01-29
+PKG_RELEASE:=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://github.com/qca/open-plc-utils.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=6beeb6fe6ce2b16b14284c26e1b9220b68044591
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
+
+PKG_LICENSE:=ISC
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/open-plc-utils/Default
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Qualcomm Atheros Power Line Communication utilities
+  URL:=https://github.com/qca/open-plc-utils/blob/master/README
+endef
+
+define Package/open-plc-utils
+  $(call Package/open-plc-utils/Default)
+  MENU:=1
+endef
+
+define GenPlugin
+  define Package/$(addprefix open-plc-utils-,$(1))
+    $(call Package/open-plc-utils/Default)
+    DEPENDS:=open-plc-utils
+    TITLE:=Utility $(2) from the Open PLC utilities
+  endef
+
+   define Package/$(addprefix open-plc-utils-,$(1))/description
+     Utility $(2) from the Open PLC utilities package.
+   endef
+endef
+
+OPEN_PLC_UTILS_APPS:=efbu efeu efru efsu edru edsu nics \
+                    hpavkey hpavkeys rkey mac2pw mac2pwd \
+                    mdioblock mdioblock2 mdiodump mdiogen \
+                    hpav mme \
+                    chknvm chknvm2 nvmsplit nvmmerge \
+                    chkpib chkpib2 setpib getpib modpib pib2xml \
+                    pibcomp pibdump pibruin xml2pib psin psout pskey \
+                    psgraph psnotch pibrump \
+                    int6k int6kboot int6keth int6kf int6khost \
+                    int64host int6kid int6klist int6klog int6kmdio \
+                    int6kmdio2 int6kmod int6kstat int6ktest int6krate \
+                    int6krule int6ktone int6kwait CMEncrypt sada \
+                    coqos_add coqos_info coqos_man coqos_mod coqos_rel \
+                    mdustats ampboot amphost ampID amplist amprate \
+                    ampstat amptest amptool amptone ampwait \
+                    plcboot plchost plcID plclist plcrate plcrule \
+                    plcstat plctest plctool plctone \
+                    plcwait plchostd plcget plcset plcotst plcfwd \
+                    plcdevs plclog plcmdio16 plcmdio32 \
+                    config2cfg sdram \
+                    int6kuart int6kbaud ttysig ptsctl weeder ttysend \
+                    ttyrecv ttycat int6kdetect
+
+$(foreach a,$(OPEN_PLC_UTILS_APPS),$(eval $(call GenPlugin,$(a))))
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               EXTRA_CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
+               LDFLAGS="$(TARGET_CFLAGS) $(TARGET_LDFLAGS)" \
+               CROSS="$(TARGET_CROSS)" \
+               ROOTFS="$(PKG_INSTALL_DIR)" \
+               OWNER="$(shell id -u $(shell whoami))" \
+               GROUP="$(shell id -g $(shell whoami))" \
+               all install
+endef
+
+define Package/open-plc-utils/install
+endef
+
+define BuildPlugin
+  define Package/$(1)/install
+       $(INSTALL_DIR) $$(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/bin/$(subst open-plc-utils-,,$(1)) \
+               $$(1)/usr/bin/
+  endef
+
+  $$(eval $$(call BuildPackage,$(1)))
+endef
+
+$(eval $(call BuildPackage,open-plc-utils))
+$(foreach a,$(OPEN_PLC_UTILS_APPS),$(eval $(call BuildPlugin,open-plc-utils-$(a))))
index f17357055f0eb5d8a0991b36b11f2f4d9ae0fb5a..a7b8301490fe90bdbc2d07a3da5c2d99c01c7f59 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=opensc
-PKG_VERSION:=20140317
+PKG_VERSION:=20141126
 PKG_RELEASE:=1
 PKG_LICENSE:=LGPL-2.1+
 PKG_LICENSE_FILES:=COPYING
@@ -19,7 +19,7 @@ PKG_RELEASE=$(PKG_SOURCE_VERSION)
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/OpenSC/OpenSC.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=de6d61405b271e22244376e4817e16b49018e1ce
+PKG_SOURCE_VERSION:=8aadbbd678730dbafb819382da553439887499fd
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_BUILD_DEPENDS:=+libpcsclite
 PKG_FIXUP:=libtool
index 0d79422ca0b81d4c5c9876b694b9e53c546b6294..08b2a8324a386474345b1d0cd1c66804b524f83f 100644 (file)
@@ -1,18 +1,18 @@
-From c706491fc9b08d4cc6d7b254cf936d6b8d8691bc Mon Sep 17 00:00:00 2001
+From 471b40173b73f213ee72bf05735abf3357658197 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  <ng.hong.quan@gmail.com>
 Date: Wed, 20 Feb 2013 11:54:30 +0700
-Subject: [PATCH 01/18] OpenPGP: Detect and support Gnuk Token.
+Subject: [PATCH 01/26] OpenPGP: Detect and support Gnuk Token.
 
 http://www.fsij.org/gnuk/
 ---
  src/libopensc/card-openpgp.c | 61 ++++++++++++++++++++++++++++++++++----------
  src/libopensc/cards.h        |  1 +
- src/tools/openpgp-tool.c     |  9 +++++--
- 3 files changed, 56 insertions(+), 15 deletions(-)
+ src/tools/openpgp-tool.c     |  7 ++++-
+ 3 files changed, 55 insertions(+), 14 deletions(-)
 
 diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 743e79c..716052b 100644
+index 6774fe1..c785a55 100644
 --- a/src/libopensc/card-openpgp.c
 +++ b/src/libopensc/card-openpgp.c
 @@ -43,6 +43,7 @@
@@ -66,7 +66,7 @@ index 743e79c..716052b 100644
                                priv->ext_caps |= EXT_CAP_SM;
  
                        if ((priv->bcd_version >= OPENPGP_CARD_2_0) && (blob->len >= 10)) {
-@@ -1055,12 +1060,18 @@ static int
+@@ -1057,12 +1062,18 @@ static int
  pgp_get_pubkey(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
  {
        sc_apdu_t       apdu;
@@ -86,7 +86,7 @@ index 743e79c..716052b 100644
        apdu.lc = 2;
        apdu.data = ushort2bebytes(idbuf, tag);
        apdu.datalen = 2;
-@@ -1152,6 +1163,7 @@ pgp_put_data(sc_card_t *card, unsigned int tag, const u8 *buf, size_t buf_len)
+@@ -1154,6 +1165,7 @@ pgp_put_data(sc_card_t *card, unsigned int tag, const u8 *buf, size_t buf_len)
        u8 ins = 0xDA;
        u8 p1 = tag >> 8;
        u8 p2 = tag & 0xFF;
@@ -94,7 +94,7 @@ index 743e79c..716052b 100644
        int r;
  
        LOG_FUNC_CALLED(card->ctx);
-@@ -1193,13 +1205,17 @@ pgp_put_data(sc_card_t *card, unsigned int tag, const u8 *buf, size_t buf_len)
+@@ -1195,13 +1207,17 @@ pgp_put_data(sc_card_t *card, unsigned int tag, const u8 *buf, size_t buf_len)
  
        /* Build APDU */
        if (buf != NULL && buf_len > 0) {
@@ -114,7 +114,7 @@ index 743e79c..716052b 100644
                apdu.datalen = buf_len;
                apdu.lc = buf_len;
        }
-@@ -1326,6 +1342,7 @@ pgp_compute_signature(sc_card_t *card, const u8 *data,
+@@ -1328,6 +1344,7 @@ pgp_compute_signature(sc_card_t *card, const u8 *data,
        struct pgp_priv_data    *priv = DRVDATA(card);
        sc_security_env_t       *env = &priv->sec_env;
        sc_apdu_t               apdu;
@@ -122,7 +122,7 @@ index 743e79c..716052b 100644
        int                     r;
  
        LOG_FUNC_CALLED(card->ctx);
-@@ -1334,14 +1351,19 @@ pgp_compute_signature(sc_card_t *card, const u8 *data,
+@@ -1336,14 +1353,19 @@ pgp_compute_signature(sc_card_t *card, const u8 *data,
                LOG_TEST_RET(card->ctx, SC_ERROR_INVALID_ARGUMENTS,
                                "invalid operation");
  
@@ -144,7 +144,7 @@ index 743e79c..716052b 100644
                break;
        case 0x01:
        default:
-@@ -1350,7 +1372,7 @@ pgp_compute_signature(sc_card_t *card, const u8 *data,
+@@ -1352,7 +1374,7 @@ pgp_compute_signature(sc_card_t *card, const u8 *data,
        }
  
        apdu.lc = data_len;
@@ -153,7 +153,7 @@ index 743e79c..716052b 100644
        apdu.datalen = data_len;
        apdu.le = ((outlen >= 256) && !(card->caps & SC_CARD_CAP_APDU_EXT)) ? 256 : outlen;
        apdu.resp    = out;
-@@ -1374,6 +1396,7 @@ pgp_decipher(sc_card_t *card, const u8 *in, size_t inlen,
+@@ -1376,6 +1398,7 @@ pgp_decipher(sc_card_t *card, const u8 *in, size_t inlen,
        struct pgp_priv_data    *priv = DRVDATA(card);
        sc_security_env_t       *env = &priv->sec_env;
        sc_apdu_t       apdu;
@@ -161,7 +161,7 @@ index 743e79c..716052b 100644
        u8              *temp = NULL;
        int             r;
  
-@@ -1398,7 +1421,7 @@ pgp_decipher(sc_card_t *card, const u8 *in, size_t inlen,
+@@ -1400,7 +1423,7 @@ pgp_decipher(sc_card_t *card, const u8 *in, size_t inlen,
        case 0x01: /* Decryption key */
        case 0x02: /* authentication key */
                /* PSO DECIPHER */
@@ -170,7 +170,7 @@ index 743e79c..716052b 100644
                break;
        case 0x00: /* signature key */
        default:
-@@ -1407,8 +1430,13 @@ pgp_decipher(sc_card_t *card, const u8 *in, size_t inlen,
+@@ -1409,8 +1432,13 @@ pgp_decipher(sc_card_t *card, const u8 *in, size_t inlen,
                                "invalid key reference");
        }
  
@@ -209,10 +209,10 @@ index 743e79c..716052b 100644
                 * sc_format_apdu() */
                apdu_le = card->max_recv_size;
 diff --git a/src/libopensc/cards.h b/src/libopensc/cards.h
-index 0fbf9ca..01b08fd 100644
+index 7be6667..a3f3634 100644
 --- a/src/libopensc/cards.h
 +++ b/src/libopensc/cards.h
-@@ -104,6 +104,7 @@ enum {
+@@ -105,6 +105,7 @@ enum {
        SC_CARD_TYPE_OPENPGP_BASE = 9000,
        SC_CARD_TYPE_OPENPGP_V1,
        SC_CARD_TYPE_OPENPGP_V2,
@@ -221,27 +221,18 @@ index 0fbf9ca..01b08fd 100644
        /* jcop driver */
        SC_CARD_TYPE_JCOP_BASE = 10000,
 diff --git a/src/tools/openpgp-tool.c b/src/tools/openpgp-tool.c
-index 7058aaa..8b5e327 100644
+index f42e6d6..a24a395 100644
 --- a/src/tools/openpgp-tool.c
 +++ b/src/tools/openpgp-tool.c
-@@ -32,6 +32,7 @@
- #include "libopensc/asn1.h"
+@@ -33,6 +33,7 @@
  #include "libopensc/cards.h"
  #include "libopensc/cardctl.h"
+ #include "libopensc/errors.h"
 +#include "libopensc/log.h"
  #include "util.h"
+ #include "libopensc/log.h"
  
- #define       OPT_RAW         256
-@@ -216,7 +217,7 @@ static void display_data(const struct ef_name_map *mapping, char *value)
-                       } else {
-                               const char *label = mapping->name;
--                              printf("%s:%*s%s\n", label, 10-strlen(label), "", value);
-+                              printf("%s:%*s%s\n", label, 10 - (int)strlen(label), "", value);
-                       }
-               }
-       }
-@@ -390,6 +391,8 @@ int do_genkey(sc_card_t *card, u8 key_id, unsigned int key_len)
+@@ -396,6 +397,8 @@ int do_genkey(sc_card_t *card, u8 key_id, unsigned int key_len)
        sc_path_t path;
        sc_file_t *file;
  
@@ -250,7 +241,7 @@ index 7058aaa..8b5e327 100644
        if (key_id < 1 || key_id > 3) {
                printf("Unknown key ID %d.\n", key_id);
                return 1;
-@@ -481,8 +484,10 @@ int main(int argc, char **argv)
+@@ -487,8 +490,10 @@ int main(int argc, char **argv)
  
        /* check card type */
        if ((card->type != SC_CARD_TYPE_OPENPGP_V1) &&
@@ -263,5 +254,5 @@ index 7058aaa..8b5e327 100644
                goto out;
        }
 -- 
-1.9.3
+2.1.3
 
index cf8cae6d7350ee85202aa9365451253d82b2c8b2..c08a6e0a35b3b30a8cd0005f491621171abb2245 100644 (file)
@@ -1,8 +1,8 @@
-From ecc6460d17147b37def27a9b776e1fc5a61408d0 Mon Sep 17 00:00:00 2001
+From 00a2c08c9125103ee0bff9af9e7ff42c5cdc14fe Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  <ng.hong.quan@gmail.com>
 Date: Fri, 12 Apr 2013 17:24:00 +0700
-Subject: [PATCH 02/18] OpenPGP: Add Gnuk in pkcs15 emulation layer.
+Subject: [PATCH 02/26] OpenPGP: Add Gnuk in pkcs15 emulation layer.
 
 ---
  src/libopensc/pkcs15-openpgp.c | 6 ++++--
@@ -10,10 +10,10 @@ Subject: [PATCH 02/18] OpenPGP: Add Gnuk in pkcs15 emulation layer.
  2 files changed, 5 insertions(+), 2 deletions(-)
 
 diff --git a/src/libopensc/pkcs15-openpgp.c b/src/libopensc/pkcs15-openpgp.c
-index d9dc074..5a8a1ca 100644
+index 4daaa98..fdf720a 100644
 --- a/src/libopensc/pkcs15-openpgp.c
 +++ b/src/libopensc/pkcs15-openpgp.c
-@@ -155,7 +155,8 @@ sc_pkcs15emu_openpgp_init(sc_pkcs15_card_t *p15card)
+@@ -151,7 +151,8 @@ sc_pkcs15emu_openpgp_init(sc_pkcs15_card_t *p15card)
        u8              c4data[10];
        u8              c5data[70];
        int             r, i;
@@ -23,7 +23,7 @@ index d9dc074..5a8a1ca 100644
        sc_path_t path;
        sc_file_t *file;
  
-@@ -367,7 +368,8 @@ failed:    sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "Failed to initialize OpenPGP e
+@@ -363,7 +364,8 @@ failed:    sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "Failed to initialize OpenPGP e
  
  static int openpgp_detect_card(sc_pkcs15_card_t *p15card)
  {
@@ -34,17 +34,17 @@ index d9dc074..5a8a1ca 100644
        else
                return SC_ERROR_WRONG_CARD;
 diff --git a/src/libopensc/pkcs15-syn.c b/src/libopensc/pkcs15-syn.c
-index e2f6004..a9f8c0b 100644
+index ffbf642..d2c086c 100644
 --- a/src/libopensc/pkcs15-syn.c
 +++ b/src/libopensc/pkcs15-syn.c
-@@ -112,6 +112,7 @@ int sc_pkcs15_is_emulation_only(sc_card_t *card)
+@@ -115,6 +115,7 @@ int sc_pkcs15_is_emulation_only(sc_card_t *card)
                case SC_CARD_TYPE_GEMSAFEV1_PTEID:
                case SC_CARD_TYPE_OPENPGP_V1:
                case SC_CARD_TYPE_OPENPGP_V2:
 +              case SC_CARD_TYPE_OPENPGP_GNUK:
                case SC_CARD_TYPE_SC_HSM:
-                       return 1;
-               default:
+               case SC_CARD_TYPE_DNIE_BASE:
+               case SC_CARD_TYPE_DNIE_BLANK:
 -- 
-1.9.3
+2.1.3
 
index fa15d792c5878194c618363714d37d732346360e..9e96cfef62534e2bb0d9a595f2cbf4da7f038dfd 100644 (file)
@@ -1,8 +1,8 @@
-From 5f751ba5628f9d85e9d8dca9939a93f49d2525d0 Mon Sep 17 00:00:00 2001
+From 2d348b60ab8c22791b56f291600954abd716a791 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  <ng.hong.quan@gmail.com>
 Date: Fri, 22 Mar 2013 17:37:16 +0700
-Subject: [PATCH 03/18] OpenPGP: Include private DO to filesystem at driver
+Subject: [PATCH 03/26] OpenPGP: Include private DO to filesystem at driver
  initialization.
 
 In old implementation, the DOs which their access is restricted by
@@ -13,7 +13,7 @@ leading to that we cannot read their data later, even if we verified PIN.
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 716052b..ead07ae 100644
+index c785a55..1cc3923 100644
 --- a/src/libopensc/card-openpgp.c
 +++ b/src/libopensc/card-openpgp.c
 @@ -357,7 +357,7 @@ pgp_init(sc_card_t *card)
@@ -26,5 +26,5 @@ index 716052b..ead07ae 100644
                        child = pgp_new_blob(card, priv->mf, info->id, sc_file_new());
  
 -- 
-1.9.3
+2.1.3
 
index 114412f2298b05128a9de4a9334565ff272f5891..b6408de7f69aeb71e0a7b84e915b64f659102c80 100644 (file)
@@ -1,8 +1,8 @@
-From fbf8e392db4456de97796259a62ccb972fe24df8 Mon Sep 17 00:00:00 2001
+From fda9b6dd088e734de372fc85c091f88e8607bc2e Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  <ng.hong.quan@gmail.com>
 Date: Tue, 26 Feb 2013 17:37:16 +0700
-Subject: [PATCH 04/18] PKCS15-OpenPGP: Declare DATA objects.
+Subject: [PATCH 04/26] PKCS15-OpenPGP: Declare DATA objects.
 
 Begin to support read/write DATA object for PKCS-OpenPGP binding.
 This object is used by TrueCrypt.
@@ -11,18 +11,18 @@ This object is used by TrueCrypt.
  1 file changed, 35 insertions(+)
 
 diff --git a/src/libopensc/pkcs15-openpgp.c b/src/libopensc/pkcs15-openpgp.c
-index 5a8a1ca..9f239ef 100644
+index fdf720a..fea2805 100644
 --- a/src/libopensc/pkcs15-openpgp.c
 +++ b/src/libopensc/pkcs15-openpgp.c
-@@ -36,6 +36,7 @@ typedef USHORT ushort;
- #endif
+@@ -32,6 +32,7 @@
+ #include "log.h"
  
  int sc_pkcs15emu_openpgp_init_ex(sc_pkcs15_card_t *, sc_pkcs15emu_opt_t *);
 +static int sc_pkcs15emu_openpgp_add_data(sc_pkcs15_card_t *);
  
  
  #define       PGP_USER_PIN_FLAGS      (SC_PKCS15_PIN_FLAG_CASE_SENSITIVE \
-@@ -45,6 +46,8 @@ int sc_pkcs15emu_openpgp_init_ex(sc_pkcs15_card_t *, sc_pkcs15emu_opt_t *);
+@@ -41,6 +42,8 @@ int sc_pkcs15emu_openpgp_init_ex(sc_pkcs15_card_t *, sc_pkcs15emu_opt_t *);
                                | SC_PKCS15_PIN_FLAG_UNBLOCK_DISABLED \
                                | SC_PKCS15_PIN_FLAG_SO_PIN)
  
@@ -31,7 +31,7 @@ index 5a8a1ca..9f239ef 100644
  typedef struct _pgp_pin_cfg {
        const char      *label;
        int             reference;
-@@ -359,6 +362,9 @@ sc_pkcs15emu_openpgp_init(sc_pkcs15_card_t *p15card)
+@@ -355,6 +358,9 @@ sc_pkcs15emu_openpgp_init(sc_pkcs15_card_t *p15card)
                        goto failed;
        }
  
@@ -41,7 +41,7 @@ index 5a8a1ca..9f239ef 100644
        return 0;
  
  failed:       sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "Failed to initialize OpenPGP emulation: %s\n",
-@@ -366,6 +372,35 @@ failed:   sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "Failed to initialize OpenPGP e
+@@ -362,6 +368,35 @@ failed:   sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "Failed to initialize OpenPGP e
        return r;
  }
  
@@ -78,5 +78,5 @@ index 5a8a1ca..9f239ef 100644
  {
        if (p15card->card->type == SC_CARD_TYPE_OPENPGP_V1 || p15card->card->type == SC_CARD_TYPE_OPENPGP_V2
 -- 
-1.9.3
+2.1.3
 
index c28ed10cbf1216048c9ed06baeb30ef2a4687946..0dc4954629cafa421143c7166729cf7d707a784a 100644 (file)
@@ -1,20 +1,20 @@
-From 4cdc5f3102f5ad93d263eea2f8206bb5e9fffc6c Mon Sep 17 00:00:00 2001
+From 6d138f0199575516bfaad18cbbafcfa2ee61e58f Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  <ng.hong.quan@gmail.com>
 Date: Mon, 4 Mar 2013 11:28:08 +0700
-Subject: [PATCH 05/18] OpenPGP: Support erasing (reset) card.
+Subject: [PATCH 05/26] OpenPGP: Support erasing (reset) card.
 
 Command: openpgp-tool --erase
 ---
  src/libopensc/card-openpgp.c | 64 ++++++++++++++++++++++++++++++++++++++++++++
- src/tools/openpgp-tool.c     | 23 +++++++++++++++-
- 2 files changed, 86 insertions(+), 1 deletion(-)
+ src/tools/openpgp-tool.c     | 2++++++++++++++-
+ 2 files changed, 85 insertions(+), 1 deletion(-)
 
 diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index ead07ae..42a9684 100644
+index 1cc3923..7349876 100644
 --- a/src/libopensc/card-openpgp.c
 +++ b/src/libopensc/card-openpgp.c
-@@ -2197,6 +2197,66 @@ out:
+@@ -2195,6 +2195,66 @@ out:
  
  #endif /* ENABLE_OPENSSL */
  
@@ -81,7 +81,7 @@ index ead07ae..42a9684 100644
  /* ABI: card ctl: perform special card-specific operations */
  static int pgp_card_ctl(sc_card_t *card, unsigned long cmd, void *ptr)
  {
-@@ -2221,6 +2281,10 @@ static int pgp_card_ctl(sc_card_t *card, unsigned long cmd, void *ptr)
+@@ -2219,6 +2279,10 @@ static int pgp_card_ctl(sc_card_t *card, unsigned long cmd, void *ptr)
                LOG_FUNC_RETURN(card->ctx, r);
                break;
  #endif /* ENABLE_OPENSSL */
@@ -93,53 +93,52 @@ index ead07ae..42a9684 100644
  
        LOG_FUNC_RETURN(card->ctx, SC_ERROR_NOT_SUPPORTED);
 diff --git a/src/tools/openpgp-tool.c b/src/tools/openpgp-tool.c
-index 8b5e327..0d360a3 100644
+index a24a395..de1c9d4 100644
 --- a/src/tools/openpgp-tool.c
 +++ b/src/tools/openpgp-tool.c
-@@ -76,6 +76,7 @@ static int opt_verify = 0;
- static char *verifytype = NULL;
- static int opt_pin = 0;
+@@ -78,6 +78,7 @@ static int opt_pin = 0;
  static char *pin = NULL;
+ static int opt_dump_do = 0;
+ static u8 do_dump_idx;
 +static int opt_erase = 0;
  
  static const char *app_name = "openpgp-tool";
  
-@@ -92,6 +93,7 @@ static const struct option options[] = {
+@@ -94,6 +95,7 @@ static const struct option options[] = {
        { "help",      no_argument,       NULL, 'h'        },
        { "verbose",   no_argument,       NULL, 'v'        },
        { "version",   no_argument,       NULL, 'V'        },
 +      { "erase",     no_argument,       NULL, 'E'        },
        { "verify",    required_argument, NULL, OPT_VERIFY },
        { "pin",       required_argument, NULL, OPT_PIN },
-       { NULL, 0, NULL, 0 }
-@@ -110,6 +112,7 @@ static const char *option_help[] = {
+       { "do",        required_argument, NULL, 'd' },
+@@ -113,6 +115,7 @@ static const char *option_help[] = {
  /* h */       "Print this help message",
  /* v */       "Verbose operation. Use several times to enable debug output.",
  /* V */       "Show version number",
 +/* E */       "Erase (reset) the card",
        "Verify PIN (CHV1, CHV2, CHV3...)",
-       "PIN string"
- };
-@@ -228,7 +231,7 @@ static int decode_options(int argc, char **argv)
+       "PIN string",
+ /* d */ "Dump private data object number <arg> (i.e. PRIVATE-DO-<arg>)"
+@@ -232,7 +235,7 @@ static int decode_options(int argc, char **argv)
  {
        int c;
  
--      while ((c = getopt_long(argc, argv,"r:x:CUG:L:hwvV", options, (int *) 0)) != EOF) {
-+      while ((c = getopt_long(argc, argv,"r:x:CUG:L:hwvVE", options, (int *) 0)) != EOF) {
+-      while ((c = getopt_long(argc, argv,"r:x:CUG:L:hwvVd:", options, (int *) 0)) != EOF) {
++      while ((c = getopt_long(argc, argv,"r:x:CUG:L:hwvVd:E", options, (int *) 0)) != EOF) {
                switch (c) {
                case 'r':
                        opt_reader = optarg;
-@@ -288,6 +291,9 @@ static int decode_options(int argc, char **argv)
-                       show_version();
-                       exit(EXIT_SUCCESS);
-                       break;
+@@ -296,6 +299,8 @@ static int decode_options(int argc, char **argv)
+                       do_dump_idx = optarg[0] - '0';
+                       opt_dump_do++;
+                       actions++;
 +              case 'E':
 +                      opt_erase++;
-+                      break;
+                       break;
                default:
                        util_print_usage_and_die(app_name, options, option_help, NULL);
-               }
-@@ -446,6 +452,18 @@ int do_verify(sc_card_t *card, u8 *type, u8* pin)
+@@ -452,6 +457,18 @@ int do_verify(sc_card_t *card, char *type, char *pin)
        return r;
  }
  
@@ -158,7 +157,7 @@ index 8b5e327..0d360a3 100644
  int main(int argc, char **argv)
  {
        sc_context_t *ctx = NULL;
-@@ -521,6 +539,9 @@ int main(int argc, char **argv)
+@@ -531,6 +548,9 @@ int main(int argc, char **argv)
                exit(EXIT_FAILURE);
        }
  
@@ -169,5 +168,5 @@ index 8b5e327..0d360a3 100644
        sc_unlock(card);
        sc_disconnect_card(card);
 -- 
-1.9.3
+2.1.3
 
index f73cb22f5c2fc816a5e32d165e9a530e7b065cec..915f6842c0c42833a0ca8fa2f6430b9e03bc9dbc 100644 (file)
@@ -1,18 +1,18 @@
-From bbbedd3b358f80a7f98df2b22cf541cb007dd62e Mon Sep 17 00:00:00 2001
+From 469b6567d9adc4af6f49fa65534162673060454d Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  <ng.hong.quan@gmail.com>
 Date: Mon, 4 Mar 2013 18:13:03 +0700
-Subject: [PATCH 06/18] openpgp-tool: Support deleting key in Gnuk.
+Subject: [PATCH 06/26] openpgp-tool: Support deleting key in Gnuk.
 
 ---
- src/tools/openpgp-tool.c | 144 ++++++++++++++++++++++++++++++++++++++++++++++-
- 1 file changed, 143 insertions(+), 1 deletion(-)
+ src/tools/openpgp-tool.c | 142 +++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 142 insertions(+)
 
 diff --git a/src/tools/openpgp-tool.c b/src/tools/openpgp-tool.c
-index 0d360a3..239c86b 100644
+index de1c9d4..374819a 100644
 --- a/src/tools/openpgp-tool.c
 +++ b/src/tools/openpgp-tool.c
-@@ -39,6 +39,7 @@
+@@ -41,6 +41,7 @@
  #define       OPT_PRETTY      257
  #define       OPT_VERIFY      258
  #define       OPT_PIN     259
@@ -20,33 +20,31 @@ index 0d360a3..239c86b 100644
  
  /* define structures */
  struct ef_name_map {
-@@ -77,6 +78,7 @@ static char *verifytype = NULL;
- static int opt_pin = 0;
- static char *pin = NULL;
+@@ -79,6 +80,7 @@ static char *pin = NULL;
+ static int opt_dump_do = 0;
+ static u8 do_dump_idx;
  static int opt_erase = 0;
 +static int opt_delkey = 0;
  
  static const char *app_name = "openpgp-tool";
  
-@@ -96,6 +98,7 @@ static const struct option options[] = {
+@@ -98,6 +100,7 @@ static const struct option options[] = {
        { "erase",     no_argument,       NULL, 'E'        },
        { "verify",    required_argument, NULL, OPT_VERIFY },
        { "pin",       required_argument, NULL, OPT_PIN },
 +      { "del-key",   required_argument, NULL, OPT_DELKEY },
+       { "do",        required_argument, NULL, 'd' },
        { NULL, 0, NULL, 0 }
  };
-@@ -114,7 +117,8 @@ static const char *option_help[] = {
- /* V */       "Show version number",
+@@ -118,6 +121,7 @@ static const char *option_help[] = {
  /* E */       "Erase (reset) the card",
        "Verify PIN (CHV1, CHV2, CHV3...)",
--      "PIN string"
-+      "PIN string",
-+      "Delete key (1, 2, 3 or all)"
+       "PIN string",
++      "Delete key (1, 2, 3 or all)",
+ /* d */ "Dump private data object number <arg> (i.e. PRIVATE-DO-<arg>)"
  };
  
- static const struct ef_name_map openpgp_data[] = {
-@@ -294,6 +298,14 @@ static int decode_options(int argc, char **argv)
+@@ -302,6 +306,14 @@ static int decode_options(int argc, char **argv)
                case 'E':
                        opt_erase++;
                        break;
@@ -61,7 +59,7 @@ index 0d360a3..239c86b 100644
                default:
                        util_print_usage_and_die(app_name, options, option_help, NULL);
                }
-@@ -452,6 +464,133 @@ int do_verify(sc_card_t *card, u8 *type, u8* pin)
+@@ -457,6 +469,133 @@ int do_verify(sc_card_t *card, char *type, char *pin)
        return r;
  }
  
@@ -195,7 +193,7 @@ index 0d360a3..239c86b 100644
  int do_erase(sc_card_t *card)
  {
        int r;
-@@ -539,6 +678,9 @@ int main(int argc, char **argv)
+@@ -548,6 +687,9 @@ int main(int argc, char **argv)
                exit(EXIT_FAILURE);
        }
  
@@ -206,5 +204,5 @@ index 0d360a3..239c86b 100644
                exit_status != do_erase(card);
  
 -- 
-1.9.3
+2.1.3
 
index 1d487af32dde4ca8345e5827f8c7ad5385eb671d..7d8045679b931a22407d190016400377ab907115 100644 (file)
@@ -1,8 +1,8 @@
-From b6bc7a497e1fe20104f923de1092a35d137ba553 Mon Sep 17 00:00:00 2001
+From d210faa377bcec63876f84b82540b110ede16e57 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  <ng.hong.quan@gmail.com>
 Date: Mon, 4 Mar 2013 18:14:51 +0700
-Subject: [PATCH 07/18] OpenPGP: Correct building Extended Header List when
+Subject: [PATCH 07/26] OpenPGP: Correct building Extended Header List when
  importing keys.
 
 ---
@@ -10,10 +10,10 @@ Subject: [PATCH 07/18] OpenPGP: Correct building Extended Header List when
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 42a9684..47c1938 100644
+index 7349876..91c311b 100644
 --- a/src/libopensc/card-openpgp.c
 +++ b/src/libopensc/card-openpgp.c
-@@ -1978,7 +1978,7 @@ pgp_build_extended_header_list(sc_card_t *card, sc_cardctl_openpgp_keystore_info
+@@ -1977,7 +1977,7 @@ pgp_build_extended_header_list(sc_card_t *card, sc_cardctl_openpgp_keystore_info
        u8 *p = NULL;
        u8 *components[] = {key_info->e, key_info->p, key_info->q, key_info->n};
        size_t componentlens[] = {key_info->e_len, key_info->p_len, key_info->q_len, key_info->n_len};
@@ -23,5 +23,5 @@ index 42a9684..47c1938 100644
                "public exponent",
                "prime p",
 -- 
-1.9.3
+2.1.3
 
index 25a69d4cb61ad2841112d633caa24731ca61431a..17aaf92ca9edc1cdb9730c0c4f8c2ecf6aaeb66a 100644 (file)
@@ -1,8 +1,8 @@
-From d1b8d3588336abac4876c1d537d8e8e5e578bc02 Mon Sep 17 00:00:00 2001
+From df98874784a77c96a7a1be54412a02a53fdd3a3e Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  <ng.hong.quan@gmail.com>
 Date: Mon, 25 Mar 2013 11:58:38 +0700
-Subject: [PATCH 08/18] OpenPGP: Read some empty DOs from Gnuk.
+Subject: [PATCH 08/26] OpenPGP: Read some empty DOs from Gnuk.
 
 In Gnuk, some empty DOs are returned as not exist, instead of existing with empty value.
 So, we will consider them exist in driver.
@@ -11,10 +11,10 @@ So, we will consider them exist in driver.
  1 file changed, 25 insertions(+)
 
 diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 47c1938..9b08bbb 100644
+index 91c311b..e7b25c0 100644
 --- a/src/libopensc/card-openpgp.c
 +++ b/src/libopensc/card-openpgp.c
-@@ -813,6 +813,23 @@ pgp_get_blob(sc_card_t *card, struct blob *blob, unsigned int id,
+@@ -815,6 +815,23 @@ pgp_get_blob(sc_card_t *card, struct blob *blob, unsigned int id,
                }
        }
  
@@ -38,7 +38,7 @@ index 47c1938..9b08bbb 100644
        return SC_ERROR_FILE_NOT_FOUND;
  }
  
-@@ -1147,6 +1164,14 @@ pgp_get_data(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
+@@ -1149,6 +1166,14 @@ pgp_get_data(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
        LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
  
        r = sc_check_sw(card, apdu.sw1, apdu.sw2);
@@ -54,5 +54,5 @@ index 47c1938..9b08bbb 100644
  
        LOG_FUNC_RETURN(card->ctx, apdu.resplen);
 -- 
-1.9.3
+2.1.3
 
index 5abf6f8db23e9a761feb6a05df22ec4854d63c2f..a75a2c2ce6ab6dc90d2c804828cfde38d9452dfc 100644 (file)
@@ -1,8 +1,8 @@
-From 6a4457cde65ef44f05b0689415ae7165b06fb8bf Mon Sep 17 00:00:00 2001
+From 42adc35954e18e24f253f710b16d850d1872bce5 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  <ng.hong.quan@gmail.com>
 Date: Wed, 27 Mar 2013 11:38:42 +0700
-Subject: [PATCH 09/18] PKCS15-OpenPGP: Do not show empty DO in pkcs15
+Subject: [PATCH 09/26] PKCS15-OpenPGP: Do not show empty DO in pkcs15
  emu_init.
 
 ---
@@ -10,10 +10,10 @@ Subject: [PATCH 09/18] PKCS15-OpenPGP: Do not show empty DO in pkcs15
  1 file changed, 18 insertions(+)
 
 diff --git a/src/libopensc/pkcs15-openpgp.c b/src/libopensc/pkcs15-openpgp.c
-index 9f239ef..850dd74 100644
+index fea2805..51a2032 100644
 --- a/src/libopensc/pkcs15-openpgp.c
 +++ b/src/libopensc/pkcs15-openpgp.c
-@@ -385,16 +385,34 @@ sc_pkcs15emu_openpgp_add_data(sc_pkcs15_card_t *p15card)
+@@ -381,16 +381,34 @@ sc_pkcs15emu_openpgp_add_data(sc_pkcs15_card_t *p15card)
                sc_pkcs15_object_t dat_obj;
                char name[8];
                char path[9];
@@ -49,5 +49,5 @@ index 9f239ef..850dd74 100644
                r = sc_pkcs15emu_add_data_object(p15card, &dat_obj, &dat_info);
        }
 -- 
-1.9.3
+2.1.3
 
index a3c75309c903afd4dc801f2d5840b26e574edecd..7b0f493ccbd663f12729ff6f6e54945341e6b06f 100644 (file)
@@ -1,8 +1,8 @@
-From 88ded8fc5802c073caa71b649cee5a3116699b2a Mon Sep 17 00:00:00 2001
+From f085e6a5f386875b5b071ef3bf115e4d9bb33bdb Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  <ng.hong.quan@gmail.com>
 Date: Wed, 27 Mar 2013 11:39:33 +0700
-Subject: [PATCH 10/18] PKCS15-OpenPGP: Allow to store data to pkcs15 data
+Subject: [PATCH 10/26] PKCS15-OpenPGP: Allow to store data to pkcs15 data
  object.
 
 Only one DO is supported now.
@@ -12,10 +12,10 @@ Only one DO is supported now.
  2 files changed, 38 insertions(+), 2 deletions(-)
 
 diff --git a/src/libopensc/pkcs15-openpgp.c b/src/libopensc/pkcs15-openpgp.c
-index 850dd74..b701041 100644
+index 51a2032..4cc1c39 100644
 --- a/src/libopensc/pkcs15-openpgp.c
 +++ b/src/libopensc/pkcs15-openpgp.c
-@@ -397,7 +397,7 @@ sc_pkcs15emu_openpgp_add_data(sc_pkcs15_card_t *p15card)
+@@ -393,7 +393,7 @@ sc_pkcs15emu_openpgp_add_data(sc_pkcs15_card_t *p15card)
                 */
                r = read_file(p15card->card, path, content, sizeof(content));
                if (r <= 0 ) {
@@ -87,5 +87,5 @@ index f3a4962..1455580 100755
                r = SC_ERROR_NOT_IMPLEMENTED;
        }
 -- 
-1.9.3
+2.1.3
 
index 8fc34642d0c14155d6d6a549fb16ef17a2d70ac5..d133e805955ab8b419b60ad64c830e93242d9384 100644 (file)
@@ -1,8 +1,8 @@
-From 7231ee09bb628f0401939778decce818ef6e3665 Mon Sep 17 00:00:00 2001
+From 752f8981bed49a98d3592ead3aa50e743318dea8 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  <ng.hong.quan@gmail.com>
 Date: Fri, 5 Apr 2013 17:18:50 +0700
-Subject: [PATCH 11/18] OpenPGP: Provide enough buffer to read pubkey from
+Subject: [PATCH 11/26] OpenPGP: Provide enough buffer to read pubkey from
  Gnuk.
 
 ---
@@ -10,7 +10,7 @@ Subject: [PATCH 11/18] OpenPGP: Provide enough buffer to read pubkey from
  1 file changed, 23 insertions(+), 5 deletions(-)
 
 diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 9b08bbb..8a1a270 100644
+index e7b25c0..1913eca 100644
 --- a/src/libopensc/card-openpgp.c
 +++ b/src/libopensc/card-openpgp.c
 @@ -263,7 +263,12 @@ static struct do_info             pgp2_objects[] = {      /* OpenPGP card spec 2.0 */
@@ -27,7 +27,7 @@ index 9b08bbb..8a1a270 100644
  
  #define DRVDATA(card)        ((struct pgp_priv_data *) ((card)->drv_data))
  struct pgp_priv_data {
-@@ -729,6 +734,14 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
+@@ -731,6 +736,14 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
                u8      buffer[2048];
                size_t  buf_len = (card->caps & SC_CARD_CAP_APDU_EXT)
                                  ? sizeof(buffer) : 256;
@@ -42,7 +42,7 @@ index 9b08bbb..8a1a270 100644
                int     r = blob->info->get_fn(card, blob->id, buffer, buf_len);
  
                if (r < 0) {    /* an error occurred */
-@@ -1830,6 +1843,7 @@ static int pgp_gen_key(sc_card_t *card, sc_cardctl_openpgp_keygen_info_t *key_in
+@@ -1828,6 +1841,7 @@ static int pgp_gen_key(sc_card_t *card, sc_cardctl_openpgp_keygen_info_t *key_in
        u8 apdu_case;
        u8 *apdu_data;
        size_t apdu_le;
@@ -83,5 +83,5 @@ index 9b08bbb..8a1a270 100644
        /* Send */
        sc_log(card->ctx, "Waiting for the card to generate key...");
 -- 
-1.9.3
+2.1.3
 
index 0d54d96fc35e9adfe32b2ebec31798184d2eb951..3a2526f4e87c7d63116ea12327f87042678f4cd7 100644 (file)
@@ -1,18 +1,18 @@
-From d8f63eb6fcc1441c12a44850da2fa22a6fe81634 Mon Sep 17 00:00:00 2001
+From 5110ae3ba33d165c43ea5eca8f929a82d81cb3fe Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  <ng.hong.quan@gmail.com>
 Date: Thu, 11 Apr 2013 11:47:51 +0700
-Subject: [PATCH 12/18] OpenPGP: Support write certificate for Gnuk.
+Subject: [PATCH 12/26] OpenPGP: Support write certificate for Gnuk.
 
 ---
  src/libopensc/card-openpgp.c | 158 +++++++++++++++++++++++++++++++++----------
  1 file changed, 123 insertions(+), 35 deletions(-)
 
 diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 8a1a270..d9db948 100644
+index 1913eca..7cea84f 100644
 --- a/src/libopensc/card-openpgp.c
 +++ b/src/libopensc/card-openpgp.c
-@@ -725,6 +725,8 @@ pgp_iterate_blobs(struct blob *blob, int level, void (*func)())
+@@ -727,6 +727,8 @@ pgp_iterate_blobs(struct blob *blob, int level, void (*func)())
  static int
  pgp_read_blob(sc_card_t *card, struct blob *blob)
  {
@@ -21,7 +21,7 @@ index 8a1a270..d9db948 100644
        if (blob->data != NULL)
                return SC_SUCCESS;
        if (blob->info == NULL)
-@@ -735,6 +737,11 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
+@@ -737,6 +739,11 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
                size_t  buf_len = (card->caps & SC_CARD_CAP_APDU_EXT)
                                  ? sizeof(buffer) : 256;
  
@@ -33,7 +33,7 @@ index 8a1a270..d9db948 100644
                /* Buffer length for Gnuk pubkey */
                if (card->type == SC_CARD_TYPE_OPENPGP_GNUK &&
                    (blob->id == 0xa400 || blob->id == 0xb600 || blob->id == 0xb800
-@@ -1190,49 +1197,75 @@ pgp_get_data(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
+@@ -1192,49 +1199,75 @@ pgp_get_data(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
        LOG_FUNC_RETURN(card->ctx, apdu.resplen);
  }
  
@@ -143,7 +143,7 @@ index 8a1a270..d9db948 100644
  
        /* Extended Header list (004D DO) needs a variant of PUT DATA command */
        if (tag == 0x004D) {
-@@ -1258,15 +1291,70 @@ pgp_put_data(sc_card_t *card, unsigned int tag, const u8 *buf, size_t buf_len)
+@@ -1260,15 +1293,70 @@ pgp_put_data(sc_card_t *card, unsigned int tag, const u8 *buf, size_t buf_len)
                apdu.lc = buf_len;
        }
        else {
@@ -216,5 +216,5 @@ index 8a1a270..d9db948 100644
        if (r == SC_ERROR_SECURITY_STATUS_NOT_SATISFIED) {
                sc_debug(card->ctx, SC_LOG_DEBUG_VERBOSE, "Please verify PIN first.");
 -- 
-1.9.3
+2.1.3
 
index 67d79dd6f8cfd4475dc7f3808cc28e2e40234d5c..48afb37390fb8c58ae33d2dd81d0ffa08ca006c2 100644 (file)
@@ -1,8 +1,8 @@
-From e5c94d3f1f7e6a96a98815d6e51190498c357fb6 Mon Sep 17 00:00:00 2001
+From 7823e836e8279c8d77786d8f10ffaa83cf50bf1d Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  <ng.hong.quan@gmail.com>
 Date: Wed, 10 Apr 2013 18:35:58 +0700
-Subject: [PATCH 13/18] pkcs15-openpgp: Change to sc_put_data instead of
+Subject: [PATCH 13/26] pkcs15-openpgp: Change to sc_put_data instead of
  sc_update_binary when writing certificate.
 
 ---
@@ -27,5 +27,5 @@ index 1455580..be1291e 100755
  
        case SC_PKCS15_TYPE_DATA_OBJECT:
 -- 
-1.9.3
+2.1.3
 
index cf1a07c6478200b1ac36c37c099fb6caad7a4e09..0fa8f2c3d3ae879b824a1186044428fe6c881c00 100644 (file)
@@ -1,8 +1,8 @@
-From df8a78e3c8c9d9d591c0d3fa31db7e010eb2c8c2 Mon Sep 17 00:00:00 2001
+From 3ff1f7234abb4c42273adedbe06d9e7f9f3a5f9d Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  <ng.hong.quan@gmail.com>
 Date: Thu, 11 Apr 2013 16:18:31 +0700
-Subject: [PATCH 14/18] OpenPGP: Overcome the restriction of even data length
+Subject: [PATCH 14/26] OpenPGP: Overcome the restriction of even data length
  of Gnuk.
 
 When write certificate with odd length to Gnuk, we add zero padding to make it even.
@@ -11,10 +11,10 @@ When write certificate with odd length to Gnuk, we add zero padding to make it e
  1 file changed, 18 insertions(+), 2 deletions(-)
 
 diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index d9db948..a666163 100644
+index 7cea84f..7a77a71 100644
 --- a/src/libopensc/card-openpgp.c
 +++ b/src/libopensc/card-openpgp.c
-@@ -1206,6 +1206,10 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
+@@ -1208,6 +1208,10 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
        sc_apdu_t apdu;
        u8 *part;
        size_t plen;
@@ -25,7 +25,7 @@ index d9db948..a666163 100644
        int r = SC_SUCCESS;
  
        LOG_FUNC_CALLED(ctx);
-@@ -1236,8 +1240,20 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
+@@ -1238,8 +1242,20 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
                        sc_format_apdu(card, &apdu, SC_APDU_CASE_3_SHORT, 0xD6, i, 0);
                }
                apdu.flags |= SC_APDU_FLAGS_CHAINING;
@@ -49,5 +49,5 @@ index d9db948..a666163 100644
                r = sc_transmit_apdu(card, &apdu);
                LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
 -- 
-1.9.3
+2.1.3
 
index cc88a12db74ce3ff843480228e238453d42c961e..2389cd10992bfa4bafadd01f8cce7bf9dbb8fd88 100644 (file)
@@ -1,18 +1,18 @@
-From 693b3ac5a53e89a0cdeab0f728d24a6e16864f5c Mon Sep 17 00:00:00 2001
+From 9af45c4cf052e3a6059a3004082f9ee3d2b3b2bf Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  <ng.hong.quan@gmail.com>
 Date: Fri, 12 Apr 2013 15:33:31 +0700
-Subject: [PATCH 15/18] OpenPGP: Delete key as file, for Gnuk.
+Subject: [PATCH 15/26] OpenPGP: Delete key as file, for Gnuk.
 
 ---
  src/libopensc/card-openpgp.c | 51 +++++++++++++++++++++++++++++++++++++++++++-
  1 file changed, 50 insertions(+), 1 deletion(-)
 
 diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index a666163..19d3b04 100644
+index 7a77a71..4d0500d 100644
 --- a/src/libopensc/card-openpgp.c
 +++ b/src/libopensc/card-openpgp.c
-@@ -2437,6 +2437,44 @@ static int pgp_card_ctl(sc_card_t *card, unsigned long cmd, void *ptr)
+@@ -2435,6 +2435,44 @@ static int pgp_card_ctl(sc_card_t *card, unsigned long cmd, void *ptr)
        LOG_FUNC_RETURN(card->ctx, SC_ERROR_NOT_SUPPORTED);
  }
  
@@ -57,7 +57,7 @@ index a666163..19d3b04 100644
  /* ABI: DELETE FILE */
  static int
  pgp_delete_file(sc_card_t *card, const sc_path_t *path)
-@@ -2444,6 +2482,7 @@ pgp_delete_file(sc_card_t *card, const sc_path_t *path)
+@@ -2442,6 +2480,7 @@ pgp_delete_file(sc_card_t *card, const sc_path_t *path)
        struct pgp_priv_data *priv = DRVDATA(card);
        struct blob *blob;
        sc_file_t *file;
@@ -65,7 +65,7 @@ index a666163..19d3b04 100644
        int r;
  
        LOG_FUNC_CALLED(card->ctx);
-@@ -2459,10 +2498,20 @@ pgp_delete_file(sc_card_t *card, const sc_path_t *path)
+@@ -2457,10 +2496,20 @@ pgp_delete_file(sc_card_t *card, const sc_path_t *path)
        if (blob == priv->mf)
                LOG_FUNC_RETURN(card->ctx, SC_ERROR_NOT_SUPPORTED);
  
@@ -88,5 +88,5 @@ index a666163..19d3b04 100644
                /* call pgp_put_data() with zero-sized NULL-buffer to zap the DO contents */
                r = pgp_put_data(card, file->id, NULL, 0);
 -- 
-1.9.3
+2.1.3
 
index c49de13c0a906ecb3b6062d25842ca25961f507f..76c8624e3091fef3a5c31292ecf80ab7d0217f33 100644 (file)
@@ -1,18 +1,18 @@
-From f96f7536a8c2efd0ba41fd94fe3334e5fa556854 Mon Sep 17 00:00:00 2001
+From ee23d262768e7e54ed0fc554bc0b869c65868ace Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  <ng.hong.quan@gmail.com>
 Date: Tue, 16 Apr 2013 10:19:34 +0700
-Subject: [PATCH 16/18] OpenPGP: Correct parameter checking.
+Subject: [PATCH 16/26] OpenPGP: Correct parameter checking.
 
 ---
  src/libopensc/card-openpgp.c | 9 +++++++--
  1 file changed, 7 insertions(+), 2 deletions(-)
 
 diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 19d3b04..196c094 100644
+index 4d0500d..beeee83 100644
 --- a/src/libopensc/card-openpgp.c
 +++ b/src/libopensc/card-openpgp.c
-@@ -1221,6 +1221,8 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
+@@ -1223,6 +1223,8 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
                LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
                /* Check response */
                r = sc_check_sw(card, apdu.sw1, apdu.sw2);
@@ -21,7 +21,7 @@ index 19d3b04..196c094 100644
                LOG_FUNC_RETURN(card->ctx, length);
        }
  
-@@ -2448,6 +2450,11 @@ gnuk_delete_key(sc_card_t *card, u8 key_id)
+@@ -2446,6 +2448,11 @@ gnuk_delete_key(sc_card_t *card, u8 key_id)
  
        LOG_FUNC_CALLED(ctx);
  
@@ -33,7 +33,7 @@ index 19d3b04..196c094 100644
        /* Delete fingerprint */
        sc_log(ctx, "Delete fingerprints");
        r = pgp_put_data(card, 0xC6 + key_id, NULL, 0);
-@@ -2466,8 +2473,6 @@ gnuk_delete_key(sc_card_t *card, u8 key_id)
+@@ -2464,8 +2471,6 @@ gnuk_delete_key(sc_card_t *card, u8 key_id)
                data = "\x4D\x02\xB8";
        else if (key_id == 3)
                data = "\x4D\x02\xA4";
@@ -43,5 +43,5 @@ index 19d3b04..196c094 100644
        r = pgp_put_data(card, 0x4D, data, strlen(data) + 1);
  
 -- 
-1.9.3
+2.1.3
 
index 50501e09584cb9896941761f08422d718b0d19b9..2bb6fccafb3a97570f1afd27c4170737e15d585c 100644 (file)
@@ -1,18 +1,18 @@
-From 8a69525a60391b46db4994033527d219d2adaa4e Mon Sep 17 00:00:00 2001
+From f4aec38233010953cea72c367bccc71c3687b2f1 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  <ng.hong.quan@gmail.com>
 Date: Tue, 16 Apr 2013 16:02:17 +0700
-Subject: [PATCH 17/18] OpenPGP: Make code neater
+Subject: [PATCH 17/26] OpenPGP: Make code neater
 
 ---
  src/libopensc/card-openpgp.c | 8 ++------
  1 file changed, 2 insertions(+), 6 deletions(-)
 
 diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 196c094..c4ef3b6 100644
+index beeee83..ca0d01b 100644
 --- a/src/libopensc/card-openpgp.c
 +++ b/src/libopensc/card-openpgp.c
-@@ -1220,10 +1220,7 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
+@@ -1222,10 +1222,7 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
                r = sc_transmit_apdu(card, &apdu);
                LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
                /* Check response */
@@ -24,7 +24,7 @@ index 196c094..c4ef3b6 100644
        }
  
        /* Ref: gnuk_put_binary_libusb.py and gnuk_token.py in Gnuk source tree */
-@@ -1260,8 +1257,7 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
+@@ -1262,8 +1259,7 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
                r = sc_transmit_apdu(card, &apdu);
                LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
                /* Check response */
@@ -35,5 +35,5 @@ index 196c094..c4ef3b6 100644
                /* To next part */
                i++;
 -- 
-1.9.3
+2.1.3
 
index b05cc59c4eb471d65c5b77d123c6170e51b6b5fc..774ed58a11fe985da614b1729e33f79460ea2844 100644 (file)
@@ -1,18 +1,18 @@
-From a099f951d085d3abfefeead14a4af06913cb67d2 Mon Sep 17 00:00:00 2001
+From c84c84169f7a73eab27f6a9b13b77432baa5c3f8 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
  <ng.hong.quan@gmail.com>
 Date: Wed, 8 May 2013 16:51:21 +0700
-Subject: [PATCH 18/18] Move declaration to top of block.
+Subject: [PATCH 18/26] Move declaration to top of block.
 
 ---
  src/libopensc/card-openpgp.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index c4ef3b6..7f2006e 100644
+index ca0d01b..037ef73 100644
 --- a/src/libopensc/card-openpgp.c
 +++ b/src/libopensc/card-openpgp.c
-@@ -736,6 +736,7 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
+@@ -738,6 +738,7 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
                u8      buffer[2048];
                size_t  buf_len = (card->caps & SC_CARD_CAP_APDU_EXT)
                                  ? sizeof(buffer) : 256;
@@ -20,7 +20,7 @@ index c4ef3b6..7f2006e 100644
  
                /* Buffer length for certificate */
                if (blob->id == DO_CERT && priv->max_cert_size > 0) {
-@@ -749,7 +750,7 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
+@@ -751,7 +752,7 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
                        buf_len = MAXLEN_RESP_PUBKEY_GNUK;
                }
  
@@ -30,5 +30,5 @@ index c4ef3b6..7f2006e 100644
                if (r < 0) {    /* an error occurred */
                        blob->status = r;
 -- 
-1.9.3
+2.1.3
 
diff --git a/utils/opensc/patches/0019-OpenPGP-Make-indentation-consistent-space-tab.patch b/utils/opensc/patches/0019-OpenPGP-Make-indentation-consistent-space-tab.patch
new file mode 100644 (file)
index 0000000..3702d61
--- /dev/null
@@ -0,0 +1,182 @@
+From c6abf7976f64be5191dc80fecdbcb07daab7a2e0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
+ <ng.hong.quan@gmail.com>
+Date: Sun, 3 Nov 2013 01:45:56 +0800
+Subject: [PATCH 19/26] OpenPGP: Make indentation consistent (space -> tab).
+
+---
+ src/libopensc/card-openpgp.c | 22 ++++++++---------
+ src/tools/openpgp-tool.c     | 56 ++++++++++++++++++++++----------------------
+ 2 files changed, 39 insertions(+), 39 deletions(-)
+
+diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
+index 037ef73..ae40940 100644
+--- a/src/libopensc/card-openpgp.c
++++ b/src/libopensc/card-openpgp.c
+@@ -192,12 +192,12 @@ static struct do_info            pgp1_objects[] = {      /* OpenPGP card spec 1.1 */
+       { 0x5f35, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  NULL,               sc_put_data },
+       { 0x5f50, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  sc_get_data,        sc_put_data },
+       { 0x7f49, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, NULL,               NULL        },
+-      { 0xa400, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER,  pgp_get_pubkey,     NULL        },
+-      { 0xa401, SIMPLE,      READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL        },
+-      { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER,  pgp_get_pubkey,     NULL        },
+-      { 0xb601, SIMPLE,      READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL        },
+-      { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER,  pgp_get_pubkey,     NULL        },
+-      { 0xb801, SIMPLE,      READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL        },
++      { 0xa400, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey,     NULL        },
++      { 0xa401, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  pgp_get_pubkey_pem, NULL        },
++      { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey,     NULL        },
++      { 0xb601, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  pgp_get_pubkey_pem, NULL        },
++      { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey,     NULL        },
++      { 0xb801, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  pgp_get_pubkey_pem, NULL        },
+       { 0, 0, 0, NULL, NULL },
+ };
+@@ -253,11 +253,11 @@ static struct do_info            pgp2_objects[] = {      /* OpenPGP card spec 2.0 */
+       /* The 0xA401, 0xB601, 0xB801 are just symbolic, it does not represent any real DO.
+        * However, their R/W access condition may block the process of importing key in pkcs15init.
+        * So we set their accesses condition as WRITE_PIN3 (writable). */
+-      { 0xa401, SIMPLE,      READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL        },
+-      { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER,  pgp_get_pubkey,     NULL        },
+-      { 0xb601, SIMPLE,      READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL        },
+-      { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER,  pgp_get_pubkey,     NULL        },
+-      { 0xb801, SIMPLE,      READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL        },
++      { 0xa401, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  pgp_get_pubkey_pem, NULL        },
++      { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey,     NULL        },
++      { 0xb601, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  pgp_get_pubkey_pem, NULL        },
++      { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey,     NULL        },
++      { 0xb801, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  pgp_get_pubkey_pem, NULL        },
+       { 0, 0, 0, NULL, NULL },
+ };
+diff --git a/src/tools/openpgp-tool.c b/src/tools/openpgp-tool.c
+index 374819a..a0334ca 100644
+--- a/src/tools/openpgp-tool.c
++++ b/src/tools/openpgp-tool.c
+@@ -37,11 +37,11 @@
+ #include "util.h"
+ #include "libopensc/log.h"
+-#define       OPT_RAW         256
+-#define       OPT_PRETTY      257
+-#define       OPT_VERIFY      258
+-#define       OPT_PIN     259
+-#define       OPT_DELKEY  260
++#define OPT_RAW     256
++#define OPT_PRETTY  257
++#define OPT_VERIFY  258
++#define OPT_PIN     259
++#define OPT_DELKEY  260
+ /* define structures */
+ struct ef_name_map {
+@@ -142,10 +142,10 @@ static const struct ef_name_map openpgp_data[] = {
+ static void show_version(void)
+ {
+       fprintf(stderr,
+-              "openpgp-tool - OpenPGP card utility version " PACKAGE_VERSION "\n"
+-              "\n"
+-              "Copyright (c) 2012 Peter Marschall <peter@adpm.de>\n"
+-              "Licensed under LGPL v2\n");
++              "openpgp-tool - OpenPGP card utility version " PACKAGE_VERSION "\n"
++              "\n"
++              "Copyright (c) 2012 Peter Marschall <peter@adpm.de>\n"
++              "Licensed under LGPL v2\n");
+ }
+@@ -176,16 +176,16 @@ static char *prettify_language(char *str)
+ {
+       if (str != NULL) {
+               switch (strlen(str)) {
+-                      case 8: memmove(str+7, str+6, 1+strlen(str+6));
++                      case 8: memmove(str+7, str+6, 1+strlen(str+6));
+                               str[6] = ',';
+                               /* fall through */
+-                      case 6: memmove(str+5, str+4, 1+strlen(str+4));
++                      case 6: memmove(str+5, str+4, 1+strlen(str+4));
+                               str[4] = ',';
+                               /* fall through */
+-                      case 4: memmove(str+3, str+2, 1+strlen(str+2));
++                      case 4: memmove(str+3, str+2, 1+strlen(str+2));
+                               str[2] = ',';
+                               /* fall through */
+-                      case 2:  return str;
++                      case 2: return str;
+               }
+       }
+       return NULL;
+@@ -197,10 +197,10 @@ static char *prettify_gender(char *str)
+ {
+       if (str != NULL) {
+               switch (*str) {
+-                      case '0':  return "unknown";
+-                      case '1':  return "male";
+-                      case '2':  return "female";
+-                      case '9':  return "not applicable";
++                      case '0': return "unknown";
++                      case '1': return "male";
++                      case '2': return "female";
++                      case '9': return "not applicable";
+               }
+       }
+       return NULL;
+@@ -218,7 +218,7 @@ static void display_data(const struct ef_name_map *mapping, char *value)
+                               char *envvar;
+                               envvar = malloc(strlen(mapping->env_name) +
+-                                              strlen(value) + 2);
++                                              strlen(value) + 2);
+                               if (envvar != NULL) {
+                                       strcpy(envvar, mapping->env_name);
+                                       strcat(envvar, "=");
+@@ -346,20 +346,20 @@ static int do_userinfo(sc_card_t *card)
+               if (!count)
+                       continue;
+-              if (count > (int)sizeof(buf) - 1)   {
++              if (count > (int)sizeof(buf) - 1) {
+                       fprintf(stderr, "Too small buffer to read the OpenPGP data\n");
+                       return EXIT_FAILURE;
+               }
+-      
+-              r = sc_read_binary(card, 0, buf, count, 0);
+-                      if (r < 0) {
++
++              r = sc_read_binary(card, 0, buf, count, 0);
++              if (r < 0) {
+                       fprintf(stderr, "%s: read failed - %s\n", openpgp_data[i].ef, sc_strerror(r));
+                       return EXIT_FAILURE;
+-              }
+-                      if (r != count) {
+-                        fprintf(stderr, "%s: expecting %d, got only %d bytes\n", openpgp_data[i].ef, count, r);
++              }
++              if (r != count) {
++                      fprintf(stderr, "%s: expecting %d, got only %d bytes\n", openpgp_data[i].ef, count, r);
+                       return EXIT_FAILURE;
+-              }
++              }
+               buf[count] = '\0';
+@@ -628,7 +628,7 @@ int main(int argc, char **argv)
+       r = sc_context_create(&ctx, &ctx_param);
+       if (r) {
+               util_fatal("failed to establish context: %s\n",
+-                      sc_strerror(r));
++                         sc_strerror(r));
+               return EXIT_FAILURE;
+       }
+@@ -640,7 +640,7 @@ int main(int argc, char **argv)
+       r = util_connect_card(ctx, &card, opt_reader, opt_wait, verbose);
+       if (r) {
+               util_fatal("failed to connect to card: %s\n",
+-                      sc_strerror(r));
++                         sc_strerror(r));
+               return EXIT_FAILURE;
+       }
+-- 
+2.1.3
+
diff --git a/utils/opensc/patches/0020-OpenPGP-Don-t-use-sc_log-in-openpgp-tool.patch b/utils/opensc/patches/0020-OpenPGP-Don-t-use-sc_log-in-openpgp-tool.patch
new file mode 100644 (file)
index 0000000..b73826f
--- /dev/null
@@ -0,0 +1,84 @@
+From 9acf5c1ad7d8a32b472203d3bd8860ea2cbde0e7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
+ <ng.hong.quan@gmail.com>
+Date: Sun, 3 Nov 2013 02:53:35 +0800
+Subject: [PATCH 20/26] OpenPGP: Don't use sc_log in openpgp-tool.
+
+---
+ src/tools/openpgp-tool.c | 21 +++++++++++----------
+ 1 file changed, 11 insertions(+), 10 deletions(-)
+
+diff --git a/src/tools/openpgp-tool.c b/src/tools/openpgp-tool.c
+index a0334ca..505abd9 100644
+--- a/src/tools/openpgp-tool.c
++++ b/src/tools/openpgp-tool.c
+@@ -414,8 +414,6 @@ int do_genkey(sc_card_t *card, u8 key_id, unsigned int key_len)
+       sc_path_t path;
+       sc_file_t *file;
+-      LOG_FUNC_CALLED(card->ctx);
+-
+       if (key_id < 1 || key_id > 3) {
+               printf("Unknown key ID %d.\n", key_id);
+               return 1;
+@@ -479,14 +477,14 @@ int delete_key_gnuk(sc_card_t *card, u8 key_id)
+       u8 *data = NULL;
+       /* Delete fingerprint */
+-      sc_log(ctx, "Delete fingerprints");
++      fprintf(stdout, "Delete fingerprints");
+       r |= sc_put_data(card, 0xC6 + key_id, NULL, 0);
+       /* Delete creation time */
+-      sc_log(ctx, "Delete creation time");
++      fprintf(stdout, "Delete creation time");
+       r |= sc_put_data(card, 0xCD + key_id, NULL, 0);
+       /* Rewrite Extended Header List */
+-      sc_log(ctx, "Rewrite Extended Header List");
++      fprintf(stdout, "Rewrite Extended Header List");
+       if (key_id == 1)
+               data = "\x4D\x02\xB6";
+@@ -534,15 +532,18 @@ int delete_key_openpgp(sc_card_t *card, u8 key_id)
+               /* Build APDU from binary array */
+               r = sc_bytes2apdu(card->ctx, buf, len0, &apdu);
+               if (r) {
+-                      sc_log(ctx, "Failed to build APDU");
+-                      LOG_FUNC_RETURN(ctx, SC_ERROR_INTERNAL);
++                      fprintf(stderr, "Failed to build APDU: %s\n", sc_strerror(r));
++                      return r;
+               }
+               apdu.resp = rbuf;
+               apdu.resplen = sizeof(rbuf);
+               /* Send APDU to card */
+               r = sc_transmit_apdu(card, &apdu);
+-              LOG_TEST_RET(ctx, r, "Transmiting APDU failed");
++              if (r) {
++                      fprintf(stderr, "Transmiting APDU failed: %s\n", sc_strerror(r));
++                      return r;
++              }
+       }
+       /* TODO: Rewrite Extended Header List.
+        * Not support by OpenGPG v2 yet */
+@@ -557,7 +558,7 @@ int delete_key(sc_card_t *card, u8 key_id)
+       LOG_FUNC_CALLED(ctx);
+       /* Check key ID */
+       if (key_id < 1 || key_id > 3) {
+-              sc_log(ctx, "Invalid key ID %d", key_id);
++              fprintf(stderr, "Invalid key ID %d", key_id);
+               LOG_FUNC_RETURN(ctx, SC_ERROR_INVALID_ARGUMENTS);
+       }
+@@ -649,7 +650,7 @@ int main(int argc, char **argv)
+           (card->type != SC_CARD_TYPE_OPENPGP_V2) &&
+           (card->type != SC_CARD_TYPE_OPENPGP_GNUK)) {
+               util_error("not an OpenPGP card");
+-              sc_log(card->ctx, "Card type %X", card->type);
++              fprintf(stderr, "Card type %X\n", card->type);
+               exit_status = EXIT_FAILURE;
+               goto out;
+       }
+-- 
+2.1.3
+
diff --git a/utils/opensc/patches/0021-OpenPGP-Don-t-reimplement-gnuk_delete_key-in-openpgp.patch b/utils/opensc/patches/0021-OpenPGP-Don-t-reimplement-gnuk_delete_key-in-openpgp.patch
new file mode 100644 (file)
index 0000000..dc8fe84
--- /dev/null
@@ -0,0 +1,112 @@
+From 0fdbf868976172486af210accafbab163452ff78 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
+ <ng.hong.quan@gmail.com>
+Date: Sun, 3 Nov 2013 11:26:25 +0800
+Subject: [PATCH 21/26] OpenPGP: Don't reimplement gnuk_delete_key in
+ openpgp-tool.
+
+---
+ src/tools/openpgp-tool.c | 64 ++++++------------------------------------------
+ 1 file changed, 8 insertions(+), 56 deletions(-)
+
+diff --git a/src/tools/openpgp-tool.c b/src/tools/openpgp-tool.c
+index 505abd9..a7796e7 100644
+--- a/src/tools/openpgp-tool.c
++++ b/src/tools/openpgp-tool.c
+@@ -468,38 +468,6 @@ int do_verify(sc_card_t *card, char *type, char *pin)
+ }
+ /**
+- * Delete key, for Gnuk.
+- **/
+-int delete_key_gnuk(sc_card_t *card, u8 key_id)
+-{
+-      sc_context_t *ctx = card->ctx;
+-      int r = SC_SUCCESS;
+-      u8 *data = NULL;
+-
+-      /* Delete fingerprint */
+-      fprintf(stdout, "Delete fingerprints");
+-      r |= sc_put_data(card, 0xC6 + key_id, NULL, 0);
+-      /* Delete creation time */
+-      fprintf(stdout, "Delete creation time");
+-      r |= sc_put_data(card, 0xCD + key_id, NULL, 0);
+-
+-      /* Rewrite Extended Header List */
+-      fprintf(stdout, "Rewrite Extended Header List");
+-
+-      if (key_id == 1)
+-              data = "\x4D\x02\xB6";
+-      else if (key_id == 2)
+-              data = "\x4D\x02\xB8";
+-      else if (key_id == 3)
+-              data = "\x4D\x02\xA4";
+-      else
+-              return SC_ERROR_INVALID_ARGUMENTS;
+-
+-      r |= sc_put_data(card, 0x4D, data, strlen(data) + 1);
+-      return r;
+-}
+-
+-/**
+  * Delete key, for OpenPGP card.
+  * This function is not complete and is reserved for future version (> 2) of OpenPGP card.
+  **/
+@@ -547,32 +515,13 @@ int delete_key_openpgp(sc_card_t *card, u8 key_id)
+       }
+       /* TODO: Rewrite Extended Header List.
+        * Not support by OpenGPG v2 yet */
+-      LOG_FUNC_RETURN(ctx, r);
+-}
+-
+-int delete_key(sc_card_t *card, u8 key_id)
+-{
+-      sc_context_t *ctx = card->ctx;
+-      int r;
+-
+-      LOG_FUNC_CALLED(ctx);
+-      /* Check key ID */
+-      if (key_id < 1 || key_id > 3) {
+-              fprintf(stderr, "Invalid key ID %d", key_id);
+-              LOG_FUNC_RETURN(ctx, SC_ERROR_INVALID_ARGUMENTS);
+-      }
+-
+-      if (card->type == SC_CARD_TYPE_OPENPGP_GNUK)
+-              r = delete_key_gnuk(card, key_id);
+-      else
+-              r = delete_key_openpgp(card, key_id);
+-
+-      LOG_FUNC_RETURN(ctx, r);
++      return r;
+ }
+ int do_delete_key(sc_card_t *card, u8 key_id)
+ {
+       sc_context_t *ctx = card->ctx;
++      sc_path_t path;
+       int r = SC_SUCCESS;
+       /* Currently, only Gnuk supports deleting keys */
+@@ -586,13 +535,16 @@ int do_delete_key(sc_card_t *card, u8 key_id)
+               return SC_ERROR_INVALID_ARGUMENTS;
+       }
+       if (key_id == 1 || key_id == 'a') {
+-              r |= delete_key(card, 1);
++              sc_format_path("B601", &path);
++              r |= sc_delete_file(card, &path);
+       }
+       if (key_id == 2 || key_id == 'a') {
+-              r |= delete_key(card, 2);
++              sc_format_path("B801", &path);
++              r |= sc_delete_file(card, &path);
+       }
+       if (key_id == 3 || key_id == 'a') {
+-              r |= delete_key(card, 3);
++              sc_format_path("A401", &path);
++              r |= sc_delete_file(card, &path);
+       }
+       return r;
+ }
+-- 
+2.1.3
+
diff --git a/utils/opensc/patches/0022-OpenPGP-Use-directly-binary-array-of-APDUs-for-ERASE.patch b/utils/opensc/patches/0022-OpenPGP-Use-directly-binary-array-of-APDUs-for-ERASE.patch
new file mode 100644 (file)
index 0000000..6297783
--- /dev/null
@@ -0,0 +1,87 @@
+From 0cd2a488d86006bb2740a4e73e7a0d859e1bf33c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
+ <ng.hong.quan@gmail.com>
+Date: Sun, 13 Jul 2014 17:37:59 +0800
+Subject: [PATCH 22/26] OpenPGP: Use directly binary array of APDUs for ERASE
+ command.
+
+I used a string presentation before and it needed an extra conversion step.
+---
+ src/libopensc/card-openpgp.c | 47 +++++++++++++++++++++++---------------------
+ 1 file changed, 25 insertions(+), 22 deletions(-)
+
+diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
+index ae40940..724fe73 100644
+--- a/src/libopensc/card-openpgp.c
++++ b/src/libopensc/card-openpgp.c
+@@ -2347,24 +2347,27 @@ out:
+ static int pgp_erase_card(sc_card_t *card)
+ {
+       sc_context_t *ctx = card->ctx;
+-      u8 *apdustring[10] = {
+-              "00:20:00:81:08:40:40:40:40:40:40:40:40",
+-              "00:20:00:81:08:40:40:40:40:40:40:40:40",
+-              "00:20:00:81:08:40:40:40:40:40:40:40:40",
+-              "00:20:00:81:08:40:40:40:40:40:40:40:40",
+-              "00:20:00:83:08:40:40:40:40:40:40:40:40",
+-              "00:20:00:83:08:40:40:40:40:40:40:40:40",
+-              "00:20:00:83:08:40:40:40:40:40:40:40:40",
+-              "00:20:00:83:08:40:40:40:40:40:40:40:40",
+-              "00:e6:00:00",
+-              "00:44:00:00"
++      /* Special series of commands to erase OpenPGP card,
++       * according to https://www.crypto-stick.com/en/faq
++       * (How to reset a Crypto Stick? question).
++       * Gnuk is known not to support this feature. */
++      u8 apdu_binaries[10][13] = {
++              {0, 0x20, 0, 0x81, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
++              {0, 0x20, 0, 0x81, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
++              {0, 0x20, 0, 0x81, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
++              {0, 0x20, 0, 0x81, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
++              {0, 0x20, 0, 0x83, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
++              {0, 0x20, 0, 0x83, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
++              {0, 0x20, 0, 0x83, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
++              {0, 0x20, 0, 0x83, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
++              {0, 0xe6, 0, 0},
++              {0, 0x44, 0, 0}
+       };
++      u8 apdu_lens[10] = {13, 13, 13, 13, 13, 13, 13, 13, 4, 4};
+       u8 buf[SC_MAX_APDU_BUFFER_SIZE];
+       u8 rbuf[SC_MAX_APDU_BUFFER_SIZE];
+       sc_apdu_t apdu;
+-      size_t len0;
+-      int commandsnum = 10;
+-      int i, r;
++      int i, l, r;
+       LOG_FUNC_CALLED(ctx);
+@@ -2376,17 +2379,17 @@ static int pgp_erase_card(sc_card_t *card)
+       sc_log(ctx, "Card is OpenPGP v2. Erase card.");
+       /* Iterate over 10 commands above */
+-      for (i = 0; i < commandsnum; i++) {
+-              /* Convert the string to binary array */
+-              len0 = sizeof(buf);
+-              sc_hex_to_bin(apdustring[i], buf, &len0);
+-              printf("Sending: ");
+-              for (r = 0; r < len0; r++)
+-                      printf("%02X ", buf[r]);
++      for (i = 0; i < sizeof(apdu_lens); i++) {
++              /* Length of the binary array of the current command */
++              l = apdu_lens[i];
++              /* Print the command to console */
++              printf("Sending %d: ", i);
++              for (r = 0; r < l; r++)
++                      printf("%02X ", apdu_binaries[i][r]);
+               printf("\n");
+               /* Build APDU from binary array */
+-              r = sc_bytes2apdu(card->ctx, buf, len0, &apdu);
++              r = sc_bytes2apdu(card->ctx, apdu_binaries[i], l, &apdu);
+               if (r) {
+                       sc_log(ctx, "Failed to build APDU");
+                       LOG_FUNC_RETURN(ctx, SC_ERROR_INTERNAL);
+-- 
+2.1.3
+
diff --git a/utils/opensc/patches/0023-OpenPGP-Rename-private-blob-type-to-avoid-confusing-.patch b/utils/opensc/patches/0023-OpenPGP-Rename-private-blob-type-to-avoid-confusing-.patch
new file mode 100644 (file)
index 0000000..f859f7c
--- /dev/null
@@ -0,0 +1,339 @@
+From 6f56ea4cfc52323002d818731a50a31e863b6843 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
+ <ng.hong.quan@gmail.com>
+Date: Sun, 13 Jul 2014 19:41:36 +0800
+Subject: [PATCH 23/26] OpenPGP: Rename private "blob" type to avoid confusing
+ with variable name.
+
+This name has been used for both data type and variable name of that
+type.
+---
+ src/libopensc/card-openpgp.c | 96 ++++++++++++++++++++++----------------------
+ 1 file changed, 49 insertions(+), 47 deletions(-)
+
+diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
+index 724fe73..ca3173c 100644
+--- a/src/libopensc/card-openpgp.c
++++ b/src/libopensc/card-openpgp.c
+@@ -111,9 +111,9 @@ enum _card_state {
+       CARD_STATE_ACTIVATED      = 0x05
+ };
+-struct blob {
+-      struct blob *   next;   /* pointer to next sibling */
+-      struct blob *   parent; /* pointer to parent */
++typedef struct pgp_blob {
++      struct pgp_blob *       next;   /* pointer to next sibling */
++      struct pgp_blob *       parent; /* pointer to parent */
+       struct do_info *info;
+       sc_file_t *     file;
+@@ -122,8 +122,8 @@ struct blob {
+       unsigned char * data;
+       unsigned int    len;
+-      struct blob *   files;  /* pointer to 1st child */
+-};
++      struct pgp_blob *       files;  /* pointer to 1st child */
++} pgp_blob_t;
+ struct do_info {
+       unsigned int    id;             /* ID of the DO in question */
+@@ -141,12 +141,12 @@ struct do_info {
+ static int            pgp_get_card_features(sc_card_t *card);
+ static int            pgp_finish(sc_card_t *card);
+-static void           pgp_iterate_blobs(struct blob *, int, void (*func)());
++static void           pgp_iterate_blobs(pgp_blob_t *, int, void (*func)());
+-static int            pgp_get_blob(sc_card_t *card, struct blob *blob,
+-                               unsigned int id, struct blob **ret);
+-static struct blob *  pgp_new_blob(sc_card_t *, struct blob *, unsigned int, sc_file_t *);
+-static void           pgp_free_blob(struct blob *);
++static int            pgp_get_blob(sc_card_t *card, pgp_blob_t *blob,
++                               unsigned int id, pgp_blob_t **ret);
++static pgp_blob_t *   pgp_new_blob(sc_card_t *, pgp_blob_t *, unsigned int, sc_file_t *);
++static void           pgp_free_blob(pgp_blob_t *);
+ static int            pgp_get_pubkey(sc_card_t *, unsigned int,
+                               u8 *, size_t);
+ static int            pgp_get_pubkey_pem(sc_card_t *, unsigned int,
+@@ -272,8 +272,8 @@ static struct do_info              pgp2_objects[] = {      /* OpenPGP card spec 2.0 */
+ #define DRVDATA(card)        ((struct pgp_priv_data *) ((card)->drv_data))
+ struct pgp_priv_data {
+-      struct blob *           mf;
+-      struct blob *           current;        /* currently selected file */
++      pgp_blob_t *            mf;
++      pgp_blob_t *            current;        /* currently selected file */
+       enum _version           bcd_version;
+       struct do_info          *pgp_objects;
+@@ -311,7 +311,7 @@ pgp_init(sc_card_t *card)
+       sc_file_t       *file = NULL;
+       struct do_info  *info;
+       int             r;
+-      struct blob     *child = NULL;
++      pgp_blob_t      *child = NULL;
+       LOG_FUNC_CALLED(card->ctx);
+@@ -389,7 +389,7 @@ pgp_get_card_features(sc_card_t *card)
+       unsigned char *hist_bytes = card->atr.value;
+       size_t atr_len = card->atr.len;
+       size_t i = 0;
+-      struct blob *blob, *blob6e, *blob73;
++      pgp_blob_t *blob, *blob6e, *blob73;
+       /* parse card capabilities from historical bytes */
+       while ((i < atr_len) && (hist_bytes[i] != 0x73))
+@@ -526,7 +526,7 @@ pgp_finish(sc_card_t *card)
+ /* internal: fill a blob's data */
+ static int
+-pgp_set_blob(struct blob *blob, const u8 *data, size_t len)
++pgp_set_blob(pgp_blob_t *blob, const u8 *data, size_t len)
+ {
+       if (blob->data)
+               free(blob->data);
+@@ -620,16 +620,16 @@ pgp_attach_acl(sc_card_t *card, sc_file_t *file, struct do_info *info)
+ }
+ /* internal: append a blob to the list of children of a given parent blob */
+-static struct blob *
+-pgp_new_blob(sc_card_t *card, struct blob *parent, unsigned int file_id,
++static pgp_blob_t *
++pgp_new_blob(sc_card_t *card, pgp_blob_t *parent, unsigned int file_id,
+               sc_file_t *file)
+ {
+-      struct blob *blob = NULL;
++      pgp_blob_t *blob = NULL;
+       if (file == NULL)
+               return NULL;
+-      if ((blob = calloc(1, sizeof(struct blob))) != NULL) {
++      if ((blob = calloc(1, sizeof(pgp_blob_t))) != NULL) {
+               struct pgp_priv_data *priv = DRVDATA (card);
+               struct do_info *info;
+@@ -643,7 +643,7 @@ pgp_new_blob(sc_card_t *card, struct blob *parent, unsigned int file_id,
+               blob->parent = parent;
+               if (parent != NULL) {
+-                      struct blob **p;
++                      pgp_blob_t **p;
+                       /* set file's path = parent's path + file's id */
+                       blob->file->path = parent->file->path;
+@@ -681,11 +681,11 @@ pgp_new_blob(sc_card_t *card, struct blob *parent, unsigned int file_id,
+ /* internal: free a blob including its content */
+ static void
+-pgp_free_blob(struct blob *blob)
++pgp_free_blob(pgp_blob_t *blob)
+ {
+       if (blob) {
+               if (blob->parent) {
+-                      struct blob **p;
++                      pgp_blob_t **p;
+                       /* remove blob from list of parent's children */
+                       for (p = &blob->parent->files; *p != NULL && *p != blob; p = &(*p)->next)
+@@ -705,14 +705,14 @@ pgp_free_blob(struct blob *blob)
+ /* internal: iterate through the blob tree, calling a function for each blob */
+ static void
+-pgp_iterate_blobs(struct blob *blob, int level, void (*func)())
++pgp_iterate_blobs(pgp_blob_t *blob, int level, void (*func)())
+ {
+       if (blob) {
+               if (level > 0) {
+-                      struct blob *child = blob->files;
++                      pgp_blob_t *child = blob->files;
+                       while (child != NULL) {
+-                              struct blob *next = child->next;
++                              pgp_blob_t *next = child->next;
+                               pgp_iterate_blobs(child, level-1, func);
+                               child = next;
+@@ -725,7 +725,7 @@ pgp_iterate_blobs(struct blob *blob, int level, void (*func)())
+ /* internal: read a blob's contents from card */
+ static int
+-pgp_read_blob(sc_card_t *card, struct blob *blob)
++pgp_read_blob(sc_card_t *card, pgp_blob_t *blob)
+ {
+       struct pgp_priv_data *priv = DRVDATA (card);
+@@ -772,7 +772,7 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
+  * The OpenPGP card has a TLV encoding according ASN.1 BER-encoding rules.
+  */
+ static int
+-pgp_enumerate_blob(sc_card_t *card, struct blob *blob)
++pgp_enumerate_blob(sc_card_t *card, pgp_blob_t *blob)
+ {
+       const u8        *in;
+       int             r;
+@@ -789,7 +789,7 @@ pgp_enumerate_blob(sc_card_t *card, struct blob *blob)
+               unsigned int    cla, tag, tmptag;
+               size_t          len;
+               const u8        *data = in;
+-              struct blob     *new;
++              pgp_blob_t      *new;
+               r = sc_asn1_read_tag(&data, blob->len - (in - blob->data),
+                                       &cla, &tag, &len);
+@@ -819,10 +819,10 @@ pgp_enumerate_blob(sc_card_t *card, struct blob *blob)
+ /* internal: find a blob by ID below a given parent, filling its contents when necessary */
+ static int
+-pgp_get_blob(sc_card_t *card, struct blob *blob, unsigned int id,
+-              struct blob **ret)
++pgp_get_blob(sc_card_t *card, pgp_blob_t *blob, unsigned int id,
++              pgp_blob_t **ret)
+ {
+-      struct blob             *child;
++      pgp_blob_t              *child;
+       int                     r;
+       if ((r = pgp_enumerate_blob(card, blob)) < 0)
+@@ -858,10 +858,10 @@ pgp_get_blob(sc_card_t *card, struct blob *blob, unsigned int id,
+ /* Internal: search recursively for a blob by ID below a given root */
+ static int
+-pgp_seek_blob(sc_card_t *card, struct blob *root, unsigned int id,
+-              struct blob **ret)
++pgp_seek_blob(sc_card_t *card, pgp_blob_t *root, unsigned int id,
++              pgp_blob_t **ret)
+ {
+-      struct blob     *child;
++      pgp_blob_t      *child;
+       int                     r;
+       if ((r = pgp_get_blob(card, root, id, ret)) == 0)
+@@ -883,11 +883,11 @@ pgp_seek_blob(sc_card_t *card, struct blob *root, unsigned int id,
+ }
+ /* internal: find a blob by tag - pgp_seek_blob with optimizations */
+-static struct blob *
++static pgp_blob_t *
+ pgp_find_blob(sc_card_t *card, unsigned int tag)
+ {
+       struct pgp_priv_data *priv = DRVDATA(card);
+-      struct blob *blob = NULL;
++      pgp_blob_t *blob = NULL;
+       int r;
+       /* Check if current selected blob is which we want to test*/
+@@ -941,7 +941,7 @@ static int
+ pgp_select_file(sc_card_t *card, const sc_path_t *path, sc_file_t **ret)
+ {
+       struct pgp_priv_data *priv = DRVDATA(card);
+-      struct blob     *blob;
++      pgp_blob_t      *blob;
+       unsigned int    path_start = 0;
+       unsigned int    n;
+       sc_path_t dummy_path;
+@@ -1022,7 +1022,7 @@ static int
+ pgp_list_files(sc_card_t *card, u8 *buf, size_t buflen)
+ {
+       struct pgp_priv_data *priv = DRVDATA(card);
+-      struct blob     *blob;
++      pgp_blob_t      *blob;
+       unsigned int    k;
+       int             r;
+@@ -1058,7 +1058,7 @@ pgp_read_binary(sc_card_t *card, unsigned int idx,
+               u8 *buf, size_t count, unsigned long flags)
+ {
+       struct pgp_priv_data *priv = DRVDATA(card);
+-      struct blob     *blob;
++      pgp_blob_t      *blob;
+       int             r;
+       LOG_FUNC_CALLED(card->ctx);
+@@ -1134,7 +1134,7 @@ static int
+ pgp_get_pubkey_pem(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
+ {
+       struct pgp_priv_data *priv = DRVDATA(card);
+-      struct blob     *blob, *mod_blob, *exp_blob;
++      pgp_blob_t      *blob, *mod_blob, *exp_blob;
+       sc_pkcs15_pubkey_t pubkey;
+       u8              *data;
+       size_t          len;
+@@ -1329,7 +1329,7 @@ static int
+ pgp_put_data(sc_card_t *card, unsigned int tag, const u8 *buf, size_t buf_len)
+ {
+       struct pgp_priv_data *priv = DRVDATA(card);
+-      struct blob *affected_blob = NULL;
++      pgp_blob_t *affected_blob = NULL;
+       struct do_info *dinfo = NULL;
+       int r;
+@@ -1603,7 +1603,7 @@ static int
+ pgp_update_new_algo_attr(sc_card_t *card, sc_cardctl_openpgp_keygen_info_t *key_info)
+ {
+       struct pgp_priv_data *priv = DRVDATA(card);
+-      struct blob *algo_blob;
++      pgp_blob_t *algo_blob;
+       unsigned int old_modulus_len;     /* Measured in bit */
+       unsigned int old_exponent_len;
+       const unsigned int tag = 0x00C0 | key_info->keytype;
+@@ -1708,7 +1708,7 @@ pgp_calculate_and_store_fingerprint(sc_card_t *card, time_t ctime,
+       u8 *p; /* Use this pointer to set fp_buffer content */
+       size_t pk_packet_len;
+       unsigned int tag;
+-      struct blob *fpseq_blob;
++      pgp_blob_t *fpseq_blob;
+       u8 *newdata;
+       int r;
+@@ -1797,7 +1797,7 @@ pgp_update_pubkey_blob(sc_card_t *card, u8* modulus, size_t modulus_len,
+                        u8* exponent, size_t exponent_len, u8 key_id)
+ {
+       struct pgp_priv_data *priv = DRVDATA(card);
+-      struct blob *pk_blob;
++      pgp_blob_t *pk_blob;
+       unsigned int blob_id;
+       sc_pkcs15_pubkey_t pubkey;
+       u8 *data = NULL;
+@@ -1939,6 +1939,8 @@ static int pgp_update_card_algorithms(sc_card_t *card, sc_cardctl_openpgp_keygen
+  **/
+ static int pgp_gen_key(sc_card_t *card, sc_cardctl_openpgp_keygen_info_t *key_info)
+ {
++      struct pgp_priv_data *priv = DRVDATA(card);
++      pgp_blob_t *algo_blob;
+       sc_apdu_t apdu;
+       /* Temporary variables to hold APDU params */
+       u8 apdu_case;
+@@ -2132,7 +2134,7 @@ pgp_build_extended_header_list(sc_card_t *card, sc_cardctl_openpgp_keystore_info
+       };
+       size_t comp_to_add = 3;
+       size_t req_e_len = 0;     /* The exponent length specified in Algorithm Attributes */
+-      struct blob *alat_blob;
++      pgp_blob_t *alat_blob;
+       u8 i;
+       int r;
+@@ -2483,7 +2485,7 @@ static int
+ pgp_delete_file(sc_card_t *card, const sc_path_t *path)
+ {
+       struct pgp_priv_data *priv = DRVDATA(card);
+-      struct blob *blob;
++      pgp_blob_t *blob;
+       sc_file_t *file;
+       u8 key_id;
+       int r;
+@@ -2533,7 +2535,7 @@ pgp_update_binary(sc_card_t *card, unsigned int idx,
+                 const u8 *buf, size_t count, unsigned long flags)
+ {
+       struct pgp_priv_data *priv = DRVDATA(card);
+-      struct blob *blob = priv->current;
++      pgp_blob_t *blob = priv->current;
+       int r = SC_SUCCESS;
+       LOG_FUNC_CALLED(card->ctx);
+-- 
+2.1.3
+
diff --git a/utils/opensc/patches/0024-OpenPGP-Fix-crash-after-accessing-inexistent-file.patch b/utils/opensc/patches/0024-OpenPGP-Fix-crash-after-accessing-inexistent-file.patch
new file mode 100644 (file)
index 0000000..7d8a0ff
--- /dev/null
@@ -0,0 +1,41 @@
+From 8a87a4ee9107f250254d5c93c6fd62224c400ce7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
+ <ng.hong.quan@gmail.com>
+Date: Mon, 14 Jul 2014 01:30:28 +0800
+Subject: [PATCH 24/26] OpenPGP: Fix crash after accessing inexistent file.
+
+---
+ src/libopensc/card-openpgp.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
+index ca3173c..94c69ae 100644
+--- a/src/libopensc/card-openpgp.c
++++ b/src/libopensc/card-openpgp.c
+@@ -973,7 +973,6 @@ pgp_select_file(sc_card_t *card, const sc_path_t *path, sc_file_t **ret)
+                        * So we set its size to be the same as max certificate size the card supports. */
+                       (*ret)->size = priv->max_cert_size;
+               }
+-              priv->current = NULL;
+               LOG_FUNC_RETURN(card->ctx, SC_SUCCESS);
+       }
+@@ -990,7 +989,6 @@ pgp_select_file(sc_card_t *card, const sc_path_t *path, sc_file_t **ret)
+               /* This file ID is refered when importing key&certificate via pkcs15init, like above.
+                * We pretend to successfully find this inexistent file. */
+               if (id == 0x4402 || id == 0x5f48) {
+-                      priv->current = NULL;
+                       if (ret == NULL)
+                               /* No need to return file */
+                               LOG_FUNC_RETURN(card->ctx, SC_SUCCESS);
+@@ -1002,7 +1000,6 @@ pgp_select_file(sc_card_t *card, const sc_path_t *path, sc_file_t **ret)
+               }
+               if (r < 0) {    /* failure */
+-                      priv->current = NULL;
+                       LOG_FUNC_RETURN(card->ctx, r);
+               }
+       }
+-- 
+2.1.3
+
diff --git a/utils/opensc/patches/0025-Replace-hardcode.patch b/utils/opensc/patches/0025-Replace-hardcode.patch
new file mode 100644 (file)
index 0000000..0eb750c
--- /dev/null
@@ -0,0 +1,148 @@
+From da70a41383e2ab81fbcc89fb1067f5a189e0fb97 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
+ <ng.hong.quan@gmail.com>
+Date: Sun, 9 Nov 2014 15:58:40 +0700
+Subject: [PATCH 25/26] Replace hardcode.
+
+---
+ src/libopensc/card-openpgp.c | 72 +++++++++++++++++++++++++-------------------
+ 1 file changed, 41 insertions(+), 31 deletions(-)
+
+diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
+index 94c69ae..1e6e338 100644
+--- a/src/libopensc/card-openpgp.c
++++ b/src/libopensc/card-openpgp.c
+@@ -152,6 +152,24 @@ static int                pgp_get_pubkey(sc_card_t *, unsigned int,
+ static int            pgp_get_pubkey_pem(sc_card_t *, unsigned int,
+                               u8 *, size_t);
++/* The DO holding X.509 certificate is constructed but does not contain child DO.
++ * We should notice this when building fake file system later. */
++#define DO_CERT                  0x7f21
++/* Control Reference Template of private keys. Ref: Section 4.3.3.7 of OpenPGP card v2 spec.
++ * Here we seen it as DO just for convenient */
++#define DO_SIGN                  0xb600
++#define DO_ENCR                  0xb800
++#define DO_AUTH                  0xa400
++/* These DO does not exist. They are defined and used just for ease of implementation */
++#define DO_SIGN_SYM              0xb601
++#define DO_ENCR_SYM              0xb801
++#define DO_AUTH_SYM              0xa401
++/* Maximum length for response buffer when reading pubkey. This value is calculated with
++ * 4096-bit key length */
++#define MAXLEN_RESP_PUBKEY       527
++/* Gnuk only support 1 key length (2048 bit) */
++#define MAXLEN_RESP_PUBKEY_GNUK  271
++
+ static struct do_info         pgp1_objects[] = {      /* OpenPGP card spec 1.1 */
+       { 0x004f, SIMPLE,      READ_ALWAYS | WRITE_NEVER, NULL,               NULL        },
+       { 0x005b, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  NULL,               sc_put_data },
+@@ -192,12 +210,12 @@ static struct do_info            pgp1_objects[] = {      /* OpenPGP card spec 1.1 */
+       { 0x5f35, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  NULL,               sc_put_data },
+       { 0x5f50, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  sc_get_data,        sc_put_data },
+       { 0x7f49, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, NULL,               NULL        },
+-      { 0xa400, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey,     NULL        },
+-      { 0xa401, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  pgp_get_pubkey_pem, NULL        },
+-      { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey,     NULL        },
+-      { 0xb601, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  pgp_get_pubkey_pem, NULL        },
+-      { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey,     NULL        },
+-      { 0xb801, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  pgp_get_pubkey_pem, NULL        },
++      { DO_AUTH,     CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey,     NULL   },
++      { DO_AUTH_SYM, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  pgp_get_pubkey_pem, NULL   },
++      { DO_SIGN,     CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey,     NULL   },
++      { DO_SIGN_SYM, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  pgp_get_pubkey_pem, NULL   },
++      { DO_ENCR,     CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey,     NULL   },
++      { DO_ENCR_SYM, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  pgp_get_pubkey_pem, NULL   },
+       { 0, 0, 0, NULL, NULL },
+ };
+@@ -246,30 +264,21 @@ static struct do_info            pgp2_objects[] = {      /* OpenPGP card spec 2.0 */
+       { 0x5f52, SIMPLE,      READ_ALWAYS | WRITE_NEVER, sc_get_data,        NULL        },
+       /* The 7F21 is constructed DO in spec, but in practice, its content can be retrieved
+        * as simple DO (no need to parse TLV). */
+-      { 0x7f21, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  sc_get_data,        sc_put_data },
++      { DO_CERT, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  sc_get_data,        sc_put_data },
+       { 0x7f48, CONSTRUCTED, READ_NEVER  | WRITE_NEVER, NULL,               NULL        },
+       { 0x7f49, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, NULL,               NULL        },
+-      { 0xa400, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey,     NULL        },
++      { DO_AUTH,     CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey,     NULL   },
+       /* The 0xA401, 0xB601, 0xB801 are just symbolic, it does not represent any real DO.
+        * However, their R/W access condition may block the process of importing key in pkcs15init.
+        * So we set their accesses condition as WRITE_PIN3 (writable). */
+-      { 0xa401, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  pgp_get_pubkey_pem, NULL        },
+-      { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey,     NULL        },
+-      { 0xb601, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  pgp_get_pubkey_pem, NULL        },
+-      { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey,     NULL        },
+-      { 0xb801, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  pgp_get_pubkey_pem, NULL        },
++      { DO_AUTH_SYM, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  pgp_get_pubkey_pem, NULL   },
++      { DO_SIGN,     CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey,     NULL   },
++      { DO_SIGN_SYM, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  pgp_get_pubkey_pem, NULL   },
++      { DO_ENCR,     CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey,     NULL   },
++      { DO_ENCR_SYM, SIMPLE,      READ_ALWAYS | WRITE_PIN3,  pgp_get_pubkey_pem, NULL   },
+       { 0, 0, 0, NULL, NULL },
+ };
+-/* The DO holding X.509 certificate is constructed but does not contain child DO.
+- * We should notice this when building fake file system later. */
+-#define DO_CERT                  0x7f21
+-/* Maximum length for response buffer when reading pubkey. This value is calculated with
+- * 4096-bit key length */
+-#define MAXLEN_RESP_PUBKEY       527
+-/* Gnuk only support 1 key length (2048 bit) */
+-#define MAXLEN_RESP_PUBKEY_GNUK  271
+-
+ #define DRVDATA(card)        ((struct pgp_priv_data *) ((card)->drv_data))
+ struct pgp_priv_data {
+       pgp_blob_t *            mf;
+@@ -747,8 +756,9 @@ pgp_read_blob(sc_card_t *card, pgp_blob_t *blob)
+               /* Buffer length for Gnuk pubkey */
+               if (card->type == SC_CARD_TYPE_OPENPGP_GNUK &&
+-                  (blob->id == 0xa400 || blob->id == 0xb600 || blob->id == 0xb800
+-                   || blob->id == 0xa401 || blob->id == 0xb601 || blob->id == 0xb801)) {
++                  (blob->id == DO_AUTH || blob->id == DO_SIGN || blob->id == DO_ENCR
++                   || blob->id == DO_AUTH_SYM || blob->id == DO_SIGN_SYM
++                   || blob->id == DO_ENCR_SYM)) {
+                       buf_len = MAXLEN_RESP_PUBKEY_GNUK;
+               }
+@@ -1804,11 +1814,11 @@ pgp_update_pubkey_blob(sc_card_t *card, u8* modulus, size_t modulus_len,
+       LOG_FUNC_CALLED(card->ctx);
+       if (key_id == SC_OPENPGP_KEY_SIGN)
+-              blob_id = 0xB601;
++              blob_id = DO_SIGN_SYM;
+       else if (key_id == SC_OPENPGP_KEY_ENCR)
+-              blob_id = 0xB801;
++              blob_id = DO_ENCR_SYM;
+       else if (key_id == SC_OPENPGP_KEY_AUTH)
+-              blob_id = 0xA401;
++              blob_id = DO_AUTH_SYM;
+       else {
+               sc_log(card->ctx, "Unknown key id %X.", key_id);
+               LOG_FUNC_RETURN(card->ctx, SC_ERROR_INVALID_ARGUMENTS);
+@@ -2501,17 +2511,17 @@ pgp_delete_file(sc_card_t *card, const sc_path_t *path)
+               LOG_FUNC_RETURN(card->ctx, SC_ERROR_NOT_SUPPORTED);
+       if (card->type != SC_CARD_TYPE_OPENPGP_GNUK &&
+-          (file->id == 0xB601 || file->id == 0xB801 || file->id == 0xA401)) {
++          (file->id == DO_SIGN_SYM || file->id == DO_ENCR_SYM || file->id == DO_AUTH_SYM)) {
+               /* These tags are just symbolic. We don't really delete it. */
+               r = SC_SUCCESS;
+       }
+-      else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == 0xB601) {
++      else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == DO_SIGN_SYM) {
+               r = gnuk_delete_key(card, 1);
+       }
+-      else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == 0xB801) {
++      else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == DO_ENCR_SYM) {
+               r = gnuk_delete_key(card, 2);
+       }
+-      else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == 0xA401) {
++      else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == DO_AUTH_SYM) {
+               r = gnuk_delete_key(card, 3);
+       }
+       else {
+-- 
+2.1.3
+
diff --git a/utils/opensc/patches/0026-hardcode-defines-for-DO-s.patch b/utils/opensc/patches/0026-hardcode-defines-for-DO-s.patch
new file mode 100644 (file)
index 0000000..d106e86
--- /dev/null
@@ -0,0 +1,53 @@
+From b9dae832db54b206a15bcc12e290cef50f31c3d0 Mon Sep 17 00:00:00 2001
+From: george <ggkitsas@yahoo.com>
+Date: Tue, 11 Nov 2014 16:16:15 +0100
+Subject: [PATCH 26/26] hardcode->defines for DO's
+
+---
+ src/libopensc/card-openpgp.c | 16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
+index 1e6e338..8464914 100644
+--- a/src/libopensc/card-openpgp.c
++++ b/src/libopensc/card-openpgp.c
+@@ -164,6 +164,18 @@ static int                pgp_get_pubkey_pem(sc_card_t *, unsigned int,
+ #define DO_SIGN_SYM              0xb601
+ #define DO_ENCR_SYM              0xb801
+ #define DO_AUTH_SYM              0xa401
++/* Private DO's */
++#define DO_PRIV1                 0x0101
++#define DO_PRIV2                 0x0102
++#define DO_PRIV3                 0x0103
++#define DO_PRIV4                 0x0104
++/* Cardholder information DO's */
++#define DO_CARDHOLDER            0x65
++#define DO_NAME                  0x5b
++#define DO_LANG_PREF             0x5f2d
++#define DO_SEX                   0x5f35
++
++
+ /* Maximum length for response buffer when reading pubkey. This value is calculated with
+  * 4096-bit key length */
+ #define MAXLEN_RESP_PUBKEY       527
+@@ -851,7 +863,7 @@ pgp_get_blob(sc_card_t *card, pgp_blob_t *blob, unsigned int id,
+       /* Special case:
+        * Gnuk does not have default value for children of DO 65 (DOs 5B, 5F2D, 5F35)
+        * So, if these blob was not found, we create it. */
+-      if (blob->id == 0x65 && (id == 0x5B || id == 0x5F2D || id == 0x5F35)) {
++      if (blob->id == DO_CARDHOLDER && (id == DO_NAME || id == DO_LANG_PREF || id == DO_SEX)) {
+               sc_log(card->ctx, "Create blob %X under %X", id, blob->id);
+               child = pgp_new_blob(card, blob, id, sc_file_new());
+               if (child) {
+@@ -1198,7 +1210,7 @@ pgp_get_data(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
+       /* For Gnuk card, if there is no certificate, it returns error instead of empty data.
+        * So, for this case, we ignore error and consider success */
+       if (r == SC_ERROR_DATA_OBJECT_NOT_FOUND && card->type == SC_CARD_TYPE_OPENPGP_GNUK
+-        && (tag == DO_CERT || tag == 0x0101 || tag == 0x0102 || tag == 0x0103 || tag == 0x0104)) {
++        && (tag == DO_CERT || tag == DO_PRIV1 || tag == DO_PRIV2 || tag == DO_PRIV3 || tag == DO_PRIV4)) {
+               r = SC_SUCCESS;
+               apdu.resplen = 0;
+       }
+-- 
+2.1.3
+
index da13a4e116caf13a52f36d527df3f1c54ea80e36..e53b84328181c161924b9c3a64da1a8ab21bf02f 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=http://downloads.xiph.org/releases/opus/
 PKG_MD5SUM:=20682e4d8d1ae9ec5af3cf43e808b8cb
 
 PKG_LICENSE:=BSD-2-Clause
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
 
 PKG_INSTALL:=1
index 82d016b7e1c2ff756a58b202a1e16204a106d1f0..d3b0765f85b7dd1dc1b3ab38940a86c3d8238bd8 100644 (file)
@@ -8,12 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pciutils
-PKG_VERSION:=3.2.1
+PKG_VERSION:=3.3.0
 PKG_RELEASE:=1
+PKG_USE_MIPS16:=0
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@KERNEL/software/utils/pciutils
-PKG_MD5SUM:=425b1acad6854cc2bbb06ac8e48e76fc
+PKG_MD5SUM:=bf6ce5c50b273ffc2d27f659e929a37e
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=GPL-2.0
index 583eb9a60edc41c38ad4af23a1261061a9603216..610a7553083d792342313da70aca471bbd5495a9 100644 (file)
@@ -1,6 +1,6 @@
 --- a/Makefile
 +++ b/Makefile
-@@ -108,7 +108,7 @@ distclean: clean
+@@ -111,7 +111,7 @@ distclean: clean
  install: all
  # -c is ignored on Linux, but required on FreeBSD
        $(DIRINSTALL) -m 755 $(DESTDIR)$(SBINDIR) $(DESTDIR)$(IDSDIR) $(DESTDIR)$(MANDIR)/man8 $(DESTDIR)$(MANDIR)/man7
index 9c1a067550d257711942de56758b47316325e81a..c6d690681572880b2f06544f403e27996d182fb7 100644 (file)
@@ -1,6 +1,6 @@
 --- a/Makefile
 +++ b/Makefile
-@@ -85,7 +85,7 @@ lspci: LDLIBS+=$(LIBKMOD_LIBS)
+@@ -88,7 +88,7 @@ lspci: LDLIBS+=$(LIBKMOD_LIBS)
  ls-kernel.o: CFLAGS+=$(LIBKMOD_CFLAGS)
  
  update-pciids: update-pciids.sh
index dbd46aab4f4246abb6edf68e51afda67661c8efb..c38d1cfc57104351810778f1dafd989bf3bbfac8 100644 (file)
@@ -6,6 +6,6 @@
  echo_n "Looking for access methods..."
 -LIBRESOLV=-lresolv
 +LIBRESOLV=
+ LIBEXT=so
  
  case $sys in
-       linux*)
index df0cdeaecd08884f2c7da0c2c095a6e3e64f8fd9..f5387f0399a8657c978894564a70e440182d46cd 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pcsc-lite
-PKG_VERSION:=1.8.11
+PKG_VERSION:=1.8.13
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/3991
-PKG_MD5SUM:=73502ca4ba6526727f9f49c63d805408
+PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4126
+PKG_MD5SUM:=4dcd22d20a6df8810fac5480cc320b6d
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=COPYING
diff --git a/utils/rpcd-mod-lxc/Makefile b/utils/rpcd-mod-lxc/Makefile
new file mode 100644 (file)
index 0000000..154336b
--- /dev/null
@@ -0,0 +1,37 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=rpcd-mod-lxc
+PKG_RELEASE=20141012
+
+PKG_LICENSE:=ISC
+
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/rpcd-mod-lxc
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=LXC rpcd module
+  DEPENDS:=+rpcd +liblxc
+  MAINTAINER:=Luka Perkov <luka@openwrt.org>
+endef
+
+define Build/Prepare
+       $(CP) ./files/* $(PKG_BUILD_DIR)/
+endef
+
+define Package/rpcd-mod-lxc/install
+       $(INSTALL_DIR) $(1)/usr/lib/rpcd
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/lxc.so $(1)/usr/lib/rpcd/
+endef
+
+$(eval $(call BuildPackage,rpcd-mod-lxc))
diff --git a/utils/rpcd-mod-lxc/files/CMakeLists.txt b/utils/rpcd-mod-lxc/files/CMakeLists.txt
new file mode 100644 (file)
index 0000000..4a728a0
--- /dev/null
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.6)
+PROJECT(rpcd-mod-lxc)
+ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations)
+
+INCLUDE_DIRECTORIES(include)
+FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
+
+SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
+SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
+
+SET(SOURCES lxc.c)
+
+ADD_LIBRARY(rpcd-mod-lxc SHARED ${SOURCES})
+
+FIND_LIBRARY(lxc NAMES lxc liblxc)
+TARGET_LINK_LIBRARIES(rpcd-mod-lxc ${lxc})
+
+SET_TARGET_PROPERTIES(rpcd-mod-lxc PROPERTIES OUTPUT_NAME lxc PREFIX "")
+INSTALL(TARGETS rpcd-mod-lxc LIBRARY DESTINATION lib)
diff --git a/utils/rpcd-mod-lxc/files/lxc.c b/utils/rpcd-mod-lxc/files/lxc.c
new file mode 100644 (file)
index 0000000..0d52f16
--- /dev/null
@@ -0,0 +1,504 @@
+/*
+ * rpcd-lxc-plugin
+ *
+ * Copyright (C) 2014 Cisco Systems, Inc.
+ * Author: Luka Perkov <luka@openwrt.org>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <libubus.h>
+
+#include <lxc/lxccontainer.h>
+
+#include <rpcd/plugin.h>
+
+static struct blob_buf buf;
+
+struct rpc_lxc {
+       /* ubus options */
+       char *name;
+       char *config;
+       /* lxc container */
+       struct lxc_container *container;
+};
+
+enum {
+       RPC_LXC_NAME,
+       RPC_LXC_CONFIG,
+       __RPC_LXC_MAX,
+};
+
+enum {
+       RPC_LXC_SHUTDOWN_NAME,
+       RPC_LXC_SHUTDOWN_CONFIG,
+       RPC_LXC_SHUTDOWN_TIMEOUT,
+       __RPC_LXC_SHUTDOWN_MAX,
+};
+
+enum {
+       RPC_LXC_RENAME_NAME,
+       RPC_LXC_RENAME_CONFIG,
+       RPC_LXC_RENAME_NEWNAME,
+       __RPC_LXC_RENAME_MAX,
+};
+
+enum {
+       RPC_LXC_CREATE_NAME,
+       RPC_LXC_CREATE_CONFIG,
+       RPC_LXC_CREATE_TEMPLATE,
+       RPC_LXC_CREATE_FLAGS,
+       RPC_LXC_CREATE_ARGS,
+       __RPC_LXC_CREATE_MAX,
+};
+
+static const struct blobmsg_policy rpc_lxc_min_policy[__RPC_LXC_MAX] = {
+       [RPC_LXC_NAME] = { .name = "name", .type = BLOBMSG_TYPE_STRING },
+       [RPC_LXC_CONFIG] = { .name = "config", .type = BLOBMSG_TYPE_STRING },
+};
+
+static const struct blobmsg_policy rpc_lxc_shutdown_policy[__RPC_LXC_SHUTDOWN_MAX] = {
+       [RPC_LXC_SHUTDOWN_NAME] = { .name = "name", .type = BLOBMSG_TYPE_STRING },
+       [RPC_LXC_SHUTDOWN_CONFIG] = { .name = "config", .type = BLOBMSG_TYPE_STRING },
+       [RPC_LXC_SHUTDOWN_TIMEOUT] = { .name = "timeout", .type = BLOBMSG_TYPE_INT32 },
+};
+
+static const struct blobmsg_policy rpc_lxc_rename_policy[__RPC_LXC_RENAME_MAX] = {
+       [RPC_LXC_RENAME_NAME] = { .name = "name", .type = BLOBMSG_TYPE_STRING },
+       [RPC_LXC_RENAME_CONFIG] = { .name = "config", .type = BLOBMSG_TYPE_STRING },
+       [RPC_LXC_RENAME_NEWNAME] = { .name = "newname", .type = BLOBMSG_TYPE_STRING },
+};
+
+static const struct blobmsg_policy rpc_lxc_create_policy[__RPC_LXC_CREATE_MAX] = {
+       [RPC_LXC_CREATE_NAME] = { .name = "name", .type = BLOBMSG_TYPE_STRING },
+       [RPC_LXC_CREATE_CONFIG] = { .name = "config", .type = BLOBMSG_TYPE_STRING },
+       [RPC_LXC_CREATE_TEMPLATE] = { .name = "template", .type = BLOBMSG_TYPE_STRING },
+       [RPC_LXC_CREATE_FLAGS] = { .name = "flags", .type = BLOBMSG_TYPE_INT32 },
+       [RPC_LXC_CREATE_ARGS] = { .name = "args", .type = BLOBMSG_TYPE_ARRAY },
+};
+
+static struct rpc_lxc *
+rpc_lxc_init(struct blob_attr *tb[__RPC_LXC_MAX])
+{
+       struct rpc_lxc *l = NULL;
+
+       l = calloc(1, sizeof(struct rpc_lxc));
+       if (!l) return NULL;
+
+       if (tb[RPC_LXC_NAME]) {
+               l->name = blobmsg_data(tb[RPC_LXC_NAME]);
+       } else {
+               goto error;
+       }
+
+       if (tb[RPC_LXC_CONFIG]) {
+               l->config = blobmsg_data(tb[RPC_LXC_CONFIG]);
+       } else {
+               l->config = NULL;
+       }
+
+       l->container = lxc_container_new(l->name, l->config);
+       if (!l->container) {
+               goto error;
+       }
+
+       return l;
+error:
+       free(l);
+       return NULL;
+}
+
+static void
+rpc_lxc_done(struct rpc_lxc *l)
+{
+       if (l) {
+               lxc_container_put(l->container);
+               free(l);
+       }
+
+       return;
+}
+
+static int
+rpc_lxc_start(struct ubus_context *ctx, struct ubus_object *obj,
+               struct ubus_request_data *req, const char *method,
+               struct blob_attr *msg)
+{
+       struct blob_attr *tb[__RPC_LXC_MAX];
+       struct rpc_lxc *l = NULL;
+       int rc;
+
+       blobmsg_parse(rpc_lxc_min_policy, __RPC_LXC_MAX, tb, blob_data(msg), blob_len(msg));
+
+       l = rpc_lxc_init(tb);
+       if (!l) return UBUS_STATUS_INVALID_ARGUMENT;
+
+       if (l->container->is_running(l->container)) {
+               rc = UBUS_STATUS_UNKNOWN_ERROR;
+               goto out;
+       }
+
+       if (!l->container->start(l->container, 0, NULL)) {
+               rc = UBUS_STATUS_INVALID_ARGUMENT;
+               goto out;
+       }
+
+       rc = UBUS_STATUS_OK;
+out:
+       rpc_lxc_done(l);
+       return rc;
+}
+
+
+static int
+rpc_lxc_reboot(struct ubus_context *ctx, struct ubus_object *obj,
+               struct ubus_request_data *req, const char *method,
+               struct blob_attr *msg)
+{
+       struct blob_attr *tb[__RPC_LXC_MAX];
+       struct rpc_lxc *l = NULL;
+       int rc;
+
+       blobmsg_parse(rpc_lxc_min_policy, __RPC_LXC_MAX, tb, blob_data(msg), blob_len(msg));
+
+       l = rpc_lxc_init(tb);
+       if (!l) return UBUS_STATUS_INVALID_ARGUMENT;
+
+       if (!l->container->is_running(l->container)) {
+               rc = UBUS_STATUS_UNKNOWN_ERROR;
+               goto out;
+       }
+
+       if (!l->container->reboot(l->container)) {
+               rc = UBUS_STATUS_INVALID_ARGUMENT;
+               goto out;
+       }
+
+       rc = UBUS_STATUS_OK;
+out:
+       rpc_lxc_done(l);
+       return rc;
+}
+
+static int
+rpc_lxc_shutdown(struct ubus_context *ctx, struct ubus_object *obj,
+               struct ubus_request_data *req, const char *method,
+               struct blob_attr *msg)
+{
+       struct blob_attr *tb[__RPC_LXC_SHUTDOWN_MAX];
+       struct rpc_lxc *l = NULL;
+       int rc;
+
+       blobmsg_parse(rpc_lxc_shutdown_policy, __RPC_LXC_SHUTDOWN_MAX, tb, blob_data(msg), blob_len(msg));
+
+       l = rpc_lxc_init(tb);
+       if (!l) return UBUS_STATUS_INVALID_ARGUMENT;
+
+       if (!l->container->is_running(l->container)) {
+               rc = UBUS_STATUS_UNKNOWN_ERROR;
+               goto out;
+       }
+
+       /* define default timeout */
+       int timeout = 30;
+       if (tb[RPC_LXC_SHUTDOWN_TIMEOUT]) {
+               timeout = blobmsg_get_u32(tb[RPC_LXC_SHUTDOWN_TIMEOUT]);
+       }
+
+       if (!l->container->shutdown(l->container, timeout)) {
+               rc = UBUS_STATUS_UNKNOWN_ERROR;
+               goto out;
+       }
+
+       rc = UBUS_STATUS_OK;
+out:
+       rpc_lxc_done(l);
+       return rc;
+}
+
+static int
+rpc_lxc_stop(struct ubus_context *ctx, struct ubus_object *obj,
+               struct ubus_request_data *req, const char *method,
+               struct blob_attr *msg)
+{
+       struct blob_attr *tb[__RPC_LXC_MAX];
+       struct rpc_lxc *l = NULL;
+       int rc;
+
+       blobmsg_parse(rpc_lxc_min_policy, __RPC_LXC_MAX, tb, blob_data(msg), blob_len(msg));
+
+       l = rpc_lxc_init(tb);
+       if (!l) return UBUS_STATUS_INVALID_ARGUMENT;
+
+       if (!l->container->is_running(l->container)) {
+               rc = UBUS_STATUS_UNKNOWN_ERROR;
+               goto out;
+       }
+
+       if (!l->container->stop(l->container)) {
+               rc = UBUS_STATUS_INVALID_ARGUMENT;
+               goto out;
+       }
+
+       rc = UBUS_STATUS_OK;
+out:
+       rpc_lxc_done(l);
+       return rc;
+}
+
+static int
+rpc_lxc_freeze(struct ubus_context *ctx, struct ubus_object *obj,
+               struct ubus_request_data *req, const char *method,
+               struct blob_attr *msg)
+{
+       struct blob_attr *tb[__RPC_LXC_MAX];
+       struct rpc_lxc *l = NULL;
+       int rc;
+
+       blobmsg_parse(rpc_lxc_min_policy, __RPC_LXC_MAX, tb, blob_data(msg), blob_len(msg));
+
+       l = rpc_lxc_init(tb);
+       if (!l) return UBUS_STATUS_INVALID_ARGUMENT;
+
+       if (!l->container->is_running(l->container)) {
+               rc = UBUS_STATUS_UNKNOWN_ERROR;
+               goto out;
+       }
+
+       if (!l->container->freeze(l->container)) {
+               rc = UBUS_STATUS_INVALID_ARGUMENT;
+               goto out;
+       }
+
+       rc = UBUS_STATUS_OK;
+out:
+       rpc_lxc_done(l);
+       return rc;
+}
+
+static int
+rpc_lxc_unfreeze(struct ubus_context *ctx, struct ubus_object *obj,
+               struct ubus_request_data *req, const char *method,
+               struct blob_attr *msg)
+{
+       struct blob_attr *tb[__RPC_LXC_MAX];
+       struct rpc_lxc *l = NULL;
+       int rc;
+
+       blobmsg_parse(rpc_lxc_min_policy, __RPC_LXC_MAX, tb, blob_data(msg), blob_len(msg));
+
+       l = rpc_lxc_init(tb);
+       if (!l) return UBUS_STATUS_INVALID_ARGUMENT;
+
+       if (!l->container->is_running(l->container)) {
+               rc = UBUS_STATUS_UNKNOWN_ERROR;
+               goto out;
+       }
+
+       if (!l->container->unfreeze(l->container)) {
+               rc = UBUS_STATUS_INVALID_ARGUMENT;
+               goto out;
+       }
+
+       rc = UBUS_STATUS_OK;
+out:
+       rpc_lxc_done(l);
+       return rc;
+}
+
+static int
+rpc_lxc_rename(struct ubus_context *ctx, struct ubus_object *obj,
+               struct ubus_request_data *req, const char *method,
+               struct blob_attr *msg)
+{
+       struct blob_attr *tb[__RPC_LXC_RENAME_MAX];
+       struct rpc_lxc *l = NULL;
+       int rc;
+
+       blobmsg_parse(rpc_lxc_rename_policy, __RPC_LXC_RENAME_MAX, tb, blob_data(msg), blob_len(msg));
+
+       l = rpc_lxc_init(tb);
+       if (!l) return UBUS_STATUS_INVALID_ARGUMENT;
+
+       if (!tb[RPC_LXC_RENAME_NEWNAME]) {
+               rc = UBUS_STATUS_INVALID_ARGUMENT;
+               goto out;
+       }
+
+       if (l->container->is_running(l->container)) {
+               rc = UBUS_STATUS_UNKNOWN_ERROR;
+               goto out;
+       }
+
+       char *newname = blobmsg_data(tb[RPC_LXC_RENAME_NEWNAME]);
+       if (!newname || !l->container->rename(l->container, newname)) {
+               rc = UBUS_STATUS_INVALID_ARGUMENT;
+               goto out;
+       }
+
+       rc = UBUS_STATUS_OK;
+out:
+       rpc_lxc_done(l);
+       return rc;
+}
+
+static int
+rpc_lxc_create(struct ubus_context *ctx, struct ubus_object *obj,
+               struct ubus_request_data *req, const char *method,
+               struct blob_attr *msg)
+{
+       struct blob_attr *tb[__RPC_LXC_CREATE_MAX];
+       struct rpc_lxc *l = NULL;
+       int rc;
+
+       char *template = "none";
+       int flags = 0;
+       char **args = NULL;
+
+       blobmsg_parse(rpc_lxc_create_policy, __RPC_LXC_CREATE_MAX, tb, blob_data(msg), blob_len(msg));
+
+       l = rpc_lxc_init(tb);
+       if (!l) return UBUS_STATUS_INVALID_ARGUMENT;
+
+       if (tb[RPC_LXC_CREATE_TEMPLATE])
+               template = blobmsg_data(tb[RPC_LXC_CREATE_TEMPLATE]);
+
+       if (tb[RPC_LXC_CREATE_FLAGS])
+               flags = blobmsg_get_u32(tb[RPC_LXC_CREATE_FLAGS]);
+
+       if (tb[RPC_LXC_CREATE_ARGS]) {
+               struct blob_attr *cur;
+               int num, rem;
+
+               num = blobmsg_check_array(tb[RPC_LXC_CREATE_ARGS], BLOBMSG_TYPE_STRING);
+
+               // trailing NULL is needed
+               args = calloc(num + 1, sizeof(char *));
+               if (!args) {
+                       rc = UBUS_STATUS_UNKNOWN_ERROR;
+                       goto out;
+               }
+
+               num = 0;
+               blobmsg_for_each_attr(cur, tb[RPC_LXC_CREATE_ARGS], rem)
+               {
+                       if (blobmsg_type(cur) != BLOBMSG_TYPE_STRING)
+                               continue;
+
+                       args[num++] = (char *) blobmsg_data(cur);
+               }
+       }
+
+       if (!l->container->create(l->container, template, NULL, NULL, flags, args)) {
+               rc = UBUS_STATUS_INVALID_ARGUMENT;
+               goto out;
+       }
+
+       rc = UBUS_STATUS_OK;
+out:
+       rpc_lxc_done(l);
+       free(args);
+       return rc;
+}
+
+static int
+rpc_lxc_destroy(struct ubus_context *ctx, struct ubus_object *obj,
+               struct ubus_request_data *req, const char *method,
+               struct blob_attr *msg)
+{
+       struct blob_attr *tb[__RPC_LXC_MAX];
+       struct rpc_lxc *l = NULL;
+       int rc;
+
+       blobmsg_parse(rpc_lxc_min_policy, __RPC_LXC_MAX, tb, blob_data(msg), blob_len(msg));
+
+       l = rpc_lxc_init(tb);
+       if (!l) return UBUS_STATUS_INVALID_ARGUMENT;
+
+       if (l->container->is_running(l->container)) {
+               rc = UBUS_STATUS_UNKNOWN_ERROR;
+               goto out;
+       }
+
+       if (!l->container->destroy(l->container)) {
+               rc = UBUS_STATUS_INVALID_ARGUMENT;
+               goto out;
+       }
+
+       rc = UBUS_STATUS_OK;
+out:
+       rpc_lxc_done(l);
+       return rc;
+}
+
+static int
+rpc_lxc_list(struct ubus_context *ctx, struct ubus_object *obj,
+               struct ubus_request_data *req, const char *method,
+               struct blob_attr *msg)
+{
+
+       blob_buf_init(&buf, 0);
+
+       int rc;
+       char **names;
+       struct lxc_container **cret;
+
+       rc = list_all_containers(NULL, &names, &cret);
+       if (rc == -1)
+               return UBUS_STATUS_UNKNOWN_ERROR;
+
+       for (int i = 0; i < rc; i++) {
+               struct lxc_container *c = cret[i];
+               blobmsg_add_string(&buf, names[i], c->state(c));
+
+               free(names[i]);
+               lxc_container_put(c);
+       }
+
+       ubus_send_reply(ctx, req, buf.head);
+
+       return UBUS_STATUS_OK;
+}
+
+static int
+rpc_lxc_api_init(const struct rpc_daemon_ops *o, struct ubus_context *ctx)
+{
+       static const struct ubus_method lxc_methods[] = {
+               UBUS_METHOD("start", rpc_lxc_start, rpc_lxc_min_policy),
+               UBUS_METHOD("reboot", rpc_lxc_reboot, rpc_lxc_min_policy),
+               UBUS_METHOD("shutdown", rpc_lxc_shutdown, rpc_lxc_shutdown_policy),
+               UBUS_METHOD("stop", rpc_lxc_stop, rpc_lxc_min_policy),
+               UBUS_METHOD("freeze", rpc_lxc_freeze, rpc_lxc_min_policy),
+               UBUS_METHOD("unfreeze", rpc_lxc_unfreeze, rpc_lxc_min_policy),
+               UBUS_METHOD("rename", rpc_lxc_rename, rpc_lxc_rename_policy),
+               UBUS_METHOD("create", rpc_lxc_create, rpc_lxc_create_policy),
+               UBUS_METHOD("destroy", rpc_lxc_destroy, rpc_lxc_min_policy),
+               UBUS_METHOD_NOARG("list", rpc_lxc_list),
+       };
+
+       static struct ubus_object_type lxc_type =
+               UBUS_OBJECT_TYPE("luci-rpc-lxc", lxc_methods);
+
+       static struct ubus_object obj = {
+               .name = "lxc",
+               .type = &lxc_type,
+               .methods = lxc_methods,
+               .n_methods = ARRAY_SIZE(lxc_methods),
+       };
+
+       return ubus_add_object(ctx, &obj);
+}
+
+struct rpc_plugin rpc_plugin = {
+       .init = rpc_lxc_api_init
+};
index fe099c3f2d93f15055a666807427819dd10d5775..98c02353514480e279e65c59aafaa92050ce8b18 100644 (file)
@@ -21,6 +21,7 @@ PKG_MD5SUM:=c466e2e7df95fa8e318e46437da87686
 PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
 
 PKG_FIXUP:=autoreconf
+PKG_CHECK_FORMAT_SECURITY:=0
 
 include $(INCLUDE_DIR)/package.mk
 
diff --git a/utils/sispmctl/Makefile b/utils/sispmctl/Makefile
new file mode 100644 (file)
index 0000000..ad6c1e3
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2008-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=sispmctl
+PKG_VERSION:=3.1+20120206
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=5ff4a05a5bcb6a64a9d6f77fed47014512f66b11
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=git://git.code.sf.net/p/sispmctl/git
+PKG_MAINTAINER:=Richard Kunze <richard.kunze@web.de>
+PKG_LICENSE:=GPL-2.0+
+
+PKG_INSTALL:=1
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/sispmctl
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Silver Shield PM Control for Linux
+  URL:=http://sispmctl.sourceforge.net/
+  DEPENDS:=+libusb-compat
+endef
+
+define Package/sispmctl/description
+ The sispmctl tool can control Gembird SIS-PM Silver Shield
+ programmable power outlet strips (also known under the name
+ Revolt Intelli-Plug) from the command line.
+ .
+ It can be used to switch on or off any of the programmable
+ power sockets of the SIS-PM via USB. It can also show the
+ current status of each power socket, and it can handle
+ multiple SIS-PM devices, too.
+endef
+
+TARGET_CFLAGS += -D_GNU_SOURCE
+CONFIGURE_ARGS += \
+       --enable-webless \
+       --disable-dependency-tracking
+
+define Package/sispmctl/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,sispmctl))
diff --git a/utils/sispmctl/patches/001-fix-includes.patch b/utils/sispmctl/patches/001-fix-includes.patch
new file mode 100644 (file)
index 0000000..218e22e
--- /dev/null
@@ -0,0 +1,25 @@
+--- a/src/sispm_ctl.c
++++ b/src/sispm_ctl.c
+@@ -33,6 +33,7 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <time.h>
++#include <sys/types.h>
+ #include <usb.h>
+ #include <assert.h>
+ #include "sispm_ctl.h"
+--- a/src/main.c
++++ b/src/main.c
+@@ -34,11 +34,11 @@
+ #define __USE_XOPEN
+ #include <time.h>
+ #include <signal.h>
+-#include <usb.h>
+ #include <assert.h>
+ #include <getopt.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
++#include <usb.h>
+ #include <fcntl.h>
index ad4c2ede03f4f86d19b26678abbe581359fe3c2a..eab8cb9a3ee5a5104b0b5c7167bd8801175125f1 100644 (file)
@@ -17,7 +17,7 @@ PKG_MD5SUM:=a806c6b10b186b7d06a7eab12c3bc880
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 PKG_MAINTAINER:=Christian Pointner <equinox@spreadspace.org>
 PKG_LICENSE:=GPL-2.0+
-PKG_LICENSE_FILE:=gpl-2.0.txt
+PKG_LICENSE_FILES:=gpl-2.0.txt
 include $(INCLUDE_DIR)/package.mk
 
 define Package/stm32flash
diff --git a/utils/stoken/Makefile b/utils/stoken/Makefile
new file mode 100644 (file)
index 0000000..7fcbdad
--- /dev/null
@@ -0,0 +1,77 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=stoken
+PKG_VERSION:=0.8
+PKG_REV:=c4d79ffbf5053e44be4b64da22b1b7fb6a51daf2
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/cernekee/stoken.git
+
+PKG_SOURCE_VERSION:=$(PKG_REV)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
+PKG_LICENSE:=LGPL-2.1
+PKG_INSTALL:=1
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/stoken/Default
+  TITLE:=stoken is a tokencode generator compatible with RSA SecurID 128-bit (AES)
+  URL:=http://sourceforge.net/p/stoken/
+  DEPENDS:= +libxml2 +libnettle
+endef
+
+define Package/stoken
+  $(call Package/stoken/Default)
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libstoken
+  MENU:=1
+endef
+
+define Package/stoken/description
+  stoken is a tokencode generator compatible with RSA SecurID 128-bit (AES). This package contains the cli
+endef
+
+define Package/libstoken
+  $(call Package/stoken/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+endef
+
+CONFIGURE_ARGS += \
+       --with-nettle
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libstoken*.{la,a,so*} $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/stoken.pc \
+               $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/stoken/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/stoken $(1)/usr/bin/
+endef
+
+define Package/libstoken/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libstoken*.so* $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,stoken))
+$(eval $(call BuildPackage,libstoken))
index c77eb8af311c451e2c2fb0b0863ab2f83b87616e..a50f1820024482240a8376c2cf3bb6de43e2d98a 100644 (file)
@@ -14,7 +14,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://ftp.astron.com/pub/tcsh/
 PKG_MD5SUM:=6eed09dbd4223ab5b6955378450d228a
 PKG_LICENSE:=BSD-4-Clause-UC
-PKG_LICENSE_FILE:=Copyright
+PKG_LICENSE_FILES:=Copyright
 
 PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
 
index 7b9e6611ffef9d4a0ccf396d718fa8da99bb0a93..733d074bacd0d4476fe09046d425f5e549bae6b1 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tracertools
-PKG_VERSION:=20140905
+PKG_VERSION:=20141027
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 
@@ -16,7 +16,7 @@ PKG_LICENSE:=GPL-3.0
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://gitorious.org/tracertools/tracertools.git
-PKG_SOURCE_VERSION:=4a6eb477a850e102f37b6f6690b0797ec664f36d
+PKG_SOURCE_VERSION:=9ba70d1fe4f3c0f24d565d98c79fee71711823f0
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 
@@ -37,7 +37,6 @@ endef
 define Package/tracertools/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/tracerstat $(1)/usr/bin/
-       ln -s tracerstat $(1)/usr/bin/tracerreq
 endef
 
 $(eval $(call BuildPackage,tracertools))
index 68464f8ced975b0329710290feae7d547195cb23..5b365cdd992997714436e1545aae065695033bce 100644 (file)
@@ -20,7 +20,7 @@ PKG_SOURCE_VERSION:=$(PKG_REV)
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 PKG_LICENSE:=GPL-3.0+
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 
 include $(INCLUDE_DIR)/package.mk
 
index 10c70cb68e017697280fd689c6e26ff4d679ee2d..82c567d5b1bdec9e2e7ea39744b541394f742d12 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=unrar
-PKG_VERSION:=5.1.7
+PKG_VERSION:=5.2.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=unrarsrc-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.rarlab.com/rar
-PKG_MD5SUM:=af571529a358c972872b91792ffc0a80
+PKG_MD5SUM:=69ef5af8442cbb7dfdebe298bfb9c61a
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
 PKG_LICENSE:=UnRAR
index e553b7aa99648e25e00f222390023c8c46bb9401..ca82e13535c5bebd6d2264bcb491cb605d1d7d63 100644 (file)
@@ -1,6 +1,5 @@
-diff -uprN a/unrar/makefile b/unrar/makefile
---- a/makefile 2014-06-12 13:36:14.723816266 +0200
-+++ b/makefile 2014-06-12 13:36:36.174531961 +0200
+--- a/makefile
++++ b/makefile
 @@ -2,12 +2,12 @@
  # Makefile for UNIX - unrar
  
index a90d6d33f1509a30b8af115ab7345cca7fbbea08..65ab016672157b115c6d9e2ca609aad45a93d03f 100644 (file)
@@ -8,17 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=usbmuxd
-PKG_VERSION:=1.0.8
+PKG_VERSION:=1.1.1
 PKG_RELEASE:=2
 PKG_SOURCE_PROTO:=git
 
 PKG_MAINTAINER:=Lukasz Baj <l.baj@radytek.com>
 PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING.GPLv2
+PKG_LICENSE_FILES:=COPYING.GPLv2
 
 PKG_SOURCE_URL:=https://github.com/libimobiledevice/usbmuxd.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=2f6d9d5f7047d4dd5ea9970721ba902301621ab2
+PKG_SOURCE_VERSION:=4bd7cd0d28e7f5920de51470b863f3aeee00409d
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 
 PKG_FIXUP:=autoreconf
index 72c7f271acd42464c480fbce82f919e8e7cee16e..512057c2a5dd5d2d1764a496c6224ce7a0d25078 100644 (file)
@@ -17,7 +17,7 @@ PKG_MD5SUM:=fe77d801ba69e0fb9b4914a04b9ff506
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=GPL-3.0+
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
 
 PKG_INSTALL:=1
 
diff --git a/utils/zoneinfo/Makefile b/utils/zoneinfo/Makefile
new file mode 100644 (file)
index 0000000..482ab16
--- /dev/null
@@ -0,0 +1,242 @@
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# Author: Michael Geddes
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=zoneinfo
+PKG_VERSION:=2014j
+PKG_VERSION_CODE:=2014j
+PKG_RELEASE:=2
+
+#As i couldn't find real license used "Puplic Domain"
+#as referense to http://www.iana.org/time-zones/repository/tz-link.html
+PKG_LICENSE:=Public Domain
+
+PKG_SOURCE:=tzdata$(PKG_VERSION).tar.gz
+PKG_SOURCE_CODE:=tzcode$(PKG_VERSION_CODE).tar.gz
+PKG_SOURCE_URL:=http://www.iana.org/time-zones/repository/releases
+PKG_MD5SUM:=2d7ea9c309f0d4e162e426e568290ca3
+
+include $(INCLUDE_DIR)/package.mk
+
+define Download/tzcode
+   FILE=$(PKG_SOURCE_CODE)
+   URL=$(PKG_SOURCE_URL)
+   MD5SUM=970119e9765bc5a9320368851c91ecb6
+endef
+
+$(eval $(call Download,tzcode))
+
+define Package/zoneinfo/Default
+  SUBMENU:=zoneinfo
+  TITLE:=Zone Information
+  SECTION:=utils
+  CATEGORY:=Utilities
+  MAINTAINER=Vladimir Ulrich <admin@evl.su>
+endef
+
+define Package/zoneinfo-core
+$(call Package/zoneinfo/Default)
+  TITLE:=Zone Information (core)
+endef
+
+define Package/zoneinfo-simple
+$(call Package/zoneinfo/Default)
+  TITLE:=Zone Information (simple)
+endef
+
+define Package/zoneinfo-africa
+$(call Package/zoneinfo/Default)
+  TITLE:=Zone Information (Africa)
+endef
+
+define Package/zoneinfo-northamerica
+$(call Package/zoneinfo/Default)
+  TITLE:=Zone Information (NorthAmerica)
+endef
+
+define Package/zoneinfo-southamerica
+$(call Package/zoneinfo/Default)
+  TITLE:=Zone Information (SouthAmerica)
+endef
+
+define Package/zoneinfo-poles
+$(call Package/zoneinfo/Default)
+  TITLE:=Zone Information (Arctic, Antarctic)
+endef
+
+define Package/zoneinfo-asia
+$(call Package/zoneinfo/Default)
+  TITLE:=Zone Information (Asia)
+endef
+
+define Package/zoneinfo-atlantic
+$(call Package/zoneinfo/Default)
+  TITLE:=Zone Information (Atlantic)
+endef
+
+define Package/zoneinfo-australia-nz
+$(call Package/zoneinfo/Default)
+  TITLE:=Zone Information (Australia-NZ)
+endef
+
+define Package/zoneinfo-pacific
+$(call Package/zoneinfo/Default)
+  TITLE:=Zone Information (Pacific)
+endef
+
+define Package/zoneinfo-europe
+$(call Package/zoneinfo/Default)
+  TITLE:=Zone Information (Europe)
+endef
+
+define Package/zoneinfo-india
+$(call Package/zoneinfo/Default)
+  TITLE:=Zone Information (India)
+endef
+
+define Build/Prepare
+       (cd $(PKG_BUILD_DIR) && tar -xzf $(DL_DIR)/$(PKG_SOURCE_CODE) && tar -xzf $(DL_DIR)/$(PKG_SOURCE))
+endef
+
+define Build/Compile
+       CFLAGS="$(HOST_CFLAGS)" \
+       $(MAKE) -C $(PKG_BUILD_DIR) -f Makefile \
+               $(HOST_CONFIGURE_OPTS) \
+               CC="$(HOSTCC)" \
+               LD="\$$$$(CC)" \
+               CPPFLAGS="$(HOST_CPPFLAGS)" \
+               LDFLAGS="$(HOST_LDFLAGS)" \
+               TOPDIR="$(PKG_INSTALL_DIR)" \
+               TZDIR="$(PKG_INSTALL_DIR)/zoneinfo" \
+               install
+endef
+
+define Package/zoneinfo-core/install
+       $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+       for i in \
+               CET CST6CDT EET EST EST5EDT GB-Eire Eire \
+               GB    GMT   GMT+0 GMT-0 GMT0  Greenwich  \
+               HST   MET   MST   MST7MDT                \
+               PRC   PST8PDT ROC ROK     UCT   UTC      \
+               Universal W-SU WET Zulu Etc/* zone.tab ; do \
+         $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+             $(1)/usr/share/zoneinfo ; \
+       done
+endef
+
+define Package/zoneinfo-simple/install
+       $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+       for i in Pacific/Honolulu     \
+               America/Anchorage   America/Los_Angeles America/Denver   \
+               America/Chicago     America/New_York    America/Caracas  \
+               America/Sao_Paulo   Europe/London       Europe/Paris     \
+               Africa/Cairo        Europe/Moscow       Asia/Dubai       \
+               Asia/Karachi        Asia/Dhaka          Asia/Bankok      \
+               Asia/Hong_Kong      Asia/Tokyo          Australia/Darwin \
+               Australia/Adelaide  Australia/Brisbane  Australia/Sydney \
+               Australia/Perth     Pacific/Noumea ; do \
+         $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+             $(1)/usr/share/zoneinfo ; \
+       done
+endef
+
+define Package/zoneinfo-africa/install
+       $(INSTALL_DIR) $(1)/usr/share/zoneinfo/Africa
+       $(CP) $(PKG_INSTALL_DIR)/zoneinfo/Africa/* \
+             $(1)/usr/share/zoneinfo/Africa
+endef
+
+define Package/zoneinfo-northamerica/install
+       $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+       for i in US America Canada Mexico Cuba Jamaica Navajo ; do \
+         $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+             $(1)/usr/share/zoneinfo ; \
+       done
+       rm  -rf $(1)/usr/share/zoneinfo/America/Argentina
+endef
+
+define Package/zoneinfo-southamerica/install
+       $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+       for i in Brazil Chile ; do \
+         $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+             $(1)/usr/share/zoneinfo ; \
+       done
+       $(INSTALL_DIR) $(1)/usr/share/zoneinfo/America/Argentina
+       $(CP) $(PKG_INSTALL_DIR)/zoneinfo/America/Argentina/* \
+             $(1)/usr/share/zoneinfo/America/Argentina
+endef
+
+define Package/zoneinfo-poles/install
+       $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+       for i in Antarctica Arctic ; do \
+         $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+             $(1)/usr/share/zoneinfo ; \
+       done
+endef
+
+define Package/zoneinfo-asia/install
+       $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+       for i in Asia Japan Singapore Hongkong ; do \
+         $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+             $(1)/usr/share/zoneinfo ; \
+       done
+endef
+
+define Package/zoneinfo-atlantic/install
+       $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+       for i in Atlantic Iceland ; do \
+         $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+             $(1)/usr/share/zoneinfo ; \
+       done
+endef
+
+define Package/zoneinfo-australia-nz/install
+       $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+       for i in NZ NZ-CHAT Australia ; do \
+         $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+             $(1)/usr/share/zoneinfo ; \
+       done
+endef
+
+define Package/zoneinfo-pacific/install
+       $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+       for i in Pacific Kwajalein ; do \
+         $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+             $(1)/usr/share/zoneinfo ; \
+       done
+endef
+
+define Package/zoneinfo-europe/install
+       $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+       for i in Europe Portugal Poland ; do \
+         $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+             $(1)/usr/share/zoneinfo ; \
+       done
+endef
+
+define Package/zoneinfo-india/install
+       $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+       for i in Indian ; do \
+         $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+             $(1)/usr/share/zoneinfo ; \
+       done
+endef
+
+$(eval $(call BuildPackage,zoneinfo-simple))
+$(eval $(call BuildPackage,zoneinfo-core))
+$(eval $(call BuildPackage,zoneinfo-africa))
+$(eval $(call BuildPackage,zoneinfo-northamerica))
+$(eval $(call BuildPackage,zoneinfo-southamerica))
+$(eval $(call BuildPackage,zoneinfo-poles))
+$(eval $(call BuildPackage,zoneinfo-asia))
+$(eval $(call BuildPackage,zoneinfo-atlantic))
+$(eval $(call BuildPackage,zoneinfo-australia-nz))
+$(eval $(call BuildPackage,zoneinfo-pacific))
+$(eval $(call BuildPackage,zoneinfo-europe))
+$(eval $(call BuildPackage,zoneinfo-india))