Fresh pull from upstream
authorRISCi_ATOM <bob@bobcall.me>
Fri, 12 May 2017 19:29:18 +0000 (15:29 -0400)
committerRISCi_ATOM <bob@bobcall.me>
Fri, 12 May 2017 19:29:18 +0000 (15:29 -0400)
520 files changed:
CONTRIBUTING.md [deleted file]
admin/debootstrap/Makefile
admin/openwisp-config/Makefile [new file with mode: 0644]
admin/sudo/Makefile
admin/syslog-ng/Makefile [new file with mode: 0644]
admin/syslog-ng/files/syslog-ng.conf [new file with mode: 0644]
admin/syslog-ng/files/syslog-ng.init [new file with mode: 0644]
kernel/exfat-nofuse/Makefile [deleted file]
lang/lua-bencode/Makefile
lang/lualanes/Makefile
lang/luarocks/Makefile
lang/luarocks/patches/02_allow_configure_uname_siteconfig_adjustment.patch [new file with mode: 0644]
lang/node/Makefile
lang/perl-cgi/Makefile
lang/perl-www-curl/Makefile [new file with mode: 0644]
lang/perl-www-curl/patches/100-perl-www-curl_disable_curl-config_hack.patch [new file with mode: 0644]
lang/perl-www-curl/patches/101-skip-preprocessor-symbol.path [new file with mode: 0644]
lang/perl-www-curl/patches/200-fix_default_lflags.patch [new file with mode: 0644]
lang/perl-xml-parser/Makefile
lang/perl/Config.in
lang/perl/Makefile
lang/perl/perlmod.mk
lang/php7-pecl-dio/Makefile
lang/php7-pecl-dio/patches/0000-unify-line-endings.patch [deleted file]
lang/php7-pecl-dio/patches/0001-fix-svn-prop.patch [deleted file]
lang/php7-pecl-dio/patches/0002-fix-Wunused-variable.patch [deleted file]
lang/php7-pecl-dio/patches/0003-Fix-Wmaybe-uninitialized.patch [deleted file]
lang/php7-pecl-dio/patches/0004-Fix-last-build-warning-Wunused-but-set-variable-sorr.patch [deleted file]
lang/php7-pecl-dio/patches/0005-Added-LICENCE-file-as-requested-in-Request-65869.patch [deleted file]
lang/php7-pecl-dio/patches/0006-Replace-ZEND_FETCH_RESOURCE-macro-with-zend_fetch_re.patch [deleted file]
lang/php7-pecl-dio/patches/0007-Replace-ZEND_REGISTER_RESOURCE-with-zend_register_re.patch [deleted file]
lang/php7-pecl-dio/patches/0008-RETURN_STRINGL-takes-only-2-arguments.patch [deleted file]
lang/php7-pecl-dio/patches/0009-Replace-zend_hash_find-with-zend_hash_str_find.patch [deleted file]
lang/php7-pecl-dio/patches/0010-Replace-dio_convert_to_long.patch [deleted file]
lang/php7-pecl-dio/patches/0011-Adopt-to-changed-stream-API-interface.patch [deleted file]
lang/php7-pecl-dio/patches/0012-Remove-ancient-macros-TSRMLS_CC-and-TSRMLS_DC.patch [deleted file]
lang/php7-pecl-dio/patches/0013-Fix-tests-for-legacy-interface.patch [deleted file]
lang/php7-pecl-dio/patches/0014-Add-missing-changes-from-changed-stream-API-interfac.patch [deleted file]
lang/php7-pecl-dio/patches/0015-Add-.gitignore.patch [deleted file]
lang/php7-pecl-dio/patches/0016-Add-additional-baudrates.patch [deleted file]
lang/php7-pecl-http/Makefile
lang/php7-pecl-http/patches.old/100_config9-m4.patch [new file with mode: 0644]
lang/php7-pecl-http/patches/100_config9-m4.patch [deleted file]
lang/php7-pecl-http/patches/100_php_http_etag_bigendian_check.patch [new file with mode: 0644]
lang/php7/Makefile
lang/php7/patches/0013-Add-support-for-use-of-the-system-timezone-database.patch
lang/php7/patches/0032-Use-system-timezone.patch
lang/php7/patches/0041-Add-patch-to-remove-build-timestamps-from-generated-.patch
lang/php7/patches/1005-fix-asm-constraints-in-aarch64-multiply-macro.patch [new file with mode: 0644]
lang/php7/pecl.mk
lang/python-cffi/Makefile
lang/python-gmpy/Makefile [deleted file]
lang/python-packages/Makefile
lang/python-pip/Makefile
lang/python-ply/Makefile
lang/python-pycparser/Makefile
lang/python-setuptools/Makefile
lang/python/Makefile
lang/python/files/python-host.mk
lang/python/files/python-package-dev.mk
lang/python/files/python-package.mk
lang/python/files/python-version.mk
lang/python/patches/005-fix-libffi-x86-64-configure.patch [deleted file]
lang/python/patches/011-do-not-prefer-ncursesw.patch [deleted file]
lang/python/patches/011-remove-setupterm-definition.patch [new file with mode: 0644]
lang/python3/Makefile
lang/python3/files/python3-host.mk [new file with mode: 0644]
lang/python3/files/python3-package-dev.mk
lang/python3/files/python3-package-lib2to3.mk
lang/python3/files/python3-package.mk
lang/python3/files/python3-version.mk [new file with mode: 0644]
lang/python3/patches/011-fix-ncursesw-definition-colisions.patch [new file with mode: 0644]
lang/python3/patches/016-adjust-config-paths.patch [new file with mode: 0644]
lang/ruby/Makefile
lang/ruby/patches/001-acinclude.m4_rename_aclocal.m4.patch [deleted file]
lang/ruby/ruby_find_pkgsdeps
lang/ruby/ruby_missingfiles
libs/boost/Makefile
libs/boost/patches/01_fiber_fix.patch
libs/dtc/Makefile [new file with mode: 0644]
libs/eventlog/Makefile [new file with mode: 0644]
libs/expat/Makefile
libs/fftw3/Makefile
libs/fftw3/patches/001-makefile.patch
libs/glib2/Makefile
libs/gnutls/Makefile
libs/icu/Makefile
libs/icu/patches/000-dont-cpy-files-from-topdirs.patch
libs/icu/patches/001-disable-strtod_l.patch [new file with mode: 0644]
libs/icu/patches/CVE-2017-7867_CVE-2017-7868.patch [new file with mode: 0644]
libs/libcanfestival/Makefile [new file with mode: 0644]
libs/libcanfestival/patches/001-sigval-ref-fix.patch [new file with mode: 0644]
libs/libcanfestival/patches/002-makefile-gcc-linker.patch [new file with mode: 0644]
libs/libcanfestival/patches/003-makefile-skip-examples.patch [new file with mode: 0644]
libs/libcoap/Makefile [new file with mode: 0644]
libs/libevhtp/Makefile [deleted file]
libs/libevhtp/patches/010-strcmp-endianness-fix.patch [deleted file]
libs/libexif/Makefile
libs/libextractor/Makefile
libs/libextractor/patches/002-ffmpeg2.9_api_backport.patch [new file with mode: 0644]
libs/libgd/Makefile
libs/libgee/Makefile
libs/libidn/Makefile
libs/libidn/patches/002-disable-po-docs-examples.patch
libs/libidn/patches/010-fix-idn-error-usage.patch
libs/liblz4/Makefile
libs/liboping/Makefile
libs/libpng/Makefile
libs/libshout/Makefile
libs/libshout/patches/100-add_with-openssl_option.patch [new file with mode: 0644]
libs/libshout/patches/120-vorbis-c.patch
libs/libshout/patches/140-no_example_doc_win32.patch
libs/libstrophe/Makefile
libs/libtasn1/Makefile
libs/libuecc/Makefile
libs/libuv/Makefile
libs/libvpx/Makefile
libs/libzdb/Makefile
libs/libzdb/patches/020-filterh-use-host-built-version.patch
libs/opus/Makefile
libs/pcre/Makefile
libs/pcre/patches/001-CVE-2017-7186 [new file with mode: 0644]
libs/poco/Makefile
libs/postgresql/Makefile
libs/protobuf/Makefile
libs/rxtx/Makefile [new file with mode: 0755]
libs/rxtx/patches/010-acm-devices.patch [new file with mode: 0755]
libs/sqlite3/Makefile
mail/dovecot/Makefile [new file with mode: 0644]
mail/dovecot/files/dovecot.init [new file with mode: 0644]
mail/dovecot/patches/001-configure_in.patch [new file with mode: 0644]
multimedia/ffmpeg/Config.in
multimedia/ffmpeg/Makefile
multimedia/grilo/Makefile
multimedia/gst1-libav/Config.in [new file with mode: 0644]
multimedia/gst1-libav/Makefile [new file with mode: 0644]
multimedia/icecast/Makefile
multimedia/icecast/libvorbisidec.mk [deleted file]
multimedia/icecast/patches/001-icecast-2.4.0-tremor.patch
multimedia/icecast/patches/005-no_examples_doc_win32.patch [new file with mode: 0644]
multimedia/icecast/patches/015-add_with-openssl_option.patch [new file with mode: 0644]
multimedia/ices/Makefile
net/adblock/Makefile
net/adblock/files/README.md
net/adblock/files/adblock-helper.sh [deleted file]
net/adblock/files/adblock-update.sh [deleted file]
net/adblock/files/adblock.conf
net/adblock/files/adblock.hotplug [deleted file]
net/adblock/files/adblock.init
net/adblock/files/adblock.sh [new file with mode: 0755]
net/adblock/files/www/adblock/index.html [deleted file]
net/apache/Makefile
net/apache/patches/002-test_char_h.patch
net/apache/patches/003-logdir_fix.patch
net/apache/patches/004-pidfile_fix.patch
net/apache/patches/005-httpd_conf.patch
net/apache/patches/006-remove-ssl3.patch [deleted file]
net/aria2/Makefile
net/bcp38/Makefile
net/bcp38/files/bcp38.config
net/bind/Config.in
net/bind/Makefile
net/bmon/Makefile
net/chrony/Makefile
net/cifs-utils/Makefile
net/clamav/Makefile [deleted file]
net/clamav/files/bytecode.cvd [deleted file]
net/clamav/files/clamav.config [deleted file]
net/clamav/files/clamav.init [deleted file]
net/clamav/files/freshclam.config [deleted file]
net/clamav/files/freshclam.init [deleted file]
net/clamav/patches/001-compile.patch [deleted file]
net/cshark/Makefile
net/ctorrent-svn/Makefile [deleted file]
net/ctorrent-svn/patches/100-compile-fix.patch [deleted file]
net/ctorrent-svn/patches/300-negative.patch [deleted file]
net/ctorrent-svn/patches/400-musl-compat.patch [deleted file]
net/ctorrent/Makefile [deleted file]
net/ctorrent/patches/100-CVE-2009-1759.patch [deleted file]
net/ctorrent/patches/100-negative-ints.patch [deleted file]
net/ctorrent/patches/200-musl-compat.patch [deleted file]
net/ddns-scripts/Makefile
net/ddns-scripts/files/ddns.defaults
net/ddns-scripts/files/dynamic_dns_functions.sh
net/ddns-scripts/files/dynamic_dns_lucihelper.sh
net/ddns-scripts/files/dynamic_dns_updater.sh
net/ddns-scripts/files/public_suffix_list.dat [new file with mode: 0644]
net/ddns-scripts/files/services
net/ddns-scripts/files/services_ipv6
net/ddns-scripts/files/update_cloudflare_com_v1.sh
net/ddns-scripts/files/update_cloudflare_com_v4.sh
net/ddns-scripts/files/update_godaddy_com_v1.sh
net/dnscrypt-proxy/Makefile
net/dnscrypt-proxy/files/dnscrypt-proxy.config
net/dnscrypt-proxy/files/dnscrypt-proxy.init
net/dynapoint/Makefile [new file with mode: 0644]
net/dynapoint/src/dynapoint.config [new file with mode: 0644]
net/dynapoint/src/dynapoint.init [new file with mode: 0644]
net/dynapoint/src/dynapoint.lua [new file with mode: 0644]
net/esniper/Makefile
net/fastd/Makefile
net/freeradius2/Config.in [deleted file]
net/freeradius2/Makefile [deleted file]
net/freeradius2/files/radiusd.init [deleted file]
net/freeradius2/patches/001-fix-makefile.patch [deleted file]
net/freeradius2/patches/002-config.patch [deleted file]
net/freeradius2/patches/004-ldap_configure.patch [deleted file]
net/freeradius2/patches/008-honor_ccpflags.patch [deleted file]
net/freeradius2/patches/010-disbale-openssl-check.patch [deleted file]
net/fwknop/Config.in
net/fwknop/Makefile
net/fwknop/files/fwknopd.init
net/git/Makefile
net/gnunet/Makefile
net/haproxy/Makefile
net/haproxy/patches/0001-BUG-MINOR-Fix-OSX-compilation-errors.patch [deleted file]
net/haproxy/patches/0002-BUG-MINOR-displayed-PCRE-version-is-running-release.patch [deleted file]
net/haproxy/patches/0003-MINOR-show-Built-with-PCRE-version.patch [deleted file]
net/haproxy/patches/0004-MINOR-show-Running-on-zlib-version.patch [deleted file]
net/haproxy/patches/0005-MINOR-Add-fe_req_rate-sample-fetch.patch [deleted file]
net/haproxy/patches/0006-MEDIUM-make-SO_REUSEPORT-configurable.patch [deleted file]
net/haproxy/patches/0007-BUG-MINOR-vars-use-sess-and-not-s-sess-in-action_sto.patch [deleted file]
net/haproxy/patches/0008-BUG-MINOR-vars-make-smp_fetch_var-more-robust-agains.patch [deleted file]
net/haproxy/patches/0009-BUG-MINOR-vars-smp_fetch_var-doesn-t-depend-on-HTTP-.patch [deleted file]
net/haproxy/patches/0010-BUG-MINOR-ssl-Check-malloc-return-code.patch [deleted file]
net/haproxy/patches/0011-BUG-MINOR-ssl-prevent-multiple-entries-for-the-same-.patch [deleted file]
net/haproxy/patches/0012-BUG-MINOR-systemd-make-the-wrapper-return-a-non-null.patch [deleted file]
net/haproxy/patches/0013-BUG-MINOR-systemd-always-restore-signals-before-exec.patch [deleted file]
net/haproxy/patches/0014-BUG-MINOR-systemd-check-return-value-of-calloc.patch [deleted file]
net/haproxy/patches/0015-MINOR-systemd-report-it-when-execve-fails.patch [deleted file]
net/haproxy/patches/0016-BUG-MEDIUM-systemd-let-the-wrapper-know-that-haproxy.patch [deleted file]
net/haproxy/patches/0017-BUILD-protocol-fix-some-build-errors-on-OpenBSD.patch [deleted file]
net/haproxy/patches/0018-BUILD-log-iovec-requires-to-include-sys-uio.h-on-Ope.patch [deleted file]
net/haproxy/patches/0019-BUILD-tcp-do-not-include-netinet-ip.h-for-IP_TTL.patch [deleted file]
net/haproxy/patches/0020-BUILD-checks-remove-the-last-strcat-and-eliminate-a-.patch [deleted file]
net/haproxy/patches/0021-BUILD-poll-remove-unused-hap_fd_isset-which-causes-a.patch [deleted file]
net/haproxy/patches/0022-MINOR-cfgparse-few-memory-leaks-fixes.patch [deleted file]
net/haproxy/patches/0023-MINOR-build-Allow-linking-to-device-atlas-library-fi.patch [deleted file]
net/haproxy/patches/0024-DOC-Fix-typo-in-description-of-st-parameter-in-man-p.patch [deleted file]
net/haproxy/patches/0025-BUG-MEDIUM-peers-on-shutdown-wake-up-the-appctx-not-.patch [deleted file]
net/haproxy/patches/0026-BUG-MEDIUM-peers-fix-use-after-free-in-peer_session_.patch [deleted file]
net/haproxy/patches/0027-BUG-MEDIUM-systemd-wrapper-return-correct-exit-codes.patch [deleted file]
net/haproxy/patches/0028-BUG-MEDIUM-srv-state-properly-restore-the-DRAIN-stat.patch [deleted file]
net/haproxy/patches/0029-BUG-MINOR-srv-state-allow-to-have-both-CMAINT-and-FD.patch [deleted file]
net/haproxy/patches/0030-BUG-MEDIUM-servers-properly-propagate-the-maintenanc.patch [deleted file]
net/haproxy/patches/0031-BUG-vars-Fix-set-var-converter-because-of-a-typo.patch [deleted file]
net/https-dns-proxy/Makefile
net/https-dns-proxy/files/https_dns_proxy.init
net/iotivity/Makefile
net/iotivity/files/etc/iotivity/oic_svr_db.cbor
net/iotivity/files/etc/iotivity/oic_svr_db.json
net/iotivity/patches/001-no_unit_test.patch
net/iotivity/patches/004-use-env.patch [deleted file]
net/iotivity/patches/020-Do-not-set-architecture-specific-flags.patch [deleted file]
net/iotivity/patches/020-linux-Add-more-architectures.patch [new file with mode: 0644]
net/iotivity/patches/021-add-some-more-architectures.patch [deleted file]
net/iotivity/patches/021-build-do-not-set-TARGET_ARCH-to-default.patch [new file with mode: 0644]
net/iotivity/patches/022-build-restrict-compiler-options-to-supported-archite.patch [new file with mode: 0644]
net/iotivity/patches/023-build-take-compiler-options-from-environment.patch [new file with mode: 0644]
net/iotivity/patches/030-remove-check-for-curl.patch
net/iotivity/patches/040-linux-Use-system-sqlite3.patch [new file with mode: 0644]
net/iotivity/patches/040-remove-provisioning.patch [deleted file]
net/iotivity/patches/050-csdk-move-OCEntityHandlerResponse-from-stack-to-heap.patch [new file with mode: 0644]
net/iotivity/patches/051-csdk-move-OCClientResponse-from-stack-to-heap.patch [new file with mode: 0644]
net/iotivity/patches/053-src-move-OCClientResponse-from-stack-to-heap.patch [new file with mode: 0644]
net/iotivity/patches/054-resource-encapsulation-deactivate-test-covergae.patch [deleted file]
net/iotivity/patches/060-security-fix-reading-of-permission-attribute-from-co.patch [deleted file]
net/iotivity/patches/061-Remove-the-endianness-dependency-for-credential.patch [deleted file]
net/iotivity/patches/062-Fix-memory-corruption-when-reading-inetgers-from-cbo.patch [deleted file]
net/iotivity/patches/070-Resource-container-Backported-init-fix-to-1.1-rel.patch [deleted file]
net/iotivity/patches/070-ssl-fix-compilation-against-non-debug-mbedtls.patch [new file with mode: 0644]
net/iotivity/patches/071-ssl-call-mbedtls_version_get_string-only-if-availabl.patch [new file with mode: 0644]
net/iotivity/patches/072-ssl-call-mbedtls_ssl_conf_renegotiation-only-if-avai.patch [new file with mode: 0644]
net/iotivity/patches/075-ssl-enable-usage-of-patched-mbed-functions-condition.patch [new file with mode: 0644]
net/iotivity/patches/078-use-system-mbedtls.patch [new file with mode: 0644]
net/iotivity/patches/080-zigbee_wrapper-do-not-check-for-floating-point.patch [new file with mode: 0644]
net/iotivity/patches/140-remove-glib2.patch
net/irssi/Makefile
net/isc-dhcp/Makefile
net/isc-dhcp/files/dhcrelay4.init
net/isc-dhcp/files/dhcrelay6.init
net/isc-dhcp/patches/100-relay-rfc3527-link-selection.patch [deleted file]
net/jool/Makefile [new file with mode: 0644]
net/keepalived/Makefile
net/keepalived/files/keepalived.config [new file with mode: 0644]
net/keepalived/files/keepalived.init
net/keepalived/patches/100-musl-compat.patch [deleted file]
net/keepalived/patches/101-0001-vrrp-update-struct-msghdr.patch [new file with mode: 0644]
net/keepalived/patches/101-0002-Reinstate-initialisation-of-msghdr-fields.patch [new file with mode: 0644]
net/keepalived/patches/101-update-struct-msghdr.patch [deleted file]
net/lftp/Makefile
net/lighttpd/Makefile [deleted file]
net/lighttpd/files/lighttpd.conf [deleted file]
net/lighttpd/files/lighttpd.init [deleted file]
net/luci-app-bcp38/Makefile
net/luci-app-bcp38/files/bcp38-cbi.lua
net/memcached/Makefile
net/mwan3-luci/Makefile
net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/advanced_wirelessconfig.lua [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_diagnostics.htm
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_hotplugscript.htm
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_mwanconfig.htm
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_networkconfig.htm
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_troubleshooting.htm
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_wirelessconfig.htm [new file with mode: 0644]
net/net-snmp/Makefile
net/net-snmp/files/snmpd.conf
net/net-snmp/files/snmpd.init
net/net-snmp/patches/000-cross-compile.patch [new file with mode: 0644]
net/net-snmp/patches/100-debian-statistics.patch
net/net-snmp/patches/110-debian-makefiles.patch
net/net-snmp/patches/120-debian-searchdirs.patch
net/net-snmp/patches/130-debian-extramibs.patch
net/net-snmp/patches/160-no_ldconfig.patch
net/net-snmp/patches/170-ldflags.patch
net/net-snmp/patches/800-format-security.patch [deleted file]
net/nfs-kernel-server/Makefile
net/nginx/Makefile
net/ntpd/Makefile
net/ntpd/files/ntpd.hotplug-helper [new file with mode: 0644]
net/ntpd/files/ntpd.init
net/ocserv/Makefile
net/ocserv/files/ocserv.conf.template
net/ocserv/patches/001-makefile-fix.patch [deleted file]
net/openssh/Makefile
net/openssh/patches/100-openssh-7.3_p1-NEWKEYS_null_deref.patch [deleted file]
net/openssh/patches/101-Unregister-the-KEXINIT-handler-after-receive.patch [deleted file]
net/openvswitch/Makefile
net/pen/Makefile [new file with mode: 0644]
net/pptpd/files/pptpd.init
net/prosody/Makefile
net/rsync/Makefile
net/seafile-ccnet/patches/010-Makefile.patch
net/seafile-server/Config.in [deleted file]
net/seafile-server/Makefile [deleted file]
net/seafile-server/files/seafile.conf [deleted file]
net/seafile-server/files/seafile.init [deleted file]
net/seafile-server/files/seahub.init [deleted file]
net/seafile-server/patches/020-script-patches.patch [deleted file]
net/seafile-server/patches/030-pidfiles-in-same-directory.patch [deleted file]
net/seafile-server/patches/040-seafile-admin.patch [deleted file]
net/seafile-server/patches/050-libseafile-makefile-fixes.patch [deleted file]
net/seafile-server/patches/060-timestamps-as-int64.patch [deleted file]
net/seafile-server/patches/070-fuse-mount.patch [deleted file]
net/ser2net/Makefile
net/shadowsocks-libev/Makefile
net/sngrep/Makefile
net/socat/Makefile
net/socat/patches/110-drop_egd_sslv3_support.patch [new file with mode: 0644]
net/softethervpn/Makefile [new file with mode: 0644]
net/softethervpn/files/dummy [new file with mode: 0644]
net/softethervpn/files/launcher.sh [new file with mode: 0755]
net/softethervpn/files/vpnbridge.init [new file with mode: 0644]
net/softethervpn/files/vpnclient.init [new file with mode: 0644]
net/softethervpn/files/vpnserver.init [new file with mode: 0644]
net/softethervpn/patches/103-noeucjp.patch [new file with mode: 0644]
net/softethervpn/patches/105-nossl3.patch [new file with mode: 0644]
net/sqm-scripts/Makefile
net/sstp-client/Makefile
net/strongswan/Makefile
net/stunnel/Makefile
net/subversion/Makefile [new file with mode: 0644]
net/subversion/files/subversion.config [new file with mode: 0644]
net/subversion/files/subversion.init [new file with mode: 0644]
net/subversion/patches/301-cross-compilation-macos.patch [new file with mode: 0644]
net/tor/Makefile
net/tor/patches/001-torrc.patch
net/transmission/Makefile
net/transmission/patches/020-use-internal-miniupnp.patch
net/transmission/patches/030-fix-musl-build.patch
net/transmission/patches/040-fix-for-mbedtls.patch [new file with mode: 0644]
net/transmission/patches/050-mask-as-release.patch [new file with mode: 0644]
net/travelmate/Makefile
net/travelmate/files/README.md
net/travelmate/files/travelmate.conf
net/travelmate/files/travelmate.init
net/travelmate/files/travelmate.sh
net/umurmur/Makefile
net/umurmur/patches/010-mbedtls_fix_includes.patch [new file with mode: 0644]
net/umurmur/patches/10-Add-compile-time-check-for-POLARSSL_VERSION_FEATURES.patch [deleted file]
net/unbound/Makefile
net/unbound/files/README.md
net/unbound/files/dnsmasq.sh
net/unbound/files/odhcpd.awk [new file with mode: 0644]
net/unbound/files/odhcpd.sh [new file with mode: 0644]
net/unbound/files/root.key
net/unbound/files/rootzone.sh
net/unbound/files/unbound.iface [deleted file]
net/unbound/files/unbound.init
net/unbound/files/unbound.ntpd
net/unbound/files/unbound.sh
net/unbound/files/unbound.uci
net/unbound/files/unbound_ext.conf [new file with mode: 0644]
net/unbound/files/unbound_srv.conf [new file with mode: 0644]
net/unbound/patches/001-conf.patch
net/vsftpd/Makefile
net/vsftpd/files/vsftpd.conf
net/wireguard/Makefile
net/wireguard/files/wireguard.sh
net/xl2tpd/Makefile
net/xl2tpd/patches/200-xl2tpd-control-fix-xl2tpd-hanged-up-in-fopen.patch [new file with mode: 0644]
net/zerotier/Config.in [new file with mode: 0644]
net/zerotier/Makefile [new file with mode: 0644]
net/zerotier/files/zerotier.config [new file with mode: 0644]
net/zerotier/files/zerotier.init [new file with mode: 0644]
net/zerotier/patches/0001-Fix-for-running-under-MUSL-libc-e.g.-Alpine-Linux.patch [new file with mode: 0644]
net/zerotier/patches/0002-fix-build.patch [new file with mode: 0644]
net/zerotier/patches/0003-workaround_to_avoid_seg_faults.patch [new file with mode: 0644]
net/zerotier/patches/0005-use-external-miniupnpc-and-natpmp.patch [new file with mode: 0644]
sound/mocp/Makefile
sound/pianod/Makefile
sound/pianod/patches/005-Remove_svn_version_query.patch [deleted file]
sound/pianod/patches/010-Configure_add_SSL_options.patch [deleted file]
sound/pianod/patches/020-Use_package_config_h_for_all_modules.patch [deleted file]
sound/pianod/patches/030-Waitress_add_polarssl_variant.patch [deleted file]
sound/shairport-sync/Makefile
sound/shairport-sync/patches/100-replace_polarssl_with_mbedtls.patch [new file with mode: 0644]
sound/shine/Makefile
sound/shine/patches/002-fix-name-collision-with-ffmpeg.patch [new file with mode: 0644]
sound/sox/Makefile
sound/sox/patches/001-cross_compile.patch
sound/sox/patches/010-fix_uclibc_build_issue.patch
sound/sox/patches/020-ffmpeg-0.11.patch [deleted file]
sound/sox/patches/020-ffmpeg-2.x.patch [deleted file]
utils/bandwidthd-php/Makefile [deleted file]
utils/bandwidthd-php/files/bandwidthd-php.config [deleted file]
utils/bandwidthd-php/files/bandwidthd-php.init [deleted file]
utils/bandwidthd-php/files/details.php [deleted file]
utils/bandwidthd-php/files/footer.php [deleted file]
utils/bandwidthd-php/files/graph.php [deleted file]
utils/bandwidthd-php/files/include.php [deleted file]
utils/bandwidthd-php/files/index.php [deleted file]
utils/bandwidthd-php/files/legend.gif [deleted file]
utils/bandwidthd-php/files/logo.gif [deleted file]
utils/bandwidthd/Makefile
utils/bandwidthd/files/bandwidthd-pgsql.config
utils/bandwidthd/files/bandwidthd-pgsql.init [deleted file]
utils/bandwidthd/files/bandwidthd-php.config [new file with mode: 0644]
utils/bandwidthd/files/bandwidthd-php.init [new file with mode: 0755]
utils/bandwidthd/files/bandwidthd-sqlite.config [new file with mode: 0644]
utils/bandwidthd/files/bandwidthd-sqlite.init [new file with mode: 0755]
utils/bandwidthd/files/bandwidthd.config
utils/bandwidthd/files/bandwidthd.init [changed mode: 0644->0755]
utils/bandwidthd/files/logo-openwrt.gif [new file with mode: 0644]
utils/bandwidthd/files/logo.gif [deleted file]
utils/bandwidthd/files/phphtdocs-sqlite/details.php [new file with mode: 0644]
utils/bandwidthd/files/phphtdocs-sqlite/footer.php [new file with mode: 0644]
utils/bandwidthd/files/phphtdocs-sqlite/graph.php [new file with mode: 0644]
utils/bandwidthd/files/phphtdocs-sqlite/include.php [new file with mode: 0644]
utils/bandwidthd/files/phphtdocs-sqlite/index.php [new file with mode: 0644]
utils/bandwidthd/files/phphtdocs/details.php [new file with mode: 0644]
utils/bandwidthd/files/phphtdocs/footer.php [new file with mode: 0644]
utils/bandwidthd/files/phphtdocs/graph.php [new file with mode: 0644]
utils/bandwidthd/files/phphtdocs/include.php [new file with mode: 0644]
utils/bandwidthd/files/phphtdocs/index.php [new file with mode: 0644]
utils/bandwidthd/patches/010-dont-add-host-paths-in-config.in.patch [new file with mode: 0644]
utils/bandwidthd/patches/010-dont-add-host-paths.patch [deleted file]
utils/bandwidthd/patches/020-change-p2p-to-smtp.patch [new file with mode: 0644]
utils/bandwidthd/patches/100-fix_config_file_location [deleted file]
utils/ccid/Makefile
utils/ccrypt/Makefile
utils/collectd/Makefile
utils/collectd/patches/050-upstream-fix-for-network-plugin-ddos.patch [new file with mode: 0644]
utils/collectd/patches/200-fix-git-describe-error.patch
utils/collectd/patches/600-fix-libmodbus-detection.patch
utils/collectd/patches/900-add-iwinfo-plugin.patch
utils/collectd/patches/920-fix-ping-droprate.patch
utils/coreutils/Makefile
utils/dbus/Makefile
utils/dump1090/Makefile
utils/ecdsautils/Makefile [new file with mode: 0644]
utils/flent-tools/Makefile
utils/gnupg/Makefile
utils/gpsd/Makefile
utils/gpsd/files/gpsd.config
utils/gpsd/files/gpsd.hotplug [deleted file]
utils/gpsd/patches/0001-Remove-a-BSD-ism.patch [deleted file]
utils/gpsd/patches/0002-ncurses6_detection.patch [new file with mode: 0644]
utils/grep/Makefile
utils/hamlib/Makefile [new file with mode: 0644]
utils/haveged/Makefile
utils/hfsprogs/Makefile [deleted file]
utils/hfsprogs/files/hfsfsck.sh [deleted file]
utils/hfsprogs/patches/0001-Create-short-Makefiles-for-Debian.patch [deleted file]
utils/hfsprogs/patches/0002-Add-exclude-Darwin-specific-code.patch [deleted file]
utils/hfsprogs/patches/0003-Add-helper-include-files-absent-from-the-upstream-pa.patch [deleted file]
utils/hfsprogs/patches/0004-Fix-compilation-on-64-bit-arches.patch [deleted file]
utils/hfsprogs/patches/0005-Remove-Apple-specific-p-from-strings.patch [deleted file]
utils/hfsprogs/patches/0006-Adjust-types-for-printing.patch [deleted file]
utils/hfsprogs/patches/0007-Fix-path-for-HFS-wrapper-block.patch [deleted file]
utils/hfsprogs/patches/0008-Provide-command-line-option-a.patch [deleted file]
utils/hfsprogs/patches/0009-Rename-dprintf-to-dbg_printf.patch [deleted file]
utils/hfsprogs/patches/0010-Rename-custom-macro-nil-with-NULL.patch [deleted file]
utils/hfsprogs/patches/0011-Fix-types.patch [deleted file]
utils/hfsprogs/patches/0012-Fix-mkfs-not-creating-UUIDs-for-new-filesystems.patch [deleted file]
utils/hfsprogs/patches/0013-Fix-manpages.patch [deleted file]
utils/hfsprogs/patches/0014-uClibc_no_loadavg.patch [deleted file]
utils/hfsprogs/patches/0015-sysctl-only-on-glibc.patch [deleted file]
utils/io/Makefile [new file with mode: 0644]
utils/io/src/io.c [new file with mode: 0644]
utils/irqbalance/Makefile [new file with mode: 0644]
utils/irqbalance/patches/100-disable-ui-compilation.patch [new file with mode: 0644]
utils/irqbalance/patches/200-avoid-glib.patch [new file with mode: 0644]
utils/mysql/files/mysqld.init
utils/nano/Makefile
utils/open-plc-utils/Makefile
utils/open-plc-utils/patches/100-musl-compat.patch [deleted file]
utils/pcsc-lite/Makefile
utils/qemu/Makefile
utils/rng-tools/files/rngd.init
utils/tar/Makefile
utils/tar/patches/001-CVE-2016-6321.patch [new file with mode: 0644]
utils/tmux/Makefile
utils/unzip/Makefile
utils/unzip/patches/008-cve-2014-9913-unzip-buffer-overflow.patch [new file with mode: 0644]
utils/unzip/patches/009-cve-2016-9844-zipinfo-buffer-overflow.patch [new file with mode: 0644]
utils/xz/Makefile
utils/zip/Makefile
utils/zip/patches/001-unix-configure-borrow-the-LFS-test-from-autotools.patch [new file with mode: 0644]

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
deleted file mode 100644 (file)
index 29ba5db..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-# Contributing Guidelines  
-(See <http://wiki.openwrt.org/doc/devel/packages> for overall format and construction)
-
-
-### Basic guidelines
-
-All packages you commit or submit by pull-request should follow these simple guidelines:
-* Package a version which is still maintained by the upstream author.
-* Will be updated regularly to maintained and supported versions.
-* Have no dependencies outside the OpenWrt core packages or this repository feed.
-* Have been tested to compile with the correct includes and dependencies. Please also test with "Compile with full language support" found under "General Build Settings" set if language support is relevant to your package.
-* Do NOT use a rolling source file (e.g. foo-latest.tar.gz) or the head of a branch as source for the package since that would create unpredictable builds which change over time.
-* Best of all -- it works as expected!
-
-#### Makefile contents should contain:
-
-* An up-to-date copyright notice. Use OpenWrt if no other present or supply your own.
-* A (PKG_)MAINTAINER definition listing either yourself or another person in the field.
-    (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_FILES tag including the filenames of the license-files in the source-package.
-    (E.g.: PKG_LICENSE_FILES:=COPYING)
-* PKG_RELEASE should be initially set to 1 or reset to 1 if the software version is changed. You should increment it if the package itself has changed. For example, modifying a support script, changing configure options like --disable* or --enable* switches, or if you changed something in the package which causes the resulting binaries to be different. Changes like correcting md5sums, changing mirror URLs, adding a maintainer field or updating a comment or copyright year in a Makefile do not require a change to PKG_RELEASE.
-
-#### Commits in your pull-requests should:
-
-* Have a useful description prefixed with the package name
-    (E.g.: "foopkg: Add libzot dependency")
-* Include Signed-off-by in the comment
-    (See <https://dev.openwrt.org/wiki/SubmittingPatches#a10.Signyourwork>)
-
-### Advice on pull requests:
-
-Pull requests are the easiest way to contribute changes to git repos at Github. They are the preferred contribution method, as they offer a nice way for commenting and amending the proposed changes.
-
-* You need a local "fork" of the Github repo.
-* Use a "feature branch" for your changes. That separates the changes in the pull request from your other changes and makes it easy to edit/amend commits in the pull request. Workflow using "feature_x" as the example:
-  - Update your local git fork to the tip (of the master, usually)
-  - Create the feature branch with `git checkout -b feature_x`
-  - Edit changes and commit them locally
-  - Push them to your Github fork by `git push -u origin feature_x`. That creates the "feature_x" branch at your Github fork and sets it as the remote of this branch
-  - When you now visit Github, you should see a proposal to create a pull request
-
-* If you later need to add new commits to the pull request, you can simply commit the changes to the local branch and then use `git push` to automatically update the pull request.
-
-* If you need to change something in the existing pull request (e.g. to add a missing signed-off-by line to the commit message), you can use `git push -f` to overwrite the original commits. That is easy and safe when using a feature branch. Example workflow:
-  - Checkout the feature branch by `git checkout feature_x`
-  - Edit changes and commit them locally. If you are just updating the commit message in the last commit, you can use `git commit --amend` to do that
-  - If you added several new commits or made other changes that require cleaning up, you can use `git rebase -i HEAD~X` (X = number of commits to edit) to possibly squash some commits
-  - Push the changed commits to Github with `git push -f` to overwrite the original commits in the "feature_x" branch with the new ones. The pull request gets automatically updated
-
-### If you have commit access:
-
-* Do NOT use git push --force.
-* Do NOT commit to other maintainer's packages without their consent.
-* Use Pull Requests if you are unsure and to suggest changes to other maintainers.
-
-#### Gaining commit access:
-
-* We will gladly grant commit access to responsible contributors who have made
-  useful pull requests and / or feedback or patches to this repository or
-  OpenWrt in general. Please include your request for commit access in your
-  next pull request or ticket.
-
-### Release Branches:
-
-* Branches named "for-XX.YY" (e.g. for-14.07) are release branches.
-* These branches are built with the respective OpenWrt release and are created
-  during the release stabilisation phase.
-* Please ONLY cherry-pick or commit security and bug-fixes to these branches.
-* Do NOT add new packages and do NOT do major upgrades of packages here.
-* If you are unsure if your change is suitable, please use a pull request.
-
-### Common LICENSE tags (short list)  
-(Complete list can be found at: <http://spdx.org/licenses>)
-
-| Full Name | Identifier  |
-|---|:---|
-|Apache License 1.0|Apache-1.0|
-|Apache License 1.1|Apache-1.1|
-|Apache License 2.0|Apache-2.0|
-|Artistic License 1.0|Artistic-1.0|
-|Artistic License 1.0 (Perl)|Artistic-1.0-Perl|
-|Artistic License 1.0 w/clause 8|Artistic-1.0-cl8|
-|Artistic License 2.0|Artistic-2.0|
-|BSD 2-clause "Simplified" License|BSD-2-Clause|
-|BSD 2-clause FreeBSD License|BSD-2-Clause-FreeBSD|
-|BSD 2-clause NetBSD License|BSD-2-Clause-NetBSD|
-|BSD 3-clause "New" or "Revised" License|BSD-3-Clause|
-|BSD 3-clause Clear License|BSD-3-Clause-Clear|
-|BSD 4-clause "Original" or "Old" License|BSD-4-Clause|
-|BSD Protection License|BSD-Protection|
-|BSD with attribution|BSD-3-Clause-Attribution|
-|BSD-4-Clause (University of California-Specific)|BSD-4-Clause-UC|
-|GNU General Public License v1.0 only|GPL-1.0|
-|GNU General Public License v1.0 or later|GPL-1.0+|
-|GNU General Public License v2.0 only|GPL-2.0|
-|GNU General Public License v2.0 or later|GPL-2.0+|
-|GNU General Public License v3.0 only|GPL-3.0|
-|GNU General Public License v3.0 or later|GPL-3.0+|
-|GNU Lesser General Public License v2.1 only|LGPL-2.1|
-|GNU Lesser General Public License v2.1 or later|LGPL-2.1+|
-|GNU Lesser General Public License v3.0 only|LGPL-3.0|
-|GNU Lesser General Public License v3.0 or later|LGPL-3.0+|
-|GNU Library General Public License v2 only|LGPL-2.0|
-|GNU Library General Public License v2 or later|LGPL-2.0+|
-|Fair License|Fair|
-|ISC License|ISC|
-|MIT License|MIT|
-|No Limit Public License|NLPL|
-|OpenSSL License|OpenSSL|
-|X11 License|X11|
-|zlib License|Zlib|
index a7d45c2640224db9a605d81c590c7141e80feaa9..72d2c5bef7c1865882a14ffef1a18d72efac580e 100644 (file)
@@ -9,13 +9,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=debootstrap
-PKG_VERSION:=1.0.83
+PKG_VERSION:=1.0.87
 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:=877fe5281a0e424bd6c71d121cbb725b8f56694e66558cd47c20c3aa87ceff72
+PKG_MD5SUM:=784f5754f3287ae80715d9100a4ed04e7895be5f7b81b7b2295d335dd69d79fb
 PKG_LICENSE:=Unique
 PKG_LICENSE_FILES:=debian/copyright
 
diff --git a/admin/openwisp-config/Makefile b/admin/openwisp-config/Makefile
new file mode 100644 (file)
index 0000000..ed539b0
--- /dev/null
@@ -0,0 +1,119 @@
+# openwisp.org
+#
+# This is free software, licensed under the GNU General Public License v3.
+# See /LICENSE for more information.
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=openwisp-config
+PKG_VERSION:=0.4.5
+PKG_RELEASE:=1
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/openwisp/openwisp-config.git
+PKG_SOURCE_VERSION:=0.4.5
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
+PKG_MIRROR_HASH:=017a8ed35ebfda2805426e7da02559d5cc2845ee9ded60fdae8e848d377424fb
+PKG_LICENSE:=GPL-3.0
+PKGARCH:=all
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/openwisp-config/default
+       TITLE:=Remote configuration management agent ($(2) variant)
+       CATEGORY:=Administration
+       SECTION:=admin
+       SUBMENU:=openwisp
+       DEPENDS:=+curl +lua +libuci-lua +luafilesystem $(3)
+       VARIANT:=$(1)
+       MAINTAINER:=Federico Capoano <f.capoano@cineca.it>
+       URL:=http://openwisp.org
+endef
+
+Package/openwisp-config-openssl=$(call Package/openwisp-config/default,openssl,OpenSSL,+ca-certificates +libopenssl)
+Package/openwisp-config-mbedtls=$(call Package/openwisp-config/default,mbedtls,mbedTLS,+ca-certificates +libmbedtls)
+Package/openwisp-config-cyassl=$(call Package/openwisp-config/default,cyassl,CyaSSL,+ca-certificates +libcyassl)
+# deprecated on recent versions of OpenWRT (>= Designated Driver) and LEDE (>= 17.01)
+Package/openwisp-config-polarssl=$(call Package/openwisp-config/default,polarssl,PolarSSL,+ca-certificates +libpolarssl)
+Package/openwisp-config-nossl=$(call Package/openwisp-config/default,nossl,No SSL)
+
+define Build/Compile
+endef
+
+define Package/openwisp-config-$(BUILD_VARIANT)/conffiles
+/etc/config/openwisp
+endef
+
+ifeq ($(BUILD_VARIANT),openssl)
+CONFIG_OPENWISP_UCI:=ssl
+endif
+ifeq ($(BUILD_VARIANT),mbedtls)
+CONFIG_OPENWISP_UCI:=ssl
+endif
+ifeq ($(BUILD_VARIANT),cyassl)
+CONFIG_OPENWISP_UCI:=ssl
+endif
+ifeq ($(BUILD_VARIANT),polarssl)
+CONFIG_OPENWISP_UCI:=ssl
+endif
+ifeq ($(BUILD_VARIANT),nossl)
+CONFIG_OPENWISP_UCI:=nossl
+endif
+
+
+define Package/openwisp-config-$(BUILD_VARIANT)/install
+       $(INSTALL_DIR) \
+               $(1)/usr/sbin \
+               $(1)/etc/init.d \
+               $(1)/etc/config \
+               $(1)/etc/openwisp \
+               $(1)/usr/lib/lua/openwisp
+
+       $(INSTALL_BIN) \
+               $(PKG_BUILD_DIR)/openwisp-config/files/openwisp.agent \
+               $(1)/usr/sbin/openwisp_config
+
+       $(INSTALL_BIN) \
+               $(PKG_BUILD_DIR)/openwisp-config/files/openwisp.init \
+               $(1)/etc/init.d/openwisp_config
+
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/openwisp-config/files/openwisp-$(CONFIG_OPENWISP_UCI).config \
+               $(1)/etc/config/openwisp
+
+       $(INSTALL_BIN) \
+               $(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-reload-config \
+               $(1)/usr/sbin/openwisp-reload-config
+
+       $(INSTALL_BIN) \
+               $(PKG_BUILD_DIR)/openwisp-config/files/lib/openwisp/utils.lua \
+               $(1)/usr/lib/lua/openwisp/utils.lua
+
+       $(INSTALL_BIN) \
+               $(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-store-unmanaged.lua \
+               $(1)/usr/sbin/openwisp-store-unmanaged
+
+       $(INSTALL_BIN) \
+               $(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-restore-unmanaged.lua \
+               $(1)/usr/sbin/openwisp-restore-unmanaged
+
+       $(INSTALL_BIN) \
+               $(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-remove-default-wifi.lua \
+               $(1)/usr/sbin/openwisp-remove-default-wifi
+
+       $(INSTALL_BIN) \
+               $(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-uci-autoname.lua \
+               $(1)/usr/sbin/openwisp-uci-autoname
+
+       $(INSTALL_BIN) \
+               $(PKG_BUILD_DIR)/openwisp-config/files/sbin/openwisp-update-config.lua \
+               $(1)/usr/sbin/openwisp-update-config
+
+       $(CP) $(PKG_BUILD_DIR)/VERSION $(1)/etc/openwisp/
+endef
+
+$(eval $(call BuildPackage,openwisp-config-openssl))
+$(eval $(call BuildPackage,openwisp-config-mbedtls))
+$(eval $(call BuildPackage,openwisp-config-cyassl))
+$(eval $(call BuildPackage,openwisp-config-polarssl))
+$(eval $(call BuildPackage,openwisp-config-nossl))
index 05551613e7045ce5b7a964eb9c79fca9e013a35e..e9090eea407115326eb3a7416a302fc5626362ee 100644 (file)
@@ -64,8 +64,8 @@ define Host/Compile
 endef
 
 define Host/Install
-       $(INSTALL_DIR) $(HOST_BUILD_PREFIX)/bin
-       $(CP) $(HOST_BUILD_DIR)/lib/util/mksig{list,name} $(HOST_BUILD_PREFIX)/bin/
+       $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
+       $(CP) $(HOST_BUILD_DIR)/lib/util/mksig{list,name} $(STAGING_DIR_HOSTPKG)/bin/
 endef
 
 $(eval $(call HostBuild))
diff --git a/admin/syslog-ng/Makefile b/admin/syslog-ng/Makefile
new file mode 100644 (file)
index 0000000..0486164
--- /dev/null
@@ -0,0 +1,76 @@
+include  $(TOPDIR)/rules.mk
+
+PKG_NAME:=syslog-ng
+PKG_VERSION:=3.8.1
+PKG_RELEASE:=3
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/balabit/syslog-ng/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
+PKG_MD5SUM:=acf14563cf5ce435db8db35486ce66af
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/syslog-ng
+  SECTION:=admin
+  CATEGORY:=Administration
+  DEPENDS:=+libpcre +glib2 +libeventlog +libopenssl +libuuid +libcurl
+  TITLE:=A powerful syslog daemon
+  URL:=http://www.balabit.com/network-security/syslog-ng/opensource-logging-system/
+endef
+
+define Package/syslog-ng/description
+  syslog-ng reads and logs messages to the system console, log
+  files, other machines and/or users as specified by its
+  configuration file.
+endef
+
+define Package/syslog-ng/conffiles
+  /etc/syslog-ng.conf
+endef
+
+define Build/Configure
+       $(SED) 's,-I/usr/include,,' $(PKG_BUILD_DIR)/configure
+       $(Build/Configure/Default)
+endef
+
+CONFIGURE_ARGS += \
+  $(call autoconf_bool,CONFIG_IPV6,ipv6) \
+         --disable-dependency-tracking \
+         --disable-ampq \
+         --disable-tcp-wrapper \
+         --disable-glibtest \
+         --disable-mongodb \
+         --disable-java \
+         --disable-json \
+         --disable-python \
+         --disable-spoof-source \
+         --disable-sql \
+         --disable-linux-caps \
+        --disable-smtp \
+        --disable-redis \
+         --enable-prce \
+
+TARGET_CPPFLAGS += \
+  -I$(STAGING_DIR)/usr/include/eventlog
+
+CONFIGURE_VARS += \
+  LIBDBI_CFLAGS="-I$(STAGING_DIR)/usr/include"
+
+define Package/syslog-ng/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               install-sbinPROGRAMS install-libLTLIBRARIES \
+               install-moduleLTLIBRARIES DESTDIR="$(1)"
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/syslog-ng.init $(1)/etc/init.d/syslog-ng
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_DATA) ./files/syslog-ng.conf $(1)/etc
+       $(call libtool_remove_files,$(1))
+endef
+
+$(eval $(call BuildPackage,syslog-ng))
diff --git a/admin/syslog-ng/files/syslog-ng.conf b/admin/syslog-ng/files/syslog-ng.conf
new file mode 100644 (file)
index 0000000..6786bc3
--- /dev/null
@@ -0,0 +1,37 @@
+@version:3.8
+
+options {
+       chain_hostnames(no);
+       create_dirs(yes);
+       flush_lines(0);
+       keep_hostname(yes);
+       log_fifo_size(256);
+       log_msg_size(1024);
+       stats_freq(0);
+       flush_lines(0);
+       use_fqdn(no);
+};
+
+source src {
+       internal();
+       unix-stream("/dev/log");
+};
+
+source net {
+       udp(ip(0.0.0.0) port(514));
+};
+
+source kernel {
+        file("/proc/kmsg" program_override("kernel"));
+};
+
+destination messages {
+       file("/var/log/messages");
+};
+
+log {
+       source(src);
+       source(net);
+        source(kernel);
+       destination(messages);
+};
diff --git a/admin/syslog-ng/files/syslog-ng.init b/admin/syslog-ng/files/syslog-ng.init
new file mode 100644 (file)
index 0000000..cecb3f9
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2016 OpenWrt.org
+
+START=20
+
+SERVICE_USE_PID=1
+
+start() {
+       [ -f /etc/syslog-ng.conf ] || return 1
+       service_start /usr/sbin/syslog-ng
+}
+
+stop() {
+       service_stop /usr/sbin/syslog-ng
+}
+
+reload() {
+       service_reload /usr/sbin/syslog-ng
+}
diff --git a/kernel/exfat-nofuse/Makefile b/kernel/exfat-nofuse/Makefile
deleted file mode 100644 (file)
index 694ad1e..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Copyright (C) 2014 Bruno Randolf <br1@einfach.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:=exfat-nofuse
-PKG_VERSION=2016-09-26-$(PKG_SOURCE_VERSION)
-PKG_RELEASE:=1
-
-PKG_SOURCE=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://github.com/dorimanx/exfat-nofuse.git
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=051167ceccbe75d9d77fc4f5356f5a39a01779e8
-
-PKG_MAINTAINER:=Bruno Randolf <br1@einfach.org>
-PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILES:=LICENSE
-
-include $(INCLUDE_DIR)/package.mk
-
-define KernelPackage/fs-exfat
-       SUBMENU:=Filesystems
-       TITLE:=ExFAT Kernel driver
-       FILES:=$(PKG_BUILD_DIR)/exfat.ko
-       AUTOLOAD:=$(call AutoLoad,30,exfat,1)
-       DEPENDS:=+kmod-nls-base @BUILD_PATENTED
-endef
-
-define KernelPackage/fs-exfat/description
-       Kernel module for ExFAT Filesytems
-endef
-
-MAKE_OPTS:= \
-       ARCH="$(LINUX_KARCH)" \
-       CROSS_COMPILE="$(TARGET_CROSS)" \
-       M="$(PKG_BUILD_DIR)"
-
-define Build/Compile
-       $(MAKE) -C "$(LINUX_DIR)" \
-               $(MAKE_OPTS) \
-               CONFIG_EXFAT_FS=m \
-               modules
-endef
-
-$(eval $(call KernelPackage,fs-exfat))
index 0b320560875f8ffa995c60a715562546393dede8..a7b898bf52fcf166c62a3196deb119983708d3ef 100644 (file)
@@ -11,11 +11,10 @@ PKG_NAME:=lua-bencode
 PKG_VERSION:=2.1.0
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_URL:=https://bitbucket.org/wilhelmy/lua-bencode
-PKG_SOURCE_PROTO:=hg
-PKG_SOURCE_VERSION:=500243383cb6acbddd3cf12aee6e4667aab53324
+PKG_SOURCE_URL:=https://bitbucket.org/wilhelmy/lua-bencode/downloads/
+PKG_HASH:=4624f33ff026bc62990a323ee4953e42d68430c38a1a4726c9cfd77c085b1422
 PKG_LICENSE:=MIT
 
 include $(INCLUDE_DIR)/package.mk
index 616129066f82df1be07e5945bea37739110c4e1a..749709d99a8671695e350eacd1294fd212517dbc 100644 (file)
@@ -42,8 +42,8 @@ endef
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) all \
         CC="$(TARGET_CC)" \
-        LUA="$(STAGING_DIR)/host/bin/lua" \
-        LUAC="$(STAGING_DIR)/host/bin/luac" \
+        LUA="$(STAGING_DIR_HOSTPKG)/bin/lua" \
+        LUAC="$(STAGING_DIR_HOSTPKG)/bin/luac" \
         OPT_FLAGS="$(TARGET_CFLAGS) --std=c99 -Dpthread_yield=sched_yield"
 endef
 
index 7519f8f7c806cbd7abf53bf3422b0f4b260d84c8..73dbde722bcab4a7d2d41c0eb42805248f79148f 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=luarocks
 PKG_VERSION:=2.2.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_PROTO:=git
@@ -41,7 +41,11 @@ endef
 CONFIGURE_ARGS = \
     --prefix=$(CONFIGURE_PREFIX) \
     --sysconfdir=/etc \
-    --with-lua=$(STAGING_DIR)/host
+    --with-lua=$(STAGING_DIR_HOSTPKG)
+
+CONFIGURE_VARS = \
+       LUAROCKS_UNAME_S="Linux" \
+       LUAROCKS_UNAME_M="$(ARCH)"
 
 define Build/Compile
        $(call Build/Compile/Default,build)
diff --git a/lang/luarocks/patches/02_allow_configure_uname_siteconfig_adjustment.patch b/lang/luarocks/patches/02_allow_configure_uname_siteconfig_adjustment.patch
new file mode 100644 (file)
index 0000000..5c9c968
--- /dev/null
@@ -0,0 +1,37 @@
+Index: luarocks-2.2.2/configure
+===================================================================
+--- luarocks-2.2.2.orig/configure
++++ luarocks-2.2.2/configure
+@@ -388,18 +388,22 @@ then
+ fi
+ echo_n "Configuring for system... "
+-if uname -s
+-then
+-   LUAROCKS_UNAME_S=`uname -s`
+-else
+-   die "Could not determine operating system. 'uname -s' failed."
++if [ -z "$LUAROCKS_UNAME_S" ]; then
++    if uname -s
++    then
++        LUAROCKS_UNAME_S=`uname -s`
++    else
++        die "Could not determine operating system. 'uname -s' failed."
++    fi
+ fi
+ echo_n "Configuring for architecture... "
+-if uname -m
+-then
+-   LUAROCKS_UNAME_M=`uname -m`
+-else
+-   die "Could not determine processor architecture. 'uname -m' failed."
++if [ -z "$LUAROCKS_UNAME_M" ]; then
++    if uname -m
++    then
++        LUAROCKS_UNAME_M=`uname -m`
++    else
++        die "Could not determine processor architecture. 'uname -m' failed."
++    fi
+ fi
+ for v in 5.1 5.2 5.3; do
index 6cb1e205df7b68c323ed18b36d8a0c83f1250168..3a1a2f3eb836181da40cbda8a65f4ff0da2eb0d1 100644 (file)
@@ -72,7 +72,7 @@ HOST_CONFIGURE_VARS:=
 HOST_CONFIGURE_ARGS:= \
        --dest-os=linux \
        --without-snapshot \
-       --prefix=$(HOST_BUILD_PREFIX)
+       --prefix=$(STAGING_DIR_HOSTPKG)
 
 HOST_CONFIGURE_CMD:=python ./configure
 
index afecaa086d6a123c2d54c02e9448a34ed68e9b67..eaca4253c4762051afb50174ec941f55376cd9a2 100644 (file)
@@ -8,18 +8,22 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-cgi
-PKG_VERSION:=4.28
-PKG_RELEASE:=1
+PKG_VERSION:=4.35
+PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/L/LE/LEEJO
 PKG_SOURCE:=CGI-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=28efb391377f6e98c19c23292d5fcc8c
+PKG_MD5SUM:=15e63942c02354426b25f056f2a4467c
 
 PKG_LICENSE:=GPL Artistic-2.0
-PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>, \
+               Philip Prindeville <philipp@redfish-solutions.com>
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/perl/CGI-$(PKG_VERSION)
 
+# don't strip comments because that will mangle this module
+PKG_LEAVE_COMMENTS:=1
+
 include $(INCLUDE_DIR)/package.mk
 include ../perl/perlmod.mk
 
diff --git a/lang/perl-www-curl/Makefile b/lang/perl-www-curl/Makefile
new file mode 100644 (file)
index 0000000..1e424cb
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# 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:=perl-www-curl
+PKG_VERSION:=4.17
+PKG_RELEASE:=4
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/S/SZ/SZBALINT/
+PKG_SOURCE:=WWW-Curl-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=997ac81cd6b03b30b36f7cd930474845
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/WWW-Curl-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include ../perl/perlmod.mk
+
+define Package/perl-www-curl
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Perl bindings to libcurl
+  URL:=http://search.cpan.org/dist/WWW-Curl/
+  DEPENDS:=perl +libcurl +perlbase-essential +perlbase-xsloader
+endef
+
+define Build/Configure
+       $(call perlmod/Configure,$(STAGING_DIR)/usr/include,)
+endef
+
+define Build/Compile
+       $(call perlmod/Compile,,)
+endef
+
+define Package/perl-www-curl/install
+       $(call perlmod/Install,$(1),WWW/Curl WWW/Curl.pm auto/WWW/Curl)
+endef
+
+
+$(eval $(call BuildPackage,perl-www-curl))
diff --git a/lang/perl-www-curl/patches/100-perl-www-curl_disable_curl-config_hack.patch b/lang/perl-www-curl/patches/100-perl-www-curl_disable_curl-config_hack.patch
new file mode 100644 (file)
index 0000000..568b65c
--- /dev/null
@@ -0,0 +1,74 @@
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -12,31 +12,31 @@ no_index           directory => 'template';
+ repository            'http://github.com/szbalint/WWW--Curl';
+ # This is a hack. If you have libcurl installed, just specify curl.h below
+ # and comment out this line.
+-if ($^O ne 'MSWin32') {
+-    if (!$ENV{CURL_CONFIG}) {
+-          requires_external_bin       'curl-config';
+-    }
+-} else {
+-      print   "Sorry, no automated install is available on Windows,\n".
+-              "please see the README.Win32 file on instructions for a manual install.\n";
+-      exit(0);
+-}
+-
+-my $curl_config = $ENV{CURL_CONFIG} || 'curl-config';
+-
+-my $vernum = `${curl_config} --vernum`; chomp $vernum;
+-my $version = `${curl_config} --version`; chomp $version; 
+-
+-my $minimum_ver = hex("070a08");
+-
+-if ($vernum && hex($vernum) <= $minimum_ver) {
+-      print   "Your currently installed libcurl version - $version - is too old.\n".
+-              "This module doesn't seek compatibility with versions older than 7.10.8\n".
+-              "Proceed manually if you know what you're doing.\n";
+-      exit(0);
+-}
+-
+-print "The version is $version\n";
++#if ($^O ne 'MSWin32') {
++#    if (!$ENV{CURL_CONFIG}) {
++#         requires_external_bin       'curl-config';
++#    }
++#} else {
++#     print   "Sorry, no automated install is available on Windows,\n".
++#             "please see the README.Win32 file on instructions for a manual install.\n";
++#     exit(0);
++#}
++#
++#my $curl_config = $ENV{CURL_CONFIG} || 'curl-config';
++#
++#my $vernum = `${curl_config} --vernum`; chomp $vernum;
++#my $version = `${curl_config} --version`; chomp $version; 
++#
++#my $minimum_ver = hex("070a08");
++#
++#if ($vernum && hex($vernum) <= $minimum_ver) {
++#     print   "Your currently installed libcurl version - $version - is too old.\n".
++#             "This module doesn't seek compatibility with versions older than 7.10.8\n".
++#             "Proceed manually if you know what you're doing.\n";
++#     exit(0);
++#}
++#
++#print "The version is $version\n";
+ my @includes = qw();
+ my ($cflags,$lflags, $ldflags) = ('','','');
+@@ -58,10 +58,10 @@ if ($^O ne 'MSWin32') {
+ # Get curl to tell us where it is, if we can.
+ #
+-if ($^O ne 'MSWin32') {
+-      $cflags = `${curl_config} --cflags`;
+-      $lflags = `${curl_config} --libs`;
+-}
++#if ($^O ne 'MSWin32') {
++#     $cflags = `${curl_config} --cflags`;
++#     $lflags = `${curl_config} --libs`;
++#}
+ # can't find link flags, make some guesses
+ if (!defined($lflags)) {
diff --git a/lang/perl-www-curl/patches/101-skip-preprocessor-symbol.path b/lang/perl-www-curl/patches/101-skip-preprocessor-symbol.path
new file mode 100644 (file)
index 0000000..34221c0
--- /dev/null
@@ -0,0 +1,34 @@
+From 0be0223422e6e5f4091c6e4e058d213623eed105 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Mon, 12 Sep 2016 14:40:44 +0200
+Subject: [PATCH] Skip preprocessor symbol only CURL_STRICTER
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+CURL_STRICTER leaked into curl-constants.c when building against
+curl-7.50.2. This is a preprocessor only macro without a value.
+
+CPAN RT#117793
+
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ Makefile.PL | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.PL b/Makefile.PL
+index f9170bb..ad2bd3d 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -127,7 +127,7 @@ if (!defined($curl_h)) {
+     close H;
+     for my $e (sort @syms) {
+-       if($e =~ /(OBSOLETE|^CURL_EXTERN|_LAST\z|_LASTENTRY\z)/) {
++       if($e =~ /(OBSOLETE|^CURL_EXTERN|^CURL_STRICTER\z|_LAST\z|_LASTENTRY\z)/) {
+           next;
+        }
+        my ($group) = $e =~ m/^([^_]+_)/;
+-- 
+2.7.4
+
diff --git a/lang/perl-www-curl/patches/200-fix_default_lflags.patch b/lang/perl-www-curl/patches/200-fix_default_lflags.patch
new file mode 100644 (file)
index 0000000..f51eaf5
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -39,7 +39,7 @@ repository           'http://github.com/szbalint/
+ #print "The version is $version\n";
+ my @includes = qw();
+-my ($cflags,$lflags, $ldflags) = ('','','');
++my ($cflags,$lflags, $ldflags) = ('','-lcurl','');
+ # You may need to specify where to find curl.h on your platform
+ # These are guesses only, in case curl-config is not telling us.
index e5d3b2c88bbaa4b02669a75dd49d03ee6e049728..57977c19b881a30d696018785f68b33e7d79ea7f 100644 (file)
@@ -25,8 +25,8 @@ HOST_BUILD_DEPENDS:=perl/host expat/host
 
 EXPAT_LIBPATH:=$(STAGING_DIR)/usr/lib
 EXPAT_INCPATH=$(STAGING_DIR)/usr/include
-HOST_EXPAT_LIBPATH:=$(STAGING_DIR)/host/lib
-HOST_EXPAT_INCPATH=$(STAGING_DIR)/host/include
+HOST_EXPAT_LIBPATH:=$(STAGING_DIR_HOSTPKG)/lib
+HOST_EXPAT_INCPATH=$(STAGING_DIR_HOSTPKG)/include
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/host-build.mk
index 14aedc285ca1aebd31cd5dd6893c0e12b7e31119..65a3a47d7163ac6f5113d513a5701979b9b76244 100644 (file)
@@ -17,4 +17,15 @@ config PERL_TESTS
                Test support is still in development. Some tests will fail,
                others are just missing completely.
 
+config PERL_NOCOMMENT
+       bool "Strip comments and pod sections from modules"
+       default y
+       help
+               Remove comments and pod sections for all perl packages.
+
+               This will descrease the size of perl libraries moderately.
+
+               Stripping occasionally gets confused and mangles valid code,
+               so disable this option if you're not pressed for space.
+
 endmenu
index 7c7f10d4e0878e539a6310eaa66ebcb59444466d..d3cb081dac245972529998a37e07719cbe1b78b0 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl
 PKG_VERSION:=5.22.1
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \
                http://www.cpan.org/src/5.0 \
@@ -24,7 +24,8 @@ PKG_MD5SUM:=19295bbb775a3c36123161b9bf4892f1
 
 PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_LICENSE_FILES:=Copying Artistic README
-PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>, \
+               Philip Prindeville <philipp@redfish-solutions.com>
 
 # Build settings
 PKG_BUILD_DIR:=$(BUILD_DIR)/perl/$(PKG_NAME)-$(PKG_VERSION)
@@ -35,7 +36,7 @@ PKG_BUILD_PARALLEL:=1
 HOST_BUILD_PARALLEL:=1
 
 # Variables used during configuration/build
-HOST_PERL_PREFIX:=$(STAGING_DIR)/host/usr
+HOST_PERL_PREFIX:=$(STAGING_DIR_HOSTPKG)/usr
 
 # Filter -g3, it will break Compress-Raw-Zlib
 TARGET_CFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CFLAGS))
index c64942fedee3b8bc161e029f51caa4f4b1c7cd02..be566087cdabd896d855c15fcbad410b09aeffed 100644 (file)
@@ -4,12 +4,12 @@
 PERL_VERSION:=5.22
 
 # Build environment
-HOST_PERL_PREFIX:=$(STAGING_DIR)/host/usr
+HOST_PERL_PREFIX:=$(STAGING_DIR_HOSTPKG)/usr
 ifneq ($(CONFIG_USE_GLIBC),)
        EXTRA_LIBS:=bsd
        EXTRA_LIBDIRS:=$(STAGING_DIR)/lib
 endif
-PERL_CMD:=$(STAGING_DIR)/host/usr/bin/perl$(PERL_VERSION).0
+PERL_CMD:=$(STAGING_DIR_HOSTPKG)/usr/bin/perl$(PERL_VERSION).0
 
 MOD_CFLAGS_PERL:=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(TARGET_CFLAGS) $(TARGET_CPPFLAGS)
 ifdef CONFIG_PERL_THREADS
@@ -26,7 +26,7 @@ define perlmod/host/relink
        rm -f $(1)/Makefile.aperl
        $(MAKE) -C $(1) perl
        $(CP) $(1)/perl $(PERL_CMD)
-       $(CP) $(1)/perl $(STAGING_DIR)/host/usr/bin/perl
+       $(CP) $(1)/perl $(STAGING_DIR_HOSTPKG)/usr/bin/perl
 endef
 
 define perlmod/host/Configure
@@ -129,9 +129,7 @@ define perlmod/Install/NoStrip
 endef
 
 
-define perlmod/Install
-       $(call perlmod/Install/NoStrip,$(1),$(2),$(3))
-
+define perlmod/_DoStrip
        @echo "---> Stripping modules in: $(strip $(1))$(PERL_SITELIB)"
        find $(strip $(1))$(PERL_SITELIB) -name \*.pm -or -name \*.pl | \
        xargs -r sed -i \
@@ -141,6 +139,12 @@ define perlmod/Install
                -e '/^#[^!"'"'"']/d'
 endef
 
+define perlmod/Install
+       $(call perlmod/Install/NoStrip,$(1),$(2),$(3))
+
+       $(if $(CONFIG_PERL_NOCOMMENT),$(if $(PKG_LEAVE_COMMENTS),,$(call perlmod/_DoStrip,$(1),$(2),$(3))))
+endef
+
 # You probably don't want to use this directly. Look at perlmod/InstallTests
 define perlmod/_InstallTests
        $(INSTALL_DIR) $(strip $(1))
index bcf32a16424903de0a5f5c3a6abd0e3eeede16de..9c1d52e00ee689d9f60db6815b6529292e05dc51 100644 (file)
@@ -8,9 +8,9 @@ include $(TOPDIR)/rules.mk
 PECL_NAME:=dio
 PECL_LONGNAME:=Direct I/O functions
 
-PKG_VERSION:=0.0.7
-PKG_RELEASE:=2
-PKG_MD5SUM:=a1a4df428a17dbe1ab4277b492dfa052
+PKG_VERSION:=0.0.9
+PKG_RELEASE:=1
+PKG_MD5SUM:=2c80b63fbbbaead856cb468955c14dc328d1262621b0c704b122d902053c8156
 
 PKG_NAME:=php7-pecl-$(PECL_NAME)
 PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
diff --git a/lang/php7-pecl-dio/patches/0000-unify-line-endings.patch b/lang/php7-pecl-dio/patches/0000-unify-line-endings.patch
deleted file mode 100644 (file)
index b6c2750..0000000
+++ /dev/null
@@ -1,3110 +0,0 @@
---- a/dio_posix.c
-+++ b/dio_posix.c
-@@ -1,659 +1,659 @@
--/*\r
--   +----------------------------------------------------------------------+\r
--   | PHP Version 5                                                        |\r
--   +----------------------------------------------------------------------+\r
--   | Copyright (c) 2009 Melanie Rhianna Lewis                             |\r
--   +----------------------------------------------------------------------+\r
--   | This source file is subject to version 3.0 of the PHP license,       |\r
--   | that is bundled with this package in the file LICENSE, and is        |\r
--   | available through the world-wide-web at the following url:           |\r
--   | http://www.php.net/license/3_0.txt.                                  |\r
--   | If you did not receive a copy of the PHP license and are unable to   |\r
--   | obtain it through the world-wide-web, please send a note to          |\r
--   | license@php.net so we can mail you a copy immediately.               |\r
--   +----------------------------------------------------------------------+\r
--   | Author: Melanie Rhianna Lewis <cyberspice@php.net>                   |\r
--   +----------------------------------------------------------------------+\r
-- */\r
--\r
--#ifdef HAVE_CONFIG_H\r
--#include "config.h"\r
--#endif\r
--\r
--#include "php.h"\r
--\r
--#include "php_dio_common.h"\r
--\r
--/* {{{ dio_stream_mode_to_flags\r
-- * Convert an fopen() mode string to open() flags\r
-- */\r
--static int dio_stream_mode_to_flags(const char *mode) {\r
--      int  flags = 0, ch = 0, bin = 1;\r
--\r
--      switch(mode[ch++]) {\r
--              case 'r':\r
--                      flags = 0;\r
--                      break;\r
--              case 'w':\r
--                      flags = O_TRUNC | O_CREAT;\r
--                      break;\r
--              case 'a':\r
--                      flags = O_APPEND | O_CREAT;\r
--                      break;\r
--              case 'x':\r
--                      flags = O_EXCL | O_CREAT;\r
--                      break;\r
--      }\r
--\r
--      if (mode[ch] != '+') {\r
--              bin = (mode[ch++] == 'b');\r
--      }\r
--\r
--      if (mode[ch] == '+') {\r
--              flags |= O_RDWR;\r
--      } else if (flags) {\r
--              flags |= O_WRONLY;\r
--      } else {\r
--              flags |= O_RDONLY;\r
--      }\r
--\r
--#if defined(_O_TEXT) && defined(O_BINARY)\r
--      if (bin) {\r
--              flags |= O_BINARY;\r
--      } else {\r
--              flags |= _O_TEXT;\r
--      }\r
--#endif\r
--\r
--      return flags;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_data_rate_to_define\r
-- * Converts a numeric data rate to a termios define\r
-- */\r
--static int dio_data_rate_to_define(long rate, speed_t *def) {\r
--      speed_t val;\r
--\r
--      switch (rate) {\r
--              case 0:\r
--                      val = 0;\r
--                      break;\r
--              case 50:\r
--                      val = B50;\r
--                      break;\r
--              case 75:\r
--                      val = B75;\r
--                      break;\r
--              case 110:\r
--                      val = B110;\r
--                      break;\r
--              case 134:\r
--                      val = B134;\r
--                      break;\r
--              case 150:\r
--                      val = B150;\r
--                      break;\r
--              case 200:\r
--                      val = B200;\r
--                      break;\r
--              case 300:\r
--                      val = B300;\r
--                      break;\r
--              case 600:\r
--                      val = B600;\r
--                      break;\r
--              case 1200:\r
--                      val = B1200;\r
--                      break;\r
--              case 1800:\r
--                      val = B1800;\r
--                      break;\r
--              case 2400:\r
--                      val = B2400;\r
--                      break;\r
--              case 4800:\r
--                      val = B4800;\r
--                      break;\r
--              case 9600:\r
--                      val = B9600;\r
--                      break;\r
--              case 19200:\r
--                      val = B19200;\r
--                      break;\r
--              case 38400:\r
--                      val = B38400;\r
--                      break;\r
--#ifdef B57600\r
--              case 57600:\r
--                      val = B57600;\r
--                      break;\r
--#endif\r
--#ifdef B115200\r
--              case 115200:\r
--                      val = B115200;\r
--                      break;\r
--#endif\r
--#ifdef B230400\r
--              case 230400:\r
--                      val = B230400;\r
--                      break;\r
--#endif\r
--#ifdef B460800\r
--              case 460800:\r
--                      val = B460800;\r
--                      break;\r
--#endif\r
--              default:\r
--                      return 0;\r
--      }\r
--\r
--      *def = val;\r
--      return 1;\r
--}\r
--\r
--/* {{{ dio_data_bits_to_define\r
-- * Converts a number of data bits to a termios define\r
-- */\r
--static int dio_data_bits_to_define(int data_bits, int *def) {\r
--      int val;\r
--\r
--      switch (data_bits) {\r
--              case 8:\r
--                      val = CS8;\r
--                      break;\r
--              case 7:\r
--                      val = CS7;\r
--                      break;\r
--              case 6:\r
--                      val = CS6;\r
--                      break;\r
--              case 5:\r
--                      val = CS5;\r
--                      break;\r
--              default:\r
--                      return 0;\r
--      }\r
--\r
--      *def = val;\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_stop_bits_to_define\r
-- * Converts a number of stop bits to a termios define\r
-- */\r
--static int dio_stop_bits_to_define(int stop_bits, int *def) {\r
--      int val;\r
--\r
--      switch (stop_bits) {\r
--              case 1:\r
--                      val = 0;\r
--                      break;\r
--              case 2:\r
--                      val = CSTOPB;\r
--                      break;\r
--              default:\r
--                      return 0;\r
--      }\r
--\r
--      *def = val;\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_parity_to_define\r
-- * Converts a parity type to a termios define\r
-- */\r
--static int dio_parity_to_define(int parity, int *def) {\r
--      int val;\r
--\r
--      switch (parity) {\r
--              case 0:\r
--                      val = 0;\r
--                      break;\r
--              case 1:\r
--                      val = PARENB | PARODD;\r
--                      break;\r
--              case 2:\r
--                      val = PARENB;\r
--                      break;\r
--              default:\r
--                      return 0;\r
--      }\r
--\r
--      *def = val;\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_create_stream_data\r
-- * Creates an initialised stream data structure.  Free with efree().\r
-- */\r
--php_dio_stream_data * dio_create_stream_data(void) {\r
--      php_dio_posix_stream_data * data = emalloc(sizeof(php_dio_posix_stream_data));\r
--      dio_init_stream_data(&(data->common));\r
--      data->fd = -1;\r
--      data->flags = 0;\r
--\r
--      return (php_dio_stream_data *)data;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_common_write\r
-- * Writes count chars from the buffer to the stream described by the stream data.\r
-- */\r
--size_t dio_common_write(php_dio_stream_data *data, const char *buf, size_t count) {\r
--      size_t ret;\r
--\r
--      /* Blocking writes can be interrupted by signals etc. If\r
--       * interrupted try again. Not sure about non-blocking\r
--       * writes but it doesn't hurt to check. */\r
--      do {\r
--              ret = write(((php_dio_posix_stream_data*)data)->fd, buf, count);\r
--              if (ret > 0) {\r
--                      return ret;\r
--              }\r
--      } while (errno == EINTR);\r
--      return 0;\r
--}\r
--/* }}} */\r
--\r
--#ifdef DIO_NONBLOCK\r
--/* {{{ dio_timeval_subtract\r
-- * Calculates the difference between two timevals returning the result in the\r
-- * structure pointed to by diffptr.  Returns -1 as error if late time is\r
-- * earlier than early time.\r
-- */\r
--static int dio_timeval_subtract(struct timeval *late, struct timeval *early, struct timeval *diff) {\r
--      struct timeval *tmp;\r
--\r
--      /* Handle negatives */\r
--      if (late->tv_sec < early->tv_sec) {\r
--              return 0;\r
--      }\r
--\r
--      if ((late->tv_sec == early->tv_sec) && (late->tv_usec < early->tv_usec)) {\r
--              return 0;\r
--      }\r
--\r
--      /* Handle any carry.  If later usec is smaller than earlier usec simple\r
--       * subtraction will result in negative value.  Since usec has a maximum\r
--       * of one second by adding another second before the subtraction the\r
--       * result will always be positive. */\r
--      if (late->tv_usec < early->tv_usec) {\r
--              late->tv_usec  += 1000000;\r
--              late->tv_sec--;\r
--      }\r
--\r
--      /* Once adjusted can just subtract values. */\r
--      diff->tv_sec  = late->tv_sec  - early->tv_sec;\r
--      diff->tv_usec = late->tv_usec - early->tv_usec;\r
--\r
--      return 1;\r
--}\r
--#endif\r
--\r
--/* {{{ dio_common_read\r
-- * Reads count chars to the buffer to the stream described by the stream data.\r
-- */\r
--size_t dio_common_read(php_dio_stream_data *data, const char *buf, size_t count) {\r
--      int fd = ((php_dio_posix_stream_data*)data)->fd;\r
--      size_t ret, total = 0;\r
--      char *ptr = (char*)buf;\r
--\r
--      struct timeval timeout, timeouttmp, before, after, diff;\r
--      fd_set rfds;\r
--\r
--      if (!data->has_timeout) {\r
--              /* Blocking reads can be interrupted by signals etc. If\r
--               * interrupted try again. Not sure about non-blocking\r
--               * reads but it doesn't hurt to check. */\r
--              do {\r
--                      ret = read(fd, (char*)ptr, count);\r
--                      if (ret > 0) {\r
--                              return ret;\r
--                      } else if (!ret) {\r
--                              data->end_of_file = 1;\r
--                      }\r
--              } while ((errno == EINTR) && !data->end_of_file);\r
--              return 0;\r
--      }\r
--#ifdef DIO_NONBLOCK\r
--      else {\r
--              /* Clear timed out flag */\r
--              data->timed_out = 0;\r
--\r
--              /* The initial timeout value */\r
--              timeout.tv_sec  = data->timeout_sec;\r
--              timeout.tv_usec = data->timeout_usec;\r
--\r
--              do {\r
--                      /* The semantics of select() are that you cannot guarantee\r
--                       * that the timeval structure passed in has not been changed by\r
--                       * the select call.  So you keep a copy. */\r
--                      timeouttmp = timeout;\r
--\r
--                      /* The time before we wait for data. */\r
--                      (void) gettimeofday(&before, NULL);\r
--\r
--                      /* Wait for an event on our file descriptor. */\r
--                      FD_ZERO(&rfds);\r
--                      FD_SET(fd, &rfds);\r
--\r
--                      ret = select(fd + 1, &rfds, NULL, NULL, &timeouttmp);\r
--                      /* An error. */\r
--                      if ((ret < 0) && (errno != EINTR) && (errno != EAGAIN)) {\r
--                              return 0;\r
--                      }\r
--\r
--                      /* We have data to read. */\r
--                      if ((ret > 0) && FD_ISSET(fd, &rfds)) {\r
--                              ret = read(fd, ptr, count);\r
--                              /* Another error */\r
--                              if ((ret < 0) && (errno != EINTR) && (errno != EAGAIN)) {\r
--                                      return 0;\r
--                              }\r
--\r
--                              if (ret > 0) {\r
--                                      /* Got data, add it to the buffer. */\r
--                                      ptr   += ret;\r
--                                      total += ret;\r
--                                      count -= ret;\r
--                              } else if (!ret) {\r
--                                      /* This should never happen since how can we have\r
--                                       * data to read at an end of file, but still\r
--                                       * just in case! */\r
--                                      data->end_of_file = 1;\r
--                                      break;\r
--                              }\r
--                      }\r
--\r
--                      /* If not timed out and not end of file and not all data read\r
--                       * calculate how long it took us and loop if we still have time\r
--                       * out time left. */\r
--                      if (count) {\r
--                              (void) gettimeofday(&after, NULL);\r
--\r
--                              /* Diff the timevals */\r
--                              (void) dio_timeval_subtract(&after, &before, &diff);\r
--\r
--                              /* Now adjust the timeout. */\r
--                              if (!dio_timeval_subtract(&timeout, &diff, &timeout)) {\r
--                                      /* If it errors we've run out of time. */\r
--                                      data->timed_out = 1;\r
--                                      break;\r
--                              } else if (!timeout.tv_sec && !(timeout.tv_usec / 1000)) {\r
--                                      /* Check for rounding issues (millisecond accuracy) */\r
--                                      data->timed_out = 1;\r
--                                      break;\r
--                              }\r
--                      }\r
--              } while (count); /* Until time out or end of file or all data read. */\r
--\r
--              return total;\r
--      }\r
--#endif\r
--}\r
--/* }}} */\r
--\r
--/* {{{ php_dio_stream_data\r
-- * Closes the php_stream.\r
-- */\r
--int dio_common_close(php_dio_stream_data *data) {\r
--      if (close(((php_dio_posix_stream_data*)data)->fd) < 0) {\r
--              return 0;\r
--      }\r
--\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_common_set_option\r
-- * Sets/gets stream options\r
-- */\r
--int dio_common_set_option(php_dio_stream_data *data, int option, int value, void *ptrparam) {\r
--      int fd = ((php_dio_posix_stream_data*)data)->fd;\r
--      int old_is_blocking;\r
--      int flags;\r
--\r
--      switch (option) {\r
--#ifdef DIO_NONBLOCK\r
--              case PHP_STREAM_OPTION_READ_TIMEOUT:\r
--                      if (ptrparam) {\r
--                              struct timeval *tv = (struct timeval*)ptrparam;\r
--\r
--                              flags = fcntl(fd, F_GETFL, 0);\r
--\r
--                              /* A timeout of zero seconds and zero microseconds disables\r
--                                 any existing timeout. */\r
--                              if (tv->tv_sec || tv->tv_usec) {\r
--                                      data->timeout_sec = tv->tv_sec;\r
--                                      data->timeout_usec = tv->tv_usec;\r
--                                      data->has_timeout = -1;\r
--                                      (void) fcntl(fd, F_SETFL, flags & ~DIO_NONBLOCK);\r
--                              } else {\r
--                                      data->timeout_sec = 0;\r
--                                      data->timeout_usec = 0;\r
--                                      data->has_timeout = 0;\r
--                                      data->timed_out = 0;\r
--                                      (void) fcntl(fd, F_SETFL, flags | DIO_NONBLOCK);\r
--                              }\r
--\r
--                              return PHP_STREAM_OPTION_RETURN_OK;\r
--                      } else {\r
--                              return PHP_STREAM_OPTION_RETURN_ERR;\r
--                      }\r
--\r
--              case PHP_STREAM_OPTION_BLOCKING:\r
--                      flags = fcntl(fd, F_GETFL, 0);\r
--                      if (value) {\r
--                              flags &= ~DIO_NONBLOCK;\r
--                      } else {\r
--                              flags |= DIO_NONBLOCK;\r
--                      }\r
--                      (void) fcntl(fd, F_SETFL, flags);\r
--\r
--                      old_is_blocking = data->is_blocking;\r
--                      data->is_blocking = value;\r
--                      return old_is_blocking ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR;\r
--#endif /* O_NONBLOCK */\r
--\r
--              default:\r
--                      break;\r
--      }\r
--\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_raw_open_stream\r
-- * Opens the underlying stream.\r
-- */\r
--int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {\r
--      php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;\r
--      pdata->flags = dio_stream_mode_to_flags(mode);\r
--\r
--#ifdef DIO_NONBLOCK\r
--      if (!data->is_blocking || data->has_timeout) {\r
--              pdata->flags |= DIO_NONBLOCK;\r
--      }\r
--#endif\r
--\r
--      /* Open the file and handle any errors. */\r
--#ifdef DIO_HAS_FILEPERMS\r
--      if (data->has_perms) {\r
--              pdata->fd = open(filename, pdata->flags, (mode_t)data->perms);\r
--      } else {\r
--              pdata->fd = open(filename, pdata->flags);\r
--      }\r
--#else\r
--      pdata->fd = open(filename, pdata->flags);\r
--#endif\r
--\r
--      if (pdata->fd < 0) {\r
--              switch (errno) {\r
--                      case EEXIST:\r
--                              php_error_docref(NULL TSRMLS_CC, E_WARNING, "File exists!");\r
--                              return 0;\r
--                      default:\r
--                              return 0;\r
--              }\r
--      }\r
--\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_serial_init\r
-- * Initialises the serial settings storing the original settings before hand.\r
-- */\r
--static int dio_serial_init(php_dio_stream_data *data TSRMLS_DC) {\r
--      php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;\r
--      int ret = 0, data_bits_def, stop_bits_def, parity_def;\r
--      struct termios tio;\r
--      speed_t rate_def;\r
--\r
--      if (!dio_data_rate_to_define(data->data_rate, &rate_def)) {\r
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_rate value (%ld)", data->data_rate);\r
--              return 0;\r
--      }\r
--\r
--      if (!dio_data_bits_to_define(data->data_bits, &data_bits_def)) {\r
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_bits value (%d)", data->data_bits);\r
--              return 0;\r
--      }\r
--\r
--      if (!dio_stop_bits_to_define(data->stop_bits, &stop_bits_def)) {\r
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid stop_bits value (%d)", data->stop_bits);\r
--              return 0;\r
--      }\r
--\r
--      if (!dio_parity_to_define(data->parity, &parity_def)) {\r
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid parity value (%d)", data->parity);\r
--              return 0;\r
--      }\r
--\r
--      ret = tcgetattr(pdata->fd, &(pdata->oldtio));\r
--      if (ret < 0) {\r
--              if ((errno == ENOTTY) || (errno == ENODEV)) {\r
--                      php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a serial port or terminal!");\r
--              }\r
--              return 0;\r
--      }\r
--\r
--      ret = tcgetattr(pdata->fd, &tio);\r
--      if (ret < 0) {\r
--              return 0;\r
--      }\r
--\r
--      if (data->canonical) {\r
--              tio.c_iflag = IGNPAR | ICRNL;\r
--              tio.c_oflag = 0;\r
--              tio.c_lflag = ICANON;\r
--      } else {\r
--              cfmakeraw(&tio);\r
--      }\r
--\r
--      cfsetispeed(&tio, rate_def);\r
--      cfsetospeed(&tio, rate_def);\r
--\r
--      tio.c_cflag &= ~CSIZE;\r
--      tio.c_cflag |= data_bits_def;\r
--      tio.c_cflag &= ~CSTOPB;\r
--      tio.c_cflag |= stop_bits_def;\r
--      tio.c_cflag &= ~(PARENB|PARODD);\r
--      tio.c_cflag |= parity_def;\r
--\r
--#ifdef CRTSCTS\r
--      tio.c_cflag &= ~(CLOCAL | CRTSCTS);\r
--#else\r
--      tio.c_cflag &= ~CLOCAL;\r
--#endif\r
--      if (!data->flow_control) {\r
--              tio.c_cflag |= CLOCAL;\r
--#ifdef CRTSCTS\r
--      } else {\r
--              tio.c_cflag |= CRTSCTS;\r
--#endif\r
--      }\r
--\r
--      ret = tcsetattr(pdata->fd, TCSANOW, &tio);\r
--      if (ret < 0) {\r
--              return 0;\r
--      }\r
--\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_serial_uninit\r
-- * Restores the serial settings back to their original state.\r
-- */\r
--int dio_serial_uninit(php_dio_stream_data *data) {\r
--      php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;\r
--      int ret;\r
--\r
--      do {\r
--              ret = tcsetattr(pdata->fd, TCSANOW, &(pdata->oldtio));\r
--      } while ((ret < 0) && (errno == EINTR));\r
--\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_serial_flush\r
-- * Purges the serial buffers of data.\r
-- */\r
--int dio_serial_purge(php_dio_stream_data *data) {\r
--      php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;\r
--      int ret;\r
--\r
--      if ((pdata->flags & O_RDWR) == O_RDWR) {\r
--              ret = tcflush(pdata->fd, TCIOFLUSH);\r
--      } else if ((pdata->flags & O_WRONLY) == O_WRONLY) {\r
--              ret = tcflush(pdata->fd, TCOFLUSH);\r
--      } else if ((pdata->flags & O_RDONLY) == O_RDONLY) {\r
--              ret = tcflush(pdata->fd, TCIFLUSH);\r
--      }\r
--\r
--      if (ret < 0) {\r
--              return 0;\r
--      }\r
--\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_serial_open_stream\r
-- * Opens the underlying stream.\r
-- */\r
--int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {\r
--      php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;\r
--\r
--#ifdef O_NOCTTY\r
--      /* We don't want a controlling TTY */\r
--      pdata->flags |= O_NOCTTY;\r
--#endif\r
--\r
--      if (!dio_raw_open_stream(filename, mode, data TSRMLS_CC)) {\r
--              return 0;\r
--      }\r
--\r
--      if (!dio_serial_init(data TSRMLS_CC)) {\r
--              close(pdata->fd);\r
--              return 0;\r
--      }\r
--\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--/*\r
-- * Local variables:\r
-- * c-basic-offset: 4\r
-- * tab-width: 4\r
-- * End:\r
-- * vim600: fdm=marker\r
-- * vim: sw=4 ts=4 noet\r
-- */\r
-+/*
-+   +----------------------------------------------------------------------+
-+   | PHP Version 5                                                        |
-+   +----------------------------------------------------------------------+
-+   | Copyright (c) 2009 Melanie Rhianna Lewis                             |
-+   +----------------------------------------------------------------------+
-+   | This source file is subject to version 3.0 of the PHP license,       |
-+   | that is bundled with this package in the file LICENSE, and is        |
-+   | available through the world-wide-web at the following url:           |
-+   | http://www.php.net/license/3_0.txt.                                  |
-+   | If you did not receive a copy of the PHP license and are unable to   |
-+   | obtain it through the world-wide-web, please send a note to          |
-+   | license@php.net so we can mail you a copy immediately.               |
-+   +----------------------------------------------------------------------+
-+   | Author: Melanie Rhianna Lewis <cyberspice@php.net>                   |
-+   +----------------------------------------------------------------------+
-+ */
-+
-+#ifdef HAVE_CONFIG_H
-+#include "config.h"
-+#endif
-+
-+#include "php.h"
-+
-+#include "php_dio_common.h"
-+
-+/* {{{ dio_stream_mode_to_flags
-+ * Convert an fopen() mode string to open() flags
-+ */
-+static int dio_stream_mode_to_flags(const char *mode) {
-+      int  flags = 0, ch = 0, bin = 1;
-+
-+      switch(mode[ch++]) {
-+              case 'r':
-+                      flags = 0;
-+                      break;
-+              case 'w':
-+                      flags = O_TRUNC | O_CREAT;
-+                      break;
-+              case 'a':
-+                      flags = O_APPEND | O_CREAT;
-+                      break;
-+              case 'x':
-+                      flags = O_EXCL | O_CREAT;
-+                      break;
-+      }
-+
-+      if (mode[ch] != '+') {
-+              bin = (mode[ch++] == 'b');
-+      }
-+
-+      if (mode[ch] == '+') {
-+              flags |= O_RDWR;
-+      } else if (flags) {
-+              flags |= O_WRONLY;
-+      } else {
-+              flags |= O_RDONLY;
-+      }
-+
-+#if defined(_O_TEXT) && defined(O_BINARY)
-+      if (bin) {
-+              flags |= O_BINARY;
-+      } else {
-+              flags |= _O_TEXT;
-+      }
-+#endif
-+
-+      return flags;
-+}
-+/* }}} */
-+
-+/* {{{ dio_data_rate_to_define
-+ * Converts a numeric data rate to a termios define
-+ */
-+static int dio_data_rate_to_define(long rate, speed_t *def) {
-+      speed_t val;
-+
-+      switch (rate) {
-+              case 0:
-+                      val = 0;
-+                      break;
-+              case 50:
-+                      val = B50;
-+                      break;
-+              case 75:
-+                      val = B75;
-+                      break;
-+              case 110:
-+                      val = B110;
-+                      break;
-+              case 134:
-+                      val = B134;
-+                      break;
-+              case 150:
-+                      val = B150;
-+                      break;
-+              case 200:
-+                      val = B200;
-+                      break;
-+              case 300:
-+                      val = B300;
-+                      break;
-+              case 600:
-+                      val = B600;
-+                      break;
-+              case 1200:
-+                      val = B1200;
-+                      break;
-+              case 1800:
-+                      val = B1800;
-+                      break;
-+              case 2400:
-+                      val = B2400;
-+                      break;
-+              case 4800:
-+                      val = B4800;
-+                      break;
-+              case 9600:
-+                      val = B9600;
-+                      break;
-+              case 19200:
-+                      val = B19200;
-+                      break;
-+              case 38400:
-+                      val = B38400;
-+                      break;
-+#ifdef B57600
-+              case 57600:
-+                      val = B57600;
-+                      break;
-+#endif
-+#ifdef B115200
-+              case 115200:
-+                      val = B115200;
-+                      break;
-+#endif
-+#ifdef B230400
-+              case 230400:
-+                      val = B230400;
-+                      break;
-+#endif
-+#ifdef B460800
-+              case 460800:
-+                      val = B460800;
-+                      break;
-+#endif
-+              default:
-+                      return 0;
-+      }
-+
-+      *def = val;
-+      return 1;
-+}
-+
-+/* {{{ dio_data_bits_to_define
-+ * Converts a number of data bits to a termios define
-+ */
-+static int dio_data_bits_to_define(int data_bits, int *def) {
-+      int val;
-+
-+      switch (data_bits) {
-+              case 8:
-+                      val = CS8;
-+                      break;
-+              case 7:
-+                      val = CS7;
-+                      break;
-+              case 6:
-+                      val = CS6;
-+                      break;
-+              case 5:
-+                      val = CS5;
-+                      break;
-+              default:
-+                      return 0;
-+      }
-+
-+      *def = val;
-+      return 1;
-+}
-+/* }}} */
-+
-+/* {{{ dio_stop_bits_to_define
-+ * Converts a number of stop bits to a termios define
-+ */
-+static int dio_stop_bits_to_define(int stop_bits, int *def) {
-+      int val;
-+
-+      switch (stop_bits) {
-+              case 1:
-+                      val = 0;
-+                      break;
-+              case 2:
-+                      val = CSTOPB;
-+                      break;
-+              default:
-+                      return 0;
-+      }
-+
-+      *def = val;
-+      return 1;
-+}
-+/* }}} */
-+
-+/* {{{ dio_parity_to_define
-+ * Converts a parity type to a termios define
-+ */
-+static int dio_parity_to_define(int parity, int *def) {
-+      int val;
-+
-+      switch (parity) {
-+              case 0:
-+                      val = 0;
-+                      break;
-+              case 1:
-+                      val = PARENB | PARODD;
-+                      break;
-+              case 2:
-+                      val = PARENB;
-+                      break;
-+              default:
-+                      return 0;
-+      }
-+
-+      *def = val;
-+      return 1;
-+}
-+/* }}} */
-+
-+/* {{{ dio_create_stream_data
-+ * Creates an initialised stream data structure.  Free with efree().
-+ */
-+php_dio_stream_data * dio_create_stream_data(void) {
-+      php_dio_posix_stream_data * data = emalloc(sizeof(php_dio_posix_stream_data));
-+      dio_init_stream_data(&(data->common));
-+      data->fd = -1;
-+      data->flags = 0;
-+
-+      return (php_dio_stream_data *)data;
-+}
-+/* }}} */
-+
-+/* {{{ dio_common_write
-+ * Writes count chars from the buffer to the stream described by the stream data.
-+ */
-+size_t dio_common_write(php_dio_stream_data *data, const char *buf, size_t count) {
-+      size_t ret;
-+
-+      /* Blocking writes can be interrupted by signals etc. If
-+       * interrupted try again. Not sure about non-blocking
-+       * writes but it doesn't hurt to check. */
-+      do {
-+              ret = write(((php_dio_posix_stream_data*)data)->fd, buf, count);
-+              if (ret > 0) {
-+                      return ret;
-+              }
-+      } while (errno == EINTR);
-+      return 0;
-+}
-+/* }}} */
-+
-+#ifdef DIO_NONBLOCK
-+/* {{{ dio_timeval_subtract
-+ * Calculates the difference between two timevals returning the result in the
-+ * structure pointed to by diffptr.  Returns -1 as error if late time is
-+ * earlier than early time.
-+ */
-+static int dio_timeval_subtract(struct timeval *late, struct timeval *early, struct timeval *diff) {
-+      struct timeval *tmp;
-+
-+      /* Handle negatives */
-+      if (late->tv_sec < early->tv_sec) {
-+              return 0;
-+      }
-+
-+      if ((late->tv_sec == early->tv_sec) && (late->tv_usec < early->tv_usec)) {
-+              return 0;
-+      }
-+
-+      /* Handle any carry.  If later usec is smaller than earlier usec simple
-+       * subtraction will result in negative value.  Since usec has a maximum
-+       * of one second by adding another second before the subtraction the
-+       * result will always be positive. */
-+      if (late->tv_usec < early->tv_usec) {
-+              late->tv_usec  += 1000000;
-+              late->tv_sec--;
-+      }
-+
-+      /* Once adjusted can just subtract values. */
-+      diff->tv_sec  = late->tv_sec  - early->tv_sec;
-+      diff->tv_usec = late->tv_usec - early->tv_usec;
-+
-+      return 1;
-+}
-+#endif
-+
-+/* {{{ dio_common_read
-+ * Reads count chars to the buffer to the stream described by the stream data.
-+ */
-+size_t dio_common_read(php_dio_stream_data *data, const char *buf, size_t count) {
-+      int fd = ((php_dio_posix_stream_data*)data)->fd;
-+      size_t ret, total = 0;
-+      char *ptr = (char*)buf;
-+
-+      struct timeval timeout, timeouttmp, before, after, diff;
-+      fd_set rfds;
-+
-+      if (!data->has_timeout) {
-+              /* Blocking reads can be interrupted by signals etc. If
-+               * interrupted try again. Not sure about non-blocking
-+               * reads but it doesn't hurt to check. */
-+              do {
-+                      ret = read(fd, (char*)ptr, count);
-+                      if (ret > 0) {
-+                              return ret;
-+                      } else if (!ret) {
-+                              data->end_of_file = 1;
-+                      }
-+              } while ((errno == EINTR) && !data->end_of_file);
-+              return 0;
-+      }
-+#ifdef DIO_NONBLOCK
-+      else {
-+              /* Clear timed out flag */
-+              data->timed_out = 0;
-+
-+              /* The initial timeout value */
-+              timeout.tv_sec  = data->timeout_sec;
-+              timeout.tv_usec = data->timeout_usec;
-+
-+              do {
-+                      /* The semantics of select() are that you cannot guarantee
-+                       * that the timeval structure passed in has not been changed by
-+                       * the select call.  So you keep a copy. */
-+                      timeouttmp = timeout;
-+
-+                      /* The time before we wait for data. */
-+                      (void) gettimeofday(&before, NULL);
-+
-+                      /* Wait for an event on our file descriptor. */
-+                      FD_ZERO(&rfds);
-+                      FD_SET(fd, &rfds);
-+
-+                      ret = select(fd + 1, &rfds, NULL, NULL, &timeouttmp);
-+                      /* An error. */
-+                      if ((ret < 0) && (errno != EINTR) && (errno != EAGAIN)) {
-+                              return 0;
-+                      }
-+
-+                      /* We have data to read. */
-+                      if ((ret > 0) && FD_ISSET(fd, &rfds)) {
-+                              ret = read(fd, ptr, count);
-+                              /* Another error */
-+                              if ((ret < 0) && (errno != EINTR) && (errno != EAGAIN)) {
-+                                      return 0;
-+                              }
-+
-+                              if (ret > 0) {
-+                                      /* Got data, add it to the buffer. */
-+                                      ptr   += ret;
-+                                      total += ret;
-+                                      count -= ret;
-+                              } else if (!ret) {
-+                                      /* This should never happen since how can we have
-+                                       * data to read at an end of file, but still
-+                                       * just in case! */
-+                                      data->end_of_file = 1;
-+                                      break;
-+                              }
-+                      }
-+
-+                      /* If not timed out and not end of file and not all data read
-+                       * calculate how long it took us and loop if we still have time
-+                       * out time left. */
-+                      if (count) {
-+                              (void) gettimeofday(&after, NULL);
-+
-+                              /* Diff the timevals */
-+                              (void) dio_timeval_subtract(&after, &before, &diff);
-+
-+                              /* Now adjust the timeout. */
-+                              if (!dio_timeval_subtract(&timeout, &diff, &timeout)) {
-+                                      /* If it errors we've run out of time. */
-+                                      data->timed_out = 1;
-+                                      break;
-+                              } else if (!timeout.tv_sec && !(timeout.tv_usec / 1000)) {
-+                                      /* Check for rounding issues (millisecond accuracy) */
-+                                      data->timed_out = 1;
-+                                      break;
-+                              }
-+                      }
-+              } while (count); /* Until time out or end of file or all data read. */
-+
-+              return total;
-+      }
-+#endif
-+}
-+/* }}} */
-+
-+/* {{{ php_dio_stream_data
-+ * Closes the php_stream.
-+ */
-+int dio_common_close(php_dio_stream_data *data) {
-+      if (close(((php_dio_posix_stream_data*)data)->fd) < 0) {
-+              return 0;
-+      }
-+
-+      return 1;
-+}
-+/* }}} */
-+
-+/* {{{ dio_common_set_option
-+ * Sets/gets stream options
-+ */
-+int dio_common_set_option(php_dio_stream_data *data, int option, int value, void *ptrparam) {
-+      int fd = ((php_dio_posix_stream_data*)data)->fd;
-+      int old_is_blocking;
-+      int flags;
-+
-+      switch (option) {
-+#ifdef DIO_NONBLOCK
-+              case PHP_STREAM_OPTION_READ_TIMEOUT:
-+                      if (ptrparam) {
-+                              struct timeval *tv = (struct timeval*)ptrparam;
-+
-+                              flags = fcntl(fd, F_GETFL, 0);
-+
-+                              /* A timeout of zero seconds and zero microseconds disables
-+                                 any existing timeout. */
-+                              if (tv->tv_sec || tv->tv_usec) {
-+                                      data->timeout_sec = tv->tv_sec;
-+                                      data->timeout_usec = tv->tv_usec;
-+                                      data->has_timeout = -1;
-+                                      (void) fcntl(fd, F_SETFL, flags & ~DIO_NONBLOCK);
-+                              } else {
-+                                      data->timeout_sec = 0;
-+                                      data->timeout_usec = 0;
-+                                      data->has_timeout = 0;
-+                                      data->timed_out = 0;
-+                                      (void) fcntl(fd, F_SETFL, flags | DIO_NONBLOCK);
-+                              }
-+
-+                              return PHP_STREAM_OPTION_RETURN_OK;
-+                      } else {
-+                              return PHP_STREAM_OPTION_RETURN_ERR;
-+                      }
-+
-+              case PHP_STREAM_OPTION_BLOCKING:
-+                      flags = fcntl(fd, F_GETFL, 0);
-+                      if (value) {
-+                              flags &= ~DIO_NONBLOCK;
-+                      } else {
-+                              flags |= DIO_NONBLOCK;
-+                      }
-+                      (void) fcntl(fd, F_SETFL, flags);
-+
-+                      old_is_blocking = data->is_blocking;
-+                      data->is_blocking = value;
-+                      return old_is_blocking ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR;
-+#endif /* O_NONBLOCK */
-+
-+              default:
-+                      break;
-+      }
-+
-+      return 1;
-+}
-+/* }}} */
-+
-+/* {{{ dio_raw_open_stream
-+ * Opens the underlying stream.
-+ */
-+int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
-+      php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
-+      pdata->flags = dio_stream_mode_to_flags(mode);
-+
-+#ifdef DIO_NONBLOCK
-+      if (!data->is_blocking || data->has_timeout) {
-+              pdata->flags |= DIO_NONBLOCK;
-+      }
-+#endif
-+
-+      /* Open the file and handle any errors. */
-+#ifdef DIO_HAS_FILEPERMS
-+      if (data->has_perms) {
-+              pdata->fd = open(filename, pdata->flags, (mode_t)data->perms);
-+      } else {
-+              pdata->fd = open(filename, pdata->flags);
-+      }
-+#else
-+      pdata->fd = open(filename, pdata->flags);
-+#endif
-+
-+      if (pdata->fd < 0) {
-+              switch (errno) {
-+                      case EEXIST:
-+                              php_error_docref(NULL TSRMLS_CC, E_WARNING, "File exists!");
-+                              return 0;
-+                      default:
-+                              return 0;
-+              }
-+      }
-+
-+      return 1;
-+}
-+/* }}} */
-+
-+/* {{{ dio_serial_init
-+ * Initialises the serial settings storing the original settings before hand.
-+ */
-+static int dio_serial_init(php_dio_stream_data *data TSRMLS_DC) {
-+      php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
-+      int ret = 0, data_bits_def, stop_bits_def, parity_def;
-+      struct termios tio;
-+      speed_t rate_def;
-+
-+      if (!dio_data_rate_to_define(data->data_rate, &rate_def)) {
-+              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_rate value (%ld)", data->data_rate);
-+              return 0;
-+      }
-+
-+      if (!dio_data_bits_to_define(data->data_bits, &data_bits_def)) {
-+              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_bits value (%d)", data->data_bits);
-+              return 0;
-+      }
-+
-+      if (!dio_stop_bits_to_define(data->stop_bits, &stop_bits_def)) {
-+              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid stop_bits value (%d)", data->stop_bits);
-+              return 0;
-+      }
-+
-+      if (!dio_parity_to_define(data->parity, &parity_def)) {
-+              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid parity value (%d)", data->parity);
-+              return 0;
-+      }
-+
-+      ret = tcgetattr(pdata->fd, &(pdata->oldtio));
-+      if (ret < 0) {
-+              if ((errno == ENOTTY) || (errno == ENODEV)) {
-+                      php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a serial port or terminal!");
-+              }
-+              return 0;
-+      }
-+
-+      ret = tcgetattr(pdata->fd, &tio);
-+      if (ret < 0) {
-+              return 0;
-+      }
-+
-+      if (data->canonical) {
-+              tio.c_iflag = IGNPAR | ICRNL;
-+              tio.c_oflag = 0;
-+              tio.c_lflag = ICANON;
-+      } else {
-+              cfmakeraw(&tio);
-+      }
-+
-+      cfsetispeed(&tio, rate_def);
-+      cfsetospeed(&tio, rate_def);
-+
-+      tio.c_cflag &= ~CSIZE;
-+      tio.c_cflag |= data_bits_def;
-+      tio.c_cflag &= ~CSTOPB;
-+      tio.c_cflag |= stop_bits_def;
-+      tio.c_cflag &= ~(PARENB|PARODD);
-+      tio.c_cflag |= parity_def;
-+
-+#ifdef CRTSCTS
-+      tio.c_cflag &= ~(CLOCAL | CRTSCTS);
-+#else
-+      tio.c_cflag &= ~CLOCAL;
-+#endif
-+      if (!data->flow_control) {
-+              tio.c_cflag |= CLOCAL;
-+#ifdef CRTSCTS
-+      } else {
-+              tio.c_cflag |= CRTSCTS;
-+#endif
-+      }
-+
-+      ret = tcsetattr(pdata->fd, TCSANOW, &tio);
-+      if (ret < 0) {
-+              return 0;
-+      }
-+
-+      return 1;
-+}
-+/* }}} */
-+
-+/* {{{ dio_serial_uninit
-+ * Restores the serial settings back to their original state.
-+ */
-+int dio_serial_uninit(php_dio_stream_data *data) {
-+      php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
-+      int ret;
-+
-+      do {
-+              ret = tcsetattr(pdata->fd, TCSANOW, &(pdata->oldtio));
-+      } while ((ret < 0) && (errno == EINTR));
-+
-+      return 1;
-+}
-+/* }}} */
-+
-+/* {{{ dio_serial_flush
-+ * Purges the serial buffers of data.
-+ */
-+int dio_serial_purge(php_dio_stream_data *data) {
-+      php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
-+      int ret;
-+
-+      if ((pdata->flags & O_RDWR) == O_RDWR) {
-+              ret = tcflush(pdata->fd, TCIOFLUSH);
-+      } else if ((pdata->flags & O_WRONLY) == O_WRONLY) {
-+              ret = tcflush(pdata->fd, TCOFLUSH);
-+      } else if ((pdata->flags & O_RDONLY) == O_RDONLY) {
-+              ret = tcflush(pdata->fd, TCIFLUSH);
-+      }
-+
-+      if (ret < 0) {
-+              return 0;
-+      }
-+
-+      return 1;
-+}
-+/* }}} */
-+
-+/* {{{ dio_serial_open_stream
-+ * Opens the underlying stream.
-+ */
-+int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
-+      php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
-+
-+#ifdef O_NOCTTY
-+      /* We don't want a controlling TTY */
-+      pdata->flags |= O_NOCTTY;
-+#endif
-+
-+      if (!dio_raw_open_stream(filename, mode, data TSRMLS_CC)) {
-+              return 0;
-+      }
-+
-+      if (!dio_serial_init(data TSRMLS_CC)) {
-+              close(pdata->fd);
-+              return 0;
-+      }
-+
-+      return 1;
-+}
-+/* }}} */
-+
-+/*
-+ * Local variables:
-+ * c-basic-offset: 4
-+ * tab-width: 4
-+ * End:
-+ * vim600: fdm=marker
-+ * vim: sw=4 ts=4 noet
-+ */
---- a/dio_win32.c
-+++ b/dio_win32.c
-@@ -1,759 +1,759 @@
--/*\r
--   +----------------------------------------------------------------------+\r
--   | PHP Version 5                                                        |\r
--   +----------------------------------------------------------------------+\r
--   | Copyright (c) 2009 Melanie Rhianna Lewis                             |\r
--   +----------------------------------------------------------------------+\r
--   | This source file is subject to version 3.0 of the PHP license,       |\r
--   | that is bundled with this package in the file LICENSE, and is        |\r
--   | available through the world-wide-web at the following url:           |\r
--   | http://www.php.net/license/3_0.txt.                                  |\r
--   | If you did not receive a copy of the PHP license and are unable to   |\r
--   | obtain it through the world-wide-web, please send a note to          |\r
--   | license@php.net so we can mail you a copy immediately.               |\r
--   +----------------------------------------------------------------------+\r
--   | Author: Melanie Rhianna Lewis <cyberspice@php.net>                   |\r
--   +----------------------------------------------------------------------+\r
-- */\r
--\r
--#ifdef HAVE_CONFIG_H\r
--#include "config.h"\r
--#endif\r
--\r
--#include "php.h"\r
--#include "php_dio_common.h"\r
--\r
--#ifndef ZEND_WIN32\r
--#error ZEND_WIN32 not defined!\r
--#endif\r
--\r
--/* {{{ dio_last_error_php_error\r
-- * Generates a PHP error message based upon the last Windows error.\r
-- */\r
--static void dio_last_error_php_error(int level, char * message TSRMLS_DC) {\r
--      LPVOID msgbuf;\r
--      DWORD  msgbuflen;\r
--      char * errmsg;\r
--      DWORD  err;\r
--\r
--#ifdef UNICODE\r
--      DWORD  errmsglen;\r
--#endif\r
--\r
--      err = GetLastError();\r
--      msgbuflen = FormatMessage(\r
--              FORMAT_MESSAGE_ALLOCATE_BUFFER|\r
--              FORMAT_MESSAGE_FROM_SYSTEM|\r
--              FORMAT_MESSAGE_IGNORE_INSERTS,\r
--              NULL,\r
--              err,\r
--              MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),\r
--              (LPTSTR)&msgbuf,\r
--              0,\r
--              NULL);\r
--\r
--#ifdef UNICODE\r
--\r
--      /* Get the length of the converted message */\r
--      errmsglen = WideCharToMultibyte(\r
--              CP_ACP,\r
--              0\r
--              (LPCWSTR)msgbuf,\r
--              -1,\r
--              (LPSTR)errmsg,\r
--              0,\r
--              NULL,\r
--              NULL);\r
--\r
--      /* Allocate a buffer */\r
--      errmsg = emalloc(errmsglen);\r
--      if (!errmsg) {\r
--              php_error_docref(NULL TSRMLS_CC, E_ERROR, "Out of memory in dio_last_error_php_error()!");\r
--              LocalFree(msgbuf);\r
--              return;\r
--      }\r
--\r
--      /* Convert the message */\r
--      errmsglen = WideCharToMultibyte(\r
--              CP_ACP,\r
--              0\r
--              (LPCWSTR)msgbuf,\r
--              -1,\r
--              (LPSTR)errmsg,\r
--              errmsglen,\r
--              NULL,\r
--              NULL);\r
--\r
--#else\r
--      errmsg = (char *)msgbuf;\r
--#endif\r
--\r
--      php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s[ERROR %d] %s", message, err, errmsg);\r
--\r
--      LocalFree(msgbuf);\r
--#ifdef UNICODE\r
--      efree(errmsg);\r
--#endif\r
--}\r
--\r
--/* {{{ dio_data_rate_to_define\r
-- * Converts a numeric data rate to a termios define\r
-- */\r
--static int dio_data_rate_to_define(long rate, DWORD *def) {\r
--      switch (rate) {\r
--              case 75:\r
--              case 110:\r
--              case 134:\r
--              case 150:\r
--              case 300:\r
--              case 600:\r
--              case 1200:\r
--              case 1800:\r
--              case 2400:\r
--              case 4800:\r
--              case 7200:\r
--              case 9600:\r
--              case 14400:\r
--              case 19200:\r
--              case 38400:\r
--              case 57600:\r
--              case 115200:\r
--              case 56000:\r
--              case 128000:\r
--              case 256000:\r
--                      break;\r
--              default:\r
--                      return 0;\r
--      }\r
--\r
--      *def = (DWORD)rate;\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--\r
--/* {{{ dio_data_bits_to_define\r
-- * Converts a number of data bits to a termios define\r
-- */\r
--static int dio_data_bits_to_define(int data_bits, DWORD *def) {\r
--      switch (data_bits) {\r
--              case 8:\r
--              case 7:\r
--              case 6:\r
--              case 5:\r
--              case 4:\r
--                      break;\r
--              default:\r
--                      return 0;\r
--      }\r
--\r
--      *def = (DWORD)data_bits;\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_stop_bits_to_define\r
-- * Converts a number of stop bits to a termios define\r
-- */\r
--static int dio_stop_bits_to_define(int stop_bits, DWORD *def) {\r
--      DWORD val;\r
--\r
--      switch (stop_bits) {\r
--              case 1:\r
--                      val = ONESTOPBIT;\r
--                      break;\r
--              case 2:\r
--                      val = TWOSTOPBITS;\r
--                      break;\r
--              case 3:\r
--                      val = ONE5STOPBITS;\r
--                      break;\r
--              default:\r
--                      return 0;\r
--      }\r
--\r
--      *def = val;\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_parity_to_define\r
-- * Converts a parity type to a termios define\r
-- */\r
--static int dio_parity_to_define(int parity, DWORD *def) {\r
--      DWORD val;\r
--\r
--      switch (parity) {\r
--              case 0:\r
--                      val = NOPARITY;\r
--                      break;\r
--              case 1:\r
--                      val = ODDPARITY;\r
--                      break;\r
--              case 2:\r
--                      val = EVENPARITY;\r
--                      break;\r
--              default:\r
--                      return 0;\r
--      }\r
--\r
--      *def = val;\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_create_stream_data\r
-- * Creates an initialised stream data structure.  Free with efree().\r
-- */\r
--php_dio_stream_data * dio_create_stream_data(void) {\r
--      php_dio_win32_stream_data * data = emalloc(sizeof(php_dio_win32_stream_data));\r
--      memset(data, 0, sizeof(php_dio_win32_stream_data));\r
--      dio_init_stream_data(&(data->common));\r
--      data->handle = INVALID_HANDLE_VALUE;\r
--      data->desired_access = 0;\r
--      data->creation_disposition = 0;\r
--      data->olddcb.DCBlength = sizeof(DCB);\r
--\r
--      return (php_dio_stream_data *)data;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_common_write\r
-- * Writes count chars from the buffer to the stream described by the stream data.\r
-- */\r
--size_t dio_common_write(php_dio_stream_data *data, const char *buf, size_t count) {\r
--      php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;\r
--      DWORD total = 0;\r
--\r
--      if (WriteFile(wdata->handle, buf, (DWORD)count, &total, NULL)) {\r
--              return (size_t)total;\r
--      }\r
--\r
--      return 0;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_buffer_read\r
-- * Reads any available chars from the canonical buffer.\r
-- */\r
--static size_t dio_buffer_read(php_dio_win32_stream_data *wdata, const char *buf, size_t count) {\r
--      php_dio_win32_canon_data *canon_data = wdata->canon_data;\r
--      size_t total = 0;\r
--\r
--      /* Read always follows write.  I.e. if read ptr > write ptr buffer has\r
--         wrapped and so we need to copy two blocks of data. */\r
--      if (canon_data->read_pos > canon_data->write_pos) {\r
--\r
--              /* Check we actually need to copy both blocks */\r
--              if ((canon_data->size - canon_data->read_pos) > count) {\r
--\r
--                      /* No we don't.  Just copy as much as we were asked for. */\r
--                      memcpy((char*)buf, \r
--                                 &(canon_data->buf[canon_data->read_pos]), \r
--                                 count);\r
--                      /* Update the read pointer. */\r
--                      canon_data->read_pos += count;\r
--\r
--                      /* Return the amount read. */\r
--                      return count;\r
--              } else {\r
--\r
--                      /* We need to copy both blocks so copy data up to the end of \r
--                         the buffer. */\r
--                      total = canon_data->size - canon_data->read_pos;\r
--                      memcpy((char*)buf, \r
--                                 &(canon_data->buf[canon_data->read_pos]), \r
--                                 total);\r
--                      canon_data->read_pos = 0;\r
--                      count -= total;\r
--\r
--                      /* Now copy the data from the start of the buffer either up\r
--                         count or the number of bytes in the buffer. */\r
--\r
--                      if (canon_data->write_pos > count) {\r
--                              memcpy((char*)buf, canon_data->buf, count);\r
--                              canon_data->read_pos = count;\r
--                              total += count;\r
--\r
--                              return total;\r
--                      } else {\r
--                              memcpy((char*)buf, canon_data->buf, canon_data->write_pos);\r
--                              canon_data->read_pos = canon_data->write_pos;\r
--                              total += canon_data->write_pos;\r
--\r
--                              return total;\r
--                      }\r
--              }\r
--\r
--      /* Else if write follows read.  This is a simpler case.  We just copy \r
--         either all the data buffered or count, which ever is smaller. */\r
--      } else if (canon_data->write_pos > canon_data->read_pos) {\r
--              if ((canon_data->write_pos - canon_data->read_pos) > count) {\r
--                      memcpy((char*)buf, \r
--                                 &(canon_data->buf[canon_data->read_pos]), \r
--                                 count);\r
--                      canon_data->read_pos += count;\r
--\r
--                      return count;\r
--              } else {\r
--                      total = canon_data->write_pos - canon_data->read_pos;\r
--                      memcpy((char*)buf, \r
--                                 &(canon_data->buf[canon_data->read_pos]), \r
--                                 total);\r
--                      canon_data->read_pos += total;\r
--\r
--                      return total;\r
--              }\r
--      }\r
--\r
--      /* Else we need to read more data from the data port. */\r
--      return 0;\r
--}\r
--\r
--/* {{{ dio_com_read\r
-- * Read chars from the data port.\r
-- */\r
--static size_t dio_com_read(php_dio_stream_data *data, const char *buf, size_t count) {\r
--      php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;\r
--      DWORD err, total = 0;\r
--\r
--      if (ReadFile(wdata->handle, (void*)buf, (DWORD)count, &total, NULL)) {\r
--\r
--              if (total) {\r
--                      return (size_t)total;\r
--              }\r
--\r
--              data->end_of_file = 1;\r
--      }\r
--\r
--      if (!data->end_of_file) {\r
--              err = GetLastError();\r
--\r
--              if (ERROR_HANDLE_EOF == err) {\r
--                      data->end_of_file = 1;\r
--              }\r
--      }\r
--\r
--      return 0;\r
--}\r
--\r
--/* {{{ dio_canonical_read\r
-- * Reads chars from the input stream until the internal buffer is full or a new\r
-- * line is reached.\r
-- */\r
--static size_t dio_canonical_read(php_dio_win32_stream_data *wdata, const char *buf, size_t count) {\r
--      php_dio_win32_canon_data *canon_data = wdata->canon_data;\r
--      size_t total = 0;\r
--      char ch;\r
--\r
--      /* See if there's any buffered data and copy it. */\r
--      total = dio_buffer_read(wdata, buf, count);\r
--      if (total) {\r
--              return total;\r
--      }\r
--\r
--      /* Need to read more data from the data port.  Buffer should be empty(er)\r
--         by now. */\r
--      do {\r
--              /* Is the buffer full? */\r
--              if (((canon_data->write_pos + 1) % canon_data->size) == \r
--                      canon_data->read_pos) {\r
--                      break;\r
--              }\r
--\r
--              /* Read a byte from the input checking for EOF. */\r
--              if (!dio_com_read((php_dio_stream_data*)wdata, &ch, 1)) {\r
--                      break;\r
--              }\r
--\r
--              /* Translate CR to newlines (same as ICRNL in POSIX) */\r
--              ch = (ch != '\r') ? ch : '\n';\r
--\r
--              /* We read a character!  So buffer it. */\r
--              canon_data->buf[canon_data->write_pos++] = ch;\r
--              if (canon_data->write_pos >= canon_data->size) {\r
--                      canon_data->write_pos = 0;\r
--              }\r
--\r
--              /* End of line/input (^D)? */\r
--      } while ((ch != '\n') && (ch != 0x04));\r
--\r
--      return dio_buffer_read(wdata, buf, count);\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_common_read\r
-- * Reads count chars to the buffer to the stream described by the stream data.\r
-- */\r
--size_t dio_common_read(php_dio_stream_data *data, const char *buf, size_t count) {\r
--\r
--      /* You ask for no bytes you'll get none :-) */\r
--      if (!count) {\r
--              return 0;\r
--      }\r
--\r
--      if (data->canonical) {\r
--              return dio_canonical_read((php_dio_win32_stream_data*)data, buf, count);\r
--      } else {\r
--              return dio_com_read(data, buf, count);\r
--      }\r
--}\r
--/* }}} */\r
--\r
--/* {{{ php_dio_stream_data\r
-- * Closes the php_stream.\r
-- */\r
--int dio_common_close(php_dio_stream_data *data) {\r
--      php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;\r
--\r
--      if (data->canonical) {\r
--              efree(wdata->canon_data);\r
--      }\r
--\r
--      if (!CloseHandle(wdata->handle)) {\r
--              return 0;\r
--      }\r
--\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_common_set_option\r
-- * Sets/gets stream options\r
-- */\r
--int dio_common_set_option(php_dio_stream_data *data, int option, int value, void *ptrparam) {\r
--      COMMTIMEOUTS cto = { 0, 0, 0, 0, 0 };\r
--      int old_is_blocking = 0;\r
--\r
--      /* Can't do timeouts or non blocking with raw windows streams :-( */\r
--      if (DIO_STREAM_TYPE_SERIAL == data->stream_type) {\r
--              switch (option) {\r
--                      case PHP_STREAM_OPTION_BLOCKING:\r
--                              old_is_blocking   = data->is_blocking;\r
--                              data->is_blocking = value ? 1 : 0;\r
--\r
--                              /* Only change values if we need to change them. */\r
--                              if (data->is_blocking != old_is_blocking) {\r
--                                      /* If we're not blocking but don't have a timeout\r
--                                         set to return immediately */\r
--                                      if (!data->is_blocking && !data->has_timeout) {\r
--                                              cto.ReadIntervalTimeout = MAXDWORD;\r
--                                      }\r
--\r
--                                      /* If we have a timeout ignore the blocking and set\r
--                                         the total time in which to read the data */\r
--                                      if (data->has_timeout) {\r
--                                              cto.ReadIntervalTimeout = MAXDWORD;\r
--                                              cto.ReadTotalTimeoutMultiplier  = MAXDWORD;\r
--                                              cto.ReadTotalTimeoutConstant = (data->timeout_usec / 1000) +\r
--                                                      (data->timeout_sec * 1000);\r
--                                      }\r
--\r
--                                      if (!SetCommTimeouts(((php_dio_win32_stream_data*)data)->handle, &cto)) {\r
--                                              return PHP_STREAM_OPTION_RETURN_ERR;\r
--                                      }\r
--                              }\r
--                              return old_is_blocking ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR;\r
--\r
--                      case PHP_STREAM_OPTION_READ_TIMEOUT:\r
--                              if (ptrparam) {\r
--                                      /* struct timeval is supported with PHP_WIN32 defined. */\r
--                                      struct timeval *tv = (struct timeval*)ptrparam;\r
--\r
--                                      /* A timeout of zero seconds and zero microseconds disables\r
--                                         any existing timeout. */\r
--                                      if (tv->tv_sec || tv->tv_usec) {\r
--                                              data->timeout_sec = tv->tv_sec;\r
--                                              data->timeout_usec = tv->tv_usec;\r
--                                              data->has_timeout = -1;\r
--\r
--                                              cto.ReadIntervalTimeout = MAXDWORD;\r
--                                              cto.ReadTotalTimeoutMultiplier  = MAXDWORD;\r
--                                              cto.ReadTotalTimeoutConstant = (data->timeout_usec / 1000) +\r
--                                                      (data->timeout_sec * 1000);\r
--                                      } else {\r
--                                              data->timeout_sec = 0;\r
--                                              data->timeout_usec = 0;\r
--                                              data->has_timeout = 0;\r
--                                              data->timed_out = 0;\r
--\r
--                                              /* If we're not blocking but don't have a timeout\r
--                                                 set to return immediately */\r
--                                              if (!data->is_blocking) {\r
--                                                      cto.ReadIntervalTimeout = MAXDWORD;\r
--                                              }\r
--                                      }\r
--\r
--                                      if (!SetCommTimeouts(((php_dio_win32_stream_data*)data)->handle, &cto)) {\r
--                                              return PHP_STREAM_OPTION_RETURN_ERR;\r
--                                      } else {\r
--                                              return PHP_STREAM_OPTION_RETURN_OK;\r
--                                      }\r
--                              } else {\r
--                                      return PHP_STREAM_OPTION_RETURN_ERR;\r
--                              }\r
--\r
--                      default:\r
--                              break;\r
--              }\r
--      }\r
--\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_raw_open_stream\r
-- * Opens the underlying stream.\r
-- */\r
--int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {\r
--      php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;\r
--      DWORD err;\r
--\r
--      switch(*mode) {\r
--              case 'r':\r
--                      wdata->creation_disposition = OPEN_EXISTING;\r
--                      break;\r
--              case 'w':\r
--                      wdata->creation_disposition = TRUNCATE_EXISTING;\r
--                      break;\r
--              case 'a':\r
--                      wdata->creation_disposition = OPEN_ALWAYS;\r
--                      break;\r
--              case 'x':\r
--                      wdata->creation_disposition = CREATE_NEW;\r
--                      break;\r
--      }\r
--      mode ++;\r
--\r
--      if (*mode && (*mode != '+')) {\r
--              mode++;\r
--      }\r
--\r
--      if (*mode && (*mode == '+')) {\r
--              wdata->desired_access = GENERIC_READ | GENERIC_WRITE;\r
--      } else if (OPEN_EXISTING == wdata->creation_disposition) {\r
--              wdata->desired_access = GENERIC_READ;\r
--      } else {\r
--              wdata->desired_access = GENERIC_WRITE;\r
--      }\r
--\r
--      wdata->handle = CreateFile(filename, wdata->desired_access, 0,\r
--                      NULL, wdata->creation_disposition, FILE_ATTRIBUTE_NORMAL, NULL);\r
--      if (INVALID_HANDLE_VALUE == wdata->handle) {\r
--              err = GetLastError();\r
--              switch (err) {\r
--                      case ERROR_FILE_EXISTS:\r
--                              php_error_docref(NULL TSRMLS_CC, E_WARNING, "File exists!");\r
--                              return 0;\r
--\r
--                      case ERROR_FILE_NOT_FOUND:\r
--                              /* ERROR_FILE_NOT_FOUND with TRUNCATE_EXISTING means that\r
--                               * the file doesn't exist so now try to create it. */\r
--                              if (TRUNCATE_EXISTING == wdata->creation_disposition) {\r
--                                      php_error_docref(NULL TSRMLS_CC, E_NOTICE, "File does not exist, creating new file!");\r
--\r
--                                      wdata->handle = CreateFile(filename, wdata->desired_access, 0,\r
--                                                              NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);\r
--                                      if (INVALID_HANDLE_VALUE == wdata->handle) {\r
--                                              dio_last_error_php_error(E_WARNING, "CreateFile() failed:" TSRMLS_CC);\r
--                                              return 0;\r
--                                      }\r
--                              } else {\r
--                                      php_error_docref(NULL TSRMLS_CC, E_WARNING, "File not found!");\r
--                                      return 0;\r
--                              }\r
--                              break;\r
--\r
--                      default:\r
--                              dio_last_error_php_error(E_WARNING, "CreateFile() failed:" TSRMLS_CC);\r
--                              return 0;\r
--              }\r
--      }\r
--\r
--      /* If canonical allocate the canonical buffer. */\r
--      if (data->canonical) {\r
--              wdata->canon_data = emalloc(sizeof(php_dio_win32_canon_data));\r
--              memset(wdata->canon_data, 0, sizeof(php_dio_win32_canon_data));\r
--              wdata->canon_data->size = DIO_WIN32_CANON_BUF_SIZE;\r
--      }\r
--\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_serial_init\r
-- * Initialises the serial port\r
-- */\r
--static int dio_serial_init(php_dio_stream_data *data TSRMLS_DC) {\r
--      php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;\r
--      DWORD rate_def, data_bits_def, stop_bits_def, parity_def;\r
--      DCB dcb;\r
--\r
--      if (!dio_data_rate_to_define(data->data_rate, &rate_def)) {\r
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_rate value (%d)", data->data_rate);\r
--              return 0;\r
--      }\r
--\r
--      if (!dio_data_bits_to_define(data->data_bits, &data_bits_def)) {\r
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_bits value (%d)", data->data_bits);\r
--              return 0;\r
--      }\r
--\r
--      if (!dio_stop_bits_to_define(data->stop_bits, &stop_bits_def)) {\r
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid stop_bits value (%d)", data->stop_bits);\r
--              return 0;\r
--      }\r
--\r
--      if (!dio_parity_to_define(data->parity, &parity_def)) {\r
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid parity value (%d)", data->parity);\r
--              return 0;\r
--      }\r
--\r
--      if (!GetCommState(wdata->handle, &(wdata->olddcb))) {\r
--              dio_last_error_php_error(E_WARNING, "GetCommState() failed:" TSRMLS_CC);\r
--              return 0;\r
--      }\r
--\r
--      /* Init the DCB structure */\r
--      memset(&dcb, 0, sizeof(DCB));\r
--      dcb.DCBlength = sizeof(DCB);\r
--\r
--      /* Set the communication parameters */\r
--      dcb.fBinary  = 1;\r
--      dcb.BaudRate = rate_def;\r
--      dcb.ByteSize = (BYTE)data_bits_def;\r
--      dcb.StopBits = (BYTE)stop_bits_def;\r
--      dcb.Parity   = (BYTE)parity_def;\r
--\r
--      /* Set the control line parameters */\r
--      dcb.fDtrControl       = DTR_CONTROL_DISABLE;\r
--      dcb.fDsrSensitivity   = FALSE;\r
--      dcb.fOutxDsrFlow      = FALSE;\r
--      dcb.fTXContinueOnXoff = FALSE;\r
--      dcb.fOutX             = FALSE;\r
--      dcb.fInX              = FALSE;\r
--      dcb.fErrorChar        = FALSE;\r
--      dcb.fNull             = FALSE;\r
--      dcb.fAbortOnError     = FALSE;\r
--\r
--      /* Hardware flow control */\r
--      if (data->flow_control) {\r
--              dcb.fOutxCtsFlow = TRUE;\r
--              dcb.fRtsControl  = RTS_CONTROL_HANDSHAKE;\r
--      } else {\r
--              dcb.fOutxCtsFlow = FALSE;\r
--              dcb.fRtsControl  = RTS_CONTROL_DISABLE;\r
--      }\r
--\r
--      if (!SetCommState(wdata->handle, &dcb)) {\r
--              dio_last_error_php_error(E_WARNING, "SetCommState() failed:" TSRMLS_CC);\r
--              return 0;\r
--      }\r
--\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--\r
--/* {{{ dio_serial_uninit\r
-- * Restores the serial settings back to their original state.\r
-- */\r
--int dio_serial_uninit(php_dio_stream_data *data) {\r
--      php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;\r
--\r
--      if (!SetCommState(wdata->handle, &(wdata->olddcb))) {\r
--              return 0;\r
--      }\r
--\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_serial_flush\r
-- * Purges the serial buffers of data.\r
-- */\r
--int dio_serial_purge(php_dio_stream_data *data) {\r
--      php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;\r
--      BOOL ret;\r
--\r
--      /* Purge the canonical buffer if required */\r
--      if (data->canonical && ((wdata->desired_access & GENERIC_READ) == GENERIC_READ)) {\r
--              wdata->canon_data->read_pos  = 0;\r
--              wdata->canon_data->write_pos = 0;\r
--      }\r
--\r
--      /* Purge the com port */\r
--      if ((wdata->desired_access & (GENERIC_READ|GENERIC_WRITE)) == (GENERIC_READ|GENERIC_WRITE)) {\r
--              ret = PurgeComm(wdata->handle, PURGE_RXCLEAR|PURGE_TXCLEAR);\r
--      } else if ((wdata->desired_access & GENERIC_WRITE) == GENERIC_WRITE) {\r
--              ret = PurgeComm(wdata->handle, PURGE_TXCLEAR);\r
--      } else if ((wdata->desired_access & GENERIC_READ) == GENERIC_READ) {\r
--              ret = PurgeComm(wdata->handle, PURGE_RXCLEAR);\r
--      }\r
--\r
--      return ret;\r
--}\r
--/* }}} */\r
--\r
--/* {{{ dio_serial_open_stream\r
-- * Opens the underlying stream.\r
-- */\r
--int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {\r
--      php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;\r
--      COMMTIMEOUTS cto = { 0, 0, 0, 0, 0 };\r
--\r
--      php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Opening \"%s\" as a serial port (mode=\"%s\").", filename, mode);\r
--\r
--      if (*mode != 'r') {\r
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must open serial ports in read or read/write mode!");\r
--              return 0;\r
--      }\r
--\r
--      if (!dio_raw_open_stream(filename, mode, data TSRMLS_CC)) {\r
--              return 0;\r
--      }\r
--\r
--      if (!GetCommTimeouts(wdata->handle, &(wdata->oldcto))) {\r
--              dio_last_error_php_error(E_WARNING, "GetCommTimeouts() failed (Not a comm port?):" TSRMLS_CC);\r
--              CloseHandle(wdata->handle);\r
--              return 0;\r
--      }\r
--\r
--      /* If we're not blocking but don't have a timeout\r
--         set to return immediately */\r
--      if (!data->is_blocking && !data->has_timeout) {\r
--              cto.ReadIntervalTimeout = MAXDWORD;\r
--      }\r
--      \r
--      /* If we have a timeout ignore the blocking and set\r
--         the total time in which to read the data */\r
--      if (data->has_timeout) {\r
--              cto.ReadIntervalTimeout = MAXDWORD;\r
--              cto.ReadTotalTimeoutMultiplier  = MAXDWORD;\r
--              cto.ReadTotalTimeoutConstant = (data->timeout_usec / 1000) + \r
--                      (data->timeout_sec * 1000);\r
--      }\r
--\r
--      if (!SetCommTimeouts(wdata->handle, &cto)) {\r
--              dio_last_error_php_error(E_WARNING, "SetCommTimeouts() failed:" TSRMLS_CC);\r
--              CloseHandle(wdata->handle);\r
--              return 0;\r
--      }\r
--\r
--      if (!dio_serial_init(data TSRMLS_CC)) {\r
--              CloseHandle(wdata->handle);\r
--              return 0;\r
--      }\r
--\r
--      return 1;\r
--}\r
--/* }}} */\r
--\r
--/*\r
-- * Local variables:\r
-- * c-basic-offset: 4\r
-- * tab-width: 4\r
-- * End:\r
-- * vim600: fdm=marker\r
-- * vim: sw=4 ts=4 noet\r
-- */\r
-+/*
-+   +----------------------------------------------------------------------+
-+   | PHP Version 5                                                        |
-+   +----------------------------------------------------------------------+
-+   | Copyright (c) 2009 Melanie Rhianna Lewis                             |
-+   +----------------------------------------------------------------------+
-+   | This source file is subject to version 3.0 of the PHP license,       |
-+   | that is bundled with this package in the file LICENSE, and is        |
-+   | available through the world-wide-web at the following url:           |
-+   | http://www.php.net/license/3_0.txt.                                  |
-+   | If you did not receive a copy of the PHP license and are unable to   |
-+   | obtain it through the world-wide-web, please send a note to          |
-+   | license@php.net so we can mail you a copy immediately.               |
-+   +----------------------------------------------------------------------+
-+   | Author: Melanie Rhianna Lewis <cyberspice@php.net>                   |
-+   +----------------------------------------------------------------------+
-+ */
-+
-+#ifdef HAVE_CONFIG_H
-+#include "config.h"
-+#endif
-+
-+#include "php.h"
-+#include "php_dio_common.h"
-+
-+#ifndef ZEND_WIN32
-+#error ZEND_WIN32 not defined!
-+#endif
-+
-+/* {{{ dio_last_error_php_error
-+ * Generates a PHP error message based upon the last Windows error.
-+ */
-+static void dio_last_error_php_error(int level, char * message TSRMLS_DC) {
-+      LPVOID msgbuf;
-+      DWORD  msgbuflen;
-+      char * errmsg;
-+      DWORD  err;
-+
-+#ifdef UNICODE
-+      DWORD  errmsglen;
-+#endif
-+
-+      err = GetLastError();
-+      msgbuflen = FormatMessage(
-+              FORMAT_MESSAGE_ALLOCATE_BUFFER|
-+              FORMAT_MESSAGE_FROM_SYSTEM|
-+              FORMAT_MESSAGE_IGNORE_INSERTS,
-+              NULL,
-+              err,
-+              MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-+              (LPTSTR)&msgbuf,
-+              0,
-+              NULL);
-+
-+#ifdef UNICODE
-+
-+      /* Get the length of the converted message */
-+      errmsglen = WideCharToMultibyte(
-+              CP_ACP,
-+              0
-+              (LPCWSTR)msgbuf,
-+              -1,
-+              (LPSTR)errmsg,
-+              0,
-+              NULL,
-+              NULL);
-+
-+      /* Allocate a buffer */
-+      errmsg = emalloc(errmsglen);
-+      if (!errmsg) {
-+              php_error_docref(NULL TSRMLS_CC, E_ERROR, "Out of memory in dio_last_error_php_error()!");
-+              LocalFree(msgbuf);
-+              return;
-+      }
-+
-+      /* Convert the message */
-+      errmsglen = WideCharToMultibyte(
-+              CP_ACP,
-+              0
-+              (LPCWSTR)msgbuf,
-+              -1,
-+              (LPSTR)errmsg,
-+              errmsglen,
-+              NULL,
-+              NULL);
-+
-+#else
-+      errmsg = (char *)msgbuf;
-+#endif
-+
-+      php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s[ERROR %d] %s", message, err, errmsg);
-+
-+      LocalFree(msgbuf);
-+#ifdef UNICODE
-+      efree(errmsg);
-+#endif
-+}
-+
-+/* {{{ dio_data_rate_to_define
-+ * Converts a numeric data rate to a termios define
-+ */
-+static int dio_data_rate_to_define(long rate, DWORD *def) {
-+      switch (rate) {
-+              case 75:
-+              case 110:
-+              case 134:
-+              case 150:
-+              case 300:
-+              case 600:
-+              case 1200:
-+              case 1800:
-+              case 2400:
-+              case 4800:
-+              case 7200:
-+              case 9600:
-+              case 14400:
-+              case 19200:
-+              case 38400:
-+              case 57600:
-+              case 115200:
-+              case 56000:
-+              case 128000:
-+              case 256000:
-+                      break;
-+              default:
-+                      return 0;
-+      }
-+
-+      *def = (DWORD)rate;
-+      return 1;
-+}
-+/* }}} */
-+
-+
-+/* {{{ dio_data_bits_to_define
-+ * Converts a number of data bits to a termios define
-+ */
-+static int dio_data_bits_to_define(int data_bits, DWORD *def) {
-+      switch (data_bits) {
-+              case 8:
-+              case 7:
-+              case 6:
-+              case 5:
-+              case 4:
-+                      break;
-+              default:
-+                      return 0;
-+      }
-+
-+      *def = (DWORD)data_bits;
-+      return 1;
-+}
-+/* }}} */
-+
-+/* {{{ dio_stop_bits_to_define
-+ * Converts a number of stop bits to a termios define
-+ */
-+static int dio_stop_bits_to_define(int stop_bits, DWORD *def) {
-+      DWORD val;
-+
-+      switch (stop_bits) {
-+              case 1:
-+                      val = ONESTOPBIT;
-+                      break;
-+              case 2:
-+                      val = TWOSTOPBITS;
-+                      break;
-+              case 3:
-+                      val = ONE5STOPBITS;
-+                      break;
-+              default:
-+                      return 0;
-+      }
-+
-+      *def = val;
-+      return 1;
-+}
-+/* }}} */
-+
-+/* {{{ dio_parity_to_define
-+ * Converts a parity type to a termios define
-+ */
-+static int dio_parity_to_define(int parity, DWORD *def) {
-+      DWORD val;
-+
-+      switch (parity) {
-+              case 0:
-+                      val = NOPARITY;
-+                      break;
-+              case 1:
-+                      val = ODDPARITY;
-+                      break;
-+              case 2:
-+                      val = EVENPARITY;
-+                      break;
-+              default:
-+                      return 0;
-+      }
-+
-+      *def = val;
-+      return 1;
-+}
-+/* }}} */
-+
-+/* {{{ dio_create_stream_data
-+ * Creates an initialised stream data structure.  Free with efree().
-+ */
-+php_dio_stream_data * dio_create_stream_data(void) {
-+      php_dio_win32_stream_data * data = emalloc(sizeof(php_dio_win32_stream_data));
-+      memset(data, 0, sizeof(php_dio_win32_stream_data));
-+      dio_init_stream_data(&(data->common));
-+      data->handle = INVALID_HANDLE_VALUE;
-+      data->desired_access = 0;
-+      data->creation_disposition = 0;
-+      data->olddcb.DCBlength = sizeof(DCB);
-+
-+      return (php_dio_stream_data *)data;
-+}
-+/* }}} */
-+
-+/* {{{ dio_common_write
-+ * Writes count chars from the buffer to the stream described by the stream data.
-+ */
-+size_t dio_common_write(php_dio_stream_data *data, const char *buf, size_t count) {
-+      php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
-+      DWORD total = 0;
-+
-+      if (WriteFile(wdata->handle, buf, (DWORD)count, &total, NULL)) {
-+              return (size_t)total;
-+      }
-+
-+      return 0;
-+}
-+/* }}} */
-+
-+/* {{{ dio_buffer_read
-+ * Reads any available chars from the canonical buffer.
-+ */
-+static size_t dio_buffer_read(php_dio_win32_stream_data *wdata, const char *buf, size_t count) {
-+      php_dio_win32_canon_data *canon_data = wdata->canon_data;
-+      size_t total = 0;
-+
-+      /* Read always follows write.  I.e. if read ptr > write ptr buffer has
-+         wrapped and so we need to copy two blocks of data. */
-+      if (canon_data->read_pos > canon_data->write_pos) {
-+
-+              /* Check we actually need to copy both blocks */
-+              if ((canon_data->size - canon_data->read_pos) > count) {
-+
-+                      /* No we don't.  Just copy as much as we were asked for. */
-+                      memcpy((char*)buf, 
-+                                 &(canon_data->buf[canon_data->read_pos]), 
-+                                 count);
-+                      /* Update the read pointer. */
-+                      canon_data->read_pos += count;
-+
-+                      /* Return the amount read. */
-+                      return count;
-+              } else {
-+
-+                      /* We need to copy both blocks so copy data up to the end of 
-+                         the buffer. */
-+                      total = canon_data->size - canon_data->read_pos;
-+                      memcpy((char*)buf, 
-+                                 &(canon_data->buf[canon_data->read_pos]), 
-+                                 total);
-+                      canon_data->read_pos = 0;
-+                      count -= total;
-+
-+                      /* Now copy the data from the start of the buffer either up
-+                         count or the number of bytes in the buffer. */
-+
-+                      if (canon_data->write_pos > count) {
-+                              memcpy((char*)buf, canon_data->buf, count);
-+                              canon_data->read_pos = count;
-+                              total += count;
-+
-+                              return total;
-+                      } else {
-+                              memcpy((char*)buf, canon_data->buf, canon_data->write_pos);
-+                              canon_data->read_pos = canon_data->write_pos;
-+                              total += canon_data->write_pos;
-+
-+                              return total;
-+                      }
-+              }
-+
-+      /* Else if write follows read.  This is a simpler case.  We just copy 
-+         either all the data buffered or count, which ever is smaller. */
-+      } else if (canon_data->write_pos > canon_data->read_pos) {
-+              if ((canon_data->write_pos - canon_data->read_pos) > count) {
-+                      memcpy((char*)buf, 
-+                                 &(canon_data->buf[canon_data->read_pos]), 
-+                                 count);
-+                      canon_data->read_pos += count;
-+
-+                      return count;
-+              } else {
-+                      total = canon_data->write_pos - canon_data->read_pos;
-+                      memcpy((char*)buf, 
-+                                 &(canon_data->buf[canon_data->read_pos]), 
-+                                 total);
-+                      canon_data->read_pos += total;
-+
-+                      return total;
-+              }
-+      }
-+
-+      /* Else we need to read more data from the data port. */
-+      return 0;
-+}
-+
-+/* {{{ dio_com_read
-+ * Read chars from the data port.
-+ */
-+static size_t dio_com_read(php_dio_stream_data *data, const char *buf, size_t count) {
-+      php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
-+      DWORD err, total = 0;
-+
-+      if (ReadFile(wdata->handle, (void*)buf, (DWORD)count, &total, NULL)) {
-+
-+              if (total) {
-+                      return (size_t)total;
-+              }
-+
-+              data->end_of_file = 1;
-+      }
-+
-+      if (!data->end_of_file) {
-+              err = GetLastError();
-+
-+              if (ERROR_HANDLE_EOF == err) {
-+                      data->end_of_file = 1;
-+              }
-+      }
-+
-+      return 0;
-+}
-+
-+/* {{{ dio_canonical_read
-+ * Reads chars from the input stream until the internal buffer is full or a new
-+ * line is reached.
-+ */
-+static size_t dio_canonical_read(php_dio_win32_stream_data *wdata, const char *buf, size_t count) {
-+      php_dio_win32_canon_data *canon_data = wdata->canon_data;
-+      size_t total = 0;
-+      char ch;
-+
-+      /* See if there's any buffered data and copy it. */
-+      total = dio_buffer_read(wdata, buf, count);
-+      if (total) {
-+              return total;
-+      }
-+
-+      /* Need to read more data from the data port.  Buffer should be empty(er)
-+         by now. */
-+      do {
-+              /* Is the buffer full? */
-+              if (((canon_data->write_pos + 1) % canon_data->size) == 
-+                      canon_data->read_pos) {
-+                      break;
-+              }
-+
-+              /* Read a byte from the input checking for EOF. */
-+              if (!dio_com_read((php_dio_stream_data*)wdata, &ch, 1)) {
-+                      break;
-+              }
-+
-+              /* Translate CR to newlines (same as ICRNL in POSIX) */
-+              ch = (ch != '\r') ? ch : '\n';
-+
-+              /* We read a character!  So buffer it. */
-+              canon_data->buf[canon_data->write_pos++] = ch;
-+              if (canon_data->write_pos >= canon_data->size) {
-+                      canon_data->write_pos = 0;
-+              }
-+
-+              /* End of line/input (^D)? */
-+      } while ((ch != '\n') && (ch != 0x04));
-+
-+      return dio_buffer_read(wdata, buf, count);
-+}
-+/* }}} */
-+
-+/* {{{ dio_common_read
-+ * Reads count chars to the buffer to the stream described by the stream data.
-+ */
-+size_t dio_common_read(php_dio_stream_data *data, const char *buf, size_t count) {
-+
-+      /* You ask for no bytes you'll get none :-) */
-+      if (!count) {
-+              return 0;
-+      }
-+
-+      if (data->canonical) {
-+              return dio_canonical_read((php_dio_win32_stream_data*)data, buf, count);
-+      } else {
-+              return dio_com_read(data, buf, count);
-+      }
-+}
-+/* }}} */
-+
-+/* {{{ php_dio_stream_data
-+ * Closes the php_stream.
-+ */
-+int dio_common_close(php_dio_stream_data *data) {
-+      php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
-+
-+      if (data->canonical) {
-+              efree(wdata->canon_data);
-+      }
-+
-+      if (!CloseHandle(wdata->handle)) {
-+              return 0;
-+      }
-+
-+      return 1;
-+}
-+/* }}} */
-+
-+/* {{{ dio_common_set_option
-+ * Sets/gets stream options
-+ */
-+int dio_common_set_option(php_dio_stream_data *data, int option, int value, void *ptrparam) {
-+      COMMTIMEOUTS cto = { 0, 0, 0, 0, 0 };
-+      int old_is_blocking = 0;
-+
-+      /* Can't do timeouts or non blocking with raw windows streams :-( */
-+      if (DIO_STREAM_TYPE_SERIAL == data->stream_type) {
-+              switch (option) {
-+                      case PHP_STREAM_OPTION_BLOCKING:
-+                              old_is_blocking   = data->is_blocking;
-+                              data->is_blocking = value ? 1 : 0;
-+
-+                              /* Only change values if we need to change them. */
-+                              if (data->is_blocking != old_is_blocking) {
-+                                      /* If we're not blocking but don't have a timeout
-+                                         set to return immediately */
-+                                      if (!data->is_blocking && !data->has_timeout) {
-+                                              cto.ReadIntervalTimeout = MAXDWORD;
-+                                      }
-+
-+                                      /* If we have a timeout ignore the blocking and set
-+                                         the total time in which to read the data */
-+                                      if (data->has_timeout) {
-+                                              cto.ReadIntervalTimeout = MAXDWORD;
-+                                              cto.ReadTotalTimeoutMultiplier  = MAXDWORD;
-+                                              cto.ReadTotalTimeoutConstant = (data->timeout_usec / 1000) +
-+                                                      (data->timeout_sec * 1000);
-+                                      }
-+
-+                                      if (!SetCommTimeouts(((php_dio_win32_stream_data*)data)->handle, &cto)) {
-+                                              return PHP_STREAM_OPTION_RETURN_ERR;
-+                                      }
-+                              }
-+                              return old_is_blocking ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR;
-+
-+                      case PHP_STREAM_OPTION_READ_TIMEOUT:
-+                              if (ptrparam) {
-+                                      /* struct timeval is supported with PHP_WIN32 defined. */
-+                                      struct timeval *tv = (struct timeval*)ptrparam;
-+
-+                                      /* A timeout of zero seconds and zero microseconds disables
-+                                         any existing timeout. */
-+                                      if (tv->tv_sec || tv->tv_usec) {
-+                                              data->timeout_sec = tv->tv_sec;
-+                                              data->timeout_usec = tv->tv_usec;
-+                                              data->has_timeout = -1;
-+
-+                                              cto.ReadIntervalTimeout = MAXDWORD;
-+                                              cto.ReadTotalTimeoutMultiplier  = MAXDWORD;
-+                                              cto.ReadTotalTimeoutConstant = (data->timeout_usec / 1000) +
-+                                                      (data->timeout_sec * 1000);
-+                                      } else {
-+                                              data->timeout_sec = 0;
-+                                              data->timeout_usec = 0;
-+                                              data->has_timeout = 0;
-+                                              data->timed_out = 0;
-+
-+                                              /* If we're not blocking but don't have a timeout
-+                                                 set to return immediately */
-+                                              if (!data->is_blocking) {
-+                                                      cto.ReadIntervalTimeout = MAXDWORD;
-+                                              }
-+                                      }
-+
-+                                      if (!SetCommTimeouts(((php_dio_win32_stream_data*)data)->handle, &cto)) {
-+                                              return PHP_STREAM_OPTION_RETURN_ERR;
-+                                      } else {
-+                                              return PHP_STREAM_OPTION_RETURN_OK;
-+                                      }
-+                              } else {
-+                                      return PHP_STREAM_OPTION_RETURN_ERR;
-+                              }
-+
-+                      default:
-+                              break;
-+              }
-+      }
-+
-+      return 1;
-+}
-+/* }}} */
-+
-+/* {{{ dio_raw_open_stream
-+ * Opens the underlying stream.
-+ */
-+int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
-+      php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
-+      DWORD err;
-+
-+      switch(*mode) {
-+              case 'r':
-+                      wdata->creation_disposition = OPEN_EXISTING;
-+                      break;
-+              case 'w':
-+                      wdata->creation_disposition = TRUNCATE_EXISTING;
-+                      break;
-+              case 'a':
-+                      wdata->creation_disposition = OPEN_ALWAYS;
-+                      break;
-+              case 'x':
-+                      wdata->creation_disposition = CREATE_NEW;
-+                      break;
-+      }
-+      mode ++;
-+
-+      if (*mode && (*mode != '+')) {
-+              mode++;
-+      }
-+
-+      if (*mode && (*mode == '+')) {
-+              wdata->desired_access = GENERIC_READ | GENERIC_WRITE;
-+      } else if (OPEN_EXISTING == wdata->creation_disposition) {
-+              wdata->desired_access = GENERIC_READ;
-+      } else {
-+              wdata->desired_access = GENERIC_WRITE;
-+      }
-+
-+      wdata->handle = CreateFile(filename, wdata->desired_access, 0,
-+                      NULL, wdata->creation_disposition, FILE_ATTRIBUTE_NORMAL, NULL);
-+      if (INVALID_HANDLE_VALUE == wdata->handle) {
-+              err = GetLastError();
-+              switch (err) {
-+                      case ERROR_FILE_EXISTS:
-+                              php_error_docref(NULL TSRMLS_CC, E_WARNING, "File exists!");
-+                              return 0;
-+
-+                      case ERROR_FILE_NOT_FOUND:
-+                              /* ERROR_FILE_NOT_FOUND with TRUNCATE_EXISTING means that
-+                               * the file doesn't exist so now try to create it. */
-+                              if (TRUNCATE_EXISTING == wdata->creation_disposition) {
-+                                      php_error_docref(NULL TSRMLS_CC, E_NOTICE, "File does not exist, creating new file!");
-+
-+                                      wdata->handle = CreateFile(filename, wdata->desired_access, 0,
-+                                                              NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
-+                                      if (INVALID_HANDLE_VALUE == wdata->handle) {
-+                                              dio_last_error_php_error(E_WARNING, "CreateFile() failed:" TSRMLS_CC);
-+                                              return 0;
-+                                      }
-+                              } else {
-+                                      php_error_docref(NULL TSRMLS_CC, E_WARNING, "File not found!");
-+                                      return 0;
-+                              }
-+                              break;
-+
-+                      default:
-+                              dio_last_error_php_error(E_WARNING, "CreateFile() failed:" TSRMLS_CC);
-+                              return 0;
-+              }
-+      }
-+
-+      /* If canonical allocate the canonical buffer. */
-+      if (data->canonical) {
-+              wdata->canon_data = emalloc(sizeof(php_dio_win32_canon_data));
-+              memset(wdata->canon_data, 0, sizeof(php_dio_win32_canon_data));
-+              wdata->canon_data->size = DIO_WIN32_CANON_BUF_SIZE;
-+      }
-+
-+      return 1;
-+}
-+/* }}} */
-+
-+/* {{{ dio_serial_init
-+ * Initialises the serial port
-+ */
-+static int dio_serial_init(php_dio_stream_data *data TSRMLS_DC) {
-+      php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
-+      DWORD rate_def, data_bits_def, stop_bits_def, parity_def;
-+      DCB dcb;
-+
-+      if (!dio_data_rate_to_define(data->data_rate, &rate_def)) {
-+              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_rate value (%d)", data->data_rate);
-+              return 0;
-+      }
-+
-+      if (!dio_data_bits_to_define(data->data_bits, &data_bits_def)) {
-+              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_bits value (%d)", data->data_bits);
-+              return 0;
-+      }
-+
-+      if (!dio_stop_bits_to_define(data->stop_bits, &stop_bits_def)) {
-+              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid stop_bits value (%d)", data->stop_bits);
-+              return 0;
-+      }
-+
-+      if (!dio_parity_to_define(data->parity, &parity_def)) {
-+              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid parity value (%d)", data->parity);
-+              return 0;
-+      }
-+
-+      if (!GetCommState(wdata->handle, &(wdata->olddcb))) {
-+              dio_last_error_php_error(E_WARNING, "GetCommState() failed:" TSRMLS_CC);
-+              return 0;
-+      }
-+
-+      /* Init the DCB structure */
-+      memset(&dcb, 0, sizeof(DCB));
-+      dcb.DCBlength = sizeof(DCB);
-+
-+      /* Set the communication parameters */
-+      dcb.fBinary  = 1;
-+      dcb.BaudRate = rate_def;
-+      dcb.ByteSize = (BYTE)data_bits_def;
-+      dcb.StopBits = (BYTE)stop_bits_def;
-+      dcb.Parity   = (BYTE)parity_def;
-+
-+      /* Set the control line parameters */
-+      dcb.fDtrControl       = DTR_CONTROL_DISABLE;
-+      dcb.fDsrSensitivity   = FALSE;
-+      dcb.fOutxDsrFlow      = FALSE;
-+      dcb.fTXContinueOnXoff = FALSE;
-+      dcb.fOutX             = FALSE;
-+      dcb.fInX              = FALSE;
-+      dcb.fErrorChar        = FALSE;
-+      dcb.fNull             = FALSE;
-+      dcb.fAbortOnError     = FALSE;
-+
-+      /* Hardware flow control */
-+      if (data->flow_control) {
-+              dcb.fOutxCtsFlow = TRUE;
-+              dcb.fRtsControl  = RTS_CONTROL_HANDSHAKE;
-+      } else {
-+              dcb.fOutxCtsFlow = FALSE;
-+              dcb.fRtsControl  = RTS_CONTROL_DISABLE;
-+      }
-+
-+      if (!SetCommState(wdata->handle, &dcb)) {
-+              dio_last_error_php_error(E_WARNING, "SetCommState() failed:" TSRMLS_CC);
-+              return 0;
-+      }
-+
-+      return 1;
-+}
-+/* }}} */
-+
-+
-+/* {{{ dio_serial_uninit
-+ * Restores the serial settings back to their original state.
-+ */
-+int dio_serial_uninit(php_dio_stream_data *data) {
-+      php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
-+
-+      if (!SetCommState(wdata->handle, &(wdata->olddcb))) {
-+              return 0;
-+      }
-+
-+      return 1;
-+}
-+/* }}} */
-+
-+/* {{{ dio_serial_flush
-+ * Purges the serial buffers of data.
-+ */
-+int dio_serial_purge(php_dio_stream_data *data) {
-+      php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
-+      BOOL ret;
-+
-+      /* Purge the canonical buffer if required */
-+      if (data->canonical && ((wdata->desired_access & GENERIC_READ) == GENERIC_READ)) {
-+              wdata->canon_data->read_pos  = 0;
-+              wdata->canon_data->write_pos = 0;
-+      }
-+
-+      /* Purge the com port */
-+      if ((wdata->desired_access & (GENERIC_READ|GENERIC_WRITE)) == (GENERIC_READ|GENERIC_WRITE)) {
-+              ret = PurgeComm(wdata->handle, PURGE_RXCLEAR|PURGE_TXCLEAR);
-+      } else if ((wdata->desired_access & GENERIC_WRITE) == GENERIC_WRITE) {
-+              ret = PurgeComm(wdata->handle, PURGE_TXCLEAR);
-+      } else if ((wdata->desired_access & GENERIC_READ) == GENERIC_READ) {
-+              ret = PurgeComm(wdata->handle, PURGE_RXCLEAR);
-+      }
-+
-+      return ret;
-+}
-+/* }}} */
-+
-+/* {{{ dio_serial_open_stream
-+ * Opens the underlying stream.
-+ */
-+int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
-+      php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
-+      COMMTIMEOUTS cto = { 0, 0, 0, 0, 0 };
-+
-+      php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Opening \"%s\" as a serial port (mode=\"%s\").", filename, mode);
-+
-+      if (*mode != 'r') {
-+              php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must open serial ports in read or read/write mode!");
-+              return 0;
-+      }
-+
-+      if (!dio_raw_open_stream(filename, mode, data TSRMLS_CC)) {
-+              return 0;
-+      }
-+
-+      if (!GetCommTimeouts(wdata->handle, &(wdata->oldcto))) {
-+              dio_last_error_php_error(E_WARNING, "GetCommTimeouts() failed (Not a comm port?):" TSRMLS_CC);
-+              CloseHandle(wdata->handle);
-+              return 0;
-+      }
-+
-+      /* If we're not blocking but don't have a timeout
-+         set to return immediately */
-+      if (!data->is_blocking && !data->has_timeout) {
-+              cto.ReadIntervalTimeout = MAXDWORD;
-+      }
-+      
-+      /* If we have a timeout ignore the blocking and set
-+         the total time in which to read the data */
-+      if (data->has_timeout) {
-+              cto.ReadIntervalTimeout = MAXDWORD;
-+              cto.ReadTotalTimeoutMultiplier  = MAXDWORD;
-+              cto.ReadTotalTimeoutConstant = (data->timeout_usec / 1000) + 
-+                      (data->timeout_sec * 1000);
-+      }
-+
-+      if (!SetCommTimeouts(wdata->handle, &cto)) {
-+              dio_last_error_php_error(E_WARNING, "SetCommTimeouts() failed:" TSRMLS_CC);
-+              CloseHandle(wdata->handle);
-+              return 0;
-+      }
-+
-+      if (!dio_serial_init(data TSRMLS_CC)) {
-+              CloseHandle(wdata->handle);
-+              return 0;
-+      }
-+
-+      return 1;
-+}
-+/* }}} */
-+
-+/*
-+ * Local variables:
-+ * c-basic-offset: 4
-+ * tab-width: 4
-+ * End:
-+ * vim600: fdm=marker
-+ * vim: sw=4 ts=4 noet
-+ */
---- a/php_dio_posix.h
-+++ b/php_dio_posix.h
-@@ -1,70 +1,70 @@
--/*\r
--   +----------------------------------------------------------------------+\r
--   | PHP Version 5                                                        |\r
--   +----------------------------------------------------------------------+\r
--   | Copyright (c) 2009 Melanie Rhianna Lewis                             |\r
--   +----------------------------------------------------------------------+\r
--   | This source file is subject to version 3.0 of the PHP license,       |\r
--   | that is bundled with this package in the file LICENSE, and is        |\r
--   | available through the world-wide-web at the following url:           |\r
--   | http://www.php.net/license/3_0.txt.                                  |\r
--   | If you did not receive a copy of the PHP license and are unable to   |\r
--   | obtain it through the world-wide-web, please send a note to          |\r
--   | license@php.net so we can mail you a copy immediately.               |\r
--   +----------------------------------------------------------------------+\r
--   | Author: Melanie Rhianna Lewis <cyberspice@php.net>                   |\r
--   +----------------------------------------------------------------------+\r
-- */\r
--\r
--#ifndef PHP_DIO_POSIX_H_\r
--#define PHP_DIO_POSIX_H_\r
--\r
--#include <sys/stat.h>\r
--#include <sys/types.h>\r
--#include <sys/select.h>\r
--#include <sys/time.h>\r
--\r
--#ifdef HAVE_UNISTD_H\r
--#include <unistd.h>\r
--#endif\r
--\r
--#include <fcntl.h>\r
--#include <termios.h>\r
--\r
--\r
--/**\r
-+/*
-+   +----------------------------------------------------------------------+
-+   | PHP Version 5                                                        |
-+   +----------------------------------------------------------------------+
-+   | Copyright (c) 2009 Melanie Rhianna Lewis                             |
-+   +----------------------------------------------------------------------+
-+   | This source file is subject to version 3.0 of the PHP license,       |
-+   | that is bundled with this package in the file LICENSE, and is        |
-+   | available through the world-wide-web at the following url:           |
-+   | http://www.php.net/license/3_0.txt.                                  |
-+   | If you did not receive a copy of the PHP license and are unable to   |
-+   | obtain it through the world-wide-web, please send a note to          |
-+   | license@php.net so we can mail you a copy immediately.               |
-+   +----------------------------------------------------------------------+
-+   | Author: Melanie Rhianna Lewis <cyberspice@php.net>                   |
-+   +----------------------------------------------------------------------+
-+ */
-+
-+#ifndef PHP_DIO_POSIX_H_
-+#define PHP_DIO_POSIX_H_
-+
-+#include <sys/stat.h>
-+#include <sys/types.h>
-+#include <sys/select.h>
-+#include <sys/time.h>
-+
-+#ifdef HAVE_UNISTD_H
-+#include <unistd.h>
-+#endif
-+
-+#include <fcntl.h>
-+#include <termios.h>
-+
-+
-+/**
-  * Detect if we can support non blocking IO.
-- */\r
--#ifdef O_NONBLOCK\r
--#define DIO_NONBLOCK O_NONBLOCK\r
--#else\r
--#ifdef O_NDELAY\r
--#define DIO_NONBLOCK O_NDELAY\r
--#endif\r
--#endif\r
--\r
--/**\r
-+ */
-+#ifdef O_NONBLOCK
-+#define DIO_NONBLOCK O_NONBLOCK
-+#else
-+#ifdef O_NDELAY
-+#define DIO_NONBLOCK O_NDELAY
-+#endif
-+#endif
-+
-+/**
-  * POSIXy platforms have file permissions
-- */\r
--#define DIO_HAS_FILEPERMS\r
--\r
--#include "php_dio_common_data.h"\r
--\r
--typedef struct _php_dio_posix_stream_data {\r
--      php_dio_stream_data common;\r
--      int fd;\r
--      int flags;\r
--      /* Serial options */\r
--      struct termios oldtio;\r
--} php_dio_posix_stream_data ;\r
--\r
--#endif /* PHP_DIO_POSIX_H_ */\r
--\r
--/*\r
-- * Local variables:\r
-- * c-basic-offset: 4\r
-- * tab-width: 4\r
-- * End:\r
-- * vim600: fdm=marker\r
-- * vim: sw=4 ts=4 noet\r
-- */\r
-+ */
-+#define DIO_HAS_FILEPERMS
-+
-+#include "php_dio_common_data.h"
-+
-+typedef struct _php_dio_posix_stream_data {
-+      php_dio_stream_data common;
-+      int fd;
-+      int flags;
-+      /* Serial options */
-+      struct termios oldtio;
-+} php_dio_posix_stream_data ;
-+
-+#endif /* PHP_DIO_POSIX_H_ */
-+
-+/*
-+ * Local variables:
-+ * c-basic-offset: 4
-+ * tab-width: 4
-+ * End:
-+ * vim600: fdm=marker
-+ * vim: sw=4 ts=4 noet
-+ */
---- a/php_dio_win32.h
-+++ b/php_dio_win32.h
-@@ -1,62 +1,62 @@
--/*\r
--   +----------------------------------------------------------------------+\r
--   | PHP Version 5                                                        |\r
--   +----------------------------------------------------------------------+\r
--   | Copyright (c) 2009 Melanie Rhianna Lewis                             |\r
--   +----------------------------------------------------------------------+\r
--   | This source file is subject to version 3.0 of the PHP license,       |\r
--   | that is bundled with this package in the file LICENSE, and is        |\r
--   | available through the world-wide-web at the following url:           |\r
--   | http://www.php.net/license/3_0.txt.                                  |\r
--   | If you did not receive a copy of the PHP license and are unable to   |\r
--   | obtain it through the world-wide-web, please send a note to          |\r
--   | license@php.net so we can mail you a copy immediately.               |\r
--   +----------------------------------------------------------------------+\r
--   | Author: Melanie Rhianna Lewis <cyberspice@php.net>                   |\r
--   +----------------------------------------------------------------------+\r
-- */\r
--\r
--#ifndef PHP_DIO_WIN32_H_\r
--#define PHP_DIO_WIN32_H_\r
--\r
--#include <windows.h>\r
--\r
--/* Windows platform can do non blocking. */\r
--#define DIO_NONBLOCK\r
--\r
--#include "php_dio_common_data.h"\r
--\r
--#define DIO_WIN32_CANON_BUF_SIZE 8192\r
--\r
--/* This is the buffer information when reading in canonical mode.  Data is \r
--   read right up to either buffer being full or a newline being read.  Excess\r
--   data will be retained in the buffer until the next read. */\r
--typedef struct _php_dio_win32_canon_data {\r
--      size_t size;\r
--      size_t read_pos;\r
--      size_t write_pos;\r
--      char buf[DIO_WIN32_CANON_BUF_SIZE];\r
--\r
--} php_dio_win32_canon_data;\r
--\r
--typedef struct _php_dio_win32_stream_data {\r
--      php_dio_stream_data common;\r
--      HANDLE handle;\r
--      DWORD desired_access;\r
--      DWORD creation_disposition;\r
--      DCB olddcb;\r
--      COMMTIMEOUTS oldcto;\r
--      php_dio_win32_canon_data *canon_data;\r
--\r
--} php_dio_win32_stream_data ;\r
--\r
--#endif /* PHP_DIO_WIN32_H_ */\r
--\r
--/*\r
-- * Local variables:\r
-- * c-basic-offset: 4\r
-- * tab-width: 4\r
-- * End:\r
-- * vim600: fdm=marker\r
-- * vim: sw=4 ts=4 noet\r
-- */\r
-+/*
-+   +----------------------------------------------------------------------+
-+   | PHP Version 5                                                        |
-+   +----------------------------------------------------------------------+
-+   | Copyright (c) 2009 Melanie Rhianna Lewis                             |
-+   +----------------------------------------------------------------------+
-+   | This source file is subject to version 3.0 of the PHP license,       |
-+   | that is bundled with this package in the file LICENSE, and is        |
-+   | available through the world-wide-web at the following url:           |
-+   | http://www.php.net/license/3_0.txt.                                  |
-+   | If you did not receive a copy of the PHP license and are unable to   |
-+   | obtain it through the world-wide-web, please send a note to          |
-+   | license@php.net so we can mail you a copy immediately.               |
-+   +----------------------------------------------------------------------+
-+   | Author: Melanie Rhianna Lewis <cyberspice@php.net>                   |
-+   +----------------------------------------------------------------------+
-+ */
-+
-+#ifndef PHP_DIO_WIN32_H_
-+#define PHP_DIO_WIN32_H_
-+
-+#include <windows.h>
-+
-+/* Windows platform can do non blocking. */
-+#define DIO_NONBLOCK
-+
-+#include "php_dio_common_data.h"
-+
-+#define DIO_WIN32_CANON_BUF_SIZE 8192
-+
-+/* This is the buffer information when reading in canonical mode.  Data is 
-+   read right up to either buffer being full or a newline being read.  Excess
-+   data will be retained in the buffer until the next read. */
-+typedef struct _php_dio_win32_canon_data {
-+      size_t size;
-+      size_t read_pos;
-+      size_t write_pos;
-+      char buf[DIO_WIN32_CANON_BUF_SIZE];
-+
-+} php_dio_win32_canon_data;
-+
-+typedef struct _php_dio_win32_stream_data {
-+      php_dio_stream_data common;
-+      HANDLE handle;
-+      DWORD desired_access;
-+      DWORD creation_disposition;
-+      DCB olddcb;
-+      COMMTIMEOUTS oldcto;
-+      php_dio_win32_canon_data *canon_data;
-+
-+} php_dio_win32_stream_data ;
-+
-+#endif /* PHP_DIO_WIN32_H_ */
-+
-+/*
-+ * Local variables:
-+ * c-basic-offset: 4
-+ * tab-width: 4
-+ * End:
-+ * vim600: fdm=marker
-+ * vim: sw=4 ts=4 noet
-+ */
diff --git a/lang/php7-pecl-dio/patches/0001-fix-svn-prop.patch b/lang/php7-pecl-dio/patches/0001-fix-svn-prop.patch
deleted file mode 100644 (file)
index e8a56fb..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-From 46d3a1ff2c6e316cf0928a9fd403cb5284bfe863 Mon Sep 17 00:00:00 2001
-From: remi <remi@c90b9560-bf6c-de11-be94-00142212c4b1>
-Date: Wed, 9 Oct 2013 12:04:16 +0000
-Subject: [PATCH 01/16] fix svn prop
-
-git-svn-id: http://svn.php.net/repository/pecl/dio/trunk@331748 c90b9560-bf6c-de11-be94-00142212c4b1
----
- dio_posix.c     | 0
- dio_win32.c     | 0
- php_dio_posix.h | 0
- php_dio_win32.h | 0
- 4 files changed, 0 insertions(+), 0 deletions(-)
- mode change 100755 => 100644 dio_posix.c
- mode change 100755 => 100644 dio_win32.c
- mode change 100755 => 100644 php_dio_posix.h
- mode change 100755 => 100644 php_dio_win32.h
-
-diff --git a/dio_posix.c b/dio_posix.c
-old mode 100755
-new mode 100644
-diff --git a/dio_win32.c b/dio_win32.c
-old mode 100755
-new mode 100644
-diff --git a/php_dio_posix.h b/php_dio_posix.h
-old mode 100755
-new mode 100644
-diff --git a/php_dio_win32.h b/php_dio_win32.h
-old mode 100755
-new mode 100644
--- 
-2.5.0
-
diff --git a/lang/php7-pecl-dio/patches/0002-fix-Wunused-variable.patch b/lang/php7-pecl-dio/patches/0002-fix-Wunused-variable.patch
deleted file mode 100644 (file)
index 6624174..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-From e9261081d447492e7eff3a22601b1de4f1ae550f Mon Sep 17 00:00:00 2001
-From: remi <remi@c90b9560-bf6c-de11-be94-00142212c4b1>
-Date: Wed, 9 Oct 2013 12:15:51 +0000
-Subject: [PATCH 02/16] fix [-Wunused-variable]
-
-git-svn-id: http://svn.php.net/repository/pecl/dio/trunk@331749 c90b9560-bf6c-de11-be94-00142212c4b1
----
- dio.c       | 2 +-
- dio_posix.c | 1 -
- 2 files changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/dio.c b/dio.c
-index e400cf0..408a171 100644
---- a/dio.c
-+++ b/dio.c
-@@ -775,7 +775,7 @@ ZEND_BEGIN_ARG_INFO_EX(dio_serial_args, 0, 0, 2)
-       ZEND_ARG_INFO(0, options)
- ZEND_END_ARG_INFO()
--static zend_object_handlers dio_raw_object_handlers;
-+// not used static zend_object_handlers dio_raw_object_handlers;
- static zend_function_entry dio_functions[] = {
-       /* Class functions. */
-diff --git a/dio_posix.c b/dio_posix.c
-index 16fb3d6..01e1109 100644
---- a/dio_posix.c
-+++ b/dio_posix.c
-@@ -266,7 +266,6 @@ size_t dio_common_write(php_dio_stream_data *data, const char *buf, size_t count
-  * earlier than early time.
-  */
- static int dio_timeval_subtract(struct timeval *late, struct timeval *early, struct timeval *diff) {
--      struct timeval *tmp;
-       /* Handle negatives */
-       if (late->tv_sec < early->tv_sec) {
--- 
-2.5.0
-
diff --git a/lang/php7-pecl-dio/patches/0003-Fix-Wmaybe-uninitialized.patch b/lang/php7-pecl-dio/patches/0003-Fix-Wmaybe-uninitialized.patch
deleted file mode 100644 (file)
index 21f4cff..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-From 6cbc1651b6b6f865f9aae1e9adff73743298666f Mon Sep 17 00:00:00 2001
-From: remi <remi@c90b9560-bf6c-de11-be94-00142212c4b1>
-Date: Wed, 9 Oct 2013 12:18:34 +0000
-Subject: [PATCH 03/16] Fix [-Wmaybe-uninitialized]
-
-git-svn-id: http://svn.php.net/repository/pecl/dio/trunk@331750 c90b9560-bf6c-de11-be94-00142212c4b1
----
- dio_stream_wrappers.c | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
-
-diff --git a/dio_stream_wrappers.c b/dio_stream_wrappers.c
-index 844b006..811bc07 100644
---- a/dio_stream_wrappers.c
-+++ b/dio_stream_wrappers.c
-@@ -228,9 +228,8 @@ PHP_FUNCTION(dio_raw) {
-                       efree(data);
-                       RETURN_FALSE;
-               }
-+              php_stream_to_zval(stream, return_value);
-       }
--
--      php_stream_to_zval(stream, return_value);
- }
- /* }}} */
-@@ -390,9 +389,8 @@ PHP_FUNCTION(dio_serial) {
-                       efree(data);
-                       RETURN_FALSE;
-               }
-+              php_stream_to_zval(stream, return_value);
-       }
--
--      php_stream_to_zval(stream, return_value);
- }
- /* }}} */
--- 
-2.5.0
-
diff --git a/lang/php7-pecl-dio/patches/0004-Fix-last-build-warning-Wunused-but-set-variable-sorr.patch b/lang/php7-pecl-dio/patches/0004-Fix-last-build-warning-Wunused-but-set-variable-sorr.patch
deleted file mode 100644 (file)
index ba69d22..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-From 1e6f98d9fb65b9c052e6d555eab573d7e5073dae Mon Sep 17 00:00:00 2001
-From: remi <remi@c90b9560-bf6c-de11-be94-00142212c4b1>
-Date: Wed, 9 Oct 2013 12:24:28 +0000
-Subject: [PATCH 04/16] Fix last build warning [-Wunused-but-set-variable]
- (sorry for legibility...)
-
-git-svn-id: http://svn.php.net/repository/pecl/dio/trunk@331751 c90b9560-bf6c-de11-be94-00142212c4b1
----
- dio_posix.c | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/dio_posix.c b/dio_posix.c
-index 01e1109..6ed8630 100644
---- a/dio_posix.c
-+++ b/dio_posix.c
-@@ -28,7 +28,10 @@
-  * Convert an fopen() mode string to open() flags
-  */
- static int dio_stream_mode_to_flags(const char *mode) {
--      int  flags = 0, ch = 0, bin = 1;
-+      int  flags = 0, ch = 0;
-+#if defined(_O_TEXT) && defined(O_BINARY)
-+      int  bin = 1;
-+#endif
-       switch(mode[ch++]) {
-               case 'r':
-@@ -45,9 +48,11 @@ static int dio_stream_mode_to_flags(const char *mode) {
-                       break;
-       }
-+#if defined(_O_TEXT) && defined(O_BINARY)
-       if (mode[ch] != '+') {
-               bin = (mode[ch++] == 'b');
-       }
-+#endif
-       if (mode[ch] == '+') {
-               flags |= O_RDWR;
--- 
-2.5.0
-
diff --git a/lang/php7-pecl-dio/patches/0005-Added-LICENCE-file-as-requested-in-Request-65869.patch b/lang/php7-pecl-dio/patches/0005-Added-LICENCE-file-as-requested-in-Request-65869.patch
deleted file mode 100644 (file)
index fc9961a..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-From 7c85a44880d9d748e7554f8fe7448505fa86aa28 Mon Sep 17 00:00:00 2001
-From: cyberspice <cyberspice@c90b9560-bf6c-de11-be94-00142212c4b1>
-Date: Sat, 12 Oct 2013 22:20:19 +0000
-Subject: [PATCH 05/16] Added LICENCE file as requested in Request #65869
-
-Files added:
-   LICENCE
-
-git-svn-id: http://svn.php.net/repository/pecl/dio/trunk@331788 c90b9560-bf6c-de11-be94-00142212c4b1
----
- LICENSE | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 68 insertions(+)
- create mode 100644 LICENSE
-
-diff --git a/LICENSE b/LICENSE
-new file mode 100644
-index 0000000..d376afe
---- /dev/null
-+++ b/LICENSE
-@@ -0,0 +1,68 @@
-+-------------------------------------------------------------------- 
-+                  The PHP License, version 3.01
-+Copyright (c) 2008 - 2013 The PHP Group. All rights reserved.
-+-------------------------------------------------------------------- 
-+
-+Redistribution and use in source and binary forms, with or without
-+modification, is 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 "PHP" must not be used to endorse or promote products
-+     derived from this software without prior written permission. For
-+     written permission, please contact group@php.net.
-+  
-+  4. Products derived from this software may not be called "PHP", nor
-+     may "PHP" appear in their name, without prior written permission
-+     from group@php.net.  You may indicate that your software works in
-+     conjunction with PHP by saying "Foo for PHP" instead of calling
-+     it "PHP Foo" or "phpfoo"
-+ 
-+  5. The PHP Group may publish revised and/or new versions of the
-+     license from time to time. Each version will be given a
-+     distinguishing version number.
-+     Once covered code has been published under a particular version
-+     of the license, you may always continue to use it under the terms
-+     of that version. You may also choose to use such covered code
-+     under the terms of any subsequent version of the license
-+     published by the PHP Group. No one other than the PHP Group has
-+     the right to modify the terms applicable to covered code created
-+     under this License.
-+
-+  6. Redistributions of any form whatsoever must retain the following
-+     acknowledgment:
-+     "This product includes PHP software, freely available from
-+     <http://www.php.net/software/>".
-+
-+THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND 
-+ANY EXPRESSED 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 PHP
-+DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
-+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
-+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
-+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-+OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+-------------------------------------------------------------------- 
-+
-+This software consists of voluntary contributions made by many
-+individuals on behalf of the PHP Group.
-+
-+The PHP Group can be contacted via Email at group@php.net.
-+
-+For more information on the PHP Group and the PHP project, 
-+please see <http://www.php.net>.
-+
-+PHP includes the Zend Engine, freely available at
-+<http://www.zend.com>.
--- 
-2.5.0
-
diff --git a/lang/php7-pecl-dio/patches/0006-Replace-ZEND_FETCH_RESOURCE-macro-with-zend_fetch_re.patch b/lang/php7-pecl-dio/patches/0006-Replace-ZEND_FETCH_RESOURCE-macro-with-zend_fetch_re.patch
deleted file mode 100644 (file)
index 6d9c483..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-From b69e1067f70ef293587b72979193e68b01d90902 Mon Sep 17 00:00:00 2001
-From: Michael Heimpold <mhei@heimpold.de>
-Date: Wed, 13 Jul 2016 00:23:29 +0200
-Subject: [PATCH 06/16] Replace ZEND_FETCH_RESOURCE macro with
- zend_fetch_resource
-
-Signed-off-by: Michael Heimpold <mhei@heimpold.de>
----
- dio.c | 36 +++++++++++++++++++++++++++---------
- 1 file changed, 27 insertions(+), 9 deletions(-)
-
-diff --git a/dio.c b/dio.c
-index 408a171..6b687ac 100644
---- a/dio.c
-+++ b/dio.c
-@@ -161,7 +161,9 @@ PHP_FUNCTION(dio_dup)
-               return;
-       }
--      ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
-+      if ((f = (php_fd_t *)zend_fetch_resource(Z_RES_P(r_fd), le_fd_name, le_fd)) == NULL) {
-+              RETURN_FALSE;
-+      }
-       dfd = dup(f->fd);
-       if (dfd == -1) {
-@@ -192,7 +194,9 @@ PHP_FUNCTION(dio_read)
-               return;
-       }
--      ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
-+      if ((f = (php_fd_t *)zend_fetch_resource(Z_RES_P(r_fd), le_fd_name, le_fd)) == NULL) {
-+              RETURN_FALSE;
-+      }
-       if (bytes <= 0) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0.");
-@@ -233,7 +237,9 @@ PHP_FUNCTION(dio_write)
-               RETURN_FALSE;
-       }
--      ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
-+      if ((f = (php_fd_t *)zend_fetch_resource(Z_RES_P(r_fd), le_fd_name, le_fd)) == NULL) {
-+              RETURN_FALSE;
-+      }
-       res = write(f->fd, data, trunc_len ? trunc_len : data_len);
-       if (res == -1) {
-@@ -258,7 +264,9 @@ PHP_FUNCTION(dio_truncate)
-               return;
-       }
--      ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
-+      if ((f = (php_fd_t *)zend_fetch_resource(Z_RES_P(r_fd), le_fd_name, le_fd)) == NULL) {
-+              RETURN_FALSE;
-+      }
-       if (ftruncate(f->fd, offset) == -1) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "couldn't truncate %d to %ld bytes: %s", f->fd, offset, strerror(errno));
-@@ -284,7 +292,9 @@ PHP_FUNCTION(dio_stat)
-               return;
-       }
--      ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
-+      if ((f = (php_fd_t *)zend_fetch_resource(Z_RES_P(r_fd), le_fd_name, le_fd)) == NULL) {
-+              RETURN_FALSE;
-+      }
-       if (fstat(f->fd, &s) == -1) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot stat %d: %s", f->fd, strerror(errno));
-@@ -323,7 +333,9 @@ PHP_FUNCTION(dio_seek)
-               return;
-       }
--      ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
-+      if ((f = (php_fd_t *)zend_fetch_resource(Z_RES_P(r_fd), le_fd_name, le_fd)) == NULL) {
-+              RETURN_FALSE;
-+      }
-       RETURN_LONG(lseek(f->fd, offset, whence));
- }
-@@ -344,7 +356,9 @@ PHP_FUNCTION(dio_fcntl)
-               return;
-       }
--      ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
-+      if ((f = (php_fd_t *)zend_fetch_resource(Z_RES_P(r_fd), le_fd_name, le_fd)) == NULL) {
-+              RETURN_FALSE;
-+      }
-       switch (cmd) {
-               case F_SETLK:
-@@ -454,7 +468,9 @@ PHP_FUNCTION(dio_tcsetattr)
-               return;
-       }
--      ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
-+      if ((f = (php_fd_t *)zend_fetch_resource(Z_RES_P(r_fd), le_fd_name, le_fd)) == NULL) {
-+              RETURN_FALSE;
-+      }
-       if (Z_TYPE_P(arg) != IS_ARRAY) {
-               php_error_docref(NULL TSRMLS_CC, E_WARNING,"tcsetattr, third argument should be an associative array");
-@@ -639,7 +655,9 @@ PHP_FUNCTION(dio_close)
-               return;
-       }
--      ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
-+      if ((f = (php_fd_t *)zend_fetch_resource(Z_RES_P(r_fd), le_fd_name, le_fd)) == NULL) {
-+              RETURN_FALSE;
-+      }
-       zend_list_delete(Z_LVAL_P(r_fd));
- }
--- 
-2.5.0
-
diff --git a/lang/php7-pecl-dio/patches/0007-Replace-ZEND_REGISTER_RESOURCE-with-zend_register_re.patch b/lang/php7-pecl-dio/patches/0007-Replace-ZEND_REGISTER_RESOURCE-with-zend_register_re.patch
deleted file mode 100644 (file)
index c676a25..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-From dbf03eb09bf1a41bcd140c4edba351121ac24729 Mon Sep 17 00:00:00 2001
-From: Michael Heimpold <mhei@heimpold.de>
-Date: Wed, 13 Jul 2016 00:36:46 +0200
-Subject: [PATCH 07/16] Replace ZEND_REGISTER_RESOURCE with
- zend_register_resource
-
-Signed-off-by: Michael Heimpold <mhei@heimpold.de>
----
- dio.c | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/dio.c b/dio.c
-index 6b687ac..6f2d58c 100644
---- a/dio.c
-+++ b/dio.c
-@@ -72,9 +72,9 @@ static int new_php_fd(php_fd_t **f, int fd)
-       return 1;
- }
--static void _dio_close_fd(zend_rsrc_list_entry *rsrc TSRMLS_DC)
-+static void _dio_close_fd(zend_resource *res)
- {
--      php_fd_t *f = (php_fd_t *) rsrc->ptr;
-+      php_fd_t *f = (php_fd_t *)zend_fetch_resource(res, NULL, le_fd);
-       if (f) {
-               close(f->fd);
-               free(f);
-@@ -115,7 +115,7 @@ PHP_FUNCTION(dio_open)
-               RETURN_FALSE;
-       }
--      ZEND_REGISTER_RESOURCE(return_value, f, le_fd);
-+      RETVAL_RES(zend_register_resource(f, le_fd));
- }
- /* }}} */
-@@ -144,7 +144,7 @@ PHP_FUNCTION(dio_fdopen)
-               RETURN_FALSE;
-       }
--      ZEND_REGISTER_RESOURCE(return_value, f, le_fd);
-+      RETVAL_RES(zend_register_resource(f, le_fd));
- }
- /* }}} */
-@@ -175,7 +175,7 @@ PHP_FUNCTION(dio_dup)
-               RETURN_FALSE;
-       }
--      ZEND_REGISTER_RESOURCE(return_value, df, le_fd);
-+      RETVAL_RES(zend_register_resource(f, le_fd));
- }
- /* }}} */
- #endif
-@@ -434,7 +434,7 @@ PHP_FUNCTION(dio_fcntl)
-                       if (!new_php_fd(&new_f, fcntl(f->fd, cmd, Z_LVAL_P(arg)))) {
-                               RETURN_FALSE;
-                       }
--                      ZEND_REGISTER_RESOURCE(return_value, new_f, le_fd);
-+                      RETVAL_RES(zend_register_resource(new_f, le_fd));
-                       break;
-               }
-               default:
--- 
-2.5.0
-
diff --git a/lang/php7-pecl-dio/patches/0008-RETURN_STRINGL-takes-only-2-arguments.patch b/lang/php7-pecl-dio/patches/0008-RETURN_STRINGL-takes-only-2-arguments.patch
deleted file mode 100644 (file)
index 2197d12..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-From 47422cf01f0a352c3f5f015585a28c99dba79862 Mon Sep 17 00:00:00 2001
-From: Michael Heimpold <mhei@heimpold.de>
-Date: Wed, 13 Jul 2016 00:40:08 +0200
-Subject: [PATCH 08/16] RETURN_STRINGL takes only 2 arguments
-
-Signed-off-by: Michael Heimpold <mhei@heimpold.de>
----
- dio.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/dio.c b/dio.c
-index 6f2d58c..e8660f8 100644
---- a/dio.c
-+++ b/dio.c
-@@ -24,6 +24,7 @@
- #include "php.h"
- #include "php_ini.h"
- #include "ext/standard/info.h"
-+#include "ext/standard/php_string.h"
- #include "php_dio.h"
- #include "php_dio_stream_wrappers.h"
-@@ -213,7 +214,7 @@ PHP_FUNCTION(dio_read)
-       data = erealloc(data, res + 1);
-       data[res] = 0;
--      RETURN_STRINGL(data, res, 0);
-+      RETURN_STRINGL(data, res);
- }
- /* }}} */
--- 
-2.5.0
-
diff --git a/lang/php7-pecl-dio/patches/0009-Replace-zend_hash_find-with-zend_hash_str_find.patch b/lang/php7-pecl-dio/patches/0009-Replace-zend_hash_find-with-zend_hash_str_find.patch
deleted file mode 100644 (file)
index 85a8a07..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-From 7533f64b19006262fae7c6a4769392c67078166b Mon Sep 17 00:00:00 2001
-From: Michael Heimpold <mhei@heimpold.de>
-Date: Wed, 13 Jul 2016 01:07:22 +0200
-Subject: [PATCH 09/16] Replace zend_hash_find with zend_hash_str_find
-
-Signed-off-by: Michael Heimpold <mhei@heimpold.de>
----
- dio.c | 44 ++++++++++++++++++++++----------------------
- 1 file changed, 22 insertions(+), 22 deletions(-)
-
-diff --git a/dio.c b/dio.c
-index e8660f8..b489747 100644
---- a/dio.c
-+++ b/dio.c
-@@ -364,7 +364,7 @@ PHP_FUNCTION(dio_fcntl)
-       switch (cmd) {
-               case F_SETLK:
-               case F_SETLKW: {
--                      zval          **element;
-+                      zval           *element;
-                       struct flock    lk = {0};
-                       HashTable      *fh;
-@@ -374,28 +374,28 @@ PHP_FUNCTION(dio_fcntl)
-                       }
-                       if (Z_TYPE_P(arg) == IS_ARRAY) {
-                               fh = HASH_OF(arg);
--                              if (zend_hash_find(fh, "start", sizeof("start"), (void **) &element) == FAILURE) {
-+                              if ((element = zend_hash_str_find(fh, "start", sizeof("start"))) == NULL) {
-                                       lk.l_start = 0;
-                               } else {
--                                      lk.l_start = Z_LVAL_PP(element);
-+                                      lk.l_start = Z_LVAL_P(element);
-                               }
--                              if (zend_hash_find(fh, "length", sizeof("length"), (void **) &element) == FAILURE) {
-+                              if ((element = zend_hash_str_find(fh, "length", sizeof("length"))) == NULL) {
-                                       lk.l_len = 0;
-                               } else {
--                                      lk.l_len = Z_LVAL_PP(element);
-+                                      lk.l_len = Z_LVAL_P(element);
-                               }
--                              if (zend_hash_find(fh, "whence", sizeof("whence"), (void **) &element) == FAILURE) {
-+                              if ((element = zend_hash_str_find(fh, "whence", sizeof("whence"))) == NULL) {
-                                       lk.l_whence = 0;
-                               } else {
--                                      lk.l_whence = Z_LVAL_PP(element);
-+                                      lk.l_whence = Z_LVAL_P(element);
-                               }
--                              if (zend_hash_find(fh, "type", sizeof("type"), (void **) &element) == FAILURE) {
-+                              if ((element = zend_hash_str_find(fh, "type", sizeof("type"))) == NULL) {
-                                       lk.l_type = 0;
-                               } else {
--                                      lk.l_type = Z_LVAL_PP(element);
-+                                      lk.l_type = Z_LVAL_P(element);
-                               }
-                       } else if (Z_TYPE_P(arg) == IS_LONG) {
-                               lk.l_start  = 0;
-@@ -463,7 +463,7 @@ PHP_FUNCTION(dio_tcsetattr)
-       int Baud_Rate, Data_Bits=8, Stop_Bits=1, Parity=0, Flow_Control=1, Is_Canonical=1;
-       long BAUD,DATABITS,STOPBITS,PARITYON,PARITY;
-       HashTable      *fh;
--      zval          **element;
-+      zval           *element;
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &r_fd, &arg) == FAILURE) {
-               return;
-@@ -480,40 +480,40 @@ PHP_FUNCTION(dio_tcsetattr)
-       fh = HASH_OF(arg);
--      if (zend_hash_find(fh, "baud", sizeof("baud"), (void **) &element) == FAILURE) {
-+      if ((element = zend_hash_str_find(fh, "baud", sizeof("baud"))) == NULL) {
-               Baud_Rate = 9600;
-       } else {
--              Baud_Rate = Z_LVAL_PP(element);
-+              Baud_Rate = Z_LVAL_P(element);
-       }
--      if (zend_hash_find(fh, "bits", sizeof("bits"), (void **) &element) == FAILURE) {
-+      if ((element = zend_hash_str_find(fh, "bits", sizeof("bits"))) == NULL) {
-               Data_Bits = 8;
-       } else {
--              Data_Bits = Z_LVAL_PP(element);
-+              Data_Bits = Z_LVAL_P(element);
-       }
--      if (zend_hash_find(fh, "stop", sizeof("stop"), (void **) &element) == FAILURE) {
-+      if ((element = zend_hash_str_find(fh, "stop", sizeof("stop"))) == NULL) {
-               Stop_Bits = 1;
-       } else {
--              Stop_Bits = Z_LVAL_PP(element);
-+              Stop_Bits = Z_LVAL_P(element);
-       }
--      if (zend_hash_find(fh, "parity", sizeof("parity"), (void **) &element) == FAILURE) {
-+      if ((element = zend_hash_str_find(fh, "parity", sizeof("parity"))) == NULL) {
-               Parity = 0;
-       } else {
--              Parity = Z_LVAL_PP(element);
-+              Parity = Z_LVAL_P(element);
-       }
--      if (zend_hash_find(fh, "flow_control", sizeof("flow_control"), (void **) &element) == FAILURE) {
-+      if ((element = zend_hash_str_find(fh, "flow_control", sizeof("flow_control"))) == NULL) {
-               Flow_Control = 1;
-       } else {
--              Flow_Control = Z_LVAL_PP(element);
-+              Flow_Control = Z_LVAL_P(element);
-       }
--      if (zend_hash_find(fh, "is_canonical", sizeof("is_canonical"), (void **) &element) == FAILURE) {
-+      if ((element = zend_hash_str_find(fh, "is_canonical", sizeof("is_canonical"))) == NULL) {
-               Is_Canonical = 0;
-       } else {
--              Is_Canonical = Z_LVAL_PP(element);
-+              Is_Canonical = Z_LVAL_P(element);
-       }
-       /* assign to correct values... */
--- 
-2.5.0
-
diff --git a/lang/php7-pecl-dio/patches/0010-Replace-dio_convert_to_long.patch b/lang/php7-pecl-dio/patches/0010-Replace-dio_convert_to_long.patch
deleted file mode 100644 (file)
index b5d7b61..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-From fb31b1cf4da2bfd0830d0a83754f5ecb125d1c4a Mon Sep 17 00:00:00 2001
-From: Michael Heimpold <mhei@heimpold.de>
-Date: Thu, 14 Jul 2016 00:38:52 +0200
-Subject: [PATCH 10/16] Replace dio_convert_to_long
-
-Signed-off-by: Michael Heimpold <mhei@heimpold.de>
----
- dio_common.c     | 106 +++++++++++++++++++++++--------------------------------
- php_dio_common.h |   2 --
- 2 files changed, 44 insertions(+), 64 deletions(-)
-
-diff --git a/dio_common.c b/dio_common.c
-index c50f56d..a5f4c63 100644
---- a/dio_common.c
-+++ b/dio_common.c
-@@ -52,29 +52,12 @@ void dio_init_stream_data(php_dio_stream_data *data) {
- }
- /* }}} */
--/* {{{ dio_convert_to_long
-- * Returns as a long, the value of the zval regardless of its type.
-- */
--long dio_convert_to_long(zval *val) {
--      zval *copyval;
--      long  longval;
--
--      ALLOC_INIT_ZVAL(copyval);
--      *copyval = *val;
--      convert_to_long(copyval);
--      longval = Z_LVAL_P(copyval);
--      zval_ptr_dtor(&copyval);
--
--      return longval;
--}
--/* }}} */
--
- /* {{{ dio_assoc_array_get_basic_options
-  * Retrieves the basic open option values from an associative array
-  */
- void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data TSRMLS_DC) {
- #if defined(DIO_HAS_FILEPERMS) || defined(DIO_NONBLOCK)
--      zval **tmpzval;
-+      zval *tmpzval;
-       HashTable *opthash;
-       opthash = HASH_OF(options);
-@@ -82,8 +65,8 @@ void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data
- #ifdef DIO_HAS_FILEPERMS
-       /* This is the file mode flags used by open(). */
--      if (zend_hash_find(opthash, "perms", sizeof("perms"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->perms = (int)dio_convert_to_long(*tmpzval);
-+      if ((tmpzval = zend_hash_str_find(opthash, "perms", sizeof("perms"))) != NULL) {
-+              data->perms = (int)zval_get_long(tmpzval);
-               data->has_perms = 1;
-       }
- #endif
-@@ -91,20 +74,20 @@ void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data
- #ifdef DIO_NONBLOCK
-       /* This sets the underlying stream to be blocking/non
-          block (i.e. O_NONBLOCK) */
--      if (zend_hash_find(opthash, "is_blocking", sizeof("is_blocking"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->is_blocking = dio_convert_to_long(*tmpzval) ? 1 : 0;
-+      if ((tmpzval = zend_hash_str_find(opthash, "is_blocking", sizeof("is_blocking"))) != NULL) {
-+              data->is_blocking = zval_get_long(tmpzval) ? 1 : 0;
-       }
-       /* This is the timeout value for reads in seconds.  Only one of
-          timeout_secs or timeout_usecs need be defined to define a timeout. */
--      if (zend_hash_find(opthash, "timeout_secs", sizeof("timeout_secs"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->timeout_sec = dio_convert_to_long(*tmpzval);
-+      if ((tmpzval = zend_hash_str_find(opthash, "timeout_secs", sizeof("timeout_secs"))) != NULL) {
-+              data->timeout_sec = zval_get_long(tmpzval);
-       }
-       /* This is the timeout value for reads in microseconds.  Only one of
-          timeout_secs or timeout_usecs need be defined to define a timeout. */
--      if (zend_hash_find(opthash, "timeout_usecs", sizeof("timeout_usecs"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->timeout_usec = dio_convert_to_long(*tmpzval);
-+      if ((tmpzval = zend_hash_str_find(opthash, "timeout_usecs", sizeof("timeout_usecs"))) != NULL) {
-+              data->timeout_usec = zval_get_long(tmpzval);
-       }
-       data->has_timeout = (data->timeout_sec | data->timeout_usec) ? 1 : 0;
-@@ -116,33 +99,33 @@ void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data
-  * Retrieves the serial open option values from an associative array
-  */
- void dio_assoc_array_get_serial_options(zval *options, php_dio_stream_data *data TSRMLS_DC) {
--      zval **tmpzval;
-+      zval *tmpzval;
-       HashTable *opthash;
-       opthash = HASH_OF(options);
--      if (zend_hash_find(opthash, "data_rate", sizeof("data_rate"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->data_rate = dio_convert_to_long(*tmpzval);
-+      if ((tmpzval = zend_hash_str_find(opthash, "data_rate", sizeof("data_rate"))) != NULL) {
-+              data->data_rate = zval_get_long(tmpzval);
-       }
--      if (zend_hash_find(opthash, "data_bits", sizeof("data_bits"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->data_bits = (int)dio_convert_to_long(*tmpzval);
-+      if ((tmpzval = zend_hash_str_find(opthash, "data_bits", sizeof("data_bits"))) != NULL) {
-+              data->data_bits = (int)zval_get_long(tmpzval);
-       }
--      if (zend_hash_find(opthash, "stop_bits", sizeof("stop_bits"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->stop_bits = (int)dio_convert_to_long(*tmpzval);
-+      if ((tmpzval = zend_hash_str_find(opthash, "stop_bits", sizeof("stop_bits"))) != NULL) {
-+              data->stop_bits = (int)zval_get_long(tmpzval);
-       }
--      if (zend_hash_find(opthash, "parity", sizeof("parity"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->parity = (int)dio_convert_to_long(*tmpzval);
-+      if ((tmpzval = zend_hash_str_find(opthash, "parity", sizeof("parity"))) != NULL) {
-+              data->parity = (int)zval_get_long(tmpzval);
-       }
--      if (zend_hash_find(opthash, "flow_control", sizeof("flow_control"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->flow_control = (int)(dio_convert_to_long(*tmpzval) ? 1 : 0);
-+      if ((tmpzval = zend_hash_str_find(opthash, "flow_control", sizeof("flow_control"))) != NULL) {
-+              data->flow_control = zval_get_long(tmpzval) ? 1 : 0;
-       }
--      if (zend_hash_find(opthash, "is_canonical", sizeof("is_canonical"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->canonical = (int)(dio_convert_to_long(*tmpzval) ? 1 : 0);
-+      if ((tmpzval = zend_hash_str_find(opthash, "is_canonical", sizeof("is_canonical"))) != NULL) {
-+              data->canonical = zval_get_long(tmpzval) ? 1 : 0;
-       }
- }
- /* }}} */
-@@ -152,13 +135,13 @@ void dio_assoc_array_get_serial_options(zval *options, php_dio_stream_data *data
-  */
- void dio_stream_context_get_basic_options(php_stream_context *context, php_dio_stream_data *data TSRMLS_DC) {
- #if defined(DIO_HAS_FILEPERMS) || defined(DIO_NONBLOCK)
--      zval **tmpzval;
-+      zval *tmpzval;
- #endif
- #ifdef DIO_HAS_FILEPERMS
-       /* This is the file mode flags used by open(). */
--      if (php_stream_context_get_option(context, "dio", "perms", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->perms = (int)dio_convert_to_long(*tmpzval);
-+      if ((tmpzval = php_stream_context_get_option(context, "dio", "perms")) != NULL) {
-+              data->perms = (int)zval_get_long(tmpzval);
-               data->has_perms = 1;
-       }
- #endif
-@@ -166,20 +149,20 @@ void dio_stream_context_get_basic_options(php_stream_context *context, php_dio_s
- #ifdef DIO_NONBLOCK
-       /* This sets the underlying stream to be blocking/non
-          block (i.e. O_NONBLOCK) */
--      if (php_stream_context_get_option(context, "dio", "is_blocking", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->is_blocking = dio_convert_to_long(*tmpzval) ? 1 : 0;
-+      if ((tmpzval = php_stream_context_get_option(context, "dio", "is_blocking")) != NULL) {
-+              data->is_blocking = zval_get_long(tmpzval) ? 1 : 0;
-       }
-       /* This is the timeout value for reads in seconds.  Only one of
-          timeout_secs or timeout_usecs need be defined to define a timeout. */
--      if (php_stream_context_get_option(context, "dio", "timeout_secs", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->timeout_sec = dio_convert_to_long(*tmpzval);
-+      if ((tmpzval = php_stream_context_get_option(context, "dio", "timeout_secs")) != NULL) {
-+              data->timeout_sec = zval_get_long(tmpzval);
-       }
-       /* This is the timeout value for reads in microseconds.  Only one of
-          timeout_secs or timeout_usecs need be defined to define a timeout. */
--      if (php_stream_context_get_option(context, "dio", "timeout_usecs", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->timeout_usec = dio_convert_to_long(*tmpzval);
-+      if ((tmpzval = php_stream_context_get_option(context, "dio", "timeout_usecs")) != NULL) {
-+              data->timeout_usec = zval_get_long(tmpzval);
-       }
-       data->has_timeout = (data->timeout_sec | data->timeout_usec) ? 1 : 0;
-@@ -191,30 +174,30 @@ void dio_stream_context_get_basic_options(php_stream_context *context, php_dio_s
-  * Extracts the option values for dio.serial mode from a context
-  */
- void dio_stream_context_get_serial_options(php_stream_context *context, php_dio_stream_data *data TSRMLS_DC) {
--      zval **tmpzval;
-+      zval *tmpzval;
--      if (php_stream_context_get_option(context, "dio", "data_rate", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->data_rate = dio_convert_to_long(*tmpzval);
-+      if ((tmpzval = php_stream_context_get_option(context, "dio", "data_rate")) != NULL) {
-+              data->data_rate = zval_get_long(tmpzval);
-       }
--      if (php_stream_context_get_option(context, "dio", "data_bits", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->data_bits = (int)dio_convert_to_long(*tmpzval);
-+      if ((tmpzval = php_stream_context_get_option(context, "dio", "data_bits")) != NULL) {
-+              data->data_bits = (int)zval_get_long(tmpzval);
-       }
--      if (php_stream_context_get_option(context, "dio", "stop_bits", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->stop_bits = (int)dio_convert_to_long(*tmpzval);
-+      if ((tmpzval = php_stream_context_get_option(context, "dio", "stop_bits")) != NULL) {
-+              data->stop_bits = (int)zval_get_long(tmpzval);
-       }
--      if (php_stream_context_get_option(context, "dio", "parity", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->parity = (int)dio_convert_to_long(*tmpzval);
-+      if ((tmpzval = php_stream_context_get_option(context, "dio", "parity")) != NULL) {
-+              data->parity = (int)zval_get_long(tmpzval);
-       }
--      if (php_stream_context_get_option(context, "dio", "flow_control", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->flow_control = (int)(dio_convert_to_long(*tmpzval) ? 1 : 0);
-+      if ((tmpzval = php_stream_context_get_option(context, "dio", "flow_control")) != NULL) {
-+              data->flow_control = zval_get_long(tmpzval) ? 1 : 0;
-       }
--      if (php_stream_context_get_option(context, "dio", "is_canonical", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
--              data->canonical = (int)(dio_convert_to_long(*tmpzval) ? 1 : 0);
-+      if ((tmpzval = php_stream_context_get_option(context, "dio", "is_canonical")) != NULL) {
-+              data->canonical = zval_get_long(tmpzval) ? 1 : 0;
-       }
- }
- /* }}} */
-@@ -227,4 +210,3 @@ void dio_stream_context_get_serial_options(php_stream_context *context, php_dio_
-  * vim600: fdm=marker
-  * vim: sw=4 ts=4 noet
-  */
--
-diff --git a/php_dio_common.h b/php_dio_common.h
-index f6e4d98..6b14040 100644
---- a/php_dio_common.h
-+++ b/php_dio_common.h
-@@ -35,8 +35,6 @@
- #define DIO_STREAM_TYPE_RAW    1
- #define DIO_STREAM_TYPE_SERIAL 2
--long dio_convert_to_long(zval *val);
--
- php_dio_stream_data * dio_create_stream_data(void);
- void dio_init_stream_data(php_dio_stream_data *data);
--- 
-2.5.0
-
diff --git a/lang/php7-pecl-dio/patches/0011-Adopt-to-changed-stream-API-interface.patch b/lang/php7-pecl-dio/patches/0011-Adopt-to-changed-stream-API-interface.patch
deleted file mode 100644 (file)
index dde8565..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-From 3d71063ada4f1a4ef90611d263aa8e1d4f275359 Mon Sep 17 00:00:00 2001
-From: Michael Heimpold <mhei@heimpold.de>
-Date: Thu, 14 Jul 2016 00:50:12 +0200
-Subject: [PATCH 11/16] Adopt to changed stream API interface
-
-Signed-off-by: Michael Heimpold <mhei@heimpold.de>
----
- dio_posix.c           |  2 +-
- dio_stream_wrappers.c | 14 +++++++-------
- dio_win32.c           |  2 +-
- php_dio_common.h      |  2 +-
- 4 files changed, 10 insertions(+), 10 deletions(-)
-
-diff --git a/dio_posix.c b/dio_posix.c
-index 6ed8630..527d683 100644
---- a/dio_posix.c
-+++ b/dio_posix.c
-@@ -474,7 +474,7 @@ int dio_common_set_option(php_dio_stream_data *data, int option, int value, void
- /* {{{ dio_raw_open_stream
-  * Opens the underlying stream.
-  */
--int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
-+int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
-       php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
-       pdata->flags = dio_stream_mode_to_flags(mode);
-diff --git a/dio_stream_wrappers.c b/dio_stream_wrappers.c
-index 811bc07..817b0d1 100644
---- a/dio_stream_wrappers.c
-+++ b/dio_stream_wrappers.c
-@@ -126,12 +126,12 @@ php_stream_ops dio_raw_stream_ops = {
-  * fopen for the dio.raw stream.
-  */
- static php_stream *dio_raw_fopen_wrapper(php_stream_wrapper *wrapper,
--                                         char *path, char *mode,
--                                         int options, char **opened_path,
--                                         php_stream_context *context STREAMS_DC TSRMLS_DC) {
-+                                         const char *path, const char *mode, int options,
-+                                         zend_string **opened_path, php_stream_context *context STREAMS_DC)
-+{
-       php_dio_stream_data *data;
-       php_stream *stream;
--      char *filename;
-+      const char *filename;
-       /* Check it was actually for us (not a corrupted function pointer
-          somewhere!). */
-@@ -287,9 +287,9 @@ php_stream_ops dio_serial_stream_ops = {
-  * fopen for the dio.raw stream.
-  */
- static php_stream *dio_serial_fopen_wrapper(php_stream_wrapper *wrapper,
--                                         char *path, char *mode,
--                                         int options, char **opened_path,
--                                         php_stream_context *context STREAMS_DC TSRMLS_DC) {
-+                                            const char *path, const char *mode, int options,
-+                                            zend_string **opened_path, php_stream_context *context STREAMS_DC)
-+{
-       php_dio_stream_data *data;
-       php_stream *stream;
-       char *filename;
-diff --git a/dio_win32.c b/dio_win32.c
-index e7ccedd..1023d36 100644
---- a/dio_win32.c
-+++ b/dio_win32.c
-@@ -505,7 +505,7 @@ int dio_common_set_option(php_dio_stream_data *data, int option, int value, void
- /* {{{ dio_raw_open_stream
-  * Opens the underlying stream.
-  */
--int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
-+int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
-       php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
-       DWORD err;
-diff --git a/php_dio_common.h b/php_dio_common.h
-index 6b14040..7a75370 100644
---- a/php_dio_common.h
-+++ b/php_dio_common.h
-@@ -55,7 +55,7 @@ int dio_common_close(php_dio_stream_data *data);
- int dio_common_set_option(php_dio_stream_data *data, int option, int value, void *ptrparam);
--int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC);
-+int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC);
- int dio_serial_uninit(php_dio_stream_data *data);
--- 
-2.5.0
-
diff --git a/lang/php7-pecl-dio/patches/0012-Remove-ancient-macros-TSRMLS_CC-and-TSRMLS_DC.patch b/lang/php7-pecl-dio/patches/0012-Remove-ancient-macros-TSRMLS_CC-and-TSRMLS_DC.patch
deleted file mode 100644 (file)
index c15fd89..0000000
+++ /dev/null
@@ -1,829 +0,0 @@
-From 760ec7072cbba2cbbb6e4e17b0c54ee3c7b661a8 Mon Sep 17 00:00:00 2001
-From: Michael Heimpold <mhei@heimpold.de>
-Date: Thu, 14 Jul 2016 00:59:42 +0200
-Subject: [PATCH 12/16] Remove ancient macros TSRMLS_CC and TSRMLS_DC
-
-Signed-off-by: Michael Heimpold <mhei@heimpold.de>
----
- dio.c                 | 70 +++++++++++++++++++++++++--------------------------
- dio_common.c          |  8 +++---
- dio_posix.c           | 22 ++++++++--------
- dio_stream_wrappers.c | 48 +++++++++++++++++------------------
- dio_win32.c           | 46 ++++++++++++++++-----------------
- php_dio_common.h      | 12 ++++-----
- 6 files changed, 103 insertions(+), 103 deletions(-)
-
-diff --git a/dio.c b/dio.c
-index b489747..7bad575 100644
---- a/dio.c
-+++ b/dio.c
-@@ -93,11 +93,11 @@ PHP_FUNCTION(dio_open)
-       long      mode = 0;
-       int       fd;
--      if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|l", &file_name, &file_name_length, &flags, &mode) == FAILURE) {
-+      if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|l", &file_name, &file_name_length, &flags, &mode) == FAILURE) {
-               return;
-       }
--      if (php_check_open_basedir(file_name TSRMLS_CC) || DIO_SAFE_MODE_CHECK(file_name, "wb+")) {
-+      if (php_check_open_basedir(file_name) || DIO_SAFE_MODE_CHECK(file_name, "wb+")) {
-               RETURN_FALSE;
-       }
-@@ -108,7 +108,7 @@ PHP_FUNCTION(dio_open)
-       }
-       if (fd == -1) {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot open file %s with flags %ld and permissions %ld: %s", file_name, flags, mode, strerror(errno));
-+              php_error_docref(NULL, E_WARNING, "cannot open file %s with flags %ld and permissions %ld: %s", file_name, flags, mode, strerror(errno));
-               RETURN_FALSE;
-       }
-@@ -130,14 +130,14 @@ PHP_FUNCTION(dio_fdopen)
-       long lfd;
-       int fd;
--      if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &lfd) == FAILURE) {
-+      if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &lfd) == FAILURE) {
-               return;
-       }
-       fd = (int)lfd;
-       if ((fcntl(fd, F_GETFL, 0) == -1) && (errno == EBADF)) {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad file descriptor %d", fd);
-+              php_error_docref(NULL, E_WARNING, "Bad file descriptor %d", fd);
-               RETURN_FALSE;
-       }
-@@ -158,7 +158,7 @@ PHP_FUNCTION(dio_dup)
-       php_fd_t *f, *df;
-       int dfd;
--      if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &r_fd) == FAILURE) {
-+      if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &r_fd) == FAILURE) {
-               return;
-       }
-@@ -168,7 +168,7 @@ PHP_FUNCTION(dio_dup)
-       dfd = dup(f->fd);
-       if (dfd == -1) {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot duplication file descriptor %d: %s", f->fd, strerror(errno));
-+              php_error_docref(NULL, E_WARNING, "cannot duplication file descriptor %d: %s", f->fd, strerror(errno));
-               RETURN_FALSE;
-       }
-@@ -191,7 +191,7 @@ PHP_FUNCTION(dio_read)
-       long      bytes = 1024;
-       ssize_t   res;
--      if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &r_fd, &bytes) == FAILURE) {
-+      if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &r_fd, &bytes) == FAILURE) {
-               return;
-       }
-@@ -200,7 +200,7 @@ PHP_FUNCTION(dio_read)
-       }
-       if (bytes <= 0) {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0.");
-+              php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0.");
-               RETURN_FALSE;
-       }
-@@ -229,12 +229,12 @@ PHP_FUNCTION(dio_write)
-       long      trunc_len = 0;
-       ssize_t   res;
--      if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &r_fd, &data, &data_len, &trunc_len) == FAILURE) {
-+      if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|l", &r_fd, &data, &data_len, &trunc_len) == FAILURE) {
-               return;
-       }
-       if (trunc_len < 0 || trunc_len > data_len) {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "length must be greater or equal to zero and less then the length of the specified string.");
-+              php_error_docref(NULL, E_WARNING, "length must be greater or equal to zero and less then the length of the specified string.");
-               RETURN_FALSE;
-       }
-@@ -244,7 +244,7 @@ PHP_FUNCTION(dio_write)
-       res = write(f->fd, data, trunc_len ? trunc_len : data_len);
-       if (res == -1) {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot write data to file descriptor %d: %s", f->fd, strerror(errno));
-+              php_error_docref(NULL, E_WARNING, "cannot write data to file descriptor %d: %s", f->fd, strerror(errno));
-       }
-       RETURN_LONG(res);
-@@ -261,7 +261,7 @@ PHP_FUNCTION(dio_truncate)
-       php_fd_t *f;
-       long      offset;
--      if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &r_fd, &offset) == FAILURE) {
-+      if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &r_fd, &offset) == FAILURE) {
-               return;
-       }
-@@ -270,7 +270,7 @@ PHP_FUNCTION(dio_truncate)
-       }
-       if (ftruncate(f->fd, offset) == -1) {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "couldn't truncate %d to %ld bytes: %s", f->fd, offset, strerror(errno));
-+              php_error_docref(NULL, E_WARNING, "couldn't truncate %d to %ld bytes: %s", f->fd, offset, strerror(errno));
-               RETURN_FALSE;
-       }
-@@ -289,7 +289,7 @@ PHP_FUNCTION(dio_stat)
-       php_fd_t    *f;
-       struct stat  s;
--      if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &r_fd) == FAILURE) {
-+      if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &r_fd) == FAILURE) {
-               return;
-       }
-@@ -298,7 +298,7 @@ PHP_FUNCTION(dio_stat)
-       }
-       if (fstat(f->fd, &s) == -1) {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot stat %d: %s", f->fd, strerror(errno));
-+              php_error_docref(NULL, E_WARNING, "cannot stat %d: %s", f->fd, strerror(errno));
-               RETURN_FALSE;
-       }
-@@ -330,7 +330,7 @@ PHP_FUNCTION(dio_seek)
-       long      offset;
-       long      whence = SEEK_SET;
--      if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &r_fd, &offset, &whence) == FAILURE) {
-+      if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|l", &r_fd, &offset, &whence) == FAILURE) {
-               return;
-       }
-@@ -353,7 +353,7 @@ PHP_FUNCTION(dio_fcntl)
-       php_fd_t *f;
-       long      cmd;
--      if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &r_fd, &cmd, &arg) == FAILURE) {
-+      if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|z", &r_fd, &cmd, &arg) == FAILURE) {
-               return;
-       }
-@@ -369,7 +369,7 @@ PHP_FUNCTION(dio_fcntl)
-                       HashTable      *fh;
-                       if (!arg) {
--                              php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 3 to be array or int, none given");
-+                              php_error_docref(NULL, E_WARNING, "expects argument 3 to be array or int, none given");
-                               RETURN_FALSE;
-                       }
-                       if (Z_TYPE_P(arg) == IS_ARRAY) {
-@@ -403,7 +403,7 @@ PHP_FUNCTION(dio_fcntl)
-                               lk.l_whence = SEEK_SET;
-                               lk.l_type   = Z_LVAL_P(arg);
-                       } else {
--                              php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 3 to be array or int, %s given", zend_zval_type_name(arg));
-+                              php_error_docref(NULL, E_WARNING, "expects argument 3 to be array or int, %s given", zend_zval_type_name(arg));
-                               RETURN_FALSE;
-                       }
-@@ -428,7 +428,7 @@ PHP_FUNCTION(dio_fcntl)
-                       php_fd_t *new_f;
-                       if (!arg || Z_TYPE_P(arg) != IS_LONG) {
--                              php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 3 to be int");
-+                              php_error_docref(NULL, E_WARNING, "expects argument 3 to be int");
-                               RETURN_FALSE;
-                       }
-@@ -440,7 +440,7 @@ PHP_FUNCTION(dio_fcntl)
-               }
-               default:
-                       if (!arg || Z_TYPE_P(arg) != IS_LONG) {
--                              php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 3 to be int");
-+                              php_error_docref(NULL, E_WARNING, "expects argument 3 to be int");
-                               RETURN_FALSE;
-                       }
-@@ -465,7 +465,7 @@ PHP_FUNCTION(dio_tcsetattr)
-       HashTable      *fh;
-       zval           *element;
--      if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &r_fd, &arg) == FAILURE) {
-+      if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &r_fd, &arg) == FAILURE) {
-               return;
-       }
-@@ -474,7 +474,7 @@ PHP_FUNCTION(dio_tcsetattr)
-       }
-       if (Z_TYPE_P(arg) != IS_ARRAY) {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING,"tcsetattr, third argument should be an associative array");
-+              php_error_docref(NULL, E_WARNING,"tcsetattr, third argument should be an associative array");
-               return;
-       }
-@@ -564,7 +564,7 @@ PHP_FUNCTION(dio_tcsetattr)
-                       BAUD = B50;
-                       break;
-               default:
--                      php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid baud rate %d", Baud_Rate);
-+                      php_error_docref(NULL, E_WARNING, "invalid baud rate %d", Baud_Rate);
-                       RETURN_FALSE;
-       }
-       switch (Data_Bits) {
-@@ -581,7 +581,7 @@ PHP_FUNCTION(dio_tcsetattr)
-                       DATABITS = CS5;
-                       break;
-               default:
--                      php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data bits %d", Data_Bits);
-+                      php_error_docref(NULL, E_WARNING, "invalid data bits %d", Data_Bits);
-                       RETURN_FALSE;
-       }
-       switch (Stop_Bits) {
-@@ -592,7 +592,7 @@ PHP_FUNCTION(dio_tcsetattr)
-                       STOPBITS = CSTOPB;
-                       break;
-               default:
--                      php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid stop bits %d", Stop_Bits);
-+                      php_error_docref(NULL, E_WARNING, "invalid stop bits %d", Stop_Bits);
-                       RETURN_FALSE;
-       }
-@@ -610,7 +610,7 @@ PHP_FUNCTION(dio_tcsetattr)
-                       PARITY = 0;
-                       break;
-               default:
--                      php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid parity %d", Parity);
-+                      php_error_docref(NULL, E_WARNING, "invalid parity %d", Parity);
-                       RETURN_FALSE;
-       }
-@@ -652,7 +652,7 @@ PHP_FUNCTION(dio_close)
-       zval     *r_fd;
-       php_fd_t *f;
--      if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &r_fd) == FAILURE) {
-+      if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &r_fd) == FAILURE) {
-               return;
-       }
-@@ -669,7 +669,7 @@ PHP_FUNCTION(dio_close)
- /* {{{ dio_init_legacy_defines
-  * Initialises the legacy PHP defines
-  */
--static void dio_init_legacy_defines(int module_number TSRMLS_DC) {
-+static void dio_init_legacy_defines(int module_number) {
-       RDIOC(O_RDONLY);
-       RDIOC(O_WRONLY);
-       RDIOC(O_RDWR);
-@@ -852,11 +852,11 @@ PHP_MINIT_FUNCTION(dio)
-       /* Legacy resource destructor. */
-       le_fd = zend_register_list_destructors_ex(_dio_close_fd, NULL, le_fd_name, module_number);
--      dio_init_legacy_defines(module_number TSRMLS_CC);
-+      dio_init_legacy_defines(module_number);
-       /* Register the stream wrappers */
--      return (php_register_url_stream_wrapper(DIO_RAW_STREAM_NAME, &php_dio_raw_stream_wrapper TSRMLS_CC) == SUCCESS &&
--                      php_register_url_stream_wrapper(DIO_SERIAL_STREAM_NAME, &php_dio_serial_stream_wrapper TSRMLS_CC) == SUCCESS) ? SUCCESS : FAILURE;
-+      return (php_register_url_stream_wrapper(DIO_RAW_STREAM_NAME, &php_dio_raw_stream_wrapper) == SUCCESS &&
-+                      php_register_url_stream_wrapper(DIO_SERIAL_STREAM_NAME, &php_dio_serial_stream_wrapper) == SUCCESS) ? SUCCESS : FAILURE;
- }
- /* }}} */
-@@ -864,8 +864,8 @@ PHP_MINIT_FUNCTION(dio)
-  */
- PHP_MSHUTDOWN_FUNCTION(dio)
- {
--      return (php_unregister_url_stream_wrapper(DIO_RAW_STREAM_NAME TSRMLS_CC) == SUCCESS &&
--                      php_unregister_url_stream_wrapper(DIO_SERIAL_STREAM_NAME TSRMLS_CC) == SUCCESS) ? SUCCESS : FAILURE;
-+      return (php_unregister_url_stream_wrapper(DIO_RAW_STREAM_NAME) == SUCCESS &&
-+                      php_unregister_url_stream_wrapper(DIO_SERIAL_STREAM_NAME) == SUCCESS) ? SUCCESS : FAILURE;
- }
- /* }}} */
-diff --git a/dio_common.c b/dio_common.c
-index a5f4c63..d09c0ec 100644
---- a/dio_common.c
-+++ b/dio_common.c
-@@ -55,7 +55,7 @@ void dio_init_stream_data(php_dio_stream_data *data) {
- /* {{{ dio_assoc_array_get_basic_options
-  * Retrieves the basic open option values from an associative array
-  */
--void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data TSRMLS_DC) {
-+void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data) {
- #if defined(DIO_HAS_FILEPERMS) || defined(DIO_NONBLOCK)
-       zval *tmpzval;
-       HashTable *opthash;
-@@ -98,7 +98,7 @@ void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data
- /* {{{ dio_assoc_array_get_serial_options
-  * Retrieves the serial open option values from an associative array
-  */
--void dio_assoc_array_get_serial_options(zval *options, php_dio_stream_data *data TSRMLS_DC) {
-+void dio_assoc_array_get_serial_options(zval *options, php_dio_stream_data *data) {
-       zval *tmpzval;
-       HashTable *opthash;
-@@ -133,7 +133,7 @@ void dio_assoc_array_get_serial_options(zval *options, php_dio_stream_data *data
- /* {{{ dio_stream_context_get_raw_options
-  * Extracts the option values for dio.raw mode from a context
-  */
--void dio_stream_context_get_basic_options(php_stream_context *context, php_dio_stream_data *data TSRMLS_DC) {
-+void dio_stream_context_get_basic_options(php_stream_context *context, php_dio_stream_data *data) {
- #if defined(DIO_HAS_FILEPERMS) || defined(DIO_NONBLOCK)
-       zval *tmpzval;
- #endif
-@@ -173,7 +173,7 @@ void dio_stream_context_get_basic_options(php_stream_context *context, php_dio_s
- /* {{{ dio_stream_context_get_serial_options
-  * Extracts the option values for dio.serial mode from a context
-  */
--void dio_stream_context_get_serial_options(php_stream_context *context, php_dio_stream_data *data TSRMLS_DC) {
-+void dio_stream_context_get_serial_options(php_stream_context *context, php_dio_stream_data *data) {
-       zval *tmpzval;
-       if ((tmpzval = php_stream_context_get_option(context, "dio", "data_rate")) != NULL) {
-diff --git a/dio_posix.c b/dio_posix.c
-index 527d683..843e234 100644
---- a/dio_posix.c
-+++ b/dio_posix.c
-@@ -474,7 +474,7 @@ int dio_common_set_option(php_dio_stream_data *data, int option, int value, void
- /* {{{ dio_raw_open_stream
-  * Opens the underlying stream.
-  */
--int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
-+int dio_raw_open_stream(const char *filename, const char *mode, php_dio_stream_data *data) {
-       php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
-       pdata->flags = dio_stream_mode_to_flags(mode);
-@@ -498,7 +498,7 @@ int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *d
-       if (pdata->fd < 0) {
-               switch (errno) {
-                       case EEXIST:
--                              php_error_docref(NULL TSRMLS_CC, E_WARNING, "File exists!");
-+                              php_error_docref(NULL, E_WARNING, "File exists!");
-                               return 0;
-                       default:
-                               return 0;
-@@ -512,36 +512,36 @@ int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *d
- /* {{{ dio_serial_init
-  * Initialises the serial settings storing the original settings before hand.
-  */
--static int dio_serial_init(php_dio_stream_data *data TSRMLS_DC) {
-+static int dio_serial_init(php_dio_stream_data *data) {
-       php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
-       int ret = 0, data_bits_def, stop_bits_def, parity_def;
-       struct termios tio;
-       speed_t rate_def;
-       if (!dio_data_rate_to_define(data->data_rate, &rate_def)) {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_rate value (%ld)", data->data_rate);
-+              php_error_docref(NULL, E_WARNING, "invalid data_rate value (%ld)", data->data_rate);
-               return 0;
-       }
-       if (!dio_data_bits_to_define(data->data_bits, &data_bits_def)) {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_bits value (%d)", data->data_bits);
-+              php_error_docref(NULL, E_WARNING, "invalid data_bits value (%d)", data->data_bits);
-               return 0;
-       }
-       if (!dio_stop_bits_to_define(data->stop_bits, &stop_bits_def)) {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid stop_bits value (%d)", data->stop_bits);
-+              php_error_docref(NULL, E_WARNING, "invalid stop_bits value (%d)", data->stop_bits);
-               return 0;
-       }
-       if (!dio_parity_to_define(data->parity, &parity_def)) {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid parity value (%d)", data->parity);
-+              php_error_docref(NULL, E_WARNING, "invalid parity value (%d)", data->parity);
-               return 0;
-       }
-       ret = tcgetattr(pdata->fd, &(pdata->oldtio));
-       if (ret < 0) {
-               if ((errno == ENOTTY) || (errno == ENODEV)) {
--                      php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a serial port or terminal!");
-+                      php_error_docref(NULL, E_WARNING, "Not a serial port or terminal!");
-               }
-               return 0;
-       }
-@@ -632,7 +632,7 @@ int dio_serial_purge(php_dio_stream_data *data) {
- /* {{{ dio_serial_open_stream
-  * Opens the underlying stream.
-  */
--int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
-+int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data) {
-       php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
- #ifdef O_NOCTTY
-@@ -640,11 +640,11 @@ int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data
-       pdata->flags |= O_NOCTTY;
- #endif
--      if (!dio_raw_open_stream(filename, mode, data TSRMLS_CC)) {
-+      if (!dio_raw_open_stream(filename, mode, data)) {
-               return 0;
-       }
--      if (!dio_serial_init(data TSRMLS_CC)) {
-+      if (!dio_serial_init(data)) {
-               close(pdata->fd);
-               return 0;
-       }
-diff --git a/dio_stream_wrappers.c b/dio_stream_wrappers.c
-index 817b0d1..eb23752 100644
---- a/dio_stream_wrappers.c
-+++ b/dio_stream_wrappers.c
-@@ -36,7 +36,7 @@
- /* {{{ dio_stream_write
-  * Write to the stream
-  */
--static size_t dio_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
-+static size_t dio_stream_write(php_stream *stream, const char *buf, size_t count)
- {
-       return dio_common_write((php_dio_stream_data*)stream->abstract, buf, count);
- }
-@@ -45,7 +45,7 @@ static size_t dio_stream_write(php_stream *stream, const char *buf, size_t count
- /* {{{ dio_stream_read
-  * Read from the stream
-  */
--static size_t dio_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
-+static size_t dio_stream_read(php_stream *stream, char *buf, size_t count)
- {
-       php_dio_stream_data* data = (php_dio_stream_data*)stream->abstract;
-       size_t bytes = dio_common_read(data, buf, count);
-@@ -58,7 +58,7 @@ static size_t dio_stream_read(php_stream *stream, char *buf, size_t count TSRMLS
- /* {{{ dio_stream_flush
-  * Flush the stream.  For raw streams this does nothing.
-  */
--static int dio_stream_flush(php_stream *stream TSRMLS_DC)
-+static int dio_stream_flush(php_stream *stream)
- {
-       return 1;
- }
-@@ -67,7 +67,7 @@ static int dio_stream_flush(php_stream *stream TSRMLS_DC)
- /* {{{ dio_stream_close
-  * Close the stream
-  */
--static int dio_stream_close(php_stream *stream, int close_handle TSRMLS_DC)
-+static int dio_stream_close(php_stream *stream, int close_handle)
- {
-       php_dio_stream_data *abstract = (php_dio_stream_data*)stream->abstract;
-@@ -83,7 +83,7 @@ static int dio_stream_close(php_stream *stream, int close_handle TSRMLS_DC)
- /* {{{ dio_stream_set_option
-  * Set the stream options.
-  */
--static int dio_stream_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC)
-+static int dio_stream_set_option(php_stream *stream, int option, int value, void *ptrparam)
- {
-       php_dio_stream_data *abstract = (php_dio_stream_data*)stream->abstract;
-@@ -143,7 +143,7 @@ static php_stream *dio_raw_fopen_wrapper(php_stream_wrapper *wrapper,
-       filename = path + sizeof(DIO_RAW_STREAM_PROTOCOL) - 1;
-       /* Check we can actually access it. */
--      if (php_check_open_basedir(filename TSRMLS_CC) || DIO_SAFE_MODE_CHECK(filename, mode)) {
-+      if (php_check_open_basedir(filename) || DIO_SAFE_MODE_CHECK(filename, mode)) {
-               return NULL;
-       }
-@@ -152,11 +152,11 @@ static php_stream *dio_raw_fopen_wrapper(php_stream_wrapper *wrapper,
-       /* Parse the context. */
-       if (context) {
--              dio_stream_context_get_basic_options(context, data TSRMLS_CC);
-+              dio_stream_context_get_basic_options(context, data);
-       }
-       /* Try and open a raw stream. */
--      if (!dio_raw_open_stream(filename, mode, data TSRMLS_CC)) {
-+      if (!dio_raw_open_stream(filename, mode, data)) {
-               return NULL;
-       }
-@@ -199,7 +199,7 @@ PHP_FUNCTION(dio_raw) {
-       char *mode;
-       int   mode_len;
--      if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|z", &filename, &filename_len, &mode, &mode_len, &options) == FAILURE) {
-+      if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|z", &filename, &filename_len, &mode, &mode_len, &options) == FAILURE) {
-               RETURN_FALSE;
-       }
-@@ -209,7 +209,7 @@ PHP_FUNCTION(dio_raw) {
-       }
-       /* Check we can actually access the file. */
--      if (php_check_open_basedir(filename TSRMLS_CC) || DIO_SAFE_MODE_CHECK(filename, mode)) {
-+      if (php_check_open_basedir(filename) || DIO_SAFE_MODE_CHECK(filename, mode)) {
-               RETURN_FALSE;
-       }
-@@ -217,11 +217,11 @@ PHP_FUNCTION(dio_raw) {
-       data->stream_type = DIO_STREAM_TYPE_RAW;
-       if (options) {
--              dio_assoc_array_get_basic_options(options, data TSRMLS_CC);
-+              dio_assoc_array_get_basic_options(options, data);
-       }
-       /* Try and open a raw stream. */
--      if (dio_raw_open_stream(filename, mode, data TSRMLS_CC)) {
-+      if (dio_raw_open_stream(filename, mode, data)) {
-               stream = php_stream_alloc(&dio_raw_stream_ops, data, 0, mode);
-               if (!stream) {
-                       (void) dio_common_close(data);
-@@ -244,7 +244,7 @@ PHP_FUNCTION(dio_raw) {
-  * stream, if it is write only it flushes the write, otherwise it flushes
-  * both.
-  */
--static int dio_serial_stream_flush(php_stream *stream TSRMLS_DC)
-+static int dio_serial_stream_flush(php_stream *stream)
- {
-       return dio_serial_purge((php_dio_stream_data*)stream->abstract);
- }
-@@ -254,7 +254,7 @@ static int dio_serial_stream_flush(php_stream *stream TSRMLS_DC)
-  * Close the stream.  Restores the serial settings to their value before
-  * the stream was open.
-  */
--static int dio_serial_stream_close(php_stream *stream, int close_handle TSRMLS_DC)
-+static int dio_serial_stream_close(php_stream *stream, int close_handle)
- {
-       php_dio_stream_data *abstract = (php_dio_stream_data*)stream->abstract;
-@@ -304,7 +304,7 @@ static php_stream *dio_serial_fopen_wrapper(php_stream_wrapper *wrapper,
-       filename = path + sizeof(DIO_SERIAL_STREAM_PROTOCOL) - 1;
-       /* Check we can actually access it. */
--      if (php_check_open_basedir(filename TSRMLS_CC) || DIO_SAFE_MODE_CHECK(filename, mode)) {
-+      if (php_check_open_basedir(filename) || DIO_SAFE_MODE_CHECK(filename, mode)) {
-               return NULL;
-       }
-@@ -313,12 +313,12 @@ static php_stream *dio_serial_fopen_wrapper(php_stream_wrapper *wrapper,
-       /* Parse the context. */
-       if (context) {
--              dio_stream_context_get_basic_options(context, data TSRMLS_CC);
--              dio_stream_context_get_serial_options(context, data TSRMLS_CC);
-+              dio_stream_context_get_basic_options(context, data);
-+              dio_stream_context_get_serial_options(context, data);
-       }
-       /* Try and open a serial stream. */
--      if (!dio_serial_open_stream(filename, mode, data TSRMLS_CC)) {
-+      if (!dio_serial_open_stream(filename, mode, data)) {
-               return NULL;
-       }
-@@ -359,18 +359,18 @@ PHP_FUNCTION(dio_serial) {
-       char *mode;
-       int   mode_len;
--      if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|z", &filename, &filename_len, &mode, &mode_len, &options) == FAILURE) {
-+      if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|z", &filename, &filename_len, &mode, &mode_len, &options) == FAILURE) {
-               RETURN_FALSE;
-       }
-       /* Check the third argument is an array. */
-       if (options && (Z_TYPE_P(options) != IS_ARRAY)) {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING,"dio_serial, the third argument should be an array of options");
-+              php_error_docref(NULL, E_WARNING,"dio_serial, the third argument should be an array of options");
-               RETURN_FALSE;
-       }
-       /* Check we can actually access the file. */
--      if (php_check_open_basedir(filename TSRMLS_CC) || DIO_SAFE_MODE_CHECK(filename, mode)) {
-+      if (php_check_open_basedir(filename) || DIO_SAFE_MODE_CHECK(filename, mode)) {
-               RETURN_FALSE;
-       }
-@@ -378,12 +378,12 @@ PHP_FUNCTION(dio_serial) {
-       data->stream_type = DIO_STREAM_TYPE_SERIAL;
-       if (options) {
--              dio_assoc_array_get_basic_options(options, data TSRMLS_CC);
--              dio_assoc_array_get_serial_options(options, data TSRMLS_CC);
-+              dio_assoc_array_get_basic_options(options, data);
-+              dio_assoc_array_get_serial_options(options, data);
-       }
-       /* Try and open a serial stream. */
--      if (dio_serial_open_stream(filename, mode, data TSRMLS_CC)) {
-+      if (dio_serial_open_stream(filename, mode, data)) {
-               stream = php_stream_alloc(&dio_serial_stream_ops, data, 0, mode);
-               if (!stream) {
-                       efree(data);
-diff --git a/dio_win32.c b/dio_win32.c
-index 1023d36..25c838a 100644
---- a/dio_win32.c
-+++ b/dio_win32.c
-@@ -30,7 +30,7 @@
- /* {{{ dio_last_error_php_error
-  * Generates a PHP error message based upon the last Windows error.
-  */
--static void dio_last_error_php_error(int level, char * message TSRMLS_DC) {
-+static void dio_last_error_php_error(int level, char * message) {
-       LPVOID msgbuf;
-       DWORD  msgbuflen;
-       char * errmsg;
-@@ -68,7 +68,7 @@ static void dio_last_error_php_error(int level, char * message TSRMLS_DC) {
-       /* Allocate a buffer */
-       errmsg = emalloc(errmsglen);
-       if (!errmsg) {
--              php_error_docref(NULL TSRMLS_CC, E_ERROR, "Out of memory in dio_last_error_php_error()!");
-+              php_error_docref(NULL, E_ERROR, "Out of memory in dio_last_error_php_error()!");
-               LocalFree(msgbuf);
-               return;
-       }
-@@ -88,7 +88,7 @@ static void dio_last_error_php_error(int level, char * message TSRMLS_DC) {
-       errmsg = (char *)msgbuf;
- #endif
--      php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s[ERROR %d] %s", message, err, errmsg);
-+      php_error_docref(NULL, E_WARNING, "%s[ERROR %d] %s", message, err, errmsg);
-       LocalFree(msgbuf);
- #ifdef UNICODE
-@@ -505,7 +505,7 @@ int dio_common_set_option(php_dio_stream_data *data, int option, int value, void
- /* {{{ dio_raw_open_stream
-  * Opens the underlying stream.
-  */
--int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
-+int dio_raw_open_stream(const char *filename, const char *mode, php_dio_stream_data *data) {
-       php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
-       DWORD err;
-@@ -543,29 +543,29 @@ int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *d
-               err = GetLastError();
-               switch (err) {
-                       case ERROR_FILE_EXISTS:
--                              php_error_docref(NULL TSRMLS_CC, E_WARNING, "File exists!");
-+                              php_error_docref(NULL, E_WARNING, "File exists!");
-                               return 0;
-                       case ERROR_FILE_NOT_FOUND:
-                               /* ERROR_FILE_NOT_FOUND with TRUNCATE_EXISTING means that
-                                * the file doesn't exist so now try to create it. */
-                               if (TRUNCATE_EXISTING == wdata->creation_disposition) {
--                                      php_error_docref(NULL TSRMLS_CC, E_NOTICE, "File does not exist, creating new file!");
-+                                      php_error_docref(NULL, E_NOTICE, "File does not exist, creating new file!");
-                                       wdata->handle = CreateFile(filename, wdata->desired_access, 0,
-                                                               NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
-                                       if (INVALID_HANDLE_VALUE == wdata->handle) {
--                                              dio_last_error_php_error(E_WARNING, "CreateFile() failed:" TSRMLS_CC);
-+                                              dio_last_error_php_error(E_WARNING, "CreateFile() failed:");
-                                               return 0;
-                                       }
-                               } else {
--                                      php_error_docref(NULL TSRMLS_CC, E_WARNING, "File not found!");
-+                                      php_error_docref(NULL, E_WARNING, "File not found!");
-                                       return 0;
-                               }
-                               break;
-                       default:
--                              dio_last_error_php_error(E_WARNING, "CreateFile() failed:" TSRMLS_CC);
-+                              dio_last_error_php_error(E_WARNING, "CreateFile() failed:");
-                               return 0;
-               }
-       }
-@@ -584,33 +584,33 @@ int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *d
- /* {{{ dio_serial_init
-  * Initialises the serial port
-  */
--static int dio_serial_init(php_dio_stream_data *data TSRMLS_DC) {
-+static int dio_serial_init(php_dio_stream_data *data) {
-       php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
-       DWORD rate_def, data_bits_def, stop_bits_def, parity_def;
-       DCB dcb;
-       if (!dio_data_rate_to_define(data->data_rate, &rate_def)) {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_rate value (%d)", data->data_rate);
-+              php_error_docref(NULL, E_WARNING, "invalid data_rate value (%d)", data->data_rate);
-               return 0;
-       }
-       if (!dio_data_bits_to_define(data->data_bits, &data_bits_def)) {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_bits value (%d)", data->data_bits);
-+              php_error_docref(NULL, E_WARNING, "invalid data_bits value (%d)", data->data_bits);
-               return 0;
-       }
-       if (!dio_stop_bits_to_define(data->stop_bits, &stop_bits_def)) {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid stop_bits value (%d)", data->stop_bits);
-+              php_error_docref(NULL, E_WARNING, "invalid stop_bits value (%d)", data->stop_bits);
-               return 0;
-       }
-       if (!dio_parity_to_define(data->parity, &parity_def)) {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid parity value (%d)", data->parity);
-+              php_error_docref(NULL, E_WARNING, "invalid parity value (%d)", data->parity);
-               return 0;
-       }
-       if (!GetCommState(wdata->handle, &(wdata->olddcb))) {
--              dio_last_error_php_error(E_WARNING, "GetCommState() failed:" TSRMLS_CC);
-+              dio_last_error_php_error(E_WARNING, "GetCommState() failed:");
-               return 0;
-       }
-@@ -646,7 +646,7 @@ static int dio_serial_init(php_dio_stream_data *data TSRMLS_DC) {
-       }
-       if (!SetCommState(wdata->handle, &dcb)) {
--              dio_last_error_php_error(E_WARNING, "SetCommState() failed:" TSRMLS_CC);
-+              dio_last_error_php_error(E_WARNING, "SetCommState() failed:");
-               return 0;
-       }
-@@ -698,23 +698,23 @@ int dio_serial_purge(php_dio_stream_data *data) {
- /* {{{ dio_serial_open_stream
-  * Opens the underlying stream.
-  */
--int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
-+int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data) {
-       php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
-       COMMTIMEOUTS cto = { 0, 0, 0, 0, 0 };
--      php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Opening \"%s\" as a serial port (mode=\"%s\").", filename, mode);
-+      php_error_docref(NULL, E_NOTICE, "Opening \"%s\" as a serial port (mode=\"%s\").", filename, mode);
-       if (*mode != 'r') {
--              php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must open serial ports in read or read/write mode!");
-+              php_error_docref(NULL, E_WARNING, "You must open serial ports in read or read/write mode!");
-               return 0;
-       }
--      if (!dio_raw_open_stream(filename, mode, data TSRMLS_CC)) {
-+      if (!dio_raw_open_stream(filename, mode, data)) {
-               return 0;
-       }
-       if (!GetCommTimeouts(wdata->handle, &(wdata->oldcto))) {
--              dio_last_error_php_error(E_WARNING, "GetCommTimeouts() failed (Not a comm port?):" TSRMLS_CC);
-+              dio_last_error_php_error(E_WARNING, "GetCommTimeouts() failed (Not a comm port?):");
-               CloseHandle(wdata->handle);
-               return 0;
-       }
-@@ -735,12 +735,12 @@ int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data
-       }
-       if (!SetCommTimeouts(wdata->handle, &cto)) {
--              dio_last_error_php_error(E_WARNING, "SetCommTimeouts() failed:" TSRMLS_CC);
-+              dio_last_error_php_error(E_WARNING, "SetCommTimeouts() failed:");
-               CloseHandle(wdata->handle);
-               return 0;
-       }
--      if (!dio_serial_init(data TSRMLS_CC)) {
-+      if (!dio_serial_init(data)) {
-               CloseHandle(wdata->handle);
-               return 0;
-       }
-diff --git a/php_dio_common.h b/php_dio_common.h
-index 7a75370..6af202f 100644
---- a/php_dio_common.h
-+++ b/php_dio_common.h
-@@ -39,13 +39,13 @@ php_dio_stream_data * dio_create_stream_data(void);
- void dio_init_stream_data(php_dio_stream_data *data);
--void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data TSRMLS_DC);
-+void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data);
--void dio_assoc_array_get_serial_options(zval *options, php_dio_stream_data *data TSRMLS_DC);
-+void dio_assoc_array_get_serial_options(zval *options, php_dio_stream_data *data);
--void dio_stream_context_get_basic_options(php_stream_context *context, php_dio_stream_data *data TSRMLS_DC);
-+void dio_stream_context_get_basic_options(php_stream_context *context, php_dio_stream_data *data);
--void dio_stream_context_get_serial_options(php_stream_context *context, php_dio_stream_data *data TSRMLS_DC);
-+void dio_stream_context_get_serial_options(php_stream_context *context, php_dio_stream_data *data);
- size_t dio_common_write(php_dio_stream_data *data, const char *buf, size_t count);
-@@ -55,13 +55,13 @@ int dio_common_close(php_dio_stream_data *data);
- int dio_common_set_option(php_dio_stream_data *data, int option, int value, void *ptrparam);
--int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC);
-+int dio_raw_open_stream(const char *filename, const char *mode, php_dio_stream_data *data);
- int dio_serial_uninit(php_dio_stream_data *data);
- int dio_serial_purge(php_dio_stream_data *data);
--int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC);
-+int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data);
- #endif /* PHP_DIO_COMMON_H_ */
--- 
-2.5.0
-
diff --git a/lang/php7-pecl-dio/patches/0013-Fix-tests-for-legacy-interface.patch b/lang/php7-pecl-dio/patches/0013-Fix-tests-for-legacy-interface.patch
deleted file mode 100644 (file)
index e632552..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-From 942b77d84417298fb9e99c216029f22fbd1e2d98 Mon Sep 17 00:00:00 2001
-From: Michael Heimpold <mhei@heimpold.de>
-Date: Thu, 14 Jul 2016 01:47:05 +0200
-Subject: [PATCH 13/16] Fix tests for legacy interface
-
-Signed-off-by: Michael Heimpold <mhei@heimpold.de>
----
- dio.c | 16 ++++++++++------
- 1 file changed, 10 insertions(+), 6 deletions(-)
-
-diff --git a/dio.c b/dio.c
-index 7bad575..1a130a2 100644
---- a/dio.c
-+++ b/dio.c
-@@ -73,9 +73,9 @@ static int new_php_fd(php_fd_t **f, int fd)
-       return 1;
- }
--static void _dio_close_fd(zend_resource *res)
-+static void _dio_close_fd(zend_resource *rsrc)
- {
--      php_fd_t *f = (php_fd_t *)zend_fetch_resource(res, NULL, le_fd);
-+      php_fd_t *f = (php_fd_t *)rsrc->ptr;
-       if (f) {
-               close(f->fd);
-               free(f);
-@@ -87,8 +87,8 @@ static void _dio_close_fd(zend_resource *res)
- PHP_FUNCTION(dio_open)
- {
-       php_fd_t *f;
--      char     *file_name;
--      int       file_name_length;
-+      char     *file_name = NULL;
-+      size_t    file_name_length = 0;
-       long      flags;
-       long      mode = 0;
-       int       fd;
-@@ -97,6 +97,10 @@ PHP_FUNCTION(dio_open)
-               return;
-       }
-+      if (!file_name || file_name[0] == '\0') {
-+              RETURN_FALSE;
-+      }
-+
-       if (php_check_open_basedir(file_name) || DIO_SAFE_MODE_CHECK(file_name, "wb+")) {
-               RETURN_FALSE;
-       }
-@@ -176,7 +180,7 @@ PHP_FUNCTION(dio_dup)
-               RETURN_FALSE;
-       }
--      RETVAL_RES(zend_register_resource(f, le_fd));
-+      RETVAL_RES(zend_register_resource(df, le_fd));
- }
- /* }}} */
- #endif
-@@ -660,7 +664,7 @@ PHP_FUNCTION(dio_close)
-               RETURN_FALSE;
-       }
--      zend_list_delete(Z_LVAL_P(r_fd));
-+      zend_list_delete(Z_RES_P(r_fd));
- }
- /* }}} */
--- 
-2.5.0
-
diff --git a/lang/php7-pecl-dio/patches/0014-Add-missing-changes-from-changed-stream-API-interfac.patch b/lang/php7-pecl-dio/patches/0014-Add-missing-changes-from-changed-stream-API-interfac.patch
deleted file mode 100644 (file)
index b9e2e00..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-From ff469d3a11409e9b043dc10ddfc44792c5359ff1 Mon Sep 17 00:00:00 2001
-From: Michael Heimpold <mhei@heimpold.de>
-Date: Thu, 14 Jul 2016 01:47:05 +0200
-Subject: [PATCH 14/16] Add missing changes from changed stream API interface
-
-Signed-off-by: Michael Heimpold <mhei@heimpold.de>
----
- dio_posix.c           | 2 +-
- dio_stream_wrappers.c | 2 +-
- php_dio_common.h      | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/dio_posix.c b/dio_posix.c
-index 843e234..b2aa228 100644
---- a/dio_posix.c
-+++ b/dio_posix.c
-@@ -632,7 +632,7 @@ int dio_serial_purge(php_dio_stream_data *data) {
- /* {{{ dio_serial_open_stream
-  * Opens the underlying stream.
-  */
--int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data) {
-+int dio_serial_open_stream(const char *filename, const char *mode, php_dio_stream_data *data) {
-       php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
- #ifdef O_NOCTTY
-diff --git a/dio_stream_wrappers.c b/dio_stream_wrappers.c
-index eb23752..0a00daa 100644
---- a/dio_stream_wrappers.c
-+++ b/dio_stream_wrappers.c
-@@ -292,7 +292,7 @@ static php_stream *dio_serial_fopen_wrapper(php_stream_wrapper *wrapper,
- {
-       php_dio_stream_data *data;
-       php_stream *stream;
--      char *filename;
-+      const char *filename;
-       /* Check it was actually for us (not a corrupted function pointer
-          somewhere!). */
-diff --git a/php_dio_common.h b/php_dio_common.h
-index 6af202f..7068ea7 100644
---- a/php_dio_common.h
-+++ b/php_dio_common.h
-@@ -61,7 +61,7 @@ int dio_serial_uninit(php_dio_stream_data *data);
- int dio_serial_purge(php_dio_stream_data *data);
--int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data);
-+int dio_serial_open_stream(const char *filename, const char *mode, php_dio_stream_data *data);
- #endif /* PHP_DIO_COMMON_H_ */
--- 
-2.5.0
-
diff --git a/lang/php7-pecl-dio/patches/0015-Add-.gitignore.patch b/lang/php7-pecl-dio/patches/0015-Add-.gitignore.patch
deleted file mode 100644 (file)
index ef675de..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-From def92a2db269d4ea6d2e8b7f8fe9dd473886a6b1 Mon Sep 17 00:00:00 2001
-From: Michael Heimpold <mhei@heimpold.de>
-Date: Sun, 17 Jul 2016 01:08:47 +0200
-Subject: [PATCH 15/16] Add .gitignore
-
-Signed-off-by: Michael Heimpold <mhei@heimpold.de>
----
- .gitignore | 28 ++++++++++++++++++++++++++++
- 1 file changed, 28 insertions(+)
- create mode 100644 .gitignore
-
-diff --git a/.gitignore b/.gitignore
-new file mode 100644
-index 0000000..dae52e8
---- /dev/null
-+++ b/.gitignore
-@@ -0,0 +1,28 @@
-+.deps
-+.libs
-+Makefile
-+Makefile.fragments
-+Makefile.global
-+Makefile.objects
-+acinclude.m4
-+aclocal.m4
-+autom4te.cache
-+build
-+config.guess
-+config.h
-+config.h.in
-+config.log
-+config.nice
-+config.status
-+config.sub
-+configure
-+configure.in
-+*.la
-+*.lo
-+install-sh
-+libtool
-+ltmain.sh
-+missing
-+mkinstalldirs
-+modules
-+run-tests.php
--- 
-2.5.0
-
diff --git a/lang/php7-pecl-dio/patches/0016-Add-additional-baudrates.patch b/lang/php7-pecl-dio/patches/0016-Add-additional-baudrates.patch
deleted file mode 100644 (file)
index 16cceea..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-From 0f8df09a8008eed8a7ac0c6400bce523014ff770 Mon Sep 17 00:00:00 2001
-From: Michael Heimpold <mhei@heimpold.de>
-Date: Mon, 18 Jul 2016 22:45:04 +0200
-Subject: [PATCH 16/16] Add additional baudrates
-
-Signed-off-by: Michael Heimpold <mhei@heimpold.de>
----
- dio.c | 20 ++++++++++++++++++++
- 1 file changed, 20 insertions(+)
-
-diff --git a/dio.c b/dio.c
-index 1a130a2..a4e8e7d 100644
---- a/dio.c
-+++ b/dio.c
-@@ -522,6 +522,26 @@ PHP_FUNCTION(dio_tcsetattr)
-       /* assign to correct values... */
-       switch (Baud_Rate)  {
-+#ifdef B460800
-+              case 460800:
-+                      BAUD = B460800;
-+                      break;
-+#endif
-+#ifdef B230400
-+              case 230400:
-+                      BAUD = B230400;
-+                      break;
-+#endif
-+#ifdef B115200
-+              case 115200:
-+                      BAUD = B115200;
-+                      break;
-+#endif
-+#ifdef B57600
-+              case 57600:
-+                      BAUD = B57600;
-+                      break;
-+#endif
-               case 38400:
-                       BAUD = B38400;
-                       break;
--- 
-2.5.0
-
index 4166d2c5e07e9cb43458336fb5625ab1ab039d03..be9267a742066946f2b63a89de97ddbb82c5e9cc 100644 (file)
@@ -8,9 +8,9 @@ include $(TOPDIR)/rules.mk
 PECL_NAME:=pecl_http
 PECL_LONGNAME:=Extended HTTP Support
 
-PKG_VERSION:=3.0.1
+PKG_VERSION:=3.1.0
 PKG_RELEASE:=2
-PKG_MD5SUM:=042c97314c180f6473338f0c5d35fabd
+PKG_MD5SUM:=e3de67b156e7d5f6c2e5eb1e2b5f0acceb7004f1260d68c9f8b2c0f9629aabf0
 
 PKG_NAME:=php7-pecl-http
 PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
@@ -32,8 +32,19 @@ include $(INCLUDE_DIR)/nls.mk
 include ../php7/pecl.mk
 
 CONFIGURE_VARS+= \
-       PHP_PROPRO=yes \
-       PHP_RAPHF=yes \
+       PECL_cv_HAVE_EXT_propro=yes \
+       PECL_cv_HAVE_EXT_raphf=yes \
+       PECL_cv_HAVE_LIBCURL_ARES=no \
+       PECL_cv_HAVE_LIBCURL_OpenSSL=$(if $(CONFIG_LIBCURL_OPENSSL),yes,no) \
+       PECL_cv_HAVE_LIBCURL_GnuTLS=$(if $(CONFIG_LIBCURL_GNUTLS),yes,no) \
+       PECL_cv_HAVE_LIBCURL_NSS=no \
+       PECL_cv_HAVE_LIBCURL_SecureTransport=no \
+       PECL_cv_HAVE_LIBCURL_GSKit=no \
+       PECL_cv_HAVE_LIBCURL_PolarSSL=no \
+       PECL_cv_HAVE_LIBCURL_WolfSSL=$(if $(CONFIG_LIBCURL_CYASSL),yes,no) \
+       PECL_cv_HAVE_LIBCURL_mbedTLS=$(if $(CONFIG_LIBCURL_MBEDTLS),yes,no) \
+       PECL_cv_HAVE_LIBCURL_axTLS=no \
+       PECL_cv_LIBCURL_TLSAUTH_SRP=$(if $(CONFIG_LIBCURL_TLS_SRP),yes,no) \
 
 CONFIGURE_ARGS+= \
        --with-http \
@@ -42,5 +53,5 @@ CONFIGURE_ARGS+= \
        --with-http-libevent-dir="$(STAGING_DIR)/usr" \
        --with-http-libidn-dir="$(STAGING_DIR)/usr"
 
-$(eval $(call PECLPackage,http,$(PECL_LONGNAME),+libcurl +librt +libevent2 +libidn +php7-mod-iconv +php7-mod-session +php7-pecl-raphf +php7-pecl-propro,30))
+$(eval $(call PECLPackage,http,$(PECL_LONGNAME),+icu +libcurl +librt +libevent2 +libidn +php7-mod-iconv +php7-mod-session +php7-pecl-raphf +php7-pecl-propro,30))
 $(eval $(call BuildPackage,$(PKG_NAME)))
diff --git a/lang/php7-pecl-http/patches.old/100_config9-m4.patch b/lang/php7-pecl-http/patches.old/100_config9-m4.patch
new file mode 100644 (file)
index 0000000..304a1df
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/config9.m4       2016-09-08 21:39:18.000000000 +0200
++++ b/config9.m4       2016-09-08 21:42:35.066903251 +0200
+@@ -71,18 +71,7 @@
+               extname=$1
+               haveext=$[PHP_]translit($1,a-z_-,A-Z__)
+               AC_MSG_CHECKING([for ext/$extname support])
+-              if test -x "$PHP_EXECUTABLE"; then
+-                      grepext=`$PHP_EXECUTABLE -m | $EGREP ^$extname\$`
+-                      if test "$grepext" = "$extname"; then
+-                              [PHP_HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=1
+-                              AC_MSG_RESULT([yes])
+-                              $2
+-                      else
+-                              [PHP_HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=
+-                              AC_MSG_RESULT([no])
+-                              $3
+-                      fi
+-              elif test "$haveext" != "no" && test "x$haveext" != "x"; then
++              if test "$haveext" != "no" && test "x$haveext" != "x"; then
+                       [PHP_HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=1
+                       AC_MSG_RESULT([yes])
+                       $2
diff --git a/lang/php7-pecl-http/patches/100_config9-m4.patch b/lang/php7-pecl-http/patches/100_config9-m4.patch
deleted file mode 100644 (file)
index 304a1df..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
---- a/config9.m4       2016-09-08 21:39:18.000000000 +0200
-+++ b/config9.m4       2016-09-08 21:42:35.066903251 +0200
-@@ -71,18 +71,7 @@
-               extname=$1
-               haveext=$[PHP_]translit($1,a-z_-,A-Z__)
-               AC_MSG_CHECKING([for ext/$extname support])
--              if test -x "$PHP_EXECUTABLE"; then
--                      grepext=`$PHP_EXECUTABLE -m | $EGREP ^$extname\$`
--                      if test "$grepext" = "$extname"; then
--                              [PHP_HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=1
--                              AC_MSG_RESULT([yes])
--                              $2
--                      else
--                              [PHP_HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=
--                              AC_MSG_RESULT([no])
--                              $3
--                      fi
--              elif test "$haveext" != "no" && test "x$haveext" != "x"; then
-+              if test "$haveext" != "no" && test "x$haveext" != "x"; then
-                       [PHP_HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=1
-                       AC_MSG_RESULT([yes])
-                       $2
diff --git a/lang/php7-pecl-http/patches/100_php_http_etag_bigendian_check.patch b/lang/php7-pecl-http/patches/100_php_http_etag_bigendian_check.patch
new file mode 100644 (file)
index 0000000..ee925c4
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/php_http_etag.c      2016-12-12 10:04:21.000000000 +0100
++++ b/src/php_http_etag.c      2016-12-23 21:10:59.523222367 +0100
+@@ -60,7 +60,7 @@
+               unsigned char buf[4];
+               *((uint *) e->ctx) = ~*((uint *) e->ctx);
+-#if WORDS_BIGENDIAN
++#ifdef WORDS_BIGENDIAN
+               etag = php_http_etag_digest((unsigned char *) e->ctx, 4);
+ #else
+               buf[0] = ((unsigned char *) e->ctx)[3];
index d311a7b068a4e27b2eb5e1812e7f5cc73b9defb1..6cd2bebd2e6e1f776101793d3704fccfc0e0a041 100644 (file)
@@ -6,7 +6,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=php
-PKG_VERSION:=7.0.13
+PKG_VERSION:=7.1.1
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
@@ -16,7 +16,8 @@ PKG_LICENSE_FILES:=LICENSE
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.php.net/distributions/
-PKG_MD5SUM:=eb117bf1d1efc99c522f132b265a3402
+PKG_MD5SUM:=65eef256f6e7104a05361939f5e23ada
+PKG_HASH:=b3565b0c1441064eba204821608df1ec7367abff881286898d900c2c2a5ffe70
 
 PKG_FIXUP:=libtool autoreconf
 PKG_BUILD_PARALLEL:=1
index 9d8f989f0211953425344f23e07565e2c8263637..819ad1e95d4b61b1b18ead5af2d1e415778c2fea 100644 (file)
@@ -1,11 +1,12 @@
 From: Joe Orton <jorton@redhat.com>
-Date: Sun, 18 Oct 2015 02:15:17 +0200
+Date: Thu, 20 Oct 2016 11:44:14 +0200
 Subject: Add support for use of the system timezone database
 
 Add support for use of the system timezone database, rather
 than embedding a copy.  Discussed upstream but was not desired.
 
 History:
+r14: improve check for valid tz file
 r13: adapt for upstream changes to use PHP allocator
 r12: adapt for upstream changes for new zic
 r11: use canonical names to avoid more case sensitivity issues
@@ -25,12 +26,12 @@ r3: fix a crash if /usr/share/zoneinfo doesn't exist (Raphael Geissert)
 r2: add filesystem trawl to set up name alias index
 r1: initial revision
 ---
- ext/date/lib/parse_tz.c | 549 +++++++++++++++++++++++++++++++++++++++++++++++-
- ext/date/lib/timelib.m4 |  14 ++
- 2 files changed, 552 insertions(+), 11 deletions(-)
+ ext/date/lib/parse_tz.c | 560 +++++++++++++++++++++++++++++++++++++++++++++++-
+ ext/date/lib/timelib.m4 |  13 ++
+ 2 files changed, 562 insertions(+), 11 deletions(-)
 
 diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
-index 20d7eea..6301dc5 100644
+index 20d7eea..ed7717e 100644
 --- a/ext/date/lib/parse_tz.c
 +++ b/ext/date/lib/parse_tz.c
 @@ -24,6 +24,16 @@
@@ -75,7 +76,7 @@ index 20d7eea..6301dc5 100644
        /* read ID */
        version = (*tzf)[3] - '0';
        *tzf += 4;
-@@ -302,7 +321,418 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
+@@ -302,7 +321,429 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
        }
  }
  
@@ -294,6 +295,7 @@ index 20d7eea..6301dc5 100644
 +              && strcmp(ent->d_name, "posix") != 0
 +              && strcmp(ent->d_name, "posixrules") != 0
 +              && strcmp(ent->d_name, "right") != 0
++              && strstr(ent->d_name, ".list") == NULL
 +              && strstr(ent->d_name, ".tab") == NULL;
 +}
 +
@@ -434,8 +436,18 @@ index 20d7eea..6301dc5 100644
 +
 +/* Returns true if the passed-in stat structure describes a
 + * probably-valid timezone file. */
-+static int is_valid_tzfile(const struct stat *st)
++static int is_valid_tzfile(const struct stat *st, int fd)
 +{
++      if (fd) {
++              char buf[20];
++              if (read(fd, buf, 20)!=20) {
++                      return 0;
++              }
++              lseek(fd, SEEK_SET, 0);
++              if (memcmp(buf, "TZif", 4)) {
++                      return 0;
++              }
++      }
 +      return S_ISREG(st->st_mode) && st->st_size > 20;
 +}
 +
@@ -473,11 +485,11 @@ index 20d7eea..6301dc5 100644
 +      }
 +
 +      snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
-+      
++
 +      fd = open(fname, O_RDONLY);
 +      if (fd == -1) {
 +              return NULL;
-+      } else if (fstat(fd, &st) != 0 || !is_valid_tzfile(&st)) {
++      } else if (fstat(fd, &st) != 0 || !is_valid_tzfile(&st, fd)) {
 +              close(fd);
 +              return NULL;
 +      }
@@ -495,7 +507,7 @@ index 20d7eea..6301dc5 100644
  {
        int left = 0, right = tzdb->index_size - 1;
  #ifdef HAVE_SETLOCALE
-@@ -341,21 +771,88 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
+@@ -341,21 +782,88 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
        return 0;
  }
  
@@ -577,7 +589,7 @@ index 20d7eea..6301dc5 100644
 +
 +              snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
 +
-+              return stat(fname, &st) == 0 && is_valid_tzfile(&st);
++              return stat(fname, &st) == 0 && is_valid_tzfile(&st, 0);
 +      }
 +#endif
 +
@@ -585,7 +597,7 @@ index 20d7eea..6301dc5 100644
  }
  
  static void skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
-@@ -380,24 +877,54 @@ static void read_64bit_header(const unsigned char **tzf, timelib_tzinfo *tz)
+@@ -380,24 +888,54 @@ static void read_64bit_header(const unsigned char **tzf, timelib_tzinfo *tz)
  timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb)
  {
        const unsigned char *tzf;
@@ -650,13 +662,13 @@ index 20d7eea..6301dc5 100644
                tmp = NULL;
        }
 diff --git a/ext/date/lib/timelib.m4 b/ext/date/lib/timelib.m4
-index c725572..4c837c7 100644
+index 99bf9fa..4bf7e46 100644
 --- a/ext/date/lib/timelib.m4
 +++ b/ext/date/lib/timelib.m4
-@@ -78,3 +78,17 @@ stdlib.h
+@@ -78,3 +78,16 @@ stdlib.h
  
  dnl Check for strtoll, atoll
- AC_CHECK_FUNCS(strtoll atoll strftime)
+ AC_CHECK_FUNCS(strtoll atoll strftime gettimeofday)
 +
 +PHP_ARG_WITH(system-tzdata, for use of system timezone data,
 +[  --with-system-tzdata[=DIR]      to specify use of system timezone data],
@@ -670,4 +682,3 @@ index c725572..4c837c7 100644
 +                         [Define for location of system timezone data])
 +   fi
 +fi
-+
index 11a6393bf842dac1a50033f8beab3529724ccaed..efa1fc7e0e9fa034ff439c2939c62bc5b748b7d3 100644 (file)
@@ -14,10 +14,10 @@ To be used in tandem with use_embedded_timezonedb.patch and use_embedded_timezon
  1 file changed, 17 insertions(+)
 
 diff --git a/ext/date/php_date.c b/ext/date/php_date.c
-index e780b2e..2b5a528 100644
+index cbe6e91..1999c83 100644
 --- a/ext/date/php_date.c
 +++ b/ext/date/php_date.c
-@@ -992,6 +992,23 @@ static char* guess_timezone(const timelib_tzdb *tzdb)
+@@ -1003,6 +1003,23 @@ static char* guess_timezone(const timelib_tzdb *tzdb)
                DATEG(timezone_valid) = 1;
                return DATEG(default_timezone);
        }
index abfd6f760d8e9fa630435399fa6317791a367869..0a10afa51d876e25e072ca2bf44d0426463bb83e 100644 (file)
@@ -8,15 +8,14 @@ Subject: Add patch to remove build timestamps from generated binaries.
  sapi/cgi/cgi_main.c           |  4 ++--
  sapi/cli/php_cli.c            |  4 ++--
  sapi/fpm/fpm/fpm_main.c       |  4 ++--
- sapi/litespeed/lsapi_main.c   |  4 ++--
  sapi/phpdbg/phpdbg.c          |  4 +---
7 files changed, 12 insertions(+), 24 deletions(-)
6 files changed, 10 insertions(+), 22 deletions(-)
 
 diff --git a/ext/standard/info.c b/ext/standard/info.c
-index e6eaac3..024e5c9 100644
+index e74d6b4..883fbdf 100644
 --- a/ext/standard/info.c
 +++ b/ext/standard/info.c
-@@ -863,7 +863,6 @@ PHPAPI void php_print_info(int flag)
+@@ -865,7 +865,6 @@ PHPAPI void php_print_info(int flag)
                php_info_print_box_end();
                php_info_print_table_start();
                php_info_print_table_row(2, "System", ZSTR_VAL(php_uname));
@@ -51,78 +50,62 @@ index f286b1a..fba92b8 100644
    case $host_alias in
    *aix*)
 diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
-index 8983b53..589e299 100644
+index 0b6deb1..bb9014a 100644
 --- a/sapi/cgi/cgi_main.c
 +++ b/sapi/cgi/cgi_main.c
-@@ -2216,9 +2216,9 @@ consult the installation file that came with this distribution, or visit \n\
+@@ -2342,9 +2342,9 @@ consult the installation file that came with this distribution, or visit \n\
                                                                SG(request_info).no_headers = 1;
                                                        }
  #if ZEND_DEBUG
--                                                      php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
-+                                                      php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
+-                                                      php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2017 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
++                                                      php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) 1997-2017 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
  #else
--                                                      php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
-+                                                      php_printf("PHP %s (%s)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
+-                                                      php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2017 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
++                                                      php_printf("PHP %s (%s)\nCopyright (c) 1997-2017 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
  #endif
                                                        php_request_shutdown((void *) 0);
                                                        fcgi_shutdown();
 diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
-index 978c8b3..3ee61a4 100644
+index dc92045..bb28364 100644
 --- a/sapi/cli/php_cli.c
 +++ b/sapi/cli/php_cli.c
-@@ -682,8 +682,8 @@ static int do_cli(int argc, char **argv) /* {{{ */
+@@ -690,8 +690,8 @@ static int do_cli(int argc, char **argv) /* {{{ */
                                goto out;
  
                        case 'v': /* show php version & quit */
--                              php_printf("PHP %s (%s) (built: %s %s) ( %s)\nCopyright (c) 1997-2016 The PHP Group\n%s",
+-                              php_printf("PHP %s (%s) (built: %s %s) ( %s)\nCopyright (c) 1997-2017 The PHP Group\n%s",
 -                                      PHP_VERSION, cli_sapi_module.name, __DATE__, __TIME__,
-+                              php_printf("PHP %s (%s) ( %s)\nCopyright (c) 1997-2016 The PHP Group\n%s",
++                              php_printf("PHP %s (%s) ( %s)\nCopyright (c) 1997-2017 The PHP Group\n%s",
 +                                      PHP_VERSION, cli_sapi_module.name,
  #if ZTS
                                        "ZTS "
  #else
 diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
-index 5adeb63..5e60255 100644
+index 6768113..545c52e 100644
 --- a/sapi/fpm/fpm/fpm_main.c
 +++ b/sapi/fpm/fpm/fpm_main.c
-@@ -1757,9 +1757,9 @@ int main(int argc, char *argv[])
+@@ -1756,9 +1756,9 @@ int main(int argc, char *argv[])
                                SG(request_info).no_headers = 1;
  
  #if ZEND_DEBUG
--                              php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__,        __TIME__, get_zend_version());
-+                              php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
+-                              php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2017 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__,        __TIME__, get_zend_version());
++                              php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) 1997-2017 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
  #else
--                              php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__,      get_zend_version());
-+                              php_printf("PHP %s (%s)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
+-                              php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2017 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__,      get_zend_version());
++                              php_printf("PHP %s (%s)\nCopyright (c) 1997-2017 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
  #endif
                                php_request_shutdown((void *) 0);
                                fcgi_shutdown();
-diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
-index b0ea105..4feb8f3 100644
---- a/sapi/litespeed/lsapi_main.c
-+++ b/sapi/litespeed/lsapi_main.c
-@@ -811,9 +811,9 @@ static int cli_main( int argc, char * argv[] )
-             case 'v':
-                 if (php_request_startup() != FAILURE) {
- #if ZEND_DEBUG
--                    php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
-+                    php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
- #else
--                    php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
-+                    php_printf("PHP %s (%s)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
- #endif
- #ifdef PHP_OUTPUT_NEWAPI
-                     php_output_end_all();
 diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
-index 68a164c..82565d8 100644
+index b47c7c8..ab94bba 100644
 --- a/sapi/phpdbg/phpdbg.c
 +++ b/sapi/phpdbg/phpdbg.c
-@@ -1657,10 +1657,8 @@
-                               phpdbg_do_help(NULL);
+@@ -1699,10 +1699,8 @@ phpdbg_main:
+                               phpdbg_do_help_cmd(exec);
                        } else if (show_version) {
                                phpdbg_out(
--                                      "phpdbg %s (built: %s %s)\nPHP %s, Copyright (c) 1997-2016 The PHP Group\n%s",
-+                                      "phpdbg %s\nPHP %s, Copyright (c) 1997-2016 The PHP Group\n%s",
+-                                      "phpdbg %s (built: %s %s)\nPHP %s, Copyright (c) 1997-2017 The PHP Group\n%s",
++                                      "phpdbg %s\nPHP %s, Copyright (c) 1997-2017 The PHP Group\n%s",
                                        PHPDBG_VERSION,
 -                                      __DATE__,
 -                                      __TIME__,
diff --git a/lang/php7/patches/1005-fix-asm-constraints-in-aarch64-multiply-macro.patch b/lang/php7/patches/1005-fix-asm-constraints-in-aarch64-multiply-macro.patch
new file mode 100644 (file)
index 0000000..0afa951
--- /dev/null
@@ -0,0 +1,29 @@
+From 6cbb9f4c247c5361b8c165fbb40b4118d5d7c0e5 Mon Sep 17 00:00:00 2001
+From: Andreas Schwab <schwab@linux-m68k.org>
+Date: Mon, 25 Apr 2016 11:59:14 +0200
+Subject: [PATCH] Fix asm constraints in aarch64 multiply macro
+
+All operands must be register operands and the output operands are early
+clobbered.
+---
+ Zend/zend_multiply.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h
+index dfd21f7..651dd43 100644
+--- a/Zend/zend_multiply.h
++++ b/Zend/zend_multiply.h
+@@ -53,8 +53,8 @@
+       __asm__("mul %0, %2, %3\n"                                                                              \
+               "smulh %1, %2, %3\n"                                                                            \
+               "sub %1, %1, %0, asr #63\n"                                                                     \
+-                      : "=X"(__tmpvar), "=X"(usedval)                                                 \
+-                      : "X"(a), "X"(b));                                                                              \
++                      : "=&r"(__tmpvar), "=&r"(usedval)                                               \
++                      : "r"(a), "r"(b));                                                                              \
+       if (usedval) (dval) = (double) (a) * (double) (b);                              \
+       else (lval) = __tmpvar;                                                                                 \
+ } while (0)
+-- 
+2.8.0
+
index 7b7c2442b77c15107eadcb6f98070674153f6ae6..caafc66c339dadbe25ab3cd088678a53c336e523 100644 (file)
@@ -16,6 +16,9 @@ define Build/Prepare
        ( cd $(PKG_BUILD_DIR); $(STAGING_DIR)/usr/bin/phpize7 )
 endef
 
+CONFIGURE_VARS+= \
+        ac_cv_c_bigendian_php=$(if $(CONFIG_BIG_ENDIAN),yes,no)
+
 CONFIGURE_ARGS+= \
        --with-php-config=$(STAGING_DIR)/usr/bin/php7-config
 
index b8a50009d275e1226cd3cb83812e311ce47846a8..b6d15fd6a9fa1213925e122ef79b371507559894 100644 (file)
@@ -45,7 +45,7 @@ define Build/Compile
 endef
 
 define Host/Compile
-       $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(HOST_BUILD_PREFIX)")
+       $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
 endef
 
 define Host/Install
diff --git a/lang/python-gmpy/Makefile b/lang/python-gmpy/Makefile
deleted file mode 100644 (file)
index 09ed13d..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Copyright (C) 2015 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:=gmpy
-PKG_VERSION:=1.17
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/g/gmpy
-PKG_MD5SUM:=2bf419076b06e107167e219f60ac6d27
-
-PKG_LICENSE:=LGPL-2.1+
-PKG_LICENSE_FILES:=lgpl-2.1.txt
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-
-include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-
-define Package/python-gmpy
-       SECTION:=lang
-       CATEGORY:=Languages
-       SUBMENU:=Python
-       TITLE:=python-gmpy
-       URL:=http://code.google.com/p/gmpy/
-       DEPENDS:=+libgmp +python-light
-endef
-
-define Package/python-gmpy/description
-gmpy is a C-coded Python extension module that provides access to the
-GMP (or MPIR) multiple-precision arithmetic library.
-endef
-
-define Build/Compile
-       $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
-endef
-
-$(eval $(call PyPackage,python-gmpy))
-$(eval $(call BuildPackage,python-gmpy))
index f12b78e4d2b38c991a18a595c4c1810082f2dd9a..701f0e6c4260b155917e777ca26ac9d22ccf8d93 100644 (file)
@@ -69,7 +69,7 @@ CONFIG_PACKAGE_python-packages-envs:=$(call qstrip,$(CONFIG_PACKAGE_python-packa
 CONFIG_PACKAGE_python-packages-extra-deps:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-extra-deps))
 CONFIG_PACKAGE_python-packages-pip-opts:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-pip-opts))
 
-HOST_PYTHON_PIP:=$(STAGING_DIR)/host/bin/pip$(PYTHON_VERSION)
+HOST_PYTHON_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON_VERSION)
 
 decr=$(word $(1),0 1 2 3 4 5 6 7 8 9 10)
 recur=$(if $(subst 0,,$(2)),$(call recur,$(1),$(call decr,$(2)),$(call $(1)$(2),$(3))),$(3))
@@ -92,7 +92,7 @@ HOST_PYTHON_PIP_INSTALL=$(HOST_PYTHON_PIP) install \
        $(if $(CONFIG_PACKAGE_python-packages-index-url), --index-url $(CONFIG_PACKAGE_python-packages-index-url)) \
        $(if $(CONFIG_PACKAGE_python-packages-pip-opts), $(CONFIG_PACKAGE_python-packages-pip-opts)) \
 
-HOST_PYTHON_PIP_INSTALL_HOST:=$(call HOST_PYTHON_PIP_INSTALL,$(STAGING_DIR)/host,"")
+HOST_PYTHON_PIP_INSTALL_HOST:=$(call HOST_PYTHON_PIP_INSTALL,$(STAGING_DIR_HOSTPKG),"")
 HOST_PYTHON_PIP_INSTALL_TARGET=$(call HOST_PYTHON_PIP_INSTALL,$(PKG_INSTALL_DIR)/$(call req2dir,$(pkg)),/usr)
 HOST_PYTHON_PIP_INSTALL_CLEANUP:=$(call HOST_PYTHON_PIP_INSTALL,$(PKG_INSTALL_DIR)/_cleanup,/usr)
 
index db40f8f6a300a9452368c9f57b25e061b18f5353..2099e63a95c3b2ae073c37f4dde5d362a5e9b178 100644 (file)
@@ -62,7 +62,7 @@ endef
 
 define Host/Compile
        $(call Build/Compile/HostPyMod,,\
-               install --root="$(STAGING_DIR)/host" --prefix="" \
+               install --root="$(STAGING_DIR_HOSTPKG)" --prefix="" \
                --single-version-externally-managed \
        )
 endef
index ba90ecb30ca0c753d1d9afc122850a46d541525b..0b0e5537f35b1fd7b50e316716453c364faf6a90 100644 (file)
@@ -46,7 +46,7 @@ define Build/Compile
 endef
 
 define Host/Compile
-       $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(HOST_BUILD_PREFIX)")
+       $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
 endef
 
 define Host/Install
index ff17417e7d440815ddc15721024ecbc565fad57c..37e6c8403883d5385dc5ea4f2560e7aea0b61310 100644 (file)
@@ -47,7 +47,7 @@ define Build/Compile
 endef
 
 define Host/Compile
-       $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(HOST_BUILD_PREFIX)")
+       $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
 endef
 
 define Host/Install
index 6efc433a44a89839516281b4226018723d00a5d4..1f312229f9b34233c9d0908db28be9f2af8437e9 100644 (file)
@@ -63,7 +63,7 @@ endef
 
 define Host/Compile
        $(call Build/Compile/HostPyMod,,\
-               install --root="$(HOST_BUILD_PREFIX)" --prefix="" \
+               install --root="$(STAGING_DIR_HOSTPKG)" --prefix="" \
                --single-version-externally-managed \
        )
 endef
index 3eb4e9dad091457e4f386bc1cc78fb9934fc9d97..d17b6e1341d8d40217c4cd9a7421ef0f22df43ad 100644 (file)
@@ -10,23 +10,24 @@ include $(TOPDIR)/rules.mk
 # For PYTHON_VERSION
 include ./files/python-version.mk
 
-# This file provides the necsessary host build variables
-include ./files/python-host.mk
-
-# For PyPackage
-include ./files/python-package.mk
-
 PKG_NAME:=python
 PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
-PKG_RELEASE:=2
+PKG_RELEASE:=4
 
 PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
-PKG_MD5SUM:=57dffcee9cee8bb2ab5f82af1d8e9a69
+PKG_MD5SUM:=53b43534153bb2a0363f08bae8b9d990
+PKG_HASH:=35d543986882f78261f97787fd3e06274bfa6df29fac9b4a94f73930ff98f731
 
 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
 
+# This file provides the necsessary host build variables
+include ./files/python-host.mk
+
+# For PyPackage
+include ./files/python-package.mk
+
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 HOST_BUILD_PARALLEL:=1
@@ -35,7 +36,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION)
 
 PKG_BUILD_DEPENDS:=python/host
-HOST_BUILD_DEPENDS:=bzip2/host expat/host libffi/host
+HOST_BUILD_DEPENDS:=bzip2/host expat/host
 
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
@@ -122,13 +123,21 @@ ifeq ($(CONFIG_IPV6),y)
        ENABLE_IPV6 += --enable-ipv6
 endif
 
+PYTHON_FOR_BUILD:= \
+       _PYTHON_PROJECT_BASE=$(PKG_BUILD_DIR) \
+       _PYTHON_HOST_PLATFORM=linux2 \
+       PYTHONPATH="$(PKG_BUILD_DIR)/Lib:$(PKG_BUILD_DIR)/build/lib.linux2-$(PYTHON_VERSION)" \
+       _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata \
+       $(HOST_PYTHON_BIN)
+
 CONFIGURE_ARGS+= \
        --sysconfdir=/etc \
        --enable-shared \
        --without-cxx-main \
        --with-threads \
-       --with-system-ffi="$(STAGING_DIR)/usr" \
+       --with-system-ffi \
        --without-pymalloc \
+       PYTHON_FOR_BUILD="$(PYTHON_FOR_BUILD)" \
        $(ENABLE_IPV6) \
        CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
        OPT="$(TARGET_CFLAGS)"
@@ -220,6 +229,9 @@ define PyPackage/python/filespec
 -|$(PYTHON_PKG_DIR)
 endef
 
+HOST_LDFLAGS += \
+       $$$$(pkg-config --static --libs libcrypto libssl)
+
 HOST_CONFIGURE_ARGS+= \
        --without-cxx-main \
        --without-pymalloc \
@@ -227,9 +239,8 @@ HOST_CONFIGURE_ARGS+= \
        --prefix=$(HOST_PYTHON_DIR) \
        --exec-prefix=$(HOST_PYTHON_DIR) \
        --with-system-expat=$(STAGING_DIR_HOSTPKG) \
-       --with-system-ffi=$(STAGING_DIR_HOSTPKG) \
-       CONFIG_SITE= \
-       CFLAGS="$(HOST_CFLAGS)"
+       --with-system-ffi=no \
+       CONFIG_SITE=
 
 define Host/Install
        $(MAKE) -C $(HOST_BUILD_DIR) install
index dc0c0c049968cbabdd3776d69892eb471b250263..6953a09d94165cf4dd4f67942dab764f711ede46 100644 (file)
@@ -11,12 +11,6 @@ __python_host_mk_inc=1
 # For PYTHON_VERSION
 $(call include_mk, python-version.mk)
 
-# Compatibility fallback for older OpenWrt and LEDE versions
-ifeq ($(STAGING_DIR_HOSTPKG),)
-  $(warning STAGING_DIR_HOSTPKG is unset - falling back to $$(STAGING_DIR)/host)
-  STAGING_DIR_HOSTPKG := $(STAGING_DIR)/host
-endif
-
 HOST_PYTHON_DIR:=$(STAGING_DIR_HOSTPKG)
 HOST_PYTHON_INC_DIR:=$(HOST_PYTHON_DIR)/include/python$(PYTHON_VERSION)
 HOST_PYTHON_LIB_DIR:=$(HOST_PYTHON_DIR)/lib/python$(PYTHON_VERSION)
@@ -77,4 +71,11 @@ define Build/Compile/HostPyMod
                $(3))
 endef
 
+define HostPy/Compile/Default
+       $(call Build/Compile/HostPyMod,,\
+               install --root="$(STAGING_DIR_HOSTPKG)" --prefix="" \
+               --single-version-externally-managed \
+       )
+endef
+
 endif # __python_host_mk_inc
index 6a2b942f4f252b99e4dd5f021b932465a069a589..647f649f785b230ac57df8f0d6c83946c421b21a 100644 (file)
@@ -8,7 +8,7 @@
 define Package/python-dev
 $(call Package/python/Default)
   TITLE:=Python $(PYTHON_VERSION) development files
-  DEPENDS:=+python
+  DEPENDS:=+python +python-lib2to3
 endef
 
 define PyPackage/python-dev/install
index 2a2e371c31e7fbeaf06ede36b9ea27cec96baae9..d0818a64c9381be920dd74228ab2b31f0f8f4507 100644 (file)
@@ -41,6 +41,15 @@ define PyPackage
     endef
   endif
 
+  ifndef PyPackage/$(1)/install
+    define PyPackage/$(1)/install
+               if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then \
+                       $(INSTALL_DIR) $$(1)/usr/bin \
+                       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $$(1)/usr/bin/
+               fi
+    endef
+  endif
+
   $(call shexport,PyPackage/$(1)/filespec)
 
   define Package/$(1)/install
@@ -115,21 +124,15 @@ define Build/Compile/PyMod
        find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" -o -name "*\.exe" | xargs rm -f
 endef
 
-define PyMod/Default
-  define Build/Compile
-       $$(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
-  endef
-
-  define Package/$(PKG_NAME)/install
-       $(INSTALL_DIR) $$(1)$(PYTHON_PKG_DIR) $$(1)/usr/bin
-       if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then find $(PKG_INSTALL_DIR)/usr/bin -mindepth 1 -maxdepth 1 -type f -exec $(CP) \{\} $$(1)/usr/bin/ \; ; fi
-       find $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR) -mindepth 1 -maxdepth 1 \( -type f -o -type d \) -exec $(CP) \{\} $$(1)$(PYTHON_PKG_DIR)/ \;
-  endef
-
-  define Build/InstallDev
-       $(INSTALL_DIR) $$(1)/usr/bin $$(1)$(PYTHON_PKG_DIR)
-       if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then find $(PKG_INSTALL_DIR)/usr/bin -mindepth 1 -maxdepth 1 -type f -exec $(CP) \{\} $$(1)/usr/bin/ \; ; fi
-       find $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR) -mindepth 1 -maxdepth 1 \( -type f -o -type d \) -exec $(CP) \{\} $$(1)$(PYTHON_PKG_DIR)/ \;
-  endef
+define PyBuild/Compile/Default
+       $(call Build/Compile/PyMod,, \
+               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
+               --single-version-externally-managed \
+       )
 endef
 
+ifeq ($(BUILD_VARIANT),python)
+define Build/Compile
+       $(call PyBuild/Compile/Default)
+endef
+endif # python
index 6905c3d6851ec4d8641eecae705a4c683ae03317..847eaf5c729269c61de360f46b93586b96c4d836 100644 (file)
@@ -6,5 +6,5 @@
 #
 
 PYTHON_VERSION:=2.7
-PYTHON_VERSION_MICRO:=12
+PYTHON_VERSION_MICRO:=13
 
diff --git a/lang/python/patches/005-fix-libffi-x86-64-configure.patch b/lang/python/patches/005-fix-libffi-x86-64-configure.patch
deleted file mode 100644 (file)
index ea062a3..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-diff --git a/Modules/_ctypes/libffi/configure b/Modules/_ctypes/libffi/configure
-index 75f62a7..4d6c9f2 100755
---- a/Modules/_ctypes/libffi/configure
-+++ b/Modules/_ctypes/libffi/configure
-@@ -17257,20 +17257,12 @@ case "$host" in
-       fi
-       ;;
--  i?86-*-* | x86_64-*-*)
--      TARGETDIR=x86
--      if test $ac_cv_sizeof_size_t = 4; then
--        case "$host" in
--          *-gnux32)
--            TARGET=X86_64
--            ;;
--          *)
--            TARGET=X86
--            ;;
--          esac
--      else
--        TARGET=X86_64;
--      fi
-+  i?86-*-*)
-+      TARGET=X86; TARGETDIR=x86
-+      ;;
-+
-+  x86_64-*-*)
-+      TARGET=X86_64; TARGETDIR=x86
-       ;;
-   ia64*-*-*)
diff --git a/lang/python/patches/011-do-not-prefer-ncursesw.patch b/lang/python/patches/011-do-not-prefer-ncursesw.patch
deleted file mode 100644 (file)
index c5f323c..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/setup.py b/setup.py
-index 7868b7b..86b0119 100644
---- a/setup.py
-+++ b/setup.py
-@@ -725,8 +725,8 @@ class PyBuildExt(build_ext):
-         # use the same library for the readline and curses modules.
-         if 'curses' in readline_termcap_library:
-             curses_library = readline_termcap_library
--        elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
--            curses_library = 'ncursesw'
-+        #elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
-+        #    curses_library = 'ncursesw'
-         elif self.compiler.find_library_file(lib_dirs, 'ncurses'):
-             curses_library = 'ncurses'
-         elif self.compiler.find_library_file(lib_dirs, 'curses'):
diff --git a/lang/python/patches/011-remove-setupterm-definition.patch b/lang/python/patches/011-remove-setupterm-definition.patch
new file mode 100644 (file)
index 0000000..e55d708
--- /dev/null
@@ -0,0 +1,12 @@
+diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
+index e478a57..eb297b4 100644
+--- a/Modules/_cursesmodule.c
++++ b/Modules/_cursesmodule.c
+@@ -117,7 +117,6 @@ char *PyCursesVersion = "2.2";
+     #defines many common symbols (such as "lines") which breaks the
+     curses module in other ways.  So the code will just specify
+     explicit prototypes here. */
+-extern int setupterm(char *,int,int *);
+ #ifdef __sgi
+ #include <term.h>
+ #endif
index 2e0f872a09474dbcf72764a0c6e0b5d89ec4049b..3a08a93935e94d4f51b3673f39198dd72fb31ada 100644 (file)
@@ -8,22 +8,29 @@
 include $(TOPDIR)/rules.mk
 
 # The file included below defines PYTHON_VERSION
-include ./files/python3-package.mk
+include ./files/python3-version.mk
 
 PYTHON_VERSION:=$(PYTHON3_VERSION)
 PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
 
 PKG_NAME:=python3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
 
 PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
-PKG_MD5SUM:=8906efbacfcdc7c3c9198aeefafd159e
+PKG_MD5SUM:=82b143ebbf4514d7e05876bed7a6b1f5
+PKG_HASH:=b0c5f904f685e32d9232f7bdcbece9819a892929063b6e385414ad2dd6a23622
 
 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
 
+# This file provides the necsessary host build variables
+include ./files/python3-host.mk
+
+# For Py3Package
+include ./files/python3-package.mk
+
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 HOST_BUILD_PARALLEL:=1
@@ -31,7 +38,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:=libbz2/host expat/host python3/host
+PKG_BUILD_DEPENDS:=python3/host
 HOST_BUILD_DEPENDS:=bzip2/host expat/host libffi/host
 
 include $(INCLUDE_DIR)/host-build.mk
@@ -81,8 +88,12 @@ endef
 PYTHON3_LIB_FILES_DEL:=
 PYTHON3_PACKAGES:=
 PYTHON3_SO_SUFFIX:=cpython-$(PYTHON3_VERSION_MAJOR)$(PYTHON3_VERSION_MINOR).so
+PYTHON3_PACKAGES_DEPENDS:=
 define Py3BasePackage
   PYTHON3_PACKAGES+=$(1)
+  ifeq ($(3),)
+    PYTHON3_PACKAGES_DEPENDS+=$(1)
+  endif
   PYTHON3_LIB_FILES_DEL+=$(2)
   define Py3Package/$(1)/filespec
     $(subst $(space),$(newline),$(foreach lib_file,$(2),+|$(lib_file)))
@@ -93,7 +104,7 @@ include ./files/python3-package-*.mk
 
 define Package/python3
 $(call Package/python3/Default)
-  DEPENDS:=+python3-light $(foreach package,$(filter-out python3-dev python3-lib2to3,$(PYTHON3_PACKAGES)),+$(package))
+  DEPENDS:=+python3-light $(foreach package,$(PYTHON3_PACKAGES_DEPENDS),+$(package))
 endef
 
 define Package/python3/description
@@ -120,14 +131,22 @@ ifeq ($(CONFIG_IPV6),y)
        ENABLE_IPV6 += --enable-ipv6
 endif
 
+PYTHON_FOR_BUILD:= \
+       _PYTHON_PROJECT_BASE=$(PKG_BUILD_DIR) \
+       _PYTHON_HOST_PLATFORM=linux2 \
+       PYTHONPATH="$(PKG_BUILD_DIR)/Lib:$(PKG_BUILD_DIR)/build/lib.linux2-$(PYTHON_VERSION)" \
+       _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata \
+       $(HOST_PYTHON3_BIN)
+
 CONFIGURE_ARGS+= \
        --sysconfdir=/etc \
        --enable-shared \
        --without-cxx-main \
        --with-threads \
-       --with-system-ffi="$(STAGING_DIR)/usr" \
+       --with-system-ffi \
        --without-pymalloc \
        --with-ensurepip=no \
+       PYTHON_FOR_BUILD="$(PYTHON_FOR_BUILD)" \
        $(ENABLE_IPV6) \
        CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
        OPT="$(TARGET_CFLAGS)"
@@ -141,7 +160,11 @@ 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/python3-package.mk $(STAGING_DIR)/mk/
+       $(INSTALL_DATA) \
+               ./files/python3-package.mk \
+               ./files/python3-host.mk \
+               ./files/python3-version.mk \
+               $(STAGING_DIR)/mk/
        $(CP) \
                $(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
                $(1)/usr/include/
@@ -215,7 +238,7 @@ HOST_CONFIGURE_ARGS+= \
        --prefix=$(HOST_PYTHON3_DIR) \
        --exec-prefix=$(HOST_PYTHON3_DIR) \
        --with-system-expat=$(STAGING_DIR_HOSTPKG) \
-       --with-system-ffi=$(STAGING_DIR_HOSTPKG) \
+       --with-system-ffi \
        --with-ensurepip=no \
        CONFIG_SITE= \
        CFLAGS="$(HOST_CFLAGS)"
diff --git a/lang/python3/files/python3-host.mk b/lang/python3/files/python3-host.mk
new file mode 100644 (file)
index 0000000..8ff6dd7
--- /dev/null
@@ -0,0 +1,90 @@
+#
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+ifneq ($(__python3_host_mk_inc),1)
+__python3_host_mk_inc=1
+
+# For PYTHON3_VERSION
+$(call include_mk, python3-version.mk)
+
+HOST_PYTHON3_DIR:=$(STAGING_DIR_HOSTPKG)
+HOST_PYTHON3_INC_DIR:=$(HOST_PYTHON3_DIR)/include/python$(PYTHON3_VERSION)
+HOST_PYTHON3_LIB_DIR:=$(HOST_PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)
+
+HOST_PYTHON3_PKG_DIR:=$(HOST_PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)/site-packages
+
+HOST_PYTHON3_BIN:=$(HOST_PYTHON3_DIR)/bin/python$(PYTHON3_VERSION)
+
+HOST_PYTHON3PATH:=$(HOST_PYTHON3_LIB_DIR):$(HOST_PYTHON3_PKG_DIR)
+
+define HostPython3
+       if [ "$(strip $(3))" == "HOST" ]; then \
+               export PYTHONPATH="$(HOST_PYTHON3PATH)"; \
+               export PYTHONDONTWRITEBYTECODE=0; \
+       else \
+               export PYTHONPATH="$(PYTHON3PATH)"; \
+               export PYTHONDONTWRITEBYTECODE=1; \
+               export _python_sysroot="$(STAGING_DIR)"; \
+               export _python_prefix="/usr"; \
+               export _python_exec_prefix="/usr"; \
+       fi; \
+       export PYTHONOPTIMIZE=""; \
+       $(1) \
+       $(HOST_PYTHON3_BIN) $(2);
+endef
+
+# $(1) => commands to execute before running pythons script
+# $(2) => python script and its arguments
+# $(3) => additional variables
+define Build/Compile/HostPy3RunHost
+       $(call HostPython3, \
+               $(if $(1),$(1);) \
+               CC="$(HOSTCC)" \
+               CCSHARED="$(HOSTCC) $(HOST_FPIC)" \
+               CXX="$(HOSTCXX)" \
+               LD="$(HOSTCC)" \
+               LDSHARED="$(HOSTCC) -shared" \
+               CFLAGS="$(HOST_CFLAGS)" \
+               CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON3_INC_DIR)" \
+               LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON3_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \
+               _PYTHON_HOST_PLATFORM=linux2 \
+               $(3) \
+               , \
+               $(2) \
+               , \
+               HOST \
+       )
+endef
+
+
+# $(1) => build subdir
+# $(2) => additional arguments to setup.py
+# $(3) => additional variables
+define Build/Compile/HostPy3Mod
+       $(call Build/Compile/HostPy3RunHost, \
+               cd $(HOST_BUILD_DIR)/$(strip $(1)), \
+               ./setup.py $(2), \
+               $(3))
+endef
+
+define HostPy3/Compile/Default
+       $(call Build/Compile/HostPy3Mod,,\
+               install --root="$(STAGING_DIR_HOSTPKG)" --prefix="" \
+               --single-version-externally-managed \
+       )
+endef
+
+ifeq ($(BUILD_VARIANT),python3)
+define Host/Compile
+       $(call HostPy3/Compile/Default)
+endef
+
+define Host/Install
+endef
+endif # python3
+
+endif # __python3_host_mk_inc
index 7c2fc0d4bb22ad8ffd2b246e11ba5ce33864b604..19d9592d63d26e41f881ad3dbcda316770df3349 100644 (file)
@@ -8,7 +8,7 @@
 define Package/python3-dev
 $(call Package/python3/Default)
   TITLE:=Python $(PYTHON3_VERSION) development files
-  DEPENDS:=+python3
+  DEPENDS:=+python3 +python3-lib2to3
 endef
 
 define Py3Package/python3-dev/install
@@ -22,4 +22,6 @@ $(eval $(call Py3BasePackage,python3-dev, \
     /usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION) \
     /usr/include/python$(PYTHON_VERSION) \
     /usr/lib/pkgconfig \
+       , \
+       DO_NOT_ADD_TO_PACKAGE_DEPENDS \
 ))
index 801fd915aa022f263f685808e29493c2a26b48f7..ed712b6fda8cb541f77aef2d7647995a2674b0c7 100644 (file)
@@ -13,4 +13,6 @@ endef
 
 $(eval $(call Py3BasePackage,python3-lib2to3, \
        /usr/lib/python$(PYTHON3_VERSION)/lib2to3 \
+       , \
+       DO_NOT_ADD_TO_PACKAGE_DEPENDS \
 ))
index 60feaf195f3e2a229c689358b99141f6ab043e70..f13e737aea10bbd86594348b71684d2f9f30a4b7 100644 (file)
@@ -5,17 +5,7 @@
 # See /LICENSE for more information.
 #
 
-# Compatibility fallback for older OpenWrt and LEDE versions
-ifeq ($(STAGING_DIR_HOSTPKG),)
-  $(warning STAGING_DIR_HOSTPKG is unset - falling back to $$(STAGING_DIR)/host)
-  STAGING_DIR_HOSTPKG := $(STAGING_DIR)/host
-endif
-
-PYTHON3_VERSION_MAJOR:=3
-PYTHON3_VERSION_MINOR:=5
-PYTHON3_VERSION_MICRO:=2
-
-PYTHON3_VERSION:=$(PYTHON3_VERSION_MAJOR).$(PYTHON3_VERSION_MINOR)
+$(call include_mk, python3-version.mk)
 
 PYTHON3_DIR:=$(STAGING_DIR)/usr
 PYTHON3_BIN_DIR:=$(PYTHON3_DIR)/bin
@@ -26,22 +16,7 @@ PYTHON3_PKG_DIR:=/usr/lib/python$(PYTHON3_VERSION)/site-packages
 
 PYTHON3:=python$(PYTHON3_VERSION)
 
-HOST_PYTHON3_DIR:=$(STAGING_DIR_HOSTPKG)
-HOST_PYTHON3_LIB_DIR:=$(HOST_PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)
-HOST_PYTHON3_BIN:=$(HOST_PYTHON3_DIR)/bin/python3
-
 PYTHON3PATH:=$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
-define HostPython3
-       (       export PYTHONPATH="$(PYTHON3PATH)"; \
-               export PYTHONOPTIMIZE=""; \
-               export PYTHONDONTWRITEBYTECODE=1; \
-               export _python_sysroot="$(STAGING_DIR)"; \
-               export _python_prefix="/usr"; \
-               export _python_exec_prefix="/usr"; \
-               $(1) \
-               $(HOST_PYTHON3_BIN) $(2); \
-       )
-endef
 
 # These configure args are needed in detection of path to Python header files
 # using autotools.
@@ -66,6 +41,15 @@ define Py3Package
     endef
   endif
 
+  ifndef Py3Package/$(1)/install
+    define Py3Package/$(1)/install
+               if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then \
+                       $(INSTALL_DIR) $$(1)/usr/bin \
+                       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $$(1)/usr/bin/
+               fi
+    endef
+  endif
+
   $(call shexport,Py3Package/$(1)/filespec)
 
   define Package/$(1)/install
@@ -104,15 +88,17 @@ define Py3Package
   endef
 endef
 
-# $(1) => build subdir
-# $(2) => additional arguments to setup.py
+$(call include_mk, python3-host.mk)
+
+# $(1) => commands to execute before running pythons script
+# $(2) => python script and its arguments
 # $(3) => additional variables
-define Build/Compile/Py3Mod
-       $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
+define Build/Compile/HostPy3RunTarget
        $(call HostPython3, \
-               cd $(PKG_BUILD_DIR)/$(strip $(1)); \
+               $(if $(1),$(1);) \
                CC="$(TARGET_CC)" \
                CCSHARED="$(TARGET_CC) $(FPIC)" \
+               CXX="$(TARGET_CXX)" \
                LD="$(TARGET_CC)" \
                LDSHARED="$(TARGET_CC) -shared" \
                CFLAGS="$(TARGET_CFLAGS)" \
@@ -122,8 +108,31 @@ define Build/Compile/Py3Mod
                __PYVENV_LAUNCHER__="/usr/bin/$(PYTHON3)" \
                $(3) \
                , \
-               ./setup.py $(2) \
+               $(2) \
        )
+endef
+
+# $(1) => build subdir
+# $(2) => additional arguments to setup.py
+# $(3) => additional variables
+define Build/Compile/Py3Mod
+       $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
+       $(call Build/Compile/HostPy3RunTarget, \
+               cd $(PKG_BUILD_DIR)/$(strip $(1)), \
+               ./setup.py $(2), \
+               $(3))
        find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" -o -name "*\.exe" | xargs rm -f
 endef
 
+define Py3Build/Compile/Default
+       $(call Build/Compile/Py3Mod,, \
+               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
+               --single-version-externally-managed \
+       )
+endef
+
+ifeq ($(BUILD_VARIANT),python3)
+define Build/Compile
+       $(call Py3Build/Compile/Default)
+endef
+endif # python3
diff --git a/lang/python3/files/python3-version.mk b/lang/python3/files/python3-version.mk
new file mode 100644 (file)
index 0000000..08a130f
--- /dev/null
@@ -0,0 +1,13 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+PYTHON3_VERSION_MAJOR:=3
+PYTHON3_VERSION_MINOR:=6
+PYTHON3_VERSION_MICRO:=0
+
+PYTHON3_VERSION:=$(PYTHON3_VERSION_MAJOR).$(PYTHON3_VERSION_MINOR)
+
diff --git a/lang/python3/patches/011-fix-ncursesw-definition-colisions.patch b/lang/python3/patches/011-fix-ncursesw-definition-colisions.patch
new file mode 100644 (file)
index 0000000..0df72c7
--- /dev/null
@@ -0,0 +1,24 @@
+diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
+index 3bf2ca7..c156964 100644
+--- a/Modules/_cursesmodule.c
++++ b/Modules/_cursesmodule.c
+@@ -116,7 +116,6 @@ char *PyCursesVersion = "2.2";
+     #defines many common symbols (such as "lines") which breaks the
+     curses module in other ways.  So the code will just specify
+     explicit prototypes here. */
+-extern int setupterm(char *,int,int *);
+ #ifdef __sgi
+ #include <term.h>
+ #endif
+diff --git a/setup.py b/setup.py
+index af9a414..ee19ecd 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1349,7 +1349,6 @@ class PyBuildExt(build_ext):
+         panel_library = 'panel'
+         if curses_library == 'ncursesw':
+             curses_defines.append(('HAVE_NCURSESW', '1'))
+-            curses_includes.append('/usr/include/ncursesw')
+             # Bug 1464056: If _curses.so links with ncursesw,
+             # _curses_panel.so must link with panelw.
+             panel_library = 'panelw'
diff --git a/lang/python3/patches/016-adjust-config-paths.patch b/lang/python3/patches/016-adjust-config-paths.patch
new file mode 100644 (file)
index 0000000..fb709b7
--- /dev/null
@@ -0,0 +1,72 @@
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index 8bf1a70..c2708c3 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -424,6 +424,7 @@ def _init_posix():
+         platform=sys.platform,
+         multiarch=getattr(sys.implementation, '_multiarch', ''),
+     ))
++    name = '_sysconfigdata'
+     _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
+     build_time_vars = _temp.build_time_vars
+     global _config_vars
+diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
+index 9314e71..4861261 100644
+--- a/Lib/sysconfig.py
++++ b/Lib/sysconfig.py
+@@ -343,6 +343,7 @@ def get_makefile_filename():
+ def _get_sysconfigdata_name():
++    return '_sysconfigdata'
+     return os.environ.get('_PYTHON_SYSCONFIGDATA_NAME',
+         '_sysconfigdata_{abi}_{platform}_{multiarch}'.format(
+         abi=sys.abiflags,
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index cd7d33d..ad6572f 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1301,7 +1301,7 @@ libinstall:      build_all $(srcdir)/Modules/xxmodule.c
+                       esac; \
+               done; \
+       done
+-      $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py \
++      $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata*.py \
+               $(DESTDIR)$(LIBDEST); \
+       $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
+       if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
+@@ -1436,7 +1436,7 @@ sharedinstall: sharedmods
+               --install-scripts=$(BINDIR) \
+               --install-platlib=$(DESTSHARED) \
+               --root=$(DESTDIR)/
+-      -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py
++      -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata*.py
+       -rm -r $(DESTDIR)$(DESTSHARED)/__pycache__
+ # Here are a couple of targets for MacOSX again, to install a full
+diff --git a/configure b/configure
+index cf95b27..8203fbb 100755
+--- a/configure
++++ b/configure
+@@ -14895,7 +14895,7 @@ LDVERSION='$(VERSION)$(ABIFLAGS)'
+ $as_echo "$LDVERSION" >&6; }
+-if test x$PLATFORM_TRIPLET = x; then
++if true ; then
+   LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
+ else
+   LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
+diff --git a/configure.ac b/configure.ac
+index 1d63813..25f25ed 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4600,7 +4600,7 @@ AC_MSG_RESULT($LDVERSION)
+ dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
+ AC_SUBST(PY_ENABLE_SHARED)
+-if test x$PLATFORM_TRIPLET = x; then
++if true ; then
+   LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
+ else
+   LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
index f6dcd2d28891d9870c798d93e5a86f619b63e02d..adca82f64d22d2a63606e305d24cec71a3ec4d92 100644 (file)
@@ -1,23 +1,25 @@
 #
 # Copyright (C) 2006-2016 OpenWrt.org
+# Copyright (C) 2017 Luiz Angelo Daros de Luca <luizluca@gmail.com>
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
 # To Do:
-#  - dirs not removed when uninstalling!
+#  - dirs not removed when uninstalling! opkg bug?
 #
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ruby
-PKG_VERSION:=2.3.3
+PKG_VERSION:=2.4.1
 PKG_RELEASE:=1
 
-PKG_LIBVER:=2.3
+# First two numbes
+PKG_ABI_VERSION:=$(subst $(space),.,$(wordlist 1, 2, $(subst .,$(space),$(PKG_VERSION))))
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://cache.ruby-lang.org/pub/ruby/$(PKG_LIBVER)/
-PKG_MD5SUM:=882e6146ed26c6e78c02342835f5d46b86de95f0dc4e16543294bc656594cc5b
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://cache.ruby-lang.org/pub/ruby/$(PKG_ABI_VERSION)/
+PKG_HASH:=4fc8a9992de3e90191de369270ea4b6c1b171b7941743614cc50822ddc1fe654
 PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
 PKG_LICENSE:=BSD-2-Clause
 PKG_LICENSE_FILES:=COPYING
@@ -36,7 +38,7 @@ HOST_CONFIGURE_ARGS += \
        --disable-install-rdoc \
        --disable-install-capi \
        --without-gmp \
-       --with-out-ext=tk,tk/tkutil,win32,win32ole,dbm,gdbm,readline \
+       --with-out-ext=-test-/array/resize,-test-/bignum,-test-/bug-3571,-test-/bug-5832,-test-/bug_reporter,-test-/class,-test-/debug,-test-/dln/empty,-test-/exception,-test-/fatal,-test-/file,-test-/float,-test-/funcall,-test-/gvl/call_without_gvl,-test-/hash,-test-/integer,-test-/iseq_load,-test-/iter,-test-/load/dot.dot,-test-/marshal/compat,-test-/marshal/internal_ivar,-test-/marshal/usr,-test-/memory_status,-test-/method,-test-/notimplement,-test-/num2int,-test-/path_to_class,-test-/popen_deadlock,-test-/postponed_job,-test-/printf,-test-/proc,-test-/rational,-test-/recursion,-test-/st/foreach,-test-/st/numhash,-test-/st/update,-test-/string,-test-/struct,-test-/symbol,-test-/time,-test-/tracepoint,-test-/typeddata,-test-/vm,-test-/wait_for_single_fd,-test-/win32/console,-test-/win32/dln,-test-/win32/fd_setsize,bigdecimal,cgi/escape,continuation,coverage,dbm,etc,fcntl,fiber,fiddle,gdbm,io/console,io/nonblock,io/wait,json,json/generator,json/parser,mathn/complex,mathn/rational,nkf,objspace,openssl,pathname,pty,racc/cparse,rbconfig/sizeof,readline,ripper,rubyvm,sdbm,socket,syslog,win32,win32ole,win32/resolv,zlib
 
 # Does not compile with this. Workaround is --without-gmp
 # https://bugs.ruby-lang.org/issues/11940
@@ -57,7 +59,7 @@ CONFIGURE_ARGS += \
        --disable-install-capi \
        --with-ruby-version=minor \
        --with-iconv-dir=$(ICONV_PREFIX) \
-       --with-out-ext=tk,tk/tkutil,win32,win32ole
+       --with-out-ext=win32,win32ole
 
 ifndef CONFIG_RUBY_DIGEST_USE_OPENSSL
 CONFIGURE_ARGS += \
@@ -73,7 +75,7 @@ TARGET_LDFLAGS += -L$(PKG_BUILD_DIR)
 # Ruby uses DLDFLAGS and not LDFLAGS for libraries. LDFLAGS is only for execs.
 # However, DLDFLAGS from configure is not passed to Makefile when target is linux.
 # XLDFLAGS is used by both libraries and execs. This is somehow brute force but
-# if will fix when some LD_FLAGS is needef for libraries. As side effect, it will
+# it will fix when some LD_FLAGS is needed for libraries. As side effect, it will
 # duplicate ld args for binaries.
 CONFIGURE_VARS += XLDFLAGS="$(TARGET_LDFLAGS)"
 
@@ -90,7 +92,7 @@ endef
 define Host/Install
        # When ruby version is updated, make install asks in some cases before replace
        # an existing different file. Remove them before install and avoid the interaction
-       rm -f $(HOST_BUILD_PREFIX)/bin/rake
+       rm -f $(STAGING_DIR_HOSTPKG)/bin/rake
        $(call Host/Install/Default)
 endef
 
@@ -155,15 +157,15 @@ endef
 
 define Package/ruby/install
        $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
-       $(INSTALL_DIR) $(1)/usr/lib/ruby/vendor_ruby/$(PKG_LIBVER)
-       $(INSTALL_DIR) $(1)/usr/lib/ruby/site_ruby/$(PKG_LIBVER)
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ruby $(1)/usr/lib/ruby/ruby$(PKG_LIBVER)-bin
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_ABI_VERSION)
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/vendor_ruby/$(PKG_ABI_VERSION)
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/site_ruby/$(PKG_ABI_VERSION)
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ruby $(1)/usr/lib/ruby/ruby$(PKG_ABI_VERSION)-bin
        $(INSTALL_BIN) ./files/ruby $(1)/usr/bin/ruby
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/vendor_ruby/$(PKG_LIBVER)/* $(1)/usr/lib/ruby/vendor_ruby/$(PKG_LIBVER)/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/site_ruby/$(PKG_LIBVER)/* $(1)/usr/lib/ruby/site_ruby/$(PKG_LIBVER)/
-       $(SED) "s%@RUBY_LIBPATH@%/usr/lib/ruby/$(PKG_LIBVER)%" $(1)/usr/bin/ruby
-       $(SED) "s%@RUBY_BINPATH@%/usr/lib/ruby/ruby$(PKG_LIBVER)-bin%" $(1)/usr/bin/ruby
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/vendor_ruby/$(PKG_ABI_VERSION)/* $(1)/usr/lib/ruby/vendor_ruby/$(PKG_ABI_VERSION)/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/site_ruby/$(PKG_ABI_VERSION)/* $(1)/usr/lib/ruby/site_ruby/$(PKG_ABI_VERSION)/
+       $(SED) "s%@RUBY_LIBPATH@%/usr/lib/ruby/$(PKG_ABI_VERSION)%" $(1)/usr/bin/ruby
+       $(SED) "s%@RUBY_BINPATH@%/usr/lib/ruby/ruby$(PKG_ABI_VERSION)-bin%" $(1)/usr/bin/ruby
 endef
 
 define Package/libruby
@@ -173,7 +175,7 @@ $(call Package/ruby/Default)
   CATEGORY:=Libraries
   TITLE+= (shared library)
   DEPENDS+= +libpthread +librt +libgmp
-  ABI_VERSION:=$(PKG_LIBVER)
+  ABI_VERSION:=$(PKG_ABI_VERSION)
 endef
 define Package/libruby/install
        $(INSTALL_DIR) $(1)/usr/lib
@@ -200,25 +202,25 @@ define Package/ruby-stdlib/install
 endef
 
 define Package/ruby-bigdecimal/files
-/usr/lib/ruby/$(PKG_LIBVER)/*/bigdecimal.so
-/usr/lib/ruby/$(PKG_LIBVER)/bigdecimal/
-/usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/bigdecimal-*.gemspec
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/bigdecimal.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/bigdecimal/
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/bigdecimal-*.gemspec
 endef
 
 define Package/ruby-cgi/files
-/usr/lib/ruby/$(PKG_LIBVER)/cgi
-/usr/lib/ruby/$(PKG_LIBVER)/cgi.rb
-/usr/lib/ruby/$(PKG_LIBVER)/*/cgi/escape.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/cgi
+/usr/lib/ruby/$(PKG_ABI_VERSION)/cgi.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/cgi/escape.so
 endef
 
 define Package/ruby-csv/files
-/usr/lib/ruby/$(PKG_LIBVER)/csv.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/csv.rb
 endef
 
 define Package/ruby-datetime/files
-/usr/lib/ruby/$(PKG_LIBVER)/time.rb
-/usr/lib/ruby/$(PKG_LIBVER)/date.rb
-/usr/lib/ruby/$(PKG_LIBVER)/*/date_core.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/time.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/date.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/date_core.so
 endef
 
 define Package/ruby-dbm/description
@@ -227,28 +229,28 @@ define Package/ruby-dbm/description
 
 endef
 define Package/ruby-dbm/files
-/usr/lib/ruby/$(PKG_LIBVER)/*/dbm.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/dbm.so
 endef
 
 define Package/ruby-debuglib/files
-/usr/lib/ruby/$(PKG_LIBVER)/profile.rb
-/usr/lib/ruby/$(PKG_LIBVER)/profiler.rb
-/usr/lib/ruby/$(PKG_LIBVER)/debug.rb
-/usr/lib/ruby/$(PKG_LIBVER)/tracer.rb
-/usr/lib/ruby/$(PKG_LIBVER)/benchmark.rb
-/usr/lib/ruby/$(PKG_LIBVER)/*/objspace.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/profile.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/profiler.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/debug.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/tracer.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/benchmark.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/objspace.so
 endef
 
 define Package/ruby-did-you-mean/files
-/usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/did_you_mean-*.gemspec
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/did_you_mean-*.gemspec
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/did_you_mean-*/
 endef
 define Package/ruby-did-you-mean/files-excluded
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/benchmark
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/doc
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/evaluation
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/test
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/*.md
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/did_you_mean-*/benchmark
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/did_you_mean-*/doc
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/did_you_mean-*/evaluation
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/did_you_mean-*/test
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/did_you_mean-*/*.md
 endef
 
 define Package/ruby-digest/description
@@ -270,26 +272,26 @@ define Package/ruby-digest/config
 
 endef
 define Package/ruby-digest/files
-/usr/lib/ruby/$(PKG_LIBVER)/digest
-/usr/lib/ruby/$(PKG_LIBVER)/digest.rb
-/usr/lib/ruby/$(PKG_LIBVER)/*/digest.so
-/usr/lib/ruby/$(PKG_LIBVER)/*/digest/*
+/usr/lib/ruby/$(PKG_ABI_VERSION)/digest
+/usr/lib/ruby/$(PKG_ABI_VERSION)/digest.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/digest.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/digest/*
 endef
 
 define Package/ruby-drb/files
-/usr/lib/ruby/$(PKG_LIBVER)/drb.rb
-/usr/lib/ruby/$(PKG_LIBVER)/drb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/drb.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/drb
 endef
 
 define Package/ruby-enc/files
-/usr/lib/ruby/$(PKG_LIBVER)/*/enc/encdb.so
-/usr/lib/ruby/$(PKG_LIBVER)/*/enc/iso_8859_1.so
-/usr/lib/ruby/$(PKG_LIBVER)/*/enc/utf_*.so
-/usr/lib/ruby/$(PKG_LIBVER)/*/enc/euc_jp.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/enc/encdb.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/enc/iso_8859_1.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/enc/utf_*.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/enc/euc_jp.so
 endef
 
 define Package/ruby-enc-extra/files
-/usr/lib/ruby/$(PKG_LIBVER)/*/enc
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/enc
 endef
 define Package/ruby-enc-extra/files-excluded
 $(call Package/ruby-enc/files)
@@ -297,59 +299,59 @@ endef
 
 define Package/ruby-erb/files
 /usr/bin/erb
-/usr/lib/ruby/$(PKG_LIBVER)/erb.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/erb.rb
 endef
 
 define Package/ruby-fiddle/files
-/usr/lib/ruby/$(PKG_LIBVER)/fiddle.rb
-/usr/lib/ruby/$(PKG_LIBVER)/fiddle/
-/usr/lib/ruby/$(PKG_LIBVER)/*/fiddle.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/fiddle.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/fiddle/
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/fiddle.so
 endef
 
 define Package/ruby-filelib/files
-/usr/lib/ruby/$(PKG_LIBVER)/tmpdir.rb
-/usr/lib/ruby/$(PKG_LIBVER)/tempfile.rb
-/usr/lib/ruby/$(PKG_LIBVER)/pathname.rb
-/usr/lib/ruby/$(PKG_LIBVER)/*/pathname.so
-/usr/lib/ruby/$(PKG_LIBVER)/find.rb
-/usr/lib/ruby/$(PKG_LIBVER)/fileutils.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/tmpdir.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/tempfile.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/pathname.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/pathname.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/find.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/fileutils.rb
 endef
 
 define Package/ruby-gdbm/files
-/usr/lib/ruby/$(PKG_LIBVER)/*/gdbm.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/gdbm.so
 endef
 
 define Package/ruby-gems/files
-/usr/lib/ruby/$(PKG_LIBVER)/ubygems.rb
-/usr/lib/ruby/$(PKG_LIBVER)/rubygems.rb
-/usr/lib/ruby/$(PKG_LIBVER)/rubygems
+/usr/lib/ruby/$(PKG_ABI_VERSION)/ubygems.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rubygems.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rubygems
 endef
 define Package/ruby-gems/files-excluded
-/usr/lib/ruby/$(PKG_LIBVER)/rubygems/test_case.rb
-/usr/lib/ruby/$(PKG_LIBVER)/rubygems/package/tar_test_case.rb
-/usr/lib/ruby/$(PKG_LIBVER)/rubygems/installer_test_case.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rubygems/test_case.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rubygems/package/tar_test_case.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rubygems/installer_test_case.rb
 endef
 define Package/ruby-gems/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gem $(1)/usr/bin/
-       $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default
-       $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/gems
-       $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/doc
-       $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/cache
-       $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/extensions
-       $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/build_info
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/doc
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/cache
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/extensions
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/build_info
        $(call RubyBuildPackage/install,gems,$(1))
 endef
 
 define Package/ruby-io-console/files
-/usr/lib/ruby/$(PKG_LIBVER)/*/io/console.so
-/usr/lib/ruby/$(PKG_LIBVER)/io/console/
-/usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/io-console-*.gemspec
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/io/console.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/io/console/
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/io-console-*.gemspec
 endef
 
 define Package/ruby-irb/files
-/usr/lib/ruby/$(PKG_LIBVER)/irb
-/usr/lib/ruby/$(PKG_LIBVER)/irb.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/irb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/irb.rb
 endef
 define Package/ruby-irb/install
        $(INSTALL_DIR) $(1)/usr/bin
@@ -358,159 +360,156 @@ define Package/ruby-irb/install
 endef
 
 define Package/ruby-json/files
-/usr/lib/ruby/$(PKG_LIBVER)/json.rb
-/usr/lib/ruby/$(PKG_LIBVER)/json
-/usr/lib/ruby/$(PKG_LIBVER)/*/json
-/usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/json-*.gemspec
+/usr/lib/ruby/$(PKG_ABI_VERSION)/json.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/json
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/json
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/json-*.gemspec
 endef
 define Package/ruby-json/files-excluded
 $(call Package/ruby-psych/files)
 endef
 
 define Package/ruby-logger/files
-/usr/lib/ruby/$(PKG_LIBVER)/logger.rb
-/usr/lib/ruby/$(PKG_LIBVER)/syslog/logger.rb
-/usr/lib/ruby/$(PKG_LIBVER)/*/syslog.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/logger.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/syslog/logger.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/syslog.so
 endef
 
 define Package/ruby-math/files
-/usr/lib/ruby/$(PKG_LIBVER)/prime.rb
-/usr/lib/ruby/$(PKG_LIBVER)/mathn.rb
-/usr/lib/ruby/$(PKG_LIBVER)/cmath.rb
-/usr/lib/ruby/$(PKG_LIBVER)/*/mathn
-/usr/lib/ruby/$(PKG_LIBVER)/matrix.rb
-/usr/lib/ruby/$(PKG_LIBVER)/matrix
+/usr/lib/ruby/$(PKG_ABI_VERSION)/prime.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/mathn.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/cmath.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/mathn
+/usr/lib/ruby/$(PKG_ABI_VERSION)/matrix.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/matrix
 endef
 
 define Package/ruby-minitest/files
-/usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/minitest-*.gemspec
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/minitest-*
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/minitest-*.gemspec
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/minitest-*
 endef
 define Package/ruby-minitest/files-excluded
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/minitest-*/test
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/minitest-*/*.rdoc
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/minitest-*/*.txt
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/minitest-*/test
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/minitest-*/*.rdoc
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/minitest-*/*.txt
 endef
 
 define Package/ruby-misc/files
-/usr/lib/ruby/$(PKG_LIBVER)/English.rb
-/usr/lib/ruby/$(PKG_LIBVER)/abbrev.rb
-/usr/lib/ruby/$(PKG_LIBVER)/base64.rb
-/usr/lib/ruby/$(PKG_LIBVER)/delegate.rb
-/usr/lib/ruby/$(PKG_LIBVER)/e2mmap.rb
-/usr/lib/ruby/$(PKG_LIBVER)/expect.rb
-/usr/lib/ruby/$(PKG_LIBVER)/getoptlong.rb
-/usr/lib/ruby/$(PKG_LIBVER)/open3.rb
-/usr/lib/ruby/$(PKG_LIBVER)/ostruct.rb
-/usr/lib/ruby/$(PKG_LIBVER)/scanf.rb
-/usr/lib/ruby/$(PKG_LIBVER)/securerandom.rb
-/usr/lib/ruby/$(PKG_LIBVER)/set.rb
-/usr/lib/ruby/$(PKG_LIBVER)/shellwords.rb
-/usr/lib/ruby/$(PKG_LIBVER)/tsort.rb
-/usr/lib/ruby/$(PKG_LIBVER)/weakref.rb
-/usr/lib/ruby/$(PKG_LIBVER)/*/continuation.so
-/usr/lib/ruby/$(PKG_LIBVER)/*/coverage.so
-/usr/lib/ruby/$(PKG_LIBVER)/*/etc.so
-/usr/lib/ruby/$(PKG_LIBVER)/*/fcntl.so
-/usr/lib/ruby/$(PKG_LIBVER)/*/fiber.so
-/usr/lib/ruby/$(PKG_LIBVER)/*/pty.so
-/usr/lib/ruby/$(PKG_LIBVER)/*/stringio.so
-/usr/lib/ruby/$(PKG_LIBVER)/*/strscan.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/English.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/abbrev.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/base64.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/delegate.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/e2mmap.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/expect.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/getoptlong.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/open3.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/ostruct.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/scanf.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/securerandom.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/set.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/shellwords.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/tsort.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/weakref.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/continuation.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/coverage.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/etc.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/fcntl.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/fiber.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/pty.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/stringio.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/strscan.so
 endef
 
 define Package/ruby-mkmf/files
-/usr/lib/ruby/$(PKG_LIBVER)/mkmf.rb
-/usr/lib/ruby/$(PKG_LIBVER)/un.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/mkmf.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/un.rb
 endef
 
 define Package/ruby-multithread/files
-/usr/lib/ruby/$(PKG_LIBVER)/monitor.rb
-/usr/lib/ruby/$(PKG_LIBVER)/timeout.rb
-/usr/lib/ruby/$(PKG_LIBVER)/thwait.rb
-/usr/lib/ruby/$(PKG_LIBVER)/mutex_m.rb
-/usr/lib/ruby/$(PKG_LIBVER)/sync.rb
-/usr/lib/ruby/$(PKG_LIBVER)/*/thread.so
-/usr/lib/ruby/$(PKG_LIBVER)/*/io/wait.so
-/usr/lib/ruby/$(PKG_LIBVER)/*/io/nonblock.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/monitor.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/timeout.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/thwait.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/mutex_m.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/sync.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/io/wait.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/io/nonblock.so
 endef
 
 define Package/ruby-net/files
-/usr/lib/ruby/$(PKG_LIBVER)/open-uri.rb
-/usr/lib/ruby/$(PKG_LIBVER)/net/*
+/usr/lib/ruby/$(PKG_ABI_VERSION)/open-uri.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/net/*
 endef
 
 define Package/ruby-net-telnet/files
-/usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/net-telnet-*.gemspec
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/net-telnet-*/
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/net-telnet-*.gemspec
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/net-telnet-*/
 endef
 define Package/ruby-net-telnet/files-excluded
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/net-telnet-*/*.md
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/net-telnet-*/*.txt
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/net-telnet-*/*.md
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/net-telnet-*/*.txt
 endef
 
 define Package/ruby-nkf/files
-/usr/lib/ruby/$(PKG_LIBVER)/kconv.rb
-/usr/lib/ruby/$(PKG_LIBVER)/*/nkf.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/kconv.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/nkf.so
 endef
 
 define Package/ruby-openssl/files
-/usr/lib/ruby/$(PKG_LIBVER)/openssl
-/usr/lib/ruby/$(PKG_LIBVER)/openssl.rb
-/usr/lib/ruby/$(PKG_LIBVER)/*/openssl.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/openssl
+/usr/lib/ruby/$(PKG_ABI_VERSION)/openssl.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/openssl.so
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/openssl-*.gemspec
 endef
 
 define Package/ruby-optparse/files
-/usr/lib/ruby/$(PKG_LIBVER)/optparse.rb
-/usr/lib/ruby/$(PKG_LIBVER)/optionparser.rb
-/usr/lib/ruby/$(PKG_LIBVER)/optparse
+/usr/lib/ruby/$(PKG_ABI_VERSION)/optparse.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/optionparser.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/optparse
 endef
 
 define Package/ruby-patterns/files
-/usr/lib/ruby/$(PKG_LIBVER)/observer.rb
-/usr/lib/ruby/$(PKG_LIBVER)/singleton.rb
-/usr/lib/ruby/$(PKG_LIBVER)/forwardable.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/observer.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/singleton.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/forwardable.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/forwardable
 endef
 
 define Package/ruby-powerassert/files
-/usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/power_assert-*.gemspec
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/power_assert-*
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/power_assert-*.gemspec
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/power_assert-*
 endef
 define Package/ruby-powerassert/files-excluded
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/power_assert-*/test
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/power_assert-*/test
 endef
 
 define Package/ruby-prettyprint/files
-/usr/lib/ruby/$(PKG_LIBVER)/pp.rb
-/usr/lib/ruby/$(PKG_LIBVER)/prettyprint.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/pp.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/prettyprint.rb
 endef
 
 define Package/ruby-pstore/files
-/usr/lib/ruby/$(PKG_LIBVER)/pstore.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/pstore.rb
 endef
 
 define Package/ruby-psych/files
-/usr/lib/ruby/$(PKG_LIBVER)/psych
-/usr/lib/ruby/$(PKG_LIBVER)/psych.rb
-/usr/lib/ruby/$(PKG_LIBVER)/psych_jars.rb
-/usr/lib/ruby/$(PKG_LIBVER)/*/psych.so
-/usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/psych-*.gemspec
+/usr/lib/ruby/$(PKG_ABI_VERSION)/psych
+/usr/lib/ruby/$(PKG_ABI_VERSION)/psych.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/psych.so
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/psych-*.gemspec
 endef
 
 define Package/ruby-racc/files
-/usr/lib/ruby/$(PKG_LIBVER)/racc
-/usr/lib/ruby/$(PKG_LIBVER)/*/racc/*.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/racc
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/racc/*.so
 endef
 
 define Package/ruby-rake/files
-/usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/rake-*.gemspec
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-*/
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/rake-*.gemspec
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/rake-*/
 endef
 define Package/ruby-rake/files-excluded
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-*/doc
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-*/test
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-*/*.rdoc
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-*/*.txt
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-10.4.2/lib/rake/runtest.rb
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/rake-*/doc
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/rake-*/*.rdoc
 endef
 define Package/ruby-rake/install
        $(INSTALL_DIR) $(1)/usr/bin
@@ -519,21 +518,21 @@ define Package/ruby-rake/install
 endef
 
 define Package/ruby-rbconfig/files
-/usr/lib/ruby/$(PKG_LIBVER)/*/rbconfig.rb
-/usr/lib/ruby/$(PKG_LIBVER)/rbconfig/*
-/usr/lib/ruby/$(PKG_LIBVER)/*/rbconfig/*.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/rbconfig.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rbconfig/*
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/rbconfig/*.so
 endef
 
 define Package/ruby-rdoc/files
-       /usr/lib/ruby/$(PKG_LIBVER)/rdoc.rb
-       /usr/lib/ruby/$(PKG_LIBVER)/rdoc
-       /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rdoc-*
-       /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/rdoc-*.gemspec
+       /usr/lib/ruby/$(PKG_ABI_VERSION)/rdoc.rb
+       /usr/lib/ruby/$(PKG_ABI_VERSION)/rdoc
+       /usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/rdoc-*
+       /usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/default/rdoc-*.gemspec
 endef
 define Package/ruby-rdoc/files-excluded
-       /usr/lib/ruby/$(PKG_LIBVER)/rdoc/test_case.rb
-       /usr/lib/ruby/$(PKG_LIBVER)/rdoc/markup/formatter_test_case.rb
-       /usr/lib/ruby/$(PKG_LIBVER)/rdoc/markup/text_formatter_test_case.rb
+       /usr/lib/ruby/$(PKG_ABI_VERSION)/rdoc/test_case.rb
+       /usr/lib/ruby/$(PKG_ABI_VERSION)/rdoc/markup/formatter_test_case.rb
+       /usr/lib/ruby/$(PKG_ABI_VERSION)/rdoc/markup/text_formatter_test_case.rb
 endef
 define Package/ruby-rdoc/install
        $(INSTALL_DIR) $(1)/usr/bin
@@ -543,83 +542,87 @@ define Package/ruby-rdoc/install
 endef
 
 define Package/ruby-readline/files
-/usr/lib/ruby/$(PKG_LIBVER)/*/readline.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/readline.so
 endef
 
 define Package/ruby-rexml/files
-/usr/lib/ruby/$(PKG_LIBVER)/rexml
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rexml
 endef
 
 define Package/ruby-rinda/files
-/usr/lib/ruby/$(PKG_LIBVER)/rinda
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rinda
 endef
 
 define Package/ruby-ripper/files
-/usr/lib/ruby/$(PKG_LIBVER)/ripper.rb
-/usr/lib/ruby/$(PKG_LIBVER)/ripper
-/usr/lib/ruby/$(PKG_LIBVER)/*/ripper.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/ripper.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/ripper
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/ripper.so
 endef
 
 define Package/ruby-rss/files
-/usr/lib/ruby/$(PKG_LIBVER)/rss
-/usr/lib/ruby/$(PKG_LIBVER)/rss.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rss
+/usr/lib/ruby/$(PKG_ABI_VERSION)/rss.rb
 endef
 
 define Package/ruby-sdbm/files
-/usr/lib/ruby/$(PKG_LIBVER)/*/sdbm.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/sdbm.so
 endef
 
 define Package/ruby-shell/files
-/usr/lib/ruby/$(PKG_LIBVER)/shell.rb
-/usr/lib/ruby/$(PKG_LIBVER)/shell
+/usr/lib/ruby/$(PKG_ABI_VERSION)/shell.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/shell
 endef
 
 define Package/ruby-socket/files
-/usr/lib/ruby/$(PKG_LIBVER)/ipaddr.rb
-/usr/lib/ruby/$(PKG_LIBVER)/resolv-replace.rb
-/usr/lib/ruby/$(PKG_LIBVER)/resolv.rb
-/usr/lib/ruby/$(PKG_LIBVER)/socket.rb
-/usr/lib/ruby/$(PKG_LIBVER)/*/socket.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/ipaddr.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/resolv-replace.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/resolv.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/socket.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/socket.so
 endef
 
 define Package/ruby-testunit/files
-/usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/test-unit-*.gemspec
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/test-unit-*.gemspec
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/test-unit-*
 endef
 define Package/ruby-testunit/files-excluded
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*/doc
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*/test
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*/sample
-/usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*/*.md
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/test-unit-*/doc
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/test-unit-*/test
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/test-unit-*/sample
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/test-unit-*/*.md
 endef
 
 define Package/ruby-unicodenormalize/files
-/usr/lib/ruby/$(PKG_LIBVER)/unicode_normalize.rb
-/usr/lib/ruby/$(PKG_LIBVER)/unicode_normalize
+/usr/lib/ruby/$(PKG_ABI_VERSION)/unicode_normalize.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/unicode_normalize
 endef
 
 define Package/ruby-uri/files
-/usr/lib/ruby/$(PKG_LIBVER)/uri.rb
-/usr/lib/ruby/$(PKG_LIBVER)/uri
+/usr/lib/ruby/$(PKG_ABI_VERSION)/uri.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/uri
 endef
 
 define Package/ruby-webrick/files
-/usr/lib/ruby/$(PKG_LIBVER)/webrick
-/usr/lib/ruby/$(PKG_LIBVER)/webrick.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/webrick
+/usr/lib/ruby/$(PKG_ABI_VERSION)/webrick.rb
 endef
 
 define Package/ruby-xmlrpc/files
-/usr/lib/ruby/$(PKG_LIBVER)/xmlrpc
-/usr/lib/ruby/$(PKG_LIBVER)/xmlrpc.rb
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/xmlrpc-*
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/specifications/xmlrpc-*.gemspec
+endef
+define Package/ruby-xmlrpc/files-excluded
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/xmlrpc-0.2.1/*.md
+/usr/lib/ruby/gems/$(PKG_ABI_VERSION)/gems/xmlrpc-0.2.1/*.txt
 endef
 
 define Package/ruby-yaml/files
-/usr/lib/ruby/$(PKG_LIBVER)/yaml
-/usr/lib/ruby/$(PKG_LIBVER)/yaml.rb
+/usr/lib/ruby/$(PKG_ABI_VERSION)/yaml
+/usr/lib/ruby/$(PKG_ABI_VERSION)/yaml.rb
 endef
 
 define Package/ruby-zlib/files
-/usr/lib/ruby/$(PKG_LIBVER)/*/zlib.so
+/usr/lib/ruby/$(PKG_ABI_VERSION)/*/zlib.so
 endef
 
 RUBY_FILES = $(strip $(call Package/ruby-$(1)/files))
@@ -690,14 +693,14 @@ $(patsubst /%,
   $$(eval $$(call BuildPackage,ruby-$(1)))
 endef
 
-$(eval $(call BuildPackage,ruby))
 $(eval $(call BuildPackage,libruby))
+$(eval $(call BuildPackage,ruby))
 $(eval $(call RubyBuildPackage,bigdecimal,Arbitrary-precision decimal floating-point library,))
 $(eval $(call RubyBuildPackage,cgi,CGI support toolkit,+ruby-filelib +ruby-pstore))
-$(eval $(call RubyBuildPackage,csv,CSV library,+ruby-patterns +ruby-datetime +ruby-enc))
+$(eval $(call RubyBuildPackage,csv,CSV library,+ruby-patterns +ruby-datetime +ruby-enc +ruby-misc))
 $(eval $(call RubyBuildPackage,datetime,date library))
 $(eval $(call RubyBuildPackage,dbm,support for dbm,+libdb47))
-$(eval $(call RubyBuildPackage,debuglib,debug library,+ruby-multithread +ruby-prettyprint))
+$(eval $(call RubyBuildPackage,debuglib,debug library,+ruby-prettyprint))
 $(eval $(call RubyBuildPackage,did-you-mean,did you mean? experience,+ruby-misc))
 $(eval $(call RubyBuildPackage,digest,Digest Library,+RUBY_DIGEST_USE_OPENSSL:libopenssl))
 $(eval $(call RubyBuildPackage,drb,distributed object system,+ruby-filelib +ruby-patterns +ruby-socket))
@@ -712,7 +715,7 @@ $(eval $(call RubyBuildPackage,io-console,Console interface,))
 $(eval $(call RubyBuildPackage,irb,(interactive shell),+ruby-debuglib +ruby-filelib +ruby-math))
 $(eval $(call RubyBuildPackage,json,support for JSON,+ruby-datetime +ruby-misc))
 $(eval $(call RubyBuildPackage,logger,logger and syslog library,+ruby-multithread))
-$(eval $(call RubyBuildPackage,math,math library,+ruby-patterns))
+$(eval $(call RubyBuildPackage,math,math library,+ruby-patterns +ruby-misc))
 $(eval $(call RubyBuildPackage,minitest,Gem minitest,+ruby-gems))
 $(eval $(call RubyBuildPackage,misc,standard libraries subset (miscellaneous files),))
 $(eval $(call RubyBuildPackage,mkmf,makefile library,+ruby-filelib +ruby-optparse +ruby-rbconfig))
@@ -722,24 +725,24 @@ $(eval $(call RubyBuildPackage,net-telnet,telnet client,+ruby-net))
 $(eval $(call RubyBuildPackage,nkf,Network Kanji Filter,+ruby-enc))
 $(eval $(call RubyBuildPackage,openssl,support for openssl,+ruby-enc +ruby-multithread +libopenssl))
 $(eval $(call RubyBuildPackage,optparse,command-line option analysis,+ruby-misc))
-$(eval $(call RubyBuildPackage,patterns,design patterns implementation,+ruby-multithread))
-$(eval $(call RubyBuildPackage,powerassert,Gem power_assert,+ruby-ripper))
+$(eval $(call RubyBuildPackage,patterns,design patterns implementation,))
+$(eval $(call RubyBuildPackage,powerassert,Gem power_assert,+ruby-ripper +ruby-debuglib))
 $(eval $(call RubyBuildPackage,prettyprint,PrettyPrint library,+ruby-misc))
 $(eval $(call RubyBuildPackage,pstore,file based persistence,+ruby-digest +ruby-enc))
 $(eval $(call RubyBuildPackage,psych,YAML parser and emitter,+ruby-bigdecimal +ruby-datetime +ruby-misc +ruby-enc +libyaml))
 $(eval $(call RubyBuildPackage,racc,LALR parser generator,))
-$(eval $(call RubyBuildPackage,rake,Rake (make replacement),+ruby-datetime +ruby-filelib +ruby-optparse +ruby-patterns +ruby-rbconfig))
+$(eval $(call RubyBuildPackage,rake,Rake (make replacement),+ruby-filelib +ruby-optparse +ruby-patterns +ruby-rbconfig +ruby-multithread))
 $(eval $(call RubyBuildPackage,rbconfig,RbConfig,))
 $(eval $(call RubyBuildPackage,rdoc,documentation generator,+ruby-erb +ruby-irb +ruby-json +ruby-racc +ruby-rake +ruby-yaml +ruby-zlib))
 $(eval $(call RubyBuildPackage,readline,support for readline,+libncurses +libreadline))
-$(eval $(call RubyBuildPackage,rexml,XML toolkit,+ruby-patterns +ruby-enc))
+$(eval $(call RubyBuildPackage,rexml,XML toolkit,+ruby-patterns +ruby-enc +ruby-misc))
 $(eval $(call RubyBuildPackage,rinda,Linda paradigm implementation,+ruby-drb))
 $(eval $(call RubyBuildPackage,ripper,script parser,))
 $(eval $(call RubyBuildPackage,rss,RSS toolkit,+ruby-net +ruby-nkf +ruby-rexml))
 $(eval $(call RubyBuildPackage,sdbm,simple file-based key-value dbm implementation,))
-$(eval $(call RubyBuildPackage,shell,idiomatic Ruby interface,+ruby-patterns))
+$(eval $(call RubyBuildPackage,shell,idiomatic Ruby interface,+ruby-patterns +ruby-multithread))
 $(eval $(call RubyBuildPackage,socket,socket support,+ruby-multithread))
-$(eval $(call RubyBuildPackage,testunit,Gem test-unit,+ruby-csv +ruby-erb +ruby-optparse +ruby-powerassert +ruby-prettyprint +ruby-rexml +ruby-yaml))
+$(eval $(call RubyBuildPackage,testunit,Gem test-unit,+ruby-csv +ruby-erb +ruby-optparse +ruby-powerassert +ruby-rexml +ruby-yaml))
 $(eval $(call RubyBuildPackage,unicodenormalize,String additions for Unicode normalization,+ruby-enc +ruby-enc-extra))
 $(eval $(call RubyBuildPackage,uri,library to handle URI,+ruby-socket +ruby-enc))
 $(eval $(call RubyBuildPackage,webrick,Web server toolkit,+ruby-erb +ruby-net +ruby-patterns +ruby-rbconfig))
diff --git a/lang/ruby/patches/001-acinclude.m4_rename_aclocal.m4.patch b/lang/ruby/patches/001-acinclude.m4_rename_aclocal.m4.patch
deleted file mode 100644 (file)
index 271bd71..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/53414
-
-Fixes:
-
-https://bugs.ruby-lang.org/issues/11941
-
-It might be incorporated in the following release
-
-Index: aclocal.m4
-===================================================================
---- a/aclocal.m4       (revision 53413)
-+++ b/aclocal.m4       (revision 53414)
-@@ -1,46 +0,0 @@
--# -*- autoconf -*-
--
--AC_DEFUN([_COLORIZE_RESULT_PREPARE], [
--    msg_checking= msg_result_yes= msg_result_no= msg_result_other= msg_reset=
--    AS_IF([test "x${CONFIGURE_TTY}" = xyes -o -t 1], [
--      msg_begin="`tput smso 2>/dev/null`"
--      AS_CASE(["$msg_begin"], ['\e@<:@'*m],
--          [msg_begin="`echo "$msg_begin" | sed ['s/[0-9]*m$//']`"
--          msg_checking="${msg_begin}33m"
--          AS_IF([test ${TEST_COLORS:+set}], [
--              msg_result_yes=[`expr ":$TEST_COLORS:" : ".*:pass=\([^:]*\):"`]
--              msg_result_no=[`expr ":$TEST_COLORS:" : ".*:fail=\([^:]*\):"`]
--              msg_result_other=[`expr ":$TEST_COLORS:" : ".*:skip=\([^:]*\):"`]
--          ])
--          msg_result_yes="${msg_begin}${msg_result_yes:-32;1}m"
--          msg_result_no="${msg_begin}${msg_result_no:-31;1}m"
--          msg_result_other="${msg_begin}${msg_result_other:-33;1}m"
--          msg_reset="${msg_begin}m"
--          ])
--      AS_UNSET(msg_begin)
--      ])
--    AS_REQUIRE_SHELL_FN([colorize_result],
--      [AS_FUNCTION_DESCRIBE([colorize_result], [MSG], [Colorize result])],
--        [AS_CASE(["$[]1"],
--            [yes], [AS_ECHO(["${msg_result_yes}$[]1${msg_reset}]")],
--            [no], [AS_ECHO(["${msg_result_no}$[]1${msg_reset}]")],
--            [AS_ECHO(["${msg_result_other}$[]1${msg_reset}]")])])
--])
--
--AC_DEFUN([COLORIZE_RESULT], [AC_REQUIRE([_COLORIZE_RESULT_PREPARE])dnl
--    AS_LITERAL_IF([$1],
--      [m4_case([$1],
--              [yes], [AS_ECHO(["${msg_result_yes}$1${msg_reset}"])],
--              [no], [AS_ECHO(["${msg_result_no}$1${msg_reset}"])],
--              [AS_ECHO(["${msg_result_other}$1${msg_reset}"])])],
--      [colorize_result "$1"]) dnl
--])
--
--AC_DEFUN([AC_CHECKING],[dnl
--AC_REQUIRE([_COLORIZE_RESULT_PREPARE])dnl
--AS_MESSAGE([checking ${msg_checking}$1${msg_reset}...])])
--
--AC_DEFUN([AC_MSG_RESULT], [dnl
--{ _AS_ECHO_LOG([result: $1])
--COLORIZE_RESULT([$1]); dnl
--}])
-Index: acinclude.m4
-===================================================================
---- a/acinclude.m4     (revision 0)
-+++ b/acinclude.m4     (revision 53414)
-@@ -0,0 +1,46 @@
-+# -*- autoconf -*-
-+
-+AC_DEFUN([_COLORIZE_RESULT_PREPARE], [
-+    msg_checking= msg_result_yes= msg_result_no= msg_result_other= msg_reset=
-+    AS_IF([test "x${CONFIGURE_TTY}" = xyes -o -t 1], [
-+      msg_begin="`tput smso 2>/dev/null`"
-+      AS_CASE(["$msg_begin"], ['\e@<:@'*m],
-+          [msg_begin="`echo "$msg_begin" | sed ['s/[0-9]*m$//']`"
-+          msg_checking="${msg_begin}33m"
-+          AS_IF([test ${TEST_COLORS:+set}], [
-+              msg_result_yes=[`expr ":$TEST_COLORS:" : ".*:pass=\([^:]*\):"`]
-+              msg_result_no=[`expr ":$TEST_COLORS:" : ".*:fail=\([^:]*\):"`]
-+              msg_result_other=[`expr ":$TEST_COLORS:" : ".*:skip=\([^:]*\):"`]
-+          ])
-+          msg_result_yes="${msg_begin}${msg_result_yes:-32;1}m"
-+          msg_result_no="${msg_begin}${msg_result_no:-31;1}m"
-+          msg_result_other="${msg_begin}${msg_result_other:-33;1}m"
-+          msg_reset="${msg_begin}m"
-+          ])
-+      AS_UNSET(msg_begin)
-+      ])
-+    AS_REQUIRE_SHELL_FN([colorize_result],
-+      [AS_FUNCTION_DESCRIBE([colorize_result], [MSG], [Colorize result])],
-+        [AS_CASE(["$[]1"],
-+            [yes], [AS_ECHO(["${msg_result_yes}$[]1${msg_reset}]")],
-+            [no], [AS_ECHO(["${msg_result_no}$[]1${msg_reset}]")],
-+            [AS_ECHO(["${msg_result_other}$[]1${msg_reset}]")])])
-+])
-+
-+AC_DEFUN([COLORIZE_RESULT], [AC_REQUIRE([_COLORIZE_RESULT_PREPARE])dnl
-+    AS_LITERAL_IF([$1],
-+      [m4_case([$1],
-+              [yes], [AS_ECHO(["${msg_result_yes}$1${msg_reset}"])],
-+              [no], [AS_ECHO(["${msg_result_no}$1${msg_reset}"])],
-+              [AS_ECHO(["${msg_result_other}$1${msg_reset}"])])],
-+      [colorize_result "$1"]) dnl
-+])
-+
-+AC_DEFUN([AC_CHECKING],[dnl
-+AC_REQUIRE([_COLORIZE_RESULT_PREPARE])dnl
-+AS_MESSAGE([checking ${msg_checking}$1${msg_reset}...])])
-+
-+AC_DEFUN([AC_MSG_RESULT], [dnl
-+{ _AS_ECHO_LOG([result: $1])
-+COLORIZE_RESULT([$1]); dnl
-+}])
-
-Property changes on: acinclude.m4
-___________________________________________________________________
-Added: svn:eol-style
-## -0,0 +1 ##
-+LF
-\ No newline at end of property
-Index: common.mk
-===================================================================
---- a/common.mk        (revision 53413)
-+++ b/common.mk        (revision 53414)
-@@ -518,7 +518,7 @@
-       $(Q)$(RM) id.c id.h probes.dmyh
-       $(Q)$(CHDIR) $(srcdir) && $(exec) $(RM) parse.c parse.h lex.c enc/trans/newline.c $(PRELUDES) revision.h
-       $(Q)$(CHDIR) $(srcdir) && $(exec) $(RM) id.c id.h probes.dmyh
--      $(Q)$(CHDIR) $(srcdir) && $(exec) $(RM) configure tool/config.guess tool/config.sub gems/*.gem
-+      $(Q)$(CHDIR) $(srcdir) && $(exec) $(RM) configure aclocal.m4 tool/config.guess tool/config.sub gems/*.gem
- realclean-ext:: PHONY
- realclean-golf: distclean-golf
-       $(Q)$(RM) $(GOLFPRELUDES)
-Index: Makefile.in
-===================================================================
---- a/Makefile.in      (revision 53413)
-+++ b/Makefile.in      (revision 53414)
-@@ -22,6 +22,7 @@
- YACC = bison
- PURIFY =
- AUTOCONF = autoconf
-+ACLOCAL = aclocal
- CONFIGURE = @CONFIGURE@
- @SET_MAKE@
- MKFILES = @MAKEFILES@
-@@ -310,6 +311,9 @@
- $(srcdir)/$(CONFIGURE): $(srcdir)/configure.in $(srcdir)/aclocal.m4
-       $(CHDIR) $(srcdir) && exec $(AUTOCONF) -o $(@F)
-+$(srcdir)/aclocal.m4: $(srcdir)/acinclude.m4
-+      $(CHDIR) $(srcdir) && exec $(ACLOCAL)
-+
- incs: id.h
- all-incs: probes.h
index 16f664a56f74d53ad89051d325d4e896e3638ddb..15a64088d965254127c9691b98cb179791579657 100644 (file)
@@ -25,7 +25,7 @@ require_regex_ignore=/^require ([a-zA-Z\$]|["']$|.*\/$)/
 require_ignore=%w{drb/invokemethod16 foo rubygems/defaults/operating_system win32console java Win32API
                   builder/xchar json/pure simplecov win32/sspi rdoc/markdown/literals_1_8 enumerator win32/resolv rbtree
                   nqxml/streamingparser nqxml/treeparser xmlscan/parser xmlscan/scanner xmltreebuilder xml/parser xmlparser xml/encoding-ja xmlencoding-ja
-                  iconv uconv win32ole gettext/po_parser gettext/mo libxml psych.jar jar-dependencies}
+                  iconv uconv win32ole gettext/po_parser gettext/mo libxml psych.jar psych_jars jar-dependencies thread minitest/proveit}
 
 builtin_enc=[
        Encoding.find("ASCII-8BIT"),
@@ -164,7 +164,7 @@ package_requires_files.each do
                else
                        found = package_files.detect {|(pkg,files)| files.detect {|file| $:.detect {|path| "#{path}/#{require}" == file.gsub(/\.(so|rb)$/,"") } } }
                        if not found
-                               $stderr.puts "#{pkg}: Nothing provides #{require}"
+                               $stderr.puts "#{pkg}: Nothing provides #{require} for #{files.collect {|file| file.sub("/usr/lib/ruby/","") }.join(",")}"
                                failed = true
                                next
                        end
index e23b73df4b4c9133e747652afff69d3bc5eb22d8..25e5810ba3d33d8a3131e1e565c25d12e5420f0d 100644 (file)
@@ -5,7 +5,7 @@
 
 function list_staging_files {
        cd "$1"; find \
-               \( \( -name "root-x86" -or -name "packages" -or -name "stamp" -or -name "pkginfo" \) -prune \) -or -true \
+               \( \( -name "root-*" -or -name "packages" -or -name "stamp" -or -name "pkginfo" -or -name "host" \) -prune \) -or -true \
                \( -path "*ruby*" -or -name "erb" -or -name "gem" -or -name "irb" -or -name "rake" -or -name "rdoc" -or -name "ri" -or -name "testrb" \) \
                -not -path "*/usr/include/*" -not -path "*/usr/lib/pkgconfig/*" -not -path "*/usr/lib/lib*.a" \
                -not -path "*/usr/lib/ruby/gems/*/cache/*" \
index fd87298b51e44620eba1d96eee4c44d62cc752a6..45e9c6282bb6db898051f461b0078784d92f64bb 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2015-2016 OpenWrt.org
+# Copyright (C) 2015-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -16,15 +16,15 @@ include $(INCLUDE_DIR)/nls.mk
 include $(INCLUDE_DIR)/target.mk 
 
 PKG_NAME:=boost
-PKG_VERSION:=1.62.0
-PKG_SOURCE_VERSION:=1_62_0
-PKG_RELEASE:=5
+PKG_VERSION:=1.63.0
+PKG_SOURCE_VERSION:=1_63_0
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_SOURCE_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://sourceforge.net/projects/boost/files/boost/$(PKG_VERSION)
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_SOURCE_VERSION)
 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)_$(PKG_SOURCE_VERSION)
-PKG_MD5SUM:=36c96b0f6155c98404091d8ceb48319a28279ca0333fba1ad8611eb90afb2ca0
+PKG_MD5SUM:=beae2529f759f6b3bf3f4969a19c2e9d6f0c503edcb2de4a61d1428519fcb3b0
 PKG_LICENSE:=Boost Software License <http://www.boost.org/users/license.html>
 PKG_MAINTAINER:=Carlos M. Ferreira <carlosmf.pt@gmail.com>
 
@@ -44,7 +44,7 @@ define Package/boost/Default
 endef
 
 define Package/boost/description
-This package provides the Boost v1.62 libraries.
+This package provides the Boost v1.63 libraries.
 Boost is a set of free, peer-reviewed, portable C++ source libraries.
 
 -----------------------------------------------------------------------------
@@ -68,7 +68,7 @@ This package provides the following run-time libraries:
  - date_time
  - exception
  - filesystem
- - fiber (Requires GCC v5 and up) - BROKEN
+ - fiber (Requires GCC v5 and up)
  - graph
  - - graph-parallel
  - iostreams
@@ -88,7 +88,7 @@ This package provides the following run-time libraries:
  - wave
 
 There are many more header-only libraries supported by Boost.
-See more at http://www.boost.org/doc/libs/1_62_0/
+See more at http://www.boost.org/doc/libs/1_63_0/
 endef
 
 PKG_BUILD_DEPENDS:=boost/host PACKAGE_python:python PACKAGE_python3:python3
@@ -336,6 +336,8 @@ TARGET_CFLAGS += \
        $(if $(CONFIG_PACKAGE_boost-python3), -I$(STAGING_DIR)/usr/include/python3.5/) \
        $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
 
+EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_VERSION_4_8),-std=gnu++11,-std=gnu++14)
+
 ifneq ($(findstring mips,$(ARCH)),)
     BOOST_ABI = o32
     ifneq ($(findstring 64,$(ARCH)),)
@@ -354,7 +356,7 @@ comma := ,
 define Build/Compile
        $(info Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu $(CPU_TYPE) $(CPU_SUBTYPE))
        ( cd $(PKG_BUILD_DIR) ; \
-               echo "using gcc : $(ARCH) : $(GNU_TARGET_NAME)-gcc : <compileflags>\"$(TARGET_CFLAGS)\" <cxxflags>\"$(TARGET_CXXFLAGS) $(if $(CONFIG_boost-coroutine2),-std=c++14,)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > tools/build/src/user-config.jam ; \
+               echo "using gcc : $(ARCH) : $(GNU_TARGET_NAME)-gcc : <compileflags>\"$(TARGET_CFLAGS)\" <cxxflags>\"$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > tools/build/src/user-config.jam ; \
                $(if $(CONFIG_PACKAGE_boost-python3), \
                        echo "using python : 3.5 : $(STAGING_DIR_ROOT)/usr/bin/python3 : $(STAGING_DIR)/usr/include/python3.5/ ;" >> \
                                tools/build/src/user-config.jam; \
@@ -415,11 +417,11 @@ endef
 
 define Host/Install
        $(INSTALL_DIR) \
-               $(STAGING_DIR)/host/bin
+               $(STAGING_DIR_HOSTPKG)/bin
 
        $(CP) \
                $(HOST_BUILD_DIR)/tools/build/src/engine/bin.*/b2 \
-               $(STAGING_DIR)/host/bin/
+               $(STAGING_DIR_HOSTPKG)/bin/
 endef
 
 define Package/boost/Default/install
index dc62f6fdfecd9e26a246afb5b8d1da349fa31724..8989e0b282e6541a5c1eb7162ab88870a1e5d437 100644 (file)
@@ -1,8 +1,8 @@
-Index: boost_1_62_0/libs/fiber/build/Jamfile.v2
+Index: boost_1_63_0/libs/fiber/build/Jamfile.v2
 ===================================================================
---- boost_1_62_0.orig/libs/fiber/build/Jamfile.v2
-+++ boost_1_62_0/libs/fiber/build/Jamfile.v2
-@@ -43,19 +43,6 @@ lib boost_fiber
+--- boost_1_63_0.orig/libs/fiber/build/Jamfile.v2
++++ boost_1_63_0/libs/fiber/build/Jamfile.v2
+@@ -44,20 +44,6 @@ lib boost_fiber
        recursive_timed_mutex.cpp
        timed_mutex.cpp
        scheduler.cpp
@@ -11,6 +11,7 @@ Index: boost_1_62_0/libs/fiber/build/Jamfile.v2
 -               cxx11_constexpr
 -               cxx11_defaulted_functions
 -               cxx11_final
+-               cxx11_hdr_mutex
 -               cxx11_hdr_tuple
 -               cxx11_lambdas
 -               cxx11_noexcept
diff --git a/libs/dtc/Makefile b/libs/dtc/Makefile
new file mode 100644 (file)
index 0000000..a2d74a9
--- /dev/null
@@ -0,0 +1,74 @@
+#
+# Copyright (C) 2016 Yousong Zhou <yszhou4tech@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=dtc
+PKG_VERSION:=1.4.2
+PKG_RELEASE:=2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://www.kernel.org/pub/software/utils/dtc
+PKG_SOURCE_MD5SUM:=3d5814e31b2046ef51fca8fece998db0
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=GPL
+PKG_INSTALL:=1
+PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+
+
+define Package/dtc
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Device Tree Compiler
+  URL:=http://devicetree.org/Device_Tree_Compiler
+endef
+
+define Package/dtc/description
+  Device Tree Compiler for Flat Device Trees Device Tree Compiler, dtc, takes
+  as input a device-tree in a given format and outputs a device-tree in another
+  format for booting kernels on embedded systems.
+endef
+
+define Package/dtc/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/bin/dtc $(1)/usr/bin
+endef
+
+
+define Package/libfdt
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=a utility library for reading and manipulating dtb files
+  URL:=http://devicetree.org/Device_Tree_Compiler
+endef
+
+define Package/libfdt/description
+  This is a library containing functions for manipulating Flat Device Trees.
+endef
+
+define Package/libfdt/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/lib/libfdt*.so* $(1)/usr/lib
+endef
+
+TARGET_CFLAGS += \
+       $(FPIC)
+
+MAKE_FLAGS += \
+       PREFIX= \
+       CFLAGS="$(TARGET_CFLAGS)"
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/include/* $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/lib/* $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,dtc))
+$(eval $(call BuildPackage,libfdt))
diff --git a/libs/eventlog/Makefile b/libs/eventlog/Makefile
new file mode 100644 (file)
index 0000000..d0658ff
--- /dev/null
@@ -0,0 +1,44 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=eventlog
+PKG_VERSION:=0.2.12
+PKG_RELEASE:=2
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+
+PKG_SOURCE_URL:=https://my.balabit.com/downloads/eventlog/0.2/
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=3d6ebda8a161d36cb40d09328f78786b
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libeventlog
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=A new API to format and send structured log messages.
+endef
+
+define Package/eventlog/description
+  A new API to format and send structured log messages. It supports multiple message
+  representations (plain, XML attributes and XML tags) and multiple output methods
+  (local syslogd).
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/eventlog $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevtlog.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/eventlog.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libeventlog/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libevtlog.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libeventlog))
index db599d9f53ae8a252d06ba430773d8fd7279c3f1..27a8e50d9f02d93a066320314df8c34c7fc0905d 100644 (file)
@@ -8,11 +8,11 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=expat
-PKG_VERSION:=2.1.0
-PKG_RELEASE:=3
+PKG_VERSION:=2.2.0
+PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=dd7dab7a5fea97d2a6a43f511449b7cd
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MD5SUM:=2f47841c829facb346eb6e3fab5212e2
 PKG_SOURCE_URL:=@SF/expat
 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
 
index 7d31b73819fb526cc88378e33aa016601e1e85f3..e6634da7fb923014556190291dda2b5642bb2b75 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fftw3
-PKG_VERSION:=3.3.4
+PKG_VERSION:=3.3.6
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-2.0+
 
 PKG_SOURCE:=fftw-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.fftw.org
-PKG_MD5SUM:=2edab8c06b24feeb3b82bbb3ebf3e7b3
+PKG_MD5SUM:=ccd91b5b12bd0a441e100070ff09a310
 
 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/fftw-$(PKG_VERSION)
 PKG_FIXUP:=autoreconf
index c5dd8571fdb5ae344fa50bd18bba0ba1696b9730..6f56fa6a211997af7d128fb9d4c57582bd3cd88a 100644 (file)
@@ -1,19 +1,19 @@
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -232,7 +232,7 @@ 
+@@ -241,7 +241,7 @@
  CTAGS = ctags
  CSCOPE = cscope
  DIST_SUBDIRS = support genfft kernel simd-support dft rdft reodft api \
 -      libbench2 . threads tests mpi doc tools m4
 +      libbench2 . threads mpi doc tools m4
- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
- distdir = $(PACKAGE)-$(VERSION)
- top_distdir = $(distdir)
-@@ -444,7 +444,7 @@
- #
- @COMBINED_THREADS_TRUE@CHICKEN_EGG = threads .
+ am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+       $(srcdir)/fftw.pc.in AUTHORS COPYING ChangeLog INSTALL NEWS \
+       README TODO compile config.guess config.sub install-sh \
+@@ -470,7 +470,7 @@
+ # tools are available, such as fig2dev in maintainer mode)
+ @BUILD_DOC_TRUE@DOCDIR = doc
  SUBDIRS = support $(GENFFT) kernel simd-support dft rdft reodft api   \
--libbench2 $(CHICKEN_EGG) tests mpi doc tools m4
+-libbench2 $(CHICKEN_EGG) tests mpi $(DOCDIR) tools m4
 +libbench2 $(CHICKEN_EGG) mpi m4
  
  EXTRA_DIST = COPYRIGHT bootstrap.sh CONVENTIONS fftw.pc.in
index 013e23b1608d8d90e32897014e338b49495330e0..dce64f9606da857f0a430fca50c3cd844d44c69f 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=glib2
-PKG_VERSION:=2.49.7
-PKG_RELEASE:=1
+PKG_VERSION:=2.50.2
+PKG_RELEASE:=2
 
 PKG_SOURCE:=glib-$(PKG_VERSION).tar.xz
 PKG_BUILD_DIR:=$(BUILD_DIR)/glib-$(PKG_VERSION)
-PKG_SOURCE_URL:=@GNOME/glib/2.49
-PKG_MD5SUM:=397ead3fcf325cb921d54e2c9e7dfd7a
+PKG_SOURCE_URL:=@GNOME/glib/2.50
+PKG_MD5SUM:=5eeb2bfaf78a07be59585e8b6e80b1d6
 
 PKG_BUILD_PARALLEL:=1
 HOST_BUILD_PARALLEL:=1
@@ -47,13 +47,15 @@ endef
 HOST_CONFIGURE_ARGS += \
        --disable-selinux \
        --with-libiconv=gnu \
-       --with-pcre=internal
+       --with-pcre=internal \
+       --enable-libmount=no
 
 CONFIGURE_ARGS += \
        --enable-shared \
        --enable-static \
        --enable-debug=no \
        --disable-selinux \
+       --enable-libmount=no \
        --disable-fam \
        --with-libiconv=gnu \
        --with-pcre=internal
@@ -61,7 +63,7 @@ CONFIGURE_ARGS += \
 CONFIGURE_VARS += \
        glib_cv_stack_grows=no \
        glib_cv_uscore=no \
-       ac_cv_path_GLIB_GENMARSHAL=$(STAGING_DIR)/host/bin/glib-genmarshal \
+       ac_cv_path_GLIB_GENMARSHAL=$(STAGING_DIR_HOSTPKG)/bin/glib-genmarshal \
        ac_cv_func_mmap_fixed_mapped=yes \
        ac_cv_func_posix_getpwuid_r=yes \
        ac_cv_func_posix_getgrgid_r=yes
index 69cac8de7b8bffa0379d47779e13ec8443ac8676..aba32559efa1c537fbf39acce131ca04bcba85ca 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gnutls
-PKG_VERSION:=3.5.6
+PKG_VERSION:=3.5.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.5
-PKG_MD5SUM:=7a38b23757aae009c3eb5bb12fb0afda
+PKG_HASH:=51765cc5579e250da77fbd7871507c517d01b15353cc40af7b67e9ec7b6fe28f
 #PKG_FIXUP:=autoreconf gettext-version
 PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
 PKG_LICENSE:=LGPLv2.1+
@@ -110,8 +110,10 @@ CONFIGURE_ARGS+= \
        --enable-static \
        --disable-rpath \
        --disable-libdane \
+       --with-included-unistring \
        --disable-guile \
        --disable-nls \
+       --without-idn \
        --without-zlib \
        --enable-local-libopts \
        --disable-doc \
index c70ac166e78c46e5182c6b79fd94cb3f71cad46c..ecf261e03f81cf594a64195a52583d8ad79f8ecf 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2010 OpenWrt.org
+# Copyright (C) 2006-2016 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,17 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=icu4c
-PKG_VERSION:=55.1
-PKG_RELEASE:=1
+PKG_VERSION:=58.2
+PKG_RELEASE:=2
 
-PKG_SOURCE:=$(PKG_NAME)-55_1-src.tgz
-PKG_SOURCE_URL:=http://download.icu-project.org/files/icu4c/55.1
-PKG_MD5SUM:=e2d523df79d6cb7855c2fbe284f4db29
+PKG_SOURCE:=$(PKG_NAME)-58_2-src.tgz
+PKG_SOURCE_URL:=http://download.icu-project.org/files/$(PKG_NAME)/$(PKG_VERSION)
+PKG_MD5SUM:=fac212b32b7ec7ab007a12dff1f3aea1
 
 PKG_LICENSE:=ICU-1.8.1+
-PKG_LICENSE_FILES:=license.html
+PKG_LICENSE_FILES:=LICENSE
 
-PKG_MAINTAINER:=Mirko Vogt <mirko@openwrt.org>
+PKG_MAINTAINER:=Hirokazu MORIKAWA <morikw2@gmail.com>
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
@@ -26,7 +26,6 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 
 PKG_BUILD_DEPENDS:=icu/host
 
-
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/host-build.mk
 
@@ -41,25 +40,39 @@ define Package/icu
   DEPENDS:=+libstdcpp +libpthread
 endef
 
-define Build/Configure
-       $(call Build/Configure/Default, \
-               --disable-debug \
-               --enable-release \
-               --enable-shared \
-               --enable-static \
-               --enable-draft \
-               --enable-renaming \
-               --disable-tracing \
-               --disable-extras \
-               --enable-dyload \
-               --enable-layout \
-               --enable-layoutex \
-               --disable-tools \
-               --disable-tests \
-               --disable-samples \
-               --with-cross-build="$(HOST_BUILD_DIR)" \
-       )
-endef
+CONFIGURE_CMD:= ./runConfigureICU
+CONFIGURE_VARS:=
+CONFIGURE_ARGS:= \
+       Linux/gcc \
+       --disable-debug \
+       --enable-release \
+       --enable-shared \
+       --enable-static \
+       --enable-draft \
+       --enable-renaming \
+       --disable-tracing \
+       --disable-extras \
+       --enable-dyload \
+       --disable-tools \
+       --disable-tests \
+       --disable-samples \
+       --with-cross-build="$(HOST_BUILD_DIR)" \
+       --prefix=/usr
+
+HOST_CONFIGURE_CMD:= ./runConfigureICU
+HOST_CONFIGURE_VARS:=
+HOST_CONFIGURE_ARGS:= \
+       Linux/gcc \
+       --disable-debug \
+       --enable-release \
+       --enable-shared \
+       --enable-static \
+       --enable-draft \
+       --enable-renaming \
+       --disable-tracing \
+       --disable-extras \
+       --enable-dyload \
+       --prefix=$(HOST_BUILD_PREFIX)
 
 define Build/InstallDev
        $(INSTALL_DIR) \
index cc7d93838a3267210d4b9eb617cc4a009eedc0aa..8b8cb7bc05d1ad702960fd92168eec3b0c4be3bf 100644 (file)
@@ -6,7 +6,7 @@ index 9db6c52..6aa2273 100644
        $(INSTALL_SCRIPT) $(top_srcdir)/install-sh $(DESTDIR)$(pkgdatadir)/install-sh
        @$(MKINSTALLDIRS) $(DESTDIR)$(libdir)/pkgconfig
        $(INSTALL_DATA) $(ALL_PKGCONFIG_FILES) $(DESTDIR)$(libdir)/pkgconfig/
--      $(INSTALL_DATA) $(top_srcdir)/../license.html $(DESTDIR)$(pkgdatadir)/license.html
+-      $(INSTALL_DATA) $(top_srcdir)/../LICENSE $(DESTDIR)$(pkgdatadir)/LICENSE
        $(INSTALL_SCRIPT) $(top_builddir)/config/icu-config $(DESTDIR)$(bindir)/icu-config
        $(INSTALL_DATA) $(top_builddir)/config/Makefile.inc $(DESTDIR)$(pkglibdir)/Makefile.inc
        $(INSTALL_DATA) $(top_builddir)/config/pkgdata.inc $(DESTDIR)$(pkglibdir)/pkgdata.inc
diff --git a/libs/icu/patches/001-disable-strtod_l.patch b/libs/icu/patches/001-disable-strtod_l.patch
new file mode 100644 (file)
index 0000000..b84d14f
--- /dev/null
@@ -0,0 +1,26 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -893,8 +893,8 @@
+ AC_CHECK_FUNC(strtod_l)
+ if test x$ac_cv_func_strtod_l = xyes
+ then
+-     CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=1"
+-     U_HAVE_STRTOD_L=1
++     CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=0"
++     U_HAVE_STRTOD_L=0
+ else
+      CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=0"
+      U_HAVE_STRTOD_L=0
+--- a/configure
++++ b/configure
+@@ -7053,8 +7053,8 @@
+ if test x$ac_cv_func_strtod_l = xyes
+ then
+-     CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=1"
+-     U_HAVE_STRTOD_L=1
++     CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=0"
++     U_HAVE_STRTOD_L=0
+ else
+      CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=0"
+      U_HAVE_STRTOD_L=0
diff --git a/libs/icu/patches/CVE-2017-7867_CVE-2017-7868.patch b/libs/icu/patches/CVE-2017-7867_CVE-2017-7868.patch
new file mode 100644 (file)
index 0000000..accba5f
--- /dev/null
@@ -0,0 +1,176 @@
+Index: source/test/intltest/utxttest.h
+===================================================================
+--- source/test/intltest/utxttest.h    (revision 39670)
++++ source/test/intltest/utxttest.h    (revision 39671)
+@@ -38,6 +38,7 @@
+     void Ticket10562();
+     void Ticket10983();
+     void Ticket12130();
++    void Ticket12888();
+ private:
+     struct m {                              // Map between native indices & code points.
+Index: source/test/intltest/utxttest.cpp
+===================================================================
+--- source/test/intltest/utxttest.cpp  (revision 39670)
++++ source/test/intltest/utxttest.cpp  (revision 39671)
+@@ -67,6 +67,8 @@
+             if (exec) Ticket10983();  break;
+         case 7: name = "Ticket12130";
+             if (exec) Ticket12130(); break;
++        case 8: name = "Ticket12888";
++            if (exec) Ticket12888(); break;
+         default: name = "";          break;
+     }
+ }
+@@ -1583,3 +1585,63 @@
+     }
+     utext_close(&ut);
+ }
++
++// Ticket 12888: bad handling of illegal utf-8 containing many instances of the archaic, now illegal,
++//               six byte utf-8 forms. Original implementation had an assumption that
++//               there would be at most three utf-8 bytes per UTF-16 code unit.
++//               The five and six byte sequences map to a single replacement character.
++
++void UTextTest::Ticket12888() {
++    const char *badString = 
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
++            "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80";
++
++    UErrorCode status = U_ZERO_ERROR;
++    LocalUTextPointer ut(utext_openUTF8(NULL, badString, -1, &status));
++    TEST_SUCCESS(status);
++    for (;;) {
++        UChar32 c = utext_next32(ut.getAlias());
++        if (c == U_SENTINEL) {
++            break;
++        }
++    }
++    int32_t endIdx = utext_getNativeIndex(ut.getAlias());
++    if (endIdx != (int32_t)strlen(badString)) {
++        errln("%s:%d expected=%d, actual=%d", __FILE__, __LINE__, strlen(badString), endIdx);
++        return;
++    }
++
++    for (int32_t prevIndex = endIdx; prevIndex>0;) {
++        UChar32 c = utext_previous32(ut.getAlias());
++        int32_t currentIndex = utext_getNativeIndex(ut.getAlias());
++        if (c != 0xfffd) {
++            errln("%s:%d (expected, actual, index) = (%d, %d, %d)\n",
++                    __FILE__, __LINE__, 0xfffd, c, currentIndex);
++            break;
++        }
++        if (currentIndex != prevIndex - 6) {
++            errln("%s:%d: wrong index. Expected, actual = %d, %d",
++                    __FILE__, __LINE__, prevIndex - 6, currentIndex);
++            break;
++        }
++        prevIndex = currentIndex;
++    }
++}
+Index: source/common/utext.cpp
+===================================================================
+--- source/common/utext.cpp    (revision 39670)
++++ source/common/utext.cpp    (revision 39671)
+@@ -847,9 +847,15 @@
+ //------------------------------------------------------------------------------
+ // Chunk size.
+-//     Must be less than 85, because of byte mapping from UChar indexes to native indexes.
+-//     Worst case is three native bytes to one UChar.  (Supplemenaries are 4 native bytes
+-//     to two UChars.)
++//     Must be less than 42  (256/6), because of byte mapping from UChar indexes to native indexes.
++//     Worst case there are six UTF-8 bytes per UChar.
++//         obsolete 6 byte form fd + 5 trails maps to fffd
++//         obsolete 5 byte form fc + 4 trails maps to fffd
++//         non-shortest 4 byte forms maps to fffd
++//         normal supplementaries map to a pair of utf-16, two utf8 bytes per utf-16 unit
++//     mapToUChars array size must allow for the worst case, 6.
++//     This could be brought down to 4, by treating fd and fc as pure illegal,
++//     rather than obsolete lead bytes. But that is not compatible with the utf-8 access macros.
+ //
+ enum { UTF8_TEXT_CHUNK_SIZE=32 };
+@@ -889,7 +895,7 @@
+                                                      //  Requires two extra slots,
+                                                      //    one for a supplementary starting in the last normal position,
+                                                      //    and one for an entry for the buffer limit position.
+-    uint8_t   mapToUChars[UTF8_TEXT_CHUNK_SIZE*3+6]; // Map native offset from bufNativeStart to
++    uint8_t   mapToUChars[UTF8_TEXT_CHUNK_SIZE*6+6]; // Map native offset from bufNativeStart to
+                                                      //   correspoding offset in filled part of buf.
+     int32_t   align;
+ };
+@@ -1032,6 +1038,7 @@
+             // Requested index is in this buffer.
+             u8b = (UTF8Buf *)ut->p;   // the current buffer
+             mapIndex = ix - u8b->toUCharsMapStart;
++            U_ASSERT(mapIndex < (int32_t)sizeof(UTF8Buf::mapToUChars));
+             ut->chunkOffset = u8b->mapToUChars[mapIndex] - u8b->bufStartIdx;
+             return TRUE;
+@@ -1298,6 +1305,10 @@
+         // Can only do this if the incoming index is somewhere in the interior of the string.
+         //   If index is at the end, there is no character there to look at.
+         if (ix != ut->b) {
++            // Note: this function will only move the index back if it is on a trail byte
++            //       and there is a preceding lead byte and the sequence from the lead 
++            //       through this trail could be part of a valid UTF-8 sequence
++            //       Otherwise the index remains unchanged.
+             U8_SET_CP_START(s8, 0, ix);
+         }
+@@ -1311,7 +1322,10 @@
+         UChar   *buf = u8b->buf;
+         uint8_t *mapToNative = u8b->mapToNative;
+         uint8_t *mapToUChars = u8b->mapToUChars;
+-        int32_t  toUCharsMapStart = ix - (UTF8_TEXT_CHUNK_SIZE*3 + 1);
++        int32_t  toUCharsMapStart = ix - sizeof(UTF8Buf::mapToUChars) + 1;
++        // Note that toUCharsMapStart can be negative. Happens when the remaining
++        // text from current position to the beginning is less than the buffer size.
++        // + 1 because mapToUChars must have a slot at the end for the bufNativeLimit entry.
+         int32_t  destIx = UTF8_TEXT_CHUNK_SIZE+2;   // Start in the overflow region
+                                                     //   at end of buffer to leave room
+                                                     //   for a surrogate pair at the
+@@ -1338,6 +1352,7 @@
+             if (c<0x80) {
+                 // Special case ASCII range for speed.
+                 buf[destIx] = (UChar)c;
++                U_ASSERT(toUCharsMapStart <= srcIx);
+                 mapToUChars[srcIx - toUCharsMapStart] = (uint8_t)destIx;
+                 mapToNative[destIx] = (uint8_t)(srcIx - toUCharsMapStart);
+             } else {
+@@ -1367,6 +1382,7 @@
+                 do {
+                     mapToUChars[sIx-- - toUCharsMapStart] = (uint8_t)destIx;
+                 } while (sIx >= srcIx);
++                U_ASSERT(toUCharsMapStart <= (srcIx+1));
+                 // Set native indexing limit to be the current position.
+                 //   We are processing a non-ascii, non-native-indexing char now;
+@@ -1541,6 +1557,7 @@
+     U_ASSERT(index>=ut->chunkNativeStart+ut->nativeIndexingLimit);
+     U_ASSERT(index<=ut->chunkNativeLimit);
+     int32_t mapIndex = index - u8b->toUCharsMapStart;
++    U_ASSERT(mapIndex < (int32_t)sizeof(UTF8Buf::mapToUChars));
+     int32_t offset = u8b->mapToUChars[mapIndex] - u8b->bufStartIdx;
+     U_ASSERT(offset>=0 && offset<=ut->chunkLength);
+     return offset;
diff --git a/libs/libcanfestival/Makefile b/libs/libcanfestival/Makefile
new file mode 100644 (file)
index 0000000..9758ef3
--- /dev/null
@@ -0,0 +1,71 @@
+#
+# Copyright (C) 2015-2016 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:=libcanfestival
+PKG_RELEASE:=3
+
+PKG_SOURCE_PROTO:=hg
+PKG_SOURCE_URL:=http://dev.automforge.net/CanFestival-3
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)
+PKG_SOURCE_VERSION:=8bfe0ac00cdb
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
+
+PKG_MAINTAINER:=Anton Glukhov <anton.a.glukhov@gmail.com>
+PKG_LICENSE:=LGPL-2.1+
+PKG_LICENSE_FILES:=LICENCE
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libcanfestival
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Free software CANopen library
+  URL:=http://canfestival.org
+  DEPENDS:=+libpthread +librt
+endef
+
+define Package/libcanfestival/description
+  CanFestival library
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS := \
+       --cc=$(TARGET_CC) \
+       --cxx=$(TARGET_CXX) \
+       --ld=$(TARGET_CC) \
+       --arch=$(ARCH) \
+       --binutils=$(TARGET_CROSS) \
+       --os=Linux \
+       --kerneldir=$(LINUX_DIR) \
+       --prefix=/usr \
+       --target=unix \
+       --can=socket \
+       --timers=unix \
+       --debug=ERR \
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+endef
+
+define Package/libcanfestival/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcanfestival_can_socket.so $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libcanfestival))
diff --git a/libs/libcanfestival/patches/001-sigval-ref-fix.patch b/libs/libcanfestival/patches/001-sigval-ref-fix.patch
new file mode 100644 (file)
index 0000000..7e15ff1
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/drivers/timers_unix/timers_unix.c
++++ b/drivers/timers_unix/timers_unix.c
+@@ -33,7 +33,7 @@
+       }
+ }
+-void timer_notify(sigval_t val)
++void timer_notify(void)
+ {
+       if(gettimeofday(&last_sig,NULL)) {
+               perror("gettimeofday()");
diff --git a/libs/libcanfestival/patches/002-makefile-gcc-linker.patch b/libs/libcanfestival/patches/002-makefile-gcc-linker.patch
new file mode 100644 (file)
index 0000000..129743f
--- /dev/null
@@ -0,0 +1,33 @@
+--- a/examples/TestMasterMicroMod/Makefile.in
++++ b/examples/TestMasterMicroMod/Makefile.in
+@@ -56,7 +56,7 @@
+ $(TESTMASTERMICROMOD): $(OBJS)
+-      $(LD) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ $(OBJS) $(EXE_CFLAGS)
++      $(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ $(OBJS) $(EXE_CFLAGS)
+       
+ TestMaster.c: TestMaster.od
+--- a/examples/TestMasterSlave/Makefile.in
++++ b/examples/TestMasterSlave/Makefile.in
+@@ -65,7 +65,7 @@
+ $(TESTMASTERSLAVE): $(OBJS)
+-      $(LD) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ $(OBJS) $(EXE_CFLAGS)
++      $(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ $(OBJS) $(EXE_CFLAGS)
+       
+ TestSlave.c: TestSlave.od
+       $(MAKE) -C ../../objdictgen gnosis
+--- a/examples/CANOpenShell/Makefile.in
++++ b/examples/CANOpenShell/Makefile.in
+@@ -64,7 +64,7 @@
+       $(MAKE) -C ../../drivers/$(TARGET) libcanfestival_$(TARGET).a
+ $(CANOPENSHELL): $(OBJS)
+-      $(LD) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ $(OBJS) $(EXE_CFLAGS)
++      $(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ $(OBJS) $(EXE_CFLAGS)
+       mkdir -p Debug; cp $(CANOPENSHELL) Debug
+       
+ CANOpenShellMasterOD.c: CANOpenShellMasterOD.od
diff --git a/libs/libcanfestival/patches/003-makefile-skip-examples.patch b/libs/libcanfestival/patches/003-makefile-skip-examples.patch
new file mode 100644 (file)
index 0000000..e52fc6a
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -21,7 +21,7 @@
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ # 
+-all: objdictedit canfestival examples
++all: objdictedit canfestival
+ examples: canfestival driver
+       $(MAKE) -C examples all
+@@ -44,7 +44,7 @@ driver:
+ install: canfestival driver
+       $(MAKE) -C drivers $@
+       $(MAKE) -C src $@
+-      $(MAKE) -C examples $@
++      #$(MAKE) -C examples $@
+       $(MAKE) -C objdictgen $@
+       ldconfig
diff --git a/libs/libcoap/Makefile b/libs/libcoap/Makefile
new file mode 100644 (file)
index 0000000..fb220a9
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# Copyright (C) 2015 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:=libcoap
+PKG_RELEASE:=3
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/obgm/libcoap
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)
+PKG_SOURCE_VERSION:=2da31de732c0e51a9bc9e1d4aea21e25da89cf87
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
+
+PKG_MAINTAINER:=Anton Glukhov <anton.a.glukhov@gmail.com>
+PKG_LICENSE:=GPL-2.0+ BSD-2-Clause
+PKG_LICENSE_FILES:=COPYING LICENSE.GPL LICENSE.BSD
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libcoap
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=CoAP (RFC 7252) library
+  URL:=http://libcoap.net/
+endef
+
+define Package/libcoap/description
+  Constrained Application Protocol (RFC 7252) library
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --disable-examples \
+       --disable-documentation
+
+ifeq ($(CONFIG_BIG_ENDIAN),y)
+TARGET_CFLAGS += -DWORDS_BIGENDIAN
+endif
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+endef
+
+define Package/libcoap/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcoap-1.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libcoap))
diff --git a/libs/libevhtp/Makefile b/libs/libevhtp/Makefile
deleted file mode 100644 (file)
index a81e7ab..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-# NOTE: please DO NOT update this package without the maintainer's consent.
-# See https://github.com/haiwen/seafile/issues/1119
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=libevhtp
-PKG_VERSION:=1.1.6
-PKG_RELEASE:=1
-PKG_LICENSE:=BSD-3-Clause
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/ellzey/libevhtp.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=91071e2f20749cd469b87ac2ef1c158dc2a6806f
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/libevhtp
-    SECTION:=libs
-    CATEGORY:=Libraries
-    TITLE:=A more flexible replacement for libevent's httpd API
-    MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-    URL:=https://github.com/ellzey/libevhtp
-    DEPENDS:=+libevent2 +libevent2-openssl +libevent2-pthreads +libopenssl +libpthread
-endef
-
-define Package/libevhtp/description
-   Libevhtp was created as a replacement API for Libevent's current HTTP API.
-   The reality of libevent's http interface is that it was created as a JIT server,
-   meaning the developer never thought of it being used for creating a full-fledged HTTP service.
-endef
-
-include $(INCLUDE_DIR)/cmake.mk
-
-define Build/InstallDev
-       $(INSTALL_DIR) $(1)/usr/{include,lib}
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
-endef
-
-$(eval $(call BuildPackage,libevhtp))
diff --git a/libs/libevhtp/patches/010-strcmp-endianness-fix.patch b/libs/libevhtp/patches/010-strcmp-endianness-fix.patch
deleted file mode 100644 (file)
index 072b76b..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-diff -rupN libevhtp-1.2.9.orig/htparse/htparse.c libevhtp-1.2.9/htparse/htparse.c
---- libevhtp-1.2.9.orig/htparse/htparse.c      2014-03-23 12:50:50.000000000 +0100
-+++ libevhtp-1.2.9/htparse/htparse.c   2014-12-09 01:12:22.242001241 +0100
-@@ -197,6 +197,7 @@ static const char * method_strmap[] = {
- #define _MIN_READ(a, b) ((a) < (b) ? (a) : (b))
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- #define _str3_cmp(m, c0, c1, c2, c3) \
-     *(uint32_t *)m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0)
-@@ -226,6 +227,37 @@ static const char * method_strmap[] = {
-     *(uint32_t *)m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0)        \
-     && ((uint32_t *)m)[1] == ((c7 << 24) | (c6 << 16) | (c5 << 8) | c4) \
-     && m[8] == c8
-+#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
-+#define _str3_cmp(m, c0, c1, c2, c3) \
-+    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3)
-+
-+#define _str3Ocmp(m, c0, c1, c2, c3) \
-+    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3)
-+
-+#define _str4cmp(m, c0, c1, c2, c3) \
-+    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3)
-+
-+#define _str5cmp(m, c0, c1, c2, c3, c4)                          \
-+    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3) \
-+    && m[4] == c4
-+
-+#define _str6cmp(m, c0, c1, c2, c3, c4, c5)                      \
-+    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3) \
-+    && (((uint32_t *)m)[1] & 0xffff0000) == ((c4 << 24) | c5 << 16)
-+
-+#define _str7_cmp(m, c0, c1, c2, c3, c4, c5, c6, c7)             \
-+    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3) \
-+    && ((uint32_t *)m)[1] == ((c4 << 24) | (c5 << 16) | (c6 << 8) | c7)
-+
-+#define _str8cmp(m, c0, c1, c2, c3, c4, c5, c6, c7)              \
-+    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3) \
-+    && ((uint32_t *)m)[1] == ((c4 << 24) | (c5 << 16) | (c6 << 8) | c7)
-+
-+#define _str9cmp(m, c0, c1, c2, c3, c4, c5, c6, c7, c8)                 \
-+    *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3)        \
-+    && ((uint32_t *)m)[1] == ((c4 << 24) | (c5 << 16) | (c6 << 8) | c7) \
-+    && m[8] == c8
-+#endif
- #define __HTPARSE_GENHOOK(__n)                                                    \
-     static inline int hook_ ## __n ## _run(htparser * p, htparse_hooks * hooks) { \
index c290bddb6c6804e504ceffe16f10b058e3b1c5fe..05883047b18d301e4d7fcd8e7ea6d1a5ca9458b9 100644 (file)
@@ -41,6 +41,7 @@ CONFIGURE_ARGS+= \
        --enable-shared \
        --enable-static \
        --disable-rpath \
+       --disable-nls \
        --without-libiconv-prefix \
        --without-libintl-prefix \
 
index ddccc886132e5b51a62b293bb2be38f0ff210648..914dd562ee9fc078a48e8dc074377d31ffb2e408 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2015 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -9,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libextractor
 PKG_VERSION:=1.3
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 # ToDo:
 # - package missing optional dependencies: libexiv2, gsf, librpm, smf, tidy
@@ -17,6 +15,7 @@ PKG_RELEASE:=3
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
 PKG_MD5SUM:=35b8913dbebafe583a2781bf71509c48
+PKG_HASH:=868ad64c9a056d6b923d451d746935bffb1ddf5d89c3eb4f67d786001a3f7b7f
 
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
@@ -31,7 +30,7 @@ PLUGINS:= \
        dvi \
        flac:+libflac \
        gif:+giflib \
-       gstreamer:+libgstreamer1:+libgst1app:+libgst1pbutils:+libgst1tag \
+       gstreamer:+libgstreamer1:+gstreamer1-plugins-base:+libgst1app:+libgst1pbutils:+libgst1tag \
        it \
        jpeg:+libjpeg \
        man \
diff --git a/libs/libextractor/patches/002-ffmpeg2.9_api_backport.patch b/libs/libextractor/patches/002-ffmpeg2.9_api_backport.patch
new file mode 100644 (file)
index 0000000..f875729
--- /dev/null
@@ -0,0 +1,347 @@
+--- a/src/plugins/thumbnailffmpeg_extractor.c
++++ b/src/plugins/thumbnailffmpeg_extractor.c
+@@ -59,6 +59,20 @@
+ #include <ffmpeg/swscale.h>
+ #endif
++#if USE_JPEG
++#ifdef PIX_FMT_YUVJ420P
++#define PIX_OUTPUT_FORMAT PIX_FMT_YUVJ420P
++#else
++#define PIX_OUTPUT_FORMAT AV_PIX_FMT_YUVJ420P
++#endif
++#else
++#ifdef PIX_FMT_RGB24
++#define PIX_OUTPUT_FORMAT PIX_FMT_RGB24
++#else
++#define PIX_OUTPUT_FORMAT AV_PIX_FMT_RGB24
++#endif
++#endif
++
+ /**
+  * Set to 1 to enable debug output.
+  */ 
+@@ -153,7 +167,7 @@
+ static size_t 
+ create_thumbnail (int src_width, int src_height, 
+                 int src_stride[],
+-                enum PixelFormat src_pixfmt, 
++                enum AVPixelFormat src_pixfmt, 
+                 const uint8_t * const src_data[],
+                 int dst_width, int dst_height,
+                 uint8_t **output_data, 
+@@ -189,7 +203,8 @@
+   if (NULL == 
+       (scaler_ctx =
+        sws_getContext (src_width, src_height, src_pixfmt,
+-                     dst_width, dst_height, PIX_FMT_RGB24, 
++                     dst_width, dst_height,
++                     PIX_OUTPUT_FORMAT, 
+                      SWS_BILINEAR, NULL, NULL, NULL)))
+     {
+ #if DEBUG
+@@ -199,7 +214,12 @@
+       return 0;
+     }
+-  if (NULL == (dst_frame = avcodec_alloc_frame ()))
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++  dst_frame = av_frame_alloc ();
++#else
++  dst_frame = avcodec_alloc_frame();
++#endif
++  if (NULL == dst_frame)
+     {
+ #if DEBUG
+       fprintf (stderr,
+@@ -209,18 +229,24 @@
+       return 0;
+     }
+   if (NULL == (dst_buffer =
+-             av_malloc (avpicture_get_size (PIX_FMT_RGB24, dst_width, dst_height))))
++             av_malloc (avpicture_get_size (PIX_OUTPUT_FORMAT,
++                                              dst_width, dst_height))))
+     {
+ #if DEBUG
+       fprintf (stderr,
+                "Failed to allocate the destination image buffer\n");
+ #endif
+-      av_free (dst_frame);
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++      av_frame_free (&dst_frame);
++#else
++      avcodec_free_frame (&dst_frame);
++#endif
+       sws_freeContext (scaler_ctx);
+       return 0;
+     }
+   avpicture_fill ((AVPicture *) dst_frame, dst_buffer,
+-                  PIX_FMT_RGB24, dst_width, dst_height);
++                  PIX_OUTPUT_FORMAT,
++                  dst_width, dst_height);
+   sws_scale (scaler_ctx,
+              src_data, 
+              src_stride,
+@@ -236,7 +262,11 @@
+                "Failed to allocate the encoder output buffer\n");
+ #endif
+       av_free (dst_buffer);
+-      av_free (dst_frame);
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++      av_frame_free (&dst_frame);
++#else
++      avcodec_free_frame (&dst_frame);
++#endif
+       sws_freeContext (scaler_ctx);
+       return 0;
+     }
+@@ -249,13 +279,17 @@
+ #endif
+       av_free (encoder_output_buffer);
+       av_free (dst_buffer);
+-      av_free (dst_frame);
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++      av_frame_free (&dst_frame);
++#else
++      avcodec_free_frame (&dst_frame);
++#endif
+       sws_freeContext (scaler_ctx);
+       return 0;
+     }
+   encoder_codec_ctx->width = dst_width;
+   encoder_codec_ctx->height = dst_height;
+-  encoder_codec_ctx->pix_fmt = PIX_FMT_RGB24;
++  encoder_codec_ctx->pix_fmt = PIX_OUTPUT_FORMAT;
+   opts = NULL;
+   if (avcodec_open2 (encoder_codec_ctx, encoder_codec, &opts) < 0)
+     {
+@@ -263,10 +297,14 @@
+       fprintf (stderr,
+                "Failed to open the encoder\n");
+ #endif
+-      av_free (encoder_codec_ctx);
++      avcodec_free_context (&encoder_codec_ctx);
+       av_free (encoder_output_buffer);
+       av_free (dst_buffer);
+-      av_free (dst_frame);
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++      av_frame_free (&dst_frame);
++#else
++      avcodec_free_frame (&dst_frame);
++#endif
+       sws_freeContext  (scaler_ctx);
+       return 0;
+     }
+@@ -295,9 +333,13 @@
+ cleanup:
+   av_dict_free (&opts);
+   avcodec_close (encoder_codec_ctx);
+-  av_free (encoder_codec_ctx);
++  avcodec_free_context (&encoder_codec_ctx);
+   av_free (dst_buffer);
+-  av_free (dst_frame);
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++  av_frame_free (&dst_frame);
++#else
++  avcodec_free_frame (&dst_frame);
++#endif
+   sws_freeContext (scaler_ctx);
+   *output_data = encoder_output_buffer;
+@@ -406,18 +448,23 @@
+       fprintf (stderr,
+              "Failed to open image codec\n");
+ #endif
+-      av_free (codec_ctx);
++      avcodec_free_context (&codec_ctx);
+       return;
+     }
+   av_dict_free (&opts);
+-  if (NULL == (frame = avcodec_alloc_frame ()))
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++  frame = av_frame_alloc ();
++#else
++  frame = avcodec_alloc_frame();
++#endif
++  if (NULL == frame)
+     {
+ #if DEBUG
+       fprintf (stderr,
+                "Failed to allocate frame\n");
+ #endif
+       avcodec_close (codec_ctx);
+-      av_free (codec_ctx);
++      avcodec_free_context (&codec_ctx);
+       return;
+     }
+@@ -441,9 +488,13 @@
+       fprintf (stderr,
+              "Failed to decode a complete frame\n");
+ #endif
+-      av_free (frame);
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++      av_frame_free (&frame);
++#else
++      avcodec_free_frame (&frame);
++#endif
+       avcodec_close (codec_ctx);
+-      av_free (codec_ctx);
++      avcodec_free_context (&codec_ctx);
+       return;
+     }
+   calculate_thumbnail_dimensions (codec_ctx->width, codec_ctx->height,
+@@ -467,9 +518,13 @@
+               err);
+       av_free (encoded_thumbnail);
+     }
+-  av_free (frame);
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++  av_frame_free (&frame);
++#else
++  avcodec_free_frame (&frame);
++#endif
+   avcodec_close (codec_ctx);
+-  av_free (codec_ctx);
++  avcodec_free_context (&codec_ctx);
+ }
+@@ -563,7 +618,12 @@
+       return;
+     }
+-  if (NULL == (frame = avcodec_alloc_frame ()))
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++  frame = av_frame_alloc ();
++#else
++  frame = avcodec_alloc_frame();
++#endif
++  if (NULL == frame)
+     {
+ #if DEBUG
+       fprintf (stderr,
+@@ -616,7 +676,11 @@
+       fprintf (stderr,
+              "Failed to decode a complete frame\n");
+ #endif
+-      av_free (frame);
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++      av_frame_free (&frame);
++#else
++      avcodec_free_frame (&frame);
++#endif
+       avcodec_close (codec_ctx);
+       avformat_close_input (&format_ctx);
+       av_free (io_ctx);
+@@ -643,7 +707,11 @@
+               err);
+       av_free (encoded_thumbnail);
+     }
+-  av_free (frame);
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++  av_frame_free (&frame);
++#else
++  avcodec_free_frame (&frame);
++#endif
+   avcodec_close (codec_ctx);
+   avformat_close_input (&format_ctx);
+   av_free (io_ctx);
+--- a/src/plugins/previewopus_extractor.c
++++ b/src/plugins/previewopus_extractor.c
+@@ -296,7 +296,12 @@
+ /** Initialize one audio frame for reading from the input file */
+ static int init_input_frame(AVFrame **frame)
+ {
+-    if (!(*frame = avcodec_alloc_frame())) {
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++    *frame = av_frame_alloc ();
++#else
++    *frame = avcodec_alloc_frame();
++#endif
++    if (NULL == *frame) {
+  #if DEBUG
+         fprintf(stderr, "Could not allocate input frame\n");
+ #endif
+@@ -655,7 +660,11 @@
+         av_freep(&converted_input_samples[0]);
+         free(converted_input_samples);
+     }
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++    av_frame_free (&input_frame);
++#else
+     avcodec_free_frame(&input_frame);
++#endif
+     return ret;
+ }
+@@ -671,7 +680,12 @@
+     int error;
+     /** Create a new frame to store the audio samples. */
+-    if (!(*frame = avcodec_alloc_frame())) {
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++    *frame = av_frame_alloc ();
++#else
++    *frame = avcodec_alloc_frame();
++#endif
++    if (NULL == *frame) {
+         #if DEBUG
+               fprintf(stderr, "Could not allocate output frame\n");
+               #endif
+@@ -702,7 +716,11 @@
+         #if DEBUG
+               fprintf(stderr, "Could allocate output frame samples (error '%s')\n", get_error_text(error));
+               #endif
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++        av_frame_free (frame);
++#else
+         avcodec_free_frame(frame);
++#endif
+         return error;
+     }
+@@ -783,17 +801,29 @@
+         #if DEBUG
+               fprintf(stderr, "Could not read data from FIFO\n");
+               #endif
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++        av_frame_free (&output_frame);
++#else
+         avcodec_free_frame(&output_frame);
++#endif
+         return AVERROR_EXIT;
+     }
+     /** Encode one frame worth of audio samples. */
+     if (encode_audio_frame(output_frame, output_format_context,
+                            output_codec_context, &data_written)) {
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++        av_frame_free (&output_frame);
++#else
+         avcodec_free_frame(&output_frame);
++#endif
+         return AVERROR_EXIT;
+     }
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++    av_frame_free (&output_frame);
++#else
+     avcodec_free_frame(&output_frame);
++#endif
+     return 0;
+ }
+ /** Write the trailer of the output file container. */
+@@ -907,7 +937,12 @@
+       return;
+     }
+-  if (NULL == (frame = avcodec_alloc_frame ()))
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
++  frame = av_frame_alloc ();
++#else
++  frame = avcodec_alloc_frame();
++#endif
++  if (NULL == frame)
+     {
+ #if DEBUG
+       fprintf (stderr,
index 0309ff28ce7ee1d28abe3df355e4c7106d558895..3749982641bf7e200f2c550321d4af09eea83085 100644 (file)
@@ -54,7 +54,7 @@ CONFIGURE_ARGS += \
        --without-iconv
 
 CONFIGURE_VARS += \
-       LIBPNG12_CONFIG="$(STAGING_DIR)/host/bin/libpng12-config" \
+       LIBPNG12_CONFIG="$(STAGING_DIR_HOSTPKG)/bin/libpng12-config" \
        ac_cv_header_iconv_h=no
 
 define Build/InstallDev
index 9be56482d03747334790fa069ba7010892117c59..27b353c16679c9517dc9839ff01456efcd6969f9 100644 (file)
@@ -57,10 +57,10 @@ define Build/InstallDev
        $(INSTALL_DATA) \
                $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
                $(1)/usr/lib/pkgconfig/
-       $(INSTALL_DIR) $(STAGING_DIR)/host/share/vala-0.30/vapi/
+       $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/share/vala-0.30/vapi/
        $(INSTALL_DATA) \
                 $(PKG_INSTALL_DIR)/usr/share/vala/vapi/* \
-                $(STAGING_DIR)/host/share/vala-0.30/vapi
+                $(STAGING_DIR_HOSTPKG)/share/vala-0.30/vapi
 endef
 
 define Package/libgee/install
index d7f52472b803fa0c3e0a0c5465425302a07c66cc..2d20216269886c0f3ba8728ccae0b1f68d396ec5 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libidn
 PKG_VERSION:=1.33
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/libidn
@@ -28,7 +28,7 @@ define Package/idn/Default
   SECTION:=net
   CATEGORY:=Network
   URL:=http://www.gnu.org/software/libidn/
-  MAINTAINER:=Marcel Denia <naoir@gmx.net>
+  MAINTAINER:=Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
 endef
 
 define Package/idn/Default/description
@@ -79,6 +79,8 @@ define Build/InstallDev
        $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libidn.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libidn.pc $(1)/usr/lib/pkgconfig/
 endef
 
 define Package/idn/install
index e99f2a11f1f5a410e17fe42b3624aac79d894a3e..dcac7c450deaa97caa6cd25ab16eb4242879c5cd 100644 (file)
@@ -11,7 +11,7 @@
  EXTRA_DIST = cfg.mk maint.mk .clcopying
 --- a/configure.ac
 +++ b/configure.ac
-@@ -48,8 +48,6 @@ AC_PROG_LIBTOOL
+@@ -47,8 +47,6 @@ LT_INIT([win32-dll])
  # Checks for programs.
  AM_MISSING_PROG(PERL, perl, $missing_dir)
  AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
index 9b7ab2cca3b71cc86e81716e7e9bb036e86dc044..e9201c42b876b2bbcd578af7c0c776f8634d5d18 100644 (file)
@@ -1,6 +1,6 @@
 --- a/src/idn.c
 +++ b/src/idn.c
-@@ -169,7 +169,7 @@ main (int argc, char *argv[])
+@@ -170,7 +170,7 @@ main (int argc, char *argv[])
        (args_info.idna_to_unicode_given ? 1 : 0) +
        (args_info.nfkc_given ? 1 : 0) != 1)
      {
@@ -9,7 +9,7 @@
        usage (EXIT_FAILURE);
      }
  
-@@ -184,7 +184,7 @@ main (int argc, char *argv[])
+@@ -185,7 +185,7 @@ main (int argc, char *argv[])
    if (!args_info.quiet_given
        && args_info.inputs_num == 0
        && isatty (fileno (stdin)))
@@ -18,7 +18,7 @@
                       "terminated by a newline character.\n"));
  
    do
-@@ -199,7 +199,7 @@ main (int argc, char *argv[])
+@@ -197,7 +197,7 @@ main (int argc, char *argv[])
          if (feof (stdin))
            break;
  
@@ -26,8 +26,8 @@
 +        error (EXIT_FAILURE, errno, "%s", _("input error"));
        }
  
-       if (readbuf[strlen (readbuf) - 1] == '\n')
-@@ -216,7 +216,7 @@ main (int argc, char *argv[])
+       if (strlen (line) > 0)
+@@ -215,7 +215,7 @@ main (int argc, char *argv[])
          if (!q)
            {
              free (p);
@@ -36,7 +36,7 @@
                     _("could not convert from UTF-8 to UCS-4"));
            }
  
-@@ -241,7 +241,7 @@ main (int argc, char *argv[])
+@@ -240,7 +240,7 @@ main (int argc, char *argv[])
          if (!q)
            {
              free (r);
index fd173e5f6c2cbc4ecc8295bda88454d8beede9c4..6e520679057576b9f246cfdc5df78ecd09fb0858 100644 (file)
@@ -16,7 +16,7 @@ PKG_RELEASE:=1
 PKG_LICENSE:=BSD-2-Clause
 PKG_MAINTAINER:=Darik Horn <dajhorn@vanadac.com>
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/Cyan4973/lz4.git
index faca681a9402b6158884a1aa3fdd4dfecfd415d9..ffed96d54f61c646970b5cc0f494a6725051e640 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=liboping
-PKG_VERSION:=1.6.2
+PKG_VERSION:=1.9.0
 PKG_RELEASE:=1
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
-PKG_LICENSE:=GPL-2.0
+PKG_LICENSE:=LGPL-2.1+
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://verplant.org/liboping/files
-PKG_MD5SUM:=64a6f31310093d2517cfe7f05aa011e0
+PKG_SOURCE_URL:=https://noping.cc/files
+PKG_MD5SUM:=9c9f65bfd297d7e7092c7f219c31f66a
 
 PKG_FIXUP:=autoreconf
 
index 2ff620a99533513ba58855fdef9293ddba6f86c8..a4eda8e1765b7a2efc90ce9dcc1f0ad09b371ab9 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libpng
-PKG_VERSION:=1.2.56
+PKG_VERSION:=1.2.57
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@SF/libpng
-PKG_MD5SUM:=868562bd1c58b76ed8703f135a2e439a
+PKG_MD5SUM:=307052e5e8af97b82b17b64fb1b3677a
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
 
 PKG_LICENSE:=Libpng GPL-2.0+ BSD-3-Clause
index aeff8531d1a2d9c1614677663d271e25efca5b1c..d491e32b8686935d327f49577e3420b571c716a1 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2008-2015 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -8,17 +6,19 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libshout
-PKG_VERSION:=2.3.1
-PKG_RELEASE:=3
+PKG_VERSION:=2.4.1
+PKG_RELEASE:=1
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://downloads.us.xiph.org/releases/libshout/
-PKG_MD5SUM:=11765b2592e7ea623ccd93d3f8df172c
+PKG_MD5SUM:=89cebf8cb0197f639cde69c95177fe47
+PKG_HASH:=f3acb8dec26f2dbf6df778888e0e429a4ce9378a9d461b02a7ccbf2991bbf24d
 
 PKG_LICENSE:=LGPL-2.0+
 PKG_LICENSE_FILES:=COPYING
-PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>, \
+               Ted Hess <thess@kitschensync.net>
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
@@ -29,24 +29,31 @@ define Package/libshout/default
   SECTION:=libs
   CATEGORY:=Libraries
   TITLE:=Shoutcast client library
-  URL:=http://www.icecast.org/download.php
-  DEPENDS:= +libvorbis +libvorbisidec +libpthread
+  URL:=http://www.icecast.org
+  DEPENDS:= +libvorbisidec +libpthread
 endef
 
 define Package/libshout
   $(call Package/libshout/default)
-  TITLE+= (no speex & theora)
-  VARIANT:=nospeex
+  TITLE+= (no theora)
+  DEPENDS+= +libopenssl
+  VARIANT:=notheora
+endef
+
+define Package/libshout-nossl
+  $(call Package/libshout/default)
+  TITLE+= (no ssl/theora)
+  VARIANT:=nossl
 endef
 
 define Package/libshout-full
   $(call Package/libshout/default)
-  TITLE+= (all codecs)
-  DEPENDS+= +libspeex +libtheora
+  TITLE+=(full)
+  DEPENDS+= +libtheora +libopenssl
   VARIANT:=full
 endef
 
-define Package/libshout/description
+define Package/libshout/description/default
  libshout allows applications to easily communicate and broadcast
  to an Icecast streaming media server. It handles the socket connections,
  metadata communication, and data streaming for the calling application,
@@ -54,19 +61,36 @@ define Package/libshout/description
  details.
 endef
 
-Package/libshout-full/description=Package/libshout/description
+define Package/libshout/description
+  $(call Package/libshout/description/default)
+  .
+  This package does not have Theora support.
+endef
+
+define Package/libshout-nossl/description
+  $(call Package/libshout/description/default)
+  .
+  This package does not have OpenSSL or Theora support.
+endef
+
+Package/libshout-full/description=$(Package/libshout/description/default)
 
 CONFIGURE_ARGS += \
        --enable-shared \
-       --enable-static
+       --enable-static \
+       --disable-speex
 
-ifeq ($(BUILD_VARIANT),nospeex)
-  CONFIGURE_ARGS += --disable-theora --disable-speex
+ifeq ($(BUILD_VARIANT),notheora)
+  CONFIGURE_ARGS += --disable-theora
+endif
+
+ifeq ($(BUILD_VARIANT),nossl)
+  CONFIGURE_ARGS += --disable-theora --with-openssl="no"
 endif
 
 CONFIGURE_VARS += \
        VORBIS_CFLAGS="-I$(STAGING_DIR)/usr/include/tremor/" \
-       VORBIS_LIBS="$(TARGET_LDFLAGS) -lvorbis -lvorbisidec" \
+       VORBIS_LIBS="$(TARGET_LDFLAGS) -lvorbisidec" \
 
 TARGET_CFLAGS += $(FPIC) -Wl,-rpath-link="$(STAGING_DIR)/usr/lib"
 
@@ -86,7 +110,10 @@ define Package/libshout/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libshout.so.* $(1)/usr/lib/
 endef
+
 Package/libshout-full/install=$(Package/libshout/install)
+Package/libshout-nossl/install=$(Package/libshout/install)
 
 $(eval $(call BuildPackage,libshout))
+$(eval $(call BuildPackage,libshout-nossl))
 $(eval $(call BuildPackage,libshout-full))
diff --git a/libs/libshout/patches/100-add_with-openssl_option.patch b/libs/libshout/patches/100-add_with-openssl_option.patch
new file mode 100644 (file)
index 0000000..7319e29
--- /dev/null
@@ -0,0 +1,27 @@
+--- a/m4/xiph_openssl.m4
++++ b/m4/xiph_openssl.m4
+@@ -29,14 +29,16 @@ else
+     fi
+ fi
+-# Now try linking to openssl
+-xt_save_CFLAGS="$CFLAGS"
+-xt_save_LIBS="$LIBS"
+-CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
+-LIBS="$OPENSSL_LIBS $LIBS"
+-AC_TRY_LINK([#include <openssl/ssl.h>], [void *a = SSL_new], [openssl_ok='yes'])
+-CFLAGS="$xt_save_CFLAGS"
+-LIBS="$xt_save_LIBS"
++if test "x$openssl_prefix" != "xno"; then
++    # Now try linking to openssl
++    xt_save_CFLAGS="$CFLAGS"
++    xt_save_LIBS="$LIBS"
++    CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
++    LIBS="$OPENSSL_LIBS $LIBS"
++    AC_TRY_LINK([#include <openssl/ssl.h>], [void *a = SSL_new], [openssl_ok='yes'])
++    CFLAGS="$xt_save_CFLAGS"
++    LIBS="$xt_save_LIBS"
++fi
+ if test "$openssl_ok" = "yes"; then
+     AC_DEFINE(HAVE_OPENSSL, 1, [Define if you have libopenssl.])
index a9e41f93a6c559a4301c155c21696ecfb16006f6..be7ca7a1f821ceacc13374cb3e6d3d82ad19f44f 100644 (file)
@@ -1,5 +1,5 @@
---- a/src/vorbis.c
-+++ b/src/vorbis.c
+--- a/src/codec_vorbis.c
++++ b/src/codec_vorbis.c
 @@ -28,7 +28,7 @@
  #endif
  #include <stdlib.h>
@@ -8,4 +8,4 @@
 +#include <tremor/ivorbiscodec.h>
  
  #include "shout_private.h"
- #include "shout_ogg.h"
+ #include "format_ogg.h"
index 9e8b5a357a3b61a6a1427a916dbc01966c3b3cf9..4f09328081c1386308b7a1d67c57d322d833b9e7 100644 (file)
@@ -1,17 +1,19 @@
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -288,12 +288,12 @@ top_builddir = @top_builddir@
- top_srcdir = @top_srcdir@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -3,14 +3,14 @@
  AUTOMAKE_OPTIONS = 1.6 foreign
  ACLOCAL_AMFLAGS = -I m4
--SUBDIRS = include src examples debian doc win32
-+SUBDIRS = include src debian
+-SUBDIRS = include src examples doc win32
++SUBDIRS = include src
  EXTRA_DIST = INSTALL m4/shout.m4 m4/acx_pthread.m4 \
        m4/ogg.m4 m4/vorbis.m4 m4/xiph_compiler.m4 m4/xiph_net.m4 \
-       m4/xiph_types.m4
+       m4/xiph_types.m4 libshout.ckport
  
+ docdir = $(datadir)/doc/$(PACKAGE)
 -doc_DATA = COPYING NEWS README examples/example.c examples/nonblocking.c
-+doc_DATA = COPYING NEWS README
++doc_DATA = COPYING README
  m4datadir = $(datadir)/aclocal
  m4data_DATA = m4/shout.m4
- @HAVE_PKGCONFIG_TRUE@pkgconfigdir = $(libdir)/pkgconfig
index 49997bf815cec3317025bc9a83d4e2bcb4e6f44b..61b7be0d9403247ad2746e4925fde277f893e248 100644 (file)
@@ -15,9 +15,12 @@ PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Chih-Wei Chen <changeway@gmail.com>
 
-PKG_SOURCE_URL:=https://github.com/strophe/libstrophe/archive/
-PKG_SOURCE:=$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=2db62ab21187785ec5f870adc33b74e5
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL=https://github.com/strophe/libstrophe
+PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=9931ad4fa2aa7f204c608010eb2ebf84bcf7d542
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_MD5SUM:=6a499bcfc7c52db6765957ff38f48a344ad121ac0b665fd3d4adb7d8deadc427
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index 2f8292c832ced373f68926c9f0986c7b8fd16d66..466547d463f1364908523deffacd483c4ae79d66 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libtasn1
-PKG_VERSION:=4.8
-PKG_RELEASE:=2
+PKG_VERSION:=4.9
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=ftp://ftp.gnu.org/gnu/libtasn1
-PKG_MD5SUM:=9a6767705725544f2b86670dcfb34107
+PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
+PKG_MD5SUM:=4f6f7a8fd691ac2b8307c8ca365bad711db607d4ad5966f6938a9d2ecd65c920
 PKG_LICENSE:=LGPLv2.1+
 PKG_LICENSE_FILES:=COPYING.LIB
 
@@ -39,6 +39,7 @@ TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
                --enable-shared \
+               --disable-gcc-warnings \
                --enable-static
 
 define Build/InstallDev
index c1ba53f854b5f0e29728f0a4d2e8f682ff8357a3..81110624212291d86631a7b56232208459b004da 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libuecc
 PKG_VERSION:=7
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
@@ -35,11 +35,16 @@ CMAKE_OPTIONS += \
        -DCMAKE_BUILD_TYPE:String="MINSIZEREL"
 
 
+define Package/libuecc/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libuecc.so* $(1)/usr/lib/
+endef
+
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/libuecc-$(PKG_VERSION) $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libuecc.a $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libuecc.so* $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libuecc.pc $(1)/usr/lib/pkgconfig/
 endef
index c191c0eaaa317eed7be752acfb2c45033228ac16..4f40a2021576fee9f264fed040163993fee3b15f 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2015 OpenWrt.org
+# Copyright (C) 2015-2017 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:=libuv
-PKG_VERSION:=1.9.1
+PKG_VERSION:=1.10.2
 PKG_RELEASE:=1
 
 PKG_LICENSE_FILES:=LICENSE
 
-PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
+PKG_MAINTAINER:=Luka Perkov <luka.perkov@sartura.hr>
 
 PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://dist.libuv.org/dist/v$(PKG_VERSION)/
-PKG_MD5SUM:=654bf6783ac7fc10435c84ec86720a6e
+PKG_MD5SUM:=fad96b56f517c1ad3f274a19a10c53b2
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
 PKG_BUILD_PARALLEL:=1
@@ -56,6 +56,9 @@ define Build/InstallDev
        $(CP) \
                $(PKG_INSTALL_DIR)/usr/lib/libuv.so* \
                $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libuv.a \
+               $(1)/usr/lib/
 
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
        $(CP) \
index 3da90f4ea6437b25fbb6e3f825e9fa1b5bd1ee5e..6678970fe77c2a3f65eb28567d20f86f7bc901d7 100644 (file)
@@ -9,7 +9,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libvpx
-PKG_VERSION:=1.6.0
+PKG_VERSION:=1.6.1
 PKG_RELEASE:=1
 
 PKG_REV:=v$(PKG_VERSION)
@@ -24,6 +24,8 @@ PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE
 
+PKG_ABI_VERSION:=$(subst $(space),.,$(wordlist 1, 2, $(subst .,$(space),$(PKG_VERSION))))
+
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
@@ -34,7 +36,7 @@ define Package/libvpx
   TITLE:=libvpx
   URL:=http://www.webmproject.org/
   DEPENDS:=+libpthread
-  ABI_VERSION:=$(PKG_VERSION)
+  ABI_VERSION:=$(PKG_ABI_VERSION)
 endef
 
 define Package/libvpx/description
index a8fcf30c278035aa5933097c1a2a6e24ce7082ac..c4f38f45bce93c238ca04c27835553be3aee5bf5 100644 (file)
@@ -63,8 +63,8 @@ define Host/Compile
 endef
 
 define Host/Install
-       $(INSTALL_DIR) $(STAGING_DIR)/host/bin
-       $(CP) $(HOST_BUILD_DIR)/tools/bin/filterh $(STAGING_DIR)/host/bin/
+       $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
+       $(CP) $(HOST_BUILD_DIR)/tools/bin/filterh $(STAGING_DIR_HOSTPKG)/bin/
 endef
 
 $(eval $(call HostBuild))
index 1edfd77b3a7b0cdcbc5d9c7478b4af60641f0c27..7495fbc0bedc76b0a0a382d2d6a92878f0a21e28 100644 (file)
@@ -14,7 +14,7 @@ diff -rupN libzdb-3.0.orig/Makefile.am libzdb-3.0/Makefile.am
  RE2C          = @RE2C@
  RE2CFLAGS       = -b
 -FILTERH         = ./tools/bin/filterh
-+FILTERH         = $(STAGING_DIR)/host/bin/filterh
++FILTERH         = $(STAGING_DIR_HOSTPKG)/bin/filterh
  
  AM_CPPFLAGS     = $(CPPFLAGS) $(DBCPPFLAGS)
  AM_CPPFLAGS     += -Isrc -Isrc/util -Isrc/net -Isrc/db -Isrc/exceptions
index d23e9bbcab6f6e40f59bf0ec664a1bff70a2ad4e..4a6a452d9a150fcdb9f072682e862b907ae86448 100644 (file)
@@ -8,16 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=opus
-PKG_VERSION:=1.1.3
-PKG_RELEASE:=2
+PKG_VERSION:=1.1.4
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://downloads.xiph.org/releases/opus/
-PKG_MD5SUM:=32bbb6b557fe1b6066adc0ae1f08b629
+PKG_MD5SUM:=a2c09d995d0885665ff83b5df2505a5f
+PKG_HASH:=9122b6b380081dd2665189f97bfd777f04f92dc3ab6698eea1dbb27ad59d8692
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=COPYING
-PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+PKG_MAINTAINER:=Ted Hess <thess@kitchensync.net> Ian Leonard <antonlacon@gmail.com>
 
 PKG_INSTALL:=1
 
index 1e041612b84c4a52dc72fbbe41cb3daaec51cd9a..861b561e2f8841d844e2ac6752b923cba21b7628 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pcre
-PKG_VERSION:=8.39
-PKG_RELEASE:=1
+PKG_VERSION:=8.40
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
-PKG_MD5SUM:=e3fca7650a0556a2647821679d81f585
+PKG_MD5SUM:=41a842bf7dcecd6634219336e2167d1d
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 
 PKG_LICENSE:=BSD-3-Clause
diff --git a/libs/pcre/patches/001-CVE-2017-7186 b/libs/pcre/patches/001-CVE-2017-7186
new file mode 100644 (file)
index 0000000..984cf81
--- /dev/null
@@ -0,0 +1,53 @@
+#CVE-2017-7186 patch
+--- trunk/pcre_internal.h      2016/05/21 13:34:44     1649
++++ trunk/pcre_internal.h      2017/02/24 17:30:30     1688
+@@ -2772,6 +2772,9 @@
+ extern const pcre_uint16 PRIV(ucd_stage2)[];
+ extern const pcre_uint32 PRIV(ucp_gentype)[];
+ extern const pcre_uint32 PRIV(ucp_gbtable)[];
++#ifdef COMPILE_PCRE32
++extern const ucd_record  PRIV(dummy_ucd_record)[];
++#endif
+ #ifdef SUPPORT_JIT
+ extern const int         PRIV(ucp_typerange)[];
+ #endif
+@@ -2780,9 +2783,15 @@
+ /* UCD access macros */
+ #define UCD_BLOCK_SIZE 128
+-#define GET_UCD(ch) (PRIV(ucd_records) + \
++#define REAL_GET_UCD(ch) (PRIV(ucd_records) + \
+         PRIV(ucd_stage2)[PRIV(ucd_stage1)[(int)(ch) / UCD_BLOCK_SIZE] * \
+         UCD_BLOCK_SIZE + (int)(ch) % UCD_BLOCK_SIZE])
++        
++#ifdef COMPILE_PCRE32
++#define GET_UCD(ch) ((ch > 0x10ffff)? PRIV(dummy_ucd_record) : REAL_GET_UCD(ch))
++#else
++#define GET_UCD(ch) REAL_GET_UCD(ch)
++#endif 
+ #define UCD_CHARTYPE(ch)    GET_UCD(ch)->chartype
+ #define UCD_SCRIPT(ch)      GET_UCD(ch)->script
+--- trunk/pcre_ucd.c   2014/06/19 07:51:39     1490
++++ trunk/pcre_ucd.c   2017/02/24 17:30:30     1688
+@@ -38,6 +38,20 @@
+ const pcre_uint32 PRIV(ucd_caseless_sets)[] = {0};
+ #else
++/* If the 32-bit library is run in non-32-bit mode, character values
++greater than 0x10ffff may be encountered. For these we set up a
++special record. */
++
++#ifdef COMPILE_PCRE32
++const ucd_record PRIV(dummy_ucd_record)[] = {{
++  ucp_Common,    /* script */
++  ucp_Cn,        /* type unassigned */
++  ucp_gbOther,   /* grapheme break property */
++  0,             /* case set */
++  0,             /* other case */
++  }};
++#endif
++
+ /* When recompiling tables with a new Unicode version, please check the
+ types in this structure definition from pcre_internal.h (the actual
+ field names will be different):
index 990346c35f8d8b29300386a17a12fdb3a773c40e..fd3eefcb9ea16037d07a3ac1a31b29bf6d8963fb 100644 (file)
@@ -1,5 +1,6 @@
 #
 # Copyright (C) 2007-2016 OpenWrt.org
+# Copyright (C) 2017 Daniel Engberg <daniel.engberg.lists@pyret.net>
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=poco
-PKG_VERSION:=1.7.5
+PKG_VERSION:=1.7.7
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://pocoproject.org/releases/poco-1.7.5
-PKG_MD5SUM:=baafda4833c4dd95993398d9f237c96c
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://pocoproject.org/releases/$(PKG_NAME)-$(PKG_VERSION)
+PKG_MD5SUM:=17783e30f5ef9c852544ac0e9d1fd316c4804317026059a9d6aad798b61c77f8
 
 PKG_LICENSE:=BSL-1.0
 PKG_LICENSE_FILES:=LICENSE
index f27fa1e39899c04178e2a5cf27918a42681c8688..05071468d243084ffd76ea9f055497330a134e6e 100644 (file)
@@ -147,14 +147,14 @@ endef
 define Host/Install
        $(INSTALL_DIR) $(STAGING_DIR)/usr/bin/
        $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/bin/pg_config/pg_config $(STAGING_DIR)/usr/bin/
-       $(INSTALL_DIR) $(STAGING_DIR)/host/bin/
-       $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg $(STAGING_DIR)/host/bin/
-       $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/timezone/zic $(STAGING_DIR)/host/bin/
+       $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin/
+       $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg $(STAGING_DIR_HOSTPKG)/bin/
+       $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/timezone/zic $(STAGING_DIR_HOSTPKG)/bin/
 endef
 
 define Build/Configure
        $(Build/Configure/Default)
-       $(SED) 's@ECPG = ../../preproc/ecpg@ECPG = $(STAGING_DIR)/host/bin/ecpg@' $(PKG_BUILD_DIR)/src/interfaces/ecpg/test/Makefile.regress
+       $(SED) 's@ECPG = ../../preproc/ecpg@ECPG = $(STAGING_DIR_HOSTPKG)/bin/ecpg@' $(PKG_BUILD_DIR)/src/interfaces/ecpg/test/Makefile.regress
 endef
 
 TARGET_CFLAGS += $(FPIC) -lpthread
index 1e70a12fce9be730f52805b3a805bc6857825f23..93d538a0a1ab23434def51f4553b4906ddac5db4 100644 (file)
@@ -41,7 +41,7 @@ define Package/protobuf/description
  of its internal RPC protocols and file formats.
 endef
 
-CONFIGURE_ARGS += --with-protoc=$(STAGING_DIR)/host/bin/protoc
+CONFIGURE_ARGS += --with-protoc=$(STAGING_DIR_HOSTPKG)/bin/protoc
 
 define Build/InstallDev
        $(INSTALL_DIR) \
diff --git a/libs/rxtx/Makefile b/libs/rxtx/Makefile
new file mode 100755 (executable)
index 0000000..5a1374f
--- /dev/null
@@ -0,0 +1,49 @@
+#\r
+# Copyright (C) 2016 Dana H. Myers <k6jq@comcast.net>\r
+#\r
+# This is free software, licensed under the GNU General Public License v2.\r
+# See /LICENSE for more information.\r
+#\r
+\r
+include $(TOPDIR)/rules.mk\r
+\r
+PKG_NAME:=rxtx\r
+PKG_VERSION:=2.2pre2\r
+PKG_RELEASE:=1\r
+PKG_LICENSE:=LGPL-2.1\r
+PKG_MAINTAINER:=Dana H. Myers <k6jq@comcast.net>\r
+\r
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip\r
+PKG_SOURCE_URL:=http://rxtx.qbang.org/pub/rxtx/\r
+PKG_MD5SUM:=7eedb18e3f33a427e2b0e9be8ce3f94c\r
+\r
+PKG_FIXUP:=patch-libtool\r
+PKG_CHECK_FORMAT_SECURITY:=0\r
+\r
+include $(INCLUDE_DIR)/package.mk\r
+\r
+define Package/rxtx\r
+  SECTION:=libs\r
+  CATEGORY:=Libraries\r
+  TITLE:=RX/TX Support for Java serial communications\r
+  URL:=http://rxtx.qbang.org/wiki/index.php/Main_Page\r
+  DEPENDS:=+libpthread\r
+endef\r
+\r
+define Package/rxtx/description\r
+       RX/TX Support for Java serial communications\r
+endef\r
+\r
+CONFIGURE_ARGS += \\r
+       --disable-PRINTER\r
+\r
+define Package/rxtx/install\r
+       $(INSTALL_DIR) \\r
+               $(1)/usr/lib/classpath\r
+       $(CP) $(PKG_BUILD_DIR)/$(GNU_TARGET_NAME)-gnu/.libs/*.so \\r
+               $(1)/usr/lib/classpath/\r
+       $(CP) $(PKG_BUILD_DIR)/RXTXcomm.jar \\r
+               $(1)/usr/lib/classpath/\r
+endef\r
+\r
+$(eval $(call BuildPackage,rxtx))\r
diff --git a/libs/rxtx/patches/010-acm-devices.patch b/libs/rxtx/patches/010-acm-devices.patch
new file mode 100755 (executable)
index 0000000..3833c5c
--- /dev/null
@@ -0,0 +1,11 @@
+diff -rupN rxtx-2.2pre2/src/gnu/io/RXTXCommDriver.java rxtx-2.2pre2.new/src/gnu/io/RXTXCommDriver.java\r
+--- rxtx-2.2pre2/src/gnu/io/RXTXCommDriver.java        2008-11-13 16:44:01.000000000 -0800\r
++++ rxtx-2.2pre2.new/src/gnu/io/RXTXCommDriver.java    2015-08-21 16:19:14.330743949 -0700\r
+@@ -579,6 +579,7 @@ public class RXTXCommDriver implements C\r
+                                               "ttyUSB", // for USB frobs\r
+                                               "rfcomm",       // bluetooth serial device\r
+                                               "ttyircomm", // linux IrCommdevices (IrDA serial emu)\r
++                                              "ttyACM" // linux CDC ACM devices\r
+                                               };\r
+                                               CandidatePortPrefixes=Temp;\r
+                                       }\r
index f9bd2c794ec73967a6ffe45f5bf5678e80589f04..7f9b1b34ce940b8ba5b36c635d32f56a51457249 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sqlite
-PKG_VERSION:=3130000
-PKG_RELEASE:=2
+PKG_VERSION:=3160000
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.sqlite.org/2016/
-PKG_MD5SUM:=4e83f39fa2ffb610ac5ecd36865da6a2
+PKG_SOURCE_URL:=http://www.sqlite.org/2017/
+PKG_MD5SUM:=5102404047054b2cec2f43463293f94dea39425d42bf386d24596ab4fac7c7ff
 
 PKG_LICENSE:=PUBLICDOMAIN
 PKG_LICENSE_FILES:=
@@ -69,7 +69,9 @@ $(call Package/sqlite3/Default/description)
 endef
 
 TARGET_CFLAGS += $(FPIC) \
-       -DSQLITE_ENABLE_UNLOCK_NOTIFY \
+       -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \
+       -DHAVE_ISNAN=1 \
+       -DHAVE_MALLOC_USABLE_SIZE=1
 
 CONFIGURE_ARGS += \
        --enable-shared \
diff --git a/mail/dovecot/Makefile b/mail/dovecot/Makefile
new file mode 100644 (file)
index 0000000..aad6e68
--- /dev/null
@@ -0,0 +1,99 @@
+#
+# 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:=dovecot
+PKG_VERSION:=2.2.26.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.dovecot.org/releases/2.2
+PKG_MD5SUM:=85bc42328de41d1eb8d6d3f1db666db8
+PKG_LICENSE:=LGPL-2.1 MIT BSD-3-Clause Unique
+PKG_LICENSE_FILES:=COPYING COPYING.LGPL COPYING.MIT
+
+PKG_BUILD_DEPENDS:=libiconv
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/dovecot
+  SECTION:=mail
+  CATEGORY:=Mail
+  DEPENDS:=+DOVECOT_LDAP:libopenldap +libopenssl +librt +zlib +libbz2 +libcap
+  TITLE:=An IMAP and POP3 daemon
+  MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
+  URL:=http://www.dovecot.org/
+  USERID:=dovecot=59:dovecot=59
+endef
+
+define Package/dovecot/description
+ Dovecot is a program which provides POP3 and IMAP services.
+endef
+
+define Package/dovecot/config
+        menu "Select dovecot build options"
+                depends on PACKAGE_dovecot
+                config DOVECOT_LDAP
+                        bool "LDAP support"
+                        default n
+                        help
+                          Implements LDAP support in dovecot.
+        endmenu
+endef
+
+CONFIGURE_ARGS += \
+       --without-gssapi \
+       --without-pam \
+       --with-moduledir=/usr/lib/dovecot/modules \
+       --with-notify=dnotify \
+       --without-lzma \
+       --without-lz4 \
+       --with-icu=no
+
+ifneq ($(strip $(CONFIG_DOVECOT_LDAP)),)
+  CONFIGURE_ARGS+= \
+       --with-ldap=yes
+else
+  CONFIGURE_ARGS+= \
+       --with-ldap=no
+endif
+
+CONFIGURE_VARS += \
+       RPCGEN= \
+       i_cv_signed_size_t=no \
+       i_cv_signed_time_t=no \
+       i_cv_gmtime_max_time_t=32 \
+       i_cv_mmap_plays_with_write=yes \
+       i_cv_fd_passing=yes \
+       i_cv_c99_vsnprintf=yes \
+       lib_cv_va_copy=yes \
+       lib_cv_va_copy=yes \
+       lib_cv___va_copy=yes \
+       lib_cv_va_val_copy=yes
+
+define Package/dovecot/install
+       $(INSTALL_DIR)  $(1)/etc/init.d \
+                       $(1)/etc/dovecot \
+                       $(1)/usr/share/doc/dovecot/example-config \
+                       $(1)/usr/lib/dovecot \
+                       $(1)/usr/bin \
+                       $(1)/usr/sbin
+       $(CP) $(PKG_INSTALL_DIR)/etc/dovecot/* $(1)/etc/dovecot/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/dovecot/* $(1)/usr/lib/dovecot/
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/doc/dovecot/example-config $(1)/usr/share/doc/dovecot/example-config
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/doveconf $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
+       $(INSTALL_BIN) ./files/dovecot.init $(1)/etc/init.d/dovecot
+       rm  $(1)/usr/lib/dovecot/dovecot-config
+       find $(1)/usr/lib/dovecot/ -name "*.a" -o -name "*.la" | xargs rm
+endef
+
+$(eval $(call BuildPackage,dovecot))
diff --git a/mail/dovecot/files/dovecot.init b/mail/dovecot/files/dovecot.init
new file mode 100644 (file)
index 0000000..1f83184
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2013 OpenWrt.org
+
+START=75
+STOP=75
+
+USE_PROCD=1
+
+start_service() {
+       mkdir -p -m 0755 /var/lib/dovecot
+       mkdir -p -m 0755 /var/run/dovecot
+       chmod 0750 /var/lib/dovecot
+       procd_open_instance
+       procd_set_param command /usr/sbin/dovecot -F
+       procd_close_instance
+}
diff --git a/mail/dovecot/patches/001-configure_in.patch b/mail/dovecot/patches/001-configure_in.patch
new file mode 100644 (file)
index 0000000..7cf68fc
--- /dev/null
@@ -0,0 +1,31 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -488,9 +488,9 @@ have_ioloop=no
+ if test "$ioloop" = "best" || test "$ioloop" = "epoll"; then
+   AC_CACHE_CHECK([whether we can use epoll],i_cv_epoll_works,[
+-    AC_TRY_RUN([
++    AC_TRY_LINK([
+       #include <sys/epoll.h>
+-  
++    ], [
+       int main()
+       {
+       return epoll_create(5) < 1;
+@@ -594,7 +594,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,[
+-  AC_TRY_RUN([
++  AC_TRY_LINK([
+     #define _XOPEN_SOURCE 600
+     #include <stdio.h>
+     #include <stdlib.h>
+@@ -603,6 +603,7 @@ AC_CACHE_CHECK([whether posix_fallocate(
+     #if defined(__GLIBC__) && (__GLIBC__ < 2 || __GLIBC_MINOR__ < 7)
+       possibly broken posix_fallocate
+     #endif
++  ], [
+     int main() {
+       int fd = creat("conftest.temp", 0600);
+       int ret;
index a488908227f9d1ff359ba03f8aea3ee83a25e139..d2ab7d1f0d5b5bf9be2a90667b8c9c4b3a31b2eb 100644 (file)
@@ -63,7 +63,6 @@ config FFMPEG_CUSTOM_AUDIO_DEC_SUPPORT
        select FFMPEG_CUSTOM_DECODER_opus
        select FFMPEG_CUSTOM_DECODER_pcm_s16be
        select FFMPEG_CUSTOM_DECODER_pcm_s16le
-       select FFMPEG_CUSTOM_SELECT_speex
        select FFMPEG_CUSTOM_DECODER_vorbis
        select FFMPEG_CUSTOM_DECODER_wavpack
        select FFMPEG_CUSTOM_DECODER_wmav1
@@ -117,9 +116,6 @@ config FFMPEG_CUSTOM_SELECT_mp3lame
 config FFMPEG_CUSTOM_SELECT_libopus
        bool "Opus"
 
-config FFMPEG_CUSTOM_SELECT_speex
-       bool "Speex"
-
 config FFMPEG_CUSTOM_SELECT_x264
        bool "x264"
        depends on FFMPEG_CUSTOM_PATENTED
index a982ea7600cd23c090ec0a68ce13fb9fda65f2e9..f87401444dc7ecbc4ff1bd51abf8093803253303 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2016 OpenWrt.org
+# Copyright (C) 2006-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ffmpeg
-PKG_VERSION:=2.8.8
-PKG_RELEASE:=2
+PKG_VERSION:=3.2.2
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://ffmpeg.org/releases/
-PKG_MD5SUM:=5fae1ba5a5d37a2d0de750479b7270d4
+PKG_SOURCE_URL:=https://ffmpeg.org/releases/
+PKG_MD5SUM:=e34d1b92c5d844f2a3611c741a6dba18
+PKG_HASH:=3f01bd1fe1a17a277f8c84869e5d9192b4b978cb660872aa2b54c3cc8a2fedfc
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_LICENSE:=LGPL-2.1+ GPL-2+ LGPL-3
@@ -292,7 +293,7 @@ endef
 define Package/libffmpeg-custom
 $(call Package/libffmpeg/Default)
  TITLE+= (custom)
- DEPENDS+= +FFMPEG_CUSTOM_SELECT_libopus:libopus +FFMPEG_CUSTOM_SELECT_speex:libspeex \
+ DEPENDS+= +FFMPEG_CUSTOM_SELECT_libopus:libopus \
            +PACKAGE_libx264:libx264 +PACKAGE_lame-lib:lame-lib
 
  VARIANT:=custom
@@ -313,7 +314,6 @@ endef
 define Package/libffmpeg-audio-dec
 $(call Package/libffmpeg/Default)
  TITLE+= (audio)
- DEPENDS+= +libspeex
  VARIANT:=audio-dec
 endef
 
@@ -327,7 +327,7 @@ endef
 define Package/libffmpeg-full
 $(call Package/libffmpeg/Default)
  TITLE+= (full)
- DEPENDS+= +alsa-lib +PACKAGE_libx264:libx264 +PACKAGE_lame-lib:lame-lib +libopus +libspeex
+ DEPENDS+= +alsa-lib +PACKAGE_libx264:libx264 +PACKAGE_lame-lib:lame-lib +libopus
  VARIANT:=full
 endef
 
@@ -382,6 +382,8 @@ FFMPEG_CONFIGURE:= \
 ifeq ($(CONFIG_SOFT_FLOAT),y)
 FFMPEG_CONFIGURE += \
        --disable-altivec \
+       --disable-vsx \
+       --disable-power8 \
        --disable-amd3dnow \
        --disable-amd3dnowext \
        --disable-mmx \
@@ -397,11 +399,17 @@ FFMPEG_CONFIGURE += \
        --disable-fma3 \
        --disable-fma4 \
        --disable-avx2 \
+       --disable-aesni \
+       --disable-armv5te \
+       --disable-armv6 \
+       --disable-armv6t2 \
        --disable-inline-asm \
-       --disable-mips32r2 \
-       --disable-mipsdspr1 \
+       --disable-mipsdsp \
        --disable-mipsdspr2 \
        --disable-mipsfpu \
+       --disable-msa \
+       --disable-mmi \
+       --disable-fast-unaligned \
        --disable-runtime-cpudetect
 
 else ifneq ($(findstring arm,$(CONFIG_ARCH)),)
@@ -434,7 +442,6 @@ endif
 ifeq ($(BUILD_VARIANT),full)
        FFMPEG_CONFIGURE+= \
                --enable-libopus --enable-decoder=libopus \
-               --enable-libspeex --enable-decoder=libspeex \
                $(if $(CONFIG_PACKAGE_libx264),--enable-libx264) \
                $(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame)
 endif
@@ -473,11 +480,6 @@ ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libopus),y)
        --enable-libopus --enable-decoder=libopus
 endif
 
-ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_speex),y)
-  FFMPEG_CONFIGURE+= \
-       --enable-libspeex --enable-decoder=libspeex
-endif
-
 ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_x264),y)
   FFMPEG_CONFIGURE+= \
        --enable-libx264
@@ -508,7 +510,6 @@ ifeq ($(BUILD_VARIANT),audio-dec)
        $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_AUDIO_DEMUXERS)) \
        $(call FFMPEG_ENABLE,parser,$(FFMPEG_AUDIO_PARSERS)) \
        $(call FFMPEG_ENABLE,protocol,$(FFMPEG_AUDIO_PROTOCOLS)) \
-       --enable-libspeex --enable-decoder=libspeex \
        --disable-decoder=pcm_bluray,pcm_dvd \
 
 endif
index 66875d5dad35ea9b7a12078aa9c60fc4daa7876d..2daa0d573767169888279f5c2435e0c423f14c75 100644 (file)
@@ -56,13 +56,13 @@ define Build/InstallDev
        $(INSTALL_DATA) \
                $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
                $(1)/usr/lib/pkgconfig/
-       $(INSTALL_DIR) $(STAGING_DIR)/host/share/vala-0.30/vapi/
+       $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/share/vala-0.30/vapi/
        # Note: this are compiled elsewhere because grilo refuses to
        # generate VAPI files unless gobject-introspection exists;
        # OpenWrt does not yet have a gobject-introspection package.
        $(INSTALL_DATA) \
                ./files/*.vapi \
-               $(STAGING_DIR)/host/share/vala-0.30/vapi
+               $(STAGING_DIR_HOSTPKG)/share/vala-0.30/vapi
 endef
 
 define Package/grilo/install
diff --git a/multimedia/gst1-libav/Config.in b/multimedia/gst1-libav/Config.in
new file mode 100644 (file)
index 0000000..b394d7d
--- /dev/null
@@ -0,0 +1,279 @@
+menu "Select GStreamer libav configuration options"
+       depends on PACKAGE_gst1-libav
+
+config GST1_LIBAV_IPV6
+       bool "Enable IPv6"
+       default IPV6
+
+config GST1_LIBAV_PATENTED
+       bool "Include patented codecs and technologies"
+       default BUILD_PATENTED
+
+config GET_LIBAV_COMMON_AV_SUPPORT
+       bool "Include support for common audio/video decoders"
+       default y
+       select GST1_LIBAV_DECODER_aac if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_ac3 if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_h264 if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_atrac3 if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_jpegls
+       select GST1_LIBAV_DECODER_mp3 if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_mpeg1video
+       select GST1_LIBAV_DECODER_mpeg2video if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_mpeg4 if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_mpeg4aac if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_mpegvideo
+       select GST1_LIBAV_DECODER_pcm_s16be
+       select GST1_LIBAV_DECODER_pcm_s16le
+       select GST1_LIBAV_DECODER_vorbis
+       select GST1_LIBAV_DECODER_wmav1 if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_wmav2 if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_png
+       select GST1_LIBAV_PARSER_aac if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_PARSER_h264 if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_PARSER_mpegaudio
+       select GST1_LIBAV_PARSER_mpegvideo
+       select GST1_LIBAV_PARSER_mpeg4video
+       select GST1_LIBAV_DEMUXER_ac3
+       select GST1_LIBAV_DEMUXER_h264 if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DEMUXER_mp3 if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DEMUXER_mpegvideo if GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DEMUXER_ogg
+
+comment "Encoders ---"
+
+config GST1_LIBAV_ENCODER_ac3
+       bool "AC3"
+       depends on GST1_LIBAV_PATENTED
+       select GST1_LIBAV_PARSER_ac3
+
+config GST1_LIBAV_ENCODER_jpegls
+       bool "JPEG-LS"
+
+config GST1_LIBAV_ENCODER_mpeg1video
+       bool "MPEG-1 Video"
+
+config GST1_LIBAV_ENCODER_mpeg2video
+       bool "MPEG-2 Video"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_ENCODER_mpeg4
+       bool "MPEG-4"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_ENCODER_pcm_s16be
+       bool "PCM signed 16-bit big-endian"
+
+config GST1_LIBAV_ENCODER_pcm_s16le
+       bool "PCM signed 16-bit little-endian"
+
+config GST1_LIBAV_ENCODER_png
+       bool "PNG"
+       select GST1_LIBAV_ENCODER_zlib
+
+config GST1_LIBAV_ENCODER_vorbis
+       bool "Vorbis"
+
+config GST1_LIBAV_ENCODER_zlib
+       bool "Zlib"
+
+comment "Decoders ---"
+
+config GST1_LIBAV_DECODER_aac
+       bool "AAC (Advanced Audio Coding)"
+       depends on GST1_LIBAV_PATENTED
+       select GST1_LIBAV_PARSER_aac
+
+config GST1_LIBAV_DECODER_ac3
+       bool "AC3"
+       depends on GST1_LIBAV_PATENTED
+       select GST1_LIBAV_PARSER_ac3
+
+config GST1_LIBAV_DECODER_atrac3
+       bool "ATRAC3"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_DECODER_gif
+       bool "GIF"
+
+config GST1_LIBAV_DECODER_h264
+       bool "H.264"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_DECODER_jpegls
+       bool "JPEG-LS"
+
+config GST1_LIBAV_DECODER_mp2
+       bool "MP2 (MPEG Audio Layer 2)"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_DECODER_mp3
+       bool "MP3 (MPEG Audio Layer 2)"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_DECODER_mpegvideo
+       bool "MPEG Video"
+
+config GST1_LIBAV_DECODER_mpeg1video
+       bool "MPEG-1 Video"
+
+config GST1_LIBAV_DECODER_mpeg2video
+       bool "MPEG-2 Video"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_DECODER_mpeg4
+       bool "MPEG-4"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_DECODER_mpeg4aac
+       bool "MPEG-4 (AAC)"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_DECODER_pcm_s16be
+       bool "PCM signed 16-bit big-endian"
+
+config GST1_LIBAV_DECODER_pcm_s16le
+       bool "PCM signed 16-bit little-endian"
+
+config GST1_LIBAV_DECODER_png
+       bool "PNG"
+       select GST1_LIBAV_DECODER_zlib
+
+config GST1_LIBAV_DECODER_vorbis
+       bool "Vorbis"
+
+config GST1_LIBAV_DECODER_wmav1
+       bool "WMAv1"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_DECODER_wmav2
+       bool "WMAv2"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_DECODER_zlib
+       bool "Zlib"
+
+comment "Muxers ---"
+
+config GST1_LIBAV_MUXER_ac3
+       bool "AC3"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_MUXER_ffm
+       bool "FFM (ffserver live feed)"
+
+config GST1_LIBAV_MUXER_h264
+       bool "H.264"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_MUXER_mp3
+       bool "MP3 (MPEG Audio Layer 3)"
+
+config GST1_LIBAV_MUXER_mp4
+       bool "MP4"
+
+config GST1_LIBAV_MUXER_mpeg1video
+       bool "MPEG-1 Video"
+
+config GST1_LIBAV_MUXER_mpeg2video
+       bool "MPEG-2 Video"
+
+config GST1_LIBAV_MUXER_mpegts
+       bool "MPEG-2 (TS)"
+
+config GST1_LIBAV_MUXER_ogg
+       bool "Ogg"
+
+config GST1_LIBAV_MUXER_oss
+       bool "OSS (Open Sound System playback)"
+
+config GST1_LIBAV_MUXER_rtp
+       bool "RTP"
+
+comment "Demuxers ---"
+
+config GST1_LIBAV_DEMUXER_ac3
+       bool "AC3"
+
+config GST1_LIBAV_DEMUXER_ffm
+       bool "FFM (ffserver live feed)"
+
+config GST1_LIBAV_DEMUXER_h264
+       bool "H.264"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_DEMUXER_mp3
+       bool "MP3 (MPEG Audio Layer 3)"
+
+config GST1_LIBAV_DEMUXER_mpegvideo
+       bool "MPEG Video"
+
+config GST1_LIBAV_DEMUXER_mpegps
+       bool "MPEG-2 (PS)"
+
+config GST1_LIBAV_DEMUXER_mpegts
+       bool "MPEG-2 (TS)"
+
+config GST1_LIBAV_DEMUXER_ogg
+       bool "Ogg"
+
+config GST1_LIBAV_DEMUXER_rm
+       bool "RM"
+       help
+         RealMedia format demuxer
+
+config GST1_LIBAV_DEMUXER_rtsp
+       bool "RTSP"
+       select GST1_LIBAV_DEMUXER_rm
+       select GST1_LIBAV_DEMUXER_sdp
+
+config GST1_LIBAV_DEMUXER_sdp
+       bool "SDP"
+       select GST1_LIBAV_DEMUXER_mpegts
+
+comment "Parsers ---"
+
+config GST1_LIBAV_PARSER_aac
+       bool "AAC (Advanced Audio Coding)"
+       depends on GST1_LIBAV_PATENTED
+
+config GST1_LIBAV_PARSER_ac3
+       bool "AC3"
+
+config GST1_LIBAV_PARSER_h264
+       bool "H.264"
+       depends on GST1_LIBAV_PATENTED
+       select GST1_LIBAV_DECODER_h264
+
+config GST1_LIBAV_PARSER_mpegaudio
+       bool "MPEG Audio"
+
+config GST1_LIBAV_PARSER_mpegvideo
+       bool "MPEG Video"
+
+config GST1_LIBAV_PARSER_mpeg4video
+       bool "MPEG-4 Video"
+
+comment "Protocols ---"
+
+config GST1_LIBAV_PROTOCOL_file
+       bool "file:"
+
+config GST1_LIBAV_PROTOCOL_http
+       bool "http:"
+
+config GST1_LIBAV_PROTOCOL_pipe
+       bool "pipe:"
+
+config GST1_LIBAV_PROTOCOL_rtp
+       bool "rtp:"
+       select GST1_LIBAV_PROTOCOL_udp
+
+config GST1_LIBAV_PROTOCOL_tcp
+       bool "tcp:"
+
+config GST1_LIBAV_PROTOCOL_udp
+       bool "udp:"
+
+endmenu
+
diff --git a/multimedia/gst1-libav/Makefile b/multimedia/gst1-libav/Makefile
new file mode 100644 (file)
index 0000000..bed00ac
--- /dev/null
@@ -0,0 +1,198 @@
+#
+# Copyright (C) 2006-2016 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:=gst1-libav
+PKG_VERSION:=1.8.2
+PKG_RELEASE:=2
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
+               Ted Hess <thess@kitschensync.net>
+
+PKG_SOURCE:=gst-libav-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-libav
+PKG_MD5SUM:=b5f3c7a27b39b5f5c2f0bfd546b0c655020faf6b38d27b64b346c43e5ebf687a
+
+PKG_LICENSE:=GPL-2.0 LGPL-2.0
+PKG_LICENSE_FILES:=COPYING COPYING.LIB
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/gst-libav-$(PKG_VERSION)
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+PKG_USE_MIPS16:=0
+
+GST_VERSION:=1.0
+
+LIBAV_ENCODERS:= \
+       ac3 \
+       jpegls \
+       mpeg1video \
+       mpeg2video \
+       mpeg4 \
+       pcm_s16be \
+       pcm_s16le \
+       png \
+       vorbis \
+       zlib \
+
+LIBAV_DECODERS:= \
+       aac \
+       ac3 \
+       atrac3 \
+       gif \
+       h264 \
+       jpegls \
+       mp2 \
+       mp3 \
+       mpeg1video \
+       mpeg2video \
+       mpeg4 \
+       mpegvideo \
+       pcm_s16be \
+       pcm_s16le \
+       png \
+       vorbis \
+       wmav1 \
+       wmav2 \
+       zlib \
+
+LIBAV_MUXERS:= \
+       ac3 \
+       ffm \
+       h264 \
+       mp3 \
+       mp4 \
+       mpeg1video \
+       mpeg2video \
+       mpegts \
+       ogg \
+       oss \
+       rtp \
+
+LIBAV_DEMUXERS:= \
+       ac3 \
+       ffm \
+       h264 \
+       mp3 \
+       mpegps \
+       mpegts \
+       mpegvideo \
+       ogg \
+       rm \
+       rtsp \
+       sdp \
+       v4l2 \
+
+LIBAV_PARSERS:= \
+       aac \
+       ac3 \
+       h264 \
+       mpegaudio \
+       mpegvideo \
+       mpeg4video \
+
+LIBAV_PROTOCOLS:= \
+       file http pipe rtp tcp udp
+
+PKG_CONFIG_DEPENDS:= \
+       $(patsubst %,CONFIG_GST1_LIBAV_ENCODER_%,$(LIBAV_ENCODERS)) \
+       $(patsubst %,CONFIG_GST1_LIBAV_DECODER_%,$(LIBAV_DECODERS)) \
+       $(patsubst %,CONFIG_GST1_LIBAV_MUXER_%,$(LIBAV_DEMUXERS)) \
+       $(patsubst %,CONFIG_GST1_LIBAV_DEMUXER_%,$(LIBAV_DEMUXERS)) \
+       $(patsubst %,CONFIG_GST1_LIBAV_PARSER_%,$(LIBAV_PARSERS)) \
+       $(patsubst %,CONFIG_GST1_LIBAV_PROTOCOL_%,$(LIBAV_PROTOCOLS))
+
+PKG_BUILD_DEPENDS:= libgstreamer1 gstreamer1-plugins-base
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/gst1-libav
+  SECTION:=multimedia
+  CATEGORY:=Multimedia
+  TITLE:=GStreamer Libav plugin
+  URL:=http://www.gstreamer.net/modules/gst-libav.html
+  DEPENDS:= +libgstreamer1 +gstreamer1-plugins-base \
+           +gst1-mod-alsa +libgst1audio +libgst1pbutils +libgst1video \
+           +libbz2 +liblzma
+endef
+
+define Package/gst1-libav/description
+  GStreamer with libav bindings using internal Libav
+endef
+
+define Package/gst1-libav/config
+  source "$(SOURCE)/Config.in"
+endef
+
+FILTER_CONFIG= \
+       $(foreach c, $(3), \
+               $(if $(CONFIG_GST1_LIBAV_$(1)_$(c)),--enable-$(2)='$(c)') \
+       )
+
+LIBAV_CONFIGURE_ENCODERS:=$(call FILTER_CONFIG,ENCODER,encoder,$(LIBAV_ENCODERS))
+LIBAV_CONFIGURE_DECODERS:=$(call FILTER_CONFIG,DECODER,decoder,$(LIBAV_DECODERS))
+LIBAV_CONFIGURE_MUXERS:=$(call FILTER_CONFIG,MUXER,muxer,$(LIBAV_MUXERS))
+LIBAV_CONFIGURE_DEMUXERS:=$(call FILTER_CONFIG,DEMUXER,demuxer,$(LIBAV_DEMUXERS))
+LIBAV_CONFIGURE_PARSERS:=$(call FILTER_CONFIG,PARSER,parser,$(LIBAV_PARSERS))
+LIBAV_CONFIGURE_PROTOCOLS:=$(call FILTER_CONFIG,PROTOCOL,protocol,$(LIBAV_PROTOCOLS))
+
+CONFIGURE_ARGS += \
+       --without-system-libav \
+       --with-libav-extra-configure="--target-os=linux \
+       $(if $(findstring " ",$(CONFIG_CPU_TYPE)),,--cpu=$(CONFIG_CPU_TYPE)) \
+       --disable-bsfs \
+       --disable-programs \
+       --disable-devices \
+       --disable-encoders \
+       $(LIBAV_CONFIGURE_ENCODERS) \
+       --disable-decoders \
+       $(LIBAV_CONFIGURE_DECODERS) \
+       --disable-muxers \
+       $(LIBAV_CONFIGURE_MUXERS) \
+       --disable-demuxers \
+       $(LIBAV_CONFIGURE_DEMUXERS) \
+       --disable-parsers \
+       $(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-inline-asm \
+       --disable-yasm"
+
+TARGET_CFLAGS += -D_GNU_SOURCE
+
+TARGET_LDFLAGS += $(FPIC)
+
+define Package/gst1-libav/install
+       $(INSTALL_DIR) $(1)/usr/lib/gstreamer-$(GST_VERSION)
+       ( cd $(PKG_INSTALL_DIR); $(CP) \
+                ./usr/lib/gstreamer-$(GST_VERSION)/libgstlibav.so* \
+                $(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
+        )
+endef
+
+$(eval $(call BuildPackage,gst1-libav))
index ea115f3a997307d579e62d902338c166603cfff1..2ef95b78137fd9f32c59f450846f7bbfdc089f05 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2006-2011 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -9,25 +7,28 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=icecast
 PKG_VERSION:=2.4.3
-PKG_RELEASE:=2
-PKG_LICENSE:=GPL-2.0
-PKG_MAINTAINER:=André Gaul <andre@gaul.io>
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://downloads.xiph.org/releases/icecast/
+PKG_SOURCE_URL:=https://downloads.xiph.org/releases/icecast/
 PKG_MD5SUM:=83d7d34dbe22f0f8fc119d2c9839efc0
+PKG_HASH:=c85ca48c765d61007573ee1406a797ae6cb31fb5961a42e7f1c87adb45ddc592
+
+PKG_MAINTAINER:=André Gaul <andre@gaul.io>, \
+               Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
 
 PKG_FIXUP:=autoreconf
+PKG_INSTALL:= 1
 
 include $(INCLUDE_DIR)/package.mk
 
-TREMOR_BUILD_DIR=$(PKG_BUILD_DIR)/libvorbisidec-1.2.0-dave
-TREMOR_DIR=$(TREMOR_BUILD_DIR)/ipkg-install/usr
-
 define Package/icecast
   SECTION:=multimedia
   CATEGORY:=Multimedia
-  DEPENDS:=+libcurl +libxml2 +libxslt +libogg +libopenssl
+  DEPENDS:=+libcurl +libxml2 +libxslt +libogg +libvorbisidec
   TITLE:=A streaming media server for Ogg/Vorbis and MP3 audio streams
   USERID:=icecast=87:icecast=87
   URL:=http://www.icecast.org/
@@ -42,39 +43,22 @@ define Package/icecast/description
        interaction.
 endef
 
-define Build/Prepare
-       $(Build/Prepare/Default)
-       $(SUBMAKE) -f libvorbisidec.mk \
-               BUILD_DIR="$(PKG_BUILD_DIR)" \
-               V=99 \
-               prepare
-endef
+CONFIGURE_ARGS+= \
+       --enable-yp \
+       --with-openssl="no" \
+       --with-curl="yes" \
+       --with-curl-config="$(STAGING_DIR)/usr/bin/curl-config" \
+       --with-ogg="$(STAGING_DIR)/usr" \
+       --with-speex="no" \
+       --with-theora="no" \
+       --with-vorbis="$(STAGING_DIR)/usr" \
+       --with-xslt-config="$(STAGING_DIR)/usr/bin/xslt-config"
 
-define Build/Configure
-       $(MAKE) -f libvorbisidec.mk \
-               BUILD_DIR="$(PKG_BUILD_DIR)" \
-               V=99 \
-               compile
-       $(SED) 's,-lvorbis ,$(TREMOR_DIR)/lib/libvorbisidec.a -logg ,g' $(PKG_BUILD_DIR)/configure
-       $(call Build/Configure/Default, \
-               --enable-yp \
-               --with-curl="yes" \
-               --with-curl-config="$(STAGING_DIR)/usr/bin/curl-config" \
-               --with-ogg="$(STAGING_DIR)/usr" \
-               --with-speex="no" \
-               --with-theora="no" \
-               --with-vorbis="$(TREMOR_DIR)" \
-               --with-xslt-config="$(STAGING_DIR)/usr/bin/xslt-config" \
-               , \
-               CPPFLAGS="-I$(TREMOR_DIR)/include -I$(STAGING_DIR)/usr/include/libxml2 $(TARGET_CPPFLAGS)" \
-       )
-endef
 
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               DESTDIR="$(PKG_INSTALL_DIR)" \
-               INCLUDES="-I$(PKG_BUILD_DIR)/src -I$(TREMOR_DIR)/include" \
-               all install
+# Manually edit configure in case both vorbis and tremor host packages are installed
+define Build/Configure
+       $(SED) 's,-lvorbis -lm,-lvorbisidec -logg ,g' $(PKG_BUILD_DIR)/configure
+       $(call Build/Configure/Default)
 endef
 
 define Package/icecast/install
diff --git a/multimedia/icecast/libvorbisidec.mk b/multimedia/icecast/libvorbisidec.mk
deleted file mode 100644 (file)
index eda6e76..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-# 
-# Copyright (C) 2006 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:=icecast-libvorbisidec
-PKG_VERSION:=1.2.0-dave
-PKG_RELEASE:=1
-
-PKG_SOURCE:=libvorbisidec-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://users.tpg.com.au/davico/openwrt/
-PKG_MD5SUM:=cb8e51aab92ef164f8e0e8853f7164fa
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/libvorbisidec-$(PKG_VERSION)
-PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
-PATCH_DIR=./patches-libvorbisidec
-
-include $(INCLUDE_DIR)/package.mk
-
-define Build/Configure
-       $(call Build/Configure/Default, \
-               --disable-shared \
-               --enable-static \
-       )
-endef
-
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               DESTDIR="$(PKG_INSTALL_DIR)" \
-               all install
-endef
-
-define Build/InstallDev
-       true
-endef
-
-$(eval $(call Build/DefaultTargets))
index 6fa6f0822b52f783e38c38c671ff4a0254b214f9..49861d2e3eaecce8e82578c8fa19292a1f087ac1 100644 (file)
---- a/src/format_flac.c
-+++ b/src/format_flac.c
-@@ -18,7 +18,7 @@
- #endif
- #include <stdlib.h>
--#include <ogg/ogg.h>
-+#include <tremor/ogg.h>
- #include <string.h>
- typedef struct source_tag source_t;
---- a/src/format_midi.c
-+++ b/src/format_midi.c
-@@ -18,7 +18,7 @@
- #endif
- #include <stdlib.h>
--#include <ogg/ogg.h>
-+#include <tremor/ogg.h>
- #include <string.h>
- typedef struct source_tag source_t;
---- a/src/format_ogg.c
-+++ b/src/format_ogg.c
-@@ -24,7 +24,7 @@
- #include <stdlib.h>
- #include <string.h>
--#include <ogg/ogg.h>
-+#include <tremor/ogg.h>
- #include "refbuf.h"
- #include "source.h"
---- a/src/format_ogg.h
-+++ b/src/format_ogg.h
-@@ -18,7 +18,7 @@
- #ifndef __FORMAT_OGG_H__
- #define __FORMAT_OGG_H__
--#include <ogg/ogg.h>
-+#include <tremor/ogg.h>
- #include "refbuf.h"
- #include "format.h"
---- a/src/format_speex.c
-+++ b/src/format_speex.c
-@@ -18,7 +18,7 @@
- #endif
- #include <stdlib.h>
--#include <ogg/ogg.h>
-+#include <tremor/ogg.h>
- #include <speex/speex_header.h>
- typedef struct source_tag source_t;
---- a/src/format_theora.c
-+++ b/src/format_theora.c
-@@ -18,7 +18,7 @@
- #endif
- #include <stdlib.h>
--#include <ogg/ogg.h>
-+#include <tremor/ogg.h>
- #include <theora/theora.h>
- typedef struct source_tag source_t;
 --- a/src/format_vorbis.c
 +++ b/src/format_vorbis.c
-@@ -18,8 +18,8 @@
- #endif
+@@ -19,7 +19,7 @@
  
  #include <stdlib.h>
--#include <ogg/ogg.h>
+ #include <ogg/ogg.h>
 -#include <vorbis/codec.h>
-+#include <tremor/ogg.h>
 +#include <tremor/ivorbiscodec.h>
  #include <memory.h>
  #include <string.h>
  
---- a/src/source.c
-+++ b/src/source.c
-@@ -19,7 +19,7 @@
- #include <stdlib.h>
- #include <string.h>
- #include <sys/types.h>
--#include <ogg/ogg.h>
-+#include <tremor/ogg.h>
- #include <errno.h>
- #ifndef _WIN32
---- a/src/format_kate.c
-+++ b/src/format_kate.c
-@@ -19,7 +19,7 @@
- #include <stdlib.h>
- #include <string.h>
--#include <ogg/ogg.h>
-+#include <tremor/ogg.h>
- #ifdef HAVE_KATE
- #include <kate/oggkate.h>
- #endif
+@@ -34,6 +34,7 @@
+ #define CATMODULE "format-vorbis"
+ #include "logging.h"
++int vorbis_commentheader_out(vorbis_comment *vc, ogg_packet *op);
+ typedef struct vorbis_codec_tag
+ {
+@@ -583,3 +584,91 @@ static refbuf_t *process_vorbis_page (og
+     return NULL;
+ }
++/* Some additional functions from vorbis missing from tremor */
++
++static void _v_writestring(oggpack_buffer *o,char *s, int bytes)
++{
++
++  while(bytes--){
++    oggpack_write(o,*s++,8);
++  }
++}
++
++static int _vorbis_pack_comment(oggpack_buffer *opb,vorbis_comment *vc)
++{
++  char temp[]="Xiph.Org libVorbis I 20150104";
++  int bytes = strlen(temp);
++
++  /* preamble */
++  oggpack_write(opb,0x03,8);
++  _v_writestring(opb,"vorbis", 6);
++
++  /* vendor */
++  oggpack_write(opb,bytes,32);
++  _v_writestring(opb,temp, bytes);
++
++  /* comments */
++
++  oggpack_write(opb,vc->comments,32);
++  if(vc->comments){
++    int i;
++    for(i=0;i<vc->comments;i++){
++      if(vc->user_comments[i]){
++      oggpack_write(opb,vc->comment_lengths[i],32);
++      _v_writestring(opb,vc->user_comments[i], vc->comment_lengths[i]);
++      }else{
++      oggpack_write(opb,0,32);
++      }
++    }
++  }
++  oggpack_write(opb,1,1);
++
++  return(0);
++}
++
++void vorbis_comment_add(vorbis_comment *vc,char *comment)
++{
++  vc->user_comments=_ogg_realloc(vc->user_comments,
++                          (vc->comments+2)*sizeof(*vc->user_comments));
++  vc->comment_lengths=_ogg_realloc(vc->comment_lengths,
++                                  (vc->comments+2)*sizeof(*vc->comment_lengths));
++  vc->comment_lengths[vc->comments]=strlen(comment);
++  vc->user_comments[vc->comments]=_ogg_malloc(vc->comment_lengths[vc->comments]+1);
++  strcpy(vc->user_comments[vc->comments], comment);
++  vc->comments++;
++  vc->user_comments[vc->comments]=NULL;
++}
++
++void vorbis_comment_add_tag(vorbis_comment *vc, char *tag, char *contents)
++{
++  char *comment=alloca(strlen(tag)+strlen(contents)+2); /* +2 for = and \0 */
++  strcpy(comment, tag);
++  strcat(comment, "=");
++  strcat(comment, contents);
++  vorbis_comment_add(vc, comment);
++
++  return;
++}
++
++int vorbis_commentheader_out(vorbis_comment *vc, ogg_packet *op)
++{
++  oggpack_buffer opb;
++
++  oggpack_writeinit(&opb);
++  if(_vorbis_pack_comment(&opb,vc)){
++    oggpack_writeclear(&opb);
++    return OV_EIMPL;
++  }
++
++  op->packet = _ogg_malloc(oggpack_bytes(&opb));
++  memcpy(op->packet, opb.buffer, oggpack_bytes(&opb));
++
++  op->bytes=oggpack_bytes(&opb);
++  op->b_o_s=0;
++  op->e_o_s=0;
++  op->granulepos=0;
++  op->packetno=1;
++
++  oggpack_writeclear(&opb);
++  return 0;
++}
 --- a/m4/vorbis.m4
 +++ b/m4/vorbis.m4
 @@ -38,9 +38,9 @@ if test "x$vorbis_prefix" != "x$ogg_pref
  
  #
  # check if the installed Ogg is sufficiently new.
-@@ -42,7 +42,7 @@ LIBS="$LIBS $OGG_LIBS"
- LDFLAGS="$LDFLAGS $OGG_LDFLAGS"
- AC_TRY_LINK_FUNC(ogg_sync_init,
-     [ xt_cv_lib_ogg=ok ],
--    [ AC_TRY_LINK([#include <ogg/ogg.h>],, 
-+    [ AC_TRY_LINK([#include <tremor/ogg.h>],, 
-         [ xt_cv_lib_ogg="pre v1.0, needs updating" ],
-         [ xt_cv_lib_ogg="not found" ])
-     ])
diff --git a/multimedia/icecast/patches/005-no_examples_doc_win32.patch b/multimedia/icecast/patches/005-no_examples_doc_win32.patch
new file mode 100644 (file)
index 0000000..178df54
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -3,7 +3,7 @@
+ AUTOMAKE_OPTIONS = foreign dist-zip
+ ACLOCAL_AMFLAGS = -I m4
+-SUBDIRS = src conf doc web admin win32 examples
++SUBDIRS = src conf web admin
+ EXTRA_DIST = HACKING m4/acx_pthread.m4 m4/ogg.m4 \
+     m4/theora.m4 m4/vorbis.m4 m4/speex.m4 \
+@@ -11,7 +11,7 @@ EXTRA_DIST = HACKING m4/acx_pthread.m4 m
+     m4/xiph_types.m4 m4/xiph_xml2.m4
+ docdir = $(datadir)/doc/$(PACKAGE)
+-doc_DATA = README AUTHORS COPYING NEWS TODO ChangeLog
++doc_DATA = README AUTHORS COPYING
+ debug:
+       $(MAKE) all CFLAGS="@DEBUG@"
diff --git a/multimedia/icecast/patches/015-add_with-openssl_option.patch b/multimedia/icecast/patches/015-add_with-openssl_option.patch
new file mode 100644 (file)
index 0000000..f0a5b70
--- /dev/null
@@ -0,0 +1,25 @@
+--- a/m4/xiph_openssl.m4
++++ b/m4/xiph_openssl.m4
+@@ -30,13 +30,15 @@ else
+ fi
+ # Now try linking to openssl
+-xt_save_CFLAGS="$CFLAGS"
+-xt_save_LIBS="$LIBS"
+-CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
+-LIBS="$OPENSSL_LIBS $LIBS"
+-AC_TRY_LINK([#include <openssl/ssl.h>], [void *a = SSL_new], [openssl_ok='yes'])
+-CFLAGS="$xt_save_CFLAGS"
+-LIBS="$xt_save_LIBS"
++if test "x$openssl_prefix" != "xno"; then
++    xt_save_CFLAGS="$CFLAGS"
++    xt_save_LIBS="$LIBS"
++    CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
++    LIBS="$OPENSSL_LIBS $LIBS"
++    AC_TRY_LINK([#include <openssl/ssl.h>], [void *a = SSL_new], [openssl_ok='yes'])
++    CFLAGS="$xt_save_CFLAGS"
++    LIBS="$xt_save_LIBS"
++fi
+ if test "$openssl_ok" = "yes"; then
+     AC_DEFINE(HAVE_OPENSSL, 1, [Define if you have libopenssl.])
index a3cb714aeab3ae6198ab5769467c3c8dddda80c9..c0569ab4fddd7c99f1ca9a94f729b297db6cb144 100644 (file)
@@ -1,7 +1,4 @@
 #
-# Copyright (C) 2009-2015 OpenWrt.org
-# Copyright (C) 2009 Freifunk Leipzig
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -18,7 +15,8 @@ PKG_MD5SUM:=832c448cc993170a70fd95804fcda5b2
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
-PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>, \
+               Ted Hess <thess@kitschensync.net>
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
@@ -41,7 +39,9 @@ endef
 
 CONFIGURE_ARGS+= \
        --with-ogg="$(STAGING_DIR)/usr/include" \
-       --with-vorbis="$(STAGING_DIR)/usr/include" \
+       --with-vorbis="$(STAGING_DIR)/usr/include"
+
+TARGET_LDFLAGS+= -logg
 
 define Package/ices/install
        $(INSTALL_DIR) $(1)/usr/bin
index 08a11d73a4496e58a977564b18db3e9aec1eef9f..15117902e94944258feb999e3fddf89d4f8aceb2 100644 (file)
@@ -1,34 +1,33 @@
 #
-# Copyright (C) 2015-2016 OpenWrt.org
-#
+# Copyright (c) 2015-2017 Dirk Brenken (dev@brenken.org)
 # This is free software, licensed under the GNU General Public License v3.
 #
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=adblock
-PKG_VERSION:=1.5.4
+PKG_VERSION:=2.6.2
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-3.0+
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/$(PKG_NAME)
+define Package/adblock
        SECTION:=net
        CATEGORY:=Network
        TITLE:=Powerful adblock script to block ad/abuse domains
        PKGARCH:=all
 endef
 
-define Package/$(PKG_NAME)/description
-Powerful adblock script to block ad/abuse domains.
+define Package/adblock/description
+Powerful adblock script to block ad/abuse domains via dnsmasq or unbound dns backend.
 The script supports many domain blacklist sites plus manual black- and whitelist overrides.
 Please see https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md for further information.
 
 endef
 
-define Package/$(PKG_NAME)/conffiles
+define Package/adblock/conffiles
 /etc/config/adblock
 /etc/adblock/adblock.whitelist
 /etc/adblock/adblock.blacklist
@@ -43,13 +42,9 @@ endef
 define Build/Compile
 endef
 
-define Package/$(PKG_NAME)/install
+define Package/adblock/install
        $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) ./files/adblock-update.sh $(1)/usr/bin/
-       $(INSTALL_DATA) ./files/adblock-helper.sh $(1)/usr/bin/
-
-       $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
-       $(INSTALL_BIN) ./files/adblock.hotplug $(1)/etc/hotplug.d/iface/90-adblock
+       $(INSTALL_BIN) ./files/adblock.sh $(1)/usr/bin/
 
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/adblock.init $(1)/etc/init.d/adblock
@@ -58,12 +53,8 @@ define Package/$(PKG_NAME)/install
        $(INSTALL_CONF) ./files/adblock.conf $(1)/etc/config/adblock
 
        $(INSTALL_DIR) $(1)/etc/adblock
-       $(INSTALL_CONF) ./files/adblock.conf $(1)/etc/adblock/adblock.conf.default
        $(INSTALL_CONF) ./files/adblock.blacklist $(1)/etc/adblock/
        $(INSTALL_CONF) ./files/adblock.whitelist $(1)/etc/adblock/
-
-       $(INSTALL_DIR) $(1)/www/adblock
-       $(INSTALL_DATA) ./files/www/adblock/* $(1)/www/adblock/
 endef
 
-$(eval $(call BuildPackage,$(PKG_NAME)))
+$(eval $(call BuildPackage,adblock))
index 043b99adde3a2315757b2781923c5274fb329995..6950ec792be239258fb0a2699c67897c0f30bc69 100644 (file)
@@ -1,12 +1,14 @@
 # dns based ad/abuse domain blocking
 
 ## Description
-A lot of people already use adblocker plugins within their desktop browsers, but what if you are using your (smart) phone, tablet, watch or any other wlan gadget...getting rid of annoying ads, trackers and other abuse sites (like facebook ;-) is simple: block them with your router. When the dns server on your router receives dns requests, you will sort out queries that ask for the resource records of ad servers and return the local ip address of your router and the internal web server delivers a transparent pixel instead.  
+A lot of people already use adblocker plugins within their desktop browsers, but what if you are using your (smart) phone, tablet, watch or any other wlan gadget...getting rid of annoying ads, trackers and other abuse sites (like facebook ;-) is simple: block them with your router. When the dns server on your router receives dns requests, you will sort out queries that ask for the resource records of ad servers and return a simple 'NXDOMAIN'. This is nothing but **N**on-e**X**istent Internet or Intranet domain name, if domain name is unable to resolved using the dns server, a condition called the 'NXDOMAIN' occurred.  
 
 ## Main Features
-* support of the following domain blocklist sources (free for private usage, for commercial use please check their individual licenses):
+* support of the following domain block list sources (free for private usage, for commercial use please check their individual licenses):
     * [adaway](https://adaway.org)
     * => infrequent updates, approx. 400 entries (enabled by default)
+    * [adguard](https://adguard.com)
+    * => numerous updates on the same day, approx. 12.000 entries
     * [blacklist]()
     * => static local blacklist, located by default in '/etc/adblock/adblock.blacklist'
     * [disconnect](https://disconnect.me)
@@ -27,10 +29,14 @@ A lot of people already use adblocker plugins within their desktop browsers, but
     * => daily updates, approx. 15 entries
     * [ransomware tracker](https://ransomwaretracker.abuse.ch)
     * => daily updates, approx. 150 entries
-    * [rolist/easylist](https://easylist-downloads.adblockplus.org/rolist+easylist.txt)
-    * => weekly updates, approx. 600 entries
-    * [ruadlist/easylist](https://code.google.com/p/ruadlist)
-    * => weekly updates, approx. 2.000 entries
+    * [reg_cn](https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt)
+    * => regional blocklist for China, daily updates, approx. 1.600 entries
+    * [reg_pl](http://adblocklist.org)
+    * => regional blocklist for Poland, daily updates, approx. 50 entries
+    * [reg_ro](https://easylist-downloads.adblockplus.org/rolist+easylist.txt)
+    * => regional blocklist for Romania, weekly updates, approx. 600 entries
+    * [reg_ru](https://code.google.com/p/ruadlist)
+    * => regional blocklist for Russia, weekly updates, approx. 2.000 entries
     * [securemecca](http://www.securemecca.com)
     * => infrequent updates, approx. 25.000 entries
     * [shallalist](http://www.shallalist.de) (categories "adv" "costtraps" "spyware" "tracker" "warez" enabled by default)
@@ -49,107 +55,120 @@ A lot of people already use adblocker plugins within their desktop browsers, but
     * => weekly updates, approx. 2.500 entries (enabled by default)
     * [zeus tracker](https://zeustracker.abuse.ch)
     * => daily updates, approx. 440 entries
-* zero-conf like automatic installation & setup, usually no manual changes needed (i.e. ip address, network devices etc.)
-* supports a wide range of router modes (incl. AP mode), as long as firewall and dnsmasq are installed and in use
+* zero-conf like automatic installation & setup, usually no manual changes needed
+* simple but yet powerful adblock engine: adblock does not use error prone external iptables rulesets, http pixel server instances and things like that
+* automatically selects dnsmasq or unbound as dns backend
+* automatically selects uclient-fetch or wget as download utility (other tools like curl or aria2c are supported as well)
+* support http only mode (without installed ssl library) for all non-SSL blocklist sources
+* automatically supports a wide range of router modes, even AP modes are supported
 * full IPv4 and IPv6 support
-* each blocklist source will be updated and processed separately
-* timestamp check to download and process only updated adblock list sources
-* overall duplicate removal in separate adblock lists (will be automatically disabled on low memory systems)
-* adblock source list parsing by fast & flexible regex rulesets
+* supports tld compression (top level domain compression), this feature removes thousands of needless host entries from the block lists and lowers the memory footprint for the dns backends
+* each block list source will be updated and processed separately
+* block list source parsing by fast & flexible regex rulesets
+* overall duplicate removal in separate block lists
 * additional whitelist for manual overrides, located by default in /etc/adblock/adblock.whitelist
-* quality checks during & after update of adblock lists to ensure a reliable dnsmasq service
-* adblock statistics, last runtime and list states/counts/update times will be stored in uci config for LuCI frontend
-* status & error logging to stdout and syslog
-* use two dynamic uhttpd instances as adblock pixel server, separated for ads delivered on port 80 and on port 443
-* use dynamic iptables chains/rulesets for adblock related redirects/rejects
-* init system support (start/stop/restart/reload/toggle/stats/cfgup/envchk/query)
-* hotplug support, the adblock start will be triggered by wan 'ifup' event, this can be restricted to a certain wan interface or disabled at all (see config options below)
-* toggle to quickly switch adblock 'on' or 'off'
-* envchk function to check the volatile adblock environment only (without list updates)
-* query function to quickly identify blocked (sub-)domains, i.e. for whitelisting
-* optional: automatic adblock list backup/restore, backups will be (de-)compressed on the fly (disabled by default)
-* optional: add new adblock sources via uci config (see example below)
+* quality checks during block list update to ensure a reliable dns backend service
+* minimal status & error logging to syslog, enable debug logging to receive more output
+* procd based init system support (start/stop/restart/reload/suspend/resume/query/status)
+* procd based hotplug support, the adblock start will be solely triggered by network interface triggers
+* suspend & resume adblock actions temporarily without block list reloading
+* runtime information available via LuCI & via 'status' init command
+* query function to quickly identify blocked (sub-)domains, e.g. for whitelisting
+* optional: force dns requests to local resolver
+* optional: force overall sort / duplicate removal for low memory devices (handle with care!)
+* optional: automatic block list backup & restore, backups will be (de-)compressed and restored on the fly in case of any runtime error
+* optional: add new adblock sources on your own via uci config
 
 ## Prerequisites
-* [openwrt](https://openwrt.org), tested with latest stable release (Chaos Calmer) and with current trunk (Designated Driver)
-* [LEDE project](https://www.lede-project.org), tested with trunk > r98
-* usual setup with enabled 'iptables', 'dnsmasq' and 'uhttpd' - dump AP modes without these basics are _not_ supported!
-* additional required software packages:
-    * a download utility: 'uclient-fetch' and 'wget' (full versions with ssl support) are supported. Normally you should use 'wget', it's quite stable and supports the online timestamp checks. If you need a smaller memory footprint try 'uclient-fetch' without openssl dependency. The default ustream ssl backend 'libustream-polarssl' has issues with certain https sites and is currently not supported. To change the ssl backend see example below.
-    * optional: 'kmod-ipt-nat6' for IPv6 support
-* the above dependencies and requirements will be checked during package installation & script runtime
-
-## OpenWrt / LEDE trunk Installation & Usage
-* install 'adblock' (_opkg install adblock_)
-* adblock starts automatically during boot, triggered by wan-ifup event, check _logread -e "adblock"_ for adblock related information
-* optional: start/restart/stop the adblock service manually with _/etc/init.d/adblock_
-* optional: enable/disable your required adblock list sources in _/etc/config/adblock_ - 'adaway', 'disconnect' and 'yoyo' are enabled by default
-* optional: maintain the adblock service in LuCI under 'System => Startup'
+* [LEDE project](https://www.lede-project.org), tested with latest stable release (LEDE 17.01) and with current LEDE snapshot
+* a usual setup with an enabled dns backend at minimum - dump AP modes without a working dns backend are _not_ supported
+* a download utility:
+    * to support all blocklist sources a full version (with ssl support) of 'wget', 'uclient-fetch' with one of the 'libustream-*' ssl libraries, 'aria2c' or 'curl' is required
+    * for limited devices with real memory constraints, adblock provides also a plain http option and supports wget-nossl and uclient-fetch (without libustream-ssl), too
+    * for more configuration options see examples below
+
+## LEDE trunk Installation & Usage
+* install 'adblock' (_opkg install adblock_) and that's it - the adblock start will be automatically triggered by procd interface trigger
+* control the adblock service manually with _/etc/init.d/adblock_ start/stop/restart/reload/suspend/resume/status or use the LuCI frontend
+* enable/disable your favored block list sources in _/etc/config/adblock_ - 'adaway', 'disconnect' and 'yoyo' are enabled by default
 
 ## LuCI adblock companion package
-* for easy management of the various blocklist sources and adblock options there is also a nice & efficient LuCI frontend available
+* for easy management of the various block list sources and all other adblock options you can also use a nice & efficient LuCI frontend
 * install 'luci-app-adblock' (_opkg install luci-app-adblock_)
 * the application is located in LuCI under 'Services' menu
-* _Thanks to Hannu Nyman for this great adblock LuCI frontend!_
-
-## Chaos Calmer installation notes
-* 'adblock' and 'luci-app-adblock' are _not_ available as .ipk packages in the Chaos Calmer download repository
-* download both packages from a development snapshot package directory:
-    * for 'adblock' look [here](https://downloads.lede-project.org/snapshots/packages/x86_64/packages/)
-    * for 'luci-app-adblock' look [here](https://downloads.lede-project.org/snapshots/packages/x86_64/luci/)
-* manually transfer the packages to your routers temp directory (with tools like _sshfs_ or _winscp_)
-* install the packages with _opkg install <...>_ as described above
 
 ## Tweaks
-* **storage:** to process & store all blocklist sources at once it might helpful to enlarge your temp directory with a swap partition => see [openwrt wiki](https://wiki.openwrt.org/doc/uci/fstab) for further details
-* **white-/blacklist:** add domain white- or blacklist entries to always-allow or -deny certain (sub) domains, by default both lists are located in _/etc/adblock_. Please add one domain per line - ip addresses, wildcards & regex are _not_ allowed (see example below)
-* **backup/restore:** enable the backup/restore feature, to restore automatically the latest compressed backup of your adblock lists in case of any processing error (i.e. a single blocklist source is down). Please use an (external) solid partition and _not_ your volatile router temp directory for this
-* **list updates:** for a scheduled call of the adblock service add an appropriate crontab entry (see example below)
-* **hotplug fine tuning:** to restrict hotplug support to a certain wan interface or to disable it at all, you can set 'adb\_hotplugif' to an existing interface like 'wan' or to a non-existing 'dummy' interface
-* **new list sources:** you could add new blocklist sources on your own via uci config, all you need is a source url and an awk one-liner (see example below)
-* **AP mode:** in 'AP mode' adblock uses automatically the local router ip as nullip address. To make sure that your LuCI interface will be still accessible, you have to change the local uhttpd instance to ports <> 80/443 (see example below), also make sure that firewall and dnsmasq are installed and running
-* **restricted mode:** to disable flash writes with adblock status information to the adblock config file (used by LuCI frontend), please set 'adb\_restricted' to '1'
-* **adblock toggle:** to quickly switch adblocking 'on' or 'off', simply use _/etc/init.d/adblock toggle_
-* **adblock statistics:** to update only the adblock statistics (without updating the block lists as well), please run _/etc/init.d/adblock stats_
-* **adblock query `<DOMAIN>`:** to query the active blocklists for a specific domain, please run _/etc/init.d/adblock query `<DOMAIN>`_ (see example below)
-* **configuration update:** to update an outdated adblock config file with the current default version, please run _/etc/init.d/adblock cfgup_, make your individual changes and start the adblock service again
-* **debugging:** for script debugging please set the 'adb\_debug' variable in the header of _/etc/init.d/adblock_ to '1'
-* **mute output** to mute the normal adblock output and print only warn/error messages, please set 'adb\_loglevel to '0'
-* **disable active dns probing in windows:** to prevent a possible yellow exclamation mark on your internet connection icon (which wrongly means connected, but no internet), please change the following registry key/value from "1" to "0" _HKLM\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet\EnableActiveProbing_
+* **runtime information:** the adblock status is available via _/etc/init.d/adblock status_ (see example below)
+* **debug logging:** for script debugging please set the config option 'adb\_debug' to '1' and check the runtime output with _logread -e "adblock"_
+* **storage expansion:** to process and store all block list sources at once it might helpful to enlarge your temp directory with a swap partition => see [openwrt wiki](https://wiki.openwrt.org/doc/uci/fstab) for further details
+* **add white- / blacklist entries:** add domain white- or blacklist entries to always-allow or -deny certain (sub) domains, by default both lists are empty and located in _/etc/adblock_. Please add one domain per line - ip addresses, wildcards & regex are _not_ allowed (see example below)
+* **backup & restore block lists:** enable this feature, to restore automatically the latest compressed backup of your block lists in case of any processing error (e.g. a single block list source is not available during update). Please use an (external) solid partition and _not_ your volatile router temp directory for this
+* **scheduled list updates:** for a scheduled call of the adblock service add an appropriate crontab entry (see example below)
+* **restrict procd interface trigger:** restrict the procd interface trigger to a (list of) certain interface(s) (default: wan). To disable it at all, remove all entries
+* **suspend & resume adblocking:** to quickly switch the adblock service 'on' or 'off', simply use _/etc/init.d/adblock [suspend|resume]_
+* **domain query:** to query the active block lists for a specific domain, please run _/etc/init.d/adblock query `<DOMAIN>`_ (see example below)
+* **add new list sources:** you could add new block list sources on your own via uci config, all you need is a source url and an awk one-liner (see example below)
+* **disable active dns probing in windows 10:** to prevent a yellow exclamation mark on your internet connection icon (which wrongly means connected, but no internet), please change the following registry key/value from "1" to "0" _HKLM\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet\EnableActiveProbing_
 
 ## Further adblock config options
-* usually the adblock autodetection works quite well and no manual config overrides are needed, all options apply to the 'global' config section:
+* usually the pre-configured adblock setup works quite well and no manual config overrides are needed, all listed options apply to the 'global' config section:
     * adb\_enabled => main switch to enable/disable adblock service (default: '1', enabled)
-    * adb\_cfgver => config version string (do not change!) - adblock will check this entry during startup
-    * adb\_lanif => name of the logical lan interface (default: 'lan')
-    * adb\_nullport => port of the adblock uhttpd instance used for ads delivered on port 80 (default: '65534')
-    * adb\_nullportssl => port of the adblock uhttpd instance used for ads delivered on port 443 (default: '65535')
-    * adb\_nullipv4 => IPv4 blackhole ip address (default: '198.18.0.1', in AP mode: local router ip)
-    * adb\_nullipv6 => IPv6 blackhole ip address (default: '::ffff:c612:0001', in AP mode: local router ip)
-    * adb\_forcedns => redirect all local DNS queries to the local dnsmasq resolver (default: '1', enabled / always disabled in 'AP mode')
-    * adb\_fetchttl => set the timeout for list downloads (default: '5' seconds)
-    * adb\_restricted => disable updates of the adblock config file (no flash writes) during runtime (default: '0', disabled)
-    * adb\_hotplugif => restrict hotplug support to a certain wan interface or disable it at all (default: '', disabled)
-    * adb\_loglevel => set it to '0' to mute normal adblock output and print only error messages (default: '1', normal output)
+    * adb\_debug => enable/disable adblock debug output (default: '0', disabled)
+    * adb\_iface => set the procd interface trigger to a (list of) lan / wan interface(s) (default: 'wan')
+    * adb\_fetch => full path to a different download utility, see example below (default: not set, use wget)
+    * adb\_fetchparm => options for the download utility, see example below (default: not set, use wget options)
+    * adb\_triggerdelay => additional trigger delay in seconds before adblock processing starts (default: '2')
+    * adb\_forcedns => force dns requests to local resolver (default: '0', disabled)
+    * adb\_forcesrt => force overall sort on low memory devices with less than 64 MB RAM (default: '0', disabled)
 
 ## Examples
+**change default dns backend to 'unbound':**
+<pre><code>
+Adblock detects the presence of an active unbound dns backend and the block lists will be automatically pulled in by unbound.
+The adblock script deposits the sorted and filtered block lists in '/var/lib/unbound' where unbound can find them in its jail.
+If you use manual configuration for unbound, then just include the following line in your 'server:' clause:
+
+  include: "/var/lib/unbound/adb_list.*"
+</code></pre>
+  
+**configuration for different download utilities:**
+<pre><code>
+wget (default):
+  option adb_fetch="/usr/bin/wget"
+  option adb_fetchparm="--no-config --quiet --no-cache --no-cookies --max-redirect=0 --timeout=10 --no-check-certificate -O"
+
+aria2c:
+  option adb_fetch '/usr/bin/aria2c'
+  option adb_fetchparm '-q --timeout=10 --allow-overwrite=true --auto-file-renaming=false --check-certificate=false -o'
+
+uclient-fetch:
+  option adb_fetch '/bin/uclient-fetch'
+  option adb_fetchparm '-q --timeout=10 --no-check-certificate -O'
 
-**example to change the ssl backend for 'uclient-fetch':**
+curl:
+  option adb_fetch '/usr/bin/curl'
+  option adb_fetchparm '-s --connect-timeout 10 --insecure -o'
+</code></pre>
+  
+**receive adblock runtime information:**
 <pre><code>
-opkg update
-opkg remove --force-depends libustream-polarssl
-opkg install libustream-mbedtls
+root@blackhole:~# /etc/init.d/adblock status
+::: adblock runtime information
+ status          : active
+ adblock_version : 2.6.0
+ blocked_domains : 113711
+ fetch_info      : wget (built-in)
+ dns_backend     : dnsmasq
+ last_rundate    : 12.04.2017 13:08:26
+ system          : LEDE Reboot SNAPSHOT r3900-399d5cf532
 </code></pre>
   
-**example cronjob for a regular block list update:**
+**cronjob for a regular block list update (/etc/crontabs/root):**
 <pre><code>
-# configuration found in /etc/crontabs/root
-# start adblock script once a day at 6 a.m.
-#
 0 06 * * *    /etc/init.d/adblock start
 </code></pre>
   
-**example blacklist entry (/etc/adblock/adblock.blacklist):**
+**blacklist entry (/etc/adblock/adblock.blacklist):**
 <pre><code>
 ads.example.com
 
@@ -163,11 +182,11 @@ This entry does not block:
   http://example.com/
 </code></pre>
   
-**example whitelist entry (/etc/adblock/adblock.whitelist):**
+**whitelist entry (/etc/adblock/adblock.whitelist):**
 <pre><code>
 here.com
 
-This entry removes the following (sub)domains from the blocklists:
+This entry removes the following (sub)domains from the block lists:
   maps.here.com
   here.com
 
@@ -176,53 +195,25 @@ This entry does not remove:
   www.adwhere.com
 </code></pre>
   
-**example uhttpd configuration in AP mode:**
+**query active block lists for a certain (sub-)domain, e.g. for whitelisting:**
 <pre><code>
-# configuration found in /etc/config/uhttpd
-# change default http/https ports <> 80/443
-#
-config uhttpd 'main'
-    list listen_http '0.0.0.0:88'
-    list listen_https '0.0.0.0:445'
-</code></pre>
-  
-**example to query active blocklists for a certain (sub-)domain, i.e. for whitelisting:**
-<pre><code>
-/etc/init.d/adblock query "example.www.doubleclick.net"
-=> distinct results for domain 'example.www.doubleclick.net' (overall 0)
-   no matches in active blocklists
-=> distinct results for domain 'www.doubleclick.net' (overall 1)
-   adb_list.winhelp     : www.doubleclick.net
-=> distinct results for domain 'doubleclick.net' (overall 252)
-   adb_list.adaway      : ad-g.doubleclick.net
-   adb_list.hphosts     : 1016557.fls.doubleclick.net
-   adb_list.rolist      : feedads.g.doubleclick.net
-   adb_list.securemecca : 1168945.fls.doubleclick.net
-   adb_list.sysctl      : ad.co.doubleclick.net
-   adb_list.whocares    : 3ad.doubleclick.net
-   adb_list.winhelp     : 1435575.fls.doubleclick.net
+/etc/init.d/adblock query example.www.doubleclick.net
+::: distinct results for domain 'example.www.doubleclick.net'
+ no match
+::: distinct results for domain 'www.doubleclick.net'
+ adb_list.sysctl      : www.doubleclick.net
+::: distinct results for domain 'doubleclick.net'
+ adb_list.adaway      : ad-g.doubleclick.net
+ adb_list.securemecca : 1168945.fls.doubleclick.net
+ adb_list.sysctl      : 1435575.fls.doubleclick.net
+ adb_list.whocares    : 3ad.doubleclick.net
 
 The query function checks against the submitted (sub-)domain and recurses automatically to the upper top level domain(s).
-For every domain it returns the overall count plus a distinct list of active blocklists with the first relevant result.
-In the example above you have to whitelist "www.doubleclick.net" to free the submitted domain.
+For every domain it returns the overall count plus a distinct list of active block lists with the first relevant result.
+In the example above whitelist "www.doubleclick.net" to free the submitted domain.
 </code></pre>
   
-**example to identify blocked domains during web browsing, i.e. for whitelisting:**
-<pre><code>
-1. the easy way ...
-enable the network analysis builtins in chrome or firefox to identify domains
-which are redirected to the adblock null-ip (default 198.18.0.1), add these domains to your whitelist
-
-2. a bit harder ...
-enable 'Log queries' in the dnsmasq configuration (via LuCI Network => DHCP/DNS),
-ssh to your router and start tracing with 'logread -f -e "dnsmasq" -e "198.18.0.1"'
-switch to your client, access the relevant site and check all domains
-that are blocked/listed in logread, add these domains to your whitelist
-
-=> finally restart the adblock service (/etc/init.d/adblock restart) in both variants
-</code></pre>
-  
-**example to add a new blocklist source:**
+**add a new block list source:**
 <pre><code>
 1. the easy way ...
 example: https://easylist-downloads.adblockplus.org/rolist+easylist.txt
@@ -251,14 +242,8 @@ the output result should be a sequential list with one domain/host per line - no
 If your awk one-liner works quite well, add a new source section in adblock config and test your new source
 </code></pre>
   
-## Background
-This adblock package is a dns/dnsmasq based adblock solution.  
-Queries to ad/abuse domains are never forwarded and always replied with a local IP address which may be IPv4 or IPv6. For that purpose adblock uses an ip address from the private 'Benchmark Test' subnet (198.18.0.1 / ::ffff:c612:0001) by default (in AP mode the local router ip address will be used). Furthermore all ad/abuse queries will be filtered by ip(6)tables and redirected to two uhttpd instances, separated for ads delivered on port 80 and on port 443 (in PREROUTING chain) or rejected (in FORWARD or OUTPUT chain). In 'AP mode' only the uhttpd related rules in PREROUTING chain are enabled.  
-  
-All iptables and uhttpd related adblock additions are non-destructive, no hard-coded changes in 'firewall.user', 'uhttpd' config or any other system related config files. There is _no_ adblock background daemon running, the (scheduled) start of the adblock service keeps only the adblock lists up-to-date.  
-
 ## Support
-Please join the adblock discussion in this [openwrt forum thread](https://forum.openwrt.org/viewtopic.php?id=59803) or contact me by mail <dev@brenken.org>  
+Please join the adblock discussion in this [forum thread](https://forum.lede-project.org/t/adblock-2-x-support-thread/507) or contact me by mail <dev@brenken.org>  
 
 ## Removal
 * stop all adblock related services with _/etc/init.d/adblock stop_
diff --git a/net/adblock/files/adblock-helper.sh b/net/adblock/files/adblock-helper.sh
deleted file mode 100644 (file)
index 8be9941..0000000
+++ /dev/null
@@ -1,753 +0,0 @@
-#!/bin/sh
-# function library used by adblock-update.sh
-# written by Dirk Brenken (dev@brenken.org)
-
-# set initial defaults
-#
-LC_ALL=C
-PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-adb_scriptver="1.5.4"
-adb_mincfgver="2.5"
-adb_hotplugif=""
-adb_lanif="lan"
-adb_nullport="65534"
-adb_nullportssl="65535"
-adb_nullipv4="198.18.0.1"
-adb_nullipv6="::ffff:c612:0001"
-adb_whitelist="/etc/adblock/adblock.whitelist"
-adb_whitelist_rset="\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\"^\"\$1\"\\\|[.]\"\$1)}"
-adb_dnsdir="/tmp/dnsmasq.d"
-adb_dnshidedir="${adb_dnsdir}/.adb_hidden"
-adb_dnsprefix="adb_list"
-adb_count=0
-adb_minspace=12000
-adb_forcedns=1
-adb_fetchttl=5
-adb_restricted=0
-adb_loglevel=1
-adb_uci="$(which uci)"
-
-# f_envload: load adblock environment
-#
-f_envload()
-{
-    # source in system function library
-    #
-    if [ -r "/lib/functions.sh" ]
-    then
-        . "/lib/functions.sh"
-    else
-        rc=-10
-        f_log "system function library not found, please check your installation"
-        f_exit
-    fi
-
-    # source in system network library
-    #
-    if [ -r "/lib/functions/network.sh" ]
-    then
-        . "/lib/functions/network.sh"
-    else
-        rc=-10
-        f_log "system network library not found, please check your installation"
-        f_exit
-    fi
-
-    # uci function to parse global section by callback
-    #
-    config_cb()
-    {
-        local type="${1}"
-        if [ "${type}" = "adblock" ]
-        then
-            option_cb()
-            {
-                local option="${1}"
-                local value="${2}"
-                eval "${option}=\"${value}\""
-            }
-        else
-            reset_cb
-        fi
-    }
-
-    # uci function to parse 'service' and 'source' sections
-    #
-    parse_config()
-    {
-        local value opt section="${1}" options="enabled adb_dir adb_src adb_src_rset adb_src_cat"
-        if [ "${section}" != "backup" ]
-        then
-            eval "adb_sources=\"${adb_sources} ${section}\""
-        fi
-        for opt in ${options}
-        do
-            config_get value "${section}" "${opt}"
-            if [ -n "${value}" ]
-            then
-                eval "${opt}_${section}=\"${value}\""
-            fi
-        done
-    }
-
-    # load adblock config and start parsing functions
-    #
-    config_load adblock
-    config_foreach parse_config service
-    config_foreach parse_config source
-
-    # get network basics
-    #
-    network_get_ipaddr adb_ipv4 "${adb_lanif}"
-    network_get_ipaddr6 adb_ipv6 "${adb_lanif}"
-    network_get_device adb_landev "${adb_lanif}"
-    network_find_wan adb_wanif4
-    network_find_wan6 adb_wanif6
-}
-
-# f_envcheck: check/set environment prerequisites
-#
-f_envcheck()
-{
-    local check
-
-    # check 'enabled' & 'version' config options
-    #
-    if [ -z "${adb_enabled}" ] || [ -z "${adb_cfgver}" ] || [ "${adb_cfgver%%.*}" != "${adb_mincfgver%%.*}" ]
-    then
-        rc=-1
-        f_log "outdated adblock config (${adb_cfgver} vs. ${adb_mincfgver}), please run '/etc/init.d/adblock cfgup' to update your configuration"
-        f_exit
-    elif [ "${adb_cfgver#*.}" != "${adb_mincfgver#*.}" ]
-    then
-        outdated_ok="true"
-    fi
-    if [ "${adb_enabled}" != "1" ]
-    then
-        rc=-10
-        f_log "adblock is currently disabled, please set adb_enabled to '1' to use this service"
-        f_exit
-    fi
-
-    # check opkg availability
-    #
-    adb_pkglist="$(opkg list-installed)"
-    if [ $(($?)) -eq 255 ]
-    then
-        rc=-10
-        f_log "adblock installation finished successfully, 'opkg' currently locked by package installer"
-        f_exit
-    elif [ -z "${adb_pkglist}" ]
-    then
-        rc=-1
-        f_log "empty 'opkg' package list, please check your installation"
-        f_exit
-    fi
-    adb_sysver="$(printf "${adb_pkglist}" | grep "^base-files -")"
-    adb_sysver="${adb_sysver##*-}"
-
-    # get lan ip addresses
-    #
-    if [ -z "${adb_ipv4}" ] && [ -z "${adb_ipv6}" ]
-    then
-        rc=-1
-        f_log "no valid IPv4/IPv6 configuration found (${adb_lanif}), please set 'adb_lanif' manually"
-        f_exit
-    fi
-
-    # check logical update interfaces (with default route)
-    #
-    if [ -z "${adb_wanif4}" ] && [ -z "${adb_wanif6}" ]
-    then
-        adb_wanif4="${adb_lanif}"
-    fi
-
-    # check AP mode
-    #
-    if [ "${adb_wanif4}" = "${adb_lanif}" ] || [ "${adb_wanif6}" = "${adb_lanif}" ]
-    then
-        adb_nullipv4="${adb_ipv4}"
-        adb_nullipv6="${adb_ipv6}"
-        if [ -n "$(${adb_uci} -q get uhttpd.main.listen_http | grep -o ":80$")" ] ||
-           [ -n "$(${adb_uci} -q get uhttpd.main.listen_https | grep -o ":443$")" ]
-        then
-            rc=-1
-            f_log "AP mode detected, please set local LuCI instance to ports <> 80/443"
-            f_exit
-        else
-            apmode_ok="true"
-        fi
-    else
-        apmode_ok="false"
-        check="$(${adb_uci} -q get bcp38.@bcp38[0].enabled)"
-        if [ "${check}" = "1" ]
-        then
-            if [ -n "$(${adb_uci} -q get bcp38.@bcp38[0].match | grep -Fo "${adb_nullipv4%.*}")" ]
-            then
-                rc=-1
-                f_log "please whitelist '${adb_nullipv4}' in your bcp38 configuration to use adblock"
-                f_exit
-            fi
-        fi
-    fi
-
-    # check general package dependencies
-    #
-    f_depend "busybox -"
-    f_depend "uci -"
-    f_depend "uhttpd -"
-    f_depend "iptables -"
-    f_depend "kmod-ipt-nat -"
-    f_depend "firewall -"
-    f_depend "dnsmasq*"
-
-    # check ipv6 related package dependencies
-    #
-    if [ -n "${adb_wanif6}" ]
-    then
-        f_depend "ip6tables -" "true"
-        if [ "${package_ok}" = "false" ]
-        then
-            f_log "package 'ip6tables' not found, IPv6 support will be disabled"
-            unset adb_wanif6
-        else
-            f_depend "kmod-ipt-nat6 -" "true"
-            if [ "${package_ok}" = "false" ]
-            then
-                f_log "package 'kmod-ipt-nat6' not found, IPv6 support will be disabled"
-                unset adb_wanif6
-            fi
-        fi
-    fi
-
-    # check uclient-fetch/wget dependencies
-    #
-    f_depend "uclient-fetch -" "true"
-    if [ "${package_ok}" = "true" ]
-    then
-        f_depend "libustream-polarssl -" "true"
-        if [ "${package_ok}" = "false" ]
-        then
-            f_depend "libustream-\(mbedtls\|openssl\|cyassl\) -" "true"
-            if [ "${package_ok}" = "true" ]
-            then
-                adb_fetch="$(which uclient-fetch)"
-                fetch_parm="-q"
-                response_parm=
-            fi
-        fi
-    fi
-    if [ -z "${adb_fetch}" ]
-    then
-        f_depend "wget -" "true"
-        if [ "${package_ok}" = "true" ]
-        then
-            adb_fetch="$(which /usr/bin/wget* | head -1)"
-            fetch_parm="--no-config --quiet --tries=1 --no-cache --no-cookies --max-redirect=0 --dns-timeout=${adb_fetchttl} --connect-timeout=${adb_fetchttl} --read-timeout=${adb_fetchttl}"
-            response_parm="--spider --server-response"
-        fi
-        if [ -z "${adb_fetch}" ]
-        then
-            rc=-1
-            f_log "please install 'uclient-fetch' or 'wget' with ssl support to use adblock"
-            f_exit
-        fi
-    fi
-
-    # check ca-certificate package and set fetch parm accordingly
-    #
-    f_depend "ca-certificates -" "true"
-    if [ "${package_ok}" = "false" ]
-    then
-        fetch_parm="${fetch_parm} --no-check-certificate"
-    fi
-
-    # start normal processing/logging
-    #
-    f_log "domain adblock processing started (${adb_scriptver}, ${adb_sysver}, $(/bin/date "+%d.%m.%Y %H:%M:%S"))"
-
-    # log partially outdated config
-    #
-    if [ "${outdated_ok}" = "true" ]
-    then
-        f_log "partially outdated adblock config (${adb_mincfgver} vs. ${adb_cfgver}), please run '/etc/init.d/adblock cfgup' to update your configuration"
-    fi
-
-    # log ap mode
-    #
-    if [ "${apmode_ok}" = "true" ]
-    then
-        f_log "AP mode enabled"
-    fi
-
-    # set/log restricted mode
-    #
-    if [ "${adb_restricted}" = "1" ]
-    then
-        adb_uci="$(which true)"
-        f_log "Restricted mode enabled"
-    fi
-
-    # check dns hideout directory
-    #
-    if [ -d "${adb_dnshidedir}" ]
-    then
-        mv_done="$(find "${adb_dnshidedir}" -maxdepth 1 -type f -name "${adb_dnsprefix}*" -print -exec mv -f "{}" "${adb_dnsdir}" \;)"
-    else
-        mkdir -p -m 660 "${adb_dnshidedir}"
-    fi
-
-    # check adblock temp directory
-    #
-    adb_tmpfile="$(mktemp -tu)"
-    adb_tmpdir="$(mktemp -p /tmp -d)"
-    if [ -n "${adb_tmpdir}" ] && [ -d "${adb_tmpdir}" ]
-    then
-        f_space "${adb_tmpdir}"
-        if [ "${space_ok}" = "false" ]
-        then
-            if [ $((av_space)) -le 2000 ]
-            then
-                rc=105
-                f_log "not enough free space in '${adb_tmpdir}' (avail. ${av_space} kb)"
-                f_exit
-            else
-                f_log "not enough free space to handle all block list sources at once in '${adb_tmpdir}' (avail. ${av_space} kb)"
-            fi
-        fi
-    else
-        rc=110
-        f_log "temp directory not found"
-        f_exit
-    fi
-
-    # check memory
-    #
-    mem_total="$(awk '$1 ~ /^MemTotal/ {printf $2}' "/proc/meminfo")"
-    mem_free="$(awk '$1 ~ /^MemFree/ {printf $2}' "/proc/meminfo")"
-    mem_swap="$(awk '$1 ~ /^SwapTotal/ {printf $2}' "/proc/meminfo")"
-    if [ $((mem_total)) -le 64000 ] && [ $((mem_swap)) -eq 0 ]
-    then
-        mem_ok="false"
-        f_log "not enough free memory, overall sort processing will be disabled (total: ${mem_total}, free: ${mem_free}, swap: ${mem_swap})"
-    else
-        mem_ok="true"
-    fi
-
-    # check backup configuration
-    #
-    if [ "${enabled_backup}" = "1" ] && [ -d "${adb_dir_backup}" ]
-    then
-        f_space "${adb_dir_backup}"
-        if [ "${space_ok}" = "false" ]
-        then
-            f_log "not enough free space in '${adb_dir_backup}'(avail. ${av_space} kb), backup/restore will be disabled"
-            backup_ok="false"
-        else
-            f_log "backup/restore will be enabled"
-            backup_ok="true"
-        fi
-    else
-        backup_ok="false"
-        f_log "backup/restore will be disabled"
-    fi
-
-    # set dnsmasq defaults
-    #
-    if [ -n "${adb_wanif4}" ] && [ -n "${adb_wanif6}" ]
-    then
-        adb_dnsformat="awk -v ipv4="${adb_nullipv4}" -v ipv6="${adb_nullipv6}" '{print \"address=/\"\$0\"/\"ipv4\"\n\"\"address=/\"\$0\"/\"ipv6}'"
-    elif [ -n "${adb_wanif4}" ]
-    then
-        adb_dnsformat="awk -v ipv4="${adb_nullipv4}" '{print \"address=/\"\$0\"/\"ipv4}'"
-    else
-        adb_dnsformat="awk -v ipv6="${adb_nullipv6}" '{print \"address=/\"\$0\"/\"ipv6}'"
-    fi
-
-    # check volatile iptables configuration
-    #
-    if [ -n "${adb_wanif4}" ]
-    then
-        if [ "${apmode_ok}" = "false" ]
-        then
-            if [ "${adb_forcedns}" = "1" ] && [ -n "${adb_landev}" ]
-            then
-                f_firewall "IPv4" "nat" "prerouting_rule" "adb-dns" "1" "dns" "-p udp --dport 53 -j DNAT --to-destination ${adb_ipv4}:53"
-                f_firewall "IPv4" "nat" "prerouting_rule" "adb-dns" "2" "dns" "-p tcp --dport 53 -j DNAT --to-destination ${adb_ipv4}:53"
-            fi
-            f_firewall "IPv4" "filter" "forwarding_rule" "adb-fwd" "1" "fwd" "-p tcp -j REJECT --reject-with tcp-reset"
-            f_firewall "IPv4" "filter" "forwarding_rule" "adb-fwd" "2" "fwd" "-j REJECT --reject-with icmp-host-unreachable"
-            f_firewall "IPv4" "filter" "output_rule" "adb-out" "1" "out" "-p tcp -j REJECT --reject-with tcp-reset"
-            f_firewall "IPv4" "filter" "output_rule" "adb-out" "2" "out" "-j REJECT --reject-with icmp-host-unreachable"
-        fi
-        f_firewall "IPv4" "nat" "prerouting_rule" "adb-nat" "1" "nat" "-p tcp --dport 80 -j DNAT --to-destination ${adb_ipv4}:${adb_nullport}"
-        f_firewall "IPv4" "nat" "prerouting_rule" "adb-nat" "2" "nat" "-p tcp --dport 443 -j DNAT --to-destination ${adb_ipv4}:${adb_nullportssl}"
-    fi
-    if [ -n "${adb_wanif6}" ]
-    then
-        if [ "${apmode_ok}" = "false" ]
-        then
-            if [ "${adb_forcedns}" = "1" ] && [ -n "${adb_landev}" ]
-            then
-                f_firewall "IPv6" "nat" "PREROUTING" "adb-dns" "1" "dns" "-p udp --dport 53 -j DNAT --to-destination [${adb_ipv6}]:53"
-                f_firewall "IPv6" "nat" "PREROUTING" "adb-dns" "2" "dns" "-p tcp --dport 53 -j DNAT --to-destination [${adb_ipv6}]:53"
-            fi
-            f_firewall "IPv6" "filter" "forwarding_rule" "adb-fwd" "1" "fwd" "-p tcp -j REJECT --reject-with tcp-reset"
-            f_firewall "IPv6" "filter" "forwarding_rule" "adb-fwd" "2" "fwd" "-j REJECT --reject-with icmp6-addr-unreachable"
-            f_firewall "IPv6" "filter" "output_rule" "adb-out" "1" "out" "-p tcp -j REJECT --reject-with tcp-reset"
-            f_firewall "IPv6" "filter" "output_rule" "adb-out" "2" "out" "-j REJECT --reject-with icmp6-addr-unreachable"
-        fi
-        f_firewall "IPv6" "nat" "PREROUTING" "adb-nat" "1" "nat" "-p tcp --dport 80 -j DNAT --to-destination [${adb_ipv6}]:${adb_nullport}"
-        f_firewall "IPv6" "nat" "PREROUTING" "adb-nat" "2" "nat" "-p tcp --dport 443 -j DNAT --to-destination [${adb_ipv6}]:${adb_nullportssl}"
-    fi
-    if [ "${firewall_ok}" = "true" ]
-    then
-        f_log "created volatile firewall rulesets"
-    fi
-
-    # check volatile uhttpd instance configuration
-    #
-    if [ -n "${adb_wanif4}" ] && [ -n "${adb_wanif6}" ]
-    then
-        f_uhttpd "adbIPv46_80" "1" "-p ${adb_ipv4}:${adb_nullport} -p [${adb_ipv6}]:${adb_nullport}"
-        f_uhttpd "adbIPv46_443" "0" "-p ${adb_ipv4}:${adb_nullportssl} -p [${adb_ipv6}]:${adb_nullportssl}"
-    elif [ -n "${adb_wanif4}" ]
-    then
-        f_uhttpd "adbIPv4_80" "1" "-p ${adb_ipv4}:${adb_nullport}"
-        f_uhttpd "adbIPv4_443" "0" "-p ${adb_ipv4}:${adb_nullportssl}"
-    else
-        f_uhttpd "adbIPv6_80" "1" "-p [${adb_ipv6}]:${adb_nullport}"
-        f_uhttpd "adbIPv6_443" "0" "-p [${adb_ipv6}]:${adb_nullportssl}"
-    fi
-    if [ "${uhttpd_ok}" = "true" ]
-    then
-        f_log "created volatile uhttpd instances"
-    fi
-
-    # check whitelist entries
-    #
-    if [ -s "${adb_whitelist}" ]
-    then
-        awk "${adb_whitelist_rset}" "${adb_whitelist}" > "${adb_tmpdir}/tmp.whitelist"
-    fi
-
-    # remove temporary package list
-    #
-    unset adb_pkglist
-}
-
-# f_depend: check package dependencies
-#
-f_depend()
-{
-    local check
-    local package="${1}"
-    local check_only="${2}"
-    package_ok="true"
-
-    check="$(printf "${adb_pkglist}" | grep "^${package}")"
-    if [ "${check_only}" = "true" ] && [ -z "${check}" ]
-    then
-        package_ok="false"
-    elif [ -z "${check}" ]
-    then
-        rc=-1
-        f_log "package '${package}' not found"
-        f_exit
-    fi
-}
-
-# f_firewall: set iptables rules for ipv4/ipv6
-#
-f_firewall()
-{
-    local ipt="iptables"
-    local nullip="${adb_nullipv4}"
-    local proto="${1}"
-    local table="${2}"
-    local chsrc="${3}"
-    local chain="${4}"
-    local chpos="${5}"
-    local notes="adb-${6}"
-    local rules="${7}"
-
-    # select appropriate iptables executable for IPv6
-    #
-    if [ "${proto}" = "IPv6" ]
-    then
-        ipt="ip6tables"
-        nullip="${adb_nullipv6}"
-    fi
-
-    # check whether iptables chain already exist
-    #
-    rc="$("${ipt}" -w -t "${table}" -nL "${chain}" >/dev/null 2>&1; printf ${?})"
-    if [ $((rc)) -ne 0 ]
-    then
-        "${ipt}" -w -t "${table}" -N "${chain}"
-        "${ipt}" -w -t "${table}" -A "${chain}" -m comment --comment "${notes}" -j RETURN
-        if [ "${chain}" = "adb-dns" ]
-        then
-            "${ipt}" -w -t "${table}" -A "${chsrc}" -i "${adb_landev}+" -m comment --comment "${notes}" -j "${chain}"
-        else
-            "${ipt}" -w -t "${table}" -A "${chsrc}" -d "${nullip}" -m comment --comment "${notes}" -j "${chain}"
-        fi
-        rc=${?}
-        if [ $((rc)) -ne 0 ]
-        then
-            f_log "failed to initialize volatile ${proto} firewall chain '${chain}'"
-            f_exit
-        fi
-    fi
-
-    # check whether iptables rule already exist
-    #
-    rc="$("${ipt}" -w -t "${table}" -C "${chain}" -m comment --comment "${notes}" ${rules} >/dev/null 2>&1; printf ${?})"
-    if [ $((rc)) -ne 0 ]
-    then
-        "${ipt}" -w -t "${table}" -I "${chain}" "${chpos}" -m comment --comment "${notes}" ${rules}
-        rc=${?}
-        if [ $((rc)) -eq 0 ]
-        then
-            firewall_ok="true"
-        else
-            f_log "failed to initialize volatile ${proto} firewall rule '${notes}'"
-            f_exit
-        fi
-    fi
-}
-
-# f_uhttpd: start uhttpd instances
-#
-f_uhttpd()
-{
-    local check
-    local realm="${1}"
-    local timeout="${2}"
-    local ports="${3}"
-
-    check="$(pgrep -f "uhttpd -h /www/adblock -N 25 -T ${timeout} -r ${realm}")"
-    if [ -z "${check}" ]
-    then
-        uhttpd -h "/www/adblock" -N 25 -T "${timeout}" -r "${realm}" -k 0 -t 0 -R -D -S -E "/index.html" ${ports}
-        rc=${?}
-        if [ $((rc)) -eq 0 ]
-        then
-            uhttpd_ok="true"
-        else
-            f_log "failed to initialize volatile uhttpd instance (${realm})"
-            f_exit
-        fi
-    fi
-}
-
-# f_space: check mount points/space requirements
-#
-f_space()
-{
-    local mp="${1}"
-    space_ok="true"
-
-    if [ -d "${mp}" ]
-    then
-        av_space="$(df "${mp}" | tail -n1 | awk '{printf $4}')"
-        if [ $((av_space)) -lt $((adb_minspace)) ]
-        then
-            space_ok="false"
-        fi
-    fi
-}
-
-# f_cntconfig: calculate counters in config
-#
-f_cntconfig()
-{
-    local src_name
-    local count=0
-
-    for src_name in $(ls -ASr "${adb_dnsdir}/${adb_dnsprefix}"*)
-    do
-        count="$(wc -l < "${src_name}")"
-        src_name="${src_name##*.}"
-        if [ -n "${adb_wanif4}" ] && [ -n "${adb_wanif6}" ]
-        then
-            count=$((count / 2))
-        fi
-        "${adb_uci}" -q set "adblock.${src_name}.adb_src_count=${count}"
-        adb_count=$((adb_count + count))
-    done
-    "${adb_uci}" -q set "adblock.global.adb_overall_count=${adb_count}"
-}
-
-# f_rmconfig: remove volatile config entries
-#
-f_rmconfig()
-{
-    local opt
-    local options="adb_src_timestamp adb_src_count"
-    local section="${1}"
-
-    "${adb_uci}" -q delete "adblock.global.adb_overall_count"
-    "${adb_uci}" -q delete "adblock.global.adb_dnstoggle"
-    "${adb_uci}" -q delete "adblock.global.adb_percentage"
-    "${adb_uci}" -q delete "adblock.global.adb_lastrun"
-    for opt in ${options}
-    do
-        "${adb_uci}" -q delete "adblock.${section}.${opt}"
-    done
-}
-
-# f_rmdns: remove dns block lists and backups
-#
-f_rmdns()
-{
-    rm_dns="$(find "${adb_dnsdir}" -maxdepth 1 -type f -name "${adb_dnsprefix}*" -print -exec rm -f "{}" \;)"
-    if [ -n "${rm_dns}" ]
-    then
-        rm -rf "${adb_dnshidedir}"
-        if [ "${enabled_backup}" = "1" ] && [ -d "${adb_dir_backup}" ]
-        then
-            rm -f "${adb_dir_backup}/${adb_dnsprefix}"*.gz
-        fi
-        /etc/init.d/dnsmasq restart
-    fi
-}
-
-# f_rmuhttpd: remove uhttpd instances
-#
-f_rmuhttpd()
-{
-    rm_uhttpd="$(pgrep -f "uhttpd -h /www/adblock")"
-    if [ -n "${rm_uhttpd}" ]
-    then
-        for pid in ${rm_uhttpd}
-        do
-            kill -9 "${pid}"
-        done
-    fi
-}
-
-# f_rmfirewall: remove firewall rulsets
-#
-f_rmfirewall()
-{
-    rm_fw="$(iptables -w -t nat -vnL | grep -Fo "adb-")"
-    if [ -n "${rm_fw}" ]
-    then
-        iptables-save | grep -Fv -- "adb-" | iptables-restore
-        if [ -n "$(lsmod | grep -Fo "ip6table_nat")" ]
-        then
-            ip6tables-save | grep -Fv -- "adb-" | ip6tables-restore
-        fi
-    fi
-}
-
-# f_log: log messages to stdout and syslog
-#
-f_log()
-{
-    local log_parm
-    local log_msg="${1}"
-    local class="info "
-
-    if [ $((rc)) -gt 0 ]
-    then
-        class="error"
-    elif [ $((rc)) -lt 0 ]
-    then
-        class="warn "
-    fi
-    if [ -t 1 ]
-    then
-        log_parm="-s"
-    fi
-    if [ -n "${log_msg}" ] && ([ $((adb_loglevel)) -gt 0 ] || [ "${class}" != "info " ])
-    then
-        logger ${log_parm} -t "adblock[${adb_pid}] ${class}" "${log_msg}" 2>&1
-    fi
-}
-
-# f_statistics: adblock runtime statistics
-f_statistics()
-{
-    local ipv4_blk=0 ipv4_all=0 ipv4_pct=0
-    local ipv6_blk=0 ipv6_all=0 ipv6_pct=0
-
-    if [ -n "${adb_wanif4}" ]
-    then
-        ipv4_blk="$(iptables -t nat -vxnL adb-nat | awk '$3 ~ /^DNAT$/ {sum += $1} END {printf sum}')"
-        ipv4_all="$(iptables -t nat -vxnL PREROUTING | awk '$3 ~ /^(delegate_prerouting|prerouting_rule)$/ {sum += $1} END {printf sum}')"
-        if [ $((ipv4_all)) -gt 0 ] && [ $((ipv4_blk)) -gt 0 ] && [ $((ipv4_all)) -gt $((ipv4_blk)) ]
-        then
-            ipv4_pct="$(printf "${ipv4_blk}" | awk -v all="${ipv4_all}" '{printf( "%5.2f\n",$1/all*100)}')"
-        elif [ $((ipv4_all)) -lt $((ipv4_blk)) ]
-        then
-            iptables -t nat -Z adb-nat
-        fi
-    fi
-    if [ -n "${adb_wanif6}" ]
-    then
-        ipv6_blk="$(ip6tables -t nat -vxnL adb-nat | awk '$3 ~ /^DNAT$/ {sum += $1} END {printf sum}')"
-        ipv6_all="$(ip6tables -t nat -vxnL PREROUTING | awk '$3 ~ /^(adb-nat|DNAT)$/ {sum += $1} END {printf sum}')"
-        if [ $((ipv6_all)) -gt 0 ] && [ $((ipv6_blk)) -gt 0 ] && [ $((ipv6_all)) -gt $((ipv6_blk)) ]
-        then
-            ipv6_pct="$(printf "${ipv6_blk}" | awk -v all="${ipv6_all}" '{printf( "%5.2f\n",$1/all*100)}')"
-        elif [ $((ipv6_all)) -lt $((ipv6_blk)) ]
-        then
-            ip6tables -t nat -Z adb-nat
-        fi
-    fi
-    "${adb_uci}" -q set "adblock.global.adb_percentage=${ipv4_pct}%/${ipv6_pct}%"
-    f_log "firewall statistics (IPv4/IPv6): ${ipv4_pct}%/${ipv6_pct}% of all packets in prerouting chain are ad related & blocked"
-}
-
-# f_exit: delete temporary files, generate statistics and exit
-#
-f_exit()
-{
-    local lastrun="$(date "+%d.%m.%Y %H:%M:%S")"
-
-    if [ "${adb_restricted}" = "1" ]
-    then
-        adb_uci="$(which true)"
-    fi
-
-    # delete temp files & directories
-    #
-    rm -f "${adb_tmpfile}"
-    rm -rf "${adb_tmpdir}"
-
-    # tidy up on error
-    #
-    if [ $((rc)) -lt 0 ] || [ $((rc)) -gt 0 ]
-    then
-        f_rmdns
-        f_rmuhttpd
-        f_rmfirewall
-        config_foreach f_rmconfig source
-        if [ $((rc)) -eq -1 ]
-        then
-            "${adb_uci}" -q set "adblock.global.adb_lastrun=${lastrun} => runtime error, please check the log!"
-        fi
-    fi
-
-    # final log message and iptables statistics
-    #
-    if [ $((rc)) -eq 0 ]
-    then
-        f_statistics
-        "${adb_uci}" -q set "adblock.global.adb_lastrun=${lastrun}"
-        f_log "domain adblock processing finished successfully (${adb_scriptver}, ${adb_sysver}, ${lastrun})"
-    elif [ $((rc)) -gt 0 ]
-    then
-        f_log "domain adblock processing failed (${adb_scriptver}, ${adb_sysver}, ${lastrun})"
-    else
-        rc=0
-    fi
-    if [ -n "$("${adb_uci}" -q changes adblock)" ]
-    then
-        "${adb_uci}" -q commit "adblock"
-    fi
-    rm -f "${adb_pidfile}"
-    exit ${rc}
-}
diff --git a/net/adblock/files/adblock-update.sh b/net/adblock/files/adblock-update.sh
deleted file mode 100755 (executable)
index 661081d..0000000
+++ /dev/null
@@ -1,278 +0,0 @@
-#!/bin/sh
-# dns based ad/abuse domain blocking script
-# written by Dirk Brenken (dev@brenken.org)
-
-# This is free software, licensed under the GNU General Public License v3.
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# prepare environment
-#
-adb_pid="${$}"
-adb_pidfile="/var/run/adblock.pid"
-adb_scriptdir="${0%/*}"
-
-if [ -r "${adb_pidfile}" ]
-then
-    rc=255
-    logger -s -t "adblock[${adb_pid}] error" "adblock service already running ($(cat ${adb_pidfile}))"
-    exit ${rc}
-else
-    printf "${adb_pid}" > "${adb_pidfile}"
-    if [ -r "${adb_scriptdir}/adblock-helper.sh" ]
-    then
-        . "${adb_scriptdir}/adblock-helper.sh"
-        f_envload
-    else
-        rc=254
-        logger -s -t "adblock[${adb_pid}] error" "adblock function library not found"
-        rm -f "${adb_pidfile}"
-        exit ${rc}
-    fi
-fi
-
-# call trap function on error signals (HUP, INT, QUIT, BUS, SEGV, TERM)
-#
-trap "rc=250; f_log 'error signal received/trapped'; f_exit" 1 2 3 10 11 15
-
-# check environment
-#
-f_envcheck
-
-# main loop for all block list sources
-#
-f_log "use '${adb_fetch}' for list downloads"
-
-for src_name in ${adb_sources}
-do
-    # check disabled sources
-    #
-    eval "enabled=\"\${enabled_${src_name}}\""
-    if [ "${enabled}" = "0" ]
-    then
-        if [ -r "${adb_dnsdir}/${adb_dnsprefix}.${src_name}" ]
-        then
-            rm -f "${adb_dnsdir}/${adb_dnsprefix}.${src_name}"
-            if [ "${backup_ok}" = "true" ] && [ -r "${adb_dir_backup}/${adb_dnsprefix}.${src_name}.gz" ]
-            then
-                rm -f "${adb_dir_backup}/${adb_dnsprefix}.${src_name}.gz"
-            fi
-            rm_done="true"
-            f_log "=> disabled source '${src_name}' removed"
-        fi
-        "${adb_uci}" -q delete "adblock.${src_name}.adb_src_count"
-        "${adb_uci}" -q delete "adblock.${src_name}.adb_src_timestamp"
-        continue
-    fi
-
-    f_log "=> processing source '${src_name}'"
-    eval "url=\"\${adb_src_${src_name}}\""
-    eval "src_rset=\"\${adb_src_rset_${src_name}}\""
-    eval "list_time=\"\${CONFIG_${src_name}_adb_src_timestamp}\""
-    adb_dnsfile="${adb_dnsdir}/${adb_dnsprefix}.${src_name}"
-
-    # check 'url' and 'src_rset' values
-    #
-    if [ -z "${url}" ] || [ -z "${src_rset}" ]
-    then
-        "${adb_uci}" -q set "adblock.${src_name}.adb_src_timestamp=broken config"
-        f_log "   broken source configuration, skipped"
-        continue
-    fi
-
-    # download only block list with newer/updated timestamp
-    #
-    if [ "${src_name}" = "blacklist" ]
-    then
-        url_time="$(date -r "${url}")"
-    elif [ -n "${response_parm}" ]
-    then
-        url_time="$(${adb_fetch} ${fetch_parm} ${response_parm} "${url}" 2>&1 | awk '$0 ~ /Last-Modified/ {printf substr($0,18)}')"
-    fi
-    if [ -z "${url_time}" ]
-    then
-        url_time="$(date)"
-        f_log "   no online timestamp"
-    fi
-    if [ -z "${list_time}" ] || [ "${list_time}" != "${url_time}" ] || [ ! -r "${adb_dnsfile}" ] ||\
-      ([ "${backup_ok}" = "true" ] && [ ! -r "${adb_dir_backup}/${adb_dnsprefix}.${src_name}.gz" ])
-    then
-        if [ "${src_name}" = "blacklist" ]
-        then
-            tmp_domains="$(strings -n 1 "${url}")"
-        elif [ "${src_name}" = "shalla" ]
-        then
-            shalla_archive="${adb_tmpdir}/shallalist.tar.gz"
-            shalla_file="${adb_tmpdir}/shallalist.txt"
-            "${adb_fetch}" ${fetch_parm} -O "${shalla_archive}" "${url}"
-            rc=${?}
-            if [ $((rc)) -eq 0 ]
-            then
-                > "${shalla_file}"
-                for category in ${adb_src_cat_shalla}
-                do
-                    tar -xOzf "${shalla_archive}" BL/${category}/domains >> "${shalla_file}"
-                    rc=${?}
-                    if [ $((rc)) -ne 0 ]
-                    then
-                        f_log "   archive extraction failed (${category})"
-                        break
-                    fi
-                done
-                tmp_domains="$(strings -n 1 "${shalla_file}")"
-                rm -rf "${adb_tmpdir}/BL"
-                rm -f "${shalla_archive}"
-                rm -f "${shalla_file}"
-            fi
-        else
-            tmp_domains="$(${adb_fetch} ${fetch_parm} -O- "${url}" | strings -n 1)"
-        fi
-        rc=${?}
-    else
-        f_log "   source doesn't change, skipped"
-        continue
-    fi
-
-    # check download result and prepare domain output, backup/restore if needed
-    #
-    if [ $((rc)) -eq 0 ] && [ -n "${tmp_domains}" ]
-    then
-        count="$(printf "%s\n" "${tmp_domains}" | awk "${src_rset}" | tee "${adb_tmpfile}" | wc -l)"
-        "${adb_uci}" -q set "adblock.${src_name}.adb_src_timestamp=${url_time}"
-        if [ "${backup_ok}" = "true" ]
-        then
-            gzip -cf "${adb_tmpfile}" > "${adb_dir_backup}/${adb_dnsprefix}.${src_name}.gz"
-        fi
-        f_log "   source download finished (${count} entries)"
-        unset tmp_domains
-    elif [ $((rc)) -eq 0 ] && [ -z "${tmp_domains}" ]
-    then
-        if [ "${backup_ok}" = "true" ] && [ -r "${adb_dir_backup}/${adb_dnsprefix}.${src_name}.gz" ]
-        then
-            gunzip -cf "${adb_dir_backup}/${adb_dnsprefix}.${src_name}.gz" > "${adb_tmpfile}"
-            count="$(wc -l < "${adb_tmpfile}")"
-            "${adb_uci}" -q set "adblock.${src_name}.adb_src_timestamp=list restored"
-            f_log "   empty source download, restored (${count} entries)"
-        else
-            if [ -r "${adb_dnsdir}/${adb_dnsprefix}.${src_name}" ]
-            then
-                rm -f "${adb_dnsdir}/${adb_dnsprefix}.${src_name}"
-                rm_done="true"
-            fi
-            "${adb_uci}" -q delete "adblock.${src_name}.adb_src_count"
-            "${adb_uci}" -q set "adblock.${src_name}.adb_src_timestamp=empty download"
-            f_log "   empty source download, skipped"
-            continue
-        fi
-    else
-        rc=0
-        if [ "${backup_ok}" = "true" ] && [ -r "${adb_dir_backup}/${adb_dnsprefix}.${src_name}.gz" ]
-        then
-            gunzip -cf "${adb_dir_backup}/${adb_dnsprefix}.${src_name}.gz" > "${adb_tmpfile}"
-            count="$(wc -l < "${adb_tmpfile}")"
-            "${adb_uci}" -q set "adblock.${src_name}.adb_src_timestamp=list restored"
-            f_log "   source download failed, restored (${count} entries)"
-        else
-            if [ -r "${adb_dnsdir}/${adb_dnsprefix}.${src_name}" ]
-            then
-                rm -f "${adb_dnsdir}/${adb_dnsprefix}.${src_name}"
-                rm_done="true"
-            fi
-            "${adb_uci}" -q delete "adblock.${src_name}.adb_src_count"
-            "${adb_uci}" -q set "adblock.${src_name}.adb_src_timestamp=download failed"
-            f_log "   source download failed, skipped"
-            continue
-        fi
-    fi
-
-    # remove whitelist domains, sort domains and make them unique,
-    # rewrite ad/abuse domain information to separate dnsmasq files
-    #
-    if [ $((count)) -gt 0 ] && [ -n "${adb_tmpfile}" ]
-    then
-        if [ -s "${adb_tmpdir}/tmp.whitelist" ]
-        then
-            grep -vf "${adb_tmpdir}/tmp.whitelist" "${adb_tmpfile}" | sort -u | eval "${adb_dnsformat}" > "${adb_dnsfile}"
-        else
-            sort -u "${adb_tmpfile}" | eval "${adb_dnsformat}" > "${adb_dnsfile}"
-        fi
-        rc=${?}
-        if [ $((rc)) -eq 0 ]
-        then
-            rev_done="true"
-            f_log "   domain merging finished"
-        else
-            rc=0
-            rm -f "${adb_dnsfile}"
-            if [ "${backup_ok}" = "true" ] && [ -r "${adb_dir_backup}/${adb_dnsprefix}.${src_name}.gz" ]
-            then
-                rm -f "${adb_dir_backup}/${adb_dnsprefix}.${src_name}.gz"
-            fi
-            "${adb_uci}" -q delete "adblock.${src_name}.adb_src_count"
-            "${adb_uci}" -q set "adblock.${src_name}.adb_src_timestamp=domain merging failed"
-            f_log "   domain merging failed, skipped"
-            continue
-        fi
-    else
-        rm -f "${adb_dnsfile}"
-        if [ "${backup_ok}" = "true" ] && [ -r "${adb_dir_backup}/${adb_dnsprefix}.${src_name}.gz" ]
-        then
-            rm -f "${adb_dir_backup}/${adb_dnsprefix}.${src_name}.gz"
-        fi
-        "${adb_uci}" -q delete "adblock.${src_name}.adb_src_count"
-        "${adb_uci}" -q set "adblock.${src_name}.adb_src_timestamp=empty domain input"
-        f_log "   empty domain input, skipped"
-        continue
-    fi
-done
-
-# overall sort, make block list entries unique
-#
-if [ "${rev_done}" = "true" ] && [ "${mem_ok}" = "true" ]
-then
-    f_log "remove duplicates in separate block lists"
-    for list in $(ls -ASr "${adb_dnsdir}/${adb_dnsprefix}"*)
-    do
-        list="${list/*./}"
-        if [ -s "${adb_tmpdir}/blocklist.overall" ]
-        then
-            sort "${adb_tmpdir}/blocklist.overall" "${adb_tmpdir}/blocklist.overall" "${adb_dnsdir}/${adb_dnsprefix}.${list}" | uniq -u > "${adb_tmpdir}/tmp.blocklist"
-            cat "${adb_tmpdir}/tmp.blocklist" > "${adb_dnsdir}/${adb_dnsprefix}.${list}"
-        fi
-        cat "${adb_dnsdir}/${adb_dnsprefix}.${list}" >> "${adb_tmpdir}/blocklist.overall"
-    done
-fi
-
-# restart & check dnsmasq with generated set of block lists
-#
-if [ "${rev_done}" = "true" ] || [ "${rm_done}" = "true" ] || [ -n "${mv_done}" ]
-then
-    "${adb_uci}" -q delete "adblock.global.adb_dnstoggle"
-    /etc/init.d/dnsmasq restart
-    sleep 1
-    check="$(pgrep -f "dnsmasq")"
-    if [ -n "${check}" ]
-    then
-        f_cntconfig
-        f_log "block lists with overall ${adb_count} domains loaded"
-    else
-        f_rmdns
-        sleep 1
-        check="$(pgrep -f "dnsmasq")"
-        if [ -n "${check}" ]
-        then
-            f_log "dnsmasq restart without block lists succeeded, please check your configuration"
-        else
-            f_log "dnsmasq restart without block lists failed, please check your configuration"
-        fi
-        rc=100
-        f_exit
-    fi
-else
-    f_cntconfig
-    f_log "block lists with overall ${adb_count} domains are still valid, no update required"
-fi
-
-# remove temporary files and exit
-#
-f_exit
index cc86b503b03ca8a11f5424398f6059f8ad5a4c83..0e4fd0257774c0add0370cb91c93cdb36a849eab 100644 (file)
@@ -3,14 +3,16 @@
 
 config adblock 'global'
        option adb_enabled '1'
-       option adb_cfgver '2.5'
+       option adb_debug '0'
+       option adb_forcesrt '0'
+       option adb_forcedns '0'
+       option adb_iface 'wan'
+       option adb_triggerdelay '2'
        option adb_whitelist '/etc/adblock/adblock.whitelist'
        option adb_whitelist_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\"^\"\$1\"\\\|[.]\"\$1)}'
-       option adb_forcedns '1'
-
-config service 'backup'
-       option enabled '0'
-       option adb_dir '/mnt'
+       option adb_backup '0'
+       option adb_backupdir '/mnt'
+       option adb_rtfile '/tmp/adb_runtime.json'
 
 config source 'adaway'
        option enabled '1'
@@ -18,6 +20,12 @@ config source 'adaway'
        option adb_src_rset '\$0 ~/^127\.0\.0\.1[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
        option adb_src_desc 'focus on mobile ads, infrequent updates, approx. 400 entries'
 
+config source 'adguard'
+       option enabled '0'
+       option adb_src 'https://raw.githubusercontent.com/AdguardTeam/AdguardDNS/master/Filters/filter.txt'
+       option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
+       option adb_src_desc 'combined adguard dns filter list, approx. 12.000 entries'
+
 config source 'blacklist'
        option enabled '0'
        option adb_src '/etc/adblock/adblock.blacklist'
@@ -32,7 +40,7 @@ config source 'disconnect'
 
 config source 'dshield'
        option enabled '0'
-       option adb_src 'http://www.dshield.org/feeds/suspiciousdomains_Low.txt'
+       option adb_src 'https://www.dshield.org/feeds/suspiciousdomains_Low.txt'
        option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
        option adb_src_desc 'generic blocklist, daily updates, approx. 4.500 entries'
 
@@ -78,13 +86,25 @@ config source 'ransomware'
        option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
        option adb_src_desc 'focus on ransomware, numerous updates on the same day, approx. 130 entries'
 
-config source 'rolist'
+config source 'reg_cn'
+       option enabled '0'
+       option adb_src 'https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt'
+       option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
+       option adb_src_desc 'focus on chinese ads, daily updates, approx. 1.600 entries'
+
+config source 'reg_pl'
+       option enabled '0'
+       option adb_src 'http://adblocklist.org/adblock-pxf-polish.txt'
+       option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
+       option adb_src_desc 'focus on polish ads, daily updates, approx. 50 entries'
+
+config source 'reg_ro'
        option enabled '0'
        option adb_src 'https://easylist-downloads.adblockplus.org/rolist+easylist.txt'
        option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
        option adb_src_desc 'focus on romanian ads plus generic easylist additions, weekly updates, approx. 600 entries'
 
-config source 'ruadlist'
+config source 'reg_ru'
        option enabled '0'
        option adb_src 'https://easylist-downloads.adblockplus.org/ruadlist+easylist.txt'
        option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
diff --git a/net/adblock/files/adblock.hotplug b/net/adblock/files/adblock.hotplug
deleted file mode 100644 (file)
index ee48bb0..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-#
-
-adb_pid="${$}"
-adb_helper="/usr/bin/adblock-helper.sh"
-adb_pidfile="/var/run/adblock.pid"
-adb_enabled="$(/etc/init.d/adblock enabled; echo $?)"
-
-if [ "${adb_enabled}" = "1" ] || [ -f "${adb_pidfile}" ] || [ "${ACTION}" != "ifup" ]
-then
-    exit 0
-fi
-
-. "${adb_helper}"
-f_envload
-
-if [ "${INTERFACE}" = "${adb_wanif4}" ] || [ "${INTERFACE}" = "${adb_wanif6}" ]
-then
-    if [ -z "${adb_hotplugif}" ] || [ "${INTERFACE}" = "${adb_hotplugif}" ]
-    then
-        /etc/init.d/adblock start
-        f_log "adblock service started due to '${ACTION}' of '${INTERFACE}' interface"
-    fi
-fi
index 5cd8672111b401d31714336907477908aeb8d082..ee94aa8228dabe6574a029c83bee18650cf6c3ab 100755 (executable)
 #!/bin/sh /etc/rc.common
 #
 
-START=90
-EXTRA_COMMANDS="toggle stats cfgup envchk query"
-EXTRA_HELP="   toggle  Toggle adblock 'on' or 'off'
-       stats   Update adblock statistics
-       cfgup   Update adblock configuration file
-       envchk  Check/Set adblock environment
-       query   <DOMAIN> Query active blocklists for specific domain"
+START=50
+USE_PROCD=1
 
-adb_debug=0
-adb_pid="${$}"
-adb_script="/usr/bin/adblock-update.sh"
-adb_helper="/usr/bin/adblock-helper.sh"
-adb_pidfile="/var/run/adblock.pid"
-bg_parm="&"
+EXTRA_COMMANDS="suspend resume query status"
+EXTRA_HELP="   suspend Suspend adblock processing
+       resume  Resume adblock processing
+       query   <DOMAIN> Query active blocklists for specific domains
+       status  Print runtime information"
 
-if [ $((adb_debug)) -eq 0 ]
-then
-    exec 2>/dev/null
-fi
-
-if [ -r "${adb_pidfile}" ]
-then
-    logger -s -t "adblock[${adb_pid}] error" "adblock service already running ($(cat ${adb_pidfile}))" 2>&1
-    exit 255
-fi
-
-. "${adb_helper}"
-f_envload
-
-if [ "${adb_restricted}" = "1" ]
-then
-    adb_uci="$(which true)"
-fi
+adb_init="/etc/init.d/adblock"
+adb_script="/usr/bin/adblock.sh"
 
 boot()
 {
-    return 0
+    adb_boot=1
+    ubus -t 30 wait_for network.interface 2>/dev/null
+    rc_procd start_service
 }
 
-start()
+start_service()
 {
-    if [ -t 1 ]
+    if [ $("${adb_init}" enabled; printf ${?}) -eq 0 ]
     then
-        unset bg_parm
+        if [ -n "${adb_boot}" ]
+        then
+            return 0
+        fi
+        procd_open_instance "adblock"
+        procd_set_param command "${adb_script}" "${@}"
+        procd_set_param stdout 1
+        procd_set_param stderr 1
+        procd_close_instance
     fi
-    eval "${adb_script}" ${bg_parm}
-    return 0
-}
-
-restart()
-{
-    stop
-    start
 }
 
-reload()
+stop_service()
 {
-    reload="true"
-    stop
-    start
+    rc_procd "${adb_script}" stop
+    rc_procd start_service
 }
 
-stop()
+restart()
 {
-    f_rmdns
-    f_rmuhttpd
-    config_foreach f_rmconfig source
-    if [ -z "${reload}" ]
-    then
-        f_rmfirewall
-    fi
-    if [ -n "${rm_dns}" ] || [ -n "${rm_uhttpd}" ] || [ -n "${rm_fw}" ] || [ -n "$(${adb_uci} -q changes adblock)" ]
-    then
-        "${adb_uci}" -q commit adblock
-        f_log "all adblock related services stopped"
-    fi
-    return 0
+    rc_procd start_service restart
 }
 
-toggle()
+suspend()
 {
-    if [ -d "${adb_dnshidedir}" ]
-    then
-        list_dns="$(find "${adb_dnsdir}" -maxdepth 1 -type f -name "${adb_dnsprefix}*" -print)"
-        list_dnshide="$(find "${adb_dnshidedir}" -maxdepth 1 -type f -name "${adb_dnsprefix}*" -print)"
-        if [ -n "${list_dns}" ]
-        then
-            source="${adb_dnsdir}/${adb_dnsprefix}"
-            target="${adb_dnshidedir}"
-            pos="off"
-        elif [ -n "${list_dnshide}" ]
-        then
-            source="${adb_dnshidedir}/${adb_dnsprefix}"
-            target="${adb_dnsdir}"
-            pos="on"
-        fi
-        if [ -n "${list_dns}" ] || [ -n "${list_dnshide}" ]
-        then
-            mv -f "${source}"* "${target}"
-            /etc/init.d/dnsmasq restart
-            "${adb_uci}" -q set "adblock.global.adb_dnstoggle=${pos}"
-            "${adb_uci}" -q commit "adblock"
-            f_log "adblock toggle switched '${pos}'"
-        fi
-    fi
-    return 0
+    rc_procd "${adb_script}" suspend
 }
 
-stats()
+resume()
 {
-    f_statistics
-    "${adb_uci}" -q commit "adblock"
-    return 0
+    rc_procd "${adb_script}" resume
 }
 
-cfgup()
+query()
 {
-    stop
-    cp -pf "/etc/adblock/adblock.conf.default" "/etc/config/adblock"
-    rc=$?
-    if [ $((rc)) -eq 0 ]
-    then
-        f_log "default adblock configuration applied, please check the settings in '/etc/config/adblock'"
-    else
-        f_log "default adblock configuration not found, please re-install the package via 'opkg install adblock --force-maintainer'"
-    fi
-    return 0
+    rc_procd "${adb_script}" query "${1}"
 }
 
-query()
+status()
 {
-    domain="${1}"
-    tld="${domain#*.}"
-    list_dns="$(find "${adb_dnsdir}" -maxdepth 1 -type f -name "${adb_dnsprefix}*" -print)"
-    if [ -z "${list_dns}" ]
-    then
-        f_log "no active blocklists found, please start adblock first"
-    elif [ -z "${domain}" ] || [ "${domain}" = "${tld}" ]
-    then
-        f_log "invalid domain query input, please submit a specific (sub-)domain, i.e. 'www.abc.xyz'"
-    else
-        while [ "${domain}" != "${tld}" ]
-        do
-            search="${domain//./\.}"
-            result="$(grep -Hm 1 "[/\.]${search}/" "${adb_dnsdir}/adb_list"* | awk -F ':|/' '{print "   "$4"\t: "$6}')"
-            count="$(grep -hc "[/\.]${search}/" "${adb_dnsdir}/adb_list"* | awk '{sum += $1} END {printf sum}')"
-            printf "%s\n" "=> distinct results for domain '${domain}' (overall ${count})"
-            if [ -z "${result}" ]
-            then
-                printf "%s\n" "   no matches in active blocklists"
-            else
-                printf "%s\n" "${result}"
-            fi
-            domain="${tld}"
-            tld="${domain#*.}"
-        done
-    fi
-    return 0
+    rc_procd "${adb_script}" status
 }
 
-envchk()
+service_triggers()
 {
-    adb_loglevel=0
-    f_envcheck
-    rm -f "${adb_tmpfile}"
-    rm -rf "${adb_tmpdir}"
-    adb_loglevel=1
-    f_log "adblock environment check finished successfully"
-    return 0
+    local iface="$(uci -q get adblock.global.adb_iface)"
+    local delay="$(uci -q get adblock.global.adb_triggerdelay)"
+
+    PROCD_RELOAD_DELAY=$((${delay:=2} * 1000))
+    for name in ${iface}
+    do
+        procd_add_interface_trigger "interface.*.up" "${name}" "${adb_init}" start
+    done
+    PROCD_RELOAD_DELAY=1000
+    procd_add_config_trigger "config.change" "adblock" "${adb_init}" start
 }
diff --git a/net/adblock/files/adblock.sh b/net/adblock/files/adblock.sh
new file mode 100755 (executable)
index 0000000..03f86b0
--- /dev/null
@@ -0,0 +1,586 @@
+#!/bin/sh
+# dns based ad/abuse domain blocking
+# written by Dirk Brenken (dev@brenken.org)
+
+# This is free software, licensed under the GNU General Public License v3.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# set initial defaults
+#
+LC_ALL=C
+PATH="/usr/sbin:/usr/bin:/sbin:/bin"
+adb_ver="2.6.2"
+adb_sysver="$(ubus -S call system board | jsonfilter -e '@.release.description')"
+adb_enabled=1
+adb_debug=0
+adb_forcesrt=0
+adb_forcedns=0
+adb_backup=0
+adb_backupdir="/mnt"
+adb_whitelist="/etc/adblock/adblock.whitelist"
+adb_whitelist_rset="\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\"^\"\$1\"\\\|[.]\"\$1)}"
+adb_fetch="/usr/bin/wget"
+adb_fetchparm="--no-config --quiet --no-cache --no-cookies --max-redirect=0 --timeout=10 --no-check-certificate -O"
+adb_dnslist="dnsmasq unbound"
+adb_dnsprefix="adb_list"
+adb_rtfile="/tmp/adb_runtime.json"
+
+# f_envload: load adblock environment
+#
+f_envload()
+{
+    local dns_up cnt=0
+
+    # source in system library
+    #
+    if [ -r "/lib/functions.sh" ] && [ -r "/usr/share/libubox/jshn.sh" ]
+    then
+        . "/lib/functions.sh"
+        . "/usr/share/libubox/jshn.sh"
+    else
+        f_log "error" "system libraries not found"
+    fi
+
+    # set dns backend environment
+    #
+    while [ ${cnt} -le 20 ]
+    do
+        for dns in ${adb_dnslist}
+        do
+            dns_up="$(ubus -S call service list "{\"name\":\"${dns}\"}" | jsonfilter -l1 -e "@.${dns}.instances.*.running")"
+            if [ "${dns_up}" = "true" ]
+            then
+                case "${dns}" in
+                    dnsmasq)
+                        adb_dns="dnsmasq"
+                        adb_dnsdir="/tmp/dnsmasq.d"
+                        adb_dnshidedir="${adb_dnsdir}/.adb_hidden"
+                        adb_dnsformat="awk '{print \"local=/\"\$0\"/\"}'"
+                        break 2
+                        ;;
+                    unbound)
+                        adb_dns="unbound"
+                        adb_dnsdir="/var/lib/unbound"
+                        adb_dnshidedir="${adb_dnsdir}/.adb_hidden"
+                        adb_dnsformat="awk '{print \"local-zone: \042\"\$0\"\042 static\"}'"
+                        break 2
+                        ;;
+                esac
+            fi
+        done
+        sleep 1
+        cnt=$((cnt+1))
+    done
+    if [ -z "${adb_dns}" ]
+    then
+        f_log "error" "no active/supported DNS backend found"
+    fi
+
+    # parse global section by callback
+    #
+    config_cb()
+    {
+        local type="${1}"
+        if [ "${type}" = "adblock" ]
+        then
+            option_cb()
+            {
+                local option="${1}"
+                local value="${2}"
+                eval "${option}=\"${value}\""
+            }
+        else
+            reset_cb
+        fi
+    }
+
+    # parse 'source' section
+    #
+    parse_config()
+    {
+        local value opt section="${1}" options="enabled adb_src adb_src_rset adb_src_cat"
+        eval "adb_sources=\"${adb_sources} ${section}\""
+        for opt in ${options}
+        do
+            config_get value "${section}" "${opt}"
+            if [ -n "${value}" ]
+            then
+                eval "${opt}_${section}=\"${value}\""
+            fi
+        done
+    }
+
+    # load adblock config
+    #
+    config_load adblock
+    config_foreach parse_config source
+
+    # force dns to local resolver
+    #
+    if [ ${adb_forcedns} -eq 1 ] && [ -z "$(uci -q get firewall.adblock_dns)" ]
+    then
+        uci -q set firewall.adblock_dns="redirect"
+        uci -q set firewall.adblock_dns.name="Adblock DNS"
+        uci -q set firewall.adblock_dns.src="lan"
+        uci -q set firewall.adblock_dns.proto="tcp udp"
+        uci -q set firewall.adblock_dns.src_dport="53"
+        uci -q set firewall.adblock_dns.dest_port="53"
+        uci -q set firewall.adblock_dns.target="DNAT"
+    elif [ ${adb_forcedns} -eq 0 ] && [ -n "$(uci -q get firewall.adblock_dns)" ]
+    then
+        uci -q delete firewall.adblock_dns
+    fi
+    if [ -n "$(uci -q changes firewall)" ]
+    then
+        uci -q commit firewall
+        if [ $(/etc/init.d/firewall enabled; printf ${?}) -eq 0 ]
+        then
+            /etc/init.d/firewall reload >/dev/null 2>&1
+        fi
+    fi
+}
+
+# f_envcheck: check/set environment prerequisites
+#
+f_envcheck()
+{
+    local ssl_lib
+
+    # check 'enabled' option
+    #
+    if [ ${adb_enabled} -ne 1 ]
+    then
+        if [ -n "$(ls -dA "${adb_dnsdir}/${adb_dnsprefix}"* 2>/dev/null)" ]
+        then
+            f_rmdns
+            f_dnsrestart
+        fi
+        f_log "info " "adblock is currently disabled, please set adb_enabled to '1' to use this service"
+        exit 0
+    fi
+
+    # check fetch utility
+    #
+    ssl_lib="-"
+    if [ -x "${adb_fetch}" ]
+    then
+        if [ "$(readlink -fn "${adb_fetch}")" = "/usr/bin/wget-nossl" ]
+        then
+            adb_fetchparm="--no-config --quiet --no-cache --no-cookies --max-redirect=0 --timeout=10 -O"
+        elif [ "$(readlink -fn "/bin/wget")" = "/bin/busybox" ] || [ "$(readlink -fn "${adb_fetch}")" = "/bin/busybox" ]
+        then
+            adb_fetch="/bin/busybox"
+            adb_fetchparm="-q -O"
+        else
+            ssl_lib="built-in"
+        fi
+    fi
+    if [ ! -x "${adb_fetch}" ] && [ "$(readlink -fn "/bin/wget")" = "/bin/uclient-fetch" ]
+    then
+        adb_fetch="/bin/uclient-fetch"
+        if [ -f "/lib/libustream-ssl.so" ]
+        then
+            adb_fetchparm="-q --timeout=10 --no-check-certificate -O"
+            ssl_lib="libustream-ssl"
+        else
+            adb_fetchparm="-q --timeout=10 -O"
+        fi
+    fi
+    if [ ! -x "${adb_fetch}" ] || [ -z "${adb_fetch}" ] || [ -z "${adb_fetchparm}" ]
+    then
+        f_log "error" "no download utility found, please install 'uclient-fetch' with 'libustream-mbedtls' or the full 'wget' package"
+    fi
+    adb_fetchinfo="${adb_fetch##*/} (${ssl_lib})"
+
+    # create dns hideout directory
+    #
+    if [ ! -d "${adb_dnshidedir}" ]
+    then
+        mkdir -p -m 660 "${adb_dnshidedir}"
+        chown -R "${adb_dns}":"${adb_dns}" "${adb_dnshidedir}" 2>/dev/null
+    else
+        rm -f "${adb_dnshidedir}/${adb_dnsprefix}"*
+    fi
+
+    # create adblock temp file/directory
+    #
+    adb_tmpload="$(mktemp -tu)"
+    adb_tmpfile="$(mktemp -tu)"
+    adb_tmpdir="$(mktemp -p /tmp -d)"
+
+    # prepare whitelist entries
+    #
+    if [ -s "${adb_whitelist}" ]
+    then
+        awk "${adb_whitelist_rset}" "${adb_whitelist}" > "${adb_tmpdir}/tmp.whitelist"
+    fi
+}
+
+# f_rmtemp: remove temporary files & directories
+#
+f_rmtemp()
+{
+    if [ -d "${adb_tmpdir}" ]
+    then
+        rm -f "${adb_tmpload}"
+        rm -f "${adb_tmpfile}"
+        rm -rf "${adb_tmpdir}"
+    fi
+}
+
+# f_rmdns: remove dns related files & directories
+#
+f_rmdns()
+{
+    if [ -n "${adb_dns}" ]
+    then
+        rm -f "${adb_dnsdir}/${adb_dnsprefix}"*
+        rm -f "${adb_backupdir}/${adb_dnsprefix}"*.gz
+        rm -rf "${adb_dnshidedir}"
+        > "${adb_rtfile}"
+    fi
+}
+
+# f_dnsrestart: restart the dns backend
+#
+f_dnsrestart()
+{
+    local cnt=0
+
+    "/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
+    while [ ${cnt} -le 10 ]
+    do
+        adb_dnsup="$(ubus -S call service list "{\"name\":\"${adb_dns}\"}" | jsonfilter -l1 -e "@.${adb_dns}.instances.*.running")"
+        if [ "${adb_dnsup}" = "true" ]
+        then
+            break
+        fi
+        cnt=$((cnt+1))
+        sleep 1
+    done
+}
+
+# f_list: backup/restore/remove block lists
+#
+f_list()
+{
+    local mode="${1}" in_rc="${adb_rc}" cnt=0
+
+    case "${mode}" in
+        backup)
+            cnt="$(wc -l < "${adb_tmpfile}")"
+            if [ ${adb_backup} -eq 1 ] && [ -d "${adb_backupdir}" ]
+            then
+                gzip -cf "${adb_tmpfile}" > "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz"
+                adb_rc=${?}
+            fi
+            ;;
+        restore)
+            if [ ${adb_backup} -eq 1 ] && [ -d "${adb_backupdir}" ]
+            then
+                rm -f "${adb_dnsdir}/${adb_dnsprefix}.${src_name}"
+                if [ -f "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz" ]
+                then
+                    gunzip -cf "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz" > "${adb_tmpfile}"
+                    adb_rc=${?}
+                fi
+            fi
+            ;;
+        remove)
+            rm -f "${adb_dnsdir}/${adb_dnsprefix}.${src_name}"
+            if [ -d "${adb_backupdir}" ]
+            then
+                rm -f "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz"
+            fi
+            adb_rc=${?}
+            ;;
+    esac
+    f_log "debug" "name: ${src_name}, mode: ${mode}, count: ${cnt}, in_rc: ${in_rc}, out_rc: ${adb_rc}"
+}
+
+# f_switch: suspend/resume adblock processing
+#
+f_switch()
+{
+    if [ -d "${adb_dnshidedir}" ]
+    then
+        local source target status mode="${1}"
+        local dns_active="$(find "${adb_dnsdir}" -maxdepth 1 -type f -name "${adb_dnsprefix}*" -print)"
+        local dns_passive="$(find "${adb_dnshidedir}" -maxdepth 1 -type f -name "${adb_dnsprefix}*" -print)"
+
+        if [ -n "${dns_active}" ] && [ "${mode}" = "suspend" ]
+        then
+            source="${adb_dnsdir}/${adb_dnsprefix}"
+            target="${adb_dnshidedir}"
+            status="suspended"
+        elif [ -n "${dns_passive}" ] && [ "${mode}" = "resume" ]
+        then
+            source="${adb_dnshidedir}/${adb_dnsprefix}"
+            target="${adb_dnsdir}"
+            status="resumed"
+        fi
+        if [ -n "${status}" ]
+        then
+            mv -f "${source}"* "${target}"
+            f_dnsrestart
+            f_log "info " "adblock processing ${status}"
+        fi
+    fi
+}
+
+# f_query: query block lists for certain (sub-)domains
+#
+f_query()
+{
+    local search result cnt
+    local domain="${1}"
+    local tld="${domain#*.}"
+    local dns_active="$(find "${adb_dnsdir}" -maxdepth 1 -type f -name "${adb_dnsprefix}*" -print)"
+
+    if [ -z "${dns_active}" ]
+    then
+         printf "%s\n" "::: no active block lists found, please start / resume adblock first"
+    elif [ -z "${domain}" ] || [ "${domain}" = "${tld}" ]
+    then
+        printf "%s\n" "::: invalid domain input, please submit a specific (sub-)domain, e.g. 'www.abc.xyz'"
+    else
+        cd "${adb_dnsdir}"
+        while [ "${domain}" != "${tld}" ]
+        do
+            search="${domain//./\.}"
+            result="$(grep -Hm1 "[/\"\.]${search}[/\"]" "${adb_dnsprefix}"* | awk -F ':|=|/|\"' '{printf(" %-20s : %s\n",$1,$4)}')"
+            printf "%s\n" "::: distinct results for domain '${domain}'"
+            printf "%s\n" "${result:=" no match"}"
+            domain="${tld}"
+            tld="${domain#*.}"
+        done
+    fi
+}
+
+# f_status: output runtime information
+#
+f_status()
+{
+    local key keylist value
+
+    if [ -s "${adb_rtfile}" ]
+    then
+        local dns_active="$(find "${adb_dnsdir}" -maxdepth 1 -type f -name "${adb_dnsprefix}*" -print)"
+        local dns_passive="$(find "${adb_dnshidedir}" -maxdepth 1 -type f -name "${adb_dnsprefix}*" -print)"
+
+        if [ -n "${dns_active}" ]
+        then
+            value="active"
+        elif [ -n "${dns_passive}" ] || [ -z "${dns_active}" ]
+        then
+            value="no domains blocked"
+        fi
+        printf "%s\n" "::: adblock runtime information"
+        printf " %-15s : %s\n" "status" "${value}"
+        json_load "$(cat "${adb_rtfile}" 2>/dev/null)"
+        json_select data
+        json_get_keys keylist
+        for key in ${keylist}
+        do
+            json_get_var value ${key}
+            printf " %-15s : %s\n" "${key}" "${value}"
+        done
+    fi
+}
+
+# f_log: write to syslog, exit on error
+#
+f_log()
+{
+    local class="${1}" log_msg="${2}"
+
+    if [ -n "${log_msg}" ] && ([ "${class}" != "debug" ] || [ ${adb_debug} -eq 1 ])
+    then
+        logger -t "adblock-[${adb_ver}] ${class}" "${log_msg}"
+        if [ "${class}" = "error" ]
+        then
+            logger -t "adblock-[${adb_ver}] ${class}" "Please check 'https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md' (${adb_sysver})"
+            f_rmtemp
+            if [ -n "$(ls -dA "${adb_dnsdir}/${adb_dnsprefix}"* 2>/dev/null)" ]
+            then
+                f_rmdns
+                f_dnsrestart
+            fi
+            exit 255
+        fi
+    fi
+}
+
+# main function for block list processing
+#
+f_main()
+{
+    local enabled url cnt sum_cnt=0 mem_total=0
+    local src_name src_rset shalla_archive
+    mem_total="$(awk '$1 ~ /^MemTotal/ {printf $2}' "/proc/meminfo" 2>/dev/null)"
+
+    f_log "info " "start adblock processing ..."
+    > "${adb_rtfile}"
+    for src_name in ${adb_sources}
+    do
+        eval "enabled=\"\${enabled_${src_name}}\""
+        eval "url=\"\${adb_src_${src_name}}\""
+        eval "src_rset=\"\${adb_src_rset_${src_name}}\""
+        adb_dnsfile="${adb_tmpdir}/${adb_dnsprefix}.${src_name}"
+        > "${adb_tmpload}"
+        > "${adb_tmpfile}"
+        adb_rc=0
+
+        # basic pre-checks
+        #
+        if [ "${enabled}" != "1" ] || [ -z "${url}" ] || [ -z "${src_rset}" ]
+        then
+            f_list remove
+            continue
+        fi
+
+        # download block list
+        #
+        f_log "debug" "name: ${src_name}, enabled: ${enabled}, backup: ${adb_backup}, dns: ${adb_dns}, fetch: ${adb_fetchinfo}, memory: ${mem_total}, force srt/dns: ${adb_forcesrt}/${adb_forcedns}"
+        if [ "${src_name}" = "blacklist" ]
+        then
+            cat "${url}" 2>/dev/null > "${adb_tmpload}"
+            adb_rc=${?}
+        elif [ "${src_name}" = "shalla" ]
+        then
+            shalla_archive="${adb_tmpdir}/shallalist.tar.gz"
+            "${adb_fetch}" ${adb_fetchparm} "${shalla_archive}" "${url}" 2>/dev/null
+            adb_rc=${?}
+            if [ ${adb_rc} -eq 0 ]
+            then
+                for category in ${adb_src_cat_shalla}
+                do
+                    tar -xOzf "${shalla_archive}" BL/${category}/domains >> "${adb_tmpload}"
+                    adb_rc=${?}
+                    if [ ${adb_rc} -ne 0 ]
+                    then
+                        break
+                    fi
+                done
+            fi
+            rm -f "${shalla_archive}"
+            rm -rf "${adb_tmpdir}/BL"
+        else
+            "${adb_fetch}" ${adb_fetchparm} "${adb_tmpload}" "${url}" 2>/dev/null
+            adb_rc=${?}
+        fi
+
+        # check download result and prepare domain output (incl. tld compression, list backup & restore)
+        #
+        if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpload}" ]
+        then
+            awk "${src_rset}" "${adb_tmpload}" 2>/dev/null > "${adb_tmpfile}"
+            if [ -s "${adb_tmpfile}" ]
+            then
+                awk -F "." '{for(f=NF;f > 1;f--) printf "%s.", $f;print $1}' "${adb_tmpfile}" 2>/dev/null | sort -u > "${adb_tmpload}"
+                awk '{if(NR==1){tld=$NF};while(getline){if($NF !~ tld"\\."){print tld;tld=$NF}}print tld}' "${adb_tmpload}" 2>/dev/null > "${adb_tmpfile}"
+                awk -F "." '{for(f=NF;f > 1;f--) printf "%s.", $f;print $1}' "${adb_tmpfile}" 2>/dev/null > "${adb_tmpload}"
+                mv -f "${adb_tmpload}" "${adb_tmpfile}"
+                f_list backup
+            else
+                f_list restore
+            fi
+        else
+            f_list restore
+        fi
+
+        # remove whitelist domains, final list preparation
+        #
+        if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
+        then
+            if [ -s "${adb_tmpdir}/tmp.whitelist" ]
+            then
+                grep -vf "${adb_tmpdir}/tmp.whitelist" "${adb_tmpfile}" 2>/dev/null | eval "${adb_dnsformat}" > "${adb_dnsfile}"
+            else
+                cat "${adb_tmpfile}" 2>/dev/null | eval "${adb_dnsformat}" > "${adb_dnsfile}"
+            fi
+            adb_rc=${?}
+            if [ ${adb_rc} -ne 0 ]
+            then
+                f_list remove
+            fi
+        else
+            f_list remove
+        fi
+    done
+
+    # overall sort
+    #
+    for src_name in $(ls -dASr "${adb_tmpdir}/${adb_dnsprefix}"* 2>/dev/null)
+    do
+        if [ ${mem_total} -ge 64000 ] || [ ${adb_forcesrt} -eq 1 ]
+        then
+            if [ -s "${adb_tmpdir}/blocklist.overall" ]
+            then
+                sort "${adb_tmpdir}/blocklist.overall" "${adb_tmpdir}/blocklist.overall" "${src_name}" | uniq -u > "${adb_tmpdir}/tmp.blocklist"
+                mv -f "${adb_tmpdir}/tmp.blocklist" "${src_name}"
+            fi
+            cat "${src_name}" >> "${adb_tmpdir}/blocklist.overall"
+        fi
+        cnt="$(wc -l < "${src_name}")"
+        sum_cnt=$((sum_cnt + cnt))
+    done
+
+    # restart the dns backend and export runtime information
+    #
+    mv -f "${adb_tmpdir}/${adb_dnsprefix}"* "${adb_dnsdir}" 2>/dev/null
+    chown "${adb_dns}":"${adb_dns}" "${adb_dnsdir}/${adb_dnsprefix}"* 2>/dev/null
+    f_rmtemp
+    f_dnsrestart
+    if [ "${adb_dnsup}" = "true" ]
+    then
+        json_init
+        json_add_object "data"
+        json_add_string "adblock_version" "${adb_ver}"
+        json_add_string "blocked_domains" "${sum_cnt}"
+        json_add_string "fetch_info" "${adb_fetchinfo}"
+        json_add_string "dns_backend" "${adb_dns}"
+        json_add_string "last_rundate" "$(/bin/date "+%d.%m.%Y %H:%M:%S")"
+        json_add_string "system" "${adb_sysver}"
+        json_close_object
+        json_dump > "${adb_rtfile}"
+        f_log "info " "block lists with overall ${sum_cnt} domains loaded successfully (${adb_sysver})"
+    else
+        f_log "error" "dns backend restart with active block lists failed"
+    fi
+}
+
+# handle different adblock actions
+#
+f_envload
+case "${1}" in
+    stop)
+        f_rmtemp
+        f_rmdns
+        f_dnsrestart
+        ;;
+    restart)
+        f_rmtemp
+        f_rmdns
+        f_envcheck
+        f_main
+        ;;
+    suspend)
+        f_switch suspend
+        ;;
+    resume)
+        f_switch resume
+        ;;
+    query)
+        f_query "${2}"
+        ;;
+    status)
+        f_status
+        ;;
+    *)
+        f_envcheck
+        f_main
+        ;;
+esac
+exit 0
diff --git a/net/adblock/files/www/adblock/index.html b/net/adblock/files/www/adblock/index.html
deleted file mode 100644 (file)
index ff6c903..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-    <head>
-        <script>window.close();</script>
-    </head>
-    <body>
-        <img src="data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=" alt=""></img>
-    </body>
-</html>
index 6d24fb446bbce3a465c1f3043c6ea617d39acd7b..d436bd39282270235cf4dc66da5a5da795016a9b 100644 (file)
@@ -8,15 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=apache
-PKG_VERSION:=2.2.31
-PKG_RELEASE:=2
+PKG_VERSION:=2.4.25
+PKG_RELEASE:=1
 PKG_SOURCE_NAME:=httpd
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 PKG_LICENSE:=Apache License
 
 PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@APACHE/httpd/
-PKG_MD5SUM:=6c10e15835ab214464228a9beb7afba8
+PKG_MD5SUM:=2826f49619112ad5813c0be5afcc7ddb
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
 
@@ -40,7 +40,7 @@ endef
 
 define Package/apache
 $(call Package/apache/Default)
-  DEPENDS:=+libapr +libaprutil +libpcre +libopenssl +unixodbc
+  DEPENDS:=+libapr +libaprutil +libpcre +libopenssl +unixodbc 
 endef
 
 define Package/apache/description
@@ -90,6 +90,7 @@ endef
 
 TARGET_CFLAGS += $(FPIC)
 TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
+TARGET_LDFLAGS += -lpthread 
 
 define Build/Configure
        $(call Build/Configure/Default, \
@@ -97,16 +98,22 @@ define Build/Configure
                --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \
                --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
                --enable-http \
+               --with-crypto \
+               --with-sqlit3="$(STAGING_DIR)/usr" \
+               --with-openssl="$(STAGING_DIR)/usr" \
                --enable-ssl \
                --enable-proxy \
                --disable-disk-cache \
                --enable-maintainer-mode \
+               --with-mpm=prefork \
+               --with-mpm=worker \
                --enable-mime-magic \
                --without-suexec-bin \
                --sysconfdir=/etc/apache \
                ap_cv_void_ptr_lt_long=no \
                logfiledir="/var/log" \
                runtimedir="/var/run" \
+               EXTRA_LIBS="-ldl -lpthread -lcrypto -lrt -lssl" \
        )
 endef
 
@@ -140,7 +147,8 @@ endef
 define Package/apache/install
        $(INSTALL_DIR) $(1)/usr/sbin
        # we don't need apxs on the router, it's just for building apache modules.
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{ab,apachectl,checkgid,dbmmanage,envvars,envvars-std,htcacheclean,htdbm,htdigest,htpasswd,httpd,httxt2dbm,logresolve,rotatelogs} $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{ab,dbmmanage,htdbm,htdigest,htpasswd,httxt2dbm,logresolve} $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{apachectl,checkgid,envvars,envvars-std,htcacheclean,httpd,rotatelogs} $(1)/usr/sbin/
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/share
index e8ea3cd1d72c8ef5c66dc49e667778f33bf81b22..ad07704bba6d2eb494bdb2213ca46643ef759a5b 100644 (file)
@@ -1,5 +1,7 @@
+Index: httpd-2.4.25/server/test_char.h
+===================================================================
 --- /dev/null
-+++ b/server/test_char.h
++++ httpd-2.4.25/server/test_char.h
 @@ -0,0 +1,23 @@
 +/* this file is automatically generated by gen_test_char, do not edit */
 +#define T_ESCAPE_SHELL_CMD     (1)
 +    54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,
 +    54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54
 +};
+Index: httpd-2.4.25/server/util.c
+===================================================================
+--- httpd-2.4.25.orig/server/util.c
++++ httpd-2.4.25/server/util.c
+@@ -96,6 +96,16 @@
+ #undef APLOG_MODULE_INDEX
+ #define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
++#define T_ESCAPE_SHELL_CMD    (0x01)
++#define T_ESCAPE_PATH_SEGMENT (0x02)
++#define T_OS_ESCAPE_PATH      (0x04)
++#define T_HTTP_TOKEN_STOP     (0x08)
++#define T_ESCAPE_LOGITEM      (0x10)
++#define T_ESCAPE_FORENSIC     (0x20)
++#define T_ESCAPE_URLENCODED   (0x40)
++#define T_HTTP_CTRLS          (0x80)
++#define T_VCHAR_OBSTEXT      (0x100)
++
+ /*
+  * Examine a field value (such as a media-/content-type) string and return
+  * it sans any parameters; e.g., strip off any ';charset=foo' and the like.
index 635c65caa6383a371a306c8f351b40c85d912b30..fd22410d7c76fbb519966d8142c9e3eccc92217a 100644 (file)
@@ -1,6 +1,8 @@
---- a/build/mkconfNW.awk
-+++ b/build/mkconfNW.awk
-@@ -24,7 +24,7 @@ BEGIN {
+Index: httpd-2.4.25/build/mkconfNW.awk
+===================================================================
+--- httpd-2.4.25.orig/build/mkconfNW.awk
++++ httpd-2.4.25/build/mkconfNW.awk
+@@ -23,7 +23,7 @@ BEGIN {
      A["sysconfdir"] = "conf"
      A["iconsdir"] = "icons"
      A["manualdir"] = "manual"
@@ -9,8 +11,10 @@
      A["errordir"] = "error"
      A["proxycachedir"] = "proxy"
  
---- a/config.layout
-+++ b/config.layout
+Index: httpd-2.4.25/config.layout
+===================================================================
+--- httpd-2.4.25.orig/config.layout
++++ httpd-2.4.25/config.layout
 @@ -28,8 +28,8 @@
      cgidir:        ${datadir}/cgi-bin
      includedir:    ${prefix}/include
index e9f0b6de1ade54d0b3f60a9782cb86bf9ce6f885..647f821adac048d6ddafc2dea8db37e1db004239 100644 (file)
@@ -1,6 +1,8 @@
---- a/include/scoreboard.h
-+++ b/include/scoreboard.h
-@@ -42,7 +42,7 @@ extern "C" {
+Index: httpd-2.4.25/include/scoreboard.h
+===================================================================
+--- httpd-2.4.25.orig/include/scoreboard.h
++++ httpd-2.4.25/include/scoreboard.h
+@@ -40,7 +40,7 @@ extern "C" {
  
  /* Scoreboard file, if there is one */
  #ifndef DEFAULT_SCOREBOARD
@@ -8,4 +10,4 @@
 +#define DEFAULT_SCOREBOARD "log/apache_runtime_status"
  #endif
  
- /* Scoreboard info on a process is, for now, kept very brief --- 
+ /* Scoreboard info on a process is, for now, kept very brief ---
index 3bcbba49daa4a66f04f353b2c45c3f5a19834bd4..04a73a9e32c985bc46617ecd2154f24b0b4d47f6 100644 (file)
@@ -1,14 +1,16 @@
---- a/docs/conf/httpd.conf.in
-+++ b/docs/conf/httpd.conf.in
-@@ -52,7 +52,6 @@ Listen @@Port@@
+Index: httpd-2.4.25/docs/conf/httpd.conf.in
+===================================================================
+--- httpd-2.4.25.orig/docs/conf/httpd.conf.in
++++ httpd-2.4.25/docs/conf/httpd.conf.in
+@@ -63,7 +63,6 @@ Listen @@Port@@
  # Example:
  # LoadModule foo_module modules/mod_foo.so
  #
 -@@LoadModule@@
  
- <IfModule !mpm_netware_module>
- <IfModule !mpm_winnt_module>
-@@ -64,8 +63,8 @@ Listen @@Port@@
+ <IfModule unixd_module>
+ #
+@@ -74,8 +73,8 @@ Listen @@Port@@
  # It is usually good practice to create a dedicated user and group for
  # running httpd, as with most system services.
  #
@@ -18,8 +20,8 @@
 +Group nogroup
  
  </IfModule>
- </IfModule>
-@@ -192,7 +191,7 @@ ErrorLog "@rel_logfiledir@/error_log"
+@@ -188,7 +187,7 @@ ErrorLog "@rel_logfiledir@/error_log"
  # Possible values include: debug, info, notice, warn, error, crit,
  # alert, emerg.
  #
@@ -28,7 +30,7 @@
  
  <IfModule log_config_module>
      #
-@@ -337,7 +336,7 @@ DefaultType text/plain
+@@ -330,7 +329,7 @@ LogLevel warn
  # contents of the file itself to determine its type.  The MIMEMagicFile
  # directive tells the module where the hint definitions are located.
  #
  
  #
  # Customizable error responses come in three flavors:
-@@ -366,7 +365,7 @@ DefaultType text/plain
- # broken on your system.
+@@ -360,7 +359,7 @@ LogLevel warn
+ # Defaults: EnableMMAP On, EnableSendfile Off
  #
  #EnableMMAP off
--#EnableSendfile off
+-#EnableSendfile on
 +EnableSendfile off
  
  # Supplemental configuration
  #
-@@ -412,7 +411,7 @@ DefaultType text/plain
+@@ -411,8 +410,8 @@ Include @rel_sysconfdir@/extra/proxy-htm
  #       starting without SSL on platforms with no /dev/random equivalent
  #       but a statically compiled-in mod_ssl.
  #
@@ -58,3 +60,4 @@
 +#SSLRandomSeed startup builtin
 +#SSLRandomSeed connect builtin
 +#</IfModule>
diff --git a/net/apache/patches/006-remove-ssl3.patch b/net/apache/patches/006-remove-ssl3.patch
deleted file mode 100644 (file)
index c09654c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/support/ab.c
-+++ b/support/ab.c
-@@ -2232,8 +2232,10 @@ int main(int argc, const char * const ar
-                 } else if (strncasecmp(optarg, "SSL2", 4) == 0) {
-                     meth = SSLv2_client_method();
- #endif
-+#ifndef OPENSSL_NO_SSL3_METHOD
-                 } else if (strncasecmp(optarg, "SSL3", 4) == 0) {
-                     meth = SSLv3_client_method();
-+#endif
- #ifdef HAVE_TLSV1_X
-                 } else if (strncasecmp(optarg, "TLS1.1", 6) == 0) {
-                     meth = TLSv1_1_client_method();
index 81acf83a4be162f7a2282e4a25fc45395a00903f..a96d4b86c42884b7e4035b1b571bf40441c8095c 100644 (file)
@@ -7,12 +7,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=aria2
-PKG_VERSION:=1.28.0
+PKG_VERSION:=1.30.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://github.com/aria2/aria2/releases/download/release-$(PKG_VERSION)/
-PKG_MD5SUM:=f649ab30f3b09d0c0ebb816ce0c0205d
+PKG_MD5SUM:=8c22f569d3fb9e42c5fd9a95173b9b5f
 PKG_INSTALL:=1
 
 PKG_MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>, Hsing-Wang Liao <kuoruan@gmail.com>
index 9ca19109e1f9ff0a021834d309c668c8a69f1492..4677a29729eae125559fee19bfffbcaeef38a4fb 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bcp38
 PKG_VERSION:=5
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENCE:=GPL-3.0+
 
 include $(INCLUDE_DIR)/package.mk
@@ -23,7 +23,11 @@ define Package/bcp38
 endef
 
 define Package/bcp38/description
- bcp38 implements IETF BCP38 for home routers. See https://tools.ietf.org/html/bcp38.
+ bcp38 implements IETF BCP38 for home routers.
+ See https://tools.ietf.org/html/bcp38.
+
+ This package provides BCP38 for IPv4 only - IPv6 uses source 
+ specific default routes, so no firewall configuration is needed.
 endef
 
 define Package/bcp38/conffiles
index 08e8e20b35ac0636c9d09308deaaa5e25e4877f1..fc785ebe71a5f1b12ae75b5778cdd559370159da 100644 (file)
@@ -17,6 +17,10 @@ config bcp38
 #      There is a dhcp trigger to do this for the netmask of a 
 #      double natted connection needed
 
+#       You can only specify IPv4 addresses here - for IPv6, only source
+#       specific default routes will be installed, which achieves the same
+#       without needing any firewall routes.
+
 #      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
index f0d4847842e716ea010455db4bbfcb5f0a680200..04d6bdc1b15d055a08c84a2a9f475a6b8374093e 100644 (file)
@@ -2,7 +2,7 @@ if PACKAGE_bind-server
 
 config BIND_ENABLE_FILTER_AAAA
        bool
-       default n
+       default y
        prompt "Enable filtering of AAAA records returned to the client"
        help
                BIND 9 has an option to filter AAAA (IPv6 address) records
index 959184a4fe162e389f7faad9da6f361ea3de0d6a..a4a8b851065ff9a50dceb1acf27e87564ee9dcd6 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Copyright (C) 2006-2012 OpenWrt.org
-#               2014-2016 Noah Meyerhans <frodo@morgul.net>
+#               2014-2017 Noah Meyerhans <frodo@morgul.net>
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,8 +9,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bind
-PKG_VERSION:=9.10.4-P4
-PKG_RELEASE:=2
+PKG_VERSION:=9.10.4-P5
+PKG_RELEASE:=1
 USERID:=bind=57:bind=57
 
 PKG_MAINTAINER:=Noah Meyerhans <frodo@morgul.net>
@@ -20,7 +20,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:=e110904a1d54f83f01d4be8bcd842927
+PKG_MD5SUM:=c53a3e34e7aabb16820b036ae9afd3c9
 
 PKG_FIXUP:=autoreconf
 PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
index e39e24ed94c0f66de48aa401bd8cd1bfd6d6d960..a8c08fb2d41aa62d32ecb572e2539fd98a9578be 100644 (file)
@@ -1,5 +1,6 @@
 #
 # Copyright (C) 2007-2014 OpenWrt.org
+# Copyright (C) 2014-2016 Baptiste Jonglez
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bmon
-PKG_VERSION:=3.9
+PKG_VERSION:=4.0
 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:=a959371dc6f8eecdfe27c088447ec636
+PKG_MD5SUM:=02fdc312b8ceeb5786b28bf905f54328f414040ff42f45c83007f24b76cc9f7a
 PKG_MAINTAINER:=Baptiste Jonglez <openwrt-pkg@bitsofnetworks.org>
 PKG_LICENSE:=MIT
 
index db631fecdb305c19eb144b4162e5dff3ee7aa91b..4e1cb12a4af9bba58c459315157841d62915b568 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=chrony
 PKG_VERSION:=2.4.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://download.tuxfamily.org/chrony/
@@ -27,7 +27,7 @@ define Package/chrony
   SUBMENU:=Time Synchronization
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+libcap
+  DEPENDS:=+libcap +libpthread
   USERID:=chrony=323:chrony=323
   TITLE:=A versatile NTP client and server
   URL:=http://chrony.tuxfamily.org/
@@ -53,7 +53,6 @@ CONFIGURE_ARGS+= \
        --chronysockdir=/var/run/chrony \
        --disable-readline \
        --disable-rtc \
-       --disable-asyncdns \
        --with-user=chrony
 
 CONFIGURE_VARS+=CPPFLAGS=-DNDEBUG
index ed2edd6211a725c9ea0b2c0ec60b778a39c5d6d1..3d67e94d74f3b860294ebdff3716b4df95446e4f 100644 (file)
@@ -11,7 +11,7 @@ PKG_NAME:=cifs-utils
 PKG_VERSION:=6.4
 PKG_RELEASE:=2
 
-PKG_SOURCE_URL:=http://ftp.samba.org/pub/linux-cifs/cifs-utils
+PKG_SOURCE_URL:=https://download.samba.org/pub/linux-cifs/cifs-utils/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_MD5SUM:=b7d75b67fd3987952896d27256c7293d
 
diff --git a/net/clamav/Makefile b/net/clamav/Makefile
deleted file mode 100644 (file)
index 3f3edab..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-#
-# Copyright (C) 2015 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:=clamav
-PKG_VERSION:=0.98.7
-PKG_RELEASE:=1
-
-PKG_LICENSE:=GPL-2.0
-PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://sourceforge.net/projects/clamav/files/clamav/$(PKG_VERSION)/
-PKG_MD5SUM:=157c601161da1c2d5a0e48ea1b49e067
-
-PKG_BUILD_PARALLEL:=1
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/uclibc++.mk
-include $(INCLUDE_DIR)/package.mk
-
-define Package/clamav/Default
-  SECTION:=net
-  DEPENDS:=+libpthread +uclibcxx +zlib +libcurl +libopenssl
-  CATEGORY:=Network
-  SUBMENU:=Web Servers/Proxies
-  TITLE:=ClamAV
-  URL:=http://www.clamav.net/
-endef
-
-define Package/clamav
-    $(call Package/clamav/Default)
-endef
-
-define Package/freshclam
-    $(call Package/clamav/Default)
-    DEPENDS+= +clamav
-    TITLE+=database updater
-endef
-
-define Package/clamav/description
- ClamAV is an open source antivirus engine for detecting trojans,
- viruses, malware & other malicious threats.
-endef
-
-define Package/freshclam/description
- Database updater for ClamAV
-endef
-
-define Package/clamav/conffiles
-endef
-
-CONFIGURE_VARS += \
-       INCLUDES="" \
-       CXXFLAGS="$$$$CXXFLAGS -fno-rtti" \
-       LIBS="-lpthread" \
-
-define Build/Configure
-       $(call Build/Configure/Default, \
-               --sysconfdir=/etc/clamav/ \
-               --prefix=/usr/ \
-               --exec-prefix=/usr/ \
-               --disable-xml \
-               --disable-bzip2 \
-               --enable-ltdl-install \
-               --with-user nobody \
-               --with-group nogroup \
-       )
-endef
-
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               DESTDIR="$(PKG_INSTALL_DIR)" \
-               all install
-endef
-
-define Package/clamav/install
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clamd $(1)/usr/sbin/
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamav-config $(1)/usr/sbin/
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clambc $(1)/usr/sbin/
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamconf $(1)/usr/sbin/
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamdscan $(1)/usr/sbin/
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamscan $(1)/usr/sbin/
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sigtool $(1)/usr/sbin/
-
-       $(INSTALL_DIR) $(1)/usr/include
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/clamav.h $(1)/usr/include/
-
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib*/* $(1)/usr/lib/
-
-       $(INSTALL_DIR) $(1)/etc/config
-       $(INSTALL_CONF) ./files/clamav.config $(1)/etc/config/clamav
-
-       $(INSTALL_DIR) $(1)/etc/init.d/
-       $(INSTALL_BIN) ./files/clamav.init $(1)/etc/init.d/clamav
-
-       $(INSTALL_DIR) $(1)/usr/share/clamav
-       $(CP) ./files/bytecode.cvd $(1)/usr/share/clamav/
-endef
-
-define Package/freshclam/install
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/freshclam $(1)/usr/sbin/
-
-       $(INSTALL_DIR) $(1)/etc/config
-       $(INSTALL_CONF) ./files/freshclam.config $(1)/etc/config/freshclam
-
-       $(INSTALL_DIR) $(1)/etc/init.d/
-       $(INSTALL_BIN) ./files/freshclam.init $(1)/etc/init.d/freshclam
-endef
-
-$(eval $(call BuildPackage,clamav))
-$(eval $(call BuildPackage,freshclam))
diff --git a/net/clamav/files/bytecode.cvd b/net/clamav/files/bytecode.cvd
deleted file mode 100644 (file)
index 07ff8ab..0000000
Binary files a/net/clamav/files/bytecode.cvd and /dev/null differ
diff --git a/net/clamav/files/clamav.config b/net/clamav/files/clamav.config
deleted file mode 100644 (file)
index 1543caa..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-config clamav 'clamav'
-       option clamd_config_file '/etc/clamav/clamd.conf'
-       option LogFile '/tmp/clamd.log'
-       option LogFileMaxSize '1M'
-       option LogTime 'no'
-       option LogVerbose 'no'
-       option ExtendedDetectionInfo 'no'
-       option OfficialDatabaseOnly 'no'
-       option StreamMinPort '1024'
-       option StreamMaxPort '2048'
-       option MaxThreads '10'
-       option ReadTimeout '30'
-       option CommandReadTimeout '5'
-       option MaxDirectoryRecursion '15'
-       option FollowDirectorySymlinks 'no'
-       option FollowFileSymlinks 'no'
-       option SelfCheck '600'
-       option DetectPUA 'yes'
-       option ScanPE 'yes'
-       option DisableCertCheck 'no'
-       option ScanELF 'yes'
-       option DetectBrokenExecutables 'no'
-       option ScanOLE2 'yes'
-       option ScanPDF 'yes'
-       option ScanSWF 'yes'
-       option ScanMail 'yes'
-       option ScanPartialMessages 'no'
-       option ScanArchive 'yes'
-       option ArchiveBlockEncrypted 'yes'
-       option MaxFileSize '10M'
-       option TemporaryDirectory '/tmp'
-       option LocalSocket '/var/run/clamav/clamd.sock'
-       option User 'nobody'
-       option ExitOnOOM 'yes'
diff --git a/net/clamav/files/clamav.init b/net/clamav/files/clamav.init
deleted file mode 100644 (file)
index b2a8950..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2015 OpenWrt.org
-
-START=90
-STOP=10
-
-USE_PROCD=1
-PROG=/usr/sbin/clamd
-CLAMD_CONFIGFILE="/tmp/clamav/clamd.conf"
-
-validate_clamav_section() {
-       uci_validate_section clamav clamav "${1}" \
-               'clamd_config_file:string' \
-               'LogFile:string' \
-               'LogFileMaxSize:string' \
-               'LogVerbose:string' \
-               'ExtendedDetectionInfo:string' \
-               'LogTime:string' \
-               'OfficialDatabaseOnly:string' \
-               'StreamMinPort:uinteger' \
-               'StreamMaxPort:uinteger' \
-               'MaxThreads:uinteger' \
-               'ReadTimeout:uinteger' \
-               'CommandReadTimeout:uinteger' \
-               'MaxDirectoryRecursion:uinteger' \
-               'FollowDirectorySymlinks:string' \
-               'FollowFileSymlinks:string' \
-               'SelfCheck:uinteger' \
-               'DetectPUA:string' \
-               'ScanPE:string' \
-               'DisableCertCheck:string' \
-               'ScanELF:string' \
-               'DetectBrokenExecutables:string' \
-               'ScanOLE2:string' \
-               'ScanPDF:string' \
-               'ScanSWF:string' \
-               'ScanMail:string' \
-               'ScanPartialMessages:string' \
-               'ScanArchive:string' \
-               'TemporaryDirectory:string' \
-               'ArchiveBlockEncrypted:string' \
-               'MaxFileSize:string' \
-               'LocalSocket:string' \
-               'User:string' \
-               'ExitOnOOM:string'
-}
-
-start_service() {
-       local clamd_config_file LogFile LogTime StreamMinPort \
-               StreamMaxPort MaxThreads ReadTimeout CommandReadTimeout MaxDirectoryRecursion \
-               FollowFileSymlinks FollowDirectorySymlinks SelfCheck DetectPUA ScanPE DisableCertCheck \
-               ScanELF DetectBrokenExecutables ScanOLE2 ScanPDF ScanSWF ScanMail ScanPartialMessages \
-               ScanArchive TemporaryDirectory ArchiveBlockEncrypted MaxFileSize LocalSocket User
-
-       validate_clamav_section clamav || {
-               echo "validation failed"
-               return 1
-       }
-
-       mkdir -p /usr/share/clamav
-       mkdir -p /etc/clamav/
-       mkdir -p /var/run/clamav/
-       chmod a+rw /var/run/clamav
-
-       mkdir -p $(dirname $CLAMD_CONFIGFILE)
-       ln -sf $clamd_config_file $CLAMD_CONFIGFILE
-
-       echo "LogFile " $LogFile > $CLAMD_CONFIGFILE
-       echo "LogFileMaxSize " $LogFileMaxSize >> $CLAMD_CONFIGFILE
-       echo "LogVerbose " $LogVerbose >> $CLAMD_CONFIGFILE
-       echo "ExtendedDetectionInfo " $ExtendedDetectionInfo >> $CLAMD_CONFIGFILE
-       echo "LogTime " $LogTime >> $CLAMD_CONFIGFILE
-       echo "OfficialDatabaseOnly " $OfficialDatabaseOnly >> $CLAMD_CONFIGFILE
-       echo "StreamMinPort " $StreamMinPort >> $CLAMD_CONFIGFILE
-       echo "StreamMaxPort " $StreamMaxPort >> $CLAMD_CONFIGFILE
-       echo "MaxThreads " $MaxThreads >> $CLAMD_CONFIGFILE
-       echo "ReadTimeout " $ReadTimeout >> $CLAMD_CONFIGFILE
-       echo "CommandReadTimeout " $CommandReadTimeout >> $CLAMD_CONFIGFILE
-       echo "MaxDirectoryRecursion " $MaxDirectoryRecursion >> $CLAMD_CONFIGFILE
-       echo "FollowDirectorySymlinks " $FollowDirectorySymlinks >> $CLAMD_CONFIGFILE
-       echo "FollowFileSymlinks " $FollowFileSymlinks >> $CLAMD_CONFIGFILE
-       echo "SelfCheck " $SelfCheck >> $CLAMD_CONFIGFILE
-       echo "DetectPUA " $DetectPUA >> $CLAMD_CONFIGFILE
-       echo "ScanPE " $ScanPE >> $CLAMD_CONFIGFILE
-       echo "DisableCertCheck " $DisableCertCheck >> $CLAMD_CONFIGFILE
-       echo "ScanELF " $ScanELF >> $CLAMD_CONFIGFILE
-       echo "DetectBrokenExecutables " $DetectBrokenExecutables >> $CLAMD_CONFIGFILE
-       echo "ScanOLE2 " $ScanOLE2 >> $CLAMD_CONFIGFILE
-       echo "ScanPDF " $ScanPDF >> $CLAMD_CONFIGFILE
-       echo "ScanSWF " $ScanSWF >> $CLAMD_CONFIGFILE
-       echo "ScanMail " $ScanMail >> $CLAMD_CONFIGFILE
-       echo "ScanPartialMessages " $ScanPartialMessages >> $CLAMD_CONFIGFILE
-       echo "ScanArchive " $ScanArchive >> $CLAMD_CONFIGFILE
-       echo "TemporaryDirectory " $TemporaryDirectory >> $CLAMD_CONFIGFILE
-       echo "ArchiveBlockEncrypted " $ArchiveBlockEncrypted >> $CLAMD_CONFIGFILE
-       echo "MaxFileSize " $MaxFileSize >> $CLAMD_CONFIGFILE
-       echo "LocalSocket " $LocalSocket >> $CLAMD_CONFIGFILE
-       echo "User " $User >> $CLAMD_CONFIGFILE
-       echo "ExitOnOOM " $ExitOnOOM >> $CLAMD_CONFIGFILE
-
-       procd_open_instance
-       procd_set_param command $PROG -c $CLAMD_CONFIGFILE
-       procd_set_param file $CLAMD_CONFIGFILE
-       procd_close_instance
-}
-
-stop_service()
-{
-       service_stop ${PROG}
-}
-
-service_triggers()
-{
-       procd_add_reload_trigger "clamav"
-       procd_add_validation validate_clamav_section
-}
diff --git a/net/clamav/files/freshclam.config b/net/clamav/files/freshclam.config
deleted file mode 100644 (file)
index 827e8dd..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-config freshclam 'freshclam'
-       option freshclam_config_file '/etc/clamav/freshclam.conf'
-       option UpdateLogFile '/tmp/freshclam.log'
-       option DatabaseMirror 'database.clamav.net'
-       option NotifyClamd '/etc/clamav/clamd.conf'
-       option DatabaseOwner 'root'
-       option CompressLocalDatabase 'yes'
diff --git a/net/clamav/files/freshclam.init b/net/clamav/files/freshclam.init
deleted file mode 100644 (file)
index 37b2767..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2015 OpenWrt.org
-
-START=90
-STOP=10
-
-USE_PROCD=1
-PROG=/usr/sbin/freshclam
-FRESHCLAM_CONFIGFILE="/tmp/clamav/freshclam.conf"
-
-validate_freshclam_section() {
-       uci_validate_section freshclam freshclam "${1}" \
-               'freshclam_config_file:string' \
-               'UpdateLogFile:string' \
-               'DatabaseMirror:string' \
-               'NotifyClamd:string' \
-               'DatabaseOwner:string' \
-               'CompressLocalDatabase:string:'
-}
-
-start_service() {
-       local freshclam_config_file UpdateLogFile DatabaseOwner NotifyClamd DatabaseMirror
-
-       validate_freshclam_section freshclam || {
-               echo "validation failed"
-               return 1
-       }
-
-       [ -f /tmp/freshclam.pid ] && echo "already running" && return 0
-
-       mkdir -p /usr/share/clamav
-       mkdir -p /etc/clamav
-       touch /tmp/freshclam.log
-       touch /tmp/freshclam.pid
-
-       mkdir -p $(dirname $FRESHCLAM_CONFIGFILE)
-       ln -sf $freshclam_config_file $FRESHCLAM_CONFIGFILE
-
-       echo "UpdateLogFile " $UpdateLogFile > $FRESHCLAM_CONFIGFILE
-       echo "DatabaseMirror " $DatabaseMirror >> $FRESHCLAM_CONFIGFILE
-       echo "NotifyClamd " $NotifyClamd >> $FRESHCLAM_CONFIGFILE
-       echo "DatabaseOwner " $DatabaseOwner >> $FRESHCLAM_CONFIGFILE
-       echo "CompressLocalDatabase " $CompressLocalDatabase >> $FRESHCLAM_CONFIGFILE
-
-       procd_open_instance
-       procd_set_param command $PROG -d --config-file=$FRESHCLAM_CONFIGFILE -p /tmp/freshclam.pid --no-warnings
-       procd_set_param file $FRESHCLAM_CONFIGFILE
-       procd_close_instance
-}
-
-stop_service()
-{
-       [ ! -f /tmp/freshclam.pid ] && echo "not running" && return 0
-       PID=`cat /tmp/freshclam.pid`
-       kill $PID
-       rm -f /tmp/freshclam.pid
-}
-
-service_triggers()
-{
-       procd_add_reload_trigger "freshclam"
-       procd_add_validation validate_freshclam_section
-}
diff --git a/net/clamav/patches/001-compile.patch b/net/clamav/patches/001-compile.patch
deleted file mode 100644 (file)
index 3992257..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/clamdscan/proto.c
-+++ b/clamdscan/proto.c
-@@ -55,6 +55,7 @@
- #include "shared/misc.h"
- #include "shared/clamdcom.h"
-+#include <sys/un.h>
- #include "proto.h"
- #include "client.h"
index 88fd17dad48e0451283a91cbb94b1ca726c214cb..4ed43fc9b686a14a3cfa11975e36bf89655c2243 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cshark
-PKG_VERSION:=2015-11-24
-PKG_RELEASE=$(PKG_SOURCE_VERSION)
+PKG_VERSION=2015-11-24-$(PKG_SOURCE_VERSION)
+PKG_RELEASE=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/cloudshark/cshark.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=e575ab3d35d75a6f70488001fcba45690ebe9b3e
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
@@ -28,7 +28,7 @@ define Package/cshark
   CATEGORY:=Network
   TITLE:=CloudShark capture tool
   URL:=http://www.cloudshark.org/
-  DEPENDS:=+libjson-c +libpcap +libuci +libubox +libuclient +libustream-polarssl
+  DEPENDS:=+libjson-c +libpcap +libuci +libubox +libuclient +libustream-mbedtls
   MAINTAINER:=Luka Perkov <luka@openwrt.org>
 endef
 
diff --git a/net/ctorrent-svn/Makefile b/net/ctorrent-svn/Makefile
deleted file mode 100644 (file)
index 0725f59..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-#
-# Copyright (C) 2006-2015 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:=ctorrent-svn
-PKG_REV:=322
-PKG_VERSION:=r$(PKG_REV)
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://svn.code.sf.net/p/dtorrent/code/dtorrent/trunk
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=$(PKG_REV)
-PKG_SOURCE_PROTO:=svn
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_CHECK_FORMAT_SECURITY:=0
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/ctorrent-svn/Default
-  SUBMENU:=BitTorrent
-  SECTION:=net
-  CATEGORY:=Network
-  DEPENDS:=+uclibcxx
-  TITLE:=console-based BitTorrent client
-  MAINTAINER:=Peter Wagner <tripolar@gmx.at>
-  URL:=http://www.rahul.net/dholmes/ctorrent/
-endef
-
-define Package/ctorrent-svn/Default/description
-       CTorrent is a BitTorrent client written in the C programming language,
-       known to be a very robust and mature programming language, which produces
-       fast and optimized application.
-endef
-
-define Package/ctorrent-svn
-$(call Package/ctorrent-svn/Default)
-  TITLE+= (with OpenSSL support)
-  DEPENDS+=+libopenssl
-  VARIANT:=ssl
-endef
-
-define Package/ctorrent-svn/description
-$(call Package/ctorrent-svn/Default/description)
- This package is built with OpenSSL support.
-endef
-
-define Package/ctorrent-svn-nossl
-$(call Package/ctorrent-svn/Default)
-  TITLE+= (with builtin SHA-1)
-  VARIANT:=nossl
-endef
-
-define Package/ctorrent-svn-nossl/description
-$(call Package/ctorrent-svn/Default/description)
- This package is built with builtin (Steve Reid's public-domain) SHA-1 support
-endef
-
-CONFIGURE_VARS += \
-       CXX="g++-uc" \
-       LIBS="-nodefaultlibs -luClibc++ $(LIBGCC_S) -lc"
-
-ifeq ($(BUILD_VARIANT),ssl)
-       CONFIGURE_ARGS += \
-               --with-ssl="$(STAGING_DIR)/usr"
-endif
-
-ifeq ($(BUILD_VARIANT),nossl)
-       CONFIGURE_ARGS += \
-               --with-ssl=no
-endif
-
-define Build/Configure
-       (cd $(PKG_BUILD_DIR); touch \
-               configure.ac \
-               aclocal.m4 \
-               Makefile.in \
-               config.h.in \
-               configure \
-       );
-       $(call Build/Configure/Default)
-endef
-
-define Package/ctorrent-svn/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ctorrent $(1)/usr/bin/ctorrent
-endef
-
-Package/ctorrent-svn-nossl/install = $(Package/ctorrent-svn/install)
-
-$(eval $(call BuildPackage,ctorrent-svn))
-$(eval $(call BuildPackage,ctorrent-svn-nossl))
diff --git a/net/ctorrent-svn/patches/100-compile-fix.patch b/net/ctorrent-svn/patches/100-compile-fix.patch
deleted file mode 100644 (file)
index bb7d33f..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-diff --git a/btconfig.cpp b/btconfig.cpp
-index e1badd0..aaa6feb 100644
---- a/btconfig.cpp
-+++ b/btconfig.cpp
-@@ -828,7 +828,7 @@ void CfgCTCS(Config<const char *> *config)
-     strncpy(CTCS.m_host, *cfg_ctcs, MAXHOSTNAMELEN-1);
-     CTCS.m_host[MAXHOSTNAMELEN-1] = '\0';
-     if( (s = strchr(CTCS.m_host, ':')) ) *s='\0';
--    CTCS.m_port = atoi(s = (strchr(*cfg_ctcs, ':')+1));
-+    CTCS.m_port = atoi(s = (char*)(strchr(*cfg_ctcs, ':')+1));
-     if( strchr(s, ':') )
-       CONSOLE.Input("Enter CTCS password: ", CTCS.m_pass, CTCS_PASS_SIZE);
-     else *CTCS.m_pass = '\0';
-diff --git a/btcontent.cpp b/btcontent.cpp
-index d84f450..88ccb50 100644
---- a/btcontent.cpp
-+++ b/btcontent.cpp
-@@ -1408,27 +1408,27 @@ void btContent::CompletionCommand()
-         ptmp = cmdstr + strlen(cmdstr);
-         parg = strstr(parg, "&t") + 2;
-         strcat(pt, parg);
--        pt = strstr(ptmp, "&t");
--        if( pd ) pd = strstr(ptmp, "&d");
--        if( pw ) pw = strstr(ptmp, "&w");
-+        pt = (char *)strstr(ptmp, "&t");
-+        if( pd ) pd = (char *)strstr(ptmp, "&d");
-+        if( pw ) pw = (char *)strstr(ptmp, "&w");
-       }
-       if( pd && (!pt || pd < pt) && (!pw || pd < pw) ){
-         strcpy(pd, m_btfiles.GetDataName());
-         ptmp = cmdstr + strlen(cmdstr);
-         parg = strstr(parg, "&d") + 2;
-         strcat(pd, parg);
--        pd = strstr(ptmp, "&d");
--        if( pt ) pt = strstr(ptmp, "&t");
--        if( pw ) pw = strstr(ptmp, "&w");
-+        pd = (char *)strstr(ptmp, "&d");
-+        if( pt ) pt = (char *)strstr(ptmp, "&t");
-+        if( pw ) pw = (char *)strstr(ptmp, "&w");
-       }
-       if( pw && (!pt || pw < pt) && (!pd || pw < pd) ){
-         strcpy(pw, wd);
-         ptmp = cmdstr + strlen(cmdstr);
-         parg = strstr(parg, "&w") + 2;
-         strcat(pw, parg);
--        pw = strstr(ptmp, "&w");
--        if( pt ) pt = strstr(ptmp, "&t");
--        if( pd ) pd = strstr(ptmp, "&d");
-+        pw = (char *)strstr(ptmp, "&w");
-+        if( pt ) pt = (char *)strstr(ptmp, "&t");
-+        if( pd ) pd = (char *)strstr(ptmp, "&d");
-       }
-     }
-   }
-diff --git a/console.cpp b/console.cpp
-index bdadb61..5ab2492 100644
---- a/console.cpp
-+++ b/console.cpp
-@@ -511,11 +511,8 @@ void ConStream::Error(int sev, const char *message, ...)
-   va_list ap;
-   va_start(ap, message);
--  if( g_console_ready ) CONSOLE.Error(sev, message, ap);
--  else{
-     vfprintf(stderr, message, ap);
-     fflush(stderr);
--  }
-   va_end(ap);
- }
-@@ -1766,7 +1763,7 @@ void Console::Warning(int sev, const char *message, ...)
-   va_end(ap);
- }
--
-+/*
- void Console::Error(int sev, const char *message, va_list ap)
- {
-   vsnprintf(m_buffer, sizeof(m_buffer), message, ap);
-@@ -1778,7 +1775,7 @@ void Console::Error(int sev, const char *message, va_list ap)
-   m_warnings.AddMessage(sev, m_buffer);
-   if( sev && *cfg_ctcs ) CTCS.Send_Info(sev, m_buffer);
- }
--
-+*/
- void Console::Debug(const char *message, ...)
- {
diff --git a/net/ctorrent-svn/patches/300-negative.patch b/net/ctorrent-svn/patches/300-negative.patch
deleted file mode 100644 (file)
index e1e1e65..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/bencode.cpp b/bencode.cpp
-index fef82ba..b7f14bc 100644
---- a/bencode.cpp
-+++ b/bencode.cpp
-@@ -45,6 +45,9 @@ size_t buf_int(const char *b, size_t len, char beginchar, char endchar,
-     p++;
-     len--;
-   }
-+  if( *p == '-'){
-+    p++; len--;
-+  }
-   for( psave = p; len && isdigit(*p); p++, len-- );
diff --git a/net/ctorrent-svn/patches/400-musl-compat.patch b/net/ctorrent-svn/patches/400-musl-compat.patch
deleted file mode 100644 (file)
index e17c147..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/compat.c
-+++ b/compat.c
-@@ -51,6 +51,7 @@ int snprintf(char *str, size_t size, con
- #ifndef HAVE_STRNSTR
- #include <string.h>
-+#include <sys/types.h>
- /* FUNCTION PROGRAMER: Siberiaic Sang */
- char *strnstr(const char *haystack, const char *needle, size_t haystacklen)
- {
diff --git a/net/ctorrent/Makefile b/net/ctorrent/Makefile
deleted file mode 100644 (file)
index 6a8e481..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-#
-# Copyright (C) 2006-2015 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:=ctorrent
-PKG_VERSION:=dnh3.3.2
-PKG_RELEASE:=7
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/dtorrent \
-       http://www.rahul.net/dholmes/ctorrent/
-PKG_MD5SUM:=59b23dd05ff70791cd6449effa7fc3b6
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
-include $(INCLUDE_DIR)/uclibc++.mk
-include $(INCLUDE_DIR)/package.mk
-
-define Package/ctorrent/Default
-  SUBMENU:=BitTorrent
-  SECTION:=net
-  CATEGORY:=Network
-  DEPENDS:=$(CXX_DEPENDS)
-  TITLE:=console-based BitTorrent client
-  MAINTAINER:=Peter Wagner <tripolar@gmx.at>
-  URL:=http://www.rahul.net/dholmes/ctorrent/
-endef
-
-define Package/ctorrent/Default/description
-       CTorrent is a BitTorrent client written in the C programming language,
-       known to be a very robust and mature programming language, which produces
-       fast and optimized application.
-endef
-
-define Package/ctorrent
-$(call Package/ctorrent/Default)
-  TITLE+= (with OpenSSL support)
-  DEPENDS+=+libopenssl
-  VARIANT:=ssl
-endef
-
-define Package/ctorrent/description
-$(call Package/ctorrent/Default/description)
- This package is built with OpenSSL support.
-endef
-
-define Package/ctorrent-nossl
-$(call Package/ctorrent/Default)
-  TITLE+= (with builtin SHA-1)
-  VARIANT:=nossl
-endef
-
-define Package/ctorrent-nossl/description
-$(call Package/ctorrent/Default/description)
- This package is built with builtin (Steve Reid's public-domain) SHA-1 support
-endef
-
-CONFIGURE_VARS += \
-       CXXFLAGS="$$$$CXXFLAGS -fno-rtti"
-
-ifeq ($(BUILD_VARIANT),ssl)
-       CONFIGURE_ARGS += \
-               --with-ssl="$(STAGING_DIR)/usr"
-endif
-
-ifeq ($(BUILD_VARIANT),nossl)
-       CONFIGURE_ARGS += \
-               --with-ssl=no
-endif
-
-define Package/ctorrent/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/$(PKG_NAME)
-endef
-
-Package/ctorrent-nossl/install = $(Package/ctorrent/install)
-
-$(eval $(call BuildPackage,ctorrent))
-$(eval $(call BuildPackage,ctorrent-nossl))
diff --git a/net/ctorrent/patches/100-CVE-2009-1759.patch b/net/ctorrent/patches/100-CVE-2009-1759.patch
deleted file mode 100644 (file)
index 86ae1d7..0000000
+++ /dev/null
@@ -1,364 +0,0 @@
-Patch for CVE-2009-1759.
-Source: Upstream SVN, rev 302 from the dtorrent-3 branch.
-
-Index: a/bencode.h
-===================================================================
---- a/bencode.h        (revision 300)
-+++ b/bencode.h        (revision 302)
-@@ -25,7 +25,7 @@
- size_t decode_list(const char *b,size_t len,const char *keylist);
- size_t decode_rev(const char *b,size_t len,const char *keylist);
- size_t decode_query(const char *b,size_t len,const char *keylist,const char **ps,size_t *pi,int64_t *pl,int method);
--size_t decode_list2path(const char *b, size_t n, char *pathname);
-+size_t decode_list2path(const char *b, size_t n, char *pathname, size_t maxlen);
- size_t bencode_buf(const char *str,size_t len,FILE *fp);
- size_t bencode_str(const char *str, FILE *fp);
- size_t bencode_int(const uint64_t integer, FILE *fp);
-Index: a/bencode.cpp
-===================================================================
---- a/bencode.cpp      (revision 300)
-+++ b/bencode.cpp      (revision 302)
-@@ -233,22 +233,28 @@
-   return bencode_end_dict_list(fp);
- }
--size_t decode_list2path(const char *b, size_t n, char *pathname)
-+size_t decode_list2path(const char *b, size_t n, char *pathname, size_t maxlen)
- {
-   const char *pb = b;
-   const char *s = (char *) 0;
-+  const char *endmax = pathname + maxlen - 1;
-   size_t r,q;
-   if( 'l' != *pb ) return 0;
-   pb++;
-   n--;
-   if( !n ) return 0;
--  for(; n;){
-+  while( n && pathname < endmax ){
-     if(!(r = buf_str(pb, n, &s, &q)) ) return 0;
-+    if( q >= maxlen ) return 0;
-     memcpy(pathname, s, q);
-     pathname += q;
--    pb += r; n -= r; 
--    if( 'e' != *pb ){*pathname = PATH_SP, pathname++;} else break;
-+    maxlen -= q;
-+    pb += r;
-+    n -= r; 
-+    if( 'e' == *pb ) break;
-+    if( pathname >= endmax ) return 0;
-+    *pathname++ = PATH_SP;
-   }
-   *pathname = '\0';
-   return (pb - b + 1);
-Index: a/btfiles.cpp
-===================================================================
---- a/btfiles.cpp      (revision 300)
-+++ b/btfiles.cpp      (revision 302)
-@@ -449,7 +449,8 @@
-   return 0;
- }
--int btFiles::BuildFromMI(const char *metabuf, const size_t metabuf_len, const char *saveas)
-+int btFiles::BuildFromMI(const char *metabuf, const size_t metabuf_len,
-+  const char *saveas, unsigned char exam_only)
- {
-   char path[MAXPATHLEN];
-   const char *s, *p;
-@@ -458,11 +459,19 @@
-   int f_warned = 0;
-   if( !decode_query(metabuf, metabuf_len, "info|name", &s, &q, (int64_t*)0,
--      QUERY_STR) || MAXPATHLEN <= q )
-+        QUERY_STR) || MAXPATHLEN <= q ){
-+    errno = EINVAL;
-     return -1;
-+  }
-   memcpy(path, s, q);
-   path[q] = '\0';
-+  if( !exam_only &&
-+      (PATH_SP == path[0] || '/' == path[0] || 0==strncmp("..", path, 2)) ){
-+    CONSOLE.Warning(1, "error, unsafe path \"%s\" in torrent data", path);
-+    errno = EINVAL;
-+    return -1;
-+  }
-   r = decode_query(metabuf, metabuf_len, "info|files", (const char**)0, &q,
-                    (int64_t*)0, QUERY_POS);
-@@ -471,21 +480,31 @@
-     BTFILE *pbf_last = (BTFILE*) 0; 
-     BTFILE *pbf = (BTFILE*) 0;
-     size_t dl;
-+    unsigned long nfiles = 0;
-+
-     if( decode_query(metabuf,metabuf_len,"info|length",
--                    (const char**) 0,(size_t*) 0,(int64_t*) 0,QUERY_LONG) )
-+                    (const char**) 0,(size_t*) 0,(int64_t*) 0,QUERY_LONG) ){
-+      errno = EINVAL;
-       return -1;
-+    }
-     if( saveas ){
-       m_directory = new char[strlen(saveas) + 1];
- #ifndef WINDOWS
--      if(!m_directory) return -1;
-+      if( !m_directory ){
-+        errno = ENOMEM;
-+        return -1;
-+      }
- #endif
-       strcpy(m_directory,saveas);
-     }else{
-       int f_conv;
-       char *tmpfn = new char[strlen(path)*2+5];
- #ifndef WINDOWS
--      if( !tmpfn ) return -1;
-+      if( !tmpfn ){
-+        errno = ENOMEM;
-+        return -1;
-+      }
- #endif
-       if( f_conv = ConvertFilename(tmpfn, path, strlen(path)*2+5) ){
-         if( arg_flg_convert_filenames ){
-@@ -493,6 +512,7 @@
- #ifndef WINDOWS
-           if( !m_directory ){
-             delete []tmpfn;
-+            errno = ENOMEM;
-             return -1;
-           }
- #endif
-@@ -507,7 +527,10 @@
-       if( !f_conv || !arg_flg_convert_filenames ){
-         m_directory = new char[strlen(path) + 1];
- #ifndef WINDOWS
--        if( !m_directory ) return -1;
-+        if( !m_directory ){
-+          errno = ENOMEM;
-+          return -1;
-+        }
- #endif
-         strcpy(m_directory,path);
-       }
-@@ -517,24 +540,50 @@
-     p = metabuf + r + 1; 
-     q--;
-     for(; q && 'e' != *p; p += dl, q -= dl){
--      if(!(dl = decode_dict(p, q, (const char*) 0)) ) return -1;
--      if( !decode_query(p, dl, "length", (const char**) 0,
--                       (size_t*) 0,&t,QUERY_LONG) ) return -1;
-+      if( !(dl = decode_dict(p, q, (const char*) 0)) ||
-+          !decode_query(p, dl, "length", (const char**) 0, (size_t*) 0, &t,
-+                        QUERY_LONG) ){
-+        errno = EINVAL;
-+        return -1;
-+      }
-       pbf = _new_bfnode();
- #ifndef WINDOWS
--      if( !pbf ) return -1;
-+      if( !pbf ){
-+        errno = ENOMEM;
-+        return -1;
-+      }
- #endif
-+      nfiles++;
-       pbf->bf_length = t;
-       m_total_files_length += t;
-       r = decode_query(p, dl, "path", (const char **)0, &n, (int64_t*)0,
-                        QUERY_POS);
--      if( !r ) return -1;
--      if(!decode_list2path(p + r, n, path)) return -1;
-+      if( !r || !decode_list2path(p + r, n, path, sizeof(path)) ){
-+        CONSOLE.Warning(1,
-+          "error, invalid path in torrent data for file %lu at offset %llu",
-+          nfiles, m_total_files_length - t);
-+        delete pbf;
-+        errno = EINVAL;
-+        return -1;
-+      }
-+      if( !exam_only &&
-+          (PATH_SP == path[0] || '/' == path[0] || 0==strncmp("..", path, 2)) ){
-+        CONSOLE.Warning(1,
-+          "error, unsafe path \"%s\" in torrent data for file %lu",
-+          path, nfiles);
-+        delete pbf;
-+        errno = EINVAL;
-+        return -1;
-+      }
-+
-       int f_conv;
-       char *tmpfn = new char[strlen(path)*2+5];
- #ifndef WINDOWS
--      if( !tmpfn ) return -1;
-+      if( !tmpfn ){
-+        errno = ENOMEM;
-+        return -1;
-+      }
- #endif
-       if( f_conv = ConvertFilename(tmpfn, path, strlen(path)*2+5) ){
-         if( arg_flg_convert_filenames ){
-@@ -542,6 +591,7 @@
- #ifndef WINDOWS
-           if( !pbf->bf_filename ){
-             delete []tmpfn;
-+            errno = ENOMEM;
-             return -1;
-           }
- #endif
-@@ -556,7 +606,10 @@
-       if( !f_conv || !arg_flg_convert_filenames ){
-         pbf->bf_filename = new char[strlen(path) + 1];
- #ifndef WINDOWS
--        if( !pbf->bf_filename ) return -1;
-+        if( !pbf->bf_filename ){
-+          errno = ENOMEM;
-+          return -1;
-+        }
- #endif
-         strcpy(pbf->bf_filename, path);
-       }
-@@ -564,30 +617,42 @@
-       pbf_last = pbf;
-     }
-   }else{
--    if( !decode_query(metabuf,metabuf_len,"info|length",
--                     (const char**) 0,(size_t*) 0,&t,QUERY_LONG) )
-+    if( !decode_query(metabuf,metabuf_len, "info|length",
-+                      (const char**)0, (size_t*) 0, &t, QUERY_LONG) ){
-+      errno = EINVAL;
-       return -1;
-+    }
-     m_btfhead = _new_bfnode();
- #ifndef WINDOWS
--    if( !m_btfhead) return -1;
-+    if( !m_btfhead ){
-+      errno = ENOMEM;
-+      return -1;
-+    }
- #endif
-     m_btfhead->bf_length = m_total_files_length = t;
-     if( saveas ){
-       m_btfhead->bf_filename = new char[strlen(saveas) + 1];
- #ifndef WINDOWS
--      if(!m_btfhead->bf_filename ) return -1;
-+      if( !m_btfhead->bf_filename ){
-+        errno = ENOMEM;
-+        return -1;
-+      }
- #endif
-       strcpy(m_btfhead->bf_filename, saveas);
-     }else if( arg_flg_convert_filenames ){
-       char *tmpfn = new char[strlen(path)*2+5];
- #ifndef WINDOWS
--      if( !tmpfn ) return -1;
-+      if( !tmpfn ){
-+        errno = ENOMEM;
-+        return -1;
-+      }
- #endif
-       ConvertFilename(tmpfn, path, strlen(path)*2+5);
-       m_btfhead->bf_filename = new char[strlen(tmpfn) + 1];
- #ifndef WINDOWS
-       if( !m_btfhead->bf_filename ){
-         delete []tmpfn;
-+        errno = ENOMEM;
-         return -1;
-       }
- #endif
-@@ -596,7 +661,10 @@
-     }else{
-       m_btfhead->bf_filename = new char[strlen(path) + 1];
- #ifndef WINDOWS
--      if(!m_btfhead->bf_filename ) return -1;
-+      if( !m_btfhead->bf_filename ){
-+        errno = ENOMEM;
-+        return -1;
-+      }
- #endif
-       strcpy(m_btfhead->bf_filename, path);
-     }
-@@ -694,6 +762,32 @@
- size_t btFiles::FillMetaInfo(FILE* fp)
- {
-   BTFILE *p;
-+  const char *refname, *s;
-+  char path[MAXPATHLEN];
-+
-+  refname = m_directory ? m_directory : m_btfhead->bf_filename;
-+  while( (s = strchr(refname, PATH_SP)) && *(s + 1) ){
-+    refname = s + 1;
-+  }
-+  if( m_directory && '.' == *refname ){
-+    char dir[MAXPATHLEN];
-+    if( getcwd(dir, sizeof(dir)) && 0==chdir(m_directory) ){
-+      if( getcwd(path, sizeof(path)) ){
-+        refname = path;
-+        while( (s = strchr(refname, PATH_SP)) && *(s + 1) ){
-+          refname = s + 1;
-+        }
-+      }
-+      chdir(dir);
-+    }
-+  }
-+  if( '/' == *refname || '\0' == *refname || '.' == *refname ){
-+    CONSOLE.Warning(1, "error, inappropriate file or directory name \"%s\"",
-+      m_directory ? m_directory : m_btfhead->bf_filename);
-+    errno = EINVAL;
-+    return 0;
-+  }
-+
-   if( m_directory ){
-     // multi files
-     if( bencode_str("files", fp) != 1 ) return 0;
-@@ -715,16 +809,15 @@
-     if(bencode_end_dict_list(fp) != 1 ) return 0;
-     
-     if(bencode_str("name", fp) != 1) return 0;
--    return bencode_str(m_directory, fp);
--    
-+    return bencode_str(refname, fp);
-   }else{
-     if( bencode_str("length", fp) != 1 ) return 0;
-     if( bencode_int(m_btfhead->bf_length, fp) != 1) return 0;
-     
-     if( bencode_str("name", fp) != 1 ) return 0;
--    return bencode_str(m_btfhead->bf_filename, fp);
-+    return bencode_str(refname, fp);
-   }
--  return 1;
-+  return 0;
- }
-Index: a/btcontent.cpp
-===================================================================
---- a/btcontent.cpp    (revision 300)
-+++ b/btcontent.cpp    (revision 302)
-@@ -357,7 +357,11 @@
-   cfg_req_queue_length = (m_piece_length / cfg_req_slice_size) * 2 - 1;
--  if( m_btfiles.BuildFromMI(b, flen, saveas) < 0 ) ERR_RETURN();
-+  if( m_btfiles.BuildFromMI(b, flen, saveas, arg_flg_exam_only) < 0 ){
-+    if( EINVAL == errno )
-+      CONSOLE.Warning(1, "Torrent metainfo file data is invalid or unusable.");
-+    ERR_RETURN();
-+  }
-   delete []b;
-   b = (char *)0;
-Index: a/btfiles.h
-===================================================================
---- a/btfiles.h        (revision 300)
-+++ b/btfiles.h        (revision 302)
-@@ -61,7 +61,7 @@
-   
-   int BuildFromFS(const char *pathname);
-   int BuildFromMI(const char *metabuf, const size_t metabuf_len,
--                  const char *saveas);
-+                  const char *saveas, unsigned char exam_only);
-   char *GetDataName() const;
-   uint64_t GetTotalLength() const { return m_total_files_length; }
diff --git a/net/ctorrent/patches/100-negative-ints.patch b/net/ctorrent/patches/100-negative-ints.patch
deleted file mode 100644 (file)
index 864ce1b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/bencode.cpp
-+++ b/bencode.cpp
-@@ -44,6 +44,10 @@ size_t buf_long(const char *b,size_t len
-     p++; len--;
-   }
-+  if( *p == '-'){
-+    p++; len--;
-+  }
-+
-   for(psave = p; len && isdigit(*p); p++,len--) ;
-   if(!len || MAX_INT_SIZ < (p - psave) || *p != endchar) return 0;
diff --git a/net/ctorrent/patches/200-musl-compat.patch b/net/ctorrent/patches/200-musl-compat.patch
deleted file mode 100644 (file)
index 65cb71e..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/compat.c
-+++ b/compat.c
-@@ -63,6 +63,7 @@ int snprintf(char *str, size_t size, con
- #ifndef HAVE_STRNSTR
- #include <string.h>
-+#include <sys/types.h>
- /* FUNCTION PROGRAMER: Siberiaic Sang */
- char *strnstr(const char *haystack, const char *needle, size_t haystacklen)
- {
index 6be7846cd16888b6c9bac72ba888c502be7f7f45..7be49477f7036f631a75b41e4404cd33d5f9bb1c 100755 (executable)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2008-2016 OpenWrt.org
+# Copyright (C) 2008-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 #
@@ -12,7 +12,7 @@ PKG_NAME:=ddns-scripts
 PKG_VERSION:=2.7.6
 # Release == build
 # increase on changes of services files or tld_names.dat
-PKG_RELEASE:=4
+PKG_RELEASE:=13
 
 PKG_LICENSE:=GPL-2.0
 PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
@@ -117,21 +117,19 @@ define Build/Configure
 endef
 define Build/Compile
        $(CP) ./files $(PKG_BUILD_DIR)
+       # ensure that VERSION inside dynamic_dns_functions.sh reflect PKG_VERSION of Makefile
+       $(SED) '/^VERSION=*/s/.*/VERSION="$(PKG_VERSION)-$(PKG_RELEASE)"/' $(PKG_BUILD_DIR)/files/dynamic_dns_functions.sh
+       # remove comments, white spaces and empty lines
        for FILE in `find $(PKG_BUILD_DIR)/files -type f`; do \
-               $(SED) 's/^\s*#/#/' \
-               -e '/^#\s\|^#$$$$/d' \
-               -e 's/\s#\s.*$$$$//' \
-               -e 's/\s*$$$$//' \
-               -e '/^\/\/\s/d' \
-               -e '/^\s*$$$$/d'        $$$$FILE; \
+               $(SED) 's/^[[:space:]]*//' \
+               -e '/^#[[:space:]]\|^#$$$$/d' \
+               -e 's/[[:space:]]#[[:space:]].*$$$$//' \
+               -e 's/[[:space:]]*$$$$//' \
+               -e '/^\/\/[[:space:]]/d'        \
+               -e '/^[[:space:]]*$$$$/d'       $$$$FILE; \
        done
-       # ensure that VERSION inside dynamic_dns_functions.sh reflect PKG_VERSION of Makefile
-       $(SED) '/^VERSION=*/s/.*/VERSION="$(PKG_VERSION)"/' $(PKG_BUILD_DIR)/files/dynamic_dns_functions.sh
-       $(CP) ./tools $(PKG_BUILD_DIR)
-       chmod 755 $(PKG_BUILD_DIR)/tools/*
-       $(PKG_BUILD_DIR)/tools/public_suffix_list.sh
-       mv -f $(PKG_BUILD_DIR)/tools/public_suffix_list.dat.gz \
-               $(PKG_BUILD_DIR)/files/public_suffix_list.dat.gz
+       # compress public_suffix_list.dat
+       gzip -f9 $(PKG_BUILD_DIR)/files/public_suffix_list.dat
 endef
 
 define Package/$(PKG_NAME)/conffiles
@@ -141,8 +139,8 @@ endef
 ###### *************************************************************************
 define Package/$(PKG_NAME)/preinst
        #!/bin/sh
-       # if NOT run buildroot and PKG_UPGRADE then stop service
-       [ -z "$${IPKG_INSTROOT}" -a "$${PKG_UPGRADE}" = "1" ] && /etc/init.d/ddns stop >/dev/null 2>&1
+       # if NOT run buildroot then stop service
+       [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
        exit 0  # suppress errors
 endef
 define Package/$(PKG_NAME)/install
@@ -164,23 +162,24 @@ endef
 define Package/$(PKG_NAME)/postinst
        #!/bin/sh
        # if NOT run buildroot and PKG_UPGRADE then (re)start service if enabled
-       [ -z "$${IPKG_INSTROOT}" -a "$${PKG_UPGRADE}" = "1" ] \
-               && /etc/init.d/ddns enabled \
-               && /etc/init.d/ddns start >/dev/null 2>&1
+       [ -z "$${IPKG_INSTROOT}" -a "$${PKG_UPGRADE}" = "1" ] && {
+               [ -x /etc/uci-defaults/ddns ] && \
+                       /etc/uci-defaults/ddns && \
+                               rm -f /etc/uci-defaults/ddns >/dev/null 2>&1
+               /etc/init.d/ddns enabled && \
+                       /etc/init.d/ddns start >/dev/null 2>&1
+       }
        exit 0  # suppress errors
 endef
 define Package/$(PKG_NAME)/prerm
        #!/bin/sh
        # if run within buildroot exit
        [ -n "$${IPKG_INSTROOT}" ] && exit 0
-
        # stop running scripts
        /etc/init.d/ddns stop
        /etc/init.d/ddns disable
-
        # clear LuCI indexcache
        rm -f /tmp/luci-indexcache >/dev/null 2>&1
-
        exit 0  # suppress errors
 endef
 
@@ -194,28 +193,34 @@ endef
 define Package/$(PKG_NAME)_cloudflare/install
        $(INSTALL_DIR)  $(1)/etc/uci-defaults
        $(INSTALL_BIN)  $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_cloudflare
-       $(INSTALL_DIR)  $(1)/usr/lib/ddns
-       $(INSTALL_BIN)  $(PKG_BUILD_DIR)/files/update_cloudflare_com_v1.sh $(1)/usr/lib/ddns
        $(INSTALL_DIR)  $(1)/usr/share
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/public_suffix_list.dat.gz $(1)/usr/share
+       $(INSTALL_DIR)  $(1)/usr/lib/ddns
+       $(INSTALL_BIN)  $(PKG_BUILD_DIR)/files/update_cloudflare_com_v1.sh $(1)/usr/lib/ddns
 endef
 define Package/$(PKG_NAME)_cloudflare/postinst
        #!/bin/sh
-       # if NOT upgrading add entries
-       [ "$${PKG_UPGRADE}" = "1" ] || {
-               printf "%s\\t%s\\n" '"cloudflare.com-v1"' '"update_cloudflare_com_v1.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
-               printf "%s\\t%s\\n" '"cloudflare.com-v1"' '"update_cloudflare_com_v1.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6
-       }
+       # remove old services file entries
+       /bin/sed -i '/cloudflare\.com-v1/d' $${IPKG_INSTROOT}/etc/ddns/services         >/dev/null 2>&1
+       /bin/sed -i '/cloudflare\.com-v1/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6    >/dev/null 2>&1
+       # and create new
+       printf "%s\\t%s\\n" '"cloudflare.com-v1"' '"update_cloudflare_com_v1.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
+       printf "%s\\t%s\\n" '"cloudflare.com-v1"' '"update_cloudflare_com_v1.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6
        # on real system restart service if enabled
-       [ -z "$${IPKG_INSTROOT}" ] \
-               && /etc/init.d/ddns enabled \
-               && /etc/init.d/ddns start >/dev/null 2>&1
+       [ -z "$${IPKG_INSTROOT}" ] && {
+               [ -x /etc/uci-defaults/ddns_cloudflare ] && \
+                       /etc/uci-defaults/ddns_cloudflare && \
+                               rm -f /etc/uci-defaults/ddns_cloudflare >/dev/null 2>&1
+               /etc/init.d/ddns enabled && \
+                       /etc/init.d/ddns start >/dev/null 2>&1
+       }
        exit 0  # suppress errors
 endef
 define Package/$(PKG_NAME)_cloudflare/prerm
        #!/bin/sh
        # if NOT run buildroot then stop service
        [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop                             >/dev/null 2>&1
+       # remove services file entries
        /bin/sed -i '/cloudflare\.com-v1/d' $${IPKG_INSTROOT}/etc/ddns/services         >/dev/null 2>&1
        /bin/sed -i '/cloudflare\.com-v1/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6    >/dev/null 2>&1
        exit 0  # suppress errors
@@ -236,20 +241,27 @@ define Package/$(PKG_NAME)_cloudflare.com-v4/install
 endef
 define Package/$(PKG_NAME)_cloudflare.com-v4/postinst
        #!/bin/sh
-       # if NOT upgrading add entries
-       [ "$${PKG_UPGRADE}" = "1" ] || {
-               printf "%s\\t%s\\n" '"cloudflare.com-v4"' '"update_cloudflare_com_v4.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
-               printf "%s\\t%s\\n" '"cloudflare.com-v4"' '"update_cloudflare_com_v4.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6
-       }
+       # remove old services file entries
+       /bin/sed -i '/cloudflare\.com-v4/d' $${IPKG_INSTROOT}/etc/ddns/services         >/dev/null 2>&1
+       /bin/sed -i '/cloudflare\.com-v4/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6    >/dev/null 2>&1
+       # and create new
+       printf "%s\\t%s\\n" '"cloudflare.com-v4"' '"update_cloudflare_com_v4.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
+       printf "%s\\t%s\\n" '"cloudflare.com-v4"' '"update_cloudflare_com_v4.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6
        # on real system restart service if enabled
-       [ -z "$${IPKG_INSTROOT}" ] \
-               && /etc/init.d/ddns enabled \
-               && /etc/init.d/ddns start >/dev/null 2>&1
+       [ -z "$${IPKG_INSTROOT}" ] && {
+               [ -x /etc/uci-defaults/ddns_cloudflare.com-v4 ] && \
+                       /etc/uci-defaults/ddns_cloudflare.com-v4 && \
+                               rm -f /etc/uci-defaults/ddns_cloudflare.com-v4 >/dev/null 2>&1
+               /etc/init.d/ddns enabled && \
+                       /etc/init.d/ddns start >/dev/null 2>&1
+       }
        exit 0  # suppress errors
 endef
 define Package/$(PKG_NAME)_cloudflare.com-v4/prerm
        #!/bin/sh
+       # if NOT run buildroot then stop service
        [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop                             >/dev/null 2>&1
+       # remove services file entries
        /bin/sed -i '/cloudflare\.com-v4/d' $${IPKG_INSTROOT}/etc/ddns/services         >/dev/null 2>&1
        /bin/sed -i '/cloudflare\.com-v4/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6    >/dev/null 2>&1
        exit 0  # suppress errors
@@ -270,20 +282,27 @@ define Package/$(PKG_NAME)_godaddy.com-v1/install
 endef
 define Package/$(PKG_NAME)_godaddy.com-v1/postinst
        #!/bin/sh
-       # if NOT upgrading add entries
-       [ "$${PKG_UPGRADE}" = "1" ] || {
-               printf "%s\\t%s\\n" '"godaddy.com-v1"' '"update_godaddy_com_v1.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
-               printf "%s\\t%s\\n" '"godaddy.com-v1"' '"update_godaddy_com_v1.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6
-       }
+       # remove old services file entries
+       /bin/sed -i '/godaddy\.com-v1/d' $${IPKG_INSTROOT}/etc/ddns/services            >/dev/null 2>&1
+       /bin/sed -i '/godaddy\.com-v1/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6       >/dev/null 2>&1
+       # and create new
+       printf "%s\\t%s\\n" '"godaddy.com-v1"' '"update_godaddy_com_v1.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
+       printf "%s\\t%s\\n" '"godaddy.com-v1"' '"update_godaddy_com_v1.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6
        # on real system restart service if enabled
-       [ -z "$${IPKG_INSTROOT}" ] \
-               && /etc/init.d/ddns enabled \
-               && /etc/init.d/ddns start >/dev/null 2>&1
+       [ -z "$${IPKG_INSTROOT}" ] && {
+               [ -x /etc/uci-defaults/ddns_godaddy.com-v1 ] && \
+                       /etc/uci-defaults/ddns_godaddy.com-v1 && \
+                               rm -f /etc/uci-defaults/ddns_godaddy.com-v1 >/dev/null 2>&1
+               /etc/init.d/ddns enabled \
+                       && /etc/init.d/ddns start >/dev/null 2>&1
+       }
        exit 0  # suppress errors
 endef
 define Package/$(PKG_NAME)_godaddy.com-v1/prerm
        #!/bin/sh
+       # if NOT run buildroot then stop service
        [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop                             >/dev/null 2>&1
+       # remove services file entries
        /bin/sed -i '/godaddy\.com-v1/d' $${IPKG_INSTROOT}/etc/ddns/services            >/dev/null 2>&1
        /bin/sed -i '/godaddy\.com-v1/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6       >/dev/null 2>&1
        exit 0  # suppress errors
@@ -304,19 +323,25 @@ define Package/$(PKG_NAME)_no-ip_com/install
 endef
 define Package/$(PKG_NAME)_no-ip_com/postinst
        #!/bin/sh
-       # if NOT upgrading add entries
-       [ "$${PKG_UPGRADE}" = "1" ] || {
-               printf "%s\\t%s\\n" '"no-ip.com"' '"update_no-ip_com.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
-       }
+       # remove old services file entries
+       /bin/sed -i '/no-ip\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1
+       # and create new
+       printf "%s\\t%s\\n" '"no-ip.com"' '"update_no-ip_com.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
        # on real system restart service if enabled
-       [ -z "$${IPKG_INSTROOT}" ] \
-               && /etc/init.d/ddns enabled \
-               && /etc/init.d/ddns start >/dev/null 2>&1
+       [ -z "$${IPKG_INSTROOT}" ] && {
+               [ -x /etc/uci-defaults/ddns_no-ip_com ] && \
+                       /etc/uci-defaults/ddns_no-ip_com && \
+                               rm -f /etc/uci-defaults/ddns_no-ip_com >/dev/null 2>&1
+               /etc/init.d/ddns enabled && \
+                       /etc/init.d/ddns start >/dev/null 2>&1
+       }
        exit 0  # suppress errors
 endef
 define Package/$(PKG_NAME)_no-ip_com/prerm
        #!/bin/sh
+       # if NOT run buildroot then stop service
        [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop             >/dev/null 2>&1
+       # remove services file entries
        /bin/sed -i '/no-ip\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1
        exit 0  # suppress errors
 endef
@@ -336,20 +361,27 @@ define Package/$(PKG_NAME)_nsupdate/install
 endef
 define Package/$(PKG_NAME)_nsupdate/postinst
        #!/bin/sh
-       # if NOT upgrading add entries
-       [ "$${PKG_UPGRADE}" = "1" ] || {
-               printf "%s\\t%s\\n" '"bind-nsupdate"' '"update_nsupdate.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
-               printf "%s\\t%s\\n" '"bind-nsupdate"' '"update_nsupdate.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6
-       }
+       # remove old services file entries
+       /bin/sed -i '/bind-nsupdate/d' $${IPKG_INSTROOT}/etc/ddns/services      >/dev/null 2>&1
+       /bin/sed -i '/bind-nsupdate/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1
+       # and create new
+       printf "%s\\t%s\\n" '"bind-nsupdate"' '"update_nsupdate.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
+       printf "%s\\t%s\\n" '"bind-nsupdate"' '"update_nsupdate.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6
        # on real system restart service if enabled
-       [ -z "$${IPKG_INSTROOT}" ] \
-               && /etc/init.d/ddns enabled \
-               && /etc/init.d/ddns start >/dev/null 2>&1
+       [ -z "$${IPKG_INSTROOT}" ] && {
+               [ -x /etc/uci-defaults/ddns_nsupdate ] && \
+                       /etc/uci-defaults/ddns_nsupdate && \
+                               rm -f /etc/uci-defaults/ddns_nsupdate >/dev/null 2>&1
+               /etc/init.d/ddns enabled && \
+                       /etc/init.d/ddns start >/dev/null 2>&1
+       }
        exit 0  # suppress errors
 endef
 define Package/$(PKG_NAME)_nsupdate/prerm
        #!/bin/sh
+       # if NOT run buildroot then stop service
        [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop                     >/dev/null 2>&1
+       # remove services file entries
        /bin/sed -i '/bind-nsupdate/d' $${IPKG_INSTROOT}/etc/ddns/services      >/dev/null 2>&1
        /bin/sed -i '/bind-nsupdate/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1
        exit 0  # suppress errors
index 86312088346de0742b767f3c81edf812dacc791e..3908bb4b07909ea50807c59f5b1e2b6954f89bba 100755 (executable)
 #!/bin/sh
 
+g_pslfile=/usr/share/public_suffix_list.dat.gz
+[ -f "$g_pslfile" ] || g_pslfile="$(dirname $0)/public_suffix_list.dat.gz"
+
+g_pslerr=0
+g_cfgfile="ddns"
+
+# modify "cloudflare.com-v1" domain to new syntax
+# returns "host[.subdom]@domain.TLD" of given FQDN #############################
+mod_cloudflare_v1_domain() {
+       # $1    entry to validate/split
+       [ -f "$g_pslfile" ] || return 1
+
+       [ $# -ne 1 -o -z "$1" ] && \
+               { printf "%s\\n" "mod_cloudflare_v1_domain() - Invalid number of parameters" >&2; return 1; }
+
+       local mcd_fqdn=$1
+       local mcd_fsub=""
+       local mcd_fdom=""
+       local mcd_ctld=""
+       local mcd_ftld=""
+
+       # check if already new syntax, "@" inside string
+       if [ $( printf "%s" "$mcd_fqdn" | grep -cF "@" 2>/dev/null ) -gt 0 ]; then
+               # already done
+               printf "%s" "$mcd_fqdn"
+               return 0
+       fi
+
+       # we need to do in one line because otherwise sh doesn't work correctly
+       # to lower | replace "." to " " | awk invert word order
+       set -- $(printf %s "$mcd_fqdn" | tr [A-Z] [a-z] | tr "." " " \
+                       | awk '{do printf "%s"(NF>1?OFS:ORS),$NF;while (--NF)}' )
+
+       while [ -n "${1:-}" ] ; do                      # as long we have parameters
+               if [ -z "$mcd_ctld" ]; then             # first loop
+                       mcd_ctld="$1"                   # CURRENT TLD to look at
+                       shift
+               else
+                       mcd_ctld="$1.$mcd_ctld"         # Next TLD to look at
+                       shift
+               fi
+               # check if TLD exact match in public_suffix_name.dat, save TLD
+               zcat $g_pslfile | grep -E "^$mcd_ctld$" >/dev/null 2>&1 && {
+                       mcd_ftld="$mcd_ctld"            # save found
+                       mcd_fdom="${1:-}"               # save domain next step might be invalid
+                       continue
+               }
+               # check if match any "*" in public_suffix_name.dat,
+               zcat $g_pslfile | grep -E "^\*.$mcd_ctld$" >/dev/null 2>&1 && {
+                       [ -z "${1:-}" ] && break        # no more data break
+                       # check if next level TLD match excludes "!" in tld_names.dat
+                       if zcat $g_pslfile | grep -E "^!$1.$mcd_ctld$" >/dev/null 2>&1 ; then
+                               mcd_ftld="$mcd_ctld"    # Yes
+                       else
+                               mcd_ftld="$1.$mcd_ctld"
+                               shift
+                       fi
+                       mcd_fdom="$1"; shift
+               }
+               [ -n "$mcd_ftld" ] && break     # we have something valid, break
+       done
+
+       # the leftover parameters are the HOST/SUBDOMAIN
+       while [ -n "${1:-}" ]; do
+               mcd_fsub="${1}${mcd_fsub:+.$mcd_fsub}"  # remember we need to invert
+               shift                                   # and insert dot if mcd_fsub not empty
+       done
+
+       # now validate found data
+       [ -z "$mcd_ftld" ] && { printf "%s\\n" "mod_cloudflare_v1_domain() - no TLD not found in '$mcd_fqdn'" >&1; return 1; }
+       [ -z "$mcd_fdom" ] && { printf "%s\\n" "mod_cloudflare_v1_domain() - no registrable Domain not found in '$mcd_fqdn'" >&1; return 1; }
+
+       # return data
+       printf "%s" "${mcd_fsub:+${mcd_fsub}@}${mcd_fdom}.${mcd_ftld}"
+       return 0
+}
+
+# modify timer settings from interval and unit to dhms format
+timer2dhms() {
+# $1   Number and
+# $2   Unit of time interval
+       local t=0
+       case $2 in
+               days)           t=$(( $1 * 86400 ));;
+               hours)          t=$(( $1 * 3600 ));;
+               minutes)        t=$(( $1 * 60 ));;
+               *)              t=$1;;
+       esac
+
+       local d=$(( $t / 86400 ))
+       local h=$(( $t % 86400 / 3600 ))
+       local m=$(( $t % 3600 / 60 ))
+       local s=$(( $t % 60 ))
+       if [ $d -gt 0 ]; then printf "%dd %02dh %02dm %02ds" "$d" "$h" "$m" "$s"
+       elif [ $h -gt 0 ]; then printf "%dh %02dm %02ds" "$h" "$m" "$s"
+       elif [ $m -gt 0 ]; then printf "%dm %02ds" "$m" "$s"
+       else printf "%ds" "$s"; fi
+
+       unset d h m s t
+       return 0
+}
+
 # using function to not confuse function calls with existing ones inside /lib/functions.sh
-update_ddns_config() {
-       udc_uci="$(which uci) -q"       # ignore errors
-       udc_pkg="ddns"
-       udc_cfg=""
-       udc_name=""
-       udc_var=""
-       udc_val=""
+update_config() {
+       uc_uci="$(which uci) -q"        # ignore errors
+       uc_cfg=""
+       uc_name=""
+       uc_var=""
+       uc_val=""
        package() { return 0; }
        config () {
-               udc_cfg="$1"
-               udc_name="$2"
+               uc_cfg="$1"
+               uc_name="$2"
 
                # Type = ddns   Name = global
-               if [ "$udc_cfg" = "$udc_pkg" -a "$udc_name" = "global" ]; then
-                       option() { return 0; }
-                       # rename options
-                       $udc_uci rename $udc_pkg.$udc_name.allow_local_ip="upd_privateip"
-                       $udc_uci rename $udc_pkg.$udc_name.date_format="ddns_dateformat"
-                       $udc_uci rename $udc_pkg.$udc_name.log_dir="ddns_logdir"
-                       $udc_uci rename $udc_pkg.$udc_name.log_lines="ddns_loglines"
-                       $udc_uci rename $udc_pkg.$udc_name.run_dir="ddns_rundir"
+               if [ "$uc_cfg" = "$g_cfgfile" -a "$uc_name" = "global" ]; then
+                       option() {
+                               uc_var="$1"; shift
+                               uc_val="$*"
+                               case "$uc_var" in
+                                       allow_local_ip) $uc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_privateip";;
+                                       date_format)    $uc_uci rename $g_cfgfile.$uc_name.$uc_var="ddns_dateformat";;
+                                       log_lines)      $uc_uci rename $g_cfgfile.$uc_name.$uc_var="ddns_loglines";;
+                                       log_dir)        $uc_uci rename $g_cfgfile.$uc_name.$uc_var="ddns_logdir";;
+                                       run_dir)        $uc_uci rename $g_cfgfile.$uc_name.$uc_var="ddns_rundir";;
+                                       # leave all other options currently unchanged
+                                       *)      ;;
+                               esac
+                       }
 
                # Type = service        Name = ???
-               elif [ "$udc_cfg" = "service" ]; then
+               elif [ "$uc_cfg" = "service" ]; then
                        option() {
-                               udc_var="$1"; shift
-                               udc_val="$*"
-                               # fix some option service_name values
-                               case "$udc_var" in
-                                       service_name)
-                                               case "$udc_val" in
+                               uc_var="$1"; shift
+                               uc_val="$*"
+                               case "$uc_var" in
+                                       # fix some option service_name values
+                                       # and some settings for specific providers
+                                       service_name|upd_provider)
+                                               case "$uc_val" in
                                                        freedns\.afraid\.org|afraid\.org)
-                                                               $udc_uci set $udc_pkg.$udc_name.$udc_var="afraid.org-keyauth";;
+                                                               $uc_uci set $g_cfgfile.$uc_name.$uc_var="afraid.org-keyauth";;
                                                        Bind-nsupdate)
-                                                               $udc_uci set $udc_pkg.$udc_name.$udc_var="bind-nsupdate";;
-                                                       CloudFlare|cloudflare\.com)
-                                                               $udc_uci set $udc_pkg.$udc_name.$udc_var="cloudflare.com-v1";;
+                                                               $uc_uci set $g_cfgfile.$uc_name.$uc_var="bind-nsupdate";;
+                                                       CloudFlare|cloudflare\.com|cloudflare\.com-v1)
+                                                               # verify if lookup_host is set
+                                                               $uc_uci get $g_cfgfile.$uc_name.lookup_host >/dev/null 2>&1 || {
+                                                                       ucv_domain=$($uc_uci get $g_cfgfile.$uc_name.domain 2>/dev/null)
+                                                                       $uc_uci set $g_cfgfile.$uc_name.lookup_host="$ucv_domain"
+                                                               }
+                                                               if [ -f "$g_pslfile" ]; then
+                                                                       # change value of domain/upd_object to new syntax
+                                                                       # there is no sort order inside uci data so we need multiple checks
+                                                                       ucv_domain=$($uc_uci get $g_cfgfile.$uc_name.domain 2>/dev/null)
+                                                                       ucv_object=$($uc_uci get $g_cfgfile.$uc_name.upd_object 2>/dev/null)
+                                                                       # still old option domain
+                                                                       if [ -n "$ucv_domain" ]; then
+                                                                               ucv_new=$(mod_cloudflare_v1_domain "$ucv_domain") || g_pslerr=1
+                                                                               # no error save data save data
+                                                                               [ $g_pslerr -eq 0 ] && \
+                                                                                       $uc_uci set $g_cfgfile.$uc_name.domain="$ucv_new"
+                                                                       fi
+                                                                       # already new option upd_object
+                                                                       if [ -n "$ucv_object" ]; then
+                                                                               ucv_new=$(mod_cloudflare_v1_domain "$ucv_object") || g_pslerr=1
+                                                                               # no error save data save data
+                                                                               [ $g_pslerr -eq 0 ] && \
+                                                                                       $uc_uci set $g_cfgfile.$uc_name.upd_object="$ucv_new"
+                                                                       fi
+                                                               fi
+                                                               unset ucv_domain ucv_object ucv_new
+                                                               # set new option value
+                                                               $uc_uci set $g_cfgfile.$uc_name.$uc_var="cloudflare.com-v1"
+                                                               ;;
                                                        dyndns\.org|dyndns\.com)
-                                                               $udc_uci set $udc_pkg.$udc_name.$udc_var="dyn.com";;
+                                                               $uc_uci set $g_cfgfile.$uc_name.$uc_var="dyn.com";;
                                                        free\.editdns\.net)
-                                                               $udc_uci set $udc_pkg.$udc_name.$udc_var="editdns.net";;
+                                                               $uc_uci set $g_cfgfile.$uc_name.$uc_var="editdns.net";;
                                                        domains\.google\.com)
-                                                               $udc_uci set $udc_pkg.$udc_name.$udc_var="google.com";;
+                                                               $uc_uci set $g_cfgfile.$uc_name.$uc_var="google.com";;
                                                        loopia\.com)
-                                                               $udc_uci set $udc_pkg.$udc_name.$udc_var="loopia.se";;
+                                                               $uc_uci set $g_cfgfile.$uc_name.$uc_var="loopia.se";;
                                                        NoIP\.com|No-IP\.com)
-                                                               $udc_uci set $udc_pkg.$udc_name.$udc_var="no-ip.com";;
+                                                               $uc_uci set $g_cfgfile.$uc_name.$uc_var="no-ip.com";;
                                                        spdns\.de)
-                                                               $udc_uci set $udc_pkg.$udc_name.$udc_var="spdyn.de";;
+                                                               $uc_uci set $g_cfgfile.$uc_name.$uc_var="spdyn.de";;
                                                        strato\.de)
-                                                               $udc_uci set $udc_pkg.$udc_name.$udc_var="strato.com";;
+                                                               $uc_uci set $g_cfgfile.$uc_name.$uc_var="strato.com";;
                                                        *)
                                                                # all others leave unchanged
                                                                ;;
                                                esac
                                                # rename option service_name to option upd_provider
-#                                              $udc_uci rename $udc_pkg.$udc_name.$udc_var="upd_provider"
+#                                              $uc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_provider"
                                                ;;
-                                       *)
-                                               # leave all other options currently unchanged
+                                       domain|upd_object)
+                                               # verify if lookup_host is set
+                                               $uc_uci get $g_cfgfile.$uc_name.lookup_host >/dev/null 2>&1 || \
+                                                       $uc_uci set $g_cfgfile.$uc_name.lookup_host="$uc_val"
+                                               if [ -f "$g_pslfile" ]; then
+                                                       # if service_name/upd_provider cloudflare_v1 then change domain/upd_object to new syntax
+                                                       # there is no sort order inside uci data so we need multiple checks
+                                                       uco_provider=$($uc_uci get $g_cfgfile.$uc_name.upd_provider 2>/dev/null) || \
+                                                               uco_provider=$($uc_uci get $g_cfgfile.$uc_name.service_name 2>/dev/null)
+                                                       if [ "$uco_provider" = "CloudFlare" \
+                                                         -o "$uco_provider" = "cloudflare.com" \
+                                                         -o "$uco_provider" = "cloudflare.com-v1" ]; then
+                                                               ucv_new=$(mod_cloudflare_v1_domain "$uc_val") || g_pslerr=1
+                                                               # no error save data save data
+                                                               [ $g_pslerr -eq 0 ] && \
+                                                                       $uc_uci set $g_cfgfile.$uc_name.$uc_var="$ucv_new"
+                                                               unset ucv_new
+                                                       fi
+                                                       unset uco_provider
+                                               fi
+                                               # rename option domain to option upd_object
+#                                              $uc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_object"
                                                ;;
+#                                      dns_server)
+#                                              # if bind-nsupdate takeover old "dns_server" value as new "upd_nsupd_server" value
+#                                              uco_provider=$($uc_uci get $g_cfgfile.$uc_name.upd_provider 2>/dev/null) || \
+#                                                      uco_provider=$($uc_uci get $g_cfgfile.$uc_name.service_name 2>/dev/null)
+#                                              [ "$uco_provider" = "Bind-nsupdate" -o \
+#                                                "$uco_provider" = "bind-nsupdate" ] && \
+#                                                      $uc_uci set $g_cfgfile.$uc_name.upd_nsupd_server="$uc_val"
+#                                              # rename option dns_server to new option global_dnssvr
+#                                              $udc_uci rename $g_cfgfile.$uc_name.$uc_var="global_dnssvr"
+#                                              ;;
+#                                      bind_network)
+#                                              $udc_uci set $g_cfgfile.$uc_name.upd_url_bindnet="$uc_val"
+#                                              $udc_uci rename $g_cfgfile.$uc_name.$uc_var="lip_url_bindnet"
+#                                              ;;
+#                                      proxy)
+#                                              # proxy value must include protocoll
+#                                              $udc_uci set $g_cfgfile.$uc_name.$uc_var="http://$uc_val"
+#                                              $udc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_url_proxy"
+#                                              ;;
+#                                      use_ipv6)
+#                                              $udc_uci set $g_cfgfile.$uc_name.$uc_var="$(( 4 + ( 2 * $uc_val ) ))"
+#                                              $udc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_ipversion"
+#                              TODO    update_url)
+#                              TODO    update_script)
+                                       # other renames
+#                              TODO    lookup_host)    -> rip_host
+#                                      enabled)        $udc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_enabled";;
+#                                      force_dnstcp)   $udc_uci rename $g_cfgfile.$uc_name.$uc_var="rip_host_dnstcp";;
+#                                      is_glue)        $udc_uci rename $g_cfgfile.$uc_name.$uc_var="rip_host_isglue";;
+#                                      ip_interface)   $udc_uci rename $g_cfgfile.$uc_name.$uc_var="lip_iface";;
+#                                      ip_network)     $udc_uci rename $g_cfgfile.$uc_name.$uc_var="lip_net";;
+#                                      use_https)      $udc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_url_secure";;
+#                                      cacert)         $udc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_url_cacert";;
+#                                      username)       $udc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_username";;
+#                                      password)       $udc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_password";;
+#                                      param_opt)      $udc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_paramopt";;
+#                                      param_enc)      $udc_uci rename $g_cfgfile.$uc_name.$uc_var="upd_paramenc";;
+
+                                       # leave all other options currently unchanged
+                                       *)      ;;
                                esac
                                return 0
                        }
@@ -73,27 +269,41 @@ update_ddns_config() {
                fi
        }
 
-       # read package config file
-       udc_data=$($udc_uci -S -n export "$udc_pkg")
-       udc_ret="$?"
-       # No error and udc_data then execute (eval)
+       # read config file
+       uc_data=$($uc_uci -S -n export "$g_cfgfile")
+       uc_ret="$?"
+       # Error then create config file
+       [ $uc_ret -ne 0 ] && {
+               touch /etc/config/$uc_cfgfile
+               chmod 644 /etc/config/$uc_cfgfile
+       }
+       # No error and uc_data then execute (eval)
        # this will call functions defined above
-       [ "$udc_ret" -eq 0 -a -n "$udc_data" ] && eval "$udc_data"
+       [ $uc_ret -eq 0 -a -n "$uc_data" ] && eval "$uc_data"
 
        # add config ddns "global" (ignore error if exists)
-       $udc_uci set ddns.global="$udc_pkg"
+       $uc_uci set ddns.global="$g_cfgfile"
 
        # write changes to config file
-       $udc_uci commit "$udc_pkg"
+       $uc_uci commit "$g_cfgfile"
 
-       unset udc_uci udc_pkg udc_cfg udc_name udc_var udc_val udc_ret udc_data
+       unset uc_uci uc_cfg uc_name uc_var uc_val uc_ret uc_data
        return 0
 }
 
-# do existing config update
-update_ddns_config
-
-# clear Ludc_uci indexcache
+# clear LuCI indexcache
 rm -f /tmp/luci-indexcache >/dev/null 2>&1
 
+# do config update
+update_config
+
+#cleanup
+[ $g_pslerr -ne 0 ] && {
+       unset g_pslfile g_pslerr g_cfgfile
+       return 1
+}
+
+[ -f "$g_pslfile" ] && rm -f "$g_pslfile"
+unset g_pslfile g_pslerr g_cfgfile
 return 0
+
index 8d648512869e32410a1c300ca71d99b830f94529..c8b3962aae0da75ea2f6a94625f42711cc4a3e07 100755 (executable)
@@ -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
-#.2014-2016 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+#.2014-2017 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
 #
 # function timeout
 # copied from http://www.ict.griffith.edu.au/anthony/software/timeout.sh
@@ -21,9 +21,9 @@
 . /lib/functions/network.sh
 
 # GLOBAL VARIABLES #
-VERSION="2.7.6"
+VERSION="2.7.6-13"
 SECTION_ID=""          # hold config's section name
-VERBOSE=1              # default mode is log to console, but easily changed with parameter
+VERBOSE=0              # default mode is log to console, but easily changed with parameter
 MYPROG=$(basename $0)  # my program call name
 
 LOGFILE=""             # logfile - all files are set in dynamic_dns_updater.sh
@@ -89,22 +89,22 @@ UCLIENT_FETCH_SSL=$(find /lib /usr/lib -name libustream-ssl.so* 2>/dev/null)
 
 # Global configuration settings
 # allow NON-public IP's
-upd_privateip=$(uci -q get ddns.global.allow_local_ip) || upd_privateip=0
+upd_privateip=$(uci -q get ddns.global.upd_privateip) || upd_privateip=0
 
 # directory to store run information to.
-ddns_rundir=$(uci -q get ddns.global.run_dir) || ddns_rundir="/var/run/ddns"
+ddns_rundir=$(uci -q get ddns.global.ddns_rundir) || ddns_rundir="/var/run/ddns"
 [ -d $ddns_rundir ] || mkdir -p -m755 $ddns_rundir
 
 # directory to store log files
-ddns_logdir=$(uci -q get ddns.global.log_dir) || ddns_logdir="/var/log/ddns"
+ddns_logdir=$(uci -q get ddns.global.ddns_logdir) || ddns_logdir="/var/log/ddns"
 [ -d $ddns_logdir ] || mkdir -p -m755 $ddns_logdir
 
 # number of lines to before rotate logfile
-ddns_loglines=$(uci -q get ddns.global.log_lines) || ddns_loglines=250
+ddns_loglines=$(uci -q get ddns.global.ddns_loglines) || ddns_loglines=250
 ddns_loglines=$((ddns_loglines + 1))   # correct sed handling
 
 # format to show date information in log and luci-app-ddns default ISO 8601 format
-ddns_dateformat=$(uci -q get ddns.global.date_format) || ddns_dateformat="%F %R"
+ddns_dateformat=$(uci -q get ddns.global.ddns_dateformat) || ddns_dateformat="%F %R"
 DATE_PROG="date +'$ddns_dateformat'"
 
 # USE_CURL if GNU Wget and cURL installed normally Wget is used by do_transfer()
@@ -907,6 +907,8 @@ get_local_ip () {
                                __ERR=$?
                                if [ $__ERR -eq 0 ]; then
                                        # DATFILE (sample)
+                                       # 10: l2tp-inet: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1456 qdisc fq_codel state UNKNOWN qlen 3\    link/ppp
+                                       # 10: l2tp-inet    inet 95.30.176.51 peer 95.30.176.1/32 scope global l2tp-inet\       valid_lft forever preferred_lft forever
                                        # 5: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000\    link/ether 08:00:27:d0:10:32 brd ff:ff:ff:ff:ff:ff
                                        # 5: eth1    inet 172.27.10.128/24 brd 172.27.10.255 scope global eth1\       valid_lft forever preferred_lft forever
                                        # 5: eth1    inet 172.55.55.155/24 brd 172.27.10.255 scope global eth1\       valid_lft 12345sec preferred_lft 12345sec
@@ -915,9 +917,11 @@ get_local_ip () {
                                        # 5: eth1    inet6 fd43:5368:6f6d:6500:a00:27ff:fed0:1032/64 scope global dynamic \       valid_lft 14352sec preferred_lft 14352sec
                                        # 5: eth1    inet6 2002:b0c7:f326::a00:27ff:fed0:1032/64 scope global dynamic \       valid_lft 14352sec preferred_lft 14352sec
 
-                                       #        remove         remove     remove      replace          remove                  remove
-                                       #       BROADCAST     inet6 fxxx    sec      forever=>-1    between / and pref..      linestart to inet
-                                       sed -i "/BROADCAST/d; /inet6 f/d; s/sec//g; s/forever/-1/g; s/\/.*preferred_lft//g; s/^.*$ip_interface *//g" $DATFILE
+                                       #    remove      remove     remove      replace     replace
+                                       #     link     inet6 fxxx    sec      forever=>-1   / => ' ' to separate subnet from ip
+                                       sed "/link/d; /inet6 f/d; s/sec//g; s/forever/-1/g; s/\// /g" $DATFILE | \
+                                               awk '{ print $3" "$4" "$NF }' > $ERRFILE        # temp reuse ERRFILE
+                                       # we only need    inet?   IP  prefered time
 
                                        local __TIME4=0;  local __TIME6=0
                                        local __TYP __ADR __TIME
@@ -932,7 +936,7 @@ get_local_ip () {
                                                        __DATA4="$__ADR"
                                                        __TIME4="$__TIME"
                                                }
-                                       done < $DATFILE
+                                       done < $ERRFILE
                                else
                                        write_log 3 "ip Error: '$__ERR'"
                                        write_log 7 "$(cat $ERRFILE)"           # report error
@@ -1121,18 +1125,16 @@ get_registered_ip() {
                        write_log 3 "$__PROG error: '$__ERR'"
                        write_log 7 "$(cat $ERRFILE)"
                else
-                       if [ -n "$BIND_HOST" ]; then
+                       if [ -n "$BIND_HOST" -o -n "$KNOT_HOST" ]; then
                                if [ $is_glue -eq 1 ]; then
-                                       __DATA=$(cat $DATFILE | grep "^$lookup_host" | grep -m 1 -o "$__REGEX" )
+                                       __DATA=$(cat $DATFILE | grep "^$lookup_host" | grep -om1 "$__REGEX" )
                                else
                                        __DATA=$(cat $DATFILE | awk -F "address " '/has/ {print $2; exit}' )
                                fi
-                       elif [ -n "$KNOT_HOST" ]; then
-                               __DATA=$(cat $DATFILE | awk -F "address " '/has/ {print $2; exit}' )
                        elif [ -n "$DRILL" ]; then
                                __DATA=$(cat $DATFILE | awk '/^'"$lookup_host"'/ {print $5; exit}' )
                        elif [ -n "$HOSTIP" ]; then
-                               __DATA=$(cat $DATFILE | grep -m 1 -o "$__REGEX")
+                               __DATA=$(cat $DATFILE | grep -om1 "$__REGEX")
                        elif [ -n "$NSLOOKUP" ]; then
                                __DATA=$(cat $DATFILE | sed -ne "/^Name:/,\$ { s/^Address[0-9 ]\{0,\}: \($__REGEX\).*$/\\1/p }" )
                        fi
index b2831e6a214687798c3f1a54eafc514bf1d3911d..4948e981504ea382625b6ff352b9cf6e848eab42 100755 (executable)
@@ -2,7 +2,7 @@
 # /usr/lib/ddns/dynamic_dns_lucihelper.sh
 #
 #.Distributed under the terms of the GNU General Public License (GPL) version 2.0
-#.2014-2016 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+#.2014-2017 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
 # This script is used by luci-app-ddns
 #
 # variables in small chars are read from /etc/config/ddns as parameter given here
index c58be2ea38ef33bf8f5f9670897d5bb4c4b434c5..46e5842908e48beefe039a9a299c52756e3c0925 100755 (executable)
@@ -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
-#.2014-2016 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+#.2014-2017 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
 #
 # variables in small chars are read from /etc/config/ddns
 # variables in big chars are defined inside these scripts as global vars
@@ -299,7 +299,7 @@ get_uptime CURR_TIME
 if [ $LAST_TIME -eq 0 ]; then
        write_log 7 "last update: never"
 else
-       EPOCH_TIME=$(( $(date +%s) - CURR_TIME + LAST_TIME ))
+       EPOCH_TIME=$(( $(date +%s) - $CURR_TIME + $LAST_TIME ))
        EPOCH_TIME="date -d @$EPOCH_TIME +'$ddns_dateformat'"
        write_log 7 "last update: $(eval $EPOCH_TIME)"
 fi
diff --git a/net/ddns-scripts/files/public_suffix_list.dat b/net/ddns-scripts/files/public_suffix_list.dat
new file mode 100644 (file)
index 0000000..998973b
--- /dev/null
@@ -0,0 +1,12310 @@
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at https://mozilla.org/MPL/2.0/.
+
+// Please pull this list from, and only from https://publicsuffix.org/list/public_suffix_list.dat,
+// rather than any other VCS sites. Pulling from any other URL is not guaranteed to be supported.
+
+// Instructions on pulling and using this list can be found at https://publicsuffix.org/list/.
+
+// ===BEGIN ICANN DOMAINS===
+
+// ac : https://en.wikipedia.org/wiki/.ac
+ac
+com.ac
+edu.ac
+gov.ac
+net.ac
+mil.ac
+org.ac
+
+// ad : https://en.wikipedia.org/wiki/.ad
+ad
+nom.ad
+
+// ae : https://en.wikipedia.org/wiki/.ae
+// see also: "Domain Name Eligibility Policy" at http://www.aeda.ae/eng/aepolicy.php
+ae
+co.ae
+net.ae
+org.ae
+sch.ae
+ac.ae
+gov.ae
+mil.ae
+
+// aero : see https://www.information.aero/index.php?id=66
+aero
+accident-investigation.aero
+accident-prevention.aero
+aerobatic.aero
+aeroclub.aero
+aerodrome.aero
+agents.aero
+aircraft.aero
+airline.aero
+airport.aero
+air-surveillance.aero
+airtraffic.aero
+air-traffic-control.aero
+ambulance.aero
+amusement.aero
+association.aero
+author.aero
+ballooning.aero
+broker.aero
+caa.aero
+cargo.aero
+catering.aero
+certification.aero
+championship.aero
+charter.aero
+civilaviation.aero
+club.aero
+conference.aero
+consultant.aero
+consulting.aero
+control.aero
+council.aero
+crew.aero
+design.aero
+dgca.aero
+educator.aero
+emergency.aero
+engine.aero
+engineer.aero
+entertainment.aero
+equipment.aero
+exchange.aero
+express.aero
+federation.aero
+flight.aero
+freight.aero
+fuel.aero
+gliding.aero
+government.aero
+groundhandling.aero
+group.aero
+hanggliding.aero
+homebuilt.aero
+insurance.aero
+journal.aero
+journalist.aero
+leasing.aero
+logistics.aero
+magazine.aero
+maintenance.aero
+media.aero
+microlight.aero
+modelling.aero
+navigation.aero
+parachuting.aero
+paragliding.aero
+passenger-association.aero
+pilot.aero
+press.aero
+production.aero
+recreation.aero
+repbody.aero
+res.aero
+research.aero
+rotorcraft.aero
+safety.aero
+scientist.aero
+services.aero
+show.aero
+skydiving.aero
+software.aero
+student.aero
+trader.aero
+trading.aero
+trainer.aero
+union.aero
+workinggroup.aero
+works.aero
+
+// af : http://www.nic.af/help.jsp
+af
+gov.af
+com.af
+org.af
+net.af
+edu.af
+
+// ag : http://www.nic.ag/prices.htm
+ag
+com.ag
+org.ag
+net.ag
+co.ag
+nom.ag
+
+// ai : http://nic.com.ai/
+ai
+off.ai
+com.ai
+net.ai
+org.ai
+
+// al : http://www.ert.gov.al/ert_alb/faq_det.html?Id=31
+al
+com.al
+edu.al
+gov.al
+mil.al
+net.al
+org.al
+
+// am : https://en.wikipedia.org/wiki/.am
+am
+
+// ao : https://en.wikipedia.org/wiki/.ao
+// http://www.dns.ao/REGISTR.DOC
+ao
+ed.ao
+gv.ao
+og.ao
+co.ao
+pb.ao
+it.ao
+
+// aq : https://en.wikipedia.org/wiki/.aq
+aq
+
+// ar : https://nic.ar/normativa-vigente.xhtml
+ar
+com.ar
+edu.ar
+gob.ar
+gov.ar
+int.ar
+mil.ar
+net.ar
+org.ar
+tur.ar
+
+// arpa : https://en.wikipedia.org/wiki/.arpa
+// Confirmed by registry <iana-questions@icann.org> 2008-06-18
+arpa
+e164.arpa
+in-addr.arpa
+ip6.arpa
+iris.arpa
+uri.arpa
+urn.arpa
+
+// as : https://en.wikipedia.org/wiki/.as
+as
+gov.as
+
+// asia : https://en.wikipedia.org/wiki/.asia
+asia
+
+// at : https://en.wikipedia.org/wiki/.at
+// Confirmed by registry <it@nic.at> 2008-06-17
+at
+ac.at
+co.at
+gv.at
+or.at
+
+// au : https://en.wikipedia.org/wiki/.au
+// http://www.auda.org.au/
+au
+// 2LDs
+com.au
+net.au
+org.au
+edu.au
+gov.au
+asn.au
+id.au
+// Historic 2LDs (closed to new registration, but sites still exist)
+info.au
+conf.au
+oz.au
+// CGDNs - http://www.cgdn.org.au/
+act.au
+nsw.au
+nt.au
+qld.au
+sa.au
+tas.au
+vic.au
+wa.au
+// 3LDs
+act.edu.au
+nsw.edu.au
+nt.edu.au
+qld.edu.au
+sa.edu.au
+tas.edu.au
+vic.edu.au
+wa.edu.au
+// act.gov.au  Bug 984824 - Removed at request of Greg Tankard
+// nsw.gov.au  Bug 547985 - Removed at request of <Shae.Donelan@services.nsw.gov.au>
+// nt.gov.au  Bug 940478 - Removed at request of Greg Connors <Greg.Connors@nt.gov.au>
+qld.gov.au
+sa.gov.au
+tas.gov.au
+vic.gov.au
+wa.gov.au
+
+// aw : https://en.wikipedia.org/wiki/.aw
+aw
+com.aw
+
+// ax : https://en.wikipedia.org/wiki/.ax
+ax
+
+// az : https://en.wikipedia.org/wiki/.az
+az
+com.az
+net.az
+int.az
+gov.az
+org.az
+edu.az
+info.az
+pp.az
+mil.az
+name.az
+pro.az
+biz.az
+
+// ba : http://nic.ba/users_data/files/pravilnik_o_registraciji.pdf
+ba
+com.ba
+edu.ba
+gov.ba
+mil.ba
+net.ba
+org.ba
+
+// bb : https://en.wikipedia.org/wiki/.bb
+bb
+biz.bb
+co.bb
+com.bb
+edu.bb
+gov.bb
+info.bb
+net.bb
+org.bb
+store.bb
+tv.bb
+
+// bd : https://en.wikipedia.org/wiki/.bd
+*.bd
+
+// be : https://en.wikipedia.org/wiki/.be
+// Confirmed by registry <tech@dns.be> 2008-06-08
+be
+ac.be
+
+// bf : https://en.wikipedia.org/wiki/.bf
+bf
+gov.bf
+
+// bg : https://en.wikipedia.org/wiki/.bg
+// https://www.register.bg/user/static/rules/en/index.html
+bg
+a.bg
+b.bg
+c.bg
+d.bg
+e.bg
+f.bg
+g.bg
+h.bg
+i.bg
+j.bg
+k.bg
+l.bg
+m.bg
+n.bg
+o.bg
+p.bg
+q.bg
+r.bg
+s.bg
+t.bg
+u.bg
+v.bg
+w.bg
+x.bg
+y.bg
+z.bg
+0.bg
+1.bg
+2.bg
+3.bg
+4.bg
+5.bg
+6.bg
+7.bg
+8.bg
+9.bg
+
+// bh : https://en.wikipedia.org/wiki/.bh
+bh
+com.bh
+edu.bh
+net.bh
+org.bh
+gov.bh
+
+// bi : https://en.wikipedia.org/wiki/.bi
+// http://whois.nic.bi/
+bi
+co.bi
+com.bi
+edu.bi
+or.bi
+org.bi
+
+// biz : https://en.wikipedia.org/wiki/.biz
+biz
+
+// bj : https://en.wikipedia.org/wiki/.bj
+bj
+asso.bj
+barreau.bj
+gouv.bj
+
+// bm : http://www.bermudanic.bm/dnr-text.txt
+bm
+com.bm
+edu.bm
+gov.bm
+net.bm
+org.bm
+
+// bn : https://en.wikipedia.org/wiki/.bn
+*.bn
+
+// bo : http://www.nic.bo/
+bo
+com.bo
+edu.bo
+gov.bo
+gob.bo
+int.bo
+org.bo
+net.bo
+mil.bo
+tv.bo
+
+// br : http://registro.br/dominio/categoria.html
+// Submitted by registry <fneves@registro.br>
+br
+adm.br
+adv.br
+agr.br
+am.br
+arq.br
+art.br
+ato.br
+b.br
+bio.br
+blog.br
+bmd.br
+cim.br
+cng.br
+cnt.br
+com.br
+coop.br
+ecn.br
+eco.br
+edu.br
+emp.br
+eng.br
+esp.br
+etc.br
+eti.br
+far.br
+flog.br
+fm.br
+fnd.br
+fot.br
+fst.br
+g12.br
+ggf.br
+gov.br
+imb.br
+ind.br
+inf.br
+jor.br
+jus.br
+leg.br
+lel.br
+mat.br
+med.br
+mil.br
+mp.br
+mus.br
+net.br
+*.nom.br
+not.br
+ntr.br
+odo.br
+org.br
+ppg.br
+pro.br
+psc.br
+psi.br
+qsl.br
+radio.br
+rec.br
+slg.br
+srv.br
+taxi.br
+teo.br
+tmp.br
+trd.br
+tur.br
+tv.br
+vet.br
+vlog.br
+wiki.br
+zlg.br
+
+// bs : http://www.nic.bs/rules.html
+bs
+com.bs
+net.bs
+org.bs
+edu.bs
+gov.bs
+
+// bt : https://en.wikipedia.org/wiki/.bt
+bt
+com.bt
+edu.bt
+gov.bt
+net.bt
+org.bt
+
+// bv : No registrations at this time.
+// Submitted by registry <jarle@uninett.no>
+bv
+
+// bw : https://en.wikipedia.org/wiki/.bw
+// http://www.gobin.info/domainname/bw.doc
+// list of other 2nd level tlds ?
+bw
+co.bw
+org.bw
+
+// by : https://en.wikipedia.org/wiki/.by
+// http://tld.by/rules_2006_en.html
+// list of other 2nd level tlds ?
+by
+gov.by
+mil.by
+// Official information does not indicate that com.by is a reserved
+// second-level domain, but it's being used as one (see www.google.com.by and
+// www.yahoo.com.by, for example), so we list it here for safety's sake.
+com.by
+
+// http://hoster.by/
+of.by
+
+// bz : https://en.wikipedia.org/wiki/.bz
+// http://www.belizenic.bz/
+bz
+com.bz
+net.bz
+org.bz
+edu.bz
+gov.bz
+
+// ca : https://en.wikipedia.org/wiki/.ca
+ca
+// ca geographical names
+ab.ca
+bc.ca
+mb.ca
+nb.ca
+nf.ca
+nl.ca
+ns.ca
+nt.ca
+nu.ca
+on.ca
+pe.ca
+qc.ca
+sk.ca
+yk.ca
+// gc.ca: https://en.wikipedia.org/wiki/.gc.ca
+// see also: http://registry.gc.ca/en/SubdomainFAQ
+gc.ca
+
+// cat : https://en.wikipedia.org/wiki/.cat
+cat
+
+// cc : https://en.wikipedia.org/wiki/.cc
+cc
+
+// cd : https://en.wikipedia.org/wiki/.cd
+// see also: https://www.nic.cd/domain/insertDomain_2.jsp?act=1
+cd
+gov.cd
+
+// cf : https://en.wikipedia.org/wiki/.cf
+cf
+
+// cg : https://en.wikipedia.org/wiki/.cg
+cg
+
+// ch : https://en.wikipedia.org/wiki/.ch
+ch
+
+// ci : https://en.wikipedia.org/wiki/.ci
+// http://www.nic.ci/index.php?page=charte
+ci
+org.ci
+or.ci
+com.ci
+co.ci
+edu.ci
+ed.ci
+ac.ci
+net.ci
+go.ci
+asso.ci
+xn--aroport-bya.ci
+aéroport.ci
+int.ci
+presse.ci
+md.ci
+gouv.ci
+
+// ck : https://en.wikipedia.org/wiki/.ck
+*.ck
+!www.ck
+
+// cl : https://en.wikipedia.org/wiki/.cl
+cl
+gov.cl
+gob.cl
+co.cl
+mil.cl
+
+// cm : https://en.wikipedia.org/wiki/.cm plus bug 981927
+cm
+co.cm
+com.cm
+gov.cm
+net.cm
+
+// cn : https://en.wikipedia.org/wiki/.cn
+// Submitted by registry <tanyaling@cnnic.cn>
+cn
+ac.cn
+com.cn
+edu.cn
+gov.cn
+net.cn
+org.cn
+mil.cn
+xn--55qx5d.cn
+公司.cn
+xn--io0a7i.cn
+网络.cn
+xn--od0alg.cn
+網絡.cn
+// cn geographic names
+ah.cn
+bj.cn
+cq.cn
+fj.cn
+gd.cn
+gs.cn
+gz.cn
+gx.cn
+ha.cn
+hb.cn
+he.cn
+hi.cn
+hl.cn
+hn.cn
+jl.cn
+js.cn
+jx.cn
+ln.cn
+nm.cn
+nx.cn
+qh.cn
+sc.cn
+sd.cn
+sh.cn
+sn.cn
+sx.cn
+tj.cn
+xj.cn
+xz.cn
+yn.cn
+zj.cn
+hk.cn
+mo.cn
+tw.cn
+
+// co : https://en.wikipedia.org/wiki/.co
+// Submitted by registry <tecnico@uniandes.edu.co>
+co
+arts.co
+com.co
+edu.co
+firm.co
+gov.co
+info.co
+int.co
+mil.co
+net.co
+nom.co
+org.co
+rec.co
+web.co
+
+// com : https://en.wikipedia.org/wiki/.com
+com
+
+// coop : https://en.wikipedia.org/wiki/.coop
+coop
+
+// cr : http://www.nic.cr/niccr_publico/showRegistroDominiosScreen.do
+cr
+ac.cr
+co.cr
+ed.cr
+fi.cr
+go.cr
+or.cr
+sa.cr
+
+// cu : https://en.wikipedia.org/wiki/.cu
+cu
+com.cu
+edu.cu
+org.cu
+net.cu
+gov.cu
+inf.cu
+
+// cv : https://en.wikipedia.org/wiki/.cv
+cv
+
+// cw : http://www.una.cw/cw_registry/
+// Confirmed by registry <registry@una.net> 2013-03-26
+cw
+com.cw
+edu.cw
+net.cw
+org.cw
+
+// cx : https://en.wikipedia.org/wiki/.cx
+// list of other 2nd level tlds ?
+cx
+gov.cx
+
+// cy : http://www.nic.cy/
+// Submitted by registry Panayiotou Fotia <cydns@ucy.ac.cy>
+cy
+ac.cy
+biz.cy
+com.cy
+ekloges.cy
+gov.cy
+ltd.cy
+name.cy
+net.cy
+org.cy
+parliament.cy
+press.cy
+pro.cy
+tm.cy
+
+// cz : https://en.wikipedia.org/wiki/.cz
+cz
+
+// de : https://en.wikipedia.org/wiki/.de
+// Confirmed by registry <ops@denic.de> (with technical
+// reservations) 2008-07-01
+de
+
+// dj : https://en.wikipedia.org/wiki/.dj
+dj
+
+// dk : https://en.wikipedia.org/wiki/.dk
+// Confirmed by registry <robert@dk-hostmaster.dk> 2008-06-17
+dk
+
+// dm : https://en.wikipedia.org/wiki/.dm
+dm
+com.dm
+net.dm
+org.dm
+edu.dm
+gov.dm
+
+// do : https://en.wikipedia.org/wiki/.do
+do
+art.do
+com.do
+edu.do
+gob.do
+gov.do
+mil.do
+net.do
+org.do
+sld.do
+web.do
+
+// dz : https://en.wikipedia.org/wiki/.dz
+dz
+com.dz
+org.dz
+net.dz
+gov.dz
+edu.dz
+asso.dz
+pol.dz
+art.dz
+
+// ec : http://www.nic.ec/reg/paso1.asp
+// Submitted by registry <vabboud@nic.ec>
+ec
+com.ec
+info.ec
+net.ec
+fin.ec
+k12.ec
+med.ec
+pro.ec
+org.ec
+edu.ec
+gov.ec
+gob.ec
+mil.ec
+
+// edu : https://en.wikipedia.org/wiki/.edu
+edu
+
+// ee : http://www.eenet.ee/EENet/dom_reeglid.html#lisa_B
+ee
+edu.ee
+gov.ee
+riik.ee
+lib.ee
+med.ee
+com.ee
+pri.ee
+aip.ee
+org.ee
+fie.ee
+
+// eg : https://en.wikipedia.org/wiki/.eg
+eg
+com.eg
+edu.eg
+eun.eg
+gov.eg
+mil.eg
+name.eg
+net.eg
+org.eg
+sci.eg
+
+// er : https://en.wikipedia.org/wiki/.er
+*.er
+
+// es : https://www.nic.es/site_ingles/ingles/dominios/index.html
+es
+com.es
+nom.es
+org.es
+gob.es
+edu.es
+
+// et : https://en.wikipedia.org/wiki/.et
+et
+com.et
+gov.et
+org.et
+edu.et
+biz.et
+name.et
+info.et
+net.et
+
+// eu : https://en.wikipedia.org/wiki/.eu
+eu
+
+// fi : https://en.wikipedia.org/wiki/.fi
+fi
+// aland.fi : https://en.wikipedia.org/wiki/.ax
+// This domain is being phased out in favor of .ax. As there are still many
+// domains under aland.fi, we still keep it on the list until aland.fi is
+// completely removed.
+// TODO: Check for updates (expected to be phased out around Q1/2009)
+aland.fi
+
+// fj : https://en.wikipedia.org/wiki/.fj
+*.fj
+
+// fk : https://en.wikipedia.org/wiki/.fk
+*.fk
+
+// fm : https://en.wikipedia.org/wiki/.fm
+fm
+
+// fo : https://en.wikipedia.org/wiki/.fo
+fo
+
+// fr : http://www.afnic.fr/
+// domaines descriptifs : http://www.afnic.fr/obtenir/chartes/nommage-fr/annexe-descriptifs
+fr
+com.fr
+asso.fr
+nom.fr
+prd.fr
+presse.fr
+tm.fr
+// domaines sectoriels : http://www.afnic.fr/obtenir/chartes/nommage-fr/annexe-sectoriels
+aeroport.fr
+assedic.fr
+avocat.fr
+avoues.fr
+cci.fr
+chambagri.fr
+chirurgiens-dentistes.fr
+experts-comptables.fr
+geometre-expert.fr
+gouv.fr
+greta.fr
+huissier-justice.fr
+medecin.fr
+notaires.fr
+pharmacien.fr
+port.fr
+veterinaire.fr
+
+// ga : https://en.wikipedia.org/wiki/.ga
+ga
+
+// gb : This registry is effectively dormant
+// Submitted by registry <Damien.Shaw@ja.net>
+gb
+
+// gd : https://en.wikipedia.org/wiki/.gd
+gd
+
+// ge : http://www.nic.net.ge/policy_en.pdf
+ge
+com.ge
+edu.ge
+gov.ge
+org.ge
+mil.ge
+net.ge
+pvt.ge
+
+// gf : https://en.wikipedia.org/wiki/.gf
+gf
+
+// gg : http://www.channelisles.net/register-domains/
+// Confirmed by registry <nigel@channelisles.net> 2013-11-28
+gg
+co.gg
+net.gg
+org.gg
+
+// gh : https://en.wikipedia.org/wiki/.gh
+// see also: http://www.nic.gh/reg_now.php
+// Although domains directly at second level are not possible at the moment,
+// they have been possible for some time and may come back.
+gh
+com.gh
+edu.gh
+gov.gh
+org.gh
+mil.gh
+
+// gi : http://www.nic.gi/rules.html
+gi
+com.gi
+ltd.gi
+gov.gi
+mod.gi
+edu.gi
+org.gi
+
+// gl : https://en.wikipedia.org/wiki/.gl
+// http://nic.gl
+gl
+co.gl
+com.gl
+edu.gl
+net.gl
+org.gl
+
+// gm : http://www.nic.gm/htmlpages%5Cgm-policy.htm
+gm
+
+// gn : http://psg.com/dns/gn/gn.txt
+// Submitted by registry <randy@psg.com>
+gn
+ac.gn
+com.gn
+edu.gn
+gov.gn
+org.gn
+net.gn
+
+// gov : https://en.wikipedia.org/wiki/.gov
+gov
+
+// gp : http://www.nic.gp/index.php?lang=en
+gp
+com.gp
+net.gp
+mobi.gp
+edu.gp
+org.gp
+asso.gp
+
+// gq : https://en.wikipedia.org/wiki/.gq
+gq
+
+// gr : https://grweb.ics.forth.gr/english/1617-B-2005.html
+// Submitted by registry <segred@ics.forth.gr>
+gr
+com.gr
+edu.gr
+net.gr
+org.gr
+gov.gr
+
+// gs : https://en.wikipedia.org/wiki/.gs
+gs
+
+// gt : http://www.gt/politicas_de_registro.html
+gt
+com.gt
+edu.gt
+gob.gt
+ind.gt
+mil.gt
+net.gt
+org.gt
+
+// gu : http://gadao.gov.gu/registration.txt
+*.gu
+
+// gw : https://en.wikipedia.org/wiki/.gw
+gw
+
+// gy : https://en.wikipedia.org/wiki/.gy
+// http://registry.gy/
+gy
+co.gy
+com.gy
+edu.gy
+gov.gy
+net.gy
+org.gy
+
+// hk : https://www.hkdnr.hk
+// Submitted by registry <hk.tech@hkirc.hk>
+hk
+com.hk
+edu.hk
+gov.hk
+idv.hk
+net.hk
+org.hk
+xn--55qx5d.hk
+公司.hk
+xn--wcvs22d.hk
+教育.hk
+xn--lcvr32d.hk
+敎育.hk
+xn--mxtq1m.hk
+政府.hk
+xn--gmqw5a.hk
+個人.hk
+xn--ciqpn.hk
+个人.hk
+xn--gmq050i.hk
+箇人.hk
+xn--zf0avx.hk
+網络.hk
+xn--io0a7i.hk
+网络.hk
+xn--mk0axi.hk
+组織.hk
+xn--od0alg.hk
+網絡.hk
+xn--od0aq3b.hk
+网絡.hk
+xn--tn0ag.hk
+组织.hk
+xn--uc0atv.hk
+組織.hk
+xn--uc0ay4a.hk
+組织.hk
+
+// hm : https://en.wikipedia.org/wiki/.hm
+hm
+
+// hn : http://www.nic.hn/politicas/ps02,,05.html
+hn
+com.hn
+edu.hn
+org.hn
+net.hn
+mil.hn
+gob.hn
+
+// hr : http://www.dns.hr/documents/pdf/HRTLD-regulations.pdf
+hr
+iz.hr
+from.hr
+name.hr
+com.hr
+
+// ht : http://www.nic.ht/info/charte.cfm
+ht
+com.ht
+shop.ht
+firm.ht
+info.ht
+adult.ht
+net.ht
+pro.ht
+org.ht
+med.ht
+art.ht
+coop.ht
+pol.ht
+asso.ht
+edu.ht
+rel.ht
+gouv.ht
+perso.ht
+
+// hu : http://www.domain.hu/domain/English/sld.html
+// Confirmed by registry <pasztor@iszt.hu> 2008-06-12
+hu
+co.hu
+info.hu
+org.hu
+priv.hu
+sport.hu
+tm.hu
+2000.hu
+agrar.hu
+bolt.hu
+casino.hu
+city.hu
+erotica.hu
+erotika.hu
+film.hu
+forum.hu
+games.hu
+hotel.hu
+ingatlan.hu
+jogasz.hu
+konyvelo.hu
+lakas.hu
+media.hu
+news.hu
+reklam.hu
+sex.hu
+shop.hu
+suli.hu
+szex.hu
+tozsde.hu
+utazas.hu
+video.hu
+
+// id : https://register.pandi.or.id/
+id
+ac.id
+biz.id
+co.id
+desa.id
+go.id
+mil.id
+my.id
+net.id
+or.id
+sch.id
+web.id
+
+// ie : https://en.wikipedia.org/wiki/.ie
+ie
+gov.ie
+
+// il : http://www.isoc.org.il/domains/
+il
+ac.il
+co.il
+gov.il
+idf.il
+k12.il
+muni.il
+net.il
+org.il
+
+// im : https://www.nic.im/
+// Submitted by registry <info@nic.im>
+im
+ac.im
+co.im
+com.im
+ltd.co.im
+net.im
+org.im
+plc.co.im
+tt.im
+tv.im
+
+// in : https://en.wikipedia.org/wiki/.in
+// see also: https://registry.in/Policies
+// Please note, that nic.in is not an official eTLD, but used by most
+// government institutions.
+in
+co.in
+firm.in
+net.in
+org.in
+gen.in
+ind.in
+nic.in
+ac.in
+edu.in
+res.in
+gov.in
+mil.in
+
+// info : https://en.wikipedia.org/wiki/.info
+info
+
+// int : https://en.wikipedia.org/wiki/.int
+// Confirmed by registry <iana-questions@icann.org> 2008-06-18
+int
+eu.int
+
+// io : http://www.nic.io/rules.html
+// list of other 2nd level tlds ?
+io
+com.io
+
+// iq : http://www.cmc.iq/english/iq/iqregister1.htm
+iq
+gov.iq
+edu.iq
+mil.iq
+com.iq
+org.iq
+net.iq
+
+// ir : http://www.nic.ir/Terms_and_Conditions_ir,_Appendix_1_Domain_Rules
+// Also see http://www.nic.ir/Internationalized_Domain_Names
+// Two <iran>.ir entries added at request of <tech-team@nic.ir>, 2010-04-16
+ir
+ac.ir
+co.ir
+gov.ir
+id.ir
+net.ir
+org.ir
+sch.ir
+// xn--mgba3a4f16a.ir (<iran>.ir, Persian YEH)
+xn--mgba3a4f16a.ir
+ایران.ir
+// xn--mgba3a4fra.ir (<iran>.ir, Arabic YEH)
+xn--mgba3a4fra.ir
+ايران.ir
+
+// is : http://www.isnic.is/domain/rules.php
+// Confirmed by registry <marius@isgate.is> 2008-12-06
+is
+net.is
+com.is
+edu.is
+gov.is
+org.is
+int.is
+
+// it : https://en.wikipedia.org/wiki/.it
+it
+gov.it
+edu.it
+// Reserved geo-names:
+// http://www.nic.it/documenti/regolamenti-e-linee-guida/regolamento-assegnazione-versione-6.0.pdf
+// There is also a list of reserved geo-names corresponding to Italian municipalities
+// http://www.nic.it/documenti/appendice-c.pdf, but it is not included here.
+// Regions
+abr.it
+abruzzo.it
+aosta-valley.it
+aostavalley.it
+bas.it
+basilicata.it
+cal.it
+calabria.it
+cam.it
+campania.it
+emilia-romagna.it
+emiliaromagna.it
+emr.it
+friuli-v-giulia.it
+friuli-ve-giulia.it
+friuli-vegiulia.it
+friuli-venezia-giulia.it
+friuli-veneziagiulia.it
+friuli-vgiulia.it
+friuliv-giulia.it
+friulive-giulia.it
+friulivegiulia.it
+friulivenezia-giulia.it
+friuliveneziagiulia.it
+friulivgiulia.it
+fvg.it
+laz.it
+lazio.it
+lig.it
+liguria.it
+lom.it
+lombardia.it
+lombardy.it
+lucania.it
+mar.it
+marche.it
+mol.it
+molise.it
+piedmont.it
+piemonte.it
+pmn.it
+pug.it
+puglia.it
+sar.it
+sardegna.it
+sardinia.it
+sic.it
+sicilia.it
+sicily.it
+taa.it
+tos.it
+toscana.it
+trentino-a-adige.it
+trentino-aadige.it
+trentino-alto-adige.it
+trentino-altoadige.it
+trentino-s-tirol.it
+trentino-stirol.it
+trentino-sud-tirol.it
+trentino-sudtirol.it
+trentino-sued-tirol.it
+trentino-suedtirol.it
+trentinoa-adige.it
+trentinoaadige.it
+trentinoalto-adige.it
+trentinoaltoadige.it
+trentinos-tirol.it
+trentinostirol.it
+trentinosud-tirol.it
+trentinosudtirol.it
+trentinosued-tirol.it
+trentinosuedtirol.it
+tuscany.it
+umb.it
+umbria.it
+val-d-aosta.it
+val-daosta.it
+vald-aosta.it
+valdaosta.it
+valle-aosta.it
+valle-d-aosta.it
+valle-daosta.it
+valleaosta.it
+valled-aosta.it
+valledaosta.it
+vallee-aoste.it
+valleeaoste.it
+vao.it
+vda.it
+ven.it
+veneto.it
+// Provinces
+ag.it
+agrigento.it
+al.it
+alessandria.it
+alto-adige.it
+altoadige.it
+an.it
+ancona.it
+andria-barletta-trani.it
+andria-trani-barletta.it
+andriabarlettatrani.it
+andriatranibarletta.it
+ao.it
+aosta.it
+aoste.it
+ap.it
+aq.it
+aquila.it
+ar.it
+arezzo.it
+ascoli-piceno.it
+ascolipiceno.it
+asti.it
+at.it
+av.it
+avellino.it
+ba.it
+balsan.it
+bari.it
+barletta-trani-andria.it
+barlettatraniandria.it
+belluno.it
+benevento.it
+bergamo.it
+bg.it
+bi.it
+biella.it
+bl.it
+bn.it
+bo.it
+bologna.it
+bolzano.it
+bozen.it
+br.it
+brescia.it
+brindisi.it
+bs.it
+bt.it
+bz.it
+ca.it
+cagliari.it
+caltanissetta.it
+campidano-medio.it
+campidanomedio.it
+campobasso.it
+carbonia-iglesias.it
+carboniaiglesias.it
+carrara-massa.it
+carraramassa.it
+caserta.it
+catania.it
+catanzaro.it
+cb.it
+ce.it
+cesena-forli.it
+cesenaforli.it
+ch.it
+chieti.it
+ci.it
+cl.it
+cn.it
+co.it
+como.it
+cosenza.it
+cr.it
+cremona.it
+crotone.it
+cs.it
+ct.it
+cuneo.it
+cz.it
+dell-ogliastra.it
+dellogliastra.it
+en.it
+enna.it
+fc.it
+fe.it
+fermo.it
+ferrara.it
+fg.it
+fi.it
+firenze.it
+florence.it
+fm.it
+foggia.it
+forli-cesena.it
+forlicesena.it
+fr.it
+frosinone.it
+ge.it
+genoa.it
+genova.it
+go.it
+gorizia.it
+gr.it
+grosseto.it
+iglesias-carbonia.it
+iglesiascarbonia.it
+im.it
+imperia.it
+is.it
+isernia.it
+kr.it
+la-spezia.it
+laquila.it
+laspezia.it
+latina.it
+lc.it
+le.it
+lecce.it
+lecco.it
+li.it
+livorno.it
+lo.it
+lodi.it
+lt.it
+lu.it
+lucca.it
+macerata.it
+mantova.it
+massa-carrara.it
+massacarrara.it
+matera.it
+mb.it
+mc.it
+me.it
+medio-campidano.it
+mediocampidano.it
+messina.it
+mi.it
+milan.it
+milano.it
+mn.it
+mo.it
+modena.it
+monza-brianza.it
+monza-e-della-brianza.it
+monza.it
+monzabrianza.it
+monzaebrianza.it
+monzaedellabrianza.it
+ms.it
+mt.it
+na.it
+naples.it
+napoli.it
+no.it
+novara.it
+nu.it
+nuoro.it
+og.it
+ogliastra.it
+olbia-tempio.it
+olbiatempio.it
+or.it
+oristano.it
+ot.it
+pa.it
+padova.it
+padua.it
+palermo.it
+parma.it
+pavia.it
+pc.it
+pd.it
+pe.it
+perugia.it
+pesaro-urbino.it
+pesarourbino.it
+pescara.it
+pg.it
+pi.it
+piacenza.it
+pisa.it
+pistoia.it
+pn.it
+po.it
+pordenone.it
+potenza.it
+pr.it
+prato.it
+pt.it
+pu.it
+pv.it
+pz.it
+ra.it
+ragusa.it
+ravenna.it
+rc.it
+re.it
+reggio-calabria.it
+reggio-emilia.it
+reggiocalabria.it
+reggioemilia.it
+rg.it
+ri.it
+rieti.it
+rimini.it
+rm.it
+rn.it
+ro.it
+roma.it
+rome.it
+rovigo.it
+sa.it
+salerno.it
+sassari.it
+savona.it
+si.it
+siena.it
+siracusa.it
+so.it
+sondrio.it
+sp.it
+sr.it
+ss.it
+suedtirol.it
+sv.it
+ta.it
+taranto.it
+te.it
+tempio-olbia.it
+tempioolbia.it
+teramo.it
+terni.it
+tn.it
+to.it
+torino.it
+tp.it
+tr.it
+trani-andria-barletta.it
+trani-barletta-andria.it
+traniandriabarletta.it
+tranibarlettaandria.it
+trapani.it
+trentino.it
+trento.it
+treviso.it
+trieste.it
+ts.it
+turin.it
+tv.it
+ud.it
+udine.it
+urbino-pesaro.it
+urbinopesaro.it
+va.it
+varese.it
+vb.it
+vc.it
+ve.it
+venezia.it
+venice.it
+verbania.it
+vercelli.it
+verona.it
+vi.it
+vibo-valentia.it
+vibovalentia.it
+vicenza.it
+viterbo.it
+vr.it
+vs.it
+vt.it
+vv.it
+
+// je : http://www.channelisles.net/register-domains/
+// Confirmed by registry <nigel@channelisles.net> 2013-11-28
+je
+co.je
+net.je
+org.je
+
+// jm : http://www.com.jm/register.html
+*.jm
+
+// jo : http://www.dns.jo/Registration_policy.aspx
+jo
+com.jo
+org.jo
+net.jo
+edu.jo
+sch.jo
+gov.jo
+mil.jo
+name.jo
+
+// jobs : https://en.wikipedia.org/wiki/.jobs
+jobs
+
+// jp : https://en.wikipedia.org/wiki/.jp
+// http://jprs.co.jp/en/jpdomain.html
+// Submitted by registry <info@jprs.jp>
+jp
+// jp organizational type names
+ac.jp
+ad.jp
+co.jp
+ed.jp
+go.jp
+gr.jp
+lg.jp
+ne.jp
+or.jp
+// jp prefecture type names
+aichi.jp
+akita.jp
+aomori.jp
+chiba.jp
+ehime.jp
+fukui.jp
+fukuoka.jp
+fukushima.jp
+gifu.jp
+gunma.jp
+hiroshima.jp
+hokkaido.jp
+hyogo.jp
+ibaraki.jp
+ishikawa.jp
+iwate.jp
+kagawa.jp
+kagoshima.jp
+kanagawa.jp
+kochi.jp
+kumamoto.jp
+kyoto.jp
+mie.jp
+miyagi.jp
+miyazaki.jp
+nagano.jp
+nagasaki.jp
+nara.jp
+niigata.jp
+oita.jp
+okayama.jp
+okinawa.jp
+osaka.jp
+saga.jp
+saitama.jp
+shiga.jp
+shimane.jp
+shizuoka.jp
+tochigi.jp
+tokushima.jp
+tokyo.jp
+tottori.jp
+toyama.jp
+wakayama.jp
+yamagata.jp
+yamaguchi.jp
+yamanashi.jp
+xn--4pvxs.jp
+栃木.jp
+xn--vgu402c.jp
+愛知.jp
+xn--c3s14m.jp
+愛媛.jp
+xn--f6qx53a.jp
+兵庫.jp
+xn--8pvr4u.jp
+熊本.jp
+xn--uist22h.jp
+茨城.jp
+xn--djrs72d6uy.jp
+北海道.jp
+xn--mkru45i.jp
+千葉.jp
+xn--0trq7p7nn.jp
+和歌山.jp
+xn--8ltr62k.jp
+長崎.jp
+xn--2m4a15e.jp
+長野.jp
+xn--efvn9s.jp
+新潟.jp
+xn--32vp30h.jp
+青森.jp
+xn--4it797k.jp
+静岡.jp
+xn--1lqs71d.jp
+東京.jp
+xn--5rtp49c.jp
+石川.jp
+xn--5js045d.jp
+埼玉.jp
+xn--ehqz56n.jp
+三重.jp
+xn--1lqs03n.jp
+京都.jp
+xn--qqqt11m.jp
+佐賀.jp
+xn--kbrq7o.jp
+大分.jp
+xn--pssu33l.jp
+大阪.jp
+xn--ntsq17g.jp
+奈良.jp
+xn--uisz3g.jp
+宮城.jp
+xn--6btw5a.jp
+宮崎.jp
+xn--1ctwo.jp
+富山.jp
+xn--6orx2r.jp
+山口.jp
+xn--rht61e.jp
+山形.jp
+xn--rht27z.jp
+山梨.jp
+xn--djty4k.jp
+岩手.jp
+xn--nit225k.jp
+岐阜.jp
+xn--rht3d.jp
+岡山.jp
+xn--klty5x.jp
+島根.jp
+xn--kltx9a.jp
+広島.jp
+xn--kltp7d.jp
+徳島.jp
+xn--uuwu58a.jp
+沖縄.jp
+xn--zbx025d.jp
+滋賀.jp
+xn--ntso0iqx3a.jp
+神奈川.jp
+xn--elqq16h.jp
+福井.jp
+xn--4it168d.jp
+福岡.jp
+xn--klt787d.jp
+福島.jp
+xn--rny31h.jp
+秋田.jp
+xn--7t0a264c.jp
+群馬.jp
+xn--5rtq34k.jp
+香川.jp
+xn--k7yn95e.jp
+高知.jp
+xn--tor131o.jp
+鳥取.jp
+xn--d5qv7z876c.jp
+鹿児島.jp
+// jp geographic type names
+// http://jprs.jp/doc/rule/saisoku-1.html
+*.kawasaki.jp
+*.kitakyushu.jp
+*.kobe.jp
+*.nagoya.jp
+*.sapporo.jp
+*.sendai.jp
+*.yokohama.jp
+!city.kawasaki.jp
+!city.kitakyushu.jp
+!city.kobe.jp
+!city.nagoya.jp
+!city.sapporo.jp
+!city.sendai.jp
+!city.yokohama.jp
+// 4th level registration
+aisai.aichi.jp
+ama.aichi.jp
+anjo.aichi.jp
+asuke.aichi.jp
+chiryu.aichi.jp
+chita.aichi.jp
+fuso.aichi.jp
+gamagori.aichi.jp
+handa.aichi.jp
+hazu.aichi.jp
+hekinan.aichi.jp
+higashiura.aichi.jp
+ichinomiya.aichi.jp
+inazawa.aichi.jp
+inuyama.aichi.jp
+isshiki.aichi.jp
+iwakura.aichi.jp
+kanie.aichi.jp
+kariya.aichi.jp
+kasugai.aichi.jp
+kira.aichi.jp
+kiyosu.aichi.jp
+komaki.aichi.jp
+konan.aichi.jp
+kota.aichi.jp
+mihama.aichi.jp
+miyoshi.aichi.jp
+nishio.aichi.jp
+nisshin.aichi.jp
+obu.aichi.jp
+oguchi.aichi.jp
+oharu.aichi.jp
+okazaki.aichi.jp
+owariasahi.aichi.jp
+seto.aichi.jp
+shikatsu.aichi.jp
+shinshiro.aichi.jp
+shitara.aichi.jp
+tahara.aichi.jp
+takahama.aichi.jp
+tobishima.aichi.jp
+toei.aichi.jp
+togo.aichi.jp
+tokai.aichi.jp
+tokoname.aichi.jp
+toyoake.aichi.jp
+toyohashi.aichi.jp
+toyokawa.aichi.jp
+toyone.aichi.jp
+toyota.aichi.jp
+tsushima.aichi.jp
+yatomi.aichi.jp
+akita.akita.jp
+daisen.akita.jp
+fujisato.akita.jp
+gojome.akita.jp
+hachirogata.akita.jp
+happou.akita.jp
+higashinaruse.akita.jp
+honjo.akita.jp
+honjyo.akita.jp
+ikawa.akita.jp
+kamikoani.akita.jp
+kamioka.akita.jp
+katagami.akita.jp
+kazuno.akita.jp
+kitaakita.akita.jp
+kosaka.akita.jp
+kyowa.akita.jp
+misato.akita.jp
+mitane.akita.jp
+moriyoshi.akita.jp
+nikaho.akita.jp
+noshiro.akita.jp
+odate.akita.jp
+oga.akita.jp
+ogata.akita.jp
+semboku.akita.jp
+yokote.akita.jp
+yurihonjo.akita.jp
+aomori.aomori.jp
+gonohe.aomori.jp
+hachinohe.aomori.jp
+hashikami.aomori.jp
+hiranai.aomori.jp
+hirosaki.aomori.jp
+itayanagi.aomori.jp
+kuroishi.aomori.jp
+misawa.aomori.jp
+mutsu.aomori.jp
+nakadomari.aomori.jp
+noheji.aomori.jp
+oirase.aomori.jp
+owani.aomori.jp
+rokunohe.aomori.jp
+sannohe.aomori.jp
+shichinohe.aomori.jp
+shingo.aomori.jp
+takko.aomori.jp
+towada.aomori.jp
+tsugaru.aomori.jp
+tsuruta.aomori.jp
+abiko.chiba.jp
+asahi.chiba.jp
+chonan.chiba.jp
+chosei.chiba.jp
+choshi.chiba.jp
+chuo.chiba.jp
+funabashi.chiba.jp
+futtsu.chiba.jp
+hanamigawa.chiba.jp
+ichihara.chiba.jp
+ichikawa.chiba.jp
+ichinomiya.chiba.jp
+inzai.chiba.jp
+isumi.chiba.jp
+kamagaya.chiba.jp
+kamogawa.chiba.jp
+kashiwa.chiba.jp
+katori.chiba.jp
+katsuura.chiba.jp
+kimitsu.chiba.jp
+kisarazu.chiba.jp
+kozaki.chiba.jp
+kujukuri.chiba.jp
+kyonan.chiba.jp
+matsudo.chiba.jp
+midori.chiba.jp
+mihama.chiba.jp
+minamiboso.chiba.jp
+mobara.chiba.jp
+mutsuzawa.chiba.jp
+nagara.chiba.jp
+nagareyama.chiba.jp
+narashino.chiba.jp
+narita.chiba.jp
+noda.chiba.jp
+oamishirasato.chiba.jp
+omigawa.chiba.jp
+onjuku.chiba.jp
+otaki.chiba.jp
+sakae.chiba.jp
+sakura.chiba.jp
+shimofusa.chiba.jp
+shirako.chiba.jp
+shiroi.chiba.jp
+shisui.chiba.jp
+sodegaura.chiba.jp
+sosa.chiba.jp
+tako.chiba.jp
+tateyama.chiba.jp
+togane.chiba.jp
+tohnosho.chiba.jp
+tomisato.chiba.jp
+urayasu.chiba.jp
+yachimata.chiba.jp
+yachiyo.chiba.jp
+yokaichiba.chiba.jp
+yokoshibahikari.chiba.jp
+yotsukaido.chiba.jp
+ainan.ehime.jp
+honai.ehime.jp
+ikata.ehime.jp
+imabari.ehime.jp
+iyo.ehime.jp
+kamijima.ehime.jp
+kihoku.ehime.jp
+kumakogen.ehime.jp
+masaki.ehime.jp
+matsuno.ehime.jp
+matsuyama.ehime.jp
+namikata.ehime.jp
+niihama.ehime.jp
+ozu.ehime.jp
+saijo.ehime.jp
+seiyo.ehime.jp
+shikokuchuo.ehime.jp
+tobe.ehime.jp
+toon.ehime.jp
+uchiko.ehime.jp
+uwajima.ehime.jp
+yawatahama.ehime.jp
+echizen.fukui.jp
+eiheiji.fukui.jp
+fukui.fukui.jp
+ikeda.fukui.jp
+katsuyama.fukui.jp
+mihama.fukui.jp
+minamiechizen.fukui.jp
+obama.fukui.jp
+ohi.fukui.jp
+ono.fukui.jp
+sabae.fukui.jp
+sakai.fukui.jp
+takahama.fukui.jp
+tsuruga.fukui.jp
+wakasa.fukui.jp
+ashiya.fukuoka.jp
+buzen.fukuoka.jp
+chikugo.fukuoka.jp
+chikuho.fukuoka.jp
+chikujo.fukuoka.jp
+chikushino.fukuoka.jp
+chikuzen.fukuoka.jp
+chuo.fukuoka.jp
+dazaifu.fukuoka.jp
+fukuchi.fukuoka.jp
+hakata.fukuoka.jp
+higashi.fukuoka.jp
+hirokawa.fukuoka.jp
+hisayama.fukuoka.jp
+iizuka.fukuoka.jp
+inatsuki.fukuoka.jp
+kaho.fukuoka.jp
+kasuga.fukuoka.jp
+kasuya.fukuoka.jp
+kawara.fukuoka.jp
+keisen.fukuoka.jp
+koga.fukuoka.jp
+kurate.fukuoka.jp
+kurogi.fukuoka.jp
+kurume.fukuoka.jp
+minami.fukuoka.jp
+miyako.fukuoka.jp
+miyama.fukuoka.jp
+miyawaka.fukuoka.jp
+mizumaki.fukuoka.jp
+munakata.fukuoka.jp
+nakagawa.fukuoka.jp
+nakama.fukuoka.jp
+nishi.fukuoka.jp
+nogata.fukuoka.jp
+ogori.fukuoka.jp
+okagaki.fukuoka.jp
+okawa.fukuoka.jp
+oki.fukuoka.jp
+omuta.fukuoka.jp
+onga.fukuoka.jp
+onojo.fukuoka.jp
+oto.fukuoka.jp
+saigawa.fukuoka.jp
+sasaguri.fukuoka.jp
+shingu.fukuoka.jp
+shinyoshitomi.fukuoka.jp
+shonai.fukuoka.jp
+soeda.fukuoka.jp
+sue.fukuoka.jp
+tachiarai.fukuoka.jp
+tagawa.fukuoka.jp
+takata.fukuoka.jp
+toho.fukuoka.jp
+toyotsu.fukuoka.jp
+tsuiki.fukuoka.jp
+ukiha.fukuoka.jp
+umi.fukuoka.jp
+usui.fukuoka.jp
+yamada.fukuoka.jp
+yame.fukuoka.jp
+yanagawa.fukuoka.jp
+yukuhashi.fukuoka.jp
+aizubange.fukushima.jp
+aizumisato.fukushima.jp
+aizuwakamatsu.fukushima.jp
+asakawa.fukushima.jp
+bandai.fukushima.jp
+date.fukushima.jp
+fukushima.fukushima.jp
+furudono.fukushima.jp
+futaba.fukushima.jp
+hanawa.fukushima.jp
+higashi.fukushima.jp
+hirata.fukushima.jp
+hirono.fukushima.jp
+iitate.fukushima.jp
+inawashiro.fukushima.jp
+ishikawa.fukushima.jp
+iwaki.fukushima.jp
+izumizaki.fukushima.jp
+kagamiishi.fukushima.jp
+kaneyama.fukushima.jp
+kawamata.fukushima.jp
+kitakata.fukushima.jp
+kitashiobara.fukushima.jp
+koori.fukushima.jp
+koriyama.fukushima.jp
+kunimi.fukushima.jp
+miharu.fukushima.jp
+mishima.fukushima.jp
+namie.fukushima.jp
+nango.fukushima.jp
+nishiaizu.fukushima.jp
+nishigo.fukushima.jp
+okuma.fukushima.jp
+omotego.fukushima.jp
+ono.fukushima.jp
+otama.fukushima.jp
+samegawa.fukushima.jp
+shimogo.fukushima.jp
+shirakawa.fukushima.jp
+showa.fukushima.jp
+soma.fukushima.jp
+sukagawa.fukushima.jp
+taishin.fukushima.jp
+tamakawa.fukushima.jp
+tanagura.fukushima.jp
+tenei.fukushima.jp
+yabuki.fukushima.jp
+yamato.fukushima.jp
+yamatsuri.fukushima.jp
+yanaizu.fukushima.jp
+yugawa.fukushima.jp
+anpachi.gifu.jp
+ena.gifu.jp
+gifu.gifu.jp
+ginan.gifu.jp
+godo.gifu.jp
+gujo.gifu.jp
+hashima.gifu.jp
+hichiso.gifu.jp
+hida.gifu.jp
+higashishirakawa.gifu.jp
+ibigawa.gifu.jp
+ikeda.gifu.jp
+kakamigahara.gifu.jp
+kani.gifu.jp
+kasahara.gifu.jp
+kasamatsu.gifu.jp
+kawaue.gifu.jp
+kitagata.gifu.jp
+mino.gifu.jp
+minokamo.gifu.jp
+mitake.gifu.jp
+mizunami.gifu.jp
+motosu.gifu.jp
+nakatsugawa.gifu.jp
+ogaki.gifu.jp
+sakahogi.gifu.jp
+seki.gifu.jp
+sekigahara.gifu.jp
+shirakawa.gifu.jp
+tajimi.gifu.jp
+takayama.gifu.jp
+tarui.gifu.jp
+toki.gifu.jp
+tomika.gifu.jp
+wanouchi.gifu.jp
+yamagata.gifu.jp
+yaotsu.gifu.jp
+yoro.gifu.jp
+annaka.gunma.jp
+chiyoda.gunma.jp
+fujioka.gunma.jp
+higashiagatsuma.gunma.jp
+isesaki.gunma.jp
+itakura.gunma.jp
+kanna.gunma.jp
+kanra.gunma.jp
+katashina.gunma.jp
+kawaba.gunma.jp
+kiryu.gunma.jp
+kusatsu.gunma.jp
+maebashi.gunma.jp
+meiwa.gunma.jp
+midori.gunma.jp
+minakami.gunma.jp
+naganohara.gunma.jp
+nakanojo.gunma.jp
+nanmoku.gunma.jp
+numata.gunma.jp
+oizumi.gunma.jp
+ora.gunma.jp
+ota.gunma.jp
+shibukawa.gunma.jp
+shimonita.gunma.jp
+shinto.gunma.jp
+showa.gunma.jp
+takasaki.gunma.jp
+takayama.gunma.jp
+tamamura.gunma.jp
+tatebayashi.gunma.jp
+tomioka.gunma.jp
+tsukiyono.gunma.jp
+tsumagoi.gunma.jp
+ueno.gunma.jp
+yoshioka.gunma.jp
+asaminami.hiroshima.jp
+daiwa.hiroshima.jp
+etajima.hiroshima.jp
+fuchu.hiroshima.jp
+fukuyama.hiroshima.jp
+hatsukaichi.hiroshima.jp
+higashihiroshima.hiroshima.jp
+hongo.hiroshima.jp
+jinsekikogen.hiroshima.jp
+kaita.hiroshima.jp
+kui.hiroshima.jp
+kumano.hiroshima.jp
+kure.hiroshima.jp
+mihara.hiroshima.jp
+miyoshi.hiroshima.jp
+naka.hiroshima.jp
+onomichi.hiroshima.jp
+osakikamijima.hiroshima.jp
+otake.hiroshima.jp
+saka.hiroshima.jp
+sera.hiroshima.jp
+seranishi.hiroshima.jp
+shinichi.hiroshima.jp
+shobara.hiroshima.jp
+takehara.hiroshima.jp
+abashiri.hokkaido.jp
+abira.hokkaido.jp
+aibetsu.hokkaido.jp
+akabira.hokkaido.jp
+akkeshi.hokkaido.jp
+asahikawa.hokkaido.jp
+ashibetsu.hokkaido.jp
+ashoro.hokkaido.jp
+assabu.hokkaido.jp
+atsuma.hokkaido.jp
+bibai.hokkaido.jp
+biei.hokkaido.jp
+bifuka.hokkaido.jp
+bihoro.hokkaido.jp
+biratori.hokkaido.jp
+chippubetsu.hokkaido.jp
+chitose.hokkaido.jp
+date.hokkaido.jp
+ebetsu.hokkaido.jp
+embetsu.hokkaido.jp
+eniwa.hokkaido.jp
+erimo.hokkaido.jp
+esan.hokkaido.jp
+esashi.hokkaido.jp
+fukagawa.hokkaido.jp
+fukushima.hokkaido.jp
+furano.hokkaido.jp
+furubira.hokkaido.jp
+haboro.hokkaido.jp
+hakodate.hokkaido.jp
+hamatonbetsu.hokkaido.jp
+hidaka.hokkaido.jp
+higashikagura.hokkaido.jp
+higashikawa.hokkaido.jp
+hiroo.hokkaido.jp
+hokuryu.hokkaido.jp
+hokuto.hokkaido.jp
+honbetsu.hokkaido.jp
+horokanai.hokkaido.jp
+horonobe.hokkaido.jp
+ikeda.hokkaido.jp
+imakane.hokkaido.jp
+ishikari.hokkaido.jp
+iwamizawa.hokkaido.jp
+iwanai.hokkaido.jp
+kamifurano.hokkaido.jp
+kamikawa.hokkaido.jp
+kamishihoro.hokkaido.jp
+kamisunagawa.hokkaido.jp
+kamoenai.hokkaido.jp
+kayabe.hokkaido.jp
+kembuchi.hokkaido.jp
+kikonai.hokkaido.jp
+kimobetsu.hokkaido.jp
+kitahiroshima.hokkaido.jp
+kitami.hokkaido.jp
+kiyosato.hokkaido.jp
+koshimizu.hokkaido.jp
+kunneppu.hokkaido.jp
+kuriyama.hokkaido.jp
+kuromatsunai.hokkaido.jp
+kushiro.hokkaido.jp
+kutchan.hokkaido.jp
+kyowa.hokkaido.jp
+mashike.hokkaido.jp
+matsumae.hokkaido.jp
+mikasa.hokkaido.jp
+minamifurano.hokkaido.jp
+mombetsu.hokkaido.jp
+moseushi.hokkaido.jp
+mukawa.hokkaido.jp
+muroran.hokkaido.jp
+naie.hokkaido.jp
+nakagawa.hokkaido.jp
+nakasatsunai.hokkaido.jp
+nakatombetsu.hokkaido.jp
+nanae.hokkaido.jp
+nanporo.hokkaido.jp
+nayoro.hokkaido.jp
+nemuro.hokkaido.jp
+niikappu.hokkaido.jp
+niki.hokkaido.jp
+nishiokoppe.hokkaido.jp
+noboribetsu.hokkaido.jp
+numata.hokkaido.jp
+obihiro.hokkaido.jp
+obira.hokkaido.jp
+oketo.hokkaido.jp
+okoppe.hokkaido.jp
+otaru.hokkaido.jp
+otobe.hokkaido.jp
+otofuke.hokkaido.jp
+otoineppu.hokkaido.jp
+oumu.hokkaido.jp
+ozora.hokkaido.jp
+pippu.hokkaido.jp
+rankoshi.hokkaido.jp
+rebun.hokkaido.jp
+rikubetsu.hokkaido.jp
+rishiri.hokkaido.jp
+rishirifuji.hokkaido.jp
+saroma.hokkaido.jp
+sarufutsu.hokkaido.jp
+shakotan.hokkaido.jp
+shari.hokkaido.jp
+shibecha.hokkaido.jp
+shibetsu.hokkaido.jp
+shikabe.hokkaido.jp
+shikaoi.hokkaido.jp
+shimamaki.hokkaido.jp
+shimizu.hokkaido.jp
+shimokawa.hokkaido.jp
+shinshinotsu.hokkaido.jp
+shintoku.hokkaido.jp
+shiranuka.hokkaido.jp
+shiraoi.hokkaido.jp
+shiriuchi.hokkaido.jp
+sobetsu.hokkaido.jp
+sunagawa.hokkaido.jp
+taiki.hokkaido.jp
+takasu.hokkaido.jp
+takikawa.hokkaido.jp
+takinoue.hokkaido.jp
+teshikaga.hokkaido.jp
+tobetsu.hokkaido.jp
+tohma.hokkaido.jp
+tomakomai.hokkaido.jp
+tomari.hokkaido.jp
+toya.hokkaido.jp
+toyako.hokkaido.jp
+toyotomi.hokkaido.jp
+toyoura.hokkaido.jp
+tsubetsu.hokkaido.jp
+tsukigata.hokkaido.jp
+urakawa.hokkaido.jp
+urausu.hokkaido.jp
+uryu.hokkaido.jp
+utashinai.hokkaido.jp
+wakkanai.hokkaido.jp
+wassamu.hokkaido.jp
+yakumo.hokkaido.jp
+yoichi.hokkaido.jp
+aioi.hyogo.jp
+akashi.hyogo.jp
+ako.hyogo.jp
+amagasaki.hyogo.jp
+aogaki.hyogo.jp
+asago.hyogo.jp
+ashiya.hyogo.jp
+awaji.hyogo.jp
+fukusaki.hyogo.jp
+goshiki.hyogo.jp
+harima.hyogo.jp
+himeji.hyogo.jp
+ichikawa.hyogo.jp
+inagawa.hyogo.jp
+itami.hyogo.jp
+kakogawa.hyogo.jp
+kamigori.hyogo.jp
+kamikawa.hyogo.jp
+kasai.hyogo.jp
+kasuga.hyogo.jp
+kawanishi.hyogo.jp
+miki.hyogo.jp
+minamiawaji.hyogo.jp
+nishinomiya.hyogo.jp
+nishiwaki.hyogo.jp
+ono.hyogo.jp
+sanda.hyogo.jp
+sannan.hyogo.jp
+sasayama.hyogo.jp
+sayo.hyogo.jp
+shingu.hyogo.jp
+shinonsen.hyogo.jp
+shiso.hyogo.jp
+sumoto.hyogo.jp
+taishi.hyogo.jp
+taka.hyogo.jp
+takarazuka.hyogo.jp
+takasago.hyogo.jp
+takino.hyogo.jp
+tamba.hyogo.jp
+tatsuno.hyogo.jp
+toyooka.hyogo.jp
+yabu.hyogo.jp
+yashiro.hyogo.jp
+yoka.hyogo.jp
+yokawa.hyogo.jp
+ami.ibaraki.jp
+asahi.ibaraki.jp
+bando.ibaraki.jp
+chikusei.ibaraki.jp
+daigo.ibaraki.jp
+fujishiro.ibaraki.jp
+hitachi.ibaraki.jp
+hitachinaka.ibaraki.jp
+hitachiomiya.ibaraki.jp
+hitachiota.ibaraki.jp
+ibaraki.ibaraki.jp
+ina.ibaraki.jp
+inashiki.ibaraki.jp
+itako.ibaraki.jp
+iwama.ibaraki.jp
+joso.ibaraki.jp
+kamisu.ibaraki.jp
+kasama.ibaraki.jp
+kashima.ibaraki.jp
+kasumigaura.ibaraki.jp
+koga.ibaraki.jp
+miho.ibaraki.jp
+mito.ibaraki.jp
+moriya.ibaraki.jp
+naka.ibaraki.jp
+namegata.ibaraki.jp
+oarai.ibaraki.jp
+ogawa.ibaraki.jp
+omitama.ibaraki.jp
+ryugasaki.ibaraki.jp
+sakai.ibaraki.jp
+sakuragawa.ibaraki.jp
+shimodate.ibaraki.jp
+shimotsuma.ibaraki.jp
+shirosato.ibaraki.jp
+sowa.ibaraki.jp
+suifu.ibaraki.jp
+takahagi.ibaraki.jp
+tamatsukuri.ibaraki.jp
+tokai.ibaraki.jp
+tomobe.ibaraki.jp
+tone.ibaraki.jp
+toride.ibaraki.jp
+tsuchiura.ibaraki.jp
+tsukuba.ibaraki.jp
+uchihara.ibaraki.jp
+ushiku.ibaraki.jp
+yachiyo.ibaraki.jp
+yamagata.ibaraki.jp
+yawara.ibaraki.jp
+yuki.ibaraki.jp
+anamizu.ishikawa.jp
+hakui.ishikawa.jp
+hakusan.ishikawa.jp
+kaga.ishikawa.jp
+kahoku.ishikawa.jp
+kanazawa.ishikawa.jp
+kawakita.ishikawa.jp
+komatsu.ishikawa.jp
+nakanoto.ishikawa.jp
+nanao.ishikawa.jp
+nomi.ishikawa.jp
+nonoichi.ishikawa.jp
+noto.ishikawa.jp
+shika.ishikawa.jp
+suzu.ishikawa.jp
+tsubata.ishikawa.jp
+tsurugi.ishikawa.jp
+uchinada.ishikawa.jp
+wajima.ishikawa.jp
+fudai.iwate.jp
+fujisawa.iwate.jp
+hanamaki.iwate.jp
+hiraizumi.iwate.jp
+hirono.iwate.jp
+ichinohe.iwate.jp
+ichinoseki.iwate.jp
+iwaizumi.iwate.jp
+iwate.iwate.jp
+joboji.iwate.jp
+kamaishi.iwate.jp
+kanegasaki.iwate.jp
+karumai.iwate.jp
+kawai.iwate.jp
+kitakami.iwate.jp
+kuji.iwate.jp
+kunohe.iwate.jp
+kuzumaki.iwate.jp
+miyako.iwate.jp
+mizusawa.iwate.jp
+morioka.iwate.jp
+ninohe.iwate.jp
+noda.iwate.jp
+ofunato.iwate.jp
+oshu.iwate.jp
+otsuchi.iwate.jp
+rikuzentakata.iwate.jp
+shiwa.iwate.jp
+shizukuishi.iwate.jp
+sumita.iwate.jp
+tanohata.iwate.jp
+tono.iwate.jp
+yahaba.iwate.jp
+yamada.iwate.jp
+ayagawa.kagawa.jp
+higashikagawa.kagawa.jp
+kanonji.kagawa.jp
+kotohira.kagawa.jp
+manno.kagawa.jp
+marugame.kagawa.jp
+mitoyo.kagawa.jp
+naoshima.kagawa.jp
+sanuki.kagawa.jp
+tadotsu.kagawa.jp
+takamatsu.kagawa.jp
+tonosho.kagawa.jp
+uchinomi.kagawa.jp
+utazu.kagawa.jp
+zentsuji.kagawa.jp
+akune.kagoshima.jp
+amami.kagoshima.jp
+hioki.kagoshima.jp
+isa.kagoshima.jp
+isen.kagoshima.jp
+izumi.kagoshima.jp
+kagoshima.kagoshima.jp
+kanoya.kagoshima.jp
+kawanabe.kagoshima.jp
+kinko.kagoshima.jp
+kouyama.kagoshima.jp
+makurazaki.kagoshima.jp
+matsumoto.kagoshima.jp
+minamitane.kagoshima.jp
+nakatane.kagoshima.jp
+nishinoomote.kagoshima.jp
+satsumasendai.kagoshima.jp
+soo.kagoshima.jp
+tarumizu.kagoshima.jp
+yusui.kagoshima.jp
+aikawa.kanagawa.jp
+atsugi.kanagawa.jp
+ayase.kanagawa.jp
+chigasaki.kanagawa.jp
+ebina.kanagawa.jp
+fujisawa.kanagawa.jp
+hadano.kanagawa.jp
+hakone.kanagawa.jp
+hiratsuka.kanagawa.jp
+isehara.kanagawa.jp
+kaisei.kanagawa.jp
+kamakura.kanagawa.jp
+kiyokawa.kanagawa.jp
+matsuda.kanagawa.jp
+minamiashigara.kanagawa.jp
+miura.kanagawa.jp
+nakai.kanagawa.jp
+ninomiya.kanagawa.jp
+odawara.kanagawa.jp
+oi.kanagawa.jp
+oiso.kanagawa.jp
+sagamihara.kanagawa.jp
+samukawa.kanagawa.jp
+tsukui.kanagawa.jp
+yamakita.kanagawa.jp
+yamato.kanagawa.jp
+yokosuka.kanagawa.jp
+yugawara.kanagawa.jp
+zama.kanagawa.jp
+zushi.kanagawa.jp
+aki.kochi.jp
+geisei.kochi.jp
+hidaka.kochi.jp
+higashitsuno.kochi.jp
+ino.kochi.jp
+kagami.kochi.jp
+kami.kochi.jp
+kitagawa.kochi.jp
+kochi.kochi.jp
+mihara.kochi.jp
+motoyama.kochi.jp
+muroto.kochi.jp
+nahari.kochi.jp
+nakamura.kochi.jp
+nankoku.kochi.jp
+nishitosa.kochi.jp
+niyodogawa.kochi.jp
+ochi.kochi.jp
+okawa.kochi.jp
+otoyo.kochi.jp
+otsuki.kochi.jp
+sakawa.kochi.jp
+sukumo.kochi.jp
+susaki.kochi.jp
+tosa.kochi.jp
+tosashimizu.kochi.jp
+toyo.kochi.jp
+tsuno.kochi.jp
+umaji.kochi.jp
+yasuda.kochi.jp
+yusuhara.kochi.jp
+amakusa.kumamoto.jp
+arao.kumamoto.jp
+aso.kumamoto.jp
+choyo.kumamoto.jp
+gyokuto.kumamoto.jp
+kamiamakusa.kumamoto.jp
+kikuchi.kumamoto.jp
+kumamoto.kumamoto.jp
+mashiki.kumamoto.jp
+mifune.kumamoto.jp
+minamata.kumamoto.jp
+minamioguni.kumamoto.jp
+nagasu.kumamoto.jp
+nishihara.kumamoto.jp
+oguni.kumamoto.jp
+ozu.kumamoto.jp
+sumoto.kumamoto.jp
+takamori.kumamoto.jp
+uki.kumamoto.jp
+uto.kumamoto.jp
+yamaga.kumamoto.jp
+yamato.kumamoto.jp
+yatsushiro.kumamoto.jp
+ayabe.kyoto.jp
+fukuchiyama.kyoto.jp
+higashiyama.kyoto.jp
+ide.kyoto.jp
+ine.kyoto.jp
+joyo.kyoto.jp
+kameoka.kyoto.jp
+kamo.kyoto.jp
+kita.kyoto.jp
+kizu.kyoto.jp
+kumiyama.kyoto.jp
+kyotamba.kyoto.jp
+kyotanabe.kyoto.jp
+kyotango.kyoto.jp
+maizuru.kyoto.jp
+minami.kyoto.jp
+minamiyamashiro.kyoto.jp
+miyazu.kyoto.jp
+muko.kyoto.jp
+nagaokakyo.kyoto.jp
+nakagyo.kyoto.jp
+nantan.kyoto.jp
+oyamazaki.kyoto.jp
+sakyo.kyoto.jp
+seika.kyoto.jp
+tanabe.kyoto.jp
+uji.kyoto.jp
+ujitawara.kyoto.jp
+wazuka.kyoto.jp
+yamashina.kyoto.jp
+yawata.kyoto.jp
+asahi.mie.jp
+inabe.mie.jp
+ise.mie.jp
+kameyama.mie.jp
+kawagoe.mie.jp
+kiho.mie.jp
+kisosaki.mie.jp
+kiwa.mie.jp
+komono.mie.jp
+kumano.mie.jp
+kuwana.mie.jp
+matsusaka.mie.jp
+meiwa.mie.jp
+mihama.mie.jp
+minamiise.mie.jp
+misugi.mie.jp
+miyama.mie.jp
+nabari.mie.jp
+shima.mie.jp
+suzuka.mie.jp
+tado.mie.jp
+taiki.mie.jp
+taki.mie.jp
+tamaki.mie.jp
+toba.mie.jp
+tsu.mie.jp
+udono.mie.jp
+ureshino.mie.jp
+watarai.mie.jp
+yokkaichi.mie.jp
+furukawa.miyagi.jp
+higashimatsushima.miyagi.jp
+ishinomaki.miyagi.jp
+iwanuma.miyagi.jp
+kakuda.miyagi.jp
+kami.miyagi.jp
+kawasaki.miyagi.jp
+marumori.miyagi.jp
+matsushima.miyagi.jp
+minamisanriku.miyagi.jp
+misato.miyagi.jp
+murata.miyagi.jp
+natori.miyagi.jp
+ogawara.miyagi.jp
+ohira.miyagi.jp
+onagawa.miyagi.jp
+osaki.miyagi.jp
+rifu.miyagi.jp
+semine.miyagi.jp
+shibata.miyagi.jp
+shichikashuku.miyagi.jp
+shikama.miyagi.jp
+shiogama.miyagi.jp
+shiroishi.miyagi.jp
+tagajo.miyagi.jp
+taiwa.miyagi.jp
+tome.miyagi.jp
+tomiya.miyagi.jp
+wakuya.miyagi.jp
+watari.miyagi.jp
+yamamoto.miyagi.jp
+zao.miyagi.jp
+aya.miyazaki.jp
+ebino.miyazaki.jp
+gokase.miyazaki.jp
+hyuga.miyazaki.jp
+kadogawa.miyazaki.jp
+kawaminami.miyazaki.jp
+kijo.miyazaki.jp
+kitagawa.miyazaki.jp
+kitakata.miyazaki.jp
+kitaura.miyazaki.jp
+kobayashi.miyazaki.jp
+kunitomi.miyazaki.jp
+kushima.miyazaki.jp
+mimata.miyazaki.jp
+miyakonojo.miyazaki.jp
+miyazaki.miyazaki.jp
+morotsuka.miyazaki.jp
+nichinan.miyazaki.jp
+nishimera.miyazaki.jp
+nobeoka.miyazaki.jp
+saito.miyazaki.jp
+shiiba.miyazaki.jp
+shintomi.miyazaki.jp
+takaharu.miyazaki.jp
+takanabe.miyazaki.jp
+takazaki.miyazaki.jp
+tsuno.miyazaki.jp
+achi.nagano.jp
+agematsu.nagano.jp
+anan.nagano.jp
+aoki.nagano.jp
+asahi.nagano.jp
+azumino.nagano.jp
+chikuhoku.nagano.jp
+chikuma.nagano.jp
+chino.nagano.jp
+fujimi.nagano.jp
+hakuba.nagano.jp
+hara.nagano.jp
+hiraya.nagano.jp
+iida.nagano.jp
+iijima.nagano.jp
+iiyama.nagano.jp
+iizuna.nagano.jp
+ikeda.nagano.jp
+ikusaka.nagano.jp
+ina.nagano.jp
+karuizawa.nagano.jp
+kawakami.nagano.jp
+kiso.nagano.jp
+kisofukushima.nagano.jp
+kitaaiki.nagano.jp
+komagane.nagano.jp
+komoro.nagano.jp
+matsukawa.nagano.jp
+matsumoto.nagano.jp
+miasa.nagano.jp
+minamiaiki.nagano.jp
+minamimaki.nagano.jp
+minamiminowa.nagano.jp
+minowa.nagano.jp
+miyada.nagano.jp
+miyota.nagano.jp
+mochizuki.nagano.jp
+nagano.nagano.jp
+nagawa.nagano.jp
+nagiso.nagano.jp
+nakagawa.nagano.jp
+nakano.nagano.jp
+nozawaonsen.nagano.jp
+obuse.nagano.jp
+ogawa.nagano.jp
+okaya.nagano.jp
+omachi.nagano.jp
+omi.nagano.jp
+ookuwa.nagano.jp
+ooshika.nagano.jp
+otaki.nagano.jp
+otari.nagano.jp
+sakae.nagano.jp
+sakaki.nagano.jp
+saku.nagano.jp
+sakuho.nagano.jp
+shimosuwa.nagano.jp
+shinanomachi.nagano.jp
+shiojiri.nagano.jp
+suwa.nagano.jp
+suzaka.nagano.jp
+takagi.nagano.jp
+takamori.nagano.jp
+takayama.nagano.jp
+tateshina.nagano.jp
+tatsuno.nagano.jp
+togakushi.nagano.jp
+togura.nagano.jp
+tomi.nagano.jp
+ueda.nagano.jp
+wada.nagano.jp
+yamagata.nagano.jp
+yamanouchi.nagano.jp
+yasaka.nagano.jp
+yasuoka.nagano.jp
+chijiwa.nagasaki.jp
+futsu.nagasaki.jp
+goto.nagasaki.jp
+hasami.nagasaki.jp
+hirado.nagasaki.jp
+iki.nagasaki.jp
+isahaya.nagasaki.jp
+kawatana.nagasaki.jp
+kuchinotsu.nagasaki.jp
+matsuura.nagasaki.jp
+nagasaki.nagasaki.jp
+obama.nagasaki.jp
+omura.nagasaki.jp
+oseto.nagasaki.jp
+saikai.nagasaki.jp
+sasebo.nagasaki.jp
+seihi.nagasaki.jp
+shimabara.nagasaki.jp
+shinkamigoto.nagasaki.jp
+togitsu.nagasaki.jp
+tsushima.nagasaki.jp
+unzen.nagasaki.jp
+ando.nara.jp
+gose.nara.jp
+heguri.nara.jp
+higashiyoshino.nara.jp
+ikaruga.nara.jp
+ikoma.nara.jp
+kamikitayama.nara.jp
+kanmaki.nara.jp
+kashiba.nara.jp
+kashihara.nara.jp
+katsuragi.nara.jp
+kawai.nara.jp
+kawakami.nara.jp
+kawanishi.nara.jp
+koryo.nara.jp
+kurotaki.nara.jp
+mitsue.nara.jp
+miyake.nara.jp
+nara.nara.jp
+nosegawa.nara.jp
+oji.nara.jp
+ouda.nara.jp
+oyodo.nara.jp
+sakurai.nara.jp
+sango.nara.jp
+shimoichi.nara.jp
+shimokitayama.nara.jp
+shinjo.nara.jp
+soni.nara.jp
+takatori.nara.jp
+tawaramoto.nara.jp
+tenkawa.nara.jp
+tenri.nara.jp
+uda.nara.jp
+yamatokoriyama.nara.jp
+yamatotakada.nara.jp
+yamazoe.nara.jp
+yoshino.nara.jp
+aga.niigata.jp
+agano.niigata.jp
+gosen.niigata.jp
+itoigawa.niigata.jp
+izumozaki.niigata.jp
+joetsu.niigata.jp
+kamo.niigata.jp
+kariwa.niigata.jp
+kashiwazaki.niigata.jp
+minamiuonuma.niigata.jp
+mitsuke.niigata.jp
+muika.niigata.jp
+murakami.niigata.jp
+myoko.niigata.jp
+nagaoka.niigata.jp
+niigata.niigata.jp
+ojiya.niigata.jp
+omi.niigata.jp
+sado.niigata.jp
+sanjo.niigata.jp
+seiro.niigata.jp
+seirou.niigata.jp
+sekikawa.niigata.jp
+shibata.niigata.jp
+tagami.niigata.jp
+tainai.niigata.jp
+tochio.niigata.jp
+tokamachi.niigata.jp
+tsubame.niigata.jp
+tsunan.niigata.jp
+uonuma.niigata.jp
+yahiko.niigata.jp
+yoita.niigata.jp
+yuzawa.niigata.jp
+beppu.oita.jp
+bungoono.oita.jp
+bungotakada.oita.jp
+hasama.oita.jp
+hiji.oita.jp
+himeshima.oita.jp
+hita.oita.jp
+kamitsue.oita.jp
+kokonoe.oita.jp
+kuju.oita.jp
+kunisaki.oita.jp
+kusu.oita.jp
+oita.oita.jp
+saiki.oita.jp
+taketa.oita.jp
+tsukumi.oita.jp
+usa.oita.jp
+usuki.oita.jp
+yufu.oita.jp
+akaiwa.okayama.jp
+asakuchi.okayama.jp
+bizen.okayama.jp
+hayashima.okayama.jp
+ibara.okayama.jp
+kagamino.okayama.jp
+kasaoka.okayama.jp
+kibichuo.okayama.jp
+kumenan.okayama.jp
+kurashiki.okayama.jp
+maniwa.okayama.jp
+misaki.okayama.jp
+nagi.okayama.jp
+niimi.okayama.jp
+nishiawakura.okayama.jp
+okayama.okayama.jp
+satosho.okayama.jp
+setouchi.okayama.jp
+shinjo.okayama.jp
+shoo.okayama.jp
+soja.okayama.jp
+takahashi.okayama.jp
+tamano.okayama.jp
+tsuyama.okayama.jp
+wake.okayama.jp
+yakage.okayama.jp
+aguni.okinawa.jp
+ginowan.okinawa.jp
+ginoza.okinawa.jp
+gushikami.okinawa.jp
+haebaru.okinawa.jp
+higashi.okinawa.jp
+hirara.okinawa.jp
+iheya.okinawa.jp
+ishigaki.okinawa.jp
+ishikawa.okinawa.jp
+itoman.okinawa.jp
+izena.okinawa.jp
+kadena.okinawa.jp
+kin.okinawa.jp
+kitadaito.okinawa.jp
+kitanakagusuku.okinawa.jp
+kumejima.okinawa.jp
+kunigami.okinawa.jp
+minamidaito.okinawa.jp
+motobu.okinawa.jp
+nago.okinawa.jp
+naha.okinawa.jp
+nakagusuku.okinawa.jp
+nakijin.okinawa.jp
+nanjo.okinawa.jp
+nishihara.okinawa.jp
+ogimi.okinawa.jp
+okinawa.okinawa.jp
+onna.okinawa.jp
+shimoji.okinawa.jp
+taketomi.okinawa.jp
+tarama.okinawa.jp
+tokashiki.okinawa.jp
+tomigusuku.okinawa.jp
+tonaki.okinawa.jp
+urasoe.okinawa.jp
+uruma.okinawa.jp
+yaese.okinawa.jp
+yomitan.okinawa.jp
+yonabaru.okinawa.jp
+yonaguni.okinawa.jp
+zamami.okinawa.jp
+abeno.osaka.jp
+chihayaakasaka.osaka.jp
+chuo.osaka.jp
+daito.osaka.jp
+fujiidera.osaka.jp
+habikino.osaka.jp
+hannan.osaka.jp
+higashiosaka.osaka.jp
+higashisumiyoshi.osaka.jp
+higashiyodogawa.osaka.jp
+hirakata.osaka.jp
+ibaraki.osaka.jp
+ikeda.osaka.jp
+izumi.osaka.jp
+izumiotsu.osaka.jp
+izumisano.osaka.jp
+kadoma.osaka.jp
+kaizuka.osaka.jp
+kanan.osaka.jp
+kashiwara.osaka.jp
+katano.osaka.jp
+kawachinagano.osaka.jp
+kishiwada.osaka.jp
+kita.osaka.jp
+kumatori.osaka.jp
+matsubara.osaka.jp
+minato.osaka.jp
+minoh.osaka.jp
+misaki.osaka.jp
+moriguchi.osaka.jp
+neyagawa.osaka.jp
+nishi.osaka.jp
+nose.osaka.jp
+osakasayama.osaka.jp
+sakai.osaka.jp
+sayama.osaka.jp
+sennan.osaka.jp
+settsu.osaka.jp
+shijonawate.osaka.jp
+shimamoto.osaka.jp
+suita.osaka.jp
+tadaoka.osaka.jp
+taishi.osaka.jp
+tajiri.osaka.jp
+takaishi.osaka.jp
+takatsuki.osaka.jp
+tondabayashi.osaka.jp
+toyonaka.osaka.jp
+toyono.osaka.jp
+yao.osaka.jp
+ariake.saga.jp
+arita.saga.jp
+fukudomi.saga.jp
+genkai.saga.jp
+hamatama.saga.jp
+hizen.saga.jp
+imari.saga.jp
+kamimine.saga.jp
+kanzaki.saga.jp
+karatsu.saga.jp
+kashima.saga.jp
+kitagata.saga.jp
+kitahata.saga.jp
+kiyama.saga.jp
+kouhoku.saga.jp
+kyuragi.saga.jp
+nishiarita.saga.jp
+ogi.saga.jp
+omachi.saga.jp
+ouchi.saga.jp
+saga.saga.jp
+shiroishi.saga.jp
+taku.saga.jp
+tara.saga.jp
+tosu.saga.jp
+yoshinogari.saga.jp
+arakawa.saitama.jp
+asaka.saitama.jp
+chichibu.saitama.jp
+fujimi.saitama.jp
+fujimino.saitama.jp
+fukaya.saitama.jp
+hanno.saitama.jp
+hanyu.saitama.jp
+hasuda.saitama.jp
+hatogaya.saitama.jp
+hatoyama.saitama.jp
+hidaka.saitama.jp
+higashichichibu.saitama.jp
+higashimatsuyama.saitama.jp
+honjo.saitama.jp
+ina.saitama.jp
+iruma.saitama.jp
+iwatsuki.saitama.jp
+kamiizumi.saitama.jp
+kamikawa.saitama.jp
+kamisato.saitama.jp
+kasukabe.saitama.jp
+kawagoe.saitama.jp
+kawaguchi.saitama.jp
+kawajima.saitama.jp
+kazo.saitama.jp
+kitamoto.saitama.jp
+koshigaya.saitama.jp
+kounosu.saitama.jp
+kuki.saitama.jp
+kumagaya.saitama.jp
+matsubushi.saitama.jp
+minano.saitama.jp
+misato.saitama.jp
+miyashiro.saitama.jp
+miyoshi.saitama.jp
+moroyama.saitama.jp
+nagatoro.saitama.jp
+namegawa.saitama.jp
+niiza.saitama.jp
+ogano.saitama.jp
+ogawa.saitama.jp
+ogose.saitama.jp
+okegawa.saitama.jp
+omiya.saitama.jp
+otaki.saitama.jp
+ranzan.saitama.jp
+ryokami.saitama.jp
+saitama.saitama.jp
+sakado.saitama.jp
+satte.saitama.jp
+sayama.saitama.jp
+shiki.saitama.jp
+shiraoka.saitama.jp
+soka.saitama.jp
+sugito.saitama.jp
+toda.saitama.jp
+tokigawa.saitama.jp
+tokorozawa.saitama.jp
+tsurugashima.saitama.jp
+urawa.saitama.jp
+warabi.saitama.jp
+yashio.saitama.jp
+yokoze.saitama.jp
+yono.saitama.jp
+yorii.saitama.jp
+yoshida.saitama.jp
+yoshikawa.saitama.jp
+yoshimi.saitama.jp
+aisho.shiga.jp
+gamo.shiga.jp
+higashiomi.shiga.jp
+hikone.shiga.jp
+koka.shiga.jp
+konan.shiga.jp
+kosei.shiga.jp
+koto.shiga.jp
+kusatsu.shiga.jp
+maibara.shiga.jp
+moriyama.shiga.jp
+nagahama.shiga.jp
+nishiazai.shiga.jp
+notogawa.shiga.jp
+omihachiman.shiga.jp
+otsu.shiga.jp
+ritto.shiga.jp
+ryuoh.shiga.jp
+takashima.shiga.jp
+takatsuki.shiga.jp
+torahime.shiga.jp
+toyosato.shiga.jp
+yasu.shiga.jp
+akagi.shimane.jp
+ama.shimane.jp
+gotsu.shimane.jp
+hamada.shimane.jp
+higashiizumo.shimane.jp
+hikawa.shimane.jp
+hikimi.shimane.jp
+izumo.shimane.jp
+kakinoki.shimane.jp
+masuda.shimane.jp
+matsue.shimane.jp
+misato.shimane.jp
+nishinoshima.shimane.jp
+ohda.shimane.jp
+okinoshima.shimane.jp
+okuizumo.shimane.jp
+shimane.shimane.jp
+tamayu.shimane.jp
+tsuwano.shimane.jp
+unnan.shimane.jp
+yakumo.shimane.jp
+yasugi.shimane.jp
+yatsuka.shimane.jp
+arai.shizuoka.jp
+atami.shizuoka.jp
+fuji.shizuoka.jp
+fujieda.shizuoka.jp
+fujikawa.shizuoka.jp
+fujinomiya.shizuoka.jp
+fukuroi.shizuoka.jp
+gotemba.shizuoka.jp
+haibara.shizuoka.jp
+hamamatsu.shizuoka.jp
+higashiizu.shizuoka.jp
+ito.shizuoka.jp
+iwata.shizuoka.jp
+izu.shizuoka.jp
+izunokuni.shizuoka.jp
+kakegawa.shizuoka.jp
+kannami.shizuoka.jp
+kawanehon.shizuoka.jp
+kawazu.shizuoka.jp
+kikugawa.shizuoka.jp
+kosai.shizuoka.jp
+makinohara.shizuoka.jp
+matsuzaki.shizuoka.jp
+minamiizu.shizuoka.jp
+mishima.shizuoka.jp
+morimachi.shizuoka.jp
+nishiizu.shizuoka.jp
+numazu.shizuoka.jp
+omaezaki.shizuoka.jp
+shimada.shizuoka.jp
+shimizu.shizuoka.jp
+shimoda.shizuoka.jp
+shizuoka.shizuoka.jp
+susono.shizuoka.jp
+yaizu.shizuoka.jp
+yoshida.shizuoka.jp
+ashikaga.tochigi.jp
+bato.tochigi.jp
+haga.tochigi.jp
+ichikai.tochigi.jp
+iwafune.tochigi.jp
+kaminokawa.tochigi.jp
+kanuma.tochigi.jp
+karasuyama.tochigi.jp
+kuroiso.tochigi.jp
+mashiko.tochigi.jp
+mibu.tochigi.jp
+moka.tochigi.jp
+motegi.tochigi.jp
+nasu.tochigi.jp
+nasushiobara.tochigi.jp
+nikko.tochigi.jp
+nishikata.tochigi.jp
+nogi.tochigi.jp
+ohira.tochigi.jp
+ohtawara.tochigi.jp
+oyama.tochigi.jp
+sakura.tochigi.jp
+sano.tochigi.jp
+shimotsuke.tochigi.jp
+shioya.tochigi.jp
+takanezawa.tochigi.jp
+tochigi.tochigi.jp
+tsuga.tochigi.jp
+ujiie.tochigi.jp
+utsunomiya.tochigi.jp
+yaita.tochigi.jp
+aizumi.tokushima.jp
+anan.tokushima.jp
+ichiba.tokushima.jp
+itano.tokushima.jp
+kainan.tokushima.jp
+komatsushima.tokushima.jp
+matsushige.tokushima.jp
+mima.tokushima.jp
+minami.tokushima.jp
+miyoshi.tokushima.jp
+mugi.tokushima.jp
+nakagawa.tokushima.jp
+naruto.tokushima.jp
+sanagochi.tokushima.jp
+shishikui.tokushima.jp
+tokushima.tokushima.jp
+wajiki.tokushima.jp
+adachi.tokyo.jp
+akiruno.tokyo.jp
+akishima.tokyo.jp
+aogashima.tokyo.jp
+arakawa.tokyo.jp
+bunkyo.tokyo.jp
+chiyoda.tokyo.jp
+chofu.tokyo.jp
+chuo.tokyo.jp
+edogawa.tokyo.jp
+fuchu.tokyo.jp
+fussa.tokyo.jp
+hachijo.tokyo.jp
+hachioji.tokyo.jp
+hamura.tokyo.jp
+higashikurume.tokyo.jp
+higashimurayama.tokyo.jp
+higashiyamato.tokyo.jp
+hino.tokyo.jp
+hinode.tokyo.jp
+hinohara.tokyo.jp
+inagi.tokyo.jp
+itabashi.tokyo.jp
+katsushika.tokyo.jp
+kita.tokyo.jp
+kiyose.tokyo.jp
+kodaira.tokyo.jp
+koganei.tokyo.jp
+kokubunji.tokyo.jp
+komae.tokyo.jp
+koto.tokyo.jp
+kouzushima.tokyo.jp
+kunitachi.tokyo.jp
+machida.tokyo.jp
+meguro.tokyo.jp
+minato.tokyo.jp
+mitaka.tokyo.jp
+mizuho.tokyo.jp
+musashimurayama.tokyo.jp
+musashino.tokyo.jp
+nakano.tokyo.jp
+nerima.tokyo.jp
+ogasawara.tokyo.jp
+okutama.tokyo.jp
+ome.tokyo.jp
+oshima.tokyo.jp
+ota.tokyo.jp
+setagaya.tokyo.jp
+shibuya.tokyo.jp
+shinagawa.tokyo.jp
+shinjuku.tokyo.jp
+suginami.tokyo.jp
+sumida.tokyo.jp
+tachikawa.tokyo.jp
+taito.tokyo.jp
+tama.tokyo.jp
+toshima.tokyo.jp
+chizu.tottori.jp
+hino.tottori.jp
+kawahara.tottori.jp
+koge.tottori.jp
+kotoura.tottori.jp
+misasa.tottori.jp
+nanbu.tottori.jp
+nichinan.tottori.jp
+sakaiminato.tottori.jp
+tottori.tottori.jp
+wakasa.tottori.jp
+yazu.tottori.jp
+yonago.tottori.jp
+asahi.toyama.jp
+fuchu.toyama.jp
+fukumitsu.toyama.jp
+funahashi.toyama.jp
+himi.toyama.jp
+imizu.toyama.jp
+inami.toyama.jp
+johana.toyama.jp
+kamiichi.toyama.jp
+kurobe.toyama.jp
+nakaniikawa.toyama.jp
+namerikawa.toyama.jp
+nanto.toyama.jp
+nyuzen.toyama.jp
+oyabe.toyama.jp
+taira.toyama.jp
+takaoka.toyama.jp
+tateyama.toyama.jp
+toga.toyama.jp
+tonami.toyama.jp
+toyama.toyama.jp
+unazuki.toyama.jp
+uozu.toyama.jp
+yamada.toyama.jp
+arida.wakayama.jp
+aridagawa.wakayama.jp
+gobo.wakayama.jp
+hashimoto.wakayama.jp
+hidaka.wakayama.jp
+hirogawa.wakayama.jp
+inami.wakayama.jp
+iwade.wakayama.jp
+kainan.wakayama.jp
+kamitonda.wakayama.jp
+katsuragi.wakayama.jp
+kimino.wakayama.jp
+kinokawa.wakayama.jp
+kitayama.wakayama.jp
+koya.wakayama.jp
+koza.wakayama.jp
+kozagawa.wakayama.jp
+kudoyama.wakayama.jp
+kushimoto.wakayama.jp
+mihama.wakayama.jp
+misato.wakayama.jp
+nachikatsuura.wakayama.jp
+shingu.wakayama.jp
+shirahama.wakayama.jp
+taiji.wakayama.jp
+tanabe.wakayama.jp
+wakayama.wakayama.jp
+yuasa.wakayama.jp
+yura.wakayama.jp
+asahi.yamagata.jp
+funagata.yamagata.jp
+higashine.yamagata.jp
+iide.yamagata.jp
+kahoku.yamagata.jp
+kaminoyama.yamagata.jp
+kaneyama.yamagata.jp
+kawanishi.yamagata.jp
+mamurogawa.yamagata.jp
+mikawa.yamagata.jp
+murayama.yamagata.jp
+nagai.yamagata.jp
+nakayama.yamagata.jp
+nanyo.yamagata.jp
+nishikawa.yamagata.jp
+obanazawa.yamagata.jp
+oe.yamagata.jp
+oguni.yamagata.jp
+ohkura.yamagata.jp
+oishida.yamagata.jp
+sagae.yamagata.jp
+sakata.yamagata.jp
+sakegawa.yamagata.jp
+shinjo.yamagata.jp
+shirataka.yamagata.jp
+shonai.yamagata.jp
+takahata.yamagata.jp
+tendo.yamagata.jp
+tozawa.yamagata.jp
+tsuruoka.yamagata.jp
+yamagata.yamagata.jp
+yamanobe.yamagata.jp
+yonezawa.yamagata.jp
+yuza.yamagata.jp
+abu.yamaguchi.jp
+hagi.yamaguchi.jp
+hikari.yamaguchi.jp
+hofu.yamaguchi.jp
+iwakuni.yamaguchi.jp
+kudamatsu.yamaguchi.jp
+mitou.yamaguchi.jp
+nagato.yamaguchi.jp
+oshima.yamaguchi.jp
+shimonoseki.yamaguchi.jp
+shunan.yamaguchi.jp
+tabuse.yamaguchi.jp
+tokuyama.yamaguchi.jp
+toyota.yamaguchi.jp
+ube.yamaguchi.jp
+yuu.yamaguchi.jp
+chuo.yamanashi.jp
+doshi.yamanashi.jp
+fuefuki.yamanashi.jp
+fujikawa.yamanashi.jp
+fujikawaguchiko.yamanashi.jp
+fujiyoshida.yamanashi.jp
+hayakawa.yamanashi.jp
+hokuto.yamanashi.jp
+ichikawamisato.yamanashi.jp
+kai.yamanashi.jp
+kofu.yamanashi.jp
+koshu.yamanashi.jp
+kosuge.yamanashi.jp
+minami-alps.yamanashi.jp
+minobu.yamanashi.jp
+nakamichi.yamanashi.jp
+nanbu.yamanashi.jp
+narusawa.yamanashi.jp
+nirasaki.yamanashi.jp
+nishikatsura.yamanashi.jp
+oshino.yamanashi.jp
+otsuki.yamanashi.jp
+showa.yamanashi.jp
+tabayama.yamanashi.jp
+tsuru.yamanashi.jp
+uenohara.yamanashi.jp
+yamanakako.yamanashi.jp
+yamanashi.yamanashi.jp
+
+// ke : http://www.kenic.or.ke/index.php?option=com_content&task=view&id=117&Itemid=145
+*.ke
+
+// kg : http://www.domain.kg/dmn_n.html
+kg
+org.kg
+net.kg
+com.kg
+edu.kg
+gov.kg
+mil.kg
+
+// kh : http://www.mptc.gov.kh/dns_registration.htm
+*.kh
+
+// ki : http://www.ki/dns/index.html
+ki
+edu.ki
+biz.ki
+net.ki
+org.ki
+gov.ki
+info.ki
+com.ki
+
+// km : https://en.wikipedia.org/wiki/.km
+// http://www.domaine.km/documents/charte.doc
+km
+org.km
+nom.km
+gov.km
+prd.km
+tm.km
+edu.km
+mil.km
+ass.km
+com.km
+// These are only mentioned as proposed suggestions at domaine.km, but
+// https://en.wikipedia.org/wiki/.km says they're available for registration:
+coop.km
+asso.km
+presse.km
+medecin.km
+notaires.km
+pharmaciens.km
+veterinaire.km
+gouv.km
+
+// kn : https://en.wikipedia.org/wiki/.kn
+// http://www.dot.kn/domainRules.html
+kn
+net.kn
+org.kn
+edu.kn
+gov.kn
+
+// kp : http://www.kcce.kp/en_index.php
+kp
+com.kp
+edu.kp
+gov.kp
+org.kp
+rep.kp
+tra.kp
+
+// kr : https://en.wikipedia.org/wiki/.kr
+// see also: http://domain.nida.or.kr/eng/registration.jsp
+kr
+ac.kr
+co.kr
+es.kr
+go.kr
+hs.kr
+kg.kr
+mil.kr
+ms.kr
+ne.kr
+or.kr
+pe.kr
+re.kr
+sc.kr
+// kr geographical names
+busan.kr
+chungbuk.kr
+chungnam.kr
+daegu.kr
+daejeon.kr
+gangwon.kr
+gwangju.kr
+gyeongbuk.kr
+gyeonggi.kr
+gyeongnam.kr
+incheon.kr
+jeju.kr
+jeonbuk.kr
+jeonnam.kr
+seoul.kr
+ulsan.kr
+
+// kw : https://en.wikipedia.org/wiki/.kw
+*.kw
+
+// ky : http://www.icta.ky/da_ky_reg_dom.php
+// Confirmed by registry <kysupport@perimeterusa.com> 2008-06-17
+ky
+edu.ky
+gov.ky
+com.ky
+org.ky
+net.ky
+
+// kz : https://en.wikipedia.org/wiki/.kz
+// see also: http://www.nic.kz/rules/index.jsp
+kz
+org.kz
+edu.kz
+net.kz
+gov.kz
+mil.kz
+com.kz
+
+// la : https://en.wikipedia.org/wiki/.la
+// Submitted by registry <gavin.brown@nic.la>
+la
+int.la
+net.la
+info.la
+edu.la
+gov.la
+per.la
+com.la
+org.la
+
+// lb : https://en.wikipedia.org/wiki/.lb
+// Submitted by registry <randy@psg.com>
+lb
+com.lb
+edu.lb
+gov.lb
+net.lb
+org.lb
+
+// lc : https://en.wikipedia.org/wiki/.lc
+// see also: http://www.nic.lc/rules.htm
+lc
+com.lc
+net.lc
+co.lc
+org.lc
+edu.lc
+gov.lc
+
+// li : https://en.wikipedia.org/wiki/.li
+li
+
+// lk : http://www.nic.lk/seclevpr.html
+lk
+gov.lk
+sch.lk
+net.lk
+int.lk
+com.lk
+org.lk
+edu.lk
+ngo.lk
+soc.lk
+web.lk
+ltd.lk
+assn.lk
+grp.lk
+hotel.lk
+ac.lk
+
+// lr : http://psg.com/dns/lr/lr.txt
+// Submitted by registry <randy@psg.com>
+lr
+com.lr
+edu.lr
+gov.lr
+org.lr
+net.lr
+
+// ls : https://en.wikipedia.org/wiki/.ls
+ls
+co.ls
+org.ls
+
+// lt : https://en.wikipedia.org/wiki/.lt
+lt
+// gov.lt : http://www.gov.lt/index_en.php
+gov.lt
+
+// lu : http://www.dns.lu/en/
+lu
+
+// lv : http://www.nic.lv/DNS/En/generic.php
+lv
+com.lv
+edu.lv
+gov.lv
+org.lv
+mil.lv
+id.lv
+net.lv
+asn.lv
+conf.lv
+
+// ly : http://www.nic.ly/regulations.php
+ly
+com.ly
+net.ly
+gov.ly
+plc.ly
+edu.ly
+sch.ly
+med.ly
+org.ly
+id.ly
+
+// ma : https://en.wikipedia.org/wiki/.ma
+// http://www.anrt.ma/fr/admin/download/upload/file_fr782.pdf
+ma
+co.ma
+net.ma
+gov.ma
+org.ma
+ac.ma
+press.ma
+
+// mc : http://www.nic.mc/
+mc
+tm.mc
+asso.mc
+
+// md : https://en.wikipedia.org/wiki/.md
+md
+
+// me : https://en.wikipedia.org/wiki/.me
+me
+co.me
+net.me
+org.me
+edu.me
+ac.me
+gov.me
+its.me
+priv.me
+
+// mg : http://nic.mg/nicmg/?page_id=39
+mg
+org.mg
+nom.mg
+gov.mg
+prd.mg
+tm.mg
+edu.mg
+mil.mg
+com.mg
+co.mg
+
+// mh : https://en.wikipedia.org/wiki/.mh
+mh
+
+// mil : https://en.wikipedia.org/wiki/.mil
+mil
+
+// mk : https://en.wikipedia.org/wiki/.mk
+// see also: http://dns.marnet.net.mk/postapka.php
+mk
+com.mk
+org.mk
+net.mk
+edu.mk
+gov.mk
+inf.mk
+name.mk
+
+// ml : http://www.gobin.info/domainname/ml-template.doc
+// see also: https://en.wikipedia.org/wiki/.ml
+ml
+com.ml
+edu.ml
+gouv.ml
+gov.ml
+net.ml
+org.ml
+presse.ml
+
+// mm : https://en.wikipedia.org/wiki/.mm
+*.mm
+
+// mn : https://en.wikipedia.org/wiki/.mn
+mn
+gov.mn
+edu.mn
+org.mn
+
+// mo : http://www.monic.net.mo/
+mo
+com.mo
+net.mo
+org.mo
+edu.mo
+gov.mo
+
+// mobi : https://en.wikipedia.org/wiki/.mobi
+mobi
+
+// mp : http://www.dot.mp/
+// Confirmed by registry <dcamacho@saipan.com> 2008-06-17
+mp
+
+// mq : https://en.wikipedia.org/wiki/.mq
+mq
+
+// mr : https://en.wikipedia.org/wiki/.mr
+mr
+gov.mr
+
+// ms : http://www.nic.ms/pdf/MS_Domain_Name_Rules.pdf
+ms
+com.ms
+edu.ms
+gov.ms
+net.ms
+org.ms
+
+// mt : https://www.nic.org.mt/go/policy
+// Submitted by registry <help@nic.org.mt>
+mt
+com.mt
+edu.mt
+net.mt
+org.mt
+
+// mu : https://en.wikipedia.org/wiki/.mu
+mu
+com.mu
+net.mu
+org.mu
+gov.mu
+ac.mu
+co.mu
+or.mu
+
+// museum : http://about.museum/naming/
+// http://index.museum/
+museum
+academy.museum
+agriculture.museum
+air.museum
+airguard.museum
+alabama.museum
+alaska.museum
+amber.museum
+ambulance.museum
+american.museum
+americana.museum
+americanantiques.museum
+americanart.museum
+amsterdam.museum
+and.museum
+annefrank.museum
+anthro.museum
+anthropology.museum
+antiques.museum
+aquarium.museum
+arboretum.museum
+archaeological.museum
+archaeology.museum
+architecture.museum
+art.museum
+artanddesign.museum
+artcenter.museum
+artdeco.museum
+arteducation.museum
+artgallery.museum
+arts.museum
+artsandcrafts.museum
+asmatart.museum
+assassination.museum
+assisi.museum
+association.museum
+astronomy.museum
+atlanta.museum
+austin.museum
+australia.museum
+automotive.museum
+aviation.museum
+axis.museum
+badajoz.museum
+baghdad.museum
+bahn.museum
+bale.museum
+baltimore.museum
+barcelona.museum
+baseball.museum
+basel.museum
+baths.museum
+bauern.museum
+beauxarts.museum
+beeldengeluid.museum
+bellevue.museum
+bergbau.museum
+berkeley.museum
+berlin.museum
+bern.museum
+bible.museum
+bilbao.museum
+bill.museum
+birdart.museum
+birthplace.museum
+bonn.museum
+boston.museum
+botanical.museum
+botanicalgarden.museum
+botanicgarden.museum
+botany.museum
+brandywinevalley.museum
+brasil.museum
+bristol.museum
+british.museum
+britishcolumbia.museum
+broadcast.museum
+brunel.museum
+brussel.museum
+brussels.museum
+bruxelles.museum
+building.museum
+burghof.museum
+bus.museum
+bushey.museum
+cadaques.museum
+california.museum
+cambridge.museum
+can.museum
+canada.museum
+capebreton.museum
+carrier.museum
+cartoonart.museum
+casadelamoneda.museum
+castle.museum
+castres.museum
+celtic.museum
+center.museum
+chattanooga.museum
+cheltenham.museum
+chesapeakebay.museum
+chicago.museum
+children.museum
+childrens.museum
+childrensgarden.museum
+chiropractic.museum
+chocolate.museum
+christiansburg.museum
+cincinnati.museum
+cinema.museum
+circus.museum
+civilisation.museum
+civilization.museum
+civilwar.museum
+clinton.museum
+clock.museum
+coal.museum
+coastaldefence.museum
+cody.museum
+coldwar.museum
+collection.museum
+colonialwilliamsburg.museum
+coloradoplateau.museum
+columbia.museum
+columbus.museum
+communication.museum
+communications.museum
+community.museum
+computer.museum
+computerhistory.museum
+xn--comunicaes-v6a2o.museum
+comunicações.museum
+contemporary.museum
+contemporaryart.museum
+convent.museum
+copenhagen.museum
+corporation.museum
+xn--correios-e-telecomunicaes-ghc29a.museum
+correios-e-telecomunicações.museum
+corvette.museum
+costume.museum
+countryestate.museum
+county.museum
+crafts.museum
+cranbrook.museum
+creation.museum
+cultural.museum
+culturalcenter.museum
+culture.museum
+cyber.museum
+cymru.museum
+dali.museum
+dallas.museum
+database.museum
+ddr.museum
+decorativearts.museum
+delaware.museum
+delmenhorst.museum
+denmark.museum
+depot.museum
+design.museum
+detroit.museum
+dinosaur.museum
+discovery.museum
+dolls.museum
+donostia.museum
+durham.museum
+eastafrica.museum
+eastcoast.museum
+education.museum
+educational.museum
+egyptian.museum
+eisenbahn.museum
+elburg.museum
+elvendrell.museum
+embroidery.museum
+encyclopedic.museum
+england.museum
+entomology.museum
+environment.museum
+environmentalconservation.museum
+epilepsy.museum
+essex.museum
+estate.museum
+ethnology.museum
+exeter.museum
+exhibition.museum
+family.museum
+farm.museum
+farmequipment.museum
+farmers.museum
+farmstead.museum
+field.museum
+figueres.museum
+filatelia.museum
+film.museum
+fineart.museum
+finearts.museum
+finland.museum
+flanders.museum
+florida.museum
+force.museum
+fortmissoula.museum
+fortworth.museum
+foundation.museum
+francaise.museum
+frankfurt.museum
+franziskaner.museum
+freemasonry.museum
+freiburg.museum
+fribourg.museum
+frog.museum
+fundacio.museum
+furniture.museum
+gallery.museum
+garden.museum
+gateway.museum
+geelvinck.museum
+gemological.museum
+geology.museum
+georgia.museum
+giessen.museum
+glas.museum
+glass.museum
+gorge.museum
+grandrapids.museum
+graz.museum
+guernsey.museum
+halloffame.museum
+hamburg.museum
+handson.museum
+harvestcelebration.museum
+hawaii.museum
+health.museum
+heimatunduhren.museum
+hellas.museum
+helsinki.museum
+hembygdsforbund.museum
+heritage.museum
+histoire.museum
+historical.museum
+historicalsociety.museum
+historichouses.museum
+historisch.museum
+historisches.museum
+history.museum
+historyofscience.museum
+horology.museum
+house.museum
+humanities.museum
+illustration.museum
+imageandsound.museum
+indian.museum
+indiana.museum
+indianapolis.museum
+indianmarket.museum
+intelligence.museum
+interactive.museum
+iraq.museum
+iron.museum
+isleofman.museum
+jamison.museum
+jefferson.museum
+jerusalem.museum
+jewelry.museum
+jewish.museum
+jewishart.museum
+jfk.museum
+journalism.museum
+judaica.museum
+judygarland.museum
+juedisches.museum
+juif.museum
+karate.museum
+karikatur.museum
+kids.museum
+koebenhavn.museum
+koeln.museum
+kunst.museum
+kunstsammlung.museum
+kunstunddesign.museum
+labor.museum
+labour.museum
+lajolla.museum
+lancashire.museum
+landes.museum
+lans.museum
+xn--lns-qla.museum
+läns.museum
+larsson.museum
+lewismiller.museum
+lincoln.museum
+linz.museum
+living.museum
+livinghistory.museum
+localhistory.museum
+london.museum
+losangeles.museum
+louvre.museum
+loyalist.museum
+lucerne.museum
+luxembourg.museum
+luzern.museum
+mad.museum
+madrid.museum
+mallorca.museum
+manchester.museum
+mansion.museum
+mansions.museum
+manx.museum
+marburg.museum
+maritime.museum
+maritimo.museum
+maryland.museum
+marylhurst.museum
+media.museum
+medical.museum
+medizinhistorisches.museum
+meeres.museum
+memorial.museum
+mesaverde.museum
+michigan.museum
+midatlantic.museum
+military.museum
+mill.museum
+miners.museum
+mining.museum
+minnesota.museum
+missile.museum
+missoula.museum
+modern.museum
+moma.museum
+money.museum
+monmouth.museum
+monticello.museum
+montreal.museum
+moscow.museum
+motorcycle.museum
+muenchen.museum
+muenster.museum
+mulhouse.museum
+muncie.museum
+museet.museum
+museumcenter.museum
+museumvereniging.museum
+music.museum
+national.museum
+nationalfirearms.museum
+nationalheritage.museum
+nativeamerican.museum
+naturalhistory.museum
+naturalhistorymuseum.museum
+naturalsciences.museum
+nature.museum
+naturhistorisches.museum
+natuurwetenschappen.museum
+naumburg.museum
+naval.museum
+nebraska.museum
+neues.museum
+newhampshire.museum
+newjersey.museum
+newmexico.museum
+newport.museum
+newspaper.museum
+newyork.museum
+niepce.museum
+norfolk.museum
+north.museum
+nrw.museum
+nuernberg.museum
+nuremberg.museum
+nyc.museum
+nyny.museum
+oceanographic.museum
+oceanographique.museum
+omaha.museum
+online.museum
+ontario.museum
+openair.museum
+oregon.museum
+oregontrail.museum
+otago.museum
+oxford.museum
+pacific.museum
+paderborn.museum
+palace.museum
+paleo.museum
+palmsprings.museum
+panama.museum
+paris.museum
+pasadena.museum
+pharmacy.museum
+philadelphia.museum
+philadelphiaarea.museum
+philately.museum
+phoenix.museum
+photography.museum
+pilots.museum
+pittsburgh.museum
+planetarium.museum
+plantation.museum
+plants.museum
+plaza.museum
+portal.museum
+portland.museum
+portlligat.museum
+posts-and-telecommunications.museum
+preservation.museum
+presidio.museum
+press.museum
+project.museum
+public.museum
+pubol.museum
+quebec.museum
+railroad.museum
+railway.museum
+research.museum
+resistance.museum
+riodejaneiro.museum
+rochester.museum
+rockart.museum
+roma.museum
+russia.museum
+saintlouis.museum
+salem.museum
+salvadordali.museum
+salzburg.museum
+sandiego.museum
+sanfrancisco.museum
+santabarbara.museum
+santacruz.museum
+santafe.museum
+saskatchewan.museum
+satx.museum
+savannahga.museum
+schlesisches.museum
+schoenbrunn.museum
+schokoladen.museum
+school.museum
+schweiz.museum
+science.museum
+scienceandhistory.museum
+scienceandindustry.museum
+sciencecenter.museum
+sciencecenters.museum
+science-fiction.museum
+sciencehistory.museum
+sciences.museum
+sciencesnaturelles.museum
+scotland.museum
+seaport.museum
+settlement.museum
+settlers.museum
+shell.museum
+sherbrooke.museum
+sibenik.museum
+silk.museum
+ski.museum
+skole.museum
+society.museum
+sologne.museum
+soundandvision.museum
+southcarolina.museum
+southwest.museum
+space.museum
+spy.museum
+square.museum
+stadt.museum
+stalbans.museum
+starnberg.museum
+state.museum
+stateofdelaware.museum
+station.museum
+steam.museum
+steiermark.museum
+stjohn.museum
+stockholm.museum
+stpetersburg.museum
+stuttgart.museum
+suisse.museum
+surgeonshall.museum
+surrey.museum
+svizzera.museum
+sweden.museum
+sydney.museum
+tank.museum
+tcm.museum
+technology.museum
+telekommunikation.museum
+television.museum
+texas.museum
+textile.museum
+theater.museum
+time.museum
+timekeeping.museum
+topology.museum
+torino.museum
+touch.museum
+town.museum
+transport.museum
+tree.museum
+trolley.museum
+trust.museum
+trustee.museum
+uhren.museum
+ulm.museum
+undersea.museum
+university.museum
+usa.museum
+usantiques.museum
+usarts.museum
+uscountryestate.museum
+usculture.museum
+usdecorativearts.museum
+usgarden.museum
+ushistory.museum
+ushuaia.museum
+uslivinghistory.museum
+utah.museum
+uvic.museum
+valley.museum
+vantaa.museum
+versailles.museum
+viking.museum
+village.museum
+virginia.museum
+virtual.museum
+virtuel.museum
+vlaanderen.museum
+volkenkunde.museum
+wales.museum
+wallonie.museum
+war.museum
+washingtondc.museum
+watchandclock.museum
+watch-and-clock.museum
+western.museum
+westfalen.museum
+whaling.museum
+wildlife.museum
+williamsburg.museum
+windmill.museum
+workshop.museum
+york.museum
+yorkshire.museum
+yosemite.museum
+youth.museum
+zoological.museum
+zoology.museum
+xn--9dbhblg6di.museum
+ירושלים.museum
+xn--h1aegh.museum
+иком.museum
+
+// mv : https://en.wikipedia.org/wiki/.mv
+// "mv" included because, contra Wikipedia, google.mv exists.
+mv
+aero.mv
+biz.mv
+com.mv
+coop.mv
+edu.mv
+gov.mv
+info.mv
+int.mv
+mil.mv
+museum.mv
+name.mv
+net.mv
+org.mv
+pro.mv
+
+// mw : http://www.registrar.mw/
+mw
+ac.mw
+biz.mw
+co.mw
+com.mw
+coop.mw
+edu.mw
+gov.mw
+int.mw
+museum.mw
+net.mw
+org.mw
+
+// mx : http://www.nic.mx/
+// Submitted by registry <farias@nic.mx>
+mx
+com.mx
+org.mx
+gob.mx
+edu.mx
+net.mx
+
+// my : http://www.mynic.net.my/
+my
+com.my
+net.my
+org.my
+gov.my
+edu.my
+mil.my
+name.my
+
+// mz : http://www.uem.mz/
+// Submitted by registry <antonio@uem.mz>
+mz
+ac.mz
+adv.mz
+co.mz
+edu.mz
+gov.mz
+mil.mz
+net.mz
+org.mz
+
+// na : http://www.na-nic.com.na/
+// http://www.info.na/domain/
+na
+info.na
+pro.na
+name.na
+school.na
+or.na
+dr.na
+us.na
+mx.na
+ca.na
+in.na
+cc.na
+tv.na
+ws.na
+mobi.na
+co.na
+com.na
+org.na
+
+// name : has 2nd-level tlds, but there's no list of them
+name
+
+// nc : http://www.cctld.nc/
+nc
+asso.nc
+
+// ne : https://en.wikipedia.org/wiki/.ne
+ne
+
+// net : https://en.wikipedia.org/wiki/.net
+net
+
+// nf : https://en.wikipedia.org/wiki/.nf
+nf
+com.nf
+net.nf
+per.nf
+rec.nf
+web.nf
+arts.nf
+firm.nf
+info.nf
+other.nf
+store.nf
+
+// ng : http://www.nira.org.ng/index.php/join-us/register-ng-domain/189-nira-slds
+ng
+com.ng
+edu.ng
+gov.ng
+i.ng
+mil.ng
+mobi.ng
+name.ng
+net.ng
+org.ng
+sch.ng
+
+// ni : http://www.nic.ni/
+ni
+ac.ni
+biz.ni
+co.ni
+com.ni
+edu.ni
+gob.ni
+in.ni
+info.ni
+int.ni
+mil.ni
+net.ni
+nom.ni
+org.ni
+web.ni
+
+// nl : https://en.wikipedia.org/wiki/.nl
+//      https://www.sidn.nl/
+//      ccTLD for the Netherlands
+nl
+
+// BV.nl will be a registry for dutch BV's (besloten vennootschap)
+bv.nl
+
+// no : http://www.norid.no/regelverk/index.en.html
+// The Norwegian registry has declined to notify us of updates. The web pages
+// referenced below are the official source of the data. There is also an
+// announce mailing list:
+// https://postlister.uninett.no/sympa/info/norid-diskusjon
+no
+// Norid generic domains : http://www.norid.no/regelverk/vedlegg-c.en.html
+fhs.no
+vgs.no
+fylkesbibl.no
+folkebibl.no
+museum.no
+idrett.no
+priv.no
+// Non-Norid generic domains : http://www.norid.no/regelverk/vedlegg-d.en.html
+mil.no
+stat.no
+dep.no
+kommune.no
+herad.no
+// no geographical names : http://www.norid.no/regelverk/vedlegg-b.en.html
+// counties
+aa.no
+ah.no
+bu.no
+fm.no
+hl.no
+hm.no
+jan-mayen.no
+mr.no
+nl.no
+nt.no
+of.no
+ol.no
+oslo.no
+rl.no
+sf.no
+st.no
+svalbard.no
+tm.no
+tr.no
+va.no
+vf.no
+// primary and lower secondary schools per county
+gs.aa.no
+gs.ah.no
+gs.bu.no
+gs.fm.no
+gs.hl.no
+gs.hm.no
+gs.jan-mayen.no
+gs.mr.no
+gs.nl.no
+gs.nt.no
+gs.of.no
+gs.ol.no
+gs.oslo.no
+gs.rl.no
+gs.sf.no
+gs.st.no
+gs.svalbard.no
+gs.tm.no
+gs.tr.no
+gs.va.no
+gs.vf.no
+// cities
+akrehamn.no
+xn--krehamn-dxa.no
+åkrehamn.no
+algard.no
+xn--lgrd-poac.no
+ålgård.no
+arna.no
+brumunddal.no
+bryne.no
+bronnoysund.no
+xn--brnnysund-m8ac.no
+brønnøysund.no
+drobak.no
+xn--drbak-wua.no
+drøbak.no
+egersund.no
+fetsund.no
+floro.no
+xn--flor-jra.no
+florø.no
+fredrikstad.no
+hokksund.no
+honefoss.no
+xn--hnefoss-q1a.no
+hønefoss.no
+jessheim.no
+jorpeland.no
+xn--jrpeland-54a.no
+jørpeland.no
+kirkenes.no
+kopervik.no
+krokstadelva.no
+langevag.no
+xn--langevg-jxa.no
+langevåg.no
+leirvik.no
+mjondalen.no
+xn--mjndalen-64a.no
+mjøndalen.no
+mo-i-rana.no
+mosjoen.no
+xn--mosjen-eya.no
+mosjøen.no
+nesoddtangen.no
+orkanger.no
+osoyro.no
+xn--osyro-wua.no
+osøyro.no
+raholt.no
+xn--rholt-mra.no
+råholt.no
+sandnessjoen.no
+xn--sandnessjen-ogb.no
+sandnessjøen.no
+skedsmokorset.no
+slattum.no
+spjelkavik.no
+stathelle.no
+stavern.no
+stjordalshalsen.no
+xn--stjrdalshalsen-sqb.no
+stjørdalshalsen.no
+tananger.no
+tranby.no
+vossevangen.no
+// communities
+afjord.no
+xn--fjord-lra.no
+åfjord.no
+agdenes.no
+al.no
+xn--l-1fa.no
+ål.no
+alesund.no
+xn--lesund-hua.no
+ålesund.no
+alstahaug.no
+alta.no
+xn--lt-liac.no
+áltá.no
+alaheadju.no
+xn--laheadju-7ya.no
+álaheadju.no
+alvdal.no
+amli.no
+xn--mli-tla.no
+åmli.no
+amot.no
+xn--mot-tla.no
+åmot.no
+andebu.no
+andoy.no
+xn--andy-ira.no
+andøy.no
+andasuolo.no
+ardal.no
+xn--rdal-poa.no
+årdal.no
+aremark.no
+arendal.no
+xn--s-1fa.no
+ås.no
+aseral.no
+xn--seral-lra.no
+åseral.no
+asker.no
+askim.no
+askvoll.no
+askoy.no
+xn--asky-ira.no
+askøy.no
+asnes.no
+xn--snes-poa.no
+åsnes.no
+audnedaln.no
+aukra.no
+aure.no
+aurland.no
+aurskog-holand.no
+xn--aurskog-hland-jnb.no
+aurskog-høland.no
+austevoll.no
+austrheim.no
+averoy.no
+xn--avery-yua.no
+averøy.no
+balestrand.no
+ballangen.no
+balat.no
+xn--blt-elab.no
+bálát.no
+balsfjord.no
+bahccavuotna.no
+xn--bhccavuotna-k7a.no
+báhccavuotna.no
+bamble.no
+bardu.no
+beardu.no
+beiarn.no
+bajddar.no
+xn--bjddar-pta.no
+bájddar.no
+baidar.no
+xn--bidr-5nac.no
+báidár.no
+berg.no
+bergen.no
+berlevag.no
+xn--berlevg-jxa.no
+berlevåg.no
+bearalvahki.no
+xn--bearalvhki-y4a.no
+bearalváhki.no
+bindal.no
+birkenes.no
+bjarkoy.no
+xn--bjarky-fya.no
+bjarkøy.no
+bjerkreim.no
+bjugn.no
+bodo.no
+xn--bod-2na.no
+bodø.no
+badaddja.no
+xn--bdddj-mrabd.no
+bådåddjå.no
+budejju.no
+bokn.no
+bremanger.no
+bronnoy.no
+xn--brnny-wuac.no
+brønnøy.no
+bygland.no
+bykle.no
+barum.no
+xn--brum-voa.no
+bærum.no
+bo.telemark.no
+xn--b-5ga.telemark.no
+bø.telemark.no
+bo.nordland.no
+xn--b-5ga.nordland.no
+bø.nordland.no
+bievat.no
+xn--bievt-0qa.no
+bievát.no
+bomlo.no
+xn--bmlo-gra.no
+bømlo.no
+batsfjord.no
+xn--btsfjord-9za.no
+båtsfjord.no
+bahcavuotna.no
+xn--bhcavuotna-s4a.no
+báhcavuotna.no
+dovre.no
+drammen.no
+drangedal.no
+dyroy.no
+xn--dyry-ira.no
+dyrøy.no
+donna.no
+xn--dnna-gra.no
+dønna.no
+eid.no
+eidfjord.no
+eidsberg.no
+eidskog.no
+eidsvoll.no
+eigersund.no
+elverum.no
+enebakk.no
+engerdal.no
+etne.no
+etnedal.no
+evenes.no
+evenassi.no
+xn--eveni-0qa01ga.no
+evenášši.no
+evje-og-hornnes.no
+farsund.no
+fauske.no
+fuossko.no
+fuoisku.no
+fedje.no
+fet.no
+finnoy.no
+xn--finny-yua.no
+finnøy.no
+fitjar.no
+fjaler.no
+fjell.no
+flakstad.no
+flatanger.no
+flekkefjord.no
+flesberg.no
+flora.no
+fla.no
+xn--fl-zia.no
+flå.no
+folldal.no
+forsand.no
+fosnes.no
+frei.no
+frogn.no
+froland.no
+frosta.no
+frana.no
+xn--frna-woa.no
+fræna.no
+froya.no
+xn--frya-hra.no
+frøya.no
+fusa.no
+fyresdal.no
+forde.no
+xn--frde-gra.no
+førde.no
+gamvik.no
+gangaviika.no
+xn--ggaviika-8ya47h.no
+gáŋgaviika.no
+gaular.no
+gausdal.no
+gildeskal.no
+xn--gildeskl-g0a.no
+gildeskål.no
+giske.no
+gjemnes.no
+gjerdrum.no
+gjerstad.no
+gjesdal.no
+gjovik.no
+xn--gjvik-wua.no
+gjøvik.no
+gloppen.no
+gol.no
+gran.no
+grane.no
+granvin.no
+gratangen.no
+grimstad.no
+grong.no
+kraanghke.no
+xn--kranghke-b0a.no
+kråanghke.no
+grue.no
+gulen.no
+hadsel.no
+halden.no
+halsa.no
+hamar.no
+hamaroy.no
+habmer.no
+xn--hbmer-xqa.no
+hábmer.no
+hapmir.no
+xn--hpmir-xqa.no
+hápmir.no
+hammerfest.no
+hammarfeasta.no
+xn--hmmrfeasta-s4ac.no
+hámmárfeasta.no
+haram.no
+hareid.no
+harstad.no
+hasvik.no
+aknoluokta.no
+xn--koluokta-7ya57h.no
+ákŋoluokta.no
+hattfjelldal.no
+aarborte.no
+haugesund.no
+hemne.no
+hemnes.no
+hemsedal.no
+heroy.more-og-romsdal.no
+xn--hery-ira.xn--mre-og-romsdal-qqb.no
+herøy.møre-og-romsdal.no
+heroy.nordland.no
+xn--hery-ira.nordland.no
+herøy.nordland.no
+hitra.no
+hjartdal.no
+hjelmeland.no
+hobol.no
+xn--hobl-ira.no
+hobøl.no
+hof.no
+hol.no
+hole.no
+holmestrand.no
+holtalen.no
+xn--holtlen-hxa.no
+holtålen.no
+hornindal.no
+horten.no
+hurdal.no
+hurum.no
+hvaler.no
+hyllestad.no
+hagebostad.no
+xn--hgebostad-g3a.no
+hægebostad.no
+hoyanger.no
+xn--hyanger-q1a.no
+høyanger.no
+hoylandet.no
+xn--hylandet-54a.no
+høylandet.no
+ha.no
+xn--h-2fa.no
+hå.no
+ibestad.no
+inderoy.no
+xn--indery-fya.no
+inderøy.no
+iveland.no
+jevnaker.no
+jondal.no
+jolster.no
+xn--jlster-bya.no
+jølster.no
+karasjok.no
+karasjohka.no
+xn--krjohka-hwab49j.no
+kárášjohka.no
+karlsoy.no
+galsa.no
+xn--gls-elac.no
+gálsá.no
+karmoy.no
+xn--karmy-yua.no
+karmøy.no
+kautokeino.no
+guovdageaidnu.no
+klepp.no
+klabu.no
+xn--klbu-woa.no
+klæbu.no
+kongsberg.no
+kongsvinger.no
+kragero.no
+xn--krager-gya.no
+kragerø.no
+kristiansand.no
+kristiansund.no
+krodsherad.no
+xn--krdsherad-m8a.no
+krødsherad.no
+kvalsund.no
+rahkkeravju.no
+xn--rhkkervju-01af.no
+ráhkkerávju.no
+kvam.no
+kvinesdal.no
+kvinnherad.no
+kviteseid.no
+kvitsoy.no
+xn--kvitsy-fya.no
+kvitsøy.no
+kvafjord.no
+xn--kvfjord-nxa.no
+kvæfjord.no
+giehtavuoatna.no
+kvanangen.no
+xn--kvnangen-k0a.no
+kvænangen.no
+navuotna.no
+xn--nvuotna-hwa.no
+návuotna.no
+kafjord.no
+xn--kfjord-iua.no
+kåfjord.no
+gaivuotna.no
+xn--givuotna-8ya.no
+gáivuotna.no
+larvik.no
+lavangen.no
+lavagis.no
+loabat.no
+xn--loabt-0qa.no
+loabát.no
+lebesby.no
+davvesiida.no
+leikanger.no
+leirfjord.no
+leka.no
+leksvik.no
+lenvik.no
+leangaviika.no
+xn--leagaviika-52b.no
+leaŋgaviika.no
+lesja.no
+levanger.no
+lier.no
+lierne.no
+lillehammer.no
+lillesand.no
+lindesnes.no
+lindas.no
+xn--linds-pra.no
+lindås.no
+lom.no
+loppa.no
+lahppi.no
+xn--lhppi-xqa.no
+láhppi.no
+lund.no
+lunner.no
+luroy.no
+xn--lury-ira.no
+lurøy.no
+luster.no
+lyngdal.no
+lyngen.no
+ivgu.no
+lardal.no
+lerdal.no
+xn--lrdal-sra.no
+lærdal.no
+lodingen.no
+xn--ldingen-q1a.no
+lødingen.no
+lorenskog.no
+xn--lrenskog-54a.no
+lørenskog.no
+loten.no
+xn--lten-gra.no
+løten.no
+malvik.no
+masoy.no
+xn--msy-ula0h.no
+måsøy.no
+muosat.no
+xn--muost-0qa.no
+muosát.no
+mandal.no
+marker.no
+marnardal.no
+masfjorden.no
+meland.no
+meldal.no
+melhus.no
+meloy.no
+xn--mely-ira.no
+meløy.no
+meraker.no
+xn--merker-kua.no
+meråker.no
+moareke.no
+xn--moreke-jua.no
+moåreke.no
+midsund.no
+midtre-gauldal.no
+modalen.no
+modum.no
+molde.no
+moskenes.no
+moss.no
+mosvik.no
+malselv.no
+xn--mlselv-iua.no
+målselv.no
+malatvuopmi.no
+xn--mlatvuopmi-s4a.no
+málatvuopmi.no
+namdalseid.no
+aejrie.no
+namsos.no
+namsskogan.no
+naamesjevuemie.no
+xn--nmesjevuemie-tcba.no
+nååmesjevuemie.no
+laakesvuemie.no
+nannestad.no
+narvik.no
+narviika.no
+naustdal.no
+nedre-eiker.no
+nes.akershus.no
+nes.buskerud.no
+nesna.no
+nesodden.no
+nesseby.no
+unjarga.no
+xn--unjrga-rta.no
+unjárga.no
+nesset.no
+nissedal.no
+nittedal.no
+nord-aurdal.no
+nord-fron.no
+nord-odal.no
+norddal.no
+nordkapp.no
+davvenjarga.no
+xn--davvenjrga-y4a.no
+davvenjárga.no
+nordre-land.no
+nordreisa.no
+raisa.no
+xn--risa-5na.no
+ráisa.no
+nore-og-uvdal.no
+notodden.no
+naroy.no
+xn--nry-yla5g.no
+nærøy.no
+notteroy.no
+xn--nttery-byae.no
+nøtterøy.no
+odda.no
+oksnes.no
+xn--ksnes-uua.no
+øksnes.no
+oppdal.no
+oppegard.no
+xn--oppegrd-ixa.no
+oppegård.no
+orkdal.no
+orland.no
+xn--rland-uua.no
+ørland.no
+orskog.no
+xn--rskog-uua.no
+ørskog.no
+orsta.no
+xn--rsta-fra.no
+ørsta.no
+os.hedmark.no
+os.hordaland.no
+osen.no
+osteroy.no
+xn--ostery-fya.no
+osterøy.no
+ostre-toten.no
+xn--stre-toten-zcb.no
+østre-toten.no
+overhalla.no
+ovre-eiker.no
+xn--vre-eiker-k8a.no
+øvre-eiker.no
+oyer.no
+xn--yer-zna.no
+øyer.no
+oygarden.no
+xn--ygarden-p1a.no
+øygarden.no
+oystre-slidre.no
+xn--ystre-slidre-ujb.no
+øystre-slidre.no
+porsanger.no
+porsangu.no
+xn--porsgu-sta26f.no
+porsáŋgu.no
+porsgrunn.no
+radoy.no
+xn--rady-ira.no
+radøy.no
+rakkestad.no
+rana.no
+ruovat.no
+randaberg.no
+rauma.no
+rendalen.no
+rennebu.no
+rennesoy.no
+xn--rennesy-v1a.no
+rennesøy.no
+rindal.no
+ringebu.no
+ringerike.no
+ringsaker.no
+rissa.no
+risor.no
+xn--risr-ira.no
+risør.no
+roan.no
+rollag.no
+rygge.no
+ralingen.no
+xn--rlingen-mxa.no
+rælingen.no
+rodoy.no
+xn--rdy-0nab.no
+rødøy.no
+romskog.no
+xn--rmskog-bya.no
+rømskog.no
+roros.no
+xn--rros-gra.no
+røros.no
+rost.no
+xn--rst-0na.no
+røst.no
+royken.no
+xn--ryken-vua.no
+røyken.no
+royrvik.no
+xn--ryrvik-bya.no
+røyrvik.no
+rade.no
+xn--rde-ula.no
+råde.no
+salangen.no
+siellak.no
+saltdal.no
+salat.no
+xn--slt-elab.no
+sálát.no
+xn--slat-5na.no
+sálat.no
+samnanger.no
+sande.more-og-romsdal.no
+sande.xn--mre-og-romsdal-qqb.no
+sande.møre-og-romsdal.no
+sande.vestfold.no
+sandefjord.no
+sandnes.no
+sandoy.no
+xn--sandy-yua.no
+sandøy.no
+sarpsborg.no
+sauda.no
+sauherad.no
+sel.no
+selbu.no
+selje.no
+seljord.no
+sigdal.no
+siljan.no
+sirdal.no
+skaun.no
+skedsmo.no
+ski.no
+skien.no
+skiptvet.no
+skjervoy.no
+xn--skjervy-v1a.no
+skjervøy.no
+skierva.no
+xn--skierv-uta.no
+skiervá.no
+skjak.no
+xn--skjk-soa.no
+skjåk.no
+skodje.no
+skanland.no
+xn--sknland-fxa.no
+skånland.no
+skanit.no
+xn--sknit-yqa.no
+skánit.no
+smola.no
+xn--smla-hra.no
+smøla.no
+snillfjord.no
+snasa.no
+xn--snsa-roa.no
+snåsa.no
+snoasa.no
+snaase.no
+xn--snase-nra.no
+snåase.no
+sogndal.no
+sokndal.no
+sola.no
+solund.no
+songdalen.no
+sortland.no
+spydeberg.no
+stange.no
+stavanger.no
+steigen.no
+steinkjer.no
+stjordal.no
+xn--stjrdal-s1a.no
+stjørdal.no
+stokke.no
+stor-elvdal.no
+stord.no
+stordal.no
+storfjord.no
+omasvuotna.no
+strand.no
+stranda.no
+stryn.no
+sula.no
+suldal.no
+sund.no
+sunndal.no
+surnadal.no
+sveio.no
+svelvik.no
+sykkylven.no
+sogne.no
+xn--sgne-gra.no
+søgne.no
+somna.no
+xn--smna-gra.no
+sømna.no
+sondre-land.no
+xn--sndre-land-0cb.no
+søndre-land.no
+sor-aurdal.no
+xn--sr-aurdal-l8a.no
+sør-aurdal.no
+sor-fron.no
+xn--sr-fron-q1a.no
+sør-fron.no
+sor-odal.no
+xn--sr-odal-q1a.no
+sør-odal.no
+sor-varanger.no
+xn--sr-varanger-ggb.no
+sør-varanger.no
+matta-varjjat.no
+xn--mtta-vrjjat-k7af.no
+mátta-várjjat.no
+sorfold.no
+xn--srfold-bya.no
+sørfold.no
+sorreisa.no
+xn--srreisa-q1a.no
+sørreisa.no
+sorum.no
+xn--srum-gra.no
+sørum.no
+tana.no
+deatnu.no
+time.no
+tingvoll.no
+tinn.no
+tjeldsund.no
+dielddanuorri.no
+tjome.no
+xn--tjme-hra.no
+tjøme.no
+tokke.no
+tolga.no
+torsken.no
+tranoy.no
+xn--trany-yua.no
+tranøy.no
+tromso.no
+xn--troms-zua.no
+tromsø.no
+tromsa.no
+romsa.no
+trondheim.no
+troandin.no
+trysil.no
+trana.no
+xn--trna-woa.no
+træna.no
+trogstad.no
+xn--trgstad-r1a.no
+trøgstad.no
+tvedestrand.no
+tydal.no
+tynset.no
+tysfjord.no
+divtasvuodna.no
+divttasvuotna.no
+tysnes.no
+tysvar.no
+xn--tysvr-vra.no
+tysvær.no
+tonsberg.no
+xn--tnsberg-q1a.no
+tønsberg.no
+ullensaker.no
+ullensvang.no
+ulvik.no
+utsira.no
+vadso.no
+xn--vads-jra.no
+vadsø.no
+cahcesuolo.no
+xn--hcesuolo-7ya35b.no
+čáhcesuolo.no
+vaksdal.no
+valle.no
+vang.no
+vanylven.no
+vardo.no
+xn--vard-jra.no
+vardø.no
+varggat.no
+xn--vrggt-xqad.no
+várggát.no
+vefsn.no
+vaapste.no
+vega.no
+vegarshei.no
+xn--vegrshei-c0a.no
+vegårshei.no
+vennesla.no
+verdal.no
+verran.no
+vestby.no
+vestnes.no
+vestre-slidre.no
+vestre-toten.no
+vestvagoy.no
+xn--vestvgy-ixa6o.no
+vestvågøy.no
+vevelstad.no
+vik.no
+vikna.no
+vindafjord.no
+volda.no
+voss.no
+varoy.no
+xn--vry-yla5g.no
+værøy.no
+vagan.no
+xn--vgan-qoa.no
+vågan.no
+voagat.no
+vagsoy.no
+xn--vgsy-qoa0j.no
+vågsøy.no
+vaga.no
+xn--vg-yiab.no
+vågå.no
+valer.ostfold.no
+xn--vler-qoa.xn--stfold-9xa.no
+våler.østfold.no
+valer.hedmark.no
+xn--vler-qoa.hedmark.no
+våler.hedmark.no
+
+// np : http://www.mos.com.np/register.html
+*.np
+
+// nr : http://cenpac.net.nr/dns/index.html
+// Submitted by registry <technician@cenpac.net.nr>
+nr
+biz.nr
+info.nr
+gov.nr
+edu.nr
+org.nr
+net.nr
+com.nr
+
+// nu : https://en.wikipedia.org/wiki/.nu
+nu
+
+// nz : https://en.wikipedia.org/wiki/.nz
+// Submitted by registry <jay@nzrs.net.nz>
+nz
+ac.nz
+co.nz
+cri.nz
+geek.nz
+gen.nz
+govt.nz
+health.nz
+iwi.nz
+kiwi.nz
+maori.nz
+mil.nz
+xn--mori-qsa.nz
+māori.nz
+net.nz
+org.nz
+parliament.nz
+school.nz
+
+// om : https://en.wikipedia.org/wiki/.om
+om
+co.om
+com.om
+edu.om
+gov.om
+med.om
+museum.om
+net.om
+org.om
+pro.om
+
+// onion : https://tools.ietf.org/html/rfc7686
+onion
+
+// org : https://en.wikipedia.org/wiki/.org
+org
+
+// pa : http://www.nic.pa/
+// Some additional second level "domains" resolve directly as hostnames, such as
+// pannet.pa, so we add a rule for "pa".
+pa
+ac.pa
+gob.pa
+com.pa
+org.pa
+sld.pa
+edu.pa
+net.pa
+ing.pa
+abo.pa
+med.pa
+nom.pa
+
+// pe : https://www.nic.pe/InformeFinalComision.pdf
+pe
+edu.pe
+gob.pe
+nom.pe
+mil.pe
+org.pe
+com.pe
+net.pe
+
+// pf : http://www.gobin.info/domainname/formulaire-pf.pdf
+pf
+com.pf
+org.pf
+edu.pf
+
+// pg : https://en.wikipedia.org/wiki/.pg
+*.pg
+
+// ph : http://www.domains.ph/FAQ2.asp
+// Submitted by registry <jed@email.com.ph>
+ph
+com.ph
+net.ph
+org.ph
+gov.ph
+edu.ph
+ngo.ph
+mil.ph
+i.ph
+
+// pk : http://pk5.pknic.net.pk/pk5/msgNamepk.PK
+pk
+com.pk
+net.pk
+edu.pk
+org.pk
+fam.pk
+biz.pk
+web.pk
+gov.pk
+gob.pk
+gok.pk
+gon.pk
+gop.pk
+gos.pk
+info.pk
+
+// pl http://www.dns.pl/english/index.html
+// Submitted by registry
+pl
+com.pl
+net.pl
+org.pl
+// pl functional domains (http://www.dns.pl/english/index.html)
+aid.pl
+agro.pl
+atm.pl
+auto.pl
+biz.pl
+edu.pl
+gmina.pl
+gsm.pl
+info.pl
+mail.pl
+miasta.pl
+media.pl
+mil.pl
+nieruchomosci.pl
+nom.pl
+pc.pl
+powiat.pl
+priv.pl
+realestate.pl
+rel.pl
+sex.pl
+shop.pl
+sklep.pl
+sos.pl
+szkola.pl
+targi.pl
+tm.pl
+tourism.pl
+travel.pl
+turystyka.pl
+// Government domains
+gov.pl
+ap.gov.pl
+ic.gov.pl
+is.gov.pl
+us.gov.pl
+kmpsp.gov.pl
+kppsp.gov.pl
+kwpsp.gov.pl
+psp.gov.pl
+wskr.gov.pl
+kwp.gov.pl
+mw.gov.pl
+ug.gov.pl
+um.gov.pl
+umig.gov.pl
+ugim.gov.pl
+upow.gov.pl
+uw.gov.pl
+starostwo.gov.pl
+pa.gov.pl
+po.gov.pl
+psse.gov.pl
+pup.gov.pl
+rzgw.gov.pl
+sa.gov.pl
+so.gov.pl
+sr.gov.pl
+wsa.gov.pl
+sko.gov.pl
+uzs.gov.pl
+wiih.gov.pl
+winb.gov.pl
+pinb.gov.pl
+wios.gov.pl
+witd.gov.pl
+wzmiuw.gov.pl
+piw.gov.pl
+wiw.gov.pl
+griw.gov.pl
+wif.gov.pl
+oum.gov.pl
+sdn.gov.pl
+zp.gov.pl
+uppo.gov.pl
+mup.gov.pl
+wuoz.gov.pl
+konsulat.gov.pl
+oirm.gov.pl
+// pl regional domains (http://www.dns.pl/english/index.html)
+augustow.pl
+babia-gora.pl
+bedzin.pl
+beskidy.pl
+bialowieza.pl
+bialystok.pl
+bielawa.pl
+bieszczady.pl
+boleslawiec.pl
+bydgoszcz.pl
+bytom.pl
+cieszyn.pl
+czeladz.pl
+czest.pl
+dlugoleka.pl
+elblag.pl
+elk.pl
+glogow.pl
+gniezno.pl
+gorlice.pl
+grajewo.pl
+ilawa.pl
+jaworzno.pl
+jelenia-gora.pl
+jgora.pl
+kalisz.pl
+kazimierz-dolny.pl
+karpacz.pl
+kartuzy.pl
+kaszuby.pl
+katowice.pl
+kepno.pl
+ketrzyn.pl
+klodzko.pl
+kobierzyce.pl
+kolobrzeg.pl
+konin.pl
+konskowola.pl
+kutno.pl
+lapy.pl
+lebork.pl
+legnica.pl
+lezajsk.pl
+limanowa.pl
+lomza.pl
+lowicz.pl
+lubin.pl
+lukow.pl
+malbork.pl
+malopolska.pl
+mazowsze.pl
+mazury.pl
+mielec.pl
+mielno.pl
+mragowo.pl
+naklo.pl
+nowaruda.pl
+nysa.pl
+olawa.pl
+olecko.pl
+olkusz.pl
+olsztyn.pl
+opoczno.pl
+opole.pl
+ostroda.pl
+ostroleka.pl
+ostrowiec.pl
+ostrowwlkp.pl
+pila.pl
+pisz.pl
+podhale.pl
+podlasie.pl
+polkowice.pl
+pomorze.pl
+pomorskie.pl
+prochowice.pl
+pruszkow.pl
+przeworsk.pl
+pulawy.pl
+radom.pl
+rawa-maz.pl
+rybnik.pl
+rzeszow.pl
+sanok.pl
+sejny.pl
+slask.pl
+slupsk.pl
+sosnowiec.pl
+stalowa-wola.pl
+skoczow.pl
+starachowice.pl
+stargard.pl
+suwalki.pl
+swidnica.pl
+swiebodzin.pl
+swinoujscie.pl
+szczecin.pl
+szczytno.pl
+tarnobrzeg.pl
+tgory.pl
+turek.pl
+tychy.pl
+ustka.pl
+walbrzych.pl
+warmia.pl
+warszawa.pl
+waw.pl
+wegrow.pl
+wielun.pl
+wlocl.pl
+wloclawek.pl
+wodzislaw.pl
+wolomin.pl
+wroclaw.pl
+zachpomor.pl
+zagan.pl
+zarow.pl
+zgora.pl
+zgorzelec.pl
+
+// pm : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf
+pm
+
+// pn : http://www.government.pn/PnRegistry/policies.htm
+pn
+gov.pn
+co.pn
+org.pn
+edu.pn
+net.pn
+
+// post : https://en.wikipedia.org/wiki/.post
+post
+
+// pr : http://www.nic.pr/index.asp?f=1
+pr
+com.pr
+net.pr
+org.pr
+gov.pr
+edu.pr
+isla.pr
+pro.pr
+biz.pr
+info.pr
+name.pr
+// these aren't mentioned on nic.pr, but on https://en.wikipedia.org/wiki/.pr
+est.pr
+prof.pr
+ac.pr
+
+// pro : http://registry.pro/get-pro
+pro
+aaa.pro
+aca.pro
+acct.pro
+avocat.pro
+bar.pro
+cpa.pro
+eng.pro
+jur.pro
+law.pro
+med.pro
+recht.pro
+
+// ps : https://en.wikipedia.org/wiki/.ps
+// http://www.nic.ps/registration/policy.html#reg
+ps
+edu.ps
+gov.ps
+sec.ps
+plo.ps
+com.ps
+org.ps
+net.ps
+
+// pt : http://online.dns.pt/dns/start_dns
+pt
+net.pt
+gov.pt
+org.pt
+edu.pt
+int.pt
+publ.pt
+com.pt
+nome.pt
+
+// pw : https://en.wikipedia.org/wiki/.pw
+pw
+co.pw
+ne.pw
+or.pw
+ed.pw
+go.pw
+belau.pw
+
+// py : http://www.nic.py/pautas.html#seccion_9
+// Submitted by registry
+py
+com.py
+coop.py
+edu.py
+gov.py
+mil.py
+net.py
+org.py
+
+// qa : http://domains.qa/en/
+qa
+com.qa
+edu.qa
+gov.qa
+mil.qa
+name.qa
+net.qa
+org.qa
+sch.qa
+
+// re : http://www.afnic.re/obtenir/chartes/nommage-re/annexe-descriptifs
+re
+asso.re
+com.re
+nom.re
+
+// ro : http://www.rotld.ro/
+ro
+arts.ro
+com.ro
+firm.ro
+info.ro
+nom.ro
+nt.ro
+org.ro
+rec.ro
+store.ro
+tm.ro
+www.ro
+
+// rs : https://www.rnids.rs/en/domains/national-domains
+rs
+ac.rs
+co.rs
+edu.rs
+gov.rs
+in.rs
+org.rs
+
+// ru : https://cctld.ru/en/domains/domens_ru/reserved/
+ru
+ac.ru
+edu.ru
+gov.ru
+int.ru
+mil.ru
+test.ru
+
+// rw : http://www.nic.rw/cgi-bin/policy.pl
+rw
+gov.rw
+net.rw
+edu.rw
+ac.rw
+com.rw
+co.rw
+int.rw
+mil.rw
+gouv.rw
+
+// sa : http://www.nic.net.sa/
+sa
+com.sa
+net.sa
+org.sa
+gov.sa
+med.sa
+pub.sa
+edu.sa
+sch.sa
+
+// sb : http://www.sbnic.net.sb/
+// Submitted by registry <lee.humphries@telekom.com.sb>
+sb
+com.sb
+edu.sb
+gov.sb
+net.sb
+org.sb
+
+// sc : http://www.nic.sc/
+sc
+com.sc
+gov.sc
+net.sc
+org.sc
+edu.sc
+
+// sd : http://www.isoc.sd/sudanic.isoc.sd/billing_pricing.htm
+// Submitted by registry <admin@isoc.sd>
+sd
+com.sd
+net.sd
+org.sd
+edu.sd
+med.sd
+tv.sd
+gov.sd
+info.sd
+
+// se : https://en.wikipedia.org/wiki/.se
+// Submitted by registry <patrik.wallstrom@iis.se>
+se
+a.se
+ac.se
+b.se
+bd.se
+brand.se
+c.se
+d.se
+e.se
+f.se
+fh.se
+fhsk.se
+fhv.se
+g.se
+h.se
+i.se
+k.se
+komforb.se
+kommunalforbund.se
+komvux.se
+l.se
+lanbib.se
+m.se
+n.se
+naturbruksgymn.se
+o.se
+org.se
+p.se
+parti.se
+pp.se
+press.se
+r.se
+s.se
+t.se
+tm.se
+u.se
+w.se
+x.se
+y.se
+z.se
+
+// sg : http://www.nic.net.sg/page/registration-policies-procedures-and-guidelines
+sg
+com.sg
+net.sg
+org.sg
+gov.sg
+edu.sg
+per.sg
+
+// sh : http://www.nic.sh/registrar.html
+sh
+com.sh
+net.sh
+gov.sh
+org.sh
+mil.sh
+
+// si : https://en.wikipedia.org/wiki/.si
+si
+
+// sj : No registrations at this time.
+// Submitted by registry <jarle@uninett.no>
+sj
+
+// sk : https://en.wikipedia.org/wiki/.sk
+// list of 2nd level domains ?
+sk
+
+// sl : http://www.nic.sl
+// Submitted by registry <adam@neoip.com>
+sl
+com.sl
+net.sl
+edu.sl
+gov.sl
+org.sl
+
+// sm : https://en.wikipedia.org/wiki/.sm
+sm
+
+// sn : https://en.wikipedia.org/wiki/.sn
+sn
+art.sn
+com.sn
+edu.sn
+gouv.sn
+org.sn
+perso.sn
+univ.sn
+
+// so : http://www.soregistry.com/
+so
+com.so
+net.so
+org.so
+
+// sr : https://en.wikipedia.org/wiki/.sr
+sr
+
+// st : http://www.nic.st/html/policyrules/
+st
+co.st
+com.st
+consulado.st
+edu.st
+embaixada.st
+gov.st
+mil.st
+net.st
+org.st
+principe.st
+saotome.st
+store.st
+
+// su : https://en.wikipedia.org/wiki/.su
+su
+
+// sv : http://www.svnet.org.sv/niveldos.pdf
+sv
+com.sv
+edu.sv
+gob.sv
+org.sv
+red.sv
+
+// sx : https://en.wikipedia.org/wiki/.sx
+// Submitted by registry <jcvignes@openregistry.com>
+sx
+gov.sx
+
+// sy : https://en.wikipedia.org/wiki/.sy
+// see also: http://www.gobin.info/domainname/sy.doc
+sy
+edu.sy
+gov.sy
+net.sy
+mil.sy
+com.sy
+org.sy
+
+// sz : https://en.wikipedia.org/wiki/.sz
+// http://www.sispa.org.sz/
+sz
+co.sz
+ac.sz
+org.sz
+
+// tc : https://en.wikipedia.org/wiki/.tc
+tc
+
+// td : https://en.wikipedia.org/wiki/.td
+td
+
+// tel: https://en.wikipedia.org/wiki/.tel
+// http://www.telnic.org/
+tel
+
+// tf : https://en.wikipedia.org/wiki/.tf
+tf
+
+// tg : https://en.wikipedia.org/wiki/.tg
+// http://www.nic.tg/
+tg
+
+// th : https://en.wikipedia.org/wiki/.th
+// Submitted by registry <krit@thains.co.th>
+th
+ac.th
+co.th
+go.th
+in.th
+mi.th
+net.th
+or.th
+
+// tj : http://www.nic.tj/policy.html
+tj
+ac.tj
+biz.tj
+co.tj
+com.tj
+edu.tj
+go.tj
+gov.tj
+int.tj
+mil.tj
+name.tj
+net.tj
+nic.tj
+org.tj
+test.tj
+web.tj
+
+// tk : https://en.wikipedia.org/wiki/.tk
+tk
+
+// tl : https://en.wikipedia.org/wiki/.tl
+tl
+gov.tl
+
+// tm : http://www.nic.tm/local.html
+tm
+com.tm
+co.tm
+org.tm
+net.tm
+nom.tm
+gov.tm
+mil.tm
+edu.tm
+
+// tn : https://en.wikipedia.org/wiki/.tn
+// http://whois.ati.tn/
+tn
+com.tn
+ens.tn
+fin.tn
+gov.tn
+ind.tn
+intl.tn
+nat.tn
+net.tn
+org.tn
+info.tn
+perso.tn
+tourism.tn
+edunet.tn
+rnrt.tn
+rns.tn
+rnu.tn
+mincom.tn
+agrinet.tn
+defense.tn
+turen.tn
+
+// to : https://en.wikipedia.org/wiki/.to
+// Submitted by registry <egullich@colo.to>
+to
+com.to
+gov.to
+net.to
+org.to
+edu.to
+mil.to
+
+// subTLDs: https://www.nic.tr/forms/eng/policies.pdf
+//     and: https://www.nic.tr/forms/politikalar.pdf
+// Submitted by <mehmetgurevin@gmail.com>
+tr
+com.tr
+info.tr
+biz.tr
+net.tr
+org.tr
+web.tr
+gen.tr
+tv.tr
+av.tr
+dr.tr
+bbs.tr
+name.tr
+tel.tr
+gov.tr
+bel.tr
+pol.tr
+mil.tr
+k12.tr
+edu.tr
+kep.tr
+
+// Used by Northern Cyprus
+nc.tr
+
+// Used by government agencies of Northern Cyprus
+gov.nc.tr
+
+// travel : https://en.wikipedia.org/wiki/.travel
+travel
+
+// tt : http://www.nic.tt/
+tt
+co.tt
+com.tt
+org.tt
+net.tt
+biz.tt
+info.tt
+pro.tt
+int.tt
+coop.tt
+jobs.tt
+mobi.tt
+travel.tt
+museum.tt
+aero.tt
+name.tt
+gov.tt
+edu.tt
+
+// tv : https://en.wikipedia.org/wiki/.tv
+// Not listing any 2LDs as reserved since none seem to exist in practice,
+// Wikipedia notwithstanding.
+tv
+
+// tw : https://en.wikipedia.org/wiki/.tw
+tw
+edu.tw
+gov.tw
+mil.tw
+com.tw
+net.tw
+org.tw
+idv.tw
+game.tw
+ebiz.tw
+club.tw
+xn--zf0ao64a.tw
+網路.tw
+xn--uc0atv.tw
+組織.tw
+xn--czrw28b.tw
+商業.tw
+
+// tz : http://www.tznic.or.tz/index.php/domains
+// Submitted by registry <manager@tznic.or.tz>
+tz
+ac.tz
+co.tz
+go.tz
+hotel.tz
+info.tz
+me.tz
+mil.tz
+mobi.tz
+ne.tz
+or.tz
+sc.tz
+tv.tz
+
+// ua : https://hostmaster.ua/policy/?ua
+// Submitted by registry <dk@cctld.ua>
+ua
+// ua 2LD
+com.ua
+edu.ua
+gov.ua
+in.ua
+net.ua
+org.ua
+// ua geographic names
+// https://hostmaster.ua/2ld/
+cherkassy.ua
+cherkasy.ua
+chernigov.ua
+chernihiv.ua
+chernivtsi.ua
+chernovtsy.ua
+ck.ua
+cn.ua
+cr.ua
+crimea.ua
+cv.ua
+dn.ua
+dnepropetrovsk.ua
+dnipropetrovsk.ua
+dominic.ua
+donetsk.ua
+dp.ua
+if.ua
+ivano-frankivsk.ua
+kh.ua
+kharkiv.ua
+kharkov.ua
+kherson.ua
+khmelnitskiy.ua
+khmelnytskyi.ua
+kiev.ua
+kirovograd.ua
+km.ua
+kr.ua
+krym.ua
+ks.ua
+kv.ua
+kyiv.ua
+lg.ua
+lt.ua
+lugansk.ua
+lutsk.ua
+lv.ua
+lviv.ua
+mk.ua
+mykolaiv.ua
+nikolaev.ua
+od.ua
+odesa.ua
+odessa.ua
+pl.ua
+poltava.ua
+rivne.ua
+rovno.ua
+rv.ua
+sb.ua
+sebastopol.ua
+sevastopol.ua
+sm.ua
+sumy.ua
+te.ua
+ternopil.ua
+uz.ua
+uzhgorod.ua
+vinnica.ua
+vinnytsia.ua
+vn.ua
+volyn.ua
+yalta.ua
+zaporizhzhe.ua
+zaporizhzhia.ua
+zhitomir.ua
+zhytomyr.ua
+zp.ua
+zt.ua
+
+// ug : https://www.registry.co.ug/
+ug
+co.ug
+or.ug
+ac.ug
+sc.ug
+go.ug
+ne.ug
+com.ug
+org.ug
+
+// uk : https://en.wikipedia.org/wiki/.uk
+// Submitted by registry <Michael.Daly@nominet.org.uk>
+uk
+ac.uk
+co.uk
+gov.uk
+ltd.uk
+me.uk
+net.uk
+nhs.uk
+org.uk
+plc.uk
+police.uk
+*.sch.uk
+
+// us : https://en.wikipedia.org/wiki/.us
+us
+dni.us
+fed.us
+isa.us
+kids.us
+nsn.us
+// us geographic names
+ak.us
+al.us
+ar.us
+as.us
+az.us
+ca.us
+co.us
+ct.us
+dc.us
+de.us
+fl.us
+ga.us
+gu.us
+hi.us
+ia.us
+id.us
+il.us
+in.us
+ks.us
+ky.us
+la.us
+ma.us
+md.us
+me.us
+mi.us
+mn.us
+mo.us
+ms.us
+mt.us
+nc.us
+nd.us
+ne.us
+nh.us
+nj.us
+nm.us
+nv.us
+ny.us
+oh.us
+ok.us
+or.us
+pa.us
+pr.us
+ri.us
+sc.us
+sd.us
+tn.us
+tx.us
+ut.us
+vi.us
+vt.us
+va.us
+wa.us
+wi.us
+wv.us
+wy.us
+// The registrar notes several more specific domains available in each state,
+// such as state.*.us, dst.*.us, etc., but resolution of these is somewhat
+// haphazard; in some states these domains resolve as addresses, while in others
+// only subdomains are available, or even nothing at all. We include the
+// most common ones where it's clear that different sites are different
+// entities.
+k12.ak.us
+k12.al.us
+k12.ar.us
+k12.as.us
+k12.az.us
+k12.ca.us
+k12.co.us
+k12.ct.us
+k12.dc.us
+k12.de.us
+k12.fl.us
+k12.ga.us
+k12.gu.us
+// k12.hi.us  Bug 614565 - Hawaii has a state-wide DOE login
+k12.ia.us
+k12.id.us
+k12.il.us
+k12.in.us
+k12.ks.us
+k12.ky.us
+k12.la.us
+k12.ma.us
+k12.md.us
+k12.me.us
+k12.mi.us
+k12.mn.us
+k12.mo.us
+k12.ms.us
+k12.mt.us
+k12.nc.us
+// k12.nd.us  Bug 1028347 - Removed at request of Travis Rosso <trossow@nd.gov>
+k12.ne.us
+k12.nh.us
+k12.nj.us
+k12.nm.us
+k12.nv.us
+k12.ny.us
+k12.oh.us
+k12.ok.us
+k12.or.us
+k12.pa.us
+k12.pr.us
+k12.ri.us
+k12.sc.us
+// k12.sd.us  Bug 934131 - Removed at request of James Booze <James.Booze@k12.sd.us>
+k12.tn.us
+k12.tx.us
+k12.ut.us
+k12.vi.us
+k12.vt.us
+k12.va.us
+k12.wa.us
+k12.wi.us
+// k12.wv.us  Bug 947705 - Removed at request of Verne Britton <verne@wvnet.edu>
+k12.wy.us
+cc.ak.us
+cc.al.us
+cc.ar.us
+cc.as.us
+cc.az.us
+cc.ca.us
+cc.co.us
+cc.ct.us
+cc.dc.us
+cc.de.us
+cc.fl.us
+cc.ga.us
+cc.gu.us
+cc.hi.us
+cc.ia.us
+cc.id.us
+cc.il.us
+cc.in.us
+cc.ks.us
+cc.ky.us
+cc.la.us
+cc.ma.us
+cc.md.us
+cc.me.us
+cc.mi.us
+cc.mn.us
+cc.mo.us
+cc.ms.us
+cc.mt.us
+cc.nc.us
+cc.nd.us
+cc.ne.us
+cc.nh.us
+cc.nj.us
+cc.nm.us
+cc.nv.us
+cc.ny.us
+cc.oh.us
+cc.ok.us
+cc.or.us
+cc.pa.us
+cc.pr.us
+cc.ri.us
+cc.sc.us
+cc.sd.us
+cc.tn.us
+cc.tx.us
+cc.ut.us
+cc.vi.us
+cc.vt.us
+cc.va.us
+cc.wa.us
+cc.wi.us
+cc.wv.us
+cc.wy.us
+lib.ak.us
+lib.al.us
+lib.ar.us
+lib.as.us
+lib.az.us
+lib.ca.us
+lib.co.us
+lib.ct.us
+lib.dc.us
+// lib.de.us  Issue #243 - Moved to Private section at request of Ed Moore <Ed.Moore@lib.de.us>
+lib.fl.us
+lib.ga.us
+lib.gu.us
+lib.hi.us
+lib.ia.us
+lib.id.us
+lib.il.us
+lib.in.us
+lib.ks.us
+lib.ky.us
+lib.la.us
+lib.ma.us
+lib.md.us
+lib.me.us
+lib.mi.us
+lib.mn.us
+lib.mo.us
+lib.ms.us
+lib.mt.us
+lib.nc.us
+lib.nd.us
+lib.ne.us
+lib.nh.us
+lib.nj.us
+lib.nm.us
+lib.nv.us
+lib.ny.us
+lib.oh.us
+lib.ok.us
+lib.or.us
+lib.pa.us
+lib.pr.us
+lib.ri.us
+lib.sc.us
+lib.sd.us
+lib.tn.us
+lib.tx.us
+lib.ut.us
+lib.vi.us
+lib.vt.us
+lib.va.us
+lib.wa.us
+lib.wi.us
+// lib.wv.us  Bug 941670 - Removed at request of Larry W Arnold <arnold@wvlc.lib.wv.us>
+lib.wy.us
+// k12.ma.us contains school districts in Massachusetts. The 4LDs are
+//  managed independently except for private (PVT), charter (CHTR) and
+//  parochial (PAROCH) schools.  Those are delegated directly to the
+//  5LD operators.   <k12-ma-hostmaster _ at _ rsuc.gweep.net>
+pvt.k12.ma.us
+chtr.k12.ma.us
+paroch.k12.ma.us
+
+// uy : http://www.nic.org.uy/
+uy
+com.uy
+edu.uy
+gub.uy
+mil.uy
+net.uy
+org.uy
+
+// uz : http://www.reg.uz/
+uz
+co.uz
+com.uz
+net.uz
+org.uz
+
+// va : https://en.wikipedia.org/wiki/.va
+va
+
+// vc : https://en.wikipedia.org/wiki/.vc
+// Submitted by registry <kshah@ca.afilias.info>
+vc
+com.vc
+net.vc
+org.vc
+gov.vc
+mil.vc
+edu.vc
+
+// ve : https://registro.nic.ve/
+// Submitted by registry
+ve
+arts.ve
+co.ve
+com.ve
+e12.ve
+edu.ve
+firm.ve
+gob.ve
+gov.ve
+info.ve
+int.ve
+mil.ve
+net.ve
+org.ve
+rec.ve
+store.ve
+tec.ve
+web.ve
+
+// vg : https://en.wikipedia.org/wiki/.vg
+vg
+
+// vi : http://www.nic.vi/newdomainform.htm
+// http://www.nic.vi/Domain_Rules/body_domain_rules.html indicates some other
+// TLDs are "reserved", such as edu.vi and gov.vi, but doesn't actually say they
+// are available for registration (which they do not seem to be).
+vi
+co.vi
+com.vi
+k12.vi
+net.vi
+org.vi
+
+// vn : https://www.dot.vn/vnnic/vnnic/domainregistration.jsp
+vn
+com.vn
+net.vn
+org.vn
+edu.vn
+gov.vn
+int.vn
+ac.vn
+biz.vn
+info.vn
+name.vn
+pro.vn
+health.vn
+
+// vu : https://en.wikipedia.org/wiki/.vu
+// http://www.vunic.vu/
+vu
+com.vu
+edu.vu
+net.vu
+org.vu
+
+// wf : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf
+wf
+
+// ws : https://en.wikipedia.org/wiki/.ws
+// http://samoanic.ws/index.dhtml
+ws
+com.ws
+net.ws
+org.ws
+gov.ws
+edu.ws
+
+// yt : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf
+yt
+
+// IDN ccTLDs
+// When submitting patches, please maintain a sort by ISO 3166 ccTLD, then
+// U-label, and follow this format:
+// // A-Label ("<Latin renderings>", <language name>[, variant info]) : <ISO 3166 ccTLD>
+// // [sponsoring org]
+// U-Label
+
+// xn--mgbaam7a8h ("Emerat", Arabic) : AE
+// http://nic.ae/english/arabicdomain/rules.jsp
+xn--mgbaam7a8h
+امارات
+
+// xn--y9a3aq ("hye", Armenian) : AM
+// ISOC AM (operated by .am Registry)
+xn--y9a3aq
+հայ
+
+// xn--54b7fta0cc ("Bangla", Bangla) : BD
+xn--54b7fta0cc
+বাংলা
+
+// xn--90ais ("bel", Belarusian/Russian Cyrillic) : BY
+// Operated by .by registry
+xn--90ais
+бел
+
+// xn--fiqs8s ("Zhongguo/China", Chinese, Simplified) : CN
+// CNNIC
+// http://cnnic.cn/html/Dir/2005/10/11/3218.htm
+xn--fiqs8s
+中国
+
+// xn--fiqz9s ("Zhongguo/China", Chinese, Traditional) : CN
+// CNNIC
+// http://cnnic.cn/html/Dir/2005/10/11/3218.htm
+xn--fiqz9s
+中國
+
+// xn--lgbbat1ad8j ("Algeria/Al Jazair", Arabic) : DZ
+xn--lgbbat1ad8j
+الجزائر
+
+// xn--wgbh1c ("Egypt/Masr", Arabic) : EG
+// http://www.dotmasr.eg/
+xn--wgbh1c
+مصر
+
+// xn--e1a4c ("eu", Cyrillic) : EU
+xn--e1a4c
+ею
+
+// xn--node ("ge", Georgian Mkhedruli) : GE
+xn--node
+გე
+
+// xn--qxam ("el", Greek) : GR
+// Hellenic Ministry of Infrastructure, Transport, and Networks
+xn--qxam
+ελ
+
+// xn--j6w193g ("Hong Kong", Chinese) : HK
+// https://www2.hkirc.hk/register/rules.jsp
+xn--j6w193g
+香港
+
+// xn--h2brj9c ("Bharat", Devanagari) : IN
+// India
+xn--h2brj9c
+भारत
+
+// xn--mgbbh1a71e ("Bharat", Arabic) : IN
+// India
+xn--mgbbh1a71e
+بھارت
+
+// xn--fpcrj9c3d ("Bharat", Telugu) : IN
+// India
+xn--fpcrj9c3d
+భారత్
+
+// xn--gecrj9c ("Bharat", Gujarati) : IN
+// India
+xn--gecrj9c
+ભારત
+
+// xn--s9brj9c ("Bharat", Gurmukhi) : IN
+// India
+xn--s9brj9c
+ਭਾਰਤ
+
+// xn--45brj9c ("Bharat", Bengali) : IN
+// India
+xn--45brj9c
+ভারত
+
+// xn--xkc2dl3a5ee0h ("India", Tamil) : IN
+// India
+xn--xkc2dl3a5ee0h
+இந்தியா
+
+// xn--mgba3a4f16a ("Iran", Persian) : IR
+xn--mgba3a4f16a
+ایران
+
+// xn--mgba3a4fra ("Iran", Arabic) : IR
+xn--mgba3a4fra
+ايران
+
+// xn--mgbtx2b ("Iraq", Arabic) : IQ
+// Communications and Media Commission
+xn--mgbtx2b
+عراق
+
+// xn--mgbayh7gpa ("al-Ordon", Arabic) : JO
+// National Information Technology Center (NITC)
+// Royal Scientific Society, Al-Jubeiha
+xn--mgbayh7gpa
+الاردن
+
+// xn--3e0b707e ("Republic of Korea", Hangul) : KR
+xn--3e0b707e
+한국
+
+// xn--80ao21a ("Kaz", Kazakh) : KZ
+xn--80ao21a
+қаз
+
+// xn--fzc2c9e2c ("Lanka", Sinhalese-Sinhala) : LK
+// http://nic.lk
+xn--fzc2c9e2c
+ලංකා
+
+// xn--xkc2al3hye2a ("Ilangai", Tamil) : LK
+// http://nic.lk
+xn--xkc2al3hye2a
+இலங்கை
+
+// xn--mgbc0a9azcg ("Morocco/al-Maghrib", Arabic) : MA
+xn--mgbc0a9azcg
+المغرب
+
+// xn--d1alf ("mkd", Macedonian) : MK
+// MARnet
+xn--d1alf
+мкд
+
+// xn--l1acc ("mon", Mongolian) : MN
+xn--l1acc
+мон
+
+// xn--mix891f ("Macao", Chinese, Traditional) : MO
+// MONIC / HNET Asia (Registry Operator for .mo)
+xn--mix891f
+澳門
+
+// xn--mix082f ("Macao", Chinese, Simplified) : MO
+xn--mix082f
+澳门
+
+// xn--mgbx4cd0ab ("Malaysia", Malay) : MY
+xn--mgbx4cd0ab
+مليسيا
+
+// xn--mgb9awbf ("Oman", Arabic) : OM
+xn--mgb9awbf
+عمان
+
+// xn--mgbai9azgqp6j ("Pakistan", Urdu/Arabic) : PK
+xn--mgbai9azgqp6j
+پاکستان
+
+// xn--mgbai9a5eva00b ("Pakistan", Urdu/Arabic, variant) : PK
+xn--mgbai9a5eva00b
+پاكستان
+
+// xn--ygbi2ammx ("Falasteen", Arabic) : PS
+// The Palestinian National Internet Naming Authority (PNINA)
+// http://www.pnina.ps
+xn--ygbi2ammx
+فلسطين
+
+// xn--90a3ac ("srb", Cyrillic) : RS
+// https://www.rnids.rs/en/domains/national-domains
+xn--90a3ac
+срб
+xn--o1ac.xn--90a3ac
+пр.срб
+xn--c1avg.xn--90a3ac
+орг.срб
+xn--90azh.xn--90a3ac
+обр.срб
+xn--d1at.xn--90a3ac
+од.срб
+xn--o1ach.xn--90a3ac
+упр.срб
+xn--80au.xn--90a3ac
+ак.срб
+
+// xn--p1ai ("rf", Russian-Cyrillic) : RU
+// http://www.cctld.ru/en/docs/rulesrf.php
+xn--p1ai
+рф
+
+// xn--wgbl6a ("Qatar", Arabic) : QA
+// http://www.ict.gov.qa/
+xn--wgbl6a
+قطر
+
+// xn--mgberp4a5d4ar ("AlSaudiah", Arabic) : SA
+// http://www.nic.net.sa/
+xn--mgberp4a5d4ar
+السعودية
+
+// xn--mgberp4a5d4a87g ("AlSaudiah", Arabic, variant)  : SA
+xn--mgberp4a5d4a87g
+السعودیة
+
+// xn--mgbqly7c0a67fbc ("AlSaudiah", Arabic, variant) : SA
+xn--mgbqly7c0a67fbc
+السعودیۃ
+
+// xn--mgbqly7cvafr ("AlSaudiah", Arabic, variant) : SA
+xn--mgbqly7cvafr
+السعوديه
+
+// xn--mgbpl2fh ("sudan", Arabic) : SD
+// Operated by .sd registry
+xn--mgbpl2fh
+سودان
+
+// xn--yfro4i67o Singapore ("Singapore", Chinese) : SG
+xn--yfro4i67o
+新加坡
+
+// xn--clchc0ea0b2g2a9gcd ("Singapore", Tamil) : SG
+xn--clchc0ea0b2g2a9gcd
+சிங்கப்பூர்
+
+// xn--ogbpf8fl ("Syria", Arabic) : SY
+xn--ogbpf8fl
+سورية
+
+// xn--mgbtf8fl ("Syria", Arabic, variant) : SY
+xn--mgbtf8fl
+سوريا
+
+// xn--o3cw4h ("Thai", Thai) : TH
+// http://www.thnic.co.th
+xn--o3cw4h
+ไทย
+
+// xn--pgbs0dh ("Tunisia", Arabic) : TN
+// http://nic.tn
+xn--pgbs0dh
+تونس
+
+// xn--kpry57d ("Taiwan", Chinese, Traditional) : TW
+// http://www.twnic.net/english/dn/dn_07a.htm
+xn--kpry57d
+台灣
+
+// xn--kprw13d ("Taiwan", Chinese, Simplified) : TW
+// http://www.twnic.net/english/dn/dn_07a.htm
+xn--kprw13d
+台湾
+
+// xn--nnx388a ("Taiwan", Chinese, variant) : TW
+xn--nnx388a
+臺灣
+
+// xn--j1amh ("ukr", Cyrillic) : UA
+xn--j1amh
+укр
+
+// xn--mgb2ddes ("AlYemen", Arabic) : YE
+xn--mgb2ddes
+اليمن
+
+// xxx : http://icmregistry.com
+xxx
+
+// ye : http://www.y.net.ye/services/domain_name.htm
+*.ye
+
+// za : http://www.zadna.org.za/content/page/domain-information
+ac.za
+agric.za
+alt.za
+co.za
+edu.za
+gov.za
+grondar.za
+law.za
+mil.za
+net.za
+ngo.za
+nis.za
+nom.za
+org.za
+school.za
+tm.za
+web.za
+
+// zm : https://zicta.zm/
+// Submitted by registry <info@zicta.zm>
+zm
+ac.zm
+biz.zm
+co.zm
+com.zm
+edu.zm
+gov.zm
+info.zm
+mil.zm
+net.zm
+org.zm
+sch.zm
+
+// zw : https://en.wikipedia.org/wiki/.zw
+*.zw
+
+
+// List of new gTLDs imported from https://newgtlds.icann.org/newgtlds.csv on 2016-11-29T01:06:51Z
+
+// aaa : 2015-02-26 American Automobile Association, Inc.
+aaa
+
+// aarp : 2015-05-21 AARP
+aarp
+
+// abarth : 2015-07-30 Fiat Chrysler Automobiles N.V.
+abarth
+
+// abb : 2014-10-24 ABB Ltd
+abb
+
+// abbott : 2014-07-24 Abbott Laboratories, Inc.
+abbott
+
+// abbvie : 2015-07-30 AbbVie Inc.
+abbvie
+
+// abc : 2015-07-30 Disney Enterprises, Inc.
+abc
+
+// able : 2015-06-25 Able Inc.
+able
+
+// abogado : 2014-04-24 Top Level Domain Holdings Limited
+abogado
+
+// abudhabi : 2015-07-30 Abu Dhabi Systems and Information Centre
+abudhabi
+
+// academy : 2013-11-07 Half Oaks, LLC
+academy
+
+// accenture : 2014-08-15 Accenture plc
+accenture
+
+// accountant : 2014-11-20 dot Accountant Limited
+accountant
+
+// accountants : 2014-03-20 Knob Town, LLC
+accountants
+
+// aco : 2015-01-08 ACO Severin Ahlmann GmbH & Co. KG
+aco
+
+// active : 2014-05-01 The Active Network, Inc
+active
+
+// actor : 2013-12-12 United TLD Holdco Ltd.
+actor
+
+// adac : 2015-07-16 Allgemeiner Deutscher Automobil-Club e.V. (ADAC)
+adac
+
+// ads : 2014-12-04 Charleston Road Registry Inc.
+ads
+
+// adult : 2014-10-16 ICM Registry AD LLC
+adult
+
+// aeg : 2015-03-19 Aktiebolaget Electrolux
+aeg
+
+// aetna : 2015-05-21 Aetna Life Insurance Company
+aetna
+
+// afamilycompany : 2015-07-23 Johnson Shareholdings, Inc.
+afamilycompany
+
+// afl : 2014-10-02 Australian Football League
+afl
+
+// africa : 2014-03-24 ZA Central Registry NPC trading as Registry.Africa
+africa
+
+// agakhan : 2015-04-23 Fondation Aga Khan (Aga Khan Foundation)
+agakhan
+
+// agency : 2013-11-14 Steel Falls, LLC
+agency
+
+// aig : 2014-12-18 American International Group, Inc.
+aig
+
+// aigo : 2015-08-06 aigo Digital Technology Co,Ltd.
+aigo
+
+// airbus : 2015-07-30 Airbus S.A.S.
+airbus
+
+// airforce : 2014-03-06 United TLD Holdco Ltd.
+airforce
+
+// airtel : 2014-10-24 Bharti Airtel Limited
+airtel
+
+// akdn : 2015-04-23 Fondation Aga Khan (Aga Khan Foundation)
+akdn
+
+// alfaromeo : 2015-07-31 Fiat Chrysler Automobiles N.V.
+alfaromeo
+
+// alibaba : 2015-01-15 Alibaba Group Holding Limited
+alibaba
+
+// alipay : 2015-01-15 Alibaba Group Holding Limited
+alipay
+
+// allfinanz : 2014-07-03 Allfinanz Deutsche Vermögensberatung Aktiengesellschaft
+allfinanz
+
+// allstate : 2015-07-31 Allstate Fire and Casualty Insurance Company
+allstate
+
+// ally : 2015-06-18 Ally Financial Inc.
+ally
+
+// alsace : 2014-07-02 REGION D ALSACE
+alsace
+
+// alstom : 2015-07-30 ALSTOM
+alstom
+
+// americanexpress : 2015-07-31 American Express Travel Related Services Company, Inc.
+americanexpress
+
+// americanfamily : 2015-07-23 AmFam, Inc.
+americanfamily
+
+// amex : 2015-07-31 American Express Travel Related Services Company, Inc.
+amex
+
+// amfam : 2015-07-23 AmFam, Inc.
+amfam
+
+// amica : 2015-05-28 Amica Mutual Insurance Company
+amica
+
+// amsterdam : 2014-07-24 Gemeente Amsterdam
+amsterdam
+
+// analytics : 2014-12-18 Campus IP LLC
+analytics
+
+// android : 2014-08-07 Charleston Road Registry Inc.
+android
+
+// anquan : 2015-01-08 QIHOO 360 TECHNOLOGY CO. LTD.
+anquan
+
+// anz : 2015-07-31 Australia and New Zealand Banking Group Limited
+anz
+
+// aol : 2015-09-17 AOL Inc.
+aol
+
+// apartments : 2014-12-11 June Maple, LLC
+apartments
+
+// app : 2015-05-14 Charleston Road Registry Inc.
+app
+
+// apple : 2015-05-14 Apple Inc.
+apple
+
+// aquarelle : 2014-07-24 Aquarelle.com
+aquarelle
+
+// arab : 2015-11-12 League of Arab States
+arab
+
+// aramco : 2014-11-20 Aramco Services Company
+aramco
+
+// archi : 2014-02-06 STARTING DOT LIMITED
+archi
+
+// army : 2014-03-06 United TLD Holdco Ltd.
+army
+
+// art : 2016-03-24 UK Creative Ideas Limited
+art
+
+// arte : 2014-12-11 Association Relative à la Télévision Européenne G.E.I.E.
+arte
+
+// asda : 2015-07-31 Wal-Mart Stores, Inc.
+asda
+
+// associates : 2014-03-06 Baxter Hill, LLC
+associates
+
+// athleta : 2015-07-30 The Gap, Inc.
+athleta
+
+// attorney : 2014-03-20
+attorney
+
+// auction : 2014-03-20
+auction
+
+// audi : 2015-05-21 AUDI Aktiengesellschaft
+audi
+
+// audible : 2015-06-25 Amazon EU S.à r.l.
+audible
+
+// audio : 2014-03-20 Uniregistry, Corp.
+audio
+
+// auspost : 2015-08-13 Australian Postal Corporation
+auspost
+
+// author : 2014-12-18 Amazon EU S.à r.l.
+author
+
+// auto : 2014-11-13
+auto
+
+// autos : 2014-01-09 DERAutos, LLC
+autos
+
+// avianca : 2015-01-08 Aerovias del Continente Americano S.A. Avianca
+avianca
+
+// aws : 2015-06-25 Amazon EU S.à r.l.
+aws
+
+// axa : 2013-12-19 AXA SA
+axa
+
+// azure : 2014-12-18 Microsoft Corporation
+azure
+
+// baby : 2015-04-09 Johnson & Johnson Services, Inc.
+baby
+
+// baidu : 2015-01-08 Baidu, Inc.
+baidu
+
+// banamex : 2015-07-30 Citigroup Inc.
+banamex
+
+// bananarepublic : 2015-07-31 The Gap, Inc.
+bananarepublic
+
+// band : 2014-06-12
+band
+
+// bank : 2014-09-25 fTLD Registry Services LLC
+bank
+
+// bar : 2013-12-12 Punto 2012 Sociedad Anonima Promotora de Inversion de Capital Variable
+bar
+
+// barcelona : 2014-07-24 Municipi de Barcelona
+barcelona
+
+// barclaycard : 2014-11-20 Barclays Bank PLC
+barclaycard
+
+// barclays : 2014-11-20 Barclays Bank PLC
+barclays
+
+// barefoot : 2015-06-11 Gallo Vineyards, Inc.
+barefoot
+
+// bargains : 2013-11-14 Half Hallow, LLC
+bargains
+
+// baseball : 2015-10-29 MLB Advanced Media DH, LLC
+baseball
+
+// basketball : 2015-08-20 Fédération Internationale de Basketball (FIBA)
+basketball
+
+// bauhaus : 2014-04-17 Werkhaus GmbH
+bauhaus
+
+// bayern : 2014-01-23 Bayern Connect GmbH
+bayern
+
+// bbc : 2014-12-18 British Broadcasting Corporation
+bbc
+
+// bbt : 2015-07-23 BB&T Corporation
+bbt
+
+// bbva : 2014-10-02 BANCO BILBAO VIZCAYA ARGENTARIA, S.A.
+bbva
+
+// bcg : 2015-04-02 The Boston Consulting Group, Inc.
+bcg
+
+// bcn : 2014-07-24 Municipi de Barcelona
+bcn
+
+// beats : 2015-05-14 Beats Electronics, LLC
+beats
+
+// beauty : 2015-12-03 L'Oréal
+beauty
+
+// beer : 2014-01-09 Top Level Domain Holdings Limited
+beer
+
+// bentley : 2014-12-18 Bentley Motors Limited
+bentley
+
+// berlin : 2013-10-31 dotBERLIN GmbH & Co. KG
+berlin
+
+// best : 2013-12-19 BestTLD Pty Ltd
+best
+
+// bestbuy : 2015-07-31 BBY Solutions, Inc.
+bestbuy
+
+// bet : 2015-05-07 Afilias plc
+bet
+
+// bharti : 2014-01-09 Bharti Enterprises (Holding) Private Limited
+bharti
+
+// bible : 2014-06-19 American Bible Society
+bible
+
+// bid : 2013-12-19 dot Bid Limited
+bid
+
+// bike : 2013-08-27 Grand Hollow, LLC
+bike
+
+// bing : 2014-12-18 Microsoft Corporation
+bing
+
+// bingo : 2014-12-04 Sand Cedar, LLC
+bingo
+
+// bio : 2014-03-06 STARTING DOT LIMITED
+bio
+
+// black : 2014-01-16 Afilias Limited
+black
+
+// blackfriday : 2014-01-16 Uniregistry, Corp.
+blackfriday
+
+// blanco : 2015-07-16 BLANCO GmbH + Co KG
+blanco
+
+// blockbuster : 2015-07-30 Dish DBS Corporation
+blockbuster
+
+// blog : 2015-05-14
+blog
+
+// bloomberg : 2014-07-17 Bloomberg IP Holdings LLC
+bloomberg
+
+// blue : 2013-11-07 Afilias Limited
+blue
+
+// bms : 2014-10-30 Bristol-Myers Squibb Company
+bms
+
+// bmw : 2014-01-09 Bayerische Motoren Werke Aktiengesellschaft
+bmw
+
+// bnl : 2014-07-24 Banca Nazionale del Lavoro
+bnl
+
+// bnpparibas : 2014-05-29 BNP Paribas
+bnpparibas
+
+// boats : 2014-12-04 DERBoats, LLC
+boats
+
+// boehringer : 2015-07-09 Boehringer Ingelheim International GmbH
+boehringer
+
+// bofa : 2015-07-31 NMS Services, Inc.
+bofa
+
+// bom : 2014-10-16 Núcleo de Informação e Coordenação do Ponto BR - NIC.br
+bom
+
+// bond : 2014-06-05 Bond University Limited
+bond
+
+// boo : 2014-01-30 Charleston Road Registry Inc.
+boo
+
+// book : 2015-08-27 Amazon EU S.à r.l.
+book
+
+// booking : 2015-07-16 Booking.com B.V.
+booking
+
+// boots : 2015-01-08 THE BOOTS COMPANY PLC
+boots
+
+// bosch : 2015-06-18 Robert Bosch GMBH
+bosch
+
+// bostik : 2015-05-28 Bostik SA
+bostik
+
+// boston : 2015-12-10
+boston
+
+// bot : 2014-12-18 Amazon EU S.à r.l.
+bot
+
+// boutique : 2013-11-14 Over Galley, LLC
+boutique
+
+// box : 2015-11-12 NS1 Limited
+box
+
+// bradesco : 2014-12-18 Banco Bradesco S.A.
+bradesco
+
+// bridgestone : 2014-12-18 Bridgestone Corporation
+bridgestone
+
+// broadway : 2014-12-22 Celebrate Broadway, Inc.
+broadway
+
+// broker : 2014-12-11 IG Group Holdings PLC
+broker
+
+// brother : 2015-01-29 Brother Industries, Ltd.
+brother
+
+// brussels : 2014-02-06 DNS.be vzw
+brussels
+
+// budapest : 2013-11-21 Top Level Domain Holdings Limited
+budapest
+
+// bugatti : 2015-07-23 Bugatti International SA
+bugatti
+
+// build : 2013-11-07 Plan Bee LLC
+build
+
+// builders : 2013-11-07 Atomic Madison, LLC
+builders
+
+// business : 2013-11-07 Spring Cross, LLC
+business
+
+// buy : 2014-12-18 Amazon EU S.à r.l.
+buy
+
+// buzz : 2013-10-02 DOTSTRATEGY CO.
+buzz
+
+// bzh : 2014-02-27 Association www.bzh
+bzh
+
+// cab : 2013-10-24 Half Sunset, LLC
+cab
+
+// cafe : 2015-02-11 Pioneer Canyon, LLC
+cafe
+
+// cal : 2014-07-24 Charleston Road Registry Inc.
+cal
+
+// call : 2014-12-18 Amazon EU S.à r.l.
+call
+
+// calvinklein : 2015-07-30 PVH gTLD Holdings LLC
+calvinklein
+
+// cam : 2016-04-21 AC Webconnecting Holding B.V.
+cam
+
+// camera : 2013-08-27 Atomic Maple, LLC
+camera
+
+// camp : 2013-11-07 Delta Dynamite, LLC
+camp
+
+// cancerresearch : 2014-05-15 Australian Cancer Research Foundation
+cancerresearch
+
+// canon : 2014-09-12 Canon Inc.
+canon
+
+// capetown : 2014-03-24 ZA Central Registry NPC trading as ZA Central Registry
+capetown
+
+// capital : 2014-03-06 Delta Mill, LLC
+capital
+
+// capitalone : 2015-08-06 Capital One Financial Corporation
+capitalone
+
+// car : 2015-01-22
+car
+
+// caravan : 2013-12-12 Caravan International, Inc.
+caravan
+
+// cards : 2013-12-05 Foggy Hollow, LLC
+cards
+
+// care : 2014-03-06 Goose Cross
+care
+
+// career : 2013-10-09 dotCareer LLC
+career
+
+// careers : 2013-10-02 Wild Corner, LLC
+careers
+
+// cars : 2014-11-13
+cars
+
+// cartier : 2014-06-23 Richemont DNS Inc.
+cartier
+
+// casa : 2013-11-21 Top Level Domain Holdings Limited
+casa
+
+// case : 2015-09-03 CNH Industrial N.V.
+case
+
+// caseih : 2015-09-03 CNH Industrial N.V.
+caseih
+
+// cash : 2014-03-06 Delta Lake, LLC
+cash
+
+// casino : 2014-12-18 Binky Sky, LLC
+casino
+
+// catering : 2013-12-05 New Falls. LLC
+catering
+
+// catholic : 2015-10-21 Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication)
+catholic
+
+// cba : 2014-06-26 COMMONWEALTH BANK OF AUSTRALIA
+cba
+
+// cbn : 2014-08-22 The Christian Broadcasting Network, Inc.
+cbn
+
+// cbre : 2015-07-02 CBRE, Inc.
+cbre
+
+// cbs : 2015-08-06 CBS Domains Inc.
+cbs
+
+// ceb : 2015-04-09 The Corporate Executive Board Company
+ceb
+
+// center : 2013-11-07 Tin Mill, LLC
+center
+
+// ceo : 2013-11-07 CEOTLD Pty Ltd
+ceo
+
+// cern : 2014-06-05 European Organization for Nuclear Research ("CERN")
+cern
+
+// cfa : 2014-08-28 CFA Institute
+cfa
+
+// cfd : 2014-12-11 IG Group Holdings PLC
+cfd
+
+// chanel : 2015-04-09 Chanel International B.V.
+chanel
+
+// channel : 2014-05-08 Charleston Road Registry Inc.
+channel
+
+// chase : 2015-04-30 JPMorgan Chase & Co.
+chase
+
+// chat : 2014-12-04 Sand Fields, LLC
+chat
+
+// cheap : 2013-11-14 Sand Cover, LLC
+cheap
+
+// chintai : 2015-06-11 CHINTAI Corporation
+chintai
+
+// chloe : 2014-10-16 Richemont DNS Inc.
+chloe
+
+// christmas : 2013-11-21 Uniregistry, Corp.
+christmas
+
+// chrome : 2014-07-24 Charleston Road Registry Inc.
+chrome
+
+// chrysler : 2015-07-30 FCA US LLC.
+chrysler
+
+// church : 2014-02-06 Holly Fields, LLC
+church
+
+// cipriani : 2015-02-19 Hotel Cipriani Srl
+cipriani
+
+// circle : 2014-12-18 Amazon EU S.à r.l.
+circle
+
+// cisco : 2014-12-22 Cisco Technology, Inc.
+cisco
+
+// citadel : 2015-07-23 Citadel Domain LLC
+citadel
+
+// citi : 2015-07-30 Citigroup Inc.
+citi
+
+// citic : 2014-01-09 CITIC Group Corporation
+citic
+
+// city : 2014-05-29 Snow Sky, LLC
+city
+
+// cityeats : 2014-12-11 Lifestyle Domain Holdings, Inc.
+cityeats
+
+// claims : 2014-03-20 Black Corner, LLC
+claims
+
+// cleaning : 2013-12-05 Fox Shadow, LLC
+cleaning
+
+// click : 2014-06-05 Uniregistry, Corp.
+click
+
+// clinic : 2014-03-20 Goose Park, LLC
+clinic
+
+// clinique : 2015-10-01 The Estée Lauder Companies Inc.
+clinique
+
+// clothing : 2013-08-27 Steel Lake, LLC
+clothing
+
+// cloud : 2015-04-16 ARUBA S.p.A.
+cloud
+
+// club : 2013-11-08 .CLUB DOMAINS, LLC
+club
+
+// clubmed : 2015-06-25 Club Méditerranée S.A.
+clubmed
+
+// coach : 2014-10-09 Koko Island, LLC
+coach
+
+// codes : 2013-10-31 Puff Willow, LLC
+codes
+
+// coffee : 2013-10-17 Trixy Cover, LLC
+coffee
+
+// college : 2014-01-16 XYZ.COM LLC
+college
+
+// cologne : 2014-02-05 NetCologne Gesellschaft für Telekommunikation mbH
+cologne
+
+// comcast : 2015-07-23 Comcast IP Holdings I, LLC
+comcast
+
+// commbank : 2014-06-26 COMMONWEALTH BANK OF AUSTRALIA
+commbank
+
+// community : 2013-12-05 Fox Orchard, LLC
+community
+
+// company : 2013-11-07 Silver Avenue, LLC
+company
+
+// compare : 2015-10-08 iSelect Ltd
+compare
+
+// computer : 2013-10-24 Pine Mill, LLC
+computer
+
+// comsec : 2015-01-08 VeriSign, Inc.
+comsec
+
+// condos : 2013-12-05 Pine House, LLC
+condos
+
+// construction : 2013-09-16 Fox Dynamite, LLC
+construction
+
+// consulting : 2013-12-05
+consulting
+
+// contact : 2015-01-08 Top Level Spectrum, Inc.
+contact
+
+// contractors : 2013-09-10 Magic Woods, LLC
+contractors
+
+// cooking : 2013-11-21 Top Level Domain Holdings Limited
+cooking
+
+// cookingchannel : 2015-07-02 Lifestyle Domain Holdings, Inc.
+cookingchannel
+
+// cool : 2013-11-14 Koko Lake, LLC
+cool
+
+// corsica : 2014-09-25 Collectivité Territoriale de Corse
+corsica
+
+// country : 2013-12-19 Top Level Domain Holdings Limited
+country
+
+// coupon : 2015-02-26 Amazon EU S.à r.l.
+coupon
+
+// coupons : 2015-03-26 Black Island, LLC
+coupons
+
+// courses : 2014-12-04 OPEN UNIVERSITIES AUSTRALIA PTY LTD
+courses
+
+// credit : 2014-03-20 Snow Shadow, LLC
+credit
+
+// creditcard : 2014-03-20 Binky Frostbite, LLC
+creditcard
+
+// creditunion : 2015-01-22 CUNA Performance Resources, LLC
+creditunion
+
+// cricket : 2014-10-09 dot Cricket Limited
+cricket
+
+// crown : 2014-10-24 Crown Equipment Corporation
+crown
+
+// crs : 2014-04-03 Federated Co-operatives Limited
+crs
+
+// cruise : 2015-12-10 Viking River Cruises (Bermuda) Ltd.
+cruise
+
+// cruises : 2013-12-05 Spring Way, LLC
+cruises
+
+// csc : 2014-09-25 Alliance-One Services, Inc.
+csc
+
+// cuisinella : 2014-04-03 SALM S.A.S.
+cuisinella
+
+// cymru : 2014-05-08 Nominet UK
+cymru
+
+// cyou : 2015-01-22 Beijing Gamease Age Digital Technology Co., Ltd.
+cyou
+
+// dabur : 2014-02-06 Dabur India Limited
+dabur
+
+// dad : 2014-01-23 Charleston Road Registry Inc.
+dad
+
+// dance : 2013-10-24 United TLD Holdco Ltd.
+dance
+
+// data : 2016-06-02 Dish DBS Corporation
+data
+
+// date : 2014-11-20 dot Date Limited
+date
+
+// dating : 2013-12-05 Pine Fest, LLC
+dating
+
+// datsun : 2014-03-27 NISSAN MOTOR CO., LTD.
+datsun
+
+// day : 2014-01-30 Charleston Road Registry Inc.
+day
+
+// dclk : 2014-11-20 Charleston Road Registry Inc.
+dclk
+
+// dds : 2015-05-07 Top Level Domain Holdings Limited
+dds
+
+// deal : 2015-06-25 Amazon EU S.à r.l.
+deal
+
+// dealer : 2014-12-22 Dealer Dot Com, Inc.
+dealer
+
+// deals : 2014-05-22 Sand Sunset, LLC
+deals
+
+// degree : 2014-03-06
+degree
+
+// delivery : 2014-09-11 Steel Station, LLC
+delivery
+
+// dell : 2014-10-24 Dell Inc.
+dell
+
+// deloitte : 2015-07-31 Deloitte Touche Tohmatsu
+deloitte
+
+// delta : 2015-02-19 Delta Air Lines, Inc.
+delta
+
+// democrat : 2013-10-24 United TLD Holdco Ltd.
+democrat
+
+// dental : 2014-03-20 Tin Birch, LLC
+dental
+
+// dentist : 2014-03-20
+dentist
+
+// desi : 2013-11-14 Desi Networks LLC
+desi
+
+// design : 2014-11-07 Top Level Design, LLC
+design
+
+// dev : 2014-10-16 Charleston Road Registry Inc.
+dev
+
+// dhl : 2015-07-23 Deutsche Post AG
+dhl
+
+// diamonds : 2013-09-22 John Edge, LLC
+diamonds
+
+// diet : 2014-06-26 Uniregistry, Corp.
+diet
+
+// digital : 2014-03-06 Dash Park, LLC
+digital
+
+// direct : 2014-04-10 Half Trail, LLC
+direct
+
+// directory : 2013-09-20 Extra Madison, LLC
+directory
+
+// discount : 2014-03-06 Holly Hill, LLC
+discount
+
+// discover : 2015-07-23 Discover Financial Services
+discover
+
+// dish : 2015-07-30 Dish DBS Corporation
+dish
+
+// diy : 2015-11-05 Lifestyle Domain Holdings, Inc.
+diy
+
+// dnp : 2013-12-13 Dai Nippon Printing Co., Ltd.
+dnp
+
+// docs : 2014-10-16 Charleston Road Registry Inc.
+docs
+
+// doctor : 2016-06-02 Brice Trail, LLC
+doctor
+
+// dodge : 2015-07-30 FCA US LLC.
+dodge
+
+// dog : 2014-12-04 Koko Mill, LLC
+dog
+
+// doha : 2014-09-18 Communications Regulatory Authority (CRA)
+doha
+
+// domains : 2013-10-17 Sugar Cross, LLC
+domains
+
+// dot : 2015-05-21 Dish DBS Corporation
+dot
+
+// download : 2014-11-20 dot Support Limited
+download
+
+// drive : 2015-03-05 Charleston Road Registry Inc.
+drive
+
+// dtv : 2015-06-04 Dish DBS Corporation
+dtv
+
+// dubai : 2015-01-01 Dubai Smart Government Department
+dubai
+
+// duck : 2015-07-23 Johnson Shareholdings, Inc.
+duck
+
+// dunlop : 2015-07-02 The Goodyear Tire & Rubber Company
+dunlop
+
+// duns : 2015-08-06 The Dun & Bradstreet Corporation
+duns
+
+// dupont : 2015-06-25 E. I. du Pont de Nemours and Company
+dupont
+
+// durban : 2014-03-24 ZA Central Registry NPC trading as ZA Central Registry
+durban
+
+// dvag : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG
+dvag
+
+// dvr : 2016-05-26 Hughes Satellite Systems Corporation
+dvr
+
+// dwg : 2015-07-23 Autodesk, Inc.
+dwg
+
+// earth : 2014-12-04 Interlink Co., Ltd.
+earth
+
+// eat : 2014-01-23 Charleston Road Registry Inc.
+eat
+
+// eco : 2016-07-08 Big Room Inc.
+eco
+
+// edeka : 2014-12-18 EDEKA Verband kaufmännischer Genossenschaften e.V.
+edeka
+
+// education : 2013-11-07 Brice Way, LLC
+education
+
+// email : 2013-10-31 Spring Madison, LLC
+email
+
+// emerck : 2014-04-03 Merck KGaA
+emerck
+
+// energy : 2014-09-11 Binky Birch, LLC
+energy
+
+// engineer : 2014-03-06 United TLD Holdco Ltd.
+engineer
+
+// engineering : 2014-03-06 Romeo Canyon
+engineering
+
+// enterprises : 2013-09-20 Snow Oaks, LLC
+enterprises
+
+// epost : 2015-07-23 Deutsche Post AG
+epost
+
+// epson : 2014-12-04 Seiko Epson Corporation
+epson
+
+// equipment : 2013-08-27 Corn Station, LLC
+equipment
+
+// ericsson : 2015-07-09 Telefonaktiebolaget L M Ericsson
+ericsson
+
+// erni : 2014-04-03 ERNI Group Holding AG
+erni
+
+// esq : 2014-05-08 Charleston Road Registry Inc.
+esq
+
+// estate : 2013-08-27 Trixy Park, LLC
+estate
+
+// esurance : 2015-07-23 Esurance Insurance Company
+esurance
+
+// etisalat : 2015-09-03 Emirates Telecommunications Corporation (trading as Etisalat)
+etisalat
+
+// eurovision : 2014-04-24 European Broadcasting Union (EBU)
+eurovision
+
+// eus : 2013-12-12 Puntueus Fundazioa
+eus
+
+// events : 2013-12-05 Pioneer Maple, LLC
+events
+
+// everbank : 2014-05-15 EverBank
+everbank
+
+// exchange : 2014-03-06 Spring Falls, LLC
+exchange
+
+// expert : 2013-11-21 Magic Pass, LLC
+expert
+
+// exposed : 2013-12-05 Victor Beach, LLC
+exposed
+
+// express : 2015-02-11 Sea Sunset, LLC
+express
+
+// extraspace : 2015-05-14 Extra Space Storage LLC
+extraspace
+
+// fage : 2014-12-18 Fage International S.A.
+fage
+
+// fail : 2014-03-06 Atomic Pipe, LLC
+fail
+
+// fairwinds : 2014-11-13 FairWinds Partners, LLC
+fairwinds
+
+// faith : 2014-11-20 dot Faith Limited
+faith
+
+// family : 2015-04-02
+family
+
+// fan : 2014-03-06
+fan
+
+// fans : 2014-11-07 Asiamix Digital Limited
+fans
+
+// farm : 2013-11-07 Just Maple, LLC
+farm
+
+// farmers : 2015-07-09 Farmers Insurance Exchange
+farmers
+
+// fashion : 2014-07-03 Top Level Domain Holdings Limited
+fashion
+
+// fast : 2014-12-18 Amazon EU S.à r.l.
+fast
+
+// fedex : 2015-08-06 Federal Express Corporation
+fedex
+
+// feedback : 2013-12-19 Top Level Spectrum, Inc.
+feedback
+
+// ferrari : 2015-07-31 Fiat Chrysler Automobiles N.V.
+ferrari
+
+// ferrero : 2014-12-18 Ferrero Trading Lux S.A.
+ferrero
+
+// fiat : 2015-07-31 Fiat Chrysler Automobiles N.V.
+fiat
+
+// fidelity : 2015-07-30 Fidelity Brokerage Services LLC
+fidelity
+
+// fido : 2015-08-06 Rogers Communications Partnership
+fido
+
+// film : 2015-01-08 Motion Picture Domain Registry Pty Ltd
+film
+
+// final : 2014-10-16 Núcleo de Informação e Coordenação do Ponto BR - NIC.br
+final
+
+// finance : 2014-03-20 Cotton Cypress, LLC
+finance
+
+// financial : 2014-03-06 Just Cover, LLC
+financial
+
+// fire : 2015-06-25 Amazon EU S.à r.l.
+fire
+
+// firestone : 2014-12-18 Bridgestone Corporation
+firestone
+
+// firmdale : 2014-03-27 Firmdale Holdings Limited
+firmdale
+
+// fish : 2013-12-12 Fox Woods, LLC
+fish
+
+// fishing : 2013-11-21 Top Level Domain Holdings Limited
+fishing
+
+// fit : 2014-11-07 Top Level Domain Holdings Limited
+fit
+
+// fitness : 2014-03-06 Brice Orchard, LLC
+fitness
+
+// flickr : 2015-04-02 Yahoo! Domain Services Inc.
+flickr
+
+// flights : 2013-12-05 Fox Station, LLC
+flights
+
+// flir : 2015-07-23 FLIR Systems, Inc.
+flir
+
+// florist : 2013-11-07 Half Cypress, LLC
+florist
+
+// flowers : 2014-10-09 Uniregistry, Corp.
+flowers
+
+// fly : 2014-05-08 Charleston Road Registry Inc.
+fly
+
+// foo : 2014-01-23 Charleston Road Registry Inc.
+foo
+
+// food : 2016-04-21 Lifestyle Domain Holdings, Inc.
+food
+
+// foodnetwork : 2015-07-02 Lifestyle Domain Holdings, Inc.
+foodnetwork
+
+// football : 2014-12-18 Foggy Farms, LLC
+football
+
+// ford : 2014-11-13 Ford Motor Company
+ford
+
+// forex : 2014-12-11 IG Group Holdings PLC
+forex
+
+// forsale : 2014-05-22
+forsale
+
+// forum : 2015-04-02 Fegistry, LLC
+forum
+
+// foundation : 2013-12-05 John Dale, LLC
+foundation
+
+// fox : 2015-09-11 FOX Registry, LLC
+fox
+
+// free : 2015-12-10 Amazon EU S.à r.l.
+free
+
+// fresenius : 2015-07-30 Fresenius Immobilien-Verwaltungs-GmbH
+fresenius
+
+// frl : 2014-05-15 FRLregistry B.V.
+frl
+
+// frogans : 2013-12-19 OP3FT
+frogans
+
+// frontdoor : 2015-07-02 Lifestyle Domain Holdings, Inc.
+frontdoor
+
+// frontier : 2015-02-05 Frontier Communications Corporation
+frontier
+
+// ftr : 2015-07-16 Frontier Communications Corporation
+ftr
+
+// fujitsu : 2015-07-30 Fujitsu Limited
+fujitsu
+
+// fujixerox : 2015-07-23 Xerox DNHC LLC
+fujixerox
+
+// fun : 2016-01-14
+fun
+
+// fund : 2014-03-20 John Castle, LLC
+fund
+
+// furniture : 2014-03-20 Lone Fields, LLC
+furniture
+
+// futbol : 2013-09-20
+futbol
+
+// fyi : 2015-04-02 Silver Tigers, LLC
+fyi
+
+// gal : 2013-11-07 Asociación puntoGAL
+gal
+
+// gallery : 2013-09-13 Sugar House, LLC
+gallery
+
+// gallo : 2015-06-11 Gallo Vineyards, Inc.
+gallo
+
+// gallup : 2015-02-19 Gallup, Inc.
+gallup
+
+// game : 2015-05-28 Uniregistry, Corp.
+game
+
+// games : 2015-05-28
+games
+
+// gap : 2015-07-31 The Gap, Inc.
+gap
+
+// garden : 2014-06-26 Top Level Domain Holdings Limited
+garden
+
+// gbiz : 2014-07-17 Charleston Road Registry Inc.
+gbiz
+
+// gdn : 2014-07-31 Joint Stock Company "Navigation-information systems"
+gdn
+
+// gea : 2014-12-04 GEA Group Aktiengesellschaft
+gea
+
+// gent : 2014-01-23 COMBELL GROUP NV/SA
+gent
+
+// genting : 2015-03-12 Resorts World Inc Pte. Ltd.
+genting
+
+// george : 2015-07-31 Wal-Mart Stores, Inc.
+george
+
+// ggee : 2014-01-09 GMO Internet, Inc.
+ggee
+
+// gift : 2013-10-17 Uniregistry, Corp.
+gift
+
+// gifts : 2014-07-03 Goose Sky, LLC
+gifts
+
+// gives : 2014-03-06 United TLD Holdco Ltd.
+gives
+
+// giving : 2014-11-13 Giving Limited
+giving
+
+// glade : 2015-07-23 Johnson Shareholdings, Inc.
+glade
+
+// glass : 2013-11-07 Black Cover, LLC
+glass
+
+// gle : 2014-07-24 Charleston Road Registry Inc.
+gle
+
+// global : 2014-04-17 Dot GLOBAL AS
+global
+
+// globo : 2013-12-19 Globo Comunicação e Participações S.A
+globo
+
+// gmail : 2014-05-01 Charleston Road Registry Inc.
+gmail
+
+// gmbh : 2016-01-29 Extra Dynamite, LLC
+gmbh
+
+// gmo : 2014-01-09 GMO Internet, Inc.
+gmo
+
+// gmx : 2014-04-24 1&1 Mail & Media GmbH
+gmx
+
+// godaddy : 2015-07-23 Go Daddy East, LLC
+godaddy
+
+// gold : 2015-01-22 June Edge, LLC
+gold
+
+// goldpoint : 2014-11-20 YODOBASHI CAMERA CO.,LTD.
+goldpoint
+
+// golf : 2014-12-18 Lone falls, LLC
+golf
+
+// goo : 2014-12-18 NTT Resonant Inc.
+goo
+
+// goodhands : 2015-07-31 Allstate Fire and Casualty Insurance Company
+goodhands
+
+// goodyear : 2015-07-02 The Goodyear Tire & Rubber Company
+goodyear
+
+// goog : 2014-11-20 Charleston Road Registry Inc.
+goog
+
+// google : 2014-07-24 Charleston Road Registry Inc.
+google
+
+// gop : 2014-01-16 Republican State Leadership Committee, Inc.
+gop
+
+// got : 2014-12-18 Amazon EU S.à r.l.
+got
+
+// grainger : 2015-05-07 Grainger Registry Services, LLC
+grainger
+
+// graphics : 2013-09-13 Over Madison, LLC
+graphics
+
+// gratis : 2014-03-20 Pioneer Tigers, LLC
+gratis
+
+// green : 2014-05-08 Afilias Limited
+green
+
+// gripe : 2014-03-06 Corn Sunset, LLC
+gripe
+
+// grocery : 2016-06-16 Wal-Mart Stores, Inc.
+grocery
+
+// group : 2014-08-15 Romeo Town, LLC
+group
+
+// guardian : 2015-07-30 The Guardian Life Insurance Company of America
+guardian
+
+// gucci : 2014-11-13 Guccio Gucci S.p.a.
+gucci
+
+// guge : 2014-08-28 Charleston Road Registry Inc.
+guge
+
+// guide : 2013-09-13 Snow Moon, LLC
+guide
+
+// guitars : 2013-11-14 Uniregistry, Corp.
+guitars
+
+// guru : 2013-08-27 Pioneer Cypress, LLC
+guru
+
+// hair : 2015-12-03 L'Oréal
+hair
+
+// hamburg : 2014-02-20 Hamburg Top-Level-Domain GmbH
+hamburg
+
+// hangout : 2014-11-13 Charleston Road Registry Inc.
+hangout
+
+// haus : 2013-12-05
+haus
+
+// hbo : 2015-07-30 HBO Registry Services, Inc.
+hbo
+
+// hdfc : 2015-07-30 HOUSING DEVELOPMENT FINANCE CORPORATION LIMITED
+hdfc
+
+// hdfcbank : 2015-02-12 HDFC Bank Limited
+hdfcbank
+
+// health : 2015-02-11 DotHealth, LLC
+health
+
+// healthcare : 2014-06-12 Silver Glen, LLC
+healthcare
+
+// help : 2014-06-26 Uniregistry, Corp.
+help
+
+// helsinki : 2015-02-05 City of Helsinki
+helsinki
+
+// here : 2014-02-06 Charleston Road Registry Inc.
+here
+
+// hermes : 2014-07-10 HERMES INTERNATIONAL
+hermes
+
+// hgtv : 2015-07-02 Lifestyle Domain Holdings, Inc.
+hgtv
+
+// hiphop : 2014-03-06 Uniregistry, Corp.
+hiphop
+
+// hisamitsu : 2015-07-16 Hisamitsu Pharmaceutical Co.,Inc.
+hisamitsu
+
+// hitachi : 2014-10-31 Hitachi, Ltd.
+hitachi
+
+// hiv : 2014-03-13
+hiv
+
+// hkt : 2015-05-14 PCCW-HKT DataCom Services Limited
+hkt
+
+// hockey : 2015-03-19 Half Willow, LLC
+hockey
+
+// holdings : 2013-08-27 John Madison, LLC
+holdings
+
+// holiday : 2013-11-07 Goose Woods, LLC
+holiday
+
+// homedepot : 2015-04-02 Homer TLC, Inc.
+homedepot
+
+// homegoods : 2015-07-16 The TJX Companies, Inc.
+homegoods
+
+// homes : 2014-01-09 DERHomes, LLC
+homes
+
+// homesense : 2015-07-16 The TJX Companies, Inc.
+homesense
+
+// honda : 2014-12-18 Honda Motor Co., Ltd.
+honda
+
+// honeywell : 2015-07-23 Honeywell GTLD LLC
+honeywell
+
+// horse : 2013-11-21 Top Level Domain Holdings Limited
+horse
+
+// hospital : 2016-10-20 Ruby Pike, LLC
+hospital
+
+// host : 2014-04-17 DotHost Inc.
+host
+
+// hosting : 2014-05-29 Uniregistry, Corp.
+hosting
+
+// hot : 2015-08-27 Amazon EU S.à r.l.
+hot
+
+// hoteles : 2015-03-05 Travel Reservations SRL
+hoteles
+
+// hotels : 2016-04-07 Booking.com B.V.
+hotels
+
+// hotmail : 2014-12-18 Microsoft Corporation
+hotmail
+
+// house : 2013-11-07 Sugar Park, LLC
+house
+
+// how : 2014-01-23 Charleston Road Registry Inc.
+how
+
+// hsbc : 2014-10-24 HSBC Holdings PLC
+hsbc
+
+// htc : 2015-04-02 HTC corporation
+htc
+
+// hughes : 2015-07-30 Hughes Satellite Systems Corporation
+hughes
+
+// hyatt : 2015-07-30 Hyatt GTLD, L.L.C.
+hyatt
+
+// hyundai : 2015-07-09 Hyundai Motor Company
+hyundai
+
+// ibm : 2014-07-31 International Business Machines Corporation
+ibm
+
+// icbc : 2015-02-19 Industrial and Commercial Bank of China Limited
+icbc
+
+// ice : 2014-10-30 IntercontinentalExchange, Inc.
+ice
+
+// icu : 2015-01-08 One.com A/S
+icu
+
+// ieee : 2015-07-23 IEEE Global LLC
+ieee
+
+// ifm : 2014-01-30 ifm electronic gmbh
+ifm
+
+// iinet : 2014-07-03 Connect West Pty. Ltd.
+iinet
+
+// ikano : 2015-07-09 Ikano S.A.
+ikano
+
+// imamat : 2015-08-06 Fondation Aga Khan (Aga Khan Foundation)
+imamat
+
+// imdb : 2015-06-25 Amazon EU S.à r.l.
+imdb
+
+// immo : 2014-07-10 Auburn Bloom, LLC
+immo
+
+// immobilien : 2013-11-07 United TLD Holdco Ltd.
+immobilien
+
+// industries : 2013-12-05 Outer House, LLC
+industries
+
+// infiniti : 2014-03-27 NISSAN MOTOR CO., LTD.
+infiniti
+
+// ing : 2014-01-23 Charleston Road Registry Inc.
+ing
+
+// ink : 2013-12-05 Top Level Design, LLC
+ink
+
+// institute : 2013-11-07 Outer Maple, LLC
+institute
+
+// insurance : 2015-02-19 fTLD Registry Services LLC
+insurance
+
+// insure : 2014-03-20 Pioneer Willow, LLC
+insure
+
+// intel : 2015-08-06 Intel Corporation
+intel
+
+// international : 2013-11-07 Wild Way, LLC
+international
+
+// intuit : 2015-07-30 Intuit Administrative Services, Inc.
+intuit
+
+// investments : 2014-03-20 Holly Glen, LLC
+investments
+
+// ipiranga : 2014-08-28 Ipiranga Produtos de Petroleo S.A.
+ipiranga
+
+// irish : 2014-08-07 Dot-Irish LLC
+irish
+
+// iselect : 2015-02-11 iSelect Ltd
+iselect
+
+// ismaili : 2015-08-06 Fondation Aga Khan (Aga Khan Foundation)
+ismaili
+
+// ist : 2014-08-28 Istanbul Metropolitan Municipality
+ist
+
+// istanbul : 2014-08-28 Istanbul Metropolitan Municipality
+istanbul
+
+// itau : 2014-10-02 Itau Unibanco Holding S.A.
+itau
+
+// itv : 2015-07-09 ITV Services Limited
+itv
+
+// iveco : 2015-09-03 CNH Industrial N.V.
+iveco
+
+// iwc : 2014-06-23 Richemont DNS Inc.
+iwc
+
+// jaguar : 2014-11-13 Jaguar Land Rover Ltd
+jaguar
+
+// java : 2014-06-19 Oracle Corporation
+java
+
+// jcb : 2014-11-20 JCB Co., Ltd.
+jcb
+
+// jcp : 2015-04-23 JCP Media, Inc.
+jcp
+
+// jeep : 2015-07-30 FCA US LLC.
+jeep
+
+// jetzt : 2014-01-09
+jetzt
+
+// jewelry : 2015-03-05 Wild Bloom, LLC
+jewelry
+
+// jio : 2015-04-02 Affinity Names, Inc.
+jio
+
+// jlc : 2014-12-04 Richemont DNS Inc.
+jlc
+
+// jll : 2015-04-02 Jones Lang LaSalle Incorporated
+jll
+
+// jmp : 2015-03-26 Matrix IP LLC
+jmp
+
+// jnj : 2015-06-18 Johnson & Johnson Services, Inc.
+jnj
+
+// joburg : 2014-03-24 ZA Central Registry NPC trading as ZA Central Registry
+joburg
+
+// jot : 2014-12-18 Amazon EU S.à r.l.
+jot
+
+// joy : 2014-12-18 Amazon EU S.à r.l.
+joy
+
+// jpmorgan : 2015-04-30 JPMorgan Chase & Co.
+jpmorgan
+
+// jprs : 2014-09-18 Japan Registry Services Co., Ltd.
+jprs
+
+// juegos : 2014-03-20 Uniregistry, Corp.
+juegos
+
+// juniper : 2015-07-30 JUNIPER NETWORKS, INC.
+juniper
+
+// kaufen : 2013-11-07 United TLD Holdco Ltd.
+kaufen
+
+// kddi : 2014-09-12 KDDI CORPORATION
+kddi
+
+// kerryhotels : 2015-04-30 Kerry Trading Co. Limited
+kerryhotels
+
+// kerrylogistics : 2015-04-09 Kerry Trading Co. Limited
+kerrylogistics
+
+// kerryproperties : 2015-04-09 Kerry Trading Co. Limited
+kerryproperties
+
+// kfh : 2014-12-04 Kuwait Finance House
+kfh
+
+// kia : 2015-07-09 KIA MOTORS CORPORATION
+kia
+
+// kim : 2013-09-23 Afilias Limited
+kim
+
+// kinder : 2014-11-07 Ferrero Trading Lux S.A.
+kinder
+
+// kindle : 2015-06-25 Amazon EU S.à r.l.
+kindle
+
+// kitchen : 2013-09-20 Just Goodbye, LLC
+kitchen
+
+// kiwi : 2013-09-20 DOT KIWI LIMITED
+kiwi
+
+// koeln : 2014-01-09 NetCologne Gesellschaft für Telekommunikation mbH
+koeln
+
+// komatsu : 2015-01-08 Komatsu Ltd.
+komatsu
+
+// kosher : 2015-08-20 Kosher Marketing Assets LLC
+kosher
+
+// kpmg : 2015-04-23 KPMG International Cooperative (KPMG International Genossenschaft)
+kpmg
+
+// kpn : 2015-01-08 Koninklijke KPN N.V.
+kpn
+
+// krd : 2013-12-05 KRG Department of Information Technology
+krd
+
+// kred : 2013-12-19 KredTLD Pty Ltd
+kred
+
+// kuokgroup : 2015-04-09 Kerry Trading Co. Limited
+kuokgroup
+
+// kyoto : 2014-11-07 Academic Institution: Kyoto Jyoho Gakuen
+kyoto
+
+// lacaixa : 2014-01-09 CAIXA D'ESTALVIS I PENSIONS DE BARCELONA
+lacaixa
+
+// ladbrokes : 2015-08-06 LADBROKES INTERNATIONAL PLC
+ladbrokes
+
+// lamborghini : 2015-06-04 Automobili Lamborghini S.p.A.
+lamborghini
+
+// lamer : 2015-10-01 The Estée Lauder Companies Inc.
+lamer
+
+// lancaster : 2015-02-12 LANCASTER
+lancaster
+
+// lancia : 2015-07-31 Fiat Chrysler Automobiles N.V.
+lancia
+
+// lancome : 2015-07-23 L'Oréal
+lancome
+
+// land : 2013-09-10 Pine Moon, LLC
+land
+
+// landrover : 2014-11-13 Jaguar Land Rover Ltd
+landrover
+
+// lanxess : 2015-07-30 LANXESS Corporation
+lanxess
+
+// lasalle : 2015-04-02 Jones Lang LaSalle Incorporated
+lasalle
+
+// lat : 2014-10-16 ECOM-LAC Federaciòn de Latinoamèrica y el Caribe para Internet y el Comercio Electrònico
+lat
+
+// latino : 2015-07-30 Dish DBS Corporation
+latino
+
+// latrobe : 2014-06-16 La Trobe University
+latrobe
+
+// law : 2015-01-22 Minds + Machines Group Limited
+law
+
+// lawyer : 2014-03-20
+lawyer
+
+// lds : 2014-03-20 IRI Domain Management, LLC ("Applicant")
+lds
+
+// lease : 2014-03-06 Victor Trail, LLC
+lease
+
+// leclerc : 2014-08-07 A.C.D. LEC Association des Centres Distributeurs Edouard Leclerc
+leclerc
+
+// lefrak : 2015-07-16 LeFrak Organization, Inc.
+lefrak
+
+// legal : 2014-10-16 Blue Falls, LLC
+legal
+
+// lego : 2015-07-16 LEGO Juris A/S
+lego
+
+// lexus : 2015-04-23 TOYOTA MOTOR CORPORATION
+lexus
+
+// lgbt : 2014-05-08 Afilias Limited
+lgbt
+
+// liaison : 2014-10-02 Liaison Technologies, Incorporated
+liaison
+
+// lidl : 2014-09-18 Schwarz Domains und Services GmbH & Co. KG
+lidl
+
+// life : 2014-02-06 Trixy Oaks, LLC
+life
+
+// lifeinsurance : 2015-01-15 American Council of Life Insurers
+lifeinsurance
+
+// lifestyle : 2014-12-11 Lifestyle Domain Holdings, Inc.
+lifestyle
+
+// lighting : 2013-08-27 John McCook, LLC
+lighting
+
+// like : 2014-12-18 Amazon EU S.à r.l.
+like
+
+// lilly : 2015-07-31 Eli Lilly and Company
+lilly
+
+// limited : 2014-03-06 Big Fest, LLC
+limited
+
+// limo : 2013-10-17 Hidden Frostbite, LLC
+limo
+
+// lincoln : 2014-11-13 Ford Motor Company
+lincoln
+
+// linde : 2014-12-04 Linde Aktiengesellschaft
+linde
+
+// link : 2013-11-14 Uniregistry, Corp.
+link
+
+// lipsy : 2015-06-25 Lipsy Ltd
+lipsy
+
+// live : 2014-12-04
+live
+
+// living : 2015-07-30 Lifestyle Domain Holdings, Inc.
+living
+
+// lixil : 2015-03-19 LIXIL Group Corporation
+lixil
+
+// loan : 2014-11-20 dot Loan Limited
+loan
+
+// loans : 2014-03-20 June Woods, LLC
+loans
+
+// locker : 2015-06-04 Dish DBS Corporation
+locker
+
+// locus : 2015-06-25 Locus Analytics LLC
+locus
+
+// loft : 2015-07-30 Annco, Inc.
+loft
+
+// lol : 2015-01-30 Uniregistry, Corp.
+lol
+
+// london : 2013-11-14 Dot London Domains Limited
+london
+
+// lotte : 2014-11-07 Lotte Holdings Co., Ltd.
+lotte
+
+// lotto : 2014-04-10 Afilias Limited
+lotto
+
+// love : 2014-12-22 Merchant Law Group LLP
+love
+
+// lpl : 2015-07-30 LPL Holdings, Inc.
+lpl
+
+// lplfinancial : 2015-07-30 LPL Holdings, Inc.
+lplfinancial
+
+// ltd : 2014-09-25 Over Corner, LLC
+ltd
+
+// ltda : 2014-04-17 DOMAIN ROBOT SERVICOS DE HOSPEDAGEM NA INTERNET LTDA
+ltda
+
+// lundbeck : 2015-08-06 H. Lundbeck A/S
+lundbeck
+
+// lupin : 2014-11-07 LUPIN LIMITED
+lupin
+
+// luxe : 2014-01-09 Top Level Domain Holdings Limited
+luxe
+
+// luxury : 2013-10-17 Luxury Partners, LLC
+luxury
+
+// macys : 2015-07-31 Macys, Inc.
+macys
+
+// madrid : 2014-05-01 Comunidad de Madrid
+madrid
+
+// maif : 2014-10-02 Mutuelle Assurance Instituteur France (MAIF)
+maif
+
+// maison : 2013-12-05 Victor Frostbite, LLC
+maison
+
+// makeup : 2015-01-15 L'Oréal
+makeup
+
+// man : 2014-12-04 MAN SE
+man
+
+// management : 2013-11-07 John Goodbye, LLC
+management
+
+// mango : 2013-10-24 PUNTO FA S.L.
+mango
+
+// map : 2016-06-09 Charleston Road Registry Inc.
+map
+
+// market : 2014-03-06
+market
+
+// marketing : 2013-11-07 Fern Pass, LLC
+marketing
+
+// markets : 2014-12-11 IG Group Holdings PLC
+markets
+
+// marriott : 2014-10-09 Marriott Worldwide Corporation
+marriott
+
+// marshalls : 2015-07-16 The TJX Companies, Inc.
+marshalls
+
+// maserati : 2015-07-31 Fiat Chrysler Automobiles N.V.
+maserati
+
+// mattel : 2015-08-06 Mattel Sites, Inc.
+mattel
+
+// mba : 2015-04-02 Lone Hollow, LLC
+mba
+
+// mcd : 2015-07-30 McDonald’s Corporation
+mcd
+
+// mcdonalds : 2015-07-30 McDonald’s Corporation
+mcdonalds
+
+// mckinsey : 2015-07-31 McKinsey Holdings, Inc.
+mckinsey
+
+// med : 2015-08-06 Medistry LLC
+med
+
+// media : 2014-03-06 Grand Glen, LLC
+media
+
+// meet : 2014-01-16
+meet
+
+// melbourne : 2014-05-29 The Crown in right of the State of Victoria, represented by its Department of State Development, Business and Innovation
+melbourne
+
+// meme : 2014-01-30 Charleston Road Registry Inc.
+meme
+
+// memorial : 2014-10-16 Dog Beach, LLC
+memorial
+
+// men : 2015-02-26 Exclusive Registry Limited
+men
+
+// menu : 2013-09-11 Wedding TLD2, LLC
+menu
+
+// meo : 2014-11-07 PT Comunicacoes S.A.
+meo
+
+// merckmsd : 2016-07-14 MSD Registry Holdings, Inc.
+merckmsd
+
+// metlife : 2015-05-07 MetLife Services and Solutions, LLC
+metlife
+
+// miami : 2013-12-19 Top Level Domain Holdings Limited
+miami
+
+// microsoft : 2014-12-18 Microsoft Corporation
+microsoft
+
+// mini : 2014-01-09 Bayerische Motoren Werke Aktiengesellschaft
+mini
+
+// mint : 2015-07-30 Intuit Administrative Services, Inc.
+mint
+
+// mit : 2015-07-02 Massachusetts Institute of Technology
+mit
+
+// mitsubishi : 2015-07-23 Mitsubishi Corporation
+mitsubishi
+
+// mlb : 2015-05-21 MLB Advanced Media DH, LLC
+mlb
+
+// mls : 2015-04-23 The Canadian Real Estate Association
+mls
+
+// mma : 2014-11-07 MMA IARD
+mma
+
+// mobile : 2016-06-02 Dish DBS Corporation
+mobile
+
+// mobily : 2014-12-18 GreenTech Consultancy Company W.L.L.
+mobily
+
+// moda : 2013-11-07 United TLD Holdco Ltd.
+moda
+
+// moe : 2013-11-13 Interlink Co., Ltd.
+moe
+
+// moi : 2014-12-18 Amazon EU S.à r.l.
+moi
+
+// mom : 2015-04-16 Uniregistry, Corp.
+mom
+
+// monash : 2013-09-30 Monash University
+monash
+
+// money : 2014-10-16 Outer McCook, LLC
+money
+
+// monster : 2015-09-11 Monster Worldwide, Inc.
+monster
+
+// montblanc : 2014-06-23 Richemont DNS Inc.
+montblanc
+
+// mopar : 2015-07-30 FCA US LLC.
+mopar
+
+// mormon : 2013-12-05 IRI Domain Management, LLC ("Applicant")
+mormon
+
+// mortgage : 2014-03-20
+mortgage
+
+// moscow : 2013-12-19 Foundation for Assistance for Internet Technologies and Infrastructure Development (FAITID)
+moscow
+
+// moto : 2015-06-04
+moto
+
+// motorcycles : 2014-01-09 DERMotorcycles, LLC
+motorcycles
+
+// mov : 2014-01-30 Charleston Road Registry Inc.
+mov
+
+// movie : 2015-02-05 New Frostbite, LLC
+movie
+
+// movistar : 2014-10-16 Telefónica S.A.
+movistar
+
+// msd : 2015-07-23 MSD Registry Holdings, Inc.
+msd
+
+// mtn : 2014-12-04 MTN Dubai Limited
+mtn
+
+// mtpc : 2014-11-20 Mitsubishi Tanabe Pharma Corporation
+mtpc
+
+// mtr : 2015-03-12 MTR Corporation Limited
+mtr
+
+// mutual : 2015-04-02 Northwestern Mutual MU TLD Registry, LLC
+mutual
+
+// mutuelle : 2015-06-18 Fédération Nationale de la Mutualité Française
+mutuelle
+
+// nab : 2015-08-20 National Australia Bank Limited
+nab
+
+// nadex : 2014-12-11 IG Group Holdings PLC
+nadex
+
+// nagoya : 2013-10-24 GMO Registry, Inc.
+nagoya
+
+// nationwide : 2015-07-23 Nationwide Mutual Insurance Company
+nationwide
+
+// natura : 2015-03-12 NATURA COSMÉTICOS S.A.
+natura
+
+// navy : 2014-03-06 United TLD Holdco Ltd.
+navy
+
+// nba : 2015-07-31 NBA REGISTRY, LLC
+nba
+
+// nec : 2015-01-08 NEC Corporation
+nec
+
+// netbank : 2014-06-26 COMMONWEALTH BANK OF AUSTRALIA
+netbank
+
+// netflix : 2015-06-18 Netflix, Inc.
+netflix
+
+// network : 2013-11-14 Trixy Manor, LLC
+network
+
+// neustar : 2013-12-05 NeuStar, Inc.
+neustar
+
+// new : 2014-01-30 Charleston Road Registry Inc.
+new
+
+// newholland : 2015-09-03 CNH Industrial N.V.
+newholland
+
+// news : 2014-12-18
+news
+
+// next : 2015-06-18 Next plc
+next
+
+// nextdirect : 2015-06-18 Next plc
+nextdirect
+
+// nexus : 2014-07-24 Charleston Road Registry Inc.
+nexus
+
+// nfl : 2015-07-23 NFL Reg Ops LLC
+nfl
+
+// ngo : 2014-03-06 Public Interest Registry
+ngo
+
+// nhk : 2014-02-13 Japan Broadcasting Corporation (NHK)
+nhk
+
+// nico : 2014-12-04 DWANGO Co., Ltd.
+nico
+
+// nike : 2015-07-23 NIKE, Inc.
+nike
+
+// nikon : 2015-05-21 NIKON CORPORATION
+nikon
+
+// ninja : 2013-11-07 United TLD Holdco Ltd.
+ninja
+
+// nissan : 2014-03-27 NISSAN MOTOR CO., LTD.
+nissan
+
+// nissay : 2015-10-29 Nippon Life Insurance Company
+nissay
+
+// nokia : 2015-01-08 Nokia Corporation
+nokia
+
+// northwesternmutual : 2015-06-18 Northwestern Mutual Registry, LLC
+northwesternmutual
+
+// norton : 2014-12-04 Symantec Corporation
+norton
+
+// now : 2015-06-25 Amazon EU S.à r.l.
+now
+
+// nowruz : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti.
+nowruz
+
+// nowtv : 2015-05-14 Starbucks (HK) Limited
+nowtv
+
+// nra : 2014-05-22 NRA Holdings Company, INC.
+nra
+
+// nrw : 2013-11-21 Minds + Machines GmbH
+nrw
+
+// ntt : 2014-10-31 NIPPON TELEGRAPH AND TELEPHONE CORPORATION
+ntt
+
+// nyc : 2014-01-23 The City of New York by and through the New York City Department of Information Technology & Telecommunications
+nyc
+
+// obi : 2014-09-25 OBI Group Holding SE & Co. KGaA
+obi
+
+// observer : 2015-04-30
+observer
+
+// off : 2015-07-23 Johnson Shareholdings, Inc.
+off
+
+// office : 2015-03-12 Microsoft Corporation
+office
+
+// okinawa : 2013-12-05 BusinessRalliart Inc.
+okinawa
+
+// olayan : 2015-05-14 Crescent Holding GmbH
+olayan
+
+// olayangroup : 2015-05-14 Crescent Holding GmbH
+olayangroup
+
+// oldnavy : 2015-07-31 The Gap, Inc.
+oldnavy
+
+// ollo : 2015-06-04 Dish DBS Corporation
+ollo
+
+// omega : 2015-01-08 The Swatch Group Ltd
+omega
+
+// one : 2014-11-07 One.com A/S
+one
+
+// ong : 2014-03-06 Public Interest Registry
+ong
+
+// onl : 2013-09-16 I-Registry Ltd.
+onl
+
+// online : 2015-01-15 DotOnline Inc.
+online
+
+// onyourside : 2015-07-23 Nationwide Mutual Insurance Company
+onyourside
+
+// ooo : 2014-01-09 INFIBEAM INCORPORATION LIMITED
+ooo
+
+// open : 2015-07-31 American Express Travel Related Services Company, Inc.
+open
+
+// oracle : 2014-06-19 Oracle Corporation
+oracle
+
+// orange : 2015-03-12 Orange Brand Services Limited
+orange
+
+// organic : 2014-03-27 Afilias Limited
+organic
+
+// orientexpress : 2015-02-05
+orientexpress
+
+// origins : 2015-10-01 The Estée Lauder Companies Inc.
+origins
+
+// osaka : 2014-09-04 Interlink Co., Ltd.
+osaka
+
+// otsuka : 2013-10-11 Otsuka Holdings Co., Ltd.
+otsuka
+
+// ott : 2015-06-04 Dish DBS Corporation
+ott
+
+// ovh : 2014-01-16 OVH SAS
+ovh
+
+// page : 2014-12-04 Charleston Road Registry Inc.
+page
+
+// pamperedchef : 2015-02-05 The Pampered Chef, Ltd.
+pamperedchef
+
+// panasonic : 2015-07-30 Panasonic Corporation
+panasonic
+
+// panerai : 2014-11-07 Richemont DNS Inc.
+panerai
+
+// paris : 2014-01-30 City of Paris
+paris
+
+// pars : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti.
+pars
+
+// partners : 2013-12-05 Magic Glen, LLC
+partners
+
+// parts : 2013-12-05 Sea Goodbye, LLC
+parts
+
+// party : 2014-09-11 Blue Sky Registry Limited
+party
+
+// passagens : 2015-03-05 Travel Reservations SRL
+passagens
+
+// pay : 2015-08-27 Amazon EU S.à r.l.
+pay
+
+// pccw : 2015-05-14 PCCW Enterprises Limited
+pccw
+
+// pet : 2015-05-07 Afilias plc
+pet
+
+// pfizer : 2015-09-11 Pfizer Inc.
+pfizer
+
+// pharmacy : 2014-06-19 National Association of Boards of Pharmacy
+pharmacy
+
+// phd : 2016-07-28 Charleston Road Registry Inc.
+phd
+
+// philips : 2014-11-07 Koninklijke Philips N.V.
+philips
+
+// phone : 2016-06-02 Dish DBS Corporation
+phone
+
+// photo : 2013-11-14 Uniregistry, Corp.
+photo
+
+// photography : 2013-09-20 Sugar Glen, LLC
+photography
+
+// photos : 2013-10-17 Sea Corner, LLC
+photos
+
+// physio : 2014-05-01 PhysBiz Pty Ltd
+physio
+
+// piaget : 2014-10-16 Richemont DNS Inc.
+piaget
+
+// pics : 2013-11-14 Uniregistry, Corp.
+pics
+
+// pictet : 2014-06-26 Pictet Europe S.A.
+pictet
+
+// pictures : 2014-03-06 Foggy Sky, LLC
+pictures
+
+// pid : 2015-01-08 Top Level Spectrum, Inc.
+pid
+
+// pin : 2014-12-18 Amazon EU S.à r.l.
+pin
+
+// ping : 2015-06-11 Ping Registry Provider, Inc.
+ping
+
+// pink : 2013-10-01 Afilias Limited
+pink
+
+// pioneer : 2015-07-16 Pioneer Corporation
+pioneer
+
+// pizza : 2014-06-26 Foggy Moon, LLC
+pizza
+
+// place : 2014-04-24 Snow Galley, LLC
+place
+
+// play : 2015-03-05 Charleston Road Registry Inc.
+play
+
+// playstation : 2015-07-02 Sony Computer Entertainment Inc.
+playstation
+
+// plumbing : 2013-09-10 Spring Tigers, LLC
+plumbing
+
+// plus : 2015-02-05 Sugar Mill, LLC
+plus
+
+// pnc : 2015-07-02 PNC Domain Co., LLC
+pnc
+
+// pohl : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG
+pohl
+
+// poker : 2014-07-03 Afilias Domains No. 5 Limited
+poker
+
+// politie : 2015-08-20 Politie Nederland
+politie
+
+// porn : 2014-10-16 ICM Registry PN LLC
+porn
+
+// pramerica : 2015-07-30 Prudential Financial, Inc.
+pramerica
+
+// praxi : 2013-12-05 Praxi S.p.A.
+praxi
+
+// press : 2014-04-03 DotPress Inc.
+press
+
+// prime : 2015-06-25 Amazon EU S.à r.l.
+prime
+
+// prod : 2014-01-23 Charleston Road Registry Inc.
+prod
+
+// productions : 2013-12-05 Magic Birch, LLC
+productions
+
+// prof : 2014-07-24 Charleston Road Registry Inc.
+prof
+
+// progressive : 2015-07-23 Progressive Casualty Insurance Company
+progressive
+
+// promo : 2014-12-18
+promo
+
+// properties : 2013-12-05 Big Pass, LLC
+properties
+
+// property : 2014-05-22 Uniregistry, Corp.
+property
+
+// protection : 2015-04-23
+protection
+
+// pru : 2015-07-30 Prudential Financial, Inc.
+pru
+
+// prudential : 2015-07-30 Prudential Financial, Inc.
+prudential
+
+// pub : 2013-12-12 United TLD Holdco Ltd.
+pub
+
+// pwc : 2015-10-29 PricewaterhouseCoopers LLP
+pwc
+
+// qpon : 2013-11-14 dotCOOL, Inc.
+qpon
+
+// quebec : 2013-12-19 PointQuébec Inc
+quebec
+
+// quest : 2015-03-26 Quest ION Limited
+quest
+
+// qvc : 2015-07-30 QVC, Inc.
+qvc
+
+// racing : 2014-12-04 Premier Registry Limited
+racing
+
+// radio : 2016-07-21 European Broadcasting Union (EBU)
+radio
+
+// raid : 2015-07-23 Johnson Shareholdings, Inc.
+raid
+
+// read : 2014-12-18 Amazon EU S.à r.l.
+read
+
+// realestate : 2015-09-11 dotRealEstate LLC
+realestate
+
+// realtor : 2014-05-29 Real Estate Domains LLC
+realtor
+
+// realty : 2015-03-19 Fegistry, LLC
+realty
+
+// recipes : 2013-10-17 Grand Island, LLC
+recipes
+
+// red : 2013-11-07 Afilias Limited
+red
+
+// redstone : 2014-10-31 Redstone Haute Couture Co., Ltd.
+redstone
+
+// redumbrella : 2015-03-26 Travelers TLD, LLC
+redumbrella
+
+// rehab : 2014-03-06 United TLD Holdco Ltd.
+rehab
+
+// reise : 2014-03-13
+reise
+
+// reisen : 2014-03-06 New Cypress, LLC
+reisen
+
+// reit : 2014-09-04 National Association of Real Estate Investment Trusts, Inc.
+reit
+
+// reliance : 2015-04-02 Reliance Industries Limited
+reliance
+
+// ren : 2013-12-12 Beijing Qianxiang Wangjing Technology Development Co., Ltd.
+ren
+
+// rent : 2014-12-04 DERRent, LLC
+rent
+
+// rentals : 2013-12-05 Big Hollow,LLC
+rentals
+
+// repair : 2013-11-07 Lone Sunset, LLC
+repair
+
+// report : 2013-12-05 Binky Glen, LLC
+report
+
+// republican : 2014-03-20 United TLD Holdco Ltd.
+republican
+
+// rest : 2013-12-19 Punto 2012 Sociedad Anonima Promotora de Inversion de Capital Variable
+rest
+
+// restaurant : 2014-07-03 Snow Avenue, LLC
+restaurant
+
+// review : 2014-11-20 dot Review Limited
+review
+
+// reviews : 2013-09-13
+reviews
+
+// rexroth : 2015-06-18 Robert Bosch GMBH
+rexroth
+
+// rich : 2013-11-21 I-Registry Ltd.
+rich
+
+// richardli : 2015-05-14 Pacific Century Asset Management (HK) Limited
+richardli
+
+// ricoh : 2014-11-20 Ricoh Company, Ltd.
+ricoh
+
+// rightathome : 2015-07-23 Johnson Shareholdings, Inc.
+rightathome
+
+// ril : 2015-04-02 Reliance Industries Limited
+ril
+
+// rio : 2014-02-27 Empresa Municipal de Informática SA - IPLANRIO
+rio
+
+// rip : 2014-07-10 United TLD Holdco Ltd.
+rip
+
+// rmit : 2015-11-19 Royal Melbourne Institute of Technology
+rmit
+
+// rocher : 2014-12-18 Ferrero Trading Lux S.A.
+rocher
+
+// rocks : 2013-11-14
+rocks
+
+// rodeo : 2013-12-19 Top Level Domain Holdings Limited
+rodeo
+
+// rogers : 2015-08-06 Rogers Communications Partnership
+rogers
+
+// room : 2014-12-18 Amazon EU S.à r.l.
+room
+
+// rsvp : 2014-05-08 Charleston Road Registry Inc.
+rsvp
+
+// ruhr : 2013-10-02 regiodot GmbH & Co. KG
+ruhr
+
+// run : 2015-03-19 Snow Park, LLC
+run
+
+// rwe : 2015-04-02 RWE AG
+rwe
+
+// ryukyu : 2014-01-09 BusinessRalliart Inc.
+ryukyu
+
+// saarland : 2013-12-12 dotSaarland GmbH
+saarland
+
+// safe : 2014-12-18 Amazon EU S.à r.l.
+safe
+
+// safety : 2015-01-08 Safety Registry Services, LLC.
+safety
+
+// sakura : 2014-12-18 SAKURA Internet Inc.
+sakura
+
+// sale : 2014-10-16
+sale
+
+// salon : 2014-12-11 Outer Orchard, LLC
+salon
+
+// samsclub : 2015-07-31 Wal-Mart Stores, Inc.
+samsclub
+
+// samsung : 2014-04-03 SAMSUNG SDS CO., LTD
+samsung
+
+// sandvik : 2014-11-13 Sandvik AB
+sandvik
+
+// sandvikcoromant : 2014-11-07 Sandvik AB
+sandvikcoromant
+
+// sanofi : 2014-10-09 Sanofi
+sanofi
+
+// sap : 2014-03-27 SAP AG
+sap
+
+// sapo : 2014-11-07 PT Comunicacoes S.A.
+sapo
+
+// sarl : 2014-07-03 Delta Orchard, LLC
+sarl
+
+// sas : 2015-04-02 Research IP LLC
+sas
+
+// save : 2015-06-25 Amazon EU S.à r.l.
+save
+
+// saxo : 2014-10-31 Saxo Bank A/S
+saxo
+
+// sbi : 2015-03-12 STATE BANK OF INDIA
+sbi
+
+// sbs : 2014-11-07 SPECIAL BROADCASTING SERVICE CORPORATION
+sbs
+
+// sca : 2014-03-13 SVENSKA CELLULOSA AKTIEBOLAGET SCA (publ)
+sca
+
+// scb : 2014-02-20 The Siam Commercial Bank Public Company Limited ("SCB")
+scb
+
+// schaeffler : 2015-08-06 Schaeffler Technologies AG & Co. KG
+schaeffler
+
+// schmidt : 2014-04-03 SALM S.A.S.
+schmidt
+
+// scholarships : 2014-04-24 Scholarships.com, LLC
+scholarships
+
+// school : 2014-12-18 Little Galley, LLC
+school
+
+// schule : 2014-03-06 Outer Moon, LLC
+schule
+
+// schwarz : 2014-09-18 Schwarz Domains und Services GmbH & Co. KG
+schwarz
+
+// science : 2014-09-11 dot Science Limited
+science
+
+// scjohnson : 2015-07-23 Johnson Shareholdings, Inc.
+scjohnson
+
+// scor : 2014-10-31 SCOR SE
+scor
+
+// scot : 2014-01-23 Dot Scot Registry Limited
+scot
+
+// search : 2016-06-09 Charleston Road Registry Inc.
+search
+
+// seat : 2014-05-22 SEAT, S.A. (Sociedad Unipersonal)
+seat
+
+// secure : 2015-08-27 Amazon EU S.à r.l.
+secure
+
+// security : 2015-05-14
+security
+
+// seek : 2014-12-04 Seek Limited
+seek
+
+// select : 2015-10-08 iSelect Ltd
+select
+
+// sener : 2014-10-24 Sener Ingeniería y Sistemas, S.A.
+sener
+
+// services : 2014-02-27 Fox Castle, LLC
+services
+
+// ses : 2015-07-23 SES
+ses
+
+// seven : 2015-08-06 Seven West Media Ltd
+seven
+
+// sew : 2014-07-17 SEW-EURODRIVE GmbH & Co KG
+sew
+
+// sex : 2014-11-13 ICM Registry SX LLC
+sex
+
+// sexy : 2013-09-11 Uniregistry, Corp.
+sexy
+
+// sfr : 2015-08-13 Societe Francaise du Radiotelephone - SFR
+sfr
+
+// shangrila : 2015-09-03 Shangri‐La International Hotel Management Limited
+shangrila
+
+// sharp : 2014-05-01 Sharp Corporation
+sharp
+
+// shaw : 2015-04-23 Shaw Cablesystems G.P.
+shaw
+
+// shell : 2015-07-30 Shell Information Technology International Inc
+shell
+
+// shia : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti.
+shia
+
+// shiksha : 2013-11-14 Afilias Limited
+shiksha
+
+// shoes : 2013-10-02 Binky Galley, LLC
+shoes
+
+// shop : 2016-04-08 GMO Registry, Inc.
+shop
+
+// shopping : 2016-03-31
+shopping
+
+// shouji : 2015-01-08 QIHOO 360 TECHNOLOGY CO. LTD.
+shouji
+
+// show : 2015-03-05 Snow Beach, LLC
+show
+
+// showtime : 2015-08-06 CBS Domains Inc.
+showtime
+
+// shriram : 2014-01-23 Shriram Capital Ltd.
+shriram
+
+// silk : 2015-06-25 Amazon EU S.à r.l.
+silk
+
+// sina : 2015-03-12 Sina Corporation
+sina
+
+// singles : 2013-08-27 Fern Madison, LLC
+singles
+
+// site : 2015-01-15 DotSite Inc.
+site
+
+// ski : 2015-04-09 STARTING DOT LIMITED
+ski
+
+// skin : 2015-01-15 L'Oréal
+skin
+
+// sky : 2014-06-19 Sky IP International Ltd, a company incorporated in England and Wales, operating via its registered Swiss branch
+sky
+
+// skype : 2014-12-18 Microsoft Corporation
+skype
+
+// sling : 2015-07-30 Hughes Satellite Systems Corporation
+sling
+
+// smart : 2015-07-09 Smart Communications, Inc. (SMART)
+smart
+
+// smile : 2014-12-18 Amazon EU S.à r.l.
+smile
+
+// sncf : 2015-02-19 Société Nationale des Chemins de fer Francais S N C F
+sncf
+
+// soccer : 2015-03-26 Foggy Shadow, LLC
+soccer
+
+// social : 2013-11-07 United TLD Holdco Ltd.
+social
+
+// softbank : 2015-07-02 SoftBank Corp.
+softbank
+
+// software : 2014-03-20
+software
+
+// sohu : 2013-12-19 Sohu.com Limited
+sohu
+
+// solar : 2013-11-07 Ruby Town, LLC
+solar
+
+// solutions : 2013-11-07 Silver Cover, LLC
+solutions
+
+// song : 2015-02-26 Amazon EU S.à r.l.
+song
+
+// sony : 2015-01-08 Sony Corporation
+sony
+
+// soy : 2014-01-23 Charleston Road Registry Inc.
+soy
+
+// space : 2014-04-03 DotSpace Inc.
+space
+
+// spiegel : 2014-02-05 SPIEGEL-Verlag Rudolf Augstein GmbH & Co. KG
+spiegel
+
+// spot : 2015-02-26 Amazon EU S.à r.l.
+spot
+
+// spreadbetting : 2014-12-11 IG Group Holdings PLC
+spreadbetting
+
+// srl : 2015-05-07 mySRL GmbH
+srl
+
+// srt : 2015-07-30 FCA US LLC.
+srt
+
+// stada : 2014-11-13 STADA Arzneimittel AG
+stada
+
+// staples : 2015-07-30 Staples, Inc.
+staples
+
+// star : 2015-01-08 Star India Private Limited
+star
+
+// starhub : 2015-02-05 StarHub Ltd
+starhub
+
+// statebank : 2015-03-12 STATE BANK OF INDIA
+statebank
+
+// statefarm : 2015-07-30 State Farm Mutual Automobile Insurance Company
+statefarm
+
+// statoil : 2014-12-04 Statoil ASA
+statoil
+
+// stc : 2014-10-09 Saudi Telecom Company
+stc
+
+// stcgroup : 2014-10-09 Saudi Telecom Company
+stcgroup
+
+// stockholm : 2014-12-18 Stockholms kommun
+stockholm
+
+// storage : 2014-12-22 Self Storage Company LLC
+storage
+
+// store : 2015-04-09 DotStore Inc.
+store
+
+// stream : 2016-01-08 dot Stream Limited
+stream
+
+// studio : 2015-02-11
+studio
+
+// study : 2014-12-11 OPEN UNIVERSITIES AUSTRALIA PTY LTD
+study
+
+// style : 2014-12-04 Binky Moon, LLC
+style
+
+// sucks : 2014-12-22 Vox Populi Registry Inc.
+sucks
+
+// supplies : 2013-12-19 Atomic Fields, LLC
+supplies
+
+// supply : 2013-12-19 Half Falls, LLC
+supply
+
+// support : 2013-10-24 Grand Orchard, LLC
+support
+
+// surf : 2014-01-09 Top Level Domain Holdings Limited
+surf
+
+// surgery : 2014-03-20 Tin Avenue, LLC
+surgery
+
+// suzuki : 2014-02-20 SUZUKI MOTOR CORPORATION
+suzuki
+
+// swatch : 2015-01-08 The Swatch Group Ltd
+swatch
+
+// swiftcover : 2015-07-23 Swiftcover Insurance Services Limited
+swiftcover
+
+// swiss : 2014-10-16 Swiss Confederation
+swiss
+
+// sydney : 2014-09-18 State of New South Wales, Department of Premier and Cabinet
+sydney
+
+// symantec : 2014-12-04 Symantec Corporation
+symantec
+
+// systems : 2013-11-07 Dash Cypress, LLC
+systems
+
+// tab : 2014-12-04 Tabcorp Holdings Limited
+tab
+
+// taipei : 2014-07-10 Taipei City Government
+taipei
+
+// talk : 2015-04-09 Amazon EU S.à r.l.
+talk
+
+// taobao : 2015-01-15 Alibaba Group Holding Limited
+taobao
+
+// target : 2015-07-31 Target Domain Holdings, LLC
+target
+
+// tatamotors : 2015-03-12 Tata Motors Ltd
+tatamotors
+
+// tatar : 2014-04-24 Limited Liability Company "Coordination Center of Regional Domain of Tatarstan Republic"
+tatar
+
+// tattoo : 2013-08-30 Uniregistry, Corp.
+tattoo
+
+// tax : 2014-03-20 Storm Orchard, LLC
+tax
+
+// taxi : 2015-03-19 Pine Falls, LLC
+taxi
+
+// tci : 2014-09-12 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti.
+tci
+
+// tdk : 2015-06-11 TDK Corporation
+tdk
+
+// team : 2015-03-05 Atomic Lake, LLC
+team
+
+// tech : 2015-01-30 Dot Tech LLC
+tech
+
+// technology : 2013-09-13 Auburn Falls
+technology
+
+// telecity : 2015-02-19 TelecityGroup International Limited
+telecity
+
+// telefonica : 2014-10-16 Telefónica S.A.
+telefonica
+
+// temasek : 2014-08-07 Temasek Holdings (Private) Limited
+temasek
+
+// tennis : 2014-12-04 Cotton Bloom, LLC
+tennis
+
+// teva : 2015-07-02 Teva Pharmaceutical Industries Limited
+teva
+
+// thd : 2015-04-02 Homer TLC, Inc.
+thd
+
+// theater : 2015-03-19 Blue Tigers, LLC
+theater
+
+// theatre : 2015-05-07
+theatre
+
+// theguardian : 2015-04-30 Guardian News and Media Limited
+theguardian
+
+// tiaa : 2015-07-23 Teachers Insurance and Annuity Association of America
+tiaa
+
+// tickets : 2015-02-05 Accent Media Limited
+tickets
+
+// tienda : 2013-11-14 Victor Manor, LLC
+tienda
+
+// tiffany : 2015-01-30 Tiffany and Company
+tiffany
+
+// tips : 2013-09-20 Corn Willow, LLC
+tips
+
+// tires : 2014-11-07 Dog Edge, LLC
+tires
+
+// tirol : 2014-04-24 punkt Tirol GmbH
+tirol
+
+// tjmaxx : 2015-07-16 The TJX Companies, Inc.
+tjmaxx
+
+// tjx : 2015-07-16 The TJX Companies, Inc.
+tjx
+
+// tkmaxx : 2015-07-16 The TJX Companies, Inc.
+tkmaxx
+
+// tmall : 2015-01-15 Alibaba Group Holding Limited
+tmall
+
+// today : 2013-09-20 Pearl Woods, LLC
+today
+
+// tokyo : 2013-11-13 GMO Registry, Inc.
+tokyo
+
+// tools : 2013-11-21 Pioneer North, LLC
+tools
+
+// top : 2014-03-20 Jiangsu Bangning Science & Technology Co.,Ltd.
+top
+
+// toray : 2014-12-18 Toray Industries, Inc.
+toray
+
+// toshiba : 2014-04-10 TOSHIBA Corporation
+toshiba
+
+// total : 2015-08-06 Total SA
+total
+
+// tours : 2015-01-22 Sugar Station, LLC
+tours
+
+// town : 2014-03-06 Koko Moon, LLC
+town
+
+// toyota : 2015-04-23 TOYOTA MOTOR CORPORATION
+toyota
+
+// toys : 2014-03-06 Pioneer Orchard, LLC
+toys
+
+// trade : 2014-01-23 Elite Registry Limited
+trade
+
+// trading : 2014-12-11 IG Group Holdings PLC
+trading
+
+// training : 2013-11-07 Wild Willow, LLC
+training
+
+// travelchannel : 2015-07-02 Lifestyle Domain Holdings, Inc.
+travelchannel
+
+// travelers : 2015-03-26 Travelers TLD, LLC
+travelers
+
+// travelersinsurance : 2015-03-26 Travelers TLD, LLC
+travelersinsurance
+
+// trust : 2014-10-16
+trust
+
+// trv : 2015-03-26 Travelers TLD, LLC
+trv
+
+// tube : 2015-06-11 Latin American Telecom LLC
+tube
+
+// tui : 2014-07-03 TUI AG
+tui
+
+// tunes : 2015-02-26 Amazon EU S.à r.l.
+tunes
+
+// tushu : 2014-12-18 Amazon EU S.à r.l.
+tushu
+
+// tvs : 2015-02-19 T V SUNDRAM IYENGAR  & SONS LIMITED
+tvs
+
+// ubank : 2015-08-20 National Australia Bank Limited
+ubank
+
+// ubs : 2014-12-11 UBS AG
+ubs
+
+// uconnect : 2015-07-30 FCA US LLC.
+uconnect
+
+// unicom : 2015-10-15 China United Network Communications Corporation Limited
+unicom
+
+// university : 2014-03-06 Little Station, LLC
+university
+
+// uno : 2013-09-11 Dot Latin LLC
+uno
+
+// uol : 2014-05-01 UBN INTERNET LTDA.
+uol
+
+// ups : 2015-06-25 UPS Market Driver, Inc.
+ups
+
+// vacations : 2013-12-05 Atomic Tigers, LLC
+vacations
+
+// vana : 2014-12-11 Lifestyle Domain Holdings, Inc.
+vana
+
+// vanguard : 2015-09-03 The Vanguard Group, Inc.
+vanguard
+
+// vegas : 2014-01-16 Dot Vegas, Inc.
+vegas
+
+// ventures : 2013-08-27 Binky Lake, LLC
+ventures
+
+// verisign : 2015-08-13 VeriSign, Inc.
+verisign
+
+// versicherung : 2014-03-20 dotversicherung-registry GmbH
+versicherung
+
+// vet : 2014-03-06
+vet
+
+// viajes : 2013-10-17 Black Madison, LLC
+viajes
+
+// video : 2014-10-16
+video
+
+// vig : 2015-05-14 VIENNA INSURANCE GROUP AG Wiener Versicherung Gruppe
+vig
+
+// viking : 2015-04-02 Viking River Cruises (Bermuda) Ltd.
+viking
+
+// villas : 2013-12-05 New Sky, LLC
+villas
+
+// vin : 2015-06-18 Holly Shadow, LLC
+vin
+
+// vip : 2015-01-22 Minds + Machines Group Limited
+vip
+
+// virgin : 2014-09-25 Virgin Enterprises Limited
+virgin
+
+// visa : 2015-07-30 Visa Worldwide Pte. Limited
+visa
+
+// vision : 2013-12-05 Koko Station, LLC
+vision
+
+// vista : 2014-09-18 Vistaprint Limited
+vista
+
+// vistaprint : 2014-09-18 Vistaprint Limited
+vistaprint
+
+// viva : 2014-11-07 Saudi Telecom Company
+viva
+
+// vivo : 2015-07-31 Telefonica Brasil S.A.
+vivo
+
+// vlaanderen : 2014-02-06 DNS.be vzw
+vlaanderen
+
+// vodka : 2013-12-19 Top Level Domain Holdings Limited
+vodka
+
+// volkswagen : 2015-05-14 Volkswagen Group of America Inc.
+volkswagen
+
+// volvo : 2015-11-12 Volvo Holding Sverige Aktiebolag
+volvo
+
+// vote : 2013-11-21 Monolith Registry LLC
+vote
+
+// voting : 2013-11-13 Valuetainment Corp.
+voting
+
+// voto : 2013-11-21 Monolith Registry LLC
+voto
+
+// voyage : 2013-08-27 Ruby House, LLC
+voyage
+
+// vuelos : 2015-03-05 Travel Reservations SRL
+vuelos
+
+// wales : 2014-05-08 Nominet UK
+wales
+
+// walmart : 2015-07-31 Wal-Mart Stores, Inc.
+walmart
+
+// walter : 2014-11-13 Sandvik AB
+walter
+
+// wang : 2013-10-24 Zodiac Leo Limited
+wang
+
+// wanggou : 2014-12-18 Amazon EU S.à r.l.
+wanggou
+
+// warman : 2015-06-18 Weir Group IP Limited
+warman
+
+// watch : 2013-11-14 Sand Shadow, LLC
+watch
+
+// watches : 2014-12-22 Richemont DNS Inc.
+watches
+
+// weather : 2015-01-08 The Weather Channel, LLC
+weather
+
+// weatherchannel : 2015-03-12 The Weather Channel, LLC
+weatherchannel
+
+// webcam : 2014-01-23 dot Webcam Limited
+webcam
+
+// weber : 2015-06-04 Saint-Gobain Weber SA
+weber
+
+// website : 2014-04-03 DotWebsite Inc.
+website
+
+// wed : 2013-10-01 Atgron, Inc.
+wed
+
+// wedding : 2014-04-24 Top Level Domain Holdings Limited
+wedding
+
+// weibo : 2015-03-05 Sina Corporation
+weibo
+
+// weir : 2015-01-29 Weir Group IP Limited
+weir
+
+// whoswho : 2014-02-20 Who's Who Registry
+whoswho
+
+// wien : 2013-10-28 punkt.wien GmbH
+wien
+
+// wiki : 2013-11-07 Top Level Design, LLC
+wiki
+
+// williamhill : 2014-03-13 William Hill Organization Limited
+williamhill
+
+// win : 2014-11-20 First Registry Limited
+win
+
+// windows : 2014-12-18 Microsoft Corporation
+windows
+
+// wine : 2015-06-18 June Station, LLC
+wine
+
+// winners : 2015-07-16 The TJX Companies, Inc.
+winners
+
+// wme : 2014-02-13 William Morris Endeavor Entertainment, LLC
+wme
+
+// wolterskluwer : 2015-08-06 Wolters Kluwer N.V.
+wolterskluwer
+
+// woodside : 2015-07-09 Woodside Petroleum Limited
+woodside
+
+// work : 2013-12-19 Top Level Domain Holdings Limited
+work
+
+// works : 2013-11-14 Little Dynamite, LLC
+works
+
+// world : 2014-06-12 Bitter Fields, LLC
+world
+
+// wow : 2015-10-08 Amazon EU S.à r.l.
+wow
+
+// wtc : 2013-12-19 World Trade Centers Association, Inc.
+wtc
+
+// wtf : 2014-03-06 Hidden Way, LLC
+wtf
+
+// xbox : 2014-12-18 Microsoft Corporation
+xbox
+
+// xerox : 2014-10-24 Xerox DNHC LLC
+xerox
+
+// xfinity : 2015-07-09 Comcast IP Holdings I, LLC
+xfinity
+
+// xihuan : 2015-01-08 QIHOO 360 TECHNOLOGY CO. LTD.
+xihuan
+
+// xin : 2014-12-11 Elegant Leader Limited
+xin
+
+// xn--11b4c3d : 2015-01-15 VeriSign Sarl
+xn--11b4c3d
+कॉम
+
+// xn--1ck2e1b : 2015-02-26 Amazon EU S.à r.l.
+xn--1ck2e1b
+セール
+
+// xn--1qqw23a : 2014-01-09 Guangzhou YU Wei Information Technology Co., Ltd.
+xn--1qqw23a
+佛山
+
+// xn--30rr7y : 2014-06-12 Excellent First Limited
+xn--30rr7y
+慈善
+
+// xn--3bst00m : 2013-09-13 Eagle Horizon Limited
+xn--3bst00m
+集团
+
+// xn--3ds443g : 2013-09-08 TLD REGISTRY LIMITED
+xn--3ds443g
+在线
+
+// xn--3oq18vl8pn36a : 2015-07-02 Volkswagen (China) Investment Co., Ltd.
+xn--3oq18vl8pn36a
+大众汽车
+
+// xn--3pxu8k : 2015-01-15 VeriSign Sarl
+xn--3pxu8k
+点看
+
+// xn--42c2d9a : 2015-01-15 VeriSign Sarl
+xn--42c2d9a
+คอม
+
+// xn--45q11c : 2013-11-21 Zodiac Scorpio Limited
+xn--45q11c
+八卦
+
+// xn--4gbrim : 2013-10-04 Suhub Electronic Establishment
+xn--4gbrim
+موقع
+
+// xn--4gq48lf9j : 2015-07-31 Wal-Mart Stores, Inc.
+xn--4gq48lf9j
+一号店
+
+// xn--55qw42g : 2013-11-08 China Organizational Name Administration Center
+xn--55qw42g
+公益
+
+// xn--55qx5d : 2013-11-14 Computer Network Information Center of Chinese Academy of Sciences (China Internet Network Information Center)
+xn--55qx5d
+公司
+
+// xn--5su34j936bgsg : 2015-09-03 Shangri‐La International Hotel Management Limited
+xn--5su34j936bgsg
+香格里拉
+
+// xn--5tzm5g : 2014-12-22 Global Website TLD Asia Limited
+xn--5tzm5g
+网站
+
+// xn--6frz82g : 2013-09-23 Afilias Limited
+xn--6frz82g
+移动
+
+// xn--6qq986b3xl : 2013-09-13 Tycoon Treasure Limited
+xn--6qq986b3xl
+我爱你
+
+// xn--80adxhks : 2013-12-19 Foundation for Assistance for Internet Technologies and Infrastructure Development (FAITID)
+xn--80adxhks
+москва
+
+// xn--80aqecdr1a : 2015-10-21 Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication)
+xn--80aqecdr1a
+католик
+
+// xn--80asehdb : 2013-07-14 CORE Association
+xn--80asehdb
+онлайн
+
+// xn--80aswg : 2013-07-14 CORE Association
+xn--80aswg
+сайт
+
+// xn--8y0a063a : 2015-03-26 China United Network Communications Corporation Limited
+xn--8y0a063a
+联通
+
+// xn--9dbq2a : 2015-01-15 VeriSign Sarl
+xn--9dbq2a
+קום
+
+// xn--9et52u : 2014-06-12 RISE VICTORY LIMITED
+xn--9et52u
+时尚
+
+// xn--9krt00a : 2015-03-12 Sina Corporation
+xn--9krt00a
+微博
+
+// xn--b4w605ferd : 2014-08-07 Temasek Holdings (Private) Limited
+xn--b4w605ferd
+淡马锡
+
+// xn--bck1b9a5dre4c : 2015-02-26 Amazon EU S.à r.l.
+xn--bck1b9a5dre4c
+ファッション
+
+// xn--c1avg : 2013-11-14 Public Interest Registry
+xn--c1avg
+орг
+
+// xn--c2br7g : 2015-01-15 VeriSign Sarl
+xn--c2br7g
+नेट
+
+// xn--cck2b3b : 2015-02-26 Amazon EU S.à r.l.
+xn--cck2b3b
+ストア
+
+// xn--cg4bki : 2013-09-27 SAMSUNG SDS CO., LTD
+xn--cg4bki
+삼성
+
+// xn--czr694b : 2014-01-16 Dot Trademark TLD Holding Company Limted
+xn--czr694b
+商标
+
+// xn--czrs0t : 2013-12-19 Wild Island, LLC
+xn--czrs0t
+商店
+
+// xn--czru2d : 2013-11-21 Zodiac Capricorn Limited
+xn--czru2d
+商城
+
+// xn--d1acj3b : 2013-11-20 The Foundation for Network Initiatives “The Smart Internet”
+xn--d1acj3b
+дети
+
+// xn--eckvdtc9d : 2014-12-18 Amazon EU S.à r.l.
+xn--eckvdtc9d
+ポイント
+
+// xn--efvy88h : 2014-08-22 Xinhua News Agency Guangdong Branch 新华通讯社广东分社
+xn--efvy88h
+新闻
+
+// xn--estv75g : 2015-02-19 Industrial and Commercial Bank of China Limited
+xn--estv75g
+工行
+
+// xn--fct429k : 2015-04-09 Amazon EU S.à r.l.
+xn--fct429k
+家電
+
+// xn--fhbei : 2015-01-15 VeriSign Sarl
+xn--fhbei
+كوم
+
+// xn--fiq228c5hs : 2013-09-08 TLD REGISTRY LIMITED
+xn--fiq228c5hs
+中文网
+
+// xn--fiq64b : 2013-10-14 CITIC Group Corporation
+xn--fiq64b
+中信
+
+// xn--fjq720a : 2014-05-22 Will Bloom, LLC
+xn--fjq720a
+娱乐
+
+// xn--flw351e : 2014-07-31 Charleston Road Registry Inc.
+xn--flw351e
+谷歌
+
+// xn--fzys8d69uvgm : 2015-05-14 PCCW Enterprises Limited
+xn--fzys8d69uvgm
+電訊盈科
+
+// xn--g2xx48c : 2015-01-30 Minds + Machines Group Limited
+xn--g2xx48c
+购物
+
+// xn--gckr3f0f : 2015-02-26 Amazon EU S.à r.l.
+xn--gckr3f0f
+クラウド
+
+// xn--gk3at1e : 2015-10-08 Amazon EU S.à r.l.
+xn--gk3at1e
+通販
+
+// xn--hxt814e : 2014-05-15 Zodiac Libra Limited
+xn--hxt814e
+网店
+
+// xn--i1b6b1a6a2e : 2013-11-14 Public Interest Registry
+xn--i1b6b1a6a2e
+संगठन
+
+// xn--imr513n : 2014-12-11 Dot Trademark TLD Holding Company Limted
+xn--imr513n
+餐厅
+
+// xn--io0a7i : 2013-11-14 Computer Network Information Center of Chinese Academy of Sciences (China Internet Network Information Center)
+xn--io0a7i
+网络
+
+// xn--j1aef : 2015-01-15 VeriSign Sarl
+xn--j1aef
+ком
+
+// xn--jlq61u9w7b : 2015-01-08 Nokia Corporation
+xn--jlq61u9w7b
+诺基亚
+
+// xn--jvr189m : 2015-02-26 Amazon EU S.à r.l.
+xn--jvr189m
+食品
+
+// xn--kcrx77d1x4a : 2014-11-07 Koninklijke Philips N.V.
+xn--kcrx77d1x4a
+飞利浦
+
+// xn--kpu716f : 2014-12-22 Richemont DNS Inc.
+xn--kpu716f
+手表
+
+// xn--kput3i : 2014-02-13 Beijing RITT-Net Technology Development Co., Ltd
+xn--kput3i
+手机
+
+// xn--mgba3a3ejt : 2014-11-20 Aramco Services Company
+xn--mgba3a3ejt
+ارامكو
+
+// xn--mgba7c0bbn0a : 2015-05-14 Crescent Holding GmbH
+xn--mgba7c0bbn0a
+العليان
+
+// xn--mgbaakc7dvf : 2015-09-03 Emirates Telecommunications Corporation (trading as Etisalat)
+xn--mgbaakc7dvf
+اتصالات
+
+// xn--mgbab2bd : 2013-10-31 CORE Association
+xn--mgbab2bd
+بازار
+
+// xn--mgbb9fbpob : 2014-12-18 GreenTech Consultancy Company W.L.L.
+xn--mgbb9fbpob
+موبايلي
+
+// xn--mgbca7dzdo : 2015-07-30 Abu Dhabi Systems and Information Centre
+xn--mgbca7dzdo
+ابوظبي
+
+// xn--mgbi4ecexp : 2015-10-21 Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication)
+xn--mgbi4ecexp
+كاثوليك
+
+// xn--mgbt3dhd : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti.
+xn--mgbt3dhd
+همراه
+
+// xn--mk1bu44c : 2015-01-15 VeriSign Sarl
+xn--mk1bu44c
+닷컴
+
+// xn--mxtq1m : 2014-03-06 Net-Chinese Co., Ltd.
+xn--mxtq1m
+政府
+
+// xn--ngbc5azd : 2013-07-13 International Domain Registry Pty. Ltd.
+xn--ngbc5azd
+شبكة
+
+// xn--ngbe9e0a : 2014-12-04 Kuwait Finance House
+xn--ngbe9e0a
+بيتك
+
+// xn--ngbrx : 2015-11-12 League of Arab States
+xn--ngbrx
+عرب
+
+// xn--nqv7f : 2013-11-14 Public Interest Registry
+xn--nqv7f
+机构
+
+// xn--nqv7fs00ema : 2013-11-14 Public Interest Registry
+xn--nqv7fs00ema
+组织机构
+
+// xn--nyqy26a : 2014-11-07 Stable Tone Limited
+xn--nyqy26a
+健康
+
+// xn--p1acf : 2013-12-12 Rusnames Limited
+xn--p1acf
+рус
+
+// xn--pbt977c : 2014-12-22 Richemont DNS Inc.
+xn--pbt977c
+珠宝
+
+// xn--pssy2u : 2015-01-15 VeriSign Sarl
+xn--pssy2u
+大拿
+
+// xn--q9jyb4c : 2013-09-17 Charleston Road Registry Inc.
+xn--q9jyb4c
+みんな
+
+// xn--qcka1pmc : 2014-07-31 Charleston Road Registry Inc.
+xn--qcka1pmc
+グーグル
+
+// xn--rhqv96g : 2013-09-11 Stable Tone Limited
+xn--rhqv96g
+世界
+
+// xn--rovu88b : 2015-02-26 Amazon EU S.à r.l.
+xn--rovu88b
+書籍
+
+// xn--ses554g : 2014-01-16
+xn--ses554g
+网址
+
+// xn--t60b56a : 2015-01-15 VeriSign Sarl
+xn--t60b56a
+닷넷
+
+// xn--tckwe : 2015-01-15 VeriSign Sarl
+xn--tckwe
+コム
+
+// xn--tiq49xqyj : 2015-10-21 Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication)
+xn--tiq49xqyj
+天主教
+
+// xn--unup4y : 2013-07-14 Spring Fields, LLC
+xn--unup4y
+游戏
+
+// xn--vermgensberater-ctb : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG
+xn--vermgensberater-ctb
+vermögensberater
+
+// xn--vermgensberatung-pwb : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG
+xn--vermgensberatung-pwb
+vermögensberatung
+
+// xn--vhquv : 2013-08-27 Dash McCook, LLC
+xn--vhquv
+企业
+
+// xn--vuq861b : 2014-10-16 Beijing Tele-info Network Technology Co., Ltd.
+xn--vuq861b
+信息
+
+// xn--w4r85el8fhu5dnra : 2015-04-30 Kerry Trading Co. Limited
+xn--w4r85el8fhu5dnra
+嘉里大酒店
+
+// xn--w4rs40l : 2015-07-30 Kerry Trading Co. Limited
+xn--w4rs40l
+嘉里
+
+// xn--xhq521b : 2013-11-14 Guangzhou YU Wei Information Technology Co., Ltd.
+xn--xhq521b
+广东
+
+// xn--zfr164b : 2013-11-08 China Organizational Name Administration Center
+xn--zfr164b
+政务
+
+// xperia : 2015-05-14 Sony Mobile Communications AB
+xperia
+
+// xyz : 2013-12-05 XYZ.COM LLC
+xyz
+
+// yachts : 2014-01-09 DERYachts, LLC
+yachts
+
+// yahoo : 2015-04-02 Yahoo! Domain Services Inc.
+yahoo
+
+// yamaxun : 2014-12-18 Amazon EU S.à r.l.
+yamaxun
+
+// yandex : 2014-04-10 YANDEX, LLC
+yandex
+
+// yodobashi : 2014-11-20 YODOBASHI CAMERA CO.,LTD.
+yodobashi
+
+// yoga : 2014-05-29 Top Level Domain Holdings Limited
+yoga
+
+// yokohama : 2013-12-12 GMO Registry, Inc.
+yokohama
+
+// you : 2015-04-09 Amazon EU S.à r.l.
+you
+
+// youtube : 2014-05-01 Charleston Road Registry Inc.
+youtube
+
+// yun : 2015-01-08 QIHOO 360 TECHNOLOGY CO. LTD.
+yun
+
+// zappos : 2015-06-25 Amazon EU S.à r.l.
+zappos
+
+// zara : 2014-11-07 Industria de Diseño Textil, S.A. (INDITEX, S.A.)
+zara
+
+// zero : 2014-12-18 Amazon EU S.à r.l.
+zero
+
+// zip : 2014-05-08 Charleston Road Registry Inc.
+zip
+
+// zippo : 2015-07-02 Zadco Company
+zippo
+
+// zone : 2013-11-14 Outer Falls, LLC
+zone
+
+// zuerich : 2014-11-07 Kanton Zürich (Canton of Zurich)
+zuerich
+
+
+// ===END ICANN DOMAINS===
+// ===BEGIN PRIVATE DOMAINS===
+// (Note: these are in alphabetical order by company name)
+
+// Agnat sp. z o.o. : https://domena.pl
+// Submitted by Przemyslaw Plewa <it-admin@domena.pl>
+beep.pl
+
+// Alces Software Ltd : http://alces-software.com
+// Submitted by Mark J. Titorenko <mark.titorenko@alces-software.com>
+*.compute.estate
+*.alces.network
+
+// alwaysdata : https://www.alwaysdata.com
+// Submitted by Cyril <admin@alwaysdata.com>
+*.alwaysdata.net
+
+// Amazon CloudFront : https://aws.amazon.com/cloudfront/
+// Submitted by Donavan Miller <donavanm@amazon.com>
+cloudfront.net
+
+// Amazon Elastic Compute Cloud: https://aws.amazon.com/ec2/
+// Submitted by Luke Wells <psl-maintainers@amazon.com>
+*.compute.amazonaws.com
+*.compute-1.amazonaws.com
+*.compute.amazonaws.com.cn
+us-east-1.amazonaws.com
+
+// Amazon Elastic Beanstalk : https://aws.amazon.com/elasticbeanstalk/
+// Submitted by Luke Wells <psl-maintainers@amazon.com>
+elasticbeanstalk.cn-north-1.amazonaws.com.cn
+*.elasticbeanstalk.com
+
+// Amazon Elastic Load Balancing : https://aws.amazon.com/elasticloadbalancing/
+// Submitted by Luke Wells <psl-maintainers@amazon.com>
+*.elb.amazonaws.com
+*.elb.amazonaws.com.cn
+
+// Amazon S3 : https://aws.amazon.com/s3/
+// Submitted by Luke Wells <psl-maintainers@amazon.com>
+s3.amazonaws.com
+s3-ap-northeast-1.amazonaws.com
+s3-ap-northeast-2.amazonaws.com
+s3-ap-south-1.amazonaws.com
+s3-ap-southeast-1.amazonaws.com
+s3-ap-southeast-2.amazonaws.com
+s3-ca-central-1.amazonaws.com
+s3-eu-central-1.amazonaws.com
+s3-eu-west-1.amazonaws.com
+s3-eu-west-2.amazonaws.com
+s3-external-1.amazonaws.com
+s3-fips-us-gov-west-1.amazonaws.com
+s3-sa-east-1.amazonaws.com
+s3-us-gov-west-1.amazonaws.com
+s3-us-east-2.amazonaws.com
+s3-us-west-1.amazonaws.com
+s3-us-west-2.amazonaws.com
+s3.ap-northeast-2.amazonaws.com
+s3.ap-south-1.amazonaws.com
+s3.cn-north-1.amazonaws.com.cn
+s3.ca-central-1.amazonaws.com
+s3.eu-central-1.amazonaws.com
+s3.eu-west-2.amazonaws.com
+s3.us-east-2.amazonaws.com
+s3.dualstack.ap-northeast-1.amazonaws.com
+s3.dualstack.ap-northeast-2.amazonaws.com
+s3.dualstack.ap-south-1.amazonaws.com
+s3.dualstack.ap-southeast-1.amazonaws.com
+s3.dualstack.ap-southeast-2.amazonaws.com
+s3.dualstack.ca-central-1.amazonaws.com
+s3.dualstack.eu-central-1.amazonaws.com
+s3.dualstack.eu-west-1.amazonaws.com
+s3.dualstack.eu-west-2.amazonaws.com
+s3.dualstack.sa-east-1.amazonaws.com
+s3.dualstack.us-east-1.amazonaws.com
+s3.dualstack.us-east-2.amazonaws.com
+s3-website-us-east-1.amazonaws.com
+s3-website-us-west-1.amazonaws.com
+s3-website-us-west-2.amazonaws.com
+s3-website-ap-northeast-1.amazonaws.com
+s3-website-ap-southeast-1.amazonaws.com
+s3-website-ap-southeast-2.amazonaws.com
+s3-website-eu-west-1.amazonaws.com
+s3-website-sa-east-1.amazonaws.com
+s3-website.ap-northeast-2.amazonaws.com
+s3-website.ap-south-1.amazonaws.com
+s3-website.ca-central-1.amazonaws.com
+s3-website.eu-central-1.amazonaws.com
+s3-website.eu-west-2.amazonaws.com
+s3-website.us-east-2.amazonaws.com
+
+// Amune : https://amune.org/
+// Submitted by Team Amune <cert@amune.org>
+t3l3p0rt.net
+tele.amune.org
+
+// Aptible : https://www.aptible.com/
+// Submitted by Thomas Orozco <thomas@aptible.com>
+on-aptible.com
+
+// Asociación Amigos de la Informática "Euskalamiga" : http://encounter.eus/
+// Submitted by Hector Martin <marcan@euskalencounter.org>
+user.party.eus
+
+// Association potager.org : https://potager.org/
+// Submitted by Lunar <jardiniers@potager.org>
+pimienta.org
+poivron.org
+potager.org
+sweetpepper.org
+
+// ASUSTOR Inc. : http://www.asustor.com
+// Submitted by Vincent Tseng <vincenttseng@asustor.com>
+myasustor.com
+
+// AVM : https://avm.de
+// Submitted by Andreas Weise <a.weise@avm.de>
+myfritz.net
+
+// backplane : https://www.backplane.io
+// Submitted by Anthony Voutas <anthony@backplane.io>
+backplaneapp.io
+
+// BetaInABox
+// Submitted by Adrian <adrian@betainabox.com>
+betainabox.com
+
+// BinaryLane : http://www.binarylane.com
+// Submitted by Nathan O'Sullivan <nathan@mammoth.com.au>
+bnr.la
+
+// Boxfuse : https://boxfuse.com
+// Submitted by Axel Fontaine <axel@boxfuse.com>
+boxfuse.io
+
+// BrowserSafetyMark
+// Submitted by Dave Tharp <browsersafetymark.io@quicinc.com>
+browsersafetymark.io
+
+// callidomus: https://www.callidomus.com/
+// Submitted by Marcus Popp <admin@callidomus.com>
+mycd.eu
+
+// CentralNic : http://www.centralnic.com/names/domains
+// Submitted by registry <gavin.brown@centralnic.com>
+ae.org
+ar.com
+br.com
+cn.com
+com.de
+com.se
+de.com
+eu.com
+gb.com
+gb.net
+hu.com
+hu.net
+jp.net
+jpn.com
+kr.com
+mex.com
+no.com
+qc.com
+ru.com
+sa.com
+se.com
+se.net
+uk.com
+uk.net
+us.com
+uy.com
+za.bz
+za.com
+
+// Africa.com Web Solutions Ltd : https://registry.africa.com
+// Submitted by Gavin Brown <gavin.brown@centralnic.com>
+africa.com
+
+// iDOT Services Limited : http://www.domain.gr.com
+// Submitted by Gavin Brown <gavin.brown@centralnic.com>
+gr.com
+
+// Radix FZC : http://domains.in.net
+// Submitted by Gavin Brown <gavin.brown@centralnic.com>
+in.net
+
+// US REGISTRY LLC : http://us.org
+// Submitted by Gavin Brown <gavin.brown@centralnic.com>
+us.org
+
+// co.com Registry, LLC : https://registry.co.com
+// Submitted by Gavin Brown <gavin.brown@centralnic.com>
+co.com
+
+// c.la : http://www.c.la/
+c.la
+
+// certmgr.org : https://certmgr.org
+// Submitted by B. Blechschmidt <hostmaster@certmgr.org>
+certmgr.org
+
+// Citrix : https://citrix.com
+// Submitted by Alex Stoddard <alex.stoddard@citrix.com>
+xenapponazure.com
+
+// ClearVox : http://www.clearvox.nl/
+// Submitted by Leon Rowland <leon@clearvox.nl>
+virtueeldomein.nl
+
+// cloudControl : https://www.cloudcontrol.com/
+// Submitted by Tobias Wilken <tw@cloudcontrol.com>
+cloudcontrolled.com
+cloudcontrolapp.com
+
+// co.ca : http://registry.co.ca/
+co.ca
+
+// i-registry s.r.o. : http://www.i-registry.cz/
+// Submitted by Martin Semrad <semrad@i-registry.cz>
+co.cz
+
+// CDN77.com : http://www.cdn77.com
+// Submitted by Jan Krpes <jan.krpes@cdn77.com>
+c.cdn77.org
+cdn77-ssl.net
+r.cdn77.net
+rsc.cdn77.org
+ssl.origin.cdn77-secure.org
+
+// Cloud DNS Ltd : http://www.cloudns.net
+// Submitted by Aleksander Hristov <noc@cloudns.net>
+cloudns.asia
+cloudns.biz
+cloudns.club
+cloudns.cc
+cloudns.eu
+cloudns.in
+cloudns.info
+cloudns.org
+cloudns.pro
+cloudns.pw
+cloudns.us
+
+// CoDNS B.V.
+co.nl
+co.no
+
+// Commerce Guys, SAS
+// Submitted by Damien Tournoud <damien@commerceguys.com>
+*.platform.sh
+
+// COSIMO GmbH http://www.cosimo.de
+// Submitted by Rene Marticke <rmarticke@cosimo.de>
+dyn.cosidns.de
+dynamisches-dns.de
+dnsupdater.de
+internet-dns.de
+l-o-g-i-n.de
+dynamic-dns.info
+feste-ip.net
+knx-server.net
+static-access.net
+
+// Craynic, s.r.o. : http://www.craynic.com/
+// Submitted by Ales Krajnik <ales.krajnik@craynic.com>
+realm.cz
+
+// Cryptonomic : https://cryptonomic.net/
+// Submitted by Andrew Cady <public-suffix-list@cryptonomic.net>
+*.cryptonomic.net
+
+// Cupcake : https://cupcake.io/
+// Submitted by Jonathan Rudenberg <jonathan@cupcake.io>
+cupcake.is
+
+// cyon GmbH : https://www.cyon.ch/
+// Submitted by Dominic Luechinger <dol@cyon.ch>
+cyon.link
+cyon.site
+
+// Daplie, Inc : https://daplie.com
+// Submitted by AJ ONeal <aj@daplie.com>
+daplie.me
+
+// Dansk.net : http://www.dansk.net/
+// Submitted by Anani Voule <digital@digital.co.dk>
+biz.dk
+co.dk
+firm.dk
+reg.dk
+store.dk
+
+// deSEC : https://desec.io/
+// Submitted by Peter Thomassen <peter@desec.io>
+dedyn.io
+
+// DNShome : https://www.dnshome.de/
+// Submitted by Norbert Auler <mail@dnshome.de>
+dnshome.de
+
+// DreamHost : http://www.dreamhost.com/
+// Submitted by Andrew Farmer <andrew.farmer@dreamhost.com>
+dreamhosters.com
+
+// Drobo : http://www.drobo.com/
+// Submitted by Ricardo Padilha <rpadilha@drobo.com>
+mydrobo.com
+
+// Drud Holdings, LLC. : https://www.drud.com/
+// Submitted by Kevin Bridges <kevin@drud.com>
+drud.io
+drud.us
+
+// DuckDNS : http://www.duckdns.org/
+// Submitted by Richard Harper <richard@duckdns.org>
+duckdns.org
+
+// dy.fi : http://dy.fi/
+// Submitted by Heikki Hannikainen <hessu@hes.iki.fi>
+dy.fi
+tunk.org
+
+// DynDNS.com : http://www.dyndns.com/services/dns/dyndns/
+dyndns-at-home.com
+dyndns-at-work.com
+dyndns-blog.com
+dyndns-free.com
+dyndns-home.com
+dyndns-ip.com
+dyndns-mail.com
+dyndns-office.com
+dyndns-pics.com
+dyndns-remote.com
+dyndns-server.com
+dyndns-web.com
+dyndns-wiki.com
+dyndns-work.com
+dyndns.biz
+dyndns.info
+dyndns.org
+dyndns.tv
+at-band-camp.net
+ath.cx
+barrel-of-knowledge.info
+barrell-of-knowledge.info
+better-than.tv
+blogdns.com
+blogdns.net
+blogdns.org
+blogsite.org
+boldlygoingnowhere.org
+broke-it.net
+buyshouses.net
+cechire.com
+dnsalias.com
+dnsalias.net
+dnsalias.org
+dnsdojo.com
+dnsdojo.net
+dnsdojo.org
+does-it.net
+doesntexist.com
+doesntexist.org
+dontexist.com
+dontexist.net
+dontexist.org
+doomdns.com
+doomdns.org
+dvrdns.org
+dyn-o-saur.com
+dynalias.com
+dynalias.net
+dynalias.org
+dynathome.net
+dyndns.ws
+endofinternet.net
+endofinternet.org
+endoftheinternet.org
+est-a-la-maison.com
+est-a-la-masion.com
+est-le-patron.com
+est-mon-blogueur.com
+for-better.biz
+for-more.biz
+for-our.info
+for-some.biz
+for-the.biz
+forgot.her.name
+forgot.his.name
+from-ak.com
+from-al.com
+from-ar.com
+from-az.net
+from-ca.com
+from-co.net
+from-ct.com
+from-dc.com
+from-de.com
+from-fl.com
+from-ga.com
+from-hi.com
+from-ia.com
+from-id.com
+from-il.com
+from-in.com
+from-ks.com
+from-ky.com
+from-la.net
+from-ma.com
+from-md.com
+from-me.org
+from-mi.com
+from-mn.com
+from-mo.com
+from-ms.com
+from-mt.com
+from-nc.com
+from-nd.com
+from-ne.com
+from-nh.com
+from-nj.com
+from-nm.com
+from-nv.com
+from-ny.net
+from-oh.com
+from-ok.com
+from-or.com
+from-pa.com
+from-pr.com
+from-ri.com
+from-sc.com
+from-sd.com
+from-tn.com
+from-tx.com
+from-ut.com
+from-va.com
+from-vt.com
+from-wa.com
+from-wi.com
+from-wv.com
+from-wy.com
+ftpaccess.cc
+fuettertdasnetz.de
+game-host.org
+game-server.cc
+getmyip.com
+gets-it.net
+go.dyndns.org
+gotdns.com
+gotdns.org
+groks-the.info
+groks-this.info
+ham-radio-op.net
+here-for-more.info
+hobby-site.com
+hobby-site.org
+home.dyndns.org
+homedns.org
+homeftp.net
+homeftp.org
+homeip.net
+homelinux.com
+homelinux.net
+homelinux.org
+homeunix.com
+homeunix.net
+homeunix.org
+iamallama.com
+in-the-band.net
+is-a-anarchist.com
+is-a-blogger.com
+is-a-bookkeeper.com
+is-a-bruinsfan.org
+is-a-bulls-fan.com
+is-a-candidate.org
+is-a-caterer.com
+is-a-celticsfan.org
+is-a-chef.com
+is-a-chef.net
+is-a-chef.org
+is-a-conservative.com
+is-a-cpa.com
+is-a-cubicle-slave.com
+is-a-democrat.com
+is-a-designer.com
+is-a-doctor.com
+is-a-financialadvisor.com
+is-a-geek.com
+is-a-geek.net
+is-a-geek.org
+is-a-green.com
+is-a-guru.com
+is-a-hard-worker.com
+is-a-hunter.com
+is-a-knight.org
+is-a-landscaper.com
+is-a-lawyer.com
+is-a-liberal.com
+is-a-libertarian.com
+is-a-linux-user.org
+is-a-llama.com
+is-a-musician.com
+is-a-nascarfan.com
+is-a-nurse.com
+is-a-painter.com
+is-a-patsfan.org
+is-a-personaltrainer.com
+is-a-photographer.com
+is-a-player.com
+is-a-republican.com
+is-a-rockstar.com
+is-a-socialist.com
+is-a-soxfan.org
+is-a-student.com
+is-a-teacher.com
+is-a-techie.com
+is-a-therapist.com
+is-an-accountant.com
+is-an-actor.com
+is-an-actress.com
+is-an-anarchist.com
+is-an-artist.com
+is-an-engineer.com
+is-an-entertainer.com
+is-by.us
+is-certified.com
+is-found.org
+is-gone.com
+is-into-anime.com
+is-into-cars.com
+is-into-cartoons.com
+is-into-games.com
+is-leet.com
+is-lost.org
+is-not-certified.com
+is-saved.org
+is-slick.com
+is-uberleet.com
+is-very-bad.org
+is-very-evil.org
+is-very-good.org
+is-very-nice.org
+is-very-sweet.org
+is-with-theband.com
+isa-geek.com
+isa-geek.net
+isa-geek.org
+isa-hockeynut.com
+issmarterthanyou.com
+isteingeek.de
+istmein.de
+kicks-ass.net
+kicks-ass.org
+knowsitall.info
+land-4-sale.us
+lebtimnetz.de
+leitungsen.de
+likes-pie.com
+likescandy.com
+merseine.nu
+mine.nu
+misconfused.org
+mypets.ws
+myphotos.cc
+neat-url.com
+office-on-the.net
+on-the-web.tv
+podzone.net
+podzone.org
+readmyblog.org
+saves-the-whales.com
+scrapper-site.net
+scrapping.cc
+selfip.biz
+selfip.com
+selfip.info
+selfip.net
+selfip.org
+sells-for-less.com
+sells-for-u.com
+sells-it.net
+sellsyourhome.org
+servebbs.com
+servebbs.net
+servebbs.org
+serveftp.net
+serveftp.org
+servegame.org
+shacknet.nu
+simple-url.com
+space-to-rent.com
+stuff-4-sale.org
+stuff-4-sale.us
+teaches-yoga.com
+thruhere.net
+traeumtgerade.de
+webhop.biz
+webhop.info
+webhop.net
+webhop.org
+worse-than.tv
+writesthisblog.com
+
+// ddnss.de : https://www.ddnss.de/
+// Submitted by Robert Niedziela <webmaster@ddnss.de>
+ddnss.de
+dyn.ddnss.de
+dyndns.ddnss.de
+dyndns1.de
+dyn-ip24.de
+home-webserver.de
+dyn.home-webserver.de
+myhome-server.de
+ddnss.org
+
+// dynv6 : https://dynv6.com
+// Submitted by Dominik Menke <dom@digineo.de> 2016-01-18
+dynv6.net
+
+// E4YOU spol. s.r.o. : https://e4you.cz/
+// Submitted by Vladimir Dudr <info@e4you.cz>
+e4.cz
+
+// Enonic : http://enonic.com/
+// Submitted by Erik Kaareng-Sunde <esu@enonic.com>
+enonic.io
+customer.enonic.io
+
+// EU.org https://eu.org/
+// Submitted by Pierre Beyssac <hostmaster@eu.org>
+eu.org
+al.eu.org
+asso.eu.org
+at.eu.org
+au.eu.org
+be.eu.org
+bg.eu.org
+ca.eu.org
+cd.eu.org
+ch.eu.org
+cn.eu.org
+cy.eu.org
+cz.eu.org
+de.eu.org
+dk.eu.org
+edu.eu.org
+ee.eu.org
+es.eu.org
+fi.eu.org
+fr.eu.org
+gr.eu.org
+hr.eu.org
+hu.eu.org
+ie.eu.org
+il.eu.org
+in.eu.org
+int.eu.org
+is.eu.org
+it.eu.org
+jp.eu.org
+kr.eu.org
+lt.eu.org
+lu.eu.org
+lv.eu.org
+mc.eu.org
+me.eu.org
+mk.eu.org
+mt.eu.org
+my.eu.org
+net.eu.org
+ng.eu.org
+nl.eu.org
+no.eu.org
+nz.eu.org
+paris.eu.org
+pl.eu.org
+pt.eu.org
+q-a.eu.org
+ro.eu.org
+ru.eu.org
+se.eu.org
+si.eu.org
+sk.eu.org
+tr.eu.org
+uk.eu.org
+us.eu.org
+
+// Evennode : http://www.evennode.com/
+// Submitted by Michal Kralik <support@evennode.com>
+eu-1.evennode.com
+eu-2.evennode.com
+us-1.evennode.com
+us-2.evennode.com
+
+// Facebook, Inc.
+// Submitted by Peter Ruibal <public-suffix@fb.com>
+apps.fbsbx.com
+
+// FAITID : https://faitid.org/
+// Submitted by Maxim Alzoba <tech.contact@faitid.org>
+// https://www.flexireg.net/stat_info
+ru.net
+adygeya.ru
+bashkiria.ru
+bir.ru
+cbg.ru
+com.ru
+dagestan.ru
+grozny.ru
+kalmykia.ru
+kustanai.ru
+marine.ru
+mordovia.ru
+msk.ru
+mytis.ru
+nalchik.ru
+nov.ru
+pyatigorsk.ru
+spb.ru
+vladikavkaz.ru
+vladimir.ru
+abkhazia.su
+adygeya.su
+aktyubinsk.su
+arkhangelsk.su
+armenia.su
+ashgabad.su
+azerbaijan.su
+balashov.su
+bashkiria.su
+bryansk.su
+bukhara.su
+chimkent.su
+dagestan.su
+east-kazakhstan.su
+exnet.su
+georgia.su
+grozny.su
+ivanovo.su
+jambyl.su
+kalmykia.su
+kaluga.su
+karacol.su
+karaganda.su
+karelia.su
+khakassia.su
+krasnodar.su
+kurgan.su
+kustanai.su
+lenug.su
+mangyshlak.su
+mordovia.su
+msk.su
+murmansk.su
+nalchik.su
+navoi.su
+north-kazakhstan.su
+nov.su
+obninsk.su
+penza.su
+pokrovsk.su
+sochi.su
+spb.su
+tashkent.su
+termez.su
+togliatti.su
+troitsk.su
+tselinograd.su
+tula.su
+tuva.su
+vladikavkaz.su
+vladimir.su
+vologda.su
+
+// Fastly Inc. : http://www.fastly.com/
+// Submitted by Fastly Security <security@fastly.com>
+map.fastly.net
+a.prod.fastly.net
+global.prod.fastly.net
+a.ssl.fastly.net
+b.ssl.fastly.net
+global.ssl.fastly.net
+fastlylb.net
+map.fastlylb.net
+
+// Featherhead : https://featherhead.xyz/
+// Submitted by Simon Menke <simon@featherhead.xyz>
+fhapp.xyz
+
+// Firebase, Inc.
+// Submitted by Chris Raynor <chris@firebase.com>
+firebaseapp.com
+
+// Flynn : https://flynn.io
+// Submitted by Jonathan Rudenberg <jonathan@flynn.io>
+flynnhub.com
+
+// Freebox : http://www.freebox.fr
+// Submitted by Romain Fliedel <rfliedel@freebox.fr>
+freebox-os.com
+freeboxos.com
+fbx-os.fr
+fbxos.fr
+freebox-os.fr
+freeboxos.fr
+
+// Fusion Intranet : https://www.fusion-intranet.com
+// Submitted by Matthias Burtscher <matthias.burtscher@fusonic.net>
+myfusion.cloud
+
+// Futureweb OG : http://www.futureweb.at
+// Submitted by Andreas Schnederle-Wagner <schnederle@futureweb.at>
+futurehosting.at
+futuremailing.at
+*.ex.ortsinfo.at
+*.kunden.ortsinfo.at
+*.statics.cloud
+
+// GDS : https://www.gov.uk/service-manual/operations/operating-servicegovuk-subdomains
+// Submitted by David Illsley <david.illsley@digital.cabinet-office.gov.uk>
+service.gov.uk
+
+// GitHub, Inc.
+// Submitted by Patrick Toomey <security@github.com>
+github.io
+githubusercontent.com
+githubcloud.com
+*.api.githubcloud.com
+*.ext.githubcloud.com
+gist.githubcloud.com
+*.githubcloudusercontent.com
+
+// GitLab, Inc.
+// Submitted by Alex Hanselka <alex@gitlab.com>
+gitlab.io
+
+// UKHomeOffice : https://www.gov.uk/government/organisations/home-office
+// Submitted by Jon Shanks <jon.shanks@digital.homeoffice.gov.uk>
+homeoffice.gov.uk
+
+// GlobeHosting, Inc.
+// Submitted by Zoltan Egresi <egresi@globehosting.com>
+ro.im
+shop.ro
+
+// GoIP DNS Services : http://www.goip.de
+// Submitted by Christian Poulter <milchstrasse@goip.de>
+goip.de
+
+// Google, Inc.
+// Submitted by Eduardo Vela <evn@google.com>
+*.0emm.com
+appspot.com
+blogspot.ae
+blogspot.al
+blogspot.am
+blogspot.ba
+blogspot.be
+blogspot.bg
+blogspot.bj
+blogspot.ca
+blogspot.cf
+blogspot.ch
+blogspot.cl
+blogspot.co.at
+blogspot.co.id
+blogspot.co.il
+blogspot.co.ke
+blogspot.co.nz
+blogspot.co.uk
+blogspot.co.za
+blogspot.com
+blogspot.com.ar
+blogspot.com.au
+blogspot.com.br
+blogspot.com.by
+blogspot.com.co
+blogspot.com.cy
+blogspot.com.ee
+blogspot.com.eg
+blogspot.com.es
+blogspot.com.mt
+blogspot.com.ng
+blogspot.com.tr
+blogspot.com.uy
+blogspot.cv
+blogspot.cz
+blogspot.de
+blogspot.dk
+blogspot.fi
+blogspot.fr
+blogspot.gr
+blogspot.hk
+blogspot.hr
+blogspot.hu
+blogspot.ie
+blogspot.in
+blogspot.is
+blogspot.it
+blogspot.jp
+blogspot.kr
+blogspot.li
+blogspot.lt
+blogspot.lu
+blogspot.md
+blogspot.mk
+blogspot.mr
+blogspot.mx
+blogspot.my
+blogspot.nl
+blogspot.no
+blogspot.pe
+blogspot.pt
+blogspot.qa
+blogspot.re
+blogspot.ro
+blogspot.rs
+blogspot.ru
+blogspot.se
+blogspot.sg
+blogspot.si
+blogspot.sk
+blogspot.sn
+blogspot.td
+blogspot.tw
+blogspot.ug
+blogspot.vn
+cloudfunctions.net
+codespot.com
+googleapis.com
+googlecode.com
+pagespeedmobilizer.com
+publishproxy.com
+withgoogle.com
+withyoutube.com
+
+// Hashbang : https://hashbang.sh
+hashbang.sh
+
+// Hasura : https://hasura.io
+// Submitted by Shahidh K Muhammed <shahidh@hasura.io>
+hasura-app.io
+
+// Hepforge : https://www.hepforge.org
+// Submitted by David Grellscheid <admin@hepforge.org>
+hepforge.org
+
+// Heroku : https://www.heroku.com/
+// Submitted by Tom Maher <tmaher@heroku.com>
+herokuapp.com
+herokussl.com
+
+// iki.fi
+// Submitted by Hannu Aronsson <haa@iki.fi>
+iki.fi
+
+// info.at : http://www.info.at/
+biz.at
+info.at
+
+// Interlegis : http://www.interlegis.leg.br
+// Submitted by Gabriel Ferreira <registrobr@interlegis.leg.br>
+ac.leg.br
+al.leg.br
+am.leg.br
+ap.leg.br
+ba.leg.br
+ce.leg.br
+df.leg.br
+es.leg.br
+go.leg.br
+ma.leg.br
+mg.leg.br
+ms.leg.br
+mt.leg.br
+pa.leg.br
+pb.leg.br
+pe.leg.br
+pi.leg.br
+pr.leg.br
+rj.leg.br
+rn.leg.br
+ro.leg.br
+rr.leg.br
+rs.leg.br
+sc.leg.br
+se.leg.br
+sp.leg.br
+to.leg.br
+
+// Joyent : https://www.joyent.com/
+// Submitted by Brian Bennett <brian.bennett@joyent.com>
+*.triton.zone
+*.cns.joyent.com
+
+// JS.ORG : http://dns.js.org
+// Submitted by Stefan Keim <admin@js.org>
+js.org
+
+// Keyweb AG : https://www.keyweb.de
+// Submitted by Martin Dannehl <postmaster@keymachine.de>
+keymachine.de
+
+// KnightPoint Systems, LLC : http://www.knightpoint.com/
+// Submitted by Roy Keene <rkeene@knightpoint.com>
+knightpoint.systems
+
+// .KRD : http://nic.krd/data/krd/Registration%20Policy.pdf
+co.krd
+edu.krd
+
+// Magento Commerce
+// Submitted by Damien Tournoud <dtournoud@magento.cloud>
+*.magentosite.cloud
+
+// Meteor Development Group : https://www.meteor.com/hosting
+// Submitted by Pierre Carrier <pierre@meteor.com>
+meteorapp.com
+eu.meteorapp.com
+
+// Michau Enterprises Limited : http://www.co.pl/
+co.pl
+
+// Microsoft : http://microsoft.com
+// Submitted by Barry Dorrans <bdorrans@microsoft.com>
+azurewebsites.net
+azure-mobile.net
+cloudapp.net
+
+// Mozilla Foundation : https://mozilla.org/
+// Submitted by glob <glob@mozilla.com>
+bmoattachments.org
+
+// Neustar Inc.
+// Submitted by Trung Tran <Trung.Tran@neustar.biz>
+4u.com
+
+// ngrok : https://ngrok.com/
+// Submitted by Alan Shreve <alan@ngrok.com>
+ngrok.io
+
+// NFSN, Inc. : https://www.NearlyFreeSpeech.NET/
+// Submitted by Jeff Wheelhouse <support@nearlyfreespeech.net>
+nfshost.com
+
+// nsupdate.info : https://www.nsupdate.info/
+// Submitted by Thomas Waldmann <info@nsupdate.info>
+nsupdate.info
+nerdpol.ovh
+
+// No-IP.com : https://noip.com/
+// Submitted by Deven Reza <publicsuffixlist@noip.com>
+blogsyte.com
+brasilia.me
+cable-modem.org
+ciscofreak.com
+collegefan.org
+couchpotatofries.org
+damnserver.com
+ddns.me
+ditchyourip.com
+dnsfor.me
+dnsiskinky.com
+dvrcam.info
+dynns.com
+eating-organic.net
+fantasyleague.cc
+geekgalaxy.com
+golffan.us
+health-carereform.com
+homesecuritymac.com
+homesecuritypc.com
+hopto.me
+ilovecollege.info
+loginto.me
+mlbfan.org
+mmafan.biz
+myactivedirectory.com
+mydissent.net
+myeffect.net
+mymediapc.net
+mypsx.net
+mysecuritycamera.com
+mysecuritycamera.net
+mysecuritycamera.org
+net-freaks.com
+nflfan.org
+nhlfan.net
+no-ip.ca
+no-ip.co.uk
+no-ip.net
+noip.us
+onthewifi.com
+pgafan.net
+point2this.com
+pointto.us
+privatizehealthinsurance.net
+quicksytes.com
+read-books.org
+securitytactics.com
+serveexchange.com
+servehumour.com
+servep2p.com
+servesarcasm.com
+stufftoread.com
+ufcfan.org
+unusualperson.com
+workisboring.com
+3utilities.com
+bounceme.net
+ddns.net
+ddnsking.com
+gotdns.ch
+hopto.org
+myftp.biz
+myftp.org
+myvnc.com
+no-ip.biz
+no-ip.info
+no-ip.org
+noip.me
+redirectme.net
+servebeer.com
+serveblog.net
+servecounterstrike.com
+serveftp.com
+servegame.com
+servehalflife.com
+servehttp.com
+serveirc.com
+serveminecraft.net
+servemp3.com
+servepics.com
+servequake.com
+sytes.net
+webhop.me
+zapto.org
+
+// NYC.mn : http://www.information.nyc.mn
+// Submitted by Matthew Brown <mattbrown@nyc.mn>
+nyc.mn
+
+// One Fold Media : http://www.onefoldmedia.com/
+// Submitted by Eddie Jones <eddie@onefoldmedia.com>
+nid.io
+
+// OpenCraft GmbH : http://opencraft.com/
+// Submitted by Sven Marnach <sven@opencraft.com>
+opencraft.hosting
+
+// Opera Software, A.S.A.
+// Submitted by Yngve Pettersen <yngve@opera.com>
+operaunite.com
+
+// OutSystems
+// Submitted by Duarte Santos <domain-admin@outsystemscloud.com>
+outsystemscloud.com
+
+// OwnProvider : http://www.ownprovider.com
+// Submitted by Jan Moennich <jan.moennich@ownprovider.com>
+ownprovider.com
+
+// oy.lc
+// Submitted by Charly Coste <changaco@changaco.oy.lc>
+oy.lc
+
+// Pagefog : https://pagefog.com/
+// Submitted by Derek Myers <derek@pagefog.com>
+pgfog.com
+
+// Pagefront : https://www.pagefronthq.com/
+// Submitted by Jason Kriss <jason@pagefronthq.com>
+pagefrontapp.com
+
+// .pl domains (grandfathered)
+art.pl
+gliwice.pl
+krakow.pl
+poznan.pl
+wroc.pl
+zakopane.pl
+
+// Pantheon Systems, Inc. : https://pantheon.io/
+// Submitted by Gary Dylina <gary@pantheon.io>
+pantheonsite.io
+gotpantheon.com
+
+// Peplink | Pepwave : http://peplink.com/
+// Submitted by Steve Leung <steveleung@peplink.com>
+mypep.link
+
+// Planet-Work : https://www.planet-work.com/
+// Submitted by Frédéric VANNIÈRE <f.vanniere@planet-work.com>
+on-web.fr
+
+// prgmr.com : https://prgmr.com/
+// Submitted by Sarah Newman <owner@prgmr.com>
+xen.prgmr.com
+
+// priv.at : http://www.nic.priv.at/
+// Submitted by registry <lendl@nic.at>
+priv.at
+
+// Protonet GmbH : http://protonet.io
+// Submitted by Martin Meier <admin@protonet.io>
+protonet.io
+
+// Publication Presse Communication SARL : https://ppcom.fr
+// Submitted by Yaacov Akiba Slama <admin@chirurgiens-dentistes-en-france.fr>
+chirurgiens-dentistes-en-france.fr
+
+// QA2
+// Submitted by Daniel Dent (https://www.danieldent.com/)
+qa2.com
+
+// QNAP System Inc : https://www.qnap.com
+// Submitted by Nick Chang <nickchang@qnap.com>
+dev-myqnapcloud.com
+alpha-myqnapcloud.com
+myqnapcloud.com
+
+// Rackmaze LLC : https://www.rackmaze.com
+// Submitted by Kirill Pertsev <kika@rackmaze.com>
+rackmaze.com
+rackmaze.net
+
+// Red Hat, Inc. OpenShift : https://openshift.redhat.com/
+// Submitted by Tim Kramer <tkramer@rhcloud.com>
+rhcloud.com
+
+// RethinkDB : https://www.rethinkdb.com/
+// Submitted by Chris Kastorff <info@rethinkdb.com>
+hzc.io
+
+// Revitalised Limited : http://www.revitalised.co.uk
+// Submitted by Jack Price <jack@revitalised.co.uk>
+wellbeingzone.eu
+ptplus.fit
+wellbeingzone.co.uk
+
+// Sandstorm Development Group, Inc. : https://sandcats.io/
+// Submitted by Asheesh Laroia <asheesh@sandstorm.io>
+sandcats.io
+
+// SBE network solutions GmbH : https://www.sbe.de/
+// Submitted by Norman Meilick <nm@sbe.de>
+logoip.de
+logoip.com
+
+// Securepoint GmbH : https://www.securepoint.de
+// Submitted by Erik Anders <erik.anders@securepoint.de>
+firewall-gateway.com
+firewall-gateway.de
+my-gateway.de
+my-router.de
+spdns.de
+spdns.eu
+firewall-gateway.net
+my-firewall.org
+myfirewall.org
+spdns.org
+
+// Service Online LLC : http://drs.ua/
+// Submitted by Serhii Bulakh <support@drs.ua>
+biz.ua
+co.ua
+pp.ua
+
+// ShiftEdit : https://shiftedit.net/
+// Submitted by Adam Jimenez <adam@shiftcreate.com>
+shiftedit.io
+
+// Shopblocks : http://www.shopblocks.com/
+// Submitted by Alex Bowers <alex@shopblocks.com>
+myshopblocks.com
+
+// SinaAppEngine : http://sae.sina.com.cn/
+// Submitted by SinaAppEngine <saesupport@sinacloud.com>
+1kapp.com
+appchizi.com
+applinzi.com
+sinaapp.com
+vipsinaapp.com
+
+// Skyhat : http://www.skyhat.io
+// Submitted by Shante Adam <shante@skyhat.io>
+bounty-full.com
+alpha.bounty-full.com
+beta.bounty-full.com
+
+// staticland : https://static.land
+// Submitted by Seth Vincent <sethvincent@gmail.com>
+static.land
+dev.static.land
+sites.static.land
+
+// SourceLair PC : https://www.sourcelair.com
+// Submitted by Antonis Kalipetis <akalipetis@sourcelair.com>
+apps.lair.io
+*.stolos.io
+
+// SpaceKit : https://www.spacekit.io/
+// Submitted by Reza Akhavan <spacekit.io@gmail.com>
+spacekit.io
+
+// Stackspace : https://www.stackspace.io/
+// Submitted by Lina He <info@stackspace.io>
+stackspace.space
+
+// Synology, Inc. : https://www.synology.com/
+// Submitted by Rony Weng <ronyweng@synology.com>
+diskstation.me
+dscloud.biz
+dscloud.me
+dscloud.mobi
+dsmynas.com
+dsmynas.net
+dsmynas.org
+familyds.com
+familyds.net
+familyds.org
+i234.me
+myds.me
+synology.me
+
+// TAIFUN Software AG : http://taifun-software.de
+// Submitted by Bjoern Henke <dev-server@taifun-software.de>
+taifun-dns.de
+
+// TASK geographical domains (www.task.gda.pl/uslugi/dns)
+gda.pl
+gdansk.pl
+gdynia.pl
+med.pl
+sopot.pl
+
+// TownNews.com : http://www.townnews.com
+// Submitted by Dustin Ward <dward@townnews.com>
+bloxcms.com
+townnews-staging.com
+
+// TransIP : htts://www.transip.nl
+// Submitted by Rory Breuk <rbreuk@transip.nl>
+*.transurl.be
+*.transurl.eu
+*.transurl.nl
+
+// TuxFamily : http://tuxfamily.org
+// Submitted by TuxFamily administrators <adm@staff.tuxfamily.org>
+tuxfamily.org
+
+// TwoDNS : https://www.twodns.de/
+// Submitted by TwoDNS-Support <support@two-dns.de>
+dd-dns.de
+diskstation.eu
+diskstation.org
+dray-dns.de
+draydns.de
+dyn-vpn.de
+dynvpn.de
+mein-vigor.de
+my-vigor.de
+my-wan.de
+syno-ds.de
+synology-diskstation.de
+synology-ds.de
+
+// UDR Limited : http://www.udr.hk.com
+// Submitted by registry <hostmaster@udr.hk.com>
+hk.com
+hk.org
+ltd.hk
+inc.hk
+
+// .US
+// Submitted by Ed Moore <Ed.Moore@lib.de.us>
+lib.de.us
+
+// Viprinet Europe GmbH : http://www.viprinet.com
+// Submitted by Simon Kissel <hostmaster@viprinet.com>
+router.management
+
+// Western Digital Technologies, Inc : https://www.wdc.com
+// Submitted by Jung Jin <jungseok.jin@wdc.com>
+remotewd.com
+
+// Wikimedia Labs : https://wikitech.wikimedia.org
+// Submitted by Yuvi Panda <yuvipanda@wikimedia.org>
+wmflabs.org
+
+// Yola : https://www.yola.com/
+// Submitted by Stefano Rivera <stefano@yola.com>
+yolasite.com
+
+// Yombo : https://yombo.net
+// Submitted by Mitch Schwenk <mitch@yombo.net>
+ybo.faith
+yombo.me
+homelink.one
+ybo.party
+ybo.review
+ybo.science
+ybo.trade
+
+// ZaNiC : http://www.za.net/
+// Submitted by registry <hostmaster@nic.za.net>
+za.net
+za.org
+
+// Zeit, Inc. : https://zeit.domains/
+// Submitted by Olli Vanhoja <olli@zeit.co>
+now.sh
+
+// 1GB LLC : https://www.1gb.ua/
+// Submitted by 1GB LLC <noc@1gb.com.ua>
+cc.ua
+inf.ua
+ltd.ua
+
+// ===END PRIVATE DOMAINS===
index fd70b071bf41a42e961efefe75165e99b972d216..78b345675ad2ddf7db834d4f8d9d1df3b0932ddf 100644 (file)
@@ -42,7 +42,7 @@
 
 "able.or.kr"           "http://able.or.kr/ddns/src/update.php?hostname=[DOMAIN]&myip=[IP]&ddnsuser=[USERNAME]&pwd=[PASSWORD]"
 
-"afraid.org-basicauth" "http://[USERNAME]:[PASSWORD]@freedns.afraid.org/nic/update?hostname=[DOMAIN]&myip=[IP]
+"afraid.org-basicauth" "http://[USERNAME]:[PASSWORD]@freedns.afraid.org/nic/update?hostname=[DOMAIN]&myip=[IP]"
 "afraid.org-keyauth"   "http://freedns.afraid.org/dynamic/update.php?[PASSWORD]&address=[IP]"
 
 "all-inkl.com"         "http://[USERNAME]:[PASSWORD]@dyndns.kasserver.com/?myip=[IP]"
@@ -84,7 +84,7 @@
 
 "duckdns.org"          "http://www.duckdns.org/update?domains=[USERNAME]&token=[PASSWORD]&ip=[IP]"     "OK"
 
-"duiadns.net"          "http://[USERNAME]:[PASSWORD]@ipv4.duia.ro/dynamic.duia?host=[DOMAIN]&ip4=[IP]"
+"duiadns.net"          "http://ip.duiadns.net/dynamic.duia?host=[DOMAIN]&password=[PASSWORD]&ip4=[IP]"
 
 "dy.fi"                        "http://[USERNAME]:[PASSWORD]@www.dy.fi/nic/update?hostname=[DOMAIN]"   "good|nochg"
 
index f2409d6ff566d4a4fc7611772fa203801e68fece..5b2cc23ad225c45d74a56bf00ecadd9f4e94e486 100644 (file)
@@ -38,7 +38,7 @@
 #.godaddy.com-v1       !!! Please install additional package "ddns-scripts_godaddy.com-v1"
 #.no-ip.com / noip.com !!! Please install additional package "ddns-scripts_no-ip_com"
 
-"afraid.org-basicauth" "http://[USERNAME]:[PASSWORD]@freedns.afraid.org/nic/update?hostname=[DOMAIN]&myip=[IP]
+"afraid.org-basicauth" "http://[USERNAME]:[PASSWORD]@freedns.afraid.org/nic/update?hostname=[DOMAIN]&myip=[IP]"
 "afraid.org-keyauth"   "http://freedns.afraid.org/dynamic/update.php?[PASSWORD]&address=[IP]"
 
 "all-inkl.com"         "http://[USERNAME]:[PASSWORD]@dyndns.kasserver.com/?myip=[IP]"
@@ -58,7 +58,7 @@
 
 "duckdns.org"          "http://www.duckdns.org/update?domains=[DOMAIN]&token=[PASSWORD]&ipv6=[IP]"     "OK"
 
-"duiadns.net"          "http://[USERNAME]:[PASSWORD]@ipv6.duia.ro/dynamic.duia?host=[DOMAIN]&ip6=[IP]"
+"duiadns.net"          "http://ip.duiadns.net/dynamic.duia?host=[DOMAIN]&password=[PASSWORD]&ip6=[IP]"
 
 "dyn.com"              "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]"        "good|nochg"
 "dyndns.org"           "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]"        "good|nochg"
index 6e897233ff53d5ae0e91acd45584bafff25d92f8..9fa9431dc2231653f13ebda7ad54b169c3e2acbf 100755 (executable)
@@ -2,7 +2,7 @@
 #.Distributed under the terms of the GNU General Public License (GPL) version 2.0
 #
 # script for sending updates to cloudflare.com
-#.2014-2015 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+#.2014-2017 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
 [ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing 'username'"
 [ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing 'password'"
 
-local __RECID __URL __KEY __KEYS __FOUND __SUBDOM __DOMAIN __TLD
-
-# split given Host/Domain into TLD, registrable domain, and subdomain
-split_FQDN $domain __TLD __DOMAIN __SUBDOM
-[ $? -ne 0 -o -z "$__DOMAIN" ] && \
-       write_log 14 "Wrong Host/Domain configuration ($domain). Please correct configuration!"
-
-# put together what we need
-__DOMAIN="$__DOMAIN.$__TLD"
+local __RECID __URL __KEY __KEYS __FOUND __SUBDOM __DOMAIN __FQDN
+
+# split __SUBDOM __DOMAIN from $domain
+# given data:
+# @example.com for "domain record"
+# host.sub@example.com for a "host record"
+__SUBDOM=$(printf %s "$domain" | cut -d@ -f1)
+__DOMAIN=$(printf %s "$domain" | cut -d@ -f2)
+
+# Cloudflare v1 needs:
+# __DOMAIN = the base domain i.e. example.com
+# __SUBDOM = the host.sub to change if a "host record" or blank if domain record
+# __FQDN   = the FQDN to detect record_id to change
+# i.e. example.com for the "domain record" or host.sub.example.com for "host record"
+if [ -z "$__SUBDOM" -o "$__SUBDOM" = "$__DOMAIN" ]; then
+       __SUBDOM=""
+       __FQDN="$__DOMAIN"
+else
+       __FQDN="${__SUBDOM}.${__DOMAIN}"
+fi
 
 # parse OpenWrt script with
 # functions for parsing and generating json
@@ -90,7 +101,7 @@ cleanup() {
        #       json_get_var __DISPLAY "display_name"   # for debugging
                json_get_var __NAME "name"
                json_get_var __TYPE "type"
-               if [ "$__NAME" = "$domain" ]; then
+               if [ "$__NAME" = "$__FQDN" ]; then
                        # 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
@@ -106,7 +117,7 @@ cleanup() {
        }
        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'"
+       write_log 7 "rec_id '$__RECID' detected for host/domain '$__FQDN'"
 }
 
 # build url according to cloudflare client api at https://www.cloudflare.com/docs/client-api.html
index 621203c1f87437bc9f0d35c2ab500e63699d67ce..aef3b7327955469ab0402c00ddcced1084f70c66 100755 (executable)
@@ -5,7 +5,7 @@
 # script for sending updates to cloudflare.com
 #.based on Ben Kulbertis cloudflare-update-record.sh found at http://gist.github.com/benkulbertis
 #.and on George Johnson's cf-ddns.sh found at https://github.com/gstuartj/cf-ddns.sh
-#.2016 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+#.2016-2017 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
 # CloudFlare API documentation at https://api.cloudflare.com/
 #
 # This script is parsed by dynamic_dns_functions.sh inside send_update() function
@@ -29,11 +29,21 @@ local __HOST __DOMAIN __TYPE __URLBASE __PRGBASE __RUNPROG __DATA __IPV6 __ZONEI
 local __URLBASE="https://api.cloudflare.com/client/v4"
 
 # split __HOST __DOMAIN from $domain
+# given data:
+# @example.com for "domain record"
+# host.sub@example.com for a "host record"
 __HOST=$(printf %s "$domain" | cut -d@ -f1)
 __DOMAIN=$(printf %s "$domain" | cut -d@ -f2)
 
-# __HOST != __DOMAIN then host@domain.tld => host.domain.tld
-[ "$__HOST" = "$__DOMAIN" ] || __HOST=$(printf %s "$domain" | tr "@" ".")
+# Cloudflare v4 needs:
+# __DOMAIN = the base domain i.e. example.com
+# __HOST   = the FQDN of record to modify
+# i.e. example.com for the "domain record" or host.sub.example.com for "host record"
+
+# handling domain record then set __HOST = __DOMAIN
+[ -z "$__HOST" ] && __HOST=$__DOMAIN
+# handling host record then rebuild fqdn host@domain.tld => host.domain.tld
+[ "$__HOST" != "$__DOMAIN" ] && __HOST="${__HOST}.${__DOMAIN}"
 
 # set record type
 [ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA"
@@ -118,23 +128,23 @@ __PRGBASE="$__PRGBASE --header 'Content-Type: application/json' "
 # __PRGBASE="$__PRGBASE --header 'Accept: application/json' "
 
 # read zone id for registered domain.TLD
-__RUNPROG="$__PRGBASE --request GET $__URLBASE/zones?name=$__DOMAIN"
+__RUNPROG="$__PRGBASE --request GET '$__URLBASE/zones?name=$__DOMAIN'"
 cloudflare_transfer || return 1
 # extract zone id
 __ZONEID=$(grep -o '"id":"[^"]*' $DATFILE | grep -o '[^"]*$' | head -1)
 [ -z "$__ZONEID" ] && {
        write_log 4 "Could not detect 'zone id' for domain.tld: '$__DOMAIN'"
-       return 1
+       return 127
 }
 
 # read record id for A or AAAA record of host.domain.TLD
-__RUNPROG="$__PRGBASE --request GET $__URLBASE/zones/$__ZONEID/dns_records?name=$__HOST&type=$__TYPE"
+__RUNPROG="$__PRGBASE --request GET '$__URLBASE/zones/$__ZONEID/dns_records?name=$__HOST&type=$__TYPE'"
 cloudflare_transfer || return 1
 # extract record id
 __RECID=$(grep -o '"id":"[^"]*' $DATFILE | grep -o '[^"]*$' | head -1)
 [ -z "$__RECID" ] && {
        write_log 4 "Could not detect 'record id' for host.domain.tld: '$__HOST'"
-       return 1
+       return 127
 }
 
 # extract current stored IP
@@ -153,12 +163,12 @@ __DATA=$(grep -o '"content":"[^"]*' $DATFILE | grep -o '[^"]*$' | head -1)
                expand_ipv6 $__DATA __DATA
                [ "$__DATA" = "$__IPV6" ] && {          # IPv6 no update needed
                        write_log 7 "IPv6 at CloudFlare.com already up to date"
-                       return 127
+                       return 0
                }
        else
                [ "$__DATA" = "$__IP" ] && {            # IPv4 no update needed
                        write_log 7 "IPv4 at CloudFlare.com already up to date"
-                       return 127
+                       return 0
                }
        fi
 }
@@ -171,7 +181,7 @@ cat > $DATFILE << EOF
 EOF
 
 # let's complete transfer command
-__RUNPROG="$__PRGBASE --request PUT --data @$DATFILE $__URLBASE/zones/$__ZONEID/dns_records/$__RECID"
+__RUNPROG="$__PRGBASE --request PUT --data @$DATFILE '$__URLBASE/zones/$__ZONEID/dns_records/$__RECID'"
 cloudflare_transfer || return 1
 
 return 0
index 45fc0ccac85905db7f97b3bdee16742e08982a8f..9633b4e245569741855b13a9d6edb3b75e1cbdf6 100755 (executable)
@@ -4,7 +4,7 @@
 #
 # script for sending updates to godaddy.com
 #.based on GoDaddy.sh v1.0 by Nazar78 @ TeaNazaR.com
-#.2016 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+#.2017 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
 # GoDaddy Documentation at https://developer.godaddy.com/doc
 #
 # This script is parsed by dynamic_dns_functions.sh inside send_update() function
 local __HOST __DOMAIN __TYPE __URL __PRGBASE __RUNPROG __DATA __IPV6
 
 # split __HOST __DOMAIN from $domain
+# given data:
+# @example.com for "domain record"
+# host.sub@example.com for a "host record"
 __HOST=$(printf %s "$domain" | cut -d@ -f1)
 __DOMAIN=$(printf %s "$domain" | cut -d@ -f2)
-[ -z "$__HOST" -o "$__HOST" = "$__DOMAIN" ] && __HOST="%40"    # no expizit host given so set to default "@" => urlencode "%40"
+
+# GoDaddy needs:
+# __DOMAIN = the base domain i.e. example.com
+# __HOST   = host.sub if updating a host record or
+# __HOST   = "@" urlencoded "%40" for a domain record
+[ -z "$__HOST" -o "$__HOST" = "$__DOMAIN" ] && __HOST="%40"
 
 # set record type
 [ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA"
@@ -136,12 +144,12 @@ __DATA=$(sed -r 's/.+data":"(.+)","t.+/\1/g' $DATFILE)
                expand_ipv6 $__DATA __DATA
                [ "$__DATA" = "$__IPV6" ] && {          # IPv6 no update needed
                        write_log 7 "IPv6 at GoDaddy.com already up to date"
-                       return 127
+                       return 0
                }
        else
                [ "$__DATA" = "$__IP" ] && {            # IPv4 no update needed
                        write_log 7 "IPv4 at GoDaddy.com already up to date"
-                       return 127
+                       return 0
                }
        fi
 }
index ee6c52bd363b9262cea21e4d3abef1944f0eb39c..c4b36f1b8b6825161a5c531efe2351901ceccd1b 100644 (file)
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnscrypt-proxy
-PKG_VERSION:=1.7.0
+PKG_VERSION:=1.9.4
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://download.dnscrypt.org/dnscrypt-proxy
-PKG_MD5SUM:=95df7262964dc22da62f7f6f0466c50e
-
+PKG_MD5SUM:=fdf4a708e7922e13b14555f315ca8d5361aec89b0595b06fdbbcaacfa4e6f11e
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 
index 2c281ee9e470c96dc29f33500efa698ae310b031..117e84937451c4e53649f0beec4670e2ab80f1dc 100644 (file)
@@ -6,7 +6,17 @@ config dnscrypt-proxy ns1
        # ephemeral keys option requires extra CPU cycles and can cause huge system load
        # option ephemeral_keys '0'
        # more details at https://github.com/jedisct1/dnscrypt-proxy#public-key-client-authentication
-       # option client_key ''
+       # option client_key '/path/to/client_key'
+       # option syslog '1'
+       # option syslog_prefix 'dnscrypt-proxy'
+       # option query_log_file '/path/to/logfile'
+       # enable cache may speed up dnscrypt-proxy, see https://github.com/jedisct1/dnscrypt-proxy/wiki/Go-faster
+       # option local_cache '0'
+       # disable IPv6 may also speed up dnscrypt-proxy, see https://github.com/jedisct1/dnscrypt-proxy/wiki/Go-faster
+       # option block_ipv6 '0'
+       # Blacklists allow you to block domains, ip, ... see https://github.com/jedisct1/dnscrypt-proxy/wiki/Filtering
+       # list blacklist 'domains:/path/to/domains-blacklist-file.txt'
+       # list blacklist 'domains:/path/to/domains-blacklist2-file.txt'
 
 #      config dnscrypt-proxy ns2
 #              option address '127.0.0.1'
index cc06ca64cc5830d79c99cce6d7c97dfd84bf75f0..ac7109ab3bdadada3bab8991b340acaec7134c99 100644 (file)
 START=50
 USE_PROCD=1
 PROG=/usr/sbin/dnscrypt-proxy
+CONFIG_DIR=/var/etc
+USER=nobody
 
-dnscrypt_instance() {
-       local address port resolver resolvers_list ephemeral_keys client_key
+dnscrypt_instance() {   
+    local config_path="$CONFIG_DIR/dnscrypt-proxy-$1.conf"     
+    create_config_file $1 "$config_path"
 
-       config_get      address        $1 'address'
-       config_get      port           $1 'port'
-       config_get      resolver       $1 'resolver' ''
-       config_get      resolvers_list $1 'resolvers_list' '/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv'
-       config_get_bool ephemeral_keys $1 'ephemeral_keys' '0'
-       config_get      client_key     $1 'client_key' ''
+    procd_open_instance
+    procd_set_param command $PROG "$config_path"
+    procd_close_instance
+}
+
+create_config_file() {
+    local address port resolver resolvers_list ephemeral_keys client_key syslog syslog_prefix local_cache query_log_file block_ipv6
+    local config_path="$2"
+
+    [ ! -d "$CONFIG_DIR" ] && mkdir -p "$CONFIG_DIR"
+    [ -f "$config_path" ] && rm "$config_path"
+
+    config_get      address         $1 'address'        '127.0.0.1'
+    config_get      port            $1 'port'           '5353'
+    config_get      resolver        $1 'resolver'       ''
+    config_get      resolvers_list  $1 'resolvers_list' '/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv'
+    config_get      client_key      $1 'client_key'     ''
+    config_get      syslog_prefix   $1 'syslog_prefix'  'dnscrypt-proxy'
+    config_get      query_log_file  $1 'query_log_file' ''
+    config_get_bool syslog          $1 'syslog'         '1'
+    config_get_bool ephemeral_keys  $1 'ephemeral_keys' '0'
+    config_get_bool local_cache     $1 'local_cache'    '0'
+    config_get_bool block_ipv6      $1 'block_ipv6'     '0'
+       
+    append_param_not_empty  "ResolverName"  "$resolver"         $config_path
+    append_param            "ResolversList" "$resolvers_list"   $config_path
+    append_param            "User"          "$USER"             $config_path
+    append_param            "LocalAddress"  "$address:$port"    $config_path
+    append_param_not_empty  "ClientKey"     "$client_key"       $config_path
+    append_on_off           "EphemeralKeys" $ephemeral_keys     $config_path
+    append_on_off           "Syslog"        $syslog             $config_path
+    append_param            "SyslogPrefix"  "$syslog_prefix"    $config_path
+    append_on_off           "LocalCache"    $local_cache        $config_path
+    append_param_not_empty  "QueryLogFile"  "$query_log_file"   $config_path
+    append_yes_no           "BlockIPv6"     $block_ipv6         $config_path
+
+    config_list_foreach $1 'blacklist' append_blacklists $config_path  
+}
+
+append_on_off() {
+    local param_name=$1
+    local param_value=$2
+    local config_path=$3
+    local value
+
+    if [ $param_value -eq 1 ]
+    then
+        value="on"     
+    else
+        value="off"
+    fi
+
+    echo "$param_name $value" >> $config_path
+}
+
+append_yes_no() {
+    local param_name=$1
+    local param_value=$2
+    local config_path=$3
+    local value
+
+    if [ $param_value -eq 1 ]
+    then
+        value="yes"    
+    else
+        value="no"
+    fi
+
+    echo "$param_name $value" >> $config_path
+}
+
+append_param() {
+    local param_name=$1
+    local param_value=$2
+    local config_path=$3
+       
+    echo "$param_name $param_value" >> $config_path
+}
+
+append_param_not_empty() {
+    local param_name=$1
+    local param_value=$2
+    local config_path=$3
+
+    if [ ! -z "$param_value" -a "$param_value" != " " ]
+    then
+        append_param "$param_name" "$param_value" "$config_path"
+    fi
+}
 
-       procd_open_instance
-       procd_set_param    command $PROG -u nobody -S
-       procd_append_param command -a "$address:$port"
-       procd_append_param command -L $resolvers_list
-       [ -n "$resolver" ] && procd_append_param command -R $resolver
-       [ $ephemeral_keys -eq 1 ] && procd_append_param command -E
-       [ -n "$client_key" ] && procd_append_param command -K $client_key
-       procd_close_instance
+append_blacklists() {
+    local value="$1"
+    local config_path="$2"     
+    append_param_not_empty "BlackList" "$value" $config_path
 }
 
 start_service() {
-       config_load dnscrypt-proxy
-       config_foreach dnscrypt_instance dnscrypt-proxy
+    config_load dnscrypt-proxy
+    config_foreach dnscrypt_instance dnscrypt-proxy
 }
 
 service_triggers() {
-       procd_add_reload_trigger 'dnscrypt-proxy'
+    procd_add_reload_trigger 'dnscrypt-proxy'
 }
diff --git a/net/dynapoint/Makefile b/net/dynapoint/Makefile
new file mode 100644 (file)
index 0000000..ca32cd1
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2016 Tobias Ilte <tobias.ilte@campus.tu-berlin.de>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=dynapoint
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Tobias Ilte <tobias.ilte@campus.tu-berlin.de>
+PKG_LICENSE:=GPL-3.0+
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/$(PKG_NAME)
+    SECTION:=net
+    CATEGORY:=Network
+    SUBMENU:=wireless
+    DEPENDS:=+lua +libubus-lua +libuci-lua +libubox-lua +luci-lib-nixio
+    TITLE:=Dynamic access point manager
+endef
+
+define Package/$(PKG_NAME)/description
+  Dynapoint uses LUA scripts to allow dynamic access point creation
+  and deletion depending on changes of certain network conditions.
+endef
+
+define Package/$(PKG_NAME)/conffiles
+/etc/config/dynapoint
+endef
+
+define Build/Compile
+endef
+
+define Package/$(PKG_NAME)/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) ./src/dynapoint.lua $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./src/dynapoint.init $(1)/etc/init.d/dynapoint
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_DATA) ./src/dynapoint.config $(1)/etc/config/dynapoint
+endef
+
+$(eval $(call BuildPackage,$(PKG_NAME)))
diff --git a/net/dynapoint/src/dynapoint.config b/net/dynapoint/src/dynapoint.config
new file mode 100644 (file)
index 0000000..0578cf0
--- /dev/null
@@ -0,0 +1,9 @@
+config rule 'internet'
+       list hosts 'http://www.example.com'
+       list hosts 'http://www.google.com'
+       option interval '60'
+       option timeout '5'
+       option offline_threshold '3'
+       option add_hostname_to_ssid '0'
+       option use_curl '0'
+       option curl_interface 'eth0'
diff --git a/net/dynapoint/src/dynapoint.init b/net/dynapoint/src/dynapoint.init
new file mode 100644 (file)
index 0000000..ff105d3
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh /etc/rc.common
+
+START=99
+
+USE_PROCD=1
+PROG=/usr/sbin/dynapoint.lua
+CONFFILE=/etc/config/dynapoint
+
+start_service() {
+       procd_open_instance
+       procd_set_param command $PROG
+       procd_set_param file $CONFFILE
+       procd_set_param respawn
+       procd_close_instance
+}
diff --git a/net/dynapoint/src/dynapoint.lua b/net/dynapoint/src/dynapoint.lua
new file mode 100644 (file)
index 0000000..4d2e456
--- /dev/null
@@ -0,0 +1,203 @@
+#!/usr/bin/lua
+
+--[[
+
+Copyright (C) 2016 Tobias Ilte <tobias.ilte@campus.tu-berlin.de>
+
+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.
+
+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, see <http://www.gnu.org/licenses/>.
+
+--]]
+
+
+require "uci"
+require "ubus"
+require "uloop"
+log = require "nixio"
+
+--open sys-logging
+log.openlog("DynaPoint", "ndelay", "cons", "nowait");
+
+local uci_cursor = uci.cursor()
+
+-- get all config sections with the given type
+function getConfType(conf_file,type)
+  local ifce={}
+  uci_cursor:foreach(conf_file,type,function(s) ifce[s[".index"]]=s end)
+  return ifce
+end
+
+ubus = ubus.connect()
+if not ubus then
+  error("Failed to connect to ubusd")
+end
+ubus:call("network", "reload", {})
+
+local interval = uci_cursor:get("dynapoint", "internet", "interval")
+local timeout = uci_cursor:get("dynapoint", "internet", "timeout")
+local offline_threshold = tonumber(uci_cursor:get("dynapoint", "internet", "offline_threshold"))
+local hosts = uci_cursor:get("dynapoint", "internet", "hosts")
+local numhosts = #hosts
+local curl = tonumber(uci_cursor:get("dynapoint", "internet", "use_curl"))
+if (curl == 1) then
+  curl_interface = uci_cursor:get("dynapoint", "internet", "curl_interface")
+end
+if (tonumber(uci_cursor:get("dynapoint", "internet", "add_hostname_to_ssid")) == 1 ) then
+  localhostname = uci_cursor:get("system", "system", "hostname")
+end
+
+local table_names_rule = {}
+local table_names_not_rule = {}
+local ssids_with_hostname = {}
+local ssids_not_rule = {}
+
+function get_dynapoint_sections(t)
+  for pos,val in pairs(t) do
+    if (type(val)=="table") then
+      get_dynapoint_sections(val);
+    elseif (type(val)=="string") then
+      if (pos == "dynapoint_rule") then
+        if (val == "internet") then
+          table_names_rule[#table_names_rule+1] = t[".name"]
+        elseif (val == "!internet") then
+          table_names_not_rule[#table_names_not_rule+1] = t[".name"]
+          if (localhostname) then
+            ssids_not_rule[#ssids_not_rule+1] = t[".ssid"]
+            ssids_with_hostname[#ssids_with_hostname+1] = t[".ssid"].."_"..localhostname
+          end
+        end
+      end
+    end
+  end
+end
+
+
+--print(table.getn(hosts))
+
+get_dynapoint_sections(getConfType("wireless","wifi-iface"))
+
+-- revert all non-persistent ssid uci-changes regarding sections affecting dynapoint
+for i = 1, #table_names_not_rule do
+  uci_cursor:revert("wireless", table_names_not_rule[i], "ssid")
+end
+
+
+local online = true
+
+if (#table_names_rule > 0) then
+  if (tonumber(uci_cursor:get("wireless", table_names_rule[1], "disabled")) == 1) then
+    online = false
+  end
+else
+  log.syslog("info","Not properly configured. Please add <option dynapoint_rule 'internet'> to /etc/config/wireless")
+end
+
+local timer
+local offline_counter = 0
+uloop.init()
+
+function do_internet_check(host)
+  if (curl == 1 ) then
+    if (curl_interface) then
+      result = os.execute("curl -s -m "..timeout.." --max-redirs 0 --interface "..curl_interface.." --head "..host.." > /dev/null")
+    else
+      result = os.execute("curl -s -m "..timeout.." --max-redirs 0 --head "..host.." > /dev/null")
+    end
+  else
+    result = os.execute("wget -q --timeout="..timeout.." --spider "..host)
+  end
+  if (result == 0) then
+    return true
+  else
+    return false
+  end
+end
+
+function change_wireless_config(switch_to_offline)
+  if (switch_to_offline == 1) then
+    log.syslog("info","Switched to OFFLINE")
+
+    for i = 1, #table_names_not_rule do
+      uci_cursor:set("wireless",table_names_not_rule[i], "disabled", "0")
+      if (localhostname) then
+        uci_cursor:set("wireless", table_names_not_rule[i], "ssid", ssids_with_hostname[i])
+        log.syslog("info","Bring up new AP "..ssids_with_hostname[i])
+      else
+        log.syslog("info","Bring up new AP "..ssids_not_rule[i])
+      end
+    end
+
+    for i = 1, #table_names_rule do
+      uci_cursor:set("wireless",table_names_rule[i], "disabled", "1")
+    end
+
+  else
+    log.syslog("info","Switched to ONLINE")
+    for i = 1, #table_names_not_rule do
+      uci_cursor:set("wireless",table_names_not_rule[i], "disabled", "1")
+      if (localhostname) then
+        uci_cursor:set("wireless", table_names_not_rule[i], "ssid", ssids_not_rule[i])
+      end
+    end
+    for i = 1, #table_names_rule do
+      uci_cursor:set("wireless",table_names_rule[i], "disabled", "0")
+      log.syslog("info","Bring up new AP "..uci_cursor:get("wireless", table_names_rule[i], "ssid"))
+    end
+  end
+  uci_cursor:save("wireless")
+  ubus:call("network", "reload", {})
+end
+
+
+local hostindex = 1
+
+function check_internet_connection()
+  print("checking "..hosts[hostindex].."...")
+  if (do_internet_check(hosts[hostindex]) == true) then
+    -- online
+    print("...seems to be online")
+    offline_counter = 0
+    hostindex = 1
+    if (online == false) then
+      print("changed state to online")
+      online = true
+      change_wireless_config(0)
+    end
+  else
+    --offline
+    print("...seems to be offline")
+    hostindex = hostindex + 1
+    if (hostindex <= numhosts) then
+      check_internet_connection()
+    else
+      hostindex = 1
+      -- and activate offline-mode
+      print("all hosts offline")
+      if (online == true) then
+        offline_counter = offline_counter + 1
+        if (offline_counter == offline_threshold) then
+          print("changed state to offline")
+          online = false
+          change_wireless_config(1)
+        end
+      end
+    end
+  end
+  timer:set(interval * 1000)
+end
+
+timer = uloop.timer(check_internet_connection)
+timer:set(interval * 1000)
+
+uloop.run()
+
index 9607d762e914d7872ad2762f65c15be896d6d1d4..8c2b403b1bb96da81108c69dd7d7997e9204078d 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2015 Thomas Weißschuh
+# Copyright (C) 2015-2016 Thomas Weißschuh
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=esniper
-PKG_VERSION:=2.31.0
+PKG_VERSION:=2.32.0
 PKG_RELEASE:=1
 PKG_LICENSE:=BSD-2-Clause
 PKG_LICENSE_FILES:=COPYING
@@ -19,7 +19,7 @@ VERSION_TRANSFORMED:=$(subst .,-,$(PKG_VERSION))
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(VERSION_TRANSFORMED)
 PKG_SOURCE:=$(PKG_NAME)-$(VERSION_TRANSFORMED).tgz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=4b411588c4a223acef7333ab684c7618
+PKG_MD5SUM:=5ee3e5237c6a12059ae9d38380505d38448c2c12787f9fcc603cdb0a1a519312
 
 PKG_BUILD_PARALLEL:=1
 
index 5c550d8a5f4669d4f018dde23b622376bc8d0b06..aeaa1dfcf682a5c2b048d636b549953035fdbf0d 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fastd
 PKG_VERSION:=18
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
@@ -43,7 +43,7 @@ PKG_CONFIG_DEPENDS:=\
        CONFIG_FASTD_WITH_STATUS_SOCKET
 
 
-PKG_BUILD_DEPENDS:=nacl libuecc
+PKG_BUILD_DEPENDS:=nacl
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
@@ -51,7 +51,7 @@ include $(INCLUDE_DIR)/cmake.mk
 define Package/fastd
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+kmod-tun +librt +libpthread +FASTD_WITH_STATUS_SOCKET:libjson-c +FASTD_WITH_CAPABILITIES:libcap
+  DEPENDS:=+kmod-tun +librt +libpthread +libuecc +FASTD_WITH_STATUS_SOCKET:libjson-c +FASTD_WITH_CAPABILITIES:libcap
   TITLE:=Fast and Secure Tunneling Daemon
   URL:=https://projects.universe-factory.net/projects/fastd
   SUBMENU:=VPN
diff --git a/net/freeradius2/Config.in b/net/freeradius2/Config.in
deleted file mode 100644 (file)
index cd0141e..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# FreeRADIUS avanced configuration
-
-choice
-       prompt "SSL library"
-       default FREERADIUS_OPENSSL
-       depends on PACKAGE_freeradius2-common
-
-config FREERADIUS_NOSSL
-       bool "No SSL support"
-
-config FREERADIUS_OPENSSL
-       bool "OpenSSL"
-
-endchoice
diff --git a/net/freeradius2/Makefile b/net/freeradius2/Makefile
deleted file mode 100644 (file)
index b55b9bf..0000000
+++ /dev/null
@@ -1,636 +0,0 @@
-#
-# Copyright (C) 2008-2015 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:=freeradius2
-PKG_VERSION:=2.2.9
-PKG_RELEASE:=1
-
-PKG_SOURCE:=freeradius-server-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=\
-       ftp://ftp.freeradius.org/pub/freeradius/ \
-       ftp://ftp.freeradius.org/pub/freeradius/old/
-PKG_MD5SUM:=d1398327ba4e23c75da06d8a0e01096b
-PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
-PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILES:=COPYRIGHT LICENSE
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/freeradius-server-$(PKG_VERSION)
-PKG_FIXUP:=autoreconf
-PKG_CHECK_FORMAT_SECURITY:=0
-
-PKG_CONFIG_DEPENDS := \
-  FREERADIUS_OPENSSL \
-  FREERADIUS_NOSSL
-
-PKG_CHECK_FORMAT_SECURITY:=0
-include $(INCLUDE_DIR)/package.mk
-
-define Package/freeradius2/config
-  source "$(SOURCE)/Config.in"
-endef
-
-define Package/freeradius2/Default
-  SECTION:=net
-  CATEGORY:=Network
-  URL:=http://freeradius.org/
-  SUBMENU:=FreeRADIUS (version 2)
-endef
-
-define Package/freeradius2
-  $(call Package/freeradius2/Default)
-  DEPENDS:=+libltdl +libreadline +freeradius2-common
-  TITLE:=A flexible RADIUS server (version 2)
-endef
-
-define Package/freeradius2/conffiles
-/etc/freeradius2/clients.conf
-/etc/freeradius2/radiusd.conf
-/etc/freeradius2/sites/default
-endef
-
-define Package/freeradius2-democerts
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Demo certificates to test the server
-endef
-
-define Package/freeradius2-common
-  $(call Package/freeradius2/Default)
-  TITLE:=common files
-  DEPENDS:=+libpthread +FREERADIUS_OPENSSL:libopenssl +zlib
-endef
-
-define Package/freeradius2-mod-chap
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=CHAP module
-endef
-
-define Package/freeradius2-mod-chap/conffiles
-/etc/freeradius2/modules/chap
-endef
-
-define Package/freeradius2-mod-detail
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Detailed accounting module
-endef
-
-define Package/freeradius2-mod-detail/conffiles
-/etc/freeradius2/modules/detail
-endef
-
-define Package/freeradius2-mod-eap
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Base EAP module
-endef
-
-define Package/freeradius2-mod-eap/conffiles
-/etc/freeradius2/eap.conf
-endef
-
-define Package/freeradius2-mod-eap-gtc
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-eap
-  TITLE:=EAP/GTC module
-endef
-
-define Package/freeradius2-mod-eap-md5
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-eap
-  TITLE:=EAP/MD5 module
-endef
-
-define Package/freeradius2-mod-eap-mschapv2
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-eap +freeradius2-mod-mschap
-  TITLE:=EAP/MS-CHAPv2 module
-endef
-
-define Package/freeradius2-mod-eap-peap
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-eap @FREERADIUS_OPENSSL
-  TITLE:=EAP/PEAP module
-endef
-
-define Package/freeradius2-mod-eap-tls
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-eap @FREERADIUS_OPENSSL
-  TITLE:=EAP/TLS module
-endef
-
-define Package/freeradius2-mod-eap-ttls
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-eap-tls
-  TITLE:=EAP/TTLS module
-endef
-
-define Package/freeradius2-mod-exec
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=EXEC module
-endef
-
-define Package/freeradius2-mod-exec/conffiles
-/etc/freeradius2/modules/exec
-endef
-
-define Package/freeradius2-mod-expiration
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Expiration module
-endef
-
-define Package/freeradius2-mod-expiration/conffiles
-/etc/freeradius2/modules/expiration
-endef
-
-define Package/freeradius2-mod-always
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Always module
-endef
-
-define Package/freeradius2-mod-always/conffiles
-/etc/freeradius2/modules/always
-endef
-
-define Package/freeradius2-mod-expr
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=EXPR module
-endef
-
-define Package/freeradius2-mod-expr/conffiles
-/etc/freeradius2/modules/expr
-endef
-
-define Package/freeradius2-mod-attr-filter
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=ATTR filter module
-endef
-
-define Package/freeradius2-mod-attr-filter/conffiles
-/etc/freeradius2/modules/attr_filter
-/etc/freeradius2/attrs
-/etc/freeradius2/attrs.access_reject
-/etc/freeradius2/attrs.accounting_response
-/etc/freeradius2/attrs.pre-proxy
-endef
-
-define Package/freeradius2-mod-attr-rewrite
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=ATTR rewrite module
-endef
-
-define Package/freeradius2-mod-attr-rewrite/conffiles
-/etc/freeradius2/modules/attr_rewrite
-endef
-
-define Package/freeradius2-mod-files
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Module using local files for authorization
-endef
-
-define Package/freeradius2-mod-files/conffiles
-/etc/freeradius2/acct_users
-/etc/freeradius2/preproxy_users
-/etc/freeradius2/users
-/etc/freeradius2/modules/files
-endef
-
-define Package/freeradius2-mod-passwd
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Rlm passwd module
-endef
-
-define Package/freeradius2-mod-passwd/conffiles
-/etc/freeradius2/modules/passwd
-endef
-
-define Package/freeradius2-mod-ldap
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2 +libopenldap
-  TITLE:=LDAP module
-endef
-
-define Package/freeradius2-mod-ldap/conffiles
-/etc/freeradius2/ldap.attrmap
-/etc/freeradius2/modules/ldap
-endef
-
-define Package/freeradius2-mod-logintime
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Logintime module
-endef
-
-define Package/freeradius2-mod-logintime/conffiles
-/etc/freeradius2/modules/logintime
-endef
-
-define Package/freeradius2-mod-mschap
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=MS-CHAP and MS-CHAPv2 module
-endef
-
-define Package/freeradius2-mod-mschap/conffiles
-/etc/freeradius2/modules/mschap
-endef
-
-define Package/freeradius2-mod-pap
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=PAP module
-endef
-
-define Package/freeradius2-mod-pap/conffiles
-/etc/freeradius2/modules/pap
-endef
-
-define Package/freeradius2-mod-preprocess
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Request pre-processing module
-endef
-
-define Package/freeradius2-mod-preprocess/conffiles
-/etc/freeradius2/hints
-/etc/freeradius2/huntgroups
-/etc/freeradius2/modules/preprocess
-endef
-
-define Package/freeradius2-mod-realm
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Realms handling module
-endef
-
-define Package/freeradius2-mod-realm/conffiles
-/etc/freeradius2/proxy.conf
-/etc/freeradius2/modules/realm
-endef
-
-define Package/freeradius2-mod-sql
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Base SQL module
-endef
-
-define Package/freeradius2-mod-sql/conffiles
-/etc/freeradius2/sql.conf
-endef
-
-define Package/freeradius2-mod-sql-mysql
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-sql +libmysqlclient-r
-  TITLE:=MySQL module
-endef
-
-define Package/freeradius2-mod-sql-pgsql
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-sql +libpq
-  TITLE:=PostgreSQL module
-endef
-
-define Package/freeradius2-mod-sql-sqlite
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-sql +libsqlite3
-  TITLE:=SQLite module
-endef
-
-define Package/freeradius2-mod-sqlcounter
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-sql
-  TITLE:=Generic SQL Counter module
-endef
-
-define Package/freeradius2-mod-radutmp
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=Radius UTMP module
-endef
-
-define Package/freeradius2-mod-radutmp/conffiles
-/etc/freeradius2/modules/radutmp
-/etc/freeradius2/modules/sradutmp
-endef
-
-define Package/freeradius2-utils
-  $(call Package/freeradius2/Default)
-  DEPENDS:=+freeradius2-common
-  TITLE:=Misc. client utilities
-endef
-
-define Package/freeradius2-mod-sqllog
-  $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2
-  TITLE:=SQL Logging module
-endef
-
-CONFIGURE_ARGS+= \
-       --libdir=/usr/lib/freeradius2 \
-       --libexecdir=/usr/lib/freeradius2 \
-       --enable-shared \
-       --disable-static \
-       --disable-developer \
-       --with-threads \
-       $(if $(CONFIG_FREERADIUS_OPENSSL),--with,--without)-openssl \
-       $(if $(CONFIG_FREERADIUS_OPENSSL),--with-openssl-includes="$(STAGING_DIR)/usr/include",) \
-       $(if $(CONFIG_FREERADIUS_OPENSSL),--with-openssl-libraries="$(STAGING_DIR)/usr/lib",) \
-       $(if $(CONFIG_FREERADIUS_OPENSSL),--disable-openssl-version-check,) \
-       --with-system-libtool \
-       --with-system-libltdl \
-       --enable-strict-dependencies \
-       --with-raddbdir=/etc/freeradius2 \
-       --with-radacctdir=/var/db/radacct \
-       --with-logdir=/var/log \
-       --without-edir \
-       --without-snmp \
-       --without-rlm_checkval \
-       --without-rlm_dbm \
-       --without-rlm_counter \
-       --with-rlm_expr \
-       --with-rlm_eap \
-       --without-rlm_eap_sim \
-       --without-rlm_example \
-       --without-rlm_ippool \
-       --without-rlm_krb5 \
-       --without-rlm_otp \
-       --without-rlm_smsotp \
-       --without-rlm_pam \
-       --without-rlm_perl \
-       --without-rlm_python \
-       --without-rlm_smb \
-       --with-rlm_sql \
-       --with-rlm_sqlcounter \
-       --without-rlm_sqlhpwippool \
-       --without-rlm_sqlippool \
-       --without-rlm_sql_db2 \
-       --without-rlm_sql_firebird \
-       --without-rlm_sql_freetds \
-       --without-rlm_sql_iodbc \
-       --without-rlm_sql_oracle \
-       --without-rlm_sql_sybase \
-       --without-rlm_sql_unixodbc \
-       --without-rlm_sql_log \
-       --without-rlm_unix \
-       --without-rlm_eap_tnc \
-       --without-rlm_eap_ikev2 \
-       --without-rlm_opendirectory \
-       --without-rlm_wimax \
-       --without-rlm_ruby \
-       --without-rlm_caching \
-       --without-rlm_redis \
-       --without-rlm_rediswho \
-       --without-rlm_soh \
-       --without-rlm_sim \
-       --without-rlm_replicate \
-       --without-rlm_protocol_filter \
-       --without-rlm_policy \
-       --without-rlm_linelog \
-       --without-rlm_jradius \
-       --without-rlm_fastusers \
-       --without-rlm_eap_leap \
-       --without-rlm_dynamic_clients \
-       --without-rlm_digest \
-       --without-rlm_cram \
-       --without-rlm_copy_packet \
-       --without-rlm_acct_unique \
-       --without-rlm_acctlog
-       
-
-PKG_DICTIONARIES:= \
-       freeradius freeradius.internal \
-       rfc2865 rfc2866 rfc2867 rfc2868 rfc2869 rfc3162 rfc3576 rfc3580 \
-       rfc4372 rfc4675 rfc4679 \
-       microsoft \
-       wispr \
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-ldap),)
-  CONFIGURE_ARGS+= \
-               --with-rlm_ldap-include-dir="$(STAGING_DIR)/usr/include" \
-               --with-rlm_ldap-lib-dir="$(STAGING_DIR)/usr/lib"
-  CONFIGURE_LIBS+= -lcrypto -lssl
-else
-  CONFIGURE_ARGS+= --without-rlm_ldap
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-sql-mysql),)
-  CONFIGURE_ARGS+= \
-               --with-mysql-include-dir="$(STAGING_DIR)/usr/include" \
-               --with-mysql-lib-dir="$(STAGING_DIR)/usr/lib/mysql"
-  CONFIGURE_LIBS+= -lz
-  CONFIGURE_VARS+= ac_cv_lib_mysqlclient_r_mysql_init=yes
-else
-  CONFIGURE_ARGS+= --without-rlm_sql_mysql
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-sql-pgsql),)
-  CONFIGURE_ARGS+= \
-               --with-rlm_sql_postgresql-include-dir="$(STAGING_DIR)/usr/include" \
-               --with-rlm_sql_postgresql-lib-dir="$(STAGING_DIR)/usr/lib"
-else
-  CONFIGURE_ARGS+= --without-rlm_sql_postgresql
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-sqllog),)
-  CONFIGURE_ARGS+= \
-        --with-rlm_sql_log \
-        --with-experimental-modules \
-else
-  CONFIGURE_ARGS+= --without-rlm_sql_log
-endif
-
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-sql-sqlite),)
-  CONFIGURE_ARGS+= \
-       --with-rlm_sql_sqlite \
-       --with-experimental-modules \
-       --with-sqlite-include-dir="$(STAGING_DIR)/usr/include" \
-       --with-sqlite-lib-dir="$(STAGING_DIR)/usr/lib"
-else
-  CONFIGURE_ARGS+= --without-rlm_sql_sqlite
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-eap-peap),)
-  CONFIGURE_ARGS+= \
-               --with-rlm_eap_peap \
-               --with-rlm_eap_peap-include-dir="$(STAGING_DIR)/usr/include" \
-               --with-rlm_eap_peap-lib-dir="$(STAGING_DIR)/usr/lib"
-  CONFIGURE_LIBS+= -lcrypto -lssl
-else
-  CONFIGURE_ARGS+= --without-rlm_eap_peap
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-eap-tls),)
-  CONFIGURE_ARGS+= \
-               --with-rlm_eap_tls \
-               --with-rlm_eap_tls-include-dir="$(STAGING_DIR)/usr/include" \
-               --with-rlm_eap_tls-lib-dir="$(STAGING_DIR)/usr/lib"
-  CONFIGURE_LIBS+= -lcrypto -lssl
-else
-  CONFIGURE_ARGS+= --without-rlm_eap_tls
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-eap-ttls),)
-  CONFIGURE_ARGS+= \
-               --with-rlm_eap_ttls \
-               --with-rlm_eap_ttls-include-dir="$(STAGING_DIR)/usr/include" \
-               --with-rlm_eap_ttls-lib-dir="$(STAGING_DIR)/usr/lib"
-  CONFIGURE_LIBS+= -lcrypto -lssl
-else
-  CONFIGURE_ARGS+= --without-rlm_eap_ttls
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-attr-rewrite),)
-  CONFIGURE_ARGS+= --with-rlm_attr-rewrite
-else
-  CONFIGURE_ARGS+= --without-rlm_attr-rewrite
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-radutmp),)
-  CONFIGURE_ARGS+= --with-rlm_radutmp
-else
-  CONFIGURE_ARGS+= --without-rlm_radutmp
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-logintime),)
-  CONFIGURE_ARGS+= --with-rlm_logintime
-else
-  CONFIGURE_ARGS+= --without-rlm_logintime
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-expiration),)
-  CONFIGURE_ARGS+= --with-rlm_expiration
-else
-  CONFIGURE_ARGS+= --without-rlm_expiration
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-always),)
-  CONFIGURE_ARGS+= --with-rlm_always
-else
-  CONFIGURE_ARGS+= --without-rlm_always
-endif
-
-CONFIGURE_VARS+= \
-       LDFLAGS="$$$$LDFLAGS" \
-       LIBS="$(CONFIGURE_LIBS)" \
-       MYSQL_CONFIG="no" \
-       ac_cv_lib_readline=no \
-
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               R="$(PKG_INSTALL_DIR)" \
-               INSTALLSTRIP="" \
-               all certs install
-endef
-
-define Package/freeradius2-common/install
-       $(INSTALL_DIR) $(1)/etc/freeradius2
-       chmod 771 $(1)/etc/freeradius2
-       $(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/dictionary $(1)/etc/freeradius2/ ; \
-       $(INSTALL_DIR) $(1)/usr/lib/freeradius2
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius2/libfreeradius-radius{,-*}.so $(1)/usr/lib/freeradius2
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius2/libfreeradius-eap{,-*}.so $(1)/usr/lib/freeradius2
-       $(INSTALL_DIR) $(1)/usr/share/freeradius2
-       $(CP) $(PKG_INSTALL_DIR)/usr/share/freeradius/dictionary $(1)/usr/share/freeradius2/
-       $(SED) "s,^\(\$$$$INCLUDE\),#\1,g" $(1)/usr/share/freeradius2/dictionary
-       for f in $(PKG_DICTIONARIES); do \
-               $(CP) $(PKG_INSTALL_DIR)/usr/share/freeradius/dictionary.$$$${f} $(1)/usr/share/freeradius2/ ; \
-               $(SED) "s,^#\(\$$$$INCLUDE dictionary\.$$$${f}\),\1,g" $(1)/usr/share/freeradius2/dictionary ; \
-       done
-endef
-
-define Package/freeradius2/install
-       $(INSTALL_DIR) $(1)/etc/freeradius2/modules
-       $(INSTALL_DIR) $(1)/etc/freeradius2/sites
-       for f in clients.conf radiusd.conf policy.conf; do \
-               $(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/$$$${f} $(1)/etc/freeradius2/ ; \
-       done
-       $(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/sites-available/default $(1)/etc/freeradius2/sites/default
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/radiusd $(1)/usr/sbin/
-       $(INSTALL_DIR) $(1)/etc/init.d
-       $(INSTALL_BIN) ./files/radiusd.init $(1)/etc/init.d/radiusd
-endef
-
-define Package/freeradius2-democerts/install
-       $(INSTALL_DIR) $(1)/etc/freeradius2/certs
-       $(CP) \
-               $(PKG_BUILD_DIR)/raddb/certs/ca.pem \
-               $(PKG_BUILD_DIR)/raddb/certs/dh \
-               $(PKG_BUILD_DIR)/raddb/certs/random \
-               $(PKG_BUILD_DIR)/raddb/certs/server.pem \
-               $(1)/etc/freeradius2/certs/
-endef
-
-define Package/freeradius2-utils/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       for f in radclient radeapclient radwho; do \
-               $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$$$${f} $(1)/usr/bin/ ; \
-       done
-endef
-
-define BuildPlugin
-  define Package/$(1)/install
-       [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/freeradius2
-       for m in $(2); do \
-               $(CP) $(PKG_INSTALL_DIR)/usr/lib/freeradius2/$$$$$$$${m}{,-*}.so $$(1)/usr/lib/freeradius2 ; \
-       done
-       [ -z "$(3)" ] || $(INSTALL_DIR) $$(1)/etc/freeradius2
-       [ -z "$(4)" ] || $(INSTALL_DIR) $$(1)/etc/freeradius2/$(4)
-       for f in $(3); do \
-               $(CP) $(PKG_INSTALL_DIR)/etc/freeradius2/$$$$$$$${f} $$(1)/etc/freeradius2/$$$$$$$${f} ; \
-       done
-  endef
-
-  $$(eval $$(call BuildPackage,$(1)))
-endef
-
-$(eval $(call BuildPackage,freeradius2))
-$(eval $(call BuildPackage,freeradius2-common))
-$(eval $(call BuildPackage,freeradius2-democerts))
-$(eval $(call BuildPlugin,freeradius2-mod-chap,rlm_chap,modules/chap,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-detail,rlm_detail,modules/detail,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-eap,rlm_eap,eap.conf))
-$(eval $(call BuildPlugin,freeradius2-mod-eap-gtc,rlm_eap_gtc,))
-$(eval $(call BuildPlugin,freeradius2-mod-eap-md5,rlm_eap_md5,))
-$(eval $(call BuildPlugin,freeradius2-mod-eap-mschapv2,rlm_eap_mschapv2,))
-$(eval $(call BuildPlugin,freeradius2-mod-eap-peap,rlm_eap_peap,))
-$(eval $(call BuildPlugin,freeradius2-mod-eap-tls,rlm_eap_tls,))
-$(eval $(call BuildPlugin,freeradius2-mod-eap-ttls,rlm_eap_ttls,))
-$(eval $(call BuildPlugin,freeradius2-mod-exec,rlm_exec,modules/exec modules/echo ,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-attr-rewrite,rlm_attr_rewrite,modules/attr_rewrite,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-files,rlm_files,acct_users preproxy_users users modules/files,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-passwd,rlm_passwd,modules/passwd,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-ldap,rlm_ldap,ldap.attrmap modules/ldap,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-mschap,rlm_mschap,modules/mschap,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-pap,rlm_pap,modules/pap,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-preprocess,rlm_preprocess,hints huntgroups modules/preprocess,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-realm,rlm_realm,proxy.conf modules/realm modules/inner-eap,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-sql,rlm_sql,sql.conf,))
-$(eval $(call BuildPlugin,freeradius2-mod-sql-mysql,rlm_sql_mysql,))
-$(eval $(call BuildPlugin,freeradius2-mod-sql-pgsql,rlm_sql_postgresql,))
-$(eval $(call BuildPlugin,freeradius2-mod-sql-sqlite,rlm_sql_sqlite,))
-$(eval $(call BuildPlugin,freeradius2-mod-sqlcounter,rlm_sqlcounter,))
-$(eval $(call BuildPlugin,freeradius2-mod-sqllog,rlm_sql_log,))
-$(eval $(call BuildPlugin,freeradius2-mod-radutmp,rlm_radutmp,modules/radutmp modules/sradutmp,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-logintime,rlm_logintime,modules/logintime,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-expr,rlm_expr,modules/expr,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-attr-filter,rlm_attr_filter,modules/attr_filter attrs attrs.access_reject attrs.accounting_response attrs.pre-proxy,modules,,))
-$(eval $(call BuildPlugin,freeradius2-mod-expiration,rlm_expiration,modules/expiration,modules,))
-$(eval $(call BuildPlugin,freeradius2-mod-always,rlm_always,modules/always,modules,))
-$(eval $(call BuildPackage,freeradius2-utils))
diff --git a/net/freeradius2/files/radiusd.init b/net/freeradius2/files/radiusd.init
deleted file mode 100644 (file)
index 2127e98..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh /etc/rc.common
-#
-# Copyright (C) 2006-2015 OpenWrt.org
-#
-
-USE_PROCD=1
-
-START=50
-
-NAME=radiusd
-PROG=/usr/sbin/radiusd
-DEFAULT=/etc/default/radiusd
-
-start_service()
-{
-       [ -f $DEFAULT ] && . $DEFAULT
-       mkdir -p /var/log
-       mkdir -p /var/run
-       mkdir -p /var/db/radacct
-       mkdir -p /tmp/radiusd
-
-       procd_open_instance
-       procd_set_param command $PROG -f
-       procd_set_param env LD_LIBRARY_PATH=/usr/lib/freeradius2
-       [ -n "$IPADDR" ] && procd_append_param command -i $IPADDR
-       [ -n "$OPTIONS" ] && procd_append_param command $OPTIONS
-       procd_set_param respawn
-       procd_close_instance
-}
diff --git a/net/freeradius2/patches/001-fix-makefile.patch b/net/freeradius2/patches/001-fix-makefile.patch
deleted file mode 100644 (file)
index 676f99c..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: freeradius-server-2.2.7/Make.inc.in
-===================================================================
---- freeradius-server-2.2.7.orig/Make.inc.in
-+++ freeradius-server-2.2.7/Make.inc.in
-@@ -5,6 +5,7 @@
- #
- # Location of files.
-+SHELL         = @SHELL@
- prefix                = @prefix@
- exec_prefix   = @exec_prefix@
- sysconfdir    = @sysconfdir@
diff --git a/net/freeradius2/patches/002-config.patch b/net/freeradius2/patches/002-config.patch
deleted file mode 100644 (file)
index c486389..0000000
+++ /dev/null
@@ -1,613 +0,0 @@
-Index: freeradius-server-2.2.7/raddb/dictionary.in
-===================================================================
---- freeradius-server-2.2.7.orig/raddb/dictionary.in
-+++ freeradius-server-2.2.7/raddb/dictionary.in
-@@ -11,7 +11,7 @@
- #
- #     The filename given here should be an absolute path. 
- #
--$INCLUDE      @prefix@/share/freeradius/dictionary
-+$INCLUDE      @prefix@/share/freeradius2/dictionary
- #
- #     Place additional attributes or $INCLUDEs here.  They will
-Index: freeradius-server-2.2.7/raddb/eap.conf
-===================================================================
---- freeradius-server-2.2.7.orig/raddb/eap.conf
-+++ freeradius-server-2.2.7/raddb/eap.conf
-@@ -27,7 +27,7 @@
-               #  then that EAP type takes precedence over the
-               #  default type configured here.
-               #
--              default_eap_type = md5
-+              default_eap_type = peap
-               #  A list is maintained to correlate EAP-Response
-               #  packets with EAP-Request packets.  After a
-@@ -72,8 +72,8 @@
-               #  for wireless connections.  It is insecure, and does
-               #  not provide for dynamic WEP keys.
-               #
--              md5 {
--              }
-+#             md5 {
-+#             }
-               # Cisco LEAP
-               #
-@@ -87,8 +87,8 @@
-               #  User-Password, or the NT-Password attributes.
-               #  'System' authentication is impossible with LEAP.
-               #
--              leap {
--              }
-+#             leap {
-+#             }
-               #  Generic Token Card.
-               #
-@@ -101,7 +101,7 @@
-               #  the users password will go over the wire in plain-text,
-               #  for anyone to see.
-               #
--              gtc {
-+#             gtc {
-                       #  The default challenge, which many clients
-                       #  ignore..
-                       #challenge = "Password: "
-@@ -118,8 +118,8 @@
-                       #  configured for the request, and do the
-                       #  authentication itself.
-                       #
--                      auth_type = PAP
--              }
-+#                     auth_type = PAP
-+#             }
-               ## EAP-TLS
-               #
-@@ -215,7 +215,7 @@
-                       #  In these cases, fragment size should be
-                       #  1024 or less.
-                       #
--              #       fragment_size = 1024
-+                      fragment_size = 1024
-                       #  include_length is a flag which is
-                       #  by default set to yes If set to
-@@ -225,7 +225,7 @@
-                       #  message is included ONLY in the
-                       #  First packet of a fragment series.
-                       #
--              #       include_length = yes
-+                      include_length = yes
-                       #  Check the Certificate Revocation List
-                       #
-@@ -297,7 +297,7 @@
-                       # for the server to print out an error message,
-                       # and refuse to start.
-                       #
--                      make_cert_command = "${certdir}/bootstrap"
-+              #       make_cert_command = "${certdir}/bootstrap"
-                       #
-                       #  Elliptical cryptography configuration
-@@ -332,7 +332,7 @@
-                       #  You probably also want "use_tunneled_reply = yes"
-                       #  when using fast session resumption.
-                       #
--                      cache {
-+              #       cache {
-                             #
-                             #  Enable it.  The default is "no".
-                             #  Deleting the entire "cache" subsection
-@@ -348,14 +348,14 @@
-                             #  enable resumption for just one user
-                             #  by setting the above attribute to "yes".
-                             #
--                            enable = no
-+              #             enable = no
-                             #
-                             #  Lifetime of the cached entries, in hours.
-                             #  The sessions will be deleted after this
-                             #  time.
-                             #
--                            lifetime = 24 # hours
-+              #             lifetime = 24 # hours
-                             #
-                             #  The maximum number of entries in the
-@@ -364,8 +364,8 @@
-                             #  This could be set to the number of users
-                             #  who are logged in... which can be a LOT.
-                             #
--                            max_entries = 255
--                      }
-+              #             max_entries = 255
-+              #       }
-                       #
-                       #  As of version 2.1.10, client certificates can be
-@@ -503,7 +503,7 @@
-               #
-               #  in the control items for a request.
-               #
--              ttls {
-+#             ttls {
-                       #  The tunneled EAP session needs a default
-                       #  EAP type which is separate from the one for
-                       #  the non-tunneled EAP module.  Inside of the
-@@ -511,7 +511,7 @@
-                       #  If the request does not contain an EAP
-                       #  conversation, then this configuration entry
-                       #  is ignored.
--                      default_eap_type = md5
-+#                     default_eap_type = mschapv2
-                       #  The tunneled authentication request does
-                       #  not usually contain useful attributes
-@@ -527,7 +527,7 @@
-                       #  is copied to the tunneled request.
-                       #
-                       # allowed values: {no, yes}
--                      copy_request_to_tunnel = no
-+#                     copy_request_to_tunnel = yes
-                       #  The reply attributes sent to the NAS are
-                       #  usually based on the name of the user
-@@ -540,7 +540,7 @@
-                       #  the tunneled request.
-                       #
-                       # allowed values: {no, yes}
--                      use_tunneled_reply = no
-+#                     use_tunneled_reply = no
-                       #
-                       #  The inner tunneled request can be sent
-@@ -552,13 +552,13 @@
-                       #  the virtual server that processed the
-                       #  outer requests.
-                       #
--                      virtual_server = "inner-tunnel"
-+#                     virtual_server = "inner-tunnel"
-                       #  This has the same meaning as the
-                       #  same field in the "tls" module, above.
-                       #  The default value here is "yes".
-               #       include_length = yes
--              }
-+#             }
-               ##################################################
-               #
-@@ -627,14 +627,14 @@
-                       #  the PEAP module also has these configuration
-                       #  items, which are the same as for TTLS.
--                      copy_request_to_tunnel = no
--                      use_tunneled_reply = no
-+                      copy_request_to_tunnel = yes
-+                      use_tunneled_reply = yes
-                       #  When the tunneled session is proxied, the
-                       #  home server may not understand EAP-MSCHAP-V2.
-                       #  Set this entry to "no" to proxy the tunneled
-                       #  EAP-MSCHAP-V2 as normal MSCHAPv2.
--              #       proxy_tunneled_request_as_eap = yes
-+                      proxy_tunneled_request_as_eap = no
-                       #
-                       #  The inner tunneled request can be sent
-@@ -646,7 +646,8 @@
-                       #  the virtual server that processed the
-                       #  outer requests.
-                       #
--                      virtual_server = "inner-tunnel"
-+              #       virtual_server = "inner-tunnel"
-+                      EAP-TLS-Require-Client-Cert = no
-                       # This option enables support for MS-SoH
-                       # see doc/SoH.txt for more info.
-Index: freeradius-server-2.2.7/raddb/modules/counter
-===================================================================
---- freeradius-server-2.2.7.orig/raddb/modules/counter
-+++ freeradius-server-2.2.7/raddb/modules/counter
-@@ -69,7 +69,7 @@
- #  'check-name' attribute.
- #
- counter daily {
--      filename = ${db_dir}/db.daily
-+      filename = ${radacctdir}/db.daily
-       key = User-Name
-       count-attribute = Acct-Session-Time
-       reset = daily
-Index: freeradius-server-2.2.7/raddb/modules/pap
-===================================================================
---- freeradius-server-2.2.7.orig/raddb/modules/pap
-+++ freeradius-server-2.2.7/raddb/modules/pap
-@@ -18,5 +18,5 @@
- #
- #  http://www.openldap.org/faq/data/cache/347.html
- pap {
--      auto_header = no
-+      auto_header = yes
- }
-Index: freeradius-server-2.2.7/raddb/modules/radutmp
-===================================================================
---- freeradius-server-2.2.7.orig/raddb/modules/radutmp
-+++ freeradius-server-2.2.7/raddb/modules/radutmp
-@@ -12,7 +12,7 @@ radutmp {
-       #  Where the file is stored.  It's not a log file,
-       #  so it doesn't need rotating.
-       #
--      filename = ${logdir}/radutmp
-+      filename = ${radacctdir}/radutmp
-       #  The field in the packet to key on for the
-       #  'user' name,  If you have other fields which you want
-Index: freeradius-server-2.2.7/raddb/modules/sradutmp
-===================================================================
---- freeradius-server-2.2.7.orig/raddb/modules/sradutmp
-+++ freeradius-server-2.2.7/raddb/modules/sradutmp
-@@ -10,7 +10,7 @@
- # then name "sradutmp" to identify it later in the "accounting"
- # section.
- radutmp sradutmp {
--      filename = ${logdir}/sradutmp
-+      filename = ${radacctdir}/sradutmp
-       perm = 0644
-       callerid = "no"
- }
-Index: freeradius-server-2.2.7/raddb/radiusd.conf.in
-===================================================================
---- freeradius-server-2.2.7.orig/raddb/radiusd.conf.in
-+++ freeradius-server-2.2.7/raddb/radiusd.conf.in
-@@ -66,7 +66,7 @@ name = radiusd
- #  Location of config and logfiles.
- confdir = ${raddbdir}
--run_dir = ${localstatedir}/run/${name}
-+run_dir = ${localstatedir}/run
- # Should likely be ${localstatedir}/lib/radiusd
- db_dir = ${raddbdir}
-@@ -323,7 +323,7 @@ listen {
-       #  If your system does not support this feature, you will
-       #  get an error if you try to use it.
-       #
--#     interface = eth0
-+      interface = br-lan
-       #  Per-socket lists of clients.  This is a very useful feature.
-       #
-@@ -350,7 +350,7 @@ listen {
- #     ipv6addr = ::
-       port = 0
-       type = acct
--#     interface = eth0
-+      interface = br-lan
- #     clients = per_socket_clients
- }
-@@ -576,8 +576,8 @@ security {
- #
- #  allowed values: {no, yes}
- #
--proxy_requests  = yes
--$INCLUDE proxy.conf
-+proxy_requests  = no
-+#$INCLUDE proxy.conf
- # CLIENTS CONFIGURATION
-@@ -774,7 +774,7 @@ instantiate {
-       #  The entire command line (and output) must fit into 253 bytes.
-       #
-       #  e.g. Framed-Pool = `%{exec:/bin/echo foo}`
--      exec
-+#     exec
-       #
-       #  The expression module doesn't do authorization,
-@@ -791,15 +791,15 @@ instantiate {
-       #  other xlat functions such as md5, sha1 and lc.
-       #
-       #  We do not recommend removing it's listing here.
--      expr
-+#     expr
-       #
-       # We add the counter module here so that it registers
-       # the check-name attribute before any module which sets
-       # it
- #     daily
--      expiration
--      logintime
-+#     expiration
-+#     logintime
-       # subsections here can be thought of as "virtual" modules.
-       #
-@@ -823,7 +823,7 @@ instantiate {
- #     to multiple times.
- #
- ######################################################################
--$INCLUDE policy.conf
-+#$INCLUDE policy.conf
- ######################################################################
- #
-@@ -833,9 +833,9 @@ $INCLUDE policy.conf
- #     match the regular expression: /[a-zA-Z0-9_.]+/
- #
- #     It allows you to define new virtual servers simply by placing
--#     a file into the raddb/sites-enabled/ directory.
-+#     a file into the /etc/freeradius2/sites/ directory.
- #
--$INCLUDE sites-enabled/
-+$INCLUDE sites/
- ######################################################################
- #
-@@ -843,7 +843,7 @@ $INCLUDE sites-enabled/
- #     "authenticate {}", "accounting {}", have been moved to the
- #     the file:
- #
--#             raddb/sites-available/default
-+#             /etc/freeradius2/sites/default
- #
- #     This is the "default" virtual server that has the same
- #     configuration as in version 1.0.x and 1.1.x.  The default
-Index: freeradius-server-2.2.7/raddb/sites-available/default
-===================================================================
---- freeradius-server-2.2.7.orig/raddb/sites-available/default
-+++ freeradius-server-2.2.7/raddb/sites-available/default
-@@ -85,7 +85,7 @@ authorize {
-       #
-       #  It takes care of processing the 'raddb/hints' and the
-       #  'raddb/huntgroups' files.
--      preprocess
-+#     preprocess
-       #
-       #  If you want to have a log of authentication requests,
-@@ -96,7 +96,7 @@ authorize {
-       #
-       #  The chap module will set 'Auth-Type := CHAP' if we are
-       #  handling a CHAP request and Auth-Type has not already been set
--      chap
-+#     chap
-       #
-       #  If the users are logging in with an MS-CHAP-Challenge
-@@ -104,13 +104,13 @@ authorize {
-       #  the MS-CHAP-Challenge attribute, and add 'Auth-Type := MS-CHAP'
-       #  to the request, which will cause the server to then use
-       #  the mschap module for authentication.
--      mschap
-+#     mschap
-       #
-       #  If you have a Cisco SIP server authenticating against
-       #  FreeRADIUS, uncomment the following line, and the 'digest'
-       #  line in the 'authenticate' section.
--      digest
-+#     digest
-       #
-       #  The WiMAX specification says that the Calling-Station-Id
-@@ -133,7 +133,7 @@ authorize {
-       #  Otherwise, when the first style of realm doesn't match,
-       #  the other styles won't be checked.
-       #
--      suffix
-+#     suffix
- #     ntdomain
-       #
-@@ -197,8 +197,8 @@ authorize {
-       # Use the checkval module
- #     checkval
--      expiration
--      logintime
-+#     expiration
-+#     logintime
-       #
-       #  If no other module has claimed responsibility for
-@@ -279,7 +279,7 @@ authenticate {
-       #  If you have a Cisco SIP server authenticating against
-       #  FreeRADIUS, uncomment the following line, and the 'digest'
-       #  line in the 'authorize' section.
--      digest
-+#     digest
-       #
-       #  Pluggable Authentication Modules.
-@@ -296,7 +296,7 @@ authenticate {
-       #  be used for authentication ONLY for compatibility with legacy
-       #  FreeRADIUS configurations.
-       #
--      unix
-+#     unix
-       # Uncomment it if you want to use ldap for authentication
-       #
-@@ -332,8 +332,8 @@ authenticate {
- #
- #  Pre-accounting.  Decide which accounting type to use.
- #
--preacct {
--      preprocess
-+#preacct {
-+#     preprocess
-       #
-       #  Session start times are *implied* in RADIUS.
-@@ -356,7 +356,7 @@ preacct {
-       #
-       #  Ensure that we have a semi-unique identifier for every
-       #  request, and many NAS boxes are broken.
--      acct_unique
-+#     acct_unique
-       #
-       #  Look for IPASS-style 'realm/', and if not found, look for
-@@ -366,13 +366,13 @@ preacct {
-       #  Accounting requests are generally proxied to the same
-       #  home server as authentication requests.
- #     IPASS
--      suffix
-+#     suffix
- #     ntdomain
-       #
-       #  Read the 'acct_users' file
--      files
--}
-+#     files
-+#}
- #
- #  Accounting.  Log the accounting data.
-@@ -382,7 +382,7 @@ accounting {
-       #  Create a 'detail'ed log of the packets.
-       #  Note that accounting requests which are proxied
-       #  are also logged in the detail file.
--      detail
-+#     detail
- #     daily
-       #  Update the wtmp file
-@@ -434,7 +434,7 @@ accounting {
-       exec
-       #  Filter attributes from the accounting response.
--      attr_filter.accounting_response
-+      #attr_filter.accounting_response
-       #
-       #  See "Autz-Type Status-Server" for how this works.
-@@ -460,7 +460,7 @@ session {
- #  Post-Authentication
- #  Once we KNOW that the user has been authenticated, there are
- #  additional steps we can take.
--post-auth {
-+#post-auth {
-       #  Get an address from the IP Pool.
- #     main_pool
-@@ -490,7 +490,7 @@ post-auth {
- #     ldap
-       # For Exec-Program and Exec-Program-Wait
--      exec
-+#     exec
-       #
-       #  Calculate the various WiMAX keys.  In order for this to work,
-@@ -574,18 +574,18 @@ post-auth {
-       #  Add the ldap module name (or instance) if you have set 
-       #  'edir_account_policy_check = yes' in the ldap module configuration
-       #
--      Post-Auth-Type REJECT {
--              # log failed authentications in SQL, too.
-+#     Post-Auth-Type REJECT {
-+#             # log failed authentications in SQL, too.
- #             sql
-               # Insert EAP-Failure message if the request was
-               # rejected by policy instead of because of an
-               # authentication failure
--              eap
-+#             eap
--              attr_filter.access_reject
--      }
--}
-+#             attr_filter.access_reject
-+#     }
-+#}
- #
- #  When the server decides to proxy a request to a home server,
-@@ -595,7 +595,7 @@ post-auth {
- #
- #  Only a few modules currently have this method.
- #
--pre-proxy {
-+#pre-proxy {
- #     attr_rewrite
-       #  Uncomment the following line if you want to change attributes
-@@ -611,14 +611,14 @@ pre-proxy {
-       #  server, un-comment the following line, and the
-       #  'detail pre_proxy_log' section, above.
- #     pre_proxy_log
--}
-+#}
- #
- #  When the server receives a reply to a request it proxied
- #  to a home server, the request may be massaged here, in the
- #  post-proxy stage.
- #
--post-proxy {
-+#post-proxy {
-       #  If you want to have a log of replies from a home server,
-       #  un-comment the following line, and the 'detail post_proxy_log'
-@@ -642,7 +642,7 @@ post-proxy {
-       #  hidden inside of the EAP packet, and the end server will
-       #  reject the EAP request.
-       #
--      eap
-+#     eap
-       #
-       #  If the server tries to proxy a request and fails, then the
-@@ -664,5 +664,5 @@ post-proxy {
- #     Post-Proxy-Type Fail {
- #                     detail
- #     }
--}
-+#}
-Index: freeradius-server-2.2.7/raddb/users
-===================================================================
---- freeradius-server-2.2.7.orig/raddb/users
-+++ freeradius-server-2.2.7/raddb/users
-@@ -169,22 +169,22 @@
- #     by the terminal server in which case there may not be a "P" suffix.
- #     The terminal server sends "Framed-Protocol = PPP" for auto PPP.
- #
--DEFAULT       Framed-Protocol == PPP
--      Framed-Protocol = PPP,
--      Framed-Compression = Van-Jacobson-TCP-IP
-+#DEFAULT      Framed-Protocol == PPP
-+#     Framed-Protocol = PPP,
-+#     Framed-Compression = Van-Jacobson-TCP-IP
- #
- # Default for CSLIP: dynamic IP address, SLIP mode, VJ-compression.
- #
--DEFAULT       Hint == "CSLIP"
--      Framed-Protocol = SLIP,
--      Framed-Compression = Van-Jacobson-TCP-IP
-+#DEFAULT      Hint == "CSLIP"
-+#     Framed-Protocol = SLIP,
-+#     Framed-Compression = Van-Jacobson-TCP-IP
- #
- # Default for SLIP: dynamic IP address, SLIP mode.
- #
--DEFAULT       Hint == "SLIP"
--      Framed-Protocol = SLIP
-+#DEFAULT      Hint == "SLIP"
-+#     Framed-Protocol = SLIP
- #
- # Last default: rlogin to our main server.
diff --git a/net/freeradius2/patches/004-ldap_configure.patch b/net/freeradius2/patches/004-ldap_configure.patch
deleted file mode 100644 (file)
index 05b6789..0000000
+++ /dev/null
@@ -1,4257 +0,0 @@
-Index: freeradius-server-2.2.7/src/modules/rlm_ldap/configure
-===================================================================
---- freeradius-server-2.2.7.orig/src/modules/rlm_ldap/configure
-+++ freeradius-server-2.2.7/src/modules/rlm_ldap/configure
-@@ -1,10 +1,10 @@
- #! /bin/sh
- # From configure.in Revision.
- # Guess values for system-dependent variables and create Makefiles.
--# Generated by GNU Autoconf 2.61.
-+# Generated by GNU Autoconf 2.63.
- #
- # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
--# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
- # This configure script is free software; the Free Software Foundation
- # gives unlimited permission to copy, distribute and modify it.
- ## --------------------- ##
-@@ -16,7 +16,7 @@ DUALCASE=1; export DUALCASE # for MKS sh
- if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-   emulate sh
-   NULLCMD=:
--  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-   # is contrary to our usage.  Disable this feature.
-   alias -g '${1+"$@"}'='"$@"'
-   setopt NO_GLOB_SUBST
-@@ -38,17 +38,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTE
- as_cr_digits='0123456789'
- as_cr_alnum=$as_cr_Letters$as_cr_digits
--# The user is always right.
--if test "${PATH_SEPARATOR+set}" != set; then
--  echo "#! /bin/sh" >conf$$.sh
--  echo  "exit 0"   >>conf$$.sh
--  chmod +x conf$$.sh
--  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
--    PATH_SEPARATOR=';'
-+as_nl='
-+'
-+export as_nl
-+# Printing a long string crashes Solaris 7 /usr/bin/printf.
-+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-+  as_echo='printf %s\n'
-+  as_echo_n='printf %s'
-+else
-+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-+    as_echo_n='/usr/ucb/echo -n'
-   else
--    PATH_SEPARATOR=:
-+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-+    as_echo_n_body='eval
-+      arg=$1;
-+      case $arg in
-+      *"$as_nl"*)
-+      expr "X$arg" : "X\\(.*\\)$as_nl";
-+      arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-+      esac;
-+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-+    '
-+    export as_echo_n_body
-+    as_echo_n='sh -c $as_echo_n_body as_echo'
-   fi
--  rm -f conf$$.sh
-+  export as_echo_body
-+  as_echo='sh -c $as_echo_body as_echo'
-+fi
-+
-+# The user is always right.
-+if test "${PATH_SEPARATOR+set}" != set; then
-+  PATH_SEPARATOR=:
-+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-+      PATH_SEPARATOR=';'
-+  }
- fi
- # Support unset when possible.
-@@ -64,8 +92,6 @@ fi
- # there to prevent editors from complaining about space-tab.
- # (If _AS_PATH_WALK were called with IFS unset, it would disable word
- # splitting by setting IFS to empty value.)
--as_nl='
--'
- IFS=" ""      $as_nl"
- # Find who we are.  Look in the path if we contain no directory separator.
-@@ -88,7 +114,7 @@ if test "x$as_myself" = x; then
-   as_myself=$0
- fi
- if test ! -f "$as_myself"; then
--  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-   { (exit 1); exit 1; }
- fi
-@@ -101,17 +127,10 @@ PS2='> '
- PS4='+ '
- # NLS nuisances.
--for as_var in \
--  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
--  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
--  LC_TELEPHONE LC_TIME
--do
--  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
--    eval $as_var=C; export $as_var
--  else
--    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
--  fi
--done
-+LC_ALL=C
-+export LC_ALL
-+LANGUAGE=C
-+export LANGUAGE
- # Required to use basename.
- if expr a : '\(a\)' >/dev/null 2>&1 &&
-@@ -133,7 +152,7 @@ as_me=`$as_basename -- "$0" ||
- $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-        X"$0" : 'X\(//\)$' \| \
-        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
--echo X/"$0" |
-+$as_echo X/"$0" |
-     sed '/^.*\/\([^/][^/]*\)\/*$/{
-           s//\1/
-           q
-@@ -159,7 +178,7 @@ else
-   as_have_required=no
- fi
--  if test $as_have_required = yes &&   (eval ":
-+  if test $as_have_required = yes &&   (eval ":
- (as_func_return () {
-   (exit \$1)
- }
-@@ -241,7 +260,7 @@ IFS=$as_save_IFS
- if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-   emulate sh
-   NULLCMD=:
--  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-   # is contrary to our usage.  Disable this feature.
-   alias -g '${1+"$@"}'='"$@"'
-   setopt NO_GLOB_SUBST
-@@ -262,7 +281,7 @@ _ASEOF
- if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-   emulate sh
-   NULLCMD=:
--  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-   # is contrary to our usage.  Disable this feature.
-   alias -g '${1+"$@"}'='"$@"'
-   setopt NO_GLOB_SUBST
-@@ -342,10 +361,10 @@ fi
-       if test "x$CONFIG_SHELL" != x; then
-   for as_var in BASH_ENV ENV
--        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
--        done
--        export CONFIG_SHELL
--        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-+      do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-+      done
-+      export CONFIG_SHELL
-+      exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
- fi
-@@ -414,9 +433,10 @@ fi
- test \$exitcode = 0") || {
-   echo No shell found that supports shell functions.
--  echo Please tell autoconf@gnu.org about your system,
--  echo including any error possibly output before this
--  echo message
-+  echo Please tell bug-autoconf@gnu.org about your system,
-+  echo including any error possibly output before this message.
-+  echo This can help us improve future autoconf versions.
-+  echo Configuration will now proceed without shell functions.
- }
-@@ -452,7 +472,7 @@ test \$exitcode = 0") || {
-       s/-\n.*//
-     ' >$as_me.lineno &&
-   chmod +x "$as_me.lineno" ||
--    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-    { (exit 1); exit 1; }; }
-   # Don't try to exec as it changes $[0], causing all sort of problems
-@@ -480,7 +500,6 @@ case `echo -n x` in
- *)
-   ECHO_N='-n';;
- esac
--
- if expr a : '\(a\)' >/dev/null 2>&1 &&
-    test "X`expr 00001 : '.*\(...\)'`" = X001; then
-   as_expr=expr
-@@ -493,19 +512,22 @@ if test -d conf$$.dir; then
-   rm -f conf$$.dir/conf$$.file
- else
-   rm -f conf$$.dir
--  mkdir conf$$.dir
-+  mkdir conf$$.dir 2>/dev/null
- fi
--echo >conf$$.file
--if ln -s conf$$.file conf$$ 2>/dev/null; then
--  as_ln_s='ln -s'
--  # ... but there are two gotchas:
--  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
--  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
--  # In both cases, we have to default to `cp -p'.
--  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-+if (echo >conf$$.file) 2>/dev/null; then
-+  if ln -s conf$$.file conf$$ 2>/dev/null; then
-+    as_ln_s='ln -s'
-+    # ... but there are two gotchas:
-+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-+    # In both cases, we have to default to `cp -p'.
-+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-+      as_ln_s='cp -p'
-+  elif ln conf$$.file conf$$ 2>/dev/null; then
-+    as_ln_s=ln
-+  else
-     as_ln_s='cp -p'
--elif ln conf$$.file conf$$ 2>/dev/null; then
--  as_ln_s=ln
-+  fi
- else
-   as_ln_s='cp -p'
- fi
-@@ -530,10 +552,10 @@ else
-   as_test_x='
-     eval sh -c '\''
-       if test -d "$1"; then
--        test -d "$1/.";
-+      test -d "$1/.";
-       else
-       case $1 in
--        -*)set "./$1";;
-+      -*)set "./$1";;
-       esac;
-       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
-       ???[sx]*):;;*)false;;esac;fi
-@@ -578,57 +600,65 @@ PACKAGE_STRING=
- PACKAGE_BUGREPORT=
- ac_unique_file="rlm_ldap.c"
--ac_subst_vars='SHELL
--PATH_SEPARATOR
--PACKAGE_NAME
--PACKAGE_TARNAME
--PACKAGE_VERSION
--PACKAGE_STRING
--PACKAGE_BUGREPORT
--exec_prefix
--prefix
--program_transform_name
--bindir
--sbindir
--libexecdir
--datarootdir
--datadir
--sysconfdir
--sharedstatedir
--localstatedir
--includedir
--oldincludedir
--docdir
--infodir
--htmldir
--dvidir
--pdfdir
--psdir
--libdir
--localedir
--mandir
--DEFS
--ECHO_C
--ECHO_N
--ECHO_T
--LIBS
--build_alias
--host_alias
--target_alias
--CC
--CFLAGS
--LDFLAGS
--CPPFLAGS
--ac_ct_CC
--EXEEXT
--OBJEXT
--edir
--ldap_ldflags
--ldap_cflags
--targetname
-+ac_subst_vars='LTLIBOBJS
- LIBOBJS
--LTLIBOBJS'
-+targetname
-+ldap_cflags
-+ldap_ldflags
-+edir
-+OBJEXT
-+EXEEXT
-+ac_ct_CC
-+CPPFLAGS
-+LDFLAGS
-+CFLAGS
-+CC
-+target_alias
-+host_alias
-+build_alias
-+LIBS
-+ECHO_T
-+ECHO_N
-+ECHO_C
-+DEFS
-+mandir
-+localedir
-+libdir
-+psdir
-+pdfdir
-+dvidir
-+htmldir
-+infodir
-+docdir
-+oldincludedir
-+includedir
-+localstatedir
-+sharedstatedir
-+sysconfdir
-+datadir
-+datarootdir
-+libexecdir
-+sbindir
-+bindir
-+program_transform_name
-+prefix
-+exec_prefix
-+PACKAGE_BUGREPORT
-+PACKAGE_STRING
-+PACKAGE_VERSION
-+PACKAGE_TARNAME
-+PACKAGE_NAME
-+PATH_SEPARATOR
-+SHELL'
- ac_subst_files=''
-+ac_user_opts='
-+enable_option_checking
-+with_rlm_ldap_lib_dir
-+with_rlm_ldap_include_dir
-+enable_shared
-+with_threads
-+with_edir
-+'
-       ac_precious_vars='build_alias
- host_alias
- target_alias
-@@ -642,6 +672,8 @@ CPPFLAGS'
- # Initialize some variables set by options.
- ac_init_help=
- ac_init_version=false
-+ac_unrecognized_opts=
-+ac_unrecognized_sep=
- # The variables have the same names as the options, with
- # dashes changed to underlines.
- cache_file=/dev/null
-@@ -740,13 +772,21 @@ do
-     datarootdir=$ac_optarg ;;
-   -disable-* | --disable-*)
--    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
-+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
-     # Reject names that are not valid shell variable names.
--    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
--      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
-    { (exit 1); exit 1; }; }
--    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
--    eval enable_$ac_feature=no ;;
-+    ac_useropt_orig=$ac_useropt
-+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-+    case $ac_user_opts in
-+      *"
-+"enable_$ac_useropt"
-+"*) ;;
-+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
-+       ac_unrecognized_sep=', ';;
-+    esac
-+    eval enable_$ac_useropt=no ;;
-   -docdir | --docdir | --docdi | --doc | --do)
-     ac_prev=docdir ;;
-@@ -759,13 +799,21 @@ do
-     dvidir=$ac_optarg ;;
-   -enable-* | --enable-*)
--    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
-+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
-     # Reject names that are not valid shell variable names.
--    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
--      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
-    { (exit 1); exit 1; }; }
--    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
--    eval enable_$ac_feature=\$ac_optarg ;;
-+    ac_useropt_orig=$ac_useropt
-+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-+    case $ac_user_opts in
-+      *"
-+"enable_$ac_useropt"
-+"*) ;;
-+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
-+       ac_unrecognized_sep=', ';;
-+    esac
-+    eval enable_$ac_useropt=\$ac_optarg ;;
-   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
-   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
-@@ -956,22 +1004,38 @@ do
-     ac_init_version=: ;;
-   -with-* | --with-*)
--    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
-+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
-     # Reject names that are not valid shell variable names.
--    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
--      { echo "$as_me: error: invalid package name: $ac_package" >&2
-+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
-    { (exit 1); exit 1; }; }
--    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
--    eval with_$ac_package=\$ac_optarg ;;
-+    ac_useropt_orig=$ac_useropt
-+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-+    case $ac_user_opts in
-+      *"
-+"with_$ac_useropt"
-+"*) ;;
-+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
-+       ac_unrecognized_sep=', ';;
-+    esac
-+    eval with_$ac_useropt=\$ac_optarg ;;
-   -without-* | --without-*)
--    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
-+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
-     # Reject names that are not valid shell variable names.
--    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
--      { echo "$as_me: error: invalid package name: $ac_package" >&2
-+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
-    { (exit 1); exit 1; }; }
--    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
--    eval with_$ac_package=no ;;
-+    ac_useropt_orig=$ac_useropt
-+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-+    case $ac_user_opts in
-+      *"
-+"with_$ac_useropt"
-+"*) ;;
-+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
-+       ac_unrecognized_sep=', ';;
-+    esac
-+    eval with_$ac_useropt=no ;;
-   --x)
-     # Obsolete; use --with-x.
-@@ -991,7 +1055,7 @@ do
-   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
-     x_libraries=$ac_optarg ;;
--  -*) { echo "$as_me: error: unrecognized option: $ac_option
-+  -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
- Try \`$0 --help' for more information." >&2
-    { (exit 1); exit 1; }; }
-     ;;
-@@ -1000,16 +1064,16 @@ Try \`$0 --help' for more information."
-     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
-     # Reject names that are not valid shell variable names.
-     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
--      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
-+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
-    { (exit 1); exit 1; }; }
-     eval $ac_envvar=\$ac_optarg
-     export $ac_envvar ;;
-   *)
-     # FIXME: should be removed in autoconf 3.0.
--    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
-+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
-     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
--      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
-     ;;
-@@ -1018,22 +1082,38 @@ done
- if test -n "$ac_prev"; then
-   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
--  { echo "$as_me: error: missing argument to $ac_option" >&2
-+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
-    { (exit 1); exit 1; }; }
- fi
--# Be sure to have absolute directory names.
-+if test -n "$ac_unrecognized_opts"; then
-+  case $enable_option_checking in
-+    no) ;;
-+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
-+   { (exit 1); exit 1; }; } ;;
-+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
-+  esac
-+fi
-+
-+# Check all directory arguments for consistency.
- for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
-               datadir sysconfdir sharedstatedir localstatedir includedir \
-               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-               libdir localedir mandir
- do
-   eval ac_val=\$$ac_var
-+  # Remove trailing slashes.
-+  case $ac_val in
-+    */ )
-+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
-+      eval $ac_var=\$ac_val;;
-+  esac
-+  # Be sure to have absolute directory names.
-   case $ac_val in
-     [\\/$]* | ?:[\\/]* )  continue;;
-     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
-   esac
--  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-    { (exit 1); exit 1; }; }
- done
-@@ -1048,7 +1128,7 @@ target=$target_alias
- if test "x$host_alias" != x; then
-   if test "x$build_alias" = x; then
-     cross_compiling=maybe
--    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-     If a cross compiler is detected then cross compile mode will be used." >&2
-   elif test "x$build_alias" != "x$host_alias"; then
-     cross_compiling=yes
-@@ -1064,10 +1144,10 @@ test "$silent" = yes && exec 6>/dev/null
- ac_pwd=`pwd` && test -n "$ac_pwd" &&
- ac_ls_di=`ls -di .` &&
- ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
--  { echo "$as_me: error: Working directory cannot be determined" >&2
-+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
-    { (exit 1); exit 1; }; }
- test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
--  { echo "$as_me: error: pwd does not report name of working directory" >&2
-+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
-    { (exit 1); exit 1; }; }
-@@ -1075,12 +1155,12 @@ test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- if test -z "$srcdir"; then
-   ac_srcdir_defaulted=yes
-   # Try the directory containing this script, then the parent directory.
--  ac_confdir=`$as_dirname -- "$0" ||
--$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
--       X"$0" : 'X\(//\)[^/]' \| \
--       X"$0" : 'X\(//\)$' \| \
--       X"$0" : 'X\(/\)' \| . 2>/dev/null ||
--echo X"$0" |
-+  ac_confdir=`$as_dirname -- "$as_myself" ||
-+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-+       X"$as_myself" : 'X\(//\)[^/]' \| \
-+       X"$as_myself" : 'X\(//\)$' \| \
-+       X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-+$as_echo X"$as_myself" |
-     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-           s//\1/
-           q
-@@ -1107,12 +1187,12 @@ else
- fi
- if test ! -r "$srcdir/$ac_unique_file"; then
-   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
--  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
-+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
-    { (exit 1); exit 1; }; }
- fi
- ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
- ac_abs_confdir=`(
--      cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
-+      cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
-    { (exit 1); exit 1; }; }
-       pwd)`
- # When building in place, set srcdir=.
-@@ -1161,9 +1241,9 @@ Configuration:
- Installation directories:
-   --prefix=PREFIX         install architecture-independent files in PREFIX
--                        [$ac_default_prefix]
-+                          [$ac_default_prefix]
-   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
--                        [PREFIX]
-+                          [PREFIX]
- By default, \`make install' will install all the files in
- \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
-@@ -1173,25 +1253,25 @@ for instance \`--prefix=\$HOME'.
- For better control, use the options below.
- Fine tuning of the installation directories:
--  --bindir=DIR           user executables [EPREFIX/bin]
--  --sbindir=DIR          system admin executables [EPREFIX/sbin]
--  --libexecdir=DIR       program executables [EPREFIX/libexec]
--  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
--  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
--  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
--  --libdir=DIR           object code libraries [EPREFIX/lib]
--  --includedir=DIR       C header files [PREFIX/include]
--  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
--  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
--  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
--  --infodir=DIR          info documentation [DATAROOTDIR/info]
--  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
--  --mandir=DIR           man documentation [DATAROOTDIR/man]
--  --docdir=DIR           documentation root [DATAROOTDIR/doc/PACKAGE]
--  --htmldir=DIR          html documentation [DOCDIR]
--  --dvidir=DIR           dvi documentation [DOCDIR]
--  --pdfdir=DIR           pdf documentation [DOCDIR]
--  --psdir=DIR            ps documentation [DOCDIR]
-+  --bindir=DIR            user executables [EPREFIX/bin]
-+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
-+  --libexecdir=DIR        program executables [EPREFIX/libexec]
-+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
-+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
-+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
-+  --libdir=DIR            object code libraries [EPREFIX/lib]
-+  --includedir=DIR        C header files [PREFIX/include]
-+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
-+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
-+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
-+  --infodir=DIR           info documentation [DATAROOTDIR/info]
-+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
-+  --mandir=DIR            man documentation [DATAROOTDIR/man]
-+  --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
-+  --htmldir=DIR           html documentation [DOCDIR]
-+  --dvidir=DIR            dvi documentation [DOCDIR]
-+  --pdfdir=DIR            pdf documentation [DOCDIR]
-+  --psdir=DIR             ps documentation [DOCDIR]
- _ACEOF
-   cat <<\_ACEOF
-@@ -1203,6 +1283,7 @@ if test -n "$ac_init_help"; then
-   cat <<\_ACEOF
- Optional Features:
-+  --disable-option-checking  ignore unrecognized --enable/--with options
-   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
-   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-   --enable-shared[=PKGS]  build shared libraries [default=yes]
-@@ -1234,15 +1315,17 @@ fi
- if test "$ac_init_help" = "recursive"; then
-   # If there are subdirs, report their specific --help.
-   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
--    test -d "$ac_dir" || continue
-+    test -d "$ac_dir" ||
-+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
-+      continue
-     ac_builddir=.
- case "$ac_dir" in
- .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *)
--  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
-   # A ".." for each directory in $ac_dir_suffix.
--  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
-+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
-   case $ac_top_builddir_sub in
-   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-@@ -1278,7 +1361,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_
-       echo &&
-       $SHELL "$ac_srcdir/configure" --help=recursive
-     else
--      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-     fi || ac_status=$?
-     cd "$ac_pwd" || { ac_status=$?; break; }
-   done
-@@ -1288,10 +1371,10 @@ test -n "$ac_init_help" && exit $ac_stat
- if $ac_init_version; then
-   cat <<\_ACEOF
- configure
--generated by GNU Autoconf 2.61
-+generated by GNU Autoconf 2.63
- Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
--2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
- This configure script is free software; the Free Software Foundation
- gives unlimited permission to copy, distribute and modify it.
- _ACEOF
-@@ -1302,7 +1385,7 @@ This file contains any messages produced
- running configure, to aid debugging if configure makes a mistake.
- It was created by $as_me, which was
--generated by GNU Autoconf 2.61.  Invocation command line was
-+generated by GNU Autoconf 2.63.  Invocation command line was
-   $ $0 $@
-@@ -1338,7 +1421,7 @@ for as_dir in $PATH
- do
-   IFS=$as_save_IFS
-   test -z "$as_dir" && as_dir=.
--  echo "PATH: $as_dir"
-+  $as_echo "PATH: $as_dir"
- done
- IFS=$as_save_IFS
-@@ -1373,7 +1456,7 @@ do
-     | -silent | --silent | --silen | --sile | --sil)
-       continue ;;
-     *\'*)
--      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
-+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
-     esac
-     case $ac_pass in
-     1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
-@@ -1425,11 +1508,12 @@ _ASBOX
-     case $ac_val in #(
-     *${as_nl}*)
-       case $ac_var in #(
--      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
--echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
-+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
-+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
-       esac
-       case $ac_var in #(
-       _ | IFS | as_nl) ;; #(
-+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-       *) $as_unset $ac_var ;;
-       esac ;;
-     esac
-@@ -1459,9 +1543,9 @@ _ASBOX
-     do
-       eval ac_val=\$$ac_var
-       case $ac_val in
--      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-       esac
--      echo "$ac_var='\''$ac_val'\''"
-+      $as_echo "$ac_var='\''$ac_val'\''"
-     done | sort
-     echo
-@@ -1476,9 +1560,9 @@ _ASBOX
-       do
-       eval ac_val=\$$ac_var
-       case $ac_val in
--      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-       esac
--      echo "$ac_var='\''$ac_val'\''"
-+      $as_echo "$ac_var='\''$ac_val'\''"
-       done | sort
-       echo
-     fi
-@@ -1494,8 +1578,8 @@ _ASBOX
-       echo
-     fi
-     test "$ac_signal" != 0 &&
--      echo "$as_me: caught signal $ac_signal"
--    echo "$as_me: exit $exit_status"
-+      $as_echo "$as_me: caught signal $ac_signal"
-+    $as_echo "$as_me: exit $exit_status"
-   } >&5
-   rm -f core *.core core.conftest.* &&
-     rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
-@@ -1537,21 +1621,24 @@ _ACEOF
- # Let the site file select an alternate cache file if it wants to.
--# Prefer explicitly selected file to automatically selected ones.
-+# Prefer an explicitly selected file to automatically selected ones.
-+ac_site_file1=NONE
-+ac_site_file2=NONE
- if test -n "$CONFIG_SITE"; then
--  set x "$CONFIG_SITE"
-+  ac_site_file1=$CONFIG_SITE
- elif test "x$prefix" != xNONE; then
--  set x "$prefix/share/config.site" "$prefix/etc/config.site"
-+  ac_site_file1=$prefix/share/config.site
-+  ac_site_file2=$prefix/etc/config.site
- else
--  set x "$ac_default_prefix/share/config.site" \
--      "$ac_default_prefix/etc/config.site"
-+  ac_site_file1=$ac_default_prefix/share/config.site
-+  ac_site_file2=$ac_default_prefix/etc/config.site
- fi
--shift
--for ac_site_file
-+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
- do
-+  test "x$ac_site_file" = xNONE && continue
-   if test -r "$ac_site_file"; then
--    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
--echo "$as_me: loading site script $ac_site_file" >&6;}
-+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
-     sed 's/^/| /' "$ac_site_file" >&5
-     . "$ac_site_file"
-   fi
-@@ -1561,16 +1648,16 @@ if test -r "$cache_file"; then
-   # Some versions of bash will fail to source /dev/null (special
-   # files actually), so we avoid doing that.
-   if test -f "$cache_file"; then
--    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
--echo "$as_me: loading cache $cache_file" >&6;}
-+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
-+$as_echo "$as_me: loading cache $cache_file" >&6;}
-     case $cache_file in
-       [\\/]* | ?:[\\/]* ) . "$cache_file";;
-       *)                      . "./$cache_file";;
-     esac
-   fi
- else
--  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
--echo "$as_me: creating cache $cache_file" >&6;}
-+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
-+$as_echo "$as_me: creating cache $cache_file" >&6;}
-   >$cache_file
- fi
-@@ -1584,29 +1671,38 @@ for ac_var in $ac_precious_vars; do
-   eval ac_new_val=\$ac_env_${ac_var}_value
-   case $ac_old_set,$ac_new_set in
-     set,)
--      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
--echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
-+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
-       ac_cache_corrupted=: ;;
-     ,set)
--      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
--echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
-+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
-       ac_cache_corrupted=: ;;
-     ,);;
-     *)
-       if test "x$ac_old_val" != "x$ac_new_val"; then
--      { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
--echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
--      { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
--echo "$as_me:   former value:  $ac_old_val" >&2;}
--      { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
--echo "$as_me:   current value: $ac_new_val" >&2;}
--      ac_cache_corrupted=:
-+      # differences in whitespace do not lead to failure.
-+      ac_old_val_w=`echo x $ac_old_val`
-+      ac_new_val_w=`echo x $ac_new_val`
-+      if test "$ac_old_val_w" != "$ac_new_val_w"; then
-+        { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-+        ac_cache_corrupted=:
-+      else
-+        { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
-+        eval $ac_var=\$ac_old_val
-+      fi
-+      { $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
-+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
-+      { $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
-+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
-       fi;;
-   esac
-   # Pass precious variables to config.status.
-   if test "$ac_new_set" = set; then
-     case $ac_new_val in
--    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
-+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
-     *) ac_arg=$ac_var=$ac_new_val ;;
-     esac
-     case " $ac_configure_args " in
-@@ -1616,10 +1712,12 @@ echo "$as_me:   current value: $ac_new_v
-   fi
- done
- if $ac_cache_corrupted; then
--  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
--echo "$as_me: error: changes in the environment can compromise the build" >&2;}
--  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
--echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
-+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
-    { (exit 1); exit 1; }; }
- fi
-@@ -1662,10 +1760,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
- if test -n "$ac_tool_prefix"; then
-   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
- set dummy ${ac_tool_prefix}gcc; ac_word=$2
--{ echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_CC+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   if test -n "$CC"; then
-   ac_cv_prog_CC="$CC" # Let the user override the test.
-@@ -1678,7 +1776,7 @@ do
-   for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-     ac_cv_prog_CC="${ac_tool_prefix}gcc"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
- done
-@@ -1689,11 +1787,11 @@ fi
- fi
- CC=$ac_cv_prog_CC
- if test -n "$CC"; then
--  { echo "$as_me:$LINENO: result: $CC" >&5
--echo "${ECHO_T}$CC" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
-+$as_echo "$CC" >&6; }
- else
--  { echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
- fi
-@@ -1702,10 +1800,10 @@ if test -z "$ac_cv_prog_CC"; then
-   ac_ct_CC=$CC
-   # Extract the first word of "gcc", so it can be a program name with args.
- set dummy gcc; ac_word=$2
--{ echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   if test -n "$ac_ct_CC"; then
-   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-@@ -1718,7 +1816,7 @@ do
-   for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-     ac_cv_prog_ac_ct_CC="gcc"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
- done
-@@ -1729,11 +1827,11 @@ fi
- fi
- ac_ct_CC=$ac_cv_prog_ac_ct_CC
- if test -n "$ac_ct_CC"; then
--  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
--echo "${ECHO_T}$ac_ct_CC" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-+$as_echo "$ac_ct_CC" >&6; }
- else
--  { echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
- fi
-   if test "x$ac_ct_CC" = x; then
-@@ -1741,12 +1839,8 @@ fi
-   else
-     case $cross_compiling:$ac_tool_warned in
- yes:)
--{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
--whose name does not start with the host triplet.  If you think this
--configuration is useful to you, please write to autoconf@gnu.org." >&5
--echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
--whose name does not start with the host triplet.  If you think this
--configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
- ac_tool_warned=yes ;;
- esac
-     CC=$ac_ct_CC
-@@ -1759,10 +1853,10 @@ if test -z "$CC"; then
-           if test -n "$ac_tool_prefix"; then
-     # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
- set dummy ${ac_tool_prefix}cc; ac_word=$2
--{ echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_CC+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   if test -n "$CC"; then
-   ac_cv_prog_CC="$CC" # Let the user override the test.
-@@ -1775,7 +1869,7 @@ do
-   for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-     ac_cv_prog_CC="${ac_tool_prefix}cc"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
- done
-@@ -1786,11 +1880,11 @@ fi
- fi
- CC=$ac_cv_prog_CC
- if test -n "$CC"; then
--  { echo "$as_me:$LINENO: result: $CC" >&5
--echo "${ECHO_T}$CC" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
-+$as_echo "$CC" >&6; }
- else
--  { echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
- fi
-@@ -1799,10 +1893,10 @@ fi
- if test -z "$CC"; then
-   # Extract the first word of "cc", so it can be a program name with args.
- set dummy cc; ac_word=$2
--{ echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_CC+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   if test -n "$CC"; then
-   ac_cv_prog_CC="$CC" # Let the user override the test.
-@@ -1820,7 +1914,7 @@ do
-        continue
-      fi
-     ac_cv_prog_CC="cc"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
- done
-@@ -1843,11 +1937,11 @@ fi
- fi
- CC=$ac_cv_prog_CC
- if test -n "$CC"; then
--  { echo "$as_me:$LINENO: result: $CC" >&5
--echo "${ECHO_T}$CC" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
-+$as_echo "$CC" >&6; }
- else
--  { echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
- fi
-@@ -1858,10 +1952,10 @@ if test -z "$CC"; then
-   do
-     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
- set dummy $ac_tool_prefix$ac_prog; ac_word=$2
--{ echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_CC+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   if test -n "$CC"; then
-   ac_cv_prog_CC="$CC" # Let the user override the test.
-@@ -1874,7 +1968,7 @@ do
-   for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
- done
-@@ -1885,11 +1979,11 @@ fi
- fi
- CC=$ac_cv_prog_CC
- if test -n "$CC"; then
--  { echo "$as_me:$LINENO: result: $CC" >&5
--echo "${ECHO_T}$CC" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
-+$as_echo "$CC" >&6; }
- else
--  { echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
- fi
-@@ -1902,10 +1996,10 @@ if test -z "$CC"; then
- do
-   # Extract the first word of "$ac_prog", so it can be a program name with args.
- set dummy $ac_prog; ac_word=$2
--{ echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
- if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   if test -n "$ac_ct_CC"; then
-   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-@@ -1918,7 +2012,7 @@ do
-   for ac_exec_ext in '' $ac_executable_extensions; do
-   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-     ac_cv_prog_ac_ct_CC="$ac_prog"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
- done
-@@ -1929,11 +2023,11 @@ fi
- fi
- ac_ct_CC=$ac_cv_prog_ac_ct_CC
- if test -n "$ac_ct_CC"; then
--  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
--echo "${ECHO_T}$ac_ct_CC" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-+$as_echo "$ac_ct_CC" >&6; }
- else
--  { echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
- fi
-@@ -1945,12 +2039,8 @@ done
-   else
-     case $cross_compiling:$ac_tool_warned in
- yes:)
--{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
--whose name does not start with the host triplet.  If you think this
--configuration is useful to you, please write to autoconf@gnu.org." >&5
--echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
--whose name does not start with the host triplet.  If you think this
--configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
- ac_tool_warned=yes ;;
- esac
-     CC=$ac_ct_CC
-@@ -1960,44 +2050,50 @@ fi
- fi
--test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
- See \`config.log' for more details." >&5
--echo "$as_me: error: no acceptable C compiler found in \$PATH
-+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
- See \`config.log' for more details." >&2;}
--   { (exit 1); exit 1; }; }
-+   { (exit 1); exit 1; }; }; }
- # Provide some information about the compiler.
--echo "$as_me:$LINENO: checking for C compiler version" >&5
--ac_compiler=`set X $ac_compile; echo $2`
-+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
-+set X $ac_compile
-+ac_compiler=$2
- { (ac_try="$ac_compiler --version >&5"
- case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compiler --version >&5") 2>&5
-   ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }
- { (ac_try="$ac_compiler -v >&5"
- case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compiler -v >&5") 2>&5
-   ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }
- { (ac_try="$ac_compiler -V >&5"
- case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compiler -V >&5") 2>&5
-   ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }
- cat >conftest.$ac_ext <<_ACEOF
-@@ -2016,27 +2112,22 @@ main ()
- }
- _ACEOF
- ac_clean_files_save=$ac_clean_files
--ac_clean_files="$ac_clean_files a.out a.exe b.out"
-+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
- # Try to create an executable without -o first, disregard a.out.
- # It will help us diagnose broken compilers, and finding out an intuition
- # of exeext.
--{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
--echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
--ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
--#
--# List of possible output files, starting from the most likely.
--# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
--# only as a last resort.  b.out is created by i960 compilers.
--ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
--#
--# The IRIX 6 linker writes into existing files which may not be
--# executable, retaining their permissions.  Remove them first so a
--# subsequent execution test works.
-+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-+$as_echo_n "checking for C compiler default output file name... " >&6; }
-+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-+
-+# The possible output files:
-+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-+
- ac_rmfiles=
- for ac_file in $ac_files
- do
-   case $ac_file in
--    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
-+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-     * ) ac_rmfiles="$ac_rmfiles $ac_file";;
-   esac
- done
-@@ -2047,10 +2138,11 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link_default") 2>&5
-   ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; then
-   # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
- # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-@@ -2061,7 +2153,7 @@ for ac_file in $ac_files ''
- do
-   test -f "$ac_file" || continue
-   case $ac_file in
--    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
-+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
-       ;;
-     [ab].out )
-       # We found the default executable, but exeext='' is most
-@@ -2088,25 +2180,27 @@ else
-   ac_file=''
- fi
--{ echo "$as_me:$LINENO: result: $ac_file" >&5
--echo "${ECHO_T}$ac_file" >&6; }
-+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
-+$as_echo "$ac_file" >&6; }
- if test -z "$ac_file"; then
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
- See \`config.log' for more details." >&5
--echo "$as_me: error: C compiler cannot create executables
-+$as_echo "$as_me: error: C compiler cannot create executables
- See \`config.log' for more details." >&2;}
--   { (exit 77); exit 77; }; }
-+   { (exit 77); exit 77; }; }; }
- fi
- ac_exeext=$ac_cv_exeext
- # Check that the compiler produces executables we can run.  If not, either
- # the compiler is broken, or we cross compile.
--{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
--echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-+$as_echo_n "checking whether the C compiler works... " >&6; }
- # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
- # If not cross compiling, check that we can run a simple program.
- if test "$cross_compiling" != yes; then
-@@ -2115,49 +2209,53 @@ if test "$cross_compiling" != yes; then
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_try") 2>&5
-   ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
-     cross_compiling=no
-   else
-     if test "$cross_compiling" = maybe; then
-       cross_compiling=yes
-     else
--      { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-+      { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
- If you meant to cross compile, use \`--host'.
- See \`config.log' for more details." >&5
--echo "$as_me: error: cannot run C compiled programs.
-+$as_echo "$as_me: error: cannot run C compiled programs.
- If you meant to cross compile, use \`--host'.
- See \`config.log' for more details." >&2;}
--   { (exit 1); exit 1; }; }
-+   { (exit 1); exit 1; }; }; }
-     fi
-   fi
- fi
--{ echo "$as_me:$LINENO: result: yes" >&5
--echo "${ECHO_T}yes" >&6; }
-+{ $as_echo "$as_me:$LINENO: result: yes" >&5
-+$as_echo "yes" >&6; }
--rm -f a.out a.exe conftest$ac_cv_exeext b.out
-+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
- ac_clean_files=$ac_clean_files_save
- # Check that the compiler produces executables we can run.  If not, either
- # the compiler is broken, or we cross compile.
--{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
--echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
--{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
--echo "${ECHO_T}$cross_compiling" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-+$as_echo_n "checking whether we are cross compiling... " >&6; }
-+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
-+$as_echo "$cross_compiling" >&6; }
--{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
--echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
-+$as_echo_n "checking for suffix of executables... " >&6; }
- if { (ac_try="$ac_link"
- case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>&5
-   ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; then
-   # If both `conftest.exe' and `conftest' are `present' (well, observable)
- # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
-@@ -2166,31 +2264,33 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec
- for ac_file in conftest.exe conftest conftest.*; do
-   test -f "$ac_file" || continue
-   case $ac_file in
--    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
-+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-         break;;
-     * ) break;;
-   esac
- done
- else
--  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
- See \`config.log' for more details." >&5
--echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
- See \`config.log' for more details." >&2;}
--   { (exit 1); exit 1; }; }
-+   { (exit 1); exit 1; }; }; }
- fi
- rm -f conftest$ac_cv_exeext
--{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
--echo "${ECHO_T}$ac_cv_exeext" >&6; }
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-+$as_echo "$ac_cv_exeext" >&6; }
- rm -f conftest.$ac_ext
- EXEEXT=$ac_cv_exeext
- ac_exeext=$EXEEXT
--{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
--echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
-+$as_echo_n "checking for suffix of object files... " >&6; }
- if test "${ac_cv_objext+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
-@@ -2213,40 +2313,43 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compile") 2>&5
-   ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; then
-   for ac_file in conftest.o conftest.obj conftest.*; do
-   test -f "$ac_file" || continue;
-   case $ac_file in
--    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
-+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
-     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
-        break;;
-   esac
- done
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
- See \`config.log' for more details." >&5
--echo "$as_me: error: cannot compute suffix of object files: cannot compile
-+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
- See \`config.log' for more details." >&2;}
--   { (exit 1); exit 1; }; }
-+   { (exit 1); exit 1; }; }; }
- fi
- rm -f conftest.$ac_cv_objext conftest.$ac_ext
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
--echo "${ECHO_T}$ac_cv_objext" >&6; }
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-+$as_echo "$ac_cv_objext" >&6; }
- OBJEXT=$ac_cv_objext
- ac_objext=$OBJEXT
--{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
--echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
- if test "${ac_cv_c_compiler_gnu+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
-@@ -2272,20 +2375,21 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compile") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-        } && test -s conftest.$ac_objext; then
-   ac_compiler_gnu=yes
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
-       ac_compiler_gnu=no
-@@ -2295,15 +2399,19 @@ rm -f core conftest.err conftest.$ac_obj
- ac_cv_c_compiler_gnu=$ac_compiler_gnu
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
--echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
--GCC=`test $ac_compiler_gnu = yes && echo yes`
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-+if test $ac_compiler_gnu = yes; then
-+  GCC=yes
-+else
-+  GCC=
-+fi
- ac_test_CFLAGS=${CFLAGS+set}
- ac_save_CFLAGS=$CFLAGS
--{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
--echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-+$as_echo_n "checking whether $CC accepts -g... " >&6; }
- if test "${ac_cv_prog_cc_g+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   ac_save_c_werror_flag=$ac_c_werror_flag
-    ac_c_werror_flag=yes
-@@ -2330,20 +2438,21 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compile") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-        } && test -s conftest.$ac_objext; then
-   ac_cv_prog_cc_g=yes
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
-       CFLAGS=""
-@@ -2368,20 +2477,21 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compile") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-        } && test -s conftest.$ac_objext; then
-   :
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
-       ac_c_werror_flag=$ac_save_c_werror_flag
-@@ -2407,20 +2517,21 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compile") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-        } && test -s conftest.$ac_objext; then
-   ac_cv_prog_cc_g=yes
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
-@@ -2435,8 +2546,8 @@ fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    ac_c_werror_flag=$ac_save_c_werror_flag
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
--echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-+$as_echo "$ac_cv_prog_cc_g" >&6; }
- if test "$ac_test_CFLAGS" = set; then
-   CFLAGS=$ac_save_CFLAGS
- elif test $ac_cv_prog_cc_g = yes; then
-@@ -2452,10 +2563,10 @@ else
-     CFLAGS=
-   fi
- fi
--{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
--echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
- if test "${ac_cv_prog_cc_c89+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   ac_cv_prog_cc_c89=no
- ac_save_CC=$CC
-@@ -2526,20 +2637,21 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compile") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-        } && test -s conftest.$ac_objext; then
-   ac_cv_prog_cc_c89=$ac_arg
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
-@@ -2555,15 +2667,15 @@ fi
- # AC_CACHE_VAL
- case "x$ac_cv_prog_cc_c89" in
-   x)
--    { echo "$as_me:$LINENO: result: none needed" >&5
--echo "${ECHO_T}none needed" >&6; } ;;
-+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
-+$as_echo "none needed" >&6; } ;;
-   xno)
--    { echo "$as_me:$LINENO: result: unsupported" >&5
--echo "${ECHO_T}unsupported" >&6; } ;;
-+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
-+$as_echo "unsupported" >&6; } ;;
-   *)
-     CC="$CC $ac_cv_prog_cc_c89"
--    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
--echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
-+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
- esac
-@@ -2581,8 +2693,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
- if test "${with_rlm_ldap_lib_dir+set}" = set; then
-   withval=$with_rlm_ldap_lib_dir;  case "$withval" in
-           no)
--              { { echo "$as_me:$LINENO: error: Need rlm-ldap-lib-dir" >&5
--echo "$as_me: error: Need rlm-ldap-lib-dir" >&2;}
-+              { { $as_echo "$as_me:$LINENO: error: Need rlm-ldap-lib-dir" >&5
-+$as_echo "$as_me: error: Need rlm-ldap-lib-dir" >&2;}
-    { (exit 1); exit 1; }; }
-               ;;
-           yes)
-@@ -2601,8 +2713,8 @@ fi
- if test "${with_rlm_ldap_include_dir+set}" = set; then
-   withval=$with_rlm_ldap_include_dir;  case "$withval" in
-           no)
--              { { echo "$as_me:$LINENO: error: Need rlm-ldap-include-dir" >&5
--echo "$as_me: error: Need rlm-ldap-include-dir" >&2;}
-+              { { $as_echo "$as_me:$LINENO: error: Need rlm-ldap-include-dir" >&5
-+$as_echo "$as_me: error: Need rlm-ldap-include-dir" >&2;}
-    { (exit 1); exit 1; }; }
-               ;;
-           yes)
-@@ -2641,8 +2753,8 @@ fi
-                               if test "x$enable_shared" = "xno"; then
--              { echo "$as_me:$LINENO: WARNING: Static linking with libldap will probably result in unresolved symbols." >&5
--echo "$as_me: WARNING: Static linking with libldap will probably result in unresolved symbols." >&2;}
-+              { $as_echo "$as_me:$LINENO: WARNING: Static linking with libldap will probably result in unresolved symbols." >&5
-+$as_echo "$as_me: WARNING: Static linking with libldap will probably result in unresolved symbols." >&2;}
-       fi
-               rlm_ldap_with_threads=yes
-@@ -2661,10 +2773,10 @@ fi
-                       if test "x$rlm_ldap_with_threads" = "xyes"; then
--          { echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
--echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; }
-+          { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
-+$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
- if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   ac_check_lib_save_LIBS=$LIBS
- LIBS="-lpthread  $LIBS"
-@@ -2696,39 +2808,43 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
-+       } && test -s conftest$ac_exeext && {
-+       test "$cross_compiling" = yes ||
-+       $as_test_x conftest$ac_exeext
-+       }; then
-   ac_cv_lib_pthread_pthread_create=yes
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
-       ac_cv_lib_pthread_pthread_create=no
- fi
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
- LIBS=$ac_check_lib_save_LIBS
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
--echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; }
--if test $ac_cv_lib_pthread_pthread_create = yes; then
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
-+$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
-+if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then
-    LIBS="-lpthread $LIBS"
- else
--  { echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5
--echo $ECHO_N "checking for pthread_create in -lc_r... $ECHO_C" >&6; }
-+  { $as_echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5
-+$as_echo_n "checking for pthread_create in -lc_r... " >&6; }
- if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   ac_check_lib_save_LIBS=$LIBS
- LIBS="-lc_r  $LIBS"
-@@ -2761,33 +2877,37 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
-+       } && test -s conftest$ac_exeext && {
-+       test "$cross_compiling" = yes ||
-+       $as_test_x conftest$ac_exeext
-+       }; then
-   ac_cv_lib_c_r_pthread_create=yes
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
-       ac_cv_lib_c_r_pthread_create=no
- fi
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
- LIBS=$ac_check_lib_save_LIBS
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5
--echo "${ECHO_T}$ac_cv_lib_c_r_pthread_create" >&6; }
--if test $ac_cv_lib_c_r_pthread_create = yes; then
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5
-+$as_echo "$ac_cv_lib_c_r_pthread_create" >&6; }
-+if test "x$ac_cv_lib_c_r_pthread_create" = x""yes; then
-    LIBS="-lc_r $LIBS"
- else
-    rlm_ldap_with_threads="no"
-@@ -2799,14 +2919,12 @@ fi
-       fi
--                              smart_try_dir=$rlm_ldap_lib_dir
--      if test "x$rlm_ldap_with_threads" = "xyes"; then
--sm_lib_safe=`echo "ldap_r" | sed 'y%./+-%__p_%'`
--sm_func_safe=`echo "ldap_init" | sed 'y%./+-%__p_%'`
--{ echo "$as_me:$LINENO: checking for ldap_init in -lldap_r" >&5
--echo $ECHO_N "checking for ldap_init in -lldap_r... $ECHO_C" >&6; }
-+sm_lib_safe=`echo "sasl" | sed 'y%./+-%__p_%'`
-+sm_func_safe=`echo "sasl_encode" | sed 'y%./+-%__p_%'`
-+{ $as_echo "$as_me:$LINENO: checking for sasl_encode in -lsasl" >&5
-+$as_echo_n "checking for sasl_encode in -lsasl... " >&6; }
- old_LIBS="$LIBS"
- smart_lib=
-@@ -2814,18 +2932,18 @@ smart_lib_dir=
- if test "x$smart_try_dir" != "x"; then
-   for try in $smart_try_dir; do
--    LIBS="-L$try -lldap_r $old_LIBS"
-+    LIBS="-L$try -lsasl $old_LIBS"
-     cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--extern char ldap_init();
-+extern char sasl_encode();
- int
- main ()
- {
-- ldap_init()
-+ sasl_encode()
-   ;
-   return 0;
- }
-@@ -2836,26 +2954,30 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
--  smart_lib="-L$try -lldap_r"
-+       } && test -s conftest$ac_exeext && {
-+       test "$cross_compiling" = yes ||
-+       $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-L$try -lsasl"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- fi
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
-     if test "x$smart_lib" != "x"; then
-@@ -2866,18 +2988,18 @@ rm -f core conftest.err conftest.$ac_obj
- fi
- if test "x$smart_lib" = "x"; then
--  LIBS="-lldap_r $old_LIBS"
-+  LIBS="-lsasl $old_LIBS"
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--extern char ldap_init();
-+extern char sasl_encode();
- int
- main ()
- {
-- ldap_init()
-+ sasl_encode()
-   ;
-   return 0;
- }
-@@ -2888,26 +3010,30 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
--  smart_lib="-lldap_r"
-+       } && test -s conftest$ac_exeext && {
-+       test "$cross_compiling" = yes ||
-+       $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-lsasl"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- fi
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
-   LIBS="$old_LIBS"
-@@ -2918,7 +3044,7 @@ if test "x$smart_lib" = "x"; then
- if test "x$LOCATE" != "x"; then
-         DIRS=
--  file=libldap_r${libltdl_cv_shlibext}
-+  file=libsasl${libltdl_cv_shlibext}
-   for x in `${LOCATE} $file 2>/dev/null`; do
-                                         base=`echo $x | sed "s%/${file}%%"`
-@@ -2945,7 +3071,7 @@ eval "smart_lib_dir=\"\$smart_lib_dir $D
- if test "x$LOCATE" != "x"; then
-         DIRS=
--  file=libldap_r.a
-+  file=libsasl.a
-   for x in `${LOCATE} $file 2>/dev/null`; do
-                                         base=`echo $x | sed "s%/${file}%%"`
-@@ -2970,18 +3096,18 @@ eval "smart_lib_dir=\"\$smart_lib_dir $D
-   for try in $smart_lib_dir /usr/local/lib /opt/lib; do
--    LIBS="-L$try -lldap_r $old_LIBS"
-+    LIBS="-L$try -lsasl $old_LIBS"
-     cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--extern char ldap_init();
-+extern char sasl_encode();
- int
- main ()
- {
-- ldap_init()
-+ sasl_encode()
-   ;
-   return 0;
- }
-@@ -2992,26 +3118,30 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
--  smart_lib="-L$try -lldap_r"
-+       } && test -s conftest$ac_exeext && {
-+       test "$cross_compiling" = yes ||
-+       $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-L$try -lsasl"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- fi
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
-     if test "x$smart_lib" != "x"; then
-@@ -3022,26 +3152,22 @@ rm -f core conftest.err conftest.$ac_obj
- fi
- if test "x$smart_lib" != "x"; then
--  { echo "$as_me:$LINENO: result: yes" >&5
--echo "${ECHO_T}yes" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: yes" >&5
-+$as_echo "yes" >&6; }
-   eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
-   LIBS="$smart_lib $old_LIBS"
-   SMART_LIBS="$smart_lib $SMART_LIBS"
- else
--  { echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
- fi
--          if test "x$ac_cv_lib_ldap_r_ldap_init" != "xyes"; then
--              fail="$fail libldap_r"
--          fi
--      else
--sm_lib_safe=`echo "ldap" | sed 'y%./+-%__p_%'`
--sm_func_safe=`echo "ldap_init" | sed 'y%./+-%__p_%'`
--{ echo "$as_me:$LINENO: checking for ldap_init in -lldap" >&5
--echo $ECHO_N "checking for ldap_init in -lldap... $ECHO_C" >&6; }
-+sm_lib_safe=`echo "lber" | sed 'y%./+-%__p_%'`
-+sm_func_safe=`echo "ber_init" | sed 'y%./+-%__p_%'`
-+{ $as_echo "$as_me:$LINENO: checking for ber_init in -llber" >&5
-+$as_echo_n "checking for ber_init in -llber... " >&6; }
- old_LIBS="$LIBS"
- smart_lib=
-@@ -3049,18 +3175,18 @@ smart_lib_dir=
- if test "x$smart_try_dir" != "x"; then
-   for try in $smart_try_dir; do
--    LIBS="-L$try -lldap $old_LIBS"
-+    LIBS="-L$try -llber $old_LIBS"
-     cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--extern char ldap_init();
-+extern char ber_init();
- int
- main ()
- {
-- ldap_init()
-+ ber_init()
-   ;
-   return 0;
- }
-@@ -3071,26 +3197,30 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
--  smart_lib="-L$try -lldap"
-+       } && test -s conftest$ac_exeext && {
-+       test "$cross_compiling" = yes ||
-+       $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-L$try -llber"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- fi
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
-     if test "x$smart_lib" != "x"; then
-@@ -3101,18 +3231,18 @@ rm -f core conftest.err conftest.$ac_obj
- fi
- if test "x$smart_lib" = "x"; then
--  LIBS="-lldap $old_LIBS"
-+  LIBS="-llber $old_LIBS"
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--extern char ldap_init();
-+extern char ber_init();
- int
- main ()
- {
-- ldap_init()
-+ ber_init()
-   ;
-   return 0;
- }
-@@ -3123,26 +3253,30 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
--  smart_lib="-lldap"
-+       } && test -s conftest$ac_exeext && {
-+       test "$cross_compiling" = yes ||
-+       $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-llber"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- fi
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
-   LIBS="$old_LIBS"
-@@ -3153,7 +3287,7 @@ if test "x$smart_lib" = "x"; then
- if test "x$LOCATE" != "x"; then
-         DIRS=
--  file=libldap${libltdl_cv_shlibext}
-+  file=liblber${libltdl_cv_shlibext}
-   for x in `${LOCATE} $file 2>/dev/null`; do
-                                         base=`echo $x | sed "s%/${file}%%"`
-@@ -3180,7 +3314,7 @@ eval "smart_lib_dir=\"\$smart_lib_dir $D
- if test "x$LOCATE" != "x"; then
-         DIRS=
--  file=libldap.a
-+  file=liblber.a
-   for x in `${LOCATE} $file 2>/dev/null`; do
-                                         base=`echo $x | sed "s%/${file}%%"`
-@@ -3205,18 +3339,18 @@ eval "smart_lib_dir=\"\$smart_lib_dir $D
-   for try in $smart_lib_dir /usr/local/lib /opt/lib; do
--    LIBS="-L$try -lldap $old_LIBS"
-+    LIBS="-L$try -llber $old_LIBS"
-     cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--extern char ldap_init();
-+extern char ber_init();
- int
- main ()
- {
-- ldap_init()
-+ ber_init()
-   ;
-   return 0;
- }
-@@ -3227,26 +3361,30 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
--  smart_lib="-L$try -lldap"
-+       } && test -s conftest$ac_exeext && {
-+       test "$cross_compiling" = yes ||
-+       $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-L$try -llber"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- fi
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
-     if test "x$smart_lib" != "x"; then
-@@ -3257,136 +3395,145 @@ rm -f core conftest.err conftest.$ac_obj
- fi
- if test "x$smart_lib" != "x"; then
--  { echo "$as_me:$LINENO: result: yes" >&5
--echo "${ECHO_T}yes" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: yes" >&5
-+$as_echo "yes" >&6; }
-   eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
-   LIBS="$smart_lib $old_LIBS"
-   SMART_LIBS="$smart_lib $SMART_LIBS"
- else
--  { echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
- fi
--          if test "x$ac_cv_lib_ldap_ldap_init" != "xyes"; then
--              fail="$fail libldap"
--          fi
--      fi
--
--      smart_try_dir=$rlm_ldap_include_dir
-+                              smart_try_dir=$rlm_ldap_lib_dir
-+      if test "x$rlm_ldap_with_threads" = "xyes"; then
--ac_safe=`echo "ldap.h" | sed 'y%./+-%__pm%'`
--{ echo "$as_me:$LINENO: checking for ldap.h" >&5
--echo $ECHO_N "checking for ldap.h... $ECHO_C" >&6; }
-+sm_lib_safe=`echo "ldap_r" | sed 'y%./+-%__p_%'`
-+sm_func_safe=`echo "ldap_init" | sed 'y%./+-%__p_%'`
-+{ $as_echo "$as_me:$LINENO: checking for ldap_init in -lldap_r" >&5
-+$as_echo_n "checking for ldap_init in -lldap_r... " >&6; }
--old_CFLAGS="$CFLAGS"
--smart_include=
--smart_include_dir=
-+old_LIBS="$LIBS"
-+smart_lib=
-+smart_lib_dir=
- if test "x$smart_try_dir" != "x"; then
-   for try in $smart_try_dir; do
--    CFLAGS="$old_CFLAGS -I$try"
-+    LIBS="-L$try -lldap_r $old_LIBS"
-     cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--
--                  #include <ldap.h>
-+extern char ldap_init();
- int
- main ()
- {
-- int a = 1;
-+ ldap_init()
-   ;
-   return 0;
- }
- _ACEOF
--rm -f conftest.$ac_objext
--if { (ac_try="$ac_compile"
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (ac_try="$ac_link"
- case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
--  (eval "$ac_compile") 2>conftest.er1
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+  (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
--       } && test -s conftest.$ac_objext; then
--  smart_include="-I$try"
-+       } && test -s conftest$ac_exeext && {
-+       test "$cross_compiling" = yes ||
-+       $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-L$try -lldap_r"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--      smart_include=
-+
- fi
--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
--    if test "x$smart_include" != "x"; then
-+rm -rf conftest.dSYM
-+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-+      conftest$ac_exeext conftest.$ac_ext
-+    if test "x$smart_lib" != "x"; then
-       break;
-     fi
-   done
--  CFLAGS="$old_CFLAGS"
-+  LIBS="$old_LIBS"
- fi
--if test "x$smart_include" = "x"; then
-+if test "x$smart_lib" = "x"; then
-+  LIBS="-lldap_r $old_LIBS"
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--
--                #include <ldap.h>
-+extern char ldap_init();
- int
- main ()
- {
-- int a = 1;
-+ ldap_init()
-   ;
-   return 0;
- }
- _ACEOF
--rm -f conftest.$ac_objext
--if { (ac_try="$ac_compile"
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (ac_try="$ac_link"
- case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
--  (eval "$ac_compile") 2>conftest.er1
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+  (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
--       } && test -s conftest.$ac_objext; then
--  smart_include=" "
-+       } && test -s conftest$ac_exeext && {
-+       test "$cross_compiling" = yes ||
-+       $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-lldap_r"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--      smart_include=
-+
- fi
--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+rm -rf conftest.dSYM
-+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-+      conftest$ac_exeext conftest.$ac_ext
-+  LIBS="$old_LIBS"
- fi
--if test "x$smart_include" = "x"; then
-+if test "x$smart_lib" = "x"; then
- if test "x$LOCATE" != "x"; then
-         DIRS=
--  file=ldap.h
-+  file=libldap_r${libltdl_cv_shlibext}
-   for x in `${LOCATE} $file 2>/dev/null`; do
-                                         base=`echo $x | sed "s%/${file}%%"`
-@@ -3400,19 +3547,505 @@ if test "x$LOCATE" != "x"; then
-       continue
-     fi
--                    already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}`
-+                    already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
-     if test "x$already" = "x"; then
-       DIRS="$DIRS $dir"
-     fi
-   done
- fi
--eval "smart_include_dir=\"\$smart_include_dir $DIRS\""
-+eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
--  for try in $smart_include_dir /usr/local/include /opt/include; do
--    CFLAGS="$old_CFLAGS -I$try"
--    cat >conftest.$ac_ext <<_ACEOF
-+
-+if test "x$LOCATE" != "x"; then
-+        DIRS=
-+  file=libldap_r.a
-+
-+  for x in `${LOCATE} $file 2>/dev/null`; do
-+                                        base=`echo $x | sed "s%/${file}%%"`
-+    if test "x$x" = "x$base"; then
-+      continue;
-+    fi
-+
-+    dir=`${DIRNAME} $x 2>/dev/null`
-+                exclude=`echo ${dir} | ${GREP} /home`
-+    if test "x$exclude" != "x"; then
-+      continue
-+    fi
-+
-+                    already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
-+    if test "x$already" = "x"; then
-+      DIRS="$DIRS $dir"
-+    fi
-+  done
-+fi
-+
-+eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
-+
-+
-+  for try in $smart_lib_dir /usr/local/lib /opt/lib; do
-+    LIBS="-L$try -lldap_r $old_LIBS"
-+    cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+extern char ldap_init();
-+int
-+main ()
-+{
-+ ldap_init()
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (ac_try="$ac_link"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+  (eval "$ac_link") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && {
-+       test -z "$ac_c_werror_flag" ||
-+       test ! -s conftest.err
-+       } && test -s conftest$ac_exeext && {
-+       test "$cross_compiling" = yes ||
-+       $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-L$try -lldap_r"
-+else
-+  $as_echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+
-+fi
-+
-+rm -rf conftest.dSYM
-+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-+      conftest$ac_exeext conftest.$ac_ext
-+    if test "x$smart_lib" != "x"; then
-+      break;
-+    fi
-+  done
-+  LIBS="$old_LIBS"
-+fi
-+
-+if test "x$smart_lib" != "x"; then
-+  { $as_echo "$as_me:$LINENO: result: yes" >&5
-+$as_echo "yes" >&6; }
-+  eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
-+  LIBS="$smart_lib $old_LIBS"
-+  SMART_LIBS="$smart_lib $SMART_LIBS"
-+else
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+          if test "x$ac_cv_lib_ldap_r_ldap_init" != "xyes"; then
-+              fail="$fail libldap_r"
-+          fi
-+      else
-+
-+
-+sm_lib_safe=`echo "ldap" | sed 'y%./+-%__p_%'`
-+sm_func_safe=`echo "ldap_init" | sed 'y%./+-%__p_%'`
-+{ $as_echo "$as_me:$LINENO: checking for ldap_init in -lldap" >&5
-+$as_echo_n "checking for ldap_init in -lldap... " >&6; }
-+
-+old_LIBS="$LIBS"
-+smart_lib=
-+smart_lib_dir=
-+
-+if test "x$smart_try_dir" != "x"; then
-+  for try in $smart_try_dir; do
-+    LIBS="-L$try -lldap $old_LIBS"
-+    cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+extern char ldap_init();
-+int
-+main ()
-+{
-+ ldap_init()
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (ac_try="$ac_link"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+  (eval "$ac_link") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && {
-+       test -z "$ac_c_werror_flag" ||
-+       test ! -s conftest.err
-+       } && test -s conftest$ac_exeext && {
-+       test "$cross_compiling" = yes ||
-+       $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-L$try -lldap"
-+else
-+  $as_echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+
-+fi
-+
-+rm -rf conftest.dSYM
-+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-+      conftest$ac_exeext conftest.$ac_ext
-+    if test "x$smart_lib" != "x"; then
-+      break;
-+    fi
-+  done
-+  LIBS="$old_LIBS"
-+fi
-+
-+if test "x$smart_lib" = "x"; then
-+  LIBS="-lldap $old_LIBS"
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+extern char ldap_init();
-+int
-+main ()
-+{
-+ ldap_init()
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (ac_try="$ac_link"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+  (eval "$ac_link") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && {
-+       test -z "$ac_c_werror_flag" ||
-+       test ! -s conftest.err
-+       } && test -s conftest$ac_exeext && {
-+       test "$cross_compiling" = yes ||
-+       $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-lldap"
-+else
-+  $as_echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+
-+fi
-+
-+rm -rf conftest.dSYM
-+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-+      conftest$ac_exeext conftest.$ac_ext
-+  LIBS="$old_LIBS"
-+fi
-+
-+if test "x$smart_lib" = "x"; then
-+
-+
-+if test "x$LOCATE" != "x"; then
-+        DIRS=
-+  file=libldap${libltdl_cv_shlibext}
-+
-+  for x in `${LOCATE} $file 2>/dev/null`; do
-+                                        base=`echo $x | sed "s%/${file}%%"`
-+    if test "x$x" = "x$base"; then
-+      continue;
-+    fi
-+
-+    dir=`${DIRNAME} $x 2>/dev/null`
-+                exclude=`echo ${dir} | ${GREP} /home`
-+    if test "x$exclude" != "x"; then
-+      continue
-+    fi
-+
-+                    already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
-+    if test "x$already" = "x"; then
-+      DIRS="$DIRS $dir"
-+    fi
-+  done
-+fi
-+
-+eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
-+
-+
-+
-+if test "x$LOCATE" != "x"; then
-+        DIRS=
-+  file=libldap.a
-+
-+  for x in `${LOCATE} $file 2>/dev/null`; do
-+                                        base=`echo $x | sed "s%/${file}%%"`
-+    if test "x$x" = "x$base"; then
-+      continue;
-+    fi
-+
-+    dir=`${DIRNAME} $x 2>/dev/null`
-+                exclude=`echo ${dir} | ${GREP} /home`
-+    if test "x$exclude" != "x"; then
-+      continue
-+    fi
-+
-+                    already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
-+    if test "x$already" = "x"; then
-+      DIRS="$DIRS $dir"
-+    fi
-+  done
-+fi
-+
-+eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
-+
-+
-+  for try in $smart_lib_dir /usr/local/lib /opt/lib; do
-+    LIBS="-L$try -lldap $old_LIBS"
-+    cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+extern char ldap_init();
-+int
-+main ()
-+{
-+ ldap_init()
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (ac_try="$ac_link"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+  (eval "$ac_link") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && {
-+       test -z "$ac_c_werror_flag" ||
-+       test ! -s conftest.err
-+       } && test -s conftest$ac_exeext && {
-+       test "$cross_compiling" = yes ||
-+       $as_test_x conftest$ac_exeext
-+       }; then
-+  smart_lib="-L$try -lldap"
-+else
-+  $as_echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+
-+fi
-+
-+rm -rf conftest.dSYM
-+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-+      conftest$ac_exeext conftest.$ac_ext
-+    if test "x$smart_lib" != "x"; then
-+      break;
-+    fi
-+  done
-+  LIBS="$old_LIBS"
-+fi
-+
-+if test "x$smart_lib" != "x"; then
-+  { $as_echo "$as_me:$LINENO: result: yes" >&5
-+$as_echo "yes" >&6; }
-+  eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
-+  LIBS="$smart_lib $old_LIBS"
-+  SMART_LIBS="$smart_lib $SMART_LIBS"
-+else
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+          if test "x$ac_cv_lib_ldap_ldap_init" != "xyes"; then
-+              fail="$fail libldap"
-+          fi
-+      fi
-+
-+
-+      smart_try_dir=$rlm_ldap_include_dir
-+
-+
-+ac_safe=`echo "ldap.h" | sed 'y%./+-%__pm%'`
-+{ $as_echo "$as_me:$LINENO: checking for ldap.h" >&5
-+$as_echo_n "checking for ldap.h... " >&6; }
-+
-+old_CFLAGS="$CFLAGS"
-+smart_include=
-+smart_include_dir=
-+
-+if test "x$smart_try_dir" != "x"; then
-+  for try in $smart_try_dir; do
-+    CFLAGS="$old_CFLAGS -I$try"
-+    cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+
-+                  #include <ldap.h>
-+int
-+main ()
-+{
-+ int a = 1;
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (ac_try="$ac_compile"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+  (eval "$ac_compile") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && {
-+       test -z "$ac_c_werror_flag" ||
-+       test ! -s conftest.err
-+       } && test -s conftest.$ac_objext; then
-+  smart_include="-I$try"
-+else
-+  $as_echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+      smart_include=
-+fi
-+
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+    if test "x$smart_include" != "x"; then
-+      break;
-+    fi
-+  done
-+  CFLAGS="$old_CFLAGS"
-+fi
-+
-+if test "x$smart_include" = "x"; then
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+
-+                #include <ldap.h>
-+int
-+main ()
-+{
-+ int a = 1;
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (ac_try="$ac_compile"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+  (eval "$ac_compile") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && {
-+       test -z "$ac_c_werror_flag" ||
-+       test ! -s conftest.err
-+       } && test -s conftest.$ac_objext; then
-+  smart_include=" "
-+else
-+  $as_echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+      smart_include=
-+fi
-+
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+fi
-+
-+if test "x$smart_include" = "x"; then
-+
-+
-+if test "x$LOCATE" != "x"; then
-+        DIRS=
-+  file=ldap.h
-+
-+  for x in `${LOCATE} $file 2>/dev/null`; do
-+                                        base=`echo $x | sed "s%/${file}%%"`
-+    if test "x$x" = "x$base"; then
-+      continue;
-+    fi
-+
-+    dir=`${DIRNAME} $x 2>/dev/null`
-+                exclude=`echo ${dir} | ${GREP} /home`
-+    if test "x$exclude" != "x"; then
-+      continue
-+    fi
-+
-+                    already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}`
-+    if test "x$already" = "x"; then
-+      DIRS="$DIRS $dir"
-+    fi
-+  done
-+fi
-+
-+eval "smart_include_dir=\"\$smart_include_dir $DIRS\""
-+
-+
-+  for try in $smart_include_dir /usr/local/include /opt/include; do
-+    CFLAGS="$old_CFLAGS -I$try"
-+    cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
-@@ -3434,20 +4067,21 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compile") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-        } && test -s conftest.$ac_objext; then
-   smart_include="-I$try"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
-       smart_include=
-@@ -3462,14 +4096,14 @@ rm -f core conftest.err conftest.$ac_obj
- fi
- if test "x$smart_include" != "x"; then
--  { echo "$as_me:$LINENO: result: yes" >&5
--echo "${ECHO_T}yes" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: yes" >&5
-+$as_echo "yes" >&6; }
-   eval "ac_cv_header_$ac_safe=yes"
-   CFLAGS="$old_CFLAGS $smart_include"
-   SMART_CFLAGS="$SMART_CFLAGS $smart_include"
- else
--  { echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6; }
-+  { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
- fi
-       if test "$ac_cv_header_ldap_h" != "yes"; then
-@@ -3478,10 +4112,10 @@ fi
-       if test "x$fail" = "x"; then
--          { echo "$as_me:$LINENO: checking for ldap_start_tls_s" >&5
--echo $ECHO_N "checking for ldap_start_tls_s... $ECHO_C" >&6; }
-+          { $as_echo "$as_me:$LINENO: checking for ldap_start_tls_s" >&5
-+$as_echo_n "checking for ldap_start_tls_s... " >&6; }
- if test "${ac_cv_func_ldap_start_tls_s+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
-@@ -3534,39 +4168,43 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
-+       } && test -s conftest$ac_exeext && {
-+       test "$cross_compiling" = yes ||
-+       $as_test_x conftest$ac_exeext
-+       }; then
-   ac_cv_func_ldap_start_tls_s=yes
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
-       ac_cv_func_ldap_start_tls_s=no
- fi
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_func_ldap_start_tls_s" >&5
--echo "${ECHO_T}$ac_cv_func_ldap_start_tls_s" >&6; }
--if test $ac_cv_func_ldap_start_tls_s = yes; then
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_ldap_start_tls_s" >&5
-+$as_echo "$ac_cv_func_ldap_start_tls_s" >&6; }
-+if test "x$ac_cv_func_ldap_start_tls_s" = x""yes; then
-    SMART_CFLAGS="$SMART_CFLAGS -DHAVE_LDAP_START_TLS"
- fi
--          { echo "$as_me:$LINENO: checking for ldap_initialize" >&5
--echo $ECHO_N "checking for ldap_initialize... $ECHO_C" >&6; }
-+          { $as_echo "$as_me:$LINENO: checking for ldap_initialize" >&5
-+$as_echo_n "checking for ldap_initialize... " >&6; }
- if test "${ac_cv_func_ldap_initialize+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
-@@ -3619,39 +4257,43 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
-+       } && test -s conftest$ac_exeext && {
-+       test "$cross_compiling" = yes ||
-+       $as_test_x conftest$ac_exeext
-+       }; then
-   ac_cv_func_ldap_initialize=yes
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
-       ac_cv_func_ldap_initialize=no
- fi
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_func_ldap_initialize" >&5
--echo "${ECHO_T}$ac_cv_func_ldap_initialize" >&6; }
--if test $ac_cv_func_ldap_initialize = yes; then
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_ldap_initialize" >&5
-+$as_echo "$ac_cv_func_ldap_initialize" >&6; }
-+if test "x$ac_cv_func_ldap_initialize" = x""yes; then
-    SMART_CFLAGS="$SMART_CFLAGS -DHAVE_LDAP_INITIALIZE"
- fi
--          { echo "$as_me:$LINENO: checking for ldap_int_tls_config" >&5
--echo $ECHO_N "checking for ldap_int_tls_config... $ECHO_C" >&6; }
-+          { $as_echo "$as_me:$LINENO: checking for ldap_int_tls_config" >&5
-+$as_echo_n "checking for ldap_int_tls_config... " >&6; }
- if test "${ac_cv_func_ldap_int_tls_config+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
-@@ -3704,32 +4346,36 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
-+       } && test -s conftest$ac_exeext && {
-+       test "$cross_compiling" = yes ||
-+       $as_test_x conftest$ac_exeext
-+       }; then
-   ac_cv_func_ldap_int_tls_config=yes
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
-       ac_cv_func_ldap_int_tls_config=no
- fi
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_func_ldap_int_tls_config" >&5
--echo "${ECHO_T}$ac_cv_func_ldap_int_tls_config" >&6; }
--if test $ac_cv_func_ldap_int_tls_config = yes; then
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_ldap_int_tls_config" >&5
-+$as_echo "$ac_cv_func_ldap_int_tls_config" >&6; }
-+if test "x$ac_cv_func_ldap_int_tls_config" = x""yes; then
-    SMART_CFLAGS="$SMART_CFLAGS -DHAVE_LDAP_INT_TLS_CONFIG"
- fi
-@@ -3738,11 +4384,11 @@ fi
- for ac_func in ldap_set_rebind_proc
- do
--as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
--{ echo "$as_me:$LINENO: checking for $ac_func" >&5
--echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-+$as_echo_n "checking for $ac_func... " >&6; }
- if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
-@@ -3795,44 +4441,51 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_link") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
--       } && test -s conftest$ac_exeext &&
--       $as_test_x conftest$ac_exeext; then
-+       } && test -s conftest$ac_exeext && {
-+       test "$cross_compiling" = yes ||
-+       $as_test_x conftest$ac_exeext
-+       }; then
-   eval "$as_ac_var=yes"
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
-       eval "$as_ac_var=no"
- fi
-+rm -rf conftest.dSYM
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
- fi
--ac_res=`eval echo '${'$as_ac_var'}'`
--             { echo "$as_me:$LINENO: result: $ac_res" >&5
--echo "${ECHO_T}$ac_res" >&6; }
--if test `eval echo '${'$as_ac_var'}'` = yes; then
-+ac_res=`eval 'as_val=${'$as_ac_var'}
-+               $as_echo "$as_val"'`
-+             { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-+$as_echo "$ac_res" >&6; }
-+as_val=`eval 'as_val=${'$as_ac_var'}
-+               $as_echo "$as_val"'`
-+   if test "x$as_val" = x""yes; then
-   cat >>confdefs.h <<_ACEOF
--#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
- _ACEOF
- fi
- done
--        { echo "$as_me:$LINENO: checking whether ldap_set_rebind_proc takes 3 arguments" >&5
--echo $ECHO_N "checking whether ldap_set_rebind_proc takes 3 arguments... $ECHO_C" >&6; }
-+        { $as_echo "$as_me:$LINENO: checking whether ldap_set_rebind_proc takes 3 arguments" >&5
-+$as_echo_n "checking whether ldap_set_rebind_proc takes 3 arguments... " >&6; }
- if test "${ac_cv_ldap_set_rebind_proc+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  $as_echo_n "(cached) " >&6
- else
-         cat >conftest.$ac_ext <<_ACEOF
-@@ -3858,20 +4511,21 @@ case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
--eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-   (eval "$ac_compile") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-        } && test -s conftest.$ac_objext; then
-   ac_cv_ldap_set_rebind_proc=3
- else
--  echo "$as_me: failed program was:" >&5
-+  $as_echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
-       ac_cv_ldap_set_rebind_proc=2
-@@ -3879,8 +4533,8 @@ fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_ldap_set_rebind_proc" >&5
--echo "${ECHO_T}$ac_cv_ldap_set_rebind_proc" >&6; }
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_ldap_set_rebind_proc" >&5
-+$as_echo "$ac_cv_ldap_set_rebind_proc" >&6; }
-       fi
-       targetname=rlm_ldap
-@@ -3891,21 +4545,21 @@ fi
- if test x"$fail" != x""; then
-       if test x"${enable_strict_dependencies}" = x"yes"; then
--              { { echo "$as_me:$LINENO: error: set --without-rlm_ldap to disable it explicitly." >&5
--echo "$as_me: error: set --without-rlm_ldap to disable it explicitly." >&2;}
-+              { { $as_echo "$as_me:$LINENO: error: set --without-rlm_ldap to disable it explicitly." >&5
-+$as_echo "$as_me: error: set --without-rlm_ldap to disable it explicitly." >&2;}
-    { (exit 1); exit 1; }; }
-       else
--              { echo "$as_me:$LINENO: WARNING: silently not building rlm_ldap." >&5
--echo "$as_me: WARNING: silently not building rlm_ldap." >&2;}
--              { echo "$as_me:$LINENO: WARNING: FAILURE: rlm_ldap requires: $fail." >&5
--echo "$as_me: WARNING: FAILURE: rlm_ldap requires: $fail." >&2;}
-+              { $as_echo "$as_me:$LINENO: WARNING: silently not building rlm_ldap." >&5
-+$as_echo "$as_me: WARNING: silently not building rlm_ldap." >&2;}
-+              { $as_echo "$as_me:$LINENO: WARNING: FAILURE: rlm_ldap requires: $fail." >&5
-+$as_echo "$as_me: WARNING: FAILURE: rlm_ldap requires: $fail." >&2;}
-               if test x"$headersuggestion" != x; then
--                      { echo "$as_me:$LINENO: WARNING: $headersuggestion" >&5
--echo "$as_me: WARNING: $headersuggestion" >&2;}
-+                      { $as_echo "$as_me:$LINENO: WARNING: $headersuggestion" >&5
-+$as_echo "$as_me: WARNING: $headersuggestion" >&2;}
-               fi
-               if test x"$libsuggestion" != x; then
--                      { echo "$as_me:$LINENO: WARNING: $libsuggestion" >&5
--echo "$as_me: WARNING: $libsuggestion" >&2;}
-+                      { $as_echo "$as_me:$LINENO: WARNING: $libsuggestion" >&5
-+$as_echo "$as_me: WARNING: $libsuggestion" >&2;}
-               fi
-               targetname=""
-       fi
-@@ -3966,11 +4620,12 @@ _ACEOF
-     case $ac_val in #(
-     *${as_nl}*)
-       case $ac_var in #(
--      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
--echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
-+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
-+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
-       esac
-       case $ac_var in #(
-       _ | IFS | as_nl) ;; #(
-+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-       *) $as_unset $ac_var ;;
-       esac ;;
-     esac
-@@ -4003,12 +4658,12 @@ echo "$as_me: WARNING: Cache variable $a
- if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
-   if test -w "$cache_file"; then
-     test "x$cache_file" != "x/dev/null" &&
--      { echo "$as_me:$LINENO: updating cache $cache_file" >&5
--echo "$as_me: updating cache $cache_file" >&6;}
-+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
-+$as_echo "$as_me: updating cache $cache_file" >&6;}
-     cat confcache >$cache_file
-   else
--    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
--echo "$as_me: not updating unwritable cache $cache_file" >&6;}
-+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
-   fi
- fi
- rm -f confcache
-@@ -4025,6 +4680,12 @@ test "x$exec_prefix" = xNONE && exec_pre
- # take arguments), then branch to the quote section.  Otherwise,
- # look for a macro that doesn't take arguments.
- ac_script='
-+:mline
-+/\\$/{
-+ N
-+ s,\\\n,,
-+ b mline
-+}
- t clear
- :clear
- s/^[   ]*#[    ]*define[       ][      ]*\([^  (][^    (]*([^)]*)\)[   ]*\(.*\)/-D\1=\2/g
-@@ -4054,7 +4715,7 @@ ac_ltlibobjs=
- for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
-   # 1. Remove the extension, and $U if already installed.
-   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
--  ac_i=`echo "$ac_i" | sed "$ac_script"`
-+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
-   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
-   #    will be set to the directory where LIBOBJS objects are built.
-   ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
-@@ -4067,11 +4728,12 @@ LTLIBOBJS=$ac_ltlibobjs
- : ${CONFIG_STATUS=./config.status}
-+ac_write_fail=0
- ac_clean_files_save=$ac_clean_files
- ac_clean_files="$ac_clean_files $CONFIG_STATUS"
--{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
--echo "$as_me: creating $CONFIG_STATUS" >&6;}
--cat >$CONFIG_STATUS <<_ACEOF
-+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- #! $SHELL
- # Generated by $as_me.
- # Run this file to recreate the current configuration.
-@@ -4084,7 +4746,7 @@ ac_cs_silent=false
- SHELL=\${CONFIG_SHELL-$SHELL}
- _ACEOF
--cat >>$CONFIG_STATUS <<\_ACEOF
-+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- ## --------------------- ##
- ## M4sh Initialization.  ##
- ## --------------------- ##
-@@ -4094,7 +4756,7 @@ DUALCASE=1; export DUALCASE # for MKS sh
- if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-   emulate sh
-   NULLCMD=:
--  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-   # is contrary to our usage.  Disable this feature.
-   alias -g '${1+"$@"}'='"$@"'
-   setopt NO_GLOB_SUBST
-@@ -4116,17 +4778,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTE
- as_cr_digits='0123456789'
- as_cr_alnum=$as_cr_Letters$as_cr_digits
--# The user is always right.
--if test "${PATH_SEPARATOR+set}" != set; then
--  echo "#! /bin/sh" >conf$$.sh
--  echo  "exit 0"   >>conf$$.sh
--  chmod +x conf$$.sh
--  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
--    PATH_SEPARATOR=';'
-+as_nl='
-+'
-+export as_nl
-+# Printing a long string crashes Solaris 7 /usr/bin/printf.
-+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-+  as_echo='printf %s\n'
-+  as_echo_n='printf %s'
-+else
-+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-+    as_echo_n='/usr/ucb/echo -n'
-   else
--    PATH_SEPARATOR=:
-+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-+    as_echo_n_body='eval
-+      arg=$1;
-+      case $arg in
-+      *"$as_nl"*)
-+      expr "X$arg" : "X\\(.*\\)$as_nl";
-+      arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-+      esac;
-+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-+    '
-+    export as_echo_n_body
-+    as_echo_n='sh -c $as_echo_n_body as_echo'
-   fi
--  rm -f conf$$.sh
-+  export as_echo_body
-+  as_echo='sh -c $as_echo_body as_echo'
-+fi
-+
-+# The user is always right.
-+if test "${PATH_SEPARATOR+set}" != set; then
-+  PATH_SEPARATOR=:
-+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-+      PATH_SEPARATOR=';'
-+  }
- fi
- # Support unset when possible.
-@@ -4142,8 +4832,6 @@ fi
- # there to prevent editors from complaining about space-tab.
- # (If _AS_PATH_WALK were called with IFS unset, it would disable word
- # splitting by setting IFS to empty value.)
--as_nl='
--'
- IFS=" ""      $as_nl"
- # Find who we are.  Look in the path if we contain no directory separator.
-@@ -4166,7 +4854,7 @@ if test "x$as_myself" = x; then
-   as_myself=$0
- fi
- if test ! -f "$as_myself"; then
--  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-   { (exit 1); exit 1; }
- fi
-@@ -4179,17 +4867,10 @@ PS2='> '
- PS4='+ '
- # NLS nuisances.
--for as_var in \
--  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
--  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
--  LC_TELEPHONE LC_TIME
--do
--  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
--    eval $as_var=C; export $as_var
--  else
--    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
--  fi
--done
-+LC_ALL=C
-+export LC_ALL
-+LANGUAGE=C
-+export LANGUAGE
- # Required to use basename.
- if expr a : '\(a\)' >/dev/null 2>&1 &&
-@@ -4211,7 +4892,7 @@ as_me=`$as_basename -- "$0" ||
- $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-        X"$0" : 'X\(//\)$' \| \
-        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
--echo X/"$0" |
-+$as_echo X/"$0" |
-     sed '/^.*\/\([^/][^/]*\)\/*$/{
-           s//\1/
-           q
-@@ -4262,7 +4943,7 @@ $as_unset CDPATH
-       s/-\n.*//
-     ' >$as_me.lineno &&
-   chmod +x "$as_me.lineno" ||
--    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-    { (exit 1); exit 1; }; }
-   # Don't try to exec as it changes $[0], causing all sort of problems
-@@ -4290,7 +4971,6 @@ case `echo -n x` in
- *)
-   ECHO_N='-n';;
- esac
--
- if expr a : '\(a\)' >/dev/null 2>&1 &&
-    test "X`expr 00001 : '.*\(...\)'`" = X001; then
-   as_expr=expr
-@@ -4303,19 +4983,22 @@ if test -d conf$$.dir; then
-   rm -f conf$$.dir/conf$$.file
- else
-   rm -f conf$$.dir
--  mkdir conf$$.dir
-+  mkdir conf$$.dir 2>/dev/null
- fi
--echo >conf$$.file
--if ln -s conf$$.file conf$$ 2>/dev/null; then
--  as_ln_s='ln -s'
--  # ... but there are two gotchas:
--  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
--  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
--  # In both cases, we have to default to `cp -p'.
--  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-+if (echo >conf$$.file) 2>/dev/null; then
-+  if ln -s conf$$.file conf$$ 2>/dev/null; then
-+    as_ln_s='ln -s'
-+    # ... but there are two gotchas:
-+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-+    # In both cases, we have to default to `cp -p'.
-+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-+      as_ln_s='cp -p'
-+  elif ln conf$$.file conf$$ 2>/dev/null; then
-+    as_ln_s=ln
-+  else
-     as_ln_s='cp -p'
--elif ln conf$$.file conf$$ 2>/dev/null; then
--  as_ln_s=ln
-+  fi
- else
-   as_ln_s='cp -p'
- fi
-@@ -4340,10 +5023,10 @@ else
-   as_test_x='
-     eval sh -c '\''
-       if test -d "$1"; then
--        test -d "$1/.";
-+      test -d "$1/.";
-       else
-       case $1 in
--        -*)set "./$1";;
-+      -*)set "./$1";;
-       esac;
-       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
-       ???[sx]*):;;*)false;;esac;fi
-@@ -4366,7 +5049,7 @@ exec 6>&1
- # values after options handling.
- ac_log="
- This file was extended by $as_me, which was
--generated by GNU Autoconf 2.61.  Invocation command line was
-+generated by GNU Autoconf 2.63.  Invocation command line was
-   CONFIG_FILES    = $CONFIG_FILES
-   CONFIG_HEADERS  = $CONFIG_HEADERS
-@@ -4379,26 +5062,33 @@ on `(hostname || uname -n) 2>/dev/null |
- _ACEOF
--cat >>$CONFIG_STATUS <<_ACEOF
-+case $ac_config_files in *"
-+"*) set x $ac_config_files; shift; ac_config_files=$*;;
-+esac
-+
-+
-+
-+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- # Files that config.status was made for.
- config_files="$ac_config_files"
- _ACEOF
--cat >>$CONFIG_STATUS <<\_ACEOF
-+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- ac_cs_usage="\
- \`$as_me' instantiates files from templates according to the
- current configuration.
--Usage: $0 [OPTIONS] [FILE]...
-+Usage: $0 [OPTION]... [FILE]...
-   -h, --help       print this help, then exit
-   -V, --version    print version number and configuration settings, then exit
--  -q, --quiet      do not print progress messages
-+  -q, --quiet, --silent
-+                   do not print progress messages
-   -d, --debug      don't remove temporary files
-       --recheck    update $as_me by reconfiguring in the same conditions
--  --file=FILE[:TEMPLATE]
--                 instantiate the configuration file FILE
-+      --file=FILE[:TEMPLATE]
-+                   instantiate the configuration file FILE
- Configuration files:
- $config_files
-@@ -4406,23 +5096,23 @@ $config_files
- Report bugs to <bug-autoconf@gnu.org>."
- _ACEOF
--cat >>$CONFIG_STATUS <<_ACEOF
-+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- ac_cs_version="\\
- config.status
--configured by $0, generated by GNU Autoconf 2.61,
--  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
-+configured by $0, generated by GNU Autoconf 2.63,
-+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
--Copyright (C) 2006 Free Software Foundation, Inc.
-+Copyright (C) 2008 Free Software Foundation, Inc.
- This config.status script is free software; the Free Software Foundation
- gives unlimited permission to copy, distribute and modify it."
- ac_pwd='$ac_pwd'
- srcdir='$srcdir'
-+test -n "\$AWK" || AWK=awk
- _ACEOF
--cat >>$CONFIG_STATUS <<\_ACEOF
--# If no file are specified by the user, then we need to provide default
--# value.  By we need to know if files were specified by the user.
-+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-+# The default lists apply if the user does not specify any file.
- ac_need_defaults=:
- while test $# != 0
- do
-@@ -4444,21 +5134,24 @@ do
-   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-     ac_cs_recheck=: ;;
-   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
--    echo "$ac_cs_version"; exit ;;
-+    $as_echo "$ac_cs_version"; exit ;;
-   --debug | --debu | --deb | --de | --d | -d )
-     debug=: ;;
-   --file | --fil | --fi | --f )
-     $ac_shift
--    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
-+    case $ac_optarg in
-+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
-+    esac
-+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
-     ac_need_defaults=false;;
-   --he | --h |  --help | --hel | -h )
--    echo "$ac_cs_usage"; exit ;;
-+    $as_echo "$ac_cs_usage"; exit ;;
-   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-   | -silent | --silent | --silen | --sile | --sil | --si | --s)
-     ac_cs_silent=: ;;
-   # This is an error.
--  -*) { echo "$as_me: error: unrecognized option: $1
-+  -*) { $as_echo "$as_me: error: unrecognized option: $1
- Try \`$0 --help' for more information." >&2
-    { (exit 1); exit 1; }; } ;;
-@@ -4477,30 +5170,32 @@ if $ac_cs_silent; then
- fi
- _ACEOF
--cat >>$CONFIG_STATUS <<_ACEOF
-+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- if \$ac_cs_recheck; then
--  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
--  CONFIG_SHELL=$SHELL
-+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-+  shift
-+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
-+  CONFIG_SHELL='$SHELL'
-   export CONFIG_SHELL
--  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-+  exec "\$@"
- fi
- _ACEOF
--cat >>$CONFIG_STATUS <<\_ACEOF
-+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- exec 5>>config.log
- {
-   echo
-   sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
- ## Running $as_me. ##
- _ASBOX
--  echo "$ac_log"
-+  $as_echo "$ac_log"
- } >&5
- _ACEOF
--cat >>$CONFIG_STATUS <<_ACEOF
-+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- _ACEOF
--cat >>$CONFIG_STATUS <<\_ACEOF
-+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- # Handling of arguments.
- for ac_config_target in $ac_config_targets
-@@ -4508,8 +5203,8 @@ do
-   case $ac_config_target in
-     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
--  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
--echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
-+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
-    { (exit 1); exit 1; }; };;
-   esac
- done
-@@ -4548,114 +5243,143 @@ $debug ||
-   (umask 077 && mkdir "$tmp")
- } ||
- {
--   echo "$me: cannot create a temporary directory in ." >&2
-+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
-    { (exit 1); exit 1; }
- }
--#
--# Set up the sed scripts for CONFIG_FILES section.
--#
--
--# No need to generate the scripts if there are no CONFIG_FILES.
--# This happens for instance when ./config.status config.h
-+# Set up the scripts for CONFIG_FILES section.
-+# No need to generate them if there are no CONFIG_FILES.
-+# This happens for instance with `./config.status config.h'.
- if test -n "$CONFIG_FILES"; then
--_ACEOF
-+ac_cr='\r'
-+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
-+  ac_cs_awk_cr='\\r'
-+else
-+  ac_cs_awk_cr=$ac_cr
-+fi
-+
-+echo 'BEGIN {' >"$tmp/subs1.awk" &&
-+_ACEOF
-+{
-+  echo "cat >conf$$subs.awk <<_ACEOF" &&
-+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
-+  echo "_ACEOF"
-+} >conf$$subs.sh ||
-+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-+   { (exit 1); exit 1; }; }
-+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
- ac_delim='%!_!# '
- for ac_last_try in false false false false false :; do
--  cat >conf$$subs.sed <<_ACEOF
--SHELL!$SHELL$ac_delim
--PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
--PACKAGE_NAME!$PACKAGE_NAME$ac_delim
--PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
--PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
--PACKAGE_STRING!$PACKAGE_STRING$ac_delim
--PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
--exec_prefix!$exec_prefix$ac_delim
--prefix!$prefix$ac_delim
--program_transform_name!$program_transform_name$ac_delim
--bindir!$bindir$ac_delim
--sbindir!$sbindir$ac_delim
--libexecdir!$libexecdir$ac_delim
--datarootdir!$datarootdir$ac_delim
--datadir!$datadir$ac_delim
--sysconfdir!$sysconfdir$ac_delim
--sharedstatedir!$sharedstatedir$ac_delim
--localstatedir!$localstatedir$ac_delim
--includedir!$includedir$ac_delim
--oldincludedir!$oldincludedir$ac_delim
--docdir!$docdir$ac_delim
--infodir!$infodir$ac_delim
--htmldir!$htmldir$ac_delim
--dvidir!$dvidir$ac_delim
--pdfdir!$pdfdir$ac_delim
--psdir!$psdir$ac_delim
--libdir!$libdir$ac_delim
--localedir!$localedir$ac_delim
--mandir!$mandir$ac_delim
--DEFS!$DEFS$ac_delim
--ECHO_C!$ECHO_C$ac_delim
--ECHO_N!$ECHO_N$ac_delim
--ECHO_T!$ECHO_T$ac_delim
--LIBS!$LIBS$ac_delim
--build_alias!$build_alias$ac_delim
--host_alias!$host_alias$ac_delim
--target_alias!$target_alias$ac_delim
--CC!$CC$ac_delim
--CFLAGS!$CFLAGS$ac_delim
--LDFLAGS!$LDFLAGS$ac_delim
--CPPFLAGS!$CPPFLAGS$ac_delim
--ac_ct_CC!$ac_ct_CC$ac_delim
--EXEEXT!$EXEEXT$ac_delim
--OBJEXT!$OBJEXT$ac_delim
--edir!$edir$ac_delim
--ldap_ldflags!$ldap_ldflags$ac_delim
--ldap_cflags!$ldap_cflags$ac_delim
--targetname!$targetname$ac_delim
--LIBOBJS!$LIBOBJS$ac_delim
--LTLIBOBJS!$LTLIBOBJS$ac_delim
--_ACEOF
-+  . ./conf$$subs.sh ||
-+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-+   { (exit 1); exit 1; }; }
--  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 50; then
-+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
-+  if test $ac_delim_n = $ac_delim_num; then
-     break
-   elif $ac_last_try; then
--    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
--echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-    { (exit 1); exit 1; }; }
-   else
-     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
-   fi
- done
-+rm -f conf$$subs.sh
--ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
--if test -n "$ac_eof"; then
--  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
--  ac_eof=`expr $ac_eof + 1`
--fi
--
--cat >>$CONFIG_STATUS <<_ACEOF
--cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
--/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
--_ACEOF
--sed '
--s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
--s/^/s,@/; s/!/@,|#_!!_#|/
--:n
--t n
--s/'"$ac_delim"'$/,g/; t
--s/$/\\/; p
--N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
--' >>$CONFIG_STATUS <conf$$subs.sed
--rm -f conf$$subs.sed
--cat >>$CONFIG_STATUS <<_ACEOF
--:end
--s/|#_!!_#|//g
--CEOF$ac_eof
-+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
- _ACEOF
-+sed -n '
-+h
-+s/^/S["/; s/!.*/"]=/
-+p
-+g
-+s/^[^!]*!//
-+:repl
-+t repl
-+s/'"$ac_delim"'$//
-+t delim
-+:nl
-+h
-+s/\(.\{148\}\).*/\1/
-+t more1
-+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-+p
-+n
-+b repl
-+:more1
-+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-+p
-+g
-+s/.\{148\}//
-+t nl
-+:delim
-+h
-+s/\(.\{148\}\).*/\1/
-+t more2
-+s/["\\]/\\&/g; s/^/"/; s/$/"/
-+p
-+b
-+:more2
-+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-+p
-+g
-+s/.\{148\}//
-+t delim
-+' <conf$$subs.awk | sed '
-+/^[^""]/{
-+  N
-+  s/\n//
-+}
-+' >>$CONFIG_STATUS || ac_write_fail=1
-+rm -f conf$$subs.awk
-+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-+_ACAWK
-+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
-+  for (key in S) S_is_set[key] = 1
-+  FS = "\a"
-+}
-+{
-+  line = $ 0
-+  nfields = split(line, field, "@")
-+  substed = 0
-+  len = length(field[1])
-+  for (i = 2; i < nfields; i++) {
-+    key = field[i]
-+    keylen = length(key)
-+    if (S_is_set[key]) {
-+      value = S[key]
-+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
-+      len += length(value) + length(field[++i])
-+      substed = 1
-+    } else
-+      len += 1 + keylen
-+  }
-+
-+  print line
-+}
-+
-+_ACAWK
-+_ACEOF
-+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
-+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-+else
-+  cat
-+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
-+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
-+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
-+   { (exit 1); exit 1; }; }
-+_ACEOF
- # VPATH may cause trouble with some makes, so we remove $(srcdir),
- # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-@@ -4672,19 +5396,21 @@ s/^[^=]*=[      ]*$//
- }'
- fi
--cat >>$CONFIG_STATUS <<\_ACEOF
-+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- fi # test -n "$CONFIG_FILES"
--for ac_tag in  :F $CONFIG_FILES
-+eval set X "  :F $CONFIG_FILES      "
-+shift
-+for ac_tag
- do
-   case $ac_tag in
-   :[FHLC]) ac_mode=$ac_tag; continue;;
-   esac
-   case $ac_mode$ac_tag in
-   :[FHL]*:*);;
--  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
--echo "$as_me: error: Invalid tag $ac_tag." >&2;}
-+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
-+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
-    { (exit 1); exit 1; }; };;
-   :[FH]-) ac_tag=-:-;;
-   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
-@@ -4713,26 +5439,38 @@ echo "$as_me: error: Invalid tag $ac_tag
-          [\\/$]*) false;;
-          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
-          esac ||
--         { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
--echo "$as_me: error: cannot find input file: $ac_f" >&2;}
-+         { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
-    { (exit 1); exit 1; }; };;
-       esac
--      ac_file_inputs="$ac_file_inputs $ac_f"
-+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
-+      ac_file_inputs="$ac_file_inputs '$ac_f'"
-     done
-     # Let's still pretend it is `configure' which instantiates (i.e., don't
-     # use $as_me), people would be surprised to read:
-     #    /* config.h.  Generated by config.status.  */
--    configure_input="Generated from "`IFS=:
--        echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
-+    configure_input='Generated from '`
-+        $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
-+      `' by configure.'
-     if test x"$ac_file" != x-; then
-       configure_input="$ac_file.  $configure_input"
--      { echo "$as_me:$LINENO: creating $ac_file" >&5
--echo "$as_me: creating $ac_file" >&6;}
-+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
-+$as_echo "$as_me: creating $ac_file" >&6;}
-     fi
-+    # Neutralize special characters interpreted by sed in replacement strings.
-+    case $configure_input in #(
-+    *\&* | *\|* | *\\* )
-+       ac_sed_conf_input=`$as_echo "$configure_input" |
-+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
-+    *) ac_sed_conf_input=$configure_input;;
-+    esac
-     case $ac_tag in
--    *:-:* | *:-) cat >"$tmp/stdin";;
-+    *:-:* | *:-) cat >"$tmp/stdin" \
-+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-+$as_echo "$as_me: error: could not create $ac_file" >&2;}
-+   { (exit 1); exit 1; }; } ;;
-     esac
-     ;;
-   esac
-@@ -4742,7 +5480,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^
-        X"$ac_file" : 'X\(//\)[^/]' \| \
-        X"$ac_file" : 'X\(//\)$' \| \
-        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
--echo X"$ac_file" |
-+$as_echo X"$ac_file" |
-     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-           s//\1/
-           q
-@@ -4768,7 +5506,7 @@ echo X"$ac_file" |
-     as_dirs=
-     while :; do
-       case $as_dir in #(
--      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
-+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-       *) as_qdir=$as_dir;;
-       esac
-       as_dirs="'$as_qdir' $as_dirs"
-@@ -4777,7 +5515,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/
-        X"$as_dir" : 'X\(//\)[^/]' \| \
-        X"$as_dir" : 'X\(//\)$' \| \
-        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
--echo X"$as_dir" |
-+$as_echo X"$as_dir" |
-     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-           s//\1/
-           q
-@@ -4798,17 +5536,17 @@ echo X"$as_dir" |
-       test -d "$as_dir" && break
-     done
-     test -z "$as_dirs" || eval "mkdir $as_dirs"
--  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
--echo "$as_me: error: cannot create directory $as_dir" >&2;}
-+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
-    { (exit 1); exit 1; }; }; }
-   ac_builddir=.
- case "$ac_dir" in
- .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *)
--  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
-   # A ".." for each directory in $ac_dir_suffix.
--  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
-+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
-   case $ac_top_builddir_sub in
-   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-@@ -4844,12 +5582,13 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_
- _ACEOF
--cat >>$CONFIG_STATUS <<\_ACEOF
-+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- # If the template does not know about datarootdir, expand it.
- # FIXME: This hack should be removed a few years after 2.60.
- ac_datarootdir_hack=; ac_datarootdir_seen=
--case `sed -n '/datarootdir/ {
-+ac_sed_dataroot='
-+/datarootdir/ {
-   p
-   q
- }
-@@ -4858,13 +5597,14 @@ case `sed -n '/datarootdir/ {
- /@infodir@/p
- /@localedir@/p
- /@mandir@/p
--' $ac_file_inputs` in
-+'
-+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
- *datarootdir*) ac_datarootdir_seen=yes;;
- *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
--  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
--echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
- _ACEOF
--cat >>$CONFIG_STATUS <<_ACEOF
-+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-   ac_datarootdir_hack='
-   s&@datadir@&$datadir&g
-   s&@docdir@&$docdir&g
-@@ -4878,15 +5618,16 @@ _ACEOF
- # Neutralize VPATH when `$srcdir' = `.'.
- # Shell code in configure.ac might set extrasub.
- # FIXME: do we really want to maintain this feature?
--cat >>$CONFIG_STATUS <<_ACEOF
--  sed "$ac_vpsub
-+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-+ac_sed_extra="$ac_vpsub
- $extrasub
- _ACEOF
--cat >>$CONFIG_STATUS <<\_ACEOF
-+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- :t
- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
--s&@configure_input@&$configure_input&;t t
-+s|@configure_input@|$ac_sed_conf_input|;t t
- s&@top_builddir@&$ac_top_builddir_sub&;t t
-+s&@top_build_prefix@&$ac_top_build_prefix&;t t
- s&@srcdir@&$ac_srcdir&;t t
- s&@abs_srcdir@&$ac_abs_srcdir&;t t
- s&@top_srcdir@&$ac_top_srcdir&;t t
-@@ -4895,21 +5636,28 @@ s&@builddir@&$ac_builddir&;t t
- s&@abs_builddir@&$ac_abs_builddir&;t t
- s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
- $ac_datarootdir_hack
--" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
-+"
-+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-+$as_echo "$as_me: error: could not create $ac_file" >&2;}
-+   { (exit 1); exit 1; }; }
- test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-   { ac_out=`sed -n '/^[        ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
--  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
- which seems to be undefined.  Please make sure it is defined." >&5
--echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
- which seems to be undefined.  Please make sure it is defined." >&2;}
-   rm -f "$tmp/stdin"
-   case $ac_file in
--  -) cat "$tmp/out"; rm -f "$tmp/out";;
--  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
--  esac
-+  -) cat "$tmp/out" && rm -f "$tmp/out";;
-+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
-+  esac \
-+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-+$as_echo "$as_me: error: could not create $ac_file" >&2;}
-+   { (exit 1); exit 1; }; }
-  ;;
-@@ -4924,6 +5672,11 @@ _ACEOF
- chmod +x $CONFIG_STATUS
- ac_clean_files=$ac_clean_files_save
-+test $ac_write_fail = 0 ||
-+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
-+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
-+   { (exit 1); exit 1; }; }
-+
- # configure is writing to config.log, and then calls config.status.
- # config.status does its own redirection, appending to config.log.
-@@ -4945,5 +5698,9 @@ if test "$no_create" != yes; then
-   # would make configure fail if this is the last instruction.
-   $ac_cs_success || { (exit 1); exit 1; }
- fi
-+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
-+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-+fi
-Index: freeradius-server-2.2.7/src/modules/rlm_ldap/configure.in
-===================================================================
---- freeradius-server-2.2.7.orig/src/modules/rlm_ldap/configure.in
-+++ freeradius-server-2.2.7/src/modules/rlm_ldap/configure.in
-@@ -87,6 +87,9 @@ if test x$with_[]modname != xno; then
-                        )
-       fi
-+      FR_SMART_CHECK_LIB(sasl, sasl_encode)
-+      FR_SMART_CHECK_LIB(lber, ber_init)
-+
-       dnl Try only "-lldap_r" or "-lldap"
-       dnl Static linking will probably not work, but nobody ever
-       dnl complained about it.
diff --git a/net/freeradius2/patches/008-honor_ccpflags.patch b/net/freeradius2/patches/008-honor_ccpflags.patch
deleted file mode 100644 (file)
index 7e6d81e..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-Index: freeradius-server-2.2.7/src/modules/rules.mak
-===================================================================
---- freeradius-server-2.2.7.orig/src/modules/rules.mak
-+++ freeradius-server-2.2.7/src/modules/rules.mak
-@@ -63,10 +63,10 @@ $(LT_OBJS): $(SERVER_HEADERS)
- #
- #######################################################################
- %.lo: %.c
--      $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) $(RLM_CFLAGS) -c $<
-+      $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) $(CPPFLAGS) $(RLM_CFLAGS) -c $<
- %.lo: %.cpp
--      $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(CFLAGS) $(RLM_CFLAGS) -c $<
-+      $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(CFLAGS) $(CPPFLAGS) $(RLM_CFLAGS) -c $<
- ifneq ($(TARGET),)
- #######################################################################
diff --git a/net/freeradius2/patches/010-disbale-openssl-check.patch b/net/freeradius2/patches/010-disbale-openssl-check.patch
deleted file mode 100644 (file)
index 483221d..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-Index: freeradius-server-2.2.7/configure.in
-===================================================================
---- freeradius-server-2.2.7.orig/configure.in
-+++ freeradius-server-2.2.7/configure.in
-@@ -820,35 +820,6 @@ if test "x$WITH_OPENSSL" = xyes; then
-     OPENSSL_INCLUDE="-DOPENSSL_NO_KRB5"
-   fi
--  dnl #
--  dnl #  Now check that the header versions match the library
--  dnl #
--  AC_MSG_CHECKING([OpenSSL library and header version consistency])
--  AC_RUN_IFELSE(
--    [AC_LANG_PROGRAM(
--      [[
--        #include <stdio.h>
--        #include <openssl/opensslv.h>
--        #include <openssl/crypto.h>
--      ]],
--      [[
--        if (SSLeay() == OPENSSL_VERSION_NUMBER) {
--          return 0;
--        } else {
--          printf("library: %lx header: %lx... ", (unsigned long) SSLeay(), (unsigned long) OPENSSL_VERSION_NUMBER);
--          return 1;
--        }
--      ]]
--    )],
--    [
--      AC_MSG_RESULT(yes)
--    ],
--    [
--      AC_MSG_RESULT(no)
--      AC_MSG_FAILURE([OpenSSL library version does not match header version])
--    ]
--  )
--
-   if test "x$OPENSSL_LIBS" = x; then
-     LIBS=$old_LIBS
-     LDFLAGS="$old_LDFLAGS"
index ee0e62300a32c663ef5f1716fd799f5459ee6424..940e811baf9d3825e346fd45d7c486ba36530254 100644 (file)
@@ -7,6 +7,10 @@ config FWKNOPD_GPG
        select PACKAGE_gnupg
        default n
 
+config FWKNOPD_NFQ_CAPTURE
+       bool "Enable netfilter_queue capture support (disables libpcap support)"
+       select PACKAGE_iptables-mod-nfqueue
+       default n
 
 
 endmenu
index 8ad6fc6de3ac15b873abd41e6d3454fa616f026e..cbe221196b559c51f44b72c8dc286726d85f6968 100644 (file)
@@ -9,11 +9,12 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fwknop
 PKG_VERSION:=2.6.9
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.cipherdyne.org/fwknop/download
 PKG_MD5SUM:=e2c49e9674888a028bd443a55c3aaa22
+PKG_HASH:=5bf47fe1fd30e862d29464f762c0b8bf89b5e298665c37624d6707826da956d4
 PKG_MAINTAINER:=Jonathan Bennett <JBennett@incomsystems.biz>
 PKG_LICENSE:=GPLv2
 PKG_INSTALL:=1
@@ -42,7 +43,8 @@ define Package/fwknopd
   CATEGORY:=Network
   SUBMENU:=Firewall
   TITLE+= Daemon
-  DEPENDS:=+iptables +libfko +libpcap +FWKNOP_GPG:gnupg
+  DEPENDS:=+iptables +libfko +!FWKNOPD_NFQ_CAPTURE:libpcap +FWKNOPD_NFQ_CAPTURE:iptables-mod-nfqueue +FWKNOP_GPG:gnupg \
+       +FWKNOPD_NFQ_CAPTURE:libnetfilter-queue +FWKNOPD_NFQ_CAPTURE:libnfnetlink
 endef
 
 define Package/fwknopd/description
@@ -92,6 +94,10 @@ ifneq ($(CONFIG_FWKNOPD_GPG),y)
        CONFIGURE_ARGS += --without-gpgme 
 endif
 
+ifeq ($(CONFIG_FWKNOPD_NFQ_CAPTURE),y)
+       CONFIGURE_ARGS += --enable-nfq-capture 
+endif
+
 CONFIGURE_ARGS += \
        --with-iptables=/usr/sbin/iptables
 
index c342c20b29fff37174f059dda0ead306dd1e6ff6..baf81b8da63935c60dfc6adaf4db35385d643bb1 100644 (file)
@@ -12,7 +12,12 @@ FWKNOPD_BIN=/usr/sbin/fwknopd
 start()
 {
        gen_confs
-        $FWKNOPD_BIN 
+       if [ $UCI_ENABLED ]; then
+               $FWKNOPD_BIN -c /var/etc/fwknopd.conf -a /var/etc/access.conf 
+       else
+               $FWKNOPD_BIN 
+       fi
+
 }
 
 stop()
@@ -51,10 +56,10 @@ gen_confs()
                                local option="$1"
                                local value="$2"
                                if [ "$option" = "uci_enabled" ] && [ "$value" -eq 1 ] ; then
-                                       > /etc/fwknop/fwknopd.conf
-                                       > /etc/fwknop/access.conf
-                                        chmod 600 /etc/fwknop/fwknopd.conf
-                                        chmod 600 /etc/fwknop/access.conf
+                                       > /var/etc/fwknopd.conf
+                                       > /var/etc/access.conf
+                                        chmod 600 /var/etc/fwknopd.conf
+                                        chmod 600 /var/etc/access.conf
                                        UCI_ENABLED=1
                                fi
                        }
@@ -63,20 +68,20 @@ gen_confs()
                                local option="$1"
                                local value="$2"
                                if [ $UCI_ENABLED ]; then
-                                       echo "$option $value" >> /etc/fwknop/fwknopd.conf  #writing each option to fwknopd.conf
+                                       echo "$option $value" >> /var/etc/fwknopd.conf  #writing each option to fwknopd.conf
                                fi
                        }
                elif [ "$type" = "access" ]
                then
                        if [ -f /tmp/access.conf.tmp ] ; then
-                               cat /tmp/access.conf.tmp >> /etc/fwknop/access.conf
+                               cat /tmp/access.conf.tmp >> /var/etc/access.conf
                                rm /tmp/access.conf.tmp
                        fi
                        option_cb() {
                                local option="$1"
                                local value="$2"
                                if [ $UCI_ENABLED ] && [ $option = "SOURCE" ]; then
-                                       echo "$option $value" >> /etc/fwknop/access.conf  #writing each option to access.conf
+                                       echo "$option $value" >> /var/etc/access.conf  #writing each option to access.conf
                                fi
                                if [ $UCI_ENABLED ] && [ $option != "SOURCE" ]; then
                                        echo "$option $value" >> /tmp/access.conf.tmp  #writing each option to access.conf
@@ -88,7 +93,7 @@ gen_confs()
        if [ -f /etc/config/fwknopd ]; then
                config_load fwknopd
                if [ -f /tmp/access.conf.tmp ] ; then
-                       cat /tmp/access.conf.tmp >> /etc/fwknop/access.conf
+                       cat /tmp/access.conf.tmp >> /var/etc/access.conf
                        rm /tmp/access.conf.tmp
                fi
        fi
index bc4720c7d0d75d90ddaa66cfff643ffbf094c76e..387701262e07bf7029a6e81a92cfff45a57811fb 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=git
-PKG_VERSION:=2.10.2
+PKG_VERSION:=2.11.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/software/scm/git/
-PKG_MD5SUM:=3cd1dca37be60668f482545716923b72
+PKG_MD5SUM:=dd4e3360e28aec5bb902fb34dd7fce3b
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
index 8d24f1dae8afc0e141b0828101e2e8328e48566b..3dead69587fb12cce5cb4ece7d5b0773f42d2156 100644 (file)
@@ -1,20 +1,10 @@
-#
-# Copyright (C) 2016 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:=gnunet
-PKG_SOURCE_VERSION:=948983f991c6fa623cf008826b62a6142dafa189
-PKG_VERSION:=0.10.2-git-20161127-$(PKG_SOURCE_VERSION)
+PKG_SOURCE_VERSION:=a4295da3df82817ff2fe1fa547374a96a2e0280b
+PKG_VERSION:=0.10.2-git-20170111-$(PKG_SOURCE_VERSION)
 PKG_RELEASE:=1
 
-# ToDo:
-#  - package testing stuff
-
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://gnunet.org/git/gnunet.git
@@ -37,7 +27,10 @@ CONFIGURE_ARGS+= \
        --with-ltdl \
        $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mysql),--with-mysql="$(STAGING_DIR)/usr",--without-mysql) \
        $(if $(CONFIG_PACKAGE_$(PKG_NAME)-pgsql),--with-postgresql="$(STAGING_DIR)/usr/bin/pg_config",--without-postgresql) \
-       $(if $(CONFIG_PACKAGE_$(PKG_NAME)-sqlite),--with-sqlite="$(STAGING_DIR)/usr",--without-sqlite) \
+       $(if $(CONFIG_PACKAGE_libsqlite3),--with-sqlite="$(STAGING_DIR)/usr",--without-sqlite) \
+       --disable-testing \
+       --disable-testruns \
+       --disable-wachs \
        --enable-experimental \
        --with-extractor=$(STAGING_DIR)/usr \
        --with-gnutls=$(STAGING_DIR)/usr \
@@ -139,13 +132,13 @@ define Package/gnunet/install
        $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/gnunet/libexec
        $(INSTALL_DIR) $(1)/usr/share/gnunet/config.d $(1)/usr/share/gnunet/hellos
 
-       ( for bin in arm ats cadet core config ecc identity nat nat-server nse \
+       ( for bin in arm ats cadet core config ecc identity nat nat-auto nat-server nse \
            peerinfo revocation scalarproduct statistics transport uri; do \
                $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$bin $(1)/usr/bin/ ; \
        done )
 
        ( for lib in arm ats block cadet core datacache dht \
-           dns dnsparser fragmentation friends hello identity nat natnew nse \
+           dns dnsparser fragmentation friends hello identity natauto natnew nse \
            peerinfo regexblock regex revocation scalarproduct set \
            statistics transport util; do \
                $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$lib.so* $(1)/usr/lib/ ; \
@@ -158,8 +151,8 @@ define Package/gnunet/install
 
        ( for lex in daemon-topology helper-nat-client \
            helper-nat-server service-arm service-ats service-cadet \
-           service-core service-dht service-identity service-nse \
-           service-peerinfo service-regex \
+           service-core service-dht service-identity service-nat service-nat-auto \
+           service-nse service-peerinfo service-regex \
            service-revocation service-scalarproduct-alice \
            service-scalarproduct-bob service-scalarproduct-ecc-alice \
            service-scalarproduct-ecc-bob service-set service-statistics \
@@ -167,8 +160,8 @@ define Package/gnunet/install
                $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$lex $(1)/usr/lib/gnunet/libexec ; \
        done )
 
-       ( for conf in arm ats cadet core datacache dht identity \
-           nat nse peerinfo regex revocation scalarproduct \
+       ( for conf in arm ats cadet core datacache dht identity identity-provider \
+           nat nat-auto nse peerinfo regex revocation scalarproduct \
            set statistics topology transport util; do \
                $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$conf.conf $(1)/usr/share/gnunet/config.d ; \
        done )
@@ -232,9 +225,9 @@ DEPENDS_gns:=+gnunet-vpn +iptables-mod-extra
 USERID_gns:=gnunet=958:gnunetdns=452
 BIN_gns:=gns gns-import.sh namecache namestore resolver
 LIB_gns:=gns gnsrecord namecache namestore
-PLUGIN_gns:=block_dns block_gns gnsrecord_dns gnsrecord_gns
-LIBEXEC_gns:=dns2gns helper-dns service-dns service-gns service-namecache service-namestore service-resolver
-CONF_gns:=dns gns namecache namestore resolver
+PLUGIN_gns:=block_dns block_gns gnsrecord_dns gnsrecord_gns gnsrecord_identity
+LIBEXEC_gns:=dns2gns helper-dns service-dns service-gns service-namecache service-namestore service-resolver service-zonemaster
+CONF_gns:=dns gns namecache namestore resolver zonemaster
 
 DEPENDS_namestore-fcfsd:=+gnunet-gns +libmicrohttpd
 LIBEXEC_namestore-fcfsd:=namestore-fcfsd
@@ -313,24 +306,21 @@ DEPENDS_social-pgsql:=+gnunet-pgsql +gnunet-social
 PLUGIN_social-pgsql:=psycstore_postgres
 CONFLICTS_social-pgsql:=gnunet-social-sqlite gnunet-social-mysql
 
-DEPENDS_sqlite:=+libsqlite3
-
-DEPENDS_gns-sqlite:=+gnunet-sqlite +gnunet-gns
+DEPENDS_gns-sqlite:=+libsqlite3 +gnunet-gns
 PLUGIN_gns-sqlite:=namecache_sqlite namestore_sqlite
 CONFLICTS_gns-sqlite:=gnunet-gns-flat
 
-DEPENDS_peerstore-sqlite:=+gnunet-sqlite +gnunet-peerstore
+DEPENDS_peerstore-sqlite:=+libsqlite3 +gnunet-peerstore
 PLUGIN_peerstore-sqlite:=peerstore_sqlite
 CONFLICTS_peerstore-sqlite:=gnunet-peerstore-flat
 
-DEPENDS_dhtcache-sqlite:=+gnunet-sqlite
+DEPENDS_dhtcache-sqlite:=+libsqlite3
 PLUGIN_dhtcache-sqlite:=datacache_sqlite
 
-DEPENDS_fs-sqlite:=+gnunet-sqlite +gnunet-datastore
+DEPENDS_fs-sqlite:=+libsqlite3 +gnunet-datastore
 PLUGIN_fs-sqlite:=datastore_sqlite
-LIBEXEC_fs-sqlite:=daemon-latency-logger
 
-DEPENDS_social-sqlite:=+gnunet-sqlite +gnunet-social
+DEPENDS_social-sqlite:=+libsqlite3 +gnunet-social
 PLUGIN_social-sqlite:=psycstore_sqlite
 
 DEPENDS_transport-bluetooth:=+bluez-libs
@@ -338,7 +328,7 @@ PLUGIN_transport-bluetooth:=transport_bluetooth
 LIBEXEC_transport-bluetooth:=helper-transport-bluetooth
 
 DEPENDS_utils:=+certtool +openssl-util
-BIN_utils:=gns-proxy-setup-ca transport-certificate-creation scrypt
+BIN_utils:=gns-proxy-setup-ca transport-certificate-creation
 
 DEPENDS_vpn:=+kmod-tun +iptables +firewall
 BIN_vpn:=vpn
@@ -417,7 +407,6 @@ $(eval $(call BuildComponent,dhtcache-pgsql,PostgreSQL dhtcache plugin,))
 $(eval $(call BuildComponent,fs-pgsql,PostgreSQL filesharing plugin,))
 $(eval $(call BuildComponent,gns-pgsql,PostgreSQL GNS plugins,))
 $(eval $(call BuildComponent,social-pgsql,PostgreSQL social plugin,))
-$(eval $(call BuildComponent,sqlite,libsqlite3 storage backends,))
 $(eval $(call BuildComponent,dhtcache-sqlite,libsqlite3 dhtcache plugin,))
 $(eval $(call BuildComponent,fs-sqlite,libsqlite3 filesharing plugin,))
 $(eval $(call BuildComponent,gns-sqlite,libsqlite3 gns plugins,))
index bb2dce9c4ff0e78409000110b0b324657334d71e..830633f72d6e44e9adb422a83605a6f55af6a410 100644 (file)
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=haproxy
-PKG_VERSION:=1.6.9
-PKG_RELEASE:=31
+PKG_VERSION:=1.7.5
+PKG_RELEASE:=01
 
 PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://haproxy.1wt.eu/download/1.6/src/
-PKG_MD5SUM:=c52eee40eb66f290d6f089c339b9d2b3
+PKG_SOURCE_URL:=http://www.haproxy.org/download/1.7/src/
+PKG_MD5SUM:=ed84c80cb97852d2aa3161ed16c48a1c
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_LICENSE:=GPL-2.0
@@ -51,7 +51,7 @@ define Package/haproxy/Default/description
 endef
 
 define Package/haproxy
-  DEPENDS+= +libpcre +libltdl +zlib +libpthread +libopenssl +ncurses +libreadline +@OPENSSL_WITH_DEPRECATED +@OPENSSL_WITH_EC +@OPENSSL_WITH_EC2M  +@OPENSSL_WITH_DTLS +@OPENSSL_WITH_COMPRESSION +@OPENSSL_WITH_NPN  +@OPENSSL_WITH_PSK +@OPENSSL_WITH_SRP +@OPENSSL_ENGINE_DIGEST +@OPENSSL_ENGINE_CRYPTO
+  DEPENDS+= +libpcre +libltdl +zlib +libpthread +libopenssl +libncursesw +libreadline +@OPENSSL_WITH_DEPRECATED +@OPENSSL_WITH_EC +@OPENSSL_WITH_EC2M  +@OPENSSL_WITH_DTLS +@OPENSSL_WITH_COMPRESSION +@OPENSSL_WITH_NPN  +@OPENSSL_WITH_PSK +@OPENSSL_WITH_SRP +@OPENSSL_ENGINE_DIGEST +@OPENSSL_ENGINE_CRYPTO
 
   TITLE+= (with SSL support)
   VARIANT:=ssl
@@ -120,16 +120,16 @@ define Build/Compile
        $(MAKE) TARGET=$(LINUX_TARGET) -C $(PKG_BUILD_DIR) \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                CC="$(TARGET_CC)" \
-               $(ADDON)
-               CFLAGS="$(TARGET_CFLAGS) -fno-align-jumps -fno-align-functions -fno-align-labels -fno-align-loops -pipe -fomit-frame-pointer -fhonour-copts" \
-               LD="$(TARGET_LD)" \
-               LDFLAGS="$(TARGET_LDFLAGS) -lcurses -lreadline" \
                PCREDIR="$(STAGING_DIR)/usr/include" \
                SMALL_OPTS="-DBUFSIZE=16384 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=165530 " \
                USE_LINUX_TPROXY=1 USE_LINUX_SPLICE=1 USE_REGPARM=1 \
-               USE_ZLIB=yes USE_PCRE=1 \
+               USE_ZLIB=yes USE_PCRE=1 USE_PCRE_JIT=1\
                VERSION="$(PKG_VERSION)-patch$(PKG_RELEASE)" \
-               IGNOREGIT=1
+               $(ADDON)
+               CFLAGS="$(TARGET_CFLAGS) -fno-align-jumps -fno-align-functions -fno-align-labels -fno-align-loops -pipe -fomit-frame-pointer -fhonour-copts" \
+               LD="$(TARGET_LD)" \
+               LDFLAGS="$(TARGET_LDFLAGS) -lcurses -lreadline" \
+               GNOREGIT=1
 
        $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
                DESTDIR="$(PKG_INSTALL_DIR)" \
diff --git a/net/haproxy/patches/0001-BUG-MINOR-Fix-OSX-compilation-errors.patch b/net/haproxy/patches/0001-BUG-MINOR-Fix-OSX-compilation-errors.patch
deleted file mode 100644 (file)
index 0dd9748..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-From 42ccea00f69abdd1bb748494f7e17d8369ccae31 Mon Sep 17 00:00:00 2001
-From: Dinko Korunic <dinko.korunic@gmail.com>
-Date: Fri, 9 Sep 2016 09:41:15 +0200
-Subject: [PATCH 01/26] BUG/MINOR: Fix OSX compilation errors
-
-SOL_IPV6 is not defined on OSX, breaking the compile. Also libcrypt is
-not available for installation neither in Macports nor as a Brew recipe,
-so we're disabling implicit dependancy.
-
-Signed-off-by: Dinko Korunic <dinko.korunic@gmail.com>
-(cherry picked from commit 7276f3aa3d687fca64bb9becc66c8e0dbb8b378a)
----
- Makefile        | 1 -
- src/proto_tcp.c | 4 ++--
- 2 files changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 1bf778d..1d0f2bc 100644
---- a/Makefile
-+++ b/Makefile
-@@ -301,7 +301,6 @@ ifeq ($(TARGET),osx)
-   USE_POLL       = implicit
-   USE_KQUEUE     = implicit
-   USE_TPROXY     = implicit
--  USE_LIBCRYPT   = implicit
- else
- ifeq ($(TARGET),openbsd)
-   # This is for OpenBSD >= 3.0
-diff --git a/src/proto_tcp.c b/src/proto_tcp.c
-index 2c81fb4..4f5d88d 100644
---- a/src/proto_tcp.c
-+++ b/src/proto_tcp.c
-@@ -206,7 +206,7 @@ int tcp_bind_socket(int fd, int flags, struct sockaddr_storage *local, struct so
-       case AF_INET6:
-               if (flags && ip6_transp_working) {
-                       if (0
--#if defined(IPV6_TRANSPARENT)
-+#if defined(IPV6_TRANSPARENT) && defined(SOL_IPV6)
-                           || (setsockopt(fd, SOL_IPV6, IPV6_TRANSPARENT, &one, sizeof(one)) == 0)
- #endif
- #if defined(IP_FREEBIND)
-@@ -854,7 +854,7 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
-               break;
-               case AF_INET6:
-                       if (1
--#if defined(IPV6_TRANSPARENT)
-+#if defined(IPV6_TRANSPARENT) && defined(SOL_IPV6)
-                           && (setsockopt(fd, SOL_IPV6, IPV6_TRANSPARENT, &one, sizeof(one)) == -1)
- #endif
- #if defined(IP_FREEBIND)
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0002-BUG-MINOR-displayed-PCRE-version-is-running-release.patch b/net/haproxy/patches/0002-BUG-MINOR-displayed-PCRE-version-is-running-release.patch
deleted file mode 100644 (file)
index 750eb55..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-From 3a011f15a8d61cd0088cc0e46743bdc7699db1af Mon Sep 17 00:00:00 2001
-From: Lukas Tribus <luky-37@hotmail.com>
-Date: Mon, 12 Sep 2016 21:42:00 +0000
-Subject: [PATCH 02/26] BUG/MINOR: displayed PCRE version is running release
-
-pcre_version() returns the running PCRE release, not the release
-haproxy was built with.
-
-This simple string fix should be backported to supported releases,
-as the output may be confusing.
-(cherry picked from commit d64788d9c610163756cac6c91220875e51cba3ef)
----
- src/haproxy.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/haproxy.c b/src/haproxy.c
-index d70cf63..44d32b9 100644
---- a/src/haproxy.c
-+++ b/src/haproxy.c
-@@ -347,7 +347,7 @@ void display_build_opts()
- #endif
- #ifdef USE_PCRE
--      printf("Built with PCRE version : %s", pcre_version());
-+      printf("Running on PCRE version : %s", pcre_version());
-       printf("\nPCRE library supports JIT : ");
- #ifdef USE_PCRE_JIT
-       {
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0003-MINOR-show-Built-with-PCRE-version.patch b/net/haproxy/patches/0003-MINOR-show-Built-with-PCRE-version.patch
deleted file mode 100644 (file)
index a5205b9..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-From dcdd2ae7d6809f45c5f6bbe2ba6fe9c70802bb42 Mon Sep 17 00:00:00 2001
-From: Lukas Tribus <luky-37@hotmail.com>
-Date: Mon, 12 Sep 2016 21:42:07 +0000
-Subject: [PATCH 03/26] MINOR: show Built with PCRE version
-
-Inspired by PCRE's pcre_version.c and improved with Willy's
-suggestions. Reusable parts have been added to
-include/common/standard.h.
-(cherry picked from commit dcbc5c5ecf6506b5ad55b98bbec910b29f011f14)
----
- include/common/standard.h | 9 +++++++++
- src/haproxy.c             | 3 +++
- 2 files changed, 12 insertions(+)
-
-diff --git a/include/common/standard.h b/include/common/standard.h
-index 6098550..26a52ff 100644
---- a/include/common/standard.h
-+++ b/include/common/standard.h
-@@ -1065,4 +1065,13 @@ static inline void *my_realloc2(void *ptr, size_t size)
-       return ret;
- }
-+/* HAP_STRING() makes a string from a literal while HAP_XSTRING() first
-+ * evaluates the argument and is suited to pass macros.
-+ *
-+ * They allow macros like PCRE_MAJOR to be defined without quotes, which
-+ * is convenient for applications that want to test its value.
-+ */
-+#define HAP_STRING(...) #__VA_ARGS__
-+#define HAP_XSTRING(...) HAP_STRING(__VA_ARGS__)
-+
- #endif /* _COMMON_STANDARD_H */
-diff --git a/src/haproxy.c b/src/haproxy.c
-index 44d32b9..37d700b 100644
---- a/src/haproxy.c
-+++ b/src/haproxy.c
-@@ -347,6 +347,9 @@ void display_build_opts()
- #endif
- #ifdef USE_PCRE
-+      printf("Built with PCRE version : %s\n", (HAP_XSTRING(Z PCRE_PRERELEASE)[1] == 0)?
-+              HAP_XSTRING(PCRE_MAJOR.PCRE_MINOR PCRE_DATE) :
-+              HAP_XSTRING(PCRE_MAJOR.PCRE_MINOR) HAP_XSTRING(PCRE_PRERELEASE PCRE_DATE));
-       printf("Running on PCRE version : %s", pcre_version());
-       printf("\nPCRE library supports JIT : ");
- #ifdef USE_PCRE_JIT
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0004-MINOR-show-Running-on-zlib-version.patch b/net/haproxy/patches/0004-MINOR-show-Running-on-zlib-version.patch
deleted file mode 100644 (file)
index c17af47..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-From 9d59ff222cc81ee356594cfa780349dd91376fd9 Mon Sep 17 00:00:00 2001
-From: Lukas Tribus <luky-37@hotmail.com>
-Date: Mon, 12 Sep 2016 21:42:14 +0000
-Subject: [PATCH 04/26] MINOR: show Running on zlib version
-
-(cherry picked from commit 255cc5184dc8483e4377d9de25670bd6e226cdba)
----
- src/haproxy.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/haproxy.c b/src/haproxy.c
-index 37d700b..9f5878a 100644
---- a/src/haproxy.c
-+++ b/src/haproxy.c
-@@ -287,6 +287,7 @@ void display_build_opts()
- #ifdef USE_ZLIB
-       printf("Built with zlib version : " ZLIB_VERSION "\n");
-+      printf("Running on zlib version : %s\n", zlibVersion());
- #elif defined(USE_SLZ)
-       printf("Built with libslz for stateless compression.\n");
- #else /* USE_ZLIB */
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0005-MINOR-Add-fe_req_rate-sample-fetch.patch b/net/haproxy/patches/0005-MINOR-Add-fe_req_rate-sample-fetch.patch
deleted file mode 100644 (file)
index 1e55a6e..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-From 7397526d0c80251b3006b1b45af754f5ad7adb76 Mon Sep 17 00:00:00 2001
-From: Nenad Merdanovic <nmerdan@anine.io>
-Date: Mon, 3 Oct 2016 04:57:37 +0200
-Subject: [PATCH 05/26] MINOR: Add fe_req_rate sample fetch
-
-The fe_req_rate is similar to fe_sess_rate, but fetches the number
-of HTTP requests per second instead of connections/sessions per second.
-
-Signed-off-by: Nenad Merdanovic <nmerdan@anine.io>
-(cherry picked from commit ad9a7e9770e673a70fb56ab95be18bf88666d92a)
----
- doc/configuration.txt |  5 +++++
- src/frontend.c        | 14 ++++++++++++++
- 2 files changed, 19 insertions(+)
-
-diff --git a/doc/configuration.txt b/doc/configuration.txt
-index d4b1744..d18c399 100644
---- a/doc/configuration.txt
-+++ b/doc/configuration.txt
-@@ -12253,6 +12253,11 @@ fe_conn([<frontend>]) : integer
-   statistics to servers in HTTP headers. See also the "dst_conn", "be_conn",
-   "fe_sess_rate" fetches.
-+fe_req_rate([<frontend>]) : integer
-+  Returns an integer value corresponding to the number of HTTP requests per
-+  second sent to a frontend. This number can differ from "fe_sess_rate" in
-+  situations where client-side keep-alive is enabled.
-+
- fe_sess_rate([<frontend>]) : integer
-   Returns an integer value corresponding to the sessions creation rate on the
-   frontend, in number of new sessions per second. This is used with ACLs to
-diff --git a/src/frontend.c b/src/frontend.c
-index 74ec0ab..5cc6202 100644
---- a/src/frontend.c
-+++ b/src/frontend.c
-@@ -167,6 +167,19 @@ smp_fetch_fe_id(const struct arg *args, struct sample *smp, const char *kw, void
-       return 1;
- }
-+/* set temp integer to the number of HTTP requests per second reaching the frontend.
-+ * Accepts exactly 1 argument. Argument is a frontend, other types will cause
-+ * an undefined behaviour.
-+ */
-+static int
-+smp_fetch_fe_req_rate(const struct arg *args, struct sample *smp, const char *kw, void *private)
-+{
-+      smp->flags = SMP_F_VOL_TEST;
-+      smp->data.type = SMP_T_SINT;
-+      smp->data.u.sint = read_freq_ctr(&args->data.prx->fe_req_per_sec);
-+      return 1;
-+}
-+
- /* set temp integer to the number of connections per second reaching the frontend.
-  * Accepts exactly 1 argument. Argument is a frontend, other types will cause
-  * an undefined behaviour.
-@@ -200,6 +213,7 @@ smp_fetch_fe_conn(const struct arg *args, struct sample *smp, const char *kw, vo
- static struct sample_fetch_kw_list smp_kws = {ILH, {
-       { "fe_conn",      smp_fetch_fe_conn,      ARG1(1,FE), NULL, SMP_T_SINT, SMP_USE_INTRN, },
-       { "fe_id",        smp_fetch_fe_id,        0,          NULL, SMP_T_SINT, SMP_USE_FTEND, },
-+      { "fe_req_rate",  smp_fetch_fe_req_rate,  ARG1(1,FE), NULL, SMP_T_SINT, SMP_USE_INTRN, },
-       { "fe_sess_rate", smp_fetch_fe_sess_rate, ARG1(1,FE), NULL, SMP_T_SINT, SMP_USE_INTRN, },
-       { /* END */ },
- }};
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0006-MEDIUM-make-SO_REUSEPORT-configurable.patch b/net/haproxy/patches/0006-MEDIUM-make-SO_REUSEPORT-configurable.patch
deleted file mode 100644 (file)
index 9965f0f..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-From 3dd981c016ac7ad636ee546c2b9b685f7e8500d4 Mon Sep 17 00:00:00 2001
-From: Lukas Tribus <luky-37@hotmail.com>
-Date: Mon, 12 Sep 2016 21:42:20 +0000
-Subject: [PATCH 06/26] MEDIUM: make SO_REUSEPORT configurable
-
-With Linux officially introducing SO_REUSEPORT support in 3.9 and
-its mainstream adoption we have seen more people running into strange
-SO_REUSEPORT related issues (a process management issue turning into
-hard to diagnose problems because the kernel load-balances between the
-new and an obsolete haproxy instance).
-
-Also some people simply want the guarantee that the bind fails when
-the old process is still bound.
-
-This change makes SO_REUSEPORT configurable, introducing the command
-line argument "-dR" and the noreuseport configuration directive.
-
-A backport to 1.6 should be considered.
-(cherry picked from commit a0bcbdcb04d52c3ca71045f90aac33d9dd7965bf)
----
- doc/configuration.txt  |  5 +++++
- include/types/global.h |  1 +
- src/cfgparse.c         |  5 +++++
- src/haproxy.c          | 10 ++++++++++
- src/proto_tcp.c        |  6 +++---
- 5 files changed, 24 insertions(+), 3 deletions(-)
-
-diff --git a/doc/configuration.txt b/doc/configuration.txt
-index d18c399..e725ce2 100644
---- a/doc/configuration.txt
-+++ b/doc/configuration.txt
-@@ -570,6 +570,7 @@ The following keywords are supported in the "global" section :
-    - nopoll
-    - nosplice
-    - nogetaddrinfo
-+   - noreuseport
-    - spread-checks
-    - server-state-base
-    - server-state-file
-@@ -1090,6 +1091,10 @@ nogetaddrinfo
-   Disables the use of getaddrinfo(3) for name resolving. It is equivalent to
-   the command line argument "-dG". Deprecated gethostbyname(3) will be used.
-+noreuseport
-+  Disables the use of SO_REUSEPORT - see socket(7). It is equivalent to the
-+  command line argument "-dR".
-+
- spread-checks <0..50, in percent>
-   Sometimes it is desirable to avoid sending agent and health checks to
-   servers at exact intervals, for instance when many logical servers are
-diff --git a/include/types/global.h b/include/types/global.h
-index 61f0391..2e24d3f 100644
---- a/include/types/global.h
-+++ b/include/types/global.h
-@@ -63,6 +63,7 @@
- /* platform-specific options */
- #define GTUNE_USE_SPLICE         (1<<4)
- #define GTUNE_USE_GAI            (1<<5)
-+#define GTUNE_USE_REUSEPORT      (1<<6)
- /* Access level for a stats socket */
- #define ACCESS_LVL_NONE     0
-diff --git a/src/cfgparse.c b/src/cfgparse.c
-index 55086fd..f2a104d 100644
---- a/src/cfgparse.c
-+++ b/src/cfgparse.c
-@@ -662,6 +662,11 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
-                       goto out;
-               global.tune.options &= ~GTUNE_USE_GAI;
-       }
-+      else if (!strcmp(args[0], "noreuseport")) {
-+              if (alertif_too_many_args(0, file, linenum, args, &err_code))
-+                      goto out;
-+              global.tune.options &= ~GTUNE_USE_REUSEPORT;
-+      }
-       else if (!strcmp(args[0], "quiet")) {
-               if (alertif_too_many_args(0, file, linenum, args, &err_code))
-                       goto out;
-diff --git a/src/haproxy.c b/src/haproxy.c
-index 9f5878a..a657dc4 100644
---- a/src/haproxy.c
-+++ b/src/haproxy.c
-@@ -452,6 +452,9 @@ void usage(char *name)
- #if defined(USE_GETADDRINFO)
-               "        -dG disables getaddrinfo() usage\n"
- #endif
-+#if defined(SO_REUSEPORT)
-+              "        -dR disables SO_REUSEPORT usage\n"
-+#endif
-               "        -dV disables SSL verify on servers side\n"
-               "        -sf/-st [pid ]* finishes/terminates old pids.\n"
-               "\n",
-@@ -623,6 +626,9 @@ void init(int argc, char **argv)
- #if defined(USE_GETADDRINFO)
-       global.tune.options |= GTUNE_USE_GAI;
- #endif
-+#if defined(SO_REUSEPORT)
-+      global.tune.options |= GTUNE_USE_REUSEPORT;
-+#endif
-       pid = getpid();
-       progname = *argv;
-@@ -666,6 +672,10 @@ void init(int argc, char **argv)
-                       else if (*flag == 'd' && flag[1] == 'G')
-                               global.tune.options &= ~GTUNE_USE_GAI;
- #endif
-+#if defined(SO_REUSEPORT)
-+                      else if (*flag == 'd' && flag[1] == 'R')
-+                              global.tune.options &= ~GTUNE_USE_REUSEPORT;
-+#endif
-                       else if (*flag == 'd' && flag[1] == 'V')
-                               global.ssl_server_verify = SSL_SERVER_VERIFY_NONE;
-                       else if (*flag == 'V')
-diff --git a/src/proto_tcp.c b/src/proto_tcp.c
-index 4f5d88d..0f20fde 100644
---- a/src/proto_tcp.c
-+++ b/src/proto_tcp.c
-@@ -824,10 +824,10 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
-               setsockopt(fd, SOL_SOCKET, SO_LINGER, &nolinger, sizeof(struct linger));
- #ifdef SO_REUSEPORT
--      /* OpenBSD supports this. As it's present in old libc versions of Linux,
--       * it might return an error that we will silently ignore.
-+      /* OpenBSD and Linux 3.9 support this. As it's present in old libc versions of
-+       * Linux, it might return an error that we will silently ignore.
-        */
--      if (!ext)
-+      if (!ext && (global.tune.options & GTUNE_USE_REUSEPORT))
-               setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &one, sizeof(one));
- #endif
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0007-BUG-MINOR-vars-use-sess-and-not-s-sess-in-action_sto.patch b/net/haproxy/patches/0007-BUG-MINOR-vars-use-sess-and-not-s-sess-in-action_sto.patch
deleted file mode 100644 (file)
index 1dfe10e..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-From 21877a43afd6300518140c415ccec2dba0a0591f Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Fri, 21 Oct 2016 17:13:24 +0200
-Subject: [PATCH 07/26] BUG/MINOR: vars: use sess and not s->sess in
- action_store()
-
-This causes the stream to be dereferenced when not needed. It will
-cause trouble when variables are used outside of a stream.
-(cherry picked from commit 108a8fd8be0c78a4bf147a2028fd9bda3343c93c)
----
- src/vars.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/vars.c b/src/vars.c
-index 56fade5..b22c3bf 100644
---- a/src/vars.c
-+++ b/src/vars.c
-@@ -507,7 +507,7 @@ static enum act_return action_store(struct act_rule *rule, struct proxy *px,
-       /* Process the expression. */
-       memset(&smp, 0, sizeof(smp));
--      if (!sample_process(px, s->sess, s, dir|SMP_OPT_FINAL,
-+      if (!sample_process(px, sess, s, dir|SMP_OPT_FINAL,
-                           rule->arg.vars.expr, &smp))
-               return ACT_RET_CONT;
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0008-BUG-MINOR-vars-make-smp_fetch_var-more-robust-agains.patch b/net/haproxy/patches/0008-BUG-MINOR-vars-make-smp_fetch_var-more-robust-agains.patch
deleted file mode 100644 (file)
index d381c4b..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-From ff403602edc917b8bef2062dc0d5dec2017e3232 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Fri, 21 Oct 2016 17:14:35 +0200
-Subject: [PATCH 08/26] BUG/MINOR: vars: make smp_fetch_var() more robust
- against misuses
-
-smp_fetch_var() may be called from everywhere since it just reads a
-variable. It must ensure that the stream exists before trying to return
-a stream-dependant variable. For now there is no impact but it will
-cause trouble with tcp-request session rules.
-(cherry picked from commit 7513d001c8a6b7d1cf8e7d5469942cd39d6e8160)
----
- src/vars.c | 16 +++++++++++++---
- 1 file changed, 13 insertions(+), 3 deletions(-)
-
-diff --git a/src/vars.c b/src/vars.c
-index b22c3bf..4a0c4ed 100644
---- a/src/vars.c
-+++ b/src/vars.c
-@@ -242,11 +242,21 @@ static int smp_fetch_var(const struct arg *args, struct sample *smp, const char
-       /* Check the availibity of the variable. */
-       switch (var_desc->scope) {
--      case SCOPE_SESS: vars = &smp->sess->vars;  break;
--      case SCOPE_TXN:  vars = &smp->strm->vars_txn;    break;
-+      case SCOPE_SESS:
-+              vars = &smp->sess->vars;
-+              break;
-+      case SCOPE_TXN:
-+              if (!smp->strm)
-+                      return 0;
-+              vars = &smp->strm->vars_txn;
-+              break;
-       case SCOPE_REQ:
-       case SCOPE_RES:
--      default:         vars = &smp->strm->vars_reqres; break;
-+      default:
-+              if (!smp->strm)
-+                      return 0;
-+              vars = &smp->strm->vars_reqres;
-+              break;
-       }
-       if (vars->scope != var_desc->scope)
-               return 0;
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0009-BUG-MINOR-vars-smp_fetch_var-doesn-t-depend-on-HTTP-.patch b/net/haproxy/patches/0009-BUG-MINOR-vars-smp_fetch_var-doesn-t-depend-on-HTTP-.patch
deleted file mode 100644 (file)
index 59e8c52..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-From 3810ab9e71a19e7f04a9e18580abc77c276d0ff1 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Fri, 21 Oct 2016 17:17:18 +0200
-Subject: [PATCH 09/26] BUG/MINOR: vars: smp_fetch_var() doesn't depend on HTTP
- but on the session
-
-Thus the SMP_USE_HTTP_ANY dependency is incorrect, we have to depend on
-SMP_USE_L5_CLI (the session). It's particularly important for session-wide
-variables which are kept across HTTP requests. For now there is no impact
-but it will make a difference with tcp-request session rules.
-(cherry picked from commit 87846e42a478fe2aa0fbc1e162ba5fb227be49b7)
----
- src/vars.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/vars.c b/src/vars.c
-index 4a0c4ed..a3dd85c 100644
---- a/src/vars.c
-+++ b/src/vars.c
-@@ -654,7 +654,7 @@ static int vars_max_size_reqres(char **args, int section_type, struct proxy *cur
- static struct sample_fetch_kw_list sample_fetch_keywords = {ILH, {
--      { "var", smp_fetch_var, ARG1(1,STR), smp_check_var, SMP_T_STR, SMP_USE_HTTP_ANY },
-+      { "var", smp_fetch_var, ARG1(1,STR), smp_check_var, SMP_T_STR, SMP_USE_L5CLI },
-       { /* END */ },
- }};
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0010-BUG-MINOR-ssl-Check-malloc-return-code.patch b/net/haproxy/patches/0010-BUG-MINOR-ssl-Check-malloc-return-code.patch
deleted file mode 100644 (file)
index 41087ac..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-From 2d7ed4ae91383cd35fe07cd34d01c23b4a5d03f5 Mon Sep 17 00:00:00 2001
-From: "Thierry FOURNIER / OZON.IO" <thierry.fournier@ozon.io>
-Date: Thu, 6 Oct 2016 10:35:29 +0200
-Subject: [PATCH 10/26] BUG/MINOR: ssl: Check malloc return code
-
-If malloc() can't allocate memory and return NULL, a segfaut will raises.
-
-This patch should be backported in the 1.6 and 1.5 version.
-(cherry picked from commit 7a3bd3b9dc43509bb1869389dcf91e35c0155f9b)
----
- src/ssl_sock.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/ssl_sock.c b/src/ssl_sock.c
-index 0535a3b..5f9a203 100644
---- a/src/ssl_sock.c
-+++ b/src/ssl_sock.c
-@@ -1572,6 +1572,8 @@ static int ssl_sock_add_cert_sni(SSL_CTX *ctx, struct bind_conf *s, char *name,
-               int j, len;
-               len = strlen(name);
-               sc = malloc(sizeof(struct sni_ctx) + len + 1);
-+              if (!sc)
-+                      return order;
-               for (j = 0; j < len; j++)
-                       sc->name.key[j] = tolower(name[j]);
-               sc->name.key[len] = 0;
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0011-BUG-MINOR-ssl-prevent-multiple-entries-for-the-same-.patch b/net/haproxy/patches/0011-BUG-MINOR-ssl-prevent-multiple-entries-for-the-same-.patch
deleted file mode 100644 (file)
index 4069bc0..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-From b2b0eab46a8ae36f2dd49159e65c90c1089a0f96 Mon Sep 17 00:00:00 2001
-From: "Thierry FOURNIER / OZON.IO" <thierry.fournier@ozon.io>
-Date: Thu, 6 Oct 2016 10:56:48 +0200
-Subject: [PATCH 11/26] BUG/MINOR: ssl: prevent multiple entries for the same
- certificate
-
-Today, the certificate are indexed int he SNI tree using their CN and the
-list of thier AltNames. So, Some certificates have the same names in the
-CN and one of the AltNames entries.
-
-Typically Let's Encrypt duplicate the the DNS name in the CN and the
-AltName.
-
-This patch prevents the creation of identical entries in the trees. It
-checks the same DNS name and the same SSL context.
-
-If the same certificate is registered two time it will be duplicated.
-
-This patch should be backported in the 1.6 and 1.5 version.
-(cherry picked from commit 07c3d78c2c0693ee37db71c34723597638b6ab3f)
----
- src/ssl_sock.c | 22 +++++++++++++++++++---
- 1 file changed, 19 insertions(+), 3 deletions(-)
-
-diff --git a/src/ssl_sock.c b/src/ssl_sock.c
-index 5f9a203..ad8054d 100644
---- a/src/ssl_sock.c
-+++ b/src/ssl_sock.c
-@@ -1556,6 +1556,7 @@ static int ssl_sock_add_cert_sni(SSL_CTX *ctx, struct bind_conf *s, char *name,
- {
-       struct sni_ctx *sc;
-       int wild = 0, neg = 0;
-+      struct ebmb_node *node;
-       if (*name == '!') {
-               neg = 1;
-@@ -1571,12 +1572,27 @@ static int ssl_sock_add_cert_sni(SSL_CTX *ctx, struct bind_conf *s, char *name,
-       if (*name) {
-               int j, len;
-               len = strlen(name);
-+              for (j = 0; j < len && j < trash.size; j++)
-+                      trash.str[j] = tolower(name[j]);
-+              if (j >= trash.size)
-+                      return order;
-+              trash.str[j] = 0;
-+
-+              /* Check for duplicates. */
-+              if (wild)
-+                      node = ebst_lookup(&s->sni_w_ctx, trash.str);
-+              else
-+                      node = ebst_lookup(&s->sni_ctx, trash.str);
-+              for (; node; node = ebmb_next_dup(node)) {
-+                      sc = ebmb_entry(node, struct sni_ctx, name);
-+                      if (sc->ctx == ctx && sc->neg == neg)
-+                              return order;
-+              }
-+
-               sc = malloc(sizeof(struct sni_ctx) + len + 1);
-               if (!sc)
-                       return order;
--              for (j = 0; j < len; j++)
--                      sc->name.key[j] = tolower(name[j]);
--              sc->name.key[len] = 0;
-+              memcpy(sc->name.key, trash.str, len + 1);
-               sc->ctx = ctx;
-               sc->order = order++;
-               sc->neg = neg;
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0012-BUG-MINOR-systemd-make-the-wrapper-return-a-non-null.patch b/net/haproxy/patches/0012-BUG-MINOR-systemd-make-the-wrapper-return-a-non-null.patch
deleted file mode 100644 (file)
index 16a6de8..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-From 03c706d71e2d314670d2ebb4dfa48fd3b793b361 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Tue, 25 Oct 2016 15:50:47 +0200
-Subject: [PATCH 12/26] BUG/MINOR: systemd: make the wrapper return a non-null
- status code on error
-
-When execv() fails to execute the haproxy executable, it's important to
-return an error instead of pretending everything is cool. This fix should
-be backported to 1.6 and 1.5 in order to improve the overall reliability
-under systemd.
-(cherry picked from commit 7643d09dca4d0eed97ba3c29d4f4fd1f037f96ae)
----
- src/haproxy-systemd-wrapper.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/haproxy-systemd-wrapper.c b/src/haproxy-systemd-wrapper.c
-index d118ec6..a78e75b 100644
---- a/src/haproxy-systemd-wrapper.c
-+++ b/src/haproxy-systemd-wrapper.c
-@@ -94,7 +94,7 @@ static void spawn_haproxy(char **pid_strv, int nb_pid)
-               fprintf(stderr, "\n");
-               execv(argv[0], argv);
--              exit(0);
-+              exit(1);
-       }
- }
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0013-BUG-MINOR-systemd-always-restore-signals-before-exec.patch b/net/haproxy/patches/0013-BUG-MINOR-systemd-always-restore-signals-before-exec.patch
deleted file mode 100644 (file)
index 86c693c..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-From 7a7eada6f4ecfc54325a18cf20c3035994a901c4 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Tue, 25 Oct 2016 16:49:31 +0200
-Subject: [PATCH 13/26] BUG/MINOR: systemd: always restore signals before
- execve()
-
-Since signals are inherited, we must restore them before calling execve()
-and intercept them again after a failed execve(). In order to cleanly deal
-with the SIGUSR2/SIGHUP loops where we re-exec the wrapper, we ignore these
-two signals during a re-exec, and restore them to defaults when spawning
-haproxy.
-
-This should be backported to 1.6 and 1.5.
-(cherry picked from commit 4351ea61fbddf88c960179d60b0e0f1b090f0b70)
----
- src/haproxy-systemd-wrapper.c | 49 ++++++++++++++++++++++++++++++++++++-------
- 1 file changed, 41 insertions(+), 8 deletions(-)
-
-diff --git a/src/haproxy-systemd-wrapper.c b/src/haproxy-systemd-wrapper.c
-index a78e75b..84d2e17 100644
---- a/src/haproxy-systemd-wrapper.c
-+++ b/src/haproxy-systemd-wrapper.c
-@@ -28,6 +28,11 @@ static char *pid_file = "/run/haproxy.pid";
- static int wrapper_argc;
- static char **wrapper_argv;
-+static void setup_signal_handler();
-+static void pause_signal_handler();
-+static void reset_signal_handler();
-+
-+
- /* returns the path to the haproxy binary into <buffer>, whose size indicated
-  * in <buffer_size> must be at least 1 byte long.
-  */
-@@ -76,6 +81,8 @@ static void spawn_haproxy(char **pid_strv, int nb_pid)
-               char **argv = calloc(4 + main_argc + nb_pid + 1, sizeof(char *));
-               int i;
-               int argno = 0;
-+
-+              reset_signal_handler();
-               locate_haproxy(haproxy_bin, 512);
-               argv[argno++] = haproxy_bin;
-               for (i = 0; i < main_argc; ++i)
-@@ -127,6 +134,34 @@ static void signal_handler(int signum)
-               caught_signal = signum;
- }
-+static void setup_signal_handler()
-+{
-+      struct sigaction sa;
-+
-+      memset(&sa, 0, sizeof(struct sigaction));
-+      sa.sa_handler = &signal_handler;
-+      sigaction(SIGUSR2, &sa, NULL);
-+      sigaction(SIGHUP, &sa, NULL);
-+      sigaction(SIGINT, &sa, NULL);
-+      sigaction(SIGTERM, &sa, NULL);
-+}
-+
-+static void pause_signal_handler()
-+{
-+      signal(SIGUSR2, SIG_IGN);
-+      signal(SIGHUP,  SIG_IGN);
-+      signal(SIGINT,  SIG_DFL);
-+      signal(SIGTERM, SIG_DFL);
-+}
-+
-+static void reset_signal_handler()
-+{
-+      signal(SIGUSR2, SIG_DFL);
-+      signal(SIGHUP,  SIG_DFL);
-+      signal(SIGINT,  SIG_DFL);
-+      signal(SIGTERM, SIG_DFL);
-+}
-+
- /* handles SIGUSR2 and SIGHUP only */
- static void do_restart(int sig)
- {
-@@ -134,7 +169,11 @@ static void do_restart(int sig)
-       fprintf(stderr, SD_NOTICE "haproxy-systemd-wrapper: re-executing on %s.\n",
-               sig == SIGUSR2 ? "SIGUSR2" : "SIGHUP");
-+      /* don't let the other process take one of those signals by accident */
-+      pause_signal_handler();
-       execv(wrapper_argv[0], wrapper_argv);
-+      /* failed, let's reinstall the signal handler and continue */
-+      setup_signal_handler();
- }
- /* handles SIGTERM and SIGINT only */
-@@ -168,7 +207,8 @@ static void init(int argc, char **argv)
- int main(int argc, char **argv)
- {
-       int status;
--      struct sigaction sa;
-+
-+      setup_signal_handler();
-       wrapper_argc = argc;
-       wrapper_argv = argv;
-@@ -176,13 +216,6 @@ int main(int argc, char **argv)
-       --argc; ++argv;
-       init(argc, argv);
--      memset(&sa, 0, sizeof(struct sigaction));
--      sa.sa_handler = &signal_handler;
--      sigaction(SIGUSR2, &sa, NULL);
--      sigaction(SIGHUP, &sa, NULL);
--      sigaction(SIGINT, &sa, NULL);
--      sigaction(SIGTERM, &sa, NULL);
--
-       if (getenv(REEXEC_FLAG) != NULL) {
-               /* We are being re-executed: restart HAProxy gracefully */
-               int i;
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0014-BUG-MINOR-systemd-check-return-value-of-calloc.patch b/net/haproxy/patches/0014-BUG-MINOR-systemd-check-return-value-of-calloc.patch
deleted file mode 100644 (file)
index 5efbc35..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-From 106cb89907ea6eab0073708bb8d6f56d7fc64509 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Tue, 25 Oct 2016 17:05:56 +0200
-Subject: [PATCH 14/26] BUG/MINOR: systemd: check return value of calloc()
-
-The wrapper is not the best reliable thing in the universe, so start
-by adding at least the minimum expected controls :-/
-
-To be backported to 1.5 and 1.6.
-(cherry picked from commit 3747ea07ce6b647b86559383f7d09b42550d42f3)
----
- src/haproxy-systemd-wrapper.c | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
-
-diff --git a/src/haproxy-systemd-wrapper.c b/src/haproxy-systemd-wrapper.c
-index 84d2e17..15c48ca 100644
---- a/src/haproxy-systemd-wrapper.c
-+++ b/src/haproxy-systemd-wrapper.c
-@@ -77,11 +77,17 @@ static void spawn_haproxy(char **pid_strv, int nb_pid)
-       pid = fork();
-       if (!pid) {
--              /* 3 for "haproxy -Ds -sf" */
--              char **argv = calloc(4 + main_argc + nb_pid + 1, sizeof(char *));
-+              char **argv;
-               int i;
-               int argno = 0;
-+              /* 3 for "haproxy -Ds -sf" */
-+              argv = calloc(4 + main_argc + nb_pid + 1, sizeof(char *));
-+              if (!argv) {
-+                      fprintf(stderr, SD_NOTICE "haproxy-systemd-wrapper: failed to calloc(), please try again later.\n");
-+                      exit(1);
-+              }
-+
-               reset_signal_handler();
-               locate_haproxy(haproxy_bin, 512);
-               argv[argno++] = haproxy_bin;
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0015-MINOR-systemd-report-it-when-execve-fails.patch b/net/haproxy/patches/0015-MINOR-systemd-report-it-when-execve-fails.patch
deleted file mode 100644 (file)
index 17a5a73..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-From 3bc0a399d2875e9e0627a70906c1403eef60ec60 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Tue, 25 Oct 2016 16:51:40 +0200
-Subject: [PATCH 15/26] MINOR: systemd: report it when execve() fails
-
-It's important to know that a signal sent to the wrapper had no effect
-because something failed during execve(). Ideally more info (strerror)
-should be reported. It would be nice to backport this to 1.6 and 1.5.
-(cherry picked from commit a785269b4e09114224062081f02b443b6008c524)
----
- src/haproxy-systemd-wrapper.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/src/haproxy-systemd-wrapper.c b/src/haproxy-systemd-wrapper.c
-index 15c48ca..f4fcab1 100644
---- a/src/haproxy-systemd-wrapper.c
-+++ b/src/haproxy-systemd-wrapper.c
-@@ -107,8 +107,12 @@ static void spawn_haproxy(char **pid_strv, int nb_pid)
-               fprintf(stderr, "\n");
-               execv(argv[0], argv);
-+              fprintf(stderr, SD_NOTICE "haproxy-systemd-wrapper: execv(%s) failed, please try again later.\n", argv[0]);
-               exit(1);
-       }
-+      else if (pid == -1) {
-+              fprintf(stderr, SD_NOTICE "haproxy-systemd-wrapper: failed to fork(), please try again later.\n");
-+      }
- }
- static int read_pids(char ***pid_strv)
-@@ -180,6 +184,7 @@ static void do_restart(int sig)
-       execv(wrapper_argv[0], wrapper_argv);
-       /* failed, let's reinstall the signal handler and continue */
-       setup_signal_handler();
-+      fprintf(stderr, SD_NOTICE "haproxy-systemd-wrapper: re-exec(%s) failed.\n", wrapper_argv[0]);
- }
- /* handles SIGTERM and SIGINT only */
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0016-BUG-MEDIUM-systemd-let-the-wrapper-know-that-haproxy.patch b/net/haproxy/patches/0016-BUG-MEDIUM-systemd-let-the-wrapper-know-that-haproxy.patch
deleted file mode 100644 (file)
index 3e6fac5..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-From ff81ac47267c4e0227d1e3fbc5b1dedfd81a2a2f Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Tue, 25 Oct 2016 17:20:24 +0200
-Subject: [PATCH 16/26] BUG/MEDIUM: systemd: let the wrapper know that haproxy
- has completed or failed
-
-Pierre Cheynier found that there's a persistent issue with the systemd
-wrapper. Too fast reloads can lead to certain old processes not being
-signaled at all and continuing to run. The problem was tracked down as
-a race between the startup and the signal processing : nothing prevents
-the wrapper from starting new processes while others are still starting,
-and the resulting pid file will only contain the latest pids in this
-case. This can happen with large configs and/or when a lot of SSL
-certificates are involved.
-
-In order to solve this we want the wrapper to wait for the new processes
-to complete their startup. But we also want to ensure it doesn't wait for
-nothing in case of error.
-
-The solution found here is to create a pipe between the wrapper and the
-sub-processes. The wrapper waits on the pipe and the sub-processes are
-expected to close this pipe once they completed their startup. That way
-we don't queue up new processes until the previous ones have registered
-their pids to the pid file. And if anything goes wrong, the wrapper is
-immediately released. The only thing is that we need the sub-processes
-to know the pipe's file descriptor. We pass it in an environment variable
-called HAPROXY_WRAPPER_FD.
-
-It was confirmed both by Pierre and myself that this completely solves
-the "zombie" process issue so that only the new processes continue to
-listen on the sockets.
-
-It seems that in the future this stuff could be moved to the haproxy
-master process, also getting rid of an environment variable.
-
-This fix needs to be backported to 1.6 and 1.5.
-(cherry picked from commit b957109727f7fed556c049d40bacf45f0df211db)
----
- src/haproxy-systemd-wrapper.c | 36 ++++++++++++++++++++++++++++++++++++
- src/haproxy.c                 | 10 ++++++++++
- 2 files changed, 46 insertions(+)
-
-diff --git a/src/haproxy-systemd-wrapper.c b/src/haproxy-systemd-wrapper.c
-index f4fcab1..b426f96 100644
---- a/src/haproxy-systemd-wrapper.c
-+++ b/src/haproxy-systemd-wrapper.c
-@@ -65,16 +65,30 @@ static void locate_haproxy(char *buffer, size_t buffer_size)
-       return;
- }
-+/* Note: this function must not exit in case of error (except in the child), as
-+ * it is only dedicated the starting a new haproxy process. By keeping the
-+ * process alive it will ensure that future signal delivery may get rid of
-+ * the issue. If the first startup fails, the wrapper will notice it and
-+ * return an error thanks to wait() returning ECHILD.
-+ */
- static void spawn_haproxy(char **pid_strv, int nb_pid)
- {
-       char haproxy_bin[512];
-       pid_t pid;
-       int main_argc;
-       char **main_argv;
-+      int pipefd[2];
-+      char fdstr[20];
-+      int ret;
-       main_argc = wrapper_argc - 1;
-       main_argv = wrapper_argv + 1;
-+      if (pipe(pipefd) != 0) {
-+              fprintf(stderr, SD_NOTICE "haproxy-systemd-wrapper: failed to create a pipe, please try again later.\n");
-+              return;
-+      }
-+
-       pid = fork();
-       if (!pid) {
-               char **argv;
-@@ -89,6 +103,15 @@ static void spawn_haproxy(char **pid_strv, int nb_pid)
-               }
-               reset_signal_handler();
-+
-+              close(pipefd[0]); /* close the read side */
-+
-+              snprintf(fdstr, sizeof(fdstr), "%d", pipefd[1]);
-+              if (setenv("HAPROXY_WRAPPER_FD", fdstr, 1) != 0) {
-+                      fprintf(stderr, SD_NOTICE "haproxy-systemd-wrapper: failed to setenv(), please try again later.\n");
-+                      exit(1);
-+              }
-+
-               locate_haproxy(haproxy_bin, 512);
-               argv[argno++] = haproxy_bin;
-               for (i = 0; i < main_argc; ++i)
-@@ -113,6 +136,19 @@ static void spawn_haproxy(char **pid_strv, int nb_pid)
-       else if (pid == -1) {
-               fprintf(stderr, SD_NOTICE "haproxy-systemd-wrapper: failed to fork(), please try again later.\n");
-       }
-+
-+      /* The parent closes the write side and waits for the child to close it
-+       * as well. Also deal the case where the fd would unexpectedly be 1 or 2
-+       * by silently draining all data.
-+       */
-+      close(pipefd[1]);
-+
-+      do {
-+              char c;
-+              ret = read(pipefd[0], &c, sizeof(c));
-+      } while ((ret > 0) || (ret == -1 && errno == EINTR));
-+      /* the child has finished starting up */
-+      close(pipefd[0]);
- }
- static int read_pids(char ***pid_strv)
-diff --git a/src/haproxy.c b/src/haproxy.c
-index a657dc4..2d476f2 100644
---- a/src/haproxy.c
-+++ b/src/haproxy.c
-@@ -1843,6 +1843,7 @@ int main(int argc, char **argv)
-               int ret = 0;
-               int *children = calloc(global.nbproc, sizeof(int));
-               int proc;
-+              char *wrapper_fd;
-               /* the father launches the required number of processes */
-               for (proc = 0; proc < global.nbproc; proc++) {
-@@ -1879,6 +1880,15 @@ int main(int argc, char **argv)
-                       close(pidfd);
-               }
-+              /* each child must notify the wrapper that it's ready by closing the requested fd */
-+              wrapper_fd = getenv("HAPROXY_WRAPPER_FD");
-+              if (wrapper_fd) {
-+                      int pipe_fd = atoi(wrapper_fd);
-+
-+                      if (pipe_fd >= 0)
-+                              close(pipe_fd);
-+              }
-+
-               /* We won't ever use this anymore */
-               free(oldpids);        oldpids = NULL;
-               free(global.chroot);  global.chroot = NULL;
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0017-BUILD-protocol-fix-some-build-errors-on-OpenBSD.patch b/net/haproxy/patches/0017-BUILD-protocol-fix-some-build-errors-on-OpenBSD.patch
deleted file mode 100644 (file)
index 4a7a1ab..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-From 4fc2ce4a4bb83862679e40c09c684dbf266099f2 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Wed, 10 Aug 2016 18:24:48 +0200
-Subject: [PATCH 17/26] BUILD: protocol: fix some build errors on OpenBSD
-
-Building 1.6 and above on OpenBSD 5.2 fails due to protocol.c not
-including sys/types.h before sys/socket.h :
-
-  In file included from src/protocol.c:14:
-  /usr/include/sys/socket.h:162: error: expected specifier-qualifier-list before 'u_int8_t'
-
-This fix needs to be backported to 1.6.
-(cherry picked from commit a6e3be7ae977ba907ec6ed028c5ab50a6a51886a)
----
- src/protocol.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/protocol.c b/src/protocol.c
-index 3caccb6..7884ef7 100644
---- a/src/protocol.c
-+++ b/src/protocol.c
-@@ -10,6 +10,7 @@
-  *
-  */
-+#include <sys/types.h>
- #include <sys/socket.h>
- #include <common/config.h>
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0018-BUILD-log-iovec-requires-to-include-sys-uio.h-on-Ope.patch b/net/haproxy/patches/0018-BUILD-log-iovec-requires-to-include-sys-uio.h-on-Ope.patch
deleted file mode 100644 (file)
index 48332ab..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-From 27f28950d4f9e44e776db5a5d2bc8d07df45eb30 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Wed, 10 Aug 2016 18:30:56 +0200
-Subject: [PATCH 18/26] BUILD: log: iovec requires to include sys/uio.h on
- OpenBSD
-
-The following commit merged into 1.6-dev6 broke the build on OpenBSD :
-
-  609ac2a ("MEDIUM: log: replace sendto() with sendmsg() in __send_log()")
-
-Including sys/uio.h is enough to fix this. This fix needs to be backported
-to 1.6.
-(cherry picked from commit 077edcba2e5c25524b720f905417d9f0616cd252)
----
- src/log.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/log.c b/src/log.c
-index 1ddc06d..293a034 100644
---- a/src/log.c
-+++ b/src/log.c
-@@ -22,6 +22,7 @@
- #include <errno.h>
- #include <sys/time.h>
-+#include <sys/uio.h>
- #include <common/config.h>
- #include <common/compat.h>
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0019-BUILD-tcp-do-not-include-netinet-ip.h-for-IP_TTL.patch b/net/haproxy/patches/0019-BUILD-tcp-do-not-include-netinet-ip.h-for-IP_TTL.patch
deleted file mode 100644 (file)
index 681c3a2..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-From 2a63a2b7e32bba4a33c5f4081647124565929f6a Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Wed, 10 Aug 2016 18:42:17 +0200
-Subject: [PATCH 19/26] BUILD: tcp: do not include netinet/ip.h for IP_TTL
-
-On OpenBSD, netinet/ip.h fails unless in_systm.h is included. This
-include was added by the silent-drop feature introduced with commit
-2d392c2 ("MEDIUM: tcp: add new tcp action "silent-drop"") in 1.6-dev6,
-but we don't need it, IP_TTL is defined in netinet/in.h, so let's drop
-this useless include.
-
-This fix needs to be backported to 1.6.
-(cherry picked from commit 7f3e3c0159401cdf47575bc82304696b3a98a2ab)
----
- src/proto_tcp.c | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/src/proto_tcp.c b/src/proto_tcp.c
-index 0f20fde..83b862a 100644
---- a/src/proto_tcp.c
-+++ b/src/proto_tcp.c
-@@ -31,7 +31,6 @@
- #include <netinet/tcp.h>
- #include <netinet/in.h>
--#include <netinet/ip.h>
- #include <common/cfgparse.h>
- #include <common/compat.h>
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0020-BUILD-checks-remove-the-last-strcat-and-eliminate-a-.patch b/net/haproxy/patches/0020-BUILD-checks-remove-the-last-strcat-and-eliminate-a-.patch
deleted file mode 100644 (file)
index bda2566..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-From a581cf03110f13c61faeaf87efa5b4e2777087d0 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Wed, 10 Aug 2016 19:29:09 +0200
-Subject: [PATCH 20/26] BUILD: checks: remove the last strcat and eliminate a
- warning on OpenBSD
-
-OpenBSD emits warnings on usages of strcpy, strcat and sprintf (and
-probably a few others). Here we have a single such warning in all the code
-reintroduced by commit 0ba0e4a ("MEDIUM: Support sending email alerts") in
-1.6-dev1. Let's get rid of it, the open-coding of strcat is as small as its
-usage and the the result is even more efficient.
-
-This fix needs to be backported to 1.6.
-(cherry picked from commit 64345aaaf0dc2739983902cce4667089ad926a49)
----
- src/checks.c | 7 +++++--
- 1 file changed, 5 insertions(+), 2 deletions(-)
-
-diff --git a/src/checks.c b/src/checks.c
-index 80b2fc3..55c13a9 100644
---- a/src/checks.c
-+++ b/src/checks.c
-@@ -3164,6 +3164,8 @@ static int add_tcpcheck_expect_str(struct list *list, const char *str)
- static int add_tcpcheck_send_strs(struct list *list, const char * const *strs)
- {
-       struct tcpcheck_rule *tcpcheck;
-+      const char *in;
-+      char *dst;
-       int i;
-       tcpcheck = calloc(1, sizeof *tcpcheck);
-@@ -3181,10 +3183,11 @@ static int add_tcpcheck_send_strs(struct list *list, const char * const *strs)
-               free(tcpcheck);
-               return 0;
-       }
--      tcpcheck->string[0] = '\0';
-+      dst = tcpcheck->string;
-       for (i = 0; strs[i]; i++)
--              strcat(tcpcheck->string, strs[i]);
-+              for (in = strs[i]; (*dst = *in++); dst++);
-+      *dst = 0;
-       LIST_ADDQ(list, &tcpcheck->list);
-       return 1;
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0021-BUILD-poll-remove-unused-hap_fd_isset-which-causes-a.patch b/net/haproxy/patches/0021-BUILD-poll-remove-unused-hap_fd_isset-which-causes-a.patch
deleted file mode 100644 (file)
index 39dec91..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-From a19f5bfb0d1e606dc2eb80af903c229ca41d5057 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Wed, 10 Aug 2016 21:21:57 +0200
-Subject: [PATCH 21/26] BUILD: poll: remove unused hap_fd_isset() which causes
- a warning with clang
-
-Clang reports that this function is not used :
-
-src/ev_poll.c:34:28: warning: unused function 'hap_fd_isset' [-Wunused-function]
-static inline unsigned int hap_fd_isset(int fd, unsigned int *evts)
-
-It's been true since the rework of the pollers in 1.5 and it's unlikely we'll
-ever need it anymore, so better remove it now to provide clean builds.
-
-This fix can be backported to 1.6 and 1.5 now.
-(cherry picked from commit 091e86e1ee8ec51bd5a3c1935666a822a51b9051)
----
- src/ev_poll.c | 5 -----
- 1 file changed, 5 deletions(-)
-
-diff --git a/src/ev_poll.c b/src/ev_poll.c
-index 44a2b9b..80d88eb 100644
---- a/src/ev_poll.c
-+++ b/src/ev_poll.c
-@@ -31,11 +31,6 @@ static unsigned int *fd_evts[2];
- static struct pollfd *poll_events = NULL;
--static inline unsigned int hap_fd_isset(int fd, unsigned int *evts)
--{
--      return evts[fd / (8*sizeof(*evts))] & (1U << (fd & (8*sizeof(*evts) - 1)));
--}
--
- static inline void hap_fd_set(int fd, unsigned int *evts)
- {
-       evts[fd / (8*sizeof(*evts))] |= 1U << (fd & (8*sizeof(*evts) - 1));
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0022-MINOR-cfgparse-few-memory-leaks-fixes.patch b/net/haproxy/patches/0022-MINOR-cfgparse-few-memory-leaks-fixes.patch
deleted file mode 100644 (file)
index 3c7f01f..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-From e871cc2f15ad121e1e840191f59c6c86d6d0580d Mon Sep 17 00:00:00 2001
-From: David Carlier <devnexen@gmail.com>
-Date: Mon, 22 Aug 2016 23:27:42 +0100
-Subject: [PATCH 22/26] MINOR: cfgparse: few memory leaks fixes.
-
-Some minor memory leak during the config parsing.
-(cherry picked from commit 70d604593d507f50fd99cebecee4b2c47c1d9b73)
----
- src/cfgparse.c | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/src/cfgparse.c b/src/cfgparse.c
-index f2a104d..b8289a2 100644
---- a/src/cfgparse.c
-+++ b/src/cfgparse.c
-@@ -1597,6 +1597,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
-                       if (logsrv->format < 0) {
-                               Alert("parsing [%s:%d] : unknown log format '%s'\n", file, linenum, args[arg+3]);
-                               err_code |= ERR_ALERT | ERR_FATAL;
-+                              free(logsrv);
-                               goto out;
-                       }
-@@ -6777,9 +6778,10 @@ cfg_parse_users(const char *file, int linenum, char **args, int kwm)
-               }
-               ag->name = strdup(args[1]);
--              if (!ag) {
-+              if (!ag->name) {
-                       Alert("parsing [%s:%d]: out of memory.\n", file, linenum);
-                       err_code |= ERR_ALERT | ERR_ABORT;
-+                      free(ag);
-                       goto out;
-               }
-@@ -6794,6 +6796,9 @@ cfg_parse_users(const char *file, int linenum, char **args, int kwm)
-                               Alert("parsing [%s:%d]: '%s' only supports 'users' option.\n",
-                                     file, linenum, args[0]);
-                               err_code |= ERR_ALERT | ERR_FATAL;
-+                              free(ag->groupusers);
-+                              free(ag->name);
-+                              free(ag);
-                               goto out;
-                       }
-               }
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0023-MINOR-build-Allow-linking-to-device-atlas-library-fi.patch b/net/haproxy/patches/0023-MINOR-build-Allow-linking-to-device-atlas-library-fi.patch
deleted file mode 100644 (file)
index 15719d7..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-From 5370c6774a333b2b3989639275d4093fdc541db9 Mon Sep 17 00:00:00 2001
-From: Bertrand Jacquin <bertrand@jacquin.bzh>
-Date: Thu, 6 Oct 2016 00:32:39 +0100
-Subject: [PATCH 23/26] MINOR: build: Allow linking to device-atlas library
- file
-
-DeviceAtlas might be installed in a location where a user might not have
-enough permissions to write json.o and dac.o
-(cherry picked from commit 3a2661d6b4218704c828c8a712c87d651bfe29b5)
----
- Makefile | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/Makefile b/Makefile
-index 1d0f2bc..0242cae 100644
---- a/Makefile
-+++ b/Makefile
-@@ -615,8 +615,12 @@ endif
- DEVICEATLAS_SRC =
- DEVICEATLAS_INC = $(DEVICEATLAS_SRC)
- DEVICEATLAS_LIB = $(DEVICEATLAS_SRC)
-+ifeq ($(DEVICEATLAS_SRC),)
-+OPTIONS_LDFLAGS += -lda
-+else
- OPTIONS_OBJS  += $(DEVICEATLAS_LIB)/json.o
- OPTIONS_OBJS  += $(DEVICEATLAS_LIB)/dac.o
-+endif
- OPTIONS_OBJS  += src/da.o
- OPTIONS_CFLAGS += -DUSE_DEVICEATLAS $(if $(DEVICEATLAS_INC),-I$(DEVICEATLAS_INC))
- BUILD_OPTIONS  += $(call ignore_implicit,USE_DEVICEATLAS)
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0024-DOC-Fix-typo-in-description-of-st-parameter-in-man-p.patch b/net/haproxy/patches/0024-DOC-Fix-typo-in-description-of-st-parameter-in-man-p.patch
deleted file mode 100644 (file)
index d864efb..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-From f95dc972e2e9e3c245862e45336ff4f014ad5666 Mon Sep 17 00:00:00 2001
-From: Jorrit Schippers <jorrit@ncode.nl>
-Date: Sat, 9 Apr 2016 20:30:38 +0200
-Subject: [PATCH 24/26] DOC: Fix typo in description of `-st` parameter in man
- page
-
-extra "wait".
-(cherry picked from commit 1458fdbe974562158fc40fd72d745d5fd644c939)
----
- doc/haproxy.1 | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/doc/haproxy.1 b/doc/haproxy.1
-index a836d5d..20c9343 100644
---- a/doc/haproxy.1
-+++ b/doc/haproxy.1
-@@ -149,9 +149,9 @@ PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGUSR1\fP are sent.
- .TP
- \fB\-st <pidlist>\fP
- Send TERMINATE signal to the pids in pidlist after startup. The processes
--which receive this signal will wait immediately terminate, closing all
--active sessions. This option must be specified last, followed by any number
--of PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGTERM\fP are sent.
-+which receive this signal will terminate immediately, closing all active
-+sessions. This option must be specified last, followed by any number of
-+PIDs. Technically speaking, \fBSIGTTOU\fP and \fBSIGTERM\fP are sent.
- .SH LOGGING
- Since HAProxy can run inside a chroot, it cannot reliably access /dev/log.
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0025-BUG-MEDIUM-peers-on-shutdown-wake-up-the-appctx-not-.patch b/net/haproxy/patches/0025-BUG-MEDIUM-peers-on-shutdown-wake-up-the-appctx-not-.patch
deleted file mode 100644 (file)
index e750ea8..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-From 6026323cd0c235d6ab7ec039e5d735e7ea2e28bf Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Mon, 31 Oct 2016 17:32:20 +0100
-Subject: [PATCH 25/26] BUG/MEDIUM: peers: on shutdown, wake up the appctx, not
- the stream
-
-This part was missed when peers were ported to the new applet
-infrastructure in 1.6, the main stream is woken up instead of the
-appctx. This creates a race condition by which it is possible to
-wake the stream at the wrong moment and miss an event. This bug
-might be at least partially responsible for some of the CLOSE_WAIT
-that were reported on peers session upon reload in version 1.6.
-
-This fix must be backported to 1.6.
-(cherry picked from commit 78c0c50705a5e9d48607b9377adf030bb9d97b34)
----
- src/peers.c | 4 +---
- 1 file changed, 1 insertion(+), 3 deletions(-)
-
-diff --git a/src/peers.c b/src/peers.c
-index 7e1523f..db1f608 100644
---- a/src/peers.c
-+++ b/src/peers.c
-@@ -1637,11 +1637,9 @@ static void peer_session_forceshutdown(struct stream * stream)
-       if (ps)
-               ps->reconnect = tick_add(now_ms, MS_TO_TICKS(50 + random() % 2000));
--      /* call release to reinit resync states if needed */
--      peer_session_release(appctx);
-       appctx->st0 = PEER_SESS_ST_END;
-       appctx->ctx.peers.ptr = NULL;
--      task_wakeup(stream->task, TASK_WOKEN_MSG);
-+      appctx_wakeup(appctx);
- }
- /* Pre-configures a peers frontend to accept incoming connections */
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0026-BUG-MEDIUM-peers-fix-use-after-free-in-peer_session_.patch b/net/haproxy/patches/0026-BUG-MEDIUM-peers-fix-use-after-free-in-peer_session_.patch
deleted file mode 100644 (file)
index d3f9be1..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-From ab45181e36b6c4f7d31c5284035937c2d0be37eb Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Mon, 31 Oct 2016 17:46:57 +0100
-Subject: [PATCH 26/26] BUG/MEDIUM: peers: fix use after free in
- peer_session_create()
-
-In case of resource allocation error, peer_session_create() frees
-everything allocated and returns a pointer to the stream/session that
-was put back into the free pool. This stream/session is then assigned
-to ps->{stream,session} with no error control. This means that it is
-perfectly possible to have a new stream or session being both used for
-a regular communication and for a peer at the same time.
-
-In fact it is the only way (for now) to explain a CLOSE_WAIT on peers
-connections that was caught in this dump with the stream interface in
-SI_ST_CON state while the error field proves the state ought to have
-been SI_ST_DIS, very likely indicating two concurrent accesses on the
-same area :
-
-  0x7dbd50: [31/Oct/2016:17:53:41.267510] id=0 proto=tcpv4
-    flags=0x23006, conn_retries=0, srv_conn=(nil), pend_pos=(nil)
-    frontend=myhost2 (id=4294967295 mode=tcp), listener=? (id=0)
-    backend=<NONE> (id=-1 mode=-) addr=127.0.0.1:41432
-    server=<NONE> (id=-1) addr=127.0.0.1:8521
-    task=0x7dbcd8 (state=0x08 nice=0 calls=2 exp=<NEVER> age=1m5s)
-    si[0]=0x7dbf48 (state=CLO flags=0x4040 endp0=APPCTX:0x7d99c8 exp=<NEVER>, et=0x000)
-    si[1]=0x7dbf68 (state=CON flags=0x50 endp1=CONN:0x7dc0b8 exp=<NEVER>, et=0x020)
-    app0=0x7d99c8 st0=11 st1=0 st2=0 applet=<PEER>
-    co1=0x7dc0b8 ctrl=tcpv4 xprt=RAW data=STRM target=PROXY:0x7fe62028a010
-        flags=0x0020b310 fd=7 fd.state=22 fd.cache=0 updt=0
-    req=0x7dbd60 (f=0x80a020 an=0x0 pipe=0 tofwd=0 total=0)
-        an_exp=<NEVER> rex=<NEVER> wex=<NEVER>
-        buf=0x78a3c0 data=0x78a3d4 o=0 p=0 req.next=0 i=0 size=0
-    res=0x7dbda0 (f=0x80402020 an=0x0 pipe=0 tofwd=0 total=0)
-        an_exp=<NEVER> rex=<NEVER> wex=<NEVER>
-        buf=0x78a3c0 data=0x78a3d4 o=0 p=0 rsp.next=0 i=0 size=0
-
-Special thanks to Arnaud Gavara who provided lots of valuable input and
-ran some validation testing on this patch.
-
-This fix must be backported to 1.6 and 1.5. Note that in 1.5 the
-session is not assigned from within the function so some extra checks
-may be needed in the callers.
-(cherry picked from commit b21d08e2492bfbf9d2341ce9f148cb9845927862)
----
- src/peers.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/peers.c b/src/peers.c
-index db1f608..c8be59a 100644
---- a/src/peers.c
-+++ b/src/peers.c
-@@ -1747,7 +1747,7 @@ static struct stream *peer_session_create(struct peers *peers, struct peer *peer
-  out_free_appctx:
-       appctx_free(appctx);
-  out_close:
--      return s;
-+      return NULL;
- }
- /*
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0027-BUG-MEDIUM-systemd-wrapper-return-correct-exit-codes.patch b/net/haproxy/patches/0027-BUG-MEDIUM-systemd-wrapper-return-correct-exit-codes.patch
deleted file mode 100644 (file)
index 76e6216..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-From 0a2117dc29147ed990732d1b2fc9779835820f3e Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Thu, 3 Nov 2016 20:31:40 +0100
-Subject: [PATCH 27/31] BUG/MEDIUM: systemd-wrapper: return correct exit codes
-
-Gabriele Cerami reported the the exit codes of the systemd-wrapper are
-wrong. In short, it directly returns the output of the wait syscall's
-status, which is a composite value made of error code an signal numbers.
-In general it contains the signal number on the lower bits and the error
-code on the higher bits, but exit() truncates it to the lowest 8 bits,
-causing config validations to incorrectly report a success. Example :
-
-  $ ./haproxy-systemd-wrapper -c -f /dev/null
-  <7>haproxy-systemd-wrapper: executing /tmp/haproxy -c -f /dev/null -Ds
-  Configuration file has no error but will not start (no listener) => exit(2).
-  <5>haproxy-systemd-wrapper: exit, haproxy RC=512
-  $ echo $?
-  0
-
-If the process is killed however, the signal number is directly reported
-in the exit code.
-
-Let's fix all this to ensure that the exit code matches what the shell does,
-which means that codes 0..127 are for exit codes, codes 128..254 for signals,
-and code 255 for unknown exit code. Now the return code is correct :
-
-  $ ./haproxy-systemd-wrapper -c -f /dev/null
-  <7>haproxy-systemd-wrapper: executing /tmp/haproxy -c -f /dev/null -Ds
-  Configuration file has no error but will not start (no listener) => exit(2).
-  <5>haproxy-systemd-wrapper: exit, haproxy RC=2
-  $ echo $?
-  2
-
-  $ ./haproxy-systemd-wrapper -f /tmp/cfg.conf
-  <7>haproxy-systemd-wrapper: executing /tmp/haproxy -f /dev/null -Ds
-  ^C
-  <5>haproxy-systemd-wrapper: exit, haproxy RC=130
-  $ echo $?
-  130
-
-This fix must be backported to 1.6 and 1.5.
-(cherry picked from commit f7659cb10cb0420c7ca06fad1067207021d2a078)
----
- src/haproxy-systemd-wrapper.c | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/src/haproxy-systemd-wrapper.c b/src/haproxy-systemd-wrapper.c
-index b426f96..f6a9c85 100644
---- a/src/haproxy-systemd-wrapper.c
-+++ b/src/haproxy-systemd-wrapper.c
-@@ -295,6 +295,16 @@ int main(int argc, char **argv)
-               }
-       }
-+      /* return either exit code or signal+128 */
-+      if (WIFEXITED(status))
-+              status = WEXITSTATUS(status);
-+      else if (WIFSIGNALED(status))
-+              status = 128 + WTERMSIG(status);
-+      else if (WIFSTOPPED(status))
-+              status = 128 + WSTOPSIG(status);
-+      else
-+              status = 255;
-+
-       fprintf(stderr, SD_NOTICE "haproxy-systemd-wrapper: exit, haproxy RC=%d\n",
-                       status);
-       return status;
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0028-BUG-MEDIUM-srv-state-properly-restore-the-DRAIN-stat.patch b/net/haproxy/patches/0028-BUG-MEDIUM-srv-state-properly-restore-the-DRAIN-stat.patch
deleted file mode 100644 (file)
index fb51e7f..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-From 74ffd0cd0cecaeec3cfa848cbc03beb08999cc72 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Thu, 3 Nov 2016 18:19:49 +0100
-Subject: [PATCH 28/31] BUG/MEDIUM: srv-state: properly restore the DRAIN state
-
-There were seveal reports about the DRAIN state not being properly
-restored upon reload.
-
-It happens that the condition in the code does exactly the opposite
-of what the comment says, and the comment is right so the code is
-wrong.
-
-It's worth noting that the conditions are complex here due to the 2
-available methods to set the drain state (CLI/agent, and config's
-weight). To paraphrase the updated comment in the code, there are
-two possible reasons for FDRAIN to have been present :
-  - previous config weight was zero
-  - "set server b/s drain" was sent to the CLI
-
-In the first case, we simply want to drop this drain state if the new
-weight is not zero anymore, meaning the administrator has intentionally
-turned the weight back to a positive value to enable the server again
-after an operation. In the second case, the drain state was forced on
-the CLI regardless of the config's weight so we don't want a change to
-the config weight to lose this status. What this means is :
-  - if previous weight was 0 and new one is >0, drop the DRAIN state.
-  - if the previous weight was >0, keep it.
-
-This fix must be backported to 1.6.
-(cherry picked from commit 22cace2f4c3cbeca27c1941c647e7ae38ec8c0c0)
----
- src/server.c | 22 +++++++++++++++-------
- 1 file changed, 15 insertions(+), 7 deletions(-)
-
-diff --git a/src/server.c b/src/server.c
-index 79b3cb2..b9e72b7 100644
---- a/src/server.c
-+++ b/src/server.c
-@@ -2093,15 +2093,23 @@ static void srv_update_state(struct server *srv, int version, char **params)
-                       /* apply drain mode if server is currently enabled */
-                       if (!(srv->admin & SRV_ADMF_FMAINT) && (srv_admin_state & SRV_ADMF_FDRAIN)) {
-                               /* The SRV_ADMF_FDRAIN flag is inherited when srv->iweight is 0
--                               * (srv->iweight is the weight set up in configuration)
--                               * so we don't want to apply it when srv_iweight is 0 and
--                               * srv->iweight is greater than 0. Purpose is to give the
--                               * chance to the admin to re-enable this server from configuration
--                               * file by setting a new weight > 0.
-+                               * (srv->iweight is the weight set up in configuration).
-+                               * There are two possible reasons for FDRAIN to have been present :
-+                               *   - previous config weight was zero
-+                               *   - "set server b/s drain" was sent to the CLI
-+                               *
-+                               * In the first case, we simply want to drop this drain state
-+                               * if the new weight is not zero anymore, meaning the administrator
-+                               * has intentionally turned the weight back to a positive value to
-+                               * enable the server again after an operation. In the second case,
-+                               * the drain state was forced on the CLI regardless of the config's
-+                               * weight so we don't want a change to the config weight to lose this
-+                               * status. What this means is :
-+                               *   - if previous weight was 0 and new one is >0, drop the DRAIN state.
-+                               *   - if the previous weight was >0, keep it.
-                                */
--                              if ((srv_iweight == 0) && (srv->iweight > 0)) {
-+                              if (srv_iweight > 0 || srv->iweight == 0)
-                                       srv_adm_set_drain(srv);
--                              }
-                       }
-                       srv->last_change = date.tv_sec - srv_last_time_change;
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0029-BUG-MINOR-srv-state-allow-to-have-both-CMAINT-and-FD.patch b/net/haproxy/patches/0029-BUG-MINOR-srv-state-allow-to-have-both-CMAINT-and-FD.patch
deleted file mode 100644 (file)
index 60ab33a..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-From d6649c499b8ca4fb0bf93153c2a149c78e8a76f8 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Thu, 3 Nov 2016 18:33:25 +0100
-Subject: [PATCH 29/31] BUG/MINOR: srv-state: allow to have both CMAINT and
- FDRAIN flags
-
-CMAINT indicates that the server was *initially* disabled in the
-configuration via the "disabled" keyword. FDRAIN indicates that the
-server was switched to the DRAIN state from the CLI or the agent.
-This it's perfectly valid to have both of them in the state file,
-so the parser must not reject this combination.
-
-This fix must be backported to 1.6.
-(cherry picked from commit e1bde1492a30f5036ca58248e50c27a9e116d9cc)
----
- src/server.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/server.c b/src/server.c
-index b9e72b7..b0c7bbe 100644
---- a/src/server.c
-+++ b/src/server.c
-@@ -1961,6 +1961,7 @@ static void srv_update_state(struct server *srv, int version, char **params)
-                            srv_admin_state != SRV_ADMF_IMAINT &&
-                            srv_admin_state != SRV_ADMF_CMAINT &&
-                            srv_admin_state != (SRV_ADMF_CMAINT | SRV_ADMF_FMAINT) &&
-+                           srv_admin_state != (SRV_ADMF_CMAINT | SRV_ADMF_FDRAIN) &&
-                            srv_admin_state != SRV_ADMF_FDRAIN &&
-                            srv_admin_state != SRV_ADMF_IDRAIN)) {
-                               chunk_appendf(msg, ", invalid srv_admin_state value '%s'", params[2]);
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0030-BUG-MEDIUM-servers-properly-propagate-the-maintenanc.patch b/net/haproxy/patches/0030-BUG-MEDIUM-servers-properly-propagate-the-maintenanc.patch
deleted file mode 100644 (file)
index d4815b3..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-From c449c9835e7d9e02cf0aeafc482364d5090db543 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Thu, 3 Nov 2016 19:22:19 +0100
-Subject: [PATCH 30/31] BUG/MEDIUM: servers: properly propagate the maintenance
- states during startup
-
-Right now there is an issue with the way the maintenance flags are
-propagated upon startup. They are not propagate, just copied from the
-tracked server. This implies that depending on the server's order, some
-tracking servers may not be marked down. For example this configuration
-does not work as expected :
-
-        server s1 1.1.1.1:8000 track s2
-        server s2 1.1.1.1:8000 track s3
-        server s3 1.1.1.1:8000 track s4
-        server s4 wtap:8000 check inter 1s disabled
-
-It results in s1/s2 being up, and s3/s4 being down, while all of them
-should be down.
-
-The only clean way to process this is to run through all "root" servers
-(those not tracking any other server), and to propagate their state down
-to all their trackers. This is the same algorithm used to propagate the
-state changes. It has to be done both to compute the IDRAIN flag and the
-IMAINT flag. However, doing so requires that tracking servers are not
-marked as inherited maintenance anymore while parsing the configuration
-(and given that it is wrong, better drop it).
-
-This fix also addresses another side effect of the bug above which is
-that the IDRAIN/IMAINT flags are stored in the state files, and if
-restored while the tracked server doesn't have the equivalent flag,
-the servers may end up in a situation where it's impossible to remove
-these flags. For example in the configuration above, after removing
-"disabled" on server s4, the other servers would have remained down,
-and not anymore with this fix. Similarly, the combination of IMAINT
-or IDRAIN with their respective forced modes was not accepted on
-reload, which is wrong as well.
-
-This bug has been present at least since 1.5, maybe even 1.4 (it came
-with tracking support). The fix needs to be backported there, though
-the srv-state parts are irrelevant.
-
-This commit relies on previous patch to silence warnings on startup.
-(cherry picked from commit 757478e900ebc1e67c1fe060b9b561d276cab3e1)
----
- include/proto/server.h |  1 +
- src/cfgparse.c         |  7 -------
- src/haproxy.c          |  4 ++++
- src/server.c           | 42 +++++++++++++++++++++++++++++++++++++++---
- 4 files changed, 44 insertions(+), 10 deletions(-)
-
-diff --git a/include/proto/server.h b/include/proto/server.h
-index d75cc9f..b6572ba 100644
---- a/include/proto/server.h
-+++ b/include/proto/server.h
-@@ -44,6 +44,7 @@ struct server *server_find_by_id(struct proxy *bk, int id);
- struct server *server_find_by_name(struct proxy *bk, const char *name);
- struct server *server_find_best_match(struct proxy *bk, char *name, int id, int *diff);
- void apply_server_state(void);
-+void srv_compute_all_admin_states(struct proxy *px);
- /* functions related to server name resolution */
- int snr_update_srv_status(struct server *s);
-diff --git a/src/cfgparse.c b/src/cfgparse.c
-index b8289a2..365b283 100644
---- a/src/cfgparse.c
-+++ b/src/cfgparse.c
-@@ -8275,13 +8275,6 @@ out_uri_auth_compat:
-                                       goto next_srv;
-                               }
--                              /* if the other server is forced disabled, we have to do the same here */
--                              if (srv->admin & SRV_ADMF_MAINT) {
--                                      newsrv->admin |= SRV_ADMF_IMAINT;
--                                      newsrv->state = SRV_ST_STOPPED;
--                                      newsrv->check.health = 0;
--                              }
--
-                               newsrv->track = srv;
-                               newsrv->tracknext = srv->trackers;
-                               srv->trackers = newsrv;
-diff --git a/src/haproxy.c b/src/haproxy.c
-index 2d476f2..1699132 100644
---- a/src/haproxy.c
-+++ b/src/haproxy.c
-@@ -566,6 +566,7 @@ void init(int argc, char **argv)
-       struct wordlist *wl;
-       char *progname;
-       char *change_dir = NULL;
-+      struct proxy *px;
-       chunk_init(&trash, malloc(global.tune.bufsize), global.tune.bufsize);
-       alloc_trash_buffers(global.tune.bufsize);
-@@ -852,6 +853,9 @@ void init(int argc, char **argv)
-       /* Apply server states */
-       apply_server_state();
-+      for (px = proxy; px; px = px->next)
-+              srv_compute_all_admin_states(px);
-+
-       global_listener_queue_task = task_new();
-       if (!global_listener_queue_task) {
-               Alert("Out of memory when initializing global task\n");
-diff --git a/src/server.c b/src/server.c
-index b0c7bbe..f2923ae 100644
---- a/src/server.c
-+++ b/src/server.c
-@@ -705,6 +705,40 @@ void srv_clr_admin_flag(struct server *s, enum srv_admin mode)
-               srv_clr_admin_flag(srv, mode);
- }
-+/* principle: propagate maint and drain to tracking servers. This is useful
-+ * upon startup so that inherited states are correct.
-+ */
-+static void srv_propagate_admin_state(struct server *srv)
-+{
-+      struct server *srv2;
-+
-+      if (!srv->trackers)
-+              return;
-+
-+      for (srv2 = srv->trackers; srv2; srv2 = srv2->tracknext) {
-+              if (srv->admin & (SRV_ADMF_MAINT | SRV_ADMF_CMAINT))
-+                      srv_set_admin_flag(srv2, SRV_ADMF_IMAINT);
-+
-+              if (srv->admin & SRV_ADMF_DRAIN)
-+                      srv_set_admin_flag(srv2, SRV_ADMF_IDRAIN);
-+      }
-+}
-+
-+/* Compute and propagate the admin states for all servers in proxy <px>.
-+ * Only servers *not* tracking another one are considered, because other
-+ * ones will be handled when the server they track is visited.
-+ */
-+void srv_compute_all_admin_states(struct proxy *px)
-+{
-+      struct server *srv;
-+
-+      for (srv = px->srv; srv; srv = srv->next) {
-+              if (srv->track)
-+                      continue;
-+              srv_propagate_admin_state(srv);
-+      }
-+}
-+
- /* Note: must not be declared <const> as its list will be overwritten.
-  * Please take care of keeping this list alphabetically sorted, doing so helps
-  * all code contributors.
-@@ -1955,15 +1989,17 @@ static void srv_update_state(struct server *srv, int version, char **params)
-                       p = NULL;
-                       errno = 0;
-                       srv_admin_state = strtol(params[2], &p, 10);
-+
-+                      /* inherited statuses will be recomputed later */
-+                      srv_admin_state &= ~SRV_ADMF_IDRAIN & ~SRV_ADMF_IMAINT;
-+
-                       if ((p == params[2]) || errno == EINVAL || errno == ERANGE ||
-                           (srv_admin_state != 0 &&
-                            srv_admin_state != SRV_ADMF_FMAINT &&
--                           srv_admin_state != SRV_ADMF_IMAINT &&
-                            srv_admin_state != SRV_ADMF_CMAINT &&
-                            srv_admin_state != (SRV_ADMF_CMAINT | SRV_ADMF_FMAINT) &&
-                            srv_admin_state != (SRV_ADMF_CMAINT | SRV_ADMF_FDRAIN) &&
--                           srv_admin_state != SRV_ADMF_FDRAIN &&
--                           srv_admin_state != SRV_ADMF_IDRAIN)) {
-+                           srv_admin_state != SRV_ADMF_FDRAIN)) {
-                               chunk_appendf(msg, ", invalid srv_admin_state value '%s'", params[2]);
-                       }
--- 
-2.7.3
-
diff --git a/net/haproxy/patches/0031-BUG-vars-Fix-set-var-converter-because-of-a-typo.patch b/net/haproxy/patches/0031-BUG-vars-Fix-set-var-converter-because-of-a-typo.patch
deleted file mode 100644 (file)
index 248d9a4..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-From 9c017e541bb3cee2e2884cdc53a4cb4627be5dad Mon Sep 17 00:00:00 2001
-From: Christopher Faulet <cfaulet@haproxy.com>
-Date: Wed, 9 Nov 2016 16:15:32 +0100
-Subject: [PATCH 31/31] BUG: vars: Fix 'set-var' converter because of a typo
-
-The 'set-var' converter uses function smp_conv_store (vars.c). In this function,
-we should use the first argument (index 0) to retrieve the variable name and its
-scope. But because of a typo, we get the scope of the second argument (index
-1). In this case, there is no second argument. So the scope used was always 0
-(SCOPE_SESS), always setting the variable in the session scope.
-
-So, due to this bug, this rules
-
-  tcp-request content accept if { src,set-var(txn.foo) -m found }
-
-always set the variable 'sess.foo' instead of 'txn.foo'.
-(cherry picked from commit 0099a8ca9d58cb4cff943bf6374b55b42a23fbfb)
----
- src/vars.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/vars.c b/src/vars.c
-index a3dd85c..8645905 100644
---- a/src/vars.c
-+++ b/src/vars.c
-@@ -379,7 +379,7 @@ static inline int sample_store_stream(const char *name, enum vars_scope scope, s
- /* Returns 0 if fails, else returns 1. */
- static int smp_conv_store(const struct arg *args, struct sample *smp, void *private)
- {
--      return sample_store_stream(args[0].data.var.name, args[1].data.var.scope, smp);
-+      return sample_store_stream(args[0].data.var.name, args[0].data.var.scope, smp);
- }
- /* This fucntions check an argument entry and fill it with a variable
--- 
-2.7.3
-
index 424f1f6265f0cfa033b2253b098f8042f898f652..42e154ce705a3293c8f485ec6385faf2d6bfd8cc 100644 (file)
@@ -1,14 +1,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=https_dns_proxy
-PKG_VERSION:=2016-09-04
-PKG_RELEASE=1
+PKG_VERSION:=2017-01-07
+PKG_RELEASE=2
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/aarond10/https_dns_proxy/
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=9e617b76bfd97adfff23e0e8bf2862ce4aee8682
+PKG_SOURCE_VERSION:=c62ce3f6807a4067230a8bc5ea5a829f532de785
 PKG_MAINTAINER:=Aaron Drew <aarond10@gmail.com>
 PKG_LICENSE:=MIT
 
index df1b220455a95b29c66e263949acf7ba2690f475..333f3cac3ecb14914331c41fddf5782cbc8957c3 100644 (file)
@@ -16,7 +16,7 @@ start_instance() {
 
        procd_open_instance
        procd_set_param command ${PROG} \
-               -l "$listen_addr" -p "$listen_port" \
+               -a "$listen_addr" -p "$listen_port" \
                -u "$user" -g "$group"
        procd_set_param respawn
        procd_close_instance
index b92760d2974e89c1f7f6acc63b5376800adcf156..e1491f7794242bccc19f3ae7ab1ab13c427dd2db 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=iotivity
-PKG_VERSION:=1.1.0
+PKG_VERSION:=1.2.1
 PKG_RELEASE=1
 
 PKG_SOURCE:=${PKG_NAME}-${PKG_VERSION}.tar.gz
 PKG_SOURCE_URL:=http://mirrors.kernel.org/${PKG_NAME}/${PKG_VERSION}/
-PKG_MD5SUM:=98f8d5b0304c357520c4343d983491e2
+PKG_MD5SUM:=7dcd9f0f48263c6b27a2c3d085dd7278b5c0feed1dfec8872a04899707fa23d8
 PKG_USE_MIPS16:=0
 
 PKG_BUILD_DEPENDS:=boost
@@ -26,13 +26,13 @@ PKG_LICENSE_FILES:=LICENSE.md
 PKG_CONFIG_DEPENDS := \
        CONFIG_PACKAGE_iotivity \
        CONFIG_PACKAGE_iotivity-cpp \
-       CONFIG_PACKAGE_iotivity-things-manager-lib \
+       CONFIG_PACKAGE_iotivity-resource-directory-lib \
        CONFIG_PACKAGE_iotivity-oic-middle \
-       CONFIG_PACKAGE_iotivity-things-manager \
        CONFIG_PACKAGE_iotivity-resource-container-lib \
        CONFIG_PACKAGE_iotivity-resource-container-sample \
        CONFIG_PACKAGE_iotivity-resource-container-hue \
        CONFIG_PACKAGE_iotivity-example-garage \
+       CONFIG_PACKAGE_iotivity-example-simple \
        CONFIG_PACKAGE_iotivity_DEBUG \
        CONFIG_PACKAGE_iotivity_SECURE
 
@@ -43,7 +43,7 @@ include $(INCLUDE_DIR)/scons.mk
 define Package/iotivity
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=@!USE_UCLIBC +libpthread +librt +libuuid
+  DEPENDS:=@!USE_UCLIBC +libpthread +librt +libuuid +libsqlite3 +PACKAGE_iotivity_SECURE:libmbedtls
   TITLE:=IoTivity C Library
   URL:=https://www.iotivity.org
   MENU:=1
@@ -63,10 +63,15 @@ define Package/iotivity/config
 
        config PACKAGE_iotivity_SECURE
                bool "IoTivity with security support"
-               default y
                help
                  Activate security support.
 
+       config PACKAGE_iotivity_LOGGING
+               bool "IoTivity with logging support"
+               default y
+               help
+                 Activate logging support.
+                 This will make IoTivity write a lot of log messages to stdout.
   endif
 endef
 
@@ -84,24 +89,19 @@ define Package/iotivity-cpp/description
     Open Interconnect Consortium Specification.
 endef
 
-
-define Package/iotivity-things-manager-lib
+define Package/iotivity-resource-directory-lib
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+iotivity +iotivity-cpp +libstdcpp
-  TITLE:=IoTivity things manager lib
+  DEPENDS:=+iotivity +iotivity-cpp
+  TITLE:=IoTivity Resource Directory library
   URL:=https://www.iotivity.org
 endef
 
-define Package/iotivity-things-manager-lib/description
-    IoTivity things-manager lib
-endef
-
 
 define Package/iotivity-oic-middle
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+iotivity +iotivity-cpp
+  DEPENDS:=+iotivity +iotivity-cpp +iotivity-resource-directory-lib
   TITLE:=IoTivity OIC Middle
   URL:=https://www.iotivity.org
 endef
@@ -110,19 +110,6 @@ define Package/iotivity-oic-middle/description
     IoTivity OIC Middle
 endef
 
-
-define Package/iotivity-things-manager
-  SECTION:=net
-  CATEGORY:=Network
-  DEPENDS:=+iotivity +iotivity-cpp +iotivity-things-manager-lib
-  TITLE:=IoTivity things manager
-  URL:=https://www.iotivity.org
-endef
-
-define Package/iotivity-things-manager/description
-    IoTivity things manager
-endef
-
 define Package/iotivity-resource-container-lib
   SECTION:=net
   CATEGORY:=Network
@@ -150,7 +137,7 @@ endef
 define Package/iotivity-example-garage
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+iotivity +iotivity-cpp
+  DEPENDS:=+iotivity +iotivity-cpp +iotivity-resource-directory-lib
   TITLE:=IoTivity Garage example
   URL:=https://www.iotivity.org
 endef
@@ -159,57 +146,53 @@ define Package/iotivity-example-garage/description
     An IoTivity example application
 endef
 
+define Package/iotivity-example-simple
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+iotivity +iotivity-cpp +iotivity-resource-directory-lib
+  TITLE:=IoTivity simple client + server
+  URL:=https://www.iotivity.org
+endef
+
+define Package/iotivity-example-simple/description
+    The IoTivity simple client and simple server exmaple
+endef
+
 
 PKG_TINYCBOR_NAME:=tinycbor
-PKG_TINYCBOR_VERSION:=43e3ac9490cf19459ec7b7bd13df3b66810fb62a
-PKG_TINYCBOR_SOURCE:=$(PKG_TINYCBOR_NAME)-$(PKG_TINYCBOR_VERSION).tar.bz2
 PKG_TINYCBOR_PROTO:=git
+PKG_TINYCBOR_VERSION:=0.4
+PKG_TINYCBOR_SOURCE_VERSION:=a088996aa5f59b4f27f20fadad053d88bee357d4
+PKG_TINYCBOR_SOURCE:=$(PKG_TINYCBOR_NAME)-$(PKG_TINYCBOR_VERSION).tar.bz2
 PKG_TINYCBOR_SOURCE_URL:=https://github.com/01org/tinycbor.git
 PKG_TINYCBOR_SUBDIR:=$(PKG_TINYCBOR_NAME)
-#PKG_TINYCBOR_MIRROR_MD5SUM:=?
 
 define Download/iotivity-tinycbor
   FILE:=$(PKG_TINYCBOR_SOURCE)
   URL:=$(PKG_TINYCBOR_SOURCE_URL)
   PROTO:=$(PKG_TINYCBOR_PROTO)
-  VERSION:=$(PKG_TINYCBOR_VERSION)
+  VERSION:=$(PKG_TINYCBOR_SOURCE_VERSION)
   SUBDIR:=$(PKG_TINYCBOR_SUBDIR)
-  #MIRROR_MD5SUM:=$(PKG_TINYCBOR_MIRROR_MD5SUM)
 endef
 $(eval $(call Download,iotivity-tinycbor))
 
-PKG_SQLITE_NAME:=sqlite
-PKG_SQLITE_VERSION:=3081101
-PKG_SQLITE_SOURCE:=$(PKG_SQLITE_NAME)-amalgamation-$(PKG_SQLITE_VERSION).zip
-PKG_SQLITE_SOURCE_URL:=http://www.sqlite.org/2015/
-PKG_SQLITE_SUBDIR:=$(PKG_SQLITE_NAME)
-PKG_SQLITE_MD5SUM:=94907e831502e2080b76e281cfa24dde
-
-define Download/iotivity-sqlite
-  FILE:=$(PKG_SQLITE_SOURCE)
-  URL:=$(PKG_SQLITE_SOURCE_URL)
-  VERSION:=$(PKG_SQLITE_VERSION)
-  SUBDIR:=$(PKG_SQLITE_SUBDIR)
-  MD5SUM:=$(PKG_SQLITE_MD5SUM)
-endef
-$(eval $(call Download,iotivity-sqlite))
 
+EXTRA_CXXFLAGS += -std=gnu++11
 
 SCONS_OPTIONS += \
        TARGET_OS=linux \
        TARGET_TRANSPORT=IP \
        TARGET_ARCH=$(ARCH) \
        STAGING_DIR=$(STAGING_DIR) \
-       LOGGING=true \
-       $(if $(CONFIG_PACKAGE_iotivity),liboctbstack) \
-       $(if $(CONFIG_PACKAGE_iotivity-cpp),liboc) \
-       $(if $(CONFIG_PACKAGE_iotivity-things-manager-lib),libTGMSDK) \
+       WITH_ENV=true \
+       octbstack oc \
        $(if $(CONFIG_PACKAGE_iotivity-oic-middle),examples) \
-       $(if $(CONFIG_PACKAGE_iotivity-things-manager),ConServerApp ConClientApp BootstrapServerApp) \
        $(if $(CONFIG_PACKAGE_iotivity-resource-container-lib),libResContainer) \
        $(if $(CONFIG_PACKAGE_iotivity-resource-container-sample),containersample) \
        $(if $(CONFIG_PACKAGE_iotivity-resource-container-hue),libHueBundle) \
        $(if $(CONFIG_PACKAGE_iotivity-example-garage),examples) \
+       $(if $(CONFIG_PACKAGE_iotivity-example-simple),examples) \
+       install
 
 ifeq ($(CONFIG_PACKAGE_iotivity_DEBUG),y)
   SCONS_OPTIONS += RELEASE=false
@@ -225,6 +208,10 @@ else
   SCONS_OPTIONS += SECURED=0
 endif
 
+ifeq ($(CONFIG_PACKAGE_iotivity_LOGGING),y)
+  SCONS_OPTIONS += LOGGING=true
+endif
+
 ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
   SCONS_OPTIONS += VERBOSE=true
 endif
@@ -232,9 +219,6 @@ endif
 define Build/Prepare
        $(call Build/Prepare/Default)
        $(TAR) -C $(PKG_BUILD_DIR)/extlibs/tinycbor/ -xjf $(DL_DIR)/$(PKG_TINYCBOR_SOURCE)
-       unzip -d $(PKG_BUILD_DIR)/extlibs/sqlite3/ $(DL_DIR)/$(PKG_SQLITE_SOURCE)
-       mv $(PKG_BUILD_DIR)/extlibs/sqlite3/$(PKG_SQLITE_NAME)-amalgamation-$(PKG_SQLITE_VERSION)/sqlite3.h $(PKG_BUILD_DIR)/extlibs/sqlite3/
-       mv $(PKG_BUILD_DIR)/extlibs/sqlite3/$(PKG_SQLITE_NAME)-amalgamation-$(PKG_SQLITE_VERSION)/sqlite3.c $(PKG_BUILD_DIR)/extlibs/sqlite3/
 endef
 
 
@@ -249,6 +233,7 @@ endef
 
 define Package/iotivity/install
        $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libconnectivity_abstraction.so $(1)/usr/lib/
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboctbstack.so $(1)/usr/lib/
 ifeq ($(CONFIG_PACKAGE_iotivity_SECURE),y)
        $(INSTALL_DIR) $(1)/etc/iotivity/
@@ -262,9 +247,9 @@ define Package/iotivity-cpp/install
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboc_logger.so $(1)/usr/lib/
 endef
 
-define Package/iotivity-things-manager-lib/install
+define Package/iotivity-resource-directory-lib/install
        $(INSTALL_DIR) $(1)/usr/lib
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libTGMSDKLibrary.so $(1)/usr/lib/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libresource_directory.so $(1)/usr/lib/
 endef
 
 define Package/iotivity-oic-middle/install
@@ -272,13 +257,6 @@ define Package/iotivity-oic-middle/install
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/examples/OICMiddle/OICMiddle $(1)/usr/bin/
 endef
 
-define Package/iotivity-things-manager/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/service/things-manager/sampleapp/linux/configuration/bootstrapserver $(1)/usr/bin/
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/service/things-manager/sampleapp/linux/configuration/con-server $(1)/usr/bin/
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/service/things-manager/sampleapp/linux/configuration/con-client $(1)/usr/bin/
-endef
-
 define Package/iotivity-resource-container-lib/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/librcs_common.so $(1)/usr/lib/
@@ -303,13 +281,31 @@ define Package/iotivity-example-garage/install
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/garageserver $(1)/usr/bin/
 endef
 
+define Package/iotivity-example-simple/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/simpleclient $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/resource/examples/simpleserver $(1)/usr/bin/
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/include $(1)/usr/include/iotivity
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libconnectivity_abstraction.so $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboctbstack.so $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboc.so $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/liboc_logger.so $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/out/linux/$(ARCH)/$(APP_OPTIM)/libresource_directory.so $(1)/usr/lib/
+endef
+       
 
 $(eval $(call BuildPackage,iotivity))
 $(eval $(call BuildPackage,iotivity-cpp))
-$(eval $(call BuildPackage,iotivity-things-manager-lib))
+$(eval $(call BuildPackage,iotivity-resource-directory-lib))
 $(eval $(call BuildPackage,iotivity-oic-middle))
-$(eval $(call BuildPackage,iotivity-things-manager))
 $(eval $(call BuildPackage,iotivity-resource-container-lib))
 $(eval $(call BuildPackage,iotivity-resource-container-sample))
 $(eval $(call BuildPackage,iotivity-resource-container-hue))
 $(eval $(call BuildPackage,iotivity-example-garage))
+$(eval $(call BuildPackage,iotivity-example-simple))
index 91849e22c5e7bb26c2f3f3e02f760904ef0170a7..c8f19f53a32aaf2e10a4fad3452729661bd0c01d 100644 (file)
Binary files a/net/iotivity/files/etc/iotivity/oic_svr_db.cbor and b/net/iotivity/files/etc/iotivity/oic_svr_db.cbor differ
index 5842a14f578df93c01ca796eef0552f02808215e..2155071e9148187ddabd8f830ed5fe915758c250 100644 (file)
@@ -8,83 +8,47 @@
                         {
                             "href": "/oic/res",
                             "rel": "",
-                            "rt": "",
-                            "if": ""
+                            "rt": ["oic.wk.res"],
+                            "if": ["oic.if.ll"]
                         },
                         {
                             "href": "/oic/d",
                             "rel": "",
-                            "rt": "",
-                            "if": ""
+                            "rt": ["oic.wk.d"],
+                            "if": ["oic.if.baseline", "oic.if.r"]
                         },
                         {
                             "href": "/oic/p",
                             "rel": "",
-                            "rt": "",
-                            "if": ""
-                        },
-                        {
-                            "href": "/oic/res/d",
-                            "rel": "",
-                            "rt": "",
-                            "if": ""
-                        },
-                        {
-                            "href": "/oic/res/types/d",
-                            "rel": "",
-                            "rt": "",
-                            "if": ""
-                        },
-                        {
-                            "href": "/oic/ad",
-                            "rel": "",
-                            "rt": "",
-                            "if": ""
+                            "rt": ["oic.wk.p"],
+                            "if": ["oic.if.baseline", "oic.if.r"]
                         },
                         {
                             "href": "/oic/sec/acl",
                             "rel": "",
-                            "rt": "",
-                            "if": ""
-                        },
-                        {
-                            "href": "/oic/sec/amacl",
-                            "rel": "",
-                            "rt": "",
-                            "if": ""
-                        },
-                        {
-                            "href": "/oic/sec/doxm",
-                            "rel": "",
-                            "rt": "",
-                            "if": ""
-                        },
-                        {
-                            "href": "/oic/sec/pstat",
-                            "rel": "",
-                            "rt": "",
-                            "if": ""
+                            "rt": ["oic.r.acl"],
+                            "if": ["oic.if.baseline"]
                         }
                     ],
                     "permission": 2
                 },
                 {
-                    "subjectuuid": "32323232-3232-3232-3232-323232323232",
+                    "subjectuuid": "*",
                     "resources": [
                         {
-                            "href": "/oic/sec/acl",
+                            "href": "/oic/sec/doxm",
                             "rel": "",
-                            "rt": "",
-                            "if": ""
-                        } ,
+                            "rt": ["oic.r.doxm"],
+                            "if": ["oic.if.baseline"]
+                        },
                         {
-                            "href": "/oic/sec/cred",
+                            "href": "/oic/sec/pstat",
                             "rel": "",
-                            "rt": "",
-                            "if": ""
+                            "rt": ["oic.r.pstat"],
+                            "if": ["oic.if.baseline"]
                         }
                     ],
-                    "permission": 31
+                    "permission": 2
                 },
                 {
                     "subjectuuid": "*",
                         {
                             "href": "*",
                             "rel": "",
-                            "rt": "",
-                            "if": ""
+                            "rt": ["oic.core"],
+                            "if": ["oic.if.baseline"]
                         }
                     ],
-                    "permission": 6
+                    "permission": 7
                 }
             ]
         },
         "rowneruuid": "31313131-3131-3131-3131-313131313131",
         "cm": 0,
         "tm": 0,
-        "om": 3,
-        "sm": 3
+        "om": 4,
+        "sm": 4
         },
     "doxm": {
         "oxms": [0],
         "owned": true,
         "deviceuuid": "31313131-3131-3131-3131-313131313131",
         "devowneruuid": "32323232-3232-3232-3232-323232323232",
-        "rowneruuid": "31313131-3131-3131-3131-313131313131",
-        "dpc": false
+        "rowneruuid": "31313131-3131-3131-3131-313131313131"
     },
     "cred": {
         "creds": [
                 }
             }
         ],
-        "rowneruuid": "32323232-3232-3232-3232-323232323232"
+        "rowneruuid": "31313131-3131-3131-3131-313131313131"
     }
 }
index 7e9a39543c5072ac311e095722236f3dffbb0319..8a40e731236f22c08f83cd55612f5f578504ed6f 100644 (file)
@@ -1,7 +1,18 @@
+--- a/plugins/SConscript
++++ b/plugins/SConscript
+@@ -35,7 +35,7 @@ if target_os not in ['android', 'arduino
+     SConscript(os.path.join('src', 'SConscript'))
+-    SConscript(os.path.join('unittests', 'SConscript'))
++#    SConscript(os.path.join('unittests', 'SConscript'))
+     if build_sample == 'ON':
+           if target_os in ['linux']:
 --- a/resource/SConscript
 +++ b/resource/SConscript
-@@ -75,7 +75,7 @@ if target_os == 'linux':
-       SConscript('csdk/stack/samples/linux/secure/SConscript')
+@@ -78,7 +78,7 @@ if target_os in ['linux', 'windows']:
+               SConscript('csdk/stack/samples/linux/secure/SConscript')
  
        # Build C/C++ unit tests
 -      SConscript('unit_tests.scons')
  
  elif target_os == 'darwin':
        env.Command('../../out/darwin/iotivity-csdk.framework',None,src_dir + '/tools/darwin/mkfwk_osx.sh')
---- a/resource/csdk/security/provisioning/ck_manager/SConscript
-+++ b/resource/csdk/security/provisioning/ck_manager/SConscript
-@@ -47,4 +47,4 @@ x509_env.AppendUnique(LIBS = ['Base64'])
- x509_env.AppendUnique(LIBS = ['Json'])
- SConscript('sample/SConscript')
--SConscript('unittest/SConscript')
-+# SConscript('unittest/SConscript')
---- a/service/resource-encapsulation/SConscript
-+++ b/service/resource-encapsulation/SConscript
-@@ -113,10 +113,10 @@ SConscript('examples/SConscript')
- # Build UnitTests Resource Client , resourceCache and resourceBroker and 
- # DiscoveryManager
- ################################################ ######################
--if target_os == 'linux':
--    SConscript('unittests/SConscript')
--    SConscript('src/resourceCache/unittests/SConscript')
--    SConscript('src/resourceBroker/unittest/SConscript')
-+# if target_os == 'linux':
-+#     SConscript('unittests/SConscript')
-+#     SConscript('src/resourceCache/unittests/SConscript')
-+#     SConscript('src/resourceBroker/unittest/SConscript')
- if target_os == 'android':
-     SConscript('android/SConscript')
-\ No newline at end of file
---- a/service/things-manager/SConscript
-+++ b/service/things-manager/SConscript
-@@ -75,6 +75,6 @@ SConscript('sampleapp/SConscript')
- ######################################################################
- # Build UnitTests Things Manager
- ################################################ ######################
--if target_os == 'linux':
+--- a/resource/csdk/resource-directory/SConscript
++++ b/resource/csdk/resource-directory/SConscript
+@@ -114,8 +114,3 @@ if 'SERVER' in rd_mode:
+ if target_os in ['linux']:
+     SConscript('samples/SConscript')
+-######################################################################
+-# Build UnitTests of the Resource Directory
+-################################################ ######################
+-if target_os in ['linux']:
 -    SConscript('unittests/SConscript')
-+# if target_os == 'linux':
-+#     SConscript('unittests/SConscript')
---- a/service/resource-hosting/SConscript
-+++ b/service/resource-hosting/SConscript
-@@ -94,8 +94,8 @@ resourcehosting_env.UserInstallTargetHea
-       'service/resource-hosting', 'Hosting.h')
- # Go to build Unit test
--if target_os == 'linux':
--      SConscript('unittest/SConscript')
-+# if target_os == 'linux':
-+#     SConscript('unittest/SConscript')
- # Go to build sample apps
- SConscript('SampleApp/SConscript')
---- a/service/easy-setup/mediator/csdk/SConscript
-+++ b/service/easy-setup/mediator/csdk/SConscript
-@@ -124,8 +124,8 @@ if target_os == 'linux':
+--- a/service/coap-http-proxy/SConscript
++++ b/service/coap-http-proxy/SConscript
+@@ -84,6 +84,3 @@ local_env.UserInstallTargetHeader('inclu
  ######################################################################
- #Build UnitTestcases for Mediator[CSDK]
- ################################################ ######################
--if target_os == 'linux':
+ if target_os in ['linux', 'tizen']:
+     SConscript('samples/SConscript')
+-
+-if target_os in ['linux']:
 -    SConscript('unittests/SConscript')
-+# if target_os == 'linux':
-+#     SConscript('unittests/SConscript')
+--- a/service/easy-setup/enrollee/SConscript
++++ b/service/easy-setup/enrollee/SConscript
+@@ -123,7 +123,3 @@ if target_os == 'arduino':
+ if target_os in ['linux']:
+       SConscript('../sampleapp/enrollee/linux/SConscript')
+-      #Build UnitTestcases for Enrollee
+-      if enrollee_env.get('SECURED') == '0':
+-              SConscript('../enrollee/unittests/SConscript')
+-
 --- a/service/easy-setup/mediator/richsdk/SConscript
 +++ b/service/easy-setup/mediator/richsdk/SConscript
-@@ -138,6 +138,6 @@ if target_os == 'linux':
- ######################################################################
- #Build UnitTestcases for Mediator[RichSDK]
- ################################################ ######################
--if target_os == 'linux':
--    SConscript('unittests/SConscript')
-+# if target_os == 'linux':
-+#     SConscript('unittests/SConscript')
+@@ -163,11 +163,3 @@ if target_os in ['linux']:
+ if target_os in ['android']:
+       SConscript('../../sampleapp/mediator/android/SConscript')
+-
+-######################################################################
+-#Build UnitTestcases for Mediator[RichSDK]
+-################################################ ######################
+-if env.get('SECURED') == '0':
+-   if target_os == 'linux':
+-       SConscript('unittests/SConscript')
+-
 --- a/service/resource-container/SConscript
 +++ b/service/resource-container/SConscript
-@@ -209,8 +209,8 @@ lib_env = conf2.Finish()
- ######################################################################
- # build resource container unit tests
- ######################################################################
--if target_os == 'linux':
--    SConscript('unittests/SConscript')
-+# if target_os == 'linux':
-+#     SConscript('unittests/SConscript')
+@@ -223,12 +223,6 @@ else:
+ lib_env = conf2.Finish()
  
  ######################################################################
+-# build resource container unit tests
+-######################################################################
+-if target_os in ['linux']:
+-    SConscript('unittests/SConscript')
+-
+-######################################################################
  # Build Container Sample
---- a/plugins/SConscript
-+++ b/plugins/SConscript
-@@ -35,7 +35,7 @@ if target_os not in ['android', 'arduino
-     SConscript(os.path.join('src', 'SConscript'))
--    SConscript(os.path.join('unittests', 'SConscript'))
-+#    SConscript(os.path.join('unittests', 'SConscript'))
-     if build_sample == 'ON':
-           if target_os in ['linux']:
---- a/service/scene-manager/SConscript
-+++ b/service/scene-manager/SConscript
-@@ -101,8 +101,8 @@ scenemanager_env.UserInstallTargetHeader
- scenemanager_env.UserInstallTargetHeader('include/RemoteSceneAction.h', 'service/scene-manager', 'RemoteSceneAction.h')
+ ######################################################################
+ if target_os not in ['ios']:
+--- a/service/resource-encapsulation/SConscript
++++ b/service/resource-encapsulation/SConscript
+@@ -121,14 +121,5 @@ resourceClient_env.UserInstallTargetHead
+ ######################################################################
+ SConscript('examples/SConscript')
  
- # Go to build Unit test
--if target_os == 'linux':
+-######################################################################
+-# Build UnitTests Resource Client , resourceCache and resourceBroker and 
+-# DiscoveryManager
+-################################################ ######################
+-if target_os in ['linux']:
 -    SConscript('unittests/SConscript')
-+# if target_os == 'linux':
-+#     SConscript('unittests/SConscript')
- # Go to build sample apps
--SConscript('sampleapp/SConscript')
-+# SConscript('sampleapp/SConscript')
+-    SConscript('src/resourceCache/unittests/SConscript')
+-    SConscript('src/resourceBroker/unittest/SConscript')
+-
+ if target_os == 'android':
+     SConscript('android/SConscript')
 --- a/service/resource-encapsulation/src/common/SConscript
 +++ b/service/resource-encapsulation/src/common/SConscript
-@@ -122,9 +122,9 @@ if target_os == 'linux':
-               'expiryTimer/unittests/ExpiryTimerTest.cpp'
-               ]
--      rcs_common_test = rcs_common_test_env.Program('rcs_common_test', rcs_common_test_src)
--      Alias("rcs_common_test", rcs_common_test)
--      env.AppendTarget('rcs_common_test')
-+#     rcs_common_test = rcs_common_test_env.Program('rcs_common_test', rcs_common_test_src)
-+#     Alias("rcs_common_test", rcs_common_test)
-+#     env.AppendTarget('rcs_common_test')
-       if env.get('TEST') == '1':
-               from tools.scons.RunTest import *
+@@ -22,10 +22,10 @@
+ # rcs_common (primitiveResource and expiryTimer) build script
+ ##
+ import os
++Import('env')
+ # SConscript file for Local PKI google tests
+-gtest_env = SConscript('#extlibs/gtest/SConscript')
+-lib_env = gtest_env.Clone()
++lib_env = env.Clone()
+ # Add third party libraries
+ SConscript('#service/third_party_libs.scons', exports = 'lib_env')
 --- a/service/resource-encapsulation/src/serverBuilder/SConscript
 +++ b/service/resource-encapsulation/src/serverBuilder/SConscript
-@@ -110,9 +110,9 @@ if target_os == 'linux':
-       server_builder_test_src = env.Glob('unittests/*.cpp')
--      server_builder_test = server_builder_test_env.Program('rcs_server_test', server_builder_test_src)
--      Alias("rcs_server_test", server_builder_test)
--      env.AppendTarget('rcs_server_test')
-+#     server_builder_test = server_builder_test_env.Program('rcs_server_test', server_builder_test_src)
-+#     Alias("rcs_server_test", server_builder_test)
-+#     env.AppendTarget('rcs_server_test')
+@@ -21,9 +21,11 @@
+ ##
+ # rcs_server (Server Builder) project build script
+ ##
++import os
++Import('env')
++
+ # SConscript file for Local PKI google tests
+-gtest_env = SConscript('#extlibs/gtest/SConscript')
+-lib_env = gtest_env.Clone()
++lib_env = env.Clone()
+ # Add third party libraries
+ SConscript('#service/third_party_libs.scons', exports = 'lib_env')
+--- a/service/scene-manager/SConscript
++++ b/service/scene-manager/SConscript
+@@ -100,9 +100,5 @@ scenemanager_env.UserInstallTargetHeader
+ scenemanager_env.UserInstallTargetHeader('include/RemoteScene.h', 'service/scene-manager', 'RemoteScene.h')
+ scenemanager_env.UserInstallTargetHeader('include/RemoteSceneAction.h', 'service/scene-manager', 'RemoteSceneAction.h')
  
-       if env.get('TEST') == '1':
-               from tools.scons.RunTest import *
+-# Go to build Unit test
+-if target_os in ['linux']:
+-    SConscript('unittests/SConscript')
+-
+ # Go to build sample apps
+ SConscript('sampleapp/SConscript')
diff --git a/net/iotivity/patches/004-use-env.patch b/net/iotivity/patches/004-use-env.patch
deleted file mode 100644 (file)
index 7e1df81..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-From 884e831ed07607097614276f6bbf192993228100 Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
-Date: Tue, 2 Jun 2015 11:08:17 +0200
-Subject: [PATCH 3/4] 004-use-env.patch
-
----
- build_common/SConscript | 22 ++++++++++++++++++++++
- 1 file changed, 22 insertions(+)
-
---- a/build_common/SConscript
-+++ b/build_common/SConscript
-@@ -151,6 +151,26 @@ tc_set_msg = '''
- * cause inexplicable errors.                                                  *
- *******************************************************************************
- '''
-+env['ENV'] = os.environ
-+if 'CC' in os.environ:
-+      env['CC'] = Split(os.environ['CC'])
-+      print "using CC from environment: %s" % env['CC']
-+if 'CXX' in os.environ:
-+      env['CXX'] = Split(os.environ['CXX'])
-+      print "using CXX from environment: %s" % env['CXX']
-+if 'CFLAGS' in os.environ:
-+      env['CFLAGS'] = Split(os.environ['CFLAGS'])
-+      print "using CFLAGS from environment: %s" % env['CFLAGS']
-+if 'CXXFLAGS' in os.environ:
-+      env['CXXFLAGS'] = Split(os.environ['CXXFLAGS'])
-+      print "using CXXFLAGS from environment: %s" % env['CXXFLAGS']
-+if 'CPPFLAGS' in os.environ:
-+      env['CPPFLAGS'] = Split(os.environ['CPPFLAGS'])
-+      print "using CPPFLAGS from environment: %s" % env['CPPFLAGS']
-+if 'LDFLAGS' in os.environ:
-+      env['LINKFLAGS'] = Split(os.environ['LDFLAGS'])
-+      print "using LDFLAGS/LINKFLAGS from environment: %s" % env['LINKFLAGS']
-+
- if env.get('VERBOSE') == False:
-       env['CCCOMSTR'] = "Compiling $TARGET"
-       env['SHCCCOMSTR'] = "Compiling $TARGET"
diff --git a/net/iotivity/patches/020-Do-not-set-architecture-specific-flags.patch b/net/iotivity/patches/020-Do-not-set-architecture-specific-flags.patch
deleted file mode 100644 (file)
index b49cb52..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-From 980ef34a085f654e74c9896e8143e6f970049b6c Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke@hauke-m.de>
-Date: Mon, 22 Jun 2015 19:39:58 +0200
-Subject: [PATCH 3/5] Do not set architecture specific flags
-
-Setting architecture specific flags causes problems when you want to
-build something which is not covered by these.
-
-Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
----
- build_common/linux/SConscript                     | 20 --------------------
- resource/csdk/connectivity/build/linux/SConscript | 20 --------------------
- 2 files changed, 40 deletions(-)
-
---- a/build_common/linux/SConscript
-+++ b/build_common/linux/SConscript
-@@ -24,20 +24,3 @@ env.AppendUnique(LINKFLAGS = ['-ldl', '-
- # Set arch flags that match best TARGET_ARCH variable
- target_arch = env.get('TARGET_ARCH')
--if target_arch in ['x86']:
--      env.AppendUnique(CCFLAGS = ['-m32'])
--      env.AppendUnique(LINKFLAGS = ['-m32'])
--elif target_arch in ['x86_64']:
--      env.AppendUnique(CCFLAGS = ['-m64'])
--      env.AppendUnique(LINKFLAGS = ['-m64'])
--elif target_arch in ['arm'] or target_arch.find('v5') > 0:
--      env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
--elif target_arch.find('v7a-hard') > 0:
--      env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
--      env.AppendUnique(CPPFLAGS = ['-mfloat-abi=hard'])
--      env.AppendUnique(CCFLAGS = ['-mfloat-abi=hard'])
--      env.AppendUnique(LINKFLAGS = ['-mfloat-abi=hard'])
--elif target_arch.find('v7a') > 0:
--      env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
--elif target_arch.find('arm64') >= 0:
--      env.AppendUnique(CPPFLAGS = ['-march=armv8-a'])
---- a/resource/csdk/connectivity/build/linux/SConscript
-+++ b/resource/csdk/connectivity/build/linux/SConscript
-@@ -22,20 +22,3 @@ env.AppendUnique(LINKFLAGS = ['-ldl', '-
- # Set arch flags
- target_arch = env.get('TARGET_ARCH')
--if target_arch in ['x86']:
--      env.AppendUnique(CCFLAGS = ['-m32'])
--      env.AppendUnique(LINKFLAGS = ['-m32'])
--elif target_arch in ['x86_64']:
--      env.AppendUnique(CCFLAGS = ['-m64'])
--      env.AppendUnique(LINKFLAGS = ['-m64'])
--elif target_arch.find('v7a-hard') > 0:
--      env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
--      env.AppendUnique(CPPFLAGS = ['-mfloat-abi=hard'])
--      env.AppendUnique(CCFLAGS = ['-mfloat-abi=hard'])
--      env.AppendUnique(LINKFLAGS = ['-mfloat-abi=hard'])
--elif target_arch.find('v7a') > 0:
--      env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
--elif target_arch.find('arm64') > 0:
--      env.AppendUnique(CPPFLAGS = ['-march=armv8-a'])
--else:
--      env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
diff --git a/net/iotivity/patches/020-linux-Add-more-architectures.patch b/net/iotivity/patches/020-linux-Add-more-architectures.patch
new file mode 100644 (file)
index 0000000..cb01381
--- /dev/null
@@ -0,0 +1,44 @@
+From dabd6597013e1df72b08621b466d136b8d25d110 Mon Sep 17 00:00:00 2001
+From: Philippe Coval <philippe.coval@osg.samsung.com>
+Date: Thu, 29 Sep 2016 10:57:59 +0200
+Subject: [PATCH 20/23] linux: Add more architectures
+
+This does not scale and this check should be removed.
+
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+Author: Hauke Mehrtens <hauke@hauke-m.de>
+Change-Id: Ibb271701904745ee4f5dd689c197228239c37262
+Origin: https://github.com/openwrt/packages/blob/master/net/iotivity/patches/021-add-some-more-architectures.patch
+Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
+Reviewed-on: https://gerrit.iotivity.org/gerrit/14575
+Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
+Reviewed-by: Nivedita Singhvi <niveditasinghvi@gmail.com>
+Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
+Reviewed-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
+---
+ build_common/SConscript                     | 2 +-
+ resource/csdk/connectivity/build/SConscript | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+--- a/build_common/SConscript
++++ b/build_common/SConscript
+@@ -18,7 +18,7 @@ host_target_map = {
+ # Map of os and allowed archs (os: allowed archs)
+ os_arch_map = {
+-              'linux': ['x86', 'x86_64', 'arm', 'arm-v7a', 'armeabi-v7a', 'arm64'],
++              'linux': ['x86', 'x86_64', 'arm', 'arm-v7a', 'armeabi-v7a', 'arm64', 'mips', 'mipsel', 'mips64', 'mips64el', 'i386', 'powerpc', 'sparc', 'aarch64'],
+               'tizen': ['x86', 'x86_64', 'arm', 'arm-v7a', 'armeabi-v7a', 'arm64'],
+               'android': ['x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard', 'arm64-v8a'],
+               'windows': ['x86', 'amd64', 'arm'],
+--- a/resource/csdk/connectivity/build/SConscript
++++ b/resource/csdk/connectivity/build/SConscript
+@@ -14,7 +14,7 @@ host_target_map = {
+ # Map of os and allowed archs (os: allowed archs)
+ os_arch_map = {
+-              'linux': ['x86', 'x86_64', 'arm', 'arm64'],
++              'linux': ['x86', 'x86_64', 'arm', 'arm64', 'mips', 'mipsel', 'mips64', 'mips64el', 'i386', 'powerpc', 'sparc', 'aarch64'],
+               'tizen': ['x86', 'x86_64', 'arm', 'arm64'],
+               'android': ['x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard', 'arm64-v8a'],
+               'windows': ['x86', 'amd64', 'arm'],
diff --git a/net/iotivity/patches/021-add-some-more-architectures.patch b/net/iotivity/patches/021-add-some-more-architectures.patch
deleted file mode 100644 (file)
index 6d570aa..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-From f78ba209b14908bf2b6197293e1f9e3458ddba8e Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke@hauke-m.de>
-Date: Mon, 22 Jun 2015 19:59:47 +0200
-Subject: [PATCH 4/5] add some more architectures
-
-This does not scale and this check should be removed.
-
-Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
----
- build_common/SConscript                     | 2 +-
- resource/csdk/connectivity/build/SConscript | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
---- a/build_common/SConscript
-+++ b/build_common/SConscript
-@@ -14,7 +14,7 @@ host_target_map = {
- # Map of os and allowed archs (os: allowed archs)
- os_arch_map = {
--              'linux': ['x86', 'x86_64', 'arm', 'arm64'],
-+              'linux': ['x86', 'x86_64', 'arm', 'arm64', 'mips', 'mipsel', 'mips64', 'mips64el', 'i386', 'powerpc', 'sparc', 'aarch64'],
-               'tizen': ['x86', 'x86_64', 'arm', 'arm64', 'armeabi-v7a'],
-               'android': ['x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard', 'arm64-v8a'],
-               'windows': ['x86', 'amd64', 'arm'],
---- a/resource/csdk/connectivity/build/SConscript
-+++ b/resource/csdk/connectivity/build/SConscript
-@@ -14,7 +14,7 @@ host_target_map = {
- # Map of os and allowed archs (os: allowed archs)
- os_arch_map = {
--              'linux': ['x86', 'x86_64', 'arm', 'arm64'],
-+              'linux': ['x86', 'x86_64', 'arm', 'arm64', 'mips', 'mipsel', 'mips64', 'mips64el', 'i386', 'powerpc', 'sparc', 'aarch64'],
-               'tizen': ['x86', 'x86_64', 'arm', 'arm64'],
-               'android': ['x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard', 'arm64-v8a'],
-               'windows': ['x86', 'amd64', 'arm'],
diff --git a/net/iotivity/patches/021-build-do-not-set-TARGET_ARCH-to-default.patch b/net/iotivity/patches/021-build-do-not-set-TARGET_ARCH-to-default.patch
new file mode 100644 (file)
index 0000000..2756fde
--- /dev/null
@@ -0,0 +1,39 @@
+From 792f68219b3ab4ff5238e3abc7aa1c68bfa4a22b Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sat, 10 Dec 2016 18:15:32 +0100
+Subject: [PATCH 21/23] build: do not set TARGET_ARCH to default
+
+This check is useless, scons already checks this and returns such an
+error message:
+Invalid value for option TARGET_ARCH: mips.  Valid values are: ['x86', 'x86_64', 'arm', 'arm-v7a', 'armeabi-v7a', 'arm64']
+
+Change-Id: I3f7dd3b9fcae875ab20349203fb77537f24be763
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ build_common/SConscript                     | 3 ---
+ resource/csdk/connectivity/build/SConscript | 2 --
+ 2 files changed, 5 deletions(-)
+
+--- a/build_common/SConscript
++++ b/build_common/SConscript
+@@ -54,9 +54,6 @@ if target_os == 'android':
+ else:
+       default_arch = platform.machine()
+-if default_arch not in os_arch_map[target_os]:
+-      default_arch = os_arch_map[target_os][0].lower()
+-
+ target_arch = ARGUMENTS.get('TARGET_ARCH', default_arch) # target arch
+ # True if binary needs to be installed on board. (Might need root permissions)
+--- a/resource/csdk/connectivity/build/SConscript
++++ b/resource/csdk/connectivity/build/SConscript
+@@ -40,8 +40,6 @@ if target_os not in host_target_map[host
+       Exit(1)
+ default_arch = platform.machine()
+-if default_arch not in os_arch_map[target_os]:
+-      default_arch = os_arch_map[target_os][0].lower()
+ target_arch = ARGUMENTS.get('TARGET_ARCH', default_arch) # target arch
diff --git a/net/iotivity/patches/022-build-restrict-compiler-options-to-supported-archite.patch b/net/iotivity/patches/022-build-restrict-compiler-options-to-supported-archite.patch
new file mode 100644 (file)
index 0000000..dfb546a
--- /dev/null
@@ -0,0 +1,57 @@
+From 39b0c436c77555849da1e68cc8733c67183c291f Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sat, 10 Dec 2016 18:35:04 +0100
+Subject: [PATCH 22/23] build: restrict compiler options to supported
+ architectures
+
+For Linux we currently only support the following architectures:
+'x86', 'x86_64', 'arm', 'arm-v7a', 'armeabi-v7a', 'arm64'
+explicitly check for those architectures and also remove ARM hard float.
+
+Change-Id: I7078530bc2a89b88c7049cc53e8bb3fbe5d75ca8
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ build_common/linux/SConscript                     | 11 +++--------
+ resource/csdk/connectivity/build/linux/SConscript | 11 +++--------
+ 2 files changed, 6 insertions(+), 16 deletions(-)
+
+--- a/build_common/linux/SConscript
++++ b/build_common/linux/SConscript
+@@ -30,14 +30,9 @@ if target_arch in ['x86']:
+ elif target_arch in ['x86_64']:
+       env.AppendUnique(CCFLAGS = ['-m64'])
+       env.AppendUnique(LINKFLAGS = ['-m64'])
+-elif target_arch in ['arm'] or target_arch.find('v5') > 0:
++elif target_arch in ['arm']:
+       env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
+-elif target_arch.find('v7a-hard') > 0:
++elif target_arch in ['arm-v7a', 'armeabi-v7a']:
+       env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
+-      env.AppendUnique(CPPFLAGS = ['-mfloat-abi=hard'])
+-      env.AppendUnique(CCFLAGS = ['-mfloat-abi=hard'])
+-      env.AppendUnique(LINKFLAGS = ['-mfloat-abi=hard'])
+-elif target_arch.find('v7a') > 0:
+-      env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
+-elif target_arch.find('arm64') >= 0:
++elif target_arch.find('arm64') > 0:
+       env.AppendUnique(CPPFLAGS = ['-march=armv8-a'])
+--- a/resource/csdk/connectivity/build/linux/SConscript
++++ b/resource/csdk/connectivity/build/linux/SConscript
+@@ -29,14 +29,9 @@ if target_arch in ['x86']:
+ elif target_arch in ['x86_64']:
+       env.AppendUnique(CCFLAGS = ['-m64'])
+       env.AppendUnique(LINKFLAGS = ['-m64'])
+-elif target_arch.find('v7a-hard') > 0:
+-      env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
+-      env.AppendUnique(CPPFLAGS = ['-mfloat-abi=hard'])
+-      env.AppendUnique(CCFLAGS = ['-mfloat-abi=hard'])
+-      env.AppendUnique(LINKFLAGS = ['-mfloat-abi=hard'])
+-elif target_arch.find('v7a') > 0:
++elif target_arch in ['arm']:
++      env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
++elif target_arch in ['arm-v7a', 'armeabi-v7a']:
+       env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
+ elif target_arch.find('arm64') > 0:
+       env.AppendUnique(CPPFLAGS = ['-march=armv8-a'])
+-else:
+-      env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
diff --git a/net/iotivity/patches/023-build-take-compiler-options-from-environment.patch b/net/iotivity/patches/023-build-take-compiler-options-from-environment.patch
new file mode 100644 (file)
index 0000000..b6a2bfd
--- /dev/null
@@ -0,0 +1,126 @@
+From 5f9513eb341d520d10c48f8ba2bd145063405fdd Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sat, 10 Dec 2016 18:08:05 +0100
+Subject: [PATCH 23/23] build: take compiler options from environment
+
+This makes it possible to compile IoTivity with custom compiler
+options. This way someone can use optimized compiler settings for the
+target CPU. I want to use this in OpenWrt / LEDE to build specific
+IoTivity binaries for each CPU architecture, there the build system
+provides the matching compiler options.
+
+Change-Id: I86772f73b81c41d7e96e51b434fd9e3b4992753a
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ build_common/SConscript                           | 25 +++++++++++++++++++++
+ build_common/linux/SConscript                     | 27 ++++++++++++-----------
+ resource/csdk/connectivity/build/linux/SConscript | 27 ++++++++++++-----------
+ 3 files changed, 53 insertions(+), 26 deletions(-)
+
+--- a/build_common/SConscript
++++ b/build_common/SConscript
+@@ -120,6 +120,7 @@ help_vars.Add(PathVariable('ANDROID_NDK'
+ help_vars.Add(PathVariable('ANDROID_HOME', 'Android SDK path', None, PathVariable.PathAccept))
+ help_vars.Add(PathVariable('ANDROID_GRADLE', 'Gradle binary file', None, PathVariable.PathIsFile))
+ help_vars.Add(EnumVariable('WITH_UPSTREAM_LIBCOAP', 'Use latest stable version of LibCoAP downloaded from github', default_with_upstream_libcoap, allowed_values=('0','1')))
++help_vars.Add(BoolVariable('WITH_ENV', 'Use compiler options from environment', False))
+ AddOption('--prefix',
+                   dest='prefix',
+@@ -153,6 +154,30 @@ else:
+                       )
+ Help(help_vars.GenerateHelpText(env))
++if env.get('WITH_ENV'):
++      env['ENV'] = os.environ
++      if 'CC' in os.environ:
++              env['CC'] = Split(os.environ['CC'])
++              print "using CC from environment: %s" % env['CC']
++      if 'CXX' in os.environ:
++              env['CXX'] = Split(os.environ['CXX'])
++              print "using CXX from environment: %s" % env['CXX']
++      if 'CFLAGS' in os.environ:
++              env['CFLAGS'] = Split(os.environ['CFLAGS'])
++              print "using CFLAGS from environment: %s" % env['CFLAGS']
++      if 'CXXFLAGS' in os.environ:
++              env['CXXFLAGS'] = Split(os.environ['CXXFLAGS'])
++                      print "using CXXFLAGS from environment: %s" % env['CXXFLAGS']
++      if 'CCFLAGS' in os.environ:
++              env['CCFLAGS'] = Split(os.environ['CCFLAGS'])
++              print "using CCFLAGS from environment: %s" % env['CCFLAGS']
++      if 'CPPFLAGS' in os.environ:
++              env['CPPFLAGS'] = Split(os.environ['CPPFLAGS'])
++              print "using CPPFLAGS from environment: %s" % env['CPPFLAGS']
++      if 'LDFLAGS' in os.environ:
++              env['LINKFLAGS'] = Split(os.environ['LDFLAGS'])
++              print "using LDFLAGS/LINKFLAGS from environment: %s" % env['LINKFLAGS']
++
+ tc_set_msg = '''
+ ************************************ Warning **********************************
+ *   Enviornment variable TC_PREFIX/TC_PATH is set. It will change the default *
+--- a/build_common/linux/SConscript
++++ b/build_common/linux/SConscript
+@@ -23,16 +23,17 @@ env.AppendUnique(CCFLAGS = ['-Wall', '-W
+ env.AppendUnique(LIBS = ['dl', 'pthread', 'uuid'])
+ # Set arch flags that match best TARGET_ARCH variable
+-target_arch = env.get('TARGET_ARCH')
+-if target_arch in ['x86']:
+-      env.AppendUnique(CCFLAGS = ['-m32'])
+-      env.AppendUnique(LINKFLAGS = ['-m32'])
+-elif target_arch in ['x86_64']:
+-      env.AppendUnique(CCFLAGS = ['-m64'])
+-      env.AppendUnique(LINKFLAGS = ['-m64'])
+-elif target_arch in ['arm']:
+-      env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
+-elif target_arch in ['arm-v7a', 'armeabi-v7a']:
+-      env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
+-elif target_arch.find('arm64') > 0:
+-      env.AppendUnique(CPPFLAGS = ['-march=armv8-a'])
++if not env.get('WITH_ENV'):
++      target_arch = env.get('TARGET_ARCH')
++      if target_arch in ['x86']:
++              env.AppendUnique(CCFLAGS = ['-m32'])
++              env.AppendUnique(LINKFLAGS = ['-m32'])
++      elif target_arch in ['x86_64']:
++              env.AppendUnique(CCFLAGS = ['-m64'])
++              env.AppendUnique(LINKFLAGS = ['-m64'])
++      elif target_arch in ['arm']:
++              env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
++      elif target_arch in ['arm-v7a', 'armeabi-v7a']:
++              env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
++      elif target_arch.find('arm64') > 0:
++              env.AppendUnique(CPPFLAGS = ['-march=armv8-a'])
+--- a/resource/csdk/connectivity/build/linux/SConscript
++++ b/resource/csdk/connectivity/build/linux/SConscript
+@@ -22,16 +22,17 @@ env.AppendUnique(CCFLAGS = ['-Wall', '-f
+ env.AppendUnique(LIBS = ['dl', 'pthread'])
+ # Set arch flags
+-target_arch = env.get('TARGET_ARCH')
+-if target_arch in ['x86']:
+-      env.AppendUnique(CCFLAGS = ['-m32'])
+-      env.AppendUnique(LINKFLAGS = ['-m32'])
+-elif target_arch in ['x86_64']:
+-      env.AppendUnique(CCFLAGS = ['-m64'])
+-      env.AppendUnique(LINKFLAGS = ['-m64'])
+-elif target_arch in ['arm']:
+-      env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
+-elif target_arch in ['arm-v7a', 'armeabi-v7a']:
+-      env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
+-elif target_arch.find('arm64') > 0:
+-      env.AppendUnique(CPPFLAGS = ['-march=armv8-a'])
++if not env.get('WITH_ENV'):
++      target_arch = env.get('TARGET_ARCH')
++      if target_arch in ['x86']:
++              env.AppendUnique(CCFLAGS = ['-m32'])
++              env.AppendUnique(LINKFLAGS = ['-m32'])
++      elif target_arch in ['x86_64']:
++              env.AppendUnique(CCFLAGS = ['-m64'])
++              env.AppendUnique(LINKFLAGS = ['-m64'])
++      elif target_arch in ['arm']:
++              env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
++      elif target_arch in ['arm-v7a', 'armeabi-v7a']:
++              env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
++      elif target_arch.find('arm64') > 0:
++              env.AppendUnique(CPPFLAGS = ['-march=armv8-a'])
index fd3fe53c7ee711b37fcf372a7824e4abc532ed44..475976d9435990589951f6c3cc076cdbdcf67692 100644 (file)
@@ -1,6 +1,6 @@
 --- a/service/resource-container/SConscript
 +++ b/service/resource-container/SConscript
-@@ -175,36 +175,22 @@ if target_os in ['linux', 'tizen', 'andr
+@@ -191,36 +191,22 @@ if target_os in ['linux', 'tizen', 'andr
  # build hue sample bundle
  ######################################################################
  
@@ -52,4 +52,4 @@
 +hue_resource_bundle_env.UserInstallTargetLib(HueBundle, 'libHueBundle')
  
  ######################################################################
- # build resource container unit tests
+ # Build Container Sample
diff --git a/net/iotivity/patches/040-linux-Use-system-sqlite3.patch b/net/iotivity/patches/040-linux-Use-system-sqlite3.patch
new file mode 100644 (file)
index 0000000..50d55a7
--- /dev/null
@@ -0,0 +1,27 @@
+From 08b403572985a70fe5d652378e1cfa2b72ac6a3d Mon Sep 17 00:00:00 2001
+From: Philippe Coval <philippe.coval@osg.samsung.com>
+Date: Fri, 9 Dec 2016 02:12:04 +0100
+Subject: [PATCH] linux: Use system sqlite3
+
+Problem was discovered on yocto
+
+Change-Id: I5274bed9e4b7ddcdc1b17a265a1886cd78cb631f
+Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
+Reviewed-on: https://gerrit.iotivity.org/gerrit/15305
+Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
+Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
+---
+ resource/csdk/SConscript | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/resource/csdk/SConscript
++++ b/resource/csdk/SConscript
+@@ -191,7 +191,7 @@ if with_tcp == True:
+ if 'SERVER' in rd_mode:
+     liboctbstack_src.append(OCTBSTACK_SRC + 'oicresourcedirectory.c')
+-    if target_os not in ['tizen']:
++    if target_os not in ['linux', 'tizen']:
+         liboctbstack_src.append('#extlibs/sqlite3/sqlite3.c')
+ if target_os in ['linux']:
diff --git a/net/iotivity/patches/040-remove-provisioning.patch b/net/iotivity/patches/040-remove-provisioning.patch
deleted file mode 100644 (file)
index 4696cab..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-From 4488170af944163b62051b2afee60386a9973c72 Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke.mehrtens@intel.com>
-Date: Thu, 31 Mar 2016 10:23:48 +0200
-Subject: [PATCH] remove building of provisioning service
-
-The provisioning service is not used in this build and depends on boost_thread
-which would add an additional unused dependency.
-
-Change-Id: Ic7edab3ae96d77339ea0f48fc76ab2534c49b6ba
-Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
----
- resource/src/SConscript | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/resource/src/SConscript
-+++ b/resource/src/SConscript
-@@ -116,5 +116,5 @@ oclib_env.UserInstallTargetHeader(header
- oclib_env.UserInstallTargetHeader(header_dir + 'CAManager.h', 'resource', 'CAManager.h')
- # Add Provisioning library
--if target_os in ['linux', 'android', 'tizen'] and env.get('SECURED') == '1':
--        SConscript('../provisioning/SConscript')
-+# if target_os in ['linux', 'android', 'tizen'] and env.get('SECURED') == '1':
-+#         SConscript('../provisioning/SConscript')
diff --git a/net/iotivity/patches/050-csdk-move-OCEntityHandlerResponse-from-stack-to-heap.patch b/net/iotivity/patches/050-csdk-move-OCEntityHandlerResponse-from-stack-to-heap.patch
new file mode 100644 (file)
index 0000000..5ba18d8
--- /dev/null
@@ -0,0 +1,54 @@
+From d8cf30cb0abd5fa8f6282b490618204d683b625c Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Mon, 3 Oct 2016 21:00:28 +0200
+Subject: [PATCH 1/3] csdk: move OCEntityHandlerResponse from stack to heap
+
+OCEntityHandlerResponse is over 50KByte and I got a stack overflow on MIPS
+running on LEDE without this patch. Instead of storing
+OCEntityHandlerResponse on the program stack, allocate some memory on
+the heap and free it afterwards again.
+
+This fixes one part of this issue for me:
+https://jira.iotivity.org/browse/IOT-1374
+
+Change-Id: I365a5c7a34dce2dfb0897a20b57a13ba566748ec
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ resource/csdk/stack/src/ocresource.c | 24 +++++++++++++++++-------
+ 1 file changed, 17 insertions(+), 7 deletions(-)
+
+--- a/resource/csdk/stack/src/ocresource.c
++++ b/resource/csdk/stack/src/ocresource.c
+@@ -774,15 +774,25 @@ static bool includeThisResourceInRespons
+ OCStackResult SendNonPersistantDiscoveryResponse(OCServerRequest *request, OCResource *resource,
+                                 OCPayload *discoveryPayload, OCEntityHandlerResult ehResult)
+ {
+-    OCEntityHandlerResponse response = {0};
++    OCEntityHandlerResponse *response = NULL;
++    OCStackResult result = OC_STACK_ERROR;
+-    response.ehResult = ehResult;
+-    response.payload = discoveryPayload;
+-    response.persistentBufferFlag = 0;
+-    response.requestHandle = (OCRequestHandle) request->requestId;
+-    response.resourceHandle = (OCResourceHandle) resource;
++    response = (OCEntityHandlerResponse *)OICCalloc(1, sizeof(*response));
++    VERIFY_PARAM_NON_NULL(TAG, response, "Failed allocating OCEntityHandlerResponse");
+-    return OCDoResponse(&response);
++    response->ehResult = ehResult;
++    response->payload = discoveryPayload;
++    response->persistentBufferFlag = 0;
++    response->requestHandle = (OCRequestHandle) request->requestId;
++    response->resourceHandle = (OCResourceHandle) resource;
++
++    result = OCDoResponse(response);
++
++    OICFree(response);
++    return result;
++
++exit:
++    return OC_STACK_NO_MEMORY;
+ }
+ static OCStackResult EHRequest(OCEntityHandlerRequest *ehRequest, OCPayloadType type,
diff --git a/net/iotivity/patches/051-csdk-move-OCClientResponse-from-stack-to-heap.patch b/net/iotivity/patches/051-csdk-move-OCClientResponse-from-stack-to-heap.patch
new file mode 100644 (file)
index 0000000..db8ede4
--- /dev/null
@@ -0,0 +1,357 @@
+From e8971dd4914c9d42938c4c885b4ac6d784d7e0ff Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Mon, 3 Oct 2016 23:22:36 +0200
+Subject: [PATCH 2/3] csdk: move OCClientResponse from stack to heap
+
+OCClientResponse is about 50KByte and should not be stored on the
+stack. On LEDE with MIPS, musl libc this causes a segmentation fault.
+Moving this structure to the heap is the simple solution for this
+problem, but this structure should be shrined.
+
+There are probably more places were this is stored on the stack and
+will cause problems. This fixes the other issue I saw in
+https://jira.iotivity.org/browse/IOT-1374
+
+Change-Id: I45d8aee4a8151fea51d3318acb1eea61ce579060
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ resource/csdk/stack/src/ocstack.c | 163 ++++++++++++++++++++++++--------------
+ 1 file changed, 102 insertions(+), 61 deletions(-)
+
+--- a/resource/csdk/stack/src/ocstack.c
++++ b/resource/csdk/stack/src/ocstack.c
+@@ -1042,7 +1042,7 @@ OCStackResult HandlePresenceResponse(con
+     OCStackApplicationResult cbResult = OC_STACK_DELETE_TRANSACTION;
+     ClientCB * cbNode = NULL;
+     char *resourceTypeName = NULL;
+-    OCClientResponse response = {.devAddr = {.adapter = OC_DEFAULT_ADAPTER}};
++    OCClientResponse *response = NULL;
+     OCStackResult result = OC_STACK_ERROR;
+     uint32_t maxAge = 0;
+     int uriLen;
+@@ -1057,15 +1057,23 @@ OCStackResult HandlePresenceResponse(con
+         return OC_STACK_ERROR;
+     }
+-    response.payload = NULL;
+-    response.result = OC_STACK_OK;
++    response = (OCClientResponse *)OICCalloc(1, sizeof(*response));
++    if (!response)
++    {
++            OIC_LOG(ERROR, TAG, "Allocating memory for response failed");
++            return OC_STACK_ERROR;
++    }
++    response->devAddr.adapter = OC_DEFAULT_ADAPTER;
+-    CopyEndpointToDevAddr(endpoint, &response.devAddr);
+-    FixUpClientResponse(&response);
++    response->payload = NULL;
++    response->result = OC_STACK_OK;
++
++    CopyEndpointToDevAddr(endpoint, &response->devAddr);
++    FixUpClientResponse(response);
+     if (responseInfo->info.payload)
+     {
+-        result = OCParsePayload(&response.payload,
++        result = OCParsePayload(&response->payload,
+                 PAYLOAD_TYPE_PRESENCE,
+                 responseInfo->info.payload,
+                 responseInfo->info.payloadSize);
+@@ -1075,15 +1083,15 @@ OCStackResult HandlePresenceResponse(con
+             OIC_LOG(ERROR, TAG, "Presence parse failed");
+             goto exit;
+         }
+-        if(!response.payload || response.payload->type != PAYLOAD_TYPE_PRESENCE)
++        if(!response->payload || response->payload->type != PAYLOAD_TYPE_PRESENCE)
+         {
+             OIC_LOG(ERROR, TAG, "Presence payload was wrong type");
+             result = OC_STACK_ERROR;
+             goto exit;
+         }
+-        response.sequenceNumber = ((OCPresencePayload*)response.payload)->sequenceNumber;
+-        resourceTypeName = ((OCPresencePayload*)response.payload)->resourceType;
+-        maxAge = ((OCPresencePayload*)response.payload)->maxAge;
++        response->sequenceNumber = ((OCPresencePayload*)response->payload)->sequenceNumber;
++        resourceTypeName = ((OCPresencePayload*)response->payload)->resourceType;
++        maxAge = ((OCPresencePayload*)response->payload)->maxAge;
+     }
+     // check for unicast presence
+@@ -1091,6 +1099,7 @@ OCStackResult HandlePresenceResponse(con
+                                       responseInfo->isMulticast);
+     if (uriLen < 0 || (size_t)uriLen >= sizeof (presenceUri))
+     {
++        OICFree(response);
+         return OC_STACK_INVALID_URI;
+     }
+     OIC_LOG(ERROR, TAG, "check for unicast presence");
+@@ -1118,7 +1127,7 @@ OCStackResult HandlePresenceResponse(con
+     if (presenceSubscribe)
+     {
+-        if(cbNode->sequenceNumber == response.sequenceNumber)
++        if(cbNode->sequenceNumber == response->sequenceNumber)
+         {
+             OIC_LOG(INFO, TAG, "No presence change");
+             ResetPresenceTTL(cbNode, maxAge);
+@@ -1129,7 +1138,7 @@ OCStackResult HandlePresenceResponse(con
+         if(maxAge == 0)
+         {
+             OIC_LOG(INFO, TAG, "Stopping presence");
+-            response.result = OC_STACK_PRESENCE_STOPPED;
++            response->result = OC_STACK_PRESENCE_STOPPED;
+             if(cbNode->presence)
+             {
+                 OICFree(cbNode->presence->timeOut);
+@@ -1165,7 +1174,7 @@ OCStackResult HandlePresenceResponse(con
+             ResetPresenceTTL(cbNode, maxAge);
+-            cbNode->sequenceNumber = response.sequenceNumber;
++            cbNode->sequenceNumber = response->sequenceNumber;
+         }
+     }
+     else
+@@ -1175,7 +1184,7 @@ OCStackResult HandlePresenceResponse(con
+         if (0 == maxAge)
+         {
+             OIC_LOG(INFO, TAG, "Stopping presence");
+-            response.result = OC_STACK_PRESENCE_STOPPED;
++            response->result = OC_STACK_PRESENCE_STOPPED;
+         }
+     }
+@@ -1191,7 +1200,7 @@ OCStackResult HandlePresenceResponse(con
+     OIC_LOG(INFO, TAG, "Callback for presence");
+-    cbResult = cbNode->callBack(cbNode->context, cbNode->handle, &response);
++    cbResult = cbNode->callBack(cbNode->context, cbNode->handle, response);
+     if (cbResult == OC_STACK_DELETE_TRANSACTION)
+     {
+@@ -1199,7 +1208,8 @@ OCStackResult HandlePresenceResponse(con
+     }
+ exit:
+-    OCPayloadDestroy(response.payload);
++    OCPayloadDestroy(response->payload);
++    OICFree(response);
+     return result;
+ }
+@@ -1240,36 +1250,53 @@ void OCHandleResponse(const CAEndpoint_t
+             OIC_LOG(INFO, TAG, "Receiving A Timeout for this token");
+             OIC_LOG(INFO, TAG, "Calling into application address space");
+-            OCClientResponse response =
+-                {.devAddr = {.adapter = OC_DEFAULT_ADAPTER}};
+-            CopyEndpointToDevAddr(endPoint, &response.devAddr);
+-            FixUpClientResponse(&response);
+-            response.resourceUri = responseInfo->info.resourceUri;
+-            memcpy(response.identity.id, responseInfo->info.identity.id,
+-                                                sizeof (response.identity.id));
+-            response.identity.id_length = responseInfo->info.identity.id_length;
++            OCClientResponse *response = NULL;
++
++            response = (OCClientResponse *)OICCalloc(1, sizeof(*response));
++            if (!response)
++            {
++                OIC_LOG(ERROR, TAG, "Allocating memory for response failed");
++                return;
++            }
++
++            response->devAddr.adapter = OC_DEFAULT_ADAPTER;
++            CopyEndpointToDevAddr(endPoint, &response->devAddr);
++            FixUpClientResponse(response);
++            response->resourceUri = responseInfo->info.resourceUri;
++            memcpy(response->identity.id, responseInfo->info.identity.id,
++                                                sizeof (response->identity.id));
++            response->identity.id_length = responseInfo->info.identity.id_length;
+-            response.result = CAResponseToOCStackResult(responseInfo->result);
++            response->result = CAResponseToOCStackResult(responseInfo->result);
+             cbNode->callBack(cbNode->context,
+-                    cbNode->handle, &response);
++                    cbNode->handle, response);
+             FindAndDeleteClientCB(cbNode);
++            OICFree(response);
+         }
+         else
+         {
+             OIC_LOG(INFO, TAG, "This is a regular response, A client call back is found");
+             OIC_LOG(INFO, TAG, "Calling into application address space");
+-            OCClientResponse response =
+-                {.devAddr = {.adapter = OC_DEFAULT_ADAPTER}};
+-            response.sequenceNumber = MAX_SEQUENCE_NUMBER + 1;
+-            CopyEndpointToDevAddr(endPoint, &response.devAddr);
+-            FixUpClientResponse(&response);
+-            response.resourceUri = responseInfo->info.resourceUri;
+-            memcpy(response.identity.id, responseInfo->info.identity.id,
+-                                                sizeof (response.identity.id));
+-            response.identity.id_length = responseInfo->info.identity.id_length;
++            OCClientResponse *response = NULL;
+-            response.result = CAResponseToOCStackResult(responseInfo->result);
++            response = (OCClientResponse *)OICCalloc(1, sizeof(*response));
++            if (!response)
++            {
++                OIC_LOG(ERROR, TAG, "Allocating memory for response failed");
++                return;
++            }
++            
++            response->devAddr.adapter = OC_DEFAULT_ADAPTER;
++            response->sequenceNumber = MAX_SEQUENCE_NUMBER + 1;
++            CopyEndpointToDevAddr(endPoint, &response->devAddr);
++            FixUpClientResponse(response);
++            response->resourceUri = responseInfo->info.resourceUri;
++            memcpy(response->identity.id, responseInfo->info.identity.id,
++                                                sizeof (response->identity.id));
++            response->identity.id_length = responseInfo->info.identity.id_length;
++
++            response->result = CAResponseToOCStackResult(responseInfo->result);
+             if(responseInfo->info.payload &&
+                responseInfo->info.payloadSize)
+@@ -1359,21 +1386,23 @@ void OCHandleResponse(const CAEndpoint_t
+                 {
+                     OIC_LOG_V(ERROR, TAG, "Unknown Payload type: %d %s",
+                             cbNode->method, cbNode->requestUri);
++                    OICFree(response);
+                     return;
+                 }
+-                if(OC_STACK_OK != OCParsePayload(&response.payload,
++                if(OC_STACK_OK != OCParsePayload(&response->payload,
+                             type,
+                             responseInfo->info.payload,
+                             responseInfo->info.payloadSize))
+                 {
+                     OIC_LOG(ERROR, TAG, "Error converting payload");
+-                    OCPayloadDestroy(response.payload);
++                    OCPayloadDestroy(response->payload);
++                    OICFree(response);
+                     return;
+                 }
+             }
+-            response.numRcvdVendorSpecificHeaderOptions = 0;
++            response->numRcvdVendorSpecificHeaderOptions = 0;
+             if(responseInfo->info.numOptions > 0)
+             {
+                 int start = 0;
+@@ -1391,19 +1420,20 @@ void OCHandleResponse(const CAEndpoint_t
+                         observationOption =
+                             (observationOption << 8) | optionData[i];
+                     }
+-                    response.sequenceNumber = observationOption;
+-                    response.numRcvdVendorSpecificHeaderOptions = responseInfo->info.numOptions - 1;
++                    response->sequenceNumber = observationOption;
++                    response->numRcvdVendorSpecificHeaderOptions = responseInfo->info.numOptions - 1;
+                     start = 1;
+                 }
+                 else
+                 {
+-                    response.numRcvdVendorSpecificHeaderOptions = responseInfo->info.numOptions;
++                    response->numRcvdVendorSpecificHeaderOptions = responseInfo->info.numOptions;
+                 }
+-                if(response.numRcvdVendorSpecificHeaderOptions > MAX_HEADER_OPTIONS)
++                if(response->numRcvdVendorSpecificHeaderOptions > MAX_HEADER_OPTIONS)
+                 {
+                     OIC_LOG(ERROR, TAG, "#header options are more than MAX_HEADER_OPTIONS");
+-                    OCPayloadDestroy(response.payload);
++                    OCPayloadDestroy(response->payload);
++                    OICFree(response);
+                     return;
+                 }
+@@ -1411,19 +1441,19 @@ void OCHandleResponse(const CAEndpoint_t
+                 {
+                     if(&(responseInfo->info.options[i]))
+                     {
+-                        memcpy (&(response.rcvdVendorSpecificHeaderOptions[i-start]),
++                        memcpy (&(response->rcvdVendorSpecificHeaderOptions[i-start]),
+                                 &(responseInfo->info.options[i]), sizeof(OCHeaderOption));
+                     }
+                 }
+             }
+             if (cbNode->method == OC_REST_OBSERVE &&
+-                response.sequenceNumber > OC_OFFSET_SEQUENCE_NUMBER &&
++                response->sequenceNumber > OC_OFFSET_SEQUENCE_NUMBER &&
+                 cbNode->sequenceNumber <=  MAX_SEQUENCE_NUMBER &&
+-                response.sequenceNumber <= cbNode->sequenceNumber)
++                response->sequenceNumber <= cbNode->sequenceNumber)
+             {
+                 OIC_LOG_V(INFO, TAG, "Received stale notification. Number :%d",
+-                                                 response.sequenceNumber);
++                                                 response->sequenceNumber);
+             }
+             else
+             {
+@@ -1432,13 +1462,13 @@ void OCHandleResponse(const CAEndpoint_t
+                 char *targetUri = strstr(cbNode->requestUri, OC_RSRVD_RD_URI);
+                 if (targetUri)
+                 {
+-                    OCUpdateResourceInsWithResponse(cbNode->requestUri, &response);
++                    OCUpdateResourceInsWithResponse(cbNode->requestUri, response);
+                 }
+ #endif
+                 OCStackApplicationResult appFeedback = cbNode->callBack(cbNode->context,
+                                                                         cbNode->handle,
+-                                                                        &response);
+-                cbNode->sequenceNumber = response.sequenceNumber;
++                                                                        response);
++                cbNode->sequenceNumber = response->sequenceNumber;
+                 if (appFeedback == OC_STACK_DELETE_TRANSACTION)
+                 {
+@@ -1459,7 +1489,8 @@ void OCHandleResponse(const CAEndpoint_t
+                         CA_MSG_ACKNOWLEDGE, 0, NULL, NULL, 0, NULL, CA_RESPONSE_FOR_RES);
+             }
+-            OCPayloadDestroy(response.payload);
++            OCPayloadDestroy(response->payload);
++            OICFree(response);
+         }
+         return;
+     }
+@@ -1585,16 +1616,26 @@ void HandleCAErrorResponse(const CAEndpo
+                                    errorInfo->info.tokenLength, NULL, NULL);
+     if (cbNode)
+     {
+-        OCClientResponse response = { .devAddr = { .adapter = OC_DEFAULT_ADAPTER } };
+-        CopyEndpointToDevAddr(endPoint, &response.devAddr);
+-        FixUpClientResponse(&response);
+-        response.resourceUri = errorInfo->info.resourceUri;
+-        memcpy(response.identity.id, errorInfo->info.identity.id,
+-               sizeof (response.identity.id));
+-        response.identity.id_length = errorInfo->info.identity.id_length;
+-        response.result = CAResultToOCResult(errorInfo->result);
++        OCClientResponse *response = NULL;
++
++        response = (OCClientResponse *)OICCalloc(1, sizeof(*response));
++        if (!response)
++        {
++            OIC_LOG(ERROR, TAG, "Allocating memory for response failed");
++            return;
++        }
++
++        response->devAddr.adapter = OC_DEFAULT_ADAPTER;
++        CopyEndpointToDevAddr(endPoint, &response->devAddr);
++        FixUpClientResponse(response);
++        response->resourceUri = errorInfo->info.resourceUri;
++        memcpy(response->identity.id, errorInfo->info.identity.id,
++               sizeof (response->identity.id));
++        response->identity.id_length = errorInfo->info.identity.id_length;
++        response->result = CAResultToOCResult(errorInfo->result);
+-        cbNode->callBack(cbNode->context, cbNode->handle, &response);
++        cbNode->callBack(cbNode->context, cbNode->handle, response);
++        OICFree(response);
+     }
+     ResourceObserver *observer = GetObserverUsingToken(errorInfo->info.token,
diff --git a/net/iotivity/patches/053-src-move-OCClientResponse-from-stack-to-heap.patch b/net/iotivity/patches/053-src-move-OCClientResponse-from-stack-to-heap.patch
new file mode 100644 (file)
index 0000000..523cfe1
--- /dev/null
@@ -0,0 +1,103 @@
+From 7fb5b6a19b06dc5b0a7f32261551b206b1e6a563 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sun, 8 Jan 2017 19:24:26 +0100
+Subject: [PATCH 3/3] src: move OCClientResponse from stack to heap
+
+OCClientResponse is about 50KByte and should not be stored on the
+stack. On LEDE with MIPS, musl libc this causes a segmentation fault.
+Moving this structure to the heap is the simple solution for this
+problem, but this structure should be shrinked.
+
+Change-Id: I7887f93450f45b8031fcdfffb9ee2214fc3d5dd2
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ resource/src/InProcServerWrapper.cpp | 44 +++++++++++++++++++++---------------
+ 1 file changed, 26 insertions(+), 18 deletions(-)
+
+--- a/resource/src/InProcServerWrapper.cpp
++++ b/resource/src/InProcServerWrapper.cpp
+@@ -568,51 +568,58 @@ namespace OC
+         }
+         else
+         {
+-            OCEntityHandlerResponse response;
++            OCEntityHandlerResponse *response = NULL;
++
++            response = (OCEntityHandlerResponse *)OICCalloc(1, sizeof(*response));
++            if (!response) {
++                result = OC_STACK_MALFORMED_RESPONSE;
++                throw OCException(OC::Exception::STR_NULL_RESPONSE, OC_STACK_MALFORMED_RESPONSE);
++            }
++
+ //            OCRepPayload* payLoad = pResponse->getPayload();
+             HeaderOptions serverHeaderOptions = pResponse->getHeaderOptions();
+-            response.requestHandle = pResponse->getRequestHandle();
+-            response.resourceHandle = pResponse->getResourceHandle();
+-            response.ehResult = pResponse->getResponseResult();
++            response->requestHandle = pResponse->getRequestHandle();
++            response->resourceHandle = pResponse->getResourceHandle();
++            response->ehResult = pResponse->getResponseResult();
+-            response.payload = reinterpret_cast<OCPayload*>(pResponse->getPayload());
++            response->payload = reinterpret_cast<OCPayload*>(pResponse->getPayload());
+-            response.persistentBufferFlag = 0;
++            response->persistentBufferFlag = 0;
+-            response.numSendVendorSpecificHeaderOptions = serverHeaderOptions.size();
++            response->numSendVendorSpecificHeaderOptions = serverHeaderOptions.size();
+             int i = 0;
+             for (auto it=serverHeaderOptions.begin(); it != serverHeaderOptions.end(); ++it)
+             {
+-                response.sendVendorSpecificHeaderOptions[i].protocolID = OC_COAP_ID;
+-                response.sendVendorSpecificHeaderOptions[i].optionID =
++                response->sendVendorSpecificHeaderOptions[i].protocolID = OC_COAP_ID;
++                response->sendVendorSpecificHeaderOptions[i].optionID =
+                     static_cast<uint16_t>(it->getOptionID());
+-                response.sendVendorSpecificHeaderOptions[i].optionLength =
++                response->sendVendorSpecificHeaderOptions[i].optionLength =
+                     (it->getOptionData()).length() + 1;
+                 std::string optionData = it->getOptionData();
+                 std::copy(optionData.begin(),
+                          optionData.end(),
+-                         response.sendVendorSpecificHeaderOptions[i].optionData);
+-                response.sendVendorSpecificHeaderOptions[i].optionData[it->getOptionData().length()]
++                         response->sendVendorSpecificHeaderOptions[i].optionData);
++                response->sendVendorSpecificHeaderOptions[i].optionData[it->getOptionData().length()]
+                     = '\0';
+                 i++;
+             }
+-            if(OC_EH_RESOURCE_CREATED == response.ehResult)
++            if(OC_EH_RESOURCE_CREATED == response->ehResult)
+             {
+-                pResponse->getNewResourceUri().copy(response.resourceUri,
+-                        sizeof (response.resourceUri) - 1);
+-                response.resourceUri[pResponse->getNewResourceUri().length()] = '\0';
++                pResponse->getNewResourceUri().copy(response->resourceUri,
++                        sizeof (response->resourceUri) - 1);
++                response->resourceUri[pResponse->getNewResourceUri().length()] = '\0';
+             }
+             if(cLock)
+             {
+                 std::lock_guard<std::recursive_mutex> lock(*cLock);
+-                result = OCDoResponse(&response);
++                result = OCDoResponse(response);
+             }
+             else
+             {
+-                OICFree(response.payload);
++                OICFree(response->payload);
+                 result = OC_STACK_ERROR;
+             }
+@@ -620,6 +627,7 @@ namespace OC
+             {
+                 oclog() << "Error sending response\n";
+             }
++            OICFree(response);
+             return result;
+         }
+     }
diff --git a/net/iotivity/patches/054-resource-encapsulation-deactivate-test-covergae.patch b/net/iotivity/patches/054-resource-encapsulation-deactivate-test-covergae.patch
deleted file mode 100644 (file)
index d30f8f2..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-From 8a1a5562904c1bbdb2bcb332c0a74482d7cdea15 Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
-Date: Wed, 11 Nov 2015 18:10:03 +0100
-Subject: [PATCH 5/5] resource-encapsulation: deactivate test covergae
-
-Change-Id: I9c9b5853ee1521f5963c73c3025b1c0f10393a96
-Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
----
- .../resource-encapsulation/src/common/SConscript   |    4 ----
- .../src/serverBuilder/SConscript                   |    4 ----
- 2 files changed, 8 deletions(-)
-
---- a/service/resource-encapsulation/src/common/SConscript
-+++ b/service/resource-encapsulation/src/common/SConscript
-@@ -66,10 +66,6 @@ if target_os == 'android':
- rcs_common_env.AppendUnique(LIBS = ['dl', 'oc'])
--if not release:
--    rcs_common_env.AppendUnique(CXXFLAGS = ['--coverage'])
--    rcs_common_env.PrependUnique(LIBS = ['gcov'])
--
- ######################################################################
- # Source files and Targets
- ######################################################################
---- a/service/resource-encapsulation/src/serverBuilder/SConscript
-+++ b/service/resource-encapsulation/src/serverBuilder/SConscript
-@@ -67,10 +67,6 @@ server_builder_env.AppendUnique(LIBS = [
- if env.get('LOGGING'):
-       server_builder_env.AppendUnique(LIBS = ['octbstack'])
--if not release:
--    server_builder_env.AppendUnique(CXXFLAGS = ['--coverage'])
--    server_builder_env.PrependUnique(LIBS = ['gcov'])
--
- ######################################################################
- # Source files and Targets
- ######################################################################
diff --git a/net/iotivity/patches/060-security-fix-reading-of-permission-attribute-from-co.patch b/net/iotivity/patches/060-security-fix-reading-of-permission-attribute-from-co.patch
deleted file mode 100644 (file)
index a70a801..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-From b1c29c35cba3eb39af18fb8db0ec676e3d658b1d Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke.mehrtens@intel.com>
-Date: Fri, 17 Jun 2016 17:38:35 +0200
-Subject: [PATCH] security: fix reading of permission attribute from
- configuration
-
-Casting the pointer to the permission attribute from uint16_t to uint64_t
-causes problems on MIPS Big Endian systems and probably othrs as well.
-When the calling method interprets it as uint64_t not the value is
-converted but the pointer is interpreted as it would point to a 64 bit
-integer, but it is only a 16 bit wide integer. On MIPS BE permission was
-always 0 independent of which value between 0 and 32 the permission
-attribute had, this was probably written to some padding area or into
-some other member of the struct.
-
-This patch fixes the memory corruption and makes the code work for me with
-a MIPS BE CPU.
-
-Change-Id: Ifa843e69980ad4309b1e3076b8e2c98c03324352
-Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
----
- resource/csdk/security/src/aclresource.c | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
---- a/resource/csdk/security/src/aclresource.c
-+++ b/resource/csdk/security/src/aclresource.c
-@@ -602,8 +602,11 @@ OicSecAcl_t* CBORPayloadToAcl(const uint
-                                         // Permissions -- Mandatory
-                                         if (strcmp(name, OIC_JSON_PERMISSION_NAME) == 0)
-                                         {
--                                            cborFindResult = cbor_value_get_uint64(&aclMap, (uint64_t *) &acl->permission);
-+                                            uint64_t tmp64;
-+
-+                                            cborFindResult = cbor_value_get_uint64(&aclMap, &tmp64);
-                                             VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding a PERM Value.");
-+                                            acl->permission = tmp64;
-                                         }
-                                         // Period -- Not mandatory
diff --git a/net/iotivity/patches/061-Remove-the-endianness-dependency-for-credential.patch b/net/iotivity/patches/061-Remove-the-endianness-dependency-for-credential.patch
deleted file mode 100644 (file)
index df4cbb5..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-From f182119e571a1b520b4e5ef4ee5e5b5cd243b931 Mon Sep 17 00:00:00 2001
-From: Chul Lee <chuls.lee@samsung.com>
-Date: Wed, 22 Jun 2016 12:40:21 +0900
-Subject: [PATCH] Remove the endianness dependency in cbor conversion.
-
-A similar bug reported from https://gerrit.iotivity.org/gerrit/#/c/8755/
-
-Change-Id: I631bab77f7486f1f45eaff96c67d39606e37c6b6
-Signed-off-by: Chul Lee <chuls.lee@samsung.com>
-Reviewed-on: https://gerrit.iotivity.org/gerrit/8829
-Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
-Reviewed-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
-Reviewed-by: Randeep Singh <randeep.s@samsung.com>
-(cherry picked from commit 24474a8d2555229efb425b6cb63e19b3279ba810)
-Reviewed-on: https://gerrit.iotivity.org/gerrit/9053
----
- resource/csdk/security/src/credresource.c  | 8 ++++++--
- resource/csdk/security/src/pconfresource.c | 5 +++--
- resource/csdk/stack/src/ocpayloadparse.c   | 8 ++++++--
- 3 files changed, 15 insertions(+), 6 deletions(-)
-
---- a/resource/csdk/security/src/credresource.c
-+++ b/resource/csdk/security/src/credresource.c
-@@ -435,8 +435,10 @@ OCStackResult CBORPayloadToCred(const ui
-                             //credid
-                             if (strcmp(name, OIC_JSON_CREDID_NAME)  == 0)
-                             {
--                                cborFindResult = cbor_value_get_uint64(&credMap, (uint64_t *) &cred->credId);
-+                                uint64_t credId = 0;
-+                                cborFindResult = cbor_value_get_uint64(&credMap, &credId);
-                                 VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding CredId.");
-+                                cred->credId = (uint16_t)credId;
-                             }
-                             // subjectid
-                             if (strcmp(name, OIC_JSON_SUBJECTID_NAME)  == 0)
-@@ -451,8 +453,10 @@ OCStackResult CBORPayloadToCred(const ui
-                             // credtype
-                             if (strcmp(name, OIC_JSON_CREDTYPE_NAME)  == 0)
-                             {
--                                cborFindResult = cbor_value_get_uint64(&credMap, (uint64_t *) &cred->credType);
-+                                uint64_t credType = 0;
-+                                cborFindResult = cbor_value_get_uint64(&credMap, &credType);
-                                 VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding CredType.");
-+                                cred->credType = (OicSecCredType_t)credType;
-                             }
-                             // privatedata
-                             if (strcmp(name, OIC_JSON_PRIVATEDATA_NAME)  == 0)
---- a/resource/csdk/security/src/pconfresource.c
-+++ b/resource/csdk/security/src/pconfresource.c
-@@ -642,8 +642,9 @@ OCStackResult CBORPayloadToPconf(const u
-                             // Permissions -- Mandatory
-                             if (strcmp(name, OIC_JSON_PERMISSION_NAME) == 0)
-                             {
--                                cborFindResult = cbor_value_get_uint64(&pdAclMap,
--                                        (uint64_t *) &pdacl->permission);
-+                                uint64_t permission = 0;
-+                                cborFindResult = cbor_value_get_uint64(&pdAclMap, &permission);
-+                                pdacl->permission = (uint16_t)permission;
-                                 VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed to get value");
-                             }
---- a/resource/csdk/stack/src/ocpayloadparse.c
-+++ b/resource/csdk/stack/src/ocpayloadparse.c
-@@ -1169,17 +1169,21 @@ static OCStackResult OCParsePresencePayl
-     if (cbor_value_is_map(rootValue))
-     {
-         CborValue curVal;
-+        uint64_t temp = 0;
-         // Sequence Number
-         CborError err = cbor_value_map_find_value(rootValue, OC_RSRVD_NONCE, &curVal);
-         VERIFY_CBOR_SUCCESS(TAG, err, "Failed finding nonce tag");
--        err = cbor_value_get_uint64(&curVal, (uint64_t *)&payload->sequenceNumber);
-+        err = cbor_value_get_uint64(&curVal, &temp);
-+        payload->sequenceNumber = (uint32_t)temp;
-         VERIFY_CBOR_SUCCESS(TAG, err, "Failed finding nonce value");
-         // Max Age
-         err = cbor_value_map_find_value(rootValue, OC_RSRVD_TTL, &curVal);
-         VERIFY_CBOR_SUCCESS(TAG, err, "Failed finding ttl tag");
--        err = cbor_value_get_uint64(&curVal, (uint64_t *)&payload->maxAge);
-+        temp = 0;
-+        err = cbor_value_get_uint64(&curVal, &temp);
-+        payload->maxAge = (uint32_t)temp;
-         VERIFY_CBOR_SUCCESS(TAG, err, "Failed finding ttl value");
-         // Trigger
diff --git a/net/iotivity/patches/062-Fix-memory-corruption-when-reading-inetgers-from-cbo.patch b/net/iotivity/patches/062-Fix-memory-corruption-when-reading-inetgers-from-cbo.patch
deleted file mode 100644 (file)
index 5ef7492..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-From 7c99ef8bfa024f11452311c36329eeeeece4fd74 Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke.mehrtens@intel.com>
-Date: Wed, 22 Jun 2016 11:41:43 +0200
-Subject: [PATCH] Fix memory corruption when reading inetgers from cbor
-
-When the cbor_value_get_*() function is called with a pointer to some int, it
-should have the correct size. When we cast it to something else it is treated
-as a pointer to an uint64_t in the function for example and them 64 bits gets
-written to memory even with the real type is only 32 bit long. When the real
-type is only 32 bit long some other memory gets overwritten. On Big endian
-systems the least significant bits are cut of so in most cases 0 is read.
-
-With this patch a value cast is used and the value is converted to the other size.
-
-This is the same as in commit 0d64c7c95a5c11a9fb5201e729fd8c75da210c80
-"security: fix reading of permission attribute from configuration"
-
-Change-Id: If5965491241e25ebf60a22dc45d37d74a33cb02f
-Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
----
- resource/csdk/security/src/pconfresource.c |  5 ++++-
- resource/csdk/stack/src/ocpayloadparse.c   | 19 +++++++++++++++----
- 2 files changed, 19 insertions(+), 5 deletions(-)
-
---- a/resource/csdk/security/src/pconfresource.c
-+++ b/resource/csdk/security/src/pconfresource.c
-@@ -507,8 +507,11 @@ OCStackResult CBORPayloadToPconf(const u
-                 while (cbor_value_is_valid(&prm))
-                 {
--                    cborFindResult = cbor_value_get_int(&prm, (int *)&pconf->prm[i++]);
-+                    int prm_val;
-+
-+                    cborFindResult = cbor_value_get_int(&prm, &prm_val);
-                     VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed to get value");
-+                    pconf->prm[i++] = (OicSecPrm_t)prm_val;
-                     cborFindResult = cbor_value_advance(&prm);
-                     VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed to advance value");
-                 }
---- a/resource/csdk/stack/src/ocpayloadparse.c
-+++ b/resource/csdk/stack/src/ocpayloadparse.c
-@@ -287,6 +287,8 @@ static OCStackResult OCParseDiscoveryPay
-         while (cbor_value_is_map(&resourceMap))
-         {
-+            int bitmap;
-+
-             resource = (OCResourcePayload *)OICCalloc(1, sizeof(OCResourcePayload));
-             VERIFY_PARAM_NON_NULL(TAG, resource, "Failed allocating resource payload");
-@@ -319,8 +321,9 @@ static OCStackResult OCParseDiscoveryPay
-             // Bitmap
-             err = cbor_value_map_find_value(&policyMap, OC_RSRVD_BITMAP, &curVal);
-             VERIFY_CBOR_SUCCESS(TAG, err, "to find bitmap tag");
--            err = cbor_value_get_int(&curVal, (int *)&resource->bitmap);
-+            err = cbor_value_get_int(&curVal, &bitmap);
-             VERIFY_CBOR_SUCCESS(TAG, err, "to find bitmap value");
-+            resource->bitmap = (uint8_t)bitmap;
-             // Secure Flag
-             err = cbor_value_map_find_value(&policyMap, OC_RSRVD_SECURE, &curVal);
-@@ -336,8 +339,11 @@ static OCStackResult OCParseDiscoveryPay
-             VERIFY_CBOR_SUCCESS(TAG, err, "to find port tag");
-             if (cbor_value_is_valid(&curVal))
-             {
--                err = cbor_value_get_int(&curVal, (int *)&resource->port);
-+                int port;
-+
-+                err = cbor_value_get_int(&curVal, &port);
-                 VERIFY_CBOR_SUCCESS(TAG, err, "to find port value");
-+                resource->port = (uint16_t)port;
-             }
-             err = cbor_value_advance(&resourceMap);
-@@ -1170,6 +1176,7 @@ static OCStackResult OCParsePresencePayl
-     {
-         CborValue curVal;
-         uint64_t temp = 0;
-+        uint8_t trigger;
-         // Sequence Number
-         CborError err = cbor_value_map_find_value(rootValue, OC_RSRVD_NONCE, &curVal);
-@@ -1189,8 +1196,9 @@ static OCStackResult OCParsePresencePayl
-         // Trigger
-         err = cbor_value_map_find_value(rootValue, OC_RSRVD_TRIGGER, &curVal);
-         VERIFY_CBOR_SUCCESS(TAG, err, "Failed finding trigger tag");
--        err = cbor_value_get_simple_type(&curVal, (uint8_t *)&payload->trigger);
-+        err = cbor_value_get_simple_type(&curVal, &trigger);
-         VERIFY_CBOR_SUCCESS(TAG, err, "Failed finding trigger value");
-+        payload->trigger = (OCPresenceTrigger)trigger;
-         // Resource type name
-         err = cbor_value_map_find_value(rootValue, OC_RSRVD_RESOURCE_TYPE, &curVal);
diff --git a/net/iotivity/patches/070-Resource-container-Backported-init-fix-to-1.1-rel.patch b/net/iotivity/patches/070-Resource-container-Backported-init-fix-to-1.1-rel.patch
deleted file mode 100644 (file)
index c0c0fac..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-From e093390b2839f6039a6ff94ed4942fa45c53a418 Mon Sep 17 00:00:00 2001
-From: Philippe Coval <philippe.coval@osg.samsung.com>
-Date: Tue, 26 Apr 2016 15:28:17 +0200
-Subject: [PATCH] [Resource-container] Backported init fix to 1.1-rel
-
-[Resource-container] Fix member var initialization
-
-Incorrect type was used causing build error.
-
-Origin: 6a10062f1fe64ca75ac6d34541bbd295ef052dcb
-Author: Inga Stotland <inga.stotland@intel.com>
-Change-Id: I701096c3b6512546847cf4e120430f690e920453
-Signed-off-by: Inga Stotland <inga.stotland@intel.com>
-Reviewed-on: https://gerrit.iotivity.org/gerrit/7759
-Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
-Reviewed-by: George Nash <george.nash@intel.com>
-Reviewed-by: Markus Jung <markus.jung85@gmail.com>
-Reviewed-by: Uze Choi <uzchoi@samsung.com>
-Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
-Reviewed-on: https://gerrit.iotivity.org/gerrit/7929
----
- service/resource-container/src/BundleInfoInternal.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/service/resource-container/src/BundleInfoInternal.cpp
-+++ b/service/resource-container/src/BundleInfoInternal.cpp
-@@ -32,8 +32,8 @@ namespace OIC
-             m_resourceCreator = nullptr;
-             m_resourceDestroyer = nullptr;
-             m_bundleHandle = nullptr;
--            m_so_bundle = nullptr;
-+            m_so_bundle = false;
-             m_loaded = false;
-             m_activated = false;
-             m_java_bundle = false;
diff --git a/net/iotivity/patches/070-ssl-fix-compilation-against-non-debug-mbedtls.patch b/net/iotivity/patches/070-ssl-fix-compilation-against-non-debug-mbedtls.patch
new file mode 100644 (file)
index 0000000..903cb72
--- /dev/null
@@ -0,0 +1,27 @@
+From 261cf19bfa3dea10ed0f2ebbb2d945c19c9a2804 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sun, 4 Dec 2016 00:18:37 +0100
+Subject: [PATCH 5/7] ssl: fix compilation against non debug mbedtls
+
+The function mbedtls_debug_set_threshold() is only available when
+MBEDTLS_DEBUG_C is set. make the call depend on this condition.
+
+Change-Id: I8158bc4c55b428167e36084e7a46359c269c5fc7
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
++++ b/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
+@@ -1278,8 +1278,10 @@ static int InitConfig(mbedtls_ssl_config
+ #if !defined(NDEBUG) || defined(TB_LOG)
+     mbedtls_ssl_conf_dbg(conf, DebugSsl, NULL);
++#if defined(MBEDTLS_DEBUG_C)
+     mbedtls_debug_set_threshold(MBED_TLS_DEBUG_LEVEL);
+ #endif
++#endif
+     OIC_LOG_V(DEBUG, NET_SSL_TAG, "Out %s", __func__);
+     return 0;
+ }
diff --git a/net/iotivity/patches/071-ssl-call-mbedtls_version_get_string-only-if-availabl.patch b/net/iotivity/patches/071-ssl-call-mbedtls_version_get_string-only-if-availabl.patch
new file mode 100644 (file)
index 0000000..83aec07
--- /dev/null
@@ -0,0 +1,35 @@
+From cee085e0e62214603b9ae035d63fabca23c491bd Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sun, 8 Jan 2017 01:39:35 +0100
+Subject: [PATCH 6/7] ssl: call mbedtls_version_get_string() only if available
+
+The function mbedtls_version_get_string()  is only available if
+MBEDTLS_VERSION_C is set in the mbedtls configuration. Check this
+before calling this function and print the mbedtls version this was
+compiled against instead if mbedtls_version_get_string()  is not
+available.
+
+This fixes a compile problem when MBEDTLS_VERSION_C is not set.
+
+Change-Id: I54c2c2a3fc1f9d35afa475500e3db68420a1b54a
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
++++ b/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
+@@ -1376,9 +1376,13 @@ CAResult_t CAinitSslAdapter()
+     /* Initialize TLS library
+      */
+ #if !defined(NDEBUG) || defined(TB_LOG)
++#ifdef MBEDTLS_VERSION_C
+     char version[MBED_TLS_VERSION_LEN];
+     mbedtls_version_get_string(version);
+     OIC_LOG_V(INFO, NET_SSL_TAG, "mbed TLS version: %s", version);
++#else
++    OIC_LOG_V(INFO, NET_SSL_TAG, "mbed TLS version: %s", MBEDTLS_VERSION_STRING);
++#endif
+ #endif
+     /* Entropy settings
diff --git a/net/iotivity/patches/072-ssl-call-mbedtls_ssl_conf_renegotiation-only-if-avai.patch b/net/iotivity/patches/072-ssl-call-mbedtls_ssl_conf_renegotiation-only-if-avai.patch
new file mode 100644 (file)
index 0000000..2e2ccb0
--- /dev/null
@@ -0,0 +1,30 @@
+From 3684ac3720f91dc131c1c61689395a69ae1865f9 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sun, 8 Jan 2017 20:31:18 +0100
+Subject: [PATCH 7/7] ssl: call mbedtls_ssl_conf_renegotiation() only if
+ available
+
+The function mbedtls_ssl_conf_renegotiation() is only available if
+MBEDTLS_SSL_RENEGOTIATION is set in the mbedtls configuration. Check this
+before calling this function.
+
+This fixes a compile problem when MBEDTLS_SSL_RENEGOTIATION is not set.
+
+Change-Id: I69f15359d2dcaed1e4fe56fc7799737e38d6c2e7
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
++++ b/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
+@@ -1273,7 +1273,9 @@ static int InitConfig(mbedtls_ssl_config
+     mbedtls_ssl_conf_rng(conf, mbedtls_ctr_drbg_random, &g_caSslContext->rnd);
+     mbedtls_ssl_conf_curves(conf, curve[ADAPTER_CURVE_SECP256R1]);
+     mbedtls_ssl_conf_min_version(conf, MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3);
++#ifdef MBEDTLS_SSL_RENEGOTIATION
+     mbedtls_ssl_conf_renegotiation(conf, MBEDTLS_SSL_RENEGOTIATION_DISABLED);
++#endif
+     mbedtls_ssl_conf_authmode(conf, MBEDTLS_SSL_VERIFY_REQUIRED);
+ #if !defined(NDEBUG) || defined(TB_LOG)
diff --git a/net/iotivity/patches/075-ssl-enable-usage-of-patched-mbed-functions-condition.patch b/net/iotivity/patches/075-ssl-enable-usage-of-patched-mbed-functions-condition.patch
new file mode 100644 (file)
index 0000000..0cbd1ed
--- /dev/null
@@ -0,0 +1,44 @@
+From 01796db0b166e720860eff200acabff410ba6979 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sun, 4 Dec 2016 00:15:21 +0100
+Subject: [PATCH 4/7] ssl: enable usage of patched mbed functions conditionally
+
+Only activate support for the MBEDTLS_KEY_EXCHANGE_ECDH_ANON_ENABLED
+cipher suite when this is actually available in mbedtls.
+This makes it possible to compile IoTivity against a unpatched mbedtls
+version.
+
+Change-Id: Ic56d7faf7597cc5dc08f9d55be29dde898949609
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
++++ b/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
+@@ -237,7 +237,9 @@ int tlsCipher[ADAPTER_CIPHER_MAX][2] =
+ {
+     {MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA, 0},
+     {MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8, 0},
++#ifdef MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256
+     {MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256, 0},
++#endif
+     {MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256, 0},
+     {MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM, 0},
+     {MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, 0}
+@@ -1943,6 +1945,7 @@ CAResult_t CAsetTlsCipherSuite(const uin
+             g_caSslContext->cipher = ADAPTER_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8;
+             break;
+         }
++#ifdef MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256
+         case MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256:
+         {
+ #ifdef __WITH_TLS__
+@@ -1960,6 +1963,7 @@ CAResult_t CAsetTlsCipherSuite(const uin
+             g_caSslContext->cipher = ADAPTER_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA_256;
+             break;
+         }
++#endif
+         case MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256:
+         {
+ #if 0 // PIN OTM
diff --git a/net/iotivity/patches/078-use-system-mbedtls.patch b/net/iotivity/patches/078-use-system-mbedtls.patch
new file mode 100644 (file)
index 0000000..d19c688
--- /dev/null
@@ -0,0 +1,22 @@
+Make it possible to use system mbedtls version
+
+--- a/resource/csdk/connectivity/src/SConscript
++++ b/resource/csdk/connectivity/src/SConscript
+@@ -73,16 +73,7 @@ if env.get('SECURED') == '1':
+       env.AppendUnique(CPPPATH = [src_dir + '/resource/csdk/security/include'])
+       env.AppendUnique(CPPDEFINES = ['__WITH_DTLS__'])
+       env.AppendUnique(CPPPATH = [os.path.join(root_dir, 'external/inc')])
+-      tls_path = 'extlibs/mbedtls';
+-      tls_headers_path = 'mbedtls/include';
+-      if ca_os == 'tizen' and os.path.exists(root_dir + '/' + tls_path):
+-              env.SConscript(os.path.join(root_dir, tls_path + '/SConscript'))
+-              env.AppendUnique(CPPPATH = [os.path.join(root_dir, tls_path + '/' + tls_headers_path)])
+-      else:
+-              if ca_os != 'android':
+-                      env.SConscript('#' + tls_path + '/SConscript')
+-              env.AppendUnique(CPPPATH = ['#' + tls_path + '/' + tls_headers_path])
+-              env.AppendUnique(CA_SRC = [os.path.join(ca_path, 'adapter_util/ca_adapter_net_ssl.c')])
++      env.AppendUnique(CA_SRC = [os.path.join(ca_path, 'adapter_util/ca_adapter_net_ssl.c')])
+ if ((secured == '1') and (with_tcp == True)):
+       env.AppendUnique(CPPDEFINES = ['__WITH_TLS__'])
diff --git a/net/iotivity/patches/080-zigbee_wrapper-do-not-check-for-floating-point.patch b/net/iotivity/patches/080-zigbee_wrapper-do-not-check-for-floating-point.patch
new file mode 100644 (file)
index 0000000..e5a95f0
--- /dev/null
@@ -0,0 +1,31 @@
+From df8360447163762c63994dcb07f9e69a5a365a1c Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sun, 8 Jan 2017 22:01:57 +0100
+Subject: [PATCH 8/8] zigbee_wrapper: do not check for floating point
+
+This makes the compile fail for soft float builds. In such builds the
+double is still 64 bit long.
+
+Change-Id: I45d3f19b49f5d23d2b65307738a362765c5ea1c2
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ plugins/zigbee_wrapper/src/zigbee_wrapper.c | 8 --------
+ 1 file changed, 8 deletions(-)
+
+--- a/plugins/zigbee_wrapper/src/zigbee_wrapper.c
++++ b/plugins/zigbee_wrapper/src/zigbee_wrapper.c
+@@ -37,14 +37,6 @@
+ #include <math.h>
+ #include <errno.h>
+-// The following #define must be here under "math.h".
+-// This ifdef ensures that "__STDC_IEC_559__" is defined. If it is defined,
+-// then we are guaranteed that the 'double' type is 64-bit. Otherwise, the
+-// compilation of this file should fail because we are no longer guaranteed.
+-#ifndef __STDC_IEC_559__
+-#error "Requires IEEE 754 floating point!"
+-#endif
+-
+ #include "zigbee_wrapper.h"
+ #include "telegesis_wrapper.h"
+ #include "pluginlist.h"
index 3a73ef72fdb7efa45ea6565806e583050290b328..1b009db9d16d45e49cee4fde9c80ac2e9db3a802 100644 (file)
@@ -1,35 +1,32 @@
 --- a/resource/csdk/connectivity/src/bt_le_adapter/linux/SConscript
 +++ b/resource/csdk/connectivity/src/bt_le_adapter/linux/SConscript
-@@ -73,7 +73,7 @@ env.AppendUnique(
+@@ -73,7 +73,6 @@ env.AppendUnique(
  
  # The Linux BLE adapter implementation uses GDBus to make D-Bus based
  # method calls to BlueZ.  Pull in the necessary dependencies.
 -env.ParseConfig("pkg-config gio-unix-2.0 --cflags --libs")
-+# env.ParseConfig("pkg-config gio-unix-2.0 --cflags --libs")
  
  # Set up commands to generate GDBus code from the D-Bus introspection
  # XML.
 --- a/resource/csdk/security/provisioning/sample/SConscript
 +++ b/resource/csdk/security/provisioning/sample/SConscript
-@@ -58,7 +58,7 @@ if env.get('SECURED') == '1':
- if env.get('DTLS_WITH_X509') == '1':
-       provisioning_env.AppendUnique(LIBS = ['CKManager'])
-       provisioning_env.AppendUnique(LIBS = ['asn1'])
--provisioning_env.ParseConfig('pkg-config --libs glib-2.0');
-+# provisioning_env.ParseConfig('pkg-config --libs glib-2.0');
- provisioning_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+@@ -70,7 +70,6 @@ if target_os not in ['windows']:
  
+ if target_os not in ['msys_nt', 'windows']:
+       provisioning_env.AppendUnique(LIBS = ['dl', 'm'])
+-      provisioning_env.ParseConfig('pkg-config --libs glib-2.0');
+       provisioning_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
+ else:
+       provisioning_env.AppendUnique(LIBPATH = [os.path.join(env.get('BUILD_DIR'), 'resource', 'csdk')])
 --- a/resource/csdk/security/provisioning/SConscript
 +++ b/resource/csdk/security/provisioning/SConscript
-@@ -76,8 +76,8 @@ provisioning_env.AppendUnique(LIBS = ['t
- if env.get('DTLS_WITH_X509') == '1':
-       provisioning_env.AppendUnique(LIBS = ['CKManager', 'asn1'])
+@@ -73,9 +73,6 @@ provisioning_env.PrependUnique(LIBS = ['
+ provisioning_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509','mbedcrypto'])
  
--if target_os != 'android':
+-if target_os not in ['msys_nt', 'windows', 'android', 'ios']:
 -      provisioning_env.ParseConfig('pkg-config --libs glib-2.0')
-+# if target_os != 'android':
-+#     provisioning_env.ParseConfig('pkg-config --libs glib-2.0')
+-
+ if target_os in ['windows', 'msys_nt']:
+       provisioning_env.AppendUnique(LIBS = ['ws2_32', 'advapi32', 'iphlpapi'])
  
- if target_os == 'tizen':
-       provisioning_env.ParseConfig('pkg-config --cflags --libs sqlite3')
index 3ac71405f864f846cb4d5d5c2a55ad56e9f47624..6b6820d023cbafa65c2edd9f4c54520767734c3d 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=irssi
-PKG_VERSION:=0.8.20
+PKG_VERSION:=0.8.21
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=https://github.com/irssi/irssi/releases/download/0.8.20/
-PKG_MD5SUM:=67d48c5feec2d3b949d088aa4abc3601
+PKG_SOURCE_URL:=https://github.com/irssi/irssi/releases/download/0.8.21/
+PKG_MD5SUM:=b820760c3b4f3b0c24abe4db82b6366a
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index 1de59818c1a3ffbf68fb7b8373b08ed92b4e11b0..738e7f965150db140c6c7df24dd5f64276e1842e 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=isc-dhcp
 UPSTREAM_NAME:=dhcp
-PKG_VERSION:=4.3.3
+PKG_VERSION:=4.3.5
 PKG_RELEASE:=1
 
 PKG_LICENSE:=BSD-3-Clause
@@ -17,8 +17,11 @@ PKG_LICENSE_FILES:=LICENSE
 PKG_MAINTAINER:=Antony Antony <antony@phenome.org>
 
 PKG_SOURCE:=$(UPSTREAM_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=ftp://ftp.isc.org/isc/dhcp/$(PKG_VERSION)
-PKG_MD5SUM:=c5577b09c9017cdd319a11ff6364268e
+PKG_SOURCE_URL:=ftp://ftp.isc.org/isc/dhcp/$(PKG_VERSION) \
+               http://ftp.funet.fi/pub/mirrors/ftp.isc.org/isc/dhcp/$(PKG_VERSION) \
+               http://ftp.iij.ad.jp/pub/network/isc/dhcp/$(PKG_VERSION)
+PKG_MD5SUM:=2b5e5b2fa31c2e27e487039d86f83d3f
+PKG_HASH:=eb95936bf15d2393c55dd505bc527d1d4408289cec5a9fa8abb99f7577e7f954
 
 PKG_FIXUP:=autoreconf
 PKG_BUILD_PARALLEL:=1
@@ -170,6 +173,13 @@ ifeq ($(BUILD_VARIANT),ipv6)
 endif
 
 define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR)                     \
+               BUILD_CC="$(HOSTCC_NOCACHE)"            \
+               CROSS_CC="$(TARGET_CC)"                 \
+               host_alias="$(GNU_TARGET_NAME)"         \
+               target_alias="$(GNU_TARGET_NAME)"       \
+               build_alias="$(GNU_HOST_NAME)"          \
+               all
        $(MAKE) -C $(PKG_BUILD_DIR)                     \
                DESTDIR="$(PKG_INSTALL_DIR)"            \
                BUILD_CC="$(HOSTCC_NOCACHE)"            \
@@ -177,7 +187,7 @@ define Build/Compile
                host_alias="$(GNU_TARGET_NAME)"         \
                target_alias="$(GNU_TARGET_NAME)"       \
                build_alias="$(GNU_HOST_NAME)"          \
-               all install-exec
+               install-exec
 endef
 
 define Package/isc-dhcp-relay-$(BUILD_VARIANT)/install
index 9af0f84e1baaa168c1cd98ce70c8141b9c2344c9..64d82281ef42b58ff212a96ff72128088efe91f8 100644 (file)
@@ -30,7 +30,7 @@ start() {
        local link_selection
        config_get link_selection ipv4 link_selection
        if network_get_device ifname "$link_selection"; then
-               append args "-l $ifname"
+               append args "-U $ifname"
        fi
 
        # relay mode
index 0c6f7563fe1f58cc1f019ee5bbedb9b3683b579a..2d1a170da782977738887c9adfa3510899eb4160 100644 (file)
@@ -28,7 +28,7 @@ start() {
     if [ -n "$relay_lowers" ]; then
         local relay_lower
         for relay_lower in $relay_lowers; do
-            append relay_lower_args "-l $relay_lower"
+            append relay_lower_args "-U $relay_lower"
         done
     fi
 
diff --git a/net/isc-dhcp/patches/100-relay-rfc3527-link-selection.patch b/net/isc-dhcp/patches/100-relay-rfc3527-link-selection.patch
deleted file mode 100644 (file)
index 1c86590..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
---- a/relay/dhcrelay.c
-+++ b/relay/dhcrelay.c
-@@ -60,6 +60,7 @@
- int client_packet_errors = 0; /* Errors sending packets to clients. */
- int add_agent_options = 0;    /* If nonzero, add relay agent options. */
-+int add_rfc3527_suboption = 0;        /* If nonzero, add RFC3527 link selection sub-option. */
- int agent_option_errors = 0;    /* Number of packets forwarded without
-                                  agent options because there was no room. */
-@@ -99,6 +100,8 @@
-       struct sockaddr_in to;
- } *servers;
-+struct interface_info *uplink;
-+
- #ifdef DHCPv6
- struct stream_list {
-       struct stream_list *next;
-@@ -147,6 +150,7 @@
- "                     [-pf <pid-file>] [--no-pid]\n"\
- "                     [-m append|replace|forward|discard]\n" \
- "                     [-i interface0 [ ... -i interfaceN]\n" \
-+"                     [-l interface]\n" \
- "                     server0 [ ... serverN]\n\n" \
- "       dhcrelay -6   [-d] [-q] [-I] [-c <hops>] [-p <port>]\n" \
- "                     [-pf <pid-file>] [--no-pid]\n" \
-@@ -161,6 +165,7 @@
- "                [-pf <pid-file>] [--no-pid]\n" \
- "                [-m append|replace|forward|discard]\n" \
- "                [-i interface0 [ ... -i interfaceN]\n" \
-+"                [-l interface]\n" \
- "                server0 [ ... serverN]\n\n"
- #endif
-@@ -325,6 +330,20 @@
-                               agent_relay_mode = discard;
-                       } else
-                               usage();
-+              } else if (!strcmp (argv [i], "-l")) {
-+                      add_agent_options = 1;
-+                      add_rfc3527_suboption = 1;
-+                      if (++i == argc)
-+                              usage();
-+
-+                      status = interface_allocate(&uplink, MDL);
-+                      if (status != ISC_R_SUCCESS)
-+                              log_fatal("%s: interface_allocate: %s",
-+                                        argv[i],
-+                                        isc_result_totext(status));
-+                      strcpy(uplink->name, argv[i]);
-+                      interface_snorf(uplink, INTERFACE_REQUESTED);
-+                      //interface_dereference(&uplink, MDL);
-               } else if (!strcmp(argv[i], "-D")) {
- #ifdef DHCPv6
-                       if (local_family_set && (local_family == AF_INET6)) {
-@@ -711,12 +730,17 @@
-                                              ip->addresses[0])))
-               return;
-+      /* RFC3527: Replace giaddr address by uplink address. The original
-+       * giaddr will be used in the link selection sub-option */
-+      if (add_rfc3527_suboption)
-+              packet->giaddr = uplink->addresses[0];
-+
-       /* If giaddr is not already set, Set it so the server can
-          figure out what net it's from and so that we can later
-          forward the response to the correct net.    If it's already
-          set, the response will be sent directly to the relay agent
-          that set giaddr, so we won't see it. */
--      if (!packet->giaddr.s_addr)
-+      else if (!packet->giaddr.s_addr)
-               packet->giaddr = ip->addresses[0];
-       if (packet->hops < max_hop_count)
-               packet->hops = packet->hops + 1;
-@@ -1090,6 +1114,9 @@
-               optlen += ip->remote_id_len + 2;    /* RAI_REMOTE_ID + len */
-       }
-+      if (add_rfc3527_suboption)
-+              optlen += 6;
-+
-       /* We do not support relay option fragmenting(multiple options to
-        * support an option data exceeding 255 bytes).
-        */
-@@ -1121,6 +1148,14 @@
-                       memcpy(sp, ip->remote_id, ip->remote_id_len);
-                       sp += ip->remote_id_len;
-               }
-+
-+              if (add_rfc3527_suboption) {
-+                      *sp++ = RAI_LINK_SELECT;
-+                      *sp++ = 4u;
-+                      memcpy(sp, &giaddr.s_addr, 4);
-+                      sp += 4;
-+                      log_debug ("RFC3527 link selection sub-option added: %s", inet_ntoa(giaddr));
-+              }
-       } else {
-               ++agent_option_errors;
-               log_error("No room in packet (used %d of %d) "
diff --git a/net/jool/Makefile b/net/jool/Makefile
new file mode 100644 (file)
index 0000000..aa0e1b9
--- /dev/null
@@ -0,0 +1,114 @@
+#
+# Copyright (C) 2016 Dan Luedtke <mail@danrl.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=jool
+PKG_VERSION:=2016.12.17
+PKG_RELEASE:=1
+
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/NICMx/Jool.git
+PKG_SOURCE_VERSION:=66a791c90751d7941b08c142babe1deec73d0996
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.xz
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_PARALLEL:=1
+PKG_BUILD_DEPENDS:=USE_UCLIBC:argp-standalone USE_MUSL:argp-standalone
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/kernel.mk
+include $(INCLUDE_DIR)/package.mk
+
+MAKE_PATH:=usr
+CONFIGURE_PATH:=usr
+
+define Build/Compile
+       $(MAKE) -C "$(LINUX_DIR)" \
+               KERNEL_DIR="$(LINUX_DIR)" \
+               ARCH="$(LINUX_KARCH)" \
+               CROSS_COMPILE="$(TARGET_CROSS)" \
+               SUBDIRS="$(PKG_BUILD_DIR)/mod/stateful" \
+               V="$(V)" \
+               modules
+       $(MAKE) -C "$(LINUX_DIR)" \
+               KERNEL_DIR="$(LINUX_DIR)" \
+               ARCH="$(LINUX_KARCH)" \
+               CROSS_COMPILE="$(TARGET_CROSS)" \
+               SUBDIRS="$(PKG_BUILD_DIR)/mod/stateless" \
+               V="$(V)" \
+               modules
+       $(call Build/Compile/Default)
+endef
+
+define Package/jool/Default
+  SECTION:=net
+  CATEGORY:=Network
+  URL:=https://www.jool.mx
+  MAINTAINER:=Dan Luedtke <mail@danrl.com>
+endef
+
+define Package/jool/Default/description
+  Jool is an Open Source SIIT and NAT64 for Linux.
+endef
+
+define Package/jool
+  $(call Package/jool/Default)
+  TITLE:=Jool meta-package
+  DEPENDS:=+kmod-jool +jool-tools
+endef
+
+define Package/jool/description
+  $(call Package/jool/Default/description)
+endef
+
+define KernelPackage/jool
+  SECTION:=kernel
+  CATEGORY:=Kernel modules
+  SUBMENU:=Network Support
+  TITLE:=Jool kernel module
+  DEPENDS:= \
+    @IPV6 \
+    +kmod-crypto-md5 \
+    +kmod-nf-conntrack \
+    +kmod-nf-conntrack6
+  FILES:= \
+    $(PKG_BUILD_DIR)/mod/stateful/jool.$(LINUX_KMOD_SUFFIX) \
+    $(PKG_BUILD_DIR)/mod/stateless/jool_siit.$(LINUX_KMOD_SUFFIX)
+endef
+
+define KernelPackage/jool/description
+  $(call Package/jool/Default/description)
+
+  This package provides the kernel module for Jool.
+endef
+
+define Package/jool-tools
+  $(call Package/jool/Default)
+  TITLE:=Jool userspace control programs
+  DEPENDS:=+libnl +ethtool
+endef
+
+define Package/jool-tools/description
+  $(call Package/jool/Default/description)
+
+  This package provides the userspace control programs for Jool.
+endef
+
+define Package/jool-tools/install
+       $(INSTALL_DIR) $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/usr/stateful/jool       $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/usr/stateless/jool_siit $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,jool))
+$(eval $(call KernelPackage,jool))
+$(eval $(call BuildPackage,jool-tools))
index 4f8dc8294adf75adffa028d351777be94d6f00be..2eead1672015691f10d7fc28c4ad136c163cb59f 100644 (file)
@@ -8,16 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=keepalived
-PKG_VERSION:=1.2.16
-PKG_RELEASE:=3
+PKG_VERSION:=1.2.19
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= http://www.keepalived.org/software
-PKG_MD5SUM:=f834ab2cfc2e7300edf1bafaf4a5d83e
+PKG_MD5SUM:=5c98b06639dd50a6bff76901b53febb6
+PKG_HASH:=32fbae732c1cd854cacd7a930d4a26f5bad6372cdecb5e3139f0c17e87493853
 
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
-PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+PKG_MAINTAINER:=Ben Kelly <ben@benjii.net>
 
 PKG_INSTALL:=1
 
@@ -29,7 +30,7 @@ define Package/keepalived
   CATEGORY:=Network
   TITLE:=Failover and monitoring daemon for LVS clusters
   URL:=http://www.keepalived.org/
-  DEPENDS:=+libnl-genl +libopenssl
+  DEPENDS:=+PACKAGE_libnl-genl:libnl-genl +libopenssl
 endef
 
 define Package/keepalived/description
@@ -63,6 +64,8 @@ define Package/keepalived/install
        $(CP) $(PKG_INSTALL_DIR)/etc/keepalived/keepalived.conf $(1)/etc/keepalived/
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/keepalived.init $(1)/etc/init.d/keepalived
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/keepalived.config $(1)/etc/config/keepalived
 endef
 
 $(eval $(call BuildPackage,keepalived))
diff --git a/net/keepalived/files/keepalived.config b/net/keepalived/files/keepalived.config
new file mode 100644 (file)
index 0000000..b2ad5f9
--- /dev/null
@@ -0,0 +1,147 @@
+config global_defs
+       option alt_config_file          "/etc/keepalived/keepalived.conf"
+#      list notification_email         "acassen@firewall.loc"
+#      list notification_email         "failover@firewall.loc"
+#      list notification_email         "sysadmin@firewall.loc"
+#      option notification_email_from  "Alexandre.Cassen@firewall.loc"
+#      option smtp_server              "192.168.200.1"
+#      option smtp_connect_timeout     "30"
+#      option router_id                "LVS_DEVEL"
+#      option vrrp_mcast_group4        "224.0.0.18" # optional, default 224.0.0.18
+#      option vrrp_mcast_group6        "f02::12"    # optional, default ff02::12
+#      option linkbeat_use_polling     "1"
+
+#config ipaddress
+#      option name     "ipaddress0"
+#      option address  "192.168.1.1/24"
+#      option device   "eth0"
+#      option scope    "global"
+
+#config ipaddress
+#      option name     "ipaddress1"
+#      option address  "192.168.1.2/24"
+#      option device   "eth1"
+#      option scope    "global"
+
+#config ipaddress
+#      option name     "ipaddress2"
+#      option address  "192.168.1.1/24"
+#      option device   "eth0"
+#      option scope    "link"
+
+#config ipaddress
+#      option name     "ipaddress3"
+#      option address  "192.168.1.2/24"
+#      option device   "eth2"
+#      option scope    "site"
+
+#config ipaddress
+#      option name     "ipaddress4"
+#      option address  "192.168.1.1/24"
+#      option device   "eth0"
+#      option scope    "host"
+
+#config ipaddress
+#      option name     "ipaddress5"
+#      option address  "192.168.1.2/24"
+#      option device   "eth0"
+#      option scope    "nowhere"
+
+#config route
+#      option name     "route0"
+#      option address  "192.168.1.1/24"
+#      option gateway  "192.168.0.1"
+#      option device   "eth0"
+
+#config route
+#      option name     "route1"
+#      option address  "192.168.2.1/24"
+#      option gateway  "192.168.0.1"
+#      option device   "eth0"
+
+#config route
+#      option name             "route2"
+#      option address          "127.0.0.1"
+#      option blackhole        "1"
+
+#config static_ipaddress
+#      list address    "ipaddress0"
+#      list address    "ipaddress1"
+
+#config static_routes
+#      list route      "route0"
+#      list route      "route1"
+
+#config vrrp_sync_group
+#      option name             "VI_sync_group_1"
+#      list group              "VI_1"
+#      list group              "VI_2"
+#      option smtp_alert       "1"
+#      option notify_backup    "<switch-backup-state-script>"
+#      option notify_master    "<switch-master-state-script>"
+#      option notify_fault     "<switch-fault-state-script>"
+#      option notify           "<switch-any-state-script>"
+#      option global_tracking  1
+
+#config track_interface
+#      option name     "track_intf1"
+#      option value    "eth0"
+#      option weight   "1"
+
+#config track_interface
+#      option name     "track_intf2"
+#      option value    "eth1"
+#      option weight   "2"
+
+#config track_script
+#      option name     "track_script1"
+#      option value    "<script-file1>"
+#      option weight   "1"
+
+#config track_script
+#      option name     "track_script2"
+#      option value    "<script-file2>"
+#      option weight   "2"
+
+#config vrrp_instance
+#      option name                     "VI_1"
+#      option use_vmac                 "eth0"
+#      option native_ipv6              "1"
+#      option state                    "MASTER"
+#      option interface                "eth0"
+#      list track_interface            "track_intf1"
+#      list track_interface            "track_intf2"
+#      list track_script               "track_script1"
+#      list track_script               "track_script2"
+#      option dont_track_primary       "1"
+#      list unicast_peer               "192.168.0.1"
+#      list unicast_peer               "192.168.1.1"
+#      list virtual_ipaddress          "ipaddress2"
+#      list virtual_ipaddress          "ipaddress3"
+#      list virtual_ipaddress_excluded "ipaddress4"
+#      list virtual_ipaddress_excluded "ipaddress5"
+#      list virtual_routes             "route1"
+#      list virtual_routes             "route2"
+#      option mcast_src_ip             "224.0.0.1"
+#      option unicast_src_ip           "192.168.0.1"
+#      option virtual_router_id        "128"
+#      option priority                 "128"
+#      option advert_int               "5"
+#      option nopreempt                "1"
+#      option preempt_delay            "500"
+#      option debug                    "2"
+#      option notify_backup            "<switch-backup-state-script>"
+#      option notify_master            "<switch-master-state-script>"
+#      option notify_fault             "<switch-fault-state-script>"
+#      option notify_stop              "<switch-stop-state-script>"
+#      option notify                   "<switch-any-state-script>"
+#      option smtp_alert               "1"
+#      option accept                   "1"
+
+#config vrrp_script
+#      option script           "<script-file>"
+#      option interval         "5"
+#      option weight           "10"
+#      option fall             "2"
+#      option rise             "3"
+
index 1d1ada2545e232ad4a6a5f1a6f1569d552425fb2..6e850f02d8f5c80f3b39ae7e742dd1e2877ab363 100644 (file)
 # Copyright (C) 2007-2015 OpenWrt.org
 
 START=70
+STOP=01
 
-SERVICE_USE_PID=1
+USE_PROCD=1
 
-start() {
-       service_start /usr/sbin/keepalived
+KEEPALIVED_CONF=/tmp/keepalived.conf
+
+INDENT_1=\\t
+INDENT_2=$INDENT_1$INDENT_1
+
+config_section_open() {
+       local tag=$1
+       local name=$2
+
+       printf "$tag" >> $KEEPALIVED_CONF
+       [ -n "$name" ] && printf " $name" >> $KEEPALIVED_CONF
+       printf " {\n" >> $KEEPALIVED_CONF
+}
+
+config_section_close() {
+       printf "}\n\n" >> $KEEPALIVED_CONF
+}
+
+config_foreach_wrapper() {
+       local section=$1
+       local function=$1
+
+       # Convention is that 'function' and 'section' are the same
+       config_foreach $function $section
+}
+
+print_elems_indent() {
+       local config=$1
+       shift
+       local indent=$1
+       shift
+       [ -z "$indent" ] && indent="$INDENT_1"
+       for opt in $*; do
+               local $opt
+               local no_val=0
+               if [ ${opt:0:7} == "no_val_" ]; then
+                       opt=${opt:7}
+                       no_val=1
+               fi
+               config_get $opt $config $opt
+               eval optval=\$$opt
+               [ -z "$optval" ] && continue
+               printf "$indent$opt" >> $KEEPALIVED_CONF
+               [ "$no_val" == "0" ] && printf " $optval" >> $KEEPALIVED_CONF
+               printf "\n" >> $KEEPALIVED_CONF
+       done
+       unset optval
+}
+
+print_list_indent() {
+       local lst=$1
+       local indent=$2
+       local lst_elems
+       [ -z "$indent" ] && indent=$INDENT_1
+
+       eval lst_elems=\$$lst
+       [ -z "$lst_elems" ] && return 0
+
+       printf "$indent$lst {\n" >> $KEEPALIVED_CONF
+       for e in $lst_elems; do
+               [ -n "$eval_item_func" ]
+               printf "$indent$INDENT_1$e\n" >> $KEEPALIVED_CONF
+       done
+       printf "$indent}\n" >> $KEEPALIVED_CONF
+}
+
+global_defs() {
+       local linkbeat_use_polling notification_email
+
+       config_get alt_config_file $1 alt_config_file
+       [ -z "$alt_config_file" ] || return 0
+
+       config_get_bool linkbeat_use_polling $1 linkbeat_use_polling 0
+       [ $linkbeat_use_polling -gt 0 ] && printf "linkbeat_use_polling\n\n" >> $KEEPALIVED_CONF
+
+       config_get notification_email $1 notification_email
+       print_list_indent notification_email
+
+       print_elems_indent $1 $INDENT_1 notification_email_from smtp_server smtp_connect_timeout \
+                  router_id vrrp_mcast_group4 vrrp_mcast_group6
+}
+
+print_ipaddress_indent() {
+       local section=$1
+       local curr_ipaddr=$2
+       local indent=$3
+
+       local address device scope name
+       config_get name    $section name
+       [ "$name" != "$curr_ipaddr" ] && return 0
+
+       config_get address $section address
+       config_get device  $section device
+       config_get scope   $section scope
+
+       # Default indent
+       [ -z "$indent" ] && indent=$INDENT_1
+
+       # If no address or device exit
+       [ -z "$address" -o -z "$device" ] && return 0
+
+       # Add IP address/netmask and device
+       printf "$indent$address dev $device" >> $KEEPALIVED_CONF
+       # Add scope
+       [ -n "$scope" ] && printf " scope $scope" >> $KEEPALIVED_CONF
+
+       printf "\n" >> $KEEPALIVED_CONF
+}
+
+static_ipaddress() {
+       local address
+       config_get address "$1" address
+       for a in $address; do
+               config_foreach print_ipaddress_indent ipaddress $a
+       done
+}
+
+print_route_indent() {
+       local section=$1
+       local curr_route=$2
+       local indent=$3
+
+       local name blackhole address src_addr gateway device scope table
+
+       config_get name           $section name
+       [ "$name" != "$curr_route" ] && return 0
+
+       config_get_bool blackhole $section blackhole 0
+       config_get address        $section address
+       config_get src_addr       $section src_addr
+       config_get gateway        $section gateway
+       config_get device         $section device
+       config_get table          $section table
+
+       # If no address exit
+       [ -z "$address" ] && return 0
+
+       # Default indent
+       [ -z "$indent" ] && indent=$INDENT_1
+
+       [ $blackhole -gt 0 ] && {
+               printf "${indent}blackhole $address\n" >> $KEEPALIVED_CONF
+               return 0
+       }
+       # Add src addr or address
+       if [ -n "$src_addr" ]; then
+               printf "${indent}src $src_addr $address" >> $KEEPALIVED_CONF
+       else
+               [ -z "$device" ] && return 0
+               printf "$indent$address" >> $KEEPALIVED_CONF
+       fi
+       # Add route/gateway
+       [ -n "$gateway" ] && printf " via $gateway" >> $KEEPALIVED_CONF
+       # Add device
+       printf " dev $device" >> $KEEPALIVED_CONF
+       # Add scope
+       [ -n "$scope" ] && printf " scope $scope" >> $KEEPALIVED_CONF
+       # Add table
+       [ -n "$table" ] && printf " table $table" >> $KEEPALIVED_CONF
+       printf "\n" >> $KEEPALIVED_CONF
+
+}
+
+print_track_elem_indent() {
+       local section=$1
+       local curr_track_elem=$2
+       local indent=$3
+
+       local script name value
+       config_get name    $section name
+       [ "$name" != "$curr_track_elem" ] && return 0
+
+       config_get value  $section value
+       config_get weight $section weight
+
+       [ -z "$value" ] && return 0
+
+       printf "$indent$value" >> $KEEPALIVED_CONF
+       [ -n "$weight" ] && printf " weight $weight" >> $KEEPALIVED_CONF
+       printf "\n" >> $KEEPALIVED_CONF
+}
+
+static_routes() {
+       local route
+       config_get route "$1" route
+       for r in $route; do
+               config_foreach print_route_indent route $r
+       done
+}
+
+# Count 'vrrp_instance' with the given name ; called by vrrp_instance_check()
+vrrp_instance_name_count() {
+       local name
+       config_get name $1 name
+       [ "$name" == "$2" ] && count=$((count + 1))
 }
 
-stop() {
-       service_stop /usr/sbin/keepalived
+# Check if there's a 'vrrp_instance' section with the given name
+vrrp_instance_check() {
+       local count=0
+       local name=$1
+       config_foreach vrrp_instance_name_count vrrp_instance $name
+       [ $count -gt 0 ] && return 0 || return 1
 }
+
+vrrp_sync_group() {
+       local group name
+       local valid_group
+
+       # No name for group, exit
+       config_get name $1 name
+       [ -z "$name" ] && return 0
+
+       # No members for group, exit
+       config_get group $1 group
+       [ -z "$group" ] && return 0
+
+       # Check if we have 'vrrp_instance's defined for 
+       # each member and remove names with not vrrp_instance defined
+       for m in $group; do
+               vrrp_instance_check $m && valid_group="$valid_group $m"
+       done
+       [ -z "$valid_group" ] && return 0
+
+       config_section_open "vrrp_sync_group" "$name"
+
+       group="$valid_group"
+       print_list_indent group
+
+       print_elems_indent $1 $INDENT_1 notify_backup notify_master notify_fault \
+               notify no_val_smtp_alert no_val_global_tracking
+       config_section_close
+}
+
+vrrp_instance() {
+       local name auth_type auth_pass
+
+       config_get name $1 name
+       [ -z "$name" ] && return 0
+
+       config_section_open "vrrp_instance" "$name"
+
+       config_get auth_type $1 auth_type
+       config_get auth_pass $1 auth_pass
+       [ -n "$auth_type" -a -n "$auth_pass" ] && {
+               printf "${INDENT_1}authentication {\n" >> $KEEPALIVED_CONF
+               printf "${INDENT_2}auth_type $auth_type\n" >> $KEEPALIVED_CONF
+               printf "${INDENT_2}auth_pass $auth_pass\n" >> $KEEPALIVED_CONF
+               printf "$INDENT_1}\n" >> $KEEPALIVED_CONF
+       }
+
+       print_elems_indent $1 $INDENT_1 use_vmac state interface \
+               mcast_src_ip unicast_src_ip virtual_router_id version priority \
+               advert_int preempt_delay debug notify_backup \
+               notify_master notify_fault notify_stop notify \
+               lvs_sync_daemon_interface garp_master_delay garp_master_refresh \
+               garp_master_repeat garp_master_refresh_repeat \
+               no_val_vmac_xmit_base no_val_native_ipv6 no_val_accept \
+               no_val_dont_track_primary no_val_smtp_alert no_val_nopreempt
+
+       # Handle virtual_ipaddress & virtual_ipaddress_excluded lists
+       for opt in virtual_ipaddress virtual_ipaddress_excluded; do
+               config_get $opt $1 $opt
+               eval optval=\$$opt
+               [ -z "$optval" ] && continue
+               printf "$INDENT_1$opt {\n" >> $KEEPALIVED_CONF
+               for a in $optval; do
+                       config_foreach print_ipaddress_indent ipaddress $a $INDENT_2
+               done
+               printf "$INDENT_1}\n" >> $KEEPALIVED_CONF
+       done
+
+       # Handle virtual_routes
+       for opt in virtual_routes; do
+               config_get $opt $1 $opt
+               eval optval=\$$opt
+               [ -z "$optval" ] && continue
+               printf "$INDENT_1$opt {\n" >> $KEEPALIVED_CONF
+               for r in $optval; do
+                       config_foreach print_route_indent route $r $INDENT_2
+               done
+               printf "$INDENT_1}\n" >> $KEEPALIVED_CONF
+       done
+
+       # Handle track_interface & track_script lists
+       for opt in track_interface track_script; do
+               config_get $opt $1 $opt
+               eval optval=\$$opt
+               [ -z "$optval" ] && continue
+               printf "$INDENT_1$opt {\n" >> $KEEPALIVED_CONF
+               for t in $optval; do
+                       printf "$INDENT_2$optval\n" >> $KEEPALIVED_CONF
+               done
+               printf "$INDENT_1}\n" >> $KEEPALIVED_CONF
+       done
+
+       # Handle simple lists of strings (with no spaces in between)
+       for opt in unicast_peer; do
+               config_get $opt $1 $opt
+               print_list_indent $opt
+       done
+       unset optval
+
+       config_section_close
+}
+
+vrrp_script() {
+       local name
+
+       config_get name $1 name
+       [ -z "$name" ] && return 0
+
+       config_section_open "vrrp_script" "$name"
+
+       print_elems_indent $1 $INDENT_1 script interval weight fall rise
+
+       config_section_close
+}
+
+process_config() {
+       local alt_config_file
+
+       rm -f $KEEPALIVED_CONF
+
+       # First line
+       printf "! Configuration File for keepalived (autogenerated via init script)\n\n" > $KEEPALIVED_CONF
+
+       [ -f /etc/config/keepalived ] || return 0
+       config_load 'keepalived'
+
+       config_section_open "global_defs"
+       config_foreach_wrapper global_defs
+       config_section_close
+
+       # If "alt_config_file" specified, use that instead
+       [ -n "$alt_config_file" ] && [ -f "$alt_config_file" ] && {
+               rm -f $KEEPALIVED_CONF
+               # Symlink "alt_config_file" since it's a bit easier and safer
+               ln -s $alt_config_file $KEEPALIVED_CONF
+               return 0
+       }
+
+       config_section_open "static_ipaddress"
+       config_foreach_wrapper static_ipaddress
+       config_section_close
+
+       config_section_open "static_routes"
+       config_foreach_wrapper static_routes
+       config_section_close
+
+       config_foreach_wrapper vrrp_script
+       config_foreach_wrapper vrrp_sync_group
+       config_foreach_wrapper vrrp_instance
+       return 0
+}
+
+service_running() {
+       pgrep -x /usr/sbin/keepalived &> /dev/null
+}
+
+conf_md5() {
+       echo "$(md5sum $KEEPALIVED_CONF | awk '{print $1}')"
+}
+
+reload_service() {
+       local cur_md5="$(conf_md5)"
+       running && {
+               process_config
+
+               # Return without performing the reload if config
+               # file md5sum has not changed
+               local new_md5="$(conf_md5)"
+               [ "$new_md5" == "$cur_md5" ] && return 0;
+
+               # SIGHUP is used by keepalived to do init.d reload
+               # Get the oldest process (assumption is that it's the parent process)
+               PID=$(pgrep -o /usr/sbin/keepalived)
+               kill -SIGHUP $PID
+               return 0
+       }
+       return 1
+}
+
+start_service() {
+       procd_open_instance
+       procd_set_param command /usr/sbin/keepalived
+       procd_append_param command -n # don't daemonize, procd will handle that for us
+       procd_append_param command -f "$KEEPALIVED_CONF"
+
+       process_config
+
+       # set auto respawn behavior
+       procd_set_param respawn
+       procd_close_instance
+}
+
diff --git a/net/keepalived/patches/100-musl-compat.patch b/net/keepalived/patches/100-musl-compat.patch
deleted file mode 100644 (file)
index 9668c2b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/lib/utils.h
-+++ b/lib/utils.h
-@@ -31,6 +31,7 @@
- #include <arpa/inet.h>
- #include <arpa/nameser.h>
- #include <sys/param.h>
-+#include <sys/types.h>
- #include <sys/utsname.h>
- #include <netdb.h>
diff --git a/net/keepalived/patches/101-0001-vrrp-update-struct-msghdr.patch b/net/keepalived/patches/101-0001-vrrp-update-struct-msghdr.patch
new file mode 100644 (file)
index 0000000..a18507c
--- /dev/null
@@ -0,0 +1,50 @@
+From dbb2cac9139954bd18813e88bfcb622ad3e93c54 Mon Sep 17 00:00:00 2001
+From: Stijn Tintel <stijn@linux-ipv6.be>
+Date: Tue, 10 May 2016 04:26:31 +0300
+Subject: [PATCH] vrrp: update struct msghdr
+
+The vrrp netlink code assumes an order for the members of struct msghdr.
+This breaks recvmsg and sendmsg with musl libc on mips64. Fix this by
+using designated initializers instead.
+
+Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
+---
+ keepalived/vrrp/vrrp_netlink.c | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/keepalived/vrrp/vrrp_netlink.c b/keepalived/vrrp/vrrp_netlink.c
+index b19e2e7..2c2fd59 100644
+--- a/keepalived/vrrp/vrrp_netlink.c
++++ b/keepalived/vrrp/vrrp_netlink.c
+@@ -416,8 +416,12 @@ netlink_parse_info(int (*filter) (struct sockaddr_nl *, struct nlmsghdr *),
+               char buf[4096];
+               struct iovec iov = { buf, sizeof buf };
+               struct sockaddr_nl snl;
+-              struct msghdr msg =
+-                  { (void *) &snl, sizeof snl, &iov, 1, NULL, 0, 0 };
++              struct msghdr msg = {
++                      .msg_name = &snl,
++                      .msg_namelen = sizeof(snl),
++                      .msg_iov = &iov,
++                      .msg_iovlen = 1,
++              };
+               struct nlmsghdr *h;
+               status = recvmsg(nl->fd, &msg, 0);
+@@ -538,7 +542,12 @@ netlink_talk(nl_handle_t *nl, struct nlmsghdr *n)
+       int ret, flags;
+       struct sockaddr_nl snl;
+       struct iovec iov = { (void *) n, n->nlmsg_len };
+-      struct msghdr msg = { (void *) &snl, sizeof snl, &iov, 1, NULL, 0, 0 };
++      struct msghdr msg = {
++              .msg_name = &snl,
++              .msg_namelen = sizeof(snl),
++              .msg_iov = &iov,
++              .msg_iovlen = 1,
++      };
+       memset(&snl, 0, sizeof snl);
+       snl.nl_family = AF_NETLINK;
+-- 
+2.10.2
+
diff --git a/net/keepalived/patches/101-0002-Reinstate-initialisation-of-msghdr-fields.patch b/net/keepalived/patches/101-0002-Reinstate-initialisation-of-msghdr-fields.patch
new file mode 100644 (file)
index 0000000..cf97513
--- /dev/null
@@ -0,0 +1,41 @@
+From eaabcc1b09cccff2f8815d03da4d5778ab6bbd17 Mon Sep 17 00:00:00 2001
+From: Quentin Armitage <quentin@armitage.org.uk>
+Date: Mon, 16 May 2016 23:09:13 +0100
+Subject: [PATCH] Reinstate initialisation of msghdr fields
+
+Commit dbb2cac removed initialisation of the struct msghdr msg_control,
+msg_controllen and msg_flags fields. This commit reinstates initialisation
+of those fields.
+
+Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
+---
+ keepalived/vrrp/vrrp_netlink.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/keepalived/vrrp/vrrp_netlink.c b/keepalived/vrrp/vrrp_netlink.c
+index 2c2fd59..62c37d6 100644
+--- a/keepalived/vrrp/vrrp_netlink.c
++++ b/keepalived/vrrp/vrrp_netlink.c
+@@ -421,6 +421,9 @@ netlink_parse_info(int (*filter) (struct sockaddr_nl *, struct nlmsghdr *),
+                       .msg_namelen = sizeof(snl),
+                       .msg_iov = &iov,
+                       .msg_iovlen = 1,
++                      .msg_control = NULL,
++                      .msg_controllen = 0,
++                      .msg_flags = 0
+               };
+               struct nlmsghdr *h;
+@@ -547,6 +550,9 @@ netlink_talk(nl_handle_t *nl, struct nlmsghdr *n)
+               .msg_namelen = sizeof(snl),
+               .msg_iov = &iov,
+               .msg_iovlen = 1,
++              .msg_control = NULL,
++              .msg_controllen = 0,
++              .msg_flags = 0
+       };
+       memset(&snl, 0, sizeof snl);
+-- 
+2.10.2
+
diff --git a/net/keepalived/patches/101-update-struct-msghdr.patch b/net/keepalived/patches/101-update-struct-msghdr.patch
deleted file mode 100644 (file)
index d408ded..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-From 0fc8dfa7ef479220b2a27901c5c69add6e13debd Mon Sep 17 00:00:00 2001
-From: Stijn Tintel <stijn@linux-ipv6.be>
-Date: Tue, 10 May 2016 04:26:31 +0300
-Subject: [PATCH] vrrp: update struct msghdr
-
-The vrrp netlink code assumes an order for the members of struct msghdr.
-This breaks recvmsg and sendmsg with musl libc on mips64. Fix this by
-using designated initializers instead.
----
- keepalived/vrrp/vrrp_netlink.c | 15 ++++++++++++---
- 1 file changed, 12 insertions(+), 3 deletions(-)
-
---- a/keepalived/vrrp/vrrp_netlink.c
-+++ b/keepalived/vrrp/vrrp_netlink.c
-@@ -276,8 +276,12 @@ netlink_parse_info(int (*filter) (struct
-               char buf[4096];
-               struct iovec iov = { buf, sizeof buf };
-               struct sockaddr_nl snl;
--              struct msghdr msg =
--                  { (void *) &snl, sizeof snl, &iov, 1, NULL, 0, 0 };
-+              struct msghdr msg = {
-+                      .msg_name = &snl,
-+                      .msg_namelen = sizeof(snl),
-+                      .msg_iov = &iov,
-+                      .msg_iovlen = 1,
-+              };
-               struct nlmsghdr *h;
-
-               status = recvmsg(nl->fd, &msg, 0);
-@@ -386,7 +390,12 @@ netlink_talk(nl_handle_t *nl, struct nlm
-       int ret, flags;
-       struct sockaddr_nl snl;
-       struct iovec iov = { (void *) n, n->nlmsg_len };
--      struct msghdr msg = { (void *) &snl, sizeof snl, &iov, 1, NULL, 0, 0 };
-+      struct msghdr msg = {
-+              .msg_name = &snl,
-+              .msg_namelen = sizeof(snl),
-+              .msg_iov = &iov,
-+              .msg_iovlen = 1,
-+      };
-
-       memset(&snl, 0, sizeof snl);
-       snl.nl_family = AF_NETLINK;
index 4abfc982d87c1777e03cfe340506899dbd08d8a3..5cefd24b8582c949f8ffe6d1afd6bafef551f919 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lftp
-PKG_VERSION:=4.7.4
+PKG_VERSION:=4.7.5
 PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://lftp.tech/ftp/ \
                ftp://ftp.st.ryukoku.ac.jp/pub/network/ftp/lftp/
-PKG_MD5SUM:=74965c798b1806d0a2659d8a606ea47f
+PKG_MD5SUM:=88c1505f8264429353ea7f249597eeb7
 
 
 
diff --git a/net/lighttpd/Makefile b/net/lighttpd/Makefile
deleted file mode 100644 (file)
index 1c17cef..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-#
-# Copyright (C) 2006-2015 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:=lighttpd
-PKG_VERSION:=1.4.42
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://download.lighttpd.net/lighttpd/releases-1.4.x
-PKG_MD5SUM:=53c55d7e1dac7adec161cd5490491f6d
-
-PKG_LICENSE:=BSD-3c
-PKG_LICENSE_FILES:=COPYING
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/lighttpd/Default
-  SUBMENU:=Web Servers/Proxies
-  SECTION:=net
-  CATEGORY:=Network
-  URL:=http://www.lighttpd.net/
-  MAINTAINER:=W. Michael Petullo <mike@flyn.org>
-endef
-
-define Package/lighttpd
-  $(call Package/lighttpd/Default)
-  MENU:=1
-  DEPENDS:=+LIGHTTPD_SSL:libopenssl +libpcre +libpthread
-  TITLE:=A flexible and lightweight web server
-endef
-
-define Package/lighttpd/config
-config LIGHTTPD_SSL
-       bool "SSL support"
-       depends on PACKAGE_lighttpd
-       default y
-       help
-         Implements SSL support in lighttpd (using libopenssl). This
-         option is required if you enable the SSL engine in your
-         lighttpd confguration file.
-endef
-
-CONFIGURE_ARGS+= \
-       --libdir=/usr/lib/lighttpd \
-       --sysconfdir=/etc/lighttpd \
-       --enable-shared \
-       --enable-static \
-       --disable-rpath \
-       --without-attr \
-       --without-bzip2 \
-       --without-fam \
-       --without-gdbm \
-       --without-ldap \
-       --with-lua \
-       --without-memcache \
-       --with-pcre \
-       --without-valgrind \
-        $(call autoconf_bool,CONFIG_IPV6,ipv6)
-
-CONFIGURE_VARS+= \
-       PCRE_LIB="-lpcre" \
-
-ifneq ($(strip $(CONFIG_LIGHTTPD_SSL)),)
-  CONFIGURE_ARGS+= \
-       --with-openssl="$(STAGING_DIR)/usr"
-else
-  CONFIGURE_ARGS+= \
-       --without-openssl
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-mysql-vhost),)
-  CONFIGURE_ARGS+= \
-       --with-mysql
-else
-  CONFIGURE_ARGS+= \
-       --without-mysql
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-webdav),)
-  CONFIGURE_ARGS+= \
-       --with-webdav-locks \
-       --with-webdav-props
-  # XXX: needed by sqlite3 to prevent segfaults in mod_webdav.so
-  CONFIGURE_VARS+= \
-       LIBS="-lpthread"
-else
-  CONFIGURE_ARGS+= \
-       --without-webdav-locks \
-       --without-webdav-props
-endif
-
-define Build/Configure
-$(call Build/Configure/Default)
-       # XXX: override pcre (mis)detection by ./configure when cross-compiling
-       echo "#define HAVE_LIBPCRE 1" >>$(PKG_BUILD_DIR)/config.h
-       echo "#define HAVE_PCRE_H 1" >>$(PKG_BUILD_DIR)/config.h
-endef
-
-define Package/lighttpd/conffiles
-/etc/lighttpd/lighttpd.conf
-endef
-
-define Package/lighttpd/install
-       $(INSTALL_DIR) $(1)/etc/lighttpd
-       $(INSTALL_DATA) ./files/lighttpd.conf $(1)/etc/lighttpd/
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/doc/config/conf.d/mime.conf $(1)/etc/lighttpd/
-       $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d
-       $(INSTALL_DIR) $(1)/etc/init.d
-       $(INSTALL_BIN) ./files/lighttpd.init $(1)/etc/init.d/lighttpd
-       $(INSTALL_DIR) $(1)/usr/lib/lighttpd
-       for m in dirlisting indexfile staticfile; do \
-               $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$$$${m}.so $(1)/usr/lib/lighttpd/ ; \
-       done
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/lighttpd $(1)/usr/sbin/
-endef
-
-define BuildPlugin
-  define Package/lighttpd-mod-$(1)
-    $(call Package/lighttpd/Default)
-    DEPENDS:=lighttpd
-    ifneq ($(3),)
-      DEPENDS+= $(3)
-    endif
-    TITLE:=$(2) module
-  endef
-
-  define Package/lighttpd-mod-$(1)/install
-       $(INSTALL_DIR) $$(1)/usr/lib/lighttpd
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$(1).so $$(1)/usr/lib/lighttpd
-       $(INSTALL_DIR) $$(1)/etc/lighttpd/conf.d
-       if [ -f $(PKG_BUILD_DIR)/doc/config/conf.d/$(1).conf ]; then \
-               $(CP) $(PKG_BUILD_DIR)/doc/config/conf.d/$(1).conf $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \
-       else \
-               echo 'server.modules += ( "mod_$(1)" )' > $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \
-       fi
-  endef
-
-  $$(eval $$(call BuildPackage,lighttpd-mod-$(1)))
-endef
-
-$(eval $(call BuildPackage,lighttpd))
-
-# First, permit redirect from HTTP to HTTPS.
-$(eval $(call BuildPlugin,redirect,URL redirection,+PACKAGE_lighttpd-mod-redirect:libpcre,10))
-
-# Next, permit authentication.
-$(eval $(call BuildPlugin,auth,Authentication,,20))
-$(eval $(call BuildPlugin,authn_file,File-based authentication,,20))
-
-# Finally, everything else.
-$(eval $(call BuildPlugin,access,Access restrictions,,30))
-$(eval $(call BuildPlugin,accesslog,Access logging,,30))
-$(eval $(call BuildPlugin,alias,Directory alias,,30))
-$(eval $(call BuildPlugin,cgi,CGI,,30))
-$(eval $(call BuildPlugin,cml,Cache Meta Language,+liblua,30))
-$(eval $(call BuildPlugin,compress,Compress output,+PACKAGE_lighttpd-mod-compress:zlib,30))
-$(eval $(call BuildPlugin,evasive,Evasive,,30))
-$(eval $(call BuildPlugin,evhost,Exnhanced Virtual-Hosting,,30))
-$(eval $(call BuildPlugin,expire,Expire,,30))
-$(eval $(call BuildPlugin,extforward,Extract client,,30))
-$(eval $(call BuildPlugin,fastcgi,FastCGI,,30))
-$(eval $(call BuildPlugin,flv_streaming,FLV streaming,,30))
-$(eval $(call BuildPlugin,magnet,Magnet,+liblua,30))
-$(eval $(call BuildPlugin,mysql_vhost,Mysql virtual hosting,+PACKAGE_lighttpd-mod-mysql_vhost:libmysqlclient,30))
-$(eval $(call BuildPlugin,proxy,Proxy,,30))
-$(eval $(call BuildPlugin,rewrite,URL rewriting,+PACKAGE_lighttpd-mod-rewrite:libpcre,30))
-$(eval $(call BuildPlugin,rrdtool,RRDtool,,30))
-$(eval $(call BuildPlugin,scgi,SCGI,,30))
-$(eval $(call BuildPlugin,secdownload,Secure and fast download,,30))
-$(eval $(call BuildPlugin,setenv,Environment variable setting,,30))
-$(eval $(call BuildPlugin,simple_vhost,Simple virtual hosting,,30))
-$(eval $(call BuildPlugin,ssi,SSI,+libpcre,30))
-$(eval $(call BuildPlugin,status,Server status display,,30))
-$(eval $(call BuildPlugin,trigger_b4_dl,Trigger before download,+PACKAGE_lighttpd-mod-trigger_b4_dl:libpcre,30))
-$(eval $(call BuildPlugin,userdir,User directory,,30))
-$(eval $(call BuildPlugin,usertrack,User tracking,,30))
-$(eval $(call BuildPlugin,webdav,WebDAV,+PACKAGE_lighttpd-mod-webdav:libsqlite3 +PACKAGE_lighttpd-mod-webdav:libuuid +PACKAGE_lighttpd-mod-webdav:libxml2,30))
-
diff --git a/net/lighttpd/files/lighttpd.conf b/net/lighttpd/files/lighttpd.conf
deleted file mode 100644 (file)
index 04b06bc..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-server.modules = (
-)
-
-server.document-root        = "/www"
-server.upload-dirs          = ( "/tmp" )
-server.errorlog             = "/var/log/lighttpd/error.log"
-server.pid-file             = "/var/run/lighttpd.pid"
-server.username             = "http"
-server.groupname            = "www-data"
-
-index-file.names            = ( "index.php", "index.html",
-                                "index.htm", "default.htm",
-                                "index.lighttpd.html" )
-
-static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
-
-### Options that are useful but not always necessary:
-#server.chroot               = "/"
-#server.port                 = 81
-#server.bind                 = "localhost"
-#server.tag                  = "lighttpd"
-#server.errorlog-use-syslog  = "enable"
-#server.network-backend      = "write"
-
-### Use IPv6 if available
-#include_shell "/usr/share/lighttpd/use-ipv6.pl"
-
-#dir-listing.encoding        = "utf-8"
-#server.dir-listing          = "enable"
-
-include       "/etc/lighttpd/mime.conf"
-include_shell "cat /etc/lighttpd/conf.d/*.conf"
diff --git a/net/lighttpd/files/lighttpd.init b/net/lighttpd/files/lighttpd.init
deleted file mode 100644 (file)
index 936c7f6..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006-2011 OpenWrt.org
-
-SERVICE_USE_PID=1
-
-START=50
-
-start() {
-       user_exists http || user_add http
-       [ -d /var/log/lighttpd ] || {
-               mkdir -m 0775 -p /var/log/lighttpd
-               chgrp www-data /var/log/lighttpd
-       }
-       service_start /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
-}
-
-stop() {
-       service_stop /usr/sbin/lighttpd
-}
-
index d42916cf062171f27515543c00ee6b1d76ebb915..ecf84fdf1dd7b852cb91a456672155071689aa9b 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=luci-app-bcp38
 PKG_VERSION:=2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=Apache-2.0
 LUCI_DIR:=/usr/lib/lua/luci
 
index b0b8f38791dcf0df908309f155c8259c42fb2321..632074a56f4805bbe1463d28af336d967c2e2aff 100644 (file)
@@ -19,7 +19,9 @@ 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>."))
+               "<a href=\"http://tools.ietf.org/html/bcp38\">BCP 38</a>. " ..
+               "For IPv6, only source specific default routes are installed, so " ..
+               "no BCP38 firewall routes are needed."))
 
 s = m:section(TypedSection, "bcp38", translate("BCP38 config"))
 s.anonymous = true
index bd5267abf0e8d8cdc61deae8e4ab9298ce6f5de3..98904eb2d1c0f1187785fae3c9d79c2d31aaeab4 100644 (file)
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=memcached
-PKG_VERSION:=1.4.31
+PKG_VERSION:=1.4.36
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://memcached.org/files
-PKG_MD5SUM:=c19bb0e77e720f64f33ecb43de28a1b4
+PKG_MD5SUM:=1e028fbab7288911fcaa5ed2a21817fe
 
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 
index b4b49ce00a65518af351f138cfeffaa0fd4d565c..8c77394da2bbacd2752fea1a00a157f6bc002a5d 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=luci-app-mwan3
 PKG_VERSION:=1.4
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 PKG_MAINTAINER:=Aedan Renner <chipdankly@gmail.com>
 PKG_LICENSE:=GPLv2
 
index bd343608ea5c970d79b26d2d8dbfca00165a19d0..3d5a23dd03aa15f71788646e9bbbededf0fac1ce 100644 (file)
@@ -51,6 +51,8 @@ function index()
                form("mwan/advanced_mwanconfig"))
        entry({"admin", "network", "mwan", "advanced", "networkconfig"},
                form("mwan/advanced_networkconfig"))
+       entry({"admin", "network", "mwan", "advanced", "wirelessconfig"},
+               form("mwan/advanced_wirelessconfig"))
        entry({"admin", "network", "mwan", "advanced", "diagnostics"},
                template("mwan/advanced_diagnostics"))
        entry({"admin", "network", "mwan", "advanced", "diagnostics_display"},
@@ -270,6 +272,13 @@ function troubleshootingData()
                end
        mArray.netconfig = { networkConfig }
 
+       -- wireless config
+       local wirelessConfig = ut.trim(sys.exec("cat /etc/config/wireless | sed -e 's/.*username.*/     USERNAME HIDDEN/' -e 's/.*password.*/   PASSWORD HIDDEN/' -e 's/.*key.*/        KEY HIDDEN/'"))
+               if wirelessConfig == "" then
+                       wirelessConfig = "No data found"
+               end
+       mArray.wificonfig = { wirelessConfig }
+       
        -- ifconfig
        local ifconfig = ut.trim(sys.exec("ifconfig"))
                if ifconfig == "" then
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/advanced_wirelessconfig.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/advanced_wirelessconfig.lua
new file mode 100644 (file)
index 0000000..95e9f7c
--- /dev/null
@@ -0,0 +1,32 @@
+-- ------ wireless configuration ------ --
+
+ut = require "luci.util"
+
+wirelessConfig = "/etc/config/wireless"
+
+
+m5 = SimpleForm("wirelessconf", nil)
+       m5:append(Template("mwan/advanced_wirelessconfig")) -- highlight current tab
+
+
+f = m5:section(SimpleSection, nil,
+       translate("This section allows you to modify the contents of /etc/config/wireless"))
+
+t = f:option(TextValue, "lines")
+       t.rmempty = true
+       t.rows = 20
+
+       function t.cfgvalue()
+               return nixio.fs.readfile(wirelessConfig) or ""
+       end
+
+       function t.write(self, section, data) -- format and write new data to script
+               return nixio.fs.writefile(wirelessConfig, "\n" .. ut.trim(data:gsub("\r\n", "\n")) .. "\n")
+       end
+
+       function f.handle(self, state, data)
+               return true
+       end
+
+
+return m5
index 19615695ddb039f66e2ddfd97b65b1642afe27da..14d404bc7c883327aa87174ef9ebf2c6e6a4bc64 100644 (file)
@@ -4,6 +4,7 @@
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
        <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li>
 </ul>
index cbef94b00e7cd7f1fbc47b2eedc6af07d8947ec4..4c2a0dc208bc21770df48213675357d04db686ba 100644 (file)
@@ -2,6 +2,7 @@
        <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li>
 </ul>
index 5d83bdda4302c24265ebff782eca3e11a007a5ea..fba3fa69404c642b8f5eaf5c7b02bbbf17fc8be3 100644 (file)
@@ -2,6 +2,7 @@
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
        <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li>
 </ul>
index 5c06d362c9f92f924ad54c273b283271d7efe145..cf901120784880f72d7414b9e4dadb9fd9812199 100644 (file)
@@ -2,6 +2,7 @@
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
        <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li>
 </ul>
index 514d91f9129f70c8c206adc64a0171e130c6c3b3..0a12496899876b3c7d90b5b32ceef4833d8925b7 100644 (file)
@@ -4,6 +4,7 @@
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
        <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li>
        <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li>
 </ul>
@@ -19,6 +20,7 @@
                                var versions = '<span class="description">Software versions : </span><br /><br />';
                                var mwanConfig = '<br /><br /><span class="description">Output of &#34;cat /etc/config/mwan3&#34; : </span><br /><br />';
                                var netConfig = '<br /><br /><span class="description">Output of &#34;cat /etc/config/network&#34; : </span><br /><br />';
+                               var wifiConfig = '<br /><br /><span class="description">Output of &#34;cat /etc/config/wireless&#34; : </span><br /><br />';
                                var ifconfig = '<br /><br /><span class="description">Output of &#34;ifconfig&#34; : </span><br /><br />';
                                var ipRoute = '<br /><br /><span class="description">Output of &#34;route -n&#34; : </span><br /><br />';
                                var ipRuleShow = '<br /><br /><span class="description">Output of &#34;ip rule show&#34; : </span><br /><br />';
                                var firewallOut = '<br /><br /><span class="description">Firewall default output policy (must be ACCEPT) : </span><br /><br />';
                                var iptables = '<br /><br /><span class="description">Output of &#34;iptables -L -t mangle -v -n&#34; : </span><br /><br />';
                                tshoot.innerHTML = String.format(
-                                       '<pre>%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s</pre>',
+                                       '<pre>%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s</pre>',
                                        versions, mArray.versions[0], mwanConfig, mArray.mwanconfig[0], netConfig, mArray.netconfig[0],
-                                       ifconfig, mArray.ifconfig[0], ipRoute, mArray.routeshow[0], ipRuleShow, mArray.iprule[0],
-                                       routeListTable, mArray.routelist[0], firewallOut, mArray.firewallout[0], iptables, mArray.iptables[0]
+                                       wifiConfig, mArray.wificonfig[0], ifconfig, mArray.ifconfig[0], ipRoute, mArray.routeshow[0],
+                                       ipRuleShow, mArray.iprule[0], routeListTable, mArray.routelist[0], firewallOut, mArray.firewallout[0],
+                                       iptables, mArray.iptables[0]
                                );
                        }
                        else
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_wirelessconfig.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/advanced_wirelessconfig.htm
new file mode 100644 (file)
index 0000000..5077674
--- /dev/null
@@ -0,0 +1,24 @@
+<ul class="cbi-tabmenu">
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/hotplugscript")%>"><%:Hotplug Script%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/mwanconfig")%>"><%:MWAN Config%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/networkconfig")%>"><%:Network Config%></a></li>
+       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/wirelessconfig")%>"><%:Wireless Config%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/diagnostics")%>"><%:Diagnostics%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan/advanced/troubleshooting")%>"><%:Troubleshooting%></a></li>
+</ul>
+
+<style type="text/css">
+  .container { /* container for entire page. fixes bootstrap theme's ridiculously small page width */
+       max-width: none;
+       margin: 0px 0px 0px 30px;
+       padding-right: 30px;
+       width: auto;
+  }
+  .cbi-section-node {
+       margin-top: 20px;
+  }
+  .cbi-section {
+       border: 1px dotted #555555;
+       padding: 20px;
+  }
+</style>
index ddd2da4964a88e520b4796490d5cf78a74fe9c6a..3446d151426291a5c2dc4929a6d15099ace0f072 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2015 OpenWrt.org
+# Copyright (C) 2006-2017 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:=net-snmp
-PKG_VERSION:=5.4.4
-PKG_RELEASE:=2
+PKG_VERSION:=5.7.3
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/net-snmp
-PKG_MD5SUM:=95aa054f3c99a1ce242807d7eaf98619
-PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
+PKG_MD5SUM:=d4a3459e1577d0efa8d96ca70a885e53
+PKG_MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
 PKG_LICENSE:=MIT BSD-3-Clause-Clear
 
-PKG_FIXUP = patch-libtool
+PKG_FIXUP:=autoreconf
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -40,6 +40,7 @@ define Package/libnetsnmp
 $(call Package/net-snmp/Default)
   SECTION:=libs
   CATEGORY:=Libraries
+  DEPENDS:=+libnl-tiny
   TITLE:=Open source SNMP implementation (libraries)
 endef
 
@@ -50,6 +51,18 @@ $(call Package/net-snmp/Default/description)
 endef
 
 
+define Package/snmp-mibs
+$(call Package/net-snmp/Default)
+  TITLE:=Open source SNMP implementation (MIB-files)
+endef
+
+define Package/snmp-mibs/description
+$(call Package/net-snmp/Default/description)
+ .
+ This package contains SNMP MIB-Files.
+endef
+
+
 define Package/snmp-utils
 $(call Package/net-snmp/Default)
   DEPENDS:=+libnetsnmp
@@ -78,17 +91,14 @@ endef
 
 define Package/snmpd-static
 $(call Package/net-snmp/Default)
+  DEPENDS:=+snmpd
   TITLE:=Open source SNMP implementation (daemon)
 endef
 
-define Package/snmpd-static/description
-$(call Package/net-snmp/Default/description)
- .
- This package contains the SNMP agent, statically linked.
-endef
 
 
 SNMP_MIB_MODULES_INCLUDED = \
+       agentx \
        host/hr_device \
        host/hr_disk \
        host/hr_filesys \
@@ -130,7 +140,6 @@ SNMP_MIB_MODULES_INCLUDED = \
 
 SNMP_MIB_MODULES_EXCLUDED = \
        agent_mibs \
-       agentx \
        disman/event \
        disman/schedule \
        hardware \
@@ -146,11 +155,12 @@ SNMP_MIB_MODULES_EXCLUDED = \
        udp-mib \
        utilities \
 
-SNMP_TRANSPORTS_INCLUDED = Callback UDP
+SNMP_TRANSPORTS_INCLUDED = Callback UDP Unix
 
-SNMP_TRANSPORTS_EXCLUDED = TCP TCPIPv6 Unix
+SNMP_TRANSPORTS_EXCLUDED = TCP TCPIPv6
 
 TARGET_CFLAGS += $(FPIC)
+TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny
 
 CONFIGURE_ARGS += \
        --enable-mfd-rewrites \
@@ -165,7 +175,6 @@ CONFIGURE_ARGS += \
        --enable-applications \
        --disable-debugging \
        --disable-manuals \
-       --disable-mibs \
        --disable-scripts \
        --with-out-mib-modules="$(SNMP_MIB_MODULES_EXCLUDED)" \
        --with-mib-modules="$(SNMP_MIB_MODULES_INCLUDED)" \
@@ -175,29 +184,24 @@ CONFIGURE_ARGS += \
        --without-libwrap \
        --without-rpm \
        --without-zlib \
+       --with-nl \
         $(call autoconf_bool,CONFIG_IPV6,ipv6) \
 
+CONFIGURE_VARS += \
+       ac_cv_header_netlink_netlink_h=yes \
+       netsnmp_cv_func_nl_connect_LIBS=-lnl-tiny \
+
 ifeq ($(CONFIG_IPV6),y)
 SNMP_TRANSPORTS_INCLUDED+= UDPIPv6
 endif
 
 TARGET_LDFLAGS += -L$(TOOLCHAIN_DIR)/usr/lib
 
-ifdef CONFIG_PACKAGE_snmpd-static
-  define Build/Compile/static
-       $(MAKE) -C $(PKG_BUILD_DIR)/agent \
-               LDFLAGS="$(TARGET_LDFLAGS) -lm -static" \
-               EXEEXT="-static" \
-               snmpd-static
-  endef
-endif
-
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
                INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
                LDFLAGS="$(TARGET_LDFLAGS) -lm -lc" \
                all install
-       $(Build/Compile/static)
 endef
 
 define Build/InstallDev
@@ -216,26 +220,21 @@ define Package/libnetsnmp/install
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.so.* $(1)/usr/lib/
 endef
 
-define Package/snmpd/conffiles
-/etc/config/snmpd
+define Package/snmp-mibs/install
+       $(INSTALL_DIR) $(1)/usr/share/snmp/mibs
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/snmp/mibs/* $(1)/usr/share/snmp/mibs/
 endef
 
-define Package/snmpd/install
-       $(INSTALL_DIR) $(1)/etc/config
-       $(INSTALL_DATA) ./files/snmpd.conf $(1)/etc/config/snmpd
-       $(INSTALL_DIR) $(1)/etc/snmp
-       ln -sf /var/run/snmpd.conf $(1)/etc/snmp/
-       $(INSTALL_DIR) $(1)/etc/init.d
-       $(INSTALL_BIN) ./files/snmpd.init $(1)/etc/init.d/snmpd
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snmpd $(1)/usr/sbin/snmpd
+define Package/snmp-utils/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/snmp{get,set,status,test,trap,walk} $(1)/usr/bin/
 endef
 
-define Package/snmpd-static/conffiles
+define Package/snmpd/conffiles
 /etc/config/snmpd
 endef
 
-define Package/snmpd-static/install
+define Package/snmpd/install
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_DATA) ./files/snmpd.conf $(1)/etc/config/snmpd
        $(INSTALL_DIR) $(1)/etc/snmp
@@ -243,15 +242,11 @@ define Package/snmpd-static/install
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/snmpd.init $(1)/etc/init.d/snmpd
        $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/agent/snmpd-static $(1)/usr/sbin/snmpd
-endef
-
-define Package/snmp-utils/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/snmp{get,set,status,test,trap,walk} $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snmpd $(1)/usr/sbin/snmpd
 endef
 
 $(eval $(call BuildPackage,libnetsnmp))
+$(eval $(call BuildPackage,snmp-mibs))
 $(eval $(call BuildPackage,snmp-utils))
 $(eval $(call BuildPackage,snmpd))
 $(eval $(call BuildPackage,snmpd-static))
index 4bdc3d4d43cf25b01a55ff44d0abcac6083ec1f3..ac152d83eb91d920e46e90309ae7d72620203343 100644 (file)
@@ -1,6 +1,9 @@
 config agent
        option agentaddress UDP:161
 
+config agentx
+       option agentxsocket /var/run/agentx.sock
+
 config com2sec public
        option secname ro
        option source default
@@ -80,3 +83,7 @@ config exec
        option args     /proc/sys/fs/file-nr
 #      option miboid   1.2.3.4
 
+config engineid
+#      option engineid 'LEDE'
+       option engineidtype '3'
+       option engineidnic 'eth0'
index ff780975de8ed62994e4acba13b6afd21ec848ec..7df67de28ea9c8c89a3323ea74068880d9617e73 100644 (file)
@@ -15,6 +15,13 @@ snmpd_agent_add() {
        echo "agentaddress $agentaddress" >> $CONFIGFILE
 }
 
+snmpd_agentx_add() {
+       local cfg="$1"
+       echo "master agentx" >> $CONFIGFILE
+       config_get agentxsocket "$cfg" agentxsocket
+       [ -n "$agentxsocket" ] && echo "agentXSocket $agentxsocket" >> $CONFIGFILE
+}
+
 snmpd_system_add() {
        local cfg="$1"
        config_get syslocation "$cfg" sysLocation
@@ -191,6 +198,18 @@ snmpd_disk_add() {
         echo "$disk $partition $size" >> $CONFIGFILE
 }
 
+snmpd_engineid_add() {
+       local cfg="$1"
+
+       config_get engineid "$cfg" engineid
+       [ -n "$engineid" ] && echo "engineID $engineid" >> $CONFIGFILE
+       config_get engineidtype "$cfg" engineidtype
+       [ "$engineidtype" -ge 1 -a "$engineidtype" -le 3 ] && \
+               echo "engineIDType $engineidtype" >> $CONFIGFILE
+       config_get engineidnic "$cfg" engineidnic
+       [ -n "$engineidnic" ] && echo "engineIDNic $engineidnic" >> $CONFIGFILE
+}
+
 start_service() {
        [ -f "$CONFIGFILE" ] && rm -f "$CONFIGFILE"
 
@@ -199,6 +218,7 @@ start_service() {
        config_load snmpd
 
        config_foreach snmpd_agent_add agent
+       config_foreach snmpd_agentx_add agentx
        config_foreach snmpd_system_add system
        config_foreach snmpd_com2sec_add com2sec
        config_foreach snmpd_com2sec6_add com2sec6
@@ -213,6 +233,7 @@ start_service() {
        config_foreach snmpd_pass_add pass
        config_foreach snmpd_exec_add exec
        config_foreach snmpd_disk_add disk
+       config_foreach snmpd_engineid_add engineid
        
        procd_set_param command $PROG -Lf /dev/null -f
        procd_set_param file $CONFIGFILE
diff --git a/net/net-snmp/patches/000-cross-compile.patch b/net/net-snmp/patches/000-cross-compile.patch
new file mode 100644 (file)
index 0000000..2906220
--- /dev/null
@@ -0,0 +1,47 @@
+From: Jo-Philipp Wich <jo@mein.io>
+Date: Fri, 6 Jan 2017 13:41:00 +0100
+Subject: [PATCH] configure: allow overriding hardcoded /usr/include/libnl3
+
+In a cross-compile setting we do not want to probe the host systems
+/usr/include path, therfore allow to disable this include path by passing
+ac_cv_header_netlink_netlink_h=yes to configure.
+
+Also disable the testing for libraries providing nl_connect when
+netsnmp_cv_func_nl_connect_LIBS is predefined since the proprietary
+NETSNMP_SEARCH_LIBS() macro will clobber the internal link flags upon
+encountering predefined cache variables, causing all subsequent configure
+link tests to fail due to a stray "no" word getting passed to the linker.
+
+Signed-off-by: Jo-Philipp Wich <jo@mein.io>
+--- a/configure.d/config_os_libs2
++++ b/configure.d/config_os_libs2
+@@ -226,14 +226,22 @@ if test "x$with_nl" != "xno"; then
+     case $target_os in
+     linux*) # Check for libnl (linux)
+         netsnmp_save_CPPFLAGS="$CPPFLAGS"
+-        CPPFLAGS="-I/usr/include/libnl3 $CPPFLAGS"
+-        NETSNMP_SEARCH_LIBS(nl_connect, nl-3,
+-            [AC_CHECK_HEADERS(netlink/netlink.h)
+-            EXTERNAL_MIBGROUP_INCLUDES="$EXTERNAL_MIBGROUP_INCLUDES -I/usr/include/libnl3"],
+-            [CPPFLAGS="$netsnmp_save_CPPFLAGS"], [], [], [LMIBLIBS])
++        netsnmp_netlink_include_flags=""
+         if test "x$ac_cv_header_netlink_netlink_h" != xyes; then
+-            NETSNMP_SEARCH_LIBS(nl_connect, nl, [
+-                AC_CHECK_HEADERS(netlink/netlink.h)], [], [], LMIBLIBS)
++            netsnmp_netlink_include_flags="-I/usr/include/libnl3"
++        fi
++        CPPFLAGS="$netsnmp_netlink_include_flags $CPPFLAGS"
++        if test "x$netsnmp_cv_func_nl_connect_LIBS" = x; then
++            NETSNMP_SEARCH_LIBS(nl_connect, nl-3,
++                [AC_CHECK_HEADERS(netlink/netlink.h)
++                EXTERNAL_MIBGROUP_INCLUDES="$EXTERNAL_MIBGROUP_INCLUDES $netsnmp_netlink_include_flags"],
++                [CPPFLAGS="$netsnmp_save_CPPFLAGS"], [], [], [LMIBLIBS])
++            if test "x$ac_cv_header_netlink_netlink_h" != xyes; then
++                NETSNMP_SEARCH_LIBS(nl_connect, nl, [
++                    AC_CHECK_HEADERS(netlink/netlink.h)], [], [], LMIBLIBS)
++            fi
++        else
++            LMIBLIBS="$LMIBLIBS $netsnmp_cv_func_nl_connect_LIBS"
+         fi
+         if test "x$ac_cv_header_netlink_netlink_h" = xyes; then
+             AC_EGREP_HEADER([nl_socket_free], [netlink/socket.h],
index c937fca03a05a1700d502bcb1bc144f291d00723..c6e1db44803186170f7cddc49c301cbe2eadcb82 100644 (file)
@@ -1,6 +1,6 @@
 --- a/agent/mibgroup/mibII/interfaces.c
 +++ b/agent/mibgroup/mibII/interfaces.c
-@@ -1561,6 +1561,10 @@ Interface_Scan_Init(void)
+@@ -1590,6 +1590,10 @@ Interface_Scan_Init(void)
          struct ifnet   *nnew;
          char           *stats, *ifstart = line;
  
@@ -11,7 +11,7 @@
          if (line[strlen(line) - 1] == '\n')
              line[strlen(line) - 1] = '\0';
  
-@@ -1594,7 +1598,7 @@ Interface_Scan_Init(void)
+@@ -1622,7 +1622,7 @@ Interface_Scan_Init(void)
                                                 &coll) != 5)) {
              if ((scan_line_to_use == scan_line_2_2)
                  && !strstr(line, "No statistics available"))
index 5ce771cc47dd07fc89bdc9d1121f5d4a3633af84..5ace743218d1350f82b86f095bd341200465c419 100644 (file)
@@ -1,6 +1,7 @@
---- a/local/Makefile.in
-+++ b/local/Makefile.in
-@@ -100,7 +100,7 @@ tkmib.made: $(srcdir)/tkmib
+diff -uNr a/local/Makefile.in b/local/Makefile.in
+--- a/local/Makefile.in        2014-02-20 08:36:42.000000000 +0800
++++ b/local/Makefile.in        2014-05-27 13:21:34.245223503 +0800
+@@ -103,7 +103,7 @@
  
  mib2c.made: $(srcdir)/mib2c
        if test "x$(PERL)" != "x" ; then \
@@ -9,9 +10,21 @@
        else \
          touch mib2c.made; \
          fi
---- a/mibs/Makefile.in
-+++ b/mibs/Makefile.in
-@@ -48,11 +48,15 @@ NETSNMPMIBS = NET-SNMP-TC.txt NET-SNMP-M
+diff -uNr a/Makefile.top b/Makefile.top
+--- a/Makefile.top     2014-02-20 08:36:42.000000000 +0800
++++ b/Makefile.top     2014-05-27 13:26:53.023737120 +0800
+@@ -27,6 +27,7 @@
+ snmplibdir    = $(datadir)/snmp
+ mibdir                = $(snmplibdir)/mibs
+ persistentdir = @PERSISTENT_DIRECTORY@
++sysconfdir    = @sysconfdir@
+ DESTDIR         = @INSTALL_PREFIX@
+ INSTALL_PREFIX  = $(DESTDIR)
+diff -uNr a/mibs/Makefile.in b/mibs/Makefile.in
+--- a/mibs/Makefile.in 2014-02-20 08:36:42.000000000 +0800
++++ b/mibs/Makefile.in 2014-05-27 13:25:07.151988585 +0800
+@@ -49,11 +49,15 @@
  UCDMIBS = UCD-SNMP-MIB.txt UCD-DEMO-MIB.txt UCD-IPFWACC-MIB.txt \
        UCD-DLMOD-MIB.txt UCD-DISKIO-MIB.txt
  
  
  all: standardall
  
---- a/Makefile.top
-+++ b/Makefile.top
-@@ -26,6 +26,7 @@ man8dir              = $(mandir)/man8
- snmplibdir    = $(datadir)/snmp
- mibdir                = $(snmplibdir)/mibs
- persistentdir = @PERSISTENT_DIRECTORY@
-+sysconfdir    = @sysconfdir@
- DESTDIR         = @INSTALL_PREFIX@
- INSTALL_PREFIX  = $(DESTDIR)
index d8c88f3ea46b0bde10fcdc2c0050136ce6938059..b5e377f9634d0ab1b258afedfd979052f406e1ce 100644 (file)
@@ -1,6 +1,6 @@
 --- a/local/mib2c
 +++ b/local/mib2c
-@@ -60,8 +60,9 @@ $currentlevel = -1;
+@@ -61,8 +61,9 @@ $currentlevel = -1;
  if($ENV{MIB2C_DIR}) {
     push @def_search_dirs, split(/:/, $ENV{MIB2C_DIR});
  }
index e741ee7b497a7856e3ba44d61b5a3912cdddec6c..48fb90747aa0ae7dbb7284d4aa1fd909bb9e0321 100644 (file)
 +
 +    END
 --- /dev/null
-+++ b/mibs/BRIDGE-MIB.txt
-@@ -0,0 +1,1075 @@
-+BRIDGE-MIB DEFINITIONS ::= BEGIN
-+
-+IMPORTS
-+           Counter, TimeTicks
-+                   FROM RFC1155-SMI
-+           mib-2
-+                   FROM RFC1213-MIB
-+           OBJECT-TYPE
-+                   FROM RFC-1212
-+           TRAP-TYPE
-+                   FROM RFC-1215;
-+
-+-- All representations of MAC addresses in this MIB Module
-+-- use, as a textual convention (i.e. this convention does
-+-- not affect their encoding), the data type:
-+MacAddress ::= OCTET STRING (SIZE (6))    -- a 6 octet address
-+                                          -- in the
-+                                          -- "canonical"
-+                                          -- order
-+-- defined by IEEE 802.1a, i.e., as if it were transmitted
-+-- least significant bit first, even though 802.5 (in
-+-- contrast to other n802.x protocols) requires MAC
-+-- addresses to be transmitted most significant bit first.
-+--
-+-- 16-bit addresses, if needed, are represented by setting
-+-- their upper 4 octets to all 0's, i.e., AAFF would be
-+-- represented as 00000000AAFF.
-+
-+-- Similarly, all representations of Bridge-Id in this MIB
-+-- Module use, as a textual convention (i.e. this
-+-- convention does not affect their encoding), the data
-+-- type:
-+BridgeId ::= OCTET STRING (SIZE (8))   -- the
-+                                       -- Bridge-Identifier
-+                                       -- as used in the
-+                                       -- Spanning Tree
-+-- Protocol to uniquely identify a bridge.  Its first two
-+-- octets (in network byte order) contain a priority
-+-- value and its last 6 octets contain the MAC address
-+-- used to refer to a bridge in a unique fashion
-+-- (typically, the numerically smallest MAC address
-+-- of all ports on the bridge).
-+
-+-- Several objects in this MIB module represent values of
-+-- timers used by the Spanning Tree Protocol.  In this
-+-- MIB, these timers have values in units of hundreths of
-+-- a second (i.e. 1/100 secs).
-+-- These timers, when stored in a Spanning Tree Protocol's
-+-- BPDU, are in units of 1/256 seconds.  Note, however,
-+-- that 802.1D-1990 specifies a settable granularity of
-+-- no more than 1 second for these timers.  To avoid
-+-- ambiguity, a data type is defined here as a textual
-+-- convention and all representation of these timers
-+-- in this MIB module are defined using this data type.  An
-+-- algorithm is also defined for converting between the
-+-- different units, to ensure a timer's value is not
-+-- distorted by multiple conversions.
-+-- The data type is:
-+
-+Timeout ::= INTEGER -- a STP timer in units of 1/100 seconds
-+
-+-- To convert a Timeout value into a value in units of
-+-- 1/256 seconds, the following algorithm should be used:
-+--
-+--      b  = floor( (n * 256) / 100)
-+--
-+-- where:
-+--      floor   =  quotient [ignore remainder]
-+--      n is the value in 1/100 second units
-+--      b is the value in 1/256 second units
-+--
-+-- To convert the value from 1/256 second units back to
-+-- 1/100 seconds, the following algorithm should be used:
-+--
-+--      n = ceiling( (b * 100) / 256)
-+--
-+-- where:
-+--      ceiling =  quotient [if remainder is 0], or
-+--                 quotient + 1 [if remainder is non-zero]
-+--      n is the value in 1/100 second units
-+--      b is the value in 1/256 second units
-+--
-+-- Note: it is important that the arithmetic operations are
-+-- done in the order specified (i.e., multiply first, divide
-+-- second).
-+
-+   dot1dBridge   OBJECT IDENTIFIER ::= { mib-2 17 }
-+
-+-- groups in the Bridge MIB
-+
-+dot1dBase     OBJECT IDENTIFIER ::= { dot1dBridge 1 }
-+
-+dot1dStp      OBJECT IDENTIFIER ::= { dot1dBridge 2 }
-+
-+dot1dSr       OBJECT IDENTIFIER ::= { dot1dBridge 3 }
-+-- separately documented
-+
-+dot1dTp       OBJECT IDENTIFIER ::= { dot1dBridge 4 }
-+
-+dot1dStatic   OBJECT IDENTIFIER ::= { dot1dBridge 5 }
-+
-+-- the dot1dBase group
-+
-+-- Implementation of the dot1dBase group is mandatory for all
-+-- bridges.
-+
-+dot1dBaseBridgeAddress OBJECT-TYPE
-+    SYNTAX  MacAddress
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The MAC address used by this bridge when it must
-+            be referred to in a unique fashion.   It is
-+            recommended that this be the numerically smallest
-+            MAC address of all ports that belong to this
-+            bridge.  However it is only required to be unique.
-+            When concatenated with dot1dStpPriority a unique
-+            BridgeIdentifier is formed which is used in the
-+            Spanning Tree Protocol."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Sections 6.4.1.1.3 and 3.12.5"
-+    ::= { dot1dBase 1 }
-+
-+dot1dBaseNumPorts OBJECT-TYPE
-+    SYNTAX  INTEGER
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The number of ports controlled by this bridging
-+            entity."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 6.4.1.1.3"
-+    ::= { dot1dBase 2 }
-+
-+dot1dBaseType OBJECT-TYPE
-+    SYNTAX  INTEGER {
-+                unknown(1),
-+                transparent-only(2),
-+                sourceroute-only(3),
-+                srt(4)
-+            }
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "Indicates what type of bridging this bridge can
-+            perform.  If a bridge is actually performing a
-+            certain type of bridging this will be indicated by
-+            entries in the port table for the given type."
-+    ::= { dot1dBase 3 }
-+
-+-- The Generic Bridge Port Table
-+
-+dot1dBasePortTable OBJECT-TYPE
-+    SYNTAX  SEQUENCE OF Dot1dBasePortEntry
-+    ACCESS  not-accessible
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "A table that contains generic information about
-+            every port that is associated with this bridge.
-+            Transparent, source-route, and srt ports are
-+            included."
-+    ::= { dot1dBase 4 }
-+
-+dot1dBasePortEntry OBJECT-TYPE
-+    SYNTAX  Dot1dBasePortEntry
-+    ACCESS  not-accessible
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "A list of information for each port of the
-+            bridge."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 6.4.2, 6.6.1"
-+    INDEX  { dot1dBasePort }
-+    ::= { dot1dBasePortTable 1 }
-+
-+Dot1dBasePortEntry ::=
-+    SEQUENCE {
-+        dot1dBasePort
-+            INTEGER,
-+        dot1dBasePortIfIndex
-+            INTEGER,
-+        dot1dBasePortCircuit
-+
-+            OBJECT IDENTIFIER,
-+        dot1dBasePortDelayExceededDiscards
-+            Counter,
-+        dot1dBasePortMtuExceededDiscards
-+            Counter
-+    }
-+
-+dot1dBasePort OBJECT-TYPE
-+    SYNTAX  INTEGER (1..65535)
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The port number of the port for which this entry
-+            contains bridge management information."
-+    ::= { dot1dBasePortEntry 1 }
-+
-+dot1dBasePortIfIndex OBJECT-TYPE
-+    SYNTAX  INTEGER
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The value of the instance of the ifIndex object,
-+            defined in MIB-II, for the interface corresponding
-+            to this port."
-+    ::= { dot1dBasePortEntry 2 }
-+
-+dot1dBasePortCircuit OBJECT-TYPE
-+    SYNTAX  OBJECT IDENTIFIER
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "For a port which (potentially) has the same value
-+            of dot1dBasePortIfIndex as another port on the
-+            same bridge, this object contains the name of an
-+            object instance unique to this port.  For example,
-+            in the case where multiple ports correspond one-
-+            to-one with multiple X.25 virtual circuits, this
-+            value might identify an (e.g., the first) object
-+            instance associated with the X.25 virtual circuit
-+            corresponding to this port.
-+
-+            For a port which has a unique value of
-+            dot1dBasePortIfIndex, this object can have the
-+            value { 0 0 }."
-+    ::= { dot1dBasePortEntry 3 }
-+
-+dot1dBasePortDelayExceededDiscards OBJECT-TYPE
-+    SYNTAX  Counter
-+
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The number of frames discarded by this port due
-+            to excessive transit delay through the bridge.  It
-+            is incremented by both transparent and source
-+            route bridges."
-+    REFERENCE
-+             "IEEE 802.1D-1990: Section 6.6.1.1.3"
-+    ::= { dot1dBasePortEntry 4 }
-+
-+dot1dBasePortMtuExceededDiscards OBJECT-TYPE
-+    SYNTAX  Counter
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The number of frames discarded by this port due
-+            to an excessive size.  It is incremented by both
-+            transparent and source route bridges."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 6.6.1.1.3"
-+    ::= { dot1dBasePortEntry 5 }
-+
-+-- the dot1dStp group
-+
-+-- Implementation of the dot1dStp group is optional.  It is
-+-- implemented by those bridges that support the Spanning Tree
-+-- Protocol.
-+
-+dot1dStpProtocolSpecification OBJECT-TYPE
-+    SYNTAX  INTEGER {
-+                unknown(1),
-+                decLb100(2),
-+                ieee8021d(3)
-+            }
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "An indication of what version of the Spanning
-+            Tree Protocol is being run.  The value
-+            'decLb100(2)' indicates the DEC LANbridge 100
-+            Spanning Tree protocol.  IEEE 802.1d
-+            implementations will return 'ieee8021d(3)'.  If
-+            future versions of the IEEE Spanning Tree Protocol
-+            are released that are incompatible with the
-+            current version a new value will be defined."
-+
-+    ::= { dot1dStp 1 }
-+
-+dot1dStpPriority OBJECT-TYPE
-+    SYNTAX  INTEGER (0..65535)
-+    ACCESS  read-write
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The value of the write-able portion of the Bridge
-+            ID, i.e., the first two octets of the (8 octet
-+            long) Bridge ID.  The other (last) 6 octets of the
-+            Bridge ID are given by the value of
-+            dot1dBaseBridgeAddress."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.3.7"
-+    ::= { dot1dStp 2 }
-+
-+dot1dStpTimeSinceTopologyChange OBJECT-TYPE
-+    SYNTAX  TimeTicks
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The time (in hundredths of a second) since the
-+            last time a topology change was detected by the
-+            bridge entity."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 6.8.1.1.3"
-+    ::= { dot1dStp 3 }
-+
-+dot1dStpTopChanges OBJECT-TYPE
-+    SYNTAX  Counter
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The total number of topology changes detected by
-+            this bridge since the management entity was last
-+            reset or initialized."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 6.8.1.1.3"
-+    ::= { dot1dStp 4 }
-+
-+dot1dStpDesignatedRoot OBJECT-TYPE
-+    SYNTAX  BridgeId
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The bridge identifier of the root of the spanning
-+            tree as determined by the Spanning Tree Protocol
-+            as executed by this node.  This value is used as
-+
-+            the Root Identifier parameter in all Configuration
-+            Bridge PDUs originated by this node."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.3.1"
-+    ::= { dot1dStp 5 }
-+
-+dot1dStpRootCost OBJECT-TYPE
-+    SYNTAX  INTEGER
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The cost of the path to the root as seen from
-+            this bridge."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.3.2"
-+    ::= { dot1dStp 6 }
-+
-+dot1dStpRootPort OBJECT-TYPE
-+    SYNTAX  INTEGER
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The port number of the port which offers the
-+            lowest cost path from this bridge to the root
-+            bridge."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.3.3"
-+    ::= { dot1dStp 7 }
-+
-+dot1dStpMaxAge OBJECT-TYPE
-+    SYNTAX  Timeout
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The maximum age of Spanning Tree Protocol
-+            information learned from the network on any port
-+            before it is discarded, in units of hundredths of
-+            a second.  This is the actual value that this
-+            bridge is currently using."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.3.4"
-+    ::= { dot1dStp 8 }
-+
-+dot1dStpHelloTime OBJECT-TYPE
-+    SYNTAX  Timeout
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+
-+            "The amount of time between the transmission of
-+            Configuration bridge PDUs by this node on any port
-+            when it is the root of the spanning tree or trying
-+            to become so, in units of hundredths of a second.
-+            This is the actual value that this bridge is
-+            currently using."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.3.5"
-+    ::= { dot1dStp 9 }
-+
-+dot1dStpHoldTime OBJECT-TYPE
-+    SYNTAX  INTEGER
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "This time value determines the interval length
-+            during which no more than two Configuration bridge
-+            PDUs shall be transmitted by this node, in units
-+            of hundredths of a second."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.3.14"
-+    ::= { dot1dStp 10 }
-+
-+dot1dStpForwardDelay OBJECT-TYPE
-+    SYNTAX  Timeout
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "This time value, measured in units of hundredths
-+            of a second, controls how fast a port changes its
-+            spanning state when moving towards the Forwarding
-+            state.  The value determines how long the port
-+            stays in each of the Listening and Learning
-+            states, which precede the Forwarding state.  This
-+            value is also used, when a topology change has
-+            been detected and is underway, to age all dynamic
-+            entries in the Forwarding Database.  [Note that
-+            this value is the one that this bridge is
-+            currently using, in contrast to
-+            dot1dStpBridgeForwardDelay which is the value that
-+            this bridge and all others would start using
-+            if/when this bridge were to become the root.]"
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.3.6"
-+    ::= { dot1dStp 11 }
-+
-+dot1dStpBridgeMaxAge OBJECT-TYPE
-+    SYNTAX  Timeout (600..4000)
-+
-+    ACCESS  read-write
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The value that all bridges use for MaxAge when
-+            this bridge is acting as the root.  Note that
-+            802.1D-1990 specifies that the range for this
-+            parameter is related to the value of
-+            dot1dStpBridgeHelloTime. The granularity of this
-+            timer is specified by 802.1D-1990 to be 1 second.
-+            An agent may return a badValue error if a set is
-+            attempted to a value which is not a whole number
-+            of seconds."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.3.8"
-+    ::= { dot1dStp 12 }
-+
-+dot1dStpBridgeHelloTime OBJECT-TYPE
-+    SYNTAX  Timeout (100..1000)
-+    ACCESS  read-write
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The value that all bridges use for HelloTime when
-+            this bridge is acting as the root.  The
-+            granularity of this timer is specified by 802.1D-
-+            1990 to be 1 second.  An agent may return a
-+            badValue error if a set is attempted to a value
-+            which is not a whole number of seconds."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.3.9"
-+    ::= { dot1dStp 13 }
-+
-+dot1dStpBridgeForwardDelay OBJECT-TYPE
-+    SYNTAX  Timeout (400..3000)
-+    ACCESS  read-write
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The value that all bridges use for ForwardDelay
-+            when this bridge is acting as the root.  Note that
-+            802.1D-1990 specifies that the range for this
-+            parameter is related to the value of
-+            dot1dStpBridgeMaxAge.  The granularity of this
-+            timer is specified by 802.1D-1990 to be 1 second.
-+            An agent may return a badValue error if a set is
-+            attempted to a value which is not a whole number
-+            of seconds."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.3.10"
-+    ::= { dot1dStp 14 }
-+
-+-- The Spanning Tree Port Table
-+
-+dot1dStpPortTable OBJECT-TYPE
-+    SYNTAX  SEQUENCE OF Dot1dStpPortEntry
-+    ACCESS  not-accessible
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "A table that contains port-specific information
-+            for the Spanning Tree Protocol."
-+    ::= { dot1dStp 15 }
-+
-+dot1dStpPortEntry OBJECT-TYPE
-+    SYNTAX  Dot1dStpPortEntry
-+    ACCESS  not-accessible
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "A list of information maintained by every port
-+            about the Spanning Tree Protocol state for that
-+            port."
-+    INDEX   { dot1dStpPort }
-+    ::= { dot1dStpPortTable 1 }
-+
-+Dot1dStpPortEntry ::=
-+    SEQUENCE {
-+        dot1dStpPort
-+            INTEGER,
-+        dot1dStpPortPriority
-+            INTEGER,
-+        dot1dStpPortState
-+            INTEGER,
-+        dot1dStpPortEnable
-+            INTEGER,
-+        dot1dStpPortPathCost
-+            INTEGER,
-+        dot1dStpPortDesignatedRoot
-+            BridgeId,
-+        dot1dStpPortDesignatedCost
-+            INTEGER,
-+        dot1dStpPortDesignatedBridge
-+            BridgeId,
-+        dot1dStpPortDesignatedPort
-+            OCTET STRING,
-+        dot1dStpPortForwardTransitions
-+            Counter
-+    }
-+
-+dot1dStpPort OBJECT-TYPE
-+    SYNTAX  INTEGER (1..65535)
-+
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The port number of the port for which this entry
-+            contains Spanning Tree Protocol management
-+            information."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 6.8.2.1.2"
-+    ::= { dot1dStpPortEntry 1 }
-+
-+dot1dStpPortPriority OBJECT-TYPE
-+    SYNTAX  INTEGER (0..255)
-+    ACCESS  read-write
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The value of the priority field which is
-+            contained in the first (in network byte order)
-+            octet of the (2 octet long) Port ID.  The other
-+            octet of the Port ID is given by the value of
-+            dot1dStpPort."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.5.1"
-+    ::= { dot1dStpPortEntry 2 }
-+
-+dot1dStpPortState OBJECT-TYPE
-+    SYNTAX  INTEGER {
-+                disabled(1),
-+                blocking(2),
-+                listening(3),
-+                learning(4),
-+                forwarding(5),
-+                broken(6)
-+            }
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The port's current state as defined by
-+            application of the Spanning Tree Protocol.  This
-+            state controls what action a port takes on
-+            reception of a frame.  If the bridge has detected
-+            a port that is malfunctioning it will place that
-+            port into the broken(6) state.  For ports which
-+            are disabled (see dot1dStpPortEnable), this object
-+            will have a value of disabled(1)."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.5.2"
-+    ::= { dot1dStpPortEntry 3 }
-+
-+dot1dStpPortEnable OBJECT-TYPE
-+    SYNTAX  INTEGER {
-+                enabled(1),
-+                disabled(2)
-+            }
-+    ACCESS  read-write
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The enabled/disabled status of the port."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.5.2"
-+    ::= { dot1dStpPortEntry 4 }
-+
-+dot1dStpPortPathCost OBJECT-TYPE
-+    SYNTAX  INTEGER (1..65535)
-+    ACCESS  read-write
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The contribution of this port to the path cost of
-+            paths towards the spanning tree root which include
-+            this port.  802.1D-1990 recommends that the
-+            default value of this parameter be in inverse
-+            proportion to the speed of the attached LAN."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.5.3"
-+    ::= { dot1dStpPortEntry 5 }
-+
-+dot1dStpPortDesignatedRoot OBJECT-TYPE
-+    SYNTAX  BridgeId
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The unique Bridge Identifier of the Bridge
-+            recorded as the Root in the Configuration BPDUs
-+            transmitted by the Designated Bridge for the
-+            segment to which the port is attached."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.5.4"
-+    ::= { dot1dStpPortEntry 6 }
-+
-+dot1dStpPortDesignatedCost OBJECT-TYPE
-+    SYNTAX  INTEGER
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The path cost of the Designated Port of the
-+            segment connected to this port.  This value is
-+            compared to the Root Path Cost field in received
-+
-+            bridge PDUs."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.5.5"
-+    ::= { dot1dStpPortEntry 7 }
-+
-+dot1dStpPortDesignatedBridge OBJECT-TYPE
-+    SYNTAX  BridgeId
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The Bridge Identifier of the bridge which this
-+            port considers to be the Designated Bridge for
-+            this port's segment."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.5.6"
-+    ::= { dot1dStpPortEntry 8 }
-+
-+dot1dStpPortDesignatedPort OBJECT-TYPE
-+    SYNTAX  OCTET STRING (SIZE (2))
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The Port Identifier of the port on the Designated
-+            Bridge for this port's segment."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 4.5.5.7"
-+    ::= { dot1dStpPortEntry 9 }
-+
-+dot1dStpPortForwardTransitions OBJECT-TYPE
-+    SYNTAX  Counter
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The number of times this port has transitioned
-+            from the Learning state to the Forwarding state."
-+    ::= { dot1dStpPortEntry 10 }
-+
-+-- the dot1dTp group
-+
-+-- Implementation of the dot1dTp group is optional.  It is
-+-- implemented by those bridges that support the transparent
-+-- bridging mode.  A transparent or SRT bridge will implement
-+-- this group.
-+
-+dot1dTpLearnedEntryDiscards OBJECT-TYPE
-+    SYNTAX  Counter
-+
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The total number of Forwarding Database entries,
-+            which have been or would have been learnt, but
-+            have been discarded due to a lack of space to
-+            store them in the Forwarding Database.  If this
-+            counter is increasing, it indicates that the
-+            Forwarding Database is regularly becoming full (a
-+            condition which has unpleasant performance effects
-+            on the subnetwork).  If this counter has a
-+            significant value but is not presently increasing,
-+            it indicates that the problem has been occurring
-+            but is not persistent."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 6.7.1.1.3"
-+    ::= { dot1dTp 1 }
-+
-+dot1dTpAgingTime OBJECT-TYPE
-+    SYNTAX   INTEGER (10..1000000)
-+    ACCESS   read-write
-+    STATUS   mandatory
-+    DESCRIPTION
-+            "The timeout period in seconds for aging out
-+            dynamically learned forwarding information.
-+            802.1D-1990 recommends a default of 300 seconds."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 6.7.1.1.3"
-+    ::= { dot1dTp 2 }
-+
-+--  The Forwarding Database for Transparent Bridges
-+
-+dot1dTpFdbTable OBJECT-TYPE
-+    SYNTAX  SEQUENCE OF Dot1dTpFdbEntry
-+    ACCESS  not-accessible
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "A table that contains information about unicast
-+            entries for which the bridge has forwarding and/or
-+            filtering information.  This information is used
-+            by the transparent bridging function in
-+            determining how to propagate a received frame."
-+    ::= { dot1dTp 3 }
-+
-+dot1dTpFdbEntry OBJECT-TYPE
-+    SYNTAX  Dot1dTpFdbEntry
-+    ACCESS  not-accessible
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "Information about a specific unicast MAC address
-+            for which the bridge has some forwarding and/or
-+            filtering information."
-+    INDEX   { dot1dTpFdbAddress }
-+    ::= { dot1dTpFdbTable 1 }
-+
-+Dot1dTpFdbEntry ::=
-+    SEQUENCE {
-+        dot1dTpFdbAddress
-+            MacAddress,
-+        dot1dTpFdbPort
-+            INTEGER,
-+        dot1dTpFdbStatus
-+            INTEGER
-+    }
-+
-+dot1dTpFdbAddress OBJECT-TYPE
-+    SYNTAX  MacAddress
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "A unicast MAC address for which the bridge has
-+            forwarding and/or filtering information."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 3.9.1, 3.9.2"
-+    ::= { dot1dTpFdbEntry 1 }
-+
-+dot1dTpFdbPort OBJECT-TYPE
-+    SYNTAX  INTEGER
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "Either the value '0', or the port number of the
-+            port on which a frame having a source address
-+            equal to the value of the corresponding instance
-+            of dot1dTpFdbAddress has been seen.  A value of
-+            '0' indicates that the port number has not been
-+            learned but that the bridge does have some
-+            forwarding/filtering information about this
-+            address (e.g. in the dot1dStaticTable).
-+            Implementors are encouraged to assign the port
-+            value to this object whenever it is learned even
-+            for addresses for which the corresponding value of
-+            dot1dTpFdbStatus is not learned(3)."
-+    ::= { dot1dTpFdbEntry 2 }
-+
-+dot1dTpFdbStatus OBJECT-TYPE
-+    SYNTAX  INTEGER {
-+                other(1),
-+                invalid(2),
-+                learned(3),
-+                self(4),
-+                mgmt(5)
-+            }
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The status of this entry.  The meanings of the
-+            values are:
-+              other(1)   : none of the following.  This would
-+                           include the case where some other
-+                           MIB object (not the corresponding
-+                           instance of dot1dTpFdbPort, nor an
-+                           entry in the dot1dStaticTable) is
-+                           being used to determine if and how
-+                           frames addressed to the value of
-+                           the corresponding instance of
-+                           dot1dTpFdbAddress are being
-+                           forwarded.
-+              invalid(2) : this entry is not longer valid
-+                           (e.g., it was learned but has since
-+                           aged-out), but has not yet been
-+                           flushed from the table.
-+              learned(3) : the value of the corresponding
-+                           instance of dot1dTpFdbPort was
-+                           learned, and is being used.
-+              self(4)    : the value of the corresponding
-+                           instance of dot1dTpFdbAddress
-+                           represents one of the bridge's
-+                           addresses.  The corresponding
-+                           instance of dot1dTpFdbPort
-+                           indicates which of the bridge's
-+                           ports has this address.
-+              mgmt(5)    : the value of the corresponding
-+                           instance of dot1dTpFdbAddress is
-+                           also the value of an existing
-+                           instance of dot1dStaticAddress."
-+    ::= { dot1dTpFdbEntry 3 }
-+
-+--  Port Table for Transparent Bridges
-+
-+dot1dTpPortTable OBJECT-TYPE
-+    SYNTAX  SEQUENCE OF Dot1dTpPortEntry
-+    ACCESS  not-accessible
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "A table that contains information about every
-+            port that is associated with this transparent
-+            bridge."
-+    ::= { dot1dTp 4 }
-+
-+dot1dTpPortEntry OBJECT-TYPE
-+    SYNTAX  Dot1dTpPortEntry
-+    ACCESS  not-accessible
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "A list of information for each port of a
-+            transparent bridge."
-+    INDEX   { dot1dTpPort }
-+    ::= { dot1dTpPortTable 1 }
-+
-+Dot1dTpPortEntry ::=
-+    SEQUENCE {
-+        dot1dTpPort
-+            INTEGER,
-+        dot1dTpPortMaxInfo
-+            INTEGER,
-+        dot1dTpPortInFrames
-+            Counter,
-+        dot1dTpPortOutFrames
-+            Counter,
-+        dot1dTpPortInDiscards
-+            Counter
-+    }
-+
-+dot1dTpPort OBJECT-TYPE
-+    SYNTAX  INTEGER (1..65535)
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The port number of the port for which this entry
-+            contains Transparent bridging management
-+            information."
-+    ::= { dot1dTpPortEntry 1 }
-+
-+-- It would be nice if we could use ifMtu as the size of the
-+-- largest INFO field, but we can't because ifMtu is defined
-+-- to be the size that the (inter-)network layer can use which
-+-- can differ from the MAC layer (especially if several layers
-+-- of encapsulation are used).
-+
-+dot1dTpPortMaxInfo OBJECT-TYPE
-+    SYNTAX  INTEGER
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The maximum size of the INFO (non-MAC) field that
-+            this port will receive or transmit."
-+    ::= { dot1dTpPortEntry 2 }
-+
-+dot1dTpPortInFrames OBJECT-TYPE
-+    SYNTAX  Counter
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The number of frames that have been received by
-+            this port from its segment. Note that a frame
-+            received on the interface corresponding to this
-+            port is only counted by this object if and only if
-+            it is for a protocol being processed by the local
-+            bridging function, including bridge management
-+            frames."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 6.6.1.1.3"
-+    ::= { dot1dTpPortEntry 3 }
-+
-+dot1dTpPortOutFrames OBJECT-TYPE
-+    SYNTAX  Counter
-+    ACCESS  read-only
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The number of frames that have been transmitted
-+            by this port to its segment.  Note that a frame
-+            transmitted on the interface corresponding to this
-+            port is only counted by this object if and only if
-+            it is for a protocol being processed by the local
-+            bridging function, including bridge management
-+            frames."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 6.6.1.1.3"
-+    ::= { dot1dTpPortEntry 4 }
-+
-+dot1dTpPortInDiscards OBJECT-TYPE
-+    SYNTAX   Counter
-+    ACCESS   read-only
-+    STATUS   mandatory
-+    DESCRIPTION
-+            "Count of valid frames received which were
-+            discarded (i.e., filtered) by the Forwarding
-+            Process."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 6.6.1.1.3"
-+    ::= { dot1dTpPortEntry 5 }
-+-- The Static (Destination-Address Filtering) Database
-+
-+-- Implementation of this group is optional.
-+
-+dot1dStaticTable OBJECT-TYPE
-+    SYNTAX  SEQUENCE OF Dot1dStaticEntry
-+    ACCESS  not-accessible
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "A table containing filtering information
-+            configured into the bridge by (local or network)
-+            management specifying the set of ports to which
-+            frames received from specific ports and containing
-+            specific destination addresses are allowed to be
-+            forwarded.  The value of zero in this table as the
-+            port number from which frames with a specific
-+            destination address are received, is used to
-+            specify all ports for which there is no specific
-+            entry in this table for that particular
-+            destination address.  Entries are valid for
-+            unicast and for group/broadcast addresses."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 6.7.2"
-+    ::= { dot1dStatic 1 }
-+
-+dot1dStaticEntry OBJECT-TYPE
-+    SYNTAX  Dot1dStaticEntry
-+    ACCESS  not-accessible
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "Filtering information configured into the bridge
-+            by (local or network) management specifying the
-+            set of ports to which frames received from a
-+            specific port and containing a specific
-+            destination address are allowed to be forwarded."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 6.7.2"
-+    INDEX   { dot1dStaticAddress, dot1dStaticReceivePort }
-+    ::= { dot1dStaticTable 1 }
-+
-+Dot1dStaticEntry ::=
-+    SEQUENCE {
-+        dot1dStaticAddress
-+            MacAddress,
-+        dot1dStaticReceivePort
-+            INTEGER,
-+        dot1dStaticAllowedToGoTo
-+            OCTET STRING,
-+        dot1dStaticStatus
-+            INTEGER
-+    }
-+
-+dot1dStaticAddress OBJECT-TYPE
-+    SYNTAX  MacAddress
-+    ACCESS  read-write
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The destination MAC address in a frame to which
-+            this entry's filtering information applies.  This
-+            object can take the value of a unicast address, a
-+            group address or the broadcast address."
-+    REFERENCE
-+            "IEEE 802.1D-1990: Section 3.9.1, 3.9.2"
-+    ::= { dot1dStaticEntry 1 }
-+
-+dot1dStaticReceivePort OBJECT-TYPE
-+    SYNTAX  INTEGER
-+    ACCESS  read-write
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "Either the value '0', or the port number of the
-+            port from which a frame must be received in order
-+            for this entry's filtering information to apply.
-+            A value of zero indicates that this entry applies
-+            on all ports of the bridge for which there is no
-+            other applicable entry."
-+    ::= { dot1dStaticEntry 2 }
-+
-+dot1dStaticAllowedToGoTo OBJECT-TYPE
-+    SYNTAX  OCTET STRING
-+    ACCESS  read-write
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "The set of ports to which frames received from a
-+            specific port and destined for a specific MAC
-+
-+            address, are allowed to be forwarded.  Each octet
-+            within the value of this object specifies a set of
-+            eight ports, with the first octet specifying ports
-+            1 through 8, the second octet specifying ports 9
-+            through 16, etc.  Within each octet, the most
-+            significant bit represents the lowest numbered
-+            port, and the least significant bit represents the
-+            highest numbered port.  Thus, each port of the
-+            bridge is represented by a single bit within the
-+            value of this object.  If that bit has a value of
-+            '1' then that port is included in the set of
-+            ports; the port is not included if its bit has a
-+            value of '0'.  (Note that the setting of the bit
-+            corresponding to the port from which a frame is
-+            received is irrelevant.)  The default value of
-+            this object is a string of ones of appropriate
-+            length."
-+    ::= { dot1dStaticEntry 3 }
-+
-+dot1dStaticStatus OBJECT-TYPE
-+    SYNTAX  INTEGER {
-+                other(1),
-+                invalid(2),
-+                permanent(3),
-+                deleteOnReset(4),
-+                deleteOnTimeout(5)
-+            }
-+    ACCESS  read-write
-+    STATUS  mandatory
-+    DESCRIPTION
-+            "This object indicates the status of this entry.
-+            The default value is permanent(3).
-+                 other(1) - this entry is currently in use but
-+                      the conditions under which it will
-+                      remain so are different from each of the
-+                      following values.
-+                 invalid(2) - writing this value to the object
-+                      removes the corresponding entry.
-+                 permanent(3) - this entry is currently in use
-+                      and will remain so after the next reset
-+                      of the bridge.
-+                 deleteOnReset(4) - this entry is currently in
-+                      use and will remain so until the next
-+                      reset of the bridge.
-+                 deleteOnTimeout(5) - this entry is currently
-+                      in use and will remain so until it is
-+                      aged out."
-+
-+    ::= { dot1dStaticEntry 4 }
-+
-+-- Traps for use by Bridges
-+
-+-- Traps for the Spanning Tree Protocol
-+
-+newRoot TRAP-TYPE
-+    ENTERPRISE  dot1dBridge
-+    DESCRIPTION
-+            "The newRoot trap indicates that the sending agent
-+            has become the new root of the Spanning Tree; the
-+            trap is sent by a bridge soon after its election
-+            as the new root, e.g., upon expiration of the
-+            Topology Change Timer immediately subsequent to
-+            its election.  Implementation of this trap is
-+            optional."
-+    ::= 1
-+
-+topologyChange TRAP-TYPE
-+    ENTERPRISE  dot1dBridge
-+    DESCRIPTION
-+            "A topologyChange trap is sent by a bridge when
-+            any of its configured ports transitions from the
-+            Learning state to the Forwarding state, or from
-+            the Forwarding state to the Blocking state.  The
-+            trap is not sent if a newRoot trap is sent for the
-+            same transition.  Implementation of this trap is
-+            optional."
-+    ::= 2
-+
-+END
---- /dev/null
 +++ b/mibs/GNOME-SMI.txt
 @@ -0,0 +1,88 @@
 +GNOME-SMI DEFINITIONS ::= BEGIN
index 6a28ea03194227b876863a41958dc0ef6293d4d4..7b65c1867cc5f1f7f6f416fb965e6027f4ddc8f6 100644 (file)
@@ -1,6 +1,6 @@
 --- a/configure
 +++ b/configure
-@@ -10216,7 +10216,7 @@ linux* | k*bsd*-gnu)
+@@ -14197,7 +14197,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
    need_version=no
    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
    soname_spec='${libname}${release}${shared_ext}$major'
@@ -8,4 +8,4 @@
 +  finish_cmds=''
    shlibpath_var=LD_LIBRARY_PATH
    shlibpath_overrides_runpath=no
-   # This implies no fast_install, which is unacceptable.
index fa32544d2fbb3e3fc6628666bbe5165f9d04c7e8..2d572c06fee352410e77f29ee3b8b91fdc310c21 100644 (file)
@@ -1,11 +1,11 @@
 --- a/Makefile.top
 +++ b/Makefile.top
-@@ -81,7 +81,7 @@ LIBCURRENT  = 16
- LIBAGE      = 1
+@@ -85,7 +85,7 @@ LIBCURRENT  = 30
+ LIBAGE      = 0
  LIBREVISION = 3
  
 -LIB_LD_CMD      = $(LIBTOOL) --mode=link $(LINKCC) $(CFLAGS) -rpath $(libdir) -version-info $(LIBCURRENT):$(LIBREVISION):$(LIBAGE) -o
 +LIB_LD_CMD      = $(LIBTOOL) --mode=link $(LINKCC) $(CFLAGS) -rpath $(libdir) $(LDFLAGS) -version-info $(LIBCURRENT):$(LIBREVISION):$(LIBAGE) -o
  LIB_EXTENSION   = la
  LIB_VERSION     =
- LIB_LDCONFIG_CMD = $(LIBTOOL) --mode=finish $(libdir)
+ LIB_LDCONFIG_CMD = $(LIBTOOL) --mode=finish $(INSTALL_PREFIX)$(libdir)
diff --git a/net/net-snmp/patches/800-format-security.patch b/net/net-snmp/patches/800-format-security.patch
deleted file mode 100644 (file)
index 87a3e92..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/agent/mibgroup/host/hr_filesys.c
-+++ b/agent/mibgroup/host/hr_filesys.c
-@@ -322,13 +322,13 @@ var_hrfilesys(struct variable *vp,
-         long_return = fsys_idx;
-         return (u_char *) & long_return;
-     case HRFSYS_MOUNT:
--        snprintf(string, sizeof(string), HRFS_entry->HRFS_mount);
-+        snprintf(string, sizeof(string), "%s", HRFS_entry->HRFS_mount);
-         string[ sizeof(string)-1 ] = 0;
-         *var_len = strlen(string);
-         return (u_char *) string;
-     case HRFSYS_RMOUNT:
-         if (Check_HR_FileSys_NFS()) {
--            snprintf(string, sizeof(string), HRFS_entry->HRFS_name);
-+            snprintf(string, sizeof(string), "%s", HRFS_entry->HRFS_name);
-             string[ sizeof(string)-1 ] = 0;
-         } else
-             string[0] = '\0';
---- a/agent/mibgroup/ucd-snmp/extensible.c
-+++ b/agent/mibgroup/ucd-snmp/extensible.c
-@@ -513,7 +513,7 @@ fixExecError(int action,
-         }
-         tmp = *((long *) var_val);
-         if ((tmp == 1) && (action == COMMIT) && (exten->fixcmd[0] != 0)) {
--            sprintf(ex.command, exten->fixcmd);
-+            sprintf(ex.command, "%s", exten->fixcmd);
-             if ((fd = get_exec_output(&ex)) != -1) {
-                 file = fdopen(fd, "r");
-                 while (fgets(ex.output, sizeof(ex.output), file) != NULL);
index 26ff4bdd66235bda64e3611450b9af9704addc1a..e58c6eb444ab5852a89f7f1ed1280844c5f8ed2a 100644 (file)
@@ -7,9 +7,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nfs-kernel-server
-PKG_VERSION:=1.3.4
+PKG_VERSION:=2.1.1
 PKG_RELEASE:=1
-PKG_MD5SUM:=2fabdadb8ff415a1eafcfb12ab1bf781
+PKG_MD5SUM:=1157abcfaa8670f990f408cf280426b4
 
 PKG_SOURCE_URL:=@SF/nfs
 PKG_SOURCE:=nfs-utils-$(PKG_VERSION).tar.bz2
@@ -93,8 +93,8 @@ MAKE_FLAGS += \
        OPT="$(TARGET_CFLAGS)" \
        INSTALLSUID="install -m 4755" \
        DESTDIR="$(PKG_INSTALL_DIR)" \
-       RPCGEN_PATH=$(STAGING_DIR)/host/bin/rpcgen \
-       RPCGEN=$(STAGING_DIR)/host/bin/rpcgen
+       RPCGEN_PATH=$(STAGING_DIR_HOSTPKG)/bin/rpcgen \
+       RPCGEN=$(STAGING_DIR_HOSTPKG)/bin/rpcgen
 
 HOST_CFLAGS += -Dlinux
 
@@ -125,8 +125,8 @@ define Host/Compile
 endef
 
 define Host/Install
-       $(INSTALL_DIR) $(STAGING_DIR)/host/bin
-       $(INSTALL_BIN) $(HOST_BUILD_DIR)/tools/rpcgen/rpcgen $(STAGING_DIR)/host/bin/rpcgen
+       $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
+       $(INSTALL_BIN) $(HOST_BUILD_DIR)/tools/rpcgen/rpcgen $(STAGING_DIR_HOSTPKG)/bin/rpcgen
 endef
 
 define Package/nfs-kernel-server/install
index fa1e8739121cb6ac23acf2e1321c1562da68829c..5ebdaa51d5cd761fcb60814c8bee5cb04af6a067 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nginx
-PKG_VERSION:=1.10.1
-PKG_RELEASE:=2
+PKG_VERSION:=1.10.2
+PKG_RELEASE:=1
 
 PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://nginx.org/download/
-PKG_MD5SUM:=088292d9caf6059ef328aa7dda332e44
+PKG_MD5SUM:=e8f5f4beed041e63eb97f9f4f55f3085
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 PKG_LICENSE:=2-clause BSD-like license
 
@@ -241,7 +241,7 @@ define Build/Prepare
 endef
 
 define Download/nginx-naxsi
-       VERSION:=7a6ff365f6be736c826b2d69b967a250ac07197d
+       VERSION:=cf73f9c8664127252c2a4958d2e169516d3845a1
        SUBDIR:=nginx-naxsi
        FILE:=nginx-naxsi-module-$(PKG_VERSION)-$$(VERSION).tar.gz
        URL:=https://github.com/nbs-system/naxsi.git
index 2e97575542d5a0cc620b90c1d87a51f76cb0d2c4..f1e57ad4ffa74ed40015651b749ba5d4e7a00131 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ntp
 PKG_VERSION:=4.2.8p9
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 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:=857452b05f5f2e033786f77ade1974ed
+PKG_HASH:=b724287778e1bac625b447327c9851eedef020517a3545625e9f652a90f30b72
 
 PKG_LICENSE:=Unique
 PKG_LICENSE_FILES:=COPYRIGHT html/copyright.html
@@ -115,6 +115,9 @@ CONFIGURE_ARGS += \
 define Package/ntpd/install
        $(INSTALL_DIR) $(1)/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpd/ntpd $(1)/sbin/
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpq/ntpq $(1)/usr/sbin/
+       $(INSTALL_BIN) ./files/ntpd.hotplug-helper $(1)/usr/sbin/
        $(INSTALL_DIR) $(1)/etc
        $(INSTALL_CONF) ./files/ntp.conf $(1)/etc/
        $(INSTALL_DIR) $(1)/etc/init.d
@@ -145,7 +148,6 @@ endef
 define Package/ntp-utils/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpdc/ntpdc $(1)/usr/sbin/
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpq/ntpq $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/util/ntptime $(1)/usr/sbin/
 endef
 
diff --git a/net/ntpd/files/ntpd.hotplug-helper b/net/ntpd/files/ntpd.hotplug-helper
new file mode 100644 (file)
index 0000000..555825c
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+while true
+do
+       STATUS="$(/usr/sbin/ntpq -c 'rv 0 stratum'|awk -F '=' '{ print $2 }')"
+
+       if [ -n "$STATUS" ] && [ "$STATUS" -lt "16" ]
+       then
+               ACTION="stratum" /sbin/hotplug-call ntp
+               exit 0
+       fi
+       sleep 10
+done
index e626e248ff2099fd6fec27cd1567fca80d688a04..55dd3e84f1eeb132ddd03a9c42c69c0941a5f5d2 100644 (file)
@@ -5,14 +5,18 @@ START=65
 STOP=65
 
 USE_PROCD=1
+PROG=/sbin/ntpd
+HOTPLUG_HELPER=/usr/sbin/ntpd.hotplug-helper
 
 start_service() {
-#      ln -sf /dev/ttyS0 /dev/gps0
-#      /usr/sbin/setgarmin -d /dev/gps -c /etc/setgarmin.conf
        mkdir -p /var/lib/ntp
        chown -R ntp:ntp /var/lib/ntp
 
        procd_open_instance
-       procd_set_param command /sbin/ntpd -g -u ntp:ntp -p /var/run/ntpd.pid -n
+       procd_set_param command $PROG -g -u ntp:ntp -p /var/run/ntpd.pid -n
+       procd_close_instance
+
+       procd_open_instance
+       procd_set_param command $HOTPLUG_HELPER
        procd_close_instance
 }
index 8fe057653da7ddf5078de0d7dc48d6c545ff2c83..a5767f704abb2e804da741f5925a0a5a6d06faba 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ocserv
-PKG_VERSION:=0.11.6
-PKG_RELEASE:=2
+PKG_VERSION:=0.11.8
+PKG_RELEASE:=1
 PKG_USE_MIPS16:=0
 
 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:=0e4f82d267d27f2f9d3fcba58ac6cf5a
+PKG_HASH:=735b9b88a004d5bc8a91d4093d07ea0e2c9fac370a35d84beccc394ed24420c7
 
 PKG_LICENSE:=GPLv2+
 PKG_LICENSE_FILES:=COPYING
index a46c21c63c806fcae9f22b8096c2d0f5637656f5..a3b7692deeefdfca4a5f9bf344840f55893b56d0 100644 (file)
@@ -1,3 +1,10 @@
+############################################################################
+# NOTE: Do not modify this file to configure ocserv. Add new directives    #
+# in /etc/ocserv/ocserv.conf.local and these will be included in ocserv's  #
+# configuration                                                            #
+############################################################################
+
+
 # User authentication method. Could be set multiple times and in that case
 # all should succeed.
 # Options: certificate, pam. 
@@ -51,6 +58,12 @@ tcp-port = |PORT|
 # radius is in use.
 #stats-report-time = 360
 
+# Stats reset time. The period of time statistics kept by main/sec-mod
+# processes will be reset. These are the statistics shown by cmd
+# 'occtl show stats'. For daily: 86400, weekly: 604800
+# This is unrelated to stats-report-time.
+server-stats-reset-time = 604800
+
 # Keepalive in seconds
 keepalive = 32400
 
@@ -136,7 +149,7 @@ tls-priorities = "NORMAL:%SERVER_PRECEDENCE:%COMPAT:-VERS-SSL3.0"
 
 # The time (in seconds) that a client is allowed to stay connected prior
 # to authentication
-auth-timeout = 40
+auth-timeout = 240
 
 # The time (in seconds) that a client is allowed to stay idle (no traffic)
 # before being disconnected. Unset to disable.
@@ -161,10 +174,10 @@ min-reauth-time = 360
 # locally from an HTTP server (i.e., when listen-clear-file is used).
 #
 # Set to zero to disable.
-max-ban-score = 50
+max-ban-score = 80
 
 # The time (in seconds) that all score kept for a client is reset.
-ban-reset-time = 300
+ban-reset-time = 1200
 
 # In case you'd like to change the default points.
 #ban-points-wrong-password = 10
@@ -172,13 +185,19 @@ ban-reset-time = 300
 #ban-points-kkdcp = 1
 
 # Cookie timeout (in seconds)
-# which he can reconnect. That cookie will be invalided if not
-# used within this timeout value. On a user disconnection, that
-# cookie will also be active for this time amount prior to be
-# invalid. That should allow a reasonable amount of time for roaming
-# between different networks.
+# Once a client is authenticated he's provided a cookie with
+# which he can reconnect. That cookie will be invalidated if not
+# used within this timeout value. This cookie remains valid, during
+# the user's connected time, and after user disconnection it
+# remains active for this amount of time. That setting should allow a
+# reasonable amount of time for roaming between different networks.
 cookie-timeout = 300
 
+# If this is enabled (not recommended) the cookies will stay
+# valid even after a user manually disconnects, and until they
+# expire. This may improve roaming with some broken clients.
+#persistent-cookies = true
+
 # Whether roaming is allowed, i.e., if true a cookie is
 # restricted to a single IP address and cannot be re-used
 # from a different IP.
@@ -186,7 +205,8 @@ deny-roaming = false
 
 # ReKey time (in seconds)
 # ocserv will ask the client to refresh keys periodically once
-# this amount of seconds is elapsed. Set to zero to disable.
+# this amount of seconds is elapsed. Set to zero to disable (note
+# that, some clients fail if rekey is disabled).
 rekey-time = 172800
 
 # ReKey method
@@ -285,6 +305,10 @@ ipv4-netmask = |NETMASK|
 # it is not in use by another (unrelated to this server) host.
 ping-leases = |PING_LEASES|
 
+# Whether to tunnel all DNS queries via the VPN. This is the default
+# when a default route is set.
+#tunnel-all-dns = true
+
 # Unset to assign the default MTU of the device
 # mtu = 
 
diff --git a/net/ocserv/patches/001-makefile-fix.patch b/net/ocserv/patches/001-makefile-fix.patch
deleted file mode 100644 (file)
index 0d48282..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-diff --git a/src/Makefile.am b/src/Makefile.am
-index 5943a50..4b2c77c 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -23,18 +23,7 @@ noinst_LIBRARIES = libcmd-ocserv.a libipc.a
- libcmd_ocserv_a_SOURCES = ocserv-args.def ocserv-args.c ocserv-args.h
- ocserv-args.c: $(srcdir)/ocserv-args.def $(builddir)/version.inc
--      if test "$(AUTOGEN)" = ":";then \
--              rm -f $(builddir)/ocserv-args.c; \
--              rm -f $(builddir)/ocserv-args.h; \
--              cp $(srcdir)/autogen/ocserv-args.c $(builddir)/; \
--              cp $(srcdir)/autogen/ocserv-args.h $(builddir)/; \
--      else \
--              $(AUTOGEN) $<; \
--              if test -d $(srcdir)/autogen;then \
--                      cp $(builddir)/ocserv-args.c $(srcdir)/autogen; \
--                      cp $(builddir)/ocserv-args.h $(srcdir)/autogen; \
--              fi; \
--      fi
-+      $(AUTOGEN) $<
- ocserv-args.h: ocserv-args.c
- # Authentication module sources
-diff --git a/src/ocpasswd/Makefile.am b/src/ocpasswd/Makefile.am
-index 97e2491..6304607 100644
---- a/src/ocpasswd/Makefile.am
-+++ b/src/ocpasswd/Makefile.am
-@@ -21,17 +21,6 @@ ocpasswd_LDADD += $(LIBGNUTLS_LIBS) $(LIBCRYPT) $(CODE_COVERAGE_LDFLAGS) \
-       $(LIBNETTLE_LIBS)
- args.c: $(srcdir)/args.def $(builddir)/../version.inc
--      if test "$(AUTOGEN)" = ":";then \
--              rm -f $(builddir)/args.c; \
--              rm -f $(builddir)/args.h; \
--              cp $(srcdir)/../autogen/ocpasswd-args.c $(builddir)/args.c; \
--              cp $(srcdir)/../autogen/ocpasswd-args.h $(builddir)/args.h; \
--      else \
--              $(AUTOGEN) $<; \
--              if test -d $(srcdir)/autogen;then \
--                      cp $(builddir)/args.c $(srcdir)/../autogen/ocpasswd-args.c; \
--                      cp $(builddir)/args.h $(srcdir)/../autogen/ocpasswd-args.h; \
--              fi; \
--      fi
-+      $(AUTOGEN) $<
- args.h: args.c
index 73e7e676593a9ee06ab47fa7ed5750a33e6390f3..b6881c2b1d33e1b63f97ba108458ae2c4ba6b49b 100644 (file)
@@ -8,13 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssh
-PKG_VERSION:=7.3p1
-PKG_RELEASE:=3
+PKG_VERSION:=7.4p1
+PKG_RELEASE:=1
 
 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:=dfadd9f035d38ce5d58a3bf130b86d08
+PKG_SOURCE_URL:=https://ftp.spline.de/pub/OpenBSD/OpenSSH/portable/ \
+               https://anorien.csc.warwick.ac.uk/pub/OpenBSD/OpenSSH/portable/ \
+               https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/
+PKG_MD5SUM:=b2db2a83caf66a208bb78d6d287cdaa3
 
 PKG_LICENSE:=BSD ISC
 PKG_LICENSE_FILES:=LICENCE
diff --git a/net/openssh/patches/100-openssh-7.3_p1-NEWKEYS_null_deref.patch b/net/openssh/patches/100-openssh-7.3_p1-NEWKEYS_null_deref.patch
deleted file mode 100644 (file)
index 27e99b2..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-Backport of
-https://anongit.mindrot.org/openssh.git/patch/?id=28652bca29046f62c7045e933e6b931de1d16737
-
---- openssh-7.3p1/kex.c
-+++ openssh-7.3p1/kex.c
-@@ -419,6 +419,8 @@
-       ssh_dispatch_set(ssh, SSH2_MSG_NEWKEYS, &kex_protocol_error);
-       if ((r = sshpkt_get_end(ssh)) != 0)
-               return r;
-+      if ((r = ssh_set_newkeys(ssh, MODE_IN)) != 0)
-+              return r;
-       kex->done = 1;
-       sshbuf_reset(kex->peer);
-       /* sshbuf_reset(kex->my); */
---- openssh-7.3p1/packet.c
-+++ openssh-7.3p1/packet.c
-@@ -1919,9 +1919,7 @@
-                       return r;
-               return SSH_ERR_PROTOCOL_ERROR;
-       }
--      if (*typep == SSH2_MSG_NEWKEYS)
--              r = ssh_set_newkeys(ssh, MODE_IN);
--      else if (*typep == SSH2_MSG_USERAUTH_SUCCESS && !state->server_side)
-+      if (*typep == SSH2_MSG_USERAUTH_SUCCESS && !state->server_side)
-               r = ssh_packet_enable_delayed_compress(ssh);
-       else
-               r = 0;
diff --git a/net/openssh/patches/101-Unregister-the-KEXINIT-handler-after-receive.patch b/net/openssh/patches/101-Unregister-the-KEXINIT-handler-after-receive.patch
deleted file mode 100644 (file)
index f7b41dc..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/kex.c b/kex.c
-index 50c7a0f..d09c27b 100644
---- a/kex.c
-+++ b/kex.c
-@@ -1,4 +1,4 @@
--/* $OpenBSD: kex.c,v 1.118 2016/05/02 10:26:04 djm Exp $ */
-+/* $OpenBSD: kex.c,v 1.127 2016/10/10 19:28:48 markus Exp $ */
- /*
-  * Copyright (c) 2000, 2001 Markus Friedl.  All rights reserved.
-  *
-@@ -472,6 +472,7 @@ kex_input_kexinit(int type, u_int32_t seq, void *ctxt)
-       if (kex == NULL)
-               return SSH_ERR_INVALID_ARGUMENT;
-+      ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, NULL);
-       ptr = sshpkt_ptr(ssh, &dlen);
-       if ((r = sshbuf_put(kex->peer, ptr, dlen)) != 0)
-               return r;
index cb7170fddb7c48634b74643ed644240c96e277f2..2a0fcf63f59cdf7d5d6626a963e8e69564b7636c 100644 (file)
@@ -35,6 +35,21 @@ PKG_INSTALL:=1
 # Support for kernel 4.4 is backported
 SUPPORTED_KERNELS:=LINUX_3_18||LINUX_4_1||LINUX_4_3||LINUX_4_4
 
+# If only kmod-openvswitch is enabled, then override default make path to only
+# build and install the datapath/linux subdirectory which cuts down compilation
+# time dramatically.
+ifeq ($(CONFIG_PACKAGE_openvswitch-base),)
+ ifneq ($(CONFIG_PACKAGE_kmod-openvswitch),)
+  MAKE_PATH := datapath/linux
+ endif
+endif
+
+# Additionally register PKG_CONFIG_DEPENDS to trigger a rebuild of the code
+# base if the package selection changes.
+PKG_CONFIG_DEPENDS := \
+       CONFIG_PACKAGE_openvswitch-base \
+       CONFIG_PACKAGE_kmod-openvswitch
+
 include $(INCLUDE_DIR)/package.mk
 $(call include_mk, python-package.mk)
 
@@ -71,7 +86,7 @@ endef
 define Package/openvswitch-python
   $(call Package/openvswitch/Default)
   TITLE:=Open vSwitch Python Support
-  DEPENDS:=+openvswitch +python
+  DEPENDS:=+openvswitch +PACKAGE_openvswitch-python:python
 endef
 
 define Package/openvswitch-python/description
diff --git a/net/pen/Makefile b/net/pen/Makefile
new file mode 100644 (file)
index 0000000..48d622c
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# Copyright (C) 2006-2015 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:=pen
+PKG_VERSION:=0.34.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://siag.nu/pub/pen/
+PKG_HASH:=a3306bfb02619b103ff431002bb91079048bf2dd24f739bf38e373860558cd27
+
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/pen
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+libopenssl
+  TITLE:=Simple TCP load balancer
+  URL:=http://morestuff.siag.nu/category/pen/
+endef
+
+define Package/pen/description
+       This is pen, a load balancer for "simple" TCP based protocols
+       such as HTTP or SMTP. It allows several servers to appear as
+       one to the outside and automatically detects servers that are
+       down and distributes clients among the available servers.
+       This gives high availability and scalable performance.
+endef
+
+CONFIGURE_ARGS += \
+               --with-poll \
+               --with-ssl="$(STAGING_DIR)/usr" \
+               --without-geoip \
+
+define Package/pen/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/mergelogs $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/pen $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/penctl $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/penlog $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/penlogd $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/penctl.cgi $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/penstats $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,pen))
index 0d18aa1276f3c74fa64934ab283769891c549947..294b00f4d7e542355ffae072b3b87a68415691ca 100644 (file)
@@ -67,6 +67,6 @@ start_service() {
        ln -sfn $CHAP_SECRETS /etc/ppp/chap-secrets
 
        procd_open_instance
-       procd_set_param command $BIN -c $CONFIG -o $OPTIONS_PPTP
+       procd_set_param command $BIN -c $CONFIG --fg -o $OPTIONS_PPTP
        procd_close_instance
 }
index 0942a626f3973b819b87a722aee31cb5aeef10a8..b35fd03c1606a621508fdca564123110ab83a459 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=prosody
-PKG_VERSION:=0.9.10
+PKG_VERSION:=0.9.12
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://prosody.im/downloads/source
-PKG_MD5SUM:=ef6d4a9e6dcae577eb52f7277d7beac5
+PKG_MD5SUM:=d743adea6cfbaacc3a24cc0c3928bb1b
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
 PKG_LICENSE:=MIT/X11
 
@@ -50,7 +50,7 @@ define Build/Configure
        # this is *NOT* GNU autoconf stuff
        (cd $(PKG_BUILD_DIR); ./configure \
                --prefix=/usr \
-               --with-lua="$(STAGING_DIR)/host/bin" \
+               --with-lua="$(STAGING_DIR_HOSTPKG)/bin" \
                --with-lua-include="$(STAGING_DIR)/usr/include" \
                --with-lua-lib="$(STAGING_DIR)/usr/lib" \
                --cflags="$(TARGET_CFLAGS)" \
index f9fa04758c39c1f74cca5385ebe75b2d0be7277d..aa4f00ae2ddc00e06596b12907764950867525dc 100644 (file)
@@ -12,7 +12,7 @@ PKG_VERSION:=3.1.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://rsync.samba.org/ftp/rsync/src
+PKG_SOURCE_URL:=https://download.samba.org/pub/rsync/src
 PKG_MD5SUM:=0f758d7e000c0f7f7d3792610fad70cb
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
 PKG_LICENSE:=GPL-3.0
index d8b1ae8a01f9a5d57ee6a4b2c60a32ffdfefebac..a30abbd04edec3b61d077d41644af6704bd6a53b 100644 (file)
@@ -11,12 +11,12 @@ diff -rupN seafile-ccnet-5.1.1.orig/lib/Makefile.am seafile-ccnet-5.1.1/lib/Make
  ccnet-object.h: ${ccnet_object_define}
        rm -f $@
 -      valac --pkg posix ${ccnet_object_define} -C -H ccnet-object.h
-+      "$(STAGING_DIR)/host/bin/valac" --pkg posix ${ccnet_object_define} -C -H ccnet-object.h
++      "$(STAGING_DIR_HOSTPKG)/bin/valac" --pkg posix ${ccnet_object_define} -C -H ccnet-object.h
  
  ccnetobj.c: ${ccnet_object_define}
        rm -f $@
 -      valac -C --pkg posix ${ccnet_object_define}
-+      "$(STAGING_DIR)/host/bin/valac" -C --pkg posix ${ccnet_object_define}
++      "$(STAGING_DIR_HOSTPKG)/bin/valac" -C --pkg posix ${ccnet_object_define}
  
  searpc_gen = searpc-signature.h searpc-marshal.h
  
diff --git a/net/seafile-server/Config.in b/net/seafile-server/Config.in
deleted file mode 100644 (file)
index d83f795..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-menu "Configuration"
-       depends on PACKAGE_seafile-server
-
-config SEAFILE_FUSE_SUPPORT
-       bool "Enable FUSE support"
-       select PACKAGE_libfuse
-       default n
-
-config SEAFILE_CONSOLE_SUPPORT
-       bool "Enable seafile server console"
-       default n
-
-config SEAFILE_RIAK_SUPPORT
-       bool "Enable support for riak backend"
-       default n
-endmenu
diff --git a/net/seafile-server/Makefile b/net/seafile-server/Makefile
deleted file mode 100644 (file)
index 3855221..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-#
-# Copyright (C) 2007-2016 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:=seafile-server
-PKG_VERSION:=5.1.4
-PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
-PKG_LICENSE:=GPL-3.0
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/haiwen/seafile.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=b9dc96ee845bb0148d9075aec597e6e07652cbdc
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
-$(call include_mk, python-package.mk)
-
-define Package/seafile-server
-    SECTION:=net
-    CATEGORY:=Network
-    TITLE:=Seafile server
-    MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
-    URL:=http://seafile.com/
-    DEPENDS:=+libarchive +libopenssl +glib2 +libsearpc +seafile-ccnet +seafile-seahub +sqlite3-cli +python-mysql +python-urllib3 \
-               +jansson +libevent2 +libevent2-openssl +zlib +libzdb +libsqlite3 +libmysqlclient \
-               +libpthread +libuuid +bash +procps-ng +procps-ng-pkill +SEAFILE_FUSE_SUPPORT:libfuse $(ICONV_DEPENDS)
-    EXTRA_DEPENDS:=seafile-ccnet (=5.1.4-44f74fdc5160c1bf16a92e71d79b856763ddbc15-1), seafile-seahub (=5.1.4-1e1c02aa4f2a0256ffa29a28224aad2d678f43a0-1)
-    MENU:=1
-endef
-
-define Package/seafile-server/config
-       source "$(SOURCE)/Config.in"
-endef
-
-define Package/seafile-server/description
-   Open source cloud storage with advanced features on privacy protection and teamwork.
-endef
-
-CONFIGURE_ARGS += --disable-client \
-                   --enable-server \
-                   --enable-python \
-                   --disable-static-build \
-                   --disable-server-pkg
-
-ifeq ($(CONFIG_SEAFILE_FUSE_SUPPORT),y)
-       CONFIGURE_ARGS += --enable-fuse
-       TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/fuse
-else
-       CONFIGURE_ARGS += --disable-fuse
-endif
-
-ifeq ($(CONFIG_SEAFILE_CONSOLE_SUPPORT),y)
-       CONFIGURE_ARGS += --enable-console
-else
-       CONFIGURE_ARGS += --disable-console
-endif
-
-ifeq ($(CONFIG_SEAFILE_RIAK_SUPPORT),y)
-       CONFIGURE_ARGS += --enable-riak
-else
-       CONFIGURE_ARGS += --disable-riak
-endif
-
-PKG_BUILD_DEPENDS:=vala/host libevhtp
-
-# This is required as python-package.mk overrides the default setting of having interlinking enabled
-ifdef CONFIG_USE_MIPS16
-       TARGET_CFLAGS += -minterlink-mips16
-endif
-TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib -liconv \
-                   -L$(STAGING_DIR)/usr/lib/mysql -lmysqlclient -lz -levent_openssl -levent
-
-define Package/seafile-server/conffiles
-/etc/config/seafile
-endef
-
-define Package/seafile-server/install
-       $(INSTALL_DIR) $(1)/usr/{bin,lib}
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(INSTALL_DIR) $(1)/usr/share/seafile/seafile-server
-       $(INSTALL_DIR) $(1)/usr/share/seafile/conf
-       $(INSTALL_DIR) $(1)/etc/{config,init.d}
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
-       $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/seafile/ $(1)$(PYTHON_PKG_DIR)/
-       $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/seaserv/ $(1)$(PYTHON_PKG_DIR)/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libseafile.so* $(1)/usr/lib/
-       $(CP) $(PKG_BUILD_DIR)/scripts/seaf-gc.sh $(1)/usr/share/seafile/seafile-server/
-       $(CP) $(PKG_BUILD_DIR)/scripts/seaf-fsck.sh $(1)/usr/share/seafile/seafile-server/
-ifeq ($(CONFIG_SEAFILE_FUSE_SUPPORT),y)
-       $(CP) $(PKG_BUILD_DIR)/scripts/seaf-fuse.sh $(1)/usr/share/seafile/seafile-server/
-endif
-       $(CP) $(PKG_BUILD_DIR)/scripts/setup-seafile-mysql.py $(1)/usr/share/seafile/seafile-server/
-       $(CP) $(PKG_BUILD_DIR)/scripts/setup-seafile-mysql.sh $(1)/usr/share/seafile/seafile-server/
-       $(CP) $(PKG_BUILD_DIR)/scripts/sqlite2mysql.py $(1)/usr/share/seafile/seafile-server/
-       $(CP) $(PKG_BUILD_DIR)/scripts/sqlite2mysql.sh $(1)/usr/share/seafile/seafile-server/
-       $(CP) $(PKG_BUILD_DIR)/scripts/check_init_admin.py $(1)/usr/share/seafile/seafile-server/
-       $(CP) $(PKG_BUILD_DIR)/scripts/upgrade/ $(1)/usr/share/seafile/seafile-server/
-       $(CP) ./files/seafile.conf $(1)/etc/config/seafile
-       $(INSTALL_BIN) ./files/seafile.init $(1)/etc/init.d/seafile
-       $(INSTALL_BIN) ./files/seahub.init $(1)/etc/init.d/seahub
-       find $(1) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
-endef
-
-define Build/InstallDev
-       $(INSTALL_DIR) $(1)/usr/include
-       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/seafile/ $(1)/usr/include/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libseafile.pc $(1)/usr/lib/pkgconfig/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libseafile.so* $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/seafile/ $(1)$(PYTHON_PKG_DIR)/
-       $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/seaserv/ $(1)$(PYTHON_PKG_DIR)/
-endef
-
-define Package/seafile-server/postinst
-#!/bin/sh
-[ ! -f /etc/init.d/seafile ] && exit 0
-
-if [ ! -d /usr/share/seafile/seafile-data ]
-then
-   echo "*** Installation completed, running configuration script..."
-   /etc/init.d/seafile setup
-
-   if [ $$? -ne 0 ]
-   then
-      echo
-      echo "*** ERROR: Configuration failed. Please fix the issues if any and re-run the script using the command below:"
-      echo "*** \"/etc/init.d/seafile setup\""
-   fi
-else
-   echo "*** seafile-data directory already exists."
-   echo
-   echo "*** In case you are upgrading seafile, please run the appropriate upgrade script"
-   echo "*** manually before using the new version."
-   echo "*** Upgrade scripts are located at \"/usr/share/seafile/seafile-server/upgrade\""
-   echo
-   echo "*** For more information, please read http://manual.seafile.com/deploy/upgrade.html"
-fi
-endef
-
-$(eval $(call BuildPackage,seafile-server))
diff --git a/net/seafile-server/files/seafile.conf b/net/seafile-server/files/seafile.conf
deleted file mode 100644 (file)
index f4c0ea9..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# Start Seahub in fastcgi mode - 1 = enable, 0 = disable
-SEAHUB_FASTCGI=0
-# Listen on the port specified below (defaults to 8000)
-SEAHUB_PORT=8000
-# Method of serving requests (fastcgi mode only) - threaded or prefork
-# Using threaded mode is recommended as it consumes less resources
-SEAHUB_METHOD=threaded
-# The maximum number of worker processes/threads (fastcgi mode only)
-# General formula: (2 x $num_cores) + 1
-# To set the number of workers in WSGI mode (which is the default)
-# please edit /usr/share/seafile/seafile-server/runtime/seahub.conf
-SEAHUB_WORKERS=3
diff --git a/net/seafile-server/files/seafile.init b/net/seafile-server/files/seafile.init
deleted file mode 100755 (executable)
index 1c6553a..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-#!/bin/bash /etc/rc.common
-
-START=98
-APP=seafile
-EXTRA_HELP="   setup   Runs the setup script
-       create_admin    Creates the administrative login
-       reset_admin     Alias to create_admin"
-EXTRA_COMMANDS="setup create_admin reset_admin"
-
-TOPDIR=/usr/share/seafile
-default_ccnet_conf_dir=${TOPDIR}/ccnet
-central_config_dir=${TOPDIR}/conf
-seaf_controller=/usr/bin/seafile-controller
-
-function validate_ccnet_conf_dir () {
-       if [[ ! -d ${default_ccnet_conf_dir} ]]; then
-               echo "Error: there is no ccnet config directory."
-               echo "Have you run \"/etc/init.d/seafile setup\"?"
-               echo ""
-               exit 1
-       fi
-}
-
-function validate_central_conf_dir () {
-       if [[ ! -d ${central_config_dir} ]]; then
-               echo "Error: there is no conf/ directory."
-               echo "Have you run \"/etc/init.d/seafile setup\"?"
-               echo ""
-               exit 1
-       fi
-}
-
-function read_seafile_data_dir () {
-       seafile_ini=${default_ccnet_conf_dir}/seafile.ini
-       if [[ ! -f ${seafile_ini} ]]; then
-               echo "Error: ${seafile_ini} not found."
-               exit 1
-       fi
-       seafile_data_dir=$(cat "${seafile_ini}")
-       if [[ ! -d ${seafile_data_dir} ]]; then
-               echo "Your seafile server data directory \"${seafile_data_dir}\" is invalid or doesn't exits."
-               echo "Please check it first, or create this directory yourself."
-               echo ""
-               exit 1
-       fi
-}
-
-function test_config() {
-       if ! ${seaf_controller} --test \
-               -c "${default_ccnet_conf_dir}" \
-               -d "${seafile_data_dir}" \
-               -F "${central_config_dir}" ; then
-               exit 1
-       fi
-}
-
-function check_component_running() {
-       name=$1
-       cmd=$2
-       if pid=$(pgrep -f "$cmd" 2>/dev/null); then
-               return 1
-       fi
-}
-
-function validate_already_running () {
-       check_component_running "seafile-controller" "seafile-controller -F ${central_config_dir}" || return 1
-       check_component_running "ccnet-server" "ccnet-server -F ${central_config_dir}" || return 1
-       check_component_running "seaf-server" "seaf-server -F ${central_config_dir}" || return 1
-       check_component_running "fileserver" "fileserver -F ${central_config_dir}" || return 1
-       check_component_running "seafdav" "wsgidav.server.run_server" || return 1
-}
-
-function start_seafile_server () {
-       if ! validate_already_running; then
-               if [[ "$name" == "seafile-controller" ]]; then
-                       echo "Seafile already running."
-               else
-                       echo "Error: component [$name] is already running. Please try stopping it manually by running \"kill $pid\"."
-                       echo "To force killing the process, use \"kill -9 $pid\"."
-               fi
-               exit 1
-       fi
-       validate_central_conf_dir
-       validate_ccnet_conf_dir
-       read_seafile_data_dir
-       test_config
-
-       echo "Starting seafile server, please wait ..."
-
-       ${seaf_controller} \
-               -F "${central_config_dir}" \
-               -c "${default_ccnet_conf_dir}" \
-               -d "${seafile_data_dir}"
-
-       sleep 3
-
-       # check if seafile server started successfully
-       if ! pgrep -f "seafile-controller -F ${central_config_dir}" 2>/dev/null 1>&2; then
-               echo "Failed to start seafile server"
-               exit 1
-       fi
-
-       echo "Seafile server started"
-       echo
-}
-
-function stop_seafile_server () {
-       if ! pgrep -f "seafile-controller -F ${central_config_dir}" 2>/dev/null 1>&2; then
-               echo "Seafile server not running"
-       else
-               echo "Stopping seafile server ..."
-               pkill -SIGTERM -f "seafile-controller -F ${central_config_dir}"
-               pkill -f "ccnet-server -F ${central_config_dir}"
-               pkill -f "seaf-server -F ${central_config_dir}"
-               pkill -f "fileserver -F ${central_config_dir}"
-               pkill -f "soffice.*--invisible --nocrashreport"
-               pkill -f  "wsgidav.server.run_server"
-               retry=1
-               while ! validate_already_running && [ $retry -lt 60 ]; do sleep 1; ((retry++)); done
-               if ! validate_already_running; then
-                       echo "Error: [$name] component is still running. Please try stopping it manually by running \"kill $pid\"."
-                       echo "To force killing the process, use \"kill -9 $pid\"."
-               fi
-
-       fi
-}
-
-function restart_seafile_server () {
-       stop_seafile_server
-       start_seafile_server
-}
-
-function start() {
-       start_seafile_server
-}
-
-function stop() {
-       stop_seafile_server
-}
-
-function restart() {
-       restart_seafile_server
-}
-
-function setup() {
-       cd "$TOPDIR" && \
-               /usr/bin/seafile-admin setup
-}
-
-function create_admin() {
-       cd "$TOPDIR" && \
-               /usr/bin/seafile-admin create-admin
-}
-
-function reset_admin() {
-       create_admin
-}
diff --git a/net/seafile-server/files/seahub.init b/net/seafile-server/files/seahub.init
deleted file mode 100755 (executable)
index da3a1d1..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-#!/bin/bash /etc/rc.common
-
-START=99
-APP=seahub
-EXTRA_HELP="   clearsessions   Clears expired sessions from database"
-EXTRA_COMMANDS="clearsessions"
-
-SEAHUB_FASTCGI=0
-SEAHUB_PORT=8000
-SEAHUB_METHOD=threaded
-SEAHUB_WORKERS=3
-
-[ -f /etc/config/seafile ] && \
-       . /etc/config/seafile
-
-INSTALLPATH=/usr/share/seafile/seafile-server
-TOPDIR=$(dirname "${INSTALLPATH}")
-default_ccnet_conf_dir=${TOPDIR}/ccnet
-central_config_dir=${TOPDIR}/conf
-
-manage_py=${INSTALLPATH}/seahub/manage.py
-gunicorn_conf=${INSTALLPATH}/runtime/seahub.conf
-pidfile=/var/run/seafile/seahub.pid
-errorlog=${INSTALLPATH}/runtime/error.log
-accesslog=${INSTALLPATH}/runtime/access.log
-gunicorn_exe=/usr/bin/gunicorn
-
-function check_python_executable() {
-       if [[ "$PYTHON" != "" && -x $PYTHON ]]; then
-               return 0
-       fi
-
-       if which python2.7 2>/dev/null 1>&2; then
-               PYTHON=python2.7
-       elif which python27 2>/dev/null 1>&2; then
-               PYTHON=python27
-       else
-               echo
-               echo "Can't find a python executable of version 2.7 or above in PATH"
-               echo "Install python 2.7+ before continue."
-               echo "Or if you installed it in a non-standard PATH, set the PYTHON enviroment varirable to it"
-               echo
-               exit 1
-       fi
-}
-
-function validate_ccnet_conf_dir() {
-       if [[ ! -d ${default_ccnet_conf_dir} ]]; then
-               echo "Error: there is no ccnet config directory."
-               echo "Have you run '/etc/init.d/seafile setup'?"
-               echo ""
-               exit 1
-       fi
-}
-
-function read_seafile_data_dir() {
-       seafile_ini=${default_ccnet_conf_dir}/seafile.ini
-       if [[ ! -f ${seafile_ini} ]]; then
-               echo "Error: ${seafile_ini} not found."
-               exit 1
-       fi
-       seafile_data_dir=$(cat "${seafile_ini}")
-       if [[ ! -d ${seafile_data_dir} ]]; then
-               echo "Your seafile server data directory \"${seafile_data_dir}\" is invalid or doesn't exits."
-               echo "Please check it first, or create this directory yourself."
-               echo ""
-               exit 1
-       fi
-}
-
-function validate_seahub_running() {
-       if pid=$(pgrep -f "${manage_py}" 2>/dev/null); then
-               return 1
-       elif pid=$(pgrep -f "seahub.wsgi:application" 2>/dev/null); then
-               return 1
-       fi
-}
-
-function validate_port() {
-       if ! [[ ${SEAHUB_PORT} =~ ^[1-9][0-9]{1,4}$ ]] ; then
-               printf "\033[033m${SEAHUB_PORT}\033[m is not a valid port number\n"
-               exit 1
-       fi
-}
-
-function warning_if_seafile_not_running() {
-       if ! pgrep -f "seafile-controller -F ${central_config_dir}" 2>/dev/null 1>&2; then
-               echo
-               echo "Error: seafile-controller not running. Have you run \"/etc/init.d/seafile start\"?"
-               echo
-               exit 1
-       fi
-}
-
-function prepare_seahub_log_dir() {
-       logdir="${TOPDIR}/logs"
-       if ! [[ -d "${logsdir}" ]]; then
-               if ! mkdir -p "${logdir}"; then
-                   echo "Error: failed to create log dir \"${logdir}\""
-                   exit 1
-               fi
-       fi
-       export SEAHUB_LOG_DIR="${logdir}"
-}
-
-function before_start() {
-       prepare_env
-       warning_if_seafile_not_running
-       if ! validate_seahub_running; then
-               echo "Seahub is already running."
-               exit 1
-       fi
-       prepare_seahub_log_dir
-       validate_port
-}
-
-function start_seahub() {
-       before_start
-       echo "Starting seahub at port ${SEAHUB_PORT} ..."
-       check_init_admin
-       $PYTHON $gunicorn_exe seahub.wsgi:application -c "${gunicorn_conf}" -b "0.0.0.0:${SEAHUB_PORT}" --preload
-
-       # Ensure seahub is started successfully
-       retry=1
-       while ! validate_seahub_running && [[ ! -f "${pidfile}"  ]] && [[ $retry -lt 120 ]]; do sleep 1; ((retry++)); done
-       if ! validate_seahub_running && [[ -f "${pidfile}" ]]; then
-               echo
-               echo "Seahub is started"
-               echo
-       else
-               printf "\033[33mError: Seahub failed to start.\033[m\n"
-               exit 1
-       fi
-}
-
-function start_seahub_fastcgi() {
-       before_start
-
-       # Returns 127.0.0.1 if SEAFILE_FASTCGI_HOST is unset or hasn't got any value,
-       # otherwise returns value of SEAFILE_FASTCGI_HOST environment variable
-       address=`(test -z "$SEAFILE_FASTCGI_HOST" && echo "127.0.0.1") || echo $SEAFILE_FASTCGI_HOST`
-
-       echo "Starting seahub (fastcgi) at ${address}:${SEAHUB_PORT} ..."
-       check_init_admin
-       $PYTHON "${manage_py}" runfcgi host=${address} port=${SEAHUB_PORT} pidfile=${pidfile} \
-               outlog=${accesslog} errlog=${errorlog} maxchildren=${SEAHUB_WORKERS} method=${SEAHUB_METHOD}
-
-       # Ensure seahub is started successfully
-       retry=1
-       while ! validate_seahub_running && [[ ! -f "${pidfile}"  ]] && [[ $retry -lt 120 ]]; do sleep 1; ((retry++)); done
-       if ! validate_seahub_running && [[ -f "${pidfile}" ]]; then
-               echo
-               echo "Seahub is started"
-               echo
-       else
-               printf "\033[33mError: Seahub failed to start.\033[m\n"
-               exit 1
-       fi
-}
-
-function prepare_env() {
-       check_python_executable
-       validate_ccnet_conf_dir
-       read_seafile_data_dir
-
-       export CCNET_CONF_DIR=${default_ccnet_conf_dir}
-       export SEAFILE_CONF_DIR=${seafile_data_dir}
-       export SEAFILE_CENTRAL_CONF_DIR=${central_config_dir}
-       export PYTHONPATH="${INSTALLPATH}/seahub:${INSTALLPATH}/seahub/thirdpart:${PYTHONPATH}"
-}
-
-function clear_sessions() {
-       prepare_env
-
-       echo "Start clear expired session records ..."
-       $PYTHON "${manage_py}" clearsessions
-
-       echo
-       echo "Done"
-       echo
-}
-
-function stop_seahub() {
-       if [[ -f ${pidfile} ]]; then
-               pid=$(cat "${pidfile}")
-               echo "Stopping seahub ..."
-               kill ${pid}
-               rm -f ${pidfile}
-               retry=1
-               while ! validate_seahub_running && [ $retry -lt 60 ]; do sleep 1; ((retry++)); done
-               if ! validate_seahub_running; then
-                       echo "Error: seahub cannot be stopped. Please try stopping it manually by running \"kill $(echo "$pid" | tr '\n' ' ')\"."
-                       echo "To force killing the processes, use \"kill -9 $(echo "$pid" | tr '\n' ' ')\"."
-               fi
-       else
-               echo "Seahub is not running"
-       fi
-}
-
-function check_init_admin() {
-       check_init_admin_script=${INSTALLPATH}/check_init_admin.py
-       if ! $PYTHON $check_init_admin_script; then
-               exit 1
-       fi
-}
-
-function start() {
-       if [ "$SEAHUB_FASTCGI" == "1" ]; then
-               start_seahub_fastcgi
-       else
-               start_seahub
-       fi
-}
-
-function stop() {
-       stop_seahub
-}
-
-function restart() {
-       stop
-       start
-}
-
-function clearsessions() {
-       clear_sessions
-}
diff --git a/net/seafile-server/patches/020-script-patches.patch b/net/seafile-server/patches/020-script-patches.patch
deleted file mode 100644 (file)
index 585784d..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-diff -rupN seafile-server-5.1.1.orig/scripts/seaf-fsck.sh seafile-server-5.1.1/scripts/seaf-fsck.sh
---- seafile-server-5.1.1.orig/scripts/seaf-fsck.sh     2016-04-21 11:05:26.000000000 +0200
-+++ seafile-server-5.1.1/scripts/seaf-fsck.sh  2016-04-22 09:10:13.075581325 +0200
-@@ -7,7 +7,7 @@ INSTALLPATH=$(dirname "${SCRIPT}")
- TOPDIR=$(dirname "${INSTALLPATH}")
- default_ccnet_conf_dir=${TOPDIR}/ccnet
- default_conf_dir=${TOPDIR}/conf
--seaf_fsck=${INSTALLPATH}/seafile/bin/seaf-fsck
-+seaf_fsck=/usr/bin/seaf-fsck
- export PATH=${INSTALLPATH}/seafile/bin:$PATH
- export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
-diff -rupN seafile-server-5.1.1.orig/scripts/seaf-gc.sh seafile-server-5.1.1/scripts/seaf-gc.sh
---- seafile-server-5.1.1.orig/scripts/seaf-gc.sh       2016-04-21 11:05:26.000000000 +0200
-+++ seafile-server-5.1.1/scripts/seaf-gc.sh    2016-04-22 09:10:27.211581999 +0200
-@@ -7,7 +7,7 @@ INSTALLPATH=$(dirname "${SCRIPT}")
- TOPDIR=$(dirname "${INSTALLPATH}")
- default_ccnet_conf_dir=${TOPDIR}/ccnet
- default_conf_dir=${TOPDIR}/conf
--seaf_gc=${INSTALLPATH}/seafile/bin/seafserv-gc
-+seaf_gc=/usr/bin/seafserv-gc
- seaf_gc_opts=""
- export PATH=${INSTALLPATH}/seafile/bin:$PATH
-diff -rupN seafile-server-5.1.1.orig/scripts/setup-seafile-mysql.sh seafile-server-5.1.1/scripts/setup-seafile-mysql.sh
---- seafile-server-5.1.1.orig/scripts/setup-seafile-mysql.sh   2016-04-21 11:05:26.000000000 +0200
-+++ seafile-server-5.1.1/scripts/setup-seafile-mysql.sh        2016-04-22 09:11:50.083585953 +0200
-@@ -40,15 +40,10 @@ function check_python_executable() {
- function check_python_module () {
-     module=$1
-     name=$2
--    hint=$3
-     printf "  Checking python module: ${name} ... "
-     if ! $PYTHON -c "import ${module}" 2>/dev/null 1>&2; then
-         echo
-         printf "\033[33m ${name} \033[m is not installed, Please install it first.\n"
--        if [[ "${hint}" != "" ]]; then
--            printf "${hint}"
--            echo
--        fi
-         err_and_quit;
-     fi
-     echo -e "Done."
-@@ -70,14 +65,10 @@ function check_python () {
-         if [[ $PYTHON == "python2.6" ]]; then
-             py26="2.6"
-         fi
--        hint="\nOn Debian/Ubntu: apt-get install python-setuptools\nOn CentOS/RHEL: yum install python${py26}-distribute"
--        check_python_module pkg_resources setuptools "${hint}"
--
--        hint="\nOn Debian/Ubntu: apt-get install python-imaging\nOn CentOS/RHEL: yum install python${py26}-imaging"
--        check_python_module PIL python-imaging "${hint}"
--        hint='\nOn Debian/Ubuntu:\n\nsudo apt-get install python-mysqldb\n\nOn CentOS/RHEL:\n\nsudo yum install MySQL-python'
--        check_python_module MySQLdb python-mysqldb "${hint}"
-+        check_python_module pkg_resources setuptools
-+        check_python_module PIL python-imaging
-+        check_python_module MySQLdb python-mysqldb
-     fi
-     echo
- }
-@@ -85,5 +76,6 @@ function check_python () {
- check_python;
- export PYTHON=$PYTHON
-+export PYTHONPATH="/usr/share/seafile/seafile-server/seahub/thirdpart:$PYTHONPATH"
- exec $PYTHON "$python_script"
-diff -rupN seafile-server-5.1.1.orig/scripts/sqlite2mysql.sh seafile-server-5.1.1/scripts/sqlite2mysql.sh
---- seafile-server-5.1.1.orig/scripts/sqlite2mysql.sh  2016-04-21 11:05:26.000000000 +0200
-+++ seafile-server-5.1.1/scripts/sqlite2mysql.sh       2016-04-22 09:02:22.047558854 +0200
-@@ -1,4 +1,4 @@
--#!/bin/sh
-+#!/bin/bash
- #
- # This shell script and corresponding sqlite2mysql.py are used to
- # migrate Seafile data from SQLite to MySQL.
diff --git a/net/seafile-server/patches/030-pidfiles-in-same-directory.patch b/net/seafile-server/patches/030-pidfiles-in-same-directory.patch
deleted file mode 100644 (file)
index bb3f86c..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -rupN seafile-server-5.1.1.orig/controller/seafile-controller.c seafile-server-5.1.1/controller/seafile-controller.c
---- seafile-server-5.1.1.orig/controller/seafile-controller.c  2016-04-19 15:44:32.000000000 +0200
-+++ seafile-server-5.1.1/controller/seafile-controller.c       2016-04-19 16:23:05.785000218 +0200
-@@ -21,7 +21,7 @@
- SeafileController *ctl;
--static char *controller_pidfile = NULL;
-+static char *controller_pidfile = "/var/run/seafile/seafile-controller.pid";
- char *bin_dir = NULL;
- char *installpath = NULL;
-@@ -575,9 +575,9 @@ stop_ccnet_server ()
- static void
- init_pidfile_path (SeafileController *ctl)
- {
--    char *pid_dir = g_build_filename (topdir, "pids", NULL);
-+    char *pid_dir = g_path_get_dirname (controller_pidfile);
-     if (!g_file_test(pid_dir, G_FILE_TEST_EXISTS)) {
--        if (g_mkdir(pid_dir, 0777) < 0) {
-+        if (g_mkdir(pid_dir, 0755) < 0) {
-             seaf_warning("failed to create pid dir %s: %s", pid_dir, strerror(errno));
-             controller_exit(1);
-         }
diff --git a/net/seafile-server/patches/040-seafile-admin.patch b/net/seafile-server/patches/040-seafile-admin.patch
deleted file mode 100644 (file)
index 667cdad..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-diff -rupN seafile-server-5.1.1.orig/tools/seafile-admin seafile-server-5.1.1/tools/seafile-admin
---- seafile-server-5.1.1.orig/tools/seafile-admin      2016-04-19 15:44:33.000000000 +0200
-+++ seafile-server-5.1.1/tools/seafile-admin   2016-04-26 10:55:11.826798430 +0200
-@@ -449,9 +449,12 @@ workers = 3
- # Logging
- runtime_dir = os.path.dirname(__file__)
--pidfile = os.path.join(runtime_dir, 'seahub.pid')
-+pidfile = '/var/run/seafile/seahub.pid'
- errorlog = os.path.join(runtime_dir, 'error.log')
- accesslog = os.path.join(runtime_dir, 'access.log')
-+
-+# for file upload, we need a longer timeout value (default is only 30s, too short)
-+timeout = 1200
- '''
-     try:
-@@ -526,6 +529,7 @@ def check_django_version():
- def check_python_module(import_name, package_name=None, silent=False):
-+    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "seahub.settings")
-     package_name = package_name or import_name
-     if not silent:
-         info('checking %s' % package_name)
-@@ -785,7 +789,7 @@ def check_layout(args):
-     conf[CONF_SEAFILE_DIR] = seafile_data_dir
-     conf[CONF_SEAHUB_DIR] = seahub_dir
-     conf[CONF_SEAHUB_CONF] = seahub_conf
--    conf[CONF_SEAHUB_PIDFILE] = os.path.join(runtime_dir, 'seahub.pid')
-+    conf[CONF_SEAHUB_PIDFILE] = '/var/run/seafile/seahub.pid'
-     conf[CONF_SEAHUB_OUTLOG] = os.path.join(runtime_dir, 'access.log')
-     conf[CONF_SEAHUB_ERRLOG] = os.path.join(runtime_dir, 'error.log')
-@@ -836,10 +840,13 @@ def setup_seafile(args):
-     print '-----------------------------------------------------------------'
-     print '-----------------------------------------------------------------'
-     print
--    print 'To start/stop seafile server:'
-+    print 'To start, stop or restart seafile:'
-+    print
-+    print highlight('         # /etc/init.d/seafile { start | stop | restart }')
-     print
--    print highlight('         $ cd %s' % cwd)
--    print highlight('         $ %s { start | stop }' % SCRIPT_NAME)
-+    print 'To start, stop or restart seahub:'
-+    print
-+    print highlight('         # /etc/init.d/seahub { start | stop | restart }')
-     print
-     print 'If you have any problem, refer to\n'
-     print
-@@ -903,8 +910,7 @@ def start_seafile(args):
- def stop_seafile(dummy):
-     info('Stopping seafile server')
-     pkill('seafile-controller')
--    runtime_dir = os.path.join(cwd, 'seafile-server', 'runtime')
--    pidfile = os.path.join(runtime_dir, 'seahub.pid')
-+    pidfile = '/var/run/seafile/seahub.pid'
-     try:
-         with open(pidfile, 'r') as fp:
-             pid = fp.read().strip('\n ')
diff --git a/net/seafile-server/patches/050-libseafile-makefile-fixes.patch b/net/seafile-server/patches/050-libseafile-makefile-fixes.patch
deleted file mode 100644 (file)
index d83a097..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-diff -rupN seafile-server-5.1.1.orig/lib/Makefile.am seafile-server-5.1.1/lib/Makefile.am
---- seafile-server-5.1.1.orig/lib/Makefile.am  2016-04-21 11:05:26.000000000 +0200
-+++ seafile-server-5.1.1/lib/Makefile.am       2016-04-22 10:09:41.567751561 +0200
-@@ -1,3 +1,5 @@
-+include $(TOPDIR)/rules.mk
-+
- pcfiles = libseafile.pc
- pkgconfig_DATA = $(pcfiles)
- pkgconfigdir = $(libdir)/pkgconfig
-@@ -35,7 +37,7 @@ seafile-rpc-wrapper.c: seafile-object.h
- seafile-object.h: ${seafile_object_define}
-       rm -f $@
--      valac --pkg posix ${seafile_object_define} -C -H seafile-object.h
-+      "$(STAGING_DIR)/host/bin/valac" --pkg posix ${seafile_object_define} -C -H seafile-object.h
- DISTCLEANFILES = ${searpc_gen}
-@@ -64,7 +66,7 @@ rpc_table.stamp: ${top_srcdir}/lib/rpc_t
-       @rm -f rpc_table.tmp
-       @touch rpc_table.tmp
-       @echo "[libsearpc]: generating rpc header files"
--      @PYTHON@ `which searpc-codegen.py` ${top_srcdir}/lib/rpc_table.py
-+      @PYTHON@ "$(STAGING_DIR)/usr/bin/searpc-codegen.py" ${top_srcdir}/lib/rpc_table.py
-       @echo "[libsearpc]: done"
-       @mv -f rpc_table.tmp $@
-@@ -74,7 +76,7 @@ vala.stamp: ${seafile_object_define}
-       rm -f ${seafile_object_gen}
-       @rm -f vala.tmp
-       @touch vala.tmp
--      valac -C --pkg posix $^
-+      "$(STAGING_DIR)/host/bin/valac" -C --pkg posix $^
-       @mv -f vala.tmp $@
- ${seafile_object_gen}: vala.stamp
-@@ -90,5 +92,5 @@ install-data-local:
- if MACOS
-       sed -i '' -e "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles)
- else
--      ${SED} -i "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles)
-+      ${SED} "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles)
- endif
diff --git a/net/seafile-server/patches/060-timestamps-as-int64.patch b/net/seafile-server/patches/060-timestamps-as-int64.patch
deleted file mode 100644 (file)
index 5e655d8..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-diff -rupN seafile-server-5.1.1.orig/lib/repo.vala seafile-server-5.1.1/lib/repo.vala
---- seafile-server-5.1.1.orig/lib/repo.vala    2016-04-19 15:44:32.000000000 +0200
-+++ seafile-server-5.1.1/lib/repo.vala 2016-04-25 21:29:33.327962235 +0200
-@@ -30,7 +30,7 @@ public class Repo : Object {
-     // data format version
-     public int version { get; set; }
--    public int    last_modify { get; set; }
-+    public int64  last_modify { get; set; }
-     public int64  size { get; set; }
-     public int64  file_count { get; set; }
-     public string head_cmmt_id { get; set; }
-@@ -40,7 +40,7 @@ public class Repo : Object {
-     public string repo_id { get; set; }
-     public string repo_name { get; set; }
-     public string repo_desc { get; set; }
--    public int last_modified { get; set; }
-+    public int64 last_modified { get; set; }
-     // Section 2: Encryption related
-     // Members in this section should be set for every Repo object
-@@ -63,7 +63,7 @@ public class Repo : Object {
-         get { return _relay_id; }
-         set { _relay_id = value; }
-     }
--    public int  last_sync_time { get; set; }
-+    public int64  last_sync_time { get; set; }
-     public bool auto_sync { get; set; }
-     public bool worktree_invalid { get; set; }
-@@ -155,7 +155,7 @@ public class DeletedEntry : Object {
-     public string obj_name { get; set; }
-     public string basedir { get; set; }
-     public int mode { get; set; }
--    public int delete_time { get; set; }
-+    public int64 delete_time { get; set; }
-     public int64 file_size { get; set; }
-     public string scan_stat { get; set; }
- }
diff --git a/net/seafile-server/patches/070-fuse-mount.patch b/net/seafile-server/patches/070-fuse-mount.patch
deleted file mode 100644 (file)
index 827e7f3..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -rupN seafile-server-5.1.1.orig/scripts/seaf-fuse.sh seafile-server-5.1.1/scripts/seaf-fuse.sh
---- seafile-server-5.1.1.orig/scripts/seaf-fuse.sh     2016-05-29 08:43:19.000000000 +0200
-+++ seafile-server-5.1.1/scripts/seaf-fuse.sh  2016-05-29 09:13:06.286680653 +0200
-@@ -7,7 +7,7 @@ INSTALLPATH=$(dirname "${SCRIPT}")
- TOPDIR=$(dirname "${INSTALLPATH}")
- default_ccnet_conf_dir=${TOPDIR}/ccnet
- default_conf_dir=${TOPDIR}/conf
--seaf_fuse=${INSTALLPATH}/seafile/bin/seaf-fuse
-+seaf_fuse=/usr/bin/seaf-fuse
- export PATH=${INSTALLPATH}/seafile/bin:$PATH
- export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
-@@ -68,7 +68,7 @@ function validate_already_running () {
- }
- function warning_if_seafile_not_running () {
--    if ! pgrep -f "seafile-controller -c ${default_ccnet_conf_dir}" 2>/dev/null 1>&2; then
-+    if ! pgrep -f "seafile-controller -F ${default_conf_dir}" 2>/dev/null 1>&2; then
-         echo
-         echo "Warning: seafile-controller not running. Have you run \"./seafile.sh start\" ?"
-         echo
index 7436bbbbcd0bd2e13afc9de11a233da5df949c2b..61def0e0725e6de6171bd330b57e17da547d1553 100644 (file)
@@ -8,12 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ser2net
-PKG_VERSION:=3.2
+PKG_VERSION:=3.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/ser2net
-PKG_MD5SUM:=85adca01e963ec80ec96f1dfd23aeaec
+PKG_MD5SUM:=8daf1cfd70d2b220b184c412c64faf2c
+PKG_HASH:=3d1cef5f48df8291e57d4d7d4eac2fc809ae644a5524ffca4aebef0f4e4153dc
 
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
index 415c2dfcc5acc3c86980c905ee240b676c26fbbd..5287ec608261ff3200a0b73cb5c96b1fc2eba145 100644 (file)
@@ -8,15 +8,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=shadowsocks-libev
-PKG_VERSION:=2.2.3
+PKG_VERSION:=2.6.1
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
-PKG_SOURCE_VERSION:=2b1eef11973de3f7380401fd20f937e84bc2b756
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE_VERSION:=a3bf80cf11e0a88589abdd87266b5351f270197c
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
 PKG_MAINTAINER:=Jian Chang <aa65535@live.com>
+PKG_MIRROR_MD5SUM:=fc60936d8b990fdecd69b908bc6b770b1c1e54598da6622cc9669750c76fa2d1
 
 PKG_LICENSE:=GPLv2
 PKG_LICENSE_FILES:=LICENSE
@@ -36,23 +37,26 @@ define Package/shadowsocks-libev/Default
        TITLE:=Lightweight Secured Socks5 Proxy $(2)
        URL:=https://github.com/shadowsocks/shadowsocks-libev
        VARIANT:=$(1)
-       DEPENDS:=$(3) +libpthread +ipset +ip +iptables-mod-tproxy
+       DEPENDS:=$(3) +libpthread +ipset +ip +iptables-mod-tproxy +libpcre +zlib
 endef
 
+CONFIGURE_ARGS += \
+       --disable-documentation \
+
 Package/shadowsocks-libev = $(call Package/shadowsocks-libev/Default,openssl,(OpenSSL),+libopenssl)
-Package/shadowsocks-libev-polarssl = $(call Package/shadowsocks-libev/Default,polarssl,(PolarSSL),+libpolarssl)
+Package/shadowsocks-libev-mbedtls = $(call Package/shadowsocks-libev/Default,mbedtls,(mbed TLS),+libmbedtls)
 
 define Package/shadowsocks-libev/description
 Shadowsocks-libev is a lightweight secured socks5 proxy for embedded devices and low end boxes.
 endef
 
-Package/shadowsocks-libev-polarssl/description = $(Package/shadowsocks-libev/description)
+Package/shadowsocks-libev-mbedtls/description = $(Package/shadowsocks-libev/description)
 
 define Package/shadowsocks-libev/conffiles
 /etc/config/shadowsocks-libev
 endef
 
-Package/shadowsocks-libev-polarssl/conffiles = $(Package/shadowsocks-libev/conffiles)
+Package/shadowsocks-libev-mbedtls/conffiles = $(Package/shadowsocks-libev/conffiles)
 
 define Package/shadowsocks-libev/postinst
 #!/bin/sh
@@ -67,10 +71,10 @@ EOF
 exit 0
 endef
 
-Package/shadowsocks-libev-polarssl/postinst = $(Package/shadowsocks-libev/postinst)
+Package/shadowsocks-libev-mbedtls/postinst = $(Package/shadowsocks-libev/postinst)
 
-ifeq ($(BUILD_VARIANT),polarssl)
-       CONFIGURE_ARGS += --with-crypto-library=polarssl
+ifeq ($(BUILD_VARIANT),mbedtls)
+       CONFIGURE_ARGS += --with-crypto-library=mbedtls
 endif
 
 define Package/shadowsocks-libev/install
@@ -85,7 +89,7 @@ define Package/shadowsocks-libev/install
        $(INSTALL_DATA) ./files/firewall.include $(1)/usr/share/shadowsocks-libev/firewall.include
 endef
 
-Package/shadowsocks-libev-polarssl/install = $(Package/shadowsocks-libev/install)
+Package/shadowsocks-libev-mbedtls/install = $(Package/shadowsocks-libev/install)
 
 $(eval $(call BuildPackage,shadowsocks-libev))
-$(eval $(call BuildPackage,shadowsocks-libev-polarssl))
+$(eval $(call BuildPackage,shadowsocks-libev-mbedtls))
index 06a6834e3d8a0feba3b854e58864c8df6c7b926f..e1b2c9ad4762993540b34709cf9e1f27ef0a28d7 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sngrep
-PKG_VERSION=1.4.1
+PKG_VERSION=1.4.2
 PKG_RELEASE:=1
 PKG_MAINTAINER:=Daniel Engberg <daniel.engberg.lists@pyret.net>
 PKG_LICENSE:=GPL-3.0
@@ -17,9 +17,9 @@ PKG_LICENSE_FILES:=COPYING
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=https://github.com/irontec/sngrep
 PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=57baa4b16d0021cf0a70889c15aee708db378fed
+PKG_SOURCE_VERSION:=da791185cabeea5a6fcc7372157340b2d1369df7
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MIRROR_MD5SUM:=5b2cb01d34fcc6d631f8f6efe01ec556fe1325aa300590bec5aa6a078486f9c3
+PKG_MIRROR_MD5SUM:=2cc640e065f33cae4a3a8e14bdc740e49269cd850eee2ffa9eb821427caaa371
 
 PKG_FIXUP:=autoreconf
 
index b89ffcad296f1a3c8807d5d6469334155619bb71..ede942c35c6b5b4e5899e84b90903ed3e52903ea 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=socat
-PKG_VERSION:=1.7.3.0
-PKG_RELEASE:=2
+PKG_VERSION:=1.7.3.1
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.dest-unreach.org/socat/download
-PKG_MD5SUM:=b607edb65bc6c57f4a43f06247504274
+PKG_MD5SUM:=d2da659540c38139f388e9437bfaae16bb458d174d056cb3228432a8f489fbaa
 
 PKG_MAINTAINER:= Ted Hess <thess@kitschensync.net>
 
@@ -69,6 +69,9 @@ CONFIGURE_VARS += \
        sc_cv_sys_tabdly_shift=11 \
        sc_cv_sys_csize_shift=4
 
+TARGET_CFLAGS += \
+       -include stddef.h
+
 define Package/socat/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/socat $(1)/usr/bin/
diff --git a/net/socat/patches/110-drop_egd_sslv3_support.patch b/net/socat/patches/110-drop_egd_sslv3_support.patch
new file mode 100644 (file)
index 0000000..f81f2eb
--- /dev/null
@@ -0,0 +1,184 @@
+--- a/sslcls.c
++++ b/sslcls.c
+@@ -55,6 +55,7 @@ const SSL_METHOD *sycSSLv2_server_method
+ }
+ #endif
++#ifdef HAVE_SSLv3_client_method
+ const SSL_METHOD *sycSSLv3_client_method(void) {
+    const SSL_METHOD *result;
+    Debug("SSLv3_client_method()");
+@@ -62,7 +63,9 @@ const SSL_METHOD *sycSSLv3_client_method
+    Debug1("SSLv3_client_method() -> %p", result);
+    return result;
+ }
++#endif
++#ifdef HAVE_SSLv3_server_method
+ const SSL_METHOD *sycSSLv3_server_method(void) {
+    const SSL_METHOD *result;
+    Debug("SSLv3_server_method()");
+@@ -70,6 +73,7 @@ const SSL_METHOD *sycSSLv3_server_method
+    Debug1("SSLv3_server_method() -> %p", result);
+    return result;
+ }
++#endif
+ const SSL_METHOD *sycSSLv23_client_method(void) {
+    const SSL_METHOD *result;
+@@ -331,14 +335,6 @@ void sycSSL_free(SSL *ssl) {
+    return;
+ }
+-int sycRAND_egd(const char *path) {
+-   int result;
+-   Debug1("RAND_egd(\"%s\")", path);
+-   result = RAND_egd(path);
+-   Debug1("RAND_egd() -> %d", result);
+-   return result;
+-}
+-
+ DH *sycPEM_read_bio_DHparams(BIO *bp, DH **x, pem_password_cb *cb, void *u) {
+    DH *result;
+    Debug4("PEM_read_bio_DHparams(%p, %p, %p, %p)",
+@@ -375,7 +371,7 @@ int sycFIPS_mode_set(int onoff) {
+ }
+ #endif /* WITH_FIPS */
+-#if OPENSSL_VERSION_NUMBER >= 0x00908000L
++#if (OPENSSL_VERSION_NUMBER >= 0x00908000L) && !defined(OPENSSL_NO_COMP)
+ const COMP_METHOD *sycSSL_get_current_compression(SSL *ssl) {
+    const COMP_METHOD *result;
+    Debug1("SSL_get_current_compression(%p)", ssl);
+--- a/sslcls.h
++++ b/sslcls.h
+@@ -47,7 +47,6 @@ X509 *sycSSL_get_peer_certificate(SSL *s
+ int sycSSL_shutdown(SSL *ssl);
+ void sycSSL_CTX_free(SSL_CTX *ctx);
+ void sycSSL_free(SSL *ssl);
+-int sycRAND_egd(const char *path);
+ DH *sycPEM_read_bio_DHparams(BIO *bp, DH **x, pem_password_cb *cb, void *u);
+@@ -55,7 +54,7 @@ BIO *sycBIO_new_file(const char *filenam
+ int sycFIPS_mode_set(int onoff);
+-#if OPENSSL_VERSION_NUMBER >= 0x00908000L
++#if (OPENSSL_VERSION_NUMBER >= 0x00908000L) && !defined(OPENSSL_NO_COMP)
+ const COMP_METHOD *sycSSL_get_current_compression(SSL *ssl);
+ const COMP_METHOD *sycSSL_get_current_expansion(SSL *ssl);
+ const char *sycSSL_COMP_get_name(const COMP_METHOD *comp);
+@@ -98,7 +97,6 @@ const char *sycSSL_COMP_get_name(const C
+ #define sycSSL_shutdown(s) SSL_shutdown(s)
+ #define sycSSL_CTX_free(c) SSL_CTX_free(c)
+ #define sycSSL_free(s) SSL_free(s)
+-#define sycRAND_egd(p) RAND_egd(p)
+ #define sycPEM_read_bio_DHparams(b,x,p,u) PEM_read_bio_DHparams(b,x,p,u)
+--- a/test.sh
++++ b/test.sh
+@@ -576,9 +576,6 @@ filloptionvalues() {
+     *,dh,*) OPTS=$(echo "$OPTS" |sed "s/,dh,/,dh=/tmp/hugo,/g");;
+     esac
+     case "$OPTS" in
+-    *,egd,*) OPTS=$(echo "$OPTS" |sed "s/,egd,/,egd=/tmp/hugo,/g");;
+-    esac
+-    case "$OPTS" in
+     *,compress,*) OPTS=$(echo "$OPTS" |sed "s/,compress,/,compress=none,/g");;
+     esac
+     # PROXY
+--- a/xio-openssl.c
++++ b/xio-openssl.c
+@@ -108,7 +108,6 @@ const struct optdesc opt_openssl_key
+ const struct optdesc opt_openssl_dhparam     = { "openssl-dhparam",     "dh",    OPT_OPENSSL_DHPARAM,     GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC };
+ const struct optdesc opt_openssl_cafile      = { "openssl-cafile",     "cafile", OPT_OPENSSL_CAFILE,      GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC };
+ const struct optdesc opt_openssl_capath      = { "openssl-capath",     "capath", OPT_OPENSSL_CAPATH,      GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC };
+-const struct optdesc opt_openssl_egd         = { "openssl-egd",        "egd",    OPT_OPENSSL_EGD,         GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC };
+ const struct optdesc opt_openssl_pseudo      = { "openssl-pseudo",     "pseudo", OPT_OPENSSL_PSEUDO,      GROUP_OPENSSL, PH_SPEC, TYPE_BOOL,     OFUNC_SPEC };
+ #if OPENSSL_VERSION_NUMBER >= 0x00908000L
+ const struct optdesc opt_openssl_compress    = { "openssl-compress",   "compress", OPT_OPENSSL_COMPRESS,  GROUP_OPENSSL, PH_SPEC, TYPE_STRING,   OFUNC_SPEC };
+@@ -147,7 +146,7 @@ int xio_reset_fips_mode(void) {
+ static void openssl_conn_loginfo(SSL *ssl) {
+    Notice1("SSL connection using %s", SSL_get_cipher(ssl));
+-#if OPENSSL_VERSION_NUMBER >= 0x00908000L
++#if (OPENSSL_VERSION_NUMBER >= 0x00908000L) && !defined(OPENSSL_NO_COMP)
+    {
+       const COMP_METHOD *comp, *expansion;
+@@ -722,7 +721,6 @@ int
+    char *opt_dhparam = NULL;  /* file name of DH params */
+    char *opt_cafile = NULL;   /* certificate authority file */
+    char *opt_capath = NULL;   /* certificate authority directory */
+-   char *opt_egd = NULL;      /* entropy gathering daemon socket path */
+ #if OPENSSL_VERSION_NUMBER >= 0x00908000L
+    char *opt_compress = NULL; /* compression method */
+ #endif
+@@ -741,7 +739,6 @@ int
+    retropt_string(opts, OPT_OPENSSL_CAPATH, &opt_capath);
+    retropt_string(opts, OPT_OPENSSL_KEY, &opt_key);
+    retropt_string(opts, OPT_OPENSSL_DHPARAM, &opt_dhparam);
+-   retropt_string(opts, OPT_OPENSSL_EGD, &opt_egd);
+    retropt_bool(opts,OPT_OPENSSL_PSEUDO, &opt_pseudo);
+ #if OPENSSL_VERSION_NUMBER >= 0x00908000L
+    retropt_string(opts, OPT_OPENSSL_COMPRESS, &opt_compress);
+@@ -877,10 +874,6 @@ int
+       }
+    }
+-   if (opt_egd) {
+-      sycRAND_egd(opt_egd);
+-   }
+-
+    if (opt_pseudo) {
+       long int randdata;
+       /* initialize libc random from actual microseconds */
+@@ -1105,7 +1098,7 @@ static int openssl_SSL_ERROR_SSL(int lev
+       if (e == ((ERR_LIB_RAND<<24)|
+               (RAND_F_SSLEAY_RAND_BYTES<<12)|
+               (RAND_R_PRNG_NOT_SEEDED)) /*0x24064064*/) {
+-       Error("too few entropy; use options \"egd\" or \"pseudo\"");
++       Error("too few entropy; use option \"pseudo\"");
+        stat = STAT_NORETRY;
+       } else {
+        Msg2(level, "%s(): %s", funcname, ERR_error_string(e, buf));
+--- a/xio-openssl.h
++++ b/xio-openssl.h
+@@ -21,7 +21,6 @@ extern const struct optdesc opt_openssl_
+ extern const struct optdesc opt_openssl_dhparam;
+ extern const struct optdesc opt_openssl_cafile;
+ extern const struct optdesc opt_openssl_capath;
+-extern const struct optdesc opt_openssl_egd;
+ extern const struct optdesc opt_openssl_pseudo;
+ #if OPENSSL_VERSION_NUMBER >= 0x00908000L
+ extern const struct optdesc opt_openssl_compress;
+--- a/xioopts.c
++++ b/xioopts.c
+@@ -412,7 +412,6 @@ const struct optname optionnames[] = {
+ #ifdef ECHOPRT
+       IF_TERMIOS("echoprt",   &opt_echoprt)
+ #endif
+-      IF_OPENSSL("egd",       &opt_openssl_egd)
+       IF_ANY    ("end-close", &opt_end_close)
+       IF_TERMIOS("eof",       &opt_veof)
+       IF_TERMIOS("eol",       &opt_veol)
+@@ -1102,7 +1101,6 @@ const struct optname optionnames[] = {
+       IF_OPENSSL("openssl-compress",  &opt_openssl_compress)
+ #endif
+       IF_OPENSSL("openssl-dhparam",   &opt_openssl_dhparam)
+-      IF_OPENSSL("openssl-egd",       &opt_openssl_egd)
+ #if WITH_FIPS
+       IF_OPENSSL("openssl-fips",      &opt_openssl_fips)
+ #endif
+--- a/xioopts.h
++++ b/xioopts.h
+@@ -478,7 +478,6 @@ enum e_optcode {
+    OPT_OPENSSL_COMPRESS,
+ #endif
+    OPT_OPENSSL_DHPARAM,
+-   OPT_OPENSSL_EGD,
+    OPT_OPENSSL_FIPS,
+    OPT_OPENSSL_KEY,
+    OPT_OPENSSL_METHOD,
diff --git a/net/softethervpn/Makefile b/net/softethervpn/Makefile
new file mode 100644 (file)
index 0000000..189f1f5
--- /dev/null
@@ -0,0 +1,152 @@
+#
+# Copyright (C) 2008-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# Based on the initial porting done by el1n
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=softethervpn
+PKG_VERSION:=4.22-9634
+PKG_VERREL:=beta
+PKG_VERDATE:=2016.11.27
+PKG_RELEASE:=1
+
+PKG_SOURCE:=softether-src-v$(PKG_VERSION)-$(PKG_VERREL).tar.gz
+PKG_SOURCE_URL:=http://www.softether-download.com/files/softether/v$(PKG_VERSION)-$(PKG_VERREL)-$(PKG_VERDATE)-tree/Source_Code/
+PKG_MD5SUM:=703d41b34ff49d008ddd329340a5a75e
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/v$(PKG_VERSION)
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/v$(PKG_VERSION)
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_BUILD_DEPENDS:=softethervpn/host
+
+HAMCORE_SE2:=$(STAGING_DIR_HOST)/share/softethervpn/hamcore.se2
+
+include $(INCLUDE_DIR)/nls.mk
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+
+# Override CC to add fake libreadline to linker search path
+HOSTCC += -L./src/readline
+
+# Add defines to turn add_history() and readline() calls into no-ops
+HOSTCC += -D'add_history(x)' -D'readline(x)=\"\"'
+
+# Execute in host build directory
+HOST_MAKE_FLAGS += -C $(HOST_BUILD_DIR)
+
+# Select 32 or 64 bit Makefile for host build depending on host architecture
+HOST_MAKE_FLAGS += -f src/makefiles/linux_$(if $(shell uname -m | grep 64),64,32)bit.mak
+
+# Prevent calling upstream configure
+define Host/Configure
+endef
+
+define Host/Compile
+       # Prepare fake readline headers and library
+       mkdir -p $(HOST_BUILD_DIR)/src/readline
+       touch $(HOST_BUILD_DIR)/src/readline/readline.h
+       touch $(HOST_BUILD_DIR)/src/readline/history.h
+       ar rcs $(HOST_BUILD_DIR)/src/readline/libreadline.a
+
+       # Build hamcorebuilder using host compiler and let it generate
+       # the hamcore.se2 archive file
+       CC="$(HOSTCC)" $(MAKE) $(HOST_MAKE_FLAGS) \
+               src/bin/BuiltHamcoreFiles/unix/hamcore.se2
+endef
+
+define Host/Install
+       $(INSTALL_DIR) $(STAGING_DIR_HOST)/share/softethervpn
+       $(INSTALL_DATA) $(HOST_BUILD_DIR)/src/bin/BuiltHamcoreFiles/unix/hamcore.se2 $(HAMCORE_SE2)
+endef
+
+
+# Tune CFLAGS for target
+TARGET_CFLAGS += \
+       $(if $(CONFIG_OPENSSL_WITH_SSL3),,-DSSL_OP_NO_SSLv3) \
+       $(if $(filter mips mipsel,$(ARCH)),-minterlink-mips16)
+
+# Select 32 or 64 bit Makefile for target build depending on 64bit config symbol
+MAKE_FLAGS += \
+       -f src/makefiles/linux_$(if $(CONFIG_ARCH_64BIT),64,32)bit.mak
+
+# Map nonstandard CCFLAGS variable to standard TARGET_CFLAGS
+MAKE_VARS += \
+       CCFLAGS="$(TARGET_CFLAGS)"
+
+define Build/Configure
+       # Fetch prebuilt hamcore.se2 from staging dir
+       $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/bin/BuiltHamcoreFiles/unix
+       $(CP) $(HAMCORE_SE2) $(PKG_BUILD_DIR)/src/bin/BuiltHamcoreFiles/unix/hamcore.se2
+
+       # Portably set hamcore.se2 modtime to one day in the future
+       # to prevent rebuilding it
+       perl -e 'utime(time() + 86400, time() + 86400, $$$$ARGV[0])' \
+               $(PKG_BUILD_DIR)/src/bin/BuiltHamcoreFiles/unix/hamcore.se2
+endef
+
+
+define Package/softethervpn
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=VPN
+  DEPENDS:=+libpthread +librt +libreadline +libopenssl +libncurses +kmod-tun +zlib $(ICONV_DEPENDS)
+  TITLE:=Free Cross-platform Multi-protocol VPN server and client
+  URL:=http://www.softether.org/
+  MAINTAINER:=Federico Di Marco <fededim@gmail.com>
+endef
+
+define Package/softethervpn/description
+SoftEther VPN ("SoftEther" means "Software Ethernet") is one of the world's most powerful and easy-to-use multi-protocol VPN software developed as an academic
+project from University of Tsukuba, Japan. SoftEther VPN has strong compatibility to today's most popular VPN products among the world. It has the interoperability
+with OpenVPN, L2TP, IPsec, EtherIP, L2TPv3, Cisco VPN Routers and MS-SSTP VPN Clients. SoftEther VPN is the world's only VPN software which supports SSL-VPN,
+OpenVPN, L2TP, EtherIP, L2TPv3 and IPsec as a single VPN software. SoftEther VPN is not only an alternative VPN server to existing VPN products (OpenVPN,
+IPsec and MS-SSTP), but has also original strong SSL-VPN protocol to penetrate any kinds of firewalls. Ultra-optimized SSL-VPN Protocol of SoftEther VPN
+has very fast throughput, low latency and firewall resistance.
+endef
+
+
+define Package/softethervpn/conffiles
+/usr/libexec/softethervpn/vpn_server.config
+/usr/libexec/softethervpn/vpn_client.config
+/usr/libexec/softethervpn/vpn_bridge.config
+/usr/libexec/softethervpn/lang.config
+endef
+
+define Package/softethervpn/install
+       $(INSTALL_DIR) $(1)/usr/libexec/softethervpn
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpnserver/vpnserver $(1)/usr/libexec/softethervpn
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpnserver/hamcore.se2 $(1)/usr/libexec/softethervpn
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpnclient/vpnclient $(1)/usr/libexec/softethervpn
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpnbridge/vpnbridge $(1)/usr/libexec/softethervpn
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/vpncmd/vpncmd $(1)/usr/libexec/softethervpn
+       $(INSTALL_BIN) files/launcher.sh $(1)/usr/libexec/softethervpn
+
+       $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_server.config
+       $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_bridge.config
+       $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_client.config
+       $(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/lang.config
+
+       $(INSTALL_DIR) $(1)/usr/bin
+
+       #$(LN) ../../usr/libexec/softethervpn/launcher.sh $(1)/usr/bin/vpnserver
+       #$(LN) ../../usr/libexec/softethervpn/launcher.sh $(1)/usr/bin/vpnclient
+       #$(LN) ../../usr/libexec/softethervpn/launcher.sh $(1)/usr/bin/vpnbridge
+       $(LN) ../../usr/libexec/softethervpn/launcher.sh $(1)/usr/bin/vpncmd
+
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) files/vpnserver.init $(1)/etc/init.d/softethervpnserver
+       $(INSTALL_BIN) files/vpnbridge.init $(1)/etc/init.d/softethervpnbridge
+       $(INSTALL_BIN) files/vpnclient.init $(1)/etc/init.d/softethervpnclient
+endef
+
+$(eval $(call BuildPackage,softethervpn))
+$(eval $(call HostBuild))
diff --git a/net/softethervpn/files/dummy b/net/softethervpn/files/dummy
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/net/softethervpn/files/launcher.sh b/net/softethervpn/files/launcher.sh
new file mode 100755 (executable)
index 0000000..7970792
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec "/usr/libexec/softethervpn/${0##*/}" "$@"
diff --git a/net/softethervpn/files/vpnbridge.init b/net/softethervpn/files/vpnbridge.init
new file mode 100644 (file)
index 0000000..9e5c44f
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh /etc/rc.common
+START=60
+
+start(){
+        logger -t 'softethervpn' "Starting softether vpnbridge service."
+       /usr/bin/env LANG=en_US.UTF-8 /usr/libexec/softethervpn/vpnbridge start
+}
+
+stop(){
+        logger -t 'softethervpn' "Stopping softether vpnbridge service."
+       /usr/bin/env LANG=en_US.UTF-8 /usr/libexec/softethervpn/vpnbridge stop
+}
diff --git a/net/softethervpn/files/vpnclient.init b/net/softethervpn/files/vpnclient.init
new file mode 100644 (file)
index 0000000..1a3296d
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh /etc/rc.common
+START=60
+
+start(){
+        logger -t 'softethervpn' "Starting softether vpnclient service."
+       /usr/bin/env LANG=en_US.UTF-8 /usr/libexec/softethervpn/vpnclient start
+}
+
+stop(){
+        logger -t 'softethervpn' "Stopping softether vpnclient service."
+       /usr/bin/env LANG=en_US.UTF-8 /usr/libexec/softethervpn/vpnclient stop
+}
diff --git a/net/softethervpn/files/vpnserver.init b/net/softethervpn/files/vpnserver.init
new file mode 100644 (file)
index 0000000..6dc180a
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh /etc/rc.common
+START=60
+
+start(){
+        logger -t 'softethervpn' "Starting softether vpnserver service."
+       /usr/bin/env LANG=en_US.UTF-8 /usr/libexec/softethervpn/vpnserver start
+}
+
+stop(){
+        logger -t 'softethervpn' "Stopping softether vpnserver service."
+       /usr/bin/env LANG=en_US.UTF-8 /usr/libexec/softethervpn/vpnserver stop
+}
diff --git a/net/softethervpn/patches/103-noeucjp.patch b/net/softethervpn/patches/103-noeucjp.patch
new file mode 100644 (file)
index 0000000..f403dfb
--- /dev/null
@@ -0,0 +1,29 @@
+--- a/src/Mayaqua/Internat.c
++++ b/src/Mayaqua/Internat.c
+@@ -123,7 +123,7 @@
+ #include <Mayaqua/Mayaqua.h>\r
\r
+ extern LOCK *token_lock;\r
+-static char charset[MAX_SIZE] = "EUCJP";\r
++static char charset[MAX_SIZE] = "utf-8";\r
+ static LOCK *iconv_lock = NULL;\r
+ void *iconv_cache_wide_to_str = 0;\r
+ void *iconv_cache_str_to_wide = 0;\r
+@@ -938,7 +938,7 @@ void InitInternational()
+ #ifdef        UNIX_MACOS\r
+               StrCpy(charset, sizeof(charset), "utf-8");\r
+ #else // UNIX_MACOS\r
+-              StrCpy(charset, sizeof(charset), "EUCJP");\r
++              StrCpy(charset, sizeof(charset), "utf-8");\r
+ #endif        // UNIX_MACOS\r
+               d = IconvWideToStrInternal();\r
+               if (d == (void *)-1)\r
+@@ -1198,7 +1198,7 @@ void GetCurrentCharSet(char *name, UINT
+               }\r
+               else\r
+               {\r
+-                      StrCpy(name, size, "eucJP");\r
++                      StrCpy(name, size, "utf-8");\r
+               }\r
+       }\r
+       FreeToken(t);\r
diff --git a/net/softethervpn/patches/105-nossl3.patch b/net/softethervpn/patches/105-nossl3.patch
new file mode 100644 (file)
index 0000000..00e0fea
--- /dev/null
@@ -0,0 +1,33 @@
+Index: v4.22-9634/src/Mayaqua/Network.c
+===================================================================
+--- v4.22-9634.orig/src/Mayaqua/Network.c
++++ v4.22-9634/src/Mayaqua/Network.c
+@@ -13013,20 +13013,28 @@ bool StartSSLEx(SOCK *sock, X *x, K *pri
+               }\r
+               else\r
+               {\r
++#ifndef       SSL_OP_NO_SSLv3\r
+                       if (client_tls == false)\r
+                       {\r
+                               SSL_CTX_set_ssl_version(ssl_ctx, SSLv3_method());\r
+                       }\r
+                       else\r
+                       {\r
++#endif        // SSL_OP_NO_SSLv3\r
+                               SSL_CTX_set_ssl_version(ssl_ctx, SSLv23_client_method());\r
++#ifndef       SSL_OP_NO_SSLv3\r
+                       }\r
++#endif        // SSL_OP_NO_SSLv3\r
+               }\r
+               sock->ssl = SSL_new(ssl_ctx);\r
+               SSL_set_fd(sock->ssl, (int)sock->socket);\r
\r
+ #ifdef        SSL_CTRL_SET_TLSEXT_HOSTNAME\r
++#ifndef       SSL_OP_NO_SSLv3\r
+               if (sock->ServerMode == false && client_tls)\r
++#else\r
++              if (sock->ServerMode == false)\r
++#endif        // SSL_OP_NO_SSLv3\r
+               {\r
+                       if (IsEmptyStr(sni_hostname) == false)\r
+                       {\r
index ce0e957e45c07e6763fbe349b0cb154c74042278..3aa81b18fefede22c748250fb6fa2ba7de5a7abf 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sqm-scripts
-PKG_SOURCE_VERSION:=951118f79a3fea7081f89fee49c77895624c59a1
-PKG_VERSION:=1.0.9
+PKG_SOURCE_VERSION:=8217081f7e52af342c362b29480461575c496387
+PKG_VERSION:=1.1.3
 PKG_RELEASE:=1
 PKG_LICENSE:=GPLv2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE).tar.xz
-PKG_SOURCE_URL:=git://github.com/tohojo/sqm-scripts.git
+PKG_SOURCE_URL:=https://github.com/tohojo/sqm-scripts.git
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
@@ -24,7 +24,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/sqm-scripts
   SECTION:=net
   CATEGORY:=Base system
-  DEPENDS:=+tc +kmod-sched +kmod-ifb +iptables \
+  DEPENDS:=+tc +kmod-sched-core +kmod-sched-cake +kmod-ifb +iptables \
        +iptables-mod-ipopt +iptables-mod-conntrack-extra
   TITLE:=SQM Scripts (QoS)
   PKGARCH:=all
@@ -55,7 +55,7 @@ define Package/luci-app-sqm
 endef
 
 define Package/luci-app-sqm/description
-       Control the simple_qos SQM script
+       Luci interface for the SQM scripts queue management configuration package.
 endef
 
 define Package/luci-app-sqm/install
index 32791dc9541fd0f4a3dbc93e4a922a5554e74e6e..081c324ce3c8d4a5c6f181e050ff5efd785ca5d8 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sstp-client
-PKG_VERSION:=1.0.10
-PKG_RELEASE:=2
+PKG_VERSION:=1.0.11
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/sstp-client/$(PKG_VERSION)
-PKG_MD5SUM:=5f290355187e5ce0423fb7e388e65b9d
+PKG_MD5SUM:=4ddbc2fe33eb27d5a4f38d2241005970
 PKG_LICENSE=GPLv2
 
 include $(INCLUDE_DIR)/package.mk
@@ -23,15 +23,23 @@ TARGET_CPPFLAGS += -I$(PKG_BUILD_DIR)/include
 define Package/sstp-client
   SECTION:=net
   CATEGORY:=Network
+  SUBMENU:=VPN
   DEPENDS=+libevent2 +libopenssl +ppp
-  TITLE:=SSTP is Microsofts Remote Access Solution for PPP over SSL
+  TITLE:=SSTP-Client is a SSTP client for Linux.
   URL:=http://sstp-client.sourceforge.net/
   MAINTAINER:=Federico Di Marco <fededim@gmail.com>
 endef
 
 define Package/sstp-client/description
- It can be used instead of PPTP or L2TP, and is only available with Windows Vista/7 connecting to a Windows 2008 Server. The advantage of SSTP  compared to PPTP and L2TP is that it cannot be easily blocked by firewalls since the traffic is transmitted over HTTPS on port 443.
- Windows Vista/7 uses SSTP whenever PPTP or L2TP cannot be established. For further information on SSTP check out wikipedia's article on Secure Socket Tunneling Protocol.
+The advantage of SSTP compared to other vpn protocols like PPTP and L2TP is that it cannot be easily blocked by firewalls since the traffic is transmitted over HTTPS on port 443.
+This software has a similar commandline and configuration to the standard linux pptp-client software.
+
+Features:
+- Connect to Microsoft RAS network using SSTP
+- Use HTTPS with strong encryption over port 443
+- Asynchronous HDLC frame support
+- Integration with pon/poff
+
 endef
 
 define Package/sstp-client/conffiles
@@ -41,13 +49,13 @@ define Package/sstp-client/conffiles
 endef
 
 define Package/sstp-client/install
-       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/usr/{bin,lib}
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/.libs/sstpc $(1)/usr/bin/
-       $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_BUILD_DIR)/src/libsstp-api/.libs/*.so* $(1)/usr/lib/
        $(CP) $(PKG_BUILD_DIR)/src/pppd-plugin/.libs/*.so* $(1)/usr/lib/
-       $(INSTALL_DIR) $(1)/etc/ppp
-       $(INSTALL_DIR) $(1)/etc/peers
+
+       $(INSTALL_DIR) $(1)/etc
+       $(CP) files/etc $(1) 
 endef
 
 $(eval $(call BuildPackage,sstp-client))
index 029b8bff760a9fb70a88c34e4b82b30631105b05..5289d3f9740d062735d76ce2aa9aa56b2f487385 100644 (file)
@@ -374,6 +374,7 @@ CONFIGURE_ARGS+= \
        --disable-scripts \
        --disable-static \
        --disable-fast \
+       --enable-mediation \
        --with-systemdsystemunitdir=no \
        $(if $(CONFIG_PACKAGE_strongswan-utils),--enable-pki --enable-scepclient,--disable-pki --disable-scepclient) \
        --with-random-device=/dev/random \
index 30bb958e66750a4ee146281e0ff1f4ad6f014328..0c4ec19ce87b67319459c223b8348fa6b7877046 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=stunnel
-PKG_VERSION:=5.38
+PKG_VERSION:=5.40
 PKG_RELEASE:=1
 
 PKG_LICENSE:=GPL-2.0+
@@ -19,7 +19,7 @@ PKG_SOURCE_URL:= \
        http://ftp.nluug.nl/pub/networking/stunnel/ \
        http://www.usenix.org.uk/mirrors/stunnel/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=09ada29ba1683ab1fd1f31d7bed8305127a0876537e836a40cb83851da034fd5
+PKG_MD5SUM:=23acdb390326ffd507d90f8984ecc90e0d9993f6bd6eac1d0a642456565c45ff
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
diff --git a/net/subversion/Makefile b/net/subversion/Makefile
new file mode 100644 (file)
index 0000000..561322a
--- /dev/null
@@ -0,0 +1,142 @@
+#
+# Copyright (C) 2007-2016 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:=subversion
+PKG_RELEASE:=2
+PKG_VERSION:=1.9.5
+PKG_SOURCE_URL:=@APACHE/subversion
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MD5SUM:=9fcbae352a5efe73d46a88c97c6bba14
+PKG_LICENSE:=Apache-2.0
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Val Kulkov <val.kulkov@gmail.com>
+
+PKG_FIXUP:=autoreconf
+PKG_MACRO_PATHS:=build/ac-macros
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+
+define Package/subversion/Default
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=Version Control Systems
+  TITLE:=A compelling replacement for CVS
+  DEPENDS:=+zlib +libsqlite3 +PACKAGE_unixodbc:unixodbc +libapr +libaprutil +libmagic \
+       $(ICONV_DEPENDS) $(INTL_DEPENDS)
+  URL:=http://subversion.apache.org/
+endef
+
+define Package/subversion/Default/description
+       Subversion is a free/open-source version control system. That is,
+       Subversion manages files and directories, and the changes made to them,
+       over time. This allows you to recover older versions of your data, or
+       examine the history of how your data changed. In this regard, many
+       people think of a version control system as a sort of time machine.
+endef
+
+define Package/subversion-libs
+  $(call Package/subversion/Default)
+  TITLE:=subversion libs
+endef
+
+define Package/subversion-libs/description
+  $(call Package/subversion/Default/description)
+  This package contains the Subversion libraries.
+endef
+
+define Package/subversion-client
+  $(call Package/subversion/Default)
+  DEPENDS:=+subversion-libs
+  TITLE:=subversion client tools
+endef
+
+define Package/subversion-client/description
+  $(call Package/subversion/Default/description)
+  This package contains the Subversion client tools.
+endef
+
+define Package/subversion-server
+  $(call Package/subversion/Default)
+  DEPENDS:=+subversion-libs
+  TITLE:=subversion server
+endef
+
+define Package/subversion-server/description
+  $(call Package/subversion/Default/description)
+  This package contains the Subversion server.
+endef
+
+define Package/subversion-server/conffiles
+/etc/config/subversion
+endef
+
+TARGET_CFLAGS += $(FPIC)
+TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
+APU_LIBS=$(shell $(STAGING_DIR)/usr/bin/apu-1-config --link-libtool --libs)
+
+CONFIGURE_ARGS += \
+       --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
+       --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \
+       --with-libmagic="$(STAGING_DIR)/usr" \
+       --disable-mod-activation \
+       --without-ruby-sitedir \
+       --without-swig \
+       --without-jikes \
+       --without-junit \
+       --without-berkeley-db \
+       --without-apxs \
+       --without-sasl
+
+ifdef $(INTL_FULL)
+       CONFIGURE_ARGS += --enable-nls
+else
+       CONFIGURE_ARGS += --disable-nls
+endif
+
+CONFIGURE_VARS += \
+       LDFLAGS="$(TARGET_LDFLAGS) $(APU_LIBS) -lcrypt -lm \
+               -lz -lpthread $(if $(INTL_FULL),-lintl)"
+       CPPFLAGS="$(TARGET_CPPFLAGS)"
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               all local-install
+endef
+
+define Package/subversion-libs/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsvn_*.so.* $(1)/usr/lib/
+endef
+
+define Package/subversion-client/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{svn,svnversion,svnsync} $(1)/usr/bin/
+endef
+
+define Package/subversion-server/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/svn{look,admin,dumpfilter,serve} $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/subversion.config $(1)/etc/config/subversion
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/subversion.init $(1)/etc/init.d/subversion
+endef
+
+define Package/subversion-server/prerm
+#!/bin/sh
+ ps | grep '\(/svnserve$\| svnserve\)' | grep -cvq grep >/dev/null && /etc/init.d/subversion stop
+ /etc/init.d/subversion disable
+endef
+
+$(eval $(call BuildPackage,subversion-libs))
+$(eval $(call BuildPackage,subversion-client))
+$(eval $(call BuildPackage,subversion-server))
diff --git a/net/subversion/files/subversion.config b/net/subversion/files/subversion.config
new file mode 100644 (file)
index 0000000..3297c8d
--- /dev/null
@@ -0,0 +1,3 @@
+config subversion
+       option path     '/var/local/svn'
+       option port     '3690'
diff --git a/net/subversion/files/subversion.init b/net/subversion/files/subversion.init
new file mode 100644 (file)
index 0000000..660a297
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2016 OpenWrt.org
+
+START=50
+
+start_instance () {
+       local section="$1"
+       config_get path "$section" 'path'
+       config_get port "$section" 'port'
+
+       if [ ! -d "$path" ]; then
+               echo "The subversion repository (${path}) does not exist."
+               echo "Create a new repository and/or change the path in /etc/config/subversion"
+               echo
+               echo "Create a new subversion repository with:"
+               echo "        mkdir -p ${path}"
+               echo "        svnadmin create --fs-type fsfs ${path}"
+               echo
+               echo "Changing the path using UCI (default path is: /var/local/svn):"
+               echo "        uci set subversion.@[0].path="/srv/svn""
+               echo "        uci commit"
+               echo "        /etc/init.d/subversion restart"
+               return 1
+       fi
+
+       service_start /usr/bin/svnserve -d --listen-port ${port} -r ${path}
+}
+
+start() {
+       config_load 'subversion'
+       config_foreach start_instance 'subversion'
+}
+
+stop() {
+       SERVICE_SIG_STOP="INT" \
+       service_stop /usr/bin/svnserve
+}
diff --git a/net/subversion/patches/301-cross-compilation-macos.patch b/net/subversion/patches/301-cross-compilation-macos.patch
new file mode 100644 (file)
index 0000000..b964949
--- /dev/null
@@ -0,0 +1,97 @@
+--- a/build/ac-macros/macosx.m4        2016-02-09 01:24:13.181409245 -0500
++++ b/build/ac-macros/macosx.m4        2016-02-09 01:25:15.873408288 -0500
+@@ -17,94 +17,4 @@ dnl   specific language governing permis
+ dnl   under the License.
+ dnl ===================================================================
+ dnl
+-dnl  Mac OS X specific checks
+-dnl SVN_LIB_MACHO_ITERATE
+-dnl Check for _dyld_image_name and _dyld_image_header availability
+-AC_DEFUN(SVN_LIB_MACHO_ITERATE,
+-[
+-  AC_MSG_CHECKING([for Mach-O dynamic module iteration functions])
+-  AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+-    #include <mach-o/dyld.h>
+-    #include <mach-o/loader.h>
+-  ]],[[
+-    const struct mach_header *header = _dyld_get_image_header(0);
+-    const char *name = _dyld_get_image_name(0);
+-    if (name && header) return 0;
+-    return 1;
+-  ]])],[
+-    AC_DEFINE([SVN_HAVE_MACHO_ITERATE], [1],
+-              [Is Mach-O low-level _dyld API available?])
+-    AC_MSG_RESULT([yes])
+-  ],[
+-    AC_MSG_RESULT([no])
+-  ])
+-])
+-
+-dnl SVN_LIB_MACOS_PLIST
+-dnl Assign variables for Mac OS property list support
+-AC_DEFUN(SVN_LIB_MACOS_PLIST,
+-[
+-  AC_MSG_CHECKING([for Mac OS property list utilities])
+-
+-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+-    #include <AvailabilityMacros.h>
+-    #if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) \
+-     || !defined(MAC_OS_X_VERSION_10_0) \
+-     || (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_0)
+-    #error ProperyList API unavailable.
+-    #endif
+-  ]],[[]])],[
+-    dnl ### Hack.  We should only need to pass the -framework options when
+-    dnl linking libsvn_subr, since it is the only library that uses Keychain.
+-    dnl
+-    dnl Unfortunately, libtool 1.5.x doesn't track transitive dependencies for
+-    dnl OS X frameworks like it does for normal libraries, so we need to
+-    dnl explicitly pass the option to all the users of libsvn_subr to allow
+-    dnl static builds to link successfully.
+-    dnl
+-    dnl This does mean that all executables we link will be linked directly
+-    dnl to these frameworks - even when building shared libraries - but that
+-    dnl shouldn't cause any problems.
+-
+-    LIBS="$LIBS -framework CoreFoundation"
+-    AC_DEFINE([SVN_HAVE_MACOS_PLIST], [1],
+-              [Is Mac OS property list API available?])
+-    AC_MSG_RESULT([yes])
+-  ],[
+-    AC_MSG_RESULT([no])
+-  ])
+-])
+-
+-dnl SVN_LIB_MACOS_KEYCHAIN
+-dnl Check configure options and assign variables related to Keychain support
+-
+-AC_DEFUN(SVN_LIB_MACOS_KEYCHAIN,
+-[
+-  AC_ARG_ENABLE(keychain,
+-    AS_HELP_STRING([--disable-keychain],
+-    [Disable use of Mac OS KeyChain for auth credentials]),
+-    [enable_keychain=$enableval],[enable_keychain=yes])
+-
+-  AC_MSG_CHECKING([for Mac OS KeyChain Services])
+-
+-  if test "$enable_keychain" = "yes"; then
+-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+-      #include <AvailabilityMacros.h>
+-      #if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) \
+-       || !defined(MAC_OS_X_VERSION_10_2) \
+-       || (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_2)
+-      #error KeyChain API unavailable.
+-      #endif
+-    ]],[[]])],[
+-      dnl ### Hack, see SVN_LIB_MACOS_PLIST
+-      LIBS="$LIBS -framework Security"
+-      LIBS="$LIBS -framework CoreServices"
+-      AC_DEFINE([SVN_HAVE_KEYCHAIN_SERVICES], [1], [Is Mac OS KeyChain support enabled?])
+-      AC_MSG_RESULT([yes])
+-    ],[
+-      enable_keychain=no
+-      AC_MSG_RESULT([no])
+-    ])
+-  fi
+-])
index ccdd47b65519ad4f91152194ef78514b6a416155..b6ab886c2a6453f96ec3553ebc2306327695178b 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tor
-PKG_VERSION:=0.2.8.9
+PKG_VERSION:=0.2.9.9
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://dist.torproject.org/ \
        https://archive.torproject.org/tor-package-archive
-PKG_MD5SUM:=3f5c273bb887be4aff11f4d99b9e2e52d293b81ff4f6302b730161ff16dc5316
+PKG_MD5SUM:=33325d2b250fd047ba2ddc5d11c2190c4e2951f4b03ec48ebd8bf0666e990d43
 PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
 PKG_LICENSE_FILES:=LICENSE
 
@@ -48,6 +48,28 @@ $(call Package/tor/Default/description)
  This package contains the tor daemon.
 endef
 
+define Package/tor-gencert
+$(call Package/tor/Default)
+  TITLE:=Tor certificate generation
+  DEPENDS:=+tor
+endef
+
+define Package/tor-gencert/description
+$(call Package/tor/Default/description)
+ Generate certs and keys for Tor directory authorities
+endef
+
+define Package/tor-resolve
+$(call Package/tor/Default)
+  TITLE:=tor hostname resolve
+  DEPENDS:=+tor
+endef
+
+define Package/tor-resolve/description
+$(call Package/tor/Default/description)
+ Resolve a hostname to an IP address via tor 
+endef
+
 define Package/tor-geoip
 $(call Package/tor/Default)
   TITLE:=GeoIP db for tor
@@ -61,22 +83,30 @@ endef
 
 define Package/tor/conffiles
 /etc/tor/torrc
+/var/lib/tor/fingerprint
+/var/lib/tor/keys/*
 endef
 
 CONFIGURE_ARGS += \
        --with-libevent-dir="$(STAGING_DIR)/usr" \
        --with-ssl-dir="$(STAGING_DIR)/usr" \
+       --with-openssl-dir="$(STAGING_DIR)/usr" \
+       --with-zlib-dir="$(STAGING_DIR)/usr" \
        --disable-asciidoc \
-       --disable-seccomp
+       --disable-seccomp \
+       --disable-libscrypt \
+       --disable-unittests \
+       --disable-largefile \
+       --with-tor-user=tor \
+       --with-tor-group=tor
+
+EXTRA_CFLAGS += -std=gnu99
 
 ifneq ($(CONFIG_SSP_SUPPORT),y)
        CONFIGURE_ARGS += \
                --disable-gcc-hardening
-       MAKE_FLAGS += \
-               CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
 else
-       MAKE_FLAGS += \
-               CFLAGS="$(TARGET_CFLAGS) -fPIC -std=gnu99"
+       EXTRA_CFLAGS += -fPIC
 endif
 
 CONFIGURE_VARS += \
@@ -85,16 +115,30 @@ CONFIGURE_VARS += \
 define Package/tor/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/torify $(1)/usr/sbin/
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/tor.init $(1)/etc/init.d/tor
        $(INSTALL_DIR) $(1)/etc/tor
        $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tor/torrc.sample $(1)/etc/tor/torrc
 endef
 
+define Package/tor-gencert/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-gencert $(1)/usr/sbin/
+endef
+
+define Package/tor-resolve/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tor-resolve $(1)/usr/sbin/
+endef
+
 define Package/tor-geoip/install
        $(INSTALL_DIR) $(1)/usr/share/tor
        $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip $(1)/usr/share/tor/
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/tor/geoip6 $(1)/usr/share/tor/
 endef
 
 $(eval $(call BuildPackage,tor))
+$(eval $(call BuildPackage,tor-gencert))
+$(eval $(call BuildPackage,tor-resolve))
 $(eval $(call BuildPackage,tor-geoip))
index e295219f1e10432237f20c6b4961b72208776596..1a784d2ffaee3080c50425643689533093156ccf 100644 (file)
@@ -1,11 +1,15 @@
 --- a/src/config/torrc.sample.in
 +++ b/src/config/torrc.sample.in
-@@ -45,11 +45,11 @@
- ## Uncomment this to start the process in the background... or use
- ## --runasdaemon 1 on the command line. This is ignored on Windows;
- ## see the FAQ entry if you want Tor to run as an NT service.
--#RunAsDaemon 1
-+RunAsDaemon 1
+@@ -39,7 +39,7 @@
+ ## Send every possible message to @LOCALSTATEDIR@/log/tor/debug.log
+ #Log debug file @LOCALSTATEDIR@/log/tor/debug.log
+ ## Use the system log instead of Tor's logfiles
+-#Log notice syslog
++Log notice syslog
+ ## To send all messages to stderr:
+ #Log debug stderr
+@@ -50,7 +50,7 @@
  
  ## The directory for keeping all the keys/etc. By default, we store
  ## things in $HOME/.tor on Unix, and in Application Data\tor on Windows.
@@ -14,7 +18,7 @@
  
  ## The port on which Tor will listen for local connections from Tor
  ## controller applications, as documented in control-spec.txt.
-@@ -190,3 +190,4 @@
+@@ -204,3 +204,4 @@
  ## address manually to your friends, uncomment this line:
  #PublishServerDescriptor 0
  
index 5a8a6be99d8382e65d3ba2cc625a6f32583adcfe..596b71e9ed3ed813c3945845457a7499abf060ab 100644 (file)
@@ -8,12 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=transmission
-PKG_VERSION:=2.92
-PKG_RELEASE:=3
+PKG_VERSION:=2.92+git
+PKG_RELEASE:=4
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=https://github.com/transmission/transmission-releases/raw/master
-PKG_MD5SUM:=3fce404a436e3cd7fde80fb6ed61c264
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/transmission/transmission.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=35fea28d1a37875ef7480ac061754df617805b19
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_MD5SUM:=aeeb8dfd918bd2cf4fb6fbdf58bd822e9b509df1ba5ec408888edd161123ef8e
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
@@ -45,11 +48,11 @@ define Package/transmission-daemon-openssl
   VARIANT:=openssl
 endef
 
-define Package/transmission-daemon-polarssl
+define Package/transmission-daemon-mbedtls
   $(call Package/transmission-daemon/Default)
-  TITLE+= (with PolarSSL)
-  DEPENDS+=+libpolarssl
-  VARIANT:=polarssl
+  TITLE+= (with mbed TLS)
+  DEPENDS+=+libmbedtls
+  VARIANT:=mbedtls
 endef
 
 define Package/transmission-cli/Default
@@ -64,11 +67,11 @@ define Package/transmission-cli-openssl
   VARIANT:=openssl
 endef
 
-define Package/transmission-cli-polarssl
+define Package/transmission-cli-mbedtls
   $(call Package/transmission-cli/Default)
-  TITLE+= (with PolarSSL)
-  DEPENDS+=+libpolarssl
-  VARIANT:=polarssl
+  TITLE+= (with mbed TLS)
+  DEPENDS+=+libmbedtls
+  VARIANT:=mbedtls
 endef
 
 define Package/transmission-remote/Default
@@ -83,17 +86,17 @@ define Package/transmission-remote-openssl
   VARIANT:=openssl
 endef
 
-define Package/transmission-remote-polarssl
+define Package/transmission-remote-mbedtls
   $(call Package/transmission-remote/Default)
-  TITLE+= (with PolarSSL)
-  DEPENDS+=+libpolarssl
-  VARIANT:=polarssl
+  TITLE+= (with mbed TLS)
+  DEPENDS+=+libmbedtls
+  VARIANT:=mbedtls
 endef
 
 define Package/transmission-web
   $(call Package/transmission/template)
   TITLE+= (webinterface)
-  DEPENDS:=@(PACKAGE_transmission-daemon-openssl||PACKAGE_transmission-daemon-polarssl)
+  DEPENDS:=@(PACKAGE_transmission-daemon-openssl||PACKAGE_transmission-daemon-mbedtls)
 endef
 
 
@@ -104,19 +107,19 @@ define Package/transmission-daemon/Default/description
  This package contains the daemon itself.
 endef
 Package/transmission-daemon-openssl/description = $(Package/transmission-daemon/Default/description)
-Package/transmission-daemon-polarssl/description = $(Package/transmission-daemon/Default/description)
+Package/transmission-daemon-mbedtls/description = $(Package/transmission-daemon/Default/description)
 
 define Package/transmission-cli/Default/description
  CLI utilities for transmission.
 endef
 Package/transmission-cli-openssl/description = $(Package/transmission-cli/Default/description)
-Package/transmission-cli-polarssl/description = $(Package/transmission-cli/Default/description)
+Package/transmission-cli-mbedtls/description = $(Package/transmission-cli/Default/description)
 
 define Package/transmission-remote/Default/description
  CLI remote interface for transmission.
 endef
 Package/transmission-remote-openssl/description = $(Package/transmission-remote/Default/description)
-Package/transmission-remote-polarssl/description = $(Package/transmission-remote/Default/description)
+Package/transmission-remote-mbedtls/description = $(Package/transmission-remote/Default/description)
 
 define Package/transmission-web/description
  Webinterface resources for transmission.
@@ -125,7 +128,7 @@ endef
 define Package/transmission-daemon-openssl/conffiles
 /etc/config/transmission
 endef
-Package/transmission-daemon-polarssl/conffiles = $(Package/transmission-daemon-openssl/conffiles)
+Package/transmission-daemon-mbedtls/conffiles = $(Package/transmission-daemon-openssl/conffiles)
 
 
 CONFIGURE_VARS += \
@@ -143,9 +146,12 @@ ifeq ($(BUILD_VARIANT),openssl)
        --with-crypto=openssl
 endif
 
-ifeq ($(BUILD_VARIANT),polarssl)
+ifeq ($(BUILD_VARIANT),mbedtls)
   CONFIGURE_ARGS += \
        --with-crypto=polarssl
+  CONFIGURE_VARS += \
+       MBEDTLS_CFLAGS="-I$(STAGING_DIR)/usr/include/mbedtls" \
+       MBEDTLS_LIBS="-lmbedtls -lmbedcrypto"
 endif
 
 MAKE_FLAGS += \
@@ -153,6 +159,11 @@ MAKE_FLAGS += \
 
 TARGET_CFLAGS += -std=gnu99
 
+define Build/Configure
+       ( cd $(PKG_BUILD_DIR); ./autogen.sh $(CONFIGURE_ARGS))
+       $(call Build/Configure/Default,$CONFIGURE_ARGS)
+endef
+
 define Package/transmission-daemon-openssl/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-daemon $(1)/usr/bin/
@@ -161,7 +172,7 @@ define Package/transmission-daemon-openssl/install
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_CONF) files/transmission.config $(1)/etc/config/transmission
 endef
-Package/transmission-daemon-polarssl/install = $(Package/transmission-daemon-openssl/install)
+Package/transmission-daemon-mbedtls/install = $(Package/transmission-daemon-openssl/install)
 
 define Package/transmission-cli-openssl/install
        $(INSTALL_DIR) $(1)/usr/bin
@@ -171,13 +182,13 @@ define Package/transmission-cli-openssl/install
                        $(PKG_INSTALL_DIR)/usr/bin/transmission-show \
                        $(1)/usr/bin/
 endef
-Package/transmission-cli-polarssl/install = $(Package/transmission-cli-openssl/install)
+Package/transmission-cli-mbedtls/install = $(Package/transmission-cli-openssl/install)
 
 define Package/transmission-remote-openssl/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-remote $(1)/usr/bin/
 endef
-Package/transmission-remote-polarssl/install = $(Package/transmission-remote-openssl/install)
+Package/transmission-remote-mbedtls/install = $(Package/transmission-remote-openssl/install)
 
 define Package/transmission-web/install
        $(INSTALL_DIR) $(1)/usr/share/transmission
@@ -185,9 +196,9 @@ define Package/transmission-web/install
 endef
 
 $(eval $(call BuildPackage,transmission-daemon-openssl))
-$(eval $(call BuildPackage,transmission-daemon-polarssl))
+$(eval $(call BuildPackage,transmission-daemon-mbedtls))
 $(eval $(call BuildPackage,transmission-cli-openssl))
-$(eval $(call BuildPackage,transmission-cli-polarssl))
+$(eval $(call BuildPackage,transmission-cli-mbedtls))
 $(eval $(call BuildPackage,transmission-remote-openssl))
-$(eval $(call BuildPackage,transmission-remote-polarssl))
+$(eval $(call BuildPackage,transmission-remote-mbedtls))
 $(eval $(call BuildPackage,transmission-web))
index 9a99fe87c8f64c4128d921b7bb2a07afa4055e5c..d3a2c8e535ec5fce1e32353f09a25700a70afb77 100644 (file)
@@ -1,6 +1,6 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -378,7 +378,7 @@ dnl See if ANY version of miniupnpc is i
+@@ -386,7 +386,7 @@ dnl See if ANY version of miniupnpc is i
  AC_LINK_IFELSE(
    [AC_LANG_PROGRAM([#include <miniupnpc/miniupnpc.h>],
                     [struct UPNPDev dev;])],
index 1747402f54bce01041f89516dcafa6033cdddf61..f03aebc18b7e82e8b088c95d10101a3f8ccb38cb 100644 (file)
@@ -1,7 +1,7 @@
 --- a/libtransmission/bitfield.c
 +++ b/libtransmission/bitfield.c
-@@ -7,6 +7,8 @@
-  * $Id: bitfield.c 14646 2015-12-31 05:22:42Z mikedld $
+@@ -6,6 +6,8 @@
+  *
   */
  
 +#define __NEED_ssize_t
@@ -9,7 +9,7 @@
  #include <assert.h>
  #include <string.h> /* memset */
  
-@@ -14,6 +16,7 @@
+@@ -13,6 +15,7 @@
  #include "bitfield.h"
  #include "utils.h" /* tr_new0 () */
  
@@ -19,7 +19,7 @@
  /****
 --- a/libtransmission/fdlimit.h
 +++ b/libtransmission/fdlimit.h
-@@ -11,6 +11,8 @@
+@@ -10,6 +10,8 @@
   #error only libtransmission should #include this header.
  #endif
  
diff --git a/net/transmission/patches/040-fix-for-mbedtls.patch b/net/transmission/patches/040-fix-for-mbedtls.patch
new file mode 100644 (file)
index 0000000..c766786
--- /dev/null
@@ -0,0 +1,29 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -154,24 +154,8 @@ AS_IF([test "x$want_crypto" = "xauto" -o
+ AS_IF([test "x$want_crypto" = "xauto" -o "x$want_crypto" = "xpolarssl"], [
+     PKG_CHECK_MODULES(MBEDTLS, [mbedtls >= $POLARSSL_MINIMUM],
+         [want_crypto="polarssl"; CRYPTO_PKG="polarssl"; CRYPTO_CFLAGS="$MBEDTLS_CFLAGS"; CRYPTO_LIBS="$MBEDTLS_LIBS"; POLARSSL_IS_MBEDTLS=yes],
+-        [AC_CHECK_HEADER([polarssl/version.h],
+-            [AC_EGREP_CPP([version_ok], [#include <polarssl/version.h>
+-                                         #if defined (POLARSSL_VERSION_NUMBER) && POLARSSL_VERSION_NUMBER >= $POLARSSL_MINIMUM
+-                                         version_ok
+-                                         #endif],
+-                [AC_CHECK_LIB([polarssl], [dhm_calc_secret],
+-                    [want_crypto="polarssl"; CRYPTO_PKG="polarssl"; CRYPTO_CFLAGS=""; CRYPTO_LIBS="-lpolarssl"],
+-                    [AS_IF([test "x$want_crypto" = "xpolarssl"],
+-                        [AC_MSG_ERROR([PolarSSL support requested, but library not found.])]
+-                    )]
+-                )],
+-                [AS_IF([test "x$want_crypto" = "xpolarssl"],
+-                    [AC_MSG_ERROR([PolarSSL support requested, but version not suitable.])]
+-                )]
+-            )],
+-            [AS_IF([test "x$want_crypto" = "xpolarssl"],
+-                [AC_MSG_ERROR([PolarSSL support requested, but headers not found.])]
+-            )]
++        [AS_IF([test "x$want_crypto" = "xpolarssl"],
++            [AC_MSG_ERROR([PolarSSL support requested, but library not found.])]
+         )]
+     )
+ ])
diff --git a/net/transmission/patches/050-mask-as-release.patch b/net/transmission/patches/050-mask-as-release.patch
new file mode 100644 (file)
index 0000000..7f25535
--- /dev/null
@@ -0,0 +1,26 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -42,8 +42,8 @@ set(TR_NAME ${PROJECT_NAME})
+ #         "Z" for unsupported trunk builds,
+ #         "0" for stable, supported releases
+ # these should be the only two lines you need to change
+-set(TR_USER_AGENT_PREFIX "2.92+")
+-set(TR_PEER_ID_PREFIX "-TR292Z-")
++set(TR_USER_AGENT_PREFIX "2.92")
++set(TR_PEER_ID_PREFIX "-TR2920-")
+ string(REGEX MATCH "^([0-9]+)\\.([0-9]+).*" TR_VERSION "${TR_USER_AGENT_PREFIX}")
+ set(TR_VERSION_MAJOR "${CMAKE_MATCH_1}")
+--- a/configure.ac
++++ b/configure.ac
+@@ -3,8 +3,8 @@ dnl STATUS: "X" for prerelease beta buil
+ dnl         "Z" for unsupported trunk builds,
+ dnl         "0" for stable, supported releases
+ dnl these should be the only two lines you need to change
+-m4_define([user_agent_prefix],[2.92+])
+-m4_define([peer_id_prefix],[-TR292Z-])
++m4_define([user_agent_prefix],[2.92])
++m4_define([peer_id_prefix],[-TR2920-])
+ AC_INIT([transmission],[user_agent_prefix],[https://trac.transmissionbt.com/newticket])
+ AC_SUBST(USERAGENT_PREFIX,[user_agent_prefix])
index ec41e0940d4d1e7ea125124ac4861adbe071e3b4..6f2d2a0d2cec69562ccd373e3805bdccd0e6e5cb 100644 (file)
@@ -1,12 +1,12 @@
 #
-# Copyright (c) 2016 Dirk Brenken (dev@brenken.org)
+# Copyright (c) 2016-2017 Dirk Brenken (dev@brenken.org)
 # This is free software, licensed under the GNU General Public License v3.
 #
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=travelmate
-PKG_VERSION:=0.2.7
+PKG_VERSION:=0.3.2
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-3.0+
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
index 2f8084a2e4700e98d5b866d8420d2a74f2bd4e1f..4cd39d60d285fdbff831b6a9baac6d3fdb414fea 100644 (file)
@@ -3,15 +3,15 @@
 ## Description
 If you’re planning an upcoming vacation or a business trip, taking your laptop, tablet or smartphone give you the ability to connect with friends or complete work on the go. But many hotels don’t have a secure wireless network setup or you’re limited on using a single device at once. Investing in a portable, mini travel router is a great way to connect all of your devices at once while having total control over your own personalized wireless network.  
 A logical combination of AP+STA mode on one physical radio allows most of OpenWrt/LEDE supported router devices to connect to a wireless hotspot/station (STA) and provide a wireless access point (AP) from that hotspot at the same time. Downside of this solution: whenever the STA interface looses the connection it will go into an active scan cycle which renders the radio unusable for AP mode operation, therefore the AP is taken down if the STA looses its association.  
-To avoid these kind of deadlocks, travelmate set all station interfaces in an "always off" mode, connects automatically to available hotspots and monitor & change these uplink connections automatically if required.  
+To avoid these kind of deadlocks, travelmate set all station interfaces in an "always off" mode and connects automatically to available/configured hotspots.  
 
 ## Main Features
 * STA interfaces operating in an "always off" mode, to make sure that the AP is always accessible
-* fast uplink connections
-* reliable connection tracking
 * easy setup within normal OpenWrt/LEDE environment
-* status & debug logging to syslog
+* fast uplink connections
 * procd init system support
+* procd based hotplug support, the travelmate start will be triggered by interface triggers
+* status & debug logging to syslog
 
 ## Prerequisites
 * [OpenWrt](https://openwrt.org) or [LEDE](https://www.lede-project.org) trunk
@@ -22,7 +22,7 @@ To avoid these kind of deadlocks, travelmate set all station interfaces in an "a
 * install 'travelmate' (_opkg install travelmate_)
 * configure your network to support (multiple) wlan uplinks and set travelmate config options (details see below)
 * set 'trm\_enabled' option in travelmate config to '1'
-* travelmate starts automatically during boot, triggered by procd as soon as the wireless subsystem is up & running
+* travelmate starts automatically during boot and will be triggered by procd interface triggers
 
 ## LuCI travelmate companion package
 * download the package [here](https://downloads.lede-project.org/snapshots/packages/x86_64/luci)
@@ -37,14 +37,13 @@ To avoid these kind of deadlocks, travelmate set all station interfaces in an "a
 * install the packages as described above
 
 ## Travelmate config options
-* mandatory config options:
+* travelmate config options:
     * trm\_enabled => main switch to enable/disable the travelmate service (default: '0', disabled)
-    * trm\_loop => loop timeout in seconds for wlan monitoring (default: '30')
-    * trm\_maxretry => how many times should travelmate try to connect to a certain uplink, to disable this check at all set it to '0' (default: '3')
-* optional config options:
     * trm\_debug => enable/disable debug logging (default: '0', disabled)
-    * trm\_device => limit travelmate to a dedicated radio, i.e 'radio0' (default: use all radios)
+    * trm\_maxwait => how long (in seconds) should travelmate wait for wlan interface reload action (default: '20')
+    * trm\_maxretry => how many times should travelmate try to find an uplink after a trigger event (default: '3')
     * trm\_iw => set this option to '0' to use iwinfo for wlan scanning (default: '1', use iw)
+    * trm\_iface => restrict the procd interface trigger to a (list of) certain wan interface(s) or disable it at all (default: not set, disabled)
 
 ## Setup
 **1. configure a wwan interface in /etc/config/network:**
@@ -117,16 +116,6 @@ config wifi-iface
 /etc/init.d/travelmate start
 </code></pre>
 
-**Common runtime outputs (visible via logread)**
-
-**Success:** Sun Oct  9 17:02:21 2016 user.notice root: travelmate-0.2.1[712] info : wlan interface "wwan06" connected to uplink "blackhole.nl"
-
-**Disabled service:** Sun Oct  9 18:06:32 2016 user.notice root: travelmate-0.2.1[2379] info : travelmate is currently disabled, please set 'trm_enabled' to use this service
-
-**Misconfigured/broken uplink:** Sun Oct  9 18:56:42 2016 user.notice root: travelmate-0.2.1[2435] info : uplink "blackhole.nl" disabled due to permanent connection failures
-
-**Uplink disappeared:** Sun Oct  9 19:00:28 2016 user.notice root: travelmate-0.2.1[3876] info : uplink "Neffos C5L" get lost
-
 ## Support
 Please join the travelmate discussion in this [forum thread](https://forum.openwrt.org/viewtopic.php?id=67697) or contact me by [mail](mailto:dev@brenken.org)  
 
index e413a8cfee894ae142d6cdff847b892bf0b9e037..c63000f3806b7969a8beab630ea6e23b8ffb4419 100644 (file)
@@ -3,5 +3,7 @@
 
 config travelmate 'global'
        option trm_enabled '0'
-       option trm_loop '30'
+       option trm_debug '0'
+       option trm_maxwait '20'
        option trm_maxretry '3'
+       option trm_iw '1'
index fc3e9ed9e05ef1e6620de2217258cd173298f8aa..255a641879611dc136843b21aef8a37f345cb80b 100755 (executable)
@@ -3,23 +3,37 @@
 START=85
 USE_PROCD=1
 
-exec 2>/dev/null
 trm_script="/usr/bin/travelmate.sh"
 
+boot()
+{
+    ubus -t 30 wait_for network.interface
+    rc_procd start_service
+}
+
 start_service()
 {
-    ubus -t 30 wait_for network.wireless
-    if [ $(($?)) -eq 0 ]
-    then
-        procd_open_instance
-        procd_set_param command "${trm_script}"
-        procd_close_instance
-    else
-        logger -s "travelmate [procd]:" "no wlan devices found, travelmate startup canceled"
-    fi
+    procd_open_instance "travelmate"
+    procd_set_param env trm_procd="true"
+    procd_set_param command "${trm_script}" "${@}"
+    procd_set_param stdout 1
+    procd_set_param stderr 1
+    procd_close_instance
 }
 
 service_triggers()
 {
-    procd_add_reload_trigger "travelmate"
+    local iface="$(uci -q get travelmate.global.trm_iface)"
+
+    if [ -z "${iface}" ]
+    then
+        procd_add_raw_trigger "interface.*.down" 1000 /etc/init.d/travelmate start
+    else
+        for name in ${iface}
+        do
+            procd_add_interface_trigger "interface.*.down" "${name}" /etc/init.d/travelmate start
+        done
+    fi
+
+    procd_add_config_trigger "config.change" "travelmate" /etc/init.d/travelmate start
 }
index fa0d7ae8f65a0bd9add827e09de87b57912b89e7..f626f390c01a85ee343e78427439916904dd5372 100755 (executable)
 #
 LC_ALL=C
 PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-trm_pid="${$}"
-trm_ver="0.2.7"
+trm_ver="0.3.2"
+trm_enabled=1
 trm_debug=0
-trm_loop=30
+trm_maxwait=20
 trm_maxretry=3
 trm_iw=1
-trm_device=""
 
-# function to prepare all relevant AP and STA interfaces
-#
-f_prepare()
+f_envload()
 {
-    local config="${1}"
-    local mode="$(uci -q get wireless."${config}".mode)"
-    local device="$(uci -q get wireless."${config}".device)"
-    local network="$(uci -q get wireless."${config}".network)"
-    local disabled="$(uci -q get wireless."${config}".disabled)"
-
-    if [ "${mode}" = "ap" ] && [ -n "${network}" ] &&
-        ([ -z "${trm_device}" ] || [ "${trm_device}" = "${device}" ])
-    then
-        f_ifname "${device}"
-        if [ -z "${disabled}" ] || [ "${disabled}" = "1" ]
-        then
-            f_set "none" "${config}" "${network}" "up"
-        fi
-    elif [ "${mode}" = "sta" ] && [ -n "${network}" ]
+    # source required system libraries
+    #
+    if [ -r "/lib/functions.sh" ]
     then
-        trm_stalist="${trm_stalist} ${config}_${network}"
-        if [ -z "${disabled}" ] || [ "${disabled}" = "0" ]
-        then
-            f_set "none" "${config}" "${network}" "down"
-        fi
+        . "/lib/functions.sh"
+    else
+        f_log "error" "status  ::: required system library not found"
     fi
-}
 
-# function to set different wlan interface status
-#
-f_set()
-{
-    local change="${1}"
-    local config="${2}"
-    local interface="${3}"
-    local command="${4}"
-
-    if [ "${command}" = "up" ]
-    then
-        uci -q set wireless."${config}".disabled=0
-        ubus call network.interface."${interface}" "${command}"
-        trm_checklist="${trm_checklist} ${interface}"
-    elif [ "${command}" = "down" ]
+    # load uci config and check 'enabled' option
+    #
+    option_cb()
+    {
+        local option="${1}"
+        local value="${2}"
+        eval "${option}=\"${value}\""
+    }
+    config_load travelmate
+
+    if [ ${trm_enabled} -ne 1 ]
     then
-        uci -q set wireless."${config}".disabled=1
-        ubus call network.interface."${interface}" "${command}"
+        f_log "info " "status  ::: travelmate is currently disabled, please set 'trm_enabled' to '1' to use this service"
+        exit 0
     fi
 
-    f_log "debug" "set  ::: change: ${change}, config: ${config}, interface: ${interface}, command: ${command}, checklist: ${trm_checklist}, uci-changes: $(uci -q changes wireless)"
-    if [ -n "$(uci -q changes wireless)" ]
+    # check for preferred wireless tool
+    #
+    if [ ${trm_iw} -eq 1 ]
     then
-        if [ "${change}" = "commit" ]
-        then
-            uci -q commit wireless
-            ubus call network reload
-            f_check
-        elif [ "${change}" = "partial" ]
-        then
-            ubus call network reload
-            f_check
-        elif [ "${change}" = "defer" ]
-        then
-            uci -q revert wireless
-        elif [ "${change}" = "revert" ]
-        then
-            uci -q revert wireless
-            ubus call network reload
-            f_check
-        fi
+        trm_scanner="$(which iw)"
+    else
+        trm_scanner="$(which iwinfo)"
+    fi
+    if [ -z "${trm_scanner}" ]
+    then
+        f_log "error" "status  ::: no wireless tool for wlan scanning found, please install 'iw' or 'iwinfo'"
     fi
 }
 
-# function to get ap ifnames  by ubus call
+# function to bring down all STA interfaces
 #
-f_ifname()
+f_prepare()
 {
-    local device="${1}"
-    local name cfg
+    local config="${1}"
+    local mode="$(uci -q get wireless."${config}".mode)"
+    local network="$(uci -q get wireless."${config}".network)"
+    local disabled="$(uci -q get wireless."${config}".disabled)"
 
-    json_load "$(ubus -S call network.wireless status)"
-    json_select "${device}"
-    json_get_keys if_list interfaces
-    json_select interfaces
-    for iface in ${if_list}
-    do
-        json_select "${iface}"
-        json_get_var name ifname
-        json_select "config"
-        json_get_var cfg mode
-        if [ -n "${name}" ] && [ "${cfg}" = "ap" ]
+    if [ "${mode}" = "sta" ] && [ -n "${network}" ]
+    then
+        trm_stalist="${trm_stalist} ${config}_${network}"
+        if [ -z "${disabled}" ] || [ "${disabled}" = "0" ]
         then
-            trm_aplist="${trm_aplist} ${name}"
+            uci -q set wireless."${config}".disabled=1
+            f_log "debug" "prepare ::: config: ${config}, interface: ${network}"
         fi
-    done
+    fi
 }
 
-# function to check interface status on "up" event
-#
 f_check()
 {
-    local interface value
-    local cnt=0
+    local ifname cnt=1 mode="${1}"
+    trm_ifstatus="false"
 
-    for interface in ${trm_checklist}
+    while [ ${cnt} -le ${trm_maxwait} ]
     do
-        while [ $((cnt)) -lt 15 ]
-        do
-            json_load "$(ubus -S call network.interface."${interface}" status)"
-            json_get_var trm_status up
-            if [ "${trm_status}" = "1" ] || [ -n "${trm_uplink}" ]
+        if [ "${mode}" = "ap" ]
+        then
+            trm_ifstatus="$(ubus -S call network.wireless status | jsonfilter -l1 -e '@.*.up')"
+        else
+            ifname="$(ubus -S call network.wireless status | jsonfilter -l1 -e '@.*.interfaces[@.config.mode="sta"].ifname')"
+            if [ -n "${ifname}" ]
             then
-                f_log "debug" "check::: interface: ${interface}, status: ${trm_status}, uplink-cfg: ${trm_uplink}, uplink-ssid: ${trm_ssid}, loop-cnt: ${cnt}, error-cnt: $((trm_count_${trm_config}))"
-                json_cleanup
-                break
+                trm_ifstatus="$(ubus -S call network.interface dump | jsonfilter -e "@.interface[@.device=\"${ifname}\"].up")"
             fi
-            cnt=$((cnt+1))
-            sleep 1
-        done
+        fi
+        if [ "${mode}" = "initial" ] || [ "${trm_ifstatus}" = "true" ]
+        then
+            break
+        fi
+        cnt=$((cnt+1))
+        sleep 1
     done
-    if [ -n "${trm_uplink}" ] && [ "${trm_status}" = "0" ]
-    then
-        ubus call network reload
-        eval "trm_count_${trm_uplink}=\$((trm_count_${trm_uplink}+1))"
-        trm_checklist=""
-        trm_uplink=""
-        f_log "info" "uplink ${trm_ssid} get lost"
-    elif [ -z "${trm_uplink}" ] && [ -n "${trm_checklist}" ]
-    then
-        trm_checklist=""
-    fi
+    f_log "debug" "check   ::: mode: ${mode}, name: ${ifname}, status: ${trm_ifstatus}, count: ${cnt}, max-wait: ${trm_maxwait}"
 }
 
 # function to write to syslog
@@ -157,125 +112,93 @@ f_log()
     local class="${1}"
     local log_msg="${2}"
 
-    if [ -n "${log_msg}" ] && ([ "${class}" != "debug" ] || ([ "${class}" = "debug" ] && [ $((trm_debug)) -eq 1 ]))
+    if [ -n "${log_msg}" ] && ([ "${class}" != "debug" ] || [ ${trm_debug} -eq 1 ])
     then
-        logger -t "travelmate-${trm_ver}[${trm_pid}] ${class}" "${log_msg}" 2>&1
+        logger -t "travelmate-[${trm_ver}] ${class}" "${log_msg}"
+        if [ "${class}" = "error" ]
+        then
+            exit 255
+        fi
     fi
 }
 
-# source required system libraries
-#
-if [ -r "/lib/functions.sh" ] && [ -r "/usr/share/libubox/jshn.sh" ]
-then
-    . "/lib/functions.sh"
-    . "/usr/share/libubox/jshn.sh"
-    json_init
-else
-    f_log "error" "required system libraries not found"
-    exit 255
-fi
-
-# load uci config and check 'enabled' option
-#
-option_cb()
+f_main()
 {
-    local option="${1}"
-    local value="${2}"
-    eval "${option}=\"${value}\""
-}
-
-config_load travelmate
-
-if [ "${trm_enabled}" != "1" ]
-then
-    f_log "info" "travelmate is currently disabled, please set 'trm_enabled' to '1' to use this service"
-    exit 0
-fi
-
-# check for preferred wireless tool
-#
-if [ $((trm_iw)) -eq 1 ]
-then
-    trm_scanner="$(which iw)"
-else
-    trm_scanner="$(which iwinfo)"
-fi
-
-if [ -z "${trm_scanner}" ]
-then
-    f_log "error" "no wireless tool for wlan scanning found, please install 'iw' or 'iwinfo'"
-    exit 1
-fi
+    local ap_list ssid_list config network ssid cnt=1
+    local sysver="$(ubus -S call system board | jsonfilter -e '@.release.description')"
 
-# infinitive loop to establish and track STA uplink connections
-#
-while true
-do
-    if [ -z "${trm_uplink}" ] || [ "${trm_status}" = "0" ]
+    f_check "initial"
+    if [ "${trm_ifstatus}" != "true" ]
     then
-        trm_aplist=""
-        trm_stalist=""
         config_load wireless
         config_foreach f_prepare wifi-iface
-        f_set "commit"
-        if [ -z "${trm_aplist}" ]
+        if [ -n "$(uci -q changes wireless)" ]
         then
-            f_log "error" "no usable AP configuration found, please check '/etc/config/wireless'"
-            exit 1
+            uci -q commit wireless
+            ubus call network reload
         fi
-        for ap in ${trm_aplist}
+        f_check "ap"
+        ap_list="$(ubus -S call network.wireless status | jsonfilter -e '@.*.interfaces[@.config.mode="ap"].ifname')"
+        f_log "debug" "main    ::: ap-list: ${ap_list}, sta-list: ${trm_stalist}"
+        if [ -z "${ap_list}" ] || [ -z "${trm_stalist}" ]
+        then
+            f_log "error" "status  ::: no usable AP/STA configuration found"
+        fi
+        for ap in ${ap_list}
         do
-            ubus -t 10 wait_for hostapd."${ap}"
-            if [ $((trm_iw)) -eq 1 ]
-            then
-                trm_ssidlist="$(${trm_scanner} dev "${ap}" scan 2>/dev/null | awk '/SSID: /{if(!seen[$0]++){printf "\"";for(i=2; i<=NF; i++)if(i==2)printf $i;else printf " "$i;printf "\" "}}')"
-            else
-                trm_ssidlist="$(${trm_scanner} "${ap}" scan | awk '/ESSID: ".*"/{ORS=" ";if (!seen[$0]++) for(i=2; i<=NF; i++) print $i}')"
-            fi
-            f_log "debug" "main ::: scan-tool: ${trm_scanner}, aplist: ${trm_aplist}, ssidlist: ${trm_ssidlist}"
-            if [ -n "${trm_ssidlist}" ]
-            then
-                if [ -z "${trm_stalist}" ]
+            while [ ${cnt} -le ${trm_maxretry} ]
+            do
+                if [ ${trm_iw} -eq 1 ]
                 then
-                    f_log "error" "no usable STA configuration found, please check '/etc/config/wireless'"
-                    exit 1
+                    ssid_list="$(${trm_scanner} dev "${ap}" scan 2>/dev/null | \
+                        awk '/SSID: /{if(!seen[$0]++){printf "\"";for(i=2; i<=NF; i++)if(i==2)printf $i;else printf " "$i;printf "\" "}}')"
+                else
+                    ssid_list="$(${trm_scanner} "${ap}" scan | \
+                        awk '/ESSID: ".*"/{ORS=" ";if (!seen[$0]++) for(i=2; i<=NF; i++) print $i}')"
                 fi
-                for sta in ${trm_stalist}
-                do
-                    trm_config="${sta%%_*}"
-                    trm_network="${sta##*_}"
-                    trm_ssid="\"$(uci -q get wireless."${trm_config}".ssid)\""
-                    if [ $((trm_count_${trm_config})) -lt $((trm_maxretry)) ] || [ $((trm_maxretry)) -eq 0 ]
-                    then
-                        if [ -n "$(printf "${trm_ssidlist}" | grep -Fo "${trm_ssid}")" ]
+                f_log "debug" "main    ::: scan-tool: ${trm_scanner}, ssidlist: ${ssid_list}"
+                if [ -n "${ssid_list}" ]
+                then
+                    for sta in ${trm_stalist}
+                    do
+                        config="${sta%%_*}"
+                        network="${sta##*_}"
+                        ssid="\"$(uci -q get wireless."${config}".ssid)\""
+                        if [ -n "$(printf "${ssid_list}" | grep -Fo "${ssid}")" ]
                         then
-                            f_set "partial" "${trm_config}" "${trm_network}" "up"
-                            if [ "${trm_status}" = "1" ]
+                            uci -q set wireless."${config}".disabled=0
+                            uci -q commit wireless
+                            ubus call network reload
+                            f_check "sta"
+                            if [ "${trm_ifstatus}" = "true" ]
                             then
-                                trm_checklist="${trm_network}"
-                                trm_uplink="${trm_config}"
-                                f_set "defer"
-                                f_log "info" "wwan interface connected to uplink ${trm_ssid}" 
-                                break 2
+                                f_log "info " "status  ::: wwan interface connected to uplink ${ssid} (${cnt}/${trm_maxretry}, ${sysver})"
+                                sleep 5
+                                return 0
                             else
-                                f_set "revert"
-                                eval "trm_count_${trm_config}=\$((trm_count_${trm_config}+1))"
+                                uci -q set wireless."${config}".disabled=1
+                                uci -q commit wireless
+                                ubus call network reload
+                                f_log "info " "status  ::: wwan interface can't connect to uplink ${ssid} (${cnt}/${trm_maxretry}, ${sysver})"
                             fi
                         fi
-                    elif [ $((trm_count_${trm_config})) -eq $((trm_maxretry)) ] && [ $((trm_maxretry)) -ne 0 ]
-                    then
-                        eval "trm_count_${trm_config}=\$((trm_count_${trm_config}+1))"
-                        f_log "info" "uplink ${trm_ssid} disabled due to permanent connection failures"
-                    fi
-                done
-            fi
-            sleep 5
+                    done
+                else
+                    f_log "info " "status  ::: empty uplink list (${cnt}/${trm_maxretry}, ${sysver})"
+                fi
+                cnt=$((cnt+1))
+                sleep 5
+            done
         done
+        f_log "info " "status  ::: no wwan uplink found (${sysver})"
     else
-        f_check
-        if [ -n "${trm_uplink}" ]
-        then
-            sleep ${trm_loop}
-        fi
+        f_log "info " "status  ::: wwan uplink still connected (${sysver})"
     fi
-done
+}
+
+if [ "${trm_procd}" = "true" ]
+then
+    f_envload
+    f_main
+fi
+exit 0
\ No newline at end of file
index 27254233ed8bab3d8af7bd50a4f80c441550537d..1dc5dc2af9c73dcf1ca216f3ba9d6576a9035955 100644 (file)
@@ -1,20 +1,20 @@
 #
-# Copyright (C) 2009-2015 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:=umurmur
-PKG_VERSION:=0.2.16
+PKG_VERSION:=0.2.16-20161126
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_URL:=git://github.com/umurmur/umurmur.git
+PKG_SOURCE_URL:=https://github.com/umurmur/umurmur.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=0.2.16
+PKG_SOURCE_VERSION:=fac630135664fda26338d403041b6b6e558a2d6b
+PKG_MIRROR_MD5SUM:=0e031baa5cebcdb4eb39a0cde572014f
+PKG_MIRROR_HASH:=6773aebea9aea355a41425e946291bb47bc399f85483bd6532cf26dfc7c801e5
 
 PKG_INSTALL:=1
 PKG_FIXUP:=autoreconf
@@ -32,8 +32,7 @@ define Package/umurmur/Default
   SUBMENU:=Instant Messaging
   TITLE:=uMurmur
   DEPENDS:=+libconfig +libprotobuf-c
-  URL:=http://code.google.com/p/umurmur
-  MAINTAINER:=Martin Johansson <martin@fatbob.nu>
+  URL:=http://umurmur.net
 endef
 
 define Package/umurmur/Default/description
@@ -52,16 +51,16 @@ define Package/umurmur-openssl/description
   Uses OpenSSL library for SSL and crypto.
 endef
 
-define Package/umurmur-polarssl
+define Package/umurmur-mbedtls
   $(call Package/umurmur/Default)
-  TITLE+= (with PolarSSL support)
-  DEPENDS+= +libpolarssl
-  VARIANT:=polarssl
+  TITLE+= (with mbed TLS support)
+  DEPENDS+= +libmbedtls
+  VARIANT:=mbedtls
 endef
 
-define Package/umurmur-polarssl/description
+define Package/umurmur-mbedtls/description
   $(call Package/umurmur/Default/description)
-  Uses the PolarSSL library for SSL and crypto.
+  Uses the mbed TLS library for SSL and crypto.
 endef
 
 define Build/Compile
@@ -75,7 +74,7 @@ define Package/umurmur-openssl/conffiles
 /etc/umurmur.conf
 endef
 
-Package/umurmur-polarssl/conffiles = $(Package/umurmur-openssl/conffiles)
+Package/umurmur-mbedtls/conffiles = $(Package/umurmur-openssl/conffiles)
 
 define Package/umurmur-openssl/install
        $(INSTALL_DIR) $(1)/usr/bin
@@ -87,17 +86,17 @@ define Package/umurmur-openssl/install
        $(INSTALL_DIR) $(1)/etc/umurmur
 endef
 
-Package/umurmur-polarssl/install = $(Package/umurmur-openssl/install)
+Package/umurmur-mbedtls/install = $(Package/umurmur-openssl/install)
 
 ifeq ($(BUILD_VARIANT),openssl)
   CONFIGURE_ARGS += \
        --with-ssl=openssl
 endif
 
-ifeq ($(BUILD_VARIANT),polarssl)
+ifeq ($(BUILD_VARIANT),mbedtls)
   CONFIGURE_ARGS += \
-       --with-ssl=polarssl
+       --with-ssl=mbedtls
 endif
 
 $(eval $(call BuildPackage,umurmur-openssl))
-$(eval $(call BuildPackage,umurmur-polarssl))
+$(eval $(call BuildPackage,umurmur-mbedtls))
diff --git a/net/umurmur/patches/010-mbedtls_fix_includes.patch b/net/umurmur/patches/010-mbedtls_fix_includes.patch
new file mode 100644 (file)
index 0000000..619517f
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/ssl.h
++++ b/src/ssl.h
+@@ -90,7 +90,7 @@ typedef      ssl_context SSL_handle_t;
+ #elif defined(USE_MBEDTLS)
+ #include <mbedtls/ssl.h>
+-#include <mbedtls/net.h>
++#include <mbedtls/net_sockets.h>
+ #include <mbedtls/version.h>
+ #if defined(MBEDTLS_VERSION_MAJOR)
diff --git a/net/umurmur/patches/10-Add-compile-time-check-for-POLARSSL_VERSION_FEATURES.patch b/net/umurmur/patches/10-Add-compile-time-check-for-POLARSSL_VERSION_FEATURES.patch
deleted file mode 100644 (file)
index c8fcdc8..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git a/src/ssli_polarssl.c b/src/ssli_polarssl.c
-index a36ccb6..167637b 100644
---- a/src/ssli_polarssl.c
-+++ b/src/ssli_polarssl.c
-@@ -225,8 +225,12 @@ void SSLi_init(void)
-           Log_fatal("Cannot open /dev/urandom");
- #endif
-+#ifdef POLARSSL_VERSION_FEATURES
-     version_get_string(verstring);
-     Log_info("PolarSSL library version %s initialized", verstring);
-+#else
-+    Log_info("PolarSSL library initialized");
-+#endif
- }
- void SSLi_deinit(void)
index 17f3065f183b34e54534f76a335736a1c7e2978d..d8db017a4b365517447a8248ec7300a5f5f5dab9 100644 (file)
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=unbound
-PKG_VERSION:=1.5.10
-PKG_RELEASE:=5
+PKG_VERSION:=1.6.1
+PKG_RELEASE:=6
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE
@@ -17,7 +17,7 @@ PKG_MAINTAINER:=Eric Luehrsen <ericluehrsen@hotmail.com>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.unbound.net/downloads
-PKG_MD5SUM:=0a3a236811f1ab5c1dc31974fa74e047
+PKG_HASH:=42df63f743c0fe8424aeafcf003ad4b880b46c14149d696057313f5c1ef51400
 
 PKG_BUILD_DEPENDS:=libexpat
 PKG_BUILD_PARALLEL:=1
@@ -27,7 +27,7 @@ PKG_INSTALL:=1
 include $(INCLUDE_DIR)/package.mk
 
 define Package/unbound/Default
-  TITLE:=Unbound is a validating, recursive, and caching DNS resolver.
+  TITLE:=Validating Recursive DNS Server
   URL:=http://www.unbound.net/
   DEPENDS:=+libopenssl
 endef
@@ -51,7 +51,7 @@ define Package/unbound-anchor
   SECTION:=net
   CATEGORY:=Network
   SUBMENU:=IP Addresses and Names
-  TITLE+= (anchor utility)
+  TITLE+= (DSKEY utility)
   DEPENDS+= +unbound +libexpat
 endef
 
@@ -77,7 +77,7 @@ define Package/unbound-control-setup
   SECTION:=net
   CATEGORY:=Network
   SUBMENU:=IP Addresses and Names
-  TITLE+= (control setup utility)
+  TITLE+= (control setup)
   DEPENDS+= +unbound-control +openssl-util
 endef
 
@@ -90,7 +90,7 @@ define Package/unbound-host
   SECTION:=net
   CATEGORY:=Network
   SUBMENU:=IP Addresses and Names
-  TITLE+= (DNS lookup utility)
+  TITLE+= (lookup utility)
   DEPENDS+= +libunbound
 endef
 
@@ -122,6 +122,8 @@ CONFIGURE_ARGS += \
 define Package/unbound/conffiles
 /etc/config/unbound
 /etc/unbound/unbound.conf
+/etc/unbound/unbound_ext.conf
+/etc/unbound/unbound_srv.conf
 endef
 
 define Build/InstallDev
@@ -142,15 +144,17 @@ define Package/unbound/install
                $(PKG_INSTALL_DIR)/etc/unbound/unbound.conf \
                $(1)/etc/unbound/unbound.conf
        $(INSTALL_DATA) ./files/root.key $(1)/etc/unbound/root.key
+       $(INSTALL_DATA) ./files/unbound_ext.conf $(1)/etc/unbound/unbound_ext.conf
+       $(INSTALL_DATA) ./files/unbound_srv.conf $(1)/etc/unbound/unbound_srv.conf
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_DATA) ./files/unbound.uci $(1)/etc/config/unbound
-       $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
-       $(INSTALL_BIN) ./files/unbound.iface $(1)/etc/hotplug.d/iface/25-unbound
        $(INSTALL_DIR) $(1)/etc/hotplug.d/ntp
-       $(INSTALL_BIN) ./files/unbound.ntpd $(1)/etc/hotplug.d/ntp/25-unbound
+       $(INSTALL_BIN)  ./files/unbound.ntpd $(1)/etc/hotplug.d/ntp/25-unbound
        $(INSTALL_DIR) $(1)/etc/init.d
-       $(INSTALL_BIN) ./files/unbound.init $(1)/etc/init.d/unbound
+       $(INSTALL_BIN)  ./files/unbound.init $(1)/etc/init.d/unbound
        $(INSTALL_DIR) $(1)/usr/lib/unbound
+       $(INSTALL_BIN)  ./files/odhcpd.sh $(1)/usr/lib/unbound/odhcpd.sh
+       $(INSTALL_DATA) ./files/odhcpd.awk $(1)/usr/lib/unbound/odhcpd.awk
        $(INSTALL_DATA) ./files/dnsmasq.sh $(1)/usr/lib/unbound/dnsmasq.sh
        $(INSTALL_DATA) ./files/iptools.sh $(1)/usr/lib/unbound/iptools.sh
        $(INSTALL_DATA) ./files/rootzone.sh $(1)/usr/lib/unbound/rootzone.sh
@@ -188,3 +192,4 @@ $(eval $(call BuildPackage,unbound-control))
 $(eval $(call BuildPackage,unbound-control-setup))
 $(eval $(call BuildPackage,unbound-host))
 $(eval $(call BuildPackage,libunbound))
+
index a66ac74b5d204bde853224808e469527ff7c8901..d8bdf958fbc1ef31fcadeb16dac1907981f839c3 100644 (file)
 # Unbound Recursive DNS Server with UCI
 
 ## Unbound Description
-Unbound is a validating, recursive, and caching DNS resolver. The C implementation of Unbound is developed and maintained by [NLnet Labs](https://www.unbound.net/). It is based on ideas and algorithms taken from a java prototype developed by Verisign labs, Nominet, Kirei and ep.net. Unbound is designed as a set of modular components, so that also DNSSEC (secure DNS) validation and stub-resolvers (that do not run as a server, but are linked into an application) are easily possible.
+[Unbound](https://www.unbound.net/) is a validating, recursive, and caching DNS resolver. The C implementation of Unbound is developed and maintained by [NLnet Labs](https://www.nlnetlabs.nl/). It is based on ideas and algorithms taken from a java prototype developed by Verisign labs, Nominet, Kirei and ep.net. Unbound is designed as a set of modular components, so that also DNSSEC (secure DNS) validation and stub-resolvers (that do not run as a server, but are linked into an application) are easily possible.
 
 ## Package Overview
-Unbound may be useful on consumer grade embedded hardware. It is *intended* to be a recursive resolver only. [NLnet Labs NSD](https://www.nlnetlabs.nl/projects/nsd/) is *intended* for the authoritative task. This is different than [ISC Bind](https://www.isc.org/downloads/bind/) and its inclusive functions. Unbound configuration effort and memory consumption may be easier to control. A consumer could have their own recursive resolver, and remove potential issues from forwarding resolvers outside of their control.
+Unbound may be useful on consumer grade embedded hardware. It is _intended_ to be a recursive resolver only. [NLnet Labs NSD](https://www.nlnetlabs.nl/projects/nsd/) is _intended_ for the authoritative task. This is different than [ISC Bind](https://www.isc.org/downloads/bind/) and its inclusive functions. Unbound configuration effort and memory consumption may be easier to control. A consumer could have their own recursive resolver with 8/64 MB router, and remove potential issues from forwarding resolvers outside of their control.
 
 This package builds on Unbounds capabilities with OpenWrt UCI. Not every Unbound option is in UCI, but rather, UCI simplifies the combination of related options. Unbounds native options are bundled and balanced within a smaller set of choices. Options include resources, DNSSEC, access control, and some TTL tweaking. The UCI also provides an escape option and work at the raw "unbound.conf" level.
 
-## Work with dnsmasq
-Some UCI options will help Unbound and dnsmasq work together in **parallel**. The default DHCP and DNS stub resolver in OpenWrt is dnsmasq, and it will continue to serve this purpose. The following actions will make Unbound the primary DNS server, and make dnsmasq only provide DNS to local DHCP.
+## HOW TO Adblocking
+The UCI scripts will work with [net/adblock 2.3+](https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md), if it is installed and enabled. Its all detected and integrated automatically. In brief, the adblock scripts create distinct local-zone files that are simply included in the unbound conf file during UCI generation. If you don't want this, then disable adblock or reconfigure adblock to not send these files to Unbound.
 
-- Set `unbound` UCI `option dnsmasq_link_dns` to true.
-- Set other `unbound` UCI options how you wish.
-- Set `dnsmasq` UCI `option noresolv` to true.
-- Set `dnsmasq` UCI `option resolvfile` to blank single-quotes.
-- Set `dnsmasq` UCI `option port` to 1053 or 5353.
-- Add to each `dhcp` UCI `list dhcp_option option:dns-server,0.0.0.0`
+## HOW TO Integrate with DHCP
+Some UCI options and scripts help Unbound to work with DHCP servers to load the local DNS. The examples provided here are serial dnsmasq-unbound, parallel dnsmasq-unbound, and unbound scripted with odhcpd.
 
-Alternatives are mentioned here for completeness. DHCP event scripts which write host records are difficult to formulate for Unbound, NSD, or Bind. These programs sometimes need to be forcefully reloaded with host configuration, and reloads can bust cache. **Serial** configuration between dnsmasq and Unbound can be made on 127.0.0.1 with an off-port like #1053. This may double cache storage and incur unnecessary transfer delay.
+### Serial dnsmasq
+In this case, dnsmasq is not changed *much* with respect to the default OpenWRT/LEDE configuration. Here dnsmasq is forced to use the local Unbound instance as the lone upstream DNS server, instead of your ISP. This may be the easiest implementation, but performance degradation can occur in high volume networks. dnsmasq and Unbound effectively have the same information in memory, and all transfers are double handled.
 
-## Back to Manual Configuration
-You don't want UCI, but don't worry. We have UCI for that. However, OpenWrt or LEDE are targeted at embedded machines with flash ROM. The initialization scripts do a few things to protect flash ROM. 
+**/etc/config/unbound**:
+
+```
+config unbound
+  option add_local_fqdn '0'
+  option add_wan_fqdn '0'
+  option dhcp_link 'none'
+  # dnsmasq should not forward your domain to unbound, but if...
+  option domain 'yourdomain'
+  option domain_type 'refuse'
+  option listen_port '1053'
+  ...
+```
+
+**/etc/config/dhcp**:
+
+```
+config dnsmasq
+  option domain 'yourdomain'
+  option noresolv '1'
+  option resolvfile '/tmp/resolv.conf.auto'
+  option port '53'
+  list server '127.0.0.1#1053'
+  list server '::1#1053'
+  ...
+```
+
+### Parallel dnsmasq
+In this case, Unbound serves your local network directly for all purposes. It will look over to dnsmasq for DHCP-DNS resolution. Unbound is generally accessible on port 53, and dnsmasq is only accessed at 127.0.0.1:1053 by Unbound. Although you can dig/drill/nslookup remotely with the proper directives.
+
+**/etc/config/unbound**:
+
+```
+config unbound
+  option dhcp_link 'dnsmasq'
+  option listen_port '53'
+  ...
+```
+
+**/etc/config/dhcp**:
+
+```
+config dnsmasq
+  option domain 'yourdomain'
+  option noresolv '1'
+  option resolvfile '/tmp/resolv.conf.auto'
+  option port '1053'
+  ...
+
+config dhcp 'lan'
+  # dnsmasq may not issue DNS option if not std. configuration
+  list dhcp_option 'option:dns-server,0.0.0.0'
+  ...
+```
+
+### Unbound and odhcpd
+You may ask can Unbound replace dnsmasq? You can have DHCP-DNS records with Unbound and odhcpd only. The UCI scripts will allow Unbound to act like dnsmasq. When odhcpd configures each DHCP lease, it will call a script. The script provided with Unbound will read the lease file for DHCP-DNS records. You **must install** `unbound-control`, because the lease records are added and removed without starting, stopping, flushing cache, or re-writing conf files. (_restart overhead can be excessive with even a few mobile devices._)
+
+Don't forget to disable or uninstall dnsmasq when you don't intend to use it. Strange results may occur. If you want to use default dnsmasq+odhcpd and add Unbound on top, then use the dnsmasq-serial or dnsmasq-parallel methods above.
 
-All of `/etc/unbound` (persistent, ROM) is copied to `/var/lib/unbound` (tmpfs, RAM). Edit your manual `/etc/unbound/unbound.conf` to reference this `/var/lib/unbound` location for included files. Note in preparation for a jail, `/var/lib/unbound` is `chown unbound`. Configure for security in`/etc/unbound/unbound.conf` with options `username:unbound` and `chroot:/var/lib/unbound`. 
+**/etc/config/unbound**:
+
+```
+config unbound
+  # name your router in DNS
+  option add_local_fqdn '1'
+  option add_wan_fqdn '1'
+  option dhcp_link 'odhcpd'
+  # add SLAAC inferred from DHCPv4
+  option dhcp4_slaac6 '1'
+  option domain 'lan'
+  option domain_type 'static'
+  option listen_port '53'
+  option rebind_protection '1'
+  # install unbound-control and set this
+  option unbound_control '1'
+  ...
+```
+
+**/etc/config/dhcp**:
+
+```
+config dhcp 'lan'
+  option dhcpv4 'server'
+  option dhcpv6 'server'
+  option interface 'lan'
+  option leasetime '12h'
+  option ra 'server'
+  option ra_management '1'
+  # issue your ULA and avoid default [fe80::]
+  list dns 'fdxx:xxxx:xxxx::1'
+  ...
 
-Finally, `root.key` maintenance for DNSKEY RFC5011 would be hard on flash. Unbound natively updates frequently. It also creates and destroys working files in the process. In `/var/lib/unbound` this is no problem, but it would be gone at the next reboot. If you have DNSSEC (validator) active, then you should consider this UCI option. Choose how many days to copy from `/var/lib/unbound/root.key` (tmpfs) to `/etc/unbound/root.key` (flash). Keep the DNSKEY updated with your choice of flash activity.
+config odhcpd 'odhcpd'
+  option maindhcp '1'
+  option leasefile '/var/lib/odhcpd/dhcp.leases'
+  # this is where the magic happens
+  option leasetrigger '/usr/lib/unbound/odhcpd.sh'
+```
 
-       config unbound
-               option manual_conf '1'
-               option root_age '30'
+## HOW TO Manual Override
+Yes, there is a UCI to disable the rest of Unbound UCI. However, OpenWrt or LEDE are targeted at embedded machines with flash ROM. The initialization scripts do a few things to protect flash ROM.
+
+### Completely Manual (almost)
+All of `/etc/unbound` (persistent, ROM) is copied to `/var/lib/unbound` (tmpfs, RAM). Edit your manual `/etc/unbound/unbound.conf` to reference this `/var/lib/unbound` location for included files. Note in preparation for a jail, `/var/lib/unbound` is `chown unbound`. Configure for security in`/etc/unbound/unbound.conf` with options `username:unbound` and `chroot:/var/lib/unbound`.
+
+Keep the DNSKEY updated with your choice of flash activity. `root.key` maintenance for DNSKEY RFC5011 would be hard on flash. Unbound natively updates frequently. It also creates and destroys working files in the process. In `/var/lib/unbound` this is no problem, but it would be gone at the next reboot. If you have DNSSEC (validator) active, then you should consider the age UCI option. Choose how many days to copy from `/var/lib/unbound/root.key` (tmpfs) to `/etc/unbound/root.key` (flash).
+
+**/etc/config/unbound**:
+
+```
+config unbound
+  option manual_conf '1'
+  option root_age '9'
+  # end
+```
+
+### Hybrid Manual/UCI
+You like the UCI. Yet, you need to add some difficult to standardize options, or just are not ready to make a UCI request yet. The files `/etc/unbound/unbound_srv.conf` and `/etc/unbound/unbound_ext.conf` will be copied to Unbounds chroot directory and included during auto generation.
+
+The former will be added to the end of the `server:` clause. The later will be added to the end of the file for extended `forward:` and `view:` clauses. You can also disable unbound-control in the UCI which only allows "localhost" connections unencrypted, and then add an encrypted remote `control:` clause.
 
 ## Complete List of UCI Options
 **/etc/config/unbound**:
 
-       config unbound
-               Currently only one instance is supported.
-
-       option dnsmasq_gate_name '0'
-               Boolean. Forward PTR records for interfaces not serving DHCP.
-               Assume these are WAN. Example dnsmasq option here to provide
-               logs with a name when your ISP won't link DHCP-DNS.
-               "dnsmasq.conf: interface-name=way-out.myrouter.lan,eth0.1"
-
-       option dnsmasq_link_dns '0'
-               Boolean. Master link to dnsmasq. Parse /etc/config/dhcp for dnsmasq
-               options. Forward domain such as "lan" and PTR records for DHCP
-               interfaces and their deligated subnets, IP4 and IP6.
-
-       option dnsmasq_only_local '0'
-               TODO: not yet implemented
-               Boolean. Restrict link to dnsmasq. DNS only to local host. Obscure
-               names of other connected hosts on the network. Example:
-               "drill -x 198.51.100.17  ~ IN PTR way-out.myrouter.lan"
-               "drill -x 192.168.10.1   ~ IN PTR guest-wifi.myrouter.lan"
-               "drill -x 192.168.10.201 ~ NODATA" (insted of james-laptop.lan)
-
-       option edns_size '1280'
-               Extended DNS is necessary for DNSSEC. However, it can run into MTU
-               issues. Use this size in bytes to manage drop outs.
-
-       option listen_port '53'
-               Port. Incoming. Where Unbound will listen for queries.
-
-       option localservice '1'
-               Boolean. Prevent DNS amplification attacks. Only provide access to
-               Unbound from subnets this machine has interfaces on.
-
-       option manual_conf '0'
-               Boolean. Skip all this UCI nonsense. Manually edit the
-               configuration. Make changes to /etc/unbound/unbound.conf.
-
-       option query_minimize '0'
-               Boolean. Enable a minor privacy option. Query only one name piece
-               at a time. Don't let each server know the next recursion.
-
-       option rebind_localhost '0'
-               Boolean. Prevent loopback "127.0.0.0/8" or "::1/128" responses.
-               These may used by black hole servers for good purposes like
-               ad-blocking or parental access control. Obviously these responses
-               also can be used to for bad purposes.
-
-       option rebind_protection '1'
-               Boolean. Prevent RFC 1918 Reponses from global DNS. Example a
-               poisoned reponse within "192.168.0.0/24" could be used to turn a
-               local browser into an external attack proxy server.
-
-       option recursion 'passive'
-               Unbound has numerous options for how it recurses. This UCI combines
-               them into "passive," "aggressive," or Unbound's own "default."
-               Passive is easy on resources, but slower until cache fills.
-
-       option resource 'small'
-               Unbound has numerous options for resources. This UCI gives "tiny,"
-               "small," "medium," and "large." Medium is most like the compiled
-               defaults with a bit of balancing. Tiny is close to the published
-               memory restricted configuration. Small 1/2 medium, and large 2x.
-
-       option root_age '30'
-               Days. >90 Disables. Age limit for Unbound root data like root
-               DNSSEC key. Unbound uses RFC 5011 to manage root key. This could
-               harm flash ROM. This activity is mapped to "tmpfs," but every so
-               often it needs to be copied back to flash for the next reboot.
-
-       option ttl_min '120'
-               Seconds. Minimum TTL in cache. Recursion can be expensive without
-               cache. A low TTL is normal for server migration. A low TTL can be
-               abused for snoop-vertising (DNS hit counts; recording query IP).
-               Typical to configure maybe 0~300, but 1800 is the maximum accepted.
-
-       option unbound_control '0'
-               Boolean. Enables unbound-control application access ports. Enabling
-               this without the unbound-control package installed is robust.
-
-       option validator '0'
-               Boolean. Enable DNSSEC. Unbound names this the "validator" module.
-
-       option validator_ntp '1'
-               Boolean. Disable DNSSEC time checks at boot. Once NTP confirms
-               global real time, then DNSSEC is restarted at full strength. Many
-               embedded devices don't have a real time power off clock. NTP needs
-               DNS to resolve servers. This works around the chicken-and-egg.
-
-       list domain_insecure
-               List. Domains or pointers that you wish to skip DNSSEC. Your DHCP
-               domains and pointers in dnsmasq will get this automatically.
+```
+config unbound
+  Currently only one instance is supported.
+
+  option add_local_fqdn '0'
+    Level. This puts your routers host name in the LAN (local) DNS.
+    Each level is more detailed and comprehensive.
+    0 - Disabled
+    1 - Host Name on only the primary address
+    2 - Host Name on all addresses found (except link)
+    3 - FQDN and host name on all addresses (except link)
+    4 - Above and interfaces named <iface>.<hostname>.<domain>
+
+  option add_wan_fqdn '0'
+    Level. Same as previous option only this applies to the WAN. WAN
+    are inferred by a UCI `config dhcp` entry that contains the line
+    option ignore '1'.
+
+  option dns64 '0'
+    Boolean. Enable DNS64 through Unbound in order to bridge networks
+    that are IPV6 only and IPV4 only (see RFC6052).
+
+  option dns64_prefix '64:ff9b::/96'
+    IPV6 Prefix. The IPV6 prefix wrapped on the IPV4 address for DNS64.
+    You should use RFC6052 "well known" address, unless you also
+    redirect to a proxy or gateway for your NAT64.
+
+  option dhcp_link 'none'
+    Program Name. Link to one of the supported programs we have scripts
+    for. You may also need to install a trigger script in the DHCP
+    servers configuration. See HOW TO above.
+
+  option dhcp4_slaac6 '0'
+    Boolean. Some DHCP servers do this natively (dnsmasq). Otherwise
+    the script provided with this package will try to fabricate SLAAC
+    IP6 addresses from DHCPv4 MAC records.
+
+  option domain 'lan'
+    Unbound local-zone: <domain> <type>. This is used to suffix all
+    host records, and maintain a local zone. When dnsmasq is dhcp_link
+    however, then this option is ignored (dnsmasq does it all).
+
+  option domain_type 'static'
+    Unbound local-zone: <domain> <type>. This allows you to lock
+    down or allow forwarding of your domain, your router host name
+    without suffix, and leakage of RFC6762 "local."
+
+  option edns_size '1280'
+    Bytes. Extended DNS is necessary for DNSSEC. However, it can run
+    into MTU issues. Use this size in bytes to manage drop outs.
+
+  option hide_binddata '1'
+    Boolean. If enabled version.server, version.bind, id.server, and
+    hostname.bind queries are refused.
+
+  option listen_port '53'
+    Port. Incoming. Where Unbound will listen for queries.
+
+  option localservice '1'
+    Boolean. Prevent DNS amplification attacks. Only provide access to
+    Unbound from subnets this machine has interfaces on.
+
+  option manual_conf '0'
+    Boolean. Skip all this UCI nonsense. Manually edit the
+    configuration. Make changes to /etc/unbound/unbound.conf.
+
+  option protocol 'mixed'
+    Unbound can limit its protocol used for recursive queries.
+    Set 'ip4_only' to avoid issues if you do not have native IP6.
+    Set 'ip6_prefer' to possibly improve performance as well as
+    not consume NAT paths for the client computers.
+    Do not use 'ip6_only' unless testing.
+
+  option query_minimize '0'
+    Boolean. Enable a minor privacy option. Don't let each server know
+    the next recursion. Query one piece at a time.
+
+  option query_min_strict '0'
+    Boolean. Query minimize is best effort and will fall back to normal
+    when it must. This option prevents the fall back, but less than
+    standard name servers will fail to resolve their domains.
+
+  option rebind_localhost '0'
+    Boolean. Prevent loopback "127.0.0.0/8" or "::1/128" responses.
+    These may used by black hole servers for good purposes like
+    ad-blocking or parental access control. Obviously these responses
+    also can be used to for bad purposes.
+
+  option rebind_protection '1'
+    Boolean. Prevent RFC 1918 Reponses from global DNS. Example a
+    poisoned reponse within "192.168.0.0/24" could be used to turn a
+    local browser into an external attack proxy server.
+
+  option recursion 'passive'
+    Unbound has numerous options for how it recurses. This UCI combines
+    them into "passive," "aggressive," or Unbound's own "default."
+    Passive is easy on resources, but slower until cache fills.
+
+  option resource 'small'
+    Unbound has numerous options for resources. This UCI gives "tiny,"
+    "small," "medium," and "large." Medium is most like the compiled
+    defaults with a bit of balancing. Tiny is close to the published
+    memory restricted configuration. Small 1/2 medium, and large 2x.
+
+  option root_age '9'
+    Days. >90 Disables. Age limit for Unbound root data like root
+    DNSSEC key. Unbound uses RFC 5011 to manage root key. This could
+    harm flash ROM. This activity is mapped to "tmpfs," but every so
+    often it needs to be copied back to flash for the next reboot.
+
+  option ttl_min '120'
+    Seconds. Minimum TTL in cache. Recursion can be expensive without
+    cache. A low TTL is normal for server migration. A low TTL can be
+    abused for snoop-vertising (DNS hit counts; recording query IP).
+    Typical to configure maybe 0~300, but 1800 is the maximum accepted.
+
+  option unbound_control '0'
+    Boolean. Enables unbound-control application access ports. Enabling
+    this without the unbound-control package installed is robust.
+
+  option validator '0'
+    Boolean. Enable DNSSEC. Unbound names this the "validator" module.
+
+  option validator_ntp '1'
+    Boolean. Disable DNSSEC time checks at boot. Once NTP confirms
+    global real time, then DNSSEC is restarted at full strength. Many
+    embedded devices don't have a real time power off clock. NTP needs
+    DNS to resolve servers. This works around the chicken-and-egg.
+
+  list domain_insecure
+    List. Domains or pointers that you wish to skip DNSSEC. Your DHCP
+    domains and pointers in dnsmasq will get this automatically.
+```
+
 
index f9eec7d8a3fe0eb95fc9aa066609b35f7efb81ee..079208613eb280fa634db853d6f741ee857fece5 100644 (file)
 #
 ##############################################################################
 
-create_local_zone() {
+dnsmasq_local_zone() {
   local cfg="$1"
-  local fwd_port fwd_domain
+  local fwd_port fwd_domain wan_fqdn
 
+  # dnsmasq domain and interface assignment settings will control config
   config_get fwd_domain "$cfg" domain
-  config_get fwd_port   "$cfg" port
+  config_get fwd_port "$cfg" port
+  config_get wan_fqdn "$cfg" add_wan_fqdn
+
+
+  if [ -n "$wan_fqdn" ] ; then
+    UNBOUND_D_WAN_FQDN=$wan_fqdn
+  fi
 
 
   if [ -n "$fwd_domain" -a -n "$fwd_port" -a ! "$fwd_port" -eq 53 ] ; then
@@ -48,7 +55,7 @@ create_local_zone() {
 
 ##############################################################################
 
-create_local_arpa() {
+dnsmasq_local_arpa() {
   local cfg="$1"
   local logint dhcpv4 dhcpv6 ignore
   local subnets subnets4 subnets6
@@ -78,7 +85,7 @@ create_local_arpa() {
     forward=""
 
   elif [ "$ignore" -gt 0 ] ; then
-    if [ "$UNBOUND_B_GATE_NAME" -gt 0 ] ; then
+    if [ "$UNBOUND_D_WAN_FQDN" -gt 0 ] ; then
       # Only forward the one gateway host.
       forward="host"
 
@@ -137,11 +144,11 @@ create_local_arpa() {
 
 ##############################################################################
 
-forward_local_zone() {
+dnsmasq_forward_zone() {
   if [ -n "$UNBOUND_N_FWD_PORTS" -a -n "$UNBOUND_TXT_FWD_ZONE" ] ; then
     for fwd_domain in $UNBOUND_TXT_FWD_ZONE ; do
       {
-        # This is derived of create_local_zone/arpa
+        # This is derived of dnsmasq_local_zone/arpa
         # but forward: clauses need to be seperate
         echo "forward-zone:"
         echo "  name: \"$fwd_domain.\""
@@ -159,23 +166,16 @@ forward_local_zone() {
 ##############################################################################
 
 dnsmasq_link() {
-  ####################
-  # UCI @ dhcp       #
-  ####################
-
-
-  if [ "$UNBOUND_B_DNSMASQ" -gt 0 ] ; then
-    # Forward to dnsmasq on same host for DHCP lease hosts
-    echo "  do-not-query-localhost: no" >> $UNBOUND_CONFFILE
-    # Look at dnsmasq settings
-    config_load dhcp
-    # Zone for DHCP / SLAAC-PING DOMAIN
-    config_foreach create_local_zone dnsmasq
-    # Zone for DHCP / SLAAC-PING ARPA
-    config_foreach create_local_arpa dhcp
-    # Now create ALL seperate forward: clauses
-    forward_local_zone
-  fi
+  # Forward to dnsmasq on same host for DHCP lease hosts
+  echo "  do-not-query-localhost: no" >> $UNBOUND_CONFFILE
+  # Look at dnsmasq settings
+  config_load dhcp
+  # Zone for DHCP / SLAAC-PING DOMAIN
+  config_foreach dnsmasq_local_zone dnsmasq
+  # Zone for DHCP / SLAAC-PING ARPA
+  config_foreach dnsmasq_local_arpa dhcp
+  # Now create ALL seperate forward: clauses
+  dnsmasq_forward_zone
 }
 
 ##############################################################################
diff --git a/net/unbound/files/odhcpd.awk b/net/unbound/files/odhcpd.awk
new file mode 100644 (file)
index 0000000..1609508
--- /dev/null
@@ -0,0 +1,207 @@
+#!/usr/bin/awk
+##############################################################################
+#
+# 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.
+#
+# 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.
+#
+# Copyright (C) 2016 Eric Luehrsen
+#
+##############################################################################
+#
+# Turn DHCP records into meaningful A, AAAA, and PTR records. Also lift a
+# function from dnsmasq and use DHCPv4 MAC to find IPV6 SLAAC hosts.
+#
+# External Parameters
+#   "hostfile" = where this script will cache host DNS data
+#   "domain" = text domain suffix
+#   "bslaac" = boolean, use DHCPv4 MAC to find GA and ULA IPV6 SLAAC
+#   "bisolt" = boolean, format <host>.<network>.<domain>. so you can isolate
+#   "bconf"  = boolean, write conf file format rather than pipe records
+#
+##############################################################################
+
+/^#/ {
+  # We need to pick out DHCP v4 or v6 records
+  net = $2 ; id = $3 ; cls = $4 ; hst = $5 ; adr = $9 ; adr2 = $10
+  cdr = adr ;
+  cdr2 = adr2 ;
+  sub( /\/.*/, "", adr ) ;
+  sub( /.*\//, "", cdr ) ;
+  sub( /\/.*/, "", adr2 ) ;
+  sub( /.*\//, "", cdr2 ) ;
+
+
+  if ( bisolt == 1 ) {
+    # TODO: this might be better with a substituion option,
+    # or per DHCP pool do-not-DNS option, but its getting busy here.
+    fqdn = net
+    fqdn = sub( /\./, "-", fqdn ) ;
+    fqdn = tolower( hst "." fqdn "." domain ) ;
+  }
+
+  else {
+    fqdn = tolower( hst "." domain ) ;
+  }
+
+
+  if ( cls == "ipv4" ) {
+    if ( NF == 8 ) {
+      # odhcpd errata in field format without host name
+      adr = $8 ; hst = "-" ; cdr = adr ;
+      sub( /\/.*/, "", adr ) ;
+      sub( /.*\//, "", cdr ) ;
+    }
+
+
+    if (( cdr == 32 ) && ( hst != "-" )) {
+      # only for provided hostnames and full /32 assignments
+      ptr = adr ; qpr = "" ; split( ptr, ptr, "." ) ;
+      slaac = slaac_eui64( id ) ;
+
+
+      if ( bconf == 1 ) {
+        x = ( "local-data: \"" fqdn ". 120 IN A " adr "\"" ) ;
+        y = ( "local-data-ptr: \"" adr " 120 " fqdn "\"" ) ;
+        print ( x "\n" y ) > hostfile ;
+      }
+
+      else {
+        for( i=1; i<=4; i++ ) { qpr = ( ptr[i] "." qpr) ; }
+        x = ( fqdn ". 120 IN A " adr ) ;
+        y = ( qpr "in-addr.arpa. 120 IN PTR " fqdn ) ;
+        print ( x "\n" y ) > hostfile ;
+      }
+
+
+      if (( bslaac == 1 ) && ( slaac != 0 )) {
+        # UCI option to discover IPV6 routed SLAAC addresses
+        # NOT TODO - ping probe take too long when added in awk-rule loop
+        cmd = ( "ip -6 --oneline route show dev " net ) ;
+
+
+        while ( ( cmd | getline adr ) > 0 ) {
+          if (( substr( adr, 1, 5 ) <= "fd00:" ) \
+          && ( index( adr, "via" ) == 0 )) {
+            # GA or ULA routed addresses only (not LL or MC)
+            sub( /\/.*/, "", adr ) ;
+            adr = ( adr slaac ) ;
+            
+            
+            if ( split( adr, tmp0, ":" ) >= 8 ) { 
+              sub( "::", ":", adr ) ; 
+            }
+
+
+            if ( bconf == 1 ) {
+              x = ( "local-data: \"" fqdn ". 120 IN AAAA " adr "\"" ) ;
+              y = ( "local-data-ptr: \"" adr " 120 " fqdn "\"" ) ;
+              print ( x "\n" y ) > hostfile ;
+            }
+
+            else {
+              qpr = ipv6_ptr( adr ) ;
+              x = ( fqdn ". 120 IN AAAA " adr ) ;
+              y = ( qpr ". 120 IN PTR " fqdn ) ;
+              print ( x "\n" y ) > hostfile ;
+            }
+          }
+        }
+
+
+        close( cmd ) ;
+      }
+    }
+  }
+
+  else {
+    if (( cdr == 128 ) && ( hst != "-" )) {
+      if ( bconf == 1 ) {
+        x = ( "local-data: \"" fqdn ". 120 IN AAAA " adr "\"" ) ;
+        y = ( "local-data-ptr: \"" adr " 120 " fqdn "\"" ) ;
+        print ( x "\n" y ) > hostfile ;
+      }
+
+      else {
+        # only for provided hostnames and full /128 assignments
+        qpr = ipv6_ptr( adr ) ;
+        x = ( fqdn ". 120 IN AAAA " adr ) ;
+        y = ( qpr ". 120 IN PTR " fqdn ) ;
+        print ( x "\n" y ) > hostfile ;
+      }
+    }
+    
+    if (( cdr2 == 128 ) && ( hst != "-" )) {
+      if ( bconf == 1 ) {
+        x = ( "local-data: \"" fqdn ". 120 IN AAAA " adr2 "\"" ) ;
+        y = ( "local-data-ptr: \"" adr2 " 120 " fqdn "\"" ) ;
+        print ( x "\n" y ) > hostfile ;
+      }
+
+      else {
+        # odhcp puts GA and ULA on the same line (position 9 and 10)
+        qpr2 = ipv6_ptr( adr2 ) ;
+        x = ( fqdn ". 120 IN AAAA " adr2 ) ;
+        y = ( qpr2 ". 120 IN PTR " fqdn ) ;
+        print ( x "\n" y ) > hostfile ;
+      }
+    }
+  }
+}
+
+##############################################################################
+
+function ipv6_ptr( ipv6,    arpa, ary, end, i, j, new6, sz, start ) {
+  # IPV6 colon flexibility is a challenge when creating [ptr].ip6.arpa.
+  sz = split( ipv6, ary, ":" ) ; end = 9 - sz ;
+
+
+  for( i=1; i<=sz; i++ ) {
+    if( length(ary[i]) == 0 ) {
+      for( j=1; j<=end; j++ ) { ary[i] = ( ary[i] "0000" ) ; }
+    }
+
+    else {
+      ary[i] = substr( ( "0000" ary[i] ), length( ary[i] )+5-4 ) ;
+    }
+  }
+
+
+  new6 = ary[1] ;
+  for( i = 2; i <= sz; i++ ) { new6 = ( new6 ary[i] ) ; }
+  start = length( new6 ) ;
+  for( i=start; i>0; i-- ) { arpa = ( arpa substr( new6, i, 1 ) ) ; } ;
+  gsub( /./, "&\.", arpa ) ; arpa = ( arpa "ip6.arpa" ) ;
+
+  return arpa ;
+}
+
+##############################################################################
+
+function slaac_eui64( mac,    ary, glbit, eui64 ) {
+  if ( length(mac) >= 12 ) {
+    # RFC2373 and use DHCPv4 registered MAC to find SLAAC addresses
+    split( mac , ary , "" ) ;
+    glbit = ( "0x" ary[2] ) ;
+    glbit = sprintf( "%d", glbit ) ;
+    glbit = or( glbit, 2 ) ;
+    ary[2] = sprintf( "%x", glbit ) ;
+    eui64 = ( ary[1] ary[2] ary[3] ary[4] ":" ary[5] ary[6] "ff:fe" ) ;
+    eui64 = ( eui64 ary[7] ary[8] ":" ary[9] ary[10]  ary[11] ary[12] ) ;
+  }
+
+  else {
+    eui64 = 0 ;
+  }
+
+
+  return eui64 ;
+}
+
+##############################################################################
+
diff --git a/net/unbound/files/odhcpd.sh b/net/unbound/files/odhcpd.sh
new file mode 100644 (file)
index 0000000..22a470b
--- /dev/null
@@ -0,0 +1,99 @@
+#!/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.
+#
+# 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.
+#
+# Copyright (C) 2016 Eric Luehrsen
+#
+##############################################################################
+#
+# This script facilitates alternate installation of Unbound+odhcpd and no
+# need for dnsmasq. There are some limitations, but it works and is small.
+# The lease file is parsed to make "zone-data:" and "local-data:" entries.
+#
+# config odhcpd 'odhcpd'
+#   option leasetrigger '/usr/lib/unbound/odhcpd.sh'
+#
+##############################################################################
+
+# Common file location definitions
+. /usr/lib/unbound/unbound.sh
+
+##############################################################################
+
+odhcpd_settings() {
+  # This trigger is out of normal init context, so we need to read some UCI.
+  local cfg="$1"
+  config_get UNBOUND_D_DHCP_LINK  "$cfg" dhcp_link none
+  config_get_bool UNBOUND_B_SLAAC6_MAC "$cfg" dhcp4_slaac6 0
+  config_get UNBOUND_TXT_DOMAIN "$cfg" domain lan
+}
+
+##############################################################################
+
+odhcpd_zonedata() {
+  local dns_ls_add=$UNBOUND_VARDIR/dhcp_dns.add
+  local dns_ls_del=$UNBOUND_VARDIR/dhcp_dns.del
+  local dhcp_ls_new=$UNBOUND_VARDIR/dhcp_lease.new
+  local dhcp_ls_old=$UNBOUND_VARDIR/dhcp_lease.old
+  local dhcp_ls_add=$UNBOUND_VARDIR/dhcp_lease.add
+  local dhcp_ls_del=$UNBOUND_VARDIR/dhcp_lease.del
+  local dhcp_origin=$( uci get dhcp.@odhcpd[0].leasefile )
+
+  config_load unbound
+  config_foreach odhcpd_settings unbound
+
+
+  if [ "$UNBOUND_D_DHCP_LINK" = "odhcpd" -a -f "$dhcp_origin" ] ; then
+    # Capture the lease file which could be changing often
+    cat $dhcp_origin | sort > $dhcp_ls_new
+    touch $dhcp_ls_old
+    sort $dhcp_ls_new $dhcp_ls_old $dhcp_ls_old | uniq -u > $dhcp_ls_add
+    sort $dhcp_ls_old $dhcp_ls_new $dhcp_ls_new | uniq -u > $dhcp_ls_del
+
+    # Go through the messy business of coding up A, AAAA, and PTR records
+    # This static conf will be available if Unbound restarts asynchronously
+    awk -v hostfile=$UNBOUND_DHCP_CONF -v domain=$UNBOUND_TXT_DOMAIN \
+        -v bslaac=$UNBOUND_B_SLAAC6_MAC -v bisolt=0 -v bconf=1 \
+        -f /usr/lib/unbound/odhcpd.awk $dhcp_ls_new
+
+    # Deleting and adding all records into Unbound can be a burden in a
+    # high density environment. Use unbound-control incrementally.
+    awk -v hostfile=$dns_ls_del -v domain=$UNBOUND_TXT_DOMAIN \
+        -v bslaac=$UNBOUND_B_SLAAC6_MAC -v bisolt=0 -v bconf=0 \
+        -f /usr/lib/unbound/odhcpd.awk $dhcp_ls_del
+
+    awk -v hostfile=$dns_ls_add -v domain=$UNBOUND_TXT_DOMAIN \
+        -v bslaac=$UNBOUND_B_SLAAC6_MAC -v bisolt=0 -v bconf=0 \
+        -f /usr/lib/unbound/odhcpd.awk $dhcp_ls_add
+
+
+    if [ -f "$dns_ls_del" ] ; then
+      cat $dns_ls_del | $UNBOUND_CONTROL_CFG local_datas_remove
+    fi
+
+
+    if [ -f "$dns_ls_add" ] ; then
+      cat $dns_ls_add | $UNBOUND_CONTROL_CFG local_datas
+    fi
+
+
+    # prepare next round
+    mv $dhcp_ls_new $dhcp_ls_old
+    rm -f $dns_ls_del $dns_ls_add $dhcp_ls_del $dhcp_ls_add
+  fi
+}
+
+##############################################################################
+
+odhcpd_zonedata
+
+##############################################################################
+
index 2ad6641345273ada29b584f5fcdd061c3e99e207..2de0b624605012b5dc3b45e1d17de18ab0c692b9 100644 (file)
@@ -1 +1,3 @@
 . IN DS 19036 8 2 49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5
+. IN DS 20326 8 2 E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC683457104237C7F8EC8D
+
index 143c0560f65715cf5e5f786e9b8752ce807613a9..d085fed4eafcc8ff7c3109ef0bfdec65d9b4662a 100644 (file)
@@ -26,7 +26,7 @@ rootzone_uci() {
   # This will likely be called outside of "start_service()" context
   config_get_bool UNBOUND_B_DNSSEC "$cfg" validator 0
   config_get_bool UNBOUND_B_NTP_BOOT "$cfg" validator_ntp 1
-  config_get UNBOUND_N_ROOT_AGE "$cfg" root_age 30
+  config_get UNBOUND_N_ROOT_AGE "$cfg" root_age 9
 }
 
 ##############################################################################
diff --git a/net/unbound/files/unbound.iface b/net/unbound/files/unbound.iface
deleted file mode 100755 (executable)
index 172bcae..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-##############################################################################
-#
-# Copyright (C) 2016 Eric Luehrsen
-#
-##############################################################################
-#
-# "Restart" Unbound on hotplug interface up:
-# - Clean rebind of unbound to new interfaces
-# - Some of Unbound conf options to not reload run time
-# - Unbound can grow a bit so this will shrink it back
-#
-##############################################################################
-
-if [ "$ACTION" = ifup ] && /etc/init.d/unbound enabled ; then
-  /etc/init.d/unbound restart
-fi
-
-##############################################################################
-
index 0f5049d0c51d27aaa3439acfb1599580404abf36..1edf9ef80d8804366f5c1323201d0b0010fee26a 100755 (executable)
@@ -9,7 +9,8 @@
 #
 ##############################################################################
 
-START=60
+START=19
+STOP=50
 USE_PROCD=1
 PROG=/usr/sbin/unbound
 
@@ -19,9 +20,23 @@ PROG=/usr/sbin/unbound
 
 ##############################################################################
 
+boot() {
+  UNBOUND_BOOT=1
+  start "$@"
+}
+
+##############################################################################
+
 start_service() {
-  unbound_prepare
+  if [ -n "$UNBOUND_BOOT" ] ; then
+    # Load procd triggers (rc) and use event IFUP to really start
+    return 0
+  fi
+
+  # complex UCI work
+  unbound_start
 
+  # standard procd clause
   procd_open_instance
   procd_set_param command $PROG -d -c $UNBOUND_CONFFILE
   procd_set_param respawn
@@ -31,15 +46,18 @@ start_service() {
 ##############################################################################
 
 stop_service() {
-  rootzone_update
+  unbound_stop
+  
+  # Wait! on restart Unbound may take time writing closure stats to syslog
+  pidof $PROG && sleep 1
 }
 
 ##############################################################################
 
 service_triggers() {
-  procd_add_reload_trigger "dhcp"
-  procd_add_reload_trigger "network"
+  # use soft reload to prevent continuous stop-start and cache flush
   procd_add_reload_trigger "unbound"
+  procd_add_raw_trigger "interface.*.up" 2000 /etc/init.d/unbound reload
 }
 
 ##############################################################################
index 9244284d85d7a554eb94e9fb2b1fa49b315e80f8..d744cb06705b1fc37298d136538db29116f9b602 100755 (executable)
 
 ##############################################################################
 
-if [ "$ACTION" = stratum -a ! -f "$UNBOUND_TIMEFILE" ] \
-  && /etc/init.d/dnsmasq enabled ; then
-  #
+if [ "$ACTION" = stratum -a ! -f "$UNBOUND_TIMEFILE" ] ; then
   echo "ntpd: $( date )" > $UNBOUND_TIMEFILE
-  /etc/init.d/unbound restart
+  /etc/init.d/unbound enabled && /etc/init.d/unbound restart
+  # Yes, hard RESTART. We need to be absolutely sure to enable DNSSEC.
 fi
 
 ##############################################################################
index 568c627416ed6ec61695f70a85981b4859137888..4daefda4d1138c49f6b12742e22fd8ecf32be036 100644 (file)
 ##############################################################################
 
 UNBOUND_B_CONTROL=0
-UNBOUND_B_DNSMASQ=0
+UNBOUND_B_SLAAC6_MAC=0
 UNBOUND_B_DNSSEC=0
+UNBOUND_B_DNS64=0
 UNBOUND_B_GATE_NAME=0
+UNBOUND_B_HIDE_BIND=1
 UNBOUND_B_LOCL_BLCK=0
-UNBOUND_B_LOCL_NAME=0
 UNBOUND_B_LOCL_SERV=1
 UNBOUND_B_MAN_CONF=0
 UNBOUND_B_NTP_BOOT=1
 UNBOUND_B_PRIV_BLCK=1
 UNBOUND_B_QUERY_MIN=0
+UNBOUND_B_QRY_MINST=0
 
+UNBOUND_D_DOMAIN_TYPE=static
+UNBOUND_D_DHCP_LINK=none
+UNBOUND_D_LAN_FQDN=0
+UNBOUND_D_PROTOCOL=mixed
 UNBOUND_D_RESOURCE=small
 UNBOUND_D_RECURSION=passive
+UNBOUND_D_WAN_FQDN=0
 
-UNBOUND_TXT_FWD_ZONE=""
-UNBOUND_TTL_MIN=120
+UNBOUND_IP_DNS64="64:ff9b::/96"
 
 UNBOUND_N_EDNS_SIZE=1280
 UNBOUND_N_FWD_PORTS=""
 UNBOUND_N_RX_PORT=53
-UNBOUND_N_ROOT_AGE=28
+UNBOUND_N_ROOT_AGE=9
 
-##############################################################################
+UNBOUND_TTL_MIN=120
 
-UNBOUND_ANCHOR=/usr/bin/unbound-anchor
-UNBOUND_CONTROL=/usr/bin/unbound-control
+UNBOUND_TXT_DOMAIN=lan
+UNBOUND_TXT_FWD_ZONE=""
+UNBOUND_TXT_HOSTNAME=thisrouter
+
+##############################################################################
 
 UNBOUND_LIBDIR=/usr/lib/unbound
+UNBOUND_VARDIR=/var/lib/unbound
 
 UNBOUND_PIDFILE=/var/run/unbound.pid
 
-UNBOUND_VARDIR=/var/lib/unbound
+UNBOUND_SRV_CONF=$UNBOUND_VARDIR/unbound_srv.conf
+UNBOUND_EXT_CONF=$UNBOUND_VARDIR/unbound_ext.conf
+UNBOUND_DHCP_CONF=$UNBOUND_VARDIR/unbound_dhcp.conf
 UNBOUND_CONFFILE=$UNBOUND_VARDIR/unbound.conf
+
 UNBOUND_KEYFILE=$UNBOUND_VARDIR/root.key
 UNBOUND_HINTFILE=$UNBOUND_VARDIR/root.hints
 UNBOUND_TIMEFILE=$UNBOUND_VARDIR/unbound.time
-UNBOUND_CHECKFILE=$UNBOUND_VARDIR/unbound.check
+
+##############################################################################
+
+UNBOUND_ANCHOR=/usr/sbin/unbound-anchor
+UNBOUND_CONTROL=/usr/sbin/unbound-control
+UNBOUND_CONTROL_CFG="$UNBOUND_CONTROL -c $UNBOUND_CONFFILE"
 
 ##############################################################################
 
@@ -70,6 +88,141 @@ UNBOUND_CHECKFILE=$UNBOUND_VARDIR/unbound.check
 
 ##############################################################################
 
+copy_dash_update() {
+  # TODO: remove this function and use builtins when this issues is resovled.
+  # Due to OpenWrt/LEDE divergence "cp -u" isn't yet universally available.
+  local filetime keeptime
+
+
+  if [ -f $UNBOUND_KEYFILE.keep ] ; then
+    # root.key.keep is reused if newest
+    filetime=$( date -r $UNBOUND_KEYFILE +%s )
+    keeptime=$( date -r $UNBOUND_KEYFILE.keep +%s )
+
+
+    if [ $keeptime -gt $filetime ] ; then
+      cp $UNBOUND_KEYFILE.keep $UNBOUND_KEYFILE
+    fi
+
+
+    rm -f $UNBOUND_KEYFILE.keep
+  fi
+}
+
+##############################################################################
+
+create_interface_dns() {
+  local cfg="$1"
+  local ipcommand logint ignore ifname ifdashname
+  local name names address addresses
+  local ulaprefix if_fqdn host_fqdn mode mode_ptr
+
+  # Create local-data: references for this hosts interfaces (router).
+  config_get logint "$cfg" interface
+  config_get_bool ignore "$cfg" ignore 0
+  network_get_device ifname "$cfg"
+
+  ifdashname="${ifname//./-}"
+  ipcommand="ip -o address show $ifname"
+  addresses="$($ipcommand | awk '/inet/{sub(/\/.*/,"",$4); print $4}')"
+  ulaprefix="$(uci_get network @globals[0] ula_prefix)"
+  host_fqdn="$UNBOUND_TXT_HOSTNAME.$UNBOUND_TXT_DOMAIN"
+  if_fqdn="$ifdashname.$host_fqdn"
+
+
+  if [ -z "${ulaprefix%%:/*}" ] ; then
+    # Nonsense so this option isn't globbed below
+    ulaprefix="fdno:such:addr::/48"
+  fi
+
+
+  if [ "$ignore" -gt 0 ] ; then
+    mode="$UNBOUND_D_WAN_FQDN"
+  else
+    mode="$UNBOUND_D_LAN_FQDN"
+  fi
+
+
+  case "$mode" in
+  3)
+    mode_ptr="$host_fqdn"
+    names="$host_fqdn  $UNBOUND_TXT_HOSTNAME"
+    ;;
+
+  4)
+    if [ -z "$ifdashname" ] ; then
+      # race conditions at init can rarely cause a blank device return
+      # the record format is invalid and Unbound won't load the conf file
+      mode_ptr="$host_fqdn"
+      names="$host_fqdn  $UNBOUND_TXT_HOSTNAME"
+    else
+      mode_ptr="$if_fqdn"
+      names="$if_fqdn  $host_fqdn  $UNBOUND_TXT_HOSTNAME"
+    fi
+    ;;
+
+  *)
+    mode_ptr="$UNBOUND_TXT_HOSTNAME"
+    names="$UNBOUND_TXT_HOSTNAME"
+    ;;
+  esac
+
+
+  if [ "$mode" -gt 1 ] ; then
+    {
+      for address in $addresses ; do
+        case $address in
+        fe80:*|169.254.*)
+          echo "  # note link address $address"
+          ;;
+
+        [1-9a-f]*:*[0-9a-f])
+          # GA and ULA IP6 for HOST IN AAA records (ip command is robust)
+          for name in $names ; do
+            echo "  local-data: \"$name. 120 IN AAAA $address\""
+          done
+          echo "  local-data-ptr: \"$address 120 $mode_ptr\""
+          ;;
+
+        [1-9]*.*[0-9])
+          # Old fashioned HOST IN A records
+          for name in $names ; do
+            echo "  local-data: \"$name. 120 IN A $address\""
+          done
+          echo "  local-data-ptr: \"$address 120 $mode_ptr\""
+          ;;
+        esac
+      done
+      echo
+    } >> $UNBOUND_CONFFILE
+
+  elif [ "$mode" -gt 0 ] ; then
+    {
+      for address in $addresses ; do
+        case $address in
+        fe80:*|169.254.*)
+          echo "  # note link address $address"
+          ;;
+
+        "${ulaprefix%%:/*}"*)
+          # Only this networks ULA and only hostname
+          echo "  local-data: \"$UNBOUND_TXT_HOSTNAME. 120 IN AAAA $address\""
+          echo "  local-data-ptr: \"$address 120 $UNBOUND_TXT_HOSTNAME\""
+          ;;
+
+        [1-9]*.*[0-9])
+          echo "  local-data: \"$UNBOUND_TXT_HOSTNAME. 120 IN A $address\""
+          echo "  local-data-ptr: \"$address 120 $UNBOUND_TXT_HOSTNAME\""
+          ;;
+        esac
+      done
+      echo
+    } >> $UNBOUND_CONFFILE
+  fi
+}
+
+##############################################################################
+
 create_access_control() {
   local cfg="$1"
   local subnets subnets4 subnets6
@@ -103,55 +256,101 @@ create_domain_insecure() {
 ##############################################################################
 
 unbound_mkdir() {
-  mkdir -p $UNBOUND_VARDIR
-  touch $UNBOUND_CONFFILE
+  local resolvsym=0
+  local dhcp_origin=$( uci get dhcp.@odhcpd[0].leasefile )
+  local dhcp_dir=$( dirname "$dhcp_origin" )
+  local filestuff
 
 
-  if [ -f /etc/unbound/root.hints ] ; then
-    # Your own local copy of root.hints
-    cp -p /etc/unbound/root.hints $UNBOUND_HINTFILE
+  if [ ! -x /usr/sbin/dnsmasq -o ! -x /etc/init.d/dnsmasq ] ; then
+    resolvsym=1
+  else
+    /etc/init.d/dnsmasq enabled || resolvsym=1
+  fi
 
-  elif [ -f /usr/share/dns/root.hints ] ; then
-    # Debian-like package dns-root-data
-    cp -p /usr/share/dns/root.hints $UNBOUND_HINTFILE
 
-  else
-    logger -t unbound -s "iterator will use built-in root hints"
+  if [ "$resolvsym" -gt 0 ] ; then
+    rm -f /tmp/resolv.conf
+
+
+    {
+      # Set resolver file to local but not if /etc/init.d/dnsmasq will do it.
+      echo "nameserver 127.0.0.1"
+      echo "nameserver ::1"
+      echo "search $UNBOUND_TXT_DOMAIN"
+    } > /tmp/resolv.conf
   fi
 
 
-  if [ -f /etc/unbound/root.key ] ; then
-    # Your own local copy of a root.key
-    cp -p /etc/unbound/root.key $UNBOUND_KEYFILE
+  if [ "$UNBOUND_D_DHCP_LINK" = "odhcpd" -a ! -d "$dhcp_dir" ] ; then
+    # make sure odhcpd has a directory to write (not done itself, yet)
+    mkdir -p "$dhcp_dir"
+  fi
 
-  elif [ -f /usr/share/dns/root.key ] ; then
-    # Debian-like package dns-root-data
-    cp -p /usr/share/dns/root.key $UNBOUND_KEYFILE
 
-  elif [ -x "$UNBOUND_ANCHOR" ] ; then
-    $UNBOUND_ANCHOR -a $UNBOUND_KEYFILE
+  if [ -f $UNBOUND_KEYFILE ] ; then
+    filestuff=$( cat $UNBOUND_KEYFILE )
 
-  else
-    logger -t unbound -s "validator will use built-in trust anchor"
+
+    case "$filestuff" in
+      *"state=2 [  VALID  ]"*)
+        # Lets not lose RFC 5011 tracking if we don't have to
+        cp -p $UNBOUND_KEYFILE $UNBOUND_KEYFILE.keep
+        ;;
+    esac
   fi
-}
 
-##############################################################################
 
-unbound_conf() {
-  local cfg=$1
-  local rt_mem rt_conn
+  # Blind copy /etc/ to /var/lib/
+  mkdir -p $UNBOUND_VARDIR
+  rm -f $UNBOUND_VARDIR/dhcp_*
+  touch $UNBOUND_CONFFILE
+  touch $UNBOUND_SRV_CONF
+  touch $UNBOUND_EXT_CONF
+  cp -p /etc/unbound/* $UNBOUND_VARDIR/
 
-  {
-    # Make fresh conf file
-    echo "# $UNBOUND_CONFFILE generated by UCI $( date )"
-    echo
-  } > $UNBOUND_CONFFILE
 
+  if [ ! -f $UNBOUND_HINTFILE ] ; then
+    if [ -f /usr/share/dns/root.hints ] ; then
+      # Debian-like package dns-root-data
+      cp -p /usr/share/dns/root.hints $UNBOUND_HINTFILE
 
+    elif [ ! -f "$UNBOUND_TIMEFILE" ] ; then
+      logger -t unbound -s "iterator will use built-in root hints"
+    fi
+  fi
+
+
+  if [ ! -f $UNBOUND_KEYFILE ] ; then
+    if [ -f /usr/share/dns/root.key ] ; then
+      # Debian-like package dns-root-data
+      cp -p /usr/share/dns/root.key $UNBOUND_KEYFILE
+
+    elif [ -x $UNBOUND_ANCHOR ] ; then
+      $UNBOUND_ANCHOR -a $UNBOUND_KEYFILE
+
+    elif [ ! -f "$UNBOUND_TIMEFILE" ] ; then
+      logger -t unbound -s "validator will use built-in trust anchor"
+    fi
+  fi
+
+
+  copy_dash_update
+
+
+  # Ensure access and prepare to jail
+  chown -R unbound:unbound $UNBOUND_VARDIR
+  chmod 775 $UNBOUND_VARDIR
+  chmod 664 $UNBOUND_VARDIR/*
+}
+
+##############################################################################
+
+unbound_control() {
   if [ "$UNBOUND_B_CONTROL" -gt 0 ] ; then
     {
       # Enable remote control tool, but only at local host for security
+      # You can hand write fancier encrypted access with /etc/..._ext.conf
       echo "remote-control:"
       echo "  control-enable: yes"
       echo "  control-use-cert: no"
@@ -159,18 +358,32 @@ unbound_conf() {
       echo "  control-interface: ::1"
       echo
     } >> $UNBOUND_CONFFILE
-
-  else
-    {
-      # "control:" clause is seperate before "server:" so we can append
-      # dnsmasq "server:" parts and "forward:" cluases towards the end.
-      echo "remote-control:"
-      echo "  control-enable: no"
-      echo
-    } >> $UNBOUND_CONFFILE
   fi
 
 
+  {
+    # Amend your own extended clauses here like forward zones or disable
+    # above (local, no encryption) and amend your own remote encrypted control
+    echo
+    echo "include: $UNBOUND_EXT_CONF" >> $UNBOUND_CONFFILE
+    echo
+  } >> $UNBOUND_CONFFILE
+}
+
+##############################################################################
+
+unbound_conf() {
+  local cfg="$1"
+  local rt_mem rt_conn modulestring
+
+
+  {
+    # Make fresh conf file
+    echo "# $UNBOUND_CONFFILE generated by UCI $( date )"
+    echo
+  } > $UNBOUND_CONFFILE
+
+
   {
     # No threading
     echo "server:"
@@ -204,6 +417,38 @@ unbound_conf() {
   } >> $UNBOUND_CONFFILE
 
 
+  case "$UNBOUND_D_PROTOCOL" in
+    ip4_only)
+      {
+        echo "  do-ip4: yes"
+        echo "  do-ip6: no"
+      } >> $UNBOUND_CONFFILE
+      ;;
+
+    ip6_only)
+      {
+        echo "  do-ip4: no"
+        echo "  do-ip6: yes"
+      } >> $UNBOUND_CONFFILE
+      ;;
+
+    ip6_prefer)
+      {
+        echo "  do-ip4: yes"
+        echo "  do-ip6: yes"
+        echo "  prefer-ip6: yes"
+      } >> $UNBOUND_CONFFILE
+      ;;
+
+    *)
+      {
+        echo "  do-ip4: yes"
+        echo "  do-ip6: yes"
+      } >> $UNBOUND_CONFFILE
+      ;;
+  esac
+
+
   {
     # protocol level tuning
     echo "  edns-buffer-size: $UNBOUND_N_EDNS_SIZE"
@@ -281,10 +526,13 @@ unbound_conf() {
       echo
     } >> $UNBOUND_CONFFILE
 
-  else
+  elif [ ! -f "$UNBOUND_TIMEFILE" ] ; then
     logger -t unbound -s "default memory resource consumption"
   fi
 
+  # Assembly of module-config: options is tricky; order matters
+  modulestring="iterator"
+
 
   if [ "$UNBOUND_B_DNSSEC" -gt 0 ] ; then
     if [ ! -f "$UNBOUND_TIMEFILE" -a "$UNBOUND_B_NTP_BOOT" -gt 0 ] ; then
@@ -294,24 +542,38 @@ unbound_conf() {
 
 
     {
-      # Validation of DNSSEC
-      echo "  module-config: \"validator iterator\""
       echo "  harden-dnssec-stripped: yes"
       echo "  val-clean-additional: yes"
       echo "  ignore-cd-flag: yes"
-      echo
     } >> $UNBOUND_CONFFILE
 
-  else
-    {
-      # Just iteration without DNSSEC
-      echo "  module-config: \"iterator\""
-      echo
-    } >> $UNBOUND_CONFFILE
+
+    modulestring="validator $modulestring"
+  fi
+
+
+  if [ "$UNBOUND_B_DNS64" -gt 0 ] ; then
+    echo "  dns64-prefix: $UNBOUND_IP_DNS64" >> $UNBOUND_CONFFILE
+
+    modulestring="dns64 $modulestring"
   fi
 
 
-  if [ "$UNBOUND_B_QUERY_MIN" -gt 0 ] ; then
+  {
+    # Print final module string
+    echo "  module-config: \"$modulestring\""
+    echo
+  }  >> $UNBOUND_CONFFILE
+
+
+  if [ "$UNBOUND_B_QRY_MINST" -gt 0 -a "$UNBOUND_B_QUERY_MIN" -gt 0 ] ; then
+    {
+      # Some query privacy but "strict" will break some name servers
+      echo "  qname-minimisation: yes"
+      echo "  qname-minimisation-strict: yes"
+    } >> $UNBOUND_CONFFILE
+
+  elif [ "$UNBOUND_B_QUERY_MIN" -gt 0 ] ; then
     # Minor improvement on query privacy
     echo "  qname-minimisation: yes" >> $UNBOUND_CONFFILE
 
@@ -340,7 +602,9 @@ unbound_conf() {
       ;;
 
     *)
-      logger -t unbound -s "default recursion configuration"
+      if [ ! -f "$UNBOUND_TIMEFILE" ] ; then
+        logger -t unbound -s "default recursion configuration"
+      fi
       ;;
   esac
 
@@ -357,10 +621,23 @@ unbound_conf() {
   } >> $UNBOUND_CONFFILE
 
 
+  if [ "$UNBOUND_B_HIDE_BIND" -gt 0 ] ; then
+    {
+      # Block server id and version DNS TXT records
+      echo "  hide-identity: yes"
+      echo "  hide-version: yes"
+      echo
+    } >> $UNBOUND_CONFFILE
+  fi
+
+
   if [ "$UNBOUND_B_PRIV_BLCK" -gt 0 ] ; then
     {
-      # Remove DNS reponses from upstream with private IP
+      # Remove _upstream_ or global reponses with private addresses.
+      # Unbounds own "local zone" and "forward zone" may still use these.
+      # RFC1918, RFC3927, RFC4291, RFC6598, RFC6890
       echo "  private-address: 10.0.0.0/8"
+      echo "  private-address: 100.64.0.0/10"
       echo "  private-address: 169.254.0.0/16"
       echo "  private-address: 172.16.0.0/12"
       echo "  private-address: 192.168.0.0/16"
@@ -385,14 +662,18 @@ unbound_conf() {
   fi
 
 
-  # Domain Exceptions
+  # Except and accept domains as insecure (DNSSEC); work around broken domains
   config_list_foreach "$cfg" "domain_insecure" create_domain_insecure
   echo >> $UNBOUND_CONFFILE
+}
 
+##############################################################################
 
-  ####################
-  # UCI @ network    #
-  ####################
+unbound_access() {
+  # TODO: Unbound 1.6.0 added "tags" and "views", so we can add tags to
+  # each access-control IP block, and then divert access.
+  # -- "guest" WIFI will not be allowed to see local zone data
+  # -- "child" LAN can black whole a list of domains to http~deadpixel
 
 
   if [ "$UNBOUND_B_LOCL_SERV" -gt 0 ] ; then
@@ -401,6 +682,7 @@ unbound_conf() {
     config_load network
     config_foreach create_access_control interface
 
+
     {
       echo "  access-control: 127.0.0.0/8 allow"
       echo "  access-control: ::1/128 allow"
@@ -415,45 +697,166 @@ unbound_conf() {
       echo
     } >> $UNBOUND_CONFFILE
   fi
+
+
+  {
+    # Amend your own "server:" stuff here
+    echo "  include: $UNBOUND_SRV_CONF"
+    echo
+  } >> $UNBOUND_CONFFILE
+}
+
+##############################################################################
+
+unbound_adblock() {
+  # TODO: Unbound 1.6.0 added "tags" and "views"; lets work with adblock team
+  local adb_enabled adb_file
+
+  if [ ! -x /usr/bin/adblock.sh -o ! -x /etc/init.d/adblock ] ; then
+    adb_enabled=0
+  else
+    /etc/init.d/adblock enabled && adb_enabled=1 || adb_enabled=0
+  fi
+
+
+  if [ "$adb_enabled" -gt 0 ] ; then
+    {
+      # Pull in your selected openwrt/pacakges/net/adblock generated lists
+      for adb_file in $UNBOUND_VARDIR/adb_list.* ; do
+        echo "  include: $adb_file"
+      done
+      echo
+    } >> $UNBOUND_CONFFILE
+  fi
+}
+
+##############################################################################
+
+unbound_hostname() {
+  if [ -n "$UNBOUND_TXT_DOMAIN" ] ; then
+    {
+      # TODO: Unbound 1.6.0 added "tags" and "views" and we could make
+      # domains by interface to prevent DNS from "guest" to "home"
+      echo "  local-zone: $UNBOUND_TXT_DOMAIN. $UNBOUND_D_DOMAIN_TYPE"
+      echo "  domain-insecure: $UNBOUND_TXT_DOMAIN"
+      echo "  private-domain: $UNBOUND_TXT_DOMAIN"
+      echo
+      echo "  local-zone: $UNBOUND_TXT_HOSTNAME. $UNBOUND_D_DOMAIN_TYPE"
+      echo "  domain-insecure: $UNBOUND_TXT_HOSTNAME"
+      echo "  private-domain: $UNBOUND_TXT_HOSTNAME"
+      echo
+    } >> $UNBOUND_CONFFILE
+
+
+    case "$UNBOUND_D_DOMAIN_TYPE" in
+    deny|inform_deny|refuse|static)
+      {
+        # avoid upstream involvement in RFC6762 like responses (link only)
+        echo "  local-zone: local. $UNBOUND_D_DOMAIN_TYPE"
+        echo "  domain-insecure: local"
+        echo "  private-domain: local"
+        echo
+      } >> $UNBOUND_CONFFILE
+      ;;
+    esac
+
+
+    if [ "$UNBOUND_D_LAN_FQDN" -gt 0 -o "$UNBOUND_D_WAN_FQDN" -gt 0 ] ; then
+      config_load dhcp
+      config_foreach create_interface_dns dhcp
+    fi
+
+
+    if [ -f "$UNBOUND_DHCP_CONF" ] ; then
+      {
+        # Seed DHCP records because dhcp scripts trigger externally
+        # Incremental Unbound restarts may drop unbound-control add records
+        echo "  include: $UNBOUND_DHCP_CONF"
+        echo
+      } >> $UNBOUND_CONFFILE
+    fi
+  fi
 }
 
 ##############################################################################
 
 unbound_uci() {
-  local cfg=$1
-  local dnsmasqpath
-
-  ####################
-  # UCI @ unbound    #
-  ####################
-
-  config_get_bool UNBOUND_B_GATE_NAME "$cfg" dnsmsaq_gate_name 0
-  config_get_bool UNBOUND_B_DNSMASQ   "$cfg" dnsmasq_link_dns 0
-  config_get_bool UNBOUND_B_LOCL_NAME "$cfg" dnsmasq_only_local 0
-  config_get_bool UNBOUND_B_LOCL_SERV "$cfg" localservice 1
-  config_get_bool UNBOUND_B_MAN_CONF  "$cfg" manual_conf 0
-  config_get_bool UNBOUND_B_QUERY_MIN "$cfg" query_minimize 0
-  config_get_bool UNBOUND_B_PRIV_BLCK "$cfg" rebind_protection 1
-  config_get_bool UNBOUND_B_LOCL_BLCK "$cfg" rebind_localhost 0
-  config_get_bool UNBOUND_B_CONTROL   "$cfg" unbound_control 0
-  config_get_bool UNBOUND_B_DNSSEC    "$cfg" validator  0
-  config_get_bool UNBOUND_B_NTP_BOOT  "$cfg" validator_ntp 1
+  local cfg="$1"
+  local dnsmasqpath hostnm
+
+  hostnm="$(uci_get system.@system[0].hostname | awk '{print tolower($0)}')"
+  UNBOUND_TXT_HOSTNAME=${hostnm:-thisrouter}
+
+  config_get_bool UNBOUND_B_SLAAC6_MAC "$cfg" dhcp4_slaac6 0
+  config_get_bool UNBOUND_B_DNS64      "$cfg" dns64 0
+  config_get_bool UNBOUND_B_HIDE_BIND  "$cfg" hide_binddata 1
+  config_get_bool UNBOUND_B_LOCL_SERV  "$cfg" localservice 1
+  config_get_bool UNBOUND_B_MAN_CONF   "$cfg" manual_conf 0
+  config_get_bool UNBOUND_B_QUERY_MIN  "$cfg" query_minimize 0
+  config_get_bool UNBOUND_B_QRY_MINST  "$cfg" query_min_strict 0
+  config_get_bool UNBOUND_B_PRIV_BLCK  "$cfg" rebind_protection 1
+  config_get_bool UNBOUND_B_LOCL_BLCK  "$cfg" rebind_localhost 0
+  config_get_bool UNBOUND_B_CONTROL    "$cfg" unbound_control 0
+  config_get_bool UNBOUND_B_DNSSEC     "$cfg" validator 0
+  config_get_bool UNBOUND_B_NTP_BOOT   "$cfg" validator_ntp 1
+
+  config_get UNBOUND_IP_DNS64    "$cfg" dns64_prefix "64:ff9b::/96"
 
   config_get UNBOUND_N_EDNS_SIZE "$cfg" edns_size 1280
   config_get UNBOUND_N_RX_PORT   "$cfg" listen_port 53
-  config_get UNBOUND_D_RECURSION "$cfg" recursion passive
-  config_get UNBOUND_D_RESOURCE  "$cfg" resource small
-  config_get UNBOUND_N_ROOT_AGE  "$cfg" root_age 7
+  config_get UNBOUND_N_ROOT_AGE  "$cfg" root_age 9
+
+  config_get UNBOUND_D_DOMAIN_TYPE "$cfg" domain_type static
+  config_get UNBOUND_D_DHCP_LINK   "$cfg" dhcp_link none
+  config_get UNBOUND_D_LAN_FQDN    "$cfg" add_local_fqdn 0
+  config_get UNBOUND_D_PROTOCOL    "$cfg" protocol mixed
+  config_get UNBOUND_D_RECURSION   "$cfg" recursion passive
+  config_get UNBOUND_D_RESOURCE    "$cfg" resource small
+  config_get UNBOUND_D_WAN_FQDN    "$cfg" add_wan_fqdn 0
+
   config_get UNBOUND_TTL_MIN     "$cfg" ttl_min 120
+  config_get UNBOUND_TXT_DOMAIN  "$cfg" domain lan
 
 
-  if [ "$UNBOUND_B_DNSMASQ" -gt 0 ] ; then
-    dnsmasqpath=$( which dnsmasq )
+  if [ "$UNBOUND_D_DHCP_LINK" = "none" ] ; then
+    config_get_bool UNBOUND_B_DNSMASQ   "$cfg" dnsmasq_link_dns 0
 
 
-    if [ ! -x "$dnsmasqpath" ] ; then
+    if [ "$UNBOUND_B_DNSMASQ" -gt 0 ] ; then
+      UNBOUND_D_DHCP_LINK=dnsmasq
+      
+      
+      if [ ! -f "$UNBOUND_TIMEFILE" ] ; then
+        logger -t unbound -s "Please use 'dhcp_link' selector instead"
+      fi
+    fi
+  fi
+
+
+  if [ "$UNBOUND_D_DHCP_LINK" = "dnsmasq" ] ; then
+    if [ ! -x /usr/sbin/dnsmasq -o ! -x /etc/init.d/dnsmasq ] ; then
+      UNBOUND_D_DHCP_LINK=none
+    else
+      /etc/init.d/dnsmasq enabled || UNBOUND_D_DHCP_LINK=none
+    fi
+
+
+    if [ "$UNBOUND_D_DHCP_LINK" = "none" -a ! -f "$UNBOUND_TIMEFILE" ] ; then
       logger -t unbound -s "cannot forward to dnsmasq"
-      UNBOUND_B_DNSMASQ=0
+    fi
+  fi
+
+
+  if [ "$UNBOUND_D_DHCP_LINK" = "odhcpd" ] ; then
+    if [ ! -x /usr/sbin/odhcpd -o ! -x /etc/init.d/odhcpd ] ; then
+      UNBOUND_D_DHCP_LINK=none
+    else
+      /etc/init.d/odhcpd enabled || UNBOUND_D_DHCP_LINK=none
+    fi
+
+
+    if [ "$UNBOUND_D_DHCP_LINK" = "none" -a ! -f "$UNBOUND_TIMEFILE" ] ; then
+      logger -t unbound -s "cannot receive records from odhcpd"
     fi
   fi
 
@@ -476,56 +879,51 @@ unbound_uci() {
     # that could have had awful side effects
     UNBOUND_TTL_MIN=300
   fi
-
-
-  if [ "$UNBOUND_B_MAN_CONF" -gt 0 ] ; then
-    # Don't want this being triggered. Maybe we could, but then the
-    # base conf you provide would need to be just right.
-    UNBOUND_B_DNSMASQ=0
-
-  else
-    unbound_conf $cfg
-  fi
 }
 
 ##############################################################################
 
-unbound_own () {
-  # Debug UCI
-  {
-    echo "# $UNBOUND_CHECKFILE generated by UCI $( date )"
-    echo
-    set | grep ^UNBOUND_
-  } > $UNBOUND_CHECKFILE
+unbound_start() {
+  config_load unbound
+  config_foreach unbound_uci unbound
+  unbound_mkdir
 
 
-  if [ "$UNBOUND_B_MAN_CONF" -gt 0 ] ; then
-    # You are doing your own thing, so just copy /etc/ to /var/
-    cp -p /etc/unbound/* $UNBOUND_VARDIR/
-  fi
+  if [ "$UNBOUND_B_MAN_CONF" -eq 0 ] ; then
+    unbound_conf
+    unbound_access
+    unbound_adblock
 
+    if [ "$UNBOUND_D_DHCP_LINK" = "dnsmasq" ] ; then
+      dnsmasq_link
+    else
+      unbound_hostname
+    fi
 
-  # Ensure access and prepare to jail
-  chown -R unbound:unbound $UNBOUND_VARDIR
-  chmod 775 $UNBOUND_VARDIR
-  chmod 664 $UNBOUND_VARDIR/*
+    unbound_control
+  fi
 }
 
 ##############################################################################
 
-unbound_prepare() {
-  # Make a home for Unbound in /var/lib/unbound
-  unbound_mkdir
+unbound_stop() {
+  local resolvsym=0
 
-  # Load up the chunks of UCI
-  config_load unbound
-  config_foreach unbound_uci unbound
+  rootzone_update
 
-  # Unbound primary DNS, and dnsmasq side service DHCP-DNS (dnsmasq.sh)
-  dnsmasq_link
 
-  # Unbound needs chroot ownership
-  unbound_own
+  if [ ! -x /usr/sbin/dnsmasq -o ! -x /etc/init.d/dnsmasq ] ; then
+    resolvsym=1
+  else
+    /etc/init.d/dnsmasq enabled || resolvsym=1
+  fi
+
+
+  if [ "$resolvsym" -gt 0 ] ; then
+    # set resolver file to normal, but don't stomp on dnsmasq
+    rm -f /tmp/resolv.conf
+    ln -s /tmp/resolv.conf.auto /tmp/resolv.conf
+  fi
 }
 
 ##############################################################################
index 02854a8384047691f30e93a63f7d36aa05f8574b..9e58ac799bb69c72f17f61d97b828a89057ceea2 100644 (file)
@@ -1,17 +1,25 @@
 config unbound
-       option dnsmsaq_gate_name '0'
-       option dnsmasq_link_dns '0'
-       option dnsmasq_only_local '0'
+       option add_local_fqdn '1'
+       option add_wan_fqdn '0'
+       option dhcp_link 'none'
+       option dhcp4_slaac6 '0'
+       option dns64 '0'
+       option dns64_prefix '64:ff9b::/96'
+       option domain 'lan'
+       option domain_type 'static'
        option edns_size '1280'
+       option hide_binddata '1'
        option listen_port '53'
        option localservice '1'
        option manual_conf '0'
+       option protocol 'mixed'
        option query_minimize '0'
+       option query_min_strict '0'
        option rebind_localhost '0'
        option rebind_protection '1'
        option recursion 'passive'
        option resource 'small'
-       option root_age '28'
+       option root_age '9'
        option ttl_min '120'
        option unbound_control '0'
        option validator '0'
diff --git a/net/unbound/files/unbound_ext.conf b/net/unbound/files/unbound_ext.conf
new file mode 100644 (file)
index 0000000..5a4398b
--- /dev/null
@@ -0,0 +1,8 @@
+##############################################################################
+# UNBOUND UCI USER ADDED CLAUSES
+#
+# Put your own forward:, view:, stub:, and control: clauses here. This file is
+# appended to the end of UCI auto generated 'unbound.conf'. This is done with
+# include: statement. Notice, it is outside of the server: clause.
+##############################################################################
+
diff --git a/net/unbound/files/unbound_srv.conf b/net/unbound/files/unbound_srv.conf
new file mode 100644 (file)
index 0000000..01ba544
--- /dev/null
@@ -0,0 +1,8 @@
+##############################################################################
+# UNBOUND UCI USER ADDED SERVER OPTIONS
+#
+# Put your own choice options here when not covered by UCI. These are all part
+# of the server: clause only. Most likely are hardening options or local-zone:
+# This is in an include: statement towards the end of the server: cluase. 
+##############################################################################
+
index 5f6b4c5e74b1d785edad1acfe92ac06990bce263..8aa0502024aa70fef632b32996e04d7bf431bed9 100644 (file)
@@ -1,12 +1,12 @@
 diff --git a/doc/example.conf.in b/doc/example.conf.in
-index c520c88..98a148a 100644
+index 83e7c5c..3ea2b28 100644
 --- a/doc/example.conf.in
 +++ b/doc/example.conf.in
-@@ -1,20 +1,82 @@
+@@ -1,9 +1,10 @@
 -#
 -# Example configuration file.
 -#
--# See unbound.conf(5) man page, version 1.5.10.
+-# See unbound.conf(5) man page, version 1.6.1.
 -#
 -# this is a comment.
 +##############################################################################
@@ -19,10 +19,9 @@ index c520c88..98a148a 100644
  
  #Use this to include other text into the file.
  #include: "otherfile.conf"
- # The server clause sets the main parameters.
+@@ -12,9 +13,71 @@
  server:
--      # whitespace is not necessary, but looks cleaner.
+       # whitespace is not necessary, but looks cleaner.
  
 -      # verbosity number, 0 is least verbose. 1 is default.
 +      # verbosity 1 is default
@@ -51,7 +50,7 @@ index c520c88..98a148a 100644
 +      access-control: ::0/0 allow
 +
 +      # this limits TCP service but uses less buffers
-+      outgoing-num-tcp: 1 
++      outgoing-num-tcp: 1
 +      incoming-num-tcp: 1
 +
 +      # use somewhat higher port numbers versus possible NAT issue
index da50698818aa5dc9eedd397885d7756733dbceda..e41cf220f21dd81b77e957773440b57075107c42 100644 (file)
@@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=vsftpd
 PKG_VERSION:=3.0.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://security.appspot.com/downloads/
-PKG_MD5SUM:=da119d084bd3f98664636ea05b5bb398
+PKG_HASH:=9d4d2bf6e6e2884852ba4e69e157a2cecd68c5a7635d66a3a8cf8d898c955ef7
 PKG_LICENSE:=GPLv2
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
@@ -24,8 +24,8 @@ define Package/vsftpd/Default
   SUBMENU:=File Transfer
   SECTION:=net
   CATEGORY:=Network
-  TITLE:=A fast and secure FTP server
-  URL:=http://vsftpd.beasts.org/
+  TITLE:=Fast and secure FTP server
+  URL:=https://security.appspot.com/vsftpd.html
   MAINTAINER:=Cezary Jackiewicz <cezary@eko.one.pl>
 endef
 
@@ -45,6 +45,7 @@ endef
 
 define Package/vsftpd/conffiles
 /etc/vsftpd.conf
+/etc/vsftpd
 endef
 
 Package/vsftpd-tls/conffiles=$(Package/vsftpd/conffiles)
@@ -55,6 +56,8 @@ else
   NLSSTRING:=-lcrypt -lnsl
 endif
 
+TARGET_CFLAGS += -D_GNU_SOURCE -include fcntl.h
+
 ifeq ($(BUILD_VARIANT),notls)
  define Build/Compile
        $(SED) 's/-lcrypt -lnsl/$(NLSSTRING)/' $(PKG_BUILD_DIR)/Makefile
@@ -86,6 +89,7 @@ define Package/vsftpd/install
        $(INSTALL_CONF) ./files/$(PKG_NAME).conf $(1)/etc/$(PKG_NAME).conf
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
+       $(INSTALL_DIR) $(1)/etc/vsftpd
 endef
 
 Package/vsftpd-tls/install=$(Package/vsftpd/install)
index 7d46506e9220db9cd343d5d096273d89eeed1650..e06ac35431af47a2e3e3083af01c4eb9af390a9d 100644 (file)
@@ -11,13 +11,13 @@ session_support=NO
 #syslog_enable=YES
 #userlist_enable=YES
 #userlist_deny=NO
-#userlist_file=/etc/vsftpd.users
+#userlist_file=/etc/vsftpd/vsftpd.users
 #xferlog_enable=YES
 #xferlog_file=/var/log/vsftpd.log
 #xferlog_std_format=YES
 ###
 ### TLS/SSL options
-### example key generation: openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/config/vsftpd_privkey.pem -out /etc/config/vsftpd_cert.pem -subj /C="DE"/ST="Saxony"/L="Leipzig"/CN="OpenWrt"
+### example key generation: openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/vsftpd/vsftpd_privkey.pem -out /etc/vsftpd/vsftpd_cert.pem -subj /C="DE"/ST="Saxony"/L="Leipzig"/CN="OpenWrt"
 #ssl_enable=YES
 #allow_anon_ssl=NO
 #force_local_data_ssl=NO
@@ -25,6 +25,6 @@ session_support=NO
 #ssl_tlsv1=YES
 #ssl_sslv2=NO
 #ssl_sslv3=NO
-#rsa_cert_file=/etc/config/vsftpd_cert.pem
-#rsa_private_key_file=/etc/config/vsftpd_privkey.pem
+#rsa_cert_file=/etc/vsftpd/vsftpd_cert.pem
+#rsa_private_key_file=/etc/vsftpd/vsftpd_privkey.pem
 
index fa3acc7e7c60e95f77206cc9f23e162013d6fe9b..8dacfebc0974a6b7c18870e283724159dbe3418a 100644 (file)
@@ -1,5 +1,7 @@
 #
+# Copyright (C) 2016 Jason A. Donenfeld <Jason@zx2c4.com>
 # Copyright (C) 2016 Baptiste Jonglez <openwrt@bitsofnetworks.org>
+# Copyright (C) 2016-2017 Dan Luedtke <mail@danrl.com>
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,20 +11,19 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=wireguard
 
-PKG_VERSION:=0.0.20161129
+PKG_VERSION:=0.0.20170115
 PKG_RELEASE:=1
 
-PKG_SOURCE:=WireGuard-experimental-$(PKG_VERSION).tar.xz
-# This is actually SHA256, but OpenWRT/LEDE will figure it out based on the length
-PKG_MD5SUM:=7bdce3e56aaae91b195b8bbf7afc8d07f68632c997aa702c1ab84745c099d1b7
+PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/
-PKG_BUILD_DIR:=$(BUILD_DIR)/WireGuard-experimental-$(PKG_VERSION)
+PKG_MD5SUM:=7e5f9f4699a2d4ace90d0df5d81bf0f67205ee08c45b95e0acc379bedef5ffe8
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
 
-PKG_USE_MIPS16:=0
+PKG_BUILD_DIR:=$(BUILD_DIR)/WireGuard-$(PKG_VERSION)
 PKG_BUILD_PARALLEL:=1
+PKG_USE_MIPS16:=0
 
 # Wireguard's makefile needs this to know where to build the kernel module
 export KERNELDIR:=$(LINUX_DIR)
@@ -33,7 +34,8 @@ define Package/wireguard/Default
   SECTION:=net
   CATEGORY:=Network
   URL:=https://www.wireguard.io
-  MAINTAINER:=Baptiste Jonglez <openwrt@bitsofnetworks.org>
+  MAINTAINER:=Baptiste Jonglez <openwrt@bitsofnetworks.org>, \
+              Dan Luedtke <mail@danrl.com>
 endef
 
 define Package/wireguard/Default/description
@@ -70,7 +72,7 @@ endef
 define Package/wireguard-tools
   $(call Package/wireguard/Default)
   TITLE:=Wireguard userspace control program (wg)
-  DEPENDS:=+libmnl +resolveip
+  DEPENDS:=+libmnl
 endef
 
 define Package/wireguard-tools/description
@@ -92,9 +94,9 @@ define KernelPackage/wireguard
   CATEGORY:=Kernel modules
   SUBMENU:=Network Support
   TITLE:=Wireguard kernel module
-  DEPENDS:=@IPV6 +kmod-udptunnel4 +kmod-udptunnel6 +kmod-ipt-hashlimit
+  DEPENDS:=+IPV6:kmod-udptunnel6 +kmod-udptunnel4 +kmod-ipt-hashlimit
   FILES:= $(PKG_BUILD_DIR)/src/wireguard.$(LINUX_KMOD_SUFFIX)
-  AUTOLOAD:=$(call AutoLoad,33,wireguard)
+  AUTOLOAD:=$(call AutoProbe,wireguard)
 endef
 
 define KernelPackage/wireguard/description
index 67fd1d1f88399a547781ee9dcfae434ff5dda7cc..2eb30242a664128a595c0b3d9bf5b7308715ce9e 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright 2016 Dan Luedtke <mail@danrl.com>
+# Copyright 2016-2017 Dan Luedtke <mail@danrl.com>
 # Licensed to the public under the Apache License 2.0.
 
 
@@ -83,27 +83,6 @@ proto_wireguard_setup_peer() {
       esac
     done
   fi
-
-  #### FEATURE DISABLED
-  # proto_add_host_dependency() has failed with IPv6 addresses during tests.
-  # Endpoint dependency feature is disabled until the issue is fixed.
-  ####
-  #  # endpoint dependency
-  #  if [ "${endpoint_host}" ]; then
-  #    endpoint_dependency=0
-  #    for ip in $(resolveip -t 10 "${endpoint_host}"); do
-  #      echo "adding host depedency for ${ip} at ${config}"
-  #      proto_add_host_dependency "${config}" "${ip}"
-  #      endpoint_dependency=1
-  #    done
-  #    if [ ${endpoint_dependency} -eq 0 ]; then
-  #      echo "error resolving ${endpoint_host}!"
-  #      sleep 5
-  #      proto_setup_failed "${config}"
-  #      exit 1
-  #    fi
-  #  fi
-  ####
 }
 
 
@@ -121,6 +100,7 @@ proto_wireguard_setup() {
   config_load network
   config_get private_key   "${config}" "private_key"
   config_get listen_port   "${config}" "listen_port"
+  config_get addresses     "${config}" "addresses"
   config_get mtu           "${config}" "mtu"
   config_get preshared_key "${config}" "preshared_key"
 
@@ -161,6 +141,33 @@ proto_wireguard_setup() {
     exit 1
   fi
 
+  # add ip addresses
+  for address in ${addresses}; do
+    case "${address}" in
+      *:*/*)
+        proto_add_ipv6_address "${address%%/*}" "${address##*/}"
+      ;;
+      *.*/*)
+        proto_add_ipv4_address "${address%%/*}" "${address##*/}"
+      ;;
+      *:*)
+        proto_add_ipv6_address "${address%%/*}" "128"
+      ;;
+      *.*)
+        proto_add_ipv4_address "${address%%/*}" "32"
+      ;;
+    esac
+  done
+
+  # endpoint dependency
+  wg show "${config}" endpoints | \
+    sed -E 's/\[?([0-9.:a-f]+)\]?:([0-9]+)/\1 \2/' | \
+    while IFS=$'\t ' read -r key address port; do
+    [ -n "${port}" ] || continue
+    echo "adding host depedency for ${address} at ${config}"
+    proto_add_host_dependency "${config}" "${address}"
+  done
+
   proto_send_update "${config}"
 }
 
index ae5a41be029c2acac42dd7148b7878e1990076cd..50be12e87b23e04f3b82261cc5896c01525cf990 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=xl2tpd
 PKG_VERSION:=devel-20151125
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=LICENSE
diff --git a/net/xl2tpd/patches/200-xl2tpd-control-fix-xl2tpd-hanged-up-in-fopen.patch b/net/xl2tpd/patches/200-xl2tpd-control-fix-xl2tpd-hanged-up-in-fopen.patch
new file mode 100644 (file)
index 0000000..8fa0fd3
--- /dev/null
@@ -0,0 +1,92 @@
+From 97adf987cf230e47a4800c2f0a0940a1d0d98109 Mon Sep 17 00:00:00 2001
+From: wendy2001011 <wendy2001011@163.com>
+Date: Thu, 9 Feb 2017 17:32:14 +0800
+Subject: [PATCH] xl2tpd-control: fix xl2tpd hanged up in "fopen"
+
+This is a fix for xl2tpd hanged up in "fopen" result fifo while working
+on xl2tpd with OpenWrt.
+
+Root cause is as followings,
+1. xl2tpd-control open result fifo    ##fifo readers=1
+2. xl2tpd-control read result fifo
+3. xl2tpd-control close result fifo     ##fifo readers=0
+4. xl2tpd fopen result fifo                 ##xl2tpd is hanged up here to wait readers
+5.  xl2tpd-control unlink result fifo
+
+The fix replaces the order of "unlink" and "close" when cleaning up to
+avoid hang up issue in fopen, and add the retry waiting when reading
+result fifo.
+
+[Yousong Zhou: 2s as the timeout and 10ms as the check interval]
+---
+ xl2tpd-control.c | 23 +++++++++++++++++++++--
+ 1 file changed, 21 insertions(+), 2 deletions(-)
+
+diff --git a/xl2tpd-control.c b/xl2tpd-control.c
+index 9fcab76..b8bf822 100644
+--- a/xl2tpd-control.c
++++ b/xl2tpd-control.c
+@@ -35,6 +35,7 @@
+ #define TUNNEL_REQUIRED 1
+ #define TUNNEL_NOT_REQUIRED 0
++#define TIMEOUT 2000000  //timeout is 2s
+ char result_filename[128];
+ int result_fd = -1;
+@@ -149,9 +150,9 @@ void help()
+ void cleanup(void)
+ {
+     /* cleaning up */
+-    if (result_fd >= 0)
+-          close (result_fd);
+     unlink (result_filename);
++    if (result_fd >= 0)
++        close (result_fd);
+ }
+ int main (int argc, char *argv[])
+@@ -340,6 +341,7 @@ void print_error (int level, const char *fmt, ...)
+     va_end (args);
+ }
++
+ int read_result(int result_fd, char* buf, ssize_t size)
+ {
+     /* read result from result_fd */
+@@ -348,6 +350,11 @@ int read_result(int result_fd, char* buf, ssize_t size)
+      */
+     ssize_t readed = 0;
+     ssize_t len;
++    int write_pipe = 0;
++    struct timeval tvs;
++    struct timeval tve;
++    unsigned long diff;
++    gettimeofday(&tvs, NULL);
+     do
+     {
+@@ -360,8 +367,20 @@ int read_result(int result_fd, char* buf, ssize_t size)
+                 "error: can't read command result: %s\n", strerror (errno));
+             break;
+         } else if (len == 0) {
++            if(!write_pipe) {
++                 gettimeofday(&tve, NULL);
++                 diff = (tve.tv_sec - tvs.tv_sec) * 1000000 + (tve.tv_usec - tvs.tv_usec);
++                 if (diff >= TIMEOUT) {
++                     print_error (DEBUG_LEVEL, "error: read timout\n");
++                     break;
++                 } else {
++                     usleep(10000);
++                     continue;
++                 }
++            }
+             break;
+         } else {
++            write_pipe = 1;
+             readed += len;
+             if ((size - readed) <= 0)
+                 break;
+-- 
+2.6.4
+
diff --git a/net/zerotier/Config.in b/net/zerotier/Config.in
new file mode 100644 (file)
index 0000000..dd6f2ca
--- /dev/null
@@ -0,0 +1,24 @@
+menu "Configuration"
+       depends on PACKAGE_zerotier
+
+config ZEROTIER_ENABLE_DEBUG
+       bool "Build in debug mode"
+       depends on PACKAGE_zerotier
+       default n
+
+config ZEROTIER_USE_MINIUPNPC
+       bool "Build with MiniUPnPc"
+       depends on PACKAGE_zerotier
+       default n
+
+config ZEROTIER_ENABLE_NETWORK_CONTROLLER
+       bool "Build with network controller"
+       depends on PACKAGE_zerotier
+       default n
+
+config ZEROTIER_ENABLE_SELFTEST
+       bool "Build a self test program"
+       depends on PACKAGE_zerotier
+       default n
+
+endmenu
diff --git a/net/zerotier/Makefile b/net/zerotier/Makefile
new file mode 100644 (file)
index 0000000..f838ffc
--- /dev/null
@@ -0,0 +1,87 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=zerotier
+PKG_VERSION:=1.1.14
+PKG_RELEASE:=4
+
+PKG_LICENSE:=GPL-3.0
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/zerotier/ZeroTierOne
+PKG_SOURCE_SUBDIR:=ZeroTierOne-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=ae491c277e6f35d1acbdcbf700e2b834957295ae
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_MD5SUM:=c8c3219c995a59161832d580a194f6280de7a4eef75cebece6f38400b64f003e
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+
+PKG_BUILD_DEPENDS:=uclibcxx
+PKG_BUILD_PARALLEL:=1
+include $(INCLUDE_DIR)/package.mk
+
+define Package/zerotier
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+libpthread +kmod-tun +ip +ZEROTIER_ENABLE_NETWORK_CONTROLLER:libsqlite3 +ZEROTIER_USE_MINIUPNPC:libminiupnpc +ZEROTIER_USE_MINIUPNPC:libnatpmp
+  TITLE:=Create flat virtual Ethernet networks of almost unlimited size
+  URL:=https://www.zerotier.com
+  SUBMENU:=VPN
+  MAINTAINER:=Moritz Warning <moritzwarning@web.de>
+endef
+
+define Package/zerotier/description
+       ZeroTier creates a global provider-independent virtual private cloud network.
+endef
+
+define Package/zerotier/config
+       source "$(SOURCE)/Config.in"
+endef
+
+ifeq ($(CONFIG_ZEROTIER_ENABLE_NETWORK_CONTROLLER),y)
+MAKE_FLAGS += ZT_ENABLE_NETWORK_CONTROLLER=1
+MAKE_FLAGS += LDLIBS+=" -lsqlite3 "
+endif
+
+ifeq ($(CONFIG_ZEROTIER_USE_MINIUPNPC),y)
+MAKE_FLAGS += ZT_USE_MINIUPNPC=1
+endif
+
+ifeq ($(CONFIG_ZEROTIER_ENABLE_DEBUG),y)
+TARGET_CXXFLAGS += -DZT_TRACE -ggdb3
+endif
+
+MAKE_FLAGS += \
+       DEFS="" \
+       LDFLAGS+=" -L$(STAGING_DIR)/usr/lib/uClibc++ -pthread " \
+       LDLIBS+=" -fno-builtin -nodefaultlibs -Wl,-Bstatic -luClibc++ -Wl,-Bdynamic -lpthread -lm -lc -lsupc++ -lc -lgcc -lgcc_eh -lgcc_s -lssp_nonshared " \
+       CXXFLAGS+=" -fno-builtin -nostdinc++ -I$(STAGING_DIR)/usr/include/uClibc++ -DGCC_HASCLASSVISIBILITY -Wall -fPIE -fvisibility=hidden "
+
+define Build/Compile
+       $(call Build/Compile/Default,one)
+ifeq ($(CONFIG_ZEROTIER_ENABLE_SELFTEST),y)
+       $(call Build/Compile/Default,selftest)
+endif
+endef
+
+define Package/zerotier/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/zerotier-one $(1)/usr/bin/
+       $(LN) zerotier-one $(1)/usr/bin/zerotier-cli
+       $(LN) zerotier-one $(1)/usr/bin//zerotier-idtool
+
+ifeq ($(CONFIG_ZEROTIER_ENABLE_SELFTEST),y)
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/zerotier-selftest $(1)/usr/bin/
+endif
+
+       $(INSTALL_DIR) $(1)/etc/init.d/
+       $(INSTALL_BIN) files/zerotier.init $(1)/etc/init.d/zerotier
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) files/zerotier.config $(1)/etc/config/zerotier
+endef
+
+$(eval $(call BuildPackage,zerotier))
+
diff --git a/net/zerotier/files/zerotier.config b/net/zerotier/files/zerotier.config
new file mode 100644 (file)
index 0000000..d9c33de
--- /dev/null
@@ -0,0 +1,7 @@
+
+config zerotier sample_config
+       option enabled 1
+       option interface 'wan' # restart ZT when wan status changed
+       #option port '9993'
+       option secret 'generate' # generate secret on first start
+       list join '8056c2e21c000001' # a public network called Earth
diff --git a/net/zerotier/files/zerotier.init b/net/zerotier/files/zerotier.init
new file mode 100644 (file)
index 0000000..dd18327
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/sh /etc/rc.common
+
+START=90
+
+USE_PROCD=1
+
+LIST_SEP="
+"
+ZT_COMMAND=/usr/bin/zerotier-one
+
+section_enabled() {
+       config_get_bool enabled "$1" 'enabled' 0
+       [ $enabled -gt 0 ]
+}
+
+start_instance() {
+       local cfg="$1"
+       local port secret interface
+       local ARGS=""
+
+       section_enabled "$cfg" || return 1
+
+       mkdir -p /var/lib/zerotier-one/networks.d/
+
+       config_get_bool port $cfg 'port'
+       config_get secret $cfg 'secret'
+       config_get interface $cfg 'interface'
+
+       if [ -n "$port" ]; then
+               ARGS="$ARGS -p$port"
+       fi
+
+       if [ "$secret" = "generate" ]; then
+               echo "Generate secret - please wait..."
+               local tmp="/tmp/zt.$cfg.secret"
+               zerotier-idtool generate "$tmp" > /dev/null
+               secret="$(cat $tmp)"
+               rm "$tmp"
+
+               uci set zerotier.$cfg.secret="$secret"
+               uci commit zerotier
+       fi
+
+       if [ -n "$secret" ]; then
+               echo "$secret" > /var/lib/zerotier-one/identity.secret
+               #make sure there is not previous dentity.public
+               rm -f /var/lib/zerotier-one/identity.public
+       fi
+
+       add_join() {
+               #an (empty) config file will cause ZT to join a network
+               touch /var/lib/zerotier-one/networks.d/$1.conf
+       }
+
+       config_list_foreach $cfg 'join' add_join
+
+       procd_open_instance
+       procd_add_reload_interface_trigger "$interface"
+       procd_set_param command $ZT_COMMAND $ARGS
+       procd_set_param nice -10
+       procd_close_instance
+}
+
+service_triggers() {
+       procd_add_reload_trigger zerotier
+}
+
+start_service() {
+       config_load 'zerotier'
+       config_foreach start_instance 'zerotier'
+}
diff --git a/net/zerotier/patches/0001-Fix-for-running-under-MUSL-libc-e.g.-Alpine-Linux.patch b/net/zerotier/patches/0001-Fix-for-running-under-MUSL-libc-e.g.-Alpine-Linux.patch
new file mode 100644 (file)
index 0000000..119491f
--- /dev/null
@@ -0,0 +1,44 @@
+From 830250759cd4c14ca2ae5ddf24f0a0427f258622 Mon Sep 17 00:00:00 2001
+From: Adam Ierymenko <adam.ierymenko@gmail.com>
+Date: Tue, 26 Jul 2016 16:36:20 -0700
+Subject: [PATCH 1/2] Fix for running under MUSL libc (e.g. Alpine Linux)
+
+---
+ osdep/Thread.hpp | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/osdep/Thread.hpp b/osdep/Thread.hpp
+index 7fb38d8..4f90dc0 100644
+--- a/osdep/Thread.hpp
++++ b/osdep/Thread.hpp
+@@ -125,6 +125,10 @@ public:
+               throw()\r
+       {\r
+               memset(&_tid,0,sizeof(_tid));\r
++              pthread_attr_init(&_tattr);\r
++#ifdef __LINUX__\r
++              pthread_attr_setstacksize(&_tattr,8388608); // for MUSL libc and others, has no effect in normal glibc environments\r
++#endif\r
+               _started = false;\r
+       }\r
\r
+@@ -157,7 +161,7 @@ public:
+       {\r
+               Thread t;\r
+               t._started = true;\r
+-              if (pthread_create(&t._tid,(const pthread_attr_t *)0,&___zt_threadMain<C>,instance))\r
++              if (pthread_create(&t._tid,&t._tattr,&___zt_threadMain<C>,instance))\r
+                       throw std::runtime_error("pthread_create() failed, unable to create thread");\r
+               return t;\r
+       }\r
+@@ -184,6 +188,7 @@ public:
\r
+ private:\r
+       pthread_t _tid;\r
++      pthread_attr_t _tattr;\r
+       volatile bool _started;\r
+ };\r
\r
+-- 
+2.9.0
+
diff --git a/net/zerotier/patches/0002-fix-build.patch b/net/zerotier/patches/0002-fix-build.patch
new file mode 100644 (file)
index 0000000..34088c8
--- /dev/null
@@ -0,0 +1,51 @@
+From 333bbabc6dfad0553fb63d560ab6442a50cc9e52 Mon Sep 17 00:00:00 2001
+From: Moritz Warning <moritzwarning@web.de>
+Date: Fri, 22 Jul 2016 23:27:31 +0200
+Subject: [PATCH 2/2] fix build
+
+---
+ make-linux.mk | 30 +++++++++++++++---------------
+ 1 file changed, 15 insertions(+), 15 deletions(-)
+
+--- a/make-linux.mk
++++ b/make-linux.mk
+@@ -39,24 +39,24 @@ include objects.mk
+ # On Linux we auto-detect the presence of some libraries and if present we
+ # link against the system version. This works with our package build images.
+-ifeq ($(wildcard /usr/include/lz4.h),)
++#ifeq ($(wildcard $(STAGING_DIR)/usr/include/lz4.h),)
+       OBJS+=ext/lz4/lz4.o
+-else
+-      LDLIBS+=-llz4
+-      DEFS+=-DZT_USE_SYSTEM_LZ4
+-endif
+-ifeq ($(wildcard /usr/include/http_parser.h),)
++#else
++#     LDLIBS+=-llz4
++#     DEFS+=-DZT_USE_SYSTEM_LZ4
++#endif
++#ifeq ($(wildcard $(STAGING_DIR)/usr/include/http_parser.h),)
+       OBJS+=ext/http-parser/http_parser.o
+-else
+-      LDLIBS+=-lhttp_parser
+-      DEFS+=-DZT_USE_SYSTEM_HTTP_PARSER
+-endif
+-ifeq ($(wildcard /usr/include/json-parser/json.h),)
++#else
++#     LDLIBS+=-lhttp_parser
++#     DEFS+=-DZT_USE_SYSTEM_HTTP_PARSER
++#endif
++#ifeq ($(wildcard $(STAGING_DIR)/usr/include/json-parser/json.h),)
+       OBJS+=ext/json-parser/json.o
+-else
+-      LDLIBS+=-ljsonparser
+-      DEFS+=-DZT_USE_SYSTEM_JSON_PARSER
+-endif
++#else
++#     LDLIBS+=-ljsonparser
++#     DEFS+=-DZT_USE_SYSTEM_JSON_PARSER
++#endif
+ ifeq ($(ZT_USE_MINIUPNPC),1)
+       OBJS+=osdep/PortMapper.o
diff --git a/net/zerotier/patches/0003-workaround_to_avoid_seg_faults.patch b/net/zerotier/patches/0003-workaround_to_avoid_seg_faults.patch
new file mode 100644 (file)
index 0000000..e27f872
--- /dev/null
@@ -0,0 +1,27 @@
+From 21f4958bd48cae59b478b1b3445e00fa4fb18991 Mon Sep 17 00:00:00 2001
+From: muebau <muebau@gmail.com>
+Date: Fri, 5 Aug 2016 19:22:45 +0200
+Subject: [PATCH] OpenWRT workaround to avoid seg faults
+
+---
+ service/OneService.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/service/OneService.cpp b/service/OneService.cpp
+index 13820f5..9ba3238 100644
+--- a/service/OneService.cpp
++++ b/service/OneService.cpp
+@@ -862,8 +862,8 @@ public:
+                       }
+                       // Start two background threads to handle expensive ops out of line
+-                      Thread::start(_node);
+-                      Thread::start(_node);
++                      //Thread::start(_node);
++                      //Thread::start(_node);
+                       _nextBackgroundTaskDeadline = 0;
+                       uint64_t clockShouldBe = OSUtils::now();
+-- 
+2.7.4
+
diff --git a/net/zerotier/patches/0005-use-external-miniupnpc-and-natpmp.patch b/net/zerotier/patches/0005-use-external-miniupnpc-and-natpmp.patch
new file mode 100644 (file)
index 0000000..377abef
--- /dev/null
@@ -0,0 +1,32 @@
+--- a/make-linux.mk
++++ b/make-linux.mk
+@@ -64,7 +64,8 @@ ifeq ($(ZT_USE_MINIUPNPC),1)
+       DEFS+=-DZT_USE_MINIUPNPC
+       # Auto-detect libminiupnpc at least v2.0
+-      MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2.."' /usr/include/miniupnpc/miniupnpc.h && echo 1)
++      #MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2.."' $(STAGING_DIR)/usr/include/miniupnpc/miniupnpc.h && echo 1)
++      MINIUPNPC_IS_NEW_ENOUGH=1
+       ifeq ($(MINIUPNPC_IS_NEW_ENOUGH),1)
+               DEFS+=-DZT_USE_SYSTEM_MINIUPNPC
+               LDLIBS+=-lminiupnpc
+@@ -74,7 +75,7 @@ ifeq ($(ZT_USE_MINIUPNPC),1)
+       endif
+       # Auto-detect libnatpmp
+-      ifeq ($(wildcard /usr/include/natpmp.h),)
++      ifeq ($(wildcard $(STAGING_DIR)/usr/include/natpmp.h),)
+               OBJS+=ext/libnatpmp/natpmp.o ext/libnatpmp/getgateway.o
+       else
+               LDLIBS+=-lnatpmp
+--- a/osdep/PortMapper.cpp
++++ b/osdep/PortMapper.cpp
+@@ -180,7 +180,7 @@ public:
+                               struct IGDdatas data;
+                               int upnpError = 0;
+-                              UPNPDev *devlist = upnpDiscoverAll(5000,(const char *)0,(const char *)0,0,0,2,&upnpError);
++                              UPNPDev *devlist = upnpDiscoverAll(5000,(const char *)0,(const char *)0,0,0,&upnpError);
+                               if (devlist) {
+ #ifdef ZT_PORTMAPPER_TRACE
index 0c446fc7baab43a7b1b4990116ca50a9b20571fd..93f9c6faf89fe41554522b28c945646b0a52282d 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2011-2015 OpenWrt.org
+# Copyright (C) 2011-2017 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:=moc
-PKG_VERSION:=2.5.0
-PKG_RELEASE:=2
+PKG_VERSION:=2.5.2
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://ftp.daper.net/pub/soft/moc/stable/
-PKG_MD5SUM:=18e3a979b67091bfee4b62217908c473
+PKG_MD5SUM:=f3a68115602a4788b7cfa9bbe9397a9d5e24c68cb61a57695d1c2c3ecf49db08
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
index 7fb48a9cdf18437357f7ae07734eeda561b30b88..e92ae64cb6f224bf7260996ce249226f4faf016f 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2015 OpenWrt.org
+# Copyright (C) 2015-2017 Ted Hess <thess@kitschensync.net>
 #
 # 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:=pianod
-PKG_VERSION:=174
-PKG_RELEASE:=2
+PKG_VERSION:=174.05
+PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://deviousfish.com/Downloads/pianod/
-PKG_MD5SUM:=cca2143e4a5301dea8c0cb9fcbd20881
+PKG_SOURCE_URL:=https://github.com/thess/pianod-sc/releases/download/$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MD5SUM:=0bae19b0c1e309343bc1b351e521173fe439431542a949dd2bacf4165cce5200
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
@@ -28,10 +28,10 @@ include $(INCLUDE_DIR)/package.mk
 define Package/pianod
   SECTION:=sound
   CATEGORY:=Sound
-  DEPENDS:=+libao +libfaad2 +libmad +libpolarssl +libjson-c +libgcrypt +libpthread
+  DEPENDS:=+libao +libfaad2 +libmad +libmbedtls +libjson-c +libgcrypt +libpthread
   TITLE:=Pandora radio daemon
   USERID:=pianod=88:pianod=88
-  URL:=http://deviousfish.com/pianod/
+  URL:=http://deviousfish.com/pianod1/
 endef
 
 define Package/pianod/description
@@ -39,7 +39,7 @@ define Package/pianod/description
   A simple protocol makes for easy clients, mix scripting, integration with a
   home automation system, use as multiple-user music system for home or office.
   Documentation and configuration information can be found at:
-      http://deviousfish.com/pianod/
+      http://deviousfish.com/pianod1/
 endef
 
 define Package/pianod-client
@@ -47,7 +47,7 @@ define Package/pianod-client
   CATEGORY:=Sound
   DEPENDS:=+pianod
   TITLE:=Pandora radio daemon WebUI
-  URL:=http://deviousfish.com/pianod/
+  URL:=http://deviousfish.com/pianod1/
 endef
 
 define Package/pianod-client/description
@@ -58,12 +58,12 @@ define Package/pianod-client/description
                  http://pianod-host:4446/pianod/viewer.html?server=pianod-host:4446
 endef
 
-CONFIGURE_ARGS+= --with-polarssl
+CONFIGURE_ARGS+= --with-mbedtls
 
 PIANOD_CLIENT:=pianod-client-compiled-51.tar.gz
 
 define Download/pianod-client
-  URL:=$(PKG_SOURCE_URL)
+  URL:=http://deviousfish.com/Downloads/pianod/
   FILE:=$(PIANOD_CLIENT)
   MD5SUM:=abbdee5627bcee6a00c8304da8b4e2e7
 endef
diff --git a/sound/pianod/patches/005-Remove_svn_version_query.patch b/sound/pianod/patches/005-Remove_svn_version_query.patch
deleted file mode 100644 (file)
index 0ffd3a6..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -3,7 +3,7 @@
- AC_PREREQ([2.69])
- AC_INIT([pianod],
--      m4_esyscmd([svn info http://svn.deviousfish.com/pianod | grep Revision: | awk '{print $2}' | tr -d '\n']),
-+      174-OpenWrt,
-       [pianod@lists.deviousfish.com],
-       ,[http://deviousfish.com/pianod])
- AM_INIT_AUTOMAKE([foreign -Wall -Werror])
diff --git a/sound/pianod/patches/010-Configure_add_SSL_options.patch b/sound/pianod/patches/010-Configure_add_SSL_options.patch
deleted file mode 100644 (file)
index 2c26779..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -31,8 +31,6 @@ AC_CHECK_LIB([pthread], [pthread_create]
- # with it, but don't consider it an error.
- # PKG_CHECK_MODULES only validates that pkg-config returns stuff; it doesn't
- # validate that these are correct, so check lib to make sure they're right.
--PKG_CHECK_MODULES([gnutls], [gnutls],,
--      [AC_MSG_WARN([No pkg-config for libgnutls])])
- PKG_CHECK_MODULES([ao], [ao],,
-       [AC_MSG_WARN([No pkg-config for libao])])
- PKG_CHECK_MODULES([mad], [mad],,
-@@ -42,12 +40,28 @@ PKG_CHECK_MODULES([json], [json-c],,
-               [PKG_CHECK_MODULES([json], [json0],,
-                       [AC_MSG_WARN([No pkg-config for json-c (aka libjson0, libjson)])])])])
-+
- # Network communication stuff:
- AC_CHECK_LIB([gcrypt], [gcry_cipher_open],,
-       [AC_MSG_ERROR([Cannot find required library: libgcrypt],1)])
--AC_CHECK_LIB([gnutls], [gnutls_record_recv],,
-+# Check for SSL option
-+AC_ARG_WITH(polarssl, [  --with-polarssl      Build waitress with PolarSSL (default GNUTLS)], [
-+  AC_MSG_RESULT(>>Using PolarSSL)
-+  HAS_POLARSSL=1
-+  AC_DEFINE([USE_POLARSSL], 1, [Build for PolarSSL])
-+  PKG_CHECK_MODULES([polarssl], [polarssl],,
-+              [AC_MSG_WARN([No pkg-config for libpolarssl])])
-+  AC_CHECK_LIB([polarssl], [ssl_set_session],,
-+              [AC_MSG_ERROR([Cannot find required library: libpolarssl (aka polarssl)],1)])] )
-+AM_CONDITIONAL([USE_POLARSSL],[test "x$HAS_POLARSSL" = "x1"])
-+
-+if test "x$HAS_POLARSSL" != x1 ; then
-+  PKG_CHECK_MODULES([gnutls], [gnutls],,
-+      [AC_MSG_WARN([No pkg-config for libgnutls])])
-+  AC_CHECK_LIB([gnutls], [gnutls_record_recv],,
-       [AC_MSG_ERROR([Cannot find required library: libgnutls (aka gnutls)],1)])
--AC_CHECK_FUNCS(gnutls_transport_set_int2 gnutls_sec_param_to_pk_bits)
-+  AC_CHECK_FUNCS(gnutls_transport_set_int2 gnutls_sec_param_to_pk_bits)
-+fi
- # Bloody json library may be linked via -ljson, or -ljson-c depending on
- # the platform.  Try both.
diff --git a/sound/pianod/patches/020-Use_package_config_h_for_all_modules.patch b/sound/pianod/patches/020-Use_package_config_h_for_all_modules.patch
deleted file mode 100644 (file)
index 25569cc..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
---- a/src/libpiano/config.h
-+++ /dev/null
-@@ -1 +0,0 @@
--#define PACKAGE "libpiano"
---- a/src/libwaitress/config.h
-+++ /dev/null
-@@ -1 +0,0 @@
--#define PACKAGE "libwaitress"
---- a/src/libpiano/piano.h
-+++ b/src/libpiano/piano.h
-@@ -39,6 +39,8 @@ THE SOFTWARE.
-  * http://pan-do-ra-api.wikia.com
-  */
-+#define LIBPIANO_NAME "libpiano"
-+
- #define PIANO_RPC_HOST "tuner.pandora.com"
- #define PIANO_RPC_PATH "/services/json/?"
---- a/src/libwaitress/waitress.c
-+++ b/src/libwaitress/waitress.c
-@@ -922,14 +922,14 @@ static WaitressReturn_t WaitressSendRequ
-       if (WaitressProxyEnabled (waith) && !waith->url.tls) {
-               snprintf (buf, WAITRESS_BUFFER_SIZE,
-                       "%s http://%s:%s/%s HTTP/" WAITRESS_HTTP_VERSION "\r\n"
--                      "Host: %s\r\nUser-Agent: " PACKAGE "\r\nConnection: Close\r\n",
-+                      "Host: %s\r\nUser-Agent: " LIBWAITRESS_NAME "\r\nConnection: Close\r\n",
-                       (waith->method == WAITRESS_METHOD_GET ? "GET" : "POST"),
-                       waith->url.host,
-                       WaitressDefaultPort (&waith->url), path, waith->url.host);
-       } else {
-               snprintf (buf, WAITRESS_BUFFER_SIZE,
-                       "%s /%s HTTP/" WAITRESS_HTTP_VERSION "\r\n"
--                      "Host: %s\r\nUser-Agent: " PACKAGE "\r\nConnection: Close\r\n",
-+                      "Host: %s\r\nUser-Agent: " LIBWAITRESS_NAME "\r\nConnection: Close\r\n",
-                       (waith->method == WAITRESS_METHOD_GET ? "GET" : "POST"),
-                       path, waith->url.host);
-       }
---- a/src/libwaitress/waitress.h
-+++ b/src/libwaitress/waitress.h
-@@ -29,6 +29,8 @@ THE SOFTWARE.
- #include <stdbool.h>
- #include <gnutls/gnutls.h>
-+#define LIBWAITRESS_NAME "libwaitress"
-+
- #define WAITRESS_BUFFER_SIZE 10*1024
- typedef enum {
---- a/src/libpiano/request.c
-+++ b/src/libpiano/request.c
-@@ -40,6 +40,7 @@ THE SOFTWARE.
- #include <stdio.h>
- #include <string.h>
- /* needed for urlencode */
-+#include <config.h>
- #include <waitress.h>
- #include "piano.h"
diff --git a/sound/pianod/patches/030-Waitress_add_polarssl_variant.patch b/sound/pianod/patches/030-Waitress_add_polarssl_variant.patch
deleted file mode 100644 (file)
index ad27e9b..0000000
+++ /dev/null
@@ -1,333 +0,0 @@
---- a/src/libwaitress/waitress.h
-+++ b/src/libwaitress/waitress.h
-@@ -27,7 +27,12 @@ THE SOFTWARE.
- #include <stdlib.h>
- #include <unistd.h>
- #include <stdbool.h>
-+
-+#if defined(USE_POLARSSL)
-+typedef struct _polarssl_ctx polarssl_ctx;
-+#else
- #include <gnutls/gnutls.h>
-+#endif
- #define LIBWAITRESS_NAME "libwaitress"
-@@ -102,8 +107,9 @@ typedef struct {
-       WaitressUrl_t url;
-       WaitressUrl_t proxy;
-+#if !defined(USE_POLARSSL)
-       gnutls_certificate_credentials_t tlsCred;
--
-+#endif
-       /* per-request data */
-       struct {
-               int sockfd;
-@@ -121,7 +127,11 @@ typedef struct {
-               WaitressReturn_t (*read) (void *, char *, const size_t, size_t *);
-               WaitressReturn_t (*write) (void *, const char *, const size_t);
-+#if defined(USE_POLARSSL)
-+              polarssl_ctx* sslCtx;
-+#else
-               gnutls_session_t tlsSession;
-+#endif
-       } request;
- } WaitressHandle_t;
---- a/src/pianod.c
-+++ b/src/pianod.c
-@@ -531,8 +531,11 @@ static bool initialize_libraries (APPSTA
-       gcry_check_version (NULL);
-       gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
-       gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
-+
-+#if !defined(USE_POLARSSL)
-       int crystatus = gnutls_global_init ();
-       if (crystatus == GNUTLS_E_SUCCESS) {
-+#endif
-               PianoReturn_t status = PianoInit (&app->ph, app->settings.partnerUser, app->settings.partnerPassword,
-                                                                                 app->settings.device, app->settings.inkey, app->settings.outkey);
-               if (status == PIANO_RET_OK) {
-@@ -545,11 +548,13 @@ static bool initialize_libraries (APPSTA
-               } else {
-                       flog (LOG_ERROR, "initialize_libraries: PianoInit: %s", PianoErrorToStr (status));
-               }
-+#if !defined(USE_POLARSSL)
-               gnutls_global_deinit ();
-       } else {
-               flog (LOG_ERROR, "initialize_libraries: gnutls_global_init: %s", gcry_strerror (crystatus));
-       }
-+#endif
-       return false;
- }
-@@ -728,7 +733,9 @@ int main (int argc, char **argv) {
-               PianoDestroyPlaylist (app.song_history);
-               PianoDestroyPlaylist (app.playlist);
-               WaitressFree (&app.waith);
-+#if !defined(USE_POLARSSL)
-               gnutls_global_deinit ();
-+#endif
-               settings_destroy (&app.settings);
-       }
-       
---- a/src/libwaitress/waitress.c
-+++ b/src/libwaitress/waitress.c
-@@ -41,11 +41,33 @@ THE SOFTWARE.
- #include <assert.h>
- #include <stdint.h>
--#include <gnutls/x509.h>
- #include "config.h"
- #include "waitress.h"
-+#if defined(USE_POLARSSL)
-+
-+#include <polarssl/ssl.h>
-+#include <polarssl/entropy.h>
-+#include <polarssl/ctr_drbg.h>
-+#include <polarssl/x509.h>
-+#include <polarssl/sha1.h>
-+
-+struct _polarssl_ctx
-+{
-+      ssl_context             ssl;
-+      ssl_session             session;
-+      entropy_context         entrophy;
-+      ctr_drbg_context        rnd;
-+};
-+
-+#else
-+
-+// Use gnutls by default (USE_POLARSSL not defined)
-+#include <gnutls/x509.h>
-+
-+#endif
-+
- #define strcaseeq(a,b) (strcasecmp(a,b) == 0)
- #define WAITRESS_HTTP_VERSION "1.1"
-@@ -56,6 +78,13 @@ typedef struct {
- static WaitressReturn_t WaitressReceiveHeaders (WaitressHandle_t *, size_t *);
-+// gnutls wants (void *) and polarssl want (unsigned char *)
-+#if defined(USE_POLARSSL)
-+#define BUFFER_CAST unsigned char
-+#else
-+#define BUFFER_CAST void
-+#endif
-+
- #define READ_RET(buf, count, size) \
-               if ((wRet = waith->request.read (waith, buf, count, size)) != \
-                               WAITRESS_RET_OK) { \
-@@ -444,7 +473,7 @@ static int WaitressPollLoop (int fd, sho
-  *    @param write count bytes
-  *    @return number of written bytes or -1 on error
-  */
--static ssize_t WaitressPollWrite (void *data, const void *buf, size_t count) {
-+static ssize_t WaitressPollWrite (void *data, const BUFFER_CAST *buf, size_t count) {
-       int pollres = -1;
-       ssize_t retSize;
-       WaitressHandle_t *waith = data;
-@@ -478,13 +507,20 @@ static WaitressReturn_t WaitressOrdinary
-       return waith->request.readWriteRet;
- }
--static WaitressReturn_t WaitressGnutlsWrite (void *data, const char *buf,
-+static WaitressReturn_t WaitressTlsWrite (void *data, const char *buf,
-               const size_t size) {
-       WaitressHandle_t *waith = data;
-+#if defined(USE_POLARSSL)
-+
-+      if (ssl_write (&waith->request.sslCtx->ssl, buf, size) < 0) {
-+              return WAITRESS_RET_TLS_WRITE_ERR;
-+      }
-+#else
-       if (gnutls_record_send (waith->request.tlsSession, buf, size) < 0) {
-               return WAITRESS_RET_TLS_WRITE_ERR;
-       }
-+#endif
-       return waith->request.readWriteRet;
- }
-@@ -494,7 +530,7 @@ static WaitressReturn_t WaitressGnutlsWr
-  *    @param buffer size
-  *    @return number of read bytes or -1 on error
-  */
--static ssize_t WaitressPollRead (void *data, void *buf, size_t count) {
-+static ssize_t WaitressPollRead (void *data, BUFFER_CAST *buf, size_t count) {
-       int pollres = -1;
-       ssize_t retSize;
-       WaitressHandle_t *waith = data;
-@@ -531,16 +567,34 @@ static WaitressReturn_t WaitressOrdinary
-       return waith->request.readWriteRet;
- }
--static WaitressReturn_t WaitressGnutlsRead (void *data, char *buf,
-+static WaitressReturn_t WaitressTlsRead (void *data, char *buf,
-               const size_t size, size_t *retSize) {
-       WaitressHandle_t *waith = data;
-+#if defined(USE_POLARSSL)
-+      int ret;
-+
-+      *retSize = 0;
-+      waith->request.readWriteRet = WAITRESS_RET_OK;
-+      ret = ssl_read (&waith->request.sslCtx->ssl, buf, size);
-+
-+      if (ret < 0) {
-+              if (ret != POLARSSL_ERR_SSL_PEER_CLOSE_NOTIFY) {
-+                      waith->request.readWriteRet = WAITRESS_RET_TLS_READ_ERR;
-+              }
-+
-+              return waith->request.readWriteRet;
-+      }
-+
-+      *retSize = ret;
-+#else
-       ssize_t ret = gnutls_record_recv (waith->request.tlsSession, buf, size);
-       if (ret < 0) {
-               return WAITRESS_RET_TLS_READ_ERR;
-       } else {
-               *retSize = ret;
-       }
-+#endif
-       return waith->request.readWriteRet;
- }
-@@ -727,10 +781,28 @@ static int WaitressParseStatusline (cons
- /*    verify server certificate
-  */
- static WaitressReturn_t WaitressTlsVerify (const WaitressHandle_t *waith) {
-+
-+#if defined(USE_POLARSSL)
-+      unsigned char fingerprint[20];
-+
-+      const x509_crt* cert = ssl_get_peer_cert (&waith->request.sslCtx->ssl);
-+
-+      if (NULL == cert) {
-+              return WAITRESS_RET_TLS_HANDSHAKE_ERR;
-+      }
-+
-+      sha1 (cert->raw.p, cert->raw.len, fingerprint);
-+
-+      if (memcmp (fingerprint, waith->tlsFingerprint, sizeof (fingerprint)) != 0) {
-+              return WAITRESS_RET_TLS_FINGERPRINT_MISMATCH;
-+      }
-+
-+#else
-       gnutls_session_t session = waith->request.tlsSession;
-       unsigned int certListSize;
-       const gnutls_datum_t *certList;
-       gnutls_x509_crt_t cert;
-+      char fingerprint[20];
-       if (gnutls_certificate_type_get (session) != GNUTLS_CRT_X509) {
-               return WAITRESS_RET_TLS_HANDSHAKE_ERR;
-@@ -750,7 +822,6 @@ static WaitressReturn_t WaitressTlsVerif
-               return WAITRESS_RET_TLS_HANDSHAKE_ERR;
-       }
--      char fingerprint[20];
-       size_t fingerprintSize = sizeof (fingerprint);
-       if (gnutls_x509_crt_get_fingerprint (cert, GNUTLS_DIG_SHA1, fingerprint,
-                       &fingerprintSize) != 0) {
-@@ -763,7 +834,7 @@ static WaitressReturn_t WaitressTlsVerif
-       }
-       gnutls_x509_crt_deinit (cert);
--
-+#endif
-       return WAITRESS_RET_OK;
- }
-@@ -880,6 +951,12 @@ static WaitressReturn_t WaitressConnect
-                       }
-               }
-+#if defined(USE_POLARSSL)
-+              ssl_set_hostname (&waith->request.sslCtx->ssl, waith->url.host);
-+              if (ssl_handshake (&waith->request.sslCtx->ssl) != 0) {
-+                      return WAITRESS_RET_TLS_HANDSHAKE_ERR;
-+              }
-+#else
-               /* Ignore return code as connection will likely still succeed */
-               gnutls_server_name_set (waith->request.tlsSession, GNUTLS_NAME_DNS,
-                               waith->url.host, strlen (waith->url.host));
-@@ -887,14 +964,15 @@ static WaitressReturn_t WaitressConnect
-               if (gnutls_handshake (waith->request.tlsSession) != GNUTLS_E_SUCCESS) {
-                       return WAITRESS_RET_TLS_HANDSHAKE_ERR;
-               }
-+#endif
-               if ((wRet = WaitressTlsVerify (waith)) != WAITRESS_RET_OK) {
-                       return wRet;
-               }
-               /* now we can talk encrypted */
--              waith->request.read = WaitressGnutlsRead;
--              waith->request.write = WaitressGnutlsWrite;
-+              waith->request.read = WaitressTlsRead;
-+              waith->request.write = WaitressTlsWrite;
-       }
-       return WAITRESS_RET_OK;
-@@ -1120,6 +1198,21 @@ WaitressReturn_t WaitressFetchCall (Wait
-       waith->request.contentLengthKnown = false;
-       if (waith->url.tls) {
-+#if defined(USE_POLARSSL)
-+              waith->request.sslCtx = calloc (1, sizeof(polarssl_ctx));
-+
-+              entropy_init (&waith->request.sslCtx->entrophy);
-+              ctr_drbg_init (&waith->request.sslCtx->rnd, entropy_func, &waith->request.sslCtx->entrophy, "libwaitress", 11);
-+              ssl_init (&waith->request.sslCtx->ssl);
-+
-+              ssl_set_endpoint (&waith->request.sslCtx->ssl, SSL_IS_CLIENT);
-+              ssl_set_authmode (&waith->request.sslCtx->ssl, SSL_VERIFY_NONE);
-+              ssl_set_rng (&waith->request.sslCtx->ssl, ctr_drbg_random, &waith->request.sslCtx->rnd);
-+              ssl_set_session (&waith->request.sslCtx->ssl, &waith->request.sslCtx->session);
-+              ssl_set_bio (&waith->request.sslCtx->ssl,
-+                           WaitressPollRead, waith,
-+                           WaitressPollWrite, waith);
-+#else
-               gnutls_init (&waith->request.tlsSession, GNUTLS_CLIENT);
-               gnutls_set_default_priority (waith->request.tlsSession);
-@@ -1137,6 +1230,7 @@ WaitressReturn_t WaitressFetchCall (Wait
-                               WaitressPollRead);
-               gnutls_transport_set_push_function (waith->request.tlsSession,
-                               WaitressPollWrite);
-+#endif
-       }
-       /* buffer is required for connect already */
-@@ -1148,15 +1242,22 @@ WaitressReturn_t WaitressFetchCall (Wait
-               if ((wRet = WaitressSendRequest (waith)) == WAITRESS_RET_OK) {
-                       wRet = WaitressReceiveResponse (waith);
-               }
-+#if !defined(USE_POLARSSL)
-               if (waith->url.tls) {
-                       gnutls_bye (waith->request.tlsSession, GNUTLS_SHUT_RDWR);
-               }
-+#endif
-       }
-       /* cleanup */
-       if (waith->url.tls) {
-+#if defined(USE_POLARSSL)
-+              ssl_free (&waith->request.sslCtx->ssl);
-+              free (waith->request.sslCtx);
-+#else
-               gnutls_deinit (waith->request.tlsSession);
-               gnutls_certificate_free_credentials (waith->tlsCred);
-+#endif
-       }
-       if (waith->request.sockfd != -1) {
-               close (waith->request.sockfd);
index 40e357bdcf999284e90153b7d88ac9bd303c7516..abec42156dcb9a2f6775818165475e8c3440d2cd 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2015-2016 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 # updated to work with latest source from abrasive
@@ -10,13 +8,13 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=shairport-sync
 PKG_VERSION:=2.8.6
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=git://github.com/mikebrady/shairport-sync.git
 PKG_SOURCE_VERSION:=$(PKG_VERSION)
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_VERSION).tar.gz
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
                Mike Brady <mikebrady@eircom.net>
 
@@ -46,18 +44,18 @@ define Package/shairport-sync-openssl
   VARIANT:=openssl
 endef
 
-define Package/shairport-sync-polarssl
+define Package/shairport-sync-mbedtls
   $(Package/shairport-sync/default)
-  TITLE+= (polarssl)
-  DEPENDS+= +libpolarssl +libavahi-client +libsoxr
-  VARIANT:=polarssl
+  TITLE+= (mbed TLS)
+  DEPENDS+= +libmbedtls +libavahi-client +libsoxr
+  VARIANT:=mbedtls
   DEFAULT_VARIANT:=1
 endef
 
 define Package/shairport-sync-mini
   $(Package/shairport-sync/default)
   TITLE+= (minimal)
-  DEPENDS+= +libpolarssl
+  DEPENDS+= +libmbedtls
   VARIANT:=mini
 endef
 
@@ -72,12 +70,12 @@ define Package/shairport-sync/default/description
   Also select kmod-usb-audio if you want to use USB-connected sound cards.
 endef
 Package/shairport-sync-openssl/description = $(Package/shairport-sync/default/description)
-Package/shairport-sync-polarssl/description = $(Package/shairport-sync/default/description)
+Package/shairport-sync-mbedtls/description = $(Package/shairport-sync/default/description)
 
 define Package/shairport-sync-mini/description
   $(Package/shairport-sync/default/description)
 
-  Minimal version uses PolarSSL and does not include libsoxr and avahi support.
+  Minimal version uses mbed TLS and does not include libsoxr and avahi support.
 endef
 
 CONFIGURE_ARGS+= \
@@ -88,12 +86,12 @@ ifeq ($(BUILD_VARIANT),openssl)
   CONFIGURE_ARGS+= --with-ssl=openssl
 endif
 
-ifeq ($(BUILD_VARIANT),polarssl)
-  CONFIGURE_ARGS+= --with-ssl=polarssl
+ifeq ($(BUILD_VARIANT),mbedtls)
+  CONFIGURE_ARGS+= --with-ssl=mbedtls
 endif
 
 ifeq ($(BUILD_VARIANT),mini)
-  CONFIGURE_ARGS+= --with-ssl=polarssl --with-tinysvcmdns
+  CONFIGURE_ARGS+= --with-ssl=mbedtls --with-tinysvcmdns
 else
   CONFIGURE_ARGS+= --with-avahi --with-soxr
 endif
@@ -103,7 +101,7 @@ define Package/shairport-sync/default/conffiles
 endef
 
 Package/shairport-sync-openssl/conffiles = $(Package/shairport-sync/default/conffiles)
-Package/shairport-sync-polarssl/conffiles = $(Package/shairport-sync/default/conffiles)
+Package/shairport-sync-mbedtls/conffiles = $(Package/shairport-sync/default/conffiles)
 Package/shairport-sync-mini/conffiles = $(Package/shairport-sync/default/conffiles)
 
 define Package/shairport-sync/default/install
@@ -118,9 +116,9 @@ define Package/shairport-sync/default/install
 endef
 
 Package/shairport-sync-openssl/install = $(Package/shairport-sync/default/install)
-Package/shairport-sync-polarssl/install = $(Package/shairport-sync/default/install)
+Package/shairport-sync-mbedtls/install = $(Package/shairport-sync/default/install)
 Package/shairport-sync-mini/install = $(Package/shairport-sync/default/install)
 
 $(eval $(call BuildPackage,shairport-sync-openssl))
-$(eval $(call BuildPackage,shairport-sync-polarssl))
+$(eval $(call BuildPackage,shairport-sync-mbedtls))
 $(eval $(call BuildPackage,shairport-sync-mini))
diff --git a/sound/shairport-sync/patches/100-replace_polarssl_with_mbedtls.patch b/sound/shairport-sync/patches/100-replace_polarssl_with_mbedtls.patch
new file mode 100644 (file)
index 0000000..984eb4c
--- /dev/null
@@ -0,0 +1,395 @@
+diff --git a/common.c b/common.c
+index bf72127..2d4739e 100644
+--- a/common.c
++++ b/common.c
+@@ -54,17 +54,14 @@
+ #include <openssl/buffer.h>
+ #endif
+-#ifdef HAVE_LIBPOLARSSL
+-#include <polarssl/version.h>
+-#include <polarssl/base64.h>
+-#include <polarssl/x509.h>
+-#include <polarssl/md.h>
+-#include "polarssl/entropy.h"
+-#include "polarssl/ctr_drbg.h"
+-
+-#if POLARSSL_VERSION_NUMBER >= 0x01030000
+-#include "polarssl/compat-1.2.h"
+-#endif
++#ifdef HAVE_LIBMBEDTLS
++#include <mbedtls/version.h>
++#include <mbedtls/base64.h>
++#include <mbedtls/x509.h>
++#include <mbedtls/md.h>
++#include "mbedtls/entropy.h"
++#include "mbedtls/ctr_drbg.h"
++
+ #endif
+ #include "common.h"
+@@ -126,16 +123,16 @@ void inform(char *format, ...) {
+   daemon_log(LOG_INFO, "%s", s);
+ }
+-#ifdef HAVE_LIBPOLARSSL
++#ifdef HAVE_LIBMBEDTLS
+ char *base64_enc(uint8_t *input, int length) {
+   char *buf = NULL;
+   size_t dlen = 0;
+-  int rc = base64_encode(NULL, &dlen, input, length);
+-  if (rc && (rc != POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL))
++  int rc = mbedtls_base64_encode(NULL, 0, &dlen, input, length);
++  if (rc && (rc != MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL))
+     debug(1, "Error %d getting length of base64 encode.", rc);
+   else {
+     buf = (char *)malloc(dlen);
+-    rc = base64_encode((unsigned char *)buf, &dlen, input, length);
++    rc = mbedtls_base64_encode((unsigned char *)buf, dlen, &dlen, input, length);
+     if (rc != 0)
+       debug(1, "Error %d encoding base64.", rc);
+   }
+@@ -156,10 +153,10 @@ uint8_t *base64_dec(char *input, int *outlen) {
+   else {
+     strcpy(inbuf, input);
+     strcat(inbuf, "===");
+-    // debug(1,"base64_dec called with string \"%s\", length %d, filled string: \"%s\", length
+-    // %d.",input,strlen(input),inbuf,inbufsize);
+-    int rc = base64_decode(buf, &dlen, (unsigned char *)inbuf, inbufsize);
+-    if (rc && (rc != POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL))
++    // debug(1,"base64_dec called with string \"%s\", length %d, filled string: \"%s\", length %d.",
++    //                input,strlen(input),inbuf,inbufsize);
++    int rc = mbedtls_base64_decode(NULL, 0, &dlen, (unsigned char *)inbuf, inbufsize);
++    if (rc && (rc != MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL))
+       debug(1, "Error %d getting decode length, result is %d.", rc, dlen);
+     else {
+       // debug(1,"Decode size is %d.",dlen);
+@@ -167,7 +164,7 @@ uint8_t *base64_dec(char *input, int *outlen) {
+       if (buf == 0)
+         debug(1, "Can't allocate memory in base64_dec.");
+       else {
+-        rc = base64_decode(buf, &dlen, (unsigned char *)inbuf, inbufsize);
++        rc = mbedtls_base64_decode(buf, dlen, &dlen, (unsigned char *)inbuf, inbufsize);
+         if (rc != 0)
+           debug(1, "Error %d in base64_dec.", rc);
+       }
+@@ -280,58 +277,59 @@ uint8_t *rsa_apply(uint8_t *input, int inlen, int *outlen, int mode) {
+ }
+ #endif
+-#ifdef HAVE_LIBPOLARSSL
++#ifdef HAVE_LIBMBEDTLS
+ uint8_t *rsa_apply(uint8_t *input, int inlen, int *outlen, int mode) {
+-  rsa_context trsa;
++  mbedtls_pk_context pkctx;
++  mbedtls_rsa_context *trsa;
+   const char *pers = "rsa_encrypt";
++  size_t olen = *outlen;
+   int rc;
+-  entropy_context entropy;
+-  ctr_drbg_context ctr_drbg;
+-  entropy_init(&entropy);
+-  if ((rc = ctr_drbg_init(&ctr_drbg, entropy_func, &entropy, (const unsigned char *)pers,
+-                          strlen(pers))) != 0)
+-    debug(1, "ctr_drbg_init returned %d\n", rc);
++  mbedtls_entropy_context entropy;
++  mbedtls_ctr_drbg_context ctr_drbg;
++
++  mbedtls_entropy_init(&entropy);
++
++  mbedtls_ctr_drbg_init(&ctr_drbg);
++  mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy,
++                      (const unsigned char *)pers, strlen(pers));
+-  rsa_init(&trsa, RSA_PKCS_V21, POLARSSL_MD_SHA1); // padding and hash id get overwritten
+-  // BTW, this seems to reset a lot of parameters in the rsa_context
+-  rc = x509parse_key(&trsa, (unsigned char *)super_secret_key, strlen(super_secret_key), NULL, 0);
++  mbedtls_pk_init(&pkctx);
++
++  rc = mbedtls_pk_parse_key(&pkctx, (unsigned char *)super_secret_key, sizeof(super_secret_key), NULL, 0);
+   if (rc != 0)
+-    debug(1, "Error %d reading the private key.");
++    debug(1, "Error %d reading the private key.", rc);
+-  uint8_t *out = NULL;
++  uint8_t *outbuf = NULL;
++  trsa = mbedtls_pk_rsa(pkctx);  
+   switch (mode) {
+   case RSA_MODE_AUTH:
+-    trsa.padding = RSA_PKCS_V15;
+-    trsa.hash_id = POLARSSL_MD_NONE;
+-    debug(2, "rsa_apply encrypt");
+-    out = malloc(trsa.len);
+-    rc = rsa_pkcs1_encrypt(&trsa, ctr_drbg_random, &ctr_drbg, RSA_PRIVATE, inlen, input, out);
++    mbedtls_rsa_set_padding(trsa, MBEDTLS_RSA_PKCS_V15, MBEDTLS_MD_NONE);
++    outbuf = malloc(trsa->len);
++    rc = mbedtls_rsa_pkcs1_encrypt(trsa, mbedtls_ctr_drbg_random, &ctr_drbg, MBEDTLS_RSA_PRIVATE,
++                         inlen, input, outbuf);
+     if (rc != 0)
+-      debug(1, "rsa_pkcs1_encrypt error %d.", rc);
+-    *outlen = trsa.len;
++      debug(1, "mbedtls_pk_encrypt error %d.", rc);
++    *outlen = trsa->len;
+     break;
+   case RSA_MODE_KEY:
+-    debug(2, "rsa_apply decrypt");
+-    trsa.padding = RSA_PKCS_V21;
+-    trsa.hash_id = POLARSSL_MD_SHA1;
+-    out = malloc(trsa.len);
+-#if POLARSSL_VERSION_NUMBER >= 0x01020900
+-    rc = rsa_pkcs1_decrypt(&trsa, ctr_drbg_random, &ctr_drbg, RSA_PRIVATE, (size_t *)outlen, input,
+-                           out, trsa.len);
+-#else
+-    rc = rsa_pkcs1_decrypt(&trsa, RSA_PRIVATE, outlen, input, out, trsa.len);
+-#endif
++    mbedtls_rsa_set_padding(trsa, MBEDTLS_RSA_PKCS_V21, MBEDTLS_MD_SHA1);
++    outbuf = malloc(trsa->len);
++    rc = mbedtls_rsa_pkcs1_decrypt(trsa, mbedtls_ctr_drbg_random, &ctr_drbg, MBEDTLS_RSA_PRIVATE, 
++                         &olen, input, outbuf, trsa->len);
+     if (rc != 0)
+-      debug(1, "decrypt error %d.", rc);
++      debug(1, "mbedtls_pk_decrypt error %d.", rc);
++    *outlen = olen;
+     break;
+   default:
+     die("bad rsa mode");
+   }
+-  rsa_free(&trsa);
+-  debug(2, "rsa_apply exit");
+-  return out;
++
++  mbedtls_ctr_drbg_free(&ctr_drbg);
++  mbedtls_entropy_free(&entropy);
++  mbedtls_pk_free(&pkctx);
++  return outbuf;
+ }
+ #endif
+@@ -517,7 +515,7 @@ ssize_t non_blocking_write(int fd, const void *buf, size_t count) {
+       void *ibuf = (void *)buf;
+       size_t bytes_remaining = count;
+       int rc = 0;
+-  struct pollfd ufds[1];
++      struct pollfd ufds[1];
+       while ((bytes_remaining>0) && (rc==0)) {
+               // check that we can do some writing
+               ufds[0].fd = fd;
+diff --git a/configure.ac b/configure.ac
+index 8d82da4..a2d1e4f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -108,11 +108,11 @@ AC_ARG_WITH(piddir, [ --with-piddir=<pathname> Specify a pathname to a directory
+ AM_CONDITIONAL([USE_CUSTOMPIDDIR], [test "x$HAS_CUSTOMPIDDIR" = "x1"])
+ # Check --with-ssl=argument
+-AC_ARG_WITH(ssl, [ choose --with-ssl=openssl or --with-ssl=polarssl for encryption services], [
++AC_ARG_WITH(ssl, [ choose --with-ssl=openssl or --with-ssl=mbedtls for encryption services], [
+   AC_MSG_CHECKING(encryption libraries chosen)
+   if test "x${with_ssl}" = x -o "x${with_ssl}" = xyes ; then
+     AC_MSG_RESULT(not found)
+-    AC_MSG_ERROR(choose either "openssl" or "polarssl" encryption)
++    AC_MSG_ERROR(choose either "openssl" or "mbedtls" encryption)
+   fi
+   if test "x${with_ssl}" = xopenssl ; then
+     if  test "x${with_pkg_config}" = xyes ; then
+@@ -127,10 +127,15 @@ AC_ARG_WITH(ssl, [ choose --with-ssl=openssl or --with-ssl=polarssl for encrypti
+       AC_DEFINE([HAVE_LIBCRYPTO],[1],[Define to 1 if you have libcrypto])
+       AC_DEFINE([HAVE_LIBSSL],[1],[Define to 1 if you have libssl])
+     fi
+-  elif test "x${with_ssl}" = xpolarssl ; then
+-    AC_CHECK_LIB([polarssl],[ssl_init], , AC_MSG_ERROR(PolarSSL selected but the library cannot be found!))
++  elif test "x${with_ssl}" = xmbedtls ; then
++    AC_CHECK_LIB([mbedtls],[mbedtls_ssl_init],,
++              [AC_MSG_ERROR([Cannot find required libray: libmbedtls],1)])
++    AC_CHECK_LIB([mbedcrypto], [mbedtls_entropy_func],,
++                [AC_MSG_ERROR([Cannot find required library: libmbedcrypto],1)])
++    AC_CHECK_LIB([mbedx509], [mbedtls_pk_init],,
++                [AC_MSG_ERROR([Cannot find required library: libmbedx509],1)])
+   else
+-    AC_MSG_ERROR(unknown option "${with_ssl}"." Please choose with "openssl" or "polarssl")
++    AC_MSG_ERROR(unknown option "${with_ssl}"." Please choose with "openssl" or "mbedtls")
+   fi
+ ], )
+diff --git a/player.c b/player.c
+index 97eccfb..da2d735 100644
+--- a/player.c
++++ b/player.c
+@@ -47,9 +47,9 @@
+ #include "config.h"
+-#ifdef HAVE_LIBPOLARSSL
+-#include <polarssl/aes.h>
+-#include <polarssl/havege.h>
++#ifdef HAVE_LIBMBEDTLS
++#include <mbedtls/aes.h>
++#include <mbedtls/havege.h>
+ #endif
+ #ifdef HAVE_LIBSSL
+@@ -82,8 +82,8 @@ static int max_frame_size_change = 1;
+ // maximal resampling shift - conservative
+ //#define OUTFRAME_BYTES(frame_size) (4 * (frame_size + 3))
+-#ifdef HAVE_LIBPOLARSSL
+-static aes_context dctx;
++#ifdef HAVE_LIBMBEDTLS
++static mbedtls_aes_context dctx;
+ #endif
+ //static pthread_t player_thread = NULL;
+@@ -247,8 +247,8 @@ static int alac_decode(short *dest, int *destlen, uint8_t *buf, int len) {
+     unsigned char iv[16];
+     int aeslen = len & ~0xf;
+     memcpy(iv, aesiv, sizeof(iv));
+-#ifdef HAVE_LIBPOLARSSL
+-    aes_crypt_cbc(&dctx, AES_DECRYPT, aeslen, iv, buf, packet);
++#ifdef HAVE_LIBMBEDTLS
++    mbedtls_aes_crypt_cbc(&dctx, MBEDTLS_AES_DECRYPT, aeslen, iv, buf, packet);
+ #endif
+ #ifdef HAVE_LIBSSL
+     AES_cbc_encrypt(buf, packet, aeslen, &aes, iv, AES_DECRYPT);
+@@ -1685,9 +1685,9 @@ int player_play(stream_cfg *stream, pthread_t *player_thread) {
+     die("specified buffer starting fill %d > buffer size %d", config.buffer_start_fill,
+         BUFFER_FRAMES);
+   if (encrypted) {
+-#ifdef HAVE_LIBPOLARSSL
+-    memset(&dctx, 0, sizeof(aes_context));
+-    aes_setkey_dec(&dctx, stream->aeskey, 128);
++#ifdef HAVE_LIBMBEDTLS
++    memset(&dctx, 0, sizeof(mbedtls_aes_context));
++    mbedtls_aes_setkey_dec(&dctx, stream->aeskey, 128);
+ #endif
+ #ifdef HAVE_LIBSSL
+diff --git a/rtsp.c b/rtsp.c
+index 38b0745..8003803 100644
+--- a/rtsp.c
++++ b/rtsp.c
+@@ -50,8 +50,8 @@
+ #include <openssl/md5.h>
+ #endif
+-#ifdef HAVE_LIBPOLARSSL
+-#include <polarssl/md5.h>
++#ifdef HAVE_LIBMBEDTLS
++#include <mbedtls/md5.h>
+ #endif
+ #include "common.h"
+@@ -979,7 +979,7 @@ static void handle_set_parameter_parameter(rtsp_conn_info *conn,
+ // more significant changes make it not malloc memory
+ // needs to initialise the docoding table first
+-// add _so to end of name to avoid confusion with polarssl's implementation
++// add _so to end of name to avoid confusion with SSL library implementation
+ static char encoding_table[] = {
+     'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+@@ -1651,21 +1651,21 @@ static int rtsp_auth(char **nonce, rtsp_message *req, rtsp_message *resp) {
+   MD5_Final(digest_mu, &ctx);
+ #endif
+-#ifdef HAVE_LIBPOLARSSL
+-  md5_context tctx;
+-  md5_starts(&tctx);
+-  md5_update(&tctx, (const unsigned char *)username, strlen(username));
+-  md5_update(&tctx, (unsigned char *)":", 1);
+-  md5_update(&tctx, (const unsigned char *)realm, strlen(realm));
+-  md5_update(&tctx, (unsigned char *)":", 1);
+-  md5_update(&tctx, (const unsigned char *)config.password,
++#ifdef HAVE_LIBMBEDTLS
++  mbedtls_md5_context tctx;
++  mbedtls_md5_starts(&tctx);
++  mbedtls_md5_update(&tctx, (const unsigned char *)username, strlen(username));
++  mbedtls_md5_update(&tctx, (unsigned char *)":", 1);
++  mbedtls_md5_update(&tctx, (const unsigned char *)realm, strlen(realm));
++  mbedtls_md5_update(&tctx, (unsigned char *)":", 1);
++  mbedtls_md5_update(&tctx, (const unsigned char *)config.password,
+              strlen(config.password));
+-  md5_finish(&tctx, digest_urp);
+-  md5_starts(&tctx);
+-  md5_update(&tctx, (const unsigned char *)req->method, strlen(req->method));
+-  md5_update(&tctx, (unsigned char *)":", 1);
+-  md5_update(&tctx, (const unsigned char *)uri, strlen(uri));
+-  md5_finish(&tctx, digest_mu);
++  mbedtls_md5_finish(&tctx, digest_urp);
++  mbedtls_md5_starts(&tctx);
++  mbedtls_md5_update(&tctx, (const unsigned char *)req->method, strlen(req->method));
++  mbedtls_md5_update(&tctx, (unsigned char *)":", 1);
++  mbedtls_md5_update(&tctx, (const unsigned char *)uri, strlen(uri));
++  mbedtls_md5_finish(&tctx, digest_mu);
+ #endif
+   int i;
+@@ -1685,16 +1685,16 @@ static int rtsp_auth(char **nonce, rtsp_message *req, rtsp_message *resp) {
+   MD5_Final(digest_total, &ctx);
+ #endif
+-#ifdef HAVE_LIBPOLARSSL
+-  md5_starts(&tctx);
+-  md5_update(&tctx, buf, 32);
+-  md5_update(&tctx, (unsigned char *)":", 1);
+-  md5_update(&tctx, (const unsigned char *)*nonce, strlen(*nonce));
+-  md5_update(&tctx, (unsigned char *)":", 1);
++#ifdef HAVE_LIBMBEDTLS
++  mbedtls_md5_starts(&tctx);
++  mbedtls_md5_update(&tctx, buf, 32);
++  mbedtls_md5_update(&tctx, (unsigned char *)":", 1);
++  mbedtls_md5_update(&tctx, (const unsigned char *)*nonce, strlen(*nonce));
++  mbedtls_md5_update(&tctx, (unsigned char *)":", 1);
+   for (i = 0; i < 16; i++)
+     sprintf((char *)buf + 2 * i, "%02x", digest_mu[i]);
+-  md5_update(&tctx, buf, 32);
+-  md5_finish(&tctx, digest_total);
++  mbedtls_md5_update(&tctx, buf, 32);
++  mbedtls_md5_finish(&tctx, digest_total);
+ #endif
+   for (i = 0; i < 16; i++)
+diff --git a/shairport.c b/shairport.c
+index f725d60..2349447 100644
+--- a/shairport.c
++++ b/shairport.c
+@@ -42,8 +42,8 @@
+ #include "config.h"
+-#ifdef HAVE_LIBPOLARSSL
+-#include <polarssl/md5.h>
++#ifdef HAVE_LIBMBEDTLS
++#include <mbedtls/md5.h>
+ #endif
+ #ifdef HAVE_LIBSSL
+@@ -109,8 +109,8 @@ char* get_version_string() {
+   char* version_string = malloc(200);
+   if (version_string) {
+     strcpy(version_string, PACKAGE_VERSION);
+-  #ifdef HAVE_LIBPOLARSSL
+-    strcat(version_string, "-PolarSSL");
++  #ifdef HAVE_LIBMBEDTLS
++    strcat(version_string, "-mbedTLS");
+   #endif
+   #ifdef HAVE_LIBSSL
+     strcat(version_string, "-OpenSSL");
+@@ -1046,11 +1046,11 @@ int main(int argc, char **argv) {
+   MD5_Final(ap_md5, &ctx);
+ #endif
+-#ifdef HAVE_LIBPOLARSSL
+-  md5_context tctx;
+-  md5_starts(&tctx);
+-  md5_update(&tctx, (unsigned char *)config.service_name, strlen(config.service_name));
+-  md5_finish(&tctx, ap_md5);
++#ifdef HAVE_LIBMBEDTLS
++  mbedtls_md5_context tctx;
++  mbedtls_md5_starts(&tctx);
++  mbedtls_md5_update(&tctx, (unsigned char *)config.service_name, strlen(config.service_name));
++  mbedtls_md5_finish(&tctx, ap_md5);
+ #endif
+   memcpy(config.hw_addr, ap_md5, sizeof(config.hw_addr));
+ #ifdef CONFIG_METADATA
index d13cff6eebc6a0ea30d2ab77819189004efe97e5..7b1dda0c5981f32ce7c4652ad26e74735ac80fd9 100644 (file)
@@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=shine
 PKG_VERSION:=3.1.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://github.com/savonet/shine/releases/download/$(PKG_VERSION)/
+PKG_SOURCE_URL:=https://github.com/toots/shine/releases/download/$(PKG_VERSION)/
 PKG_MD5SUM:=fcad8108335f4b051b303fbdf3fca3fe
 
 PKG_LICENSE:=GPL-2.0
@@ -29,7 +29,7 @@ define Package/shine
   SECTION:=sound
   CATEGORY:=Sound
   TITLE:=Super fast fixed-point MP3 encoder
-  URL:=https://github.com/savonet/shine
+  URL:=https://github.com/toots/shine
 endef
 
 define Package/shine/description
diff --git a/sound/shine/patches/002-fix-name-collision-with-ffmpeg.patch b/sound/shine/patches/002-fix-name-collision-with-ffmpeg.patch
new file mode 100644 (file)
index 0000000..83ddb5e
--- /dev/null
@@ -0,0 +1,64 @@
+From 3695118267be9b7a9412c86c7c5424ab47efe7ec Mon Sep 17 00:00:00 2001
+From: Romain Beauxis <toots@rastageeks.org>
+Date: Thu, 7 Apr 2016 13:20:46 -0500
+Subject: [PATCH] Rename slen{1,2}_table to avoid name collision with ffmpeg.
+
+---
+ src/lib/l3bitstream.c | 4 ++--
+ src/lib/l3loop.c      | 4 ++--
+ src/lib/tables.c      | 4 ++--
+ src/lib/tables.h      | 4 ++--
+ 4 files changed, 8 insertions(+), 8 deletions(-)
+
+--- a/src/lib/l3bitstream.c
++++ b/src/lib/l3bitstream.c
+@@ -127,8 +127,8 @@ static void encodeMainData(shine_global_
+         {
+           BF_PartHolder **pph = &config->l3stream.scaleFactorsPH[gr][ch];
+           gr_info *gi = &(si.gr[gr].ch[ch].tt);
+-          unsigned slen1 = slen1_tab[ gi->scalefac_compress ];
+-          unsigned slen2 = slen2_tab[ gi->scalefac_compress ];
++          unsigned slen1 = shine_slen1_tab[ gi->scalefac_compress ];
++          unsigned slen2 = shine_slen2_tab[ gi->scalefac_compress ];
+           int *ix = &config->l3_enc[ch][gr][0];
+           if ( (gr == 0) || (si.scfsi[ch][0] == 0) )
+--- a/src/lib/l3loop.c
++++ b/src/lib/l3loop.c
+@@ -287,8 +287,8 @@ int part2_length(int gr, int ch, shine_g
+   bits = 0;
+   {
+-    slen1 = slen1_tab[ gi->scalefac_compress ];
+-    slen2 = slen2_tab[ gi->scalefac_compress ];
++    slen1 = shine_slen1_tab[ gi->scalefac_compress ];
++    slen2 = shine_slen2_tab[ gi->scalefac_compress ];
+     if ( !gr || !(config->side_info.scfsi[ch][0]) )
+       bits += (6 * slen1);
+--- a/src/lib/tables.c
++++ b/src/lib/tables.c
+@@ -7,8 +7,8 @@
\r
+ #include "tables.h"\r
\r
+-const int slen1_tab[16] = { 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 };\r
+-const int slen2_tab[16] = { 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3 };\r
++const int shine_slen1_tab[16] = { 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 };\r
++const int shine_slen2_tab[16] = { 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3 };\r
\r
+ /* Valid samplerates and bitrates. */\r
+ const int samplerates[9] = {\r
+--- a/src/lib/tables.h
++++ b/src/lib/tables.h
+@@ -3,8 +3,8 @@
\r
+ #include "types.h"\r
\r
+-extern const int slen1_tab[16];\r
+-extern const int slen2_tab[16];\r
++extern const int shine_slen1_tab[16];\r
++extern const int shine_slen2_tab[16];\r
\r
+ extern const int samplerates[9];\r
+ extern const int bitrates[16][4];\r
index eda080fa8b928cb106d6667b2b87ff3608a4e22f..11402f8e4287e2c74e5780e410a22bf2e59fd453 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Copyright (C) 2008 David Cooper <dave@kupesoft.com>
-# Copyright (C) 2006-2014 OpenWrt.org
+# Copyright (C) 2006-2017 OpenWrt
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sox
-PKG_VERSION:=14.4.1
-PKG_RELEASE:=3
+PKG_VERSION:=14.4.2
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/sox
-PKG_MD5SUM:=ff9ca6aca972549de0e80e8e30ed379c
+PKG_MD5SUM:=81a6956d4330e75b5827316e44ae381e6f1e8928003c6aa45896da9041ea149c
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 PKG_LICENSE:=LGPL-2.1 GPL-2.0
@@ -33,7 +33,7 @@ define Package/sox
   CATEGORY:=Sound
   DEPENDS:=+BUILD_PATENTED:lame-lib +BUILD_PATENTED:libmad +BUILD_PATENTED:libid3tag \
                +libvorbis +libvorbisidec +alsa-lib +libsndfile +libflac \
-               +libmagic +libpng +libffmpeg
+               +libmagic +libpng
   TITLE:=Sox is a general purpose sound converter/player/recorder
   URL:=http://sox.sourceforge.net/
 endef
@@ -54,7 +54,6 @@ define Build/Configure
                --without-libltdl \
                --with-ogg \
                --with-flac \
-               --with-ffmpeg \
                --without-amr-wb \
                --without-amr-nb \
                --without-samplerate \
index 7996ece926cbfbde4373ad2308ef0db267eadc4b..badd531df5136dc55ced44e7cc5282cfec991eae 100644 (file)
@@ -1,22 +1,22 @@
 --- a/src/Makefile.am
 +++ b/src/Makefile.am
-@@ -144,7 +144,7 @@ EXTRA_DIST = monkey.wav optional-fmts.am
+@@ -145,7 +145,7 @@ EXTRA_DIST = monkey.wav optional-fmts.am
             CMakeLists.txt soxconfig.h.cmake \
             tests.sh testall.sh tests.bat testall.bat test-comments
  
--all: sox$(EXEEXT) play rec soxi sox_sample_test$(EXEEXT) example0$(EXEEXT) example1$(EXEEXT) example2$(EXEEXT) example3$(EXEEXT) example4$(EXEEXT) example5$(EXEEXT)
-+all: sox$(EXEEXT) play rec
+-all: sox$(EXEEXT) play$(EXEEXT) rec$(EXEEXT) soxi$(EXEEXT) sox_sample_test$(EXEEXT) example0$(EXEEXT) example1$(EXEEXT) example2$(EXEEXT) example3$(EXEEXT) example4$(EXEEXT) example5$(EXEEXT) example6$(EXEEXT)
++all: sox$(EXEEXT) play$(EXEEXT) rec$(EXEEXT)
  
- play rec: sox$(EXEEXT)
+ play$(EXEEXT) rec$(EXEEXT) soxi$(EXEEXT): sox$(EXEEXT)
        if test "$(PLAYRECLINKS)" = "yes"; then \
---- sox-14.4.1/src/Makefile.in
-+++ sox-14.4.1/src/Makefile.in
-@@ -2904,7 +2904,7 @@
-       uninstall-libLTLIBRARIES uninstall-pkglibLTLIBRARIES
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -3020,7 +3020,7 @@ uninstall-am: uninstall-binPROGRAMS unin
+       uninstall-pkglibLTLIBRARIES
  
  
--all: sox$(EXEEXT) play rec soxi sox_sample_test$(EXEEXT) example0$(EXEEXT) example1$(EXEEXT) example2$(EXEEXT) example3$(EXEEXT) example4$(EXEEXT) example5$(EXEEXT)
-+all: sox$(EXEEXT) play rec
+-all: sox$(EXEEXT) play$(EXEEXT) rec$(EXEEXT) soxi$(EXEEXT) sox_sample_test$(EXEEXT) example0$(EXEEXT) example1$(EXEEXT) example2$(EXEEXT) example3$(EXEEXT) example4$(EXEEXT) example5$(EXEEXT) example6$(EXEEXT)
++all: sox$(EXEEXT) play$(EXEEXT) rec$(EXEEXT)
  
- play rec: sox$(EXEEXT)
+ play$(EXEEXT) rec$(EXEEXT) soxi$(EXEEXT): sox$(EXEEXT)
        if test "$(PLAYRECLINKS)" = "yes"; then \
index 06454cdf5a1698e58510eb88f7350c1347706e8d..6a06301e62721603c5394bda89a3b7016ce675fc 100644 (file)
@@ -1,15 +1,15 @@
---- sox-14.4.1.orig/src/formats.c
-+++ sox-14.4.1/src/formats.c
-@@ -409,7 +409,7 @@ static void UNUSED rewind_pipe(FILE * fp
+--- a/src/formats.c
++++ b/src/formats.c
+@@ -413,7 +413,7 @@ static void UNUSED rewind_pipe(FILE * fp
  #if defined _FSTDIO || defined _NEWLIB_VERSION || defined __APPLE__
    fp->_p -= PIPE_AUTO_DETECT_SIZE;
    fp->_r += PIPE_AUTO_DETECT_SIZE;
 -#elif defined __GLIBC__
 +#elif defined __GLIBC__ && ! defined __UCLIBC__
    fp->_IO_read_ptr = fp->_IO_read_base;
- #elif defined _MSC_VER || defined _WIN32 || defined _WIN64 || defined _ISO_STDIO_ISO_H
-   fp->_ptr = fp->_base;
-@@ -417,7 +417,6 @@ static void UNUSED rewind_pipe(FILE * fp
+ #elif defined _MSC_VER || defined _WIN32 || defined _WIN64 || \
+       defined _ISO_STDIO_ISO_H || defined __sgi
+@@ -422,7 +422,6 @@ static void UNUSED rewind_pipe(FILE * fp
    /* To fix this #error, either simply remove the #error line and live without
     * file-type detection with pipes, or add support for your compiler in the
     * lines above.  Test with cat monkey.wav | ./sox --info - */
diff --git a/sound/sox/patches/020-ffmpeg-0.11.patch b/sound/sox/patches/020-ffmpeg-0.11.patch
deleted file mode 100644 (file)
index 61f6e23..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
---- a/configure
-+++ b/configure
-@@ -15825,9 +15825,9 @@
-   cat >>confdefs.h <<_ACEOF
- #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
- _ACEOF
-- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for av_open_input_file in -lavformat" >&5
--$as_echo_n "checking for av_open_input_file in -lavformat... " >&6; }
--if ${ac_cv_lib_avformat_av_open_input_file+:} false; then :
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for avformat_open_input in -lavformat" >&5
-+$as_echo_n "checking for avformat_open_input in -lavformat... " >&6; }
-+if ${ac_cv_lib_avformat_avformat_open_input+:} false; then :
-   $as_echo_n "(cached) " >&6
- else
-   ac_check_lib_save_LIBS=$LIBS
-@@ -15841,27 +15841,27 @@
- #ifdef __cplusplus
- extern "C"
- #endif
--char av_open_input_file ();
-+char avformat_open_input ();
- int
- main ()
- {
--return av_open_input_file ();
-+return avformat_open_input ();
-   ;
-   return 0;
- }
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
--  ac_cv_lib_avformat_av_open_input_file=yes
-+  ac_cv_lib_avformat_avformat_open_input=yes
- else
--  ac_cv_lib_avformat_av_open_input_file=no
-+  ac_cv_lib_avformat_avformat_open_input=no
- fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
- LIBS=$ac_check_lib_save_LIBS
- fi
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avformat_av_open_input_file" >&5
--$as_echo "$ac_cv_lib_avformat_av_open_input_file" >&6; }
--if test "x$ac_cv_lib_avformat_av_open_input_file" = xyes; then :
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avformat_avformat_open_input" >&5
-+$as_echo "$ac_cv_lib_avformat_avformat_open_input" >&6; }
-+if test "x$ac_cv_lib_avformat_avformat_open_input" = xyes; then :
-   for ac_header in libavcodec/avcodec.h ffmpeg/avcodec.h
- do :
-   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-diff -Naur sox-14.4.0-orig/src/ffmpeg.c sox-14.4.0/src/ffmpeg.c
---- sox-14.4.0-orig/src/ffmpeg.c       2012-06-12 00:35:53.459027469 -0400
-+++ sox-14.4.0/src/ffmpeg.c    2012-06-12 00:36:26.539028545 -0400
-@@ -93,7 +93,7 @@
- #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
-   enc->error_resilience = 1;
- #else
--  enc->error_recognition = 1;
-+  enc->err_recognition = 1;
- #endif
-   if (!codec || avcodec_open(enc, codec) < 0)
-@@ -157,7 +157,7 @@
- static int startread(sox_format_t * ft)
- {
-   priv_t * ffmpeg = (priv_t *)ft->priv;
--  AVFormatParameters params;
-+  AVDictionary *params;
-   int ret;
-   int i;
-@@ -172,7 +172,7 @@
-   /* Open file and get format */
-   memset(&params, 0, sizeof(params));
--  if ((ret = av_open_input_file(&ffmpeg->ctxt, ft->filename, NULL, 0, &params)) < 0) {
-+  if ((ret = avformat_open_input(&ffmpeg->ctxt, ft->filename, NULL, &params)) < 0) {
-     lsx_fail("ffmpeg cannot open file for reading: %s (code %d)", ft->filename, ret);
-     return SOX_EOF;
-   }
-@@ -231,7 +231,7 @@
-     /* If input buffer empty, read more data */
-     if (ffmpeg->audio_buf_index * 2 >= ffmpeg->audio_buf_size) {
-       if ((ret = av_read_frame(ffmpeg->ctxt, pkt)) < 0 &&
--        (ret == AVERROR_EOF || url_ferror(ffmpeg->ctxt->pb)))
-+        (ret == AVERROR_EOF || ffmpeg->ctxt->pb->error))
-       break;
-       ffmpeg->audio_buf_size = audio_decode_frame(ffmpeg, ffmpeg->audio_buf_aligned, AVCODEC_MAX_AUDIO_FRAME_SIZE);
-       ffmpeg->audio_buf_index = 0;
-@@ -373,13 +373,6 @@
-       return SOX_EOF;
-   }
--  /* set the output parameters (must be done even if no
--     parameters). */
--  if (av_set_parameters(ffmpeg->ctxt, NULL) < 0) {
--    lsx_fail("ffmpeg invalid output format parameters");
--    return SOX_EOF;
--  }
--
-   /* Next line for debugging */
-   /* dump_format(ffmpeg->ctxt, 0, ft->filename, 1); */
-@@ -391,14 +384,14 @@
-   /* open the output file, if needed */
-   if (!(ffmpeg->fmt->flags & AVFMT_NOFILE)) {
--    if (url_fopen(&ffmpeg->ctxt->pb, ft->filename, URL_WRONLY) < 0) {
-+    if (avio_open(&ffmpeg->ctxt->pb, ft->filename, AVIO_FLAG_WRITE) < 0) {
-       lsx_fail("ffmpeg could not open `%s'", ft->filename);
-       return SOX_EOF;
-     }
-   }
-   /* write the stream header, if any */
--  av_write_header(ffmpeg->ctxt);
-+  avformat_write_header(ffmpeg->ctxt, NULL);
-   return SOX_SUCCESS;
- }
-@@ -478,7 +471,7 @@
- #if (LIBAVFORMAT_VERSION_INT < 0x340000)
-     url_fclose(&ffmpeg->ctxt->pb);
- #else
--    url_fclose(ffmpeg->ctxt->pb);
-+    avio_close(ffmpeg->ctxt->pb);
- #endif
-   }
-
diff --git a/sound/sox/patches/020-ffmpeg-2.x.patch b/sound/sox/patches/020-ffmpeg-2.x.patch
deleted file mode 100644 (file)
index 44e7ebb..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
---- a/src/ffmpeg.c
-+++ b/src/ffmpeg.c
-@@ -50,6 +50,10 @@
- #include <ctype.h>
- #include "ffmpeg.h"
-+#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
-+#define AVCODEC_MAX_AUDIO_FRAME_SIZE  192000
-+#endif
-+
- #ifndef CODEC_TYPE_AUDIO
- #define CODEC_TYPE_AUDIO AVMEDIA_TYPE_AUDIO
- #endif
-@@ -96,7 +100,7 @@ static int stream_component_open(priv_t
-   enc->err_recognition = 1;
- #endif
--  if (!codec || avcodec_open(enc, codec) < 0)
-+  if (!codec || avcodec_open2(enc, codec, NULL) < 0)
-     return -1;
-   if (enc->codec_type != AVMEDIA_TYPE_AUDIO) {
-     lsx_fail("ffmpeg CODEC %x is not an audio CODEC", enc->codec_type);
-@@ -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
-  */
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0)
-+static AVStream *add_audio_stream(sox_format_t * ft, AVFormatContext *oc, enum AVCodecID codec_id)
-+#else
- static AVStream *add_audio_stream(sox_format_t * ft, AVFormatContext *oc, enum CodecID codec_id)
-+#endif
- {
-   AVCodecContext *c;
-   AVStream *st;
--  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 */
--  if (avcodec_open(c, codec) < 0) {
-+  if (avcodec_open2(c, codec, NULL) < 0) {
-     lsx_fail("ffmpeg could not open CODEC");
-     return SOX_EOF;
-   }
diff --git a/utils/bandwidthd-php/Makefile b/utils/bandwidthd-php/Makefile
deleted file mode 100644 (file)
index c71d798..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Copyright (C) 2006-2016 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:=bandwidthd-php
-PKG_VERSION:=2.0.1
-PKG_RELEASE:=2
-
-PKG_MAINTAINER:=Jean-Michel Lacroix <lacroix@lepine-lacroix.info>
-
-PKG_LICENSE:=GPL-2.0
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/bandwidthd-php
-  SECTION:=utils
-  CATEGORY:=Utilities
-  DEPENDS:=+libpcre +libxml2 +php7 +php7-cgi +php7-mod-pgsql +php7-mod-gd
-  TITLE:=PHP files to graph bandwidthd data in a postgresql database
-  URL:=http://bandwidthd.sourceforge.net/
-endef
-
-define Package/bandwidthd-php/description
-  PHP files to graph bandwidthd data in a postgresql database
-endef
-
-define Build/Compile
-endef
-
-define Package/bandwidthd-php/install
-       $(INSTALL_DIR) $(1)/www/phphtdocs
-       $(INSTALL_DATA) ./files/legend.gif $(1)/www/phphtdocs/
-       $(INSTALL_DATA) ./files/logo.gif $(1)/www/phphtdocs/
-       $(INSTALL_DATA) ./files/details.php $(1)/www/phphtdocs/
-       $(INSTALL_DATA) ./files/footer.php $(1)/www/phphtdocs/
-       $(INSTALL_DATA) ./files/graph.php $(1)/www/phphtdocs/
-       $(INSTALL_DATA) ./files/include.php $(1)/www/phphtdocs/
-       $(INSTALL_DATA) ./files/index.php $(1)/www/phphtdocs/
-       ln -s /var/etc/bandwidthd-php.conf $(1)/www/phphtdocs/config.conf
-       $(INSTALL_DIR) $(1)//etc/config
-       $(INSTALL_CONF) ./files/bandwidthd-php.config $(1)/etc/config/bandwidthd-php
-       $(INSTALL_DIR) $(1)/etc/init.d
-       $(INSTALL_BIN) ./files/bandwidthd-php.init $(1)/etc/init.d/bandwidthd-php
-endef
-
-$(eval $(call BuildPackage,bandwidthd-php))
diff --git a/utils/bandwidthd-php/files/bandwidthd-php.config b/utils/bandwidthd-php/files/bandwidthd-php.config
deleted file mode 100644 (file)
index 3bad494..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-config bandwidthd-php
-       option dflt_width       '900'
-       option dflt_height      '256'
-       option dflt_interval    'INT_DAILY'
-       option host             '127.0.0.1'
-       option user             'postgres'
-       option dbname           'bandwidthd'
diff --git a/utils/bandwidthd-php/files/bandwidthd-php.init b/utils/bandwidthd-php/files/bandwidthd-php.init
deleted file mode 100755 (executable)
index f3a7c67..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006-2016 OpenWrt.org
-
-START=99
-
-USE_PROCD=1
-
-CONFIGNAME="bandwidthd-php"
-CONFIGFILE="/var/etc/bandwidthd-php.conf"
-
-config_cb() {
-       local cfg_type="$1"
-       local cfg_name="$2"
-       case "$cfg_type" in
-               $CONFIGNAME)
-                       append cfgs "$cfg_name"
-               ;;
-       esac
-}
-
-export_number() {
-       local option="$1"
-       local section="$2"
-       local _loctmp
-       paramstr=""
-       config_get _loctmp "$section" "$option"
-       if [ -n "$_loctmp" ]; then
-               paramstr="${_loctmp}"
-       fi
-}
-
-export_string() {
-       local option="$1"
-       local section="$2"
-       local _loctmp
-       paramstr=""
-       config_get _loctmp "$section" "$option"
-       if [ -n "$_loctmp" ]; then
-               paramstr="${_loctmp}"
-       fi
-}
-
-service_triggers()
-{
-        procd_add_reload_trigger $CONFIGNAME
-}
-
-
-start_service() {
-       local conffile="<?php\n// auto-generated config file from /etc/config/${CONFIGNAME}\n"
-        rm -f $CONFIGFILE
-        touch $CONFIGFILE
-
-       config_load $CONFIGNAME
-       for cfg in $cfgs; do
-               export_number dflt_width $cfg
-               conffile="${conffile}define(\"DFLT_WIDTH\", ${paramstr:-"900"});\n"
-
-               export_number dflt_height $cfg
-                       conffile="${conffile}define(\"DFLT_HEIGHT\", ${paramstr:-"256"});\n"
-
-               export_string dflt_interval $cfg
-               conffile="${conffile}define(\"DFLT_INTERVAL\", ${paramstr:-"INT_DAILY"});\n\n"'$db_connect_string = "host='
-
-               export_string host $cfg
-               conffile="${conffile}${paramstr:-"127.0.0.1"} user="
-
-               export_string user $cfg
-               conffile="${conffile}${paramstr:-"postgres"} dbname="
-
-               export_string dbname $cfg
-               conffile="${conffile}${paramstr:-"bandwidthd"}"'"'"\n?>"
-               [ -n "$conffile" ] && echo -e "$conffile" >>$CONFIGFILE
-       done
-}
diff --git a/utils/bandwidthd-php/files/details.php b/utils/bandwidthd-php/files/details.php
deleted file mode 100644 (file)
index d2f0786..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-<?php
-include("include.php");
-?>
-<html>
-<center>
-<img src=logo.gif>
-<?php
-if (isset($_GET['sensor_name']))
-    $sensor_name = $_GET['sensor_name'];
-else
-    {
-    echo "<br>Please provide a sensor_name";
-    exit(1);
-    }
-
-if (isset($_GET['ip']))
-    $ip = $_GET['ip'];
-else
-    {
-    echo "<br>Please provide an ip address";
-    exit(1);
-    }
-                                                                                                                             
-echo "<h3>";
-if (strpos($ip, "/") === FALSE)
-       echo "$ip - ".gethostbyaddr($ip)."</h3>";
-else
-       echo "Total - $ip</h3>";
-
-$db = ConnectDb();
-
-if ($ip == "0.0.0.0/0")
-       {
-    $rxtable = "bd_rx_total_log";
-       $txtable = "bd_tx_total_log";
-       }
-else
-       {
-    $rxtable = "bd_rx_log";
-       $txtable = "bd_tx_log";
-       }
-
-$sql = "select rx.scale as rxscale, tx.scale as txscale, tx.total+rx.total as total, tx.total as sent,
-rx.total as received, tx.tcp+rx.tcp as tcp, tx.udp+rx.udp as udp,
-tx.icmp+rx.icmp as icmp, tx.http+rx.http as http,
-tx.p2p+rx.p2p as p2p, tx.ftp+rx.ftp as ftp
-from
-                                                                                                                             
-(SELECT ip, max(total/sample_duration)*8 as scale, sum(total) as total, sum(tcp) as tcp, sum(udp) as udp, sum(icmp) as icmp,
-sum(http) as http, sum(p2p) as p2p, sum(ftp) as ftp
-from sensors, $txtable
-where sensor_name = '$sensor_name'
-and sensors.sensor_id = ".$txtable.".sensor_id
-and ip <<= '$ip'
-group by ip) as tx,
-                                                                                                                             
-(SELECT ip, max(total/sample_duration)*8 as scale, sum(total) as total, sum(tcp) as tcp, sum(udp) as udp, sum(icmp) as icmp,
-sum(http) as http, sum(p2p) as p2p, sum(ftp) as ftp
-from sensors, $rxtable
-where sensor_name = '$sensor_name'
-and sensors.sensor_id = ".$rxtable.".sensor_id
-and ip <<= '$ip'
-group by ip) as rx
-                                                                                                                             
-where tx.ip = rx.ip;";
-//echo "</center><pre>$sql</pre><center>";exit(0);
-$result = pg_query($sql);
-echo "<table width=100% border=1 cellspacing=0><tr><td>Ip<td>Name<td>Total<td>Sent<td>Received<td>tcp<td>udp<td>icmp<td>http<td>p2p<td>ftp";
-$r = pg_fetch_array($result);
-echo "<tr><td>";
-if (strpos($ip, "/") === FALSE)
-       echo "$ip<td>".gethostbyaddr($ip);
-else
-       echo "Total<td>$ip";
-echo fmtb($r['total']).fmtb($r['sent']).fmtb($r['received']).
-       fmtb($r['tcp']).fmtb($r['udp']).fmtb($r['icmp']).fmtb($r['http']).
-    fmtb($r['p2p']).fmtb($r['ftp']);
-echo "</table></center>";
-
-echo "<center><h4>Daily</h4></center>";
-echo "Send:<br><img src=graph.php?ip=$ip&sensor_name=".$sensor_name."&table=$txtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
-echo "<img src=legend.gif><br>";
-echo "Receive:<br><img src=graph.php?ip=$ip&sensor_name=".$sensor_name."&table=$rxtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
-echo "<img src=legend.gif><br>";
-
-echo "<center><h4>Weekly</h4></center>";
-echo "Send:<br><img src=graph.php?interval=".INT_WEEKLY."&ip=$ip&sensor_name=$sensor_name&table=$txtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
-echo "<img src=legend.gif><br>";
-echo "Receive:<br><img src=graph.php?interval=".INT_WEEKLY."&ip=$ip&sensor_name=$sensor_name&table=$rxtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
-echo "<img src=legend.gif><br>";
-
-echo "<center><h4>Monthly</h4></center>";
-echo "Send:<br><img src=graph.php?interval=".INT_MONTHLY."&ip=$ip&sensor_name=$sensor_name&table=$txtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
-echo "<img src=legend.gif><br>";
-echo "Receive:<br><img src=graph.php?interval=".INT_MONTHLY."&ip=$ip&sensor_name=$sensor_name&table=$rxtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
-echo "<img src=legend.gif><br>";
-
-echo "<center><h4>Yearly</h4></center>";
-echo "Send:<br><img src=graph.php?interval=".INT_YEARLY."&ip=$ip&sensor_name=$sensor_name&table=$txtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
-echo "<img src=legend.gif><br>";
-echo "Receive:<br><img src=graph.php?interval=".INT_YEARLY."&ip=$ip&sensor_name=$sensor_name&table=$rxtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
-echo "<img src=legend.gif><br>";
diff --git a/utils/bandwidthd-php/files/footer.php b/utils/bandwidthd-php/files/footer.php
deleted file mode 100644 (file)
index b342825..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-echo("Page load completed in ". (time() - $starttime) ." seconds"); 
-?>
diff --git a/utils/bandwidthd-php/files/graph.php b/utils/bandwidthd-php/files/graph.php
deleted file mode 100644 (file)
index b978177..0000000
+++ /dev/null
@@ -1,457 +0,0 @@
-<?php
-require("include.php");
-
-// Returns x location of any given timestamp
-function ts2x($ts)
-       {
-       global $timestamp, $width, $interval;
-       return(($ts-$timestamp)*(($width-XOFFSET) / $interval) + XOFFSET);
-       }
-
-// If we have multiple IP's in a result set we need to total the average of each IP's samples
-function AverageAndAccumulate()
-       {
-       global $Count, $total, $icmp, $udp, $tcp, $ftp, $http, $p2p, $YMax;
-       global $a_total, $a_icmp, $a_udp, $a_tcp, $a_ftp, $a_http, $a_p2p;
-       
-       foreach ($Count as $key => $number)
-       {
-           $total[$key] /= $number;
-       $icmp[$key] /= $number;
-       $udp[$key] /= $number;
-       $tcp[$key] /= $number;
-       $ftp[$key] /= $number;
-       $http[$key] /= $number;
-       $p2p[$key] /= $number;
-       }
-
-       foreach ($Count as $key => $number) 
-               {
-               $a_total[$key] += $total[$key];
-               $a_icmp[$key] += $icmp[$key];
-               $a_udp[$key] += $udp[$key];
-               $a_tcp[$key] += $tcp[$key];
-               $a_ftp[$key] += $ftp[$key];
-               $a_http[$key] += $http[$key];
-               $a_p2p[$key] += $p2p[$key];
-
-               if ($a_total[$key] > $YMax)
-                       $YMax = $a_total[$key];
-               }
-       
-       unset($GLOBALS['total'], $GLOBALS['icmp'], $GLOBALS['udp'], $GLOBALS['tcp'], $GLOBALS['ftp'], $GLOBALS['http'], $GLOBALS['p2p'], $GLOBALS['Count']);
-
-       $total = array();
-       $icmp = array();
-       $udp = array();
-       $tcp = array();
-       $ftp = array();
-       $http = array();
-       $p2p = array();
-       $Count = array();
-       }
-
-$db = ConnectDb();
-
-// Get parameters
-
-if (isset($_GET['width']))
-    $width = $_GET['width'];
-else
-       $width = DFLT_WIDTH;
-
-if (isset($_GET['height']))
-    $height = $_GET['height'];
-else
-       $height = DFLT_HEIGHT;
-
-if (isset($_GET['interval']))
-    $interval = $_GET['interval'];
-else
-       $interval = DFLT_INTERVAL;
-
-if (isset($_GET['ip']))
-    $ip = $_GET['ip'];
-else
-       exit(1);
-
-if (isset($_GET['sensor_name']))
-       $sensor_name = $_GET['sensor_name'];
-else
-       exit(1);
-
-if (isset($_GET['timestamp']))
-    $timestamp = $_GET['timestamp'];
-else
-       $timestamp = time() - $interval + (0.05*$interval);
-
-if (isset($_GET['table']))
-    $table = $_GET['table'];
-else
-       $table = "bd_rx_log";
-
-if (isset($_GET['yscale']))
-    $yscale = $_GET['yscale'];
-
-$total = array();
-$icmp = array();
-$udp = array();
-$tcp = array();
-$ftp = array();
-$http = array();
-$p2p = array();
-$Count = array();
-
-// Accumulator
-$a_total = array();
-$a_icmp = array();
-$a_udp = array();
-$a_tcp = array();
-$a_ftp = array();
-$a_http = array();
-$a_p2p = array();
-
-$sql = "select *, extract(epoch from timestamp) as ts from sensors, $table where sensors.sensor_id = ".$table.".sensor_id and ip <<= '$ip' and sensor_name = '$sensor_name' and timestamp > $timestamp::abstime and timestamp < ".($timestamp+$interval)."::abstime order by ip;";
-//echo $sql."<br>"; exit(1);
-$result = pg_query($sql);
-
-// The SQL statement pulls the data out of the database ordered by IP address, that way we can average each
-// datapoint for each IP address to provide smoothing and then toss the smoothed value into the accumulator
-// to provide accurate total traffic rate.
-
-while ($row = pg_fetch_array($result))
-       {
-       if ($row['ip'] != $last_ip)
-               {
-               AverageAndAccumulate();
-               $last_ip = $row['ip'];
-               }
-
-       $x = ($row['ts']-$timestamp)*(($width-XOFFSET)/$interval)+XOFFSET;
-       $xint = (int) $x;
-
-       //echo "xint: ".$xint."<br>";
-       $Count[$xint]++;
-                                                                                                                             
-       if ($row['total']/$row['sample_duration'] > $SentPeak)
-               $SentPeak = $row['total']/$row['sample_duration'];
-       $TotalSent += $row['total'];
-       $total[$xint] += $row['total']/$row['sample_duration'];
-       $icmp[$xint] += $row['icmp']/$row['sample_duration'];
-       $udp[$xint] += $row['udp']/$row['sample_duration'];
-       $tcp[$xint] += $row['tcp']/$row['sample_duration'];
-       $ftp[$xint] += $row['ftp']/$row['sample_duration'];
-       $http[$xint] += $row['http']/$row['sample_duration'];
-       $p2p[$xint] += $row['p2p']/$row['sample_duration'];                                                                                                                             
-       }
-
-// One more time for the last IP
-AverageAndAccumulate();
-
-// Pull the data out of Accumulator
-$total = $a_total;
-$icmp = $a_icmp;
-$udp = $a_udp;
-$tcp = $a_tcp;
-$ftp = $a_ftp;
-$http = $a_http;
-$p2p = $a_p2p;
-
-$YMax += $YMax*0.05;    // Add an extra 5%
-
-// if a y scale was specified override YMax
-if (isset($yscale))
-    $YMax = $yscale/8;
-
-// Plot the data
-
-header("Content-type: image/png");
-
-$im = imagecreate($width, $height);
-$white = imagecolorallocate($im, 255, 255, 255);
-$yellow = ImageColorAllocate($im, 255, 255, 0);
-$purple = ImageColorAllocate($im, 255, 0, 255);
-$green  = ImageColorAllocate($im, 0, 255, 0);
-$blue   = ImageColorAllocate($im, 0, 0, 255);
-$lblue  = ImageColorAllocate($im, 128, 128, 255);
-$brown  = ImageColorAllocate($im, 128, 0, 0);
-$red    = ImageColorAllocate($im, 255, 0, 0);
-$black  = ImageColorAllocate($im, 0, 0, 0);
-
-for($Counter=XOFFSET+1; $Counter < $width; $Counter++)
-       {
-       if (isset($total[$Counter]))
-               {
-               // Convert the bytes/sec to y coords
-        $total[$Counter] = ($total[$Counter]*($height-YOFFSET))/$YMax;
-               $tcp[$Counter] = ($tcp[$Counter]*($height-YOFFSET))/$YMax;
-        $ftp[$Counter] = ($ftp[$Counter]*($height-YOFFSET))/$YMax;
-               $http[$Counter] = ($http[$Counter]*($height-YOFFSET))/$YMax;
-               $p2p[$Counter] = ($p2p[$Counter]*($height-YOFFSET))/$YMax;
-        $udp[$Counter] = ($udp[$Counter]*($height-YOFFSET))/$YMax;
-               $icmp[$Counter] = ($icmp[$Counter]*($height-YOFFSET))/$YMax;
-
-               // Stack 'em up!
-               // Total is stacked from the bottom
-               // Icmp is on the bottom too
-               // Udp is stacked on top of icmp
-               $udp[$Counter] += $icmp[$Counter];
-               // TCP and p2p are stacked on top of Udp
-               $tcp[$Counter] += $udp[$Counter];
-               $p2p[$Counter] += $udp[$Counter];
-               // Http is stacked on top of p2p
-               $http[$Counter] += $p2p[$Counter];
-               // Ftp is stacked on top of http
-        $ftp[$Counter] += $http[$Counter];
-
-               // Plot them!
-               //echo "$Counter:".$Counter." (h-y)-t:".($height-YOFFSET) - $total[$Counter]." h-YO-1:".$height-YOFFSET-1;
-        ImageLine($im, $Counter, ($height-YOFFSET) - $total[$Counter], $Counter, $height-YOFFSET-1, $yellow);
-        ImageLine($im, $Counter, ($height-YOFFSET) - $icmp[$Counter], $Counter, $height-YOFFSET-1, $red);
-        ImageLine($im, $Counter, ($height-YOFFSET) - $udp[$Counter], $Counter, ($height-YOFFSET) - $icmp[$Counter] - 1, $brown);
-        ImageLine($im, $Counter, ($height-YOFFSET) - $tcp[$Counter], $Counter, ($height-YOFFSET) - $udp[$Counter] - 1, $green);
-        ImageLine($im, $Counter, ($height-YOFFSET) - $p2p[$Counter], $Counter, ($height-YOFFSET) - $udp[$Counter] - 1, $purple);
-        ImageLine($im, $Counter, ($height-YOFFSET) - $http[$Counter], $Counter, ($height-YOFFSET) - $p2p[$Counter] - 1, $blue);
-        ImageLine($im, $Counter, ($height-YOFFSET) - $ftp[$Counter], $Counter, ($height-YOFFSET) - $http[$Counter] - 1, $lblue);
-               }
-//     else
-//             echo $Counter." not set<br>";
-       }                                                                                                                             
-
-// Margin Text
-if ($SentPeak < 1024/8)
-       $txtPeakSendRate = sprintf("Peak Send Rate: %.1f KBits/sec", $SentPeak*8);
-else if ($SentPeak < (1024*1024)/8)
-    $txtPeakSendRate = sprintf("Peak Send Rate: %.1f MBits/sec", ($SentPeak*8.0)/1024.0);
-else 
-       $txtPeakSendRate = sprintf("Peak Send Rate: %.1f GBits/sec", ($SentPeak*8.0)/(1024.0*1024.0));
-                                                                                                                             
-if ($TotalSent < 1024)
-       $txtTotalSent = sprintf("Sent %.1f KBytes", $TotalSent);
-else if ($TotalSent < 1024*1024)
-       $txtTotalSent = sprintf("Sent %.1f MBytes", $TotalSent/1024.0);
-else 
-       $txtTotalSent = sprintf("Sent %.1f GBytes", $TotalSent/(1024.0*1024.0));
-                                                                                                                             
-ImageString($im, 2, XOFFSET+5,  $height-20, $txtTotalSent, $black);
-ImageString($im, 2, $width/2+XOFFSET/2,  $height-20, $txtPeakSendRate, $black);
-
-// Draw X Axis
-
-ImageLine($im, 0, $height-YOFFSET, $width, $height-YOFFSET, $black);
-
-// Day/Month Seperator bars
-
-if ((24*60*60*($width-XOFFSET))/$interval > ($width-XOFFSET)/10)
-       {
-       $ts = getdate($timestamp);
-       $MarkTime = mktime(0, 0, 0, $ts['mon'], $ts['mday'], $ts['year']);
-       
-    $x = ts2x($MarkTime);
-    while ($x < XOFFSET)
-       {
-        $MarkTime += (24*60*60);
-           $x = ts2x($MarkTime);
-        }
-                                                                                                                             
-    while ($x < ($width-10))
-       {
-        // Day Lines
-        ImageLine($im, $x, 0, $x, $height-YOFFSET, $black);
-        ImageLine($im, $x+1, 0, $x+1, $height-YOFFSET, $black);
-                                                                                                                             
-        $txtDate = strftime("%a, %b %d", $MarkTime);
-        ImageString($im, 2, $x-30,  $height-YOFFSET+10, $txtDate, $black);
-                                                                                                                             
-        // Calculate Next x
-        $MarkTime += (24*60*60);
-           $x = ts2x($MarkTime);
-        }
-       }
-else if ((24*60*60*30*($width-XOFFSET))/$interval > ($width-XOFFSET)/10)
-       {
-       // Monthly Bars
-       $ts = getdate($timestamp);
-       $month = $ts['mon'];
-       $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
-       
-    $x = ts2x($MarkTime);
-    while ($x < XOFFSET)
-       {
-               $month++;
-        $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
-           $x = ts2x($MarkTime);
-        }
-                                                                                                                             
-    while ($x < ($width-10))
-       {
-        // Day Lines
-        ImageLine($im, $x, 0, $x, $height-YOFFSET, $black);
-        ImageLine($im, $x+1, 0, $x+1, $height-YOFFSET, $black);
-                                                                                                                             
-        $txtDate = strftime("%b, %Y", $MarkTime);
-        ImageString($im, 2, $x-25,  $height-YOFFSET+10, $txtDate, $black);
-                                                                                                                             
-        // Calculate Next x
-               $month++;
-        $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
-           $x = ts2x($MarkTime);
-        }
-       }
-else
-       {
-       // Year Bars
-    $ts = getdate($timestamp);
-    $year = $ts['year'];
-    $MarkTime = mktime(0, 0, 0, 1, 1, $year);
-                                                                                                                             
-    $x = ts2x($MarkTime);
-    while ($x < XOFFSET)
-        {
-        $year++;
-        $MarkTime = mktime(0, 0, 0, 1, 1, $year);
-        $x = ts2x($MarkTime);
-        }
-                                                                                                                             
-    while ($x < ($width-10))
-        {
-        // Day Lines
-        ImageLine($im, $x, 0, $x, $height-YOFFSET, $black);
-        ImageLine($im, $x+1, 0, $x+1, $height-YOFFSET, $black);
-                                                                                                                             
-        $txtDate = strftime("%b, %Y", $MarkTime);
-        ImageString($im, 2, $x-25,  $height-YOFFSET+10, $txtDate, $black);
-                                                                                                                             
-        // Calculate Next x
-        $year++;
-        $MarkTime = mktime(0, 0, 0, 1, 1, $year);
-        $x = ts2x($MarkTime);
-        }      
-       }
-
-// Draw Major Tick Marks
-if ((6*60*60*($width-XOFFSET))/$interval > 10) // pixels per 6 hours is more than 2
-       $MarkTimeStep = 6*60*60; // Major ticks are 6 hours
-else if ((24*60*60*($width-XOFFSET))/$interval > 10)
-       $MarkTimeStep = 24*60*60; // Major ticks are 24 hours;
-else if ((24*60*60*30*($width-XOFFSET))/$interval > 10)
-       {
-       // Major tick marks are months
-       $MarkTimeStep = 0; // Skip the standard way of drawing major tick marks below
-
-    $ts = getdate($timestamp);
-    $month = $ts['mon'];
-    $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
-                                                                                                                             
-    $x = ts2x($MarkTime);
-    while ($x < XOFFSET)
-        {
-        $month++;
-        $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
-        $x = ts2x($MarkTime);
-        }
-                                                                                                                             
-    while ($x < ($width-10))
-        {
-        // Day Lines
-               $date = getdate($MarkTime);
-               if ($date['mon'] != 1)
-                       {
-               ImageLine($im, $x, $height-YOFFSET-5, $x, $height-YOFFSET+5, $black);                                                                                                                      
-           $txtDate = strftime("%b", $MarkTime);
-               ImageString($im, 2, $x-5,  $height-YOFFSET+10, $txtDate, $black);
-               }
-                                                                                                                   
-        // Calculate Next x
-        $month++;
-        $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
-        $x = ts2x($MarkTime);
-        }
-       }
-else
-       $MarkTimeStep = 0; // Skip Major Tick Marks
-
-if ($MarkTimeStep)
-       {
-       $ts = getdate($timestamp);
-       $MarkTime = mktime(0, 0, 0, $ts['mon'], $ts['mday'], $ts['year']);
-       $x = ts2x($MarkTime);
-
-       while ($x < ($width-10))
-               {
-       if ($x > XOFFSET) 
-                       {
-           ImageLine($im, $x, $height-YOFFSET-5, $x, $height-YOFFSET+5, $black);
-               }
-               $MarkTime += $MarkTimeStep;
-           $x = ts2x($MarkTime);
-               }
-       }
-
-// Draw Minor Tick marks
-if ((60*60*($width-XOFFSET))/$interval > 4) // pixels per hour is more than 2
-       $MarkTimeStep = 60*60;  // Minor ticks are 1 hour
-else if ((6*60*60*($width-XOFFSET))/$interval > 4)
-       $MarkTimeStep = 6*60*60; // Minor ticks are 6 hours
-else if ((24*60*60*($width-XOFFSET))/$interval > 4)
-       $MarkTimeStep = 24*60*60;
-else
-       $MarkTimeStep = 0; // Skip minor tick marks
-
-if ($MarkTimeStep)
-       {
-       $ts = getdate($timestamp);
-       $MarkTime = mktime(0, 0, 0, $ts['mon'], $ts['mday'], $ts['year']);
-       $x = ts2x($MarkTime);
-
-       while ($x < ($width-10))
-               {
-       if ($x > XOFFSET) 
-                       {
-           ImageLine($im, $x, $height-YOFFSET, $x, $height-YOFFSET+5, $black);
-               }
-               $MarkTime += $MarkTimeStep;
-           $x = ts2x($MarkTime);
-               }
-       }
-
-// Draw Y Axis
-ImageLine($im, XOFFSET, 0, XOFFSET, $height, $black);
-
-$YLegend = 'k';
-$Divisor = 1;
-if ($YMax*8 > 1024*2)
-       {
-    $Divisor = 1024;    // Display in m
-    $YLegend = 'm';
-    }
-
-if ($YMax*8 > 1024*1024*2)
-       {
-    $Divisor = 1024*1024; // Display in g
-    $YLegend = 'g';
-       }
-
-if ($YMax*8 > 1024*1024*1024*2)
-       {
-    $Divisor = 1024*1024*1024; // Display in t
-    $YLegend = 't';
-    }
-                                                                                                                             
-$YStep = $YMax/10;
-if ($YStep < 1)
-       $YStep=1;
-$YTic=$YStep;
-                                                                                                                             
-while ($YTic <= ($YMax - $YMax/10))
-       {
-    $y = ($height-YOFFSET)-(($YTic*($height-YOFFSET))/$YMax);
-       ImageLine($im, XOFFSET, $y, $width, $y, $black);
-    $txtYLegend = sprintf("%4.1f %sbits/s", (8.0*$YTic)/$Divisor, $YLegend);
-    ImageString($im, 2, 3, $y-7, $txtYLegend, $black);
-       $YTic += $YStep;
-       }
-
-imagepng($im); 
-imagedestroy($im);
diff --git a/utils/bandwidthd-php/files/include.php b/utils/bandwidthd-php/files/include.php
deleted file mode 100644 (file)
index 6b435d1..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-define("INT_DAILY", 60*60*24*2);
-define("INT_WEEKLY", 60*60*24*8);
-define("INT_MONTHLY", 60*60*24*35);
-define("INT_YEARLY", 60*60*24*400);
-
-define("XOFFSET", 90);
-define("YOFFSET", 45);
-
-require("config.conf");
-
-function ConnectDb()
-    {
-       global $db_connect_string;
-
-    $db = pg_pconnect($db_connect_string);
-    if (!$db)
-        {
-        printf("DB Error, could not connect to database");
-        exit(1);
-        }
-    return($db);
-    }
-                                                                                                                             
-function fmtb($kbytes)
-       {
-       $Max = 1024;
-       $Output = $kbytes;
-       $Suffix = 'K';
-
-       if ($Output > $Max)
-               {
-               $Output /= 1024;
-               $Suffix = 'M';
-               }
-
-       if ($Output > $Max)
-               {
-               $Output /= 1024;
-               $Suffix = 'G';
-               }
-
-       if ($Output > $Max)
-               {
-               $Output /= 1024;
-               $Suffix = 'T';
-               }
-
-       return(sprintf("<td align=right><tt>%.1f%s</td>", $Output, $Suffix));
-       }
-
-$starttime = time();
-set_time_limit(300);
-?>
diff --git a/utils/bandwidthd-php/files/index.php b/utils/bandwidthd-php/files/index.php
deleted file mode 100644 (file)
index 5159f85..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-<?php
-include("include.php");
-?>
-<html>
-<center>
-<img src=logo.gif>
-<?php 
-// Get variables from url
-
-if (isset($_GET['sensor_name']) && $_GET['sensor_name'] != "none")
-    $sensor_name = $_GET['sensor_name'];
-
-if (isset($_GET['interval']) && $_GET['interval'] != "none")
-    $interval = $_GET['interval'];
-
-if (isset($_GET['timestamp']) && $_GET['timestamp'] != "none")
-    $timestamp = $_GET['timestamp'];
-
-if (isset($_GET['subnet']) && $_GET['subnet'] != "none")
-    $subnet = $_GET['subnet'];
-
-if (isset($_GET['limit']) && $_GET['limit'] != "none")
-       $limit = $_GET['limit'];
-
-
-$db = ConnectDb();
-?>
-<FORM name="navigation" method=get action=<?php echo $PHP_SELF?>>
-<table width=100% cellspacing=0 cellpadding=5 border=1>
-<tr>
-<td><SELECT name="sensor_name">
-
-<OPTION value="none">--Select A Sensor--
-<?php 
-$sql = "SELECT sensor_name from sensors order by sensor_name;";
-$result = pg_query($sql);
-while ($r = pg_fetch_array($result))
-    echo "<option value=\"".$r['sensor_name']."\" ".($sensor_name==$r['sensor_name']?"SELECTED":"").">".$r['sensor_name']."\n";
-?>
-</SELECT>
-<td><SELECT name="interval">
-<OPTION value="none">--Select An Interval--
-<OPTION value=<?php echo INT_DAILY?> <?php echo $interval==INT_DAILY?"SELECTED":""?>>Daily
-<OPTION value=<?php echo INT_WEEKLY?> <?php echo $interval==INT_WEEKLY?"SELECTED":""?>>Weekly
-<OPTION value=<?php echo INT_MONTHLY?> <?php echo $interval==INT_MONTHLY?"SELECTED":""?>>Monthly
-<OPTION value=<?php echo INT_YEARLY?> <?php echo $interval==INT_YEARLY?"SELECTED":""?>>Yearly
-<OPTION value=<?php echo 24*60*60?> <?php echo $interval==24*60*60?"SELECTED":""?>>24hrs
-<OPTION value=<?php echo 30*24*60*60?> <?php echo $interval==30*24*60*60?"SELECTED":""?>>30days
-</select>
-
-<td><SELECT name="limit">
-<OPTION value="none">--How Many Results--
-<OPTION value=20 <?php echo $limit==20?"SELECTED":""?>>20
-<OPTION value=50 <?php echo $limit==50?"SELECTED":""?>>50
-<OPTION value=100 <?php echo $limit==100?"SELECTED":""?>>100
-<OPTION value=all <?php echo $limit=="all"?"SELECTED":""?>>All
-</select>
-
-<td>Subnet Filter:<input name=subnet value="<?php echo isset($subnet)?$subnet:"0.0.0.0/0"?>"> 
-<input type=submit value="Go">
-</table>
-</FORM>
-<?php 
-// Set defaults
-if (!isset($interval))
-       $interval = DFLT_INTERVAL;
-
-if (!isset($timestamp))
-       $timestamp = time() - $interval + (0.05*$interval);
-
-if (!isset($limit))
-       $limit = 20;
-
-// Validation
-if (!isset($sensor_name))
-       exit(0);
-
-// Print Title
-
-if (isset($limit))
-       echo "<h2>Top $limit - $sensor_name</h2>";
-else
-       echo "<h2>All Records - $sensor_name</h2>";
-
-// Sqlize the incomming variables
-if (isset($subnet))
-       $sql_subnet = "and ip <<= '$subnet'";
-
-// Sql Statement
-$sql = "select tx.ip, rx.scale as rxscale, tx.scale as txscale, tx.total+rx.total as total, tx.total as sent, 
-rx.total as received, tx.tcp+rx.tcp as tcp, tx.udp+rx.udp as udp,
-tx.icmp+rx.icmp as icmp, tx.http+rx.http as http,
-tx.p2p+rx.p2p as p2p, tx.ftp+rx.ftp as ftp
-from
-
-(SELECT ip, max(total/sample_duration)*8 as scale, sum(total) as total, sum(tcp) as tcp, sum(udp) as udp, sum(icmp) as icmp,
-sum(http) as http, sum(p2p) as p2p, sum(ftp) as ftp
-from sensors, bd_tx_log
-where sensor_name = '$sensor_name'
-and sensors.sensor_id = bd_tx_log.sensor_id
-$sql_subnet
-and timestamp > $timestamp::abstime and timestamp < ".($timestamp+$interval)."::abstime
-group by ip) as tx,
-
-(SELECT ip, max(total/sample_duration)*8 as scale, sum(total) as total, sum(tcp) as tcp, sum(udp) as udp, sum(icmp) as icmp,
-sum(http) as http, sum(p2p) as p2p, sum(ftp) as ftp
-from sensors, bd_rx_log
-where sensor_name = '$sensor_name'
-and sensors.sensor_id = bd_rx_log.sensor_id
-$sql_subnet
-and timestamp > $timestamp::abstime and timestamp < ".($timestamp+$interval)."::abstime
-group by ip) as rx
-
-where tx.ip = rx.ip
-order by total desc;";
-
-//echo "</center><pre>$sql</pre><center>"; exit(0);
-pg_query("SET sort_mem TO 30000;");
-$result = pg_query($sql);
-pg_query("set sort_mem to default;");
-
-if ($limit == "all")
-       $limit = pg_num_rows($result);
-
-echo "<table width=100% border=1 cellspacing=0><tr><td>Ip<td>Name<td>Total<td>Sent<td>Received<td>tcp<td>udp<td>icmp<td>http<td>p2p<td>ftp";
-
-if (!isset($subnet)) // Set this now for total graphs
-       $subnet = "0.0.0.0/0";
-
-// Output Total Line
-echo "<TR><TD><a href=Total>Total</a><TD>$subnet";
-foreach (array("total", "sent", "received", "tcp", "udp", "icmp", "http", "p2p", "ftp") as $key)
-       {
-       for($Counter=0, $Total = 0; $Counter < pg_num_rows($result); $Counter++)
-               {
-               $r = pg_fetch_array($result, $Counter);
-               $Total += $r[$key];
-               }
-       echo fmtb($Total);
-       }
-echo "\n";
-
-// Output Other Lines
-for($Counter=0; $Counter < pg_num_rows($result) && $Counter < $limit; $Counter++)
-       {
-       $r = pg_fetch_array($result, $Counter);
-       echo "<tr><td><a href=#".$r['ip'].">";
-       echo $r['ip']."<td>".gethostbyaddr($r['ip']);
-       echo "</a>";
-       echo fmtb($r['total']).fmtb($r['sent']).fmtb($r['received']).
-               fmtb($r['tcp']).fmtb($r['udp']).fmtb($r['icmp']).fmtb($r['http']).
-               fmtb($r['p2p']).fmtb($r['ftp'])."\n";
-       }
-echo "</table></center>";
-
-// Output Total Graph
-for($Counter=0, $Total = 0; $Counter < pg_num_rows($result); $Counter++)
-       {
-       $r = pg_fetch_array($result, $Counter);
-       $scale = max($r['txscale'], $scale);
-       $scale = max($r['rxscale'], $scale);
-       }
-
-if ($subnet == "0.0.0.0/0")
-       $total_table = "bd_tx_total_log";
-else
-       $total_table = "bd_tx_log";
-echo "<a name=Total><h3><a href=details.php?sensor_name=$sensor_name&ip=$subnet>";
-echo "Total - Total of $subnet</h3>";
-echo "</a>";
-echo "Send:<br><img src=graph.php?ip=$subnet&interval=$interval&sensor_name=".$sensor_name."&table=$total_table><br>";
-echo "<img src=legend.gif><br>\n";
-if ($subnet == "0.0.0.0/0")
-       $total_table = "bd_rx_total_log";
-else
-       $total_table = "bd_rx_log";
-echo "Receive:<br><img src=graph.php?ip=$subnet&interval=$interval&sensor_name=".$sensor_name."&table=$total_table><br>";
-echo "<img src=legend.gif><br>\n";
-
-
-// Output Other Graphs
-for($Counter=0; $Counter < pg_num_rows($result) && $Counter < $limit; $Counter++) 
-       {
-       $r = pg_fetch_array($result, $Counter);
-       echo "<a name=".$r['ip']."><h3><a href=details.php?sensor_name=$sensor_name&ip=".$r['ip'].">";
-       if ($r['ip'] == "0.0.0.0")
-               echo "Total - Total of all subnets</h3>";
-       else
-               echo $r['ip']." - ".gethostbyaddr($r['ip'])."</h3>";
-       echo "</a>";
-       echo "Send:<br><img src=graph.php?ip=".$r['ip']."&interval=$interval&sensor_name=".$sensor_name."&table=bd_tx_log&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
-       echo "<img src=legend.gif><br>\n";
-       echo "Receive:<br><img src=graph.php?ip=".$r['ip']."&interval=$interval&sensor_name=".$sensor_name."&table=bd_rx_log&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
-       echo "<img src=legend.gif><br>\n";
-       }
-
-include('footer.php');
diff --git a/utils/bandwidthd-php/files/legend.gif b/utils/bandwidthd-php/files/legend.gif
deleted file mode 100644 (file)
index 3df9090..0000000
Binary files a/utils/bandwidthd-php/files/legend.gif and /dev/null differ
diff --git a/utils/bandwidthd-php/files/logo.gif b/utils/bandwidthd-php/files/logo.gif
deleted file mode 100644 (file)
index 2ffec56..0000000
Binary files a/utils/bandwidthd-php/files/logo.gif and /dev/null differ
index 3d6514a5ed790d927ad99425e66cee64668c1ea3..955e735017e75d525e1435a5ce322682958508b0 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2015 OpenWrt.org
+# Copyright (C) 2006-2017 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:=bandwidthd
-PKG_VERSION:=2.0.1
-PKG_RELEASE:=5
+PKG_VERSION:=2.0.1-34
+PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
-PKG_SOURCE_URL:=@SF/bandwidthd
-PKG_MD5SUM:=aa79aad7bd489fd2cae1f7dc086ca8b6
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/NethServer/bandwidthd/archive/$(PKG_VERSION)
+PKG_MD5SUM:=a4075335d06fe91ae815616ed9e27375
 
 PKG_MAINTAINER:=Jean-Michel Lacroix <lacroix@lepine-lacroix.info>
 
@@ -21,6 +21,8 @@ PKG_LICENSE:=GPL-2.0
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 
+PKG_FIXUP:=autoreconf
+
 include $(INCLUDE_DIR)/package.mk
 
 define Package/bandwidthd/Default
@@ -32,8 +34,8 @@ endef
 
 define Package/bandwidthd
 $(call Package/bandwidthd/Default)
-  TITLE += (without postgresql)
-  VARIANT:=no-pgsql
+  TITLE += (without database)
+  VARIANT:=no-db
   DEPENDS:=+libgd +libpcap
 endef
 
@@ -44,6 +46,20 @@ $(call Package/bandwidthd/Default)
   DEPENDS:=+libgd +libpcap +libpq
 endef
 
+define Package/bandwidthd-sqlite
+$(call Package/bandwidthd/Default)
+  TITLE += (with sqlite enabled)
+  VARIANT:=sqlite
+  DEPENDS:=+libgd +libpcap +libsqlite3 +php7 +php7-cgi +php7-mod-gd +php7-mod-pdo +php7-mod-pdo-sqlite
+endef
+
+define Package/bandwidthd-php
+$(call Package/bandwidthd/Default)
+  TITLE = PHP files to graph bandwidthd data from postgresql
+  VARIANT:=php
+  DEPENDS:=+libpcre +libxml2 +php7 +php7-cgi +php7-mod-pgsql +php7-mod-gd
+endef
+
 define Package/bandwidthd/description
   A bandwidthd tracking utility.
 endef
@@ -53,15 +69,32 @@ $(call Package/bandwidthd/description)
 With the ability to store in a postgresql database.
 endef
 
+define Package/bandwidthd-sqlite/description
+$(call Package/bandwidthd/description)
+With the ability to store in a sqlite database.
+endef
+
+define Package/bandwidthd-php/description
+  PHP files to graph bandwidthd data from pgsql.
+endef
+
 define Package/bandwidthd/daemon
- This package contains bandwidthd a bandwidth tracking utility.
+ This package contains bandwidthd, a bandwidth tracking utility.
 endef
 
 define Package/bandwidthd-pgsql/daemon
- This package contains bandwidthd a bandwidth tracking utility.
+ This package contains bandwidthd, a bandwidth tracking utility.
+endef
+
+define Package/bandwidthd-sqlite/daemon
+ This package contains bandwidthd, a bandwidth tracking utility.
+endef
+
+define Package/bandwidthd-php/daemon
+ This package contains the PHP files to graph the data from a pgsql database.
 endef
 
-ifeq ($(BUILD_VARIANT),no-pgsql)
+ifeq ($(BUILD_VARIANT),no-db)
 CONFIGURE_ARGS += \
        ac_cv_file__sw_lib=no \
        ac_cv_file__sw_include=no \
@@ -69,20 +102,45 @@ CONFIGURE_ARGS += \
        ac_cv_file__usr_pkg_include=no \
        ac_cv_file__usr_local_pgsql_lib=no \
        ac_cv_file__usr_local_pgsql_include=no \
-       ac_cv_lib_pq_PQconnectdb=no 
+       ac_cv_lib_pq_PQconnectdb=no \
+       ac_cv_lib_sqlite3_sqlite3_open=no
 endif
 
 ifeq ($(BUILD_VARIANT),pgsql)
 CONFIGURE_ARGS += \
-        ac_cv_file__sw_lib=no \
-        ac_cv_file__sw_include=no \
-        ac_cv_file__usr_pkg_lib=no \
-        ac_cv_file__usr_pkg_include=no \
-        ac_cv_file__usr_local_pgsql_lib=no \
-        ac_cv_file__usr_local_pgsql_include=no
+       ac_cv_file__sw_lib=no \
+       ac_cv_file__sw_include=no \
+       ac_cv_file__usr_pkg_lib=no \
+       ac_cv_file__usr_pkg_include=no \
+       ac_cv_file__usr_local_pgsql_lib=no \
+       ac_cv_file__usr_local_pgsql_include=no \
+       ac_cv_lib_sqlite3_sqlite3_open=no
 endif
 
-EXTRA_CFLAGS+= $(TARGET_CPPFLAGS) -std=gnu89
+ifeq ($(BUILD_VARIANT),sqlite)
+CONFIGURE_ARGS += \
+       ac_cv_file__sw_lib=no \
+       ac_cv_file__sw_include=no \
+       ac_cv_file__usr_pkg_lib=no \
+       ac_cv_file__usr_pkg_include=no \
+       ac_cv_file__usr_local_pgsql_lib=no \
+       ac_cv_file__usr_local_pgsql_include=no \
+       ac_cv_lib_pq_PQconnectdb=no
+endif
+
+ifeq ($(BUILD_VARIANT),php)
+CONFIGURE_ARGS += \
+       ac_cv_file__sw_lib=no \
+       ac_cv_file__sw_include=no \
+       ac_cv_file__usr_pkg_lib=no \
+       ac_cv_file__usr_pkg_include=no \
+       ac_cv_file__usr_local_pgsql_lib=no \
+       ac_cv_file__usr_local_pgsql_include=no \
+       ac_cv_lib_pq_PQconnectdb=no \
+       ac_cv_lib_sqlite3_sqlite3_open=no
+endif
+
+EXTRA_CFLAGS+= $(TARGET_CPPFLAGS)
 EXTRA_LDFLAGS+= $(TARGET_LDFLAGS) -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
 
 define Package/bandwidthd/install
@@ -93,8 +151,8 @@ define Package/bandwidthd/install
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/bandwidthd.init $(1)/etc/init.d/bandwidthd
        $(INSTALL_DIR) $(1)/www
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/htdocs/legend.gif $(1)/www/
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/htdocs/logo.gif $(1)/www/
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/phphtdocs/legend.gif $(1)/www/
+       $(INSTALL_DATA) ./files/logo-openwrt.gif $(1)/www/logo.gif
 endef
 
 define Package/bandwidthd-pgsql/install
@@ -103,15 +161,50 @@ define Package/bandwidthd-pgsql/install
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_DATA) ./files/bandwidthd-pgsql.config $(1)/etc/config/bandwidthd
        $(INSTALL_DIR) $(1)/etc/init.d
-       $(INSTALL_BIN) ./files/bandwidthd-pgsql.init $(1)/etc/init.d/bandwidthd
-       $(INSTALL_DIR) $(1)/www/phphtdocs
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/htdocs/legend.gif $(1)/www/
-       $(INSTALL_DATA) ./files/logo.gif $(1)/www/
+       $(INSTALL_BIN) ./files/bandwidthd.init $(1)/etc/init.d/bandwidthd
+       $(INSTALL_DIR) $(1)/www
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/phphtdocs/legend.gif $(1)/www/
+       $(INSTALL_DATA) ./files/logo-openwrt.gif $(1)/www/logo.gif
        $(INSTALL_DIR) $(1)/usr/share/postgresql
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/schema.postgresql $(1)/usr/share/postgresql
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/phphtdocs/bd_pgsql_purge.sh $(1)/usr/share/postgresql
 endef
 
+define Package/bandwidthd-sqlite/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bandwidthd $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_DATA) ./files/bandwidthd-sqlite.config $(1)/etc/config/bandwidthd
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/bandwidthd-sqlite.init $(1)/etc/init.d/bandwidthd
+       $(INSTALL_DIR) $(1)/www/phphtdocs
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/phphtdocs/legend.gif $(1)/www/phphtdocs/
+       $(INSTALL_DATA) ./files/phphtdocs-sqlite/details.php $(1)/www/phphtdocs/
+       $(INSTALL_DATA) ./files/phphtdocs-sqlite/footer.php $(1)/www/phphtdocs/
+       $(INSTALL_DATA) ./files/phphtdocs-sqlite/graph.php $(1)/www/phphtdocs/
+       $(INSTALL_DATA) ./files/phphtdocs-sqlite/include.php $(1)/www/phphtdocs/
+       $(INSTALL_DATA) ./files/phphtdocs-sqlite/index.php $(1)/www/phphtdocs/
+       $(INSTALL_DATA) ./files/logo-openwrt.gif $(1)/www/phphtdocs/logo.gif
+       ln -s /var/etc/bandwidthd-php.conf $(1)/www/phphtdocs/config.conf.php
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/phphtdocs/legend.gif $(1)/www/
+       $(INSTALL_DATA) ./files/logo-openwrt.gif $(1)/www/logo.gif
+endef
+
+define Package/bandwidthd-php/install
+       $(INSTALL_DIR) $(1)/www/phphtdocs
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/phphtdocs/legend.gif $(1)/www/phphtdocs/
+       $(INSTALL_DATA) ./files/phphtdocs/details.php $(1)/www/phphtdocs/
+       $(INSTALL_DATA) ./files/phphtdocs/footer.php $(1)/www/phphtdocs/
+       $(INSTALL_DATA) ./files/phphtdocs/graph.php $(1)/www/phphtdocs/
+       $(INSTALL_DATA) ./files/phphtdocs/include.php $(1)/www/phphtdocs/
+       $(INSTALL_DATA) ./files/phphtdocs/index.php $(1)/www/phphtdocs/
+       $(INSTALL_DATA) ./files/logo-openwrt.gif $(1)/www/phphtdocs/logo.gif
+       ln -s /var/etc/bandwidthd-php.conf $(1)/www/phphtdocs/config.conf
+       $(INSTALL_DIR) $(1)//etc/config
+       $(INSTALL_CONF) ./files/bandwidthd-php.config $(1)/etc/config/bandwidthd-php
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/bandwidthd-php.init $(1)/etc/init.d/bandwidthd-php
+endef
+
 define Package/bandwidthd/conffiles
 /etc/config/bandwidthd
 endef
@@ -120,5 +213,15 @@ define Package/bandwidthd-pgsql/conffiles
 /etc/config/bandwidthd
 endef
 
+define Package/bandwidthd-sqlite/conffiles
+/etc/config/bandwidthd
+endef
+
+define Package/bandwidthd-php/conffiles
+/etc/config/bandwidthd-php
+endef
+
 $(eval $(call BuildPackage,bandwidthd))
 $(eval $(call BuildPackage,bandwidthd-pgsql))
+$(eval $(call BuildPackage,bandwidthd-sqlite))
+$(eval $(call BuildPackage,bandwidthd-php))
index 0f87687925ce137d0b55837c3041fd320b2ab1ad..f94c737a56abed45736b1d4d55e6e971d66cd48d 100644 (file)
@@ -1,5 +1,5 @@
 config bandwidthd
-       option dev      br-lan
+       option dev              br-lan
        option subnets          "192.168.1.0/24"
        option skip_intervals   0
        option graph_cutoff     1024
@@ -9,5 +9,5 @@ config bandwidthd
        option filter           ip
        option graph            true
        option meta_refresh     150
-       option disabled_pgsql_connect_string    "user = postgres dbname = bandwidthd host = 192.168.1.1"
-       option disabled_sensor_id       "openwrt.mydomain.domain"
+       option pgsql_connect_string     "user = postgres dbname = bandwidthd host = 192.168.1.1"
+       option sensor_id        "openwrt"
diff --git a/utils/bandwidthd/files/bandwidthd-pgsql.init b/utils/bandwidthd/files/bandwidthd-pgsql.init
deleted file mode 100644 (file)
index 232fa0c..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2008-2015 OpenWrt.org
-
-START=99
-
-config_cb() {
-       local cfg_type="$1"
-       local cfg_name="$2"
-
-       case "$cfg_type" in
-               bandwidthd)
-                       append cfgs "$cfg_name"
-               ;;
-       esac
-}
-
-export_bool() {
-       local option="$1"
-       local section="$2"
-       local _loctmp
-       config_get_bool _loctmp "$section" "$option"
-       if [ -n "$_loctmp" ]; then
-               conffile="${conffile}$option "
-               if [ 1 -eq "$_loctmp" ]; then
-                       conffile="${conffile}true"
-               else
-                       conffile="${conffile}false"
-               fi
-               conffile="${conffile}\n"
-       fi
-}
-
-export_number() {
-       local option="$1"
-       local section="$2"
-       local _loctmp
-       config_get _loctmp "$section" "$option"
-       if [ -n "$_loctmp" ]; then
-               conffile="${conffile}$option ${_loctmp}\n"
-       fi
-}
-
-export_string() {
-       local option="$1"
-       local section="$2"
-       local _loctmp
-       config_get _loctmp "$section" "$option"
-       if [ -n "$_loctmp" ]; then
-               conffile="${conffile}$option \"${_loctmp}\"\n"
-       fi
-}
-
-start() {
-       local subnet conffile
-
-       [ -d /tmp/bandwidthd ] || mkdir -p /tmp/bandwidthd && cp /www/legend.gif /www/logo.gif /tmp/bandwidthd/
-       [ -e /htdocs ] || ln -s /tmp/bandwidthd /htdocs
-       [ -e /www/bandwidthd ] || ln -s /tmp/bandwidthd /www/bandwidthd
-       rm -f /tmp/bandwidthd.conf
-       touch /tmp/bandwidthd.conf
-       [ -e /etc/bandwidthd.conf ] || ln -s /tmp/bandwidthd.conf /etc/bandwidthd.conf
-       
-       
-       config_load bandwidthd
-       for cfg in $cfgs; do
-               config_get subnets $cfg subnets
-                       for subnet in $subnets; do
-                               conffile="${conffile}subnet ${subnet}\n"
-                       done
-               export_string dev $cfg
-               export_number skip_intervals $cfg
-               export_number graph_cutoff $cfg
-               export_bool promiscuous $cfg
-               export_bool output_cdf $cfg
-               export_bool recover_cdf $cfg
-               export_string filter $cfg
-               export_bool graph $cfg
-               export_number meta_refresh $cfg
-               export_string pgsql_connect_string $cfg
-               export_string sensor_id $cfg
-               [ -n "$conffile" ] && echo -e "$conffile" >>/tmp/bandwidthd.conf
-               unset conffile
-       done
-       cd /
-       service_start /usr/sbin/bandwidthd
-}
-
-stop() {
-       service_stop /usr/sbin/bandwidthd
-}
diff --git a/utils/bandwidthd/files/bandwidthd-php.config b/utils/bandwidthd/files/bandwidthd-php.config
new file mode 100644 (file)
index 0000000..3bad494
--- /dev/null
@@ -0,0 +1,7 @@
+config bandwidthd-php
+       option dflt_width       '900'
+       option dflt_height      '256'
+       option dflt_interval    'INT_DAILY'
+       option host             '127.0.0.1'
+       option user             'postgres'
+       option dbname           'bandwidthd'
diff --git a/utils/bandwidthd/files/bandwidthd-php.init b/utils/bandwidthd/files/bandwidthd-php.init
new file mode 100755 (executable)
index 0000000..b7b6434
--- /dev/null
@@ -0,0 +1,75 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2017 OpenWrt.org
+
+START=99
+
+USE_PROCD=1
+
+CONFIGNAME="bandwidthd-php"
+CONFIGFILE="/var/etc/bandwidthd-php.conf"
+
+config_cb() {
+       local cfg_type="$1"
+       local cfg_name="$2"
+       case "$cfg_type" in
+               $CONFIGNAME)
+                       append cfgs "$cfg_name"
+               ;;
+       esac
+}
+
+export_number() {
+       local option="$1"
+       local section="$2"
+       local _loctmp
+       paramstr=""
+       config_get _loctmp "$section" "$option"
+       if [ -n "$_loctmp" ]; then
+               paramstr="${_loctmp}"
+       fi
+}
+
+export_string() {
+       local option="$1"
+       local section="$2"
+       local _loctmp
+       paramstr=""
+       config_get _loctmp "$section" "$option"
+       if [ -n "$_loctmp" ]; then
+               paramstr="${_loctmp}"
+       fi
+}
+
+service_triggers()
+{
+        procd_add_reload_trigger $CONFIGNAME
+}
+
+
+start_service() {
+       local conffile="<?php\n// auto-generated config file from /etc/config/${CONFIGNAME}\n"
+        rm -f $CONFIGFILE
+        touch $CONFIGFILE
+
+       config_load $CONFIGNAME
+       for cfg in $cfgs; do
+               export_number dflt_width $cfg
+               conffile="${conffile}define(\"DFLT_WIDTH\", ${paramstr:-"900"});\n"
+
+               export_number dflt_height $cfg
+                       conffile="${conffile}define(\"DFLT_HEIGHT\", ${paramstr:-"256"});\n"
+
+               export_string dflt_interval $cfg
+               conffile="${conffile}define(\"DFLT_INTERVAL\", ${paramstr:-"INT_DAILY"});\n\n"'$db_connect_string = "host='
+
+               export_string host $cfg
+               conffile="${conffile}${paramstr:-"127.0.0.1"} user="
+
+               export_string user $cfg
+               conffile="${conffile}${paramstr:-"postgres"} dbname="
+
+               export_string dbname $cfg
+               conffile="${conffile}${paramstr:-"bandwidthd"}"'"'"\n?>"
+               [ -n "$conffile" ] && echo -e "$conffile" >>$CONFIGFILE
+       done
+}
diff --git a/utils/bandwidthd/files/bandwidthd-sqlite.config b/utils/bandwidthd/files/bandwidthd-sqlite.config
new file mode 100644 (file)
index 0000000..bc4154a
--- /dev/null
@@ -0,0 +1,13 @@
+config bandwidthd
+       option dev              br-lan
+       option subnets          "192.168.1.0/24"
+       option skip_intervals   0
+       option graph_cutoff     1024
+       option promiscuous      true
+       option output_cdf       false
+       option recover_cdf      false
+       option filter           ip
+       option graph            true
+       option meta_refresh     150
+       option sqlite_filename  "/www/bandwidthd/stats.db"
+       option sensor_id        "default"
diff --git a/utils/bandwidthd/files/bandwidthd-sqlite.init b/utils/bandwidthd/files/bandwidthd-sqlite.init
new file mode 100755 (executable)
index 0000000..c456974
--- /dev/null
@@ -0,0 +1,133 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2008-2017 OpenWrt.org
+
+START=99
+
+USE_PROCD=1
+
+CONFIGNAME="bandwidthd"
+CONFIGPHPNAME="bandwidthd-php"
+CONFIGFILE="/tmp/etc/bandwidthd.conf"
+CONFIGPHPFILE="/tmp/etc/bandwidthd-php.conf"
+
+config_cb() {
+       local cfg_type="$1"
+       local cfg_name="$2"
+
+       case "$cfg_type" in
+               bandwidthd)
+                       append cfgs "$cfg_name"
+               ;;
+       esac
+}
+
+export_bool() {
+       local option="$1"
+       local section="$2"
+       local _loctmp
+       config_get_bool _loctmp "$section" "$option"
+       if [ -n "$_loctmp" ]; then
+               conffile="${conffile}$option "
+               if [ 1 -eq "$_loctmp" ]; then
+                       conffile="${conffile}true"
+               else
+                       conffile="${conffile}false"
+               fi
+               conffile="${conffile}\n"
+       fi
+}
+
+export_number() {
+       local option="$1"
+       local section="$2"
+       local _loctmp
+       config_get _loctmp "$section" "$option"
+       if [ -n "$_loctmp" ]; then
+               conffile="${conffile}$option ${_loctmp}\n"
+       fi
+}
+
+export_string() {
+       local option="$1"
+       local section="$2"
+       local _loctmp
+       config_get _loctmp "$section" "$option"
+       if [ -n "$_loctmp" ]; then
+               conffile="${conffile}$option \"${_loctmp}\"\n"
+       fi
+}
+
+set_conf_file() {
+       local subnet conffile="# auto-generated config file from /etc/config/${CONFIGNAME}\n"
+
+       [ -d /tmp/bandwidthd ] || mkdir -p /tmp/bandwidthd && cp /www/legend.gif /www/logo.gif /tmp/bandwidthd/
+       [ -e /htdocs ] || ln -s /tmp/bandwidthd /htdocs
+       [ -e /www/bandwidthd ] || ln -s /tmp/bandwidthd /www/bandwidthd
+       rm -f $CONFIGFILE
+       touch $CONFIGFILE
+       [ -e /etc/bandwidthd.conf ] || ln -s $CONFIGFILE /etc/bandwidthd.conf
+
+       config_load $CONFIGNAME
+       for cfg in $cfgs; do
+               config_get subnets $cfg subnets
+                       for subnet in $subnets; do
+                               conffile="${conffile}subnet ${subnet}\n"
+                       done
+               export_string dev $cfg
+               export_number skip_intervals $cfg
+               export_number graph_cutoff $cfg
+               export_bool promiscuous $cfg
+               export_bool output_cdf $cfg
+               export_bool recover_cdf $cfg
+               export_string filter $cfg
+               export_bool graph $cfg
+               export_number meta_refresh $cfg
+               export_string pgsql_connect_string $cfg
+               export_string sqlite_filename $cfg
+               export_string sensor_id $cfg
+               [ -n "$conffile" ] && echo -e "$conffile" >>$CONFIGFILE
+               unset conffile
+       done
+       cd /
+}
+
+set_php_conf_file() {
+        local subnet conffile="<?php\n// auto-generated config file from /etc/config/${CONFIGPHPNAME}\n"
+
+        rm -f $CONFIGPHPFILE
+        touch $CONFIGPHPFILE
+
+        config_load $CONFIGPHPNAME
+        for cfg in $cfgs; do
+               export_number dflt_width $cfg
+               conffile="${conffile}define(\"DFLT_WIDTH\", ${paramstr:-"900"});\n"
+
+               export_number dflt_height $cfg
+                       conffile="${conffile}define(\"DFLT_HEIGHT\", ${paramstr:-"256"});\n"
+
+               export_string dflt_interval $cfg
+               conffile="${conffile}define(\"DFLT_INTERVAL\", ${paramstr:-"INT_DAILY"});\n\n"'$db_connect_string = "sqlite:'
+
+               export_string sqlite_dbname $cfg
+               conffile="${conffile}${paramstr:-"/www/bandwidthd/stats.db"}"'"'"\n?>"
+               [ -n "$conffile" ] && echo -e "$conffile" >>$CONFIGPHPFILE
+        done
+        cd /
+}
+
+service_triggers() {
+        procd_add_reload_trigger $CONFIGNAME
+        procd_add_reload_trigger $CONFIGPHPNAME
+}
+
+start_service() {
+       set_conf_file
+       set_php_conf_file
+       procd_open_instance
+       procd_set_param command /usr/sbin/bandwidthd
+       procd_close_instance
+}
+
+stop_service() {
+       service_stop /usr/sbin/bandwidthd
+}
index 0769b1c8eaded84bfb10f17a5f8776c74398689b..ac1669ef40f959aeba81a71eba4f6da1acb5ed6d 100644 (file)
@@ -1,5 +1,5 @@
 config bandwidthd
-       option dev      br-lan
+       option dev              br-lan
        option subnets          "192.168.1.0/24"
        option skip_intervals   0
        option graph_cutoff     1024
old mode 100644 (file)
new mode 100755 (executable)
index 38d9cb1..ac9d01d
@@ -1,8 +1,13 @@
 #!/bin/sh /etc/rc.common
-# Copyright (C) 2008-2015 OpenWrt.org
+# Copyright (C) 2008-2017 OpenWrt.org
 
 START=99
 
+USE_PROCD=1
+
+CONFIGNAME="bandwidthd"
+CONFIGFILE="/tmp/etc/bandwidthd.conf"
+
 config_cb() {
        local cfg_type="$1"
        local cfg_name="$2"
@@ -50,18 +55,17 @@ export_string() {
        fi
 }
 
-start() {
+set_conf_file() {
        local subnet conffile
 
        [ -d /tmp/bandwidthd ] || mkdir -p /tmp/bandwidthd && cp /www/legend.gif /www/logo.gif /tmp/bandwidthd/
        [ -e /htdocs ] || ln -s /tmp/bandwidthd /htdocs
        [ -e /www/bandwidthd ] || ln -s /tmp/bandwidthd /www/bandwidthd
-       rm -f /tmp/bandwidthd.conf
-       touch /tmp/bandwidthd.conf
-       [ -e /etc/bandwidthd.conf ] || ln -s /tmp/bandwidthd.conf /etc/bandwidthd.conf
+       rm -f $CONFIGFILE
+       touch $CONFIGFILE
+       [ -e /etc/bandwidthd.conf ] || ln -s $CONFIGFILE /etc/bandwidthd.conf
        
-       
-       config_load bandwidthd
+       config_load $CONFIGNAME
        for cfg in $cfgs; do
                config_get subnets $cfg subnets
                        for subnet in $subnets; do
@@ -76,13 +80,27 @@ start() {
                export_string filter $cfg
                export_bool graph $cfg
                export_number meta_refresh $cfg
-               [ -n "$conffile" ] && echo -e "$conffile" >>/tmp/bandwidthd.conf
+               export_string pgsql_connect_string $cfg
+               export_string sqlite_filename $cfg
+               export_string sensor_id $cfg
+               [ -n "$conffile" ] && echo -e "$conffile" >>$CONFIGFILE
                unset conffile
        done
        cd /
-       service_start /usr/sbin/bandwidthd
 }
 
-stop() {
+service_triggers()
+{
+       procd_add_reload_trigger $CONFIGNAME
+}
+
+start_service() {
+       set_conf_file
+       procd_open_instance
+       procd_set_param command /usr/sbin/bandwidthd
+       procd_close_instance    
+}
+
+stop_service() {
        service_stop /usr/sbin/bandwidthd
 }
diff --git a/utils/bandwidthd/files/logo-openwrt.gif b/utils/bandwidthd/files/logo-openwrt.gif
new file mode 100644 (file)
index 0000000..2ffec56
Binary files /dev/null and b/utils/bandwidthd/files/logo-openwrt.gif differ
diff --git a/utils/bandwidthd/files/logo.gif b/utils/bandwidthd/files/logo.gif
deleted file mode 100644 (file)
index 2ffec56..0000000
Binary files a/utils/bandwidthd/files/logo.gif and /dev/null differ
diff --git a/utils/bandwidthd/files/phphtdocs-sqlite/details.php b/utils/bandwidthd/files/phphtdocs-sqlite/details.php
new file mode 100644 (file)
index 0000000..448ea46
--- /dev/null
@@ -0,0 +1,104 @@
+<?php
+include("include.php");
+?>
+<html>
+<center>
+<img src=logo.gif>
+<?php
+if (isset($_GET['sensor_name']))
+    $sensor_name = $_GET['sensor_name'];
+else
+    {
+    echo "<br>Please provide a sensor_name";
+    exit(1);
+    }
+
+if (isset($_GET['ip']))
+    $ip = $_GET['ip'];
+else
+    {
+    echo "<br>Please provide an ip address";
+    exit(1);
+    }
+                                                                                                                             
+echo "<h3>";
+if (strpos($ip, "/") === FALSE)
+       echo "$ip - ".gethostbyaddr($ip)."</h3>";
+else
+       echo "Total - $ip</h3>";
+
+$db = ConnectDb();
+
+if ($ip == "0.0.0.0/0")
+       {
+    $rxtable = "bd_rx_total_log";
+       $txtable = "bd_tx_total_log";
+       }
+else
+       {
+    $rxtable = "bd_rx_log";
+       $txtable = "bd_tx_log";
+       }
+
+$sql = "select rx.scale as rxscale, tx.scale as txscale, tx.total+rx.total as total, tx.total as sent,
+rx.total as received, tx.tcp+rx.tcp as tcp, tx.udp+rx.udp as udp,
+tx.icmp+rx.icmp as icmp, tx.http+rx.http as http,
+tx.p2p+rx.p2p as p2p, tx.ftp+rx.ftp as ftp
+from
+                                                                                                                             
+(SELECT ip, max(total/sample_duration)*8 as scale, sum(total) as total, sum(tcp) as tcp, sum(udp) as udp, sum(icmp) as icmp,
+sum(http) as http, sum(p2p) as p2p, sum(ftp) as ftp
+from sensors, $txtable
+where sensor_name = '$sensor_name'
+and sensors.sensor_id = ".$txtable.".sensor_id
+$sql_subnet
+group by ip) as tx,
+                                                                                                                             
+(SELECT ip, max(total/sample_duration)*8 as scale, sum(total) as total, sum(tcp) as tcp, sum(udp) as udp, sum(icmp) as icmp,
+sum(http) as http, sum(p2p) as p2p, sum(ftp) as ftp
+from sensors, $rxtable
+where sensor_name = '$sensor_name'
+and sensors.sensor_id = ".$rxtable.".sensor_id
+$sql_subnet
+group by ip) as rx
+                                                                                                                             
+where tx.ip = rx.ip;";
+//error_log($sql); printf('</center><tt>%s</tt><center>', $sql);
+$db = ConnectDb();
+$result = $db->query($sql);
+echo "<table width=100% border=1 cellspacing=0><tr><td>Ip<td>Name<td>Total<td>Sent<td>Received<td>tcp<td>udp<td>icmp<td>http<td>smtp<td>ftp";
+$r = $result->fetch();
+$db = NULL;
+echo "<tr><td>";
+if (strpos($ip, "/") === FALSE)
+       echo "$ip<td>".gethostbyaddr($ip);
+else
+       echo "Total<td>$ip";
+echo fmtb($r['total']).fmtb($r['sent']).fmtb($r['received']).
+       fmtb($r['tcp']).fmtb($r['udp']).fmtb($r['icmp']).fmtb($r['http']).
+    fmtb($r['p2p']).fmtb($r['ftp']);
+echo "</table></center>";
+
+echo "<center><h4>Daily</h4></center>";
+echo "Send:<br><img src=graph.php?ip=$ip&sensor_name=".$sensor_name."&table=$txtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+echo "Receive:<br><img src=graph.php?ip=$ip&sensor_name=".$sensor_name."&table=$rxtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+
+echo "<center><h4>Weekly</h4></center>";
+echo "Send:<br><img src=graph.php?interval=".INT_WEEKLY."&ip=$ip&sensor_name=$sensor_name&table=$txtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+echo "Receive:<br><img src=graph.php?interval=".INT_WEEKLY."&ip=$ip&sensor_name=$sensor_name&table=$rxtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+
+echo "<center><h4>Monthly</h4></center>";
+echo "Send:<br><img src=graph.php?interval=".INT_MONTHLY."&ip=$ip&sensor_name=$sensor_name&table=$txtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+echo "Receive:<br><img src=graph.php?interval=".INT_MONTHLY."&ip=$ip&sensor_name=$sensor_name&table=$rxtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+
+echo "<center><h4>Yearly</h4></center>";
+echo "Send:<br><img src=graph.php?interval=".INT_YEARLY."&ip=$ip&sensor_name=$sensor_name&table=$txtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+echo "Receive:<br><img src=graph.php?interval=".INT_YEARLY."&ip=$ip&sensor_name=$sensor_name&table=$rxtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
diff --git a/utils/bandwidthd/files/phphtdocs-sqlite/footer.php b/utils/bandwidthd/files/phphtdocs-sqlite/footer.php
new file mode 100644 (file)
index 0000000..b342825
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+echo("Page load completed in ". (time() - $starttime) ." seconds"); 
+?>
diff --git a/utils/bandwidthd/files/phphtdocs-sqlite/graph.php b/utils/bandwidthd/files/phphtdocs-sqlite/graph.php
new file mode 100644 (file)
index 0000000..82df317
--- /dev/null
@@ -0,0 +1,455 @@
+<?php
+require("include.php");
+
+// Returns x location of any given timestamp
+function ts2x($ts)
+       {
+       global $timestamp, $width, $interval;
+       return(($ts-$timestamp)*(($width-XOFFSET) / $interval) + XOFFSET);
+       }
+
+// If we have multiple IP's in a result set we need to total the average of each IP's samples
+function AverageAndAccumulate()
+       {
+       global $Count, $total, $icmp, $udp, $tcp, $ftp, $http, $p2p, $YMax;
+       global $a_total, $a_icmp, $a_udp, $a_tcp, $a_ftp, $a_http, $a_p2p;
+
+       foreach ($Count as $key => $number)
+       {
+           $total[$key] /= $number;
+       $icmp[$key] /= $number;
+       $udp[$key] /= $number;
+       $tcp[$key] /= $number;
+       $ftp[$key] /= $number;
+       $http[$key] /= $number;
+       $p2p[$key] /= $number;
+       }
+
+       foreach ($Count as $key => $number)
+               {
+               $a_total[$key] += $total[$key];
+               $a_icmp[$key] += $icmp[$key];
+               $a_udp[$key] += $udp[$key];
+               $a_tcp[$key] += $tcp[$key];
+               $a_ftp[$key] += $ftp[$key];
+               $a_http[$key] += $http[$key];
+               $a_p2p[$key] += $p2p[$key];
+
+               if ($a_total[$key] > $YMax)
+                       $YMax = $a_total[$key];
+               }
+
+       unset($GLOBALS['total'], $GLOBALS['icmp'], $GLOBALS['udp'], $GLOBALS['tcp'], $GLOBALS['ftp'], $GLOBALS['http'], $GLOBALS['p2p'], $GLOBALS['Count']);
+
+       $total = array();
+       $icmp = array();
+       $udp = array();
+       $tcp = array();
+       $ftp = array();
+       $http = array();
+       $p2p = array();
+       $Count = array();
+       }
+
+$db = ConnectDb();
+
+// Get parameters
+
+if (isset($_GET['width']))
+    $width = $_GET['width'];
+else
+       $width = DFLT_WIDTH;
+
+if (isset($_GET['height']))
+    $height = $_GET['height'];
+else
+       $height = DFLT_HEIGHT;
+
+if (isset($_GET['interval']))
+    $interval = $_GET['interval'];
+else
+       $interval = DFLT_INTERVAL;
+
+if (isset($_GET['ip']))
+    $ip = $_GET['ip'];
+else
+       exit(1);
+
+if (isset($_GET['sensor_name']))
+       $sensor_name = $_GET['sensor_name'];
+else
+       exit(1);
+
+if (isset($_GET['timestamp']))
+    $timestamp = $_GET['timestamp'];
+else
+       $timestamp = time() - $interval + (0.05*$interval);
+
+if (isset($_GET['table']))
+    $table = $_GET['table'];
+else
+       $table = "bd_rx_log";
+
+if (isset($_GET['yscale']))
+    $yscale = $_GET['yscale'];
+
+$total = array();
+$icmp = array();
+$udp = array();
+$tcp = array();
+$ftp = array();
+$http = array();
+$p2p = array();
+$Count = array();
+
+// Accumulator
+$a_total = array();
+$a_icmp = array();
+$a_udp = array();
+$a_tcp = array();
+$a_ftp = array();
+$a_http = array();
+$a_p2p = array();
+
+$sql_subnet = prepare_sql_subnet($ip);
+$sql = "select *, timestamp as ts from sensors, $table where sensors.sensor_id = ".$table.".sensor_id $sql_subnet and sensor_name = '$sensor_name' and timestamp > $timestamp and timestamp < ".($timestamp+$interval)." order by ip;";
+//error_log($sql);
+$result = $db->query($sql);
+
+// The SQL statement pulls the data out of the database ordered by IP address, that way we can average each
+// datapoint for each IP address to provide smoothing and then toss the smoothed value into the accumulator
+// to provide accurate total traffic rate.
+
+while ($row = $result->fetch())
+       {
+       if ($row['ip'] != $last_ip)
+               {
+               AverageAndAccumulate();
+               $last_ip = $row['ip'];
+               }
+
+       $x = ($row['ts']-$timestamp)*(($width-XOFFSET)/$interval)+XOFFSET;
+       $xint = (int) $x;
+
+       //echo "xint: ".$xint."<br>";
+       $Count[$xint]++;
+
+       if ($row['total']/$row['sample_duration'] > $SentPeak)
+               $SentPeak = $row['total']/$row['sample_duration'];
+       $TotalSent += $row['total'];
+       $total[$xint] += $row['total']/$row['sample_duration'];
+       $icmp[$xint] += $row['icmp']/$row['sample_duration'];
+       $udp[$xint] += $row['udp']/$row['sample_duration'];
+       $tcp[$xint] += $row['tcp']/$row['sample_duration'];
+       $ftp[$xint] += $row['ftp']/$row['sample_duration'];
+       $http[$xint] += $row['http']/$row['sample_duration'];
+       $p2p[$xint] += $row['p2p']/$row['sample_duration'];
+       }
+
+// One more time for the last IP
+AverageAndAccumulate();
+
+// Pull the data out of Accumulator
+$total = $a_total;
+$icmp = $a_icmp;
+$udp = $a_udp;
+$tcp = $a_tcp;
+$ftp = $a_ftp;
+$http = $a_http;
+$p2p = $a_p2p;
+
+$YMax += $YMax*0.05;    // Add an extra 5%
+
+// if a y scale was specified override YMax
+if (isset($yscale)&& $yscale > 0)
+    $YMax = $yscale/8;
+
+// Plot the data
+
+header("Content-type: image/png");
+
+$im = imagecreate($width, $height);
+$white = imagecolorallocate($im, 255, 255, 255);
+$purple = ImageColorAllocate($im, 255, 0, 255);
+$green  = ImageColorAllocate($im, 0, 255, 0);
+$blue   = ImageColorAllocate($im, 0, 0, 255);
+$lblue  = ImageColorAllocate($im, 128, 128, 255);
+$brown  = ImageColorAllocate($im, 128, 0, 0);
+$red    = ImageColorAllocate($im, 255, 0, 0);
+$black  = ImageColorAllocate($im, 0, 0, 0);
+
+for($Counter=XOFFSET+1; $Counter < $width; $Counter++)
+       {
+       if (isset($total[$Counter]))
+               {
+               // Convert the bytes/sec to y coords
+        $total[$Counter] = ($total[$Counter]*($height-YOFFSET))/$YMax;
+               $tcp[$Counter] = ($tcp[$Counter]*($height-YOFFSET))/$YMax;
+        $ftp[$Counter] = ($ftp[$Counter]*($height-YOFFSET))/$YMax;
+               $http[$Counter] = ($http[$Counter]*($height-YOFFSET))/$YMax;
+               $p2p[$Counter] = ($p2p[$Counter]*($height-YOFFSET))/$YMax;
+        $udp[$Counter] = ($udp[$Counter]*($height-YOFFSET))/$YMax;
+               $icmp[$Counter] = ($icmp[$Counter]*($height-YOFFSET))/$YMax;
+
+               // Stack 'em up!
+               // Total is stacked from the bottom
+               // Icmp is on the bottom too
+               // Udp is stacked on top of icmp
+               $udp[$Counter] += $icmp[$Counter];
+               // TCP and p2p are stacked on top of Udp
+               $tcp[$Counter] += $udp[$Counter];
+               $p2p[$Counter] += $udp[$Counter];
+               // Http is stacked on top of p2p
+               $http[$Counter] += $p2p[$Counter];
+               // Ftp is stacked on top of http
+        $ftp[$Counter] += $http[$Counter];
+
+               // Plot them!
+               //echo "$Counter:".$Counter." (h-y)-t:".($height-YOFFSET) - $total[$Counter]." h-YO-1:".$height-YOFFSET-1;
+        ImageLine($im, $Counter, ($height-YOFFSET) - $icmp[$Counter], $Counter, $height-YOFFSET-1, $red);
+        ImageLine($im, $Counter, ($height-YOFFSET) - $udp[$Counter], $Counter, ($height-YOFFSET) - $icmp[$Counter] - 1, $brown);
+        ImageLine($im, $Counter, ($height-YOFFSET) - $tcp[$Counter], $Counter, ($height-YOFFSET) - $udp[$Counter] - 1, $green);
+        ImageLine($im, $Counter, ($height-YOFFSET) - $p2p[$Counter], $Counter, ($height-YOFFSET) - $udp[$Counter] - 1, $purple);
+        ImageLine($im, $Counter, ($height-YOFFSET) - $http[$Counter], $Counter, ($height-YOFFSET) - $p2p[$Counter] - 1, $blue);
+        ImageLine($im, $Counter, ($height-YOFFSET) - $ftp[$Counter], $Counter, ($height-YOFFSET) - $http[$Counter] - 1, $lblue);
+               }
+//     else
+//             echo $Counter." not set<br>";
+       }
+
+// Margin Text
+if ($SentPeak < 1024/8)
+       $txtPeakSendRate = sprintf("Peak Send Rate: %.1f KBits/sec", $SentPeak*8);
+else if ($SentPeak < (1024*1024)/8)
+    $txtPeakSendRate = sprintf("Peak Send Rate: %.1f MBits/sec", ($SentPeak*8.0)/1024.0);
+else
+       $txtPeakSendRate = sprintf("Peak Send Rate: %.1f GBits/sec", ($SentPeak*8.0)/(1024.0*1024.0));
+
+if ($TotalSent < 1024)
+       $txtTotalSent = sprintf("Sent %.1f KBytes", $TotalSent);
+else if ($TotalSent < 1024*1024)
+       $txtTotalSent = sprintf("Sent %.1f MBytes", $TotalSent/1024.0);
+else
+       $txtTotalSent = sprintf("Sent %.1f GBytes", $TotalSent/(1024.0*1024.0));
+
+ImageString($im, 2, XOFFSET+5,  $height-20, $txtTotalSent, $black);
+ImageString($im, 2, $width/2+XOFFSET/2,  $height-20, $txtPeakSendRate, $black);
+
+// Draw X Axis
+
+ImageLine($im, 0, $height-YOFFSET, $width, $height-YOFFSET, $black);
+
+// Day/Month Seperator bars
+
+if ((24*60*60*($width-XOFFSET))/$interval > ($width-XOFFSET)/10)
+       {
+       $ts = getdate($timestamp);
+       $MarkTime = mktime(0, 0, 0, $ts['mon'], $ts['mday'], $ts['year']);
+
+    $x = ts2x($MarkTime);
+    while ($x < XOFFSET)
+       {
+        $MarkTime += (24*60*60);
+           $x = ts2x($MarkTime);
+        }
+
+    while ($x < ($width-10))
+       {
+        // Day Lines
+        ImageLine($im, $x, 0, $x, $height-YOFFSET, $black);
+        ImageLine($im, $x+1, 0, $x+1, $height-YOFFSET, $black);
+
+        $txtDate = strftime("%a, %b %d", $MarkTime);
+        ImageString($im, 2, $x-30,  $height-YOFFSET+10, $txtDate, $black);
+
+        // Calculate Next x
+        $MarkTime += (24*60*60);
+           $x = ts2x($MarkTime);
+        }
+       }
+else if ((24*60*60*30*($width-XOFFSET))/$interval > ($width-XOFFSET)/10)
+       {
+       // Monthly Bars
+       $ts = getdate($timestamp);
+       $month = $ts['mon'];
+       $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
+
+    $x = ts2x($MarkTime);
+    while ($x < XOFFSET)
+       {
+               $month++;
+        $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
+           $x = ts2x($MarkTime);
+        }
+
+    while ($x < ($width-10))
+       {
+        // Day Lines
+        ImageLine($im, $x, 0, $x, $height-YOFFSET, $black);
+        ImageLine($im, $x+1, 0, $x+1, $height-YOFFSET, $black);
+
+        $txtDate = strftime("%b, %Y", $MarkTime);
+        ImageString($im, 2, $x-25,  $height-YOFFSET+10, $txtDate, $black);
+
+        // Calculate Next x
+               $month++;
+        $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
+           $x = ts2x($MarkTime);
+        }
+       }
+else
+       {
+       // Year Bars
+    $ts = getdate($timestamp);
+    $year = $ts['year'];
+    $MarkTime = mktime(0, 0, 0, 1, 1, $year);
+
+    $x = ts2x($MarkTime);
+    while ($x < XOFFSET)
+        {
+        $year++;
+        $MarkTime = mktime(0, 0, 0, 1, 1, $year);
+        $x = ts2x($MarkTime);
+        }
+
+    while ($x < ($width-10))
+        {
+        // Day Lines
+        ImageLine($im, $x, 0, $x, $height-YOFFSET, $black);
+        ImageLine($im, $x+1, 0, $x+1, $height-YOFFSET, $black);
+
+        $txtDate = strftime("%b, %Y", $MarkTime);
+        ImageString($im, 2, $x-25,  $height-YOFFSET+10, $txtDate, $black);
+
+        // Calculate Next x
+        $year++;
+        $MarkTime = mktime(0, 0, 0, 1, 1, $year);
+        $x = ts2x($MarkTime);
+        }
+       }
+
+// Draw Major Tick Marks
+if ((6*60*60*($width-XOFFSET))/$interval > 10) // pixels per 6 hours is more than 2
+       $MarkTimeStep = 6*60*60; // Major ticks are 6 hours
+else if ((24*60*60*($width-XOFFSET))/$interval > 10)
+       $MarkTimeStep = 24*60*60; // Major ticks are 24 hours;
+else if ((24*60*60*30*($width-XOFFSET))/$interval > 10)
+       {
+       // Major tick marks are months
+       $MarkTimeStep = 0; // Skip the standard way of drawing major tick marks below
+
+    $ts = getdate($timestamp);
+    $month = $ts['mon'];
+    $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
+
+    $x = ts2x($MarkTime);
+    while ($x < XOFFSET)
+        {
+        $month++;
+        $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
+        $x = ts2x($MarkTime);
+        }
+
+    while ($x < ($width-10))
+        {
+        // Day Lines
+               $date = getdate($MarkTime);
+               if ($date['mon'] != 1)
+                       {
+               ImageLine($im, $x, $height-YOFFSET-5, $x, $height-YOFFSET+5, $black);
+           $txtDate = strftime("%b", $MarkTime);
+               ImageString($im, 2, $x-5,  $height-YOFFSET+10, $txtDate, $black);
+               }
+
+        // Calculate Next x
+        $month++;
+        $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
+        $x = ts2x($MarkTime);
+        }
+       }
+else
+       $MarkTimeStep = 0; // Skip Major Tick Marks
+
+if ($MarkTimeStep)
+       {
+       $ts = getdate($timestamp);
+       $MarkTime = mktime(0, 0, 0, $ts['mon'], $ts['mday'], $ts['year']);
+       $x = ts2x($MarkTime);
+
+       while ($x < ($width-10))
+               {
+       if ($x > XOFFSET)
+                       {
+           ImageLine($im, $x, $height-YOFFSET-5, $x, $height-YOFFSET+5, $black);
+               }
+               $MarkTime += $MarkTimeStep;
+           $x = ts2x($MarkTime);
+               }
+       }
+
+// Draw Minor Tick marks
+if ((60*60*($width-XOFFSET))/$interval > 4) // pixels per hour is more than 2
+       $MarkTimeStep = 60*60;  // Minor ticks are 1 hour
+else if ((6*60*60*($width-XOFFSET))/$interval > 4)
+       $MarkTimeStep = 6*60*60; // Minor ticks are 6 hours
+else if ((24*60*60*($width-XOFFSET))/$interval > 4)
+       $MarkTimeStep = 24*60*60;
+else
+       $MarkTimeStep = 0; // Skip minor tick marks
+
+if ($MarkTimeStep)
+       {
+       $ts = getdate($timestamp);
+       $MarkTime = mktime(0, 0, 0, $ts['mon'], $ts['mday'], $ts['year']);
+       $x = ts2x($MarkTime);
+
+       while ($x < ($width-10))
+               {
+       if ($x > XOFFSET)
+                       {
+           ImageLine($im, $x, $height-YOFFSET, $x, $height-YOFFSET+5, $black);
+               }
+               $MarkTime += $MarkTimeStep;
+           $x = ts2x($MarkTime);
+               }
+       }
+
+// Draw Y Axis
+ImageLine($im, XOFFSET, 0, XOFFSET, $height, $black);
+
+$YLegend = 'k';
+$Divisor = 1;
+if ($YMax*8 > 1024*2)
+       {
+    $Divisor = 1024;    // Display in m
+    $YLegend = 'm';
+    }
+
+if ($YMax*8 > 1024*1024*2)
+       {
+    $Divisor = 1024*1024; // Display in g
+    $YLegend = 'g';
+       }
+
+if ($YMax*8 > 1024*1024*1024*2)
+       {
+    $Divisor = 1024*1024*1024; // Display in t
+    $YLegend = 't';
+    }
+
+$YStep = $YMax/10;
+if ($YStep < 1)
+       $YStep=1;
+$YTic=$YStep;
+
+while ($YTic <= ($YMax - $YMax/10))
+       {
+    $y = ($height-YOFFSET)-(($YTic*($height-YOFFSET))/$YMax);
+       ImageLine($im, XOFFSET, $y, $width, $y, $black);
+    $txtYLegend = sprintf("%4.1f %sbits/s", (8.0*$YTic)/$Divisor, $YLegend);
+    ImageString($im, 2, 3, $y-7, $txtYLegend, $black);
+       $YTic += $YStep;
+       }
+
+imagepng($im);
+imagedestroy($im);
diff --git a/utils/bandwidthd/files/phphtdocs-sqlite/include.php b/utils/bandwidthd/files/phphtdocs-sqlite/include.php
new file mode 100644 (file)
index 0000000..5195098
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+error_reporting(E_ALL & ~(E_NOTICE|E_STRICT));
+define("INT_DAILY", 60*60*24*2);
+define("INT_WEEKLY", 60*60*24*8);
+define("INT_MONTHLY", 60*60*24*35);
+define("INT_YEARLY", 60*60*24*400);
+
+define("XOFFSET", 90);
+define("YOFFSET", 45);
+
+require("config.conf.php");
+
+function ConnectDb() {
+    global $db_connect_string;
+    try {
+        $db = new PDO($db_connect_string);
+    } catch (PDOException $ex) {
+        die("DB Error, could not connect to database: "  . $ex->getMessage());
+    }
+    return $db;
+}
+
+function fmtb($kbytes)
+       {
+       $Max = 1024;
+       $Output = $kbytes;
+       $Suffix = 'K';
+
+       if ($Output > $Max)
+               {
+               $Output /= 1024;
+               $Suffix = 'M';
+               }
+
+       if ($Output > $Max)
+               {
+               $Output /= 1024;
+               $Suffix = 'G';
+               }
+
+       if ($Output > $Max)
+               {
+               $Output /= 1024;
+               $Suffix = 'T';
+               }
+
+       return(sprintf("<td align=right><tt>%.1f%s</td>", $Output, $Suffix));
+       }
+
+function ip2s32($ip) {
+    $i = ip2long($ip);
+    return ($i & 0x80000000 ? '-' . ((~$i & 0x7fffffff)+1) : ''. ($i & 0x7fffffff));
+}
+
+function prepare_sql_subnet($subnet) {
+    list($snet, $smask) = explode('/', $subnet);
+    $inet = ip2s32($snet);
+    if($smask > 0 && $smask < 32) {
+        $mask = -1 << (32 - (int)$smask);
+        return "and (ip & $mask = $inet)";
+    } elseif ($inet) {
+        return "and ip = " . $inet;
+    }
+    return "";
+}
+
+$starttime = time();
+set_time_limit(300);
+?>
diff --git a/utils/bandwidthd/files/phphtdocs-sqlite/index.php b/utils/bandwidthd/files/phphtdocs-sqlite/index.php
new file mode 100644 (file)
index 0000000..c8b8598
--- /dev/null
@@ -0,0 +1,190 @@
+<?php
+include("include.php");
+?>
+<html>
+<center>
+<img src=logo.gif>
+<?php
+
+$sensor_name = 'default';
+
+// Get variables from url
+
+if (isset($_GET['interval']) && $_GET['interval'] != "none")
+    $interval = $_GET['interval'];
+
+if (isset($_GET['timestamp']) && $_GET['timestamp'] != "none")
+    $timestamp = $_GET['timestamp'];
+
+if (isset($_GET['subnet']) && $_GET['subnet'] != "none")
+    $subnet = $_GET['subnet'];
+
+if (isset($_GET['limit']) && $_GET['limit'] != "none")
+       $limit = $_GET['limit'];
+
+
+$db = ConnectDb();
+?>
+<FORM name="navigation" method="get">
+<table width=100% cellspacing=0 cellpadding=5 border=1>
+<tr>
+<td><SELECT name="interval">
+<OPTION value="none">--Select An Interval--
+<OPTION value=<?php echo INT_DAILY?> <?php echo $interval==INT_DAILY?"SELECTED":""?>>Daily
+<OPTION value=<?php echo INT_WEEKLY?> <?php echo $interval==INT_WEEKLY?"SELECTED":""?>>Weekly
+<OPTION value=<?php echo INT_MONTHLY?> <?php echo $interval==INT_MONTHLY?"SELECTED":""?>>Monthly
+<OPTION value=<?php echo INT_YEARLY?> <?php echo $interval==INT_YEARLY?"SELECTED":""?>>Yearly
+<OPTION value=<?php echo 24*60*60?> <?php echo $interval==24*60*60?"SELECTED":""?>>24hrs
+<OPTION value=<?php echo 30*24*60*60?> <?php echo $interval==30*24*60*60?"SELECTED":""?>>30days
+</select>
+
+<td><SELECT name="limit">
+<OPTION value="none">--How Many Results--
+<OPTION value=20 <?php echo $limit==20?"SELECTED":""?>>20
+<OPTION value=50 <?php echo $limit==50?"SELECTED":""?>>50
+<OPTION value=100 <?php echo $limit==100?"SELECTED":""?>>100
+<OPTION value=all <?php echo $limit=="all"?"SELECTED":""?>>All
+</select>
+
+<td>Subnet Filter:<input name=subnet value="<?php echo isset($subnet)?$subnet:"0.0.0.0/0"?>"> 
+<input type=submit value="Go">
+</table>
+</FORM>
+<?php 
+// Set defaults
+if (!isset($interval))
+       $interval = DFLT_INTERVAL;
+
+if (!isset($timestamp))
+       $timestamp = time() - $interval + (0.05*$interval);
+
+if (!isset($limit))
+       $limit = 20;
+
+// Validation
+if (!isset($sensor_name))
+       exit(0);
+
+// Print Title
+
+if (isset($limit))
+       echo "<h2>Top $limit - $sensor_name</h2>";
+else
+       echo "<h2>All Records - $sensor_name</h2>";
+
+// Sqlize the incomming variables
+if (isset($subnet)) {
+    $sql_subnet = prepare_sql_subnet($subnet);
+}
+
+// Sql Statement
+$sql = "select tx.ip, rx.scale as rxscale, tx.scale as txscale, tx.total+rx.total as total, tx.total as sent, 
+rx.total as received, tx.tcp+rx.tcp as tcp, tx.udp+rx.udp as udp,
+tx.icmp+rx.icmp as icmp, tx.http+rx.http as http,
+tx.p2p+rx.p2p as p2p, tx.ftp+rx.ftp as ftp
+from
+
+(SELECT ip, max(total/sample_duration)*8 as scale, sum(total) as total, sum(tcp) as tcp, sum(udp) as udp, sum(icmp) as icmp,
+sum(http) as http, sum(p2p) as p2p, sum(ftp) as ftp
+from sensors, bd_tx_log
+where sensor_name = '$sensor_name'
+and sensors.sensor_id = bd_tx_log.sensor_id
+$sql_subnet
+and timestamp > $timestamp and timestamp < ".($timestamp+$interval)."
+group by ip) as tx,
+
+(SELECT ip, max(total/sample_duration)*8 as scale, sum(total) as total, sum(tcp) as tcp, sum(udp) as udp, sum(icmp) as icmp,
+sum(http) as http, sum(p2p) as p2p, sum(ftp) as ftp
+from sensors, bd_rx_log
+where sensor_name = '$sensor_name'
+and sensors.sensor_id = bd_rx_log.sensor_id
+$sql_subnet
+and timestamp > $timestamp and timestamp < ".($timestamp+$interval)."
+group by ip) as rx
+
+where tx.ip = rx.ip
+order by total desc;";
+
+//echo "</center><pre>$sql</pre><center>"; error_log($sql);
+$pdoResult = $db->query($sql);
+$result = $pdoResult->fetchAll();
+$db = NULL;
+$num_rows = count($result);
+if ($limit == "all")
+       $limit = $num_rows;
+
+echo "<table width=100% border=1 cellspacing=0><tr><td>Ip<td>Name<td>Total<td>Sent<td>Received<td>tcp<td>udp<td>icmp<td>http<td>smtp<td>ftp";
+
+if (!isset($subnet)) // Set this now for total graphs
+       $subnet = "0.0.0.0/0";
+
+// Output Total Line
+echo "<TR><TD><a href=Total>Total</a><TD>$subnet";
+foreach (array("total", "sent", "received", "tcp", "udp", "icmp", "http", "p2p", "ftp") as $key)
+       {
+       for($Counter=0, $Total = 0; $Counter < $num_rows; $Counter++)
+               {
+               $r = $result[$Counter];
+               $Total += $r[$key];
+               }
+       echo fmtb($Total);
+       }
+echo "\n";
+
+// Output Other Lines
+for($Counter=0; $Counter < $num_rows && $Counter < $limit; $Counter++)
+       {
+       $r = $result[$Counter];
+       $r['ip'] = long2ip($r['ip']);
+       echo "<tr><td><a href=#".$r['ip'].">";
+       echo $r['ip']."<td>".gethostbyaddr($r['ip']);
+       echo "</a>";
+       echo fmtb($r['total']).fmtb($r['sent']).fmtb($r['received']).
+               fmtb($r['tcp']).fmtb($r['udp']).fmtb($r['icmp']).fmtb($r['http']).
+               fmtb($r['p2p']).fmtb($r['ftp'])."\n";
+       }
+echo "</table></center>";
+
+// Output Total Graph
+for($Counter=0, $Total = 0; $Counter < $num_rows; $Counter++)
+       {
+       $r = $result[$Counter];
+       $scale = max($r['txscale'], $scale);
+       $scale = max($r['rxscale'], $scale);
+       }
+
+if ($subnet == "0.0.0.0/0")
+       $total_table = "bd_tx_total_log";
+else
+       $total_table = "bd_tx_log";
+echo "<a name=Total><h3><a href=details.php?sensor_name=$sensor_name&ip=$subnet>";
+echo "Total - Total of $subnet</h3>";
+echo "</a>";
+echo "Send:<br><img src=graph.php?ip=$subnet&interval=$interval&sensor_name=".$sensor_name."&table=$total_table><br>";
+echo "<img src=legend.gif><br>\n";
+if ($subnet == "0.0.0.0/0")
+       $total_table = "bd_rx_total_log";
+else
+       $total_table = "bd_rx_log";
+echo "Receive:<br><img src=graph.php?ip=$subnet&interval=$interval&sensor_name=".$sensor_name."&table=$total_table><br>";
+echo "<img src=legend.gif><br>\n";
+
+
+// Output Other Graphs
+for($Counter=0; $Counter < $num_rows && $Counter < $limit; $Counter++)
+       {
+       $r = $result[$Counter];
+       $r['ip'] = long2ip($r['ip']);
+       echo "<a name=".$r['ip']."><h3><a href=details.php?sensor_name=$sensor_name&ip=".$r['ip'].">";
+       if ($r['ip'] == "0.0.0.0")
+               echo "Total - Total of all subnets</h3>";
+       else
+               echo $r['ip']." - ".gethostbyaddr($r['ip'])."</h3>";
+       echo "</a>";
+       echo "Send:<br><img src=graph.php?ip=".$r['ip']."&interval=$interval&sensor_name=".$sensor_name."&table=bd_tx_log&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+       echo "<img src=legend.gif><br>\n";
+       echo "Receive:<br><img src=graph.php?ip=".$r['ip']."&interval=$interval&sensor_name=".$sensor_name."&table=bd_rx_log&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+       echo "<img src=legend.gif><br>\n";
+       }
+
+include('footer.php');
diff --git a/utils/bandwidthd/files/phphtdocs/details.php b/utils/bandwidthd/files/phphtdocs/details.php
new file mode 100644 (file)
index 0000000..cb52f43
--- /dev/null
@@ -0,0 +1,102 @@
+<?php
+include("include.php");
+?>
+<html>
+<center>
+<img src=logo.gif>
+<?php
+if (isset($_GET['sensor_name']))
+    $sensor_name = $_GET['sensor_name'];
+else
+    {
+    echo "<br>Please provide a sensor_name";
+    exit(1);
+    }
+
+if (isset($_GET['ip']))
+    $ip = $_GET['ip'];
+else
+    {
+    echo "<br>Please provide an ip address";
+    exit(1);
+    }
+                                                                                                                             
+echo "<h3>";
+if (strpos($ip, "/") === FALSE)
+       echo "$ip - ".gethostbyaddr($ip)."</h3>";
+else
+       echo "Total - $ip</h3>";
+
+$db = ConnectDb();
+
+if ($ip == "0.0.0.0/0")
+       {
+    $rxtable = "bd_rx_total_log";
+       $txtable = "bd_tx_total_log";
+       }
+else
+       {
+    $rxtable = "bd_rx_log";
+       $txtable = "bd_tx_log";
+       }
+
+$sql = "select rx.scale as rxscale, tx.scale as txscale, tx.total+rx.total as total, tx.total as sent,
+rx.total as received, tx.tcp+rx.tcp as tcp, tx.udp+rx.udp as udp,
+tx.icmp+rx.icmp as icmp, tx.http+rx.http as http,
+tx.p2p+rx.p2p as p2p, tx.ftp+rx.ftp as ftp
+from
+                                                                                                                             
+(SELECT ip, max(total/sample_duration)*8 as scale, sum(total) as total, sum(tcp) as tcp, sum(udp) as udp, sum(icmp) as icmp,
+sum(http) as http, sum(p2p) as p2p, sum(ftp) as ftp
+from sensors, $txtable
+where sensor_name = '$sensor_name'
+and sensors.sensor_id = ".$txtable.".sensor_id
+and ip <<= '$ip'
+group by ip) as tx,
+                                                                                                                             
+(SELECT ip, max(total/sample_duration)*8 as scale, sum(total) as total, sum(tcp) as tcp, sum(udp) as udp, sum(icmp) as icmp,
+sum(http) as http, sum(p2p) as p2p, sum(ftp) as ftp
+from sensors, $rxtable
+where sensor_name = '$sensor_name'
+and sensors.sensor_id = ".$rxtable.".sensor_id
+and ip <<= '$ip'
+group by ip) as rx
+                                                                                                                             
+where tx.ip = rx.ip;";
+//echo "</center><pre>$sql</pre><center>";exit(0);
+$result = pg_query($sql);
+echo "<table width=100% border=1 cellspacing=0><tr><td>Ip<td>Name<td>Total<td>Sent<td>Received<td>tcp<td>udp<td>icmp<td>http<td>smtp<td>ftp";
+$r = pg_fetch_array($result);
+echo "<tr><td>";
+if (strpos($ip, "/") === FALSE)
+       echo "$ip<td>".gethostbyaddr($ip);
+else
+       echo "Total<td>$ip";
+echo fmtb($r['total']).fmtb($r['sent']).fmtb($r['received']).
+       fmtb($r['tcp']).fmtb($r['udp']).fmtb($r['icmp']).fmtb($r['http']).
+    fmtb($r['p2p']).fmtb($r['ftp']);
+echo "</table></center>";
+
+echo "<center><h4>Daily</h4></center>";
+echo "Send:<br><img src=graph.php?ip=$ip&sensor_name=".$sensor_name."&table=$txtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+echo "Receive:<br><img src=graph.php?ip=$ip&sensor_name=".$sensor_name."&table=$rxtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+
+echo "<center><h4>Weekly</h4></center>";
+echo "Send:<br><img src=graph.php?interval=".INT_WEEKLY."&ip=$ip&sensor_name=$sensor_name&table=$txtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+echo "Receive:<br><img src=graph.php?interval=".INT_WEEKLY."&ip=$ip&sensor_name=$sensor_name&table=$rxtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+
+echo "<center><h4>Monthly</h4></center>";
+echo "Send:<br><img src=graph.php?interval=".INT_MONTHLY."&ip=$ip&sensor_name=$sensor_name&table=$txtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+echo "Receive:<br><img src=graph.php?interval=".INT_MONTHLY."&ip=$ip&sensor_name=$sensor_name&table=$rxtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+
+echo "<center><h4>Yearly</h4></center>";
+echo "Send:<br><img src=graph.php?interval=".INT_YEARLY."&ip=$ip&sensor_name=$sensor_name&table=$txtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+echo "Receive:<br><img src=graph.php?interval=".INT_YEARLY."&ip=$ip&sensor_name=$sensor_name&table=$rxtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
diff --git a/utils/bandwidthd/files/phphtdocs/footer.php b/utils/bandwidthd/files/phphtdocs/footer.php
new file mode 100644 (file)
index 0000000..b342825
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+echo("Page load completed in ". (time() - $starttime) ." seconds"); 
+?>
diff --git a/utils/bandwidthd/files/phphtdocs/graph.php b/utils/bandwidthd/files/phphtdocs/graph.php
new file mode 100644 (file)
index 0000000..323d659
--- /dev/null
@@ -0,0 +1,454 @@
+<?php
+require("include.php");
+
+// Returns x location of any given timestamp
+function ts2x($ts)
+       {
+       global $timestamp, $width, $interval;
+       return(($ts-$timestamp)*(($width-XOFFSET) / $interval) + XOFFSET);
+       }
+
+// If we have multiple IP's in a result set we need to total the average of each IP's samples
+function AverageAndAccumulate()
+       {
+       global $Count, $total, $icmp, $udp, $tcp, $ftp, $http, $p2p, $YMax;
+       global $a_total, $a_icmp, $a_udp, $a_tcp, $a_ftp, $a_http, $a_p2p;
+
+       foreach ($Count as $key => $number)
+       {
+           $total[$key] /= $number;
+       $icmp[$key] /= $number;
+       $udp[$key] /= $number;
+       $tcp[$key] /= $number;
+       $ftp[$key] /= $number;
+       $http[$key] /= $number;
+       $p2p[$key] /= $number;
+       }
+
+       foreach ($Count as $key => $number)
+               {
+               $a_total[$key] += $total[$key];
+               $a_icmp[$key] += $icmp[$key];
+               $a_udp[$key] += $udp[$key];
+               $a_tcp[$key] += $tcp[$key];
+               $a_ftp[$key] += $ftp[$key];
+               $a_http[$key] += $http[$key];
+               $a_p2p[$key] += $p2p[$key];
+
+               if ($a_total[$key] > $YMax)
+                       $YMax = $a_total[$key];
+               }
+
+       unset($GLOBALS['total'], $GLOBALS['icmp'], $GLOBALS['udp'], $GLOBALS['tcp'], $GLOBALS['ftp'], $GLOBALS['http'], $GLOBALS['p2p'], $GLOBALS['Count']);
+
+       $total = array();
+       $icmp = array();
+       $udp = array();
+       $tcp = array();
+       $ftp = array();
+       $http = array();
+       $p2p = array();
+       $Count = array();
+       }
+
+$db = ConnectDb();
+
+// Get parameters
+
+if (isset($_GET['width']))
+    $width = $_GET['width'];
+else
+       $width = DFLT_WIDTH;
+
+if (isset($_GET['height']))
+    $height = $_GET['height'];
+else
+       $height = DFLT_HEIGHT;
+
+if (isset($_GET['interval']))
+    $interval = $_GET['interval'];
+else
+       $interval = DFLT_INTERVAL;
+
+if (isset($_GET['ip']))
+    $ip = $_GET['ip'];
+else
+       exit(1);
+
+if (isset($_GET['sensor_name']))
+       $sensor_name = $_GET['sensor_name'];
+else
+       exit(1);
+
+if (isset($_GET['timestamp']))
+    $timestamp = $_GET['timestamp'];
+else
+       $timestamp = time() - $interval + (0.05*$interval);
+
+if (isset($_GET['table']))
+    $table = $_GET['table'];
+else
+       $table = "bd_rx_log";
+
+if (isset($_GET['yscale']))
+    $yscale = $_GET['yscale'];
+
+$total = array();
+$icmp = array();
+$udp = array();
+$tcp = array();
+$ftp = array();
+$http = array();
+$p2p = array();
+$Count = array();
+
+// Accumulator
+$a_total = array();
+$a_icmp = array();
+$a_udp = array();
+$a_tcp = array();
+$a_ftp = array();
+$a_http = array();
+$a_p2p = array();
+
+$sql = "select *, extract(epoch from timestamp) as ts from sensors, $table where sensors.sensor_id = ".$table.".sensor_id and ip <<= '$ip' and sensor_name = '$sensor_name' and timestamp > $timestamp::abstime and timestamp < ".($timestamp+$interval)."::abstime order by ip;";
+//echo $sql."<br>"; exit(1);
+$result = pg_query($sql);
+
+// The SQL statement pulls the data out of the database ordered by IP address, that way we can average each
+// datapoint for each IP address to provide smoothing and then toss the smoothed value into the accumulator
+// to provide accurate total traffic rate.
+
+while ($row = pg_fetch_array($result))
+       {
+       if ($row['ip'] != $last_ip)
+               {
+               AverageAndAccumulate();
+               $last_ip = $row['ip'];
+               }
+
+       $x = ($row['ts']-$timestamp)*(($width-XOFFSET)/$interval)+XOFFSET;
+       $xint = (int) $x;
+
+       //echo "xint: ".$xint."<br>";
+       $Count[$xint]++;
+
+       if ($row['total']/$row['sample_duration'] > $SentPeak)
+               $SentPeak = $row['total']/$row['sample_duration'];
+       $TotalSent += $row['total'];
+       $total[$xint] += $row['total']/$row['sample_duration'];
+       $icmp[$xint] += $row['icmp']/$row['sample_duration'];
+       $udp[$xint] += $row['udp']/$row['sample_duration'];
+       $tcp[$xint] += $row['tcp']/$row['sample_duration'];
+       $ftp[$xint] += $row['ftp']/$row['sample_duration'];
+       $http[$xint] += $row['http']/$row['sample_duration'];
+       $p2p[$xint] += $row['p2p']/$row['sample_duration'];
+       }
+
+// One more time for the last IP
+AverageAndAccumulate();
+
+// Pull the data out of Accumulator
+$total = $a_total;
+$icmp = $a_icmp;
+$udp = $a_udp;
+$tcp = $a_tcp;
+$ftp = $a_ftp;
+$http = $a_http;
+$p2p = $a_p2p;
+
+$YMax += $YMax*0.05;    // Add an extra 5%
+
+// if a y scale was specified override YMax
+if (isset($yscale))
+    $YMax = $yscale/8;
+
+// Plot the data
+
+header("Content-type: image/png");
+
+$im = imagecreate($width, $height);
+$white = imagecolorallocate($im, 255, 255, 255);
+$purple = ImageColorAllocate($im, 255, 0, 255);
+$green  = ImageColorAllocate($im, 0, 255, 0);
+$blue   = ImageColorAllocate($im, 0, 0, 255);
+$lblue  = ImageColorAllocate($im, 128, 128, 255);
+$brown  = ImageColorAllocate($im, 128, 0, 0);
+$red    = ImageColorAllocate($im, 255, 0, 0);
+$black  = ImageColorAllocate($im, 0, 0, 0);
+
+for($Counter=XOFFSET+1; $Counter < $width; $Counter++)
+       {
+       if (isset($total[$Counter]))
+               {
+               // Convert the bytes/sec to y coords
+        $total[$Counter] = ($total[$Counter]*($height-YOFFSET))/$YMax;
+               $tcp[$Counter] = ($tcp[$Counter]*($height-YOFFSET))/$YMax;
+        $ftp[$Counter] = ($ftp[$Counter]*($height-YOFFSET))/$YMax;
+               $http[$Counter] = ($http[$Counter]*($height-YOFFSET))/$YMax;
+               $p2p[$Counter] = ($p2p[$Counter]*($height-YOFFSET))/$YMax;
+        $udp[$Counter] = ($udp[$Counter]*($height-YOFFSET))/$YMax;
+               $icmp[$Counter] = ($icmp[$Counter]*($height-YOFFSET))/$YMax;
+
+               // Stack 'em up!
+               // Total is stacked from the bottom
+               // Icmp is on the bottom too
+               // Udp is stacked on top of icmp
+               $udp[$Counter] += $icmp[$Counter];
+               // TCP and p2p are stacked on top of Udp
+               $tcp[$Counter] += $udp[$Counter];
+               $p2p[$Counter] += $udp[$Counter];
+               // Http is stacked on top of p2p
+               $http[$Counter] += $p2p[$Counter];
+               // Ftp is stacked on top of http
+        $ftp[$Counter] += $http[$Counter];
+
+               // Plot them!
+               //echo "$Counter:".$Counter." (h-y)-t:".($height-YOFFSET) - $total[$Counter]." h-YO-1:".$height-YOFFSET-1;
+        ImageLine($im, $Counter, ($height-YOFFSET) - $icmp[$Counter], $Counter, $height-YOFFSET-1, $red);
+        ImageLine($im, $Counter, ($height-YOFFSET) - $udp[$Counter], $Counter, ($height-YOFFSET) - $icmp[$Counter] - 1, $brown);
+        ImageLine($im, $Counter, ($height-YOFFSET) - $tcp[$Counter], $Counter, ($height-YOFFSET) - $udp[$Counter] - 1, $green);
+        ImageLine($im, $Counter, ($height-YOFFSET) - $p2p[$Counter], $Counter, ($height-YOFFSET) - $udp[$Counter] - 1, $purple);
+        ImageLine($im, $Counter, ($height-YOFFSET) - $http[$Counter], $Counter, ($height-YOFFSET) - $p2p[$Counter] - 1, $blue);
+        ImageLine($im, $Counter, ($height-YOFFSET) - $ftp[$Counter], $Counter, ($height-YOFFSET) - $http[$Counter] - 1, $lblue);
+               }
+//     else
+//             echo $Counter." not set<br>";
+       }
+
+// Margin Text
+if ($SentPeak < 1024/8)
+       $txtPeakSendRate = sprintf("Peak Send Rate: %.1f KBits/sec", $SentPeak*8);
+else if ($SentPeak < (1024*1024)/8)
+    $txtPeakSendRate = sprintf("Peak Send Rate: %.1f MBits/sec", ($SentPeak*8.0)/1024.0);
+else
+       $txtPeakSendRate = sprintf("Peak Send Rate: %.1f GBits/sec", ($SentPeak*8.0)/(1024.0*1024.0));
+
+if ($TotalSent < 1024)
+       $txtTotalSent = sprintf("Sent %.1f KBytes", $TotalSent);
+else if ($TotalSent < 1024*1024)
+       $txtTotalSent = sprintf("Sent %.1f MBytes", $TotalSent/1024.0);
+else
+       $txtTotalSent = sprintf("Sent %.1f GBytes", $TotalSent/(1024.0*1024.0));
+
+ImageString($im, 2, XOFFSET+5,  $height-20, $txtTotalSent, $black);
+ImageString($im, 2, $width/2+XOFFSET/2,  $height-20, $txtPeakSendRate, $black);
+
+// Draw X Axis
+
+ImageLine($im, 0, $height-YOFFSET, $width, $height-YOFFSET, $black);
+
+// Day/Month Seperator bars
+
+if ((24*60*60*($width-XOFFSET))/$interval > ($width-XOFFSET)/10)
+       {
+       $ts = getdate($timestamp);
+       $MarkTime = mktime(0, 0, 0, $ts['mon'], $ts['mday'], $ts['year']);
+
+    $x = ts2x($MarkTime);
+    while ($x < XOFFSET)
+       {
+        $MarkTime += (24*60*60);
+           $x = ts2x($MarkTime);
+        }
+
+    while ($x < ($width-10))
+       {
+        // Day Lines
+        ImageLine($im, $x, 0, $x, $height-YOFFSET, $black);
+        ImageLine($im, $x+1, 0, $x+1, $height-YOFFSET, $black);
+
+        $txtDate = strftime("%a, %b %d", $MarkTime);
+        ImageString($im, 2, $x-30,  $height-YOFFSET+10, $txtDate, $black);
+
+        // Calculate Next x
+        $MarkTime += (24*60*60);
+           $x = ts2x($MarkTime);
+        }
+       }
+else if ((24*60*60*30*($width-XOFFSET))/$interval > ($width-XOFFSET)/10)
+       {
+       // Monthly Bars
+       $ts = getdate($timestamp);
+       $month = $ts['mon'];
+       $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
+
+    $x = ts2x($MarkTime);
+    while ($x < XOFFSET)
+       {
+               $month++;
+        $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
+           $x = ts2x($MarkTime);
+        }
+
+    while ($x < ($width-10))
+       {
+        // Day Lines
+        ImageLine($im, $x, 0, $x, $height-YOFFSET, $black);
+        ImageLine($im, $x+1, 0, $x+1, $height-YOFFSET, $black);
+
+        $txtDate = strftime("%b, %Y", $MarkTime);
+        ImageString($im, 2, $x-25,  $height-YOFFSET+10, $txtDate, $black);
+
+        // Calculate Next x
+               $month++;
+        $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
+           $x = ts2x($MarkTime);
+        }
+       }
+else
+       {
+       // Year Bars
+    $ts = getdate($timestamp);
+    $year = $ts['year'];
+    $MarkTime = mktime(0, 0, 0, 1, 1, $year);
+
+    $x = ts2x($MarkTime);
+    while ($x < XOFFSET)
+        {
+        $year++;
+        $MarkTime = mktime(0, 0, 0, 1, 1, $year);
+        $x = ts2x($MarkTime);
+        }
+
+    while ($x < ($width-10))
+        {
+        // Day Lines
+        ImageLine($im, $x, 0, $x, $height-YOFFSET, $black);
+        ImageLine($im, $x+1, 0, $x+1, $height-YOFFSET, $black);
+
+        $txtDate = strftime("%b, %Y", $MarkTime);
+        ImageString($im, 2, $x-25,  $height-YOFFSET+10, $txtDate, $black);
+
+        // Calculate Next x
+        $year++;
+        $MarkTime = mktime(0, 0, 0, 1, 1, $year);
+        $x = ts2x($MarkTime);
+        }
+       }
+
+// Draw Major Tick Marks
+if ((6*60*60*($width-XOFFSET))/$interval > 10) // pixels per 6 hours is more than 2
+       $MarkTimeStep = 6*60*60; // Major ticks are 6 hours
+else if ((24*60*60*($width-XOFFSET))/$interval > 10)
+       $MarkTimeStep = 24*60*60; // Major ticks are 24 hours;
+else if ((24*60*60*30*($width-XOFFSET))/$interval > 10)
+       {
+       // Major tick marks are months
+       $MarkTimeStep = 0; // Skip the standard way of drawing major tick marks below
+
+    $ts = getdate($timestamp);
+    $month = $ts['mon'];
+    $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
+
+    $x = ts2x($MarkTime);
+    while ($x < XOFFSET)
+        {
+        $month++;
+        $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
+        $x = ts2x($MarkTime);
+        }
+
+    while ($x < ($width-10))
+        {
+        // Day Lines
+               $date = getdate($MarkTime);
+               if ($date['mon'] != 1)
+                       {
+               ImageLine($im, $x, $height-YOFFSET-5, $x, $height-YOFFSET+5, $black);
+           $txtDate = strftime("%b", $MarkTime);
+               ImageString($im, 2, $x-5,  $height-YOFFSET+10, $txtDate, $black);
+               }
+
+        // Calculate Next x
+        $month++;
+        $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
+        $x = ts2x($MarkTime);
+        }
+       }
+else
+       $MarkTimeStep = 0; // Skip Major Tick Marks
+
+if ($MarkTimeStep)
+       {
+       $ts = getdate($timestamp);
+       $MarkTime = mktime(0, 0, 0, $ts['mon'], $ts['mday'], $ts['year']);
+       $x = ts2x($MarkTime);
+
+       while ($x < ($width-10))
+               {
+       if ($x > XOFFSET)
+                       {
+           ImageLine($im, $x, $height-YOFFSET-5, $x, $height-YOFFSET+5, $black);
+               }
+               $MarkTime += $MarkTimeStep;
+           $x = ts2x($MarkTime);
+       }
+       }
+
+// Draw Minor Tick marks
+if ((60*60*($width-XOFFSET))/$interval > 4) // pixels per hour is more than 2
+       $MarkTimeStep = 60*60;  // Minor ticks are 1 hour
+else if ((6*60*60*($width-XOFFSET))/$interval > 4)
+       $MarkTimeStep = 6*60*60; // Minor ticks are 6 hours
+else if ((24*60*60*($width-XOFFSET))/$interval > 4)
+       $MarkTimeStep = 24*60*60;
+else
+       $MarkTimeStep = 0; // Skip minor tick marks
+
+if ($MarkTimeStep)
+       {
+       $ts = getdate($timestamp);
+       $MarkTime = mktime(0, 0, 0, $ts['mon'], $ts['mday'], $ts['year']);
+       $x = ts2x($MarkTime);
+
+       while ($x < ($width-10))
+               {
+       if ($x > XOFFSET)
+                       {
+           ImageLine($im, $x, $height-YOFFSET, $x, $height-YOFFSET+5, $black);
+               }
+               $MarkTime += $MarkTimeStep;
+           $x = ts2x($MarkTime);
+               }
+       }
+
+// Draw Y Axis
+ImageLine($im, XOFFSET, 0, XOFFSET, $height, $black);
+
+$YLegend = 'k';
+$Divisor = 1;
+if ($YMax*8 > 1024*2)
+       {
+    $Divisor = 1024;    // Display in m
+    $YLegend = 'm';
+    }
+
+if ($YMax*8 > 1024*1024*2)
+       {
+    $Divisor = 1024*1024; // Display in g
+    $YLegend = 'g';
+       }
+
+if ($YMax*8 > 1024*1024*1024*2)
+       {
+    $Divisor = 1024*1024*1024; // Display in t
+    $YLegend = 't';
+    }
+
+$YStep = $YMax/10;
+if ($YStep < 1)
+       $YStep=1;
+$YTic=$YStep;
+
+while ($YTic <= ($YMax - $YMax/10))
+       {
+    $y = ($height-YOFFSET)-(($YTic*($height-YOFFSET))/$YMax);
+       ImageLine($im, XOFFSET, $y, $width, $y, $black);
+    $txtYLegend = sprintf("%4.1f %sbits/s", (8.0*$YTic)/$Divisor, $YLegend);
+    ImageString($im, 2, 3, $y-7, $txtYLegend, $black);
+       $YTic += $YStep;
+       }
+
+imagepng($im);
+imagedestroy($im);
diff --git a/utils/bandwidthd/files/phphtdocs/include.php b/utils/bandwidthd/files/phphtdocs/include.php
new file mode 100644 (file)
index 0000000..6b435d1
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+define("INT_DAILY", 60*60*24*2);
+define("INT_WEEKLY", 60*60*24*8);
+define("INT_MONTHLY", 60*60*24*35);
+define("INT_YEARLY", 60*60*24*400);
+
+define("XOFFSET", 90);
+define("YOFFSET", 45);
+
+require("config.conf");
+
+function ConnectDb()
+    {
+       global $db_connect_string;
+
+    $db = pg_pconnect($db_connect_string);
+    if (!$db)
+        {
+        printf("DB Error, could not connect to database");
+        exit(1);
+        }
+    return($db);
+    }
+                                                                                                                             
+function fmtb($kbytes)
+       {
+       $Max = 1024;
+       $Output = $kbytes;
+       $Suffix = 'K';
+
+       if ($Output > $Max)
+               {
+               $Output /= 1024;
+               $Suffix = 'M';
+               }
+
+       if ($Output > $Max)
+               {
+               $Output /= 1024;
+               $Suffix = 'G';
+               }
+
+       if ($Output > $Max)
+               {
+               $Output /= 1024;
+               $Suffix = 'T';
+               }
+
+       return(sprintf("<td align=right><tt>%.1f%s</td>", $Output, $Suffix));
+       }
+
+$starttime = time();
+set_time_limit(300);
+?>
diff --git a/utils/bandwidthd/files/phphtdocs/index.php b/utils/bandwidthd/files/phphtdocs/index.php
new file mode 100644 (file)
index 0000000..b3602af
--- /dev/null
@@ -0,0 +1,197 @@
+<?php
+include("include.php");
+?>
+<html>
+<center>
+<img src=logo.gif>
+<?php 
+// Get variables from url
+
+if (isset($_GET['sensor_name']) && $_GET['sensor_name'] != "none")
+    $sensor_name = $_GET['sensor_name'];
+
+if (isset($_GET['interval']) && $_GET['interval'] != "none")
+    $interval = $_GET['interval'];
+
+if (isset($_GET['timestamp']) && $_GET['timestamp'] != "none")
+    $timestamp = $_GET['timestamp'];
+
+if (isset($_GET['subnet']) && $_GET['subnet'] != "none")
+    $subnet = $_GET['subnet'];
+
+if (isset($_GET['limit']) && $_GET['limit'] != "none")
+       $limit = $_GET['limit'];
+
+
+$db = ConnectDb();
+?>
+<FORM name="navigation" method=get action=<?php echo $PHP_SELF?>>
+<table width=100% cellspacing=0 cellpadding=5 border=1>
+<tr>
+<td><SELECT name="sensor_name">
+
+<OPTION value="none">--Select A Sensor--
+<?php 
+$sql = "SELECT sensor_name from sensors order by sensor_name;";
+$result = pg_query($sql);
+while ($r = pg_fetch_array($result))
+    echo "<option value=\"".$r['sensor_name']."\" ".($sensor_name==$r['sensor_name']?"SELECTED":"").">".$r['sensor_name']."\n";
+?>
+</SELECT>
+<td><SELECT name="interval">
+<OPTION value="none">--Select An Interval--
+<OPTION value=<?php echo INT_DAILY?> <?php echo $interval==INT_DAILY?"SELECTED":""?>>Daily
+<OPTION value=<?php echo INT_WEEKLY?> <?php echo $interval==INT_WEEKLY?"SELECTED":""?>>Weekly
+<OPTION value=<?php echo INT_MONTHLY?> <?php echo $interval==INT_MONTHLY?"SELECTED":""?>>Monthly
+<OPTION value=<?php echo INT_YEARLY?> <?php echo $interval==INT_YEARLY?"SELECTED":""?>>Yearly
+<OPTION value=<?php echo 24*60*60?> <?php echo $interval==24*60*60?"SELECTED":""?>>24hrs
+<OPTION value=<?php echo 30*24*60*60?> <?php echo $interval==30*24*60*60?"SELECTED":""?>>30days
+</select>
+
+<td><SELECT name="limit">
+<OPTION value="none">--How Many Results--
+<OPTION value=20 <?php echo $limit==20?"SELECTED":""?>>20
+<OPTION value=50 <?php echo $limit==50?"SELECTED":""?>>50
+<OPTION value=100 <?php echo $limit==100?"SELECTED":""?>>100
+<OPTION value=all <?php echo $limit=="all"?"SELECTED":""?>>All
+</select>
+
+<td>Subnet Filter:<input name=subnet value="<?php echo isset($subnet)?$subnet:"0.0.0.0/0"?>"> 
+<input type=submit value="Go">
+</table>
+</FORM>
+<?php 
+// Set defaults
+if (!isset($interval))
+       $interval = DFLT_INTERVAL;
+
+if (!isset($timestamp))
+       $timestamp = time() - $interval + (0.05*$interval);
+
+if (!isset($limit))
+       $limit = 20;
+
+// Validation
+if (!isset($sensor_name))
+       exit(0);
+
+// Print Title
+
+if (isset($limit))
+       echo "<h2>Top $limit - $sensor_name</h2>";
+else
+       echo "<h2>All Records - $sensor_name</h2>";
+
+// Sqlize the incomming variables
+if (isset($subnet))
+       $sql_subnet = "and ip <<= '$subnet'";
+
+// Sql Statement
+$sql = "select tx.ip, rx.scale as rxscale, tx.scale as txscale, tx.total+rx.total as total, tx.total as sent, 
+rx.total as received, tx.tcp+rx.tcp as tcp, tx.udp+rx.udp as udp,
+tx.icmp+rx.icmp as icmp, tx.http+rx.http as http,
+tx.p2p+rx.p2p as p2p, tx.ftp+rx.ftp as ftp
+from
+
+(SELECT ip, max(total/sample_duration)*8 as scale, sum(total) as total, sum(tcp) as tcp, sum(udp) as udp, sum(icmp) as icmp,
+sum(http) as http, sum(p2p) as p2p, sum(ftp) as ftp
+from sensors, bd_tx_log
+where sensor_name = '$sensor_name'
+and sensors.sensor_id = bd_tx_log.sensor_id
+$sql_subnet
+and timestamp > $timestamp::abstime and timestamp < ".($timestamp+$interval)."::abstime
+group by ip) as tx,
+
+(SELECT ip, max(total/sample_duration)*8 as scale, sum(total) as total, sum(tcp) as tcp, sum(udp) as udp, sum(icmp) as icmp,
+sum(http) as http, sum(p2p) as p2p, sum(ftp) as ftp
+from sensors, bd_rx_log
+where sensor_name = '$sensor_name'
+and sensors.sensor_id = bd_rx_log.sensor_id
+$sql_subnet
+and timestamp > $timestamp::abstime and timestamp < ".($timestamp+$interval)."::abstime
+group by ip) as rx
+
+where tx.ip = rx.ip
+order by total desc;";
+
+//echo "</center><pre>$sql</pre><center>"; exit(0);
+pg_query("SET sort_mem TO 30000;");
+$result = pg_query($sql);
+pg_query("set sort_mem to default;");
+
+if ($limit == "all")
+       $limit = pg_num_rows($result);
+
+echo "<table width=100% border=1 cellspacing=0><tr><td>Ip<td>Name<td>Total<td>Sent<td>Received<td>tcp<td>udp<td>icmp<td>http<td>smtp<td>ftp";
+
+if (!isset($subnet)) // Set this now for total graphs
+       $subnet = "0.0.0.0/0";
+
+// Output Total Line
+echo "<TR><TD><a href=Total>Total</a><TD>$subnet";
+foreach (array("total", "sent", "received", "tcp", "udp", "icmp", "http", "p2p", "ftp") as $key)
+       {
+       for($Counter=0, $Total = 0; $Counter < pg_num_rows($result); $Counter++)
+               {
+               $r = pg_fetch_array($result, $Counter);
+               $Total += $r[$key];
+               }
+       echo fmtb($Total);
+       }
+echo "\n";
+
+// Output Other Lines
+for($Counter=0; $Counter < pg_num_rows($result) && $Counter < $limit; $Counter++)
+       {
+       $r = pg_fetch_array($result, $Counter);
+       echo "<tr><td><a href=#".$r['ip'].">";
+       echo $r['ip']."<td>".gethostbyaddr($r['ip']);
+       echo "</a>";
+       echo fmtb($r['total']).fmtb($r['sent']).fmtb($r['received']).
+               fmtb($r['tcp']).fmtb($r['udp']).fmtb($r['icmp']).fmtb($r['http']).
+               fmtb($r['p2p']).fmtb($r['ftp'])."\n";
+       }
+echo "</table></center>";
+
+// Output Total Graph
+for($Counter=0, $Total = 0; $Counter < pg_num_rows($result); $Counter++)
+       {
+       $r = pg_fetch_array($result, $Counter);
+       $scale = max($r['txscale'], $scale);
+       $scale = max($r['rxscale'], $scale);
+       }
+
+if ($subnet == "0.0.0.0/0")
+       $total_table = "bd_tx_total_log";
+else
+       $total_table = "bd_tx_log";
+echo "<a name=Total><h3><a href=details.php?sensor_name=$sensor_name&ip=$subnet>";
+echo "Total - Total of $subnet</h3>";
+echo "</a>";
+echo "Send:<br><img src=graph.php?ip=$subnet&interval=$interval&sensor_name=".$sensor_name."&table=$total_table><br>";
+echo "<img src=legend.gif><br>\n";
+if ($subnet == "0.0.0.0/0")
+       $total_table = "bd_rx_total_log";
+else
+       $total_table = "bd_rx_log";
+echo "Receive:<br><img src=graph.php?ip=$subnet&interval=$interval&sensor_name=".$sensor_name."&table=$total_table><br>";
+echo "<img src=legend.gif><br>\n";
+
+
+// Output Other Graphs
+for($Counter=0; $Counter < pg_num_rows($result) && $Counter < $limit; $Counter++) 
+       {
+       $r = pg_fetch_array($result, $Counter);
+       echo "<a name=".$r['ip']."><h3><a href=details.php?sensor_name=$sensor_name&ip=".$r['ip'].">";
+       if ($r['ip'] == "0.0.0.0")
+               echo "Total - Total of all subnets</h3>";
+       else
+               echo $r['ip']." - ".gethostbyaddr($r['ip'])."</h3>";
+       echo "</a>";
+       echo "Send:<br><img src=graph.php?ip=".$r['ip']."&interval=$interval&sensor_name=".$sensor_name."&table=bd_tx_log&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+       echo "<img src=legend.gif><br>\n";
+       echo "Receive:<br><img src=graph.php?ip=".$r['ip']."&interval=$interval&sensor_name=".$sensor_name."&table=bd_rx_log&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+       echo "<img src=legend.gif><br>\n";
+       }
+
+include('footer.php');
diff --git a/utils/bandwidthd/patches/010-dont-add-host-paths-in-config.in.patch b/utils/bandwidthd/patches/010-dont-add-host-paths-in-config.in.patch
new file mode 100644 (file)
index 0000000..cfaba70
--- /dev/null
@@ -0,0 +1,24 @@
+--- a/configure.in
++++ b/configure.in
+@@ -24,11 +24,6 @@ if test -n "$x_libraries" && test "x$x_l
+       LDFLAGS="$LDFLAGS -L$x_libraries"
+ fi
+-# May be equired for BSD
+-LDFLAGS="$LDFLAGS -L/usr/local/lib"
+-
+-CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+-
+ #Check for Darwin sw directory
+ AC_CHECK_FILE(/sw/lib, LDFLAGS="$LDFLAGS -L/sw/lib")
+ AC_CHECK_FILE(/sw/include, CPPFLAGS="$CPPFLAGS -I/sw/include")
+@@ -55,8 +50,7 @@ AC_CHECK_LIB(pcap, pcap_open_live, ,
+       [AC_CHECK_LIB(wpcap, pcap_open_live, ,[AC_MSG_ERROR([Bandwidthd requires but cannot find libpcap])])])
+ # Optional Library
+-AC_CHECK_FILE(/usr/lib, LDFLAGS="$LDFLAGS -L/usr/lib")
+-AC_CHECK_FILE(/usr/include/pgsql, CPPFLAGS="$CPPFLAGS -I/usr/include/pgsql")
++AC_CHECK_FILE(/usr/local/pgsql/include, CPPFLAGS="$CPPFLAGS -I/usr/local/pgsql/include")
+ AC_CHECK_LIB(pq, PQconnectdb,
+       [AC_CHECK_LIB(pq,PQexecParams, ,AC_MSG_WARN([libpq exists but is too old... bandwidthd requires support for PQexecParams]))])
+ AC_CHECK_LIB(sqlite3, sqlite3_open, ,AC_MSG_WARN([sqlite3 is recommended for storage of data but cannot be found]))
diff --git a/utils/bandwidthd/patches/010-dont-add-host-paths.patch b/utils/bandwidthd/patches/010-dont-add-host-paths.patch
deleted file mode 100644 (file)
index 59a5737..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/configure b/configure
-index 4c2546e..e516137 100755
---- a/configure
-+++ b/configure
-@@ -2439,11 +2439,6 @@ if test -n "$x_libraries" && test "x$x_libraries" != xNONE ; then
-       LDFLAGS="$LDFLAGS -L$x_libraries"
- fi
--# May be equired for BSD
--LDFLAGS="$LDFLAGS -L/usr/local/lib"
--
--CPPFLAGS="$CPPFLAGS -I/usr/local/include"
--
- #Check for Darwin sw directory
- echo "$as_me:2448: checking for /sw/lib" >&5
- echo $ECHO_N "checking for /sw/lib... $ECHO_C" >&6
-@@ -2505,9 +2500,6 @@ fi
- fi
- echo "$as_me:2506: result: $ac_cv_file__usr_pkg_lib" >&5
- echo "${ECHO_T}$ac_cv_file__usr_pkg_lib" >&6
--if test $ac_cv_file__usr_pkg_lib = yes; then
--  LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
--fi
- echo "$as_me:2512: checking for /usr/pkg/include" >&5
- echo $ECHO_N "checking for /usr/pkg/include... $ECHO_C" >&6
-@@ -3092,9 +3084,6 @@ fi
- fi
- echo "$as_me:3093: result: $ac_cv_file__usr_local_pgsql_lib" >&5
- echo "${ECHO_T}$ac_cv_file__usr_local_pgsql_lib" >&6
--if test $ac_cv_file__usr_local_pgsql_lib = yes; then
--  LDFLAGS="$LDFLAGS -L/usr/local/pgsql/lib"
--fi
- echo "$as_me:3099: checking for /usr/local/pgsql/include" >&5
- echo $ECHO_N "checking for /usr/local/pgsql/include... $ECHO_C" >&6
diff --git a/utils/bandwidthd/patches/020-change-p2p-to-smtp.patch b/utils/bandwidthd/patches/020-change-p2p-to-smtp.patch
new file mode 100644 (file)
index 0000000..d0e6144
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/graph.c
++++ b/graph.c
+@@ -274,7 +274,7 @@ void MakeIndexPages(int NumIps, struct S
+     // PASS 1:  Write out the table
+-      fprintf(file, "<TR bgcolor=lightblue><TD>Ip and Name<TD align=center>Total<TD align=center>Total Sent<TD align=center>Total Received<TD align=center>FTP<TD align=center>HTTP<TD align=center>P2P<TD align=center>TCP<TD align=center>UDP<TD align=center>ICMP\n");
++      fprintf(file, "<TR bgcolor=lightblue><TD>Ip and Name<TD align=center>Total<TD align=center>Total Sent<TD align=center>Total Received<TD align=center>FTP<TD align=center>HTTP<TD align=center>SMTP<TD align=center>TCP<TD align=center>UDP<TD align=center>ICMP\n");
+       for (Counter=0; Counter < 21 && Counter < NumIps; Counter++)
+               PrintTableLine(file, SummaryData[Counter], Counter);
+@@ -341,7 +341,7 @@ void MakeIndexPages(int NumIps, struct S
+         // PASS 1:  Write out the table
+-              fprintf(file, "<TR bgcolor=lightblue><TD>Ip and Name<TD align=center>Total<TD align=center>Total Sent<TD align=center>Total Received<TD align=center>FTP<TD align=center>HTTP<TD align=center>P2P<TD align=center>TCP<TD align=center>UDP<TD align=center>ICMP\n");
++              fprintf(file, "<TR bgcolor=lightblue><TD>Ip and Name<TD align=center>Total<TD align=center>Total Sent<TD align=center>Total Received<TD align=center>FTP<TD align=center>HTTP<TD align=center>SMTP<TD align=center>TCP<TD align=center>UDP<TD align=center>ICMP\n");
+               for (tCounter=0, Counter=0; Counter < NumIps; Counter++)
+                       {
+             if (SubnetTable[SubnetCounter].ip == (SummaryData[Counter]->IP & SubnetTable[SubnetCounter].mask))
diff --git a/utils/bandwidthd/patches/100-fix_config_file_location b/utils/bandwidthd/patches/100-fix_config_file_location
deleted file mode 100644 (file)
index ae44cd2..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
---- bandwidthd-2.0.1/bandwidthd.c.orig 2008-05-09 10:06:37.000000000 -0500
-+++ bandwidthd-2.0.1/bandwidthd.c      2008-05-09 10:32:54.000000000 -0500
-@@ -255,22 +255,22 @@
-       openlog("bandwidthd", LOG_CONS, LOG_DAEMON);
--      if (stat("./etc/bandwidthd.conf", &StatBuf))
-+      if (stat("/etc/bandwidthd.conf", &StatBuf))
-               {
-               chdir(INSTALL_DIR);
--              if (stat("./etc/bandwidthd.conf", &StatBuf))
-+              if (stat("/etc/bandwidthd.conf", &StatBuf))
-                       {
--                      printf("Cannot find ./etc/bandwidthd.conf or %s/etc/bandwidthd.conf\n", INSTALL_DIR);
--                      syslog(LOG_ERR, "Cannot find ./etc/bandwidthd.conf or %s/etc/bandwidthd.conf", INSTALL_DIR);
-+                      printf("Cannot find /etc/bandwidthd.conf or %s/etc/bandwidthd.conf\n", INSTALL_DIR);
-+                      syslog(LOG_ERR, "Cannot find /etc/bandwidthd.conf or %s/etc/bandwidthd.conf", INSTALL_DIR);
-                       exit(1);
-                       }
-               }
--      bdconfig_in = fopen("./etc/bandwidthd.conf", "rt");
-+      bdconfig_in = fopen("/etc/bandwidthd.conf", "rt");
-       if (!bdconfig_in)
-               {
-               syslog(LOG_ERR, "Cannot open bandwidthd.conf");
--              printf("Cannot open ./etc/bandwidthd.conf\n");
-+              printf("Cannot open /etc/bandwidthd.conf\n");
-               exit(1);
-               }
-       bdconfig_parse();
index c73809ae349a493c1c505929103e5453b0e23838..8b3b09d5518beae4de7d1663e2230d21895ccf0c 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ccid
-PKG_VERSION:=1.4.24
+PKG_VERSION:=1.4.26
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4171
-PKG_MD5SUM:=62cb73c6c009c9799c526f05a05e25f00f0ad86d50f82a714dedcfbf4a7e4176
+PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4205
+PKG_MD5SUM:=3267bf708ab780c02f01f6241b7c7277cb892d30fd1179a9926a8cc0ca40be2f
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=LGPL-2.1+
 PKG_LICENSE_FILES:=COPYING
index 1e25305a7e92b3a1e2a07c7e38374cddbcf3fab9..15c0cc28fb0f1a82f7c87a1d0616995afe002d94 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/ccrypt
-PKG_MD5SUM:=44ddd763465c254df83f5d38851d04d7
+PKG_MD5SUM:=87d66da2170facabf6f2fc073586ae2c7320d4689980cfca415c74688e499ba0
 PKG_MAINTAINER:=Hannu Nyman <hannu.nyman@iki.fi>
 PKG_LICENSE:=GPLv2+
 
index 70c055a5490a71ebbd9d00bb4dd5eed1c0d1c40a..27491c6fe9c1cd57a278e2af90aa270ac62ee2c2 100644 (file)
@@ -8,16 +8,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=collectd
-PKG_VERSION:=5.5.2
-PKG_RELEASE:=4
+PKG_VERSION:=5.5.3
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://collectd.org/files/
-PKG_MD5SUM:=40b83343f72089e0330f53965f1140bd
+PKG_MD5SUM:=6f10633d0f73f99ef61472a8e377d4a058de161e80f3353b4b17d394c68f2f44
 
 PKG_FIXUP:=autoreconf
 PKG_REMOVE_FILES:=aclocal.m4 libltdl/aclocal.m4
-PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
+PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>, Hannu Nyman <hannu.nyman@iki.fi>
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
@@ -199,7 +199,7 @@ CONFIGURE_ARGS+= \
 
 ifneq ($(CONFIG_PACKAGE_COLLECTD_ENCRYPTED_NETWORK),)
 CONFIGURE_ARGS+= \
-       --with-libgcrypt=$(STAGING_DIR)/include
+       --with-libgcrypt=$(STAGING_DIR)/usr/include
 else
 CONFIGURE_ARGS+= \
        --without-libgcrypt
@@ -312,7 +312,7 @@ $(eval $(call BuildPlugin,bind,BIND server/zone input,bind,+PACKAGE_collectd-mod
 $(eval $(call BuildPlugin,conntrack,connection tracking table size input,conntrack,))
 $(eval $(call BuildPlugin,contextswitch,context switch input,contextswitch,))
 $(eval $(call BuildPlugin,cpu,CPU input,cpu,))
-$(eval $(call BuildPlugin,cpufreq,CPU Freq input,cpufreq,@(TARGET_x86||TARGET_x86_64||TARGET_mvebu||TARGET_ipq806x))) # Only enable on x86 mvebu and ipq806x
+$(eval $(call BuildPlugin,cpufreq,CPU Freq input,cpufreq,@(TARGET_x86||TARGET_x86_64||TARGET_mvebu||TARGET_ipq806x||TARGET_armvirt))) # Only enable on x86 mvebu ipq806x armvirt
 $(eval $(call BuildPlugin,csv,CSV output,csv,))
 $(eval $(call BuildPlugin,curl,cURL input,curl,+PACKAGE_collectd-mod-curl:libcurl))
 #$(eval $(call BuildPlugin,dbi,relational database input,dbi,+PACKAGE_collectd-mod-dbi:libdbi))
diff --git a/utils/collectd/patches/050-upstream-fix-for-network-plugin-ddos.patch b/utils/collectd/patches/050-upstream-fix-for-network-plugin-ddos.patch
new file mode 100644 (file)
index 0000000..d4d333e
--- /dev/null
@@ -0,0 +1,50 @@
+From f6be4f9b49b949b379326c3d7002476e6ce4f211 Mon Sep 17 00:00:00 2001
+From: Pavel Rochnyack <pavel2000@ngs.ru>
+Date: Mon, 3 Apr 2017 11:57:09 +0600
+Subject: [PATCH] network plugin: Fix endless loop DOS in parse_packet()
+
+When correct 'Signature part' is received by Collectd, configured without
+AuthFile option, condition for endless loop occurs due to missing increase
+of pointer to next unprocessed part.
+
+Fixes: CVE-2017-7401
+
+Signed-off-by: Florian Forster <octo@collectd.org>
+
+
+--- a/src/network.c
++++ b/src/network.c
+@@ -1066,14 +1066,6 @@ static int parse_part_sign_sha256 (socke
+   buffer_len = *ret_buffer_len;
+   buffer_offset = 0;
+-  if (se->data.server.userdb == NULL)
+-  {
+-    c_complain (LOG_NOTICE, &complain_no_users,
+-        "network plugin: Received signed network packet but can't verify it "
+-        "because no user DB has been configured. Will accept it.");
+-    return (0);
+-  }
+-
+   /* Check if the buffer has enough data for this structure. */
+   if (buffer_len <= PART_SIGNATURE_SHA256_SIZE)
+     return (-ENOMEM);
+@@ -1091,6 +1083,18 @@ static int parse_part_sign_sha256 (socke
+     return (-1);
+   }
++  if (se->data.server.userdb == NULL) {
++    c_complain(
++        LOG_NOTICE, &complain_no_users,
++        "network plugin: Received signed network packet but can't verify it "
++        "because no user DB has been configured. Will accept it.");
++
++    *ret_buffer = buffer + pss_head_length;
++    *ret_buffer_len -= pss_head_length;
++
++    return (0);
++  }
++
+   /* Copy the hash. */
+   BUFFER_READ (pss.hash, sizeof (pss.hash));
index 8f570cb48b66de085515257a25acb47627b9d0b5..71f20360cdb3c3c244a9afd18974afe3c51176d8 100644 (file)
@@ -2,7 +2,7 @@
 +++ b/version-gen.sh
 @@ -2,7 +2,7 @@
  
- DEFAULT_VERSION="5.5.2.git"
+ DEFAULT_VERSION="5.5.3.git"
  
 -VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`"
 +#VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`"
index dd0198a511add866be0b3d3cf55006f89bfb4d4d..aacf182fbff9370c5a634c0f471be80c66792e44 100644 (file)
@@ -18,7 +18,7 @@ Reversed patch to be applied:
 
 --- a/configure.ac
 +++ b/configure.ac
-@@ -2626,7 +2626,7 @@ then
+@@ -2627,7 +2627,7 @@ then
        SAVE_CPPFLAGS="$CPPFLAGS"
        CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
  
@@ -29,12 +29,12 @@ Reversed patch to be applied:
  fi
 --- a/src/modbus.c
 +++ b/src/modbus.c
-@@ -27,7 +27,7 @@
- #include <netdb.h>
+@@ -26,7 +26,7 @@
+ #include "configfile.h"
+ #include "plugin.h"
  
 -#include <modbus.h>
 +#include <modbus/modbus.h>
+ #include <netdb.h>
+ #include <sys/socket.h>
  
- #ifndef LIBMODBUS_VERSION_CHECK
- /* Assume version 2.0.3 */
index 7f8c1e130b651e4b306b5a78b0f58aa751a72747..d23b09ea1fc3bf2cf67d5500d80a6595b54c734c 100644 (file)
@@ -1,6 +1,6 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -704,6 +704,9 @@ AC_CHECK_HEADERS(net/pfvar.h,
+@@ -705,6 +705,9 @@ AC_CHECK_HEADERS(net/pfvar.h,
  have_termios_h="no"
  AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
  
@@ -67,7 +67,7 @@
  #     JVMArg "-Djava.class.path=@prefix@/share/collectd/java/collectd-api.jar"
 --- a/src/collectd.conf.pod
 +++ b/src/collectd.conf.pod
-@@ -2606,6 +2606,27 @@ and all other interrupts are collected.
+@@ -2612,6 +2612,27 @@ and all other interrupts are collected.
  
  =back
  
index 96a5c22bd38e042e1d8ef0a342fac688e7d220ac..947dc546bab056b216f643298265e11e68c044b8 100644 (file)
@@ -1,6 +1,6 @@
 --- a/src/ping.c
 +++ b/src/ping.c
-@@ -658,7 +658,7 @@ static int ping_read (void) /* {{{ */
+@@ -655,7 +655,7 @@ static int ping_read (void) /* {{{ */
            / ((double) (pkg_recv * (pkg_recv - 1))));
  
      /* Calculate drop rate. */
index 73b1a85f7c4e67099222d4a367c0fc5c87771a1d..0d52b60ea4c1bab51a5bcaf280c54858404deff4 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=coreutils
 PKG_VERSION:=8.23
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/coreutils
@@ -37,11 +37,11 @@ DEPENDS_timeout = +librt
 DEPENDS_expr = +libgmp
 DEPENDS_factor = +libgmp
 DEPENDS_cp = +libacl
-DEPENDS_dir = +libacl
+DEPENDS_dir = +libacl +libcap
 DEPENDS_install = +libacl
-DEPENDS_ls = +libacl
+DEPENDS_ls = +libacl +libcap
 DEPENDS_mv = +libacl
-DEPENDS_vdir = +libacl
+DEPENDS_vdir = +libacl +libcap
 
 define Package/coreutils/Default
   SECTION:=utils
index 16ed227e2e87087c8d9c320923f9c36954ce10d3..0560fc6a0103655f040f9c0da0f1e7addac0d17b 100644 (file)
@@ -122,11 +122,11 @@ HOST_CONFIGURE_ARGS+= \
        --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" \
+       --with-dbus-daemondir="$(STAGING_DIR_HOSTPKG)/bin" \
+       --with-system-socket="$(STAGING_DIR_HOSTPKG)/var/run/dbus/system_bus_socket" \
+       --with-system-pid-file="$(STAGING_DIR_HOSTPKG)/var/run/dbus.pid" \
        --without-x \
-       --libexecdir="$(STAGING_DIR)/host/lib/dbus-1"
+       --libexecdir="$(STAGING_DIR_HOSTPKG)/lib/dbus-1"
 
 HOST_CONFIGURE_VARS+= \
        ac_cv_have_abstract_sockets="yes" \
index 25dfa3dfc00d62279f52612774b105c5b2a48245..2ca4abf38515f8debfb6e15447f4f30e9874416a 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dump1090
-PKG_VERSION:=2016-10-02
+PKG_VERSION:=2016-11-26
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/mutability/dump1090.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=344415b91f018e7fd3719fe639888505c54792ad
+PKG_SOURCE_VERSION:=fb63bdc2a61f0169b3c21b33bcdc99f202685b78
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
 
diff --git a/utils/ecdsautils/Makefile b/utils/ecdsautils/Makefile
new file mode 100644 (file)
index 0000000..e5f3567
--- /dev/null
@@ -0,0 +1,72 @@
+#
+# Copyright (C) 2012-2016 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:=ecdsautils
+PKG_VERSION:=0.3.2.20160630
+PKG_RELEASE:=1
+PKG_REV:=07538893fb6c2a9539678c45f9dbbf1e4f222b46
+PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=git://github.com/tcatm/$(PKG_NAME).git
+PKG_SOURCE_VERSION:=$(PKG_REV)
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_PROTO:=git
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libecdsautil
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libuecc
+  TITLE:=ECDSA library
+  URL:=https://github.com/tcatm/ecdsautils
+endef
+
+define Package/ecdsautils
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libecdsautil +libuecc
+  TITLE:=ECDSA Utilities
+  URL:=https://github.com/tcatm/ecdsautils
+endef
+
+CMAKE_OPTIONS += \
+  -DCMAKE_BUILD_TYPE:String="MINSIZEREL" \
+
+
+define Package/libecdsautil/description
+ Library to sign and verify checksums using ECDSA.
+endef
+
+define Package/ecdsautils/description
+ Utilities to sign and verify checksums using ECDSA.
+endef
+
+define Package/libecdsautil/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libecdsautil.so* $(1)/usr/lib/
+endef
+
+define Package/ecdsautils/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ecdsautil $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/ecdsakeygen $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/ecdsasign $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/ecdsaverify $(1)/usr/bin/
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include $(1)/usr/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib $(1)/usr/
+endef
+
+$(eval $(call BuildPackage,libecdsautil))
+$(eval $(call BuildPackage,ecdsautils))
index fc8fadcab1c3077966edf63e70d71c3276d473dd..b4ef0224c936caf5bf7036e67f3a6d500e3840c0 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=flent-tools
-PKG_VERSION:=0.15.0
+PKG_VERSION:=1.0.1
 PKG_LICENSE:=GPLv3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/tohojo/flent
-PKG_REV:=fd4c41cf4667fb5203e41e7eaa805ae54820218b
+PKG_REV:=03c72cc340def354024351b6500774b11170d5ba
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=$(PKG_REV)
 
index cd1a6919d7f3fbb2f6093b69cd4accac7742f025..62b52d6c49cdd80c841f6d00de02a5e126bbeb28 100644 (file)
@@ -8,17 +8,18 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gnupg
-PKG_VERSION:=1.4.20
-PKG_RELEASE:=2
+PKG_VERSION:=1.4.21
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=ftp://ftp.franken.de/pub/crypt/mirror/ftp.gnupg.org/gcrypt/gnupg \
        ftp://ftp.gnupg.org/gcrypt/gnupg
-PKG_MD5SUM:=b7af897a041c03c8ad1c7c466b54d10d
+PKG_MD5SUM:=9bdeabf3c0f87ff21cb3f9216efdd01d
+PKG_HASH:=6b47a3100c857dcab3c60e6152e56a997f2c7862c1b8b2b25adf3884a1ae2276
 
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
-PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+PKG_MAINTAINER:=Daniel Dickinson <lede@cshore.thecshore.com>
 
 PKG_INSTALL:=1
 
@@ -38,6 +39,11 @@ define Package/gnupg
   MENU:=1
 endef
 
+define Package/gpgv
+  $(call Package/gnupg/Default)
+  TITLE:=GnuPG signature verification only
+endef
+
 define Package/gnupg-utils
   $(call Package/gnupg/Default)
   DEPENDS:=gnupg +libcurl
@@ -54,6 +60,13 @@ define Package/gnupg/description
  with PGP2 because it uses IDEA (which is patented worldwide).
 endef
 
+define Package/gpgv/description
+ GPGv is a stripped down version of GnuPG that only checks signatures.
+ .
+ GnuPG does not use any patented algorithms so it cannot be compatible
+ with PGP2 because it uses IDEA (which is patented worldwide).
+endef
+
 define Package/gnupg-utils/description
  Key management utilies for GnuPG.
  This package is needed to import keys from a keyserver.
@@ -79,6 +92,11 @@ define Package/gnupg/install
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gpg $(1)/usr/bin/
 endef
 
+define Package/gpgv/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gpgv $(1)/usr/bin/
+endef
+
 define Package/gnupg-utils/install
        $(INSTALL_DIR) $(1)/usr/lib/gnupg
        for file in gpgkeys_curl gpgkeys_hkp; do \
@@ -88,4 +106,5 @@ define Package/gnupg-utils/install
 endef
 
 $(eval $(call BuildPackage,gnupg))
+$(eval $(call BuildPackage,gpgv))
 $(eval $(call BuildPackage,gnupg-utils))
index 4adb5316dd92c017c7846a2548f4ce389537362c..ee72b95083fb85ee0a5797f7f114b3dad486b8d8 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gpsd
-PKG_VERSION:=3.15
-PKG_RELEASE:=2
+PKG_VERSION:=3.16
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://download-mirror.savannah.gnu.org/releases/gpsd/
-PKG_MD5SUM:=afd79b87337fadf38ee2a7c4314dac79
+PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME)
+PKG_MD5SUM:=68691b5de4c94f82ec4062b042b5eb63
 
 PKG_MAINTAINER:=Pushpal Sidhu <psidhu.devel@gmail.com>
 PKG_LICENSE:=BSD-3-Clause
@@ -122,8 +122,6 @@ define Package/gpsd/install
        $(INSTALL_CONF) ./files/gpsd.config $(1)/etc/config/gpsd
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/gpsd.init $(1)/etc/init.d/gpsd
-       $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
-       $(INSTALL_DATA) ./files/gpsd.hotplug $(1)/etc/hotplug.d/usb/20-gpsd
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/gpsd $(1)/usr/sbin/
 endef
index 1a5ddaa300144f509d647fb48e6bcf7964d23104..c0c88e0c46faf39b6012121a64f47e37e44ecefa 100644 (file)
@@ -1,5 +1,5 @@
-config gpsd core
-    option device    "/dev/ttyUSB0"
-    option port    "2947"
-    option listen_globally    "false"
-    option enabled    "false"
+config gpsd 'core'
+       option enabled '0'
+       option device '/dev/ttyUSB0'
+       option port '2947'
+       option listen_globally '0'
diff --git a/utils/gpsd/files/gpsd.hotplug b/utils/gpsd/files/gpsd.hotplug
deleted file mode 100644 (file)
index fc15dda..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-case "$ACTION" in
-    add)
-        # start process
-        # only pl2303 devices are handled
-        if [ "$PRODUCT" = "67b/2303/300" ] && [ "$TYPE" = "0/0/0" ] && [ "$INTERFACE" = "255/0/0" ]; then
-            sleep 3 && /etc/init.d/gpsd start
-        fi
-        ;;
-    remove)
-        # stop process
-        # only pl2303 devices are handled
-        if [ "$PRODUCT" = "67b/2303/300" ] && [ "$TYPE" = "0/0/0" ] && [ "$INTERFACE" = "255/0/0" ]; then
-            /etc/init.d/gpsd stop
-        fi
-        ;;
-esac
diff --git a/utils/gpsd/patches/0001-Remove-a-BSD-ism.patch b/utils/gpsd/patches/0001-Remove-a-BSD-ism.patch
deleted file mode 100644 (file)
index 55004ab..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-From 95c99f69e026e8c57aecba545e51c97f3b284e75 Mon Sep 17 00:00:00 2001
-From: "Gary E. Miller" <gem@rellim.com>
-Date: Tue, 23 Jun 2015 14:36:26 -0700
-Subject: [PATCH] Remove a BSD-ism.
-
-CTRL('L') is a BSD-ism.  CTRL() is defined in sys/ttydefaults.h
-which does not always exist.  Instead of adding scons tests for
-needing CTRL() and its include files just replace with a simple
-constant.
-
-Needed for musl and found by Baruch Siach <baruch@tkos.co.il>
----
- gpsmon.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/gpsmon.c b/gpsmon.c
-index c3001c8..58c8300 100644
---- a/gpsmon.c
-+++ b/gpsmon.c
-@@ -583,6 +583,9 @@ static void select_packet_monitor(struct gps_device_t *device)
-       (void)wnoutrefresh(devicewin);
- }
-+/* Control-L character */
-+#define CTRL_L 0x0C
-+
- static char *curses_get_command(void)
- /* char-by-char nonblocking input, return accumulated command line on \n */
- {
-@@ -591,7 +594,8 @@ static char *curses_get_command(void)
-     int c;
-     c = wgetch(cmdwin);
--    if (c == CTRL('L')) {
-+    if (CTRL_L == c) {
-+        /* ^L is to repaint the screen */
-       (void)clearok(stdscr, true);
-       if (active != NULL && (*active)->initialize != NULL)
-           (void)(*active)->initialize();
--- 
-2.6.0
-
diff --git a/utils/gpsd/patches/0002-ncurses6_detection.patch b/utils/gpsd/patches/0002-ncurses6_detection.patch
new file mode 100644 (file)
index 0000000..7a1f409
--- /dev/null
@@ -0,0 +1,15 @@
+Index: gpsd-3.16/SConstruct
+===================================================================
+--- gpsd-3.16.orig/SConstruct
++++ gpsd-3.16/SConstruct
+@@ -543,6 +543,10 @@ else:
+             ncurseslibs = pkg_config('ncurses')
+           if config.CheckPKG('tinfo'):
+               ncurseslibs += pkg_config('tinfo')
++        elif WhereIs('ncurses6-config'):
++            ncurseslibs = ['!ncurses6-config --libs --cflags']
++        elif WhereIs('ncursesw6-config'):
++            ncurseslibs = ['!ncursesw6-config --libs --cflags']
+         elif WhereIs('ncurses5-config'):
+             ncurseslibs = ['!ncurses5-config --libs --cflags']
+         elif WhereIs('ncursesw5-config'):
index 5273231dc9701ddb24935c952544b3b59e549e68..6ee0697c6217cf92989c0034528680b4afc6a080 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=grep
-PKG_VERSION:=2.25
+PKG_VERSION:=2.26
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/grep
-PKG_MD5SUM:=04e96b0e6f0fe6a180ae62c88fcd0af6
+PKG_MD5SUM:=afdd61c7221434722671baf002ac9267
 
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
diff --git a/utils/hamlib/Makefile b/utils/hamlib/Makefile
new file mode 100644 (file)
index 0000000..3787bce
--- /dev/null
@@ -0,0 +1,100 @@
+#
+# Copyright (C) 2014-2016 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:=hamlib
+PKG_VERSION:=3.0.1
+PKG_RELEASE:=1
+PKG_MD5SUM:=451acb9f727ed706ae2f59ee3f0e03c7
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/hamlib
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=COPYING
+
+PKG_MAINTAINER:=Vasilis Tsiligiannis <acinonyx@openwrt.gr>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/hamlib/Default
+  TITLE:=Ham Radio Control
+  URL:=http://hamlib.sourceforge.net
+endef
+
+define Package/hamlib/Default/description
+  Ham Radio Control Libraries is a development effort to provide a consistent
+  interface for programmers wanting to incorporate radio control in their
+  programs.
+endef
+
+define Package/hamlib
+  $(call Package/hamlib/Default)
+  TITLE+= utilities
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libhamlib
+endef
+
+define Package/hamlib/description
+  $(call Package/hamlib/Default/description)
+
+  This package contains the utilities and daemons.
+endef
+
+define Package/libhamlib/Default
+  $(call Package/hamlib/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE+= shared library
+endef
+
+define Package/libhamlib
+  $(call Package/libhamlib/Default)
+  DEPENDS:=+libusb-1.0
+  MENU:=1
+endef
+
+define Package/libhamlib/description
+  $(call Package/hamlib/Default/description)
+
+  This package contains the hamlib shared library.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/hamlib
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/hamlib/*.h $(1)/usr/include/hamlib
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhamlib.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/hamlib.pc $(1)/usr/lib/pkgconfig/
+endef
+
+CONFIGURE_ARGS+= \
+       --disable-html-matrix \
+       --disable-winradio \
+       --without-readline \
+       --without-cxx-binding \
+       --with-pic \
+
+CONFIGURE_VARS+= \
+       LIBUSB_LIBS="-lusb-1.0" \
+
+define Package/hamlib/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/{rig,rot}* $(1)/usr/bin/
+endef
+
+define Package/libhamlib/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhamlib.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,hamlib))
+$(eval $(call BuildPackage,libhamlib))
index 78a8552fc9dd89b94bcf71b74001547dcc347035..c5adad734b9c6a8ad2e3402b2a955a71c689da1e 100644 (file)
@@ -12,9 +12,9 @@ PKG_VERSION:=1.9.1
 PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.issihosts.com/$(PKG_NAME) \
-       http://pkgs.fedoraproject.org/repo/pkgs/haveged/haveged-1.9.1.tar.gz/015ff58cd10607db0e0de60aeca2f5f8/
-PKG_MD5SUM:=015ff58cd10607db0e0de60aeca2f5f8
+PKG_SOURCE_URL:=@SF/haveged \
+               http://www.issihosts.com/$(PKG_NAME)
+PKG_MD5SUM:=9c2363ed9542a6784ff08e247182137e71f2ddb79e8e6c1ac4ad50d21ced3715
 PKG_LICENSE:=GPLv3
 
 PKG_MAINTAINER:=Hannu Nyman <hannu.nyman@iki.fi>
diff --git a/utils/hfsprogs/Makefile b/utils/hfsprogs/Makefile
deleted file mode 100644 (file)
index 9c44a35..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#
-# Copyright (C) 2015 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:=hfsprogs
-PKG_VERSION:=332.25
-PKG_RELEASE:=1
-
-PKG_LICENSE:=GPL-3.0+
-PKG_LICENSE_FILES:=COPYING
-
-PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
-
-PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
-PKG_SOURCE_URL:=http://archive.ubuntu.com/ubuntu/pool/universe/h/$(PKG_NAME)
-PKG_BUILD_DIR:=$(BUILD_DIR)/diskdev_cmds-$(PKG_VERSION)
-PKG_MD5SUM:=261c3de5ec0dcf5244e3f60d79c1d6f1
-PKG_LICENSE:=APSL 2.0
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
-
-define Package/hfsprogs/Default
-  SECTION:=utils
-  CATEGORY:=Utilities
-  SUBMENU:=Filesystem
-  DEPENDS:=+libopenssl
-endef
-
-define Package/hfsfsck
-  $(call Package/hfsprogs/Default)
-  TITLE:=fsck (fsck.hfs) utility from hfsprogs
-endef
-
-define Package/mkhfs
-  $(call Package/hfsprogs/Default)
-  TITLE:=mkfs (mkfs.hfs) utility from hfsprogs
-endef
-
-define Package/hfsfsck/description
-       Utilities to create and check HFS/HFS+ filesystems.
-       (fsck.hfs and fsck.hfsplus for checking integrity of HFS/HFS+ volumes)
-endef
-
-define Package/mkhfs/description
-       Utilities to create and check HFS/HFS+ filesystems.
-       (mkfs.hfs and mkfs.hfsplus for creating HFS/HFS+ volumes)
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               -f Makefile.lnx \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS+="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1" \
-               all
-endef
-
-define Package/hfsfsck/install
-       $(INSTALL_DIR) $(1)/lib/functions/fsck
-       $(INSTALL_DATA) ./files/hfsfsck.sh $(1)/lib/functions/fsck/
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/fsck_hfs.tproj/fsck_hfs $(1)/usr/sbin/fsck.hfsplus
-       (cd $(1)/usr/sbin; ln -sf fsck.hfsplus fsck.hfs;)
-endef
-
-define Package/mkhfs/install
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/newfs_hfs.tproj/newfs_hfs $(1)/usr/sbin/mkfs.hfsplus
-       (cd $(1)/usr/sbin; ln -sf mkfs.hfsplus mkfs.hfs;)
-endef
-
-$(eval $(call BuildPackage,hfsfsck))
-$(eval $(call BuildPackage,mkhfs))
diff --git a/utils/hfsprogs/files/hfsfsck.sh b/utils/hfsprogs/files/hfsfsck.sh
deleted file mode 100644 (file)
index 8bcd2c1..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-# Copyright 2015 OpenWrt.org
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-fsck_hfsfsck() {
-       hfsfsck "$device" 2>&1 | logger -t "fstab: hfsfsck ($device)"
-       local status="$?"
-       case "$status" in
-               0) ;; #success
-               4) reboot;;
-               8) echo "hfsfsck ($device): Warning! Uncorrected errors."| logger -t fstab
-                       return 1
-                       ;;
-               *) echo "hfsfsck ($device): Error $status. Check not complete."| logger -t fstab;;
-       esac
-       return 0
-}
-
-fsck_hfs() {
-       fsck_hfsfsck "$@"
-}
-
-fsck_hfsplus() {
-       fsck_hfsfsck "$@"
-}
-
-append libmount_known_fsck "hfs"
-append libmount_known_fsck "hfsplus"
diff --git a/utils/hfsprogs/patches/0001-Create-short-Makefiles-for-Debian.patch b/utils/hfsprogs/patches/0001-Create-short-Makefiles-for-Debian.patch
deleted file mode 100644 (file)
index a8c4193..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
-Date: Thu, 24 Oct 2013 01:11:21 -0200
-Subject: Create short Makefiles for Debian
-
-Create short Makefiles for compiling just the necessary parts for a
-Debian-based (and possibly other distributions) HFS+ filesystem
-utilities.
----
- Makefile.lnx                       |  8 ++++++++
- fsck_hfs.tproj/Makefile.lnx        | 16 ++++++++++++++++
- fsck_hfs.tproj/dfalib/Makefile.lnx | 15 +++++++++++++++
- newfs_hfs.tproj/Makefile.lnx       | 12 ++++++++++++
- 4 files changed, 51 insertions(+)
- create mode 100644 Makefile.lnx
- create mode 100644 fsck_hfs.tproj/Makefile.lnx
- create mode 100644 fsck_hfs.tproj/dfalib/Makefile.lnx
- create mode 100644 newfs_hfs.tproj/Makefile.lnx
-
-diff --git a/Makefile.lnx b/Makefile.lnx
-new file mode 100644
-index 0000000..687d1e7
---- /dev/null
-+++ b/Makefile.lnx
-@@ -0,0 +1,8 @@
-+CC := gcc
-+CFLAGS += -I$(PWD)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1
-+SUBDIRS := newfs_hfs.tproj fsck_hfs.tproj
-+
-+all clean:
-+      for d in $(SUBDIRS); do $(MAKE) -C $$d -f Makefile.lnx $@; done
-+
-+export CC CFLAGS
-diff --git a/fsck_hfs.tproj/Makefile.lnx b/fsck_hfs.tproj/Makefile.lnx
-new file mode 100644
-index 0000000..977d7e8
---- /dev/null
-+++ b/fsck_hfs.tproj/Makefile.lnx
-@@ -0,0 +1,16 @@
-+CFILES = fsck_hfs.c strings.c utilities.c cache.c fsck_debug.c
-+OFILES = $(CFILES:.c=.o)
-+
-+all: fsck_hfs
-+
-+fsck_hfs: $(OFILES) dfalib/libdfa.a
-+      $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OFILES) dfalib/libdfa.a
-+
-+dfalib/libdfa.a: FORCE
-+      $(MAKE) -C dfalib -f Makefile.lnx CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" libdfa.a
-+
-+clean:
-+      $(RM) fsck_hfs $(OFILES)
-+      $(MAKE) -C dfalib -f Makefile.lnx clean
-+
-+.PHONY : FORCE clean
-diff --git a/fsck_hfs.tproj/dfalib/Makefile.lnx b/fsck_hfs.tproj/dfalib/Makefile.lnx
-new file mode 100644
-index 0000000..8c07196
---- /dev/null
-+++ b/fsck_hfs.tproj/dfalib/Makefile.lnx
-@@ -0,0 +1,15 @@
-+CFILES = hfs_endian.c BlockCache.c\
-+         BTree.c BTreeAllocate.c BTreeMiscOps.c \
-+         BTreeNodeOps.c BTreeScanner.c BTreeTreeOps.c\
-+         CatalogCheck.c HardLinkCheck.c\
-+         SBTree.c SControl.c SVerify1.c SVerify2.c\
-+         SRepair.c SRebuildCatalogBTree.c\
-+         SUtils.c SKeyCompare.c SDevice.c SExtents.c SAllocate.c\
-+         SCatalog.c SStubs.c VolumeBitmapCheck.c
-+OFILES = $(CFILES:.c=.o)
-+
-+libdfa.a: $(OFILES)
-+      ar rc $@ $?
-+
-+clean:
-+      $(RM) $(OFILES) libdfa.a
-diff --git a/newfs_hfs.tproj/Makefile.lnx b/newfs_hfs.tproj/Makefile.lnx
-new file mode 100644
-index 0000000..58e6700
---- /dev/null
-+++ b/newfs_hfs.tproj/Makefile.lnx
-@@ -0,0 +1,12 @@
-+CFILES = hfs_endian.c makehfs.c newfs_hfs.c
-+OFILES = $(CFILES:.c=.o)
-+
-+all: newfs_hfs
-+
-+newfs_hfs: $(OFILES)
-+      $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OFILES) -lcrypto
-+
-+clean:
-+      $(RM) newfs_hfs $(OFILES)
-+
-+.PHONY : FORCE clean
diff --git a/utils/hfsprogs/patches/0002-Add-exclude-Darwin-specific-code.patch b/utils/hfsprogs/patches/0002-Add-exclude-Darwin-specific-code.patch
deleted file mode 100644 (file)
index 0046c36..0000000
+++ /dev/null
@@ -1,1407 +0,0 @@
-From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
-Date: Thu, 24 Oct 2013 01:11:21 -0200
-Subject: Add/exclude Darwin-specific code
-
-Modify some of the files so that they can be compiled without the
-Apple owned frameworks in a Debian system (and possibly others).
----
- fsck_hfs.tproj/cache.c              |   4 ++
- fsck_hfs.tproj/dfalib/BTree.c       |   2 +
- fsck_hfs.tproj/dfalib/BlockCache.c  |   3 +
- fsck_hfs.tproj/dfalib/SBTree.c      |   2 +
- fsck_hfs.tproj/dfalib/SDevice.c     |  92 ++++++++++++++++++++---------
- fsck_hfs.tproj/dfalib/SKeyCompare.c |   2 +
- fsck_hfs.tproj/dfalib/SRepair.c     |   2 +
- fsck_hfs.tproj/dfalib/SRuntime.h    |   7 ++-
- fsck_hfs.tproj/dfalib/SUtils.c      |   5 +-
- fsck_hfs.tproj/dfalib/SVerify2.c    |   7 +++
- fsck_hfs.tproj/dfalib/Scavenger.h   |  11 +++-
- fsck_hfs.tproj/dfalib/hfs_endian.c  |   4 ++
- fsck_hfs.tproj/dfalib/hfs_endian.h  |   7 ++-
- fsck_hfs.tproj/fsck_hfs.c           |  61 +++++++++++++++----
- fsck_hfs.tproj/utilities.c          |   8 ++-
- include/missing.h                   | 115 ++++++++++++++++++++++++++++++++++++
- newfs_hfs.tproj/hfs_endian.c        |   5 ++
- newfs_hfs.tproj/hfs_endian.h        |   5 ++
- newfs_hfs.tproj/makehfs.c           |  72 ++++++++++++++++------
- newfs_hfs.tproj/newfs_hfs.c         |  74 ++++++++++++++++++++---
- newfs_hfs.tproj/newfs_hfs.h         |  26 ++++----
- 21 files changed, 429 insertions(+), 85 deletions(-)
- create mode 100644 include/missing.h
-
-diff --git a/fsck_hfs.tproj/cache.c b/fsck_hfs.tproj/cache.c
-index be46195..527088a 100644
---- a/fsck_hfs.tproj/cache.c
-+++ b/fsck_hfs.tproj/cache.c
-@@ -26,7 +26,11 @@
- #include <stdlib.h>
- #include <sys/mman.h>
- #include <sys/stat.h>
-+#if LINUX
-+#include "missing.h"
-+#else
- #include <sys/types.h>
-+#endif /* __LINUX__ */
- #include <sys/uio.h>
- #include <unistd.h>
- #include <string.h>
-diff --git a/fsck_hfs.tproj/dfalib/BTree.c b/fsck_hfs.tproj/dfalib/BTree.c
-index edd8301..7ad9fe0 100644
---- a/fsck_hfs.tproj/dfalib/BTree.c
-+++ b/fsck_hfs.tproj/dfalib/BTree.c
-@@ -1705,7 +1705,9 @@ OSStatus BTGetInformation        (SFCB                                   *filePtr,
-                                                                UInt16                                  version,
-                                                                BTreeInfoRec                   *info )
- {
-+#if !LINUX
- #pragma unused (version)
-+#endif
-       BTreeControlBlockPtr    btreePtr;
-diff --git a/fsck_hfs.tproj/dfalib/BlockCache.c b/fsck_hfs.tproj/dfalib/BlockCache.c
-index 1bb952f..e3a28a2 100644
---- a/fsck_hfs.tproj/dfalib/BlockCache.c
-+++ b/fsck_hfs.tproj/dfalib/BlockCache.c
-@@ -20,6 +20,9 @@
-  * @APPLE_LICENSE_HEADER_END@
-  */
-+#if LINUX
-+#include "missing.h"
-+#endif
- #include "SRuntime.h"
- #include "Scavenger.h"
- #include "../cache.h"
-diff --git a/fsck_hfs.tproj/dfalib/SBTree.c b/fsck_hfs.tproj/dfalib/SBTree.c
-index 2fbcd1d..cd81b13 100644
---- a/fsck_hfs.tproj/dfalib/SBTree.c
-+++ b/fsck_hfs.tproj/dfalib/SBTree.c
-@@ -322,7 +322,9 @@ ErrorExit:
- OSStatus
- SetEndOfForkProc ( SFCB *filePtr, FSSize minEOF, FSSize maxEOF )
- {
-+#if !LINUX
- #pragma unused (maxEOF)
-+#endif
-       OSStatus        result;
-       UInt32          actualSectorsAdded;
-diff --git a/fsck_hfs.tproj/dfalib/SDevice.c b/fsck_hfs.tproj/dfalib/SDevice.c
-index bf6f61c..9a46023 100644
---- a/fsck_hfs.tproj/dfalib/SDevice.c
-+++ b/fsck_hfs.tproj/dfalib/SDevice.c
-@@ -2,7 +2,7 @@
-  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
-  *
-  * @APPLE_LICENSE_HEADER_START@
-- * 
-+ *
-  * "Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
-  * Reserved.  This file contains Original Code and/or Modifications of
-  * Original Code as defined in and that are subject to the Apple Public
-@@ -10,7 +10,7 @@
-  * except in compliance with the License.  Please obtain a copy of the
-  * License at http://www.apple.com/publicsource and read it before using
-  * this file.
-- * 
-+ *
-  * The Original Code and all software distributed under the License are
-  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
-  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
-@@ -18,7 +18,7 @@
-  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
-  * License for the specific language governing rights and limitations
-  * under the License."
-- * 
-+ *
-  * @APPLE_LICENSE_HEADER_END@
-  */
- #include "SRuntime.h"
-@@ -28,33 +28,71 @@
- #include <unistd.h>
- #include <errno.h>
- #include <sys/ioctl.h>
--
-+#if LINUX
-+#include <fcntl.h>
-+#include <sys/stat.h>
-+#else
- #include <IOKit/storage/IOMediaBSDClient.h>
--
-+#endif /* LINUX */
- #else
--
- #include <Files.h>
- #include <Device.h>
- #include <Disks.h>
- #endif
--
- OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize)
- {
- #if BSD
-       UInt64 devBlockCount = 0;
-       int devBlockSize = 0;
-+#if LINUX
-+      struct stat stbuf;
-+
-+      devBlockSize = 512;
-+#ifndef BLKGETSIZE
-+#define BLKGETSIZE              _IO(0x12,96)
-+#endif
-+#ifndef BLKGETSIZE64
-+#define BLKGETSIZE64            _IOR(0x12,114,size_t)
-+#endif
-+      if (fstat(driveRefNum, &stbuf) < 0){
-+              printf("Error: %s\n", strerror(errno));
-+              return(-1);
-+      }
-+
-+        if (S_ISREG(stbuf.st_mode)) {
-+                devBlockCount = stbuf.st_size / 512;
-+        }
-+        else if (S_ISBLK(stbuf.st_mode)) {
-+                unsigned long size;
-+                u_int64_t size64;
-+                if (!ioctl(driveRefNum, BLKGETSIZE64, &size64))
-+                        devBlockCount = size64 / 512;
-+                else if (!ioctl(driveRefNum, BLKGETSIZE, &size))
-+                        devBlockCount = size;
-+                else{
-+                        printf("Error: %s\n", strerror(errno));
-+                      return(-1);
-+              }
-+
-+        }
-+        else{
-+                printf("Device is not a block device");
-+              return(-1);
-+      }
-+#elif BSD
-       if (ioctl(driveRefNum, DKIOCGETBLOCKCOUNT, &devBlockCount) < 0) {
-               printf("ioctl(DKIOCGETBLOCKCOUNT) for fd %d: %s\n", driveRefNum, strerror(errno));
-               return (-1);
-       }
--      
-+
-       if (ioctl(driveRefNum, DKIOCGETBLOCKSIZE, &devBlockSize) < 0) {
-               printf("ioctl(DKIOCGETBLOCKSIZE) for fd %d: %s\n", driveRefNum, strerror(errno));
-               return (-1);
-       }
-+#endif /* BSD */
-       if (devBlockSize != 512) {
-               *numBlocks = (devBlockCount * (UInt64)devBlockSize) / 512;
-@@ -70,24 +108,24 @@ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize)
-       {
-               /* return format list status code */
-               kFmtLstCode = 6,
--              
-+
-               /* reference number of .SONY driver */
-               kSonyRefNum = 0xfffb,
--              
-+
-               /* values returned by DriveStatus in DrvSts.twoSideFmt */
-               kSingleSided = 0,
-               kDoubleSided = -1,
-               kSingleSidedSize = 800,         /* 400K */
-               kDoubleSidedSize = 1600,        /* 800K */
--              
-+
-               /* values in DrvQEl.qType */
-               kWordDrvSiz = 0,
-               kLongDrvSiz = 1,
--              
-+
-               /* more than enough formatListRecords */
-               kMaxFormatListRecs = 16
-       };
--      
-+
-       ParamBlockRec   pb;
-       FormatListRec   formatListRecords[kMaxFormatListRecs];
-       DrvSts                  status;
-@@ -95,22 +133,22 @@ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize)
-       OSErr                   result;
-       unsigned long   blocks                  = 0;
--      
-+
-       /* Attempt to get the drive's format list. */
-       /* (see the Technical Note "What Your Sony Drives For You") */
--      
-+
-       pb.cntrlParam.ioVRefNum = driveQElementPtr->dQDrive;
-       pb.cntrlParam.ioCRefNum = driveQElementPtr->dQRefNum;
-       pb.cntrlParam.csCode = kFmtLstCode;
-       pb.cntrlParam.csParam[0] = kMaxFormatListRecs;
-       *(long *)&pb.cntrlParam.csParam[1] = (long)&formatListRecords[0];
--      
-+
-       result = PBStatusSync(&pb);
--      
-+
-       if ( result == noErr )
-       {
-               /* The drive supports ReturnFormatList status call. */
--              
-+
-               /* Get the current disk's size. */
-               for( formatListRecIndex = 0;
-                        formatListRecIndex < pb.cntrlParam.csParam[0];
-@@ -131,7 +169,7 @@ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize)
-       else if ( driveQElementPtr->dQRefNum == (short)kSonyRefNum )
-       {
-               /* The drive is a non-SuperDrive floppy which only supports 400K and 800K disks */
--              
-+
-               result = DriveStatus(driveQElementPtr->dQDrive, &status);
-               if ( result == noErr )
-               {
-@@ -140,11 +178,11 @@ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize)
-                               case kSingleSided:
-                                       blocks = kSingleSidedSize;
-                                       break;
--                                      
-+
-                               case kDoubleSided:
-                                       blocks = kDoubleSidedSize;
-                                       break;
--                                      
-+
-                               default:                //      This should never happen
-                                       result = paramErr;
-                                       break;
-@@ -155,20 +193,20 @@ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize)
-       {
-               /* The drive is not a floppy and it doesn't support ReturnFormatList */
-               /* so use the dQDrvSz field(s) */
--              
-+
-               result = noErr; /* reset result */
--              
-+
-               switch ( driveQElementPtr->qType )
-               {
-                       case kWordDrvSiz:
-                               blocks = driveQElementPtr->dQDrvSz;
-                               break;
--                              
-+
-                       case kLongDrvSiz:
-                               blocks = ((unsigned long)driveQElementPtr->dQDrvSz2 << 16) +
-                                                driveQElementPtr->dQDrvSz;
-                               break;
--                              
-+
-                       default:                //      This should never happen
-                               result = paramErr;
-                               break;
-@@ -177,7 +215,7 @@ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize)
-       *numBlocks = blocks;
-       *blockSize = 512;
--      
-+
-       return( result );
- #endif
- }
-@@ -188,7 +226,7 @@ OSErr DeviceRead(int device, int drive, void* buffer, SInt64 offset, UInt32 reqB
- #if BSD
-       off_t seek_off;
-       ssize_t nbytes;
--      
-+
-       *actBytes = 0;
-       seek_off = lseek(device, offset, SEEK_SET);
-diff --git a/fsck_hfs.tproj/dfalib/SKeyCompare.c b/fsck_hfs.tproj/dfalib/SKeyCompare.c
-index 46e145f..18d99c5 100644
---- a/fsck_hfs.tproj/dfalib/SKeyCompare.c
-+++ b/fsck_hfs.tproj/dfalib/SKeyCompare.c
-@@ -454,7 +454,9 @@ SInt32 CompareExtentKeysPlus( const HFSPlusExtentKey *searchKey, const HFSPlusEx
-  * The name portion of the key is compared using a 16-bit binary comparison. 
-  * This is called from the b-tree code.
-  */
-+#if !LINUX
- __private_extern__
-+#endif
- SInt32
- CompareAttributeKeys(const AttributeKey *searchKey, const AttributeKey *trialKey)
- {
-diff --git a/fsck_hfs.tproj/dfalib/SRepair.c b/fsck_hfs.tproj/dfalib/SRepair.c
-index 01c1a10..8eb759c 100644
---- a/fsck_hfs.tproj/dfalib/SRepair.c
-+++ b/fsck_hfs.tproj/dfalib/SRepair.c
-@@ -1617,7 +1617,9 @@ Output:
- static        OSErr   FixWrapperExtents( SGlobPtr GPtr, RepairOrderPtr p )
- {
-+#if !LINUX
- #pragma unused (p)
-+#endif
-       OSErr                                           err;
-       HFSMasterDirectoryBlock         *mdb;
-diff --git a/fsck_hfs.tproj/dfalib/SRuntime.h b/fsck_hfs.tproj/dfalib/SRuntime.h
-index 646917b..770e3ef 100644
---- a/fsck_hfs.tproj/dfalib/SRuntime.h
-+++ b/fsck_hfs.tproj/dfalib/SRuntime.h
-@@ -27,8 +27,11 @@
- #define __SRUNTIME__
- #if BSD
--
-+#if LINUX
-+#include "missing.h"
-+#else
- #include <sys/types.h>
-+#endif
- #include <stdlib.h>
- #include <string.h>
- #include <stdio.h>
-@@ -91,10 +94,12 @@ typedef const unsigned char *      ConstStr255Param;
- typedef u_int32_t     HFSCatalogNodeID;
-+#if !LINUX
- enum {
-       false           = 0,
-       true            = 1
- };
-+#endif
- /* OS error codes */
- enum {
-diff --git a/fsck_hfs.tproj/dfalib/SUtils.c b/fsck_hfs.tproj/dfalib/SUtils.c
-index 72035f0..6e9253e 100644
---- a/fsck_hfs.tproj/dfalib/SUtils.c
-+++ b/fsck_hfs.tproj/dfalib/SUtils.c
-@@ -380,7 +380,8 @@ void       InvalidateCalculatedVolumeBitMap( SGlobPtr GPtr )
- //                            GPtr->realVCB                   Real in-memory vcb
- //------------------------------------------------------------------------------
--#if !BSD      
-+#if BSD
-+#if !LINUX
- OSErr GetVolumeFeatures( SGlobPtr GPtr )
- {
-       OSErr                                   err;
-@@ -418,7 +419,7 @@ OSErr GetVolumeFeatures( SGlobPtr GPtr )
-       return( noErr );
- }
- #endif
--
-+#endif
- /*-------------------------------------------------------------------------------
-diff --git a/fsck_hfs.tproj/dfalib/SVerify2.c b/fsck_hfs.tproj/dfalib/SVerify2.c
-index 6a47935..c68f3d8 100644
---- a/fsck_hfs.tproj/dfalib/SVerify2.c
-+++ b/fsck_hfs.tproj/dfalib/SVerify2.c
-@@ -32,7 +32,9 @@
- */
- #include <sys/ioctl.h>
-+#if !LINUX
- #include <sys/disk.h>
-+#endif
- #include "BTree.h"
- #include "BTreePrivate.h"
-@@ -1354,8 +1356,13 @@ OSErr CompareVolumeHeader( SGlobPtr GPtr, HFSPlusVolumeHeader *volumeHeader )
-        * clump size for read-only media is irrelevant we skip the clump size 
-        * check to avoid non useful warnings. 
-        */
-+#if LINUX
-+      // FIXME
-+      isWriteable = 1;
-+#else
-       isWriteable = 0;
-       ioctl( GPtr->DrvNum, DKIOCISWRITABLE, &isWriteable );
-+#endif
-       if ( isWriteable != 0 && 
-                volumeHeader->catalogFile.clumpSize != vcb->vcbCatalogFile->fcbClumpSize ) {
-               PrintError(GPtr, E_InvalidClumpSize, 0);
-diff --git a/fsck_hfs.tproj/dfalib/Scavenger.h b/fsck_hfs.tproj/dfalib/Scavenger.h
-index cf53970..edb3a80 100644
---- a/fsck_hfs.tproj/dfalib/Scavenger.h
-+++ b/fsck_hfs.tproj/dfalib/Scavenger.h
-@@ -37,11 +37,16 @@
- #include "../fsck_debug.h"
- #include <assert.h>
-+#if LINUX
-+#define XATTR_MAXNAMELEN 127
-+#include <limits.h>
-+#else
- #include <sys/xattr.h>
- #include <sys/acl.h>
- #include <sys/kauth.h>
--#include <sys/errno.h>
- #include <sys/syslimits.h>
-+#endif
-+#include <sys/errno.h>
- #ifdef __cplusplus
- extern        "C" {
-@@ -1465,4 +1470,8 @@ extern int       AllocateContigBitmapBits (SVCB *vcb, UInt32 numBlocks, UInt32 *actua
- };
- #endif
-+/* #if LINUX
-+#undef XATTR_MAXNAMELEN
-+#endif */
-+
- #endif /* __SCAVENGER__ */
-diff --git a/fsck_hfs.tproj/dfalib/hfs_endian.c b/fsck_hfs.tproj/dfalib/hfs_endian.c
-index 7fa5385..69500c1 100755
---- a/fsck_hfs.tproj/dfalib/hfs_endian.c
-+++ b/fsck_hfs.tproj/dfalib/hfs_endian.c
-@@ -31,7 +31,11 @@
- #include <sys/types.h>
- #include <sys/stat.h>
-+#if LINUX
-+#include "missing.h"
-+#else
- #include <architecture/byte_order.h>
-+#endif
- #include <hfs/hfs_format.h>
- #include "Scavenger.h"
-diff --git a/fsck_hfs.tproj/dfalib/hfs_endian.h b/fsck_hfs.tproj/dfalib/hfs_endian.h
-index 52d0c3a..0763d9d 100755
---- a/fsck_hfs.tproj/dfalib/hfs_endian.h
-+++ b/fsck_hfs.tproj/dfalib/hfs_endian.h
-@@ -27,9 +27,14 @@
-  *
-  * This file prototypes endian swapping routines for the HFS/HFS Plus
-  * volume format.
-- */
-+*/
- #include <hfs/hfs_format.h>
-+#if LINUX
-+#include <endian.h>
-+#include <byteswap.h>
-+#else
- #include <architecture/byte_order.h>
-+#endif
- #include "SRuntime.h"
- /*********************/
-diff --git a/fsck_hfs.tproj/fsck_hfs.c b/fsck_hfs.tproj/fsck_hfs.c
-index 90532fd..f1a18bd 100644
---- a/fsck_hfs.tproj/fsck_hfs.c
-+++ b/fsck_hfs.tproj/fsck_hfs.c
-@@ -24,10 +24,14 @@
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <sys/param.h>
-+#if !LINUX
- #include <sys/ucred.h>
-+#endif
- #include <sys/mount.h>
- #include <sys/ioctl.h>
-+#if !LINUX
- #include <sys/disk.h>
-+#endif
- #include <hfs/hfs_mount.h>
-@@ -195,8 +199,12 @@ main(argc, argv)
-       if (guiControl)
-               debug = 0; /* debugging is for command line only */
-+#if LINUX
-+// FIXME
-+#else
-       if (signal(SIGINT, SIG_IGN) != SIG_IGN)
-               (void)signal(SIGINT, catch);
-+#endif
-       if (argc < 1) {
-               (void) fprintf(stderr, "%s: missing special-device\n", progname);
-@@ -218,7 +226,9 @@ checkfilesys(char * filesys)
-       int chkLev, repLev, logLev;
-       int blockDevice_fd, canWrite;
-       char *unraw, *mntonname;
-+#if !LINUX
-       struct statfs *fsinfo;
-+#endif
-       int fs_fd=-1;  // fd to the root-dir of the fs we're checking (only w/lfag == 1)
-       flags = 0;
-@@ -227,7 +237,9 @@ checkfilesys(char * filesys)
-       canWrite = 0;
-       unraw = NULL;
-       mntonname = NULL;
--
-+#if LINUX
-+      // FIXME
-+#else
-       if (lflag) {
-               result = getmntinfo(&fsinfo, MNT_NOWAIT);
-@@ -257,10 +269,10 @@ checkfilesys(char * filesys)
-                   }
-               }
-       }
--
-+#endif
-       if (debug && preen)
-               pwarn("starting\n");
--      
-+
-       if (setup( filesys, &blockDevice_fd, &canWrite ) == 0) {
-               if (preen)
-                       pfatal("CAN'T CHECK FILE SYSTEM.");
-@@ -278,7 +290,7 @@ checkfilesys(char * filesys)
-       repLev = kMajorRepairs;
-       logLev = kVerboseLog;
--      if (yflag)      
-+      if (yflag)
-               repLev = kMajorRepairs;
-       if (quick) {
-@@ -298,16 +310,16 @@ checkfilesys(char * filesys)
-       if (nflag)
-               repLev = kNeverRepair;
--              
-+
-       if ( rebuildCatalogBtree ) {
-               chkLev = kPartialCheck;
-               repLev = kForceRepairs;  // this will force rebuild of catalog B-Tree file
-       }
--              
-+
-       /*
-        * go check HFS volume...
-        */
--      result = CheckHFS(      fsreadfd, fswritefd, chkLev, repLev, logLev, 
-+      result = CheckHFS(      fsreadfd, fswritefd, chkLev, repLev, logLev,
-                                               guiControl, lostAndFoundMode, canWrite, &fsmodified );
-       if (!hotroot) {
-               ckfini(1);
-@@ -330,6 +342,9 @@ checkfilesys(char * filesys)
-                       }
-               }
-       } else {
-+#if LINUX
-+      // FIXME
-+#else
-               struct statfs stfs_buf;
-               /*
-                * Check to see if root is mounted read-write.
-@@ -339,19 +354,25 @@ checkfilesys(char * filesys)
-               else
-                       flags = 0;
-               ckfini(flags & MNT_RDONLY);
-+#endif
-       }
-       /* XXX free any allocated memory here */
-       if (hotroot && fsmodified) {
-+#if !LINUX
-               struct hfs_mount_args args;
-+#endif
-               /*
-                * We modified the root.  Do a mount update on
-                * it, unless it is read-write, so we can continue.
-                */
-               if (!preen)
-                       printf("\n***** FILE SYSTEM WAS MODIFIED *****\n");
--              if (flags & MNT_RDONLY) {               
-+#if LINUX
-+              // FIXME
-+#else
-+              if (flags & MNT_RDONLY) {
-                       bzero(&args, sizeof(args));
-                       flags |= MNT_UPDATE | MNT_RELOAD;
-                       if (mount("hfs", "/", flags, &args) == 0) {
-@@ -359,6 +380,7 @@ checkfilesys(char * filesys)
-                               goto ExitThisRoutine;
-                       }
-               }
-+#endif
-               if (!preen)
-                       printf("\n***** REBOOT NOW *****\n");
-               sync();
-@@ -367,7 +389,7 @@ checkfilesys(char * filesys)
-       }
-       result = (result == 0) ? 0 : EEXIT;
--      
-+
- ExitThisRoutine:
-       if (lflag) {
-           fcntl(fs_fd, F_THAW_FS, NULL);
-@@ -401,16 +423,18 @@ setup( char *dev, int *blockDevice_fdPtr, int *canWritePtr )
-       fswritefd = -1;
-       *blockDevice_fdPtr = -1;
-       *canWritePtr = 0;
--      
-+
-       if (stat(dev, &statb) < 0) {
-               printf("Can't stat %s: %s\n", dev, strerror(errno));
-               return (0);
-       }
-+#if !LINUX
-       if ((statb.st_mode & S_IFMT) != S_IFCHR) {
-               pfatal("%s is not a character device", dev);
-               if (reply("CONTINUE") == 0)
-                       return (0);
-       }
-+#endif
-       if ((fsreadfd = open(dev, O_RDONLY)) < 0) {
-               printf("Can't open %s: %s\n", dev, strerror(errno));
-               return (0);
-@@ -419,7 +443,7 @@ setup( char *dev, int *blockDevice_fdPtr, int *canWritePtr )
-       /* attempt to get write access to the block device and if not check if volume is */
-       /* mounted read-only.  */
-       getWriteAccess( dev, blockDevice_fdPtr, canWritePtr );
--      
-+
-       if (preen == 0 && !guiControl)
-               printf("** %s", dev);
-       if (nflag || (fswritefd = open(dev, O_WRONLY)) < 0) {
-@@ -433,10 +457,14 @@ setup( char *dev, int *blockDevice_fdPtr, int *canWritePtr )
-               printf("\n");
-       /* Get device block size to initialize cache */
-+#if LINUX
-+      devBlockSize = 512;
-+#else
-       if (ioctl(fsreadfd, DKIOCGETBLOCKSIZE, &devBlockSize) < 0) {
-               pfatal ("Can't get device block size\n");
-               return (0);
-       }
-+#endif
-        /* calculate the cache block size and total blocks */
-       if (CalculateCacheSize(userCacheSize, &cacheBlockSize, &cacheTotalBlocks, debug) != 0) {
-@@ -463,11 +491,15 @@ setup( char *dev, int *blockDevice_fdPtr, int *canWritePtr )
- static void getWriteAccess( char *dev, int *blockDevice_fdPtr, int *canWritePtr )
- {
-+#if !LINUX
-       int                                     i;
-       int                                     myMountsCount;
-+#endif
-       void *                          myPtr;
-       char *                          myCharPtr;
-+#if !LINUX
-       struct statfs *         myBufPtr;
-+#endif
-       void *                          myNamePtr;
-       myPtr = NULL;
-@@ -490,6 +522,9 @@ static void getWriteAccess( char *dev, int *blockDevice_fdPtr, int *canWritePtr
-       }
-       
-       // get count of mounts then get the info for each 
-+#if LINUX
-+      // FIXME
-+#else
-       myMountsCount = getfsstat( NULL, 0, MNT_NOWAIT );
-       if ( myMountsCount < 0 )
-               goto ExitThisRoutine;
-@@ -513,8 +548,8 @@ static void getWriteAccess( char *dev, int *blockDevice_fdPtr, int *canWritePtr
-               }
-               myBufPtr++;
-       }
--      *canWritePtr = 1;  // single user will get us here, f_mntfromname is not /dev/diskXXXX 
--      
-+#endif
-+      *canWritePtr = 1;  // single user will get us here, f_mntfromname is not /dev/diskXXXX
- ExitThisRoutine:
-       if ( myPtr != NULL )
-               free( myPtr );
-diff --git a/fsck_hfs.tproj/utilities.c b/fsck_hfs.tproj/utilities.c
-index ee41bef..8e1cd77 100644
---- a/fsck_hfs.tproj/utilities.c
-+++ b/fsck_hfs.tproj/utilities.c
-@@ -183,12 +183,14 @@ retry:
-                       printf("Can't stat %s\n", raw);
-                       return (origname);
-               }
-+#if !LINUX
-               if ((stchar.st_mode & S_IFMT) == S_IFCHR) {
-                       return (raw);
-               } else {
-                       printf("%s is not a character device\n", raw);
-                       return (origname);
-               }
-+#endif
-       } else if ((stblock.st_mode & S_IFMT) == S_IFCHR && !retried) {
-               newname = unrawname(newname);
-               retried++;
-@@ -214,7 +216,11 @@ rawname(char *name)
-       *dp = 0;
-       (void)strcpy(rawbuf, name);
-       *dp = '/';
--      (void)strcat(rawbuf, "/r");
-+#if LINUX
-+      (void)strcat(rawbuf, "/");
-+#else
-+      (void)strcat(rawbuf,"/r");
-+#endif
-       (void)strcat(rawbuf, &dp[1]);
-       return (rawbuf);
-diff --git a/include/missing.h b/include/missing.h
-new file mode 100644
-index 0000000..0a859c4
---- /dev/null
-+++ b/include/missing.h
-@@ -0,0 +1,114 @@
-+#ifndef _MISSING_H_
-+#define _MISSING_H_
-+
-+#include <endian.h>
-+#include <byteswap.h>
-+#include <errno.h>
-+#include <stdint.h>
-+#include <string.h>
-+
-+#define MAXBSIZE              (256 * 4096)
-+
-+#ifndef true
-+#define true                  1
-+#endif
-+#ifndef false
-+#define false                 0
-+#endif
-+
-+/* Mac types */
-+
-+/* 8 Bit */
-+#ifndef UInt8
-+#define UInt8                 uint8_t
-+#endif
-+#ifndef u_int8_t
-+#define u_int8_t              UInt8
-+#endif
-+#ifndef SInt8
-+#define SInt8                 int8_t
-+#endif
-+
-+/* 16 Bit */
-+#ifndef UInt16
-+#define UInt16                        uint16_t
-+#endif
-+#ifndef u_int16_t
-+#define u_int16_t             UInt16
-+#endif
-+#ifndef SInt16
-+#define SInt16                        int16_t
-+#endif
-+
-+/* 32 Bit */
-+#ifndef UInt32
-+#define UInt32                        uint32_t
-+#endif
-+#ifndef u_int32_t
-+#define u_int32_t             UInt32
-+#endif
-+#ifndef SInt32
-+#define SInt32                        int32_t
-+#endif
-+
-+/* 64 Bit */
-+#ifndef UInt64
-+#define UInt64                        uint64_t
-+#endif
-+#ifndef u_int64_t
-+#define u_int64_t             UInt64
-+#endif
-+#ifndef SInt64
-+#define SInt64                        int64_t
-+#endif
-+
-+#define UniChar                       u_int16_t
-+#define Boolean                       u_int8_t
-+
-+#define UF_NODUMP     0x00000001
-+
-+/* syslimits.h */
-+#define NAME_MAX      255
-+
-+/* Byteswap stuff */
-+#define NXSwapHostLongToBig(x)                cpu_to_be64(x)
-+#define NXSwapBigShortToHost(x)       be16_to_cpu(x)
-+#define OSSwapBigToHostInt16(x)               be16_to_cpu(x)
-+#define NXSwapBigLongToHost(x)                be32_to_cpu(x)
-+#define OSSwapBigToHostInt32(x)               be32_to_cpu(x)
-+#define NXSwapBigLongLongToHost(x)    be64_to_cpu(x)
-+#define OSSwapBigToHostInt64(x)               be64_to_cpu(x)
-+
-+#if __BYTE_ORDER == __LITTLE_ENDIAN
-+/* Big Endian Swaps */
-+#ifndef be16_to_cpu
-+#define be16_to_cpu(x) bswap_16(x)
-+#endif
-+#ifndef be32_to_cpu
-+#define be32_to_cpu(x) bswap_32(x)
-+#endif
-+#ifndef be64_to_cpu
-+#define be64_to_cpu(x) bswap_64(x)
-+#endif
-+#ifndef cpu_to_be64
-+#define cpu_to_be64(x) bswap_64(x)
-+#endif
-+#elif __BYTE_ORDER == __BIG_ENDIAN
-+/* Big endian doesn't swap */
-+#ifndef be16_to_cpu
-+#define be16_to_cpu(x)        (x)
-+#endif
-+#ifndef be32_to_cpu
-+#define be32_to_cpu(x)        (x)
-+#endif
-+#ifndef be64_to_cpu
-+#define be64_to_cpu(x)        (x)
-+#endif
-+#ifndef cpu_to_be64
-+#define cpu_to_be64(x)        (x)
-+#endif
-+#endif
-+
-+#define KAUTH_FILESEC_XATTR "com.apple.system.Security"
-+
-+#endif
-diff --git a/newfs_hfs.tproj/hfs_endian.c b/newfs_hfs.tproj/hfs_endian.c
-index 117b7f8..fdf7353 100644
---- a/newfs_hfs.tproj/hfs_endian.c
-+++ b/newfs_hfs.tproj/hfs_endian.c
-@@ -30,7 +30,12 @@
- #include <sys/types.h>
- #include <sys/stat.h>
-+#if LINUX
-+#include "missing.h"
-+#else
- #include <architecture/byte_order.h>
-+#endif
-+
- #include <hfs/hfs_format.h>
- #include "hfs_endian.h"
-diff --git a/newfs_hfs.tproj/hfs_endian.h b/newfs_hfs.tproj/hfs_endian.h
-index 8d9d01d..5c7ff57 100644
---- a/newfs_hfs.tproj/hfs_endian.h
-+++ b/newfs_hfs.tproj/hfs_endian.h
-@@ -29,7 +29,12 @@
-  * volume format.
-  */
- #include <hfs/hfs_format.h>
-+#if LINUX
-+#include <endian.h>
-+#include <byteswap.h>
-+#else
- #include <architecture/byte_order.h>
-+#endif
- /*********************/
- /* BIG ENDIAN Macros */
-diff --git a/newfs_hfs.tproj/makehfs.c b/newfs_hfs.tproj/makehfs.c
-index 085222f..7609779 100644
---- a/newfs_hfs.tproj/makehfs.c
-+++ b/newfs_hfs.tproj/makehfs.c
-@@ -31,10 +31,16 @@
- #include <sys/param.h>
- #include <sys/types.h>
- #include <sys/time.h>
-+#if LINUX
-+#include <time.h>
-+#include "missing.h"
-+#endif
- #include <sys/errno.h>
- #include <sys/stat.h>
- #include <sys/sysctl.h>
-+#if !LINUX
- #include <sys/vmmeter.h>
-+#endif
- #include <err.h>
- #include <errno.h>
-@@ -47,13 +53,14 @@
- #include <openssl/sha.h>
-+#if !LINUX
- #include <architecture/byte_order.h>
- #include <CoreFoundation/CFString.h>
- #include <CoreFoundation/CFStringEncodingExt.h>
- extern Boolean _CFStringGetFileSystemRepresentation(CFStringRef string, UInt8 *buffer, CFIndex maxBufLen);
--
-+#endif
- #include <hfs/hfs_format.h>
- #include <hfs/hfs_mount.h>
-@@ -129,7 +136,9 @@ static UInt32 Largest __P((UInt32 a, UInt32 b, UInt32 c, UInt32 d ));
- static void MarkBitInAllocationBuffer __P((HFSPlusVolumeHeader *header,
-               UInt32 allocationBlock, void* sectorBuffer, UInt32 *sector));
-+#if !LINUX
- static UInt32 GetDefaultEncoding();
-+#endif
- static UInt32 UTCToLocal __P((UInt32 utcTime));
-@@ -158,11 +167,14 @@ void SETOFFSET (void *buffer, UInt16 btNodeSize, SInt16 recOffset, SInt16 vecOff
- #define ROUNDUP(x, u) (((x) % (u) == 0) ? (x) : ((x)/(u) + 1) * (u))
--#define ENCODING_TO_BIT(e)                               \
-+#if LINUX
-+#define ENCODING_TO_BIT(e)       (e)
-+#else
-+#define ENCODING_TO_BIT(e)
-           ((e) < 48 ? (e) :                              \
-           ((e) == kCFStringEncodingMacUkrainian ? 48 :   \
-           ((e) == kCFStringEncodingMacFarsi ? 49 : 0)))
--
-+#endif
- /*
-  * make_hfs
-  *    
-@@ -528,6 +540,7 @@ InitMDB(hfsparams_t *defaults, UInt32 driveBlocks, HFS_MDB *mdbp)
-        * Map UTF-8 input into a Mac encoding.
-        * On conversion errors "untitled" is used as a fallback.
-        */
-+#if !LINUX
-       {
-               UniChar unibuf[kHFSMaxVolumeNameChars];
-               CFStringRef cfstr;
-@@ -553,7 +566,11 @@ InitMDB(hfsparams_t *defaults, UInt32 driveBlocks, HFS_MDB *mdbp)
-               bcopy(&mdbp->drVN[1], defaults->volumeName, mdbp->drVN[0]);
-               defaults->volumeName[mdbp->drVN[0]] = '\0';
-       }
-+#endif
-       /* Save the encoding hint in the Finder Info (field 4). */
-+      mdbp->drVN[0] = strlen(defaults->volumeName);
-+      bcopy(defaults->volumeName,&mdbp->drVN[1],mdbp->drVN[0]);
-+
-       mdbp->drFndrInfo[4] = SET_HFS_TEXT_ENCODING(defaults->encodingHint);
-       mdbp->drWrCnt = kWriteSeqNum;
-@@ -1100,9 +1117,11 @@ InitCatalogRoot_HFSPlus(const hfsparams_t *dp, const HFSPlusVolumeHeader *header
-       UInt16                                  nodeSize;
-       SInt16                                  offset;
-       UInt32                                  unicodeBytes;
-+#if !LINUX
-       UInt8 canonicalName[256];
-       CFStringRef cfstr;
-       Boolean cfOK;
-+#endif
-       int index = 0;
-       nodeSize = dp->catalogNodeSize;
-@@ -1122,7 +1141,9 @@ InitCatalogRoot_HFSPlus(const hfsparams_t *dp, const HFSPlusVolumeHeader *header
-        * First record is always the root directory...
-        */
-       ckp = (HFSPlusCatalogKey *)((UInt8 *)buffer + offset);
--      
-+#if LINUX
-+      ConvertUTF8toUnicode(dp->volumeName, sizeof(ckp->nodeName.unicode), ckp->nodeName.unicode, &ckp->nodeName.length);
-+#else
-       /* Use CFString functions to get a HFSPlus Canonical name */
-       cfstr = CFStringCreateWithCString(kCFAllocatorDefault, (char *)dp->volumeName, kCFStringEncodingUTF8);
-       cfOK = _CFStringGetFileSystemRepresentation(cfstr, canonicalName, sizeof(canonicalName));
-@@ -1139,6 +1160,7 @@ InitCatalogRoot_HFSPlus(const hfsparams_t *dp, const HFSPlusVolumeHeader *header
-                     dp->volumeName, kDefaultVolumeNameStr);
-       }
-       CFRelease(cfstr);
-+#endif
-       ckp->nodeName.length = SWAP_BE16 (ckp->nodeName.length);
-       unicodeBytes = sizeof(UniChar) * SWAP_BE16 (ckp->nodeName.length);
-@@ -1821,15 +1843,15 @@ WriteBuffer(const DriveInfo *driveInfo, UInt64 startingSector, UInt32 byteCount,
-       off_t sector;
-       if ((byteCount % driveInfo->sectorSize) != 0)
--              errx(1, "WriteBuffer: byte count %ld is not sector size multiple", byteCount);
-+              errx(1, "WriteBuffer: byte count %i is not sector size multiple", byteCount);
-       sector = driveInfo->sectorOffset + startingSector;
-       if (lseek(driveInfo->fd, sector * driveInfo->sectorSize, SEEK_SET) < 0)
--              err(1, "seek (sector %qd)", sector);
-+              err(1, "seek (sector %lld)", sector);
-       if (write(driveInfo->fd, buffer, byteCount) != byteCount)
--              err(1, "write (sector %qd, %ld bytes)", sector, byteCount);
-+              err(1, "write (sector %lld, %i bytes)", sector, byteCount);
- }
-@@ -1913,7 +1935,7 @@ DivideAndRoundUp(UInt32 numerator, UInt32 denominator)
-       return quotient;
- }
--
-+#if !LINUX
- #define __kCFUserEncodingFileName ("/.CFUserTextEncoding")
- static UInt32
-@@ -1939,7 +1961,7 @@ GetDefaultEncoding()
-     }
-     return 0;
- }
--
-+#endif
- static int
- ConvertUTF8toUnicode(const UInt8* source, UInt32 bufsize, UniChar* unibuf,
-@@ -2006,6 +2028,9 @@ ConvertUTF8toUnicode(const UInt8* source, UInt32 bufsize, UniChar* unibuf,
- static int
- getencodinghint(unsigned char *name)
- {
-+#if LINUX
-+      return(0);
-+#else
-         int mib[3];
-         size_t buflen = sizeof(int);
-         struct vfsconf vfc;
-@@ -2023,7 +2048,8 @@ getencodinghint(unsigned char *name)
-       return (hint);
- error:
-       hint = GetDefaultEncoding();
--      return (hint);
-+      return (0);
-+#endif
- }
-@@ -2034,12 +2060,14 @@ void GenerateVolumeUUID(VolumeUUID *newVolumeID) {
-       unsigned char digest[20];
-       time_t now;
-       clock_t uptime;
--      int mib[2];
--      int sysdata;
--      char sysctlstring[128];
-       size_t datalen;
-       double sysloadavg[3];
-+#if !LINUX
-+      int sysdata;
-+      int mib[2];
-+      char sysctlstring[128];
-       struct vmtotal sysvmtotal;
-+#endif
-       
-       do {
-               /* Initialize the SHA-1 context for processing: */
-@@ -2052,52 +2080,58 @@ void GenerateVolumeUUID(VolumeUUID *newVolumeID) {
-               SHA1_Update(&context, &uptime, sizeof(uptime));
-               
-               /* The kernel's boot time: */
-+#if !LINUX
-               mib[0] = CTL_KERN;
-               mib[1] = KERN_BOOTTIME;
-               datalen = sizeof(sysdata);
-               sysctl(mib, 2, &sysdata, &datalen, NULL, 0);
-               SHA1_Update(&context, &sysdata, datalen);
--              
-+#endif
-               /* The system's host id: */
-+#if !LINUX
-               mib[0] = CTL_KERN;
-               mib[1] = KERN_HOSTID;
-               datalen = sizeof(sysdata);
-               sysctl(mib, 2, &sysdata, &datalen, NULL, 0);
-               SHA1_Update(&context, &sysdata, datalen);
--
-+#endif
-               /* The system's host name: */
-+#if !LINUX
-               mib[0] = CTL_KERN;
-               mib[1] = KERN_HOSTNAME;
-               datalen = sizeof(sysctlstring);
-               sysctl(mib, 2, sysctlstring, &datalen, NULL, 0);
-               SHA1_Update(&context, sysctlstring, datalen);
--
-+#endif
-               /* The running kernel's OS release string: */
-+#if !LINUX
-               mib[0] = CTL_KERN;
-               mib[1] = KERN_OSRELEASE;
-               datalen = sizeof(sysctlstring);
-               sysctl(mib, 2, sysctlstring, &datalen, NULL, 0);
-               SHA1_Update(&context, sysctlstring, datalen);
--
-+#endif
-               /* The running kernel's version string: */
-+#if !LINUX
-               mib[0] = CTL_KERN;
-               mib[1] = KERN_VERSION;
-               datalen = sizeof(sysctlstring);
-               sysctl(mib, 2, sysctlstring, &datalen, NULL, 0);
-               SHA1_Update(&context, sysctlstring, datalen);
--
-+#endif
-               /* The system's load average: */
-               datalen = sizeof(sysloadavg);
-               getloadavg(sysloadavg, 3);
-               SHA1_Update(&context, &sysloadavg, datalen);
-               /* The system's VM statistics: */
-+#if !LINUX
-               mib[0] = CTL_VM;
-               mib[1] = VM_METER;
-               datalen = sizeof(sysvmtotal);
-               sysctl(mib, 2, &sysvmtotal, &datalen, NULL, 0);
-               SHA1_Update(&context, &sysvmtotal, datalen);
--
-+#endif
-               /* The current GMT (26 ASCII characters): */
-               time(&now);
-               strncpy(randomInputBuffer, asctime(gmtime(&now)), 26);  /* "Mon Mar 27 13:46:26 2000" */
-diff --git a/newfs_hfs.tproj/newfs_hfs.c b/newfs_hfs.tproj/newfs_hfs.c
-index c4176a9..bf2ed21 100644
---- a/newfs_hfs.tproj/newfs_hfs.c
-+++ b/newfs_hfs.tproj/newfs_hfs.c
-@@ -38,8 +38,13 @@
- #include <sys/mount.h>
- #include <sys/param.h>
- #include <sys/stat.h>
-+#if LINUX
-+#include <time.h>
-+#endif
-+#if !LINUX
- #include <IOKit/storage/IOMediaBSDClient.h>
-+#endif
- #include <hfs/hfs_format.h>
- #include "newfs_hfs.h"
-@@ -73,7 +78,9 @@ static void usage __P((void));
- char  *progname;
- char  gVolumeName[kHFSPlusMaxFileNameChars + 1] = {kDefaultVolumeNameStr};
-+#if !LINUX
- char  rawdevice[MAXPATHLEN];
-+#endif
- char  blkdevice[MAXPATHLEN];
- UInt32        gBlockSize = 0;
- UInt32        gNextCNID = kHFSFirstUserCatalogNodeID;
-@@ -158,8 +165,10 @@ main(argc, argv)
-       extern int optind;
-       int ch;
-       int forceHFS;
-+#if !LINUX
-       char *cp, *special;
-       struct statfs *mp;
-+#endif
-       int n;
-       
-       if ((progname = strrchr(*argv, '/')))
-@@ -260,16 +269,19 @@ main(argc, argv)
-                       usage();
-               }
--      argc -= optind;
--      argv += optind;
-+              argc -= optind;
-+              argv += optind;
--      if (gPartitionSize != 0) {
--              if (argc != 0)
--                      usage();
--      } else {
--              if (argc != 1)
--                      usage();
-+              if (gPartitionSize != 0) {
-+                      if (argc != 0)
-+                              usage();
-+              } else {
-+                      if (argc != 1)
-+                              usage();
-+#if LINUX
-+              (void) sprintf(blkdevice, "%s", argv[0]);
-+#else
-               special = argv[0];
-               cp = strrchr(special, '/');
-               if (cp != 0)
-@@ -278,6 +290,7 @@ main(argc, argv)
-                       special++;
-               (void) sprintf(rawdevice, "%sr%s", _PATH_DEV, special);
-               (void) sprintf(blkdevice, "%s%s", _PATH_DEV, special);
-+#endif
-       }
-       if (forceHFS && gJournaled) {
-@@ -301,6 +314,9 @@ main(argc, argv)
-               /*
-                * Check if target device is aready mounted
-                */
-+#if LINUX
-+      // FIXME
-+#else
-               n = getmntinfo(&mp, MNT_NOWAIT);
-               if (n == 0)
-                       fatal("%s: getmntinfo: %s", blkdevice, strerror(errno));
-@@ -310,15 +326,20 @@ main(argc, argv)
-                               fatal("%s is mounted on %s", blkdevice, mp->f_mntonname);
-                       ++mp;
-               }
-+#endif
-       }
--      if (hfs_newfs(rawdevice, forceHFS, true) < 0) {
-+      if (hfs_newfs(blkdevice, forceHFS, true) < 0) {
-+#if LINUX
-+              err(1, NULL);
-+#else
-               /* On ENXIO error use the block device (to get de-blocking) */
-               if (errno == ENXIO) {
-                       if (hfs_newfs(blkdevice, forceHFS, false) < 0)
-                               err(1, NULL);
-               } else
-                       err(1, NULL);
-+#endif
-       }
-       exit(0);
-@@ -506,7 +527,9 @@ hfs_newfs(char *device, int forceHFS, int isRaw)
-       int fso = 0;
-       int retval = 0;
-       hfsparams_t defaults = {0};
-+#if !LINUX
-       u_int64_t maxSectorsPerIO;
-+#endif
-       if (gPartitionSize) {
-                       dip.sectorSize = kBytesPerSector;
-@@ -526,6 +549,34 @@ hfs_newfs(char *device, int forceHFS, int isRaw)
-       
-               if (fstat( fso, &stbuf) < 0)
-                       fatal("%s: %s", device, strerror(errno));
-+#if LINUX
-+              dip.sectorSize = 512;
-+              dip.sectorsPerIO = 256;
-+
-+#     ifndef  BLKGETSIZE
-+#     define  BLKGETSIZE              _IO(0x12,96)
-+#     endif
-+
-+#     ifndef  BLKGETSIZE64
-+#     define BLKGETSIZE64             _IOR(0x12,114,size_t)
-+#     endif
-+
-+              if (S_ISREG(stbuf.st_mode)) {
-+                      dip.totalSectors = stbuf.st_size / 512;
-+              }
-+              else if (S_ISBLK(stbuf.st_mode)) {
-+                      unsigned long size;
-+                      u_int64_t size64;
-+                      if (!ioctl(fso, BLKGETSIZE64, &size64))
-+                              dip.totalSectors = size64 / 512;
-+                      else if (!ioctl(fso, BLKGETSIZE, &size))
-+                              dip.totalSectors = size;
-+                      else
-+                              fatal("%s: %s", device, strerror(errno));
-+              }
-+              else
-+                      fatal("%s: is not a block device", device);
-+#else
-       
-               if (ioctl(fso, DKIOCGETBLOCKCOUNT, &dip.totalSectors) < 0)
-                       fatal("%s: %s", device, strerror(errno));
-@@ -537,11 +588,14 @@ hfs_newfs(char *device, int forceHFS, int isRaw)
-                       dip.sectorsPerIO = (128 * 1024) / dip.sectorSize;  /* use 128K as default */
-               else
-                       dip.sectorsPerIO = MIN(maxSectorsPerIO, (1024 * 1024) / dip.sectorSize);
-+#endif
-+
-               /*
-                * The make_hfs code currentlydoes 512 byte sized I/O.
-                * If the sector size is bigger than 512, start over
-                * using the block device (to get de-blocking).
-                */       
-+#if !LINUX
-               if (dip.sectorSize != kBytesPerSector) {
-                       if (isRaw) {
-                               close(fso);
-@@ -556,7 +610,9 @@ hfs_newfs(char *device, int forceHFS, int isRaw)
-                               dip.sectorSize = kBytesPerSector;
-                       }
-               }
-+#endif
-       }
-+
-       dip.sectorOffset = 0;
-       time(&createtime);
-diff --git a/newfs_hfs.tproj/newfs_hfs.h b/newfs_hfs.tproj/newfs_hfs.h
-index 968ff10..5680a34 100644
---- a/newfs_hfs.tproj/newfs_hfs.h
-+++ b/newfs_hfs.tproj/newfs_hfs.h
-@@ -19,8 +19,12 @@
-  * 
-  * @APPLE_LICENSE_HEADER_END@
-  */
-- 
-+
-+#if LINUX
-+#include "missing.h"
-+#else
- #include <CoreFoundation/CFBase.h>
-+#endif
- /*
-  * Mac OS Finder flags
-@@ -122,33 +126,33 @@ enum {
- #define kDTDF_FileID  16
- #define kDTDF_Name    "Desktop DF"
- #define kDTDF_Chars   10
--#define kDTDF_Type    'DTFL'
--#define kDTDF_Creator 'DMGR'
-+#define kDTDF_Type    0x4454464C /* 'DTFL' */
-+#define kDTDF_Creator 0x444D4752 /* 'DMGR' */
- #define kDTDB_FileID  17
- #define kDTDB_Name    "Desktop DB"
- #define kDTDB_Chars   10
--#define kDTDB_Type    'BTFL'
--#define kDTDB_Creator 'DMGR'
-+#define kDTDB_Type    0x4254464C /* 'BTFL' */
-+#define kDTDB_Creator 0x444D4752 /* 'DMGR' */
- #define kDTDB_Size    1024
- #define kReadMe_FileID        18
- #define kReadMe_Name  "ReadMe"
- #define kReadMe_Chars 6
--#define kReadMe_Type  'ttro'
--#define kReadMe_Creator       'ttxt'
-+#define kReadMe_Type  0x7474726F /* 'ttro' */
-+#define kReadMe_Creator       0x74747974 /* 'ttxt' */
- #define kFinder_FileID        19
- #define kFinder_Name  "Finder"
- #define kFinder_Chars 6
--#define kFinder_Type  'FNDR'
--#define kFinder_Creator       'MACS'
-+#define kFinder_Type  0x464E4452 /* 'FNDR' */
-+#define kFinder_Creator       0x4D414353 /* 'MACS' */
- #define kSystem_FileID        20
- #define kSystem_Name  "System"
- #define kSystem_Chars 6
--#define kSystem_Type  'zsys'
--#define kSystem_Creator       'MACS'
-+#define kSystem_Type  0x7A737973 /* 'zsys' */
-+#define kSystem_Creator       0x4D414353 /* 'MACS' */
diff --git a/utils/hfsprogs/patches/0003-Add-helper-include-files-absent-from-the-upstream-pa.patch b/utils/hfsprogs/patches/0003-Add-helper-include-files-absent-from-the-upstream-pa.patch
deleted file mode 100644 (file)
index 36b9417..0000000
+++ /dev/null
@@ -1,1024 +0,0 @@
-From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
-Date: Thu, 24 Oct 2013 01:11:21 -0200
-Subject: Add helper include files absent from the upstream package
-
-Add some include files from an Apple system that contain the definition of
-the data structures used by the programs that manipulate the filesystems.
----
- include/bitstring.h        | 164 +++++++++++
- include/hfs/hfs_format.h   | 689 +++++++++++++++++++++++++++++++++++++++++++++
- include/hfs/hfs_mount.h    |  78 +++++
- include/sys/appleapiopts.h |  52 ++++
- 4 files changed, 983 insertions(+)
- create mode 100644 include/bitstring.h
- create mode 100644 include/hfs/hfs_format.h
- create mode 100644 include/hfs/hfs_mount.h
- create mode 100644 include/sys/appleapiopts.h
-
-diff --git a/include/bitstring.h b/include/bitstring.h
-new file mode 100644
-index 0000000..fbecfbe
---- /dev/null
-+++ b/include/bitstring.h
-@@ -0,0 +1,164 @@
-+/*
-+ * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
-+ *
-+ * @APPLE_LICENSE_HEADER_START@
-+ *
-+ * The contents of this file constitute Original Code as defined in and
-+ * are subject to the Apple Public Source License Version 1.1 (the
-+ * "License").  You may not use this file except in compliance with the
-+ * License.  Please obtain a copy of the License at
-+ * http://www.apple.com/publicsource and read it before using this file.
-+ *
-+ * This Original Code and all software distributed under the License are
-+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
-+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
-+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
-+ * License for the specific language governing rights and limitations
-+ * under the License.
-+ *
-+ * @APPLE_LICENSE_HEADER_END@
-+ */
-+/*
-+ * Copyright (c) 1989, 1993
-+ *    The Regents of the University of California.  All rights reserved.
-+ *
-+ * This code is derived from software contributed to Berkeley by
-+ * Paul Vixie.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ *    notice, this list of conditions and the following disclaimer in the
-+ *    documentation and/or other materials provided with the distribution.
-+ * 3. All advertising materials mentioning features or use of this software
-+ *    must display the following acknowledgement:
-+ *    This product includes software developed by the University of
-+ *    California, Berkeley and its contributors.
-+ * 4. Neither the name of the University nor the names of its contributors
-+ *    may be used to endorse or promote products derived from this software
-+ *    without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ *
-+ *    @(#)bitstring.h 8.1 (Berkeley) 7/19/93
-+ */
-+
-+#ifndef _BITSTRING_H_
-+#define       _BITSTRING_H_
-+
-+typedef       unsigned char bitstr_t;
-+
-+/* internal macros */
-+                              /* byte of the bitstring bit is in */
-+#define       _bit_byte(bit) \
-+      ((bit) >> 3)
-+
-+                              /* mask for the bit within its byte */
-+#define       _bit_mask(bit) \
-+      (1 << ((bit)&0x7))
-+
-+/* external macros */
-+                              /* bytes in a bitstring of nbits bits */
-+#define       bitstr_size(nbits) \
-+      ((((nbits) - 1) >> 3) + 1)
-+
-+                              /* allocate a bitstring */
-+#define       bit_alloc(nbits) \
-+      (bitstr_t *)calloc(1, \
-+          (unsigned int)bitstr_size(nbits) * sizeof(bitstr_t))
-+
-+                              /* allocate a bitstring on the stack */
-+#define       bit_decl(name, nbits) \
-+      (name)[bitstr_size(nbits)]
-+
-+                              /* is bit N of bitstring name set? */
-+#define       bit_test(name, bit) \
-+      ((name)[_bit_byte(bit)] & _bit_mask(bit))
-+
-+                              /* set bit N of bitstring name */
-+#define       bit_set(name, bit) \
-+      (name)[_bit_byte(bit)] |= _bit_mask(bit)
-+
-+                              /* clear bit N of bitstring name */
-+#define       bit_clear(name, bit) \
-+      (name)[_bit_byte(bit)] &= ~_bit_mask(bit)
-+
-+                              /* clear bits start ... stop in bitstring */
-+#define       bit_nclear(name, start, stop) { \
-+      register bitstr_t *_name = name; \
-+      register int _start = start, _stop = stop; \
-+      register int _startbyte = _bit_byte(_start); \
-+      register int _stopbyte = _bit_byte(_stop); \
-+      if (_startbyte == _stopbyte) { \
-+              _name[_startbyte] &= ((0xff >> (8 - (_start&0x7))) | \
-+                                    (0xff << ((_stop&0x7) + 1))); \
-+      } else { \
-+              _name[_startbyte] &= 0xff >> (8 - (_start&0x7)); \
-+              while (++_startbyte < _stopbyte) \
-+                      _name[_startbyte] = 0; \
-+              _name[_stopbyte] &= 0xff << ((_stop&0x7) + 1); \
-+      } \
-+}
-+
-+                              /* set bits start ... stop in bitstring */
-+#define       bit_nset(name, start, stop) { \
-+      register bitstr_t *_name = name; \
-+      register int _start = start, _stop = stop; \
-+      register int _startbyte = _bit_byte(_start); \
-+      register int _stopbyte = _bit_byte(_stop); \
-+      if (_startbyte == _stopbyte) { \
-+              _name[_startbyte] |= ((0xff << (_start&0x7)) & \
-+                                  (0xff >> (7 - (_stop&0x7)))); \
-+      } else { \
-+              _name[_startbyte] |= 0xff << ((_start)&0x7); \
-+              while (++_startbyte < _stopbyte) \
-+                      _name[_startbyte] = 0xff; \
-+              _name[_stopbyte] |= 0xff >> (7 - (_stop&0x7)); \
-+      } \
-+}
-+
-+                              /* find first bit clear in name */
-+#define       bit_ffc(name, nbits, value) { \
-+      register bitstr_t *_name = name; \
-+      register int _byte, _nbits = nbits; \
-+      register int _stopbyte = _bit_byte(_nbits), _value = -1; \
-+      for (_byte = 0; _byte <= _stopbyte; ++_byte) \
-+              if (_name[_byte] != 0xff) { \
-+                      _value = _byte << 3; \
-+                      for (_stopbyte = _name[_byte]; (_stopbyte&0x1); \
-+                          ++_value, _stopbyte >>= 1); \
-+                      break; \
-+              } \
-+      *(value) = _value; \
-+}
-+
-+                              /* find first bit set in name */
-+#define       bit_ffs(name, nbits, value) { \
-+      register bitstr_t *_name = name; \
-+      register int _byte, _nbits = nbits; \
-+      register int _stopbyte = _bit_byte(_nbits), _value = -1; \
-+      for (_byte = 0; _byte <= _stopbyte; ++_byte) \
-+              if (_name[_byte]) { \
-+                      _value = _byte << 3; \
-+                      for (_stopbyte = _name[_byte]; !(_stopbyte&0x1); \
-+                          ++_value, _stopbyte >>= 1); \
-+                      break; \
-+              } \
-+      *(value) = _value; \
-+}
-+
-+#endif /* !_BITSTRING_H_ */
-diff --git a/include/hfs/hfs_format.h b/include/hfs/hfs_format.h
-new file mode 100644
-index 0000000..d820329
---- /dev/null
-+++ b/include/hfs/hfs_format.h
-@@ -0,0 +1,689 @@
-+/*
-+ * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
-+ *
-+ * @APPLE_LICENSE_HEADER_START@
-+ *
-+ * The contents of this file constitute Original Code as defined in and
-+ * are subject to the Apple Public Source License Version 1.1 (the
-+ * "License").  You may not use this file except in compliance with the
-+ * License.  Please obtain a copy of the License at
-+ * http://www.apple.com/publicsource and read it before using this file.
-+ *
-+ * This Original Code and all software distributed under the License are
-+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
-+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
-+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
-+ * License for the specific language governing rights and limitations
-+ * under the License.
-+ *
-+ * @APPLE_LICENSE_HEADER_END@
-+ */
-+#ifndef __HFS_FORMAT__
-+#define __HFS_FORMAT__
-+
-+#include "missing.h"
-+
-+#include <sys/appleapiopts.h>
-+
-+/*
-+ * hfs_format.c
-+ *
-+ * This file describes the on-disk format for HFS and HFS Plus volumes.
-+ * The HFS Plus volume format is desciibed in detail in Apple Technote 1150.
-+ *
-+ * http://developer.apple.com/technotes/tn/tn1150.html
-+ *
-+ */
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+/* some on-disk hfs structures have 68K alignment (misaligned) */
-+
-+#define PACKED_S      __attribute__((packed))
-+
-+/* Signatures used to differentiate between HFS and HFS Plus volumes */
-+enum {
-+      kHFSSigWord             = 0x4244,       /* 'BD' in ASCII */
-+      kHFSPlusSigWord         = 0x482B,       /* 'H+' in ASCII */
-+      kHFSXSigWord            = 0x4858,       /* 'HX' in ASCII */
-+
-+      kHFSPlusVersion         = 0x0004,       /* 'H+' volumes are version 4 only */
-+      kHFSXVersion            = 0x0005,       /* 'HX' volumes start with version 5 */
-+
-+      kHFSPlusMountVersion    = 0x31302E30,   /* '10.0' for Mac OS X */
-+      kHFSJMountVersion       = 0x4846534a,   /* 'HFSJ' for journaled HFS+ on OS X */
-+      kFSKMountVersion        = 0x46534b21    /* 'FSK!' for failed journal replay */
-+}PACKED_S;
-+
-+
-+#if 1
-+/*
-+ * Mac OS X has a special directory for linked and unlinked files (HFS Plus only).
-+ * This directory and its contents are never exported from the filesystem under
-+ * Mac OS X.
-+ *
-+ * To make this folder name sort last,  it has embedded null prefix.
-+ * (0xC0, 0x80 in UTF-8)
-+ */
-+#define HFSPLUSMETADATAFOLDER  "\xC0\x80\xC0\x80\xC0\x80\xC0\x80HFS+ Private Data"
-+
-+/*
-+ * Files in the HFS Private Data folder have one of the following prefixes
-+ * followed by a decimal number (no leading zeros).  For indirect nodes this
-+ * number is a 32 bit random number.  For unlinked (deleted) files that are
-+ * still open, the number is the file ID for that file.
-+ *
-+ * e.g.  iNode7182000 and temp3296
-+ */
-+#define HFS_INODE_PREFIX      "iNode"
-+#define HFS_DELETE_PREFIX     "temp"
-+
-+#endif /* __APPLE_API_PRIVATE */
-+
-+/*
-+ * Indirect link files (hard links) have the following type/creator.
-+ */
-+enum {
-+      kHardLinkFileType = 0x686C6E6B,  /* 'hlnk' */
-+      kHFSPlusCreator   = 0x6866732B   /* 'hfs+' */
-+}PACKED_S;
-+
-+
-+#ifndef _HFSUNISTR255_DEFINED_
-+#define _HFSUNISTR255_DEFINED_
-+/* Unicode strings are used for HFS Plus file and folder names */
-+struct HFSUniStr255 {
-+      u_int16_t       length;         /* number of unicode characters */
-+      u_int16_t       unicode[255];   /* unicode characters */
-+} PACKED_S;
-+typedef struct HFSUniStr255 HFSUniStr255;
-+typedef const HFSUniStr255 *ConstHFSUniStr255Param;
-+#endif /* _HFSUNISTR255_DEFINED_ */
-+
-+enum {
-+      kHFSMaxVolumeNameChars          = 27,
-+      kHFSMaxFileNameChars            = 31,
-+      kHFSPlusMaxFileNameChars        = 255
-+}PACKED_S;
-+
-+
-+/* Extent overflow file data structures */
-+
-+/* HFS Extent key */
-+struct HFSExtentKey {
-+      u_int8_t        keyLength;      /* length of key, excluding this field */
-+      u_int8_t        forkType;       /* 0 = data fork, FF = resource fork */
-+      u_int32_t       fileID;         /* file ID */
-+      u_int16_t       startBlock;     /* first file allocation block number in this extent */
-+}PACKED_S;
-+typedef struct HFSExtentKey HFSExtentKey;
-+
-+/* HFS Plus Extent key */
-+struct HFSPlusExtentKey {
-+      u_int16_t       keyLength;              /* length of key, excluding this field */
-+      u_int8_t        forkType;               /* 0 = data fork, FF = resource fork */
-+      u_int8_t        pad;                    /* make the other fields align on 32-bit boundary */
-+      u_int32_t       fileID;                 /* file ID */
-+      u_int32_t       startBlock;             /* first file allocation block number in this extent */
-+}PACKED_S;
-+typedef struct HFSPlusExtentKey HFSPlusExtentKey;
-+
-+/* Number of extent descriptors per extent record */
-+enum {
-+      kHFSExtentDensity       = 3,
-+      kHFSPlusExtentDensity   = 8
-+}PACKED_S;
-+
-+/* HFS extent descriptor */
-+struct HFSExtentDescriptor {
-+      u_int16_t       startBlock;             /* first allocation block */
-+      u_int16_t       blockCount;             /* number of allocation blocks */
-+}PACKED_S;
-+typedef struct HFSExtentDescriptor HFSExtentDescriptor;
-+
-+/* HFS Plus extent descriptor */
-+struct HFSPlusExtentDescriptor {
-+      u_int32_t       startBlock;             /* first allocation block */
-+      u_int32_t       blockCount;             /* number of allocation blocks */
-+}PACKED_S;
-+typedef struct HFSPlusExtentDescriptor HFSPlusExtentDescriptor;
-+
-+/* HFS extent record */
-+typedef HFSExtentDescriptor HFSExtentRecord[3];
-+
-+/* HFS Plus extent record */
-+typedef HFSPlusExtentDescriptor HFSPlusExtentRecord[8];
-+
-+
-+/* Finder information */
-+struct FndrFileInfo {
-+      u_int32_t       fdType;         /* file type */
-+      u_int32_t       fdCreator;      /* file creator */
-+      u_int16_t       fdFlags;        /* Finder flags */
-+      struct {
-+          int16_t     v;              /* file's location */
-+          int16_t     h;
-+      } PACKED_S fdLocation;
-+      int16_t         opaque;
-+}PACKED_S;
-+typedef struct FndrFileInfo FndrFileInfo;
-+
-+struct FndrDirInfo {
-+      struct {                        /* folder's window rectangle */
-+          int16_t     top;
-+          int16_t     left;
-+          int16_t     bottom;
-+          int16_t     right;
-+      }PACKED_S frRect;
-+      unsigned short  frFlags;        /* Finder flags */
-+      struct {
-+          u_int16_t   v;              /* folder's location */
-+          u_int16_t   h;
-+      }PACKED_S frLocation;
-+      int16_t         opaque;
-+}PACKED_S;
-+typedef struct FndrDirInfo FndrDirInfo;
-+
-+struct FndrOpaqueInfo {
-+      int8_t opaque[16];
-+}PACKED_S;
-+typedef struct FndrOpaqueInfo FndrOpaqueInfo;
-+
-+
-+/* HFS Plus Fork data info - 80 bytes */
-+struct HFSPlusForkData {
-+      u_int64_t               logicalSize;    /* fork's logical size in bytes */
-+      u_int32_t               clumpSize;      /* fork's clump size in bytes */
-+      u_int32_t               totalBlocks;    /* total blocks used by this fork */
-+      HFSPlusExtentRecord     extents;        /* initial set of extents */
-+}PACKED_S;
-+typedef struct HFSPlusForkData HFSPlusForkData;
-+
-+
-+/* Mac OS X has 16 bytes worth of "BSD" info.
-+ *
-+ * Note:  Mac OS 9 implementations and applications
-+ * should preserve, but not change, this information.
-+ */
-+struct HFSPlusBSDInfo {
-+      u_int32_t       ownerID;        /* user or group ID of file/folder owner */
-+      u_int32_t       groupID;        /* additional user of group ID */
-+      u_int8_t        adminFlags;     /* super-user changeable flags */
-+      u_int8_t        ownerFlags;     /* owner changeable flags */
-+      u_int16_t       fileMode;       /* file type and permission bits */
-+      union {
-+          u_int32_t   iNodeNum;       /* indirect node number (hard links only) */
-+          u_int32_t   linkCount;      /* links that refer to this indirect node */
-+          u_int32_t   rawDevice;      /* special file device (FBLK and FCHR only) */
-+      }PACKED_S special;
-+}PACKED_S;
-+typedef struct HFSPlusBSDInfo HFSPlusBSDInfo;
-+
-+
-+/* Catalog file data structures */
-+
-+enum {
-+      kHFSRootParentID                = 1,    /* Parent ID of the root folder */
-+      kHFSRootFolderID                = 2,    /* Folder ID of the root folder */
-+      kHFSExtentsFileID               = 3,    /* File ID of the extents file */
-+      kHFSCatalogFileID               = 4,    /* File ID of the catalog file */
-+      kHFSBadBlockFileID              = 5,    /* File ID of the bad allocation block file */
-+      kHFSAllocationFileID            = 6,    /* File ID of the allocation file (HFS Plus only) */
-+      kHFSStartupFileID               = 7,    /* File ID of the startup file (HFS Plus only) */
-+      kHFSAttributesFileID            = 8,    /* File ID of the attribute file (HFS Plus only) */
-+      kHFSRepairCatalogFileID         = 14,   /* Used when rebuilding Catalog B-tree */
-+      kHFSBogusExtentFileID           = 15,   /* Used for exchanging extents in extents file */
-+      kHFSFirstUserCatalogNodeID      = 16
-+}PACKED_S;
-+
-+/* HFS catalog key */
-+struct HFSCatalogKey {
-+      u_int8_t        keyLength;              /* key length (in bytes) */
-+      u_int8_t        reserved;               /* reserved (set to zero) */
-+      u_int32_t       parentID;               /* parent folder ID */
-+      u_int8_t        nodeName[kHFSMaxFileNameChars + 1]; /* catalog node name */
-+}PACKED_S;
-+typedef struct HFSCatalogKey HFSCatalogKey;
-+
-+/* HFS Plus catalog key */
-+struct HFSPlusCatalogKey {
-+      u_int16_t               keyLength;      /* key length (in bytes) */
-+      u_int32_t               parentID;       /* parent folder ID */
-+      HFSUniStr255            nodeName;       /* catalog node name */
-+}PACKED_S;
-+typedef struct HFSPlusCatalogKey HFSPlusCatalogKey;
-+
-+/* Catalog record types */
-+enum {
-+      /* HFS Catalog Records */
-+      kHFSFolderRecord                = 0x0100,       /* Folder record */
-+      kHFSFileRecord                  = 0x0200,       /* File record */
-+      kHFSFolderThreadRecord          = 0x0300,       /* Folder thread record */
-+      kHFSFileThreadRecord            = 0x0400,       /* File thread record */
-+
-+      /* HFS Plus Catalog Records */
-+      kHFSPlusFolderRecord            = 1,            /* Folder record */
-+      kHFSPlusFileRecord              = 2,            /* File record */
-+      kHFSPlusFolderThreadRecord      = 3,            /* Folder thread record */
-+      kHFSPlusFileThreadRecord        = 4             /* File thread record */
-+}PACKED_S;
-+
-+
-+/* Catalog file record flags */
-+enum {
-+      kHFSFileLockedBit       = 0x0000,       /* file is locked and cannot be written to */
-+      kHFSFileLockedMask      = 0x0001,
-+
-+      kHFSThreadExistsBit     = 0x0001,       /* a file thread record exists for this file */
-+      kHFSThreadExistsMask    = 0x0002,
-+
-+      kHFSHasAttributesBit    = 0x0002,       /* object has extended attributes */
-+      kHFSHasAttributesMask   = 0x0004,
-+
-+      kHFSHasSecurityBit      = 0x0003,       /* object has security data (ACLs) */
-+      kHFSHasSecurityMask     = 0x0008
-+}PACKED_S;
-+
-+
-+/* HFS catalog folder record - 70 bytes */
-+struct HFSCatalogFolder {
-+      int16_t                 recordType;             /* == kHFSFolderRecord */
-+      u_int16_t               flags;                  /* folder flags */
-+      u_int16_t               valence;                /* folder valence */
-+      u_int32_t               folderID;               /* folder ID */
-+      u_int32_t               createDate;             /* date and time of creation */
-+      u_int32_t               modifyDate;             /* date and time of last modification */
-+      u_int32_t               backupDate;             /* date and time of last backup */
-+      FndrDirInfo             userInfo;               /* Finder information */
-+      FndrOpaqueInfo          finderInfo;             /* additional Finder information */
-+      u_int32_t               reserved[4];            /* reserved - initialized as zero */
-+}PACKED_S;
-+typedef struct HFSCatalogFolder HFSCatalogFolder;
-+
-+/* HFS Plus catalog folder record - 88 bytes */
-+struct HFSPlusCatalogFolder {
-+      int16_t                 recordType;             /* == kHFSPlusFolderRecord */
-+      u_int16_t               flags;                  /* file flags */
-+      u_int32_t               valence;                /* folder's valence (limited to 2^16 in Mac OS) */
-+      u_int32_t               folderID;               /* folder ID */
-+      u_int32_t               createDate;             /* date and time of creation */
-+      u_int32_t               contentModDate;         /* date and time of last content modification */
-+      u_int32_t               attributeModDate;       /* date and time of last attribute modification */
-+      u_int32_t               accessDate;             /* date and time of last access (MacOS X only) */
-+      u_int32_t               backupDate;             /* date and time of last backup */
-+      HFSPlusBSDInfo          bsdInfo;                /* permissions (for MacOS X) */
-+      FndrDirInfo             userInfo;               /* Finder information */
-+      FndrOpaqueInfo          finderInfo;             /* additional Finder information */
-+      u_int32_t               textEncoding;           /* hint for name conversions */
-+      u_int32_t               attrBlocks;             /* cached count of attribute data blocks */
-+}PACKED_S;
-+typedef struct HFSPlusCatalogFolder HFSPlusCatalogFolder;
-+
-+/* HFS catalog file record - 102 bytes */
-+struct HFSCatalogFile {
-+      int16_t                 recordType;             /* == kHFSFileRecord */
-+      u_int8_t                flags;                  /* file flags */
-+      int8_t                  fileType;               /* file type (unused ?) */
-+      FndrFileInfo            userInfo;               /* Finder information */
-+      u_int32_t               fileID;                 /* file ID */
-+      u_int16_t               dataStartBlock;         /* not used - set to zero */
-+      int32_t                 dataLogicalSize;        /* logical EOF of data fork */
-+      int32_t                 dataPhysicalSize;       /* physical EOF of data fork */
-+      u_int16_t               rsrcStartBlock;         /* not used - set to zero */
-+      int32_t                 rsrcLogicalSize;        /* logical EOF of resource fork */
-+      int32_t                 rsrcPhysicalSize;       /* physical EOF of resource fork */
-+      u_int32_t               createDate;             /* date and time of creation */
-+      u_int32_t               modifyDate;             /* date and time of last modification */
-+      u_int32_t               backupDate;             /* date and time of last backup */
-+      FndrOpaqueInfo          finderInfo;             /* additional Finder information */
-+      u_int16_t               clumpSize;              /* file clump size (not used) */
-+      HFSExtentRecord         dataExtents;            /* first data fork extent record */
-+      HFSExtentRecord         rsrcExtents;            /* first resource fork extent record */
-+      u_int32_t               reserved;               /* reserved - initialized as zero */
-+}PACKED_S;
-+typedef struct HFSCatalogFile HFSCatalogFile;
-+
-+/* HFS Plus catalog file record - 248 bytes */
-+struct HFSPlusCatalogFile {
-+      int16_t                 recordType;             /* == kHFSPlusFileRecord */
-+      u_int16_t               flags;                  /* file flags */
-+      u_int32_t               reserved1;              /* reserved - initialized as zero */
-+      u_int32_t               fileID;                 /* file ID */
-+      u_int32_t               createDate;             /* date and time of creation */
-+      u_int32_t               contentModDate;         /* date and time of last content modification */
-+      u_int32_t               attributeModDate;       /* date and time of last attribute modification */
-+      u_int32_t               accessDate;             /* date and time of last access (MacOS X only) */
-+      u_int32_t               backupDate;             /* date and time of last backup */
-+      HFSPlusBSDInfo          bsdInfo;                /* permissions (for MacOS X) */
-+      FndrFileInfo            userInfo;               /* Finder information */
-+      FndrOpaqueInfo          finderInfo;             /* additional Finder information */
-+      u_int32_t               textEncoding;           /* hint for name conversions */
-+      u_int32_t               attrBlocks;             /* cached count of attribute data blocks */
-+
-+      /* Note: these start on double long (64 bit) boundary */
-+      HFSPlusForkData         dataFork;               /* size and block data for data fork */
-+      HFSPlusForkData         resourceFork;           /* size and block data for resource fork */
-+}PACKED_S;
-+typedef struct HFSPlusCatalogFile HFSPlusCatalogFile;
-+
-+/* HFS catalog thread record - 46 bytes */
-+struct HFSCatalogThread {
-+      int16_t         recordType;             /* == kHFSFolderThreadRecord or kHFSFileThreadRecord */
-+      int32_t         reserved[2];            /* reserved - initialized as zero */
-+      u_int32_t       parentID;               /* parent ID for this catalog node */
-+      u_int8_t        nodeName[kHFSMaxFileNameChars + 1]; /* name of this catalog node */
-+}PACKED_S;
-+typedef struct HFSCatalogThread HFSCatalogThread;
-+
-+/* HFS Plus catalog thread record -- 264 bytes */
-+struct HFSPlusCatalogThread {
-+      int16_t         recordType;             /* == kHFSPlusFolderThreadRecord or kHFSPlusFileThreadRecord */
-+      int16_t         reserved;               /* reserved - initialized as zero */
-+      u_int32_t       parentID;               /* parent ID for this catalog node */
-+      HFSUniStr255    nodeName;               /* name of this catalog node (variable length) */
-+}PACKED_S;
-+typedef struct HFSPlusCatalogThread HFSPlusCatalogThread;
-+
-+#ifdef __APPLE_API_UNSTABLE
-+/*
-+      These are the types of records in the attribute B-tree.  The values were
-+      chosen so that they wouldn't conflict with the catalog record types.
-+*/
-+enum {
-+      kHFSPlusAttrInlineData  = 0x10,    /* if size <  kAttrOverflowSize */
-+      kHFSPlusAttrForkData    = 0x20,    /* if size >= kAttrOverflowSize */
-+      kHFSPlusAttrExtents     = 0x30     /* overflow extents for large attributes */
-+}PACKED_S;
-+
-+
-+/*
-+      HFSPlusAttrForkData
-+      For larger attributes, whose value is stored in allocation blocks.
-+      If the attribute has more than 8 extents, there will be additional
-+      records (of type HFSPlusAttrExtents) for this attribute.
-+*/
-+struct HFSPlusAttrForkData {
-+      u_int32_t       recordType;             /* == kHFSPlusAttrForkData*/
-+      u_int32_t       reserved;
-+      HFSPlusForkData theFork;                /* size and first extents of value*/
-+}PACKED_S;
-+typedef struct HFSPlusAttrForkData HFSPlusAttrForkData;
-+
-+/*
-+      HFSPlusAttrExtents
-+      This record contains information about overflow extents for large,
-+      fragmented attributes.
-+*/
-+struct HFSPlusAttrExtents {
-+      u_int32_t               recordType;     /* == kHFSPlusAttrExtents*/
-+      u_int32_t               reserved;
-+      HFSPlusExtentRecord     extents;        /* additional extents*/
-+}PACKED_S;
-+typedef struct HFSPlusAttrExtents HFSPlusAttrExtents;
-+
-+/*
-+ * Atrributes B-tree Data Record
-+ *
-+ * For small attributes, whose entire value is stored
-+ * within a single B-tree record.
-+ */
-+struct HFSPlusAttrData {
-+      u_int32_t    recordType;   /* == kHFSPlusAttrInlineData */
-+      u_int32_t    reserved[2];
-+      u_int32_t    attrSize;     /* size of attribute data in bytes */
-+      u_int8_t     attrData[2];  /* variable length */
-+}PACKED_S;
-+typedef struct HFSPlusAttrData HFSPlusAttrData;
-+
-+
-+/* HFSPlusAttrInlineData is obsolete use HFSPlusAttrData instead */
-+struct HFSPlusAttrInlineData {
-+      u_int32_t       recordType;
-+      u_int32_t       reserved;
-+      u_int32_t       logicalSize;
-+      u_int8_t        userData[2];
-+}PACKED_S;
-+typedef struct HFSPlusAttrInlineData HFSPlusAttrInlineData;
-+
-+
-+/*    A generic Attribute Record*/
-+union HFSPlusAttrRecord {
-+      u_int32_t               recordType;
-+      HFSPlusAttrInlineData   inlineData;   /* NOT USED */
-+      HFSPlusAttrData         attrData;
-+      HFSPlusAttrForkData     forkData;
-+      HFSPlusAttrExtents      overflowExtents;
-+}PACKED_S;
-+typedef union HFSPlusAttrRecord HFSPlusAttrRecord;
-+
-+/* Attribute key */
-+enum { kHFSMaxAttrNameLen = 127 };
-+struct HFSPlusAttrKey {
-+      u_int16_t     keyLength;       /* key length (in bytes) */
-+      u_int16_t     pad;             /* set to zero */
-+      u_int32_t     fileID;          /* file associated with attribute */
-+      u_int32_t     startBlock;      /* first attribue allocation block number for extents */
-+      u_int16_t     attrNameLen;     /* number of unicode characters */
-+      u_int16_t     attrName[127];   /* attribute name (Unicode) */
-+}PACKED_S;
-+typedef struct HFSPlusAttrKey HFSPlusAttrKey;
-+
-+#define kHFSPlusAttrKeyMaximumLength   (sizeof(HFSPlusAttrKey) - sizeof(u_int16_t))
-+#define kHFSPlusAttrKeyMinimumLength   (kHFSPlusAttrKeyMaximumLength - (127 * sizeof(u_int16_t)))
-+
-+#endif /* __APPLE_API_UNSTABLE */
-+
-+
-+/* Key and node lengths */
-+enum {
-+      kHFSPlusExtentKeyMaximumLength = sizeof(HFSPlusExtentKey) - sizeof(u_int16_t),
-+      kHFSExtentKeyMaximumLength      = sizeof(HFSExtentKey) - sizeof(u_int8_t),
-+      kHFSPlusCatalogKeyMaximumLength = sizeof(HFSPlusCatalogKey) - sizeof(u_int16_t),
-+      kHFSPlusCatalogKeyMinimumLength = kHFSPlusCatalogKeyMaximumLength - sizeof(HFSUniStr255) + sizeof(u_int16_t),
-+      kHFSCatalogKeyMaximumLength     = sizeof(HFSCatalogKey) - sizeof(u_int8_t),
-+      kHFSCatalogKeyMinimumLength     = kHFSCatalogKeyMaximumLength - (kHFSMaxFileNameChars + 1) + sizeof(u_int8_t),
-+      kHFSPlusCatalogMinNodeSize      = 4096,
-+      kHFSPlusExtentMinNodeSize       = 512,
-+      kHFSPlusAttrMinNodeSize         = 4096
-+}PACKED_S;
-+
-+/* HFS and HFS Plus volume attribute bits */
-+enum {
-+                                                      /* Bits 0-6 are reserved (always cleared by MountVol call) */
-+      kHFSVolumeHardwareLockBit       = 7,            /* volume is locked by hardware */
-+      kHFSVolumeUnmountedBit          = 8,            /* volume was successfully unmounted */
-+      kHFSVolumeSparedBlocksBit       = 9,            /* volume has bad blocks spared */
-+      kHFSVolumeNoCacheRequiredBit = 10,              /* don't cache volume blocks (i.e. RAM or ROM disk) */
-+      kHFSBootVolumeInconsistentBit = 11,             /* boot volume is inconsistent (System 7.6 and later) */
-+      kHFSCatalogNodeIDsReusedBit = 12,
-+      kHFSVolumeJournaledBit = 13,                    /* this volume has a journal on it */
-+      kHFSVolumeInconsistentBit = 14,                 /* serious inconsistencies detected at runtime */
-+      kHFSVolumeSoftwareLockBit       = 15,           /* volume is locked by software */
-+
-+      kHFSVolumeHardwareLockMask      = 1 << kHFSVolumeHardwareLockBit,
-+      kHFSVolumeUnmountedMask         = 1 << kHFSVolumeUnmountedBit,
-+      kHFSVolumeSparedBlocksMask      = 1 << kHFSVolumeSparedBlocksBit,
-+      kHFSVolumeNoCacheRequiredMask = 1 << kHFSVolumeNoCacheRequiredBit,
-+      kHFSBootVolumeInconsistentMask = 1 << kHFSBootVolumeInconsistentBit,
-+      kHFSCatalogNodeIDsReusedMask = 1 << kHFSCatalogNodeIDsReusedBit,
-+      kHFSVolumeJournaledMask = 1 << kHFSVolumeJournaledBit,
-+      kHFSVolumeInconsistentMask = 1 << kHFSVolumeInconsistentBit,
-+      kHFSVolumeSoftwareLockMask      = 1 << kHFSVolumeSoftwareLockBit,
-+      kHFSMDBAttributesMask           = 0x8380
-+}PACKED_S;
-+
-+
-+/* HFS Master Directory Block - 162 bytes */
-+/* Stored at sector #2 (3rd sector) and second-to-last sector. */
-+struct HFSMasterDirectoryBlock {
-+      u_int16_t               drSigWord;      /* == kHFSSigWord */
-+      u_int32_t               drCrDate;       /* date and time of volume creation */
-+      u_int32_t               drLsMod;        /* date and time of last modification */
-+      u_int16_t               drAtrb;         /* volume attributes */
-+      u_int16_t               drNmFls;        /* number of files in root folder */
-+      u_int16_t               drVBMSt;        /* first block of volume bitmap */
-+      u_int16_t               drAllocPtr;     /* start of next allocation search */
-+      u_int16_t               drNmAlBlks;     /* number of allocation blocks in volume */
-+      u_int32_t               drAlBlkSiz;     /* size (in bytes) of allocation blocks */
-+      u_int32_t               drClpSiz;       /* default clump size */
-+      u_int16_t               drAlBlSt;       /* first allocation block in volume */
-+      u_int32_t               drNxtCNID;      /* next unused catalog node ID */
-+      u_int16_t               drFreeBks;      /* number of unused allocation blocks */
-+      u_int8_t                drVN[kHFSMaxVolumeNameChars + 1];  /* volume name */
-+      u_int32_t               drVolBkUp;      /* date and time of last backup */
-+      u_int16_t               drVSeqNum;      /* volume backup sequence number */
-+      u_int32_t               drWrCnt;        /* volume write count */
-+      u_int32_t               drXTClpSiz;     /* clump size for extents overflow file */
-+      u_int32_t               drCTClpSiz;     /* clump size for catalog file */
-+      u_int16_t               drNmRtDirs;     /* number of directories in root folder */
-+      u_int32_t               drFilCnt;       /* number of files in volume */
-+      u_int32_t               drDirCnt;       /* number of directories in volume */
-+      u_int32_t               drFndrInfo[8];  /* information used by the Finder */
-+      u_int16_t               drEmbedSigWord; /* embedded volume signature (formerly drVCSize) */
-+      HFSExtentDescriptor     drEmbedExtent;  /* embedded volume location and size (formerly drVBMCSize and drCtlCSize) */
-+      u_int32_t               drXTFlSize;     /* size of extents overflow file */
-+      HFSExtentRecord         drXTExtRec;     /* extent record for extents overflow file */
-+      u_int32_t               drCTFlSize;     /* size of catalog file */
-+      HFSExtentRecord         drCTExtRec;     /* extent record for catalog file */
-+}PACKED_S;
-+typedef struct HFSMasterDirectoryBlock        HFSMasterDirectoryBlock;
-+
-+
-+#ifdef __APPLE_API_UNSTABLE
-+#define SET_HFS_TEXT_ENCODING(hint)  \
-+      (0x656e6300 | ((hint) & 0xff))
-+#define GET_HFS_TEXT_ENCODING(hint)  \
-+      (((hint) & 0xffffff00) == 0x656e6300 ? (hint) & 0x000000ff : 0xffffffffU)
-+#endif /* __APPLE_API_UNSTABLE */
-+
-+
-+/* HFS Plus Volume Header - 512 bytes */
-+/* Stored at sector #2 (3rd sector) and second-to-last sector. */
-+struct HFSPlusVolumeHeader {
-+      u_int16_t       signature;              /* == kHFSPlusSigWord */
-+      u_int16_t       version;                /* == kHFSPlusVersion */
-+      u_int32_t       attributes;             /* volume attributes */
-+      u_int32_t       lastMountedVersion;     /* implementation version which last mounted volume */
-+      u_int32_t       journalInfoBlock;       /* block addr of journal info (if volume is journaled, zero otherwise) */
-+
-+      u_int32_t       createDate;             /* date and time of volume creation */
-+      u_int32_t       modifyDate;             /* date and time of last modification */
-+      u_int32_t       backupDate;             /* date and time of last backup */
-+      u_int32_t       checkedDate;            /* date and time of last disk check */
-+
-+      u_int32_t       fileCount;              /* number of files in volume */
-+      u_int32_t       folderCount;            /* number of directories in volume */
-+
-+      u_int32_t       blockSize;              /* size (in bytes) of allocation blocks */
-+      u_int32_t       totalBlocks;            /* number of allocation blocks in volume (includes this header and VBM*/
-+      u_int32_t       freeBlocks;             /* number of unused allocation blocks */
-+
-+      u_int32_t       nextAllocation;         /* start of next allocation search */
-+      u_int32_t       rsrcClumpSize;          /* default resource fork clump size */
-+      u_int32_t       dataClumpSize;          /* default data fork clump size */
-+      u_int32_t       nextCatalogID;          /* next unused catalog node ID */
-+
-+      u_int32_t       writeCount;             /* volume write count */
-+      u_int64_t       encodingsBitmap;        /* which encodings have been use  on this volume */
-+
-+      u_int8_t        finderInfo[32];         /* information used by the Finder */
-+
-+      HFSPlusForkData  allocationFile;        /* allocation bitmap file */
-+      HFSPlusForkData  extentsFile;           /* extents B-tree file */
-+      HFSPlusForkData  catalogFile;           /* catalog B-tree file */
-+      HFSPlusForkData  attributesFile;        /* extended attributes B-tree file */
-+      HFSPlusForkData  startupFile;           /* boot file (secondary loader) */
-+}PACKED_S;
-+typedef struct HFSPlusVolumeHeader HFSPlusVolumeHeader;
-+
-+
-+/* B-tree structures */
-+
-+enum BTreeKeyLimits{
-+      kMaxKeyLength   = 520
-+}PACKED_S;
-+
-+union BTreeKey{
-+      u_int8_t        length8;
-+      u_int16_t       length16;
-+      u_int8_t        rawData [kMaxKeyLength+2];
-+}PACKED_S;
-+typedef union BTreeKey BTreeKey;
-+
-+/* BTNodeDescriptor -- Every B-tree node starts with these fields. */
-+struct BTNodeDescriptor {
-+      u_int32_t       fLink;                  /* next node at this level*/
-+      u_int32_t       bLink;                  /* previous node at this level*/
-+      int8_t          kind;                   /* kind of node (leaf, index, header, map)*/
-+      u_int8_t        height;                 /* zero for header, map; child is one more than parent*/
-+      u_int16_t       numRecords;             /* number of records in this node*/
-+      u_int16_t       reserved;               /* reserved - initialized as zero */
-+}PACKED_S;
-+typedef struct BTNodeDescriptor BTNodeDescriptor;
-+
-+/* Constants for BTNodeDescriptor kind */
-+enum {
-+      kBTLeafNode     = -1,
-+      kBTIndexNode    = 0,
-+      kBTHeaderNode   = 1,
-+      kBTMapNode      = 2
-+}PACKED_S;
-+
-+/* BTHeaderRec -- The first record of a B-tree header node */
-+struct BTHeaderRec {
-+      u_int16_t       treeDepth;              /* maximum height (usually leaf nodes) */
-+      u_int32_t       rootNode;               /* node number of root node */
-+      u_int32_t       leafRecords;            /* number of leaf records in all leaf nodes */
-+      u_int32_t       firstLeafNode;          /* node number of first leaf node */
-+      u_int32_t       lastLeafNode;           /* node number of last leaf node */
-+      u_int16_t       nodeSize;               /* size of a node, in bytes */
-+      u_int16_t       maxKeyLength;           /* reserved */
-+      u_int32_t       totalNodes;             /* total number of nodes in tree */
-+      u_int32_t       freeNodes;              /* number of unused (free) nodes in tree */
-+      u_int16_t       reserved1;              /* unused */
-+      u_int32_t       clumpSize;              /* reserved */
-+      u_int8_t        btreeType;              /* reserved */
-+      u_int8_t        keyCompareType;         /* Key string Comparison Type */
-+      u_int32_t       attributes;             /* persistent attributes about the tree */
-+      u_int32_t       reserved3[16];          /* reserved */
-+}PACKED_S;
-+typedef struct BTHeaderRec BTHeaderRec;
-+
-+/* Constants for BTHeaderRec attributes */
-+enum {
-+      kBTBadCloseMask          = 0x00000001,  /* reserved */
-+      kBTBigKeysMask           = 0x00000002,  /* key length field is 16 bits */
-+      kBTVariableIndexKeysMask = 0x00000004   /* keys in index nodes are variable length */
-+}PACKED_S;
-+
-+
-+/* Catalog Key Name Comparison Type */
-+enum {
-+      kHFSCaseFolding   = 0xCF,  /* case folding (case-insensitive) */
-+      kHFSBinaryCompare = 0xBC  /* binary compare (case-sensitive) */
-+}PACKED_S;
-+
-+/* JournalInfoBlock - Structure that describes where our journal lives */
-+struct JournalInfoBlock {
-+      u_int32_t       flags;
-+      u_int32_t       device_signature[8];  // signature used to locate our device.
-+      u_int64_t       offset;               // byte offset to the journal on the device
-+      u_int64_t       size;                 // size in bytes of the journal
-+      u_int32_t       reserved[32];
-+}PACKED_S;
-+typedef struct JournalInfoBlock JournalInfoBlock;
-+
-+enum {
-+    kJIJournalInFSMask          = 0x00000001,
-+    kJIJournalOnOtherDeviceMask = 0x00000002,
-+    kJIJournalNeedInitMask      = 0x00000004
-+}PACKED_S;
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif /* __HFS_FORMAT__ */
-diff --git a/include/hfs/hfs_mount.h b/include/hfs/hfs_mount.h
-new file mode 100644
-index 0000000..ad729f2
---- /dev/null
-+++ b/include/hfs/hfs_mount.h
-@@ -0,0 +1,78 @@
-+/*
-+ * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
-+ *
-+ * @APPLE_LICENSE_HEADER_START@
-+ *
-+ * The contents of this file constitute Original Code as defined in and
-+ * are subject to the Apple Public Source License Version 1.1 (the
-+ * "License").  You may not use this file except in compliance with the
-+ * License.  Please obtain a copy of the License at
-+ * http://www.apple.com/publicsource and read it before using this file.
-+ *
-+ * This Original Code and all software distributed under the License are
-+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
-+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
-+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
-+ * License for the specific language governing rights and limitations
-+ * under the License.
-+ *
-+ * @APPLE_LICENSE_HEADER_END@
-+ */
-+/*
-+ * Copyright (c) 1997-2002 Apple Computer, Inc. All Rights Reserved
-+ *
-+ */
-+
-+#ifndef _HFS_MOUNT_H_
-+#define _HFS_MOUNT_H_
-+
-+#include <sys/appleapiopts.h>
-+
-+#include <sys/mount.h>
-+#include <sys/time.h>
-+
-+/*
-+ * Arguments to mount HFS-based filesystems
-+ */
-+
-+#define OVERRIDE_UNKNOWN_PERMISSIONS 0
-+
-+#define UNKNOWNUID ((uid_t)99)
-+#define UNKNOWNGID ((gid_t)99)
-+#define UNKNOWNPERMISSIONS (S_IRWXU | S_IROTH | S_IXOTH)              /* 705 */
-+
-+#ifdef __APPLE_API_UNSTABLE
-+struct hfs_mount_args {
-+#ifndef KERNEL
-+      char    *fspec;                 /* block special device to mount */
-+#endif
-+      uid_t   hfs_uid;                /* uid that owns hfs files (standard HFS only) */
-+      gid_t   hfs_gid;                /* gid that owns hfs files (standard HFS only) */
-+      mode_t  hfs_mask;               /* mask to be applied for hfs perms  (standard HFS only) */
-+      u_int32_t hfs_encoding;         /* encoding for this volume (standard HFS only) */
-+      struct  timezone hfs_timezone;  /* user time zone info (standard HFS only) */
-+      int             flags;                  /* mounting flags, see below */
-+      int     journal_tbuffer_size;   /* size in bytes of the journal transaction buffer */
-+      int             journal_flags;          /* flags to pass to journal_open/create */
-+      int             journal_disable;        /* don't use journaling (potentially dangerous) */
-+};
-+
-+#define HFSFSMNT_NOXONFILES   0x1     /* disable execute permissions for files */
-+#define HFSFSMNT_WRAPPER      0x2     /* mount HFS wrapper (if it exists) */
-+#define HFSFSMNT_EXTENDED_ARGS  0x4     /* indicates new fields after "flags" are valid */
-+
-+/*
-+ * Sysctl values for HFS
-+ */
-+#define HFS_ENCODINGBIAS      1           /* encoding matching CJK bias */
-+#define HFS_EXTEND_FS         2
-+#define HFS_ENCODINGHINT      3           /* guess encoding for string */
-+#define HFS_ENABLE_JOURNALING   0x082969
-+#define HFS_DISABLE_JOURNALING  0x031272
-+#define HFS_GET_JOURNAL_INFO    0x6a6e6c69
-+#define HFS_SET_PKG_EXTENSIONS  0x121031
-+
-+#endif /* __APPLE_API_UNSTABLE */
-+
-+#endif /* ! _HFS_MOUNT_H_ */
-diff --git a/include/sys/appleapiopts.h b/include/sys/appleapiopts.h
-new file mode 100644
-index 0000000..4d2061f
---- /dev/null
-+++ b/include/sys/appleapiopts.h
-@@ -0,0 +1,52 @@
-+/*
-+ * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
-+ *
-+ * @APPLE_LICENSE_HEADER_START@
-+ *
-+ * The contents of this file constitute Original Code as defined in and
-+ * are subject to the Apple Public Source License Version 1.1 (the
-+ * "License").  You may not use this file except in compliance with the
-+ * License.  Please obtain a copy of the License at
-+ * http://www.apple.com/publicsource and read it before using this file.
-+ *
-+ * This Original Code and all software distributed under the License are
-+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
-+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
-+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
-+ * License for the specific language governing rights and limitations
-+ * under the License.
-+ *
-+ * @APPLE_LICENSE_HEADER_END@
-+ */
-+
-+#ifndef __SYS_APPLEAPIOPTS_H__
-+#define __SYS_APPLEAPIOPTS_H__
-+
-+
-+#ifndef __APPLE_API_STANDARD
-+#define __APPLE_API_STANDARD
-+#endif /* __APPLE_API_STANDARD */
-+
-+#ifndef __APPLE_API_STABLE
-+#define __APPLE_API_STABLE
-+#endif /* __APPLE_API_STABLE */
-+
-+#ifndef __APPLE_API_STRICT_CONFORMANCE
-+
-+#ifndef __APPLE_API_EVOLVING
-+#define __APPLE_API_EVOLVING
-+#endif /* __APPLE_API_EVOLVING */
-+
-+#ifndef __APPLE_API_UNSTABLE
-+#define __APPLE_API_UNSTABLE
-+#endif /* __APPLE_API_UNSTABLE */
-+
-+#ifndef __APPLE_API_OBSOLETE
-+#define __APPLE_API_OBSOLETE
-+#endif /* __APPLE_API_OBSOLETE */
-+
-+#endif /* __APPLE_API_STRICT_CONFORMANCE */
-+
-+#endif /* __SYS_APPLEAPIOPTS_H__ */
-+
diff --git a/utils/hfsprogs/patches/0004-Fix-compilation-on-64-bit-arches.patch b/utils/hfsprogs/patches/0004-Fix-compilation-on-64-bit-arches.patch
deleted file mode 100644 (file)
index 57f6011..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
-Date: Thu, 24 Oct 2013 01:11:21 -0200
-Subject: Fix compilation on 64-bit arches
-
----
- fsck_hfs.tproj/dfalib/BTreePrivate.h |  5 ++++-
- fsck_hfs.tproj/dfalib/SControl.c     |  8 ++++----
- fsck_hfs.tproj/dfalib/SVerify1.c     | 14 +++++++-------
- fsck_hfs.tproj/dfalib/hfs_endian.c   |  2 +-
- 4 files changed, 16 insertions(+), 13 deletions(-)
-
-diff --git a/fsck_hfs.tproj/dfalib/BTreePrivate.h b/fsck_hfs.tproj/dfalib/BTreePrivate.h
-index 058c75b..2fc2f28 100644
---- a/fsck_hfs.tproj/dfalib/BTreePrivate.h
-+++ b/fsck_hfs.tproj/dfalib/BTreePrivate.h
-@@ -104,6 +104,9 @@ typedef enum {
- ///////////////////////////////////// Types /////////////////////////////////////
-+// Forward declaration from Scavenger.h
-+struct BTreeExtensionsRec;
-+
- typedef struct BTreeControlBlock {                                    // fields specific to BTree CBs
-       UInt8           keyCompareType;   /* Key string Comparison Type */
-@@ -144,7 +147,7 @@ typedef struct BTreeControlBlock {                                 // fields specific to BTree CBs
-       UInt32                                           numPossibleHints;      // Looks like a formated hint
-       UInt32                                           numValidHints;         // Hint used to find correct record.
-       
--      UInt32                                           refCon;                        //      Used by DFA to point to private data.
-+      struct BTreeExtensionsRec                       *refCon;                        //      Used by DFA to point to private data.
-       SFCB                                            *fcbPtr;                // fcb of btree file
-       
- } BTreeControlBlock, *BTreeControlBlockPtr;
-diff --git a/fsck_hfs.tproj/dfalib/SControl.c b/fsck_hfs.tproj/dfalib/SControl.c
-index 37eb242..4ce9e16 100644
---- a/fsck_hfs.tproj/dfalib/SControl.c
-+++ b/fsck_hfs.tproj/dfalib/SControl.c
-@@ -1034,7 +1034,7 @@ static int ScavTerm( SGlobPtr GPtr )
-               btcbP = (BTreeControlBlock*)fcbP->fcbBtree;
-               if ( btcbP != nil)
-               {
--                      if( btcbP->refCon != (UInt32)nil )
-+                      if( btcbP->refCon != nil )
-                       {
-                               if(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != nil)
-                               {
-@@ -1043,13 +1043,13 @@ static int ScavTerm( SGlobPtr GPtr )
-                               }
-                               DisposeMemory( (Ptr)btcbP->refCon );
-                               err = MemError();
--                              btcbP->refCon = (UInt32)nil;
-+                              btcbP->refCon = nil;
-                       }
-                               
-                       fcbP = GPtr->calculatedCatalogFCB;      //      release catalog BTree bit map
-                       btcbP = (BTreeControlBlock*)fcbP->fcbBtree;
-                               
--                      if( btcbP->refCon != (UInt32)nil )
-+                      if( btcbP->refCon != nil )
-                       {
-                               if(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != nil)
-                               {
-@@ -1058,7 +1058,7 @@ static int ScavTerm( SGlobPtr GPtr )
-                               }
-                               DisposeMemory( (Ptr)btcbP->refCon );
-                               err = MemError();
--                              btcbP->refCon = (UInt32)nil;
-+                              btcbP->refCon = nil;
-                       }
-               }
-       }
-diff --git a/fsck_hfs.tproj/dfalib/SVerify1.c b/fsck_hfs.tproj/dfalib/SVerify1.c
-index c272d4d..a273bf3 100644
---- a/fsck_hfs.tproj/dfalib/SVerify1.c
-+++ b/fsck_hfs.tproj/dfalib/SVerify1.c
-@@ -789,8 +789,8 @@ OSErr      CreateExtentsBTreeControlBlock( SGlobPtr GPtr )
-       //
-       //      set up our DFA extended BTCB area.  Will we have enough memory on all HFS+ volumes.
-       //
--      btcb->refCon = (UInt32) AllocateClearMemory( sizeof(BTreeExtensionsRec) );                      // allocate space for our BTCB extensions
--      if ( btcb->refCon == (UInt32) nil ) {
-+      btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) );                       // allocate space for our BTCB extensions
-+      if ( btcb->refCon == nil ) {
-               err = R_NoMem;
-               goto exit;
-       }
-@@ -1144,8 +1144,8 @@ OSErr    CreateCatalogBTreeControlBlock( SGlobPtr GPtr )
-       //      set up our DFA extended BTCB area.  Will we have enough memory on all HFS+ volumes.
-       //
--      btcb->refCon = (UInt32) AllocateClearMemory( sizeof(BTreeExtensionsRec) );                      // allocate space for our BTCB extensions
--      if ( btcb->refCon == (UInt32)nil ) {
-+      btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) );                       // allocate space for our BTCB extensions
-+      if ( btcb->refCon == nil ) {
-               err = R_NoMem;
-               goto exit;
-       }
-@@ -1779,8 +1779,8 @@ OSErr    CreateAttributesBTreeControlBlock( SGlobPtr GPtr )
-       //
-       //      set up our DFA extended BTCB area.  Will we have enough memory on all HFS+ volumes.
-       //
--      btcb->refCon = (UInt32) AllocateClearMemory( sizeof(BTreeExtensionsRec) );                      // allocate space for our BTCB extensions
--      if ( btcb->refCon == (UInt32)nil ) {
-+      btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) );                       // allocate space for our BTCB extensions
-+      if ( btcb->refCon == nil ) {
-               err = R_NoMem;
-               goto exit;
-       }
-@@ -1793,7 +1793,7 @@ OSErr    CreateAttributesBTreeControlBlock( SGlobPtr GPtr )
-       }
-       else
-       {
--              if ( btcb->refCon == (UInt32)nil ) {
-+              if ( btcb->refCon == nil ) {
-                       err = R_NoMem;
-                       goto exit;
-               }
-diff --git a/fsck_hfs.tproj/dfalib/hfs_endian.c b/fsck_hfs.tproj/dfalib/hfs_endian.c
-index 69500c1..3cc9eb4 100755
---- a/fsck_hfs.tproj/dfalib/hfs_endian.c
-+++ b/fsck_hfs.tproj/dfalib/hfs_endian.c
-@@ -437,7 +437,7 @@ hfs_swap_HFSPlusBTInternalNode (
-     BTNodeDescriptor *srcDesc = src->buffer;
-     UInt16 *srcOffs = (UInt16 *)((char *)src->buffer + (src->blockSize - (srcDesc->numRecords * sizeof (UInt16))));
-       char *nextRecord;       /*  Points to start of record following current one */
--    UInt32 i;
-+    int i;
-     UInt32 j;
-     if (fileID == kHFSExtentsFileID) {
diff --git a/utils/hfsprogs/patches/0005-Remove-Apple-specific-p-from-strings.patch b/utils/hfsprogs/patches/0005-Remove-Apple-specific-p-from-strings.patch
deleted file mode 100644 (file)
index 318fd60..0000000
+++ /dev/null
@@ -1,291 +0,0 @@
-From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
-Date: Thu, 24 Oct 2013 01:11:21 -0200
-Subject: Remove (Apple-specific?) \p from strings
-
-Modify the way that debug messages are sent to the user, by eliminating one
-character of them.
----
- fsck_hfs.tproj/dfalib/BTreeTreeOps.c | 48 ++++++++++++++++++------------------
- fsck_hfs.tproj/dfalib/SBTree.c       | 14 +++++------
- 2 files changed, 31 insertions(+), 31 deletions(-)
-
-diff --git a/fsck_hfs.tproj/dfalib/BTreeTreeOps.c b/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
-index b812b14..37fb170 100644
---- a/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
-+++ b/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
-@@ -223,7 +223,7 @@ OSStatus   SearchTree      (BTreeControlBlockPtr    btreePtr,
-         //
-         if (curNodeNum == 0)
-         {
--//          Panic("\pSearchTree: curNodeNum is zero!");
-+            Panic("SearchTree: curNodeNum is zero!");
-             err = fsBTInvalidNodeErr;
-             goto ErrorExit;
-         }
-@@ -433,7 +433,7 @@ OSStatus   InsertLevel (BTreeControlBlockPtr                btreePtr,
-               M_ExitOnError (err);
-               
-               if ( DEBUG_BUILD && updateParent && newRoot )
--                      DebugStr("\p InsertLevel: New root from primary key, update from secondary key...");
-+                      DebugStr("InsertLevel: New root from primary key, update from secondary key...");
-       }
-       //////////////////////// Update Parent(s) ///////////////////////////////
-@@ -448,7 +448,7 @@ OSStatus   InsertLevel (BTreeControlBlockPtr                btreePtr,
-               
-               secondaryKey = nil;
-               
--              PanicIf ( (level == btreePtr->treeDepth), "\p InsertLevel: unfinished insert!?");
-+              PanicIf ( (level == btreePtr->treeDepth), "InsertLevel: unfinished insert!?");
-               ++level;
-@@ -456,7 +456,7 @@ OSStatus   InsertLevel (BTreeControlBlockPtr                btreePtr,
-               index = treePathTable [level].index;
-               parentNodeNum = treePathTable [level].node;
--              PanicIf ( parentNodeNum == 0, "\p InsertLevel: parent node is zero!?");
-+              PanicIf ( parentNodeNum == 0, "InsertLevel: parent node is zero!?");
-               err = GetNode (btreePtr, parentNodeNum, &parentNode);   // released as target node in next level up
-               M_ExitOnError (err);
-@@ -470,7 +470,7 @@ OSStatus   InsertLevel (BTreeControlBlockPtr                btreePtr,
-               {
-                       //¥¥Êdebug: check if ptr == targetNodeNum
-                       GetRecordByIndex (btreePtr, parentNode.buffer, index, &keyPtr, &recPtr, &recSize);
--                      PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, "\p InsertLevel: parent ptr doesn't match target node!");
-+                      PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, "InsertLevel: parent ptr doesn't match target node!");
-                       
-                       // need to delete and re-insert this parent key/ptr
-                       // we delete it here and it gets re-inserted in the
-@@ -532,7 +532,7 @@ ErrorExit:
-       (void) ReleaseNode (btreePtr, targetNode);
-       (void) ReleaseNode (btreePtr, &siblingNode);
--      Panic ("\p InsertLevel: an error occured!");
-+      Panic ("InsertLevel: an error occured!");
-       return  err;
-@@ -566,7 +566,7 @@ static OSErr       InsertNode      (BTreeControlBlockPtr    btreePtr,
-       *rootSplit = false;
-       
--      PanicIf ( targetNode->buffer == siblingNode->buffer, "\p InsertNode: targetNode == siblingNode, huh?");
-+      PanicIf ( targetNode->buffer == siblingNode->buffer, "InsertNode: targetNode == siblingNode, huh?");
-       
-       leftNodeNum = ((NodeDescPtr) targetNode->buffer)->bLink;
-       rightNodeNum = ((NodeDescPtr) targetNode->buffer)->fLink;
-@@ -606,7 +606,7 @@ static OSErr       InsertNode      (BTreeControlBlockPtr    btreePtr,
-       
-       if ( leftNodeNum > 0 )
-       {
--              PanicIf ( siblingNode->buffer != nil, "\p InsertNode: siblingNode already aquired!");
-+              PanicIf ( siblingNode->buffer != nil, "InsertNode: siblingNode already aquired!");
-               if ( siblingNode->buffer == nil )
-               {
-@@ -614,7 +614,7 @@ static OSErr       InsertNode      (BTreeControlBlockPtr    btreePtr,
-                       M_ExitOnError (err);
-               }
--              PanicIf ( ((NodeDescPtr) siblingNode->buffer)->fLink != nodeNum, "\p InsertNode, RotateLeft: invalid sibling link!" );
-+              PanicIf ( ((NodeDescPtr) siblingNode->buffer)->fLink != nodeNum, "InsertNode, RotateLeft: invalid sibling link!" );
-               if ( !key->skipRotate )         // are rotates allowed?
-               {
-@@ -703,7 +703,7 @@ OSStatus   DeleteTree                      (BTreeControlBlockPtr            btreePtr,
-       targetNodeNum = treePathTable[level].node;
-       targetNodePtr = targetNode->buffer;
--      PanicIf (targetNodePtr == nil, "\pDeleteTree: targetNode has nil buffer!");
-+      PanicIf (targetNodePtr == nil, "DeleteTree: targetNode has nil buffer!");
-       DeleteRecord (btreePtr, targetNodePtr, index);
-               
-@@ -797,7 +797,7 @@ OSStatus   DeleteTree                      (BTreeControlBlockPtr            btreePtr,
-                        
-                       //¥¥Êdebug: check if ptr == targetNodeNum
-                       GetRecordByIndex (btreePtr, parentNode.buffer, index, &keyPtr, &recPtr, &recSize);
--                      PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, "\p DeleteTree: parent ptr doesn't match targetNodeNum!!");
-+                      PanicIf( (*(UInt32 *) recPtr) != targetNodeNum, " DeleteTree: parent ptr doesn't match targetNodeNum!!");
-                       
-                       // need to delete and re-insert this parent key/ptr
-                       DeleteRecord (btreePtr, parentNode.buffer, index);
-@@ -1018,7 +1018,7 @@ static OSStatus  RotateLeft              (BTreeControlBlockPtr            btreePtr,
-                                                                               keyPtr, keyLength, recPtr, recSize);
-                       if ( !didItFit )
-                       {
--                              Panic ("\pRotateLeft: InsertKeyRecord (left) returned false!");
-+                              Panic ("RotateLeft: InsertKeyRecord (left) returned false!");
-                               err = fsBTBadRotateErr;
-                               goto ErrorExit;
-                       }
-@@ -1031,7 +1031,7 @@ static OSStatus  RotateLeft              (BTreeControlBlockPtr            btreePtr,
-                       didItFit = RotateRecordLeft (btreePtr, leftNode, rightNode);
-                       if ( !didItFit )
-                       {
--                              Panic ("\pRotateLeft: RotateRecordLeft returned false!");
-+                              Panic ("RotateLeft: RotateRecordLeft returned false!");
-                               err = fsBTBadRotateErr;
-                               goto ErrorExit;
-                       }
-@@ -1048,7 +1048,7 @@ static OSStatus  RotateLeft              (BTreeControlBlockPtr            btreePtr,
-                                                                       keyPtr, keyLength, recPtr, recSize);
-               if ( !didItFit )
-               {
--                      Panic ("\pRotateLeft: InsertKeyRecord (right) returned false!");
-+                      Panic ("RotateLeft: InsertKeyRecord (right) returned false!");
-                       err = fsBTBadRotateErr;
-                       goto ErrorExit;
-               }
-@@ -1117,7 +1117,7 @@ static OSStatus  SplitLeft               (BTreeControlBlockPtr            btreePtr,
-       right = rightNode->buffer;
-       left  = leftNode->buffer;
-       
--      PanicIf ( right->bLink != 0 && left == 0, "\p SplitLeft: left sibling missing!?" );
-+      PanicIf ( right->bLink != 0 && left == 0, " SplitLeft: left sibling missing!?" );
-       
-       //¥¥ type should be kLeafNode or kIndexNode
-       
-@@ -1240,8 +1240,8 @@ static OSStatus  AddNewRootNode  (BTreeControlBlockPtr    btreePtr,
-       Boolean                         didItFit;
-       UInt16                          keyLength;      
-       
--      PanicIf (leftNode == nil, "\pAddNewRootNode: leftNode == nil");
--      PanicIf (rightNode == nil, "\pAddNewRootNode: rightNode == nil");
-+      PanicIf (leftNode == nil, "AddNewRootNode: leftNode == nil");
-+      PanicIf (rightNode == nil, "AddNewRootNode: rightNode == nil");
-       
-       
-       /////////////////////// Initialize New Root Node ////////////////////////////
-@@ -1264,7 +1264,7 @@ static OSStatus  AddNewRootNode  (BTreeControlBlockPtr    btreePtr,
-       didItFit = InsertKeyRecord ( btreePtr, rootNode.buffer, 0, keyPtr, keyLength,
-                                                                (UInt8 *) &rightNode->bLink, 4 );
--      PanicIf ( !didItFit, "\pAddNewRootNode:InsertKeyRecord failed for left index record");
-+      PanicIf ( !didItFit, "AddNewRootNode:InsertKeyRecord failed for left index record");
-       //////////////////// Insert Right Node Index Record /////////////////////////
-@@ -1275,7 +1275,7 @@ static OSStatus  AddNewRootNode  (BTreeControlBlockPtr    btreePtr,
-       didItFit = InsertKeyRecord ( btreePtr, rootNode.buffer, 1, keyPtr, keyLength,
-                                                                (UInt8 *) &leftNode->fLink, 4 );
--      PanicIf ( !didItFit, "\pAddNewRootNode:InsertKeyRecord failed for right index record");
-+      PanicIf ( !didItFit, "AddNewRootNode:InsertKeyRecord failed for right index record");
- #if DEBUG_TREEOPS
-@@ -1355,7 +1355,7 @@ static OSStatus  SplitRight              (BTreeControlBlockPtr            btreePtr,
-       }
-       rightPtr = rightNodePtr->buffer;
-       
--      PanicIf ( leftPtr->fLink != 0 && rightPtr == 0, "\p SplitRight: right sibling missing!?" );
-+      PanicIf ( leftPtr->fLink != 0 && rightPtr == 0, "SplitRight: right sibling missing!?" );
-       
-       //¥¥ type should be kLeafNode or kIndexNode
-       
-@@ -1557,7 +1557,7 @@ static OSStatus  RotateRight             (BTreeControlBlockPtr            btreePtr,
-                                                                       keyPtr, keyLength, recPtr, recSize);
-               if ( !didItFit )
-               {
--                      Panic ("\pRotateRight: InsertKeyRecord (left) returned false!");
-+                      Panic ("RotateRight: InsertKeyRecord (left) returned false!");
-                       err = fsBTBadRotateErr;
-                       goto ErrorExit;
-               }
-@@ -1572,7 +1572,7 @@ static OSStatus  RotateRight             (BTreeControlBlockPtr            btreePtr,
-               didItFit = RotateRecordRight( btreePtr, leftNodePtr, rightNodePtr );
-               if ( !didItFit )
-               {
--                      Panic ("\pRotateRight: RotateRecordRight returned false!");
-+                      Panic ("RotateRight: RotateRecordRight returned false!");
-                       err = fsBTBadRotateErr;
-                       goto ErrorExit;
-               }
-@@ -1583,7 +1583,7 @@ static OSStatus  RotateRight             (BTreeControlBlockPtr            btreePtr,
-                                                                               keyPtr, keyLength, recPtr, recSize);
-                       if ( !didItFit )
-                       {
--                              Panic ("\pRotateRight: InsertKeyRecord (left) returned false!");
-+                              Panic ("RotateRight: InsertKeyRecord (left) returned false!");
-                               err = fsBTBadRotateErr;
-                               goto ErrorExit;
-                       }
-@@ -1607,7 +1607,7 @@ static OSStatus  RotateRight             (BTreeControlBlockPtr            btreePtr,
-                                                                       keyPtr, keyLength, recPtr, recSize);
-               if ( !didItFit )
-               {
--                      Panic ("\pRotateRight: InsertKeyRecord (right) returned false!");
-+                      Panic ("RotateRight: InsertKeyRecord (right) returned false!");
-                       err = fsBTBadRotateErr;
-                       goto ErrorExit;
-               }
-diff --git a/fsck_hfs.tproj/dfalib/SBTree.c b/fsck_hfs.tproj/dfalib/SBTree.c
-index cd81b13..eeb4e8c 100644
---- a/fsck_hfs.tproj/dfalib/SBTree.c
-+++ b/fsck_hfs.tproj/dfalib/SBTree.c
-@@ -103,7 +103,7 @@ OSErr SearchBTreeRecord(SFCB *fcb, const void* key, UInt32 hint, void* foundKey,
-                       CopyMemory(&resultIterator->key, foundKey, CalcKeySize(btcb, &resultIterator->key));    //¥¥ warning, this could overflow user's buffer!!!
-               if ( DEBUG_BUILD && !ValidHFSRecord(data, btcb, *dataSize) )
--                      DebugStr("\pSearchBTreeRecord: bad record?");
-+                      DebugStr("SearchBTreeRecord: bad record?");
-       }
- ErrorExit:
-@@ -211,7 +211,7 @@ OSErr GetBTreeRecord(SFCB *fcb, SInt16 selectionIndex, void* key, void* data, UI
-               CopyMemory(&iterator->key, key, CalcKeySize(btcb, &iterator->key));     //¥¥ warning, this could overflow user's buffer!!!
-               
-               if ( DEBUG_BUILD && !ValidHFSRecord(data, btcb, *dataSize) )
--                      DebugStr("\pGetBTreeRecord: bad record?");
-+                      DebugStr("GetBTreeRecord: bad record?");
-       }
-       
-@@ -243,7 +243,7 @@ OSErr InsertBTreeRecord(SFCB *fcb, const void* key, const void* data, UInt16 dat
-       CopyMemory(key, &iterator.key, CalcKeySize(btcb, (BTreeKey *) key));    //¥¥ should we range check against maxkeylen?
-       if ( DEBUG_BUILD && !ValidHFSRecord(data, btcb, dataSize) )
--              DebugStr("\pInsertBTreeRecord: bad record?");
-+              DebugStr("InsertBTreeRecord: bad record?");
-       result = BTInsertRecord( fcb, &iterator, &btRecord, dataSize );
-@@ -305,7 +305,7 @@ OSErr ReplaceBTreeRecord(SFCB *fcb, const void* key, UInt32 hint, void *newData,
-       CopyMemory(key, &iterator.key, CalcKeySize(btcb, (BTreeKey *) key));            //¥¥ should we range check against maxkeylen?
-       if ( DEBUG_BUILD && !ValidHFSRecord(newData, btcb, dataSize) )
--              DebugStr("\pReplaceBTreeRecord: bad record?");
-+              DebugStr("ReplaceBTreeRecord: bad record?");
-       result = BTReplaceRecord( fcb, &iterator, &btRecord, dataSize );
-@@ -344,7 +344,7 @@ SetEndOfForkProc ( SFCB *filePtr, FSSize minEOF, FSSize maxEOF )
-       else
-       {
-               if ( DEBUG_BUILD )
--                      DebugStr("\pSetEndOfForkProc: minEOF is smaller than current size!");
-+                      DebugStr("SetEndOfForkProc: minEOF is smaller than current size!");
-               return -1;
-       }
-@@ -370,7 +370,7 @@ SetEndOfForkProc ( SFCB *filePtr, FSSize minEOF, FSSize maxEOF )
-       //      Make sure we got at least as much space as we needed
-       //
-       if (filePtr->fcbLogicalSize < minEOF) {
--              Panic("\pSetEndOfForkProc: disk too full to extend B-tree file");
-+              Panic("SetEndOfForkProc: disk too full to extend B-tree file");
-               return dskFulErr;
-       }
-       
-@@ -442,7 +442,7 @@ static OSErr CheckBTreeKey(const BTreeKey *key, const BTreeControlBlock *btcb)
-       if ( (keyLen < 6) || (keyLen > btcb->maxKeyLength) )
-       {
-               if ( DEBUG_BUILD )
--                      DebugStr("\pCheckBTreeKey: bad key length!");
-+                      DebugStr("CheckBTreeKey: bad key length!");
-               return fsBTInvalidKeyLengthErr;
-       }
-       
diff --git a/utils/hfsprogs/patches/0006-Adjust-types-for-printing.patch b/utils/hfsprogs/patches/0006-Adjust-types-for-printing.patch
deleted file mode 100644 (file)
index 09efbb6..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
-Date: Thu, 24 Oct 2013 01:11:21 -0200
-Subject: Adjust types for printing
-
-Try to address the issues of a given integral type having different sizes
-in 32 and 64-bit architectures.
----
- fsck_hfs.tproj/dfalib/SControl.c   | 2 +-
- fsck_hfs.tproj/dfalib/hfs_endian.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/fsck_hfs.tproj/dfalib/SControl.c b/fsck_hfs.tproj/dfalib/SControl.c
-index 4ce9e16..8b03ece 100644
---- a/fsck_hfs.tproj/dfalib/SControl.c
-+++ b/fsck_hfs.tproj/dfalib/SControl.c
-@@ -776,7 +776,7 @@ static int ScavSetUp( SGlob *GPtr)
-               pointer = (ScavStaticStructures *) AllocateClearMemory( sizeof(ScavStaticStructures) );
-               if ( pointer == nil ) {
-                       if ( GPtr->logLevel >= kDebugLog ) {
--                              printf( "\t error %d - could not allocate %ld bytes of memory \n",
-+                              printf( "\t error %d - could not allocate %i bytes of memory \n",
-                                       R_NoMem, sizeof(ScavStaticStructures) );
-                       }
-                       return( R_NoMem );
-diff --git a/fsck_hfs.tproj/dfalib/hfs_endian.c b/fsck_hfs.tproj/dfalib/hfs_endian.c
-index 3cc9eb4..6ca2ac1 100755
---- a/fsck_hfs.tproj/dfalib/hfs_endian.c
-+++ b/fsck_hfs.tproj/dfalib/hfs_endian.c
-@@ -563,7 +563,7 @@ hfs_swap_HFSPlusBTInternalNode (
-             /* Make sure name length is consistent with key length */
-             if (keyLength < sizeof(srcKey->parentID) + sizeof(srcKey->nodeName.length) +
-                 srcKey->nodeName.length*sizeof(srcKey->nodeName.unicode[0])) {
--                              if (debug) printf("hfs_swap_HFSPlusBTInternalNode: catalog record #%d keyLength=%d expected=%lu\n",
-+                              if (debug) printf("hfs_swap_HFSPlusBTInternalNode: catalog record #%d keyLength=%d expected=%i\n",
-                                       srcDesc->numRecords-i, keyLength, sizeof(srcKey->parentID) + sizeof(srcKey->nodeName.length) +
-                     srcKey->nodeName.length*sizeof(srcKey->nodeName.unicode[0]));
-                               WriteError(fcb->fcbVolume->vcbGPtr, E_KeyLen, fcb->fcbFileID, src->blockNum);
diff --git a/utils/hfsprogs/patches/0007-Fix-path-for-HFS-wrapper-block.patch b/utils/hfsprogs/patches/0007-Fix-path-for-HFS-wrapper-block.patch
deleted file mode 100644 (file)
index f92bb22..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
-Date: Thu, 24 Oct 2013 01:11:21 -0200
-Subject: Fix path for HFS wrapper block
-
-Fix the installation of the HFS wrapper block to be compliant in Linux
-systems (since it is arch independent).
----
- newfs_hfs.tproj/makehfs.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/newfs_hfs.tproj/makehfs.c b/newfs_hfs.tproj/makehfs.c
-index 7609779..2233ef7 100644
---- a/newfs_hfs.tproj/makehfs.c
-+++ b/newfs_hfs.tproj/makehfs.c
-@@ -70,7 +70,7 @@ extern Boolean _CFStringGetFileSystemRepresentation(CFStringRef string, UInt8 *b
- #include "readme.h"
--#define HFS_BOOT_DATA "/usr/share/misc/hfsbootdata"
-+#define HFS_BOOT_DATA "/usr/share/hfsprogs/hfsbootdata"
- #define HFS_JOURNAL_FILE      ".journal"
- #define HFS_JOURNAL_INFO      ".journal_info_block"
diff --git a/utils/hfsprogs/patches/0008-Provide-command-line-option-a.patch b/utils/hfsprogs/patches/0008-Provide-command-line-option-a.patch
deleted file mode 100644 (file)
index 366dbbc..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
-Date: Thu, 24 Oct 2013 01:11:21 -0200
-Subject: Provide command line option -a
-
-Create a new command line option (-a) for the fsck.hfsplus that has the same
-behavior that the -p option has, for greater compatibility with other tools.
----
- fsck_hfs.tproj/fsck_hfs.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/fsck_hfs.tproj/fsck_hfs.c b/fsck_hfs.tproj/fsck_hfs.c
-index f1a18bd..6117698 100644
---- a/fsck_hfs.tproj/fsck_hfs.c
-+++ b/fsck_hfs.tproj/fsck_hfs.c
-@@ -104,7 +104,7 @@ main(argc, argv)
-       else
-               progname = *argv;
--      while ((ch = getopt(argc, argv, "c:D:dfglm:npqruy")) != EOF) {
-+      while ((ch = getopt(argc, argv, "c:D:dfglm:napqruy")) != EOF) {
-               switch (ch) {
-               case 'c':
-                       /* Cache size to use in fsck_hfs */
-@@ -169,6 +169,7 @@ main(argc, argv)
-                       yflag = 0;
-                       break;
-+              case 'a':
-               case 'p':
-                       preen++;
-                       break;
-@@ -572,7 +573,7 @@ usage()
-       (void) fprintf(stderr, "  l = live fsck (lock down and test-only)\n");
-       (void) fprintf(stderr, "  m arg = octal mode used when creating lost+found directory \n");
-       (void) fprintf(stderr, "  n = assume a no response \n");
--      (void) fprintf(stderr, "  p = just fix normal inconsistencies \n");
-+      (void) fprintf(stderr, "  p, a = just fix normal inconsistencies \n");
-       (void) fprintf(stderr, "  q = quick check returns clean, dirty, or failure \n");
-       (void) fprintf(stderr, "  r = rebuild catalog btree \n");
-       (void) fprintf(stderr, "  u = usage \n");
diff --git a/utils/hfsprogs/patches/0009-Rename-dprintf-to-dbg_printf.patch b/utils/hfsprogs/patches/0009-Rename-dprintf-to-dbg_printf.patch
deleted file mode 100644 (file)
index 23f8518..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
-Date: Thu, 24 Oct 2013 01:11:21 -0200
-Subject: Rename dprintf to dbg_printf
-
----
- fsck_hfs.tproj/dfalib/SRepair.c  | 18 +++++++++---------
- fsck_hfs.tproj/dfalib/SVerify1.c |  6 +++---
- fsck_hfs.tproj/fsck_debug.c      | 10 +++++-----
- fsck_hfs.tproj/fsck_debug.h      | 10 +++++-----
- 4 files changed, 22 insertions(+), 22 deletions(-)
-
-diff --git a/fsck_hfs.tproj/dfalib/SRepair.c b/fsck_hfs.tproj/dfalib/SRepair.c
-index 8eb759c..89c12d6 100644
---- a/fsck_hfs.tproj/dfalib/SRepair.c
-+++ b/fsck_hfs.tproj/dfalib/SRepair.c
-@@ -1825,13 +1825,13 @@ static OSErr FixAttrSize(SGlobPtr GPtr, RepairOrderPtr p)
-       result = BTSearchRecord(GPtr->calculatedAttributesFCB, &iterator, 
-                               kInvalidMRUCacheKey, &btRecord, &recSize, &iterator);
-       if (result) {
--              dprintf (d_error|d_xattr, "%s: Cannot find attribute record (err = %d)\n", __FUNCTION__, result);
-+              dbg_printf (d_error|d_xattr, "%s: Cannot find attribute record (err = %d)\n", __FUNCTION__, result);
-               goto out;
-       }
-       /* We should only get record of type kHFSPlusAttrForkData */
-       if (record.recordType != kHFSPlusAttrForkData) {
--              dprintf (d_error|d_xattr, "%s: Record found is not attribute fork data\n", __FUNCTION__);
-+              dbg_printf (d_error|d_xattr, "%s: Record found is not attribute fork data\n", __FUNCTION__);
-               result = btNotFound;
-               goto out;
-       }
-@@ -1862,7 +1862,7 @@ static OSErr FixAttrSize(SGlobPtr GPtr, RepairOrderPtr p)
-               result = BTReplaceRecord(GPtr->calculatedAttributesFCB, &iterator,
-                                       &btRecord, recSize);
-               if (result) {
--                      dprintf (d_error|d_xattr, "%s: Cannot replace attribute record (err=%d)\n", __FUNCTION__, result);
-+                      dbg_printf (d_error|d_xattr, "%s: Cannot replace attribute record (err=%d)\n", __FUNCTION__, result);
-                       goto out;
-               }
-       }
-@@ -2058,7 +2058,7 @@ del_overflow_extents:
-               /* Delete the extent record */ 
-               err = DeleteBTreeRecord(GPtr->calculatedExtentsFCB, &extentKey);
--              dprintf (d_info, "%s: Deleting extent overflow for fileID=%u, forkType=%u, startBlock=%u\n", __FUNCTION__, fileID, forkType, foundStartBlock);
-+              dbg_printf (d_info, "%s: Deleting extent overflow for fileID=%u, forkType=%u, startBlock=%u\n", __FUNCTION__, fileID, forkType, foundStartBlock);
-               if (err) {
-                       goto create_symlink;
-               }
-@@ -3227,12 +3227,12 @@ static OSErr MoveExtent(SGlobPtr GPtr, ExtentInfo *extentInfo)
-                                                                                         &extentData, &recordSize, &foundExtentIndex);
-                               foundLocation = extentsBTree;
-                               if (err != noErr) {
--                                      dprintf (d_error|d_overlap, "%s: No matching extent record found in extents btree for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
-+                                      dbg_printf (d_error|d_overlap, "%s: No matching extent record found in extents btree for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
-                                       goto out;
-                               }
-                       } else {
-                               /* No more extents exist for this file */
--                              dprintf (d_error|d_overlap, "%s: No matching extent record found for fileID = %d\n", __FUNCTION__, extentInfo->fileID);
-+                              dbg_printf (d_error|d_overlap, "%s: No matching extent record found for fileID = %d\n", __FUNCTION__, extentInfo->fileID);
-                               goto out;
-                       }
-               }
-@@ -3241,7 +3241,7 @@ static OSErr MoveExtent(SGlobPtr GPtr, ExtentInfo *extentInfo)
-       err = CopyDiskBlocks(GPtr, extentInfo->startBlock, extentInfo->blockCount, 
-                                                extentInfo->newStartBlock);
-       if (err != noErr) {
--              dprintf (d_error|d_overlap, "%s: Error in copying disk blocks for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
-+              dbg_printf (d_error|d_overlap, "%s: Error in copying disk blocks for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
-               goto out;
-       }
-       
-@@ -3260,7 +3260,7 @@ static OSErr MoveExtent(SGlobPtr GPtr, ExtentInfo *extentInfo)
-       }
-       if (err != noErr) {
--              dprintf (d_error|d_overlap, "%s: Error in updating extent record for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
-+              dbg_printf (d_error|d_overlap, "%s: Error in updating extent record for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
-               goto out;
-       }
-@@ -3491,7 +3491,7 @@ static OSErr SearchExtentInAttributeBT(SGlobPtr GPtr, ExtentInfo *extentInfo,
-       result = BTSearchRecord(GPtr->calculatedAttributesFCB, &iterator, 
-                               kInvalidMRUCacheKey, &btRecord, recordSize, &iterator);
-       if (result) {
--              dprintf (d_error|d_overlap, "%s: Error finding attribute record (err=%d) for fileID = %d, attrname = %d\n", __FUNCTION__, result, extentInfo->fileID, extentInfo->attrname);
-+              dbg_printf (d_error|d_overlap, "%s: Error finding attribute record (err=%d) for fileID = %d, attrname = %d\n", __FUNCTION__, result, extentInfo->fileID, extentInfo->attrname);
-               goto out;       
-       }
-       
-diff --git a/fsck_hfs.tproj/dfalib/SVerify1.c b/fsck_hfs.tproj/dfalib/SVerify1.c
-index a273bf3..39bda5c 100644
---- a/fsck_hfs.tproj/dfalib/SVerify1.c
-+++ b/fsck_hfs.tproj/dfalib/SVerify1.c
-@@ -2157,9 +2157,9 @@ CheckAttributeRecord(SGlobPtr GPtr, const HFSPlusAttrKey *key, const HFSPlusAttr
-       
-       if (doDelete == true) {
-               result = DeleteBTreeRecord(GPtr->calculatedAttributesFCB, key);
--              dprintf (d_info|d_xattr, "%s: Deleting attribute %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
-+              dbg_printf (d_info|d_xattr, "%s: Deleting attribute %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
-               if (result) {
--                      dprintf (d_error|d_xattr, "%s: Error in deleting record for %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
-+                      dbg_printf (d_error|d_xattr, "%s: Error in deleting record for %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
-               }
-               
-               /* Set flags to mark header and map dirty */
-@@ -3034,7 +3034,7 @@ OSErr    CheckFileExtents( SGlobPtr GPtr, UInt32 fileNumber, UInt8 forkType,
-               //      checkout the extent record first
-               err = ChkExtRec( GPtr, extents, &lastExtentIndex );
-               if (err != noErr) {
--                      dprintf (d_info, "%s: Bad extent for fileID %u in extent %u for startblock %u\n", __FUNCTION__, fileNumber, lastExtentIndex, blockCount);
-+                      dbg_printf (d_info, "%s: Bad extent for fileID %u in extent %u for startblock %u\n", __FUNCTION__, fileNumber, lastExtentIndex, blockCount);
-                       /* Stop verification if bad extent is found for system file or EA */
-                       if ((fileNumber < kHFSFirstUserCatalogNodeID) ||
-diff --git a/fsck_hfs.tproj/fsck_debug.c b/fsck_hfs.tproj/fsck_debug.c
-index 1be3fc5..77e8e51 100644
---- a/fsck_hfs.tproj/fsck_debug.c
-+++ b/fsck_hfs.tproj/fsck_debug.c
-@@ -25,18 +25,18 @@
- #include <stdio.h>
- #include <stdarg.h>
--/* Current debug level of fsck_hfs for printing messages via dprintf */
-+/* Current debug level of fsck_hfs for printing messages via dbg_printf */
- unsigned long cur_debug_level;
--/* Function: dprintf
-+/* Function: dbg_printf
-  *
-  * Description: Debug function similar to printf except the first parameter
-- * which indicates the type of message to be printed by dprintf. Based on 
-+ * which indicates the type of message to be printed by dbg_printf. Based on
-  * current debug level and the type of message, the function decides 
-  * whether to print the message or not.
-  *
-  * Each unique message type has a bit assigned to it.  The message type 
-- * passed to dprintf can be one or combination (OR-ed value) of pre-defined 
-+ * passed to dbg_printf can be one or combination (OR-ed value) of pre-defined
-  * debug message types.  Only the messages whose type have one or more similar
-  * bits set in comparison with current global debug level are printed. 
-  *
-@@ -56,7 +56,7 @@ unsigned long cur_debug_level;
-  * Output:
-  *    Nothing
-  */
--void dprintf (unsigned long type, char *fmt, ...) 
-+void dbg_printf (unsigned long type, char *fmt, ...)
- {
-       if (cur_debug_level & type) {
-               va_list ap;
-diff --git a/fsck_hfs.tproj/fsck_debug.h b/fsck_hfs.tproj/fsck_debug.h
-index 81e3932..cb1b9be 100644
---- a/fsck_hfs.tproj/fsck_debug.h
-+++ b/fsck_hfs.tproj/fsck_debug.h
-@@ -36,18 +36,18 @@ enum debug_message_type {
-       d_overlap       =       0x0020  /* Overlap extents related messages */
- };
--/* Current debug level of fsck_hfs for printing messages via dprintf */
-+/* Current debug level of fsck_hfs for printing messages via dbg_printf */
- extern unsigned long cur_debug_level;
--/* Function: dprintf
-+/* Function: dbg_printf
-  *
-  * Description: Debug function similar to printf except the first parameter
-- * which indicates the type of message to be printed by dprintf. Based on 
-+ * which indicates the type of message to be printed by dbg_printf. Based on
-  * current debug level and the type of message, the function decides 
-  * whether to print the message or not.
-  *
-  * Each unique message type has a bit assigned to it.  The message type 
-- * passed to dprintf can be one or combination (OR-ed value) of pre-defined 
-+ * passed to dbg_printf can be one or combination (OR-ed value) of pre-defined
-  * debug message types.  Only the messages whose type have one or more similar
-  * bits set in comparison with current global debug level are printed. 
-  *
-@@ -67,6 +67,6 @@ extern unsigned long cur_debug_level;
-  * Output:
-  *    Nothing
-  */
--extern void dprintf (unsigned long message_type, char *format, ...);
-+extern void dbg_printf (unsigned long message_type, char *format, ...);
- #endif /* __FSCK_DEBUG__ */
diff --git a/utils/hfsprogs/patches/0010-Rename-custom-macro-nil-with-NULL.patch b/utils/hfsprogs/patches/0010-Rename-custom-macro-nil-with-NULL.patch
deleted file mode 100644 (file)
index 354b4ff..0000000
+++ /dev/null
@@ -1,1319 +0,0 @@
-From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
-Date: Thu, 24 Oct 2013 01:11:21 -0200
-Subject: Rename custom macro nil with NULL
-
----
- fsck_hfs.tproj/dfalib/BTree.c         | 142 +++++++++++++++++-----------------
- fsck_hfs.tproj/dfalib/BTreeAllocate.c |  14 ++--
- fsck_hfs.tproj/dfalib/BTreeMiscOps.c  |  26 +++----
- fsck_hfs.tproj/dfalib/BTreeNodeOps.c  |  30 +++----
- fsck_hfs.tproj/dfalib/BTreeTreeOps.c  |  38 ++++-----
- fsck_hfs.tproj/dfalib/SControl.c      |  56 +++++++-------
- fsck_hfs.tproj/dfalib/SRepair.c       |   6 +-
- fsck_hfs.tproj/dfalib/SUtils.c        |   6 +-
- fsck_hfs.tproj/dfalib/SVerify1.c      |  32 ++++----
- fsck_hfs.tproj/dfalib/SVerify2.c      |   4 +-
- 10 files changed, 177 insertions(+), 177 deletions(-)
-
-diff --git a/fsck_hfs.tproj/dfalib/BTree.c b/fsck_hfs.tproj/dfalib/BTree.c
-index 7ad9fe0..c0c8744 100644
---- a/fsck_hfs.tproj/dfalib/BTree.c
-+++ b/fsck_hfs.tproj/dfalib/BTree.c
-@@ -163,21 +163,21 @@ OSStatus BTInitialize            (FCB                                    *filePtr,
-       ////////////////////// Preliminary Error Checking ///////////////////////////
--      headerNode.buffer       = nil;
-+      headerNode.buffer       = NULL;
--      if (pathPtr                                                                             == nil) return  paramErr;
-+      if (pathPtr == NULL)    return  paramErr;
-       setEndOfForkProc        = pathPtr->agentPtr->agent.setEndOfForkProc;
-       setBlockSizeProc        = pathPtr->agentPtr->agent.setBlockSizeProc;
--      if (pathPtr->agentPtr->agent.getBlockProc               == nil) return  E_NoGetBlockProc;
--      if (pathPtr->agentPtr->agent.releaseBlockProc   == nil) return  E_NoReleaseBlockProc;
--      if (setEndOfForkProc                                                    == nil) return  E_NoSetEndOfForkProc;
--      if (setBlockSizeProc                                                    == nil) return  E_NoSetBlockSizeProc;
-+      if (pathPtr->agentPtr->agent.getBlockProc == NULL)      return  E_NoGetBlockProc;
-+      if (pathPtr->agentPtr->agent.releaseBlockProc == NULL)  return  E_NoReleaseBlockProc;
-+      if (setEndOfForkProc == NULL)   return  E_NoSetEndOfForkProc;
-+      if (setBlockSizeProc == NULL)   return  E_NoSetBlockSizeProc;
-       forkPtr = pathPtr->path.forkPtr;
--      if (forkPtr->fork.btreePtr != nil)                                              return  fsBTrFileAlreadyOpenErr;
-+      if (forkPtr->fork.btreePtr != NULL) return      fsBTrFileAlreadyOpenErr;
-       if ((maxKeyLength == 0) ||
-               (maxKeyLength >  kMaxKeyLength))                                        return  fsBTInvalidKeyLengthErr;
-@@ -209,7 +209,7 @@ OSStatus   BTInitialize            (FCB                                    *filePtr,
-       //////////////////////// Allocate Control Block /////////////////////////////
-       M_RESIDENT_ALLOCATE_FIXED_CLEAR( &btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType );
--      if (btreePtr == nil)
-+      if (btreePtr == NULL)
-       {
-               err = memFullErr;
-               goto ErrorExit;
-@@ -220,7 +220,7 @@ OSStatus   BTInitialize            (FCB                                    *filePtr,
-       btreePtr->flags                         = 0;
-       btreePtr->attributes            = 0;
-       btreePtr->forkPtr                       = forkPtr;
--      btreePtr->keyCompareProc        = nil;
-+      btreePtr->keyCompareProc        = NULL;
-       btreePtr->keyDescPtr            = keyDescPtr;
-       btreePtr->btreeType                     = btreeType;
-       btreePtr->treeDepth                     = 0;
-@@ -282,7 +282,7 @@ OSStatus   BTInitialize            (FCB                                    *filePtr,
-       ///////////////////// Copy Key Descriptor To Header /////////////////////////
- #if SupportsKeyDescriptors
--      if (keyDescPtr != nil)
-+      if (keyDescPtr != NULL)
-       {
-               err = CheckKeyDescriptor (keyDescPtr, maxKeyLength);
-               M_ExitOnError (err);
-@@ -309,7 +309,7 @@ OSStatus   BTInitialize            (FCB                                    *filePtr,
-       err = UpdateHeader (btreePtr);
-       M_ExitOnError (err);
--      pathPtr->path.forkPtr->fork.btreePtr = nil;
-+      pathPtr->path.forkPtr->fork.btreePtr = NULL;
-       M_RESIDENT_DEALLOCATE_FIXED( btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType );
-       return  noErr;
-@@ -320,7 +320,7 @@ OSStatus   BTInitialize            (FCB                                    *filePtr,
- ErrorExit:
-       (void) ReleaseNode (btreePtr, &headerNode);
--      if (btreePtr != nil)
-+      if (btreePtr != NULL)
-               M_RESIDENT_DEALLOCATE_FIXED( btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType );
-       return  err;
-@@ -342,7 +342,7 @@ Input:             filePtr                         - pointer to file to open as a B-tree
-                       setEndOfForkProc        - pointer to client's SetEOF function
- Result:               noErr                           - success
--                      paramErr                        - required ptr was nil
-+                      paramErr                        - required ptr was NULL
-                       fsBTInvalidFileErr                              -
-                       memFullErr                      -
-                       != noErr                        - failure
-@@ -364,16 +364,16 @@ OSStatus BTOpenPath                      (SFCB                                   *filePtr,
-       ////////////////////// Preliminary Error Checking ///////////////////////////
--      if ( filePtr == nil                             ||
--               getBlockProc == nil            ||
--               releaseBlockProc == nil        ||
--               setEndOfForkProc == nil        ||
--               setBlockSizeProc == nil )
-+      if (filePtr == NULL ||
-+               getBlockProc == NULL ||
-+               releaseBlockProc == NULL ||
-+               setEndOfForkProc == NULL ||
-+               setBlockSizeProc == NULL)
-       {
-               return  paramErr;
-       }
--      if ( filePtr->fcbBtree != nil )                 // already has a BTreeCB
-+      if (filePtr->fcbBtree != NULL)                  // already has a BTreeCB
-               return noErr;
-                                                                                               // is file large enough to contain header node?
-@@ -384,7 +384,7 @@ OSStatus   BTOpenPath                      (SFCB                                   *filePtr,
-       //////////////////////// Allocate Control Block /////////////////////////////
-       btreePtr = (BTreeControlBlock*) AllocateClearMemory( sizeof( BTreeControlBlock ) );
--      if (btreePtr == nil)
-+      if (btreePtr == NULL)
-       {
-               Panic ("\pBTOpen: no memory for btreePtr.");
-               return  memFullErr;
-@@ -397,7 +397,7 @@ OSStatus   BTOpenPath                      (SFCB                                   *filePtr,
-       /////////////////////////// Read Header Node ////////////////////////////////
--      nodeRec.buffer                          = nil;                          // so we can call ReleaseNode
-+      nodeRec.buffer                          = NULL;                         // so we can call ReleaseNode
-       
-       btreePtr->fcbPtr                        = filePtr;
-       filePtr->fcbBtree                       = (void *) btreePtr;    // attach btree cb to file
-@@ -487,7 +487,7 @@ OSStatus   BTOpenPath                      (SFCB                                   *filePtr,
-       ////////////////////////// Get Key Descriptor ///////////////////////////////
- #if SupportsKeyDescriptors
--      if ( keyCompareProc == nil )            //      if no key compare proc then get key descriptor
-+      if (keyCompareProc == NULL)             //      if no key compare proc then get key descriptor
-       {
-               err = GetKeyDescriptor (btreePtr, nodeRec.buffer);      //¥¥ it should check amount of memory allocated...
-               M_ExitOnError (err);
-@@ -499,7 +499,7 @@ OSStatus   BTOpenPath                      (SFCB                                   *filePtr,
-       else
- #endif
-       {
--              btreePtr->keyDescPtr = nil;                     // clear it so we don't dispose garbage later
-+              btreePtr->keyDescPtr = NULL;                    // clear it so we don't dispose garbage later
-       }
-       err = ReleaseNode (btreePtr, &nodeRec);
-@@ -528,7 +528,7 @@ OSStatus   BTOpenPath                      (SFCB                                   *filePtr,
- ErrorExit:
--      filePtr->fcbBtree = nil;
-+      filePtr->fcbBtree = NULL;
-       (void) ReleaseNode (btreePtr, &nodeRec);
-       DisposeMemory( btreePtr );
-@@ -567,7 +567,7 @@ OSStatus   BTClosePath                     (SFCB                                   *filePtr)
-       btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
--      if (btreePtr == nil)
-+      if (btreePtr == NULL)
-               return fsBTInvalidFileErr;
-       ////////////////////// Check for other BTree Paths //////////////////////////
-@@ -603,14 +603,14 @@ OSStatus BTClosePath                     (SFCB                                   *filePtr)
-       M_ExitOnError (err);
- #if SupportsKeyDescriptors
--      if (btreePtr->keyDescPtr != nil)                        // deallocate keyDescriptor, if any
-+      if (btreePtr->keyDescPtr != NULL)                       // deallocate keyDescriptor, if any
-       {
-               DisposeMemory( btreePtr->keyDescPtr );
-       }
- #endif
-       DisposeMemory( btreePtr );
--      filePtr->fcbBtree = nil;
-+      filePtr->fcbBtree = NULL;
- //    LogEndTime(kTraceCloseBTree, noErr);
-@@ -643,7 +643,7 @@ Function:  Search for position in B*Tree indicated by searchKey. If a valid node
- Input:                pathPtr                 - pointer to path for BTree file.
-                       searchKey               - pointer to search key to match.
--                      hintPtr                 - pointer to hint (may be nil)
-+                      hintPtr                 - pointer to hint (may be NULL)
- Output:               record                  - pointer to BufferDescriptor containing record
-                       recordLen               - length of data at recordPtr
-@@ -678,14 +678,14 @@ OSStatus BTSearchRecord          (SFCB                                           *filePtr,
- //    LogStartTime(kTraceSearchBTree);
--      if (filePtr == nil)                                                                     return  paramErr;
--      if (searchIterator == nil)                                                      return  paramErr;
-+      if (filePtr == NULL)            return  paramErr;
-+      if (searchIterator == NULL)     return  paramErr;
-       btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
--      if (btreePtr == nil)                                                            return  fsBTInvalidFileErr;
-+      if (btreePtr == NULL)           return  fsBTInvalidFileErr;
- #if SupportsKeyDescriptors
--      if (btreePtr->keyCompareProc == nil)            // CheckKey if we using Key Descriptor
-+      if (btreePtr->keyCompareProc == NULL)           // CheckKey if we using Key Descriptor
-       {
-               err = CheckKey (&searchIterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength);
-               M_ExitOnError (err);
-@@ -775,9 +775,9 @@ OSStatus   BTSearchRecord          (SFCB                                           *filePtr,
-               //¥¥ Should check for errors! Or BlockMove could choke on recordPtr!!!
-               GetRecordByIndex (btreePtr, node.buffer, index, &keyPtr, &recordPtr, &len);
--              if (recordLen != nil)                   *recordLen = len;
-+              if (recordLen != NULL)  *recordLen = len;
--              if (record != nil)
-+              if (record != NULL)
-               {
-                       ByteCount recordSize;
-@@ -794,7 +794,7 @@ OSStatus   BTSearchRecord          (SFCB                                           *filePtr,
-       /////////////////////// Success - Update Iterator ///////////////////////////
--      if (resultIterator != nil)
-+      if (resultIterator != NULL)
-       {
-               resultIterator->hint.writeCount = btreePtr->writeCount;
-               resultIterator->hint.nodeNum    = nodeNum;
-@@ -825,10 +825,10 @@ OSStatus BTSearchRecord          (SFCB                                           *filePtr,
- ErrorExit:
--      if (recordLen != nil)
-+      if (recordLen != NULL)
-               *recordLen = 0;
--      if (resultIterator != nil)
-+      if (resultIterator != NULL)
-       {
-               resultIterator->hint.writeCount = 0;
-               resultIterator->hint.nodeNum    = 0;
-@@ -892,18 +892,18 @@ OSStatus BTIterateRecord         (SFCB                                           *filePtr,
-       ////////////////////////// Priliminary Checks ///////////////////////////////
--      left.buffer             = nil;
--      right.buffer    = nil;
--      node.buffer             = nil;
-+      left.buffer             = NULL;
-+      right.buffer    = NULL;
-+      node.buffer             = NULL;
--      if (filePtr == nil)
-+      if (filePtr == NULL)
-       {
-               return  paramErr;
-       }
-       btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
--      if (btreePtr == nil)
-+      if (btreePtr == NULL)
-       {
-               return  fsBTInvalidFileErr;                     //¥¥ handle properly
-       }
-@@ -968,7 +968,7 @@ OSStatus   BTIterateRecord         (SFCB                                           *filePtr,
-               }
-               else
-               {
--                      if (left.buffer == nil)
-+                      if (left.buffer == NULL)
-                       {
-                               nodeNum = ((NodeDescPtr) node.buffer)->bLink;
-                               if ( nodeNum > 0)
-@@ -981,13 +981,13 @@ OSStatus BTIterateRecord         (SFCB                                           *filePtr,
-                               }
-                       }
-                       //      Before we stomp on "right", we'd better release it if needed
--                      if (right.buffer != nil) {
-+                      if (right.buffer != NULL) {
-                               err = ReleaseNode(btreePtr, &right);
-                               M_ExitOnError(err);
-                       }
-                       right           = node;
-                       node            = left;
--                      left.buffer     = nil;
-+                      left.buffer     = NULL;
-                       index           = ((NodeDescPtr) node.buffer)->numRecords -1;
-               }
-       }
-@@ -1012,7 +1012,7 @@ OSStatus BTIterateRecord         (SFCB                                           *filePtr,
-               }
-               else
-               {
--                      if (right.buffer == nil)
-+                      if (right.buffer == NULL)
-                       {
-                               nodeNum = ((NodeDescPtr) node.buffer)->fLink;
-                               if ( nodeNum > 0)
-@@ -1025,13 +1025,13 @@ OSStatus       BTIterateRecord         (SFCB                                           *filePtr,
-                               }
-                       }
-                       //      Before we stomp on "left", we'd better release it if needed
--                      if (left.buffer != nil) {
-+                      if (left.buffer != NULL) {
-                               err = ReleaseNode(btreePtr, &left);
-                               M_ExitOnError(err);
-                       }
-                       left             = node;
-                       node             = right;
--                      right.buffer = nil;
-+                      right.buffer = NULL;
-                       index            = 0;
-               }
-       }
-@@ -1054,9 +1054,9 @@ CopyData:
-       err = GetRecordByIndex (btreePtr, node.buffer, index, &keyPtr, &recordPtr, &len);
-       M_ExitOnError (err);
--      if (recordLen != nil)                   *recordLen = len;
-+      if (recordLen != NULL)                  *recordLen = len;
--      if (record != nil)
-+      if (record != NULL)
-       {
-               ByteCount recordSize;
-@@ -1069,7 +1069,7 @@ CopyData:
-               CopyMemory (recordPtr, record->bufferAddress, len);
-       }
--      if (iterator != nil)                                            // first & last do not require iterator
-+      if (iterator != NULL)                                           // first & last do not require iterator
-       {
-               iterator->hint.writeCount       = btreePtr->writeCount;
-               iterator->hint.nodeNum          = nodeNum;
-@@ -1089,13 +1089,13 @@ CopyData:
-       err = ReleaseNode (btreePtr, &node);
-       M_ExitOnError (err);
--      if (left.buffer != nil)
-+      if (left.buffer != NULL)
-       {
-               err = ReleaseNode (btreePtr, &left);
-               M_ExitOnError (err);
-       }
--      if (right.buffer != nil)
-+      if (right.buffer != NULL)
-       {
-               err = ReleaseNode (btreePtr, &right);
-               M_ExitOnError (err);
-@@ -1113,10 +1113,10 @@ ErrorExit:
-       (void)  ReleaseNode (btreePtr, &node);
-       (void)  ReleaseNode (btreePtr, &right);
--      if (recordLen != nil)
-+      if (recordLen != NULL)
-               *recordLen = 0;
--      if (iterator != nil)
-+      if (iterator != NULL)
-       {
-               iterator->hint.writeCount       = 0;
-               iterator->hint.nodeNum          = 0;
-@@ -1157,7 +1157,7 @@ OSStatus BTInsertRecord          (SFCB                                           *filePtr,
-       ////////////////////////// Priliminary Checks ///////////////////////////////
--      nodeRec.buffer = nil;                                   // so we can call ReleaseNode
-+      nodeRec.buffer = NULL;                                  // so we can call ReleaseNode
-       err = CheckInsertParams (filePtr, iterator, record, recordLen);
-       if (err != noErr)
-@@ -1317,7 +1317,7 @@ OSStatus BTSetRecord                     (SFCB                                           *filePtr,
-       ////////////////////////// Priliminary Checks ///////////////////////////////
--      nodeRec.buffer = nil;                                   // so we can call ReleaseNode
-+      nodeRec.buffer = NULL;                                  // so we can call ReleaseNode
-       err = CheckInsertParams (filePtr, iterator, record, recordLen);
-       if (err != noErr)
-@@ -1506,7 +1506,7 @@ OSStatus BTReplaceRecord         (SFCB                                           *filePtr,
-       ////////////////////////// Priliminary Checks ///////////////////////////////
--      nodeRec.buffer = nil;                                   // so we can call ReleaseNode
-+      nodeRec.buffer = NULL;                                  // so we can call ReleaseNode
-       err = CheckInsertParams (filePtr, iterator, record, recordLen);
-       if (err != noErr)
-@@ -1645,20 +1645,20 @@ OSStatus       BTDeleteRecord          (SFCB                                           *filePtr,
-       ////////////////////////// Priliminary Checks ///////////////////////////////
--      nodeRec.buffer = nil;                                   // so we can call ReleaseNode
-+      nodeRec.buffer = NULL;                                  // so we can call ReleaseNode
--      M_ReturnErrorIf (filePtr == nil,        paramErr);
--      M_ReturnErrorIf (iterator == nil,       paramErr);
-+      M_ReturnErrorIf (filePtr == NULL,       paramErr);
-+      M_ReturnErrorIf (iterator == NULL,      paramErr);
-       btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
--      if (btreePtr == nil)
-+      if (btreePtr == NULL)
-       {
-               err = fsBTInvalidFileErr;
-               goto ErrorExit;
-       }
- #if SupportsKeyDescriptors
--      if (btreePtr->keyDescPtr != nil)
-+      if (btreePtr->keyDescPtr != NULL)
-       {
-               err = CheckKey (&iterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength);
-               M_ExitOnError (err);
-@@ -1712,12 +1712,12 @@ OSStatus       BTGetInformation        (SFCB                                   *filePtr,
-       BTreeControlBlockPtr    btreePtr;
--      M_ReturnErrorIf (filePtr == nil,        paramErr);
-+      M_ReturnErrorIf (filePtr == NULL,       paramErr);
-       btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
--      M_ReturnErrorIf (btreePtr == nil,       fsBTInvalidFileErr);
--      M_ReturnErrorIf (info == nil,           paramErr);
-+      M_ReturnErrorIf (btreePtr == NULL,      fsBTInvalidFileErr);
-+      M_ReturnErrorIf (info == NULL,          paramErr);
-       //¥¥ check version?
-@@ -1730,7 +1730,7 @@ OSStatus BTGetInformation        (SFCB                                   *filePtr,
-       info->keyDescriptor     = btreePtr->keyDescPtr; //¥¥ this won't do at all...
-       info->reserved          = 0;
--      if (btreePtr->keyDescPtr == nil)
-+      if (btreePtr->keyDescPtr == NULL)
-               info->keyDescLength     = 0;
-       else
-               info->keyDescLength     = (UInt32) btreePtr->keyDescPtr->length;
-@@ -1762,11 +1762,11 @@ OSStatus       BTFlushPath                             (SFCB                                   *filePtr)
- //    LogStartTime(kTraceFlushBTree);
--      M_ReturnErrorIf (filePtr == nil,        paramErr);
-+      M_ReturnErrorIf (filePtr == NULL,       paramErr);
-       btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
--      M_ReturnErrorIf (btreePtr == nil,       fsBTInvalidFileErr);
-+      M_ReturnErrorIf (btreePtr == NULL,      fsBTInvalidFileErr);
-       err = UpdateHeader (btreePtr);
-@@ -1788,13 +1788,13 @@ Input:         iterator        - pointer to BTreeIterator
- Output:               iterator        - iterator with the hint.nodeNum cleared
- Result:               noErr                   - success
--                      paramErr        - iterator == nil
-+                      paramErr        - iterator == NULL
- -------------------------------------------------------------------------------*/
- OSStatus      BTInvalidateHint        (BTreeIterator                          *iterator )
- {
--      if (iterator == nil)
-+      if (iterator == NULL)
-               return  paramErr;
-       iterator->hint.nodeNum = 0;
-diff --git a/fsck_hfs.tproj/dfalib/BTreeAllocate.c b/fsck_hfs.tproj/dfalib/BTreeAllocate.c
-index 485d867..02bdd8d 100644
---- a/fsck_hfs.tproj/dfalib/BTreeAllocate.c
-+++ b/fsck_hfs.tproj/dfalib/BTreeAllocate.c
-@@ -83,7 +83,7 @@ OSStatus     AllocateNode (BTreeControlBlockPtr              btreePtr, UInt32        *nodeNum)
-       
-       
-       nodeNumber              = 0;                            // first node number of header map record
--      node.buffer             = nil;                          // clear node.buffer to get header node
-+      node.buffer             = NULL;                         // clear node.buffer to get header node
-                                                                               //      - and for ErrorExit
-       
-       while (true)
-@@ -192,7 +192,7 @@ OSStatus   FreeNode (BTreeControlBlockPtr          btreePtr, UInt32        nodeNum)
-       //////////////////////////// Find Map Record ////////////////////////////////
-       nodeIndex                       = 0;                            // first node number of header map record
--      node.buffer                     = nil;                          // invalidate node.buffer to get header node
-+      node.buffer                     = NULL;                         // invalidate node.buffer to get header node
-       
-       while (nodeNum >= nodeIndex)
-       {
-@@ -278,8 +278,8 @@ OSStatus   ExtendBTree     (BTreeControlBlockPtr   btreePtr,
-       nodeSize                        = btreePtr->nodeSize;
-       filePtr                         = btreePtr->fcbPtr;
-       
--      mapNode.buffer          = nil;
--      newNode.buffer          = nil;
-+      mapNode.buffer          = NULL;
-+      newNode.buffer          = NULL;
-       mapNodeRecSize  = nodeSize - sizeof(BTNodeDescriptor) - 6;      // 2 bytes of free space (see note)
-@@ -448,7 +448,7 @@ ErrorExit:
- Routine:      GetMapNode      -       Get the next map node and pointer to the map record.
- Function:     Given a BlockDescriptor to a map node in nodePtr, GetMapNode releases
--                      it and gets the next node. If nodePtr->buffer is nil, then the header
-+                      it and gets the next node. If nodePtr->buffer is NULL, then the header
-                       node is retrieved.
-@@ -474,7 +474,7 @@ OSStatus   GetMapNode (BTreeControlBlockPtr          btreePtr,
-       UInt16          mapIndex;
-       UInt32          nextNodeNum;
-       
--      if (nodePtr->buffer != nil)             // if iterator is valid...
-+      if (nodePtr->buffer != NULL)            // if iterator is valid...
-       {
-               nextNodeNum = ((NodeDescPtr)nodePtr->buffer)->fLink;
-               if (nextNodeNum == 0)
-@@ -521,7 +521,7 @@ ErrorExit:
-       
-       (void) ReleaseNode (btreePtr, nodePtr);
-       
--      *mapPtr         = nil;
-+      *mapPtr         = NULL;
-       *mapSize        = 0;
-       
-       return  err;
-diff --git a/fsck_hfs.tproj/dfalib/BTreeMiscOps.c b/fsck_hfs.tproj/dfalib/BTreeMiscOps.c
-index 7c9edca..997f34b 100644
---- a/fsck_hfs.tproj/dfalib/BTreeMiscOps.c
-+++ b/fsck_hfs.tproj/dfalib/BTreeMiscOps.c
-@@ -236,13 +236,13 @@ OSStatus FindIteratorPosition    (BTreeControlBlockPtr    btreePtr,
-       // assume index points to UInt16
-       // assume foundRecord points to Boolean
-       
--      left->buffer            = nil;
--      middle->buffer          = nil;
--      right->buffer           = nil;
-+      left->buffer            = NULL;
-+      middle->buffer          = NULL;
-+      right->buffer           = NULL;
-       
-       foundIt                         = false;
-       
--      if (iterator == nil)                                            // do we have an iterator?
-+      if (iterator == NULL)                                           // do we have an iterator?
-       {
-               err = fsBTInvalidIteratorErr;
-               goto ErrorExit;
-@@ -250,7 +250,7 @@ OSStatus   FindIteratorPosition    (BTreeControlBlockPtr    btreePtr,
- #if SupportsKeyDescriptors
-       //¥¥ verify iterator key (change CheckKey to take btreePtr instead of keyDescPtr?)
--      if (btreePtr->keyDescPtr != nil)
-+      if (btreePtr->keyDescPtr != NULL)
-       {
-               err = CheckKey (&iterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength );
-               M_ExitOnError (err);
-@@ -309,7 +309,7 @@ OSStatus   FindIteratorPosition    (BTreeControlBlockPtr    btreePtr,
-               {
-                       *right                  = *middle;
-                       *middle                 = *left;
--                      left->buffer    = nil;
-+                      left->buffer    = NULL;
-                       index                   = leftIndex;
-                       
-                       goto SuccessfulExit;
-@@ -330,7 +330,7 @@ OSStatus   FindIteratorPosition    (BTreeControlBlockPtr    btreePtr,
-               {
-                       *right                  = *middle;
-                       *middle                 = *left;
--                      left->buffer    = nil;
-+                      left->buffer    = NULL;
-                       index                   = leftIndex;
-                       
-                       goto SuccessfulExit;
-@@ -363,7 +363,7 @@ OSStatus   FindIteratorPosition    (BTreeControlBlockPtr    btreePtr,
-               {
-                       *left                   = *middle;
-                       *middle                 = *right;
--                      right->buffer   = nil;
-+                      right->buffer   = NULL;
-                       index                   = rightIndex;
-                       
-                       goto SuccessfulExit;
-@@ -427,15 +427,15 @@ OSStatus CheckInsertParams               (SFCB                                           *filePtr,
- {
-       BTreeControlBlockPtr    btreePtr;
-       
--      if (filePtr == nil)                                                                     return  paramErr;
-+      if (filePtr == NULL)                                                                    return  paramErr;
-       btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree;
--      if (btreePtr == nil)                                                            return  fsBTInvalidFileErr;
--      if (iterator == nil)                                                            return  paramErr;
--      if (record       == nil)                                                                return  paramErr;
-+      if (btreePtr == NULL)                                                           return  fsBTInvalidFileErr;
-+      if (iterator == NULL)                                                           return  paramErr;
-+      if (record       == NULL)                                                               return  paramErr;
-       
- #if SupportsKeyDescriptors
--      if (btreePtr->keyDescPtr != nil)
-+      if (btreePtr->keyDescPtr != NULL)
-       {
-               OSStatus        err;
-diff --git a/fsck_hfs.tproj/dfalib/BTreeNodeOps.c b/fsck_hfs.tproj/dfalib/BTreeNodeOps.c
-index da07cc7..ef2bd7b 100644
---- a/fsck_hfs.tproj/dfalib/BTreeNodeOps.c
-+++ b/fsck_hfs.tproj/dfalib/BTreeNodeOps.c
-@@ -105,7 +105,7 @@ Function:  Gets an existing BTree node from FS Agent and verifies it.
- Input:                btreePtr        - pointer to BTree control block
-                       nodeNum         - number of node to request
-                       
--Output:               nodePtr         - pointer to beginning of node (nil if error)
-+Output:               nodePtr         - pointer to beginning of node (NULL if error)
-                       
- Result:
-                       noErr           - success
-@@ -139,7 +139,7 @@ OSStatus   GetNode         (BTreeControlBlockPtr    btreePtr,
-       if (err != noErr)
-       {
-               Panic ("\pGetNode: getNodeProc returned error.");
--              nodePtr->buffer = nil;
-+              nodePtr->buffer = NULL;
-               goto ErrorExit;
-       }
-       ++btreePtr->numGetNodes;
-@@ -156,8 +156,8 @@ OSStatus   GetNode         (BTreeControlBlockPtr    btreePtr,
-       return noErr;
- ErrorExit:
--      nodePtr->buffer                 = nil;
--      nodePtr->blockHeader    = nil;
-+      nodePtr->buffer         = NULL;
-+      nodePtr->blockHeader    = NULL;
-       
- //    LogEndTime(kTraceGetNode, err);
-@@ -176,7 +176,7 @@ Function:  Gets a new BTree node from FS Agent and initializes it to an empty
- Input:                btreePtr                - pointer to BTree control block
-                       nodeNum                 - number of node to request
-                       
--Output:               returnNodePtr   - pointer to beginning of node (nil if error)
-+Output:               returnNodePtr   - pointer to beginning of node (NULL if error)
-                       
- Result:               noErr           - success
-                       != noErr        - failure
-@@ -203,7 +203,7 @@ OSStatus   GetNewNode      (BTreeControlBlockPtr    btreePtr,
-       if (err != noErr)
-       {
-               Panic ("\pGetNewNode: getNodeProc returned error.");
--              returnNodePtr->buffer = nil;
-+              returnNodePtr->buffer = NULL;
-               return err;
-       }
-       ++btreePtr->numGetNewNodes;
-@@ -248,7 +248,7 @@ OSStatus   ReleaseNode     (BTreeControlBlockPtr    btreePtr,
-       err = noErr;
-       
--      if (nodePtr->buffer != nil)
-+      if (nodePtr->buffer != NULL)
-       {
-               /*
-                * The nodes must remain in the cache as big endian!
-@@ -267,8 +267,8 @@ OSStatus   ReleaseNode     (BTreeControlBlockPtr    btreePtr,
-               ++btreePtr->numReleaseNodes;
-       }
-       
--      nodePtr->buffer = nil;
--      nodePtr->blockHeader = nil;
-+      nodePtr->buffer = NULL;
-+      nodePtr->blockHeader = NULL;
-       
- //    LogEndTime(kTraceReleaseNode, err);
-@@ -299,7 +299,7 @@ OSStatus   TrashNode       (BTreeControlBlockPtr    btreePtr,
-       err = noErr;
-       
--      if (nodePtr->buffer != nil)
-+      if (nodePtr->buffer != NULL)
-       {
-               releaseNodeProc = btreePtr->releaseBlockProc;
-               err = releaseNodeProc (btreePtr->fcbPtr,
-@@ -309,8 +309,8 @@ OSStatus   TrashNode       (BTreeControlBlockPtr    btreePtr,
-               ++btreePtr->numReleaseNodes;
-       }
--      nodePtr->buffer                 = nil;
--      nodePtr->blockHeader    = nil;
-+      nodePtr->buffer         = NULL;
-+      nodePtr->blockHeader    = NULL;
-       
-       return err;
- }
-@@ -338,7 +338,7 @@ OSStatus   UpdateNode      (BTreeControlBlockPtr    btreePtr,
-       
-       err = noErr;
-               
--      if (nodePtr->buffer != nil)                     //¥¥ why call UpdateNode if nil ?!?
-+      if (nodePtr->buffer != NULL)                    //¥¥ why call UpdateNode if NULL ?!?
-       {
-       //      LogStartTime(kTraceReleaseNode);
-               err = hfs_swap_BTNode(nodePtr, btreePtr->fcbPtr, kSwapBTNodeHostToBig);
-@@ -358,8 +358,8 @@ OSStatus   UpdateNode      (BTreeControlBlockPtr    btreePtr,
-               ++btreePtr->numUpdateNodes;
-       }
-       
--      nodePtr->buffer                 = nil;
--      nodePtr->blockHeader    = nil;
-+      nodePtr->buffer         = NULL;
-+      nodePtr->blockHeader    = NULL;
-       return  noErr;
-diff --git a/fsck_hfs.tproj/dfalib/BTreeTreeOps.c b/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
-index 37fb170..73e1fda 100644
---- a/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
-+++ b/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
-@@ -177,7 +177,7 @@ Output:            nodeNum                 - number of the node containing the key position
-                       
- Result:               noErr                   - key found, index is record index
-                       fsBTRecordNotFoundErr   - key not found, index is insert index
--                      fsBTEmptyErr            - key not found, return params are nil
-+                      fsBTEmptyErr            - key not found, return params are NULL
-                       otherwise                       - catastrophic failure (GetNode/ReleaseNode failed)
- -------------------------------------------------------------------------------*/
-@@ -321,8 +321,8 @@ ReleaseAndExit:
- ErrorExit:
-       
-       *nodeNum                                        = 0;
--      nodePtr->buffer                         = nil;
--      nodePtr->blockHeader            = nil;
-+      nodePtr->buffer                         = NULL;
-+      nodePtr->blockHeader            = NULL;
-       *returnIndex                            = 0;
-       return  err;
-@@ -354,7 +354,7 @@ OSStatus   InsertTree ( BTreeControlBlockPtr                btreePtr,
-       primaryKey.replacingKey = replacingKey;
-       primaryKey.skipRotate   = false;
--      err     = InsertLevel (btreePtr, treePathTable, &primaryKey, nil,
-+      err     = InsertLevel (btreePtr, treePathTable, &primaryKey, NULL,
-                                          targetNode, index, level, insertNode );
-                                               
-       return err;
-@@ -385,7 +385,7 @@ OSStatus   InsertLevel (BTreeControlBlockPtr                btreePtr,
- #if defined(applec) && !defined(__SC__)
-       PanicIf ((level == 1) && (((NodeDescPtr)targetNode->buffer)->kind != kBTLeafNode), "\P InsertLevel: non-leaf at level 1! ");
- #endif
--      siblingNode.buffer = nil;
-+      siblingNode.buffer = NULL;
-       targetNodeNum = treePathTable [level].node;
-       insertParent = false;
-@@ -420,7 +420,7 @@ OSStatus   InsertLevel (BTreeControlBlockPtr                btreePtr,
-       
-       ////// process second insert (if any) //////
--      if  ( secondaryKey != nil )
-+      if (secondaryKey != NULL)
-       {
-               Boolean                         temp;
-@@ -446,7 +446,7 @@ OSStatus   InsertLevel (BTreeControlBlockPtr                btreePtr,
-               UInt8 *                         recPtr;
-               UInt16                          recSize;
-               
--              secondaryKey = nil;
-+              secondaryKey = NULL;
-               
-               PanicIf ( (level == btreePtr->treeDepth), "InsertLevel: unfinished insert!?");
-@@ -606,9 +606,9 @@ static OSErr       InsertNode      (BTreeControlBlockPtr    btreePtr,
-       
-       if ( leftNodeNum > 0 )
-       {
--              PanicIf ( siblingNode->buffer != nil, "InsertNode: siblingNode already aquired!");
-+              PanicIf(siblingNode->buffer != NULL, "InsertNode: siblingNode already aquired!");
--              if ( siblingNode->buffer == nil )
-+              if (siblingNode->buffer == NULL)
-               {
-                       err = GetNode (btreePtr, leftNodeNum, siblingNode);     // will be released by caller or a split below
-                       M_ExitOnError (err);
-@@ -703,7 +703,7 @@ OSStatus   DeleteTree                      (BTreeControlBlockPtr            btreePtr,
-       targetNodeNum = treePathTable[level].node;
-       targetNodePtr = targetNode->buffer;
--      PanicIf (targetNodePtr == nil, "DeleteTree: targetNode has nil buffer!");
-+      PanicIf (targetNodePtr == NULL, "DeleteTree: targetNode has NULL buffer!");
-       DeleteRecord (btreePtr, targetNodePtr, index);
-               
-@@ -766,7 +766,7 @@ OSStatus   DeleteTree                      (BTreeControlBlockPtr            btreePtr,
-               deleteRequired = false;
-               updateRequired = false;
-               
--              if ( targetNode->buffer == nil )        // then root was freed and the btree is empty
-+              if (targetNode->buffer == NULL) // then root was freed and the btree is empty
-               {
-                       btreePtr->rootNode  = 0;
-                       btreePtr->treeDepth = 0;
-@@ -1124,7 +1124,7 @@ static OSStatus  SplitLeft               (BTreeControlBlockPtr            btreePtr,
-       if ( (right->height == 1) && (right->kind != kBTLeafNode) )
-               return  fsBTInvalidNodeErr;
-       
--      if ( left != nil )
-+      if (left != NULL)
-       {
-               if ( left->fLink != rightNodeNum )
-                       return fsBTInvalidNodeErr;                                                                              //¥¥ E_BadSibling ?
-@@ -1145,7 +1145,7 @@ static OSStatus  SplitLeft               (BTreeControlBlockPtr            btreePtr,
-       /////////////// Update Forward Link In Original Left Node ///////////////////
--      if ( left != nil )
-+      if (left != NULL)
-       {
-               left->fLink     = newNodeNum;
-               err = UpdateNode (btreePtr, leftNode);
-@@ -1240,8 +1240,8 @@ static OSStatus  AddNewRootNode  (BTreeControlBlockPtr    btreePtr,
-       Boolean                         didItFit;
-       UInt16                          keyLength;      
-       
--      PanicIf (leftNode == nil, "AddNewRootNode: leftNode == nil");
--      PanicIf (rightNode == nil, "AddNewRootNode: rightNode == nil");
-+      PanicIf (leftNode == NULL, "AddNewRootNode: leftNode == NULL");
-+      PanicIf (rightNode == NULL, "AddNewRootNode: rightNode == NULL");
-       
-       
-       /////////////////////// Initialize New Root Node ////////////////////////////
-@@ -1362,7 +1362,7 @@ static OSStatus  SplitRight              (BTreeControlBlockPtr            btreePtr,
-       if ( (leftPtr->height == 1) && (leftPtr->kind != kBTLeafNode) )
-               return  fsBTInvalidNodeErr;
-       
--      if ( rightPtr != nil )
-+      if (rightPtr != NULL)
-       {
-               if ( rightPtr->bLink != nodeNum )
-                       return fsBTInvalidNodeErr;                                                                              //¥¥ E_BadSibling ?
-@@ -1382,7 +1382,7 @@ static OSStatus  SplitRight              (BTreeControlBlockPtr            btreePtr,
-       /////////////// Update backward Link In Original Right Node ///////////////////
--      if ( rightPtr != nil )
-+      if (rightPtr != NULL)
-       {
-               rightPtr->bLink = newNodeNum;
-               err = UpdateNode (btreePtr, rightNodePtr);
-@@ -1739,7 +1739,7 @@ static int DoKeyCheck( NodeDescPtr nodeP, BTreeControlBlock *btcb )
-       UInt16                          keyLength;
-       KeyPtr                          keyPtr;
-       UInt8                           *dataPtr;
--      KeyPtr                          prevkeyP        = nil;
-+      KeyPtr                          prevkeyP        = NULL;
-       if ( nodeP->numRecords == 0 )
-@@ -1766,7 +1766,7 @@ static int DoKeyCheck( NodeDescPtr nodeP, BTreeControlBlock *btcb )
-                               return( -1 );
-                       }
-       
--                      if ( prevkeyP != nil )
-+                      if (prevkeyP != NULL)
-                       {
-                               if ( CompareKeys( (BTreeControlBlockPtr)btcb, prevkeyP, keyPtr ) >= 0 )
-                               {
-diff --git a/fsck_hfs.tproj/dfalib/SControl.c b/fsck_hfs.tproj/dfalib/SControl.c
-index 8b03ece..d3145e0 100644
---- a/fsck_hfs.tproj/dfalib/SControl.c
-+++ b/fsck_hfs.tproj/dfalib/SControl.c
-@@ -82,7 +82,7 @@ CheckHFS(    int fsReadRef, int fsWriteRef, int checkLevel, int repairLevel,
- {
-       SGlob                           dataArea;       // Allocate the scav globals
-       short                           temp;   
--      FileIdentifierTable     *fileIdentifierTable    = nil;
-+      FileIdentifierTable     *fileIdentifierTable    = NULL;
-       OSErr                           err = noErr;
-       OSErr                           scavError = 0;
-       int                                     scanCount = 0;
-@@ -228,7 +228,7 @@ DoAgain:
-       }
-       //      Set up structures for post processing
--      if ( (autoRepair == true) && (dataArea.fileIdentifierTable != nil) )
-+      if ((autoRepair == true) && (dataArea.fileIdentifierTable != NULL))
-       {
-       //      *repairInfo = *repairInfo | kVolumeHadOverlappingExtents;       //      Report back that volume has overlapping extents
-               fileIdentifierTable     = (FileIdentifierTable *) AllocateMemory( GetHandleSize( (Handle) dataArea.fileIdentifierTable ) );
-@@ -239,7 +239,7 @@ DoAgain:
-       //
-       //      Post processing
-       //
--      if ( fileIdentifierTable != nil )
-+      if (fileIdentifierTable != NULL)
-       {
-               DisposeMemory( fileIdentifierTable );
-       }
-@@ -682,7 +682,7 @@ short CheckForStop( SGlob *GPtr )
-       //if ( ((ticks - 10) > GPtr->lastTickCount) || (dfaStage == kAboutToRepairStage) )                      //      To reduce cursor flicker on fast machines, call through on a timed interval
-       //{
--              if ( GPtr->userCancelProc != nil )
-+              if (GPtr->userCancelProc != NULL)
-               {
-                       UInt64  progress = 0;
-                       Boolean progressChanged;
-@@ -761,7 +761,7 @@ static int ScavSetUp( SGlob *GPtr)
-       short   ioRefNum;
- #endif
--      GPtr->MinorRepairsP = nil;
-+      GPtr->MinorRepairsP = NULL;
-       
-       GPtr->itemsProcessed = 0;
-       GPtr->lastProgress = 0;
-@@ -774,7 +774,7 @@ static int ScavSetUp( SGlob *GPtr)
-               ScavStaticStructures    *pointer;
-               
-               pointer = (ScavStaticStructures *) AllocateClearMemory( sizeof(ScavStaticStructures) );
--              if ( pointer == nil ) {
-+              if (pointer == NULL) {
-                       if ( GPtr->logLevel >= kDebugLog ) {
-                               printf( "\t error %d - could not allocate %i bytes of memory \n",
-                                       R_NoMem, sizeof(ScavStaticStructures) );
-@@ -831,7 +831,7 @@ static int ScavSetUp( SGlob *GPtr)
-       //      Save current value of vcbWrCnt, to detect modifications to volume by other apps etc
-       if ( GPtr->volumeFeatures & volumeIsMountedMask )
-       {
--              FlushVol( nil, GPtr->realVCB->vcbVRefNum );     //      Ask HFS to update all changes to disk
-+              FlushVol(NULL, GPtr->realVCB->vcbVRefNum);      //      Ask HFS to update all changes to disk
-               GPtr->wrCnt = GPtr->realVCB->vcbWrCnt;          //      Remember write count after writing changes
-       }
- #endif
-@@ -949,7 +949,7 @@ static int ScavSetUp( SGlob *GPtr)
-       
-       // Keep a valid file id list for HFS volumes
-       GPtr->validFilesList = (UInt32**)NewHandle( 0 );
--      if ( GPtr->validFilesList == nil ) {
-+      if (GPtr->validFilesList == NULL) {
-               if ( GPtr->logLevel >= kDebugLog ) {
-                       printf( "\t error %d - could not allocate file ID list \n", R_NoMem );
-               }
-@@ -995,17 +995,17 @@ static int ScavTerm( SGlobPtr GPtr )
-       (void) BitMapCheckEnd();
--      while( (rP = GPtr->MinorRepairsP) != nil )              //      loop freeing leftover (undone) repair orders
-+      while((rP = GPtr->MinorRepairsP) != NULL)               //      loop freeing leftover (undone) repair orders
-       {
-               GPtr->MinorRepairsP = rP->link;                         //      (in case repairs were not made)
-               DisposeMemory(rP);
-               err = MemError();
-       }
-       
--      if( GPtr->validFilesList != nil )
-+      if (GPtr->validFilesList != NULL)
-               DisposeHandle( (Handle) GPtr->validFilesList );
-       
--      if( GPtr->overlappedExtents != nil ) {
-+      if (GPtr->overlappedExtents != NULL) {
-               extentsTableH = GPtr->overlappedExtents;
-       
-               /* Overlapped extents list also allocated memory for attribute name */
-@@ -1021,44 +1021,44 @@ static int ScavTerm( SGlobPtr GPtr )
-               DisposeHandle( (Handle) GPtr->overlappedExtents );
-       }
-       
--      if( GPtr->fileIdentifierTable != nil )
-+      if (GPtr->fileIdentifierTable != NULL)
-               DisposeHandle( (Handle) GPtr->fileIdentifierTable );
-       
--      if( GPtr->calculatedVCB == nil )                                                                //      already freed?
-+      if (GPtr->calculatedVCB == NULL)                                                                //      already freed?
-               return( noErr );
-       //      If the FCB's and BTCB's have been set up, dispose of them
-       fcbP = GPtr->calculatedExtentsFCB;      // release extent file BTree bit map
--      if ( fcbP != nil )
-+      if (fcbP != NULL)
-       {
-               btcbP = (BTreeControlBlock*)fcbP->fcbBtree;
--              if ( btcbP != nil)
-+              if (btcbP != NULL)
-               {
--                      if( btcbP->refCon != nil )
-+                      if (btcbP->refCon != NULL)
-                       {
--                              if(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != nil)
-+                              if (((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != NULL)
-                               {
-                                       DisposeMemory(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr);
-                                       err = MemError();
-                               }
-                               DisposeMemory( (Ptr)btcbP->refCon );
-                               err = MemError();
--                              btcbP->refCon = nil;
-+                              btcbP->refCon = NULL;
-                       }
-                               
-                       fcbP = GPtr->calculatedCatalogFCB;      //      release catalog BTree bit map
-                       btcbP = (BTreeControlBlock*)fcbP->fcbBtree;
-                               
--                      if( btcbP->refCon != nil )
-+                      if (btcbP->refCon != NULL)
-                       {
--                              if(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != nil)
-+                              if (((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr != NULL)
-                               {
-                                       DisposeMemory(((BTreeExtensionsRec*)btcbP->refCon)->BTCBMPtr);
-                                       err = MemError();
-                               }
-                               DisposeMemory( (Ptr)btcbP->refCon );
-                               err = MemError();
--                              btcbP->refCon = nil;
-+                              btcbP->refCon = NULL;
-                       }
-               }
-       }
-@@ -1066,7 +1066,7 @@ static int ScavTerm( SGlobPtr GPtr )
-       DisposeMemory( GPtr->calculatedVCB );                                           //      Release our block of data structures    
-       err = MemError();
--      GPtr->calculatedVCB = nil;
-+      GPtr->calculatedVCB = NULL;
-       return( noErr );
- }
-@@ -1113,7 +1113,7 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr dqPtr )
-       // Now look at the name of the Driver name. If it is .BlueBoxShared keep it out of the list of available disks.
-       driverDCtlHandle = GetDCtlEntry(dqPtr->dQRefNum);
-       driverDCtlPtr = *driverDCtlHandle;
--      if((((driverDCtlPtr->dCtlFlags) & Is_Native_Mask) == 0) && (driverDCtlPtr->dCtlDriver != nil))
-+      if((((driverDCtlPtr->dCtlFlags) & Is_Native_Mask) == 0) && (driverDCtlPtr->dCtlDriver != NULL))
-       {
-               if (((driverDCtlPtr->dCtlFlags) & Is_Ram_Based_Mask) == 0)
-               {
-@@ -1127,19 +1127,19 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr dqPtr )
-                       
-               }
-               driverName = (StringPtr)&(drvrHeaderPtr->drvrName);
--              if (!(IdenticalString(driverName,blueBoxSharedDriverName,nil)))
-+              if (!(IdenticalString(driverName,blueBoxSharedDriverName,NULL)))
-               {
-                       return( true );
-               }
-               // Special case for the ".Sony" floppy driver which might be accessed in Shared mode inside the Blue Box
-               // Test its "where" string instead of the driver name.
--              if (!(IdenticalString(driverName,sonyDriverName,nil)))
-+              if (!(IdenticalString(driverName,sonyDriverName,NULL)))
-               {
-                       CntrlParam                      paramBlock;
-               
--                      paramBlock.ioCompletion = nil;
--                      paramBlock.ioNamePtr    = nil;
-+                      paramBlock.ioCompletion = NULL;
-+                      paramBlock.ioNamePtr    = NULL;
-                       paramBlock.ioVRefNum    = dqPtr->dQDrive;
-                       paramBlock.ioCRefNum    = dqPtr->dQRefNum;
-                       paramBlock.csCode               = kDriveIcon;                                           // return physical icon
-@@ -1152,7 +1152,7 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr dqPtr )
-                               
-                               iconAndStringRecPtr = * (IconAndStringRecPtr*) & paramBlock.csParam;
-                               whereStringPtr = (StringPtr) & iconAndStringRecPtr->string;
--                              if (!(IdenticalString(whereStringPtr,blueBoxFloppyWhereString,nil)))
-+                              if (!(IdenticalString(whereStringPtr,blueBoxFloppyWhereString,NULL)))
-                               {
-                                       return( true );
-                               }
-diff --git a/fsck_hfs.tproj/dfalib/SRepair.c b/fsck_hfs.tproj/dfalib/SRepair.c
-index 89c12d6..b261c37 100644
---- a/fsck_hfs.tproj/dfalib/SRepair.c
-+++ b/fsck_hfs.tproj/dfalib/SRepair.c
-@@ -844,7 +844,7 @@ static     int     DelFThd( SGlobPtr GPtr, UInt32 fid )                            //      the file ID
-       isHFSPlus = VolumeObjectIsHFSPlus( );
-       
--      BuildCatalogKey( fid, (const CatalogName*) nil, isHFSPlus, &key );
-+      BuildCatalogKey(fid, NULL, isHFSPlus, &key);
-       result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &record, &recSize, &hint );
-       
-       if ( result )   return ( IntError( GPtr, result ) );
-@@ -910,7 +910,7 @@ static     OSErr   FixDirThread( SGlobPtr GPtr, UInt32 did )       //      the dir ID
-       isHFSPlus = VolumeObjectIsHFSPlus( );
--      BuildCatalogKey( did, (const CatalogName*) nil, isHFSPlus, &key );
-+      BuildCatalogKey(did, NULL, isHFSPlus, &key);
-       result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &record, &recSize, &hint );
-       
-       if ( result )
-@@ -2171,7 +2171,7 @@ static   OSErr   FixOrphanedFiles ( SGlobPtr GPtr )
-                               }
-                               //-- Build the key for the file thread
--                              BuildCatalogKey( cNodeID, nil, isHFSPlus, &key );
-+                              BuildCatalogKey(cNodeID, NULL, isHFSPlus, &key);
-                               err = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, 
-                                                                                &tempKey, &threadRecord, &recordSize, &hint2 );
-diff --git a/fsck_hfs.tproj/dfalib/SUtils.c b/fsck_hfs.tproj/dfalib/SUtils.c
-index 6e9253e..491afbf 100644
---- a/fsck_hfs.tproj/dfalib/SUtils.c
-+++ b/fsck_hfs.tproj/dfalib/SUtils.c
-@@ -395,11 +395,11 @@ OSErr GetVolumeFeatures( SGlobPtr GPtr )
-       err = GetVCBDriveNum( &GPtr->realVCB, GPtr->DrvNum );
-       ReturnIfError( err );
--      if ( GPtr->realVCB != nil )
-+      if (GPtr->realVCB != NULL)
-       {
-               GPtr->volumeFeatures    |= volumeIsMountedMask;
--              pb.ioParam.ioNamePtr    = nil;
-+              pb.ioParam.ioNamePtr    = NULL;
-               pb.ioParam.ioVRefNum    = GPtr->realVCB->vcbVRefNum;
-               pb.ioParam.ioBuffer             = (Ptr) &buffer;
-               pb.ioParam.ioReqCount   = sizeof( buffer );
-@@ -2282,7 +2282,7 @@ void print_prime_buckets(PrimeBuckets *cur);
-  *                    4. btreetye - can be kHFSPlusCatalogRecord or kHFSPlusAttributeRecord
-  *                            indicates which btree prime number bucket should be incremented
-  *
-- * Output:    nil
-+ * Output:    NULL
-  */
- void RecordXAttrBits(SGlobPtr GPtr, UInt16 flags, HFSCatalogNodeID fileid, UInt16 btreetype) 
- {
-diff --git a/fsck_hfs.tproj/dfalib/SVerify1.c b/fsck_hfs.tproj/dfalib/SVerify1.c
-index 39bda5c..c33155f 100644
---- a/fsck_hfs.tproj/dfalib/SVerify1.c
-+++ b/fsck_hfs.tproj/dfalib/SVerify1.c
-@@ -790,13 +790,13 @@ OSErr    CreateExtentsBTreeControlBlock( SGlobPtr GPtr )
-       //      set up our DFA extended BTCB area.  Will we have enough memory on all HFS+ volumes.
-       //
-       btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) );                       // allocate space for our BTCB extensions
--      if ( btcb->refCon == nil ) {
-+      if (btcb->refCon == NULL) {
-               err = R_NoMem;
-               goto exit;
-       }
-       size = (btcb->totalNodes + 7) / 8;                                                                                      //      size of BTree bit map
-       ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr = AllocateClearMemory(size);                      //      get precleared bitmap
--      if ( ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == nil )
-+      if (((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == NULL)
-       {
-               err = R_NoMem;
-               goto exit;
-@@ -1145,13 +1145,13 @@ OSErr  CreateCatalogBTreeControlBlock( SGlobPtr GPtr )
-       //
-       btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) );                       // allocate space for our BTCB extensions
--      if ( btcb->refCon == nil ) {
-+      if (btcb->refCon == NULL) {
-               err = R_NoMem;
-               goto exit;
-       }
-       size = (btcb->totalNodes + 7) / 8;                                                                                      //      size of BTree bit map
-       ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr = AllocateClearMemory(size);                      //      get precleared bitmap
--      if ( ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == nil )
-+      if (((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == NULL)
-       {
-               err = R_NoMem;
-               goto exit;
-@@ -1339,7 +1339,7 @@ OSErr CatHChk( SGlobPtr GPtr )
-       
-       //¥¥ Can we ignore this part by just taking advantage of setting the selCode = 0x8001;
-       { 
--              BuildCatalogKey( 1, (const CatalogName *)nil, isHFSPlus, &key );
-+              BuildCatalogKey(1, NULL, isHFSPlus, &key);
-               result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &threadRecord, &recSize, &hint );
-       
-               GPtr->TarBlock = hint;                                                                  /* set target block */
-@@ -1443,7 +1443,7 @@ OSErr CatHChk( SGlobPtr GPtr )
-                               /* 
-                                * Find thread record
-                                */
--                              BuildCatalogKey( dprP->directoryID, (const CatalogName *) nil, isHFSPlus, &key );
-+                              BuildCatalogKey(dprP->directoryID, NULL, isHFSPlus, &key);
-                               result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &threadRecord, &recSize, &hint );
-                               if ( result != noErr ) {
-                                       char idStr[16];
-@@ -1780,26 +1780,26 @@ OSErr  CreateAttributesBTreeControlBlock( SGlobPtr GPtr )
-       //      set up our DFA extended BTCB area.  Will we have enough memory on all HFS+ volumes.
-       //
-       btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) );                       // allocate space for our BTCB extensions
--      if ( btcb->refCon == nil ) {
-+      if (btcb->refCon == NULL) {
-               err = R_NoMem;
-               goto exit;
-       }
-       if (btcb->totalNodes == 0)
-       {
--              ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr                   = nil;
-+              ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr                   = NULL;
-               ((BTreeExtensionsRec*)btcb->refCon)->BTCBMSize                  = 0;
-               ((BTreeExtensionsRec*)btcb->refCon)->realFreeNodeCount  = 0;
-       }
-       else
-       {
--              if ( btcb->refCon == nil ) {
-+              if (btcb->refCon == NULL) {
-                       err = R_NoMem;
-                       goto exit;
-               }
-               size = (btcb->totalNodes + 7) / 8;                                                                                      //      size of BTree bit map
-               ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr = AllocateClearMemory(size);                      //      get precleared bitmap
--              if ( ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == nil )
-+              if (((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr == NULL)
-               {
-                       err = R_NoMem;
-                       goto exit;
-@@ -2358,7 +2358,7 @@ static   OSErr   RcdMDBEmbededVolDescriptionErr( SGlobPtr GPtr, OSErr type, HFSMaste
-       RcdError( GPtr, type );                                                                                         //      first, record the error
-       
-       p = AllocMinorRepairOrder( GPtr, sizeof(EmbededVolDescription) );       //      get the node
--      if ( p == nil ) return( R_NoMem );
-+      if (p == NULL)  return( R_NoMem );
-       
-       p->type                                                 =  type;                                                        //      save error info
-       desc                                                    =  (EmbededVolDescription *) &(p->name);
-@@ -2397,7 +2397,7 @@ static   OSErr   RcdInvalidWrapperExtents( SGlobPtr GPtr, OSErr type )
-       RcdError( GPtr, type );                                                                                         //      first, record the error
-       
-       p = AllocMinorRepairOrder( GPtr, 0 );   //      get the node
--      if ( p == nil ) return( R_NoMem );
-+      if (p == NULL)  return( R_NoMem );
-       
-       p->type                                                 =  type;                                                        //      save error info
-       
-@@ -3029,7 +3029,7 @@ OSErr    CheckFileExtents( SGlobPtr GPtr, UInt32 fileNumber, UInt8 forkType,
-       foundBadExtent = false;
-       lastExtentIndex = GPtr->numExtents;
-       
--      while ( (extents != nil) && (err == noErr) )
-+      while ((extents != NULL) && (err == noErr))
-       {       
-               //      checkout the extent record first
-               err = ChkExtRec( GPtr, extents, &lastExtentIndex );
-@@ -3105,7 +3105,7 @@ OSErr    CheckFileExtents( SGlobPtr GPtr, UInt32 fileNumber, UInt8 forkType,
-                       if ( err == btNotFound )
-                       {
-                               err = noErr;                                                            //       no more extent records
--                              extents = nil;
-+                              extents = NULL;
-                               break;
-                       }
-                       else if ( err != noErr )
-@@ -3121,7 +3121,7 @@ OSErr    CheckFileExtents( SGlobPtr GPtr, UInt32 fileNumber, UInt8 forkType,
-                       if ( err == btNotFound )
-                       {
-                               err = noErr;                                                            //       no more extent records
--                              extents = nil;
-+                              extents = NULL;
-                               break;
-                       }
-                       else if ( err != noErr )
-@@ -3205,7 +3205,7 @@ static OSErr     AddExtentToOverlapList( SGlobPtr GPtr, HFSCatalogNodeID fileNumber,
-       }
-       
-       //      If it's uninitialized
--      if ( GPtr->overlappedExtents == nil )
-+      if (GPtr->overlappedExtents == NULL)
-       {
-               GPtr->overlappedExtents = (ExtentsTable **) NewHandleClear( sizeof(ExtentsTable) );
-               extentsTableH   = GPtr->overlappedExtents;
-diff --git a/fsck_hfs.tproj/dfalib/SVerify2.c b/fsck_hfs.tproj/dfalib/SVerify2.c
-index c68f3d8..da1a982 100644
---- a/fsck_hfs.tproj/dfalib/SVerify2.c
-+++ b/fsck_hfs.tproj/dfalib/SVerify2.c
-@@ -1013,7 +1013,7 @@ static int BTKeyChk( SGlobPtr GPtr, NodeDescPtr nodeP, BTreeControlBlock *btcb )
-       UInt16                          keyLength;
-       KeyPtr                          keyPtr;
-       UInt8                           *dataPtr;
--      KeyPtr                          prevkeyP        = nil;
-+      KeyPtr                          prevkeyP        = NULL;
-       if ( nodeP->numRecords == 0 )
-@@ -1044,7 +1044,7 @@ static int BTKeyChk( SGlobPtr GPtr, NodeDescPtr nodeP, BTreeControlBlock *btcb )
-                               return( E_KeyLen );
-                       }
-       
--                      if ( prevkeyP != nil )
-+                      if (prevkeyP != NULL)
-                       {
-                               if ( CompareKeys( (BTreeControlBlockPtr)btcb, prevkeyP, keyPtr ) >= 0 )
-                               {
diff --git a/utils/hfsprogs/patches/0011-Fix-types.patch b/utils/hfsprogs/patches/0011-Fix-types.patch
deleted file mode 100644 (file)
index 88c049f..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
-Date: Thu, 24 Oct 2013 01:11:22 -0200
-Subject: Fix types
-
----
- fsck_hfs.tproj/cache.c | 30 ++++++++++++++++--------------
- 1 file changed, 16 insertions(+), 14 deletions(-)
-
-diff --git a/fsck_hfs.tproj/cache.c b/fsck_hfs.tproj/cache.c
-index 527088a..540fa0b 100644
---- a/fsck_hfs.tproj/cache.c
-+++ b/fsck_hfs.tproj/cache.c
-@@ -961,20 +961,21 @@ int CacheLookup (Cache_t *cache, uint64_t off, Tag_t **tag)
-  */
- int CacheRawRead (Cache_t *cache, uint64_t off, uint32_t len, void *buf)
- {
--      uint64_t        result;
-+      off_t   result1;
-+      ssize_t result2;
-               
-       /* Both offset and length must be multiples of the device block size */
-       if (off % cache->DevBlockSize) return (EINVAL);
-       if (len % cache->DevBlockSize) return (EINVAL);
-       
-       /* Seek to the position */
--      result = lseek (cache->FD_R, off, SEEK_SET);
--      if (result < 0) return (errno);
--      if (result != off) return (ENXIO);
-+      result1 = lseek(cache->FD_R, off, SEEK_SET);
-+      if (result1 < 0) return (errno);
-+      if (result1 != off) return (ENXIO);
-       /* Read into the buffer */
--      result = read (cache->FD_R, buf, len);
--      if (result < 0) return (errno);
--      if (result == 0) return (ENXIO);
-+      result2 = read(cache->FD_R, buf, len);
-+      if (result2 < 0) return (errno);
-+      if (result2 == 0) return (ENXIO);
-       /* Update counters */
-       cache->DiskRead++;
-@@ -989,21 +990,22 @@ int CacheRawRead (Cache_t *cache, uint64_t off, uint32_t len, void *buf)
-  */
- int CacheRawWrite (Cache_t *cache, uint64_t off, uint32_t len, void *buf)
- {
--      uint64_t        result;
-+      off_t   result1;
-+      ssize_t result2;
-       
-       /* Both offset and length must be multiples of the device block size */
-       if (off % cache->DevBlockSize) return (EINVAL);
-       if (len % cache->DevBlockSize) return (EINVAL);
-       
-       /* Seek to the position */
--      result = lseek (cache->FD_W, off, SEEK_SET);
--      if (result < 0) return (errno);
--      if (result != off) return (ENXIO);
-+      result1 = lseek (cache->FD_W, off, SEEK_SET);
-+      if (result1 < 0) return (errno);
-+      if (result1 != off) return (ENXIO);
-       
-       /* Write into the buffer */
--      result = write (cache->FD_W, buf, len);
--      if (result < 0) return (errno);
--      if (result == 0) return (ENXIO);
-+      result2 = write (cache->FD_W, buf, len);
-+      if (result2 < 0) return (errno);
-+      if (result2 == 0) return (ENXIO);
-       
-       /* Update counters */
-       cache->DiskWrite++;
diff --git a/utils/hfsprogs/patches/0012-Fix-mkfs-not-creating-UUIDs-for-new-filesystems.patch b/utils/hfsprogs/patches/0012-Fix-mkfs-not-creating-UUIDs-for-new-filesystems.patch
deleted file mode 100644 (file)
index 883a7b7..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-From: Matthew Garrett <mjg59@codon.org.uk>
-Date: Thu, 24 Oct 2013 01:11:22 -0200
-Subject: Fix mkfs not creating UUIDs for new filesystems.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Fix mkfs not creating UUIDs for new filesystems.
-
-Thanks to Lars Noodén for reporting the bug at
- <https://bugs.launchpad.net/bugs/737002>.
-
-This closes LP: #737002.
----
- include/missing.h | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/include/missing.h b/include/missing.h
-index 0a859c4..f50e8fb 100644
---- a/include/missing.h
-+++ b/include/missing.h
-@@ -72,7 +72,7 @@
- #define NAME_MAX      255
- /* Byteswap stuff */
--#define NXSwapHostLongToBig(x)                cpu_to_be64(x)
-+#define NXSwapHostLongToBig(x)                cpu_to_be32(x)
- #define NXSwapBigShortToHost(x)       be16_to_cpu(x)
- #define OSSwapBigToHostInt16(x)               be16_to_cpu(x)
- #define NXSwapBigLongToHost(x)                be32_to_cpu(x)
-@@ -88,6 +88,9 @@
- #ifndef be32_to_cpu
- #define be32_to_cpu(x) bswap_32(x)
- #endif
-+#ifndef cpu_to_be32
-+#define cpu_to_be32(x) bswap_32(x)
-+#endif
- #ifndef be64_to_cpu
- #define be64_to_cpu(x) bswap_64(x)
- #endif
-@@ -102,6 +105,9 @@
- #ifndef be32_to_cpu
- #define be32_to_cpu(x)        (x)
- #endif
-+#ifndef cpu_to_be32
-+#define cpu_to_be32(x)        (x)
-+#endif
- #ifndef be64_to_cpu
- #define be64_to_cpu(x)        (x)
- #endif
diff --git a/utils/hfsprogs/patches/0013-Fix-manpages.patch b/utils/hfsprogs/patches/0013-Fix-manpages.patch
deleted file mode 100644 (file)
index d78083b..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-From: =?UTF-8?q?Rog=C3=A9rio=20Theodoro=20de=20Brito?= <rbrito@ime.usp.br>
-Date: Thu, 25 Nov 2010 00:00:00 -0200
-Subject: Fix manpages
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Remove typos, references in the "See also" sections of the manpages to
-commands that are not available in Debian systems (and, quite probably,
-other systems too) and non-Linux specific comments.
-
-Authored also by Christoph Hellwig <hch@lst.de> and  "A. Costa" <agcosta@gis.net>
-
-Bug-Debian: http://bugs.debian.org/598714
-Bug-Debian: http://bugs.debian.org/575201
-Forwarded: no
-Reviewed-by: Rogério Theodoro de Brito <rbrito@ime.usp.br>
----
- fsck_hfs.tproj/fsck_hfs.8   | 18 +++++++-----------
- newfs_hfs.tproj/newfs_hfs.8 | 23 ++++++++---------------
- 2 files changed, 15 insertions(+), 26 deletions(-)
-
-diff --git a/fsck_hfs.tproj/fsck_hfs.8 b/fsck_hfs.tproj/fsck_hfs.8
-index aec9949..0bc804d 100644
---- a/fsck_hfs.tproj/fsck_hfs.8
-+++ b/fsck_hfs.tproj/fsck_hfs.8
-@@ -19,18 +19,18 @@
- .Dt FSCK_HFS 8
- .Os "Mac OS X"
- .Sh NAME
--.Nm fsck_hfs
-+.Nm fsck.hfs
- .Nd HFS file system consistency check
- .Sh SYNOPSIS
--.Nm fsck_hfs
-+.Nm fsck.hfs
- .Fl q
- .Op Fl df
- .Ar special ...
--.Nm fsck_hfs
-+.Nm fsck.hfs
- .Fl p
- .Op Fl df
- .Ar special ...
--.Nm fsck_hfs
-+.Nm fsck.hfs
- .Op Fl n | y | r
- .Op Fl dfgl
- .Op Fl m Ar mode
-@@ -52,9 +52,7 @@ The second form of
- preens the specified file systems.
- It is normally started by
- .Xr fsck 8
--run from
--.Pa /etc/rc.boot
--during automatic reboot, when a HFS file system is detected.
-+during systen boot, when a HFS file system is detected.
- When preening file systems,
- .Nm
- will fix common inconsistencies for file systems that were not
-@@ -105,9 +103,9 @@ to check and repair journaled HFS+ file systems.
- .It Fl g
- Causes
- .Nm
--to generate it's output strings in GUI format.
-+to generate its output strings in GUI format.
- This option is used when another application with a graphical user interface
--(like Mac OS X Disk Utility) is envoking the
-+(like Mac OS X Disk Utility) is invoking the
- .Nm
- tool.
- .It Fl l
-@@ -144,8 +142,6 @@ specified file system for a new catalog file and if there is no damage
- to the leaf nodes in the existing catalog file.
- .El
- .Pp
--Because of inconsistencies between the block device and the buffer cache,
--the raw device should always be used.
- .Sh SEE ALSO
- .Xr fsck 8
- .Sh BUGS
-diff --git a/newfs_hfs.tproj/newfs_hfs.8 b/newfs_hfs.tproj/newfs_hfs.8
-index d002cc9..fe91962 100644
---- a/newfs_hfs.tproj/newfs_hfs.8
-+++ b/newfs_hfs.tproj/newfs_hfs.8
-@@ -19,10 +19,10 @@
- .Dt NEWFS_HFS 8
- .Os "Mac OS X"
- .Sh NAME
--.Nm newfs_hfs
-+.Nm mkfs.hfs
- .Nd construct a new HFS Plus file system
- .Sh SYNOPSIS
--.Nm newfs_hfs
-+.Nm mkfs.hfs
- .Op Fl N Ar [partition-size]
- .Op Fl U Ar uid
- .Op Fl G Ar gid
-@@ -37,19 +37,13 @@
- .Op Fl v Ar volume-name
- .Ar special
- .Sh DESCRIPTION
--.Nm Newfs_hfs
-+.Nm mkfs.hfs
- builds an HFS Plus file system on the specified special device.
--Before running 
--.Nm newfs_hfs
--the disk should be partitioned using the
--.Em Disk Utility
--application or
--.Xr pdisk 8 .
- .Pp
- The file system default parameters are calculated based on
- the size of the disk partition. Typically the defaults are
- reasonable, however
--.Nm newfs_hfs
-+.Nm mkfs.hfs
- has several options to allow the defaults to be selectively overridden.
- The options are as follows:
- .Bl -tag -width Fl
-@@ -66,7 +60,7 @@ Set the group of the file system's root directory to
- Specify the access permissions mask for the file system's root directory.
- .It Fl h
- Creates a legacy HFS format filesystem. This option
--is not recomended for file systems that will be
-+is not recommended for file systems that will be
- primarily used with Mac OS X or Darwin.
- .It Fl s
- Creates a case-sensitive HFS Plus filesystem. By
-@@ -93,7 +87,7 @@ sizes are specified with the
- option followed by a comma
- separated list of the form arg=blocks.
- .Pp
--Example:  -c c=5000,e=500
-+Example:  \-c c=5000,e=500
- .Bl -tag -width Fl
- .It Em a=blocks
- Set the attribute file clump size.
-@@ -126,7 +120,7 @@ the form arg=bytes. The
- size must be a power of two and no larger than
- 32768 bytes.
- .Pp
--Example:  -n c=8192,e=4096
-+Example:  \-n c=8192,e=4096
- .Bl -tag -width Fl
- .It Em a=bytes
- Set the attribute b-tree node size.
-@@ -139,8 +133,7 @@ Set the extent overflow b-tree node size.
- Volume name (file system name) in ascii or UTF-8 format.
- .El
- .Sh SEE ALSO
--.Xr mount 8 ,
--.Xr pdisk 8
-+.Xr mount 8
- .Sh HISTORY
- The
- .Nm
diff --git a/utils/hfsprogs/patches/0014-uClibc_no_loadavg.patch b/utils/hfsprogs/patches/0014-uClibc_no_loadavg.patch
deleted file mode 100644 (file)
index 48649ba..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
---- diskdev_cmds-332.25/newfs_hfs.tproj/makehfs.c      2015-03-27 21:58:04.163171675 -0700
-+++ hfsprogs-332.25/newfs_hfs.tproj/makehfs.c  2015-03-27 21:56:03.687175020 -0700
-@@ -2119,10 +2119,12 @@
-               sysctl(mib, 2, sysctlstring, &datalen, NULL, 0);
-               SHA1_Update(&context, sysctlstring, datalen);
- #endif
-+#ifndef __UCLIBC__
-               /* The system's load average: */
-               datalen = sizeof(sysloadavg);
-               getloadavg(sysloadavg, 3);
-               SHA1_Update(&context, &sysloadavg, datalen);
-+#endif
-               /* The system's VM statistics: */
- #if !LINUX
diff --git a/utils/hfsprogs/patches/0015-sysctl-only-on-glibc.patch b/utils/hfsprogs/patches/0015-sysctl-only-on-glibc.patch
deleted file mode 100644 (file)
index b71290f..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
---- a/newfs_hfs.tproj/makehfs.c
-+++ b/newfs_hfs.tproj/makehfs.c
-@@ -37,7 +37,9 @@
- #endif
- #include <sys/errno.h>
- #include <sys/stat.h>
-+#ifdef __GLIBC__
- #include <sys/sysctl.h>
-+#endif
- #if !LINUX
- #include <sys/vmmeter.h>
- #endif
-@@ -2039,6 +2041,7 @@ getencodinghint(unsigned char *name)
-         if (getvfsbyname("hfs", &vfc) < 0)
-               goto error;
-+#ifdef __GLIBC__
-         mib[0] = CTL_VFS;
-         mib[1] = vfc.vfc_typenum;
-         mib[2] = HFS_ENCODINGHINT;
-@@ -2046,6 +2049,7 @@ getencodinghint(unsigned char *name)
-       if (sysctl(mib, 3, &hint, &buflen, name, strlen((char *)name) + 1) < 0)
-               goto error;
-       return (hint);
-+#endif
- error:
-       hint = GetDefaultEncoding();
-       return (0);
-@@ -2062,7 +2066,7 @@ void GenerateVolumeUUID(VolumeUUID *newV
-       clock_t uptime;
-       size_t datalen;
-       double sysloadavg[3];
--#if !LINUX
-+#if !LINUX && defined(__GLIBC__)
-       int sysdata;
-       int mib[2];
-       char sysctlstring[128];
-@@ -2080,7 +2084,7 @@ void GenerateVolumeUUID(VolumeUUID *newV
-               SHA1_Update(&context, &uptime, sizeof(uptime));
-               
-               /* The kernel's boot time: */
--#if !LINUX
-+#if !LINUX && defined(__GLIBC__)
-               mib[0] = CTL_KERN;
-               mib[1] = KERN_BOOTTIME;
-               datalen = sizeof(sysdata);
-@@ -2088,7 +2092,7 @@ void GenerateVolumeUUID(VolumeUUID *newV
-               SHA1_Update(&context, &sysdata, datalen);
- #endif
-               /* The system's host id: */
--#if !LINUX
-+#if !LINUX && defined(__GLIBC__)
-               mib[0] = CTL_KERN;
-               mib[1] = KERN_HOSTID;
-               datalen = sizeof(sysdata);
-@@ -2096,7 +2100,7 @@ void GenerateVolumeUUID(VolumeUUID *newV
-               SHA1_Update(&context, &sysdata, datalen);
- #endif
-               /* The system's host name: */
--#if !LINUX
-+#if !LINUX && defined(__GLIBC__)
-               mib[0] = CTL_KERN;
-               mib[1] = KERN_HOSTNAME;
-               datalen = sizeof(sysctlstring);
-@@ -2104,7 +2108,7 @@ void GenerateVolumeUUID(VolumeUUID *newV
-               SHA1_Update(&context, sysctlstring, datalen);
- #endif
-               /* The running kernel's OS release string: */
--#if !LINUX
-+#if !LINUX && defined(__GLIBC__)
-               mib[0] = CTL_KERN;
-               mib[1] = KERN_OSRELEASE;
-               datalen = sizeof(sysctlstring);
-@@ -2112,7 +2116,7 @@ void GenerateVolumeUUID(VolumeUUID *newV
-               SHA1_Update(&context, sysctlstring, datalen);
- #endif
-               /* The running kernel's version string: */
--#if !LINUX
-+#if !LINUX && defined(__GLIBC__)
-               mib[0] = CTL_KERN;
-               mib[1] = KERN_VERSION;
-               datalen = sizeof(sysctlstring);
-@@ -2127,7 +2131,7 @@ void GenerateVolumeUUID(VolumeUUID *newV
- #endif
-               /* The system's VM statistics: */
--#if !LINUX
-+#if !LINUX && defined(__GLIBC__)
-               mib[0] = CTL_VM;
-               mib[1] = VM_METER;
-               datalen = sizeof(sysvmtotal);
diff --git a/utils/io/Makefile b/utils/io/Makefile
new file mode 100644 (file)
index 0000000..a861e74
--- /dev/null
@@ -0,0 +1,36 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=io
+PKG_RELEASE:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
+
+define Package/io
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Raw memory i/o utility
+  URL:=http://www.sleepie.demon.co.uk/linuxvme/io.c
+endef
+
+define Package/io/description
+       This tool can be used to access physical memory addresses from userspace.
+       It can be useful to access hardware for which no device driver exists!
+endef
+
+define Build/Compile
+       $(TARGET_CC) $(TARGET_CFLAGS) -Wall $(PKG_BUILD_DIR)/io.c -o $(PKG_BUILD_DIR)/$(PKG_NAME)
+endef
+
+define Package/io/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/io $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,io))
diff --git a/utils/io/src/io.c b/utils/io/src/io.c
new file mode 100644 (file)
index 0000000..2572054
--- /dev/null
@@ -0,0 +1,428 @@
+/*
+ * Simple app. to do memory accesses via /dev/mem.
+ *
+ *
+ * Copyright (c) Richard Hirst <rhirst@linuxcare.com>
+ * Copyright (c) Thomas Langer <thomas.langer@infineon.com>
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#define MEM_READ  0
+#define MEM_WRITE 1
+#define MEM_AND   2
+#define MEM_OR    3
+
+static void
+usage (char *argv0)
+{
+       fprintf(stderr,
+"Raw memory i/o utility - $Revision: 2.0 $\n\n"
+"%s -v -1|2|4 -r|w|a|o [-l <len>] [-f <file>] <addr> [<value>]\n\n"
+"    -v         Verbose, asks for confirmation\n"
+"    -1|2|4     Sets memory access size in bytes (default byte)\n"
+"    -l <len>   Length in bytes of area to access (defaults to\n"
+"               one access, or whole file length)\n"
+"    -r|w|a|o   Read from or Write to memory (default read)\n"
+"               optional write with modify (and/or)\n"
+"    -f <file>  File to write on memory read, or\n"
+"               to read on memory write\n"
+"    <addr>     The memory address to access\n"
+"    <val>      The value to write (implies -w)\n\n"
+"Examples:\n"
+"    %s 0x1000                  Reads one byte from 0x1000\n"
+"    %s 0x1000 0x12             Writes 0x12 to location 0x1000\n"
+"    %s -2 -l 8 0x1000          Reads 8 words from 0x1000\n"
+"    %s -r -f dmp -l 100 200    Reads 100 bytes from addr 200 to file\n"
+"    %s -w -f img 0x10000       Writes the whole of file to memory\n"
+"\n"
+"Note access size (-1|2|4) does not apply to file based accesses.\n\n",
+               argv0, argv0, argv0, argv0, argv0, argv0);
+       exit(1);
+}
+
+
+static void
+memread_memory(unsigned long phys_addr, void *addr, int len, int iosize)
+{
+       int i;
+
+       while (len) {
+               printf("%08lx: ", phys_addr);
+               i = 0;
+               while (i < 16 && len) {
+                       switch(iosize) {
+                       case 1:
+                               printf(" %02x", *(unsigned char *)addr);
+                               break;
+                       case 2:
+                               printf(" %04x", *(unsigned short *)addr);
+                               break;
+                       case 4:
+                               printf(" %08lx", *(unsigned long *)addr);
+                               break;
+                       }
+                       i += iosize;
+                       addr += iosize;
+                       len -= iosize;
+               }
+               phys_addr += 16;
+               printf("\n");
+       }
+}
+
+
+static void
+write_memory(unsigned long phys_addr, void *addr, int len, int iosize, unsigned long value)
+{
+       switch(iosize) {
+       case 1:
+               while (len) {
+                       *(unsigned char *)addr = value;
+                       len -= iosize;
+                       addr += iosize;
+               }
+               break;
+       case 2:
+               while (len) {
+                       *(unsigned short *)addr = value;
+                       len -= iosize;
+                       addr += iosize;
+               }
+               break;
+       case 4:
+               while (len) {
+                       *(unsigned long *)addr = value;
+                       len -= iosize;
+                       addr += iosize;
+               }
+               break;
+       }
+}
+
+
+static void
+and_write_memory(unsigned long phys_addr, void *addr, int len, int iosize, unsigned long value)
+{
+       switch(iosize) {
+       case 1:
+               while (len) {
+                       *(unsigned char *)addr &= value;
+                       len -= iosize;
+                       addr += iosize;
+               }
+               break;
+       case 2:
+               while (len) {
+                       *(unsigned short *)addr &= value;
+                       len -= iosize;
+                       addr += iosize;
+               }
+               break;
+       case 4:
+               while (len) {
+                       *(unsigned long *)addr &= value;
+                       len -= iosize;
+                       addr += iosize;
+               }
+               break;
+       }
+}
+
+
+static void
+or_write_memory(unsigned long phys_addr, void *addr, int len, int iosize, unsigned long value)
+{
+       switch(iosize) {
+       case 1:
+               while (len) {
+                       *(unsigned char *)addr |= value;
+                       len -= iosize;
+                       addr += iosize;
+               }
+               break;
+       case 2:
+               while (len) {
+                       *(unsigned short *)addr |= value;
+                       len -= iosize;
+                       addr += iosize;
+               }
+               break;
+       case 4:
+               while (len) {
+                       *(unsigned long *)addr |= value;
+                       len -= iosize;
+                       addr += iosize;
+               }
+               break;
+       }
+}
+
+
+int
+main (int argc, char **argv)
+{
+       int mfd, ffd = 0, req_len = 0, opt;
+       void *real_io;
+       unsigned long real_len, real_addr, req_addr, req_value = 0, offset;
+       char *endptr;
+       int memfunc = MEM_READ;
+       int iosize = 1;
+       char *filename = NULL;
+       int verbose = 0;
+
+       opterr = 0;
+       if (argc == 1)
+               usage(argv[0]);
+
+       while ((opt = getopt(argc, argv, "hv124rwaol:f:")) > 0) {
+               switch (opt) {
+               case 'h':
+                       usage(argv[0]);
+               case 'v':
+                       verbose = 1;
+                       break;
+               case '1':
+               case '2':
+               case '4':
+                       iosize = opt - '0';
+                       break;
+               case 'r':
+                       memfunc = MEM_READ;
+                       break;
+               case 'a':
+                       memfunc = MEM_AND;
+                       break;
+               case 'o':
+                       memfunc = MEM_OR;
+                       break;
+               case 'w':
+                       memfunc = MEM_WRITE;
+                       break;
+               case 'l':
+                       req_len = strtoul(optarg, &endptr, 0);
+                       if (*endptr) {
+                               fprintf(stderr, "Bad <size> value '%s'\n", optarg);
+                               exit(1);
+                       }
+                       break;
+               case 'f':
+                       filename = strdup(optarg);
+                       break;
+               default:
+                       fprintf(stderr, "Unknown option: %c\n", opt);
+                       usage(argv[0]);
+               }
+       }
+
+       if (optind == argc) {
+               fprintf(stderr, "No address given\n");
+               exit(1);
+       }
+       req_addr = strtoul(argv[optind], &endptr, 0);
+       if (*endptr) {
+               fprintf(stderr, "Bad <addr> value '%s'\n", argv[optind]);
+               exit(1);
+       }
+       optind++;
+       if (!filename && (memfunc == MEM_READ) && optind < argc) {
+               memfunc = MEM_WRITE;
+       }
+       if (filename && optind > argc) {
+               fprintf(stderr, "Filename AND value given\n");
+               exit(1);
+       }
+       if (!filename && (memfunc != MEM_READ) && optind == argc) {
+               fprintf(stderr, "No value given for WRITE\n");
+               exit(1);
+       }
+       if (!filename && (memfunc != MEM_READ)) {
+               req_value = strtoul(argv[optind], &endptr, 0);
+               if (*endptr) {
+                       fprintf(stderr, "Bad <value> value '%s'\n", argv[optind]);
+                       exit(1);
+               }
+               if ((iosize == 1 && (req_value & 0xffffff00)) ||
+                               (iosize == 2 && (req_value & 0xffff0000))) {
+                       fprintf(stderr, "<value> too large\n");
+                       exit(1);
+               }
+               optind++;
+       }
+       if (filename && (memfunc == MEM_READ) && !req_len) {
+               fprintf(stderr, "No size given for file memread\n");
+               exit(1);
+       }
+       if (optind < argc) {
+               fprintf(stderr, "Too many arguments '%s'...\n", argv[optind]);
+               exit(1);
+       }
+       if (filename && (memfunc == MEM_READ)) {
+               ffd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
+               if (ffd < 0) {
+                       fprintf(stderr, "Failed to open destination file '%s': %s\n", filename, strerror(errno));
+                       exit(1);
+               }
+       }
+       if (filename && (memfunc != MEM_READ)) {
+               ffd = open(filename, O_RDONLY);
+               if (ffd < 0) {
+                       fprintf(stderr, "Failed to open source file '%s': %s\n", filename, strerror(errno));
+                       exit(1);
+               }
+       }
+
+       if (filename && !req_len) {
+               req_len = lseek(ffd, 0, SEEK_END);
+               if (req_len < 0) {
+                       fprintf(stderr, "Failed to seek on '%s': %s\n",
+                                       filename, strerror(errno));
+                       exit(1);
+               }
+               if (lseek(ffd, 0, SEEK_SET)) {
+                       fprintf(stderr, "Failed to seek on '%s': %s\n",
+                                       filename, strerror(errno));
+                       exit(1);
+               }
+       }
+       if (!req_len)
+               req_len = iosize;
+
+       if ((iosize == 2 && (req_addr & 1)) ||
+                       (iosize == 4 && (req_addr & 3))) {
+               fprintf(stderr, "Badly aligned <addr> for access size\n");
+               exit(1);
+       }
+       if ((iosize == 2 && (req_len & 1)) ||
+                       (iosize == 4 && (req_len & 3))) {
+               fprintf(stderr, "Badly aligned <size> for access size\n");
+               exit(1);
+       }
+
+       if (!verbose)
+               /* Nothing */;
+       else if (filename && (memfunc == MEM_READ))
+               printf("Request to read 0x%x bytes from address 0x%08lx\n"
+                       "\tto file %s, using %d byte accesses\n",
+                       req_len, req_addr, filename, iosize);
+       else if (filename)
+               printf("Request to write 0x%x bytes to address 0x%08lx\n"
+                       "\tfrom file %s, using %d byte accesses\n",
+                       req_len, req_addr, filename, iosize);
+       else if (memfunc == MEM_READ)
+               printf("Request to read 0x%x bytes from address 0x%08lx\n"
+                       "\tusing %d byte accesses\n",
+                       req_len, req_addr, iosize);
+       else
+               printf("Request to write 0x%x bytes to address 0x%08lx\n"
+                       "\tusing %d byte accesses of value 0x%0*lx\n",
+                       req_len, req_addr, iosize, iosize*2, req_value);
+
+       real_addr = req_addr & ~4095;
+       if (real_addr == 0xfffff000) {
+               fprintf(stderr, "Sorry, cannot map the top 4K page\n");
+               exit(1);
+       }
+       offset = req_addr - real_addr;
+       real_len = req_len + offset;
+       real_len = (real_len + 4095) & ~ 4095;
+       if (real_addr + real_len < real_addr) {
+               fprintf(stderr, "Aligned addr+len exceeds top of address space\n");
+               exit(1);
+       }
+       if (verbose)
+               printf("Attempting to map 0x%lx bytes at address 0x%08lx\n",
+                       real_len, real_addr);
+
+       mfd = open("/dev/mem", (memfunc == MEM_READ) ? O_RDONLY : O_RDWR);
+       if (mfd == -1) {
+               perror("open /dev/mem");
+               fprintf(stderr, "Is CONFIG_DEVMEM activated?\n");
+               exit(1);
+       }
+       if (verbose)
+               printf("open(/dev/mem) ok\n");
+       real_io = mmap(NULL, real_len,
+                       (memfunc == MEM_READ) ? PROT_READ:PROT_READ|PROT_WRITE,
+                       MAP_SHARED, mfd, real_addr);
+       if (real_io == (void *)(-1)) {
+               fprintf(stderr, "mmap() failed: %s\n", strerror(errno));
+               exit(1);
+       }
+       if (verbose)
+               printf("mmap() ok\n");
+
+       if (verbose) {
+               int c;
+
+               printf("OK? ");
+               fflush(stdout);
+               c = getchar();
+               if (c != 'y' && c != 'Y') {
+                       printf("Aborted\n");
+                       exit(1);
+               }
+       }
+
+       if (filename && (memfunc == MEM_READ)) {
+               int n = write(ffd, real_io + offset, req_len);
+
+               if (n < 0) {
+                       fprintf(stderr, "File write failed: %s\n", strerror(errno));
+                       exit(1);
+               }
+               else if (n != req_len) {
+                       fprintf(stderr, "Only wrote %d of %d bytes to file\n",
+                                       n, req_len);
+                       exit(1);
+               }
+       }
+       else if (filename) {
+               int n = read(ffd, real_io + offset, req_len);
+
+               if (n < 0) {
+                       fprintf(stderr, "File read failed: %s\n", strerror(errno));
+                       exit(1);
+               }
+               else if (n != req_len) {
+                       fprintf(stderr, "Only read %d of %d bytes from file\n",
+                                       n, req_len);
+                       exit(1);
+               }
+       }
+       else {
+               switch (memfunc)
+               {
+               case MEM_READ:
+                       memread_memory(req_addr, real_io + offset, req_len, iosize);
+                       break;
+               case MEM_WRITE:
+                       write_memory(req_addr, real_io + offset, req_len, iosize, req_value);
+                       break;
+               case MEM_AND:
+                       and_write_memory(req_addr, real_io + offset, req_len, iosize, req_value);
+                       break;
+               case MEM_OR:
+                       or_write_memory(req_addr, real_io + offset, req_len, iosize, req_value);
+                       break;
+               }
+       }
+
+       munmap(real_io, real_len);
+
+       if (filename)
+               close(ffd);
+       close (mfd);
+
+       return 0;
+}
+
diff --git a/utils/irqbalance/Makefile b/utils/irqbalance/Makefile
new file mode 100644 (file)
index 0000000..3777fde
--- /dev/null
@@ -0,0 +1,52 @@
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=irqbalance
+PKG_VERSION:=1.2.0
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/Irqbalance/irqbalance.git
+PKG_SOURCE_VERSION:=0e0dd4cfe5464de2f81eaef504eab7183f1fb030
+PKG_MIRROR_HASH:=c826e78babfc26f777a5791b2a6ea95b61453ba3e3c5803d4428cc803216bc5c
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_LICENSE:=GPLv2
+
+PKG_MAINTAINER:=Hannu Nyman <hannu.nyman@iki.fi>
+
+PKG_FIXUP:=autoreconf
+PKG_REMOVE_FILES:=autogen.sh
+
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/irqbalance
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=IRQ usage balancing for multi-core systems
+  URL:=https://github.com/Irqbalance/irqbalance
+endef
+
+define Package/irqbalance/description
+ The purpose of irqbalance is to distribute hardware interrupts across
+ processors/cores on a multiprocessor/multicore system in order to
+ increase performance.
+endef
+
+CONFIGURE_ARGS+= \
+       --disable-numa \
+       --with-libcap_ng=no \
+       --with-systemd=no \
+       --without-glib2
+
+define Package/irqbalance/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/irqbalance $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,irqbalance))
diff --git a/utils/irqbalance/patches/100-disable-ui-compilation.patch b/utils/irqbalance/patches/100-disable-ui-compilation.patch
new file mode 100644 (file)
index 0000000..5793ec6
--- /dev/null
@@ -0,0 +1,47 @@
+Revert upstream commit bf9297132d219539e07506c125c6801dd77202f4
+to prevent building the UI component. Also disable manpage.
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -24,19 +24,14 @@ AUTOMAKE_OPTIONS = no-dependencies
+ ACLOCAL_AMFLAGS = -I m4
+ EXTRA_DIST = COPYING autogen.sh misc/irqbalance.service misc/irqbalance.env
+-UI_DIR = ui
+ AM_CFLAGS = $(LIBCAP_NG_CFLAGS) $(GLIB_CFLAGS)
+ AM_CPPFLAGS = -I${top_srcdir} -W -Wall -Wshadow -Wformat -Wundef -D_GNU_SOURCE
+ noinst_HEADERS = bitmap.h constants.h cpumask.h irqbalance.h non-atomic.h \
+-      types.h $(UI_DIR)/helpers.h $(UI_DIR)/irqbalance-ui.h $(UI_DIR)/ui.h
+-sbin_PROGRAMS = irqbalance irqbalance-ui
++      types.h
++sbin_PROGRAMS = irqbalance
+ irqbalance_SOURCES = activate.c bitmap.c classify.c cputree.c irqbalance.c \
+       irqlist.c numa.c placement.c procinterrupts.c
+ irqbalance_LDADD = $(LIBCAP_NG_LIBS) $(GLIB_LIBS)
+-irqbalance_ui_SOURCES = $(UI_DIR)/helpers.c $(UI_DIR)/irqbalance-ui.c \
+-      $(UI_DIR)/ui.c
+-irqbalance_ui_LDADD = $(GLIB_LIBS) $(CURSES_LIBS)
+-dist_man_MANS = irqbalance.1
+ CONFIG_CLEAN_FILES = debug*.list config/*
+ clean-generic:
+--- a/configure.ac
++++ b/configure.ac
+@@ -3,7 +3,7 @@ AC_PREREQ(2.12)dnl
+ AM_CONFIG_HEADER(config.h)
+ AC_CONFIG_MACRO_DIR([m4])
+-AM_INIT_AUTOMAKE([foreign] [subdir-objects])
++AM_INIT_AUTOMAKE([foreign])
+ AM_PROG_LIBTOOL
+ AC_SUBST(LIBTOOL_DEPS)
+@@ -26,8 +26,6 @@ AC_CHECK_FUNCS(getopt_long)
+ AC_CHECK_LIB(numa, numa_available)
+ AC_CHECK_LIB(m, floor)
+-AC_CHECK_LIB(curses, mvprintw)
+-
+ AC_C_CONST
+ AC_C_INLINE
+ AM_PROG_CC_C_O
diff --git a/utils/irqbalance/patches/200-avoid-glib.patch b/utils/irqbalance/patches/200-avoid-glib.patch
new file mode 100644 (file)
index 0000000..3c20196
--- /dev/null
@@ -0,0 +1,421 @@
+Revert upstream commit d1993bcde2a524346a9508754671f096ec129ad1
+to avoid glib dependency. That commit polluted the main code
+with glib types.
+--- a/irqbalance.h
++++ b/irqbalance.h
+@@ -8,7 +8,6 @@
+ #include <stdint.h>
+ #include <glib.h>
+-#include <glib-unix.h>
+ #include <syslog.h>
+ #include <limits.h>
+@@ -63,7 +62,6 @@ extern GList *packages;
+ extern GList *cache_domains;
+ extern GList *cpus;
+ extern int numa_avail;
+-extern GList *cl_banned_irqs;
+ extern int debug_mode;
+ extern int journal_logging;
+@@ -171,7 +169,5 @@ extern unsigned int log_mask;
+ }while(0)
+ #endif /* HAVE_LIBSYSTEMD */
+-#define SOCKET_PATH "irqbalance"
+-
+ #endif /* __INCLUDE_GUARD_IRQBALANCE_H_ */
+--- a/irqbalance.c
++++ b/irqbalance.c
+@@ -31,8 +31,6 @@
+ #include <time.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+-#include <sys/socket.h>
+-#include <sys/un.h>
+ #include <fcntl.h>
+ #ifdef HAVE_GETOPT_LONG 
+ #include <getopt.h>
+@@ -44,7 +42,6 @@
+ #include "irqbalance.h"
+ volatile int keep_going = 1;
+-int socket_fd;
+ int one_shot_mode;
+ int debug_mode;
+ int foreground_mode;
+@@ -61,9 +58,6 @@ char *banscript = NULL;
+ char *polscript = NULL;
+ long HZ;
+ int sleep_interval = SLEEP_INTERVAL;
+-GMainLoop *main_loop;
+-
+-char *banned_cpumask_from_ui = NULL;
+ static void sleep_approx(int seconds)
+ {
+@@ -236,224 +230,22 @@ static void force_rebalance_irq(struct i
+       info->assigned_obj = NULL;
+ }
+-gboolean handler(gpointer data __attribute__((unused)))
++static void handler(int signum)
+ {
++      (void)signum;
+       keep_going = 0;
+-      g_main_loop_quit(main_loop);
+-      return TRUE;
+ }
+-gboolean force_rescan(gpointer data __attribute__((unused)))
++static void force_rescan(int signum)
+ {
++      (void)signum;
+       if (cycle_count)
+               need_rescan = 1;
+-      return TRUE;
+-}
+-
+-gboolean scan(gpointer data)
+-{
+-      log(TO_CONSOLE, LOG_INFO, "\n\n\n-----------------------------------------------------------------------------\n");
+-      clear_work_stats();
+-      parse_proc_interrupts();
+-      parse_proc_stat();
+-
+-
+-      /* cope with cpu hotplug -- detected during /proc/interrupts parsing */
+-      if (need_rescan) {
+-              need_rescan = 0;
+-              cycle_count = 0;
+-              log(TO_CONSOLE, LOG_INFO, "Rescanning cpu topology \n");
+-              clear_work_stats();
+-
+-              free_object_tree();
+-              build_object_tree();
+-              for_each_irq(NULL, force_rebalance_irq, NULL);
+-              parse_proc_interrupts();
+-              parse_proc_stat();
+-              sleep_approx(sleep_interval);
+-              clear_work_stats();
+-              parse_proc_interrupts();
+-              parse_proc_stat();
+-      } 
+-
+-      if (cycle_count)        
+-              update_migration_status();
+-
+-      calculate_placement();
+-      activate_mappings();
+-
+-      if (debug_mode)
+-              dump_tree();
+-      if (one_shot_mode)
+-              keep_going = 0;
+-      cycle_count++;
+-
+-      if (data != &sleep_interval) {
+-              data = &sleep_interval;
+-              g_timeout_add_seconds(sleep_interval, scan, data);
+-              return FALSE;
+-      }
+-
+-      if (keep_going)
+-              return TRUE;
+-      else
+-              return FALSE;
+-}
+-
+-void get_irq_data(struct irq_info *irq, void *data)
+-{
+-      sprintf(data + strlen(data),
+-                      "IRQ %d LOAD %lu DIFF %lu CLASS %d ", irq->irq, irq->load,
+-                      (irq->irq_count - irq->last_irq_count), irq->class);
+-}
+-
+-void get_object_stat(struct topo_obj *object, void *data)
+-{
+-      char irq_data[1024] = "\0";
+-
+-      if (g_list_length(object->interrupts) > 0) {
+-              for_each_irq(object->interrupts, get_irq_data, irq_data);
+-      }
+-      sprintf(data + strlen(data), "TYPE %d NUMBER %d LOAD %lu SAVE_MODE %d %s",
+-                      object->obj_type, object->number, object->load,
+-                      object->powersave_mode, irq_data);
+-      if (object->obj_type != OBJ_TYPE_CPU) {
+-              for_each_object(object->children, get_object_stat, data);
+-      }
+-}
+-
+-gboolean sock_handle(gint fd, GIOCondition condition, gpointer user_data __attribute__((unused)))
+-{
+-      char buff[500];
+-      int sock;
+-      int recv_size = 0;
+-      int valid_user = 0;
+-
+-      struct iovec iov = { buff, 500 };
+-      struct msghdr msg = { NULL, 0, &iov, 1, NULL, 0, 0 };
+-      msg.msg_control = malloc(CMSG_SPACE(sizeof(struct ucred)));
+-      msg.msg_controllen = CMSG_SPACE(sizeof(struct ucred));
+-
+-      struct cmsghdr *cmsg;
+-
+-      if (condition == G_IO_IN) {
+-              sock = accept(fd, NULL, NULL);
+-              if (sock < 0) {
+-                      log(TO_ALL, LOG_WARNING, "Connection couldn't be accepted.\n");
+-                      return TRUE;
+-              }
+-              if ((recv_size = recvmsg(sock, &msg, 0)) < 0) {
+-                      log(TO_ALL, LOG_WARNING, "Error while receiving data.\n");
+-                      return TRUE;
+-              }
+-              cmsg = CMSG_FIRSTHDR(&msg);
+-              if ((cmsg->cmsg_level == SOL_SOCKET) &&
+-                              (cmsg->cmsg_type == SCM_CREDENTIALS)) {
+-                      struct ucred *credentials = (struct ucred *) CMSG_DATA(cmsg);
+-                      if (!credentials->uid) {
+-                              valid_user = 1;
+-                      }
+-              }
+-              if (!valid_user) {
+-                      log(TO_ALL, LOG_INFO, "Permission denied for user to connect to socket.\n");
+-                      return TRUE;
+-              }
+-
+-              if (!strncmp(buff, "stats", strlen("stats"))) {
+-                      char stats[2048] = "\0";
+-                      for_each_object(numa_nodes, get_object_stat, stats);
+-                      send(sock, stats, strlen(stats), 0);
+-              }
+-              if (!strncmp(buff, "settings ", strlen("settings "))) {
+-                      if (!(strncmp(buff + strlen("settings "), "sleep ",
+-                                                      strlen("sleep ")))) {
+-                              char *sleep_string = malloc(
+-                                              sizeof(char) * (recv_size - strlen("settings sleep ")));
+-                              strncpy(sleep_string, buff + strlen("settings sleep "),
+-                                              recv_size - strlen("settings sleep "));
+-                              int new_iterval = strtoul(sleep_string, NULL, 10);
+-                              if (new_iterval >= 1) {
+-                                      sleep_interval = new_iterval;
+-                              }
+-                      } else if (!(strncmp(buff + strlen("settings "), "ban irqs ",
+-                                                      strlen("ban irqs ")))) {
+-                              char *end;
+-                              char *irq_string = malloc(
+-                                              sizeof(char) * (recv_size - strlen("settings ban irqs ")));
+-                              strncpy(irq_string, buff + strlen("settings ban irqs "),
+-                                              recv_size - strlen("settings ban irqs "));
+-                              g_list_free_full(cl_banned_irqs, free);
+-                              cl_banned_irqs = NULL;
+-                              need_rescan = 1;
+-                              if (!strncmp(irq_string, "NONE", strlen("NONE"))) {
+-                                      return TRUE;
+-                              }
+-                              int irq = strtoul(irq_string, &end, 10);
+-                              do {
+-                                      add_cl_banned_irq(irq);
+-                              } while((irq = strtoul(end, &end, 10)));
+-                      } else if (!(strncmp(buff + strlen("settings "), "cpus ",
+-                                                      strlen("cpus")))) {
+-                              char *cpu_ban_string = malloc(
+-                                              sizeof(char) * (recv_size - strlen("settings cpus ")));
+-                              strncpy(cpu_ban_string, buff + strlen("settings cpus "),
+-                                              recv_size - strlen("settings cpus "));
+-                              banned_cpumask_from_ui = strtok(cpu_ban_string, " ");
+-                              if (!strncmp(banned_cpumask_from_ui, "NULL", strlen("NULL"))) {
+-                                      banned_cpumask_from_ui = NULL;
+-                              }
+-                              need_rescan = 1;
+-                      }
+-              }
+-              if (!strncmp(buff, "setup", strlen("setup"))) {
+-                      char setup[2048] = "\0";
+-                      snprintf(setup, 2048, "SLEEP %d ", sleep_interval);
+-                      if(g_list_length(cl_banned_irqs) > 0) {
+-                              for_each_irq(cl_banned_irqs, get_irq_data, setup);
+-                      }
+-                      char banned[512];
+-                      cpumask_scnprintf(banned, 512, banned_cpus);
+-                      snprintf(setup + strlen(setup), 2048 - strlen(setup),
+-                                      "BANNED %s", banned);
+-                      send(sock, setup, strlen(setup), 0);
+-              }
+-
+-              close(sock);
+-      }
+-      return TRUE;
+-}
+-
+-int init_socket(char *socket_name)
+-{
+-      struct sockaddr_un addr;
+-      memset(&addr, 0, sizeof(struct sockaddr_un));
+-
+-      socket_fd = socket(AF_LOCAL, SOCK_STREAM, 0);
+-      if (socket_fd < 0) {
+-              log(TO_ALL, LOG_WARNING, "Socket couldn't be created.\n");
+-              return 1;
+-      }
+-
+-      addr.sun_family = AF_UNIX;
+-      addr.sun_path[0] = '\0';
+-      strncpy(addr.sun_path + 1, socket_name, strlen(socket_name));
+-      if (bind(socket_fd, (struct sockaddr *)&addr,
+-                              sizeof(sa_family_t) + strlen(socket_name) + 1) < 0) {
+-              log(TO_ALL, LOG_WARNING, "Daemon couldn't be bound to the socket.\n");
+-              return 1;
+-      }
+-      int optval = 1;
+-      if (setsockopt(socket_fd, SOL_SOCKET, SO_PASSCRED, &optval, sizeof(optval)) < 0) {
+-              log(TO_ALL, LOG_WARNING, "Unable to set socket options.\n");
+-              return 1;
+-      }
+-      listen(socket_fd, 1);
+-      g_unix_fd_add(socket_fd, G_IO_IN, sock_handle, NULL);
+-      return 0;
+ }
+ int main(int argc, char** argv)
+ {
++      struct sigaction action, hupaction;
+       sigset_t sigset, old_sigset;
+       sigemptyset(&sigset);
+@@ -553,11 +345,19 @@ int main(int argc, char** argv)
+               }
+       }
+-      g_unix_signal_add(SIGINT, handler, NULL);
+-      g_unix_signal_add(SIGTERM, handler, NULL);
+-      g_unix_signal_add(SIGUSR1, handler, NULL);
+-      g_unix_signal_add(SIGUSR2, handler, NULL);
+-      g_unix_signal_add(SIGHUP, force_rescan, NULL);
++      action.sa_handler = handler;
++      sigemptyset(&action.sa_mask);
++      action.sa_flags = 0;
++      sigaction(SIGINT, &action, NULL);
++      sigaction(SIGTERM, &action, NULL);
++      sigaction(SIGUSR1, &action, NULL);
++      sigaction(SIGUSR2, &action, NULL);
++
++      hupaction.sa_handler = force_rescan;
++      sigemptyset(&hupaction.sa_mask);
++      hupaction.sa_flags = 0;
++      sigaction(SIGHUP, &hupaction, NULL);
++
+       sigprocmask(SIG_SETMASK, &old_sigset, NULL);
+ #ifdef HAVE_LIBCAP_NG
+@@ -566,32 +366,58 @@ int main(int argc, char** argv)
+       capng_lock();
+       capng_apply(CAPNG_SELECT_BOTH);
+ #endif
++
+       for_each_irq(NULL, force_rebalance_irq, NULL);
+       parse_proc_interrupts();
+       parse_proc_stat();
+-      char socket_name[64];
+-      snprintf(socket_name, 64, "%s%d.sock", SOCKET_PATH, getpid());
++      while (keep_going) {
++              sleep_approx(sleep_interval);
++              log(TO_CONSOLE, LOG_INFO, "\n\n\n-----------------------------------------------------------------------------\n");
+-      if (init_socket(socket_name)) {
+-              return EXIT_FAILURE;
+-      }
+-      main_loop = g_main_loop_new(NULL, FALSE);
+-      int *last_interval = &sleep_interval;
+-      g_timeout_add_seconds(sleep_interval, scan, last_interval);
+-      g_main_loop_run(main_loop);
+-      g_main_loop_quit(main_loop);
++              clear_work_stats();
++              parse_proc_interrupts();
++              parse_proc_stat();
++
++              /* cope with cpu hotplug -- detected during /proc/interrupts parsing */
++              if (need_rescan) {
++                      need_rescan = 0;
++                      cycle_count = 0;
++                      log(TO_CONSOLE, LOG_INFO, "Rescanning cpu topology \n");
++                      clear_work_stats();
++
++                      free_object_tree();
++                      build_object_tree();
++                      for_each_irq(NULL, force_rebalance_irq, NULL);
++                      parse_proc_interrupts();
++                      parse_proc_stat();
++                      sleep_approx(sleep_interval);
++                      clear_work_stats();
++                      parse_proc_interrupts();
++                      parse_proc_stat();
++              } 
++
++              if (cycle_count)        
++                      update_migration_status();
++
++              calculate_placement();
++              activate_mappings();
+       
++              if (debug_mode)
++                      dump_tree();
++              if (one_shot_mode)
++                      keep_going = 0;
++              cycle_count++;
++
++      }
+       free_object_tree();
+       free_cl_opts();
+       /* Remove pidfile */
+       if (!foreground_mode && pidfile)
+               unlink(pidfile);
+-      /* Remove socket */
+-      close(socket_fd);
+       return EXIT_SUCCESS;
+ }
+--- a/cputree.c
++++ b/cputree.c
+@@ -38,7 +38,6 @@
+ #include "irqbalance.h"
+-extern char *banned_cpumask_from_ui;
+ GList *cpus;
+ GList *cache_domains;
+@@ -77,15 +76,11 @@ static void setup_banned_cpus(void)
+       cpus_clear(nohz_full);
+       /* A manually specified cpumask overrides auto-detection. */
+-      if (banned_cpumask_from_ui != NULL) {
+-              cpulist_parse(banned_cpumask_from_ui,
+-                      strlen(banned_cpumask_from_ui), banned_cpus);
+-              goto out;
+-      }
+       if (getenv("IRQBALANCE_BANNED_CPUS"))  {
+               cpumask_parse_user(getenv("IRQBALANCE_BANNED_CPUS"), strlen(getenv("IRQBALANCE_BANNED_CPUS")), banned_cpus);
+               goto out;
+       }
++
+       file = fopen("/sys/devices/system/cpu/isolated", "r");
+       if (file) {
+               if (getline(&line, &size, file) > 0) {
+@@ -117,8 +112,6 @@ out:
+       log(TO_CONSOLE, LOG_INFO, "Isolated CPUs: %s\n", buffer);
+       cpumask_scnprintf(buffer, 4096, nohz_full);
+       log(TO_CONSOLE, LOG_INFO, "Adaptive-ticks CPUs: %s\n", buffer);
+-      cpumask_scnprintf(buffer, 4096, banned_cpus);
+-      log(TO_CONSOLE, LOG_INFO, "Banned CPUs: %s\n", buffer);
+ }
+ static struct topo_obj* add_cache_domain_to_package(struct topo_obj *cache, 
index eec96c08545e181fa11d31348019b4a78b7bea98..98c8c65c4058217816fb575923733ae3d93fb322 100644 (file)
@@ -7,24 +7,26 @@ STOP=10
 SERVICE_DAEMONIZE=1
 SERVICE_WRITE_PID=1
 SERVICE_STOP_TIME=9
-
-error() {
-       echo "${initscript}:" "$@" 1>&2
-}
+PROG='/usr/bin/mysqld'
 
 start() {
-       local datadir=$(sed -n -e "s/^[[:space:]]*datadir[[:space:]]*=[[:space:]\"']*\([^[:space:]\"']*\)[[:space:]\"']*/\1/p" /etc/my.cnf)
-       if [ ! -d "$datadir" ]; then
-               error "Error: datadir '$datadir' in /etc/my.cnf doesn't exist"
+       local conf='/etc/my.cnf'
+       local datadir="$( sed -nE "s/^\s*datadir\s*=\s*('([^']*)'|\x22([^\x22]*)\x22|(.*\S))\s*$/\2\3\4/p" "$conf" )"
+
+       [ -d "$datadir" ] || {
+               logger -s "[ERROR] datadir '$datadir' in '$conf' does not exist"
                return 1
-       fi
-       if [ ! -f "$datadir/mysql/tables_priv.MYD" ]; then
-               error "Error: I didn't detect a privileges table, you might need to run mysql_install_db --force to initialize the system tables"
+       }
+
+       [ -f "$datadir/mysql/tables_priv.MYD" ] || {
+               logger -s "[ERROR] can not detect privileges table, you might need to"
+               logger -s "run 'mysql_install_db --force' to initialize the system tables"
                return 1
-       fi
-       service_start /usr/bin/mysqld
+       }
+
+       service_start "$PROG"
 }
 
 stop() {
-       service_stop /usr/bin/mysqld
+       service_stop "$PROG"
 }
index 10d86b0f5c800fa4513c0dabc343c3fd29194cf3..db285504f8a33caeed9441c8c5fc37f05b7e0a05 100644 (file)
@@ -8,14 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nano
-PKG_VERSION:=2.7.1
+PKG_VERSION:=2.7.5
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-3.0+
 PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/nano
-PKG_MD5SUM:=df5cbe69831d7394c0a32fb27373ab313335ea4dc586d6f4be4081eb1de857cd
+PKG_MD5SUM:=002703e368e07882f75e304c8860d83d
+PKG_HASH:=a64d24e6bc4fc448376d038f9a755af77f8e748c9051b6f45bf85e783a7e67e4
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
index 0cb49dbf02f33e8e636da3b99c9e8c8047e200b7..243d8e9f328936407a6963b9c583fecaaf977dcc 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=open-plc-utils
-PKG_VERSION:=2015-09-21
+PKG_VERSION:=2017-01-15
 PKG_RELEASE:=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/qca/open-plc-utils.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=885a1b7e2e663b5ab8797db6d40a0318131fdf18
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE_VERSION:=18b7e2a9a17f043fe8ac8b457680aafb1c249c55
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
 
 PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
 
@@ -75,10 +75,6 @@ OPEN_PLC_UTILS_APPS:=efbu efeu efru efsu edru edsu nics \
 
 $(foreach a,$(OPEN_PLC_UTILS_APPS),$(eval $(call GenPlugin,$(a))))
 
-ifdef CONFIG_USE_MUSL
-  TARGET_CFLAGS += -D__UCLIBC__
-endif
-
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
                EXTRA_CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
diff --git a/utils/open-plc-utils/patches/100-musl-compat.patch b/utils/open-plc-utils/patches/100-musl-compat.patch
deleted file mode 100644 (file)
index c20c0a1..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
---- a/ether/readpacket.c
-+++ b/ether/readpacket.c
-@@ -70,6 +70,10 @@
- #include <memory.h>
- #include <errno.h>
-+#if defined (__linux__)
-+#include <poll.h>
-+#endif
-+
- #include "../ether/channel.h"
- #include "../tools/memory.h"
- #include "../tools/error.h"
-@@ -95,8 +99,6 @@ ssize_t readpacket (struct channel const
- #elif defined (__linux__)
--#include <sys/poll.h>
--
-       struct pollfd pollfd =
-       {
-               channel->fd,
---- a/serial/serial.c
-+++ b/serial/serial.c
-@@ -69,6 +69,8 @@
- #if defined (WIN32)
- #include <Windows.h>
-+#else
-+#include <sys/select.h>
- #endif
- /*====================================================================*
index e8d6d9d10453f9363e45be92d779b152c9a62ee3..dc96467c55fd83e48a8793ecfcfd439fdc074fca 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pcsc-lite
-PKG_VERSION:=1.8.18
+PKG_VERSION:=1.8.20
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4179
-PKG_MD5SUM:=b22d32b018f6a1016adba91abfcc63876cca999daa472dd86e953ddd41d00905
+PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4203
+PKG_MD5SUM:=ec7d0114016c788c1c09859c84860f6cec6c4595436d23245105154b9c046bb2
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=COPYING
index 5990f38a205cac42a94fd7418abfc76b6d8b8eb9..76c1c4fe514d7893c6dd602702857e65336732ff 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=qemu
 PKG_VERSION:=2.6.2
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://wiki.qemu-project.org/download/
 PKG_SOURCE_MD5SUM:=bdf1f3d0c177ebeb35a079a4bc3fc74e
@@ -25,10 +25,15 @@ include $(INCLUDE_DIR)/uclibc++.mk
 include $(INCLUDE_DIR)/package.mk
 
 
+QEMU_DEPS_IN_GUEST := @(TARGET_x86_64||TARGET_armvirt||TARGET_arm64||TARGET_malta)
+QEMU_DEPS_IN_HOST := @(TARGET_x86_64||TARGET_sunxi)
+
 define Package/virtio-console-helper
   SECTION:=utils
   CATEGORY:=Utilities
+  SUBMENU:=Virtualization
   TITLE:=Helper script for vportNpn virtio-console devices
+  DEPENDS:=$(QEMU_DEPS_IN_GUEST)
 endef
 
 define Package/virtio-console-helper/install
@@ -40,9 +45,10 @@ endef
 define Package/qemu-ga
   SECTION:=utils
   CATEGORY:=Utilities
+  SUBMENU:=Virtualization
   TITLE:=QEMU Guest Agent
   URL:=http://www.qemu.org
-  DEPENDS:= +glib2 +virtio-console-helper $(CXX_DEPENDS)
+  DEPENDS:= +glib2 +virtio-console-helper $(CXX_DEPENDS) $(QEMU_DEPS_IN_GUEST)
 endef
 
 define Package/qemu-ga/description
@@ -62,9 +68,10 @@ endef
 define Package/qemu-blobs
   SECTION:=utils
   CATEGORY:=Utilities
+  SUBMENU:=Virtualization
   TITLE:=QEMU blobs of BIOS, VGA BIOS and keymaps
   URL:=http://www.qemu.org
-  DEPENDS:=
+  DEPENDS:=$(QEMU_DEPS_IN_HOST)
 endef
 
 define Package/qemu-blobs/install
@@ -75,9 +82,10 @@ endef
 define Package/qemu-bridge-helper
   SECTION:=utils
   CATEGORY:=Utilities
+  SUBMENU:=Virtualization
   TITLE:=QEMU bridge helper
   URL:=http://www.qemu.org
-  DEPENDS:=+glib2 $(CXX_DEPENDS)
+  DEPENDS:=+glib2 $(CXX_DEPENDS) $(QEMU_DEPS_IN_HOST)
 endef
 
 define Package/qemu-bridge-helper/install
@@ -111,11 +119,11 @@ define qemu-target
   define Package/qemu-$(1)
     SECTION:=utils
     CATEGORY:=Utilities
+    SUBMENU:=Virtualization
     TITLE:=QEMU target $(1)
     URL:=http://www.qemu.org
-    DEPENDS:= +glib2 +libpthread +zlib $(CXX_DEPENDS) \
-       $(if $(filter %-softmmu,$(1)),+libncurses +libfdt +qemu-blobs) \
-       @(TARGET_x86_64||TARGET_sunxi)
+    DEPENDS:= +glib2 +libpthread +zlib $(CXX_DEPENDS) $(QEMU_DEPS_IN_HOST) \
+       $(if $(filter %-softmmu,$(1)),+libncurses +libfdt +qemu-blobs)
   endef
 
   define Package/qemu-$(1)/description
index c9cead3bc8fc730fc4e88b3c69e6f45ae4f2155b..bb560c8b19c8b0aabc4ac5412e5c73cd58c07425 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2011-2014 OpenWrt.org
 
-START=98
+START=25
 
 USE_PROCD=1
 PROG=/sbin/rngd
index 96a64215be438b83db487b4af954eef7d555515b..45befbf3a8efa1e1845b845bae6f7eeaa85bfbbd 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tar
 PKG_VERSION:=1.29
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
@@ -21,7 +21,7 @@ PKG_LICENSE_FILES:=COPYING
 
 PKG_INSTALL:=1
 
-BUILD_DEPENDS:=xz
+PKG_BUILD_DEPENDS:=xz
 
 include $(INCLUDE_DIR)/package.mk
 
diff --git a/utils/tar/patches/001-CVE-2016-6321.patch b/utils/tar/patches/001-CVE-2016-6321.patch
new file mode 100644 (file)
index 0000000..0783473
--- /dev/null
@@ -0,0 +1,30 @@
+From 7340f67b9860ea0531c1450e5aa261c50f67165d Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@Penguin.CS.UCLA.EDU>
+Date: Sat, 29 Oct 2016 21:04:40 -0700
+Subject: When extracting, skip ".." members
+
+* src/extract.c (extract_archive): Skip members whose names
+contain "..".
+--- a/src/extract.c
++++ b/src/extract.c
+@@ -1629,12 +1629,20 @@ extract_archive (void)
+ {
+   char typeflag;
+   tar_extractor_t fun;
++  bool skip_dotdot_name;
+   fatal_exit_hook = extract_finish;
+   set_next_block_after (current_header);
++  skip_dotdot_name = (!absolute_names_option
++                    && contains_dot_dot (current_stat_info.orig_file_name));
++  if (skip_dotdot_name)
++    ERROR ((0, 0, _("%s: Member name contains '..'"),
++          quotearg_colon (current_stat_info.orig_file_name)));
++
+   if (!current_stat_info.file_name[0]
++      || skip_dotdot_name
+       || (interactive_option
+         && !confirm ("extract", current_stat_info.file_name)))
+     {
index a66db4bf5b8bb8947bb08122ada5600918fce349..593a9c02fbac51387fcbca0bef3a9ab124f61004 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tmux
-PKG_VERSION:=2.2
+PKG_VERSION:=2.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/tmux/tmux/releases/download/$(PKG_VERSION)
-PKG_MD5SUM:=bd95ee7205e489c62c616bb7af040099
+PKG_MD5SUM:=55313e132f0f42de7e020bf6323a1939ee02ab79c48634aa07475db41573852b
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
 
 PKG_LICENSE:=ISC
index a0d0d14ab5c71159d82b33b1969e067fe6c77a50..93a4dcffcb382bdaec3eb36eb643e58e0f9bc663 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2015 OpenWrt.org
+# Copyright (C) 2006-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=unzip
 PKG_REV:=60
 PKG_VERSION:=6.0
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)$(PKG_REV).tar.gz
 PKG_SOURCE_URL:=@SF/infozip
diff --git a/utils/unzip/patches/008-cve-2014-9913-unzip-buffer-overflow.patch b/utils/unzip/patches/008-cve-2014-9913-unzip-buffer-overflow.patch
new file mode 100644 (file)
index 0000000..018d014
--- /dev/null
@@ -0,0 +1,29 @@
+From: "Steven M. Schweda" <sms@antinode.info>
+Subject: Fix CVE-2014-9913, buffer overflow in unzip
+Bug: https://sourceforge.net/p/infozip/bugs/27/
+Bug-Debian: https://bugs.debian.org/847485
+Bug-Ubuntu: https://launchpad.net/bugs/387350
+X-Debian-version: 6.0-21
+
+--- a/list.c
++++ b/list.c
+@@ -339,7 +339,18 @@ int list_files(__G)    /* return PK-type
+                 G.crec.compression_method == ENHDEFLATED) {
+                 methbuf[5] = dtype[(G.crec.general_purpose_bit_flag>>1) & 3];
+             } else if (methnum >= NUM_METHODS) {
+-                sprintf(&methbuf[4], "%03u", G.crec.compression_method);
++                /* 2013-02-26 SMS.
++                 * http://sourceforge.net/p/infozip/bugs/27/  CVE-2014-9913.
++                 * Unexpectedly large compression methods overflow
++                 * &methbuf[].  Use the old, three-digit decimal format
++                 * for values which fit.  Otherwise, sacrifice the
++                 * colon, and use four-digit hexadecimal.
++                 */
++                if (G.crec.compression_method <= 999) {
++                    sprintf( &methbuf[ 4], "%03u", G.crec.compression_method);
++                } else {
++                    sprintf( &methbuf[ 3], "%04X", G.crec.compression_method);
++                }
+             }
+ #if 0       /* GRR/Euro:  add this? */
diff --git a/utils/unzip/patches/009-cve-2016-9844-zipinfo-buffer-overflow.patch b/utils/unzip/patches/009-cve-2016-9844-zipinfo-buffer-overflow.patch
new file mode 100644 (file)
index 0000000..4d75857
--- /dev/null
@@ -0,0 +1,28 @@
+From: "Steven M. Schweda" <sms@antinode.info>
+Subject: Fix CVE-2016-9844, buffer overflow in zipinfo
+Bug-Debian: https://bugs.debian.org/847486
+Bug-Ubuntu: https://launchpad.net/bugs/1643750
+X-Debian-version: 6.0-21
+
+--- a/zipinfo.c
++++ b/zipinfo.c
+@@ -1921,7 +1921,18 @@ static int zi_short(__G)   /* return PK-
+         ush  dnum=(ush)((G.crec.general_purpose_bit_flag>>1) & 3);
+         methbuf[3] = dtype[dnum];
+     } else if (methnum >= NUM_METHODS) {   /* unknown */
+-        sprintf(&methbuf[1], "%03u", G.crec.compression_method);
++        /* 2016-12-05 SMS.
++         * https://launchpad.net/bugs/1643750
++         * Unexpectedly large compression methods overflow
++         * &methbuf[].  Use the old, three-digit decimal format
++         * for values which fit.  Otherwise, sacrifice the "u",
++         * and use four-digit hexadecimal.
++         */
++        if (G.crec.compression_method <= 999) {
++            sprintf( &methbuf[ 1], "%03u", G.crec.compression_method);
++        } else {
++            sprintf( &methbuf[ 0], "%04X", G.crec.compression_method);
++        }
+     }
+     for (k = 0;  k < 15;  ++k)
index 4f738bbf3bb8e61c430763917a2c1e20691d7311..c3536c2439ab6b9442f61612a577a3b74a40a0b6 100644 (file)
@@ -1,5 +1,6 @@
 #
 # Copyright (C) 2013-2015 OpenWrt.org
+# Copyright (C) 2017 Daniel Engberg <daniel.engberg.lists@pyret.net>
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,13 +9,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=xz
-PKG_VERSION:=5.2.2
+PKG_VERSION:=5.2.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://tukaani.org/xz \
-               http://fossies.org/linux/misc
-PKG_MD5SUM:=f90c9a0c8b259aee2234c4e0d7fd70af
+PKG_SOURCE_URL:=@SF/lzmautils \
+               http://tukaani.org/xz
+PKG_MD5SUM:=fd9ca16de1052aac899ad3495ad20dfa906c27b4a5070102a2ec35ca3a4740c1
 
 PKG_LICENSE:=Public-Domain LGPL-2.1+ GPL-2.0+ GPL-3.0+
 PKG_LICENSE_FILES:=COPYING
index e1ed0687dee5c2bf3cec20c8885a9b431db54a95..6427dda926844f58c59a6ecee9fa1b6579b86c20 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=zip
 PKG_REV:=30
 PKG_VERSION:=3.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)$(PKG_REV).tar.gz
 PKG_SOURCE_URL:=@SF/infozip
diff --git a/utils/zip/patches/001-unix-configure-borrow-the-LFS-test-from-autotools.patch b/utils/zip/patches/001-unix-configure-borrow-the-LFS-test-from-autotools.patch
new file mode 100644 (file)
index 0000000..892540b
--- /dev/null
@@ -0,0 +1,90 @@
+From fc392c939b9a18959482f588aff0afc29dd6d30a Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour at openwide.fr>
+Date: Fri, 23 Jan 2015 22:20:18 +0100
+Subject: [PATCH 6/6] unix/configure: borrow the LFS test from autotools.
+
+Infozip's LFS check can't work for cross-compilation
+since it try to run a target's binary on the host system.
+
+Instead, use to LFS test used by autotools which is a
+compilation test.
+(see autotools/lib/autoconf/specific.m4)
+
+Reported-by: Richard Genoud <richard.genoud at gmail.com>
+Signed-off-by: Romain Naour <romain.naour at openwide.fr>
+---
+ configure |   46 +++++++++++++++-------------------------------
+ 1 file changed, 15 insertions(+), 31 deletions(-)
+
+diff --rupN a/unix/configure b/unix/configure
+--- a/unix/configure
++++ b/unix/configure
+@@ -399,9 +399,8 @@ else
+ fi
+-# Now we set the 64-bit file environment and check the size of off_t
+-# Added 11/4/2003 EG
+-# Revised 8/12/2004 EG
++# LFS check borrowed from autotools sources
++# lib/autoconf/specific.m4
+ echo Check for Large File Support
+ cat > conftest.c << _EOF_
+@@ -410,23 +409,19 @@ cat > conftest.c << _EOF_
+ # define _FILE_OFFSET_BITS 64       /* select default interface as 64 bit */
+ # define _LARGE_FILES        /* some OSes need this for 64-bit off_t */
+ #include <sys/types.h>
+-#include <sys/stat.h>
+-#include <unistd.h>
+-#include <stdio.h>
++
++ /* Check that off_t can represent 2**63 - 1 correctly.
++    We can't simply define LARGE_OFF_T to be 9223372036854775807,
++    since some C++ compilers masquerading as C compilers
++    incorrectly reject 9223372036854775807.  */
++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
++  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
++                     && LARGE_OFF_T % 2147483647 == 1)
++                    ? 1 : -1];
++
+ int main()
+ {
+-  off_t offset;
+-  struct stat s;
+-  /* see if have 64-bit off_t */
+-  if (sizeof(offset) < 8)
+-    return 1;
+-  printf("  off_t is %d bytes\n", sizeof(off_t));
+-  /* see if have 64-bit stat */
+-  if (sizeof(s.st_size) < 8) {
+-    printf("  s.st_size is %d bytes\n", sizeof(s.st_size));
+-    return 2;
+-  }
+-  return 3;
++  return 0;
+ }
+ _EOF_
+ # compile it
+@@ -434,19 +429,8 @@ $CC -o conftest conftest.c >/dev/null 2>
+ if [ $? -ne 0 ]; then
+   echo -- no Large File Support
+ else
+-# run it
+-  ./conftest
+-  r=$?
+-  if [ $r -eq 1 ]; then
+-    echo -- no Large File Support - no 64-bit off_t
+-  elif [ $r -eq 2 ]; then
+-    echo -- no Large File Support - no 64-bit stat
+-  elif [ $r -eq 3 ]; then
+-    echo -- yes we have Large File Support!
+-    CFLAGS="${CFLAGS} -DLARGE_FILE_SUPPORT"
+-  else
+-    echo -- no Large File Support - conftest returned $r
+-  fi
++  echo -- yes we have Large File Support!
++  CFLAGS="${CFLAGS} -DLARGE_FILE_SUPPORT"
+ fi